diff --git a/includes/Classifai/Admin/SimilarTermsListTable.php b/includes/Classifai/Admin/SimilarTermsListTable.php index c5cdff648..57c74eccb 100644 --- a/includes/Classifai/Admin/SimilarTermsListTable.php +++ b/includes/Classifai/Admin/SimilarTermsListTable.php @@ -69,7 +69,7 @@ public function prepare_items() { $columns = $this->get_columns(); $hidden = array(); $sortable = $this->get_sortable_columns(); - $search = isset( $_REQUEST['s'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['s'] ) ) : ''; + $search = isset( $_REQUEST['s'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['s'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended $this->_column_headers = array( $columns, $hidden, $sortable ); @@ -91,8 +91,8 @@ public function prepare_items() { ) ); - $current = $this->get_pagenum(); - $offset = ( $current - 1 ) * $per_page; + $current = $this->get_pagenum(); + $offset = ( $current - 1 ) * $per_page; $terms = get_terms( [ @@ -154,8 +154,8 @@ public function generate_term_html( $term, $similar_term, $score = null ) { 'taxonomy' => $this->taxonomy, 'from' => $similar_term->term_id, 'to' => $term->term_id, - 'paged' => $this->get_pagenum(), - 's' => isset( $_REQUEST['s'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['s'] ) ) : false, + 'paged' => $this->get_pagenum(), + 's' => isset( $_REQUEST['s'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['s'] ) ) : false, // phpcs:ignore WordPress.Security.NonceVerification.Recommended ); $merge_url = add_query_arg( $args, wp_nonce_url( admin_url( 'admin-post.php' ), 'classifai_merge_term' ) ); $score = $score ? ( $score > 1 ? $score - 1 : $score ) : ''; @@ -175,7 +175,8 @@ public function generate_term_html( $term, $similar_term, $score = null ) { esc_html( $term->name ), '' . esc_html( $term->term_id ) . '', esc_html( $term->slug ), - '' . esc_html( sprintf( _n( '%d time', '%d times', $term->count, 'classifai' ), $term->count ) ) . '', + // translators: %d: Term count. + '' . esc_html( sprintf( _n( '%d time', '%d times', $term->count, 'classifai' ), $term->count ) ) . '', esc_html( $term->parent > 0 ? get_term( $term->parent )->name : 'None' ), $score ? esc_html( round( $score * 100, 2 ) . '%' ) : '', esc_url( $merge_url ), @@ -223,7 +224,7 @@ public function column_actions( $item ) { 'term' => $term->term_id, 'similar_term' => $similar_term->term_id, 'paged' => $this->get_pagenum(), - 's' => isset( $_REQUEST['s'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['s'] ) ) : false, + 's' => isset( $_REQUEST['s'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['s'] ) ) : false, // phpcs:ignore WordPress.Security.NonceVerification.Recommended ); $skip_url = add_query_arg( $args, wp_nonce_url( admin_url( 'admin-post.php' ), 'classifai_skip_similar_term' ) );