From fedcdfc2783285b6d34cedea36e058e33e6ebd56 Mon Sep 17 00:00:00 2001 From: Peter Molnar Date: Wed, 14 Oct 2015 20:14:09 +0100 Subject: [PATCH] 1.9.0 * adding exclude option based on text entry matching ( regex ) * replacing variable in __ and _e functions to constant --- readme.txt | 7 +- wp-ffpc-abstract.php | 16 +-- wp-ffpc-acache.php | 11 +- wp-ffpc-backend.php | 30 ++--- wp-ffpc-class.php | 277 ++++++++++++++++++++++--------------------- wp-ffpc.php | 3 +- 6 files changed, 184 insertions(+), 160 deletions(-) diff --git a/readme.txt b/readme.txt index c8c8fb5..8fb1a2d 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i Tags: cache, page cache, full page cache, nginx, memcached, apc, speed Requires at least: 3.0 Tested up to: 4.3.1 -Stable tag: 1.8.4 +Stable tag: 1.9.0 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -128,6 +128,11 @@ Version numbering logic: * every .B version indicates new features. * every ..C indicates bugfixes for A.B version. += 1.9.0 = +*2015-10-14* + +* adding exclude option based on text entry matching ( regex ) + = 1.8.4 = *2015-10-13* diff --git a/wp-ffpc-abstract.php b/wp-ffpc-abstract.php index bb0a77e..8c318b8 100644 --- a/wp-ffpc-abstract.php +++ b/wp-ffpc-abstract.php @@ -177,7 +177,7 @@ abstract class WP_FFPC_ABSTRACT { public function plugin_admin_init() { /* save parameter updates, if there are any */ - if ( isset( $_POST[ $this->button_save ] ) && check_admin_referer( $this->plugin_constant ) ) { + if ( isset( $_POST[ $this->button_save ] ) && check_admin_referer( 'wp-ffpc') ) { $this->plugin_options_save(); $this->status = 1; @@ -185,7 +185,7 @@ abstract class WP_FFPC_ABSTRACT { } /* delete parameters if requested */ - if ( isset( $_POST[ $this->button_delete ] ) && check_admin_referer( $this->plugin_constant ) ) { + if ( isset( $_POST[ $this->button_delete ] ) && check_admin_referer( 'wp-ffpc') ) { $this->plugin_options_delete(); $this->status = 2; header( "Location: ". $this->settings_link . self::slug_delete ); @@ -195,7 +195,7 @@ abstract class WP_FFPC_ABSTRACT { $this->plugin_extend_admin_init(); /* add submenu to settings pages */ - add_submenu_page( $this->settings_slug, $this->plugin_name . __translate__( ' options' , $this->plugin_constant ), $this->plugin_name, $this->capability, $this->plugin_settings_page, array ( &$this , 'plugin_admin_panel' ) ); + add_submenu_page( $this->settings_slug, $this->plugin_name . __translate__( ' options' , 'wp-ffpc'), $this->plugin_name, $this->capability, $this->plugin_settings_page, array ( &$this , 'plugin_admin_panel' ) ); } /** @@ -211,7 +211,7 @@ abstract class WP_FFPC_ABSTRACT { * */ public function plugin_settings_link ( $links ) { - $settings_link = '' . __translate__( 'Settings', $this->plugin_constant ) . ''; + $settings_link = '' . __translate__( 'Settings', 'wp-ffpc') . ''; array_unshift( $links, $settings_link ); return $links; } @@ -359,7 +359,7 @@ abstract class WP_FFPC_ABSTRACT { * */ protected function print_default ( $e ) { - _e('Default : ', $this->plugin_constant); + _e('Default : ', 'wp-ffpc'); $select = 'select_' . $e; if ( @is_array ( $this->$select ) ) { $x = $this->$select; @@ -442,7 +442,7 @@ abstract class WP_FFPC_ABSTRACT {
- + - + - +
plugin_constant ) ); + //die ( __translate__ ( 'WP-FFPC Backend class received empty configuration array, the plugin will not work this way', 'wp-ffpc') ); } $this->options = $config; @@ -72,7 +72,7 @@ abstract class WP_FFPC_Backend { $this->set_servers(); /* info level */ - $this->log ( __translate__('init starting', $this->plugin_constant )); + $this->log ( __translate__('init starting', 'wp-ffpc')); /* call backend initiator based on cache type */ $init = $this->_init(); @@ -138,9 +138,9 @@ abstract class WP_FFPC_Backend { $key = $prefix . $key_base; - $this->log ( sprintf( __translate__( 'original key configuration: %s', $this->plugin_constant ), $this->options['key'] ) ); - $this->log ( sprintf( __translate__( 'setting key for: %s', $this->plugin_constant ), $key_base ) ); - $this->log ( sprintf( __translate__( 'setting key to: %s', $this->plugin_constant ), $key ) ); + $this->log ( sprintf( __translate__( 'original key configuration: %s', 'wp-ffpc'), $this->options['key'] ) ); + $this->log ( sprintf( __translate__( 'setting key for: %s', 'wp-ffpc'), $key_base ) ); + $this->log ( sprintf( __translate__( 'setting key to: %s', 'wp-ffpc'), $key ) ); return $key; } @@ -160,12 +160,12 @@ abstract class WP_FFPC_Backend { } /* log the current action */ - $this->log ( sprintf( __translate__( 'GET %s', $this->plugin_constant ), $key ) ); + $this->log ( sprintf( __translate__( 'GET %s', 'wp-ffpc'), $key ) ); $result = $this->_get( $key ); if ( $result === false || $result === null ) - $this->log ( sprintf( __translate__( 'failed to get entry: %s', $this->plugin_constant ), $key ) ); + $this->log ( sprintf( __translate__( 'failed to get entry: %s', 'wp-ffpc'), $key ) ); return $result; } @@ -184,7 +184,7 @@ abstract class WP_FFPC_Backend { return false; /* log the current action */ - $this->log ( sprintf( __translate__( 'set %s expiration time: %s', $this->plugin_constant ), $key, $this->options['expire'] ) ); + $this->log ( sprintf( __translate__( 'set %s expiration time: %s', 'wp-ffpc'), $key, $this->options['expire'] ) ); /* expiration time based is based on type from now on */ /* fallback */ @@ -197,13 +197,13 @@ abstract class WP_FFPC_Backend { $expire = (int) $this->options['expire_taxonomy']; /* log the current action */ - $this->log ( sprintf( __translate__( 'SET %s', $this->plugin_constant ), $key ) ); + $this->log ( sprintf( __translate__( 'SET %s', 'wp-ffpc'), $key ) ); /* proxy to internal function */ $result = $this->_set( $key, $data, $expire ); /* check result validity */ if ( $result === false || $result === null ) - $this->log ( sprintf( __translate__( 'failed to set entry: %s', $this->plugin_constant ), $key ), LOG_WARNING ); + $this->log ( sprintf( __translate__( 'failed to set entry: %s', 'wp-ffpc'), $key ), LOG_WARNING ); return $result; } @@ -232,20 +232,20 @@ abstract class WP_FFPC_Backend { /* exit if no post_id is specified */ if ( empty ( $post_id ) && $force === false ) { - $this->log ( __translate__('not clearing unidentified post ', $this->plugin_constant ), LOG_WARNING ); + $this->log ( __translate__('not clearing unidentified post ', 'wp-ffpc'), LOG_WARNING ); return false; } /* if invalidation method is set to full, flush cache */ if ( ( $this->options['invalidation_method'] === 0 || $force === true ) ) { /* log action */ - $this->log ( __translate__('flushing cache', $this->plugin_constant ) ); + $this->log ( __translate__('flushing cache', 'wp-ffpc') ); /* proxy to internal function */ $internal = $this->_flush(); if ( $result === false ) - $this->log ( __translate__('failed to flush cache', $this->plugin_constant ), LOG_WARNING ); + $this->log ( __translate__('failed to flush cache', 'wp-ffpc'), LOG_WARNING ); return $result; } @@ -282,7 +282,7 @@ abstract class WP_FFPC_Backend { /* no path, don't do anything */ if ( empty( $permalink ) && $permalink != false ) { - $this->log ( sprintf( __translate__( 'unable to determine path from Post Permalink, post ID: %s', $this->plugin_constant ), $post_id ), LOG_WARNING ); + $this->log ( sprintf( __translate__( 'unable to determine path from Post Permalink, post ID: %s', 'wp-ffpc'), $post_id ), LOG_WARNING ); return false; } @@ -433,7 +433,7 @@ abstract class WP_FFPC_Backend { */ protected function is_alive() { if ( ! $this->alive ) { - $this->log ( __translate__("backend is not active, exiting function ", $this->plugin_constant ) . __FUNCTION__, LOG_WARNING ); + $this->log ( __translate__("backend is not active, exiting function ", 'wp-ffpc') . __FUNCTION__, LOG_WARNING ); return false; } diff --git a/wp-ffpc-class.php b/wp-ffpc-class.php index d6d9c0c..ca2f319 100644 --- a/wp-ffpc-class.php +++ b/wp-ffpc-class.php @@ -119,7 +119,7 @@ class WP_FFPC extends WP_FFPC_ABSTRACT { else { $sitedomain = parse_url( get_option('siteurl') , PHP_URL_HOST); if ( $_SERVER['HTTP_HOST'] != $sitedomain ) { - $this->errors['domain_mismatch'] = sprintf( __("Domain mismatch: the site domain configuration (%s) does not match the HTTP_HOST (%s) variable in PHP. Please fix the incorrect one, otherwise the plugin may not work as expected.", $this->plugin_constant ), $sitedomain, $_SERVER['HTTP_HOST'] ); + $this->errors['domain_mismatch'] = sprintf( __("Domain mismatch: the site domain configuration (%s) does not match the HTTP_HOST (%s) variable in PHP. Please fix the incorrect one, otherwise the plugin may not work as expected.", 'wp-ffpc'), $sitedomain, $_SERVER['HTTP_HOST'] ); } $this->global_config_key = $_SERVER['HTTP_HOST']; @@ -127,11 +127,11 @@ class WP_FFPC extends WP_FFPC_ABSTRACT { /* cache type possible values array */ $this->select_cache_type = array ( - 'apc' => __( 'APC' , $this->plugin_constant ), - 'apcu' => __( 'APCu' , $this->plugin_constant ), - 'memcache' => __( 'PHP Memcache' , $this->plugin_constant ), - 'memcached' => __( 'PHP Memcached' , $this->plugin_constant ), - 'redis' => __( 'Redis (experimental, it will break!)' , $this->plugin_constant ), + 'apc' => __( 'APC' , 'wp-ffpc'), + 'apcu' => __( 'APCu' , 'wp-ffpc'), + 'memcache' => __( 'PHP Memcache' , 'wp-ffpc'), + 'memcached' => __( 'PHP Memcached' , 'wp-ffpc'), + 'redis' => __( 'Redis (experimental, it will break!)' , 'wp-ffpc'), ); /* check for required functions / classes for the cache types */ $this->valid_cache_type = array ( @@ -144,23 +144,23 @@ class WP_FFPC extends WP_FFPC_ABSTRACT { /* invalidation method possible values array */ $this->select_invalidation_method = array ( - 0 => __( 'flush cache' , $this->plugin_constant ), - 1 => __( 'only modified post' , $this->plugin_constant ), - 2 => __( 'modified post and all taxonomies' , $this->plugin_constant ), - 3 => __( 'modified post and posts index page' , $this->plugin_constant ), + 0 => __( 'flush cache' , 'wp-ffpc'), + 1 => __( 'only modified post' , 'wp-ffpc'), + 2 => __( 'modified post and all taxonomies' , 'wp-ffpc'), + 3 => __( 'modified post and posts index page' , 'wp-ffpc'), ); /* map of possible key masks */ $this->list_uri_vars = array ( - '$scheme' => __('The HTTP scheme (i.e. http, https).', $this->plugin_constant ), - '$host' => __('Host in the header of request or name of the server processing the request if the Host header is not available.', $this->plugin_constant ), - '$request_uri' => __('The *original* request URI as received from the client including the args', $this->plugin_constant ), - '$remote_user' => __('Name of user, authenticated by the Auth Basic Module', $this->plugin_constant ), - '$cookie_PHPSESSID' => __('PHP Session Cookie ID, if set ( empty if not )', $this->plugin_constant ), - //'$cookie_COOKnginy IE' => __('Value of COOKIE', $this->plugin_constant ), - //'$http_HEADER' => __('Value of HTTP request header HEADER ( lowercase, dashes converted to underscore )', $this->plugin_constant ), - //'$query_string' => __('Full request URI after rewrites', $this->plugin_constant ), - //'' => __('', $this->plugin_constant ), + '$scheme' => __('The HTTP scheme (i.e. http, https).', 'wp-ffpc'), + '$host' => __('Host in the header of request or name of the server processing the request if the Host header is not available.', 'wp-ffpc'), + '$request_uri' => __('The *original* request URI as received from the client including the args', 'wp-ffpc'), + '$remote_user' => __('Name of user, authenticated by the Auth Basic Module', 'wp-ffpc'), + '$cookie_PHPSESSID' => __('PHP Session Cookie ID, if set ( empty if not )', 'wp-ffpc'), + //'$cookie_COOKnginy IE' => __('Value of COOKIE', 'wp-ffpc'), + //'$http_HEADER' => __('Value of HTTP request header HEADER ( lowercase, dashes converted to underscore )', 'wp-ffpc'), + //'$query_string' => __('Full request URI after rewrites', 'wp-ffpc'), + //'' => __('', 'wp-ffpc'), ); /* get current wp_cron schedules */ @@ -213,29 +213,29 @@ class WP_FFPC extends WP_FFPC_ABSTRACT { add_action( self::precache_id , array( &$this, 'precache_coldrun' ) ); /* link on to settings for plugins page */ - $settings_link = ' » ' . __( 'WP-FFPC Settings', $this->plugin_constant ) . ''; + $settings_link = ' » ' . __( 'WP-FFPC Settings', 'wp-ffpc') . ''; /* check & collect errors */ /* look for WP_CACHE */ if ( ! WP_CACHE ) - $this->errors['no_wp_cache'] = __("WP_CACHE is disabled. Without that, cache plugins, like this, will not work. Please add `define ( 'WP_CACHE', true );` to the beginning of wp-config.php.", $this->plugin_constant ); + $this->errors['no_wp_cache'] = __("WP_CACHE is disabled. Without that, cache plugins, like this, will not work. Please add `define ( 'WP_CACHE', true );` to the beginning of wp-config.php.", 'wp-ffpc'); /* look for global settings array */ if ( ! $this->global_saved ) - $this->errors['no_global_saved'] = sprintf( __('This site was reached as %s ( according to PHP HTTP_HOST ) and there are no settings present for this domain in the WP-FFPC configuration yet. Please save the %s for the domain or fix the webserver configuration!', $this->plugin_constant), $_SERVER['HTTP_HOST'], $settings_link); + $this->errors['no_global_saved'] = sprintf( __('This site was reached as %s ( according to PHP HTTP_HOST ) and there are no settings present for this domain in the WP-FFPC configuration yet. Please save the %s for the domain or fix the webserver configuration!', 'wp-ffpc'), $_SERVER['HTTP_HOST'], $settings_link); /* look for writable acache file */ if ( file_exists ( $this->acache ) && ! is_writable ( $this->acache ) ) - $this->errors['no_acache_write'] = sprintf(__('Advanced cache file (%s) is not writeable!
Please change the permissions on the file.', $this->plugin_constant), $this->acache); + $this->errors['no_acache_write'] = sprintf(__('Advanced cache file (%s) is not writeable!
Please change the permissions on the file.', 'wp-ffpc'), $this->acache); /* look for acache file */ if ( ! file_exists ( $this->acache ) ) - $this->errors['no_acache_saved'] = sprintf (__('Advanced cache file is yet to be generated, please save %s', $this->plugin_constant), $settings_link ); + $this->errors['no_acache_saved'] = sprintf (__('Advanced cache file is yet to be generated, please save %s', 'wp-ffpc'), $settings_link ); /* look for extensions that should be available */ foreach ( $this->valid_cache_type as $backend => $status ) { if ( $this->options['cache_type'] == $backend && ! $status ) { - $this->errors['no_backend'] = sprintf ( __('%s cache backend activated but no PHP %s extension was found.
Please either use different backend or activate the module!', $this->plugin_constant), $backend, $backend ); + $this->errors['no_backend'] = sprintf ( __('%s cache backend activated but no PHP %s extension was found.
Please either use different backend or activate the module!', 'wp-ffpc'), $backend, $backend ); } } @@ -246,7 +246,7 @@ class WP_FFPC extends WP_FFPC_ABSTRACT { { $memcache_protocol = strtolower($memcache_settings['memcache.protocol']['local_value']); if ( $memcache_protocol == 'binary' ) { - $this->errors['memcached_binary'] = __('WARNING: Memcache extension is configured to use binary mode. This is very buggy and the plugin will most probably not work correctly.
Please consider to change either to ASCII mode or to Memcached extension.', $this->plugin_constant ); + $this->errors['memcached_binary'] = __('WARNING: Memcache extension is configured to use binary mode. This is very buggy and the plugin will most probably not work correctly.
Please consider to change either to ASCII mode or to Memcached extension.', 'wp-ffpc'); } } } @@ -297,7 +297,7 @@ class WP_FFPC extends WP_FFPC_ABSTRACT { $this->update_global_config(); $this->plugin_options_save(); $this->deploy_advanced_cache(); - static::alert ( __('WP-FFPC settings were upgraded; please double check if everything is still working correctly.', $this->plugin_constant ), LOG_NOTICE ); + static::alert ( __('WP-FFPC settings were upgraded; please double check if everything is still working correctly.', 'wp-ffpc'), LOG_NOTICE ); } } @@ -307,7 +307,7 @@ class WP_FFPC extends WP_FFPC_ABSTRACT { */ public function plugin_extend_admin_init () { /* save parameter updates, if there are any */ - if ( isset( $_POST[ $this->button_flush ] ) && check_admin_referer ( $this->plugin_constant ) ) { + if ( isset( $_POST[ $this->button_flush ] ) && check_admin_referer ( 'wp-ffpc') ) { /* remove precache log entry */ static::_delete_option( self::precache_log ); /* remove precache timestamp entry */ @@ -330,7 +330,7 @@ class WP_FFPC extends WP_FFPC_ABSTRACT { } /* save parameter updates, if there are any */ - if ( isset( $_POST[ $this->button_precache ] ) && check_admin_referer ( $this->plugin_constant ) ) { + if ( isset( $_POST[ $this->button_precache ] ) && check_admin_referer ( 'wp-ffpc') ) { /* is no shell function is possible, fail */ if ( $this->shell_function == false ) { $this->status = 5; @@ -352,7 +352,7 @@ class WP_FFPC extends WP_FFPC_ABSTRACT { /* add our page only if the screenid is correct */ if ( strpos( $screen_id, $this->plugin_settings_page ) ) { - $contextual_help = __('

Please visit the official support forum of the plugin for help.

', $this->plugin_constant ); + $contextual_help = __('

Please visit the official support forum of the plugin for help.

', 'wp-ffpc'); /* [TODO] give detailed information on errors & troubleshooting get_current_screen()->add_help_tab( array( @@ -399,28 +399,28 @@ class WP_FFPC extends WP_FFPC_ABSTRACT { * if options were saved, display saved message */ if (isset($_GET[ self::key_save ]) && $_GET[ self::key_save ]=='true' || $this->status == 1) { ?> -

plugin_constant ) ?>

+

status == 2) { ?> -

plugin_constant ) ?>

+

status == 3) { ?> -

plugin_constant ); ?>

+

status == 4) { ?> -

plugin_constant ) ?>

+

-

plugin_name ; _e( ' settings', $this->plugin_constant ) ; ?>

+

plugin_name ; _e( ' settings', 'wp-ffpc') ; ?>

-

plugin_constant); echo $this->options['cache_type']; ?>

+

options['cache_type']; ?>

options['cache_type'], 'memcache') ) { ?>

Backend status:
', $this->plugin_constant ); + _e( 'Backend status:
', 'wp-ffpc'); /* we need to go through all servers */ $servers = $this->backend->status(); @@ -446,11 +446,11 @@ class WP_FFPC extends WP_FFPC_ABSTRACT { echo $server_string ." => "; if ( $status == 0 ) - _e ( 'down
', $this->plugin_constant ); + _e ( 'down
', 'wp-ffpc'); elseif ( ( $this->options['cache_type'] == 'memcache' && $status > 0 ) || $status == 1 ) - _e ( 'up & running
', $this->plugin_constant ); + _e ( 'up & running
', 'wp-ffpc'); else - _e ( 'unknown, please try re-saving settings!
', $this->plugin_constant ); + _e ( 'unknown, please try re-saving settings!
', 'wp-ffpc'); } } @@ -459,7 +459,7 @@ class WP_FFPC extends WP_FFPC_ABSTRACT {

- plugin_constant ); ?> + plugin_admin_panel_get_tabs(); ?>
- plugin_constant ); ?> +
- +
- plugin_constant); ?> +
- +
- plugin_constant); ?> +
- +
- plugin_constant); ?> +
- +
- plugin_constant); ?> +
- +
- plugin_constant); ?> +
- +
-
plugin_constant); ?> +
    - +
    options['comments_invalidate'],true); ?> /> - plugin_constant); ?> +
    - +
    - WARNING: changing this will result the previous cache to becomes invalid!
    If you are caching with nginx, you should update your nginx configuration and reload nginx after changing this value.', $this->plugin_constant); ?>
    + WARNING: changing this will result the previous cache to becomes invalid!
    If you are caching with nginx, you should update your nginx configuration and reload nginx after changing this value.', 'wp-ffpc'); ?>
    - +
    - WARNING: changing this will result the previous cache to becomes invalid!', $this->plugin_constant); ?> + WARNING: changing this will result the previous cache to becomes invalid!', 'wp-ffpc'); ?>
    - +
    - use the guide below to change it.
    WARNING: changing this will result the previous cache to becomes invalid!
    If you are caching with nginx, you should update your nginx configuration and reload nginx after changing this value.', $this->plugin_constant); ?>
    + use the guide below to change it.
    WARNING: changing this will result the previous cache to becomes invalid!
    If you are caching with nginx, you should update your nginx configuration and reload nginx after changing this value.', 'wp-ffpc'); ?>
    list_uri_vars as $uri => $desc ) { echo '
    '. $uri .'
    '. $desc .'
    '; @@ -574,11 +574,11 @@ class WP_FFPC extends WP_FFPC_ABSTRACT {
    - +
    options['hashkey'],true); ?> /> - module in nginx if you want nginx to fetch the data directly; for details, please see the nginx example tab.', $this->plugin_constant); ?> + module in nginx if you want nginx to fetch the data directly; for details, please see the nginx example tab.', 'wp-ffpc'); ?>
    @@ -587,33 +587,33 @@ class WP_FFPC extends WP_FFPC_ABSTRACT {
- plugin_constant ); ?> -

