Plugin Directory

Changeset 3421331


Ignore:
Timestamp:
12/16/2025 06:21:55 PM (4 months ago)
Author:
getpantheon
Message:

Update to version 2.1.2 from GitHub

Location:
pantheon-advanced-page-cache
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • pantheon-advanced-page-cache/tags/2.1.2/inc/admin-interface.php

    r3132786 r3421331  
    498498            'status' => 'recommended',
    499499            'badge' => [
    500                 'label' => __( 'Performance', 'pantheon-advanced-page-cache' ),
     500                'label' => __( 'Pantheon', 'pantheon-advanced-page-cache' ),
    501501                'color' => $recommend_color,
    502502            ],
     
    523523        'status' => 'good',
    524524        'badge' => [
    525             'label' => __( 'Performance', 'pantheon-advanced-page-cache' ),
     525            'label' => __( 'Pantheon', 'pantheon-advanced-page-cache' ),
    526526            'color' => 'blue',
    527527        ],
  • pantheon-advanced-page-cache/tags/2.1.2/inc/class-purger.php

    r3246776 r3421331  
    1919     */
    2020    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 );
    2556    }
    2657
     
    4071            return;
    4172        }
    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         */
    4477        self::clear_post_path( $post );
    4578    }
     
    5083     *
    5184     * @param WP_Post $post Post object.
    52      * 
    53      * @since 2.1.1-dev
     85     *
     86     * @since 2.1.1
    5487     */
    5588    public static function clear_post_path( $post ) {
     
    5891        $path = $parsed_url['path'];
    5992        $paths = [ trailingslashit( $path ), untrailingslashit( $path ) ];
    60        
    61         /**
    62          * Paths possibly without surrogate keys purges 
     93
     94        /**
     95         * Paths possibly without surrogate keys purges
    6396         *
    6497         * @param array $paths    paths to clear.
     
    295328            'feed',
    296329            'post-huge',
     330            'rest-post-' . $post->ID,
     331            'rest-post-huge',
    297332        ];
    298333
     
    317352                foreach ( $terms as $term ) {
    318353                    $keys[] = 'term-' . $term->term_id;
     354                    $keys[] = 'rest-term-' . $term->term_id;
    319355                }
    320356                $keys[] = 'term-huge';
     357                $keys[] = 'rest-term-huge';
    321358            }
    322359        }
  • pantheon-advanced-page-cache/tags/2.1.2/pantheon-advanced-page-cache.php

    r3246776 r3421331  
    88 * Text Domain: pantheon-advanced-page-cache
    99 * Domain Path: /languages
    10  * Version: 2.1.1
     10 * Version: 2.1.2
    1111 * Requires at least: 6.4
    12  * Tested up to: 6.7.2
     12 * Tested up to: 6.9
    1313 *
    1414 * @package         Pantheon_Advanced_Page_Cache
     
    155155
    156156/**
    157  * Init namespaced files.
    158  */
    159 add_action( 'plugins_loaded', 'pantheon_bootstrap_namespaces' );
    160 
    161 /**
    162157 * Registers relevant UI
    163158 */
  • pantheon-advanced-page-cache/tags/2.1.2/readme.txt

    r3246776 r3421331  
    33Tags: pantheon, cdn, cache
    44Requires at least: 6.4
    5 Tested up to: 6.7.2
    6 Stable tag: 2.1.1
     5Tested up to: 6.9
     6Requires PHP: 7.4
     7Stable tag: 2.1.2
    78License: GPLv2 or later
    89License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    379380== Changelog ==
    380381
     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
    381387= 2.1.1 (25 February 2025) =
    382388* 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  
    498498            'status' => 'recommended',
    499499            'badge' => [
    500                 'label' => __( 'Performance', 'pantheon-advanced-page-cache' ),
     500                'label' => __( 'Pantheon', 'pantheon-advanced-page-cache' ),
    501501                'color' => $recommend_color,
    502502            ],
     
    523523        'status' => 'good',
    524524        'badge' => [
    525             'label' => __( 'Performance', 'pantheon-advanced-page-cache' ),
     525            'label' => __( 'Pantheon', 'pantheon-advanced-page-cache' ),
    526526            'color' => 'blue',
    527527        ],
  • pantheon-advanced-page-cache/trunk/inc/class-purger.php

    r3246776 r3421331  
    1919     */
    2020    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 );
    2556    }
    2657
     
    4071            return;
    4172        }
    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         */
    4477        self::clear_post_path( $post );
    4578    }
     
    5083     *
    5184     * @param WP_Post $post Post object.
    52      * 
    53      * @since 2.1.1-dev
     85     *
     86     * @since 2.1.1
    5487     */
    5588    public static function clear_post_path( $post ) {
     
    5891        $path = $parsed_url['path'];
    5992        $paths = [ trailingslashit( $path ), untrailingslashit( $path ) ];
    60        
    61         /**
    62          * Paths possibly without surrogate keys purges 
     93
     94        /**
     95         * Paths possibly without surrogate keys purges
    6396         *
    6497         * @param array $paths    paths to clear.
     
    295328            'feed',
    296329            'post-huge',
     330            'rest-post-' . $post->ID,
     331            'rest-post-huge',
    297332        ];
    298333
     
    317352                foreach ( $terms as $term ) {
    318353                    $keys[] = 'term-' . $term->term_id;
     354                    $keys[] = 'rest-term-' . $term->term_id;
    319355                }
    320356                $keys[] = 'term-huge';
     357                $keys[] = 'rest-term-huge';
    321358            }
    322359        }
  • pantheon-advanced-page-cache/trunk/pantheon-advanced-page-cache.php

    r3246776 r3421331  
    88 * Text Domain: pantheon-advanced-page-cache
    99 * Domain Path: /languages
    10  * Version: 2.1.1
     10 * Version: 2.1.2
    1111 * Requires at least: 6.4
    12  * Tested up to: 6.7.2
     12 * Tested up to: 6.9
    1313 *
    1414 * @package         Pantheon_Advanced_Page_Cache
     
    155155
    156156/**
    157  * Init namespaced files.
    158  */
    159 add_action( 'plugins_loaded', 'pantheon_bootstrap_namespaces' );
    160 
    161 /**
    162157 * Registers relevant UI
    163158 */
  • pantheon-advanced-page-cache/trunk/readme.txt

    r3246776 r3421331  
    33Tags: pantheon, cdn, cache
    44Requires at least: 6.4
    5 Tested up to: 6.7.2
    6 Stable tag: 2.1.1
     5Tested up to: 6.9
     6Requires PHP: 7.4
     7Stable tag: 2.1.2
    78License: GPLv2 or later
    89License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    379380== Changelog ==
    380381
     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
    381387= 2.1.1 (25 February 2025) =
    382388* 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.