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 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 ) ?>
plugin_constant ) ?>
plugin_constant ); ?>
plugin_constant ) ?>
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 {