Plugin Directory

Changeset 2949524


Ignore:
Timestamp:
08/08/2023 06:00:19 PM (3 years ago)
Author:
getpantheon
Message:

Update to version 1.4.1 from GitHub

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

Legend:

Unmodified
Added
Removed
  • pantheon-advanced-page-cache/tags/1.4.1/inc/class-emitter.php

    r2946260 r2949524  
    133133    public static function filter_rest_post_dispatch( $result, $server ) {
    134134        $keys = self::get_rest_api_surrogate_keys();
    135         if ( ! empty( $keys ) ) {
    136             $server->send_header( self::HEADER_KEY, implode( ' ', $keys ) );
     135        if ( ! empty( $keys ) && $result instanceof \WP_REST_Response ) {
     136            $result->header( self::HEADER_KEY, implode( ' ', $keys ) );
    137137        }
    138138        return $result;
  • pantheon-advanced-page-cache/tags/1.4.1/pantheon-advanced-page-cache.php

    r2946260 r2949524  
    88 * Text Domain:     pantheon-advanced-page-cache
    99 * Domain Path:     /languages
    10  * Version:         1.4.0
     10 * Version:         1.4.1
    1111 *
    1212 * @package         Pantheon_Advanced_Page_Cache
     
    8080/**
    8181 * Prefix surrogate keys with the blog ID to provide compatibility with WPMS. See https://github.com/pantheon-systems/pantheon-advanced-page-cache/issues/196.
    82  * 
     82 *
    8383 * @param array $keys Keys to be prefixed.
    8484 */
  • pantheon-advanced-page-cache/tags/1.4.1/readme.txt

    r2946260 r2949524  
    11=== Pantheon Advanced Page Cache ===
    2 Contributors: getpantheon, danielbachhuber, kporras07, jspellman, jazzs3quence, ryanshoover, rwagner00
     2Contributors: getpantheon, danielbachhuber, kporras07, jspellman, jazzs3quence, ryanshoover, rwagner00, pwtyler
    33Tags: pantheon, cdn, cache
    44Requires at least: 4.7
    5 Tested up to: 6.2
    6 Stable tag: 1.4.0
     5Tested up to: 6.3
     6Stable tag: 1.4.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    295295Setting surrogate keys for posts with large numbers of taxonomies (such as WooCommerce products with a large number of global attributes) can suffer from slower queries. Surrogate keys can be skipped for 'product' post types' taxonomy terms (or any other criteria you see fit) with the following filter:
    296296
    297 ```
    298 function custom_should_add_terms($should_add_terms, $wp_query) {
    299     if ( $wp_query->is_singular( 'product' ) ) {
    300         return false;
    301     }
    302     return $should_add_terms;
    303 }
    304 add_filter('pantheon_should_add_terms', 'custom_should_add_terms', 10, 2);
    305 ```
     297    function custom_should_add_terms($should_add_terms, $wp_query) {
     298        if ( $wp_query->is_singular( 'product' ) ) {
     299            return false;
     300        }
     301        return $should_add_terms;
     302    }
     303    add_filter('pantheon_should_add_terms', 'custom_should_add_terms', 10, 2);
    306304
    307305== Plugin Integrations ==
     
    316314
    317315== Changelog ==
     316
     317= 1.4.1 =
     318* Send the REST API response header to the result and not the REST server [[#237](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/237)]. Props [@srtfisher](https://github.com/srtfisher) & [@felixarntz](https://github.com/felixarntz).
    318319
    319320= 1.4.0 =
  • pantheon-advanced-page-cache/trunk/inc/class-emitter.php

    r2946260 r2949524  
    133133    public static function filter_rest_post_dispatch( $result, $server ) {
    134134        $keys = self::get_rest_api_surrogate_keys();
    135         if ( ! empty( $keys ) ) {
    136             $server->send_header( self::HEADER_KEY, implode( ' ', $keys ) );
     135        if ( ! empty( $keys ) && $result instanceof \WP_REST_Response ) {
     136            $result->header( self::HEADER_KEY, implode( ' ', $keys ) );
    137137        }
    138138        return $result;
  • pantheon-advanced-page-cache/trunk/pantheon-advanced-page-cache.php

    r2946260 r2949524  
    88 * Text Domain:     pantheon-advanced-page-cache
    99 * Domain Path:     /languages
    10  * Version:         1.4.0
     10 * Version:         1.4.1
    1111 *
    1212 * @package         Pantheon_Advanced_Page_Cache
     
    8080/**
    8181 * Prefix surrogate keys with the blog ID to provide compatibility with WPMS. See https://github.com/pantheon-systems/pantheon-advanced-page-cache/issues/196.
    82  * 
     82 *
    8383 * @param array $keys Keys to be prefixed.
    8484 */
  • pantheon-advanced-page-cache/trunk/readme.txt

    r2946260 r2949524  
    11=== Pantheon Advanced Page Cache ===
    2 Contributors: getpantheon, danielbachhuber, kporras07, jspellman, jazzs3quence, ryanshoover, rwagner00
     2Contributors: getpantheon, danielbachhuber, kporras07, jspellman, jazzs3quence, ryanshoover, rwagner00, pwtyler
    33Tags: pantheon, cdn, cache
    44Requires at least: 4.7
    5 Tested up to: 6.2
    6 Stable tag: 1.4.0
     5Tested up to: 6.3
     6Stable tag: 1.4.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    295295Setting surrogate keys for posts with large numbers of taxonomies (such as WooCommerce products with a large number of global attributes) can suffer from slower queries. Surrogate keys can be skipped for 'product' post types' taxonomy terms (or any other criteria you see fit) with the following filter:
    296296
    297 ```
    298 function custom_should_add_terms($should_add_terms, $wp_query) {
    299     if ( $wp_query->is_singular( 'product' ) ) {
    300         return false;
    301     }
    302     return $should_add_terms;
    303 }
    304 add_filter('pantheon_should_add_terms', 'custom_should_add_terms', 10, 2);
    305 ```
     297    function custom_should_add_terms($should_add_terms, $wp_query) {
     298        if ( $wp_query->is_singular( 'product' ) ) {
     299            return false;
     300        }
     301        return $should_add_terms;
     302    }
     303    add_filter('pantheon_should_add_terms', 'custom_should_add_terms', 10, 2);
    306304
    307305== Plugin Integrations ==
     
    316314
    317315== Changelog ==
     316
     317= 1.4.1 =
     318* Send the REST API response header to the result and not the REST server [[#237](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/237)]. Props [@srtfisher](https://github.com/srtfisher) & [@felixarntz](https://github.com/felixarntz).
    318319
    319320= 1.4.0 =
Note: See TracChangeset for help on using the changeset viewer.