diff --git a/core/Requirement/Prohibited_categories.php b/core/Requirement/Prohibited_categories.php index c99f5cf9..a08fae67 100644 --- a/core/Requirement/Prohibited_categories.php +++ b/core/Requirement/Prohibited_categories.php @@ -193,12 +193,15 @@ private function get_list_categories($args = array('page' => 1, 'per_page' => 10 */ private function get_total_count($args = array('search' => '', 'hide_empty' => 0)) { - $args_key = base64_encode($args['search']); + $args_key = hash('sha256', (string) $args['search']); $cache_key = 'total_prohib_category_count_' . $args_key; $total_categories = get_transient($cache_key); if ($total_categories === false) { - $total_categories = wp_count_terms('category', $args); + // get_terms() with 'fields' => 'count' works the same from WP 5.5 to current, + // unlike the two wp_count_terms() signatures. + $total_categories = get_terms(array_merge($args, ['taxonomy' => 'category', 'fields' => 'count'])); + $total_categories = is_wp_error($total_categories) ? 0 : (int) $total_categories; set_transient($cache_key, $total_categories, $this->cache_expiration); } diff --git a/core/Requirement/Prohibited_tags.php b/core/Requirement/Prohibited_tags.php index ebfc58b1..fdb3c8ba 100644 --- a/core/Requirement/Prohibited_tags.php +++ b/core/Requirement/Prohibited_tags.php @@ -199,12 +199,15 @@ private function get_list_tags($args = array('page' => 1, 'per_page' => 10, 'q' */ private function get_total_count($args = array('search' => '', 'hide_empty' => 0)) { - $args_key = base64_encode($args['search']); + $args_key = hash('sha256', (string) $args['search']); $cache_key = 'total_prohib_tag_count_' . $args_key; $total_tags = get_transient($cache_key); if ($total_tags === false) { - $total_tags = wp_count_terms('post_tag', $args); + // get_terms() with 'fields' => 'count' works the same from WP 5.5 to current, + // unlike the two wp_count_terms() signatures. + $total_tags = get_terms(array_merge($args, ['taxonomy' => 'post_tag', 'fields' => 'count'])); + $total_tags = is_wp_error($total_tags) ? 0 : (int) $total_tags; set_transient($cache_key, $total_tags, $this->cache_expiration); } diff --git a/core/Requirement/Required_categories.php b/core/Requirement/Required_categories.php index 6042d8b1..cde9b496 100644 --- a/core/Requirement/Required_categories.php +++ b/core/Requirement/Required_categories.php @@ -194,12 +194,15 @@ private function get_list_categories($args = array('page' => 1, 'per_page' => 10 */ private function get_total_count($args = array('search' => '', 'hide_empty' => 0)) { - $args_key = base64_encode($args['search']); + $args_key = hash('sha256', (string) $args['search']); $cache_key = 'total_require_category_count_' . $args_key; $total_categories = get_transient($cache_key); if ($total_categories === false) { - $total_categories = wp_count_terms('category', $args); + // get_terms() with 'fields' => 'count' works the same from WP 5.5 to current, + // unlike the two wp_count_terms() signatures. + $total_categories = get_terms(array_merge($args, ['taxonomy' => 'category', 'fields' => 'count'])); + $total_categories = is_wp_error($total_categories) ? 0 : (int) $total_categories; set_transient($cache_key, $total_categories, $this->cache_expiration); } diff --git a/core/Requirement/Required_tags.php b/core/Requirement/Required_tags.php index 697192a9..68a2ec9b 100644 --- a/core/Requirement/Required_tags.php +++ b/core/Requirement/Required_tags.php @@ -199,12 +199,15 @@ private function get_list_tags($args = array('page' => 1, 'per_page' => 10, 'q' */ private function get_total_count($args = array('search' => '', 'hide_empty' => 0)) { - $args_key = base64_encode($args['search']); + $args_key = hash('sha256', (string) $args['search']); $cache_key = 'total_required_tag_count_' . $args_key; $total_tags = get_transient($cache_key); if ($total_tags === false) { - $total_tags = wp_count_terms('post_tag', $args); + // get_terms() with 'fields' => 'count' works the same from WP 5.5 to current, + // unlike the two wp_count_terms() signatures. + $total_tags = get_terms(array_merge($args, ['taxonomy' => 'post_tag', 'fields' => 'count'])); + $total_tags = is_wp_error($total_tags) ? 0 : (int) $total_tags; set_transient($cache_key, $total_tags, $this->cache_expiration); } diff --git a/modules/checklists/checklists.php b/modules/checklists/checklists.php index ad697390..a2693eb0 100644 --- a/modules/checklists/checklists.php +++ b/modules/checklists/checklists.php @@ -1662,7 +1662,7 @@ public function redirect_on_activate() { if (get_option('ppch_activated')) { delete_option('ppch_activated'); - wp_redirect(admin_url("admin.php?page=ppch-checklists")); + wp_safe_redirect(admin_url("admin.php?page=ppch-checklists")); exit; } } diff --git a/modules/checklists/templates/global-checklists.php b/modules/checklists/templates/global-checklists.php index 888673ff..a048ca45 100644 --- a/modules/checklists/templates/global-checklists.php +++ b/modules/checklists/templates/global-checklists.php @@ -24,6 +24,31 @@
[ + 'aria-hidden' => true, + 'class' => true, + 'focusable' => true, + 'height' => true, + 'role' => true, + 'version' => true, + 'viewbox' => true, + 'width' => true, + 'xmlns' => true, + ], + 'g' => [ + 'clip-rule' => true, + 'fill' => true, + 'fill-rule' => true, + ], + 'path' => [ + 'clip-rule' => true, + 'd' => true, + 'fill' => true, + 'fill-rule' => true, + ], + ]; + /** * Render field tabs */ @@ -59,7 +84,7 @@ data-post-type="" href="#"> - + 0) : ?> @@ -98,10 +123,10 @@ $tabInfo) : - foreach ($context['requirements'] as $post_type => $post_type_requirements) : ?> + foreach ($context['requirements'] as $requirements_post_type => $post_type_requirements) : ?> group === $group) : @@ -117,7 +142,7 @@ class="pp-checklists-requirement-row ppch-group); ?>-group " style="display: none;" data-id="name); ?>" - data-post-type=""> + data-post-type=""> grou * * @return string */ - do_action('publishpress_checklists_tasks_list_td', $requirement, $post_type); + do_action('publishpress_checklists_tasks_list_td', $requirement, $requirements_post_type); ?> grou endif; endforeach; ?> - - + + diff --git a/modules/settings/settings.php b/modules/settings/settings.php index d17f7fee..88b23779 100644 --- a/modules/settings/settings.php +++ b/modules/settings/settings.php @@ -1585,7 +1585,7 @@ public function settings_checklist_items_sort_order_option($args = []) $hidden = $value === $sortValue ? '' : ' hidden'; echo '

'; + . esc_attr($hidden) . '>'; echo esc_html($sortDescription); echo '

'; }