plugin_constant);?>

-

WP_DEBUG and the WP_FFPC__DEBUG_MODE constants `true` in wp-config.php.
This will enable NOTICE level messages apart from the WARNING level ones which are always displayed.', $this->plugin_constant); ?>

+ +

+

WP_DEBUG and the WP_FFPC__DEBUG_MODE constants `true` in wp-config.php.
This will enable NOTICE level messages apart from the WARNING level ones which are always displayed.', 'wp-ffpc'); ?>

- +
options['pingback_header'],true); ?> /> - plugin_constant); ?> +
- +
options['response_header'],true); ?> /> - plugin_constant); ?> +
- +
options['generate_time'],true); ?> /> - tag.', $this->plugin_constant); ?> + tag.', 'wp-ffpc'); ?>
@@ -621,70 +621,70 @@ class WP_FFPC extends WP_FFPC_ABSTRACT {
- plugin_constant ); ?> +
- +
options['cache_loggedin'],true); ?> /> - plugin_constant); ?> +
- plugin_constant); ?> +
- - - - - - + + + + + +
options['nocache_home'],true); ?> /> - plugin_constant); ?> + options['nocache_feed'],true); ?> /> - plugin_constant); ?> + options['nocache_archive'],true); ?> /> - plugin_constant); ?> + options['nocache_page'],true); ?> /> - plugin_constant); ?> + options['nocache_single'],true); ?> /> - plugin_constant); ?> + options['nocache_dyn'],true); ?> /> - plugin_constant); ?> +
- +
- If you are caching with nginx, you should update your nginx configuration and reload nginx after changing this value.', $this->plugin_constant); ?> + If you are caching with nginx, you should update your nginx configuration and reload nginx after changing this value.', 'wp-ffpc'); ?>
- +
- pattern1|pattern2|etc', $this->plugin_constant); ?> + pattern1|pattern2|etc', 'wp-ffpc'); ?> +
+ +
+ +
+
+ + . Regular expressions use you must! e.g. pattern1|pattern2|etc
+ WARNING: be careful where you display this, because it will apply to any content, including archives, collection pages, singles, anything. If empty, this setting will be ignored.', 'wp-ffpc'); ?>
- plugin_constant); ?> +
- +
- - in case of TCP based connections, list the servers as host1:port1,host2:port2,... . Do not add trailing , and always separate host and port with : .
- for a unix socket enter: unix://[socket_path]', $this->plugin_constant); ?>
+ - in case of TCP based connections, list the servers as host1:port1,host2:port2,... . Do not add trailing , and always separate host and port with : .
- for a unix socket enter: unix://[socket_path]', 'wp-ffpc'); ?>

