Changeset 55526
- Timestamp:
- 03/10/2023 04:27:23 PM (21 months ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-comment-query.php
r54133 r55526 453 453 454 454 $cache_key = "get_comments:$key:$last_changed"; 455 $cache_value = wp_cache_get( $cache_key, 'comment ' );455 $cache_value = wp_cache_get( $cache_key, 'comment-queries' ); 456 456 if ( false === $cache_value ) { 457 457 $comment_ids = $this->get_comment_ids(); … … 464 464 'found_comments' => $this->found_comments, 465 465 ); 466 wp_cache_add( $cache_key, $cache_value, 'comment ' );466 wp_cache_add( $cache_key, $cache_value, 'comment-queries' ); 467 467 } else { 468 468 $comment_ids = $cache_value['comment_ids']; … … 1039 1039 foreach ( $_parent_ids as $parent_id ) { 1040 1040 $cache_key = "get_comment_child_ids:$parent_id:$key:$last_changed"; 1041 $parent_child_ids = wp_cache_get( $cache_key, 'comment ' );1041 $parent_child_ids = wp_cache_get( $cache_key, 'comment-queries' ); 1042 1042 if ( false !== $parent_child_ids ) { 1043 1043 $child_ids = array_merge( $child_ids, $parent_child_ids ); … … 1073 1073 $data[ $cache_key ] = $children; 1074 1074 } 1075 wp_cache_set_multiple( $data, 'comment ' );1075 wp_cache_set_multiple( $data, 'comment-queries' ); 1076 1076 } 1077 1077 -
trunk/src/wp-includes/class-wp-network-query.php
r54637 r55526 251 251 252 252 $cache_key = "get_network_ids:$key:$last_changed"; 253 $cache_value = wp_cache_get( $cache_key, 'network s' );253 $cache_value = wp_cache_get( $cache_key, 'network-queries' ); 254 254 255 255 if ( false === $cache_value ) { … … 263 263 'found_networks' => $this->found_networks, 264 264 ); 265 wp_cache_add( $cache_key, $cache_value, 'network s' );265 wp_cache_add( $cache_key, $cache_value, 'network-queries' ); 266 266 } else { 267 267 $network_ids = $cache_value['network_ids']; -
trunk/src/wp-includes/class-wp-query.php
r55252 r55526 2809 2809 2810 2810 $cache_key = "comment_feed:$key:$last_changed"; 2811 $comment_ids = wp_cache_get( $cache_key, 'comment ' );2811 $comment_ids = wp_cache_get( $cache_key, 'comment-queries' ); 2812 2812 if ( false === $comment_ids ) { 2813 2813 $comment_ids = $wpdb->get_col( $comments_request ); 2814 wp_cache_add( $cache_key, $comment_ids, 'comment ' );2814 wp_cache_add( $cache_key, $comment_ids, 'comment-queries' ); 2815 2815 } 2816 2816 _prime_comment_caches( $comment_ids, false ); … … 3166 3166 $cache_found = false; 3167 3167 if ( null === $this->posts ) { 3168 $cached_results = wp_cache_get( $cache_key, 'post s', false, $cache_found );3168 $cached_results = wp_cache_get( $cache_key, 'post-queries', false, $cache_found ); 3169 3169 3170 3170 if ( $cached_results ) { … … 3221 3221 ); 3222 3222 3223 wp_cache_set( $cache_key, $cache_value, 'post s' );3223 wp_cache_set( $cache_key, $cache_value, 'post-queries' ); 3224 3224 } 3225 3225 … … 3254 3254 ); 3255 3255 3256 wp_cache_set( $cache_key, $cache_value, 'post s' );3256 wp_cache_set( $cache_key, $cache_value, 'post-queries' ); 3257 3257 } 3258 3258 … … 3329 3329 ); 3330 3330 3331 wp_cache_set( $cache_key, $cache_value, 'post s' );3331 wp_cache_set( $cache_key, $cache_value, 'post-queries' ); 3332 3332 } 3333 3333 … … 3368 3368 3369 3369 $comment_cache_key = "comment_feed:$comment_key:$comment_last_changed"; 3370 $comment_ids = wp_cache_get( $comment_cache_key, 'comment ' );3370 $comment_ids = wp_cache_get( $comment_cache_key, 'comment-queries' ); 3371 3371 if ( false === $comment_ids ) { 3372 3372 $comment_ids = $wpdb->get_col( $comments_request ); 3373 wp_cache_add( $comment_cache_key, $comment_ids, 'comment ' );3373 wp_cache_add( $comment_cache_key, $comment_ids, 'comment-queries' ); 3374 3374 } 3375 3375 _prime_comment_caches( $comment_ids, false ); -
trunk/src/wp-includes/class-wp-site-query.php
r54637 r55526 359 359 360 360 $cache_key = "get_sites:$key:$last_changed"; 361 $cache_value = wp_cache_get( $cache_key, 'site s' );361 $cache_value = wp_cache_get( $cache_key, 'site-queries' ); 362 362 363 363 if ( false === $cache_value ) { … … 371 371 'found_sites' => $this->found_sites, 372 372 ); 373 wp_cache_add( $cache_key, $cache_value, 'site s' );373 wp_cache_add( $cache_key, $cache_value, 'site-queries' ); 374 374 } else { 375 375 $site_ids = $cache_value['site_ids']; -
trunk/src/wp-includes/class-wp-term-query.php
r55083 r55526 776 776 777 777 $cache_key = $this->generate_cache_key( $args, $this->request ); 778 $cache = wp_cache_get( $cache_key, 'term s' );778 $cache = wp_cache_get( $cache_key, 'term-queries' ); 779 779 780 780 if ( false !== $cache ) { … … 802 802 if ( 'count' === $_fields ) { 803 803 $count = $wpdb->get_var( $this->request ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared 804 wp_cache_set( $cache_key, $count, 'term s' );804 wp_cache_set( $cache_key, $count, 'term-queries' ); 805 805 return $count; 806 806 } … … 809 809 810 810 if ( empty( $terms ) ) { 811 wp_cache_add( $cache_key, array(), 'term s' );811 wp_cache_add( $cache_key, array(), 'term-queries' ); 812 812 return array(); 813 813 } … … 889 889 } 890 890 891 wp_cache_add( $cache_key, $term_cache, 'term s' );891 wp_cache_add( $cache_key, $term_cache, 'term-queries' ); 892 892 $this->terms = $this->format_terms( $term_objects, $_fields ); 893 893 -
trunk/src/wp-includes/comment.php
r55424 r55526 3294 3294 } 3295 3295 3296 wp_cache_set ( 'last_changed', microtime(), 'comment');3296 wp_cache_set_comments_last_changed(); 3297 3297 } 3298 3298 -
trunk/src/wp-includes/general-template.php
r55515 r55526 2055 2055 $key = md5( $query ); 2056 2056 $key = "wp_get_archives:$key:$last_changed"; 2057 $results = wp_cache_get( $key, 'post s' );2057 $results = wp_cache_get( $key, 'post-queries' ); 2058 2058 if ( ! $results ) { 2059 2059 $results = $wpdb->get_results( $query ); 2060 wp_cache_set( $key, $results, 'post s' );2060 wp_cache_set( $key, $results, 'post-queries' ); 2061 2061 } 2062 2062 if ( $results ) { … … 2080 2080 $key = md5( $query ); 2081 2081 $key = "wp_get_archives:$key:$last_changed"; 2082 $results = wp_cache_get( $key, 'post s' );2082 $results = wp_cache_get( $key, 'post-queries' ); 2083 2083 if ( ! $results ) { 2084 2084 $results = $wpdb->get_results( $query ); 2085 wp_cache_set( $key, $results, 'post s' );2085 wp_cache_set( $key, $results, 'post-queries' ); 2086 2086 } 2087 2087 if ( $results ) { … … 2104 2104 $key = md5( $query ); 2105 2105 $key = "wp_get_archives:$key:$last_changed"; 2106 $results = wp_cache_get( $key, 'post s' );2106 $results = wp_cache_get( $key, 'post-queries' ); 2107 2107 if ( ! $results ) { 2108 2108 $results = $wpdb->get_results( $query ); 2109 wp_cache_set( $key, $results, 'post s' );2109 wp_cache_set( $key, $results, 'post-queries' ); 2110 2110 } 2111 2111 if ( $results ) { … … 2130 2130 $key = md5( $query ); 2131 2131 $key = "wp_get_archives:$key:$last_changed"; 2132 $results = wp_cache_get( $key, 'post s' );2132 $results = wp_cache_get( $key, 'post-queries' ); 2133 2133 if ( ! $results ) { 2134 2134 $results = $wpdb->get_results( $query ); 2135 wp_cache_set( $key, $results, 'post s' );2135 wp_cache_set( $key, $results, 'post-queries' ); 2136 2136 } 2137 2137 $arc_w_last = ''; … … 2169 2169 $key = md5( $query ); 2170 2170 $key = "wp_get_archives:$key:$last_changed"; 2171 $results = wp_cache_get( $key, 'post s' );2171 $results = wp_cache_get( $key, 'post-queries' ); 2172 2172 if ( ! $results ) { 2173 2173 $results = $wpdb->get_results( $query ); 2174 wp_cache_set( $key, $results, 'post s' );2174 wp_cache_set( $key, $results, 'post-queries' ); 2175 2175 } 2176 2176 if ( $results ) { -
trunk/src/wp-includes/link-template.php
r55485 r55526 1985 1985 $cache_key = "adjacent_post:$key:$last_changed"; 1986 1986 1987 $result = wp_cache_get( $cache_key, 'post s' );1987 $result = wp_cache_get( $cache_key, 'post-queries' ); 1988 1988 if ( false !== $result ) { 1989 1989 if ( $result ) { … … 1998 1998 } 1999 1999 2000 wp_cache_set( $cache_key, $result, 'post s' );2000 wp_cache_set( $cache_key, $result, 'post-queries' ); 2001 2001 2002 2002 if ( $result ) { -
trunk/src/wp-includes/ms-functions.php
r55398 r55526 1401 1401 } 1402 1402 1403 wp_cache_set ( 'last_changed', microtime(), 'sites');1403 wp_cache_set_sites_last_changed(); 1404 1404 1405 1405 return $blog_id; -
trunk/src/wp-includes/ms-site.php
r54947 r55526 989 989 do_action( 'clean_site_cache', $blog_id, $blog, $domain_path_key ); 990 990 991 wp_cache_set ( 'last_changed', microtime(), 'sites');991 wp_cache_set_sites_last_changed(); 992 992 993 993 /** -
trunk/src/wp-includes/post.php
r55437 r55526 5676 5676 $hash = md5( $page_path . serialize( $post_type ) ); 5677 5677 $cache_key = "get_page_by_path:$hash:$last_changed"; 5678 $cached = wp_cache_get( $cache_key, 'post s' );5678 $cached = wp_cache_get( $cache_key, 'post-queries' ); 5679 5679 if ( false !== $cached ) { 5680 5680 // Special case: '0' is a bad `$page_path`. … … 5743 5743 5744 5744 // We cache misses as well as hits. 5745 wp_cache_set( $cache_key, $foundid, 'post s' );5745 wp_cache_set( $cache_key, $foundid, 'post-queries' ); 5746 5746 5747 5747 if ( $foundid ) { … … 5984 5984 5985 5985 $cache_key = "get_pages:$key:$last_changed"; 5986 $cache = wp_cache_get( $cache_key, 'post s' );5986 $cache = wp_cache_get( $cache_key, 'post-queries' ); 5987 5987 if ( false !== $cache ) { 5988 5988 _prime_post_caches( $cache, false, false ); … … 6149 6149 6150 6150 if ( empty( $pages ) ) { 6151 wp_cache_set( $cache_key, array(), 'post s' );6151 wp_cache_set( $cache_key, array(), 'post-queries' ); 6152 6152 6153 6153 /** This filter is documented in wp-includes/post.php */ … … 6192 6192 } 6193 6193 6194 wp_cache_set( $cache_key, $page_structure, 'post s' );6194 wp_cache_set( $cache_key, $page_structure, 'post-queries' ); 6195 6195 6196 6196 // Convert to WP_Post instances. … … 7356 7356 } 7357 7357 7358 wp_cache_set ( 'last_changed', microtime(), 'posts');7358 wp_cache_set_posts_last_changed(); 7359 7359 } 7360 7360 -
trunk/src/wp-includes/query.php
r54962 r55526 1155 1155 $last_changed = wp_cache_get_last_changed( 'posts' ); 1156 1156 $cache_key = "find_post_by_old_slug:$key:$last_changed"; 1157 $cache = wp_cache_get( $cache_key, 'post s' );1157 $cache = wp_cache_get( $cache_key, 'post-queries' ); 1158 1158 if ( false !== $cache ) { 1159 1159 $id = $cache; 1160 1160 } else { 1161 1161 $id = (int) $wpdb->get_var( $query ); 1162 wp_cache_set( $cache_key, $id, 'post s' );1162 wp_cache_set( $cache_key, $id, 'post-queries' ); 1163 1163 } 1164 1164 … … 1198 1198 $last_changed = wp_cache_get_last_changed( 'posts' ); 1199 1199 $cache_key = "find_post_by_old_date:$key:$last_changed"; 1200 $cache = wp_cache_get( $cache_key, 'post s' );1200 $cache = wp_cache_get( $cache_key, 'post-queries' ); 1201 1201 if ( false !== $cache ) { 1202 1202 $id = $cache; … … 1207 1207 $id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts, $wpdb->postmeta AS pm_slug, $wpdb->postmeta AS pm_date WHERE ID = pm_slug.post_id AND ID = pm_date.post_id AND post_type = %s AND pm_slug.meta_key = '_wp_old_slug' AND pm_slug.meta_value = %s AND pm_date.meta_key = '_wp_old_date'" . $date_query, $post_type, get_query_var( 'name' ) ) ); 1208 1208 } 1209 wp_cache_set( $cache_key, $id, 'post s' );1209 wp_cache_set( $cache_key, $id, 'post-queries' ); 1210 1210 } 1211 1211 } -
trunk/src/wp-includes/taxonomy.php
r55334 r55526 848 848 $last_changed = wp_cache_get_last_changed( 'terms' ); 849 849 $cache_key = 'get_objects_in_term:' . md5( $sql ) . ":$last_changed"; 850 $cache = wp_cache_get( $cache_key, 'term s' );850 $cache = wp_cache_get( $cache_key, 'term-queries' ); 851 851 if ( false === $cache ) { 852 852 $object_ids = $wpdb->get_col( $sql ); 853 wp_cache_set( $cache_key, $object_ids, 'term s' );853 wp_cache_set( $cache_key, $object_ids, 'term-queries' ); 854 854 } else { 855 855 $object_ids = (array) $cache; … … 2859 2859 2860 2860 wp_cache_delete( $object_id, $taxonomy . '_relationships' ); 2861 wp_cache_ delete( 'last_changed', 'terms');2861 wp_cache_set_terms_last_changed(); 2862 2862 2863 2863 /** … … 2957 2957 2958 2958 wp_cache_delete( $object_id, $taxonomy . '_relationships' ); 2959 wp_cache_ delete( 'last_changed', 'terms');2959 wp_cache_set_terms_last_changed(); 2960 2960 2961 2961 /** … … 3543 3543 } 3544 3544 3545 wp_cache_ delete( 'last_changed', 'terms');3545 wp_cache_set_terms_last_changed(); 3546 3546 3547 3547 /** … … 3618 3618 } 3619 3619 3620 wp_cache_set ( 'last_changed', microtime(), 'terms');3620 wp_cache_set_terms_last_changed(); 3621 3621 } 3622 3622 … … 3631 3631 wp_cache_delete( 'all_ids', $taxonomy ); 3632 3632 wp_cache_delete( 'get', $taxonomy ); 3633 wp_cache_ delete( 'last_changed', 'terms');3633 wp_cache_set_terms_last_changed(); 3634 3634 3635 3635 // Regenerate cached hierarchy.
Note: See TracChangeset
for help on using the changeset viewer.