Merge branch 'master' of github.com:petermolnar/wp-ffpc into HEAD

git-svn-id: http://plugins.svn.wordpress.org/wp-ffpc/trunk@703374 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
cadeyrn 2013-04-25 09:40:01 +00:00
commit 3b3269fc54
5 changed files with 29 additions and 19 deletions

View file

@ -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, fast
Requires at least: 3.0
Tested up to: 3.5.1
Stable tag: 1.1
Stable tag: 1.1.1
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
@ -85,8 +85,14 @@ Please post feature requests to [WP-FFPC feature request topic](http://wordpress
== Changelog ==
= 1.1.1 =
*2013.04.25*
* bugfix: Memcache plugin was diplaying server status incorrectly ( although the plugin was working )
* bugfix: typo prevented log to work correctly
= 1.1 =
2013.04.24
*2013.04.24*
What's new:

View file

@ -361,7 +361,7 @@ if (!class_exists('WP_Plugins_Abstract')) {
abstract function plugin_hook_options_save ( $activating );
/**
* sends message to sysog
* sends message to syslog
*
* @param string $message message to add besides basic info
* @param int $log_level [optional] Level of log, info by default
@ -372,22 +372,22 @@ if (!class_exists('WP_Plugins_Abstract')) {
if ( @is_array( $message ) || @is_object ( $message ) )
$message = serialize($message);
if (! $this->config['log'] )
if ( !isset ( $this->options['log'] ) || $this->options['log'] != 1 )
return false;
switch ( $log_level ) {
case LOG_ERR :
if ( function_exists( 'syslog' ) && function_exists ( 'openlog' ) ) {
openlog('wordpress('.$_SERVER['HTTP_HOST'].')',LOG_NDELAY|LOG_PID,LOG_SYSLOG);
openlog('wordpress('.$_SERVER['HTTP_HOST'].')',LOG_NDELAY|LOG_PERROR,LOG_SYSLOG);
syslog( $log_level , self::plugin_constant . $message );
}
/* error level is real problem, needs to be displayed on the admin panel */
throw new Exception ( $message );
//throw new Exception ( $message );
break;
default:
if ( function_exists( 'syslog' ) && function_exists ( 'openlog' ) && $this->config['debug'] ) {
openlog('wordpress('.$_SERVER['HTTP_HOST'].')',LOG_NDELAY|LOG_PID,LOG_SYSLOG);
syslog( $log_level , self::plugin_constant . $message );
if ( function_exists( 'syslog' ) && function_exists ( 'openlog' ) && isset( $this->options['log_info'] ) && $this->options['log_info'] == 1 ) {
openlog('wordpress(' .$_SERVER['HTTP_HOST']. ')', LOG_NDELAY,LOG_SYSLOG);
syslog( $log_level, self::plugin_constant . $message );
}
break;
}

View file

@ -62,7 +62,7 @@ if (!class_exists('WP_FFPC_Backend')) {
/* call backend initiator based on cache type */
$init = $this->proxy( 'init' );
$this->log ( __translate__(' init starting', self::plugin_constant ));
$this->log ( __translate__('init starting', self::plugin_constant ));
$this->$init();
}
@ -376,24 +376,28 @@ if (!class_exists('WP_FFPC_Backend')) {
* @param mixed $message message to add besides basic info
*
*/
public function log ( $message, $log_level = LOG_WARNING ) {
private function log ( $message, $log_level = LOG_WARNING ) {
if ( @is_array( $message ) || @is_object ( $message ) )
$message = serialize($message);
if (! $this->options['log'] )
if ( !isset ( $this->options['log'] ) || $this->options['log'] != 1 )
return false;
switch ( $log_level ) {
case LOG_ERR :
if ( function_exists( 'syslog' ) )
syslog( $log_level , self::plugin_constant . " with " . $this->options['cache_type'] . ' ' . $message );
if ( function_exists( 'syslog' ) && function_exists ( 'openlog' ) ) {
openlog('wordpress('.$_SERVER['HTTP_HOST'].')',LOG_NDELAY|LOG_PERROR,LOG_SYSLOG);
syslog( $log_level , self::plugin_constant . $message );
}
/* error level is real problem, needs to be displayed on the admin panel */
//throw new Exception ( $message );
break;
default:
if ( function_exists( 'syslog' ) && isset($this->options['debug']) && $this->options['debug'] )
syslog( $log_level , self::plugin_constant . " with " . $this->options['cache_type'] . ' ' . $message );
if ( function_exists( 'syslog' ) && function_exists ( 'openlog' ) && isset( $this->options['log_info'] ) && $this->options['log_info'] == 1 ) {
openlog('wordpress(' .$_SERVER['HTTP_HOST']. ')', LOG_NDELAY,LOG_SYSLOG);
syslog( $log_level, self::plugin_constant . " " . $message );
}
break;
}

View file

@ -326,7 +326,7 @@ if ( ! class_exists( 'WP_FFPC' ) ) {
if ( $status == 0 )
_e ( '<span class="error-msg">down</span><br />', $this->plugin_constant );
elseif ( $status == 1 )
elseif ( ( $this->options['cache_type'] == 'memcache' && $status > 0 ) || $status == 1 )
_e ( '<span class="ok-msg">up & running</span><br />', $this->plugin_constant );
else
_e ( '<span class="error-msg">unknown, please try re-saving settings!</span><br />', $this->plugin_constant );

View file

@ -3,7 +3,7 @@
Plugin Name: WP-FFPC
Plugin URI: http://petermolnar.eu/wordpress/wp-ffpc
Description: WordPress cache plugin for memcached & nginx - unbeatable speed
Version: 1.1
Version: 1.1.1
Author: Peter Molnar <hello@petermolnar.eu>
Author URI: http://petermolnar.eu/
License: GPLv3
@ -49,7 +49,7 @@ $wp_ffpc_defaults = array (
'generate_time' => false,
);
$wp_ffpc = new WP_FFPC ( 'wp-ffpc', '1.1', 'WP-FFPC', $wp_ffpc_defaults, 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XU3DG7LLA76WC' );
$wp_ffpc = new WP_FFPC ( 'wp-ffpc', '1.1.1', 'WP-FFPC', $wp_ffpc_defaults, 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XU3DG7LLA76WC' );
?>