'; if ( !isset( $_REQUEST['action'] ) ) { $url = add_query_arg( array( 'section' => 'general' ), admin_url( 'admin.php?page=affiliates-admin-settings' ) ); } else { $url = add_query_arg( array( 'section' => 'general', 'subsection' => 'robot-cleaner' ), admin_url( 'admin.php?page=affiliates-admin-settings' ) ); } printf( '%s', esc_url( $url ), esc_html__( 'Back', 'affiliates' ) ); echo '
'; return; } $robots_table = _affiliates_get_tablename( 'robots' ); if ( isset( $_POST['submit'] ) ) { if ( wp_verify_nonce( $_POST[AFFILIATES_ADMIN_SETTINGS_NONCE], 'admin' ) ) { // robots $robots = wp_filter_nohtml_kses( trim ( $_POST['robots'] ) ); $wpdb->query( "DELETE FROM $robots_table" ); if ( !empty( $robots ) ) { $robots = str_replace( ",", "\n", $robots ); $robots = str_replace( "\r", "", $robots ); $robots = explode( "\n", $robots ); foreach ( $robots as $robot ) { $robot = trim( $robot ); if (!empty($robot)) { $query = $wpdb->prepare( "INSERT INTO $robots_table (name) VALUES (%s);", $robot ); $wpdb->query( $query ); } } } $pname = !empty( $_POST['pname'] ) ? trim( $_POST['pname'] ) : get_option( 'aff_pname', AFFILIATES_PNAME ); $forbidden_names = array(); if ( !empty( $wp->public_query_vars ) ) { $forbidden_names += $wp->public_query_vars; } if ( !empty( $wp->private_query_vars ) ) { $forbidden_names += $wp->private_query_vars; } if ( !empty( $wp->extra_query_vars ) ) { $forbidden_names += $wp->extra_query_vars; } if ( !preg_match( '/[a-z_]+/', $pname, $matches ) || !isset( $matches[0] ) || $pname !== $matches[0] ) { $pname = get_option( 'aff_pname', AFFILIATES_PNAME ); echo '' . sprintf( __( 'The Affiliate URL parameter name has been changed from %s to %s.', 'affiliates' ), $old_pname, $pname ) . '
' . '' . __( 'If your affiliates are using affiliate links based on the previous Affiliate URL parameter name, they NEED to update their affiliate links.', 'affiliates' ) . '
' . '' . __( 'Unless the incoming affiliate links reflect the current Affiliate URL parameter name, no affiliate hits, visits or referrals will be recorded.', 'affiliates' ) . '
' . '| '; $caps_table .= __( 'Role', 'affiliates' ); $caps_table .= ' | '; foreach ( $caps as $cap ) { $caps_table .= ''; $caps_table .= $cap; $caps_table .= ' | '; } $caps_table .= '
| '; $caps_table .= translate_user_role( $rolename ); $caps_table .= ' | '; foreach ( $caps as $capkey => $capname ) { if ( $role->has_cap( $capkey ) ) { $checked = ' checked="checked" '; } else { $checked = ''; } $caps_table .= ''; $role_cap_id = $rolekey.'-'.$capkey; $caps_table .= ''; $caps_table .= ' | '; } $caps_table .= '