diff --git a/readme.txt b/readme.txt index 5456ef9..0ece9ad 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.2.1 -Stable tag: 1.8.1 +Stable tag: 1.8.2 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -125,6 +125,13 @@ Version numbering logic: * every .B version indicates new features. * every ..C indicates bugfixes for A.B version. += 1.8.2 = +*2015-04-30* + +* sha1 key hashing made to be optional +* added additional debug condition of WP_FFPC__DEBUG_MODE constant to be `true` + + = 1.8.1 = *2015-04-29* diff --git a/wp-admin.css b/wp-admin.css new file mode 100644 index 0000000..8132817 --- /dev/null +++ b/wp-admin.css @@ -0,0 +1,194 @@ +.plugin-admin dt { + margin-top: 2em; + font-weight:bold; +} + +.plugin-admin fieldset { + display:block; + margin: 0; + padding: 0 1em 0 1em; + border: 1px solid #ccc; +} + +.plugin-admin legend { + display: none; + visibility: hidden; +} + +.plugin-admin .description { + display: block; + padding-top: 0.3em; +} + +.plugin-admin .tabs { + padding:0; + margin: 0; + list-style-type: none; +} + +.plugin-admin .tabs li { + border-style: solid; + border-width: 1px 1px 1px 1px; + border-color: #ccc; + border-bottom-color: #ccc; + line-height: 120%; + display: inline-block; + padding: 0.5em 2em 0.5em 2em; + text-decoration: none; + margin-bottom: -1px; + -webkit-border-top-left-radius: 3px; + -webkit-border-top-right-radius: 3px; + border-top-left-radius: 3px; + border-top-right-radius: 3px; + background: #f1f1f1; + background-image: -webkit-gradient(linear,left bottom,left top,from(#ececec),to(#f9f9f9)); + background-image: -webkit-linear-gradient(bottom,#ececec,#f9f9f9); + background-image: -moz-linear-gradient(bottom,#ececec,#f9f9f9); + background-image: -o-linear-gradient(bottom,#ececec,#f9f9f9); + background-image: linear-gradient(to top,#ececec,#f9f9f9); +} + +.plugin-admin .tabs li a { + outline: none; + text-decoration: none; + font-size: 120%; +} + +.plugin-admin .tabs li.ui-state-active { + background: #fff; + border-bottom-color: #fff; +} + +.error p { + font-weight: bold; +} + +.error-msg { + color: #990000; +} + +.ok-msg { + color: #009900; +} + +.clear { + clear:both; +} + +.wp-ffpc-donation { + padding: 0.8em; + border: 1px solid #ccc; + background-color: #f6f6f6; + -webkit-border-radius: 3px; + border-radius: 3px; + +} + +.wp-ffpc-donation * { + display: inline; + line-height: 2em; +} + +.wp-ffpc-donation .currency { + padding: 0 0 0 0.3em; + +} + +.wp-ffpc-donation .submit { + display: inline-block; + width: 74px; + height: 21px; +} + +.wp-ffpc-donation .ui-slider { + position: relative; + text-align: left; + display: inline-block; + width: 16em; + margin: 0 2em 0 2em; + height: 0.4em; + background-color: #111; + border: 1px solid #ccc; + -webkit-border-radius: 3px; + border-radius: 3px; + background: #f1f1f1; +} + +.wp-ffpc-donation .ui-slider .ui-slider-handle { + position: absolute; + z-index: 2; + width: 1.2em; + height: 1.2em; + margin-top: -0.4em; + cursor: default; + border: 1px solid #ccc; + -webkit-border-radius: 3px; + border-radius: 3px; + background: #f1f1f1; + background-image: -webkit-gradient(linear,left bottom,left top,from(#ececec),to(#f9f9f9)); + background-image: -webkit-linear-gradient(bottom,#ececec,#f9f9f9); + background-image: -moz-linear-gradient(bottom,#ececec,#f9f9f9); + background-image: -o-linear-gradient(bottom,#ececec,#f9f9f9); + background-image: linear-gradient(to top,#ececec,#f9f9f9); + outline: none; +} + + +.button-warning { + display: inline-block; + text-decoration: none; + font-size: 12px; + line-height: 23px; + height: 24px; + margin: 0; + padding: 0 10px 1px; + cursor: pointer; + border-width: 1px; + border-style: solid; + -webkit-border-radius: 3px; + -webkit-appearance: none; + border-radius: 3px; + white-space: nowrap; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + background: #f3f3f3; + background-image: -webkit-gradient(linear, left top, left bottom, from(#fefefe), to(#f4f4f4)); + background-image: -webkit-linear-gradient(top, #fefefe, #f4f4f4); + background-image: -moz-linear-gradient(top, #fefefe, #f4f4f4); + background-image: -o-linear-gradient(top, #fefefe, #f4f4f4); + background-image: linear-gradient(to bottom, #fefefe, #f4f4f4); + border-color: #bbb; + color: #900; + text-shadow: 0 1px 0 #fff; +} + +.button-warning:hover, +.button-warning:focus { + background: #f3f3f3; + background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f3f3f3)); + background-image: -webkit-linear-gradient(top, #fff, #f3f3f3); + background-image: -moz-linear-gradient(top, #fff, #f3f3f3); + background-image: -ms-linear-gradient(top, #fff, #f3f3f3); + background-image: -o-linear-gradient(top, #fff, #f3f3f3); + background-image: linear-gradient(to bottom, #fff, #f3f3f3); + border-color: #900; + color: #a00; + -webkit-box-shadow: 1px 1px 1px rgba(0,0,0,.2); + box-shadow: 1px 1px 1px rgba(0,0,0,.2); +} + +.button-warning:active { + background: #eee; + background-image: -webkit-gradient(linear, left top, left bottom, from(#f4f4f4), to(#fefefe)); + background-image: -webkit-linear-gradient(top, #f4f4f4, #fefefe); + background-image: -moz-linear-gradient(top, #f4f4f4, #fefefe); + background-image: -ms-linear-gradient(top, #f4f4f4, #fefefe); + background-image: -o-linear-gradient(top, #f4f4f4, #fefefe); + background-image: linear-gradient(to bottom, #f4f4f4, #fefefe); + border-color: #900; + color: #a00; + text-shadow: 0 -1px 0 #fff; + -webkit-box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 ); + box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 ); +} diff --git a/wp-ffpc-abstract.php b/wp-ffpc-abstract.php index 4b12f86..bb0a77e 100644 --- a/wp-ffpc-abstract.php +++ b/wp-ffpc-abstract.php @@ -563,7 +563,7 @@ abstract class WP_FFPC_ABSTRACT { wp_die( '

Error:

' . '

' . $message . '

' ); exit; default: - if ( !defined( 'WP_DEBUG' ) && WP_DEBUG != true ) + if ( !defined( 'WP_DEBUG' ) || WP_DEBUG != true || !defined( 'WP_FFPC__DEBUG_MODE' ) || WP_FFPC__DEBUG_MODE != true ) return; break; } diff --git a/wp-ffpc-backend.php b/wp-ffpc-backend.php index 173a940..4aae169 100644 --- a/wp-ffpc-backend.php +++ b/wp-ffpc-backend.php @@ -140,7 +140,10 @@ class WP_FFPC_Backend { $key_base = self::map_urimap($urimap, $this->options['key']); /* data is string only with content, meta is not used in nginx */ - $key = sha1 ($prefix . $key_base ); + $key = $prefix . $key_base; + if ( isset($this->options['hashkey']) && $this->options['hashkey'] == true) + $key = sha1 ($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 ) ); @@ -502,7 +505,7 @@ class WP_FFPC_Backend { wp_die( '

Error:

' . '

' . $message . '

' ); exit; default: - if ( !defined( 'WP_DEBUG' ) && WP_DEBUG != true ) + if ( !defined( 'WP_DEBUG' ) || WP_DEBUG != true || !defined( 'WP_FFPC__DEBUG_MODE' ) || WP_FFPC__DEBUG_MODE != true ) return; break; } diff --git a/wp-ffpc-class.php b/wp-ffpc-class.php index b1eacd2..0a3b218 100644 --- a/wp-ffpc-class.php +++ b/wp-ffpc-class.php @@ -70,11 +70,8 @@ class WP_FFPC extends WP_FFPC_ABSTRACT { $this->plugin_url = plugin_dir_url( __FILE__ ); $this->plugin_dir = plugin_dir_path( __FILE__ ); - $this->common_url = $this->plugin_url . self::common_slug; - $this->common_dir = $this->plugin_dir . self::common_slug; - $this->admin_css_handle = $this->plugin_constant . '-admin-css'; - $this->admin_css_url = $this->common_url . 'wp-admin.css'; + $this->admin_css_url = $this->plugin_url . 'wp-admin.css'; } /** @@ -574,13 +571,23 @@ class WP_FFPC extends WP_FFPC_ABSTRACT { ?> +
+ +
+
+ options['hashkey'],true); ?> /> + plugin_constant); ?> +
+ + +
plugin_constant ); ?>

