Changeset 3421331
- Timestamp:
- 12/16/2025 06:21:55 PM (4 months ago)
- Location:
- pantheon-advanced-page-cache
- Files:
-
- 8 edited
- 1 copied
-
tags/2.1.2 (copied) (copied from pantheon-advanced-page-cache/trunk)
-
tags/2.1.2/inc/admin-interface.php (modified) (2 diffs)
-
tags/2.1.2/inc/class-purger.php (modified) (6 diffs)
-
tags/2.1.2/pantheon-advanced-page-cache.php (modified) (2 diffs)
-
tags/2.1.2/readme.txt (modified) (2 diffs)
-
trunk/inc/admin-interface.php (modified) (2 diffs)
-
trunk/inc/class-purger.php (modified) (6 diffs)
-
trunk/pantheon-advanced-page-cache.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pantheon-advanced-page-cache/tags/2.1.2/inc/admin-interface.php
r3132786 r3421331 498 498 'status' => 'recommended', 499 499 'badge' => [ 500 'label' => __( 'P erformance', 'pantheon-advanced-page-cache' ),500 'label' => __( 'Pantheon', 'pantheon-advanced-page-cache' ), 501 501 'color' => $recommend_color, 502 502 ], … … 523 523 'status' => 'good', 524 524 'badge' => [ 525 'label' => __( 'P erformance', 'pantheon-advanced-page-cache' ),525 'label' => __( 'Pantheon', 'pantheon-advanced-page-cache' ), 526 526 'color' => 'blue', 527 527 ], -
pantheon-advanced-page-cache/tags/2.1.2/inc/class-purger.php
r3246776 r3421331 19 19 */ 20 20 public static function action_wp_insert_post( $post_id, $post ) { 21 if ( 'publish' !== $post->post_status ) { 22 return; 23 } 24 self::purge_post_with_related( $post ); 21 if ( 'publish' === $post->post_status ) { 22 self::purge_post_with_related( $post ); 23 return; 24 } 25 26 // For non-published posts, still purge term keys if the post has taxonomies. 27 $taxonomies = wp_list_filter( 28 get_object_taxonomies( $post->post_type, 'objects' ), 29 [ 'public' => true ] 30 ); 31 32 if ( empty( $taxonomies ) ) { 33 return; 34 } 35 36 $keys = []; 37 $has_terms = false; 38 foreach ( $taxonomies as $taxonomy ) { 39 $terms = get_the_terms( $post, $taxonomy->name ); 40 if ( $terms ) { 41 $has_terms = true; 42 foreach ( $terms as $term ) { 43 $keys[] = 'term-' . $term->term_id; 44 $keys[] = 'rest-term-' . $term->term_id; 45 } 46 } 47 } 48 49 if ( ! $has_terms ) { 50 return; 51 } 52 $keys[] = 'term-huge'; 53 $keys[] = 'rest-term-huge'; 54 $keys = pantheon_wp_prefix_surrogate_keys_with_blog_id( $keys ); 55 pantheon_wp_clear_edge_keys( $keys ); 25 56 } 26 57 … … 40 71 return; 41 72 } 42 // Targets 404 pages that could be cached with no surrogate keys (i.e. 43 // a drafted post going live after the 404 has been cached). 73 /** 74 * Targets 404 pages that could be cached with no surrogate keys (i.e. 75 * a drafted post going live after the 404 has been cached). 76 */ 44 77 self::clear_post_path( $post ); 45 78 } … … 50 83 * 51 84 * @param WP_Post $post Post object. 52 * 53 * @since 2.1.1 -dev85 * 86 * @since 2.1.1 54 87 */ 55 88 public static function clear_post_path( $post ) { … … 58 91 $path = $parsed_url['path']; 59 92 $paths = [ trailingslashit( $path ), untrailingslashit( $path ) ]; 60 61 /** 62 * Paths possibly without surrogate keys purges 93 94 /** 95 * Paths possibly without surrogate keys purges 63 96 * 64 97 * @param array $paths paths to clear. … … 295 328 'feed', 296 329 'post-huge', 330 'rest-post-' . $post->ID, 331 'rest-post-huge', 297 332 ]; 298 333 … … 317 352 foreach ( $terms as $term ) { 318 353 $keys[] = 'term-' . $term->term_id; 354 $keys[] = 'rest-term-' . $term->term_id; 319 355 } 320 356 $keys[] = 'term-huge'; 357 $keys[] = 'rest-term-huge'; 321 358 } 322 359 } -
pantheon-advanced-page-cache/tags/2.1.2/pantheon-advanced-page-cache.php
r3246776 r3421331 8 8 * Text Domain: pantheon-advanced-page-cache 9 9 * Domain Path: /languages 10 * Version: 2.1. 110 * Version: 2.1.2 11 11 * Requires at least: 6.4 12 * Tested up to: 6. 7.212 * Tested up to: 6.9 13 13 * 14 14 * @package Pantheon_Advanced_Page_Cache … … 155 155 156 156 /** 157 * Init namespaced files.158 */159 add_action( 'plugins_loaded', 'pantheon_bootstrap_namespaces' );160 161 /**162 157 * Registers relevant UI 163 158 */ -
pantheon-advanced-page-cache/tags/2.1.2/readme.txt
r3246776 r3421331 3 3 Tags: pantheon, cdn, cache 4 4 Requires at least: 6.4 5 Tested up to: 6.7.2 6 Stable tag: 2.1.1 5 Tested up to: 6.9 6 Requires PHP: 7.4 7 Stable tag: 2.1.2 7 8 License: GPLv2 or later 8 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 379 380 == Changelog == 380 381 382 = 2.1.2 (December 16, 2025) = 383 * Confirmed PHP 8.4 compatibility [[#333](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/333)] 384 * Confirmed WordPress 6.9 compatibility [[#355](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/355)] 385 * Adding rest-term-* keys to purge_post_with_related() for published and draft posts. ([#357](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/357)) 386 381 387 = 2.1.1 (25 February 2025) = 382 388 * Fixes 404 pages remaining cached after a post has been published ([#315](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/315)) -
pantheon-advanced-page-cache/trunk/inc/admin-interface.php
r3132786 r3421331 498 498 'status' => 'recommended', 499 499 'badge' => [ 500 'label' => __( 'P erformance', 'pantheon-advanced-page-cache' ),500 'label' => __( 'Pantheon', 'pantheon-advanced-page-cache' ), 501 501 'color' => $recommend_color, 502 502 ], … … 523 523 'status' => 'good', 524 524 'badge' => [ 525 'label' => __( 'P erformance', 'pantheon-advanced-page-cache' ),525 'label' => __( 'Pantheon', 'pantheon-advanced-page-cache' ), 526 526 'color' => 'blue', 527 527 ], -
pantheon-advanced-page-cache/trunk/inc/class-purger.php
r3246776 r3421331 19 19 */ 20 20 public static function action_wp_insert_post( $post_id, $post ) { 21 if ( 'publish' !== $post->post_status ) { 22 return; 23 } 24 self::purge_post_with_related( $post ); 21 if ( 'publish' === $post->post_status ) { 22 self::purge_post_with_related( $post ); 23 return; 24 } 25 26 // For non-published posts, still purge term keys if the post has taxonomies. 27 $taxonomies = wp_list_filter( 28 get_object_taxonomies( $post->post_type, 'objects' ), 29 [ 'public' => true ] 30 ); 31 32 if ( empty( $taxonomies ) ) { 33 return; 34 } 35 36 $keys = []; 37 $has_terms = false; 38 foreach ( $taxonomies as $taxonomy ) { 39 $terms = get_the_terms( $post, $taxonomy->name ); 40 if ( $terms ) { 41 $has_terms = true; 42 foreach ( $terms as $term ) { 43 $keys[] = 'term-' . $term->term_id; 44 $keys[] = 'rest-term-' . $term->term_id; 45 } 46 } 47 } 48 49 if ( ! $has_terms ) { 50 return; 51 } 52 $keys[] = 'term-huge'; 53 $keys[] = 'rest-term-huge'; 54 $keys = pantheon_wp_prefix_surrogate_keys_with_blog_id( $keys ); 55 pantheon_wp_clear_edge_keys( $keys ); 25 56 } 26 57 … … 40 71 return; 41 72 } 42 // Targets 404 pages that could be cached with no surrogate keys (i.e. 43 // a drafted post going live after the 404 has been cached). 73 /** 74 * Targets 404 pages that could be cached with no surrogate keys (i.e. 75 * a drafted post going live after the 404 has been cached). 76 */ 44 77 self::clear_post_path( $post ); 45 78 } … … 50 83 * 51 84 * @param WP_Post $post Post object. 52 * 53 * @since 2.1.1 -dev85 * 86 * @since 2.1.1 54 87 */ 55 88 public static function clear_post_path( $post ) { … … 58 91 $path = $parsed_url['path']; 59 92 $paths = [ trailingslashit( $path ), untrailingslashit( $path ) ]; 60 61 /** 62 * Paths possibly without surrogate keys purges 93 94 /** 95 * Paths possibly without surrogate keys purges 63 96 * 64 97 * @param array $paths paths to clear. … … 295 328 'feed', 296 329 'post-huge', 330 'rest-post-' . $post->ID, 331 'rest-post-huge', 297 332 ]; 298 333 … … 317 352 foreach ( $terms as $term ) { 318 353 $keys[] = 'term-' . $term->term_id; 354 $keys[] = 'rest-term-' . $term->term_id; 319 355 } 320 356 $keys[] = 'term-huge'; 357 $keys[] = 'rest-term-huge'; 321 358 } 322 359 } -
pantheon-advanced-page-cache/trunk/pantheon-advanced-page-cache.php
r3246776 r3421331 8 8 * Text Domain: pantheon-advanced-page-cache 9 9 * Domain Path: /languages 10 * Version: 2.1. 110 * Version: 2.1.2 11 11 * Requires at least: 6.4 12 * Tested up to: 6. 7.212 * Tested up to: 6.9 13 13 * 14 14 * @package Pantheon_Advanced_Page_Cache … … 155 155 156 156 /** 157 * Init namespaced files.158 */159 add_action( 'plugins_loaded', 'pantheon_bootstrap_namespaces' );160 161 /**162 157 * Registers relevant UI 163 158 */ -
pantheon-advanced-page-cache/trunk/readme.txt
r3246776 r3421331 3 3 Tags: pantheon, cdn, cache 4 4 Requires at least: 6.4 5 Tested up to: 6.7.2 6 Stable tag: 2.1.1 5 Tested up to: 6.9 6 Requires PHP: 7.4 7 Stable tag: 2.1.2 7 8 License: GPLv2 or later 8 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 379 380 == Changelog == 380 381 382 = 2.1.2 (December 16, 2025) = 383 * Confirmed PHP 8.4 compatibility [[#333](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/333)] 384 * Confirmed WordPress 6.9 compatibility [[#355](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/355)] 385 * Adding rest-term-* keys to purge_post_with_related() for published and draft posts. ([#357](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/357)) 386 381 387 = 2.1.1 (25 February 2025) = 382 388 * Fixes 404 pages remaining cached after a post has been published ([#315](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/315))
Note: See TracChangeset
for help on using the changeset viewer.