Plugin Directory

Changeset 2325703


Ignore:
Timestamp:
06/17/2020 08:53:16 AM (6 years ago)
Author:
alaca
Message:

Update 1.1.8.3

Location:
wp-performance/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • wp-performance/trunk/includes/addons/cloudflare/cloudflare_api.php

    r2148462 r2325703  
    140140
    141141        $supported = [
    142             30, 60, 300, 1200, 1800, 3600, 7200, 10800, 14400, 18000, 28800, 43200, 57600, 72000, 86400, 172800, 259200, 345600, 432000, 691200, 1382400, 2073600, 2678400, 5356800, 16070400, 31536000
     142            0, 30, 60, 300, 1200, 1800, 3600, 7200, 10800, 14400, 18000, 28800, 43200, 57600, 72000, 86400, 172800, 259200, 345600, 432000, 691200, 1382400, 2073600, 2678400, 5356800, 16070400, 31536000
    143143        ];
    144144
  • wp-performance/trunk/includes/addons/cloudflare/views/admin.php

    r2148462 r2325703  
    119119                    <td>
    120120                        <select name="cf_browser_expire" form="wpp-settings">
    121                             <option value=""><?php _e( 'Respect Existing Headers', 'wpp' ); ?></option>
     121                            <option value="0"><?php _e( 'Respect Existing Headers', 'wpp' ); ?></option>
    122122                            <?php foreach( $options as $option ): ?>
    123123                                <option value="<?php echo $option; ?>" <?php wpp_selected( 'cf_browser_expire', $option, 14400 ); ?>>
  • wp-performance/trunk/includes/classes/parser.php

    r2244284 r2325703  
    3535                    $this->parseTemplate();
    3636
    37                 // Should we cache this page ?
    38                 if (
    39                     Option::boolval( 'cache' )
    40                     && empty( $_POST )
    41                     && ! is_user_logged_in()
    42                 ) {
    43                     $this->saveCache();
    44                 }
    45 
    46                 return $this->html;
     37                /**
     38                 * Parsed template filter
     39                 * @since 1.1.8.3
     40                 */
     41                $template = apply_filters( 'wpp_template', $this->html, $this->is_amp(), $this->time );
    4742
    4843            }
  • wp-performance/trunk/includes/functions/frontend.php

    r2116907 r2325703  
    1 <?php 
     1<?php
    22/**
    3 * WP Performance Optimizer - Frontend actions
    4 *
    5 * @author Ante Laca <ante.laca@gmail.com>
    6 * @package WPP
    7 */
     3 * WP Performance Optimizer - Frontend actions
     4 *
     5 * @author Ante Laca <ante.laca@gmail.com>
     6 * @package WPP
     7 */
    88
     9use WPP\Url;
    910use WPP\Cache;
    1011use WPP\Option;
     
    1920
    2021    // Disable emoji
    21     if ( Option::boolval( 'disable_emoji' ) ) 
     22    if ( Option::boolval( 'disable_emoji' ) )
    2223        add_action( 'init', 'wpp_disable_emoji' );
    2324
    2425    // Disable embeds
    25     if ( Option::boolval( 'disable_embeds' ) ) 
     26    if ( Option::boolval( 'disable_embeds' ) )
    2627        add_action( 'init', 'wpp_disable_embeds', 99999 );
    27          
     28
    2829    // Hook up
    2930    add_action( 'wp', function() {
    3031        // Do not parse template if it's an ajax request
    3132        if ( ! wpp_is_ajax() )
    32             is_404() || ob_start( [ 'WPP\Parser', 'init' ] ); 
     33            is_404() || ob_start( [ 'WPP\Parser', 'init' ] );
    3334    } );
    3435
     
    4142
    4243            foreach( [ '_gz', '_amp' ] as $extension ) {
    43                 if ( file_exists( $page . $extension ) ) 
     44                if ( file_exists( $page . $extension ) )
    4445                    unlink( $page . $extension );
    4546            }
    4647
    4748        }
    48            
    49     }   
     49
     50    }
    5051
    5152} );
     53
     54
     55// Save cache file
     56add_filter( 'wpp_template', function( $template, $is_amp, $time ) {
     57
     58    // Should we cache this page ?
     59    if (
     60        Option::boolval( 'cache' )
     61        && empty( $_POST )
     62        && ! is_user_logged_in()
     63    ) {
     64
     65        /**
     66         * Filter excluded urls
     67         *
     68         * @since 1.0.0
     69         */
     70        $excluded = apply_filters( 'wpp_exclude_urls', Option::get( 'cache_url_exclude', [] ) );
     71
     72        // Check if page is excluded
     73        if ( ! wpp_is_url_excluded( Url::current(), $excluded ) ) {
     74
     75            if ( ! $is_amp ) {
     76
     77                $template .= sprintf(
     78                    '<!-- ' . __( 'Cache file was created in %s seconds on %s at %s', 'wpp' ) . ' -->',
     79                    number_format( ( microtime( true ) - $time ), 2 ),
     80                    date( get_option( 'date_format' ) ),
     81                    date( get_option( 'time_format' ) )
     82                );
     83
     84            }
     85
     86            Cache::save( $template, $is_amp );
     87
     88        }
     89
     90    }
     91
     92}, 10, 3);
  • wp-performance/trunk/readme.txt

    r2244284 r2325703  
    44Tags: wp performance, cache, performance, speed optimization, seo
    55Requires at least: 4.7
    6 Tested up to: 5.3
     6Tested up to: 5.4
    77Requires PHP: 5.6
    88Stable tag: trunk
     
    1111
    1212== Changelog ==
     13
     14= 1.1.8.3 =
     15[FIX] Cloudflare add-on - respect existing headers
    1316
    1417= 1.1.8.2 =
  • wp-performance/trunk/vendor/autoload.php

    r2061390 r2325703  
    55require_once __DIR__ . '/composer/autoload_real.php';
    66
    7 return ComposerAutoloaderInit2acf94a015230b6fef7e83e17ef1d0c2::getLoader();
     7return ComposerAutoloaderInit889f9359b5f8cdede198e2d4b0bcf3ce::getLoader();
  • wp-performance/trunk/vendor/composer/autoload_real.php

    r2061390 r2325703  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit2acf94a015230b6fef7e83e17ef1d0c2
     5class ComposerAutoloaderInit889f9359b5f8cdede198e2d4b0bcf3ce
    66{
    77    private static $loader;
     
    2020        }
    2121
    22         spl_autoload_register(array('ComposerAutoloaderInit2acf94a015230b6fef7e83e17ef1d0c2', 'loadClassLoader'), true, true);
     22        spl_autoload_register(array('ComposerAutoloaderInit889f9359b5f8cdede198e2d4b0bcf3ce', 'loadClassLoader'), true, true);
    2323        self::$loader = $loader = new \Composer\Autoload\ClassLoader();
    24         spl_autoload_unregister(array('ComposerAutoloaderInit2acf94a015230b6fef7e83e17ef1d0c2', 'loadClassLoader'));
     24        spl_autoload_unregister(array('ComposerAutoloaderInit889f9359b5f8cdede198e2d4b0bcf3ce', 'loadClassLoader'));
    2525
    2626        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
     
    2828            require_once __DIR__ . '/autoload_static.php';
    2929
    30             call_user_func(\Composer\Autoload\ComposerStaticInit2acf94a015230b6fef7e83e17ef1d0c2::getInitializer($loader));
     30            call_user_func(\Composer\Autoload\ComposerStaticInit889f9359b5f8cdede198e2d4b0bcf3ce::getInitializer($loader));
    3131        } else {
    3232            $map = require __DIR__ . '/autoload_namespaces.php';
     
    4949
    5050        if ($useStaticLoader) {
    51             $includeFiles = Composer\Autoload\ComposerStaticInit2acf94a015230b6fef7e83e17ef1d0c2::$files;
     51            $includeFiles = Composer\Autoload\ComposerStaticInit889f9359b5f8cdede198e2d4b0bcf3ce::$files;
    5252        } else {
    5353            $includeFiles = require __DIR__ . '/autoload_files.php';
    5454        }
    5555        foreach ($includeFiles as $fileIdentifier => $file) {
    56             composerRequire2acf94a015230b6fef7e83e17ef1d0c2($fileIdentifier, $file);
     56            composerRequire889f9359b5f8cdede198e2d4b0bcf3ce($fileIdentifier, $file);
    5757        }
    5858
     
    6161}
    6262
    63 function composerRequire2acf94a015230b6fef7e83e17ef1d0c2($fileIdentifier, $file)
     63function composerRequire889f9359b5f8cdede198e2d4b0bcf3ce($fileIdentifier, $file)
    6464{
    6565    if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
  • wp-performance/trunk/vendor/composer/autoload_static.php

    r2241043 r2325703  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit2acf94a015230b6fef7e83e17ef1d0c2
     7class ComposerStaticInit889f9359b5f8cdede198e2d4b0bcf3ce
    88{
    99    public static $files = array (
     
    9191    {
    9292        return \Closure::bind(function () use ($loader) {
    93             $loader->prefixLengthsPsr4 = ComposerStaticInit2acf94a015230b6fef7e83e17ef1d0c2::$prefixLengthsPsr4;
    94             $loader->prefixDirsPsr4 = ComposerStaticInit2acf94a015230b6fef7e83e17ef1d0c2::$prefixDirsPsr4;
    95             $loader->classMap = ComposerStaticInit2acf94a015230b6fef7e83e17ef1d0c2::$classMap;
     93            $loader->prefixLengthsPsr4 = ComposerStaticInit889f9359b5f8cdede198e2d4b0bcf3ce::$prefixLengthsPsr4;
     94            $loader->prefixDirsPsr4 = ComposerStaticInit889f9359b5f8cdede198e2d4b0bcf3ce::$prefixDirsPsr4;
     95            $loader->classMap = ComposerStaticInit889f9359b5f8cdede198e2d4b0bcf3ce::$classMap;
    9696
    9797        }, null, ClassLoader::class);
  • wp-performance/trunk/wp-performance.php

    r2244284 r2325703  
    44* Plugin URI: https://www.wp-performance.com
    55* Description: WP Performance Optimizer
    6 * Version: 1.1.8.2
     6* Version: 1.1.8.3
    77* Author: Ante Laca
    88* Author URI: https://www.antelaca.xyz
     
    1515
    1616// WP Performance
    17 define( 'WPP_VERSION'       , '1.1.8.2' );
     17define( 'WPP_VERSION'       , '1.1.8.3' );
    1818define( 'WPP_SELF'          , __FILE__ );
    1919define( 'WPP_URI'           , plugin_dir_url( __FILE__ ) );
Note: See TracChangeset for help on using the changeset viewer.