Changeset 2711432
- Timestamp:
- 04/19/2022 08:31:38 AM (4 years ago)
- Location:
- surge/trunk
- Files:
-
- 1 added
- 7 edited
-
include/cache.php (modified) (1 diff)
-
include/cli.php (added)
-
include/common.php (modified) (2 diffs)
-
include/cron.php (modified) (1 diff)
-
include/install.php (modified) (1 diff)
-
include/invalidate.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
-
surge.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
surge/trunk/include/cache.php
r2674872 r2711432 28 28 29 29 $skip = false; 30 $headers = []; 30 31 31 32 foreach ( headers_list() as $header ) { -
surge/trunk/include/common.php
r2674872 r2711432 44 44 'matomo_group', 'matomo_placement', 'hsa_cam', 'hsa_grp', 'hsa_mt', 45 45 'hsa_src', 'hsa_ad', 'hsa_acc', 'hsa_net', 'hsa_kw', 'hsa_tgt', 46 'hsa_ver', '_branch_match_id' ,46 'hsa_ver', '_branch_match_id' 47 47 ], 48 48 … … 98 98 } 99 99 100 $unset_vars = []; 101 100 102 // Ignore some query vars. 101 103 foreach ( $query_vars as $key => $value ) { 102 104 if ( in_array( $key, config( 'ignore_query_vars' ) ) ) { 105 $unset_vars[] = $key; 103 106 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'] = '/'; 104 119 } 105 120 } -
surge/trunk/include/cron.php
r2639174 r2711432 47 47 48 48 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 } 50 54 51 55 // Skip files modified in the last minute. -
surge/trunk/include/install.php
r2639174 r2711432 28 28 wp_mkdir_p( CACHE_DIR ); 29 29 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. 31 if ( defined( 'WP_CACHE' ) && WP_CACHE || apply_filters( 'surge_skip_config_update', false ) ) { 32 32 update_option( 'surge_installed', 1 ); 33 33 return; -
surge/trunk/include/invalidate.php
r2674872 r2711432 135 135 $flags = null; 136 136 $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 138 145 $f = fopen( $path, $mode ); 139 146 $length = filesize( $path ); -
surge/trunk/readme.txt
r2674872 r2711432 4 4 Tags: cache, performance, caching 5 5 Requires at least: 5.7 6 Tested up to: 5.96 Tested up to: 6.0 7 7 Requires PHP: 7.3 8 Stable tag: 1.0. 38 Stable tag: 1.0.4 9 9 License: GPLv3 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.en.html … … 36 36 There isn't one. 37 37 38 = How do I clear the cache? = 39 40 Toggle the plugin activation or run `wp surge flush` using WP-CLI. 41 38 42 = Is my cache working? = 39 43 … … 63 67 == Changelog == 64 68 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 65 76 = 1.0.3 = 66 77 * Invalidate cache when posts_per_page is changed -
surge/trunk/surge.php
r2674872 r2711432 8 8 * Text Domain: surge 9 9 * Domain Path: /languages 10 * Version: 1.0. 310 * Version: 1.0.4 11 11 * 12 12 * @package Surge … … 30 30 if ( wp_doing_cron() ) { 31 31 include_once( __DIR__ . '/include/cron.php' ); 32 } 33 34 if ( defined( 'WP_CLI' ) && WP_CLI ) { 35 include_once( __DIR__ . '/include/cli.php' ); 32 36 } 33 37
Note: See TracChangeset
for help on using the changeset viewer.