Plugin Directory

Changeset 2711432


Ignore:
Timestamp:
04/19/2022 08:31:38 AM (4 years ago)
Author:
kovshenin
Message:

Release 1.0.4

Location:
surge/trunk
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • surge/trunk/include/cache.php

    r2674872 r2711432  
    2828
    2929    $skip = false;
     30    $headers = [];
    3031
    3132    foreach ( headers_list() as $header ) {
  • surge/trunk/include/common.php

    r2674872 r2711432  
    4444            'matomo_group', 'matomo_placement', 'hsa_cam', 'hsa_grp', 'hsa_mt',
    4545            'hsa_src', 'hsa_ad', 'hsa_acc', 'hsa_net', 'hsa_kw', 'hsa_tgt',
    46             'hsa_ver', '_branch_match_id',
     46            'hsa_ver', '_branch_match_id'
    4747        ],
    4848
     
    9898    }
    9999
     100    $unset_vars = [];
     101
    100102    // Ignore some query vars.
    101103    foreach ( $query_vars as $key => $value ) {
    102104        if ( in_array( $key, config( 'ignore_query_vars' ) ) ) {
     105            $unset_vars[] = $key;
    103106            unset( $query_vars[ $key ] );
     107            unset( $_REQUEST[ $key ] );
     108            unset( $_GET[ $key ] );
     109        }
     110    }
     111
     112    // Clean REQUEST_URI
     113    if ( ! empty( $unset_vars ) ) {
     114        $unset_vars_regex = implode( '|', array_map( 'preg_quote', $unset_vars ) );
     115        $_SERVER['REQUEST_URI'] = preg_replace( "#(\?)?&?({$unset_vars_regex})=[^&]+#", '\\1', $_SERVER['REQUEST_URI'] );
     116        $_SERVER['REQUEST_URI'] = str_replace( '?&', '?', $_SERVER['REQUEST_URI'] );
     117        if ( $_SERVER['REQUEST_URI'] == '/?' ) {
     118            $_SERVER['REQUEST_URI'] = '/';
    104119        }
    105120    }
  • surge/trunk/include/cron.php

    r2639174 r2711432  
    4747
    4848    foreach ( $files as $filename ) {
    49         $stat = stat( $filename );
     49        // Some files after scandir may already be gone/renamed.
     50        $stat = @stat( $filename );
     51        if ( ! $stat ) {
     52            continue;
     53        }
    5054
    5155        // Skip files modified in the last minute.
  • surge/trunk/include/install.php

    r2639174 r2711432  
    2828wp_mkdir_p( CACHE_DIR );
    2929
    30 // Nothing to do if WP_CACHE is already on.
    31 if ( defined( 'WP_CACHE' ) && WP_CACHE ) {
     30// Nothing to do if WP_CACHE is already on or forced skip.
     31if ( defined( 'WP_CACHE' ) && WP_CACHE || apply_filters( 'surge_skip_config_update', false ) ) {
    3232    update_option( 'surge_installed', 1 );
    3333    return;
  • surge/trunk/include/invalidate.php

    r2674872 r2711432  
    135135    $flags = null;
    136136    $path = CACHE_DIR . '/flags.json.php';
    137     $mode = file_exists( $path ) ? 'r+' : 'w+';
     137    $exists = file_exists( $path );
     138    $mode = $exists ? 'r+' : 'w+';
     139
     140    // Make sure cache dir exists.
     141    if ( ! $exists && ! wp_mkdir_p( CACHE_DIR ) ) {
     142        return;
     143    }
     144
    138145    $f = fopen( $path, $mode );
    139146    $length = filesize( $path );
  • surge/trunk/readme.txt

    r2674872 r2711432  
    44Tags: cache, performance, caching
    55Requires at least: 5.7
    6 Tested up to: 5.9
     6Tested up to: 6.0
    77Requires PHP: 7.3
    8 Stable tag: 1.0.3
     8Stable tag: 1.0.4
    99License: GPLv3 or later
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
     
    3636There isn't one.
    3737
     38= How do I clear the cache? =
     39
     40Toggle the plugin activation or run `wp surge flush` using WP-CLI.
     41
    3842= Is my cache working? =
    3943
     
    6367== Changelog ==
    6468
     69= 1.0.4 =
     70* Add a WP-CLI command to invalidate/flush page cache
     71* Fix redirect loop with Core's redirect_canonical for ignore_query_vars
     72* Fix warnings for requests with empty headers
     73* Fix warnings when cron cleanup attempts to read a file that no longer exists
     74* Add a filter to disable writing to wp-config.php
     75
    6576= 1.0.3 =
    6677* Invalidate cache when posts_per_page is changed
  • surge/trunk/surge.php

    r2674872 r2711432  
    88 * Text Domain: surge
    99 * Domain Path: /languages
    10  * Version: 1.0.3
     10 * Version: 1.0.4
    1111 *
    1212 * @package Surge
     
    3030    if ( wp_doing_cron() ) {
    3131        include_once( __DIR__ . '/include/cron.php' );
     32    }
     33
     34    if ( defined( 'WP_CLI' ) && WP_CLI ) {
     35        include_once( __DIR__ . '/include/cli.php' );
    3236    }
    3337
Note: See TracChangeset for help on using the changeset viewer.