plugin_constant);?>

-

WP_DEBUG constant `true`.
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.', $this->plugin_constant); ?>

diff --git a/wp-ffpc-nginx-sample.conf b/wp-ffpc-nginx-sample.conf index 6754f75..ce6a628 100644 --- a/wp-ffpc-nginx-sample.conf +++ b/wp-ffpc-nginx-sample.conf @@ -71,7 +71,9 @@ MEMCACHED_SERVERS default_type text/html; set $memcached_raw_key data-$scheme://$host$request_uri; - set_sha1 $memcached_key $memcached_raw_key; + # uncomment the following line if you have enabled + # sha1 hash option + # set_sha1 $memcached_key $memcached_raw_key; set $memcached_request 1; if ($request_method = POST ) { diff --git a/wp-ffpc.php b/wp-ffpc.php index 5cada89..7efb1c2 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.1 +Version: 1.8.2 Author: Peter Molnar Author URI: http://petermolnar.eu/ License: GPLv3 @@ -56,6 +56,7 @@ $wp_ffpc_defaults = array ( 'key' => '$scheme://$host$request_uri', 'comments_invalidate' => true, 'pingback_header' => false, + 'hashkey' => false, ); -$wp_ffpc = new WP_FFPC ( 'wp-ffpc', '1.7.9', 'WP-FFPC', $wp_ffpc_defaults, 'PeterMolnar_WordPressPlugins_wp-ffpc_HU' , 'WP-FFPC' , 'FA3NT7XDVHPWU' ); +$wp_ffpc = new WP_FFPC ( 'wp-ffpc', '1.8.2', 'WP-FFPC', $wp_ffpc_defaults, 'PeterMolnar_WordPressPlugins_wp-ffpc_HU' , 'WP-FFPC' , 'FA3NT7XDVHPWU' );