options['authuser'] ) || !empty( $this->options['authpass'] ) ) ) { ?> -

plugin_constant ) ?>

+

- +
- plugin_constant); ?> +
- +
- plugin_constant); ?> +

- +
options['memcached_binary'],true); ?> /> - plugin_constant); ?> +
@@ -747,22 +756,22 @@ class WP_FFPC extends WP_FFPC_ABSTRACT {
- plugin_constant); ?> +
In case you are about to use nginx to fetch memcached entries directly and to use SHA1 hash keys, you will need an nginx version compiled with HttpSetMiscModule. Otherwise set_sha1 function is not available in nginx.
nginx_example(); ?>
- plugin_constant); ?> +
- +
- plugin_constant); ?> +
plugin_constant); + _e('No precache log was found!', 'wp-ffpc'); } else { ?>

@@ -807,59 +816,59 @@ class WP_FFPC extends WP_FFPC_ABSTRACT {
- plugin_constant); ?> +

- +

- plugin_constant ); ?> +
- plugin_constant ); ?> +
status == 5 || $this->shell_function == false ) { ?> - Since precaching may take a very long time, it's done through a background CLI process in order not to run out of max execution time of PHP. Please enable one of the following functions if you whish to use precaching: " , $this->plugin_constant ) ?>shell_possibilities ); ?> + Since precaching may take a very long time, it's done through a background CLI process in order not to run out of max execution time of PHP. Please enable one of the following functions if you whish to use precaching: " , 'wp-ffpc') ?>shell_possibilities ); ?> - +
- The plugin tries to visit links of taxonomy terms without the taxonomy name as well. This may generate 404 hits, please be prepared for these in your logfiles if you plan to pre-cache.', $this->plugin_constant); ?> + The plugin tries to visit links of taxonomy terms without the taxonomy name as well. This may generate 404 hits, please be prepared for these in your logfiles if you plan to pre-cache.', 'wp-ffpc'); ?>
- plugin_constant ); ?> +
- +
- plugin_constant ); ?> +
- plugin_constant ); ?> +
- +
- plugin_constant ); ?> +
@@ -870,12 +879,12 @@ class WP_FFPC extends WP_FFPC_ABSTRACT { private function plugin_admin_panel_get_tabs() { $default_tabs = array( - 'type' => __( 'Cache type', $this->plugin_constant ), - 'debug' => __( 'Debug & in-depth', $this->plugin_constant ), - 'exceptions' => __( 'Cache exceptions', $this->plugin_constant ), - 'servers' => __( 'Backend settings', $this->plugin_constant ), - 'nginx' => __( 'nginx', $this->plugin_constant ), - 'precache' => __( 'Precache & precache log', $this->plugin_constant ) + 'type' => __( 'Cache type', 'wp-ffpc'), + 'debug' => __( 'Debug & in-depth', 'wp-ffpc'), + 'exceptions' => __( 'Cache exceptions', 'wp-ffpc'), + 'servers' => __( 'Backend settings', 'wp-ffpc'), + 'nginx' => __( 'nginx', 'wp-ffpc'), + 'precache' => __( 'Precache & precache log', 'wp-ffpc') ); return apply_filters('wp_ffpc_admin_panel_tabs', $default_tabs); @@ -892,11 +901,11 @@ class WP_FFPC extends WP_FFPC_ABSTRACT { if ( $this->options['precache_schedule'] != 'null' ) { /* clear all other schedules before adding a new in order to replace */ wp_clear_scheduled_hook ( self::precache_id ); - static::debug ( $this->plugin_constant, __( 'Scheduling WP-CRON event', $this->plugin_constant ) ); + static::debug ( $this->plugin_constant, __( 'Scheduling WP-CRON event', 'wp-ffpc') ); $this->scheduled = wp_schedule_event( time(), $this->options['precache_schedule'] , self::precache_id ); } elseif ( ( !isset($this->options['precache_schedule']) || $this->options['precache_schedule'] == 'null' ) && !empty( $schedule ) ) { - static::debug ( $this->plugin_constant, __('Clearing WP-CRON scheduled hook ' , $this->plugin_constant ) ); + static::debug ( $this->plugin_constant, __('Clearing WP-CRON scheduled hook ' , 'wp-ffpc') ); wp_clear_scheduled_hook ( self::precache_id ); } @@ -954,11 +963,11 @@ class WP_FFPC extends WP_FFPC_ABSTRACT { } /* look for previous config leftovers */ - $try = get_site_option( $this->plugin_constant ); + $try = get_site_option( 'wp-ffpc'); /* network option key changed, remove & migrate the leftovers if there's any */ if ( !empty ( $try ) && $this->network ) { /* clean it up, we don't use it anymore */ - delete_site_option ( $this->plugin_constant ); + delete_site_option ( 'wp-ffpc'); if ( empty ( $options ) && array_key_exists ( $this->global_config_key, $try ) ) { $options = $try [ $this->global_config_key ]; diff --git a/wp-ffpc.php b/wp-ffpc.php index 621647e..1efd1d6 100644 --- a/wp-ffpc.php +++ b/wp-ffpc.php @@ -3,7 +3,7 @@ Plugin Name: WP-FFPC Plugin URI: https://github.com/petermolnar/wp-ffpc Description: WordPress in-memory full page cache plugin -Version: 1.8.4 +Version: 1.9.0 Author: Peter Molnar Author URI: http://petermolnar.eu/ License: GPLv3 @@ -50,6 +50,7 @@ $wp_ffpc_defaults = array ( 'nocache_cookies' => false, 'nocache_dyn' => true, 'nocache_url' => '^/wp-', + 'nocache_comment' => '', 'response_header' => false, 'generate_time' => false, 'precache_schedule' => 'null',