readme cleanup, settings link for plugins page

git-svn-id: http://plugins.svn.wordpress.org/wp-ffpc/trunk@677428 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
cadeyrn 2013-03-07 12:09:59 +00:00
parent 32e75b5cb6
commit e80ff2cf55
2 changed files with 74 additions and 37 deletions

View file

@ -1,30 +1,27 @@
=== WP-FFPC === === WP-FFPC ===
Contributors: cadeyrn Contributors: cadeyrn
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XU3DG7LLA76WC Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XU3DG7LLA76WC
Tags: cache, APC, memcached, full page cache Tags: cache, APC, memcache, memcached, page cache, full page cache, nginx
Requires at least: 3.0 Requires at least: 3.0
Tested up to: 3.5.1 Tested up to: 3.5.1
Stable tag: 0.5 Stable tag: 0.5
Fast Full Page Cache, backend can be memcached or APC Store WordPress pages in memcached and serve them with nginx - unbeatable speed!
== Description == == Description ==
WP-FFPC is a full page cache plugin for WordPress. It can use APC or a memcached server as backend. WP-FFPC is a full page cache plugin for WordPress. Supports memcached server or APC as backend and both widely available PHP memcached modules, Memcache and Memcached as well.
The naming stands for Fast Full Page Cache.
PHP has two extension for communication with a memcached server, named Memcache and Memcached. The plugin can utilize both, however, the recommended is memcached.
= Features: = = Features: =
* exclude possibility of home, feeds, archieves, pages, singles * exclude possibilities: of home, feeds, archieves, pages, singles
* possibility to enable caching for logged-in users * possibility to enable caching for logged-in users
* use APC or memcached as backend * APC or memcached server storage
* 404 caching * 404 caching
* redirects caching * redirects caching
* Last Modified HTTP header compatibility with 304 responses * Last Modified HTTP header compatibility with 304 responses
* shortlink HTTP header preservation * shortlink HTTP header preservation
* pingback HTTP header preservation(1) * pingback HTTP header preservation(1)
* fallback to no caching if any error or problem occurs * fallback to no caching if any error or problem occurs
* syslog & debug settings available * syslog & debug settings for troubleshooting
* supports multiple memcached backends * supports multiple memcached backends
* Wordpress Network compatible(2) * Wordpress Network compatible(2)
* nginx compatible(3) * nginx compatible(3)
@ -33,35 +30,41 @@ PHP has two extension for communication with a memcached server, named Memcache
(2) If enabled as network-wide plugin in a WordPress Network, the configuration will only be available for network admins at the network admin panel, will be system-wide and will be applied for every blog. (2) If enabled as network-wide plugin in a WordPress Network, the configuration will only be available for network admins at the network admin panel, will be system-wide and will be applied for every blog.
(3) nginx compatility means that if used with PHP Memcache or PHP Memcached extension, the created memcached entries can be read and served directly from nginx, making the cache insanely fast. (3) nginx compatility means that if used with PHP Memcache or PHP Memcached extension, the created memcached entries can be read and served directly from nginx.
If used with APC, this feature is not available (no APC module for nginx). If used with APC, this feature is not available (no APC module for nginx).
Short nginx example configuration is generated on the plugin settings page, under `nginx` tab. Short nginx example configuration is generated on the plugin settings page, under `nginx` tab according to the settings of the plugin.
NOTE: some features ( most of additional HTTP headers for example ) will not be available with this solution! ( yet ) NOTE: some features ( most of additional HTTP headers for example, like pingback, shortlink, etc. ) will not be available with this solution! ( yet )
Parts are based on [Hyper Cache](http://wordpress.org/extend/plugins/hyper-cache "Hyper Cache") plugin by Satollo (info@satollo.net). Parts are based on [Hyper Cache](http://wordpress.org/extend/plugins/hyper-cache "Hyper Cache") plugin by Satollo (info@satollo.net).
== Installation == == Installation ==
1. Upload contents of `wp-ffpc.zip` to the `/wp-content/plugins/` directory 1. Upload contents of `wp-ffpc.zip` to the `/wp-content/plugins/` directory
2. Enable WordPress cache by adding `define('WP_CACHE',true);` in wp-config.php 2. Enable WordPress cache by adding `define('WP_CACHE',true);` in wp-config.php
3. Activate the plugin through the `Plugins` menu in WordPress (please use network wide activation if used in a WordPress Network) 3. Activate the plugin through the `Plugins` menu in WordPress ( site or Network wide )
4. Check the settings in `Settings` -> `wp-ffpc` menu in WordPress. For WordPress Network, please visit the Network Admin panel, the options will be available under Network Admin Settings page, in WP-FFPC menu entry. 4. Check the settings in `Settings` ( site or Network Admin, depending on activation wideness ) -> `WP-FFPC` menu in WordPress.
5. Save the settings. THIS STEP IS MANDATORY: without saving the settings, there will be no activated caching! 5. Save the settings. THIS STEP IS MANDATORY: without saving the settings, there will be no activated caching!
== Frequently Asked Questions == == Frequently Asked Questions ==
= How to install memcache PHP extension? = = How to install memcache PHP extension? =
On most of the distributions, php5-memcached or php5-mecache is available as package. On most of the distributions, php5-memcached or php5-memcache is available as package.
You can use PECL alternatively: `pecl install memcached`. You can use PECL alternatively: `pecl install memcached`.
It's recommended to use memcached. It's recommended to use Memcached instead of Memcache.
= How to use the plugin on Amazon Linux? = = How to use the plugin on Amazon Linux? =
You have to remove the default yum package, named `php-pecl-memcache` and install `Memcache` or `Memcached` through PECL. You have to remove the default yum package, named `php-pecl-memcache` and install `Memcache` or `Memcached` through PECL.
== Changelog == == Changelog ==
= 0.5 = = 0.5.1 =
2013.03.06 *in development*
* settings link for plugins page
* readme cleanup
* setting link URL repair & cleanup
= 0.5 =
*2013.03.06*
WARNING, MAJOR CHANGES! WARNING, MAJOR CHANGES!
* default values bug ( causing %3C bug ) really fixed by the help of Mark Costlow <cheeks@swcp.com> * default values bug ( causing %3C bug ) really fixed by the help of Mark Costlow <cheeks@swcp.com>
@ -73,73 +76,73 @@ WARNING, MAJOR CHANGES!
* refactored settings saving mechanism * refactored settings saving mechanism
* additional syslog informations * additional syslog informations
* additional comments on the code * additional comments on the code
* lots of minor fixes * lots of minor fixes and code cleanup
* donation link on the top * donation link on the top
= 0.4.3 = = 0.4.3 =
2013.03.03 *2013.03.03*
* long-running %3C bug fixed by the help of Mark Costlow <cheeks@swcp.com>, many thanks for it. It was cause by a bad check in the default values set-up: is_numeric applies for string numbers as well, which was unknown to me, and cause some of the values to be 0 where they should have been something different. * long-running %3C bug fixed by the help of Mark Costlow <cheeks@swcp.com>, many thanks for it. It was cause by a bad check in the default values set-up: is_numeric applies for string numbers as well, which was unknown to me, and cause some of the values to be 0 where they should have been something different.
= 0.4.2 = = 0.4.2 =
2012.12.07 *2012.12.07*
* added optional sync protocoll option: replace all http->https or https->http depending on request protocol * added optional sync protocoll option: replace all http->https or https->http depending on request protocol
* binary mode is working correctly with memcached extension * binary mode is working correctly with memcached extension
* added warning message for memcache extension in binary mode * added warning message for memcache extension in binary mode
KNOWN ISSUES **KNOWN ISSUES**
There are major problems with the "memcache" driver, the source is yet unkown. The situation is that there's no response from the memcached server using this driver; please avoid using it! There are major problems with the "memcache" driver, the source is yet unkown. The situation is that there's no response from the memcached server using this driver; please avoid using it!
= 0.4.1 = = 0.4.1 =
2012.08.16 *2012.08.16*
* storage key extended with scheme ( http; https; etc. ), the miss caused problems when https request server CSS and JS files via http. * storage key extended with scheme ( http; https; etc. ), the miss caused problems when https request server CSS and JS files via http.
= 0.4 = = 0.4 =
2012.08.06 *2012.08.06*
* tested against new WordPress versions * tested against new WordPress versions
* added lines to "memcached" storage to be able to work with nginx as well * added lines to "memcached" storage to be able to work with nginx as well
* added lines to "memcached" to use binary protocol ( tested with PHP Memcached version 2.0.1 ) * added lines to "memcached" to use binary protocol ( tested with PHP Memcached version 2.0.1 )
KNOWN ISSUES **KNOWN ISSUES**
* "memcache" extension fails in binary mode; the reason is under investigation * "memcache" extension fails in binary mode; the reason is under investigation
= 0.3.2 = = 0.3.2 =
2012.02.27 *2012.02.27*
* apc_cache_info replaced with apc_sma_info, makes plugin faster * apc_cache_info replaced with apc_sma_info, makes plugin faster
= 0.3 = = 0.3 =
2012.02.21 *2012.02.21*
* added syslog debug messages possibility * added syslog debug messages possibility
* bugfix: removed (accidently used) short_open_tags * bugfix: removed (accidently used) short_open_tags
= 0.2.3 = = 0.2.3 =
2012.02.21 *2012.02.21*
* nginx-sample.conf file added, nginx config is created from here * nginx-sample.conf file added, nginx config is created from here
= 0.2.2 = = 0.2.2 =
2012.02.21 *2012.02.21*
* memcache types bugfix, reported in forum, thanks! * memcache types bugfix, reported in forum, thanks!
= 0.2.1 = = 0.2.1 =
2012.02.21 *2012.02.21*
* bugfix, duplicated inclusion could emerge, fix added, thanks for Géza Kuti for reporting! * bugfix, duplicated inclusion could emerge, fix added, thanks for Géza Kuti for reporting!
= 0.2 = = 0.2 =
2012.02.19 *2012.02.19*
* added APC compression option ( requires PHP ZLIB ). Useful is output pages are large. Compression is on lowest level, therefore size/CPU load is more or less optimal. * added APC compression option ( requires PHP ZLIB ). Useful is output pages are large. Compression is on lowest level, therefore size/CPU load is more or less optimal.
= 0.1 = = 0.1 =
2012.02.16 *2012.02.16*
* first public release * first public release

View file

@ -66,6 +66,7 @@ define ( 'WP_FFPC_CONFIG_VAR' , '$wp_ffpc_config' );
define ( 'WP_FFPC_SERVER_LIST_SEPARATOR' , ',' ); define ( 'WP_FFPC_SERVER_LIST_SEPARATOR' , ',' );
define ( 'WP_FFPC_SERVER_SEPARATOR', ':' ); define ( 'WP_FFPC_SERVER_SEPARATOR', ':' );
define ( 'WP_FFPC_DONATION_LINK', 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XU3DG7LLA76WC' ); define ( 'WP_FFPC_DONATION_LINK', 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XU3DG7LLA76WC' );
define ( 'WP_FFPC_FILE' , plugin_basename(__FILE__) );
/* get the common functions */ /* get the common functions */
include_once (WP_FFPC_DIR .'/wp-ffpc-common.php'); include_once (WP_FFPC_DIR .'/wp-ffpc-common.php');
@ -91,12 +92,17 @@ if (!class_exists('WPFFPC')) {
/* stores information if plugin is network active or not */ /* stores information if plugin is network active or not */
var $network = false; var $network = false;
var $settingslink = '';
/** /**
* constructor * constructor
* *
*/ */
function __construct() { function __construct() {
/* set settings page link */
$this->settingslink = 'options-general.php?page=' . WP_FFPC_OPTIONS_PAGE;
/* check if plugin is network-activated */
$this->check_for_network(); $this->check_for_network();
/* register options */ /* register options */
@ -121,6 +127,12 @@ if (!class_exists('WPFFPC')) {
add_filter('redirect_canonical', array( $this , 'redirect_canonical') , 10, 2); add_filter('redirect_canonical', array( $this , 'redirect_canonical') , 10, 2);
} }
$plugin = plugin_basename( __FILE__ );
if ( $this->network )
add_filter( "network_admin_plugin_action_links_$plugin", array( $this, 'settings_link' ) );
else
add_filter( "plugin_action_links_$plugin", array( $this, 'settings_link' ) );
/* add admin styling */ /* add admin styling */
if( is_admin() ) if( is_admin() )
{ {
@ -168,11 +180,17 @@ if (!class_exists('WPFFPC')) {
{ {
$this->save_settings (); $this->save_settings ();
$this->status = 1; $this->status = 1;
header("Location: admin.php?page=" . WP_FFPC_OPTIONS_PAGE . "&saved=true");
header( "Location: ". $this->settingslink ."&saved=true" );
} }
if ( $this->network )
$optionspage = 'settings.php';
else
$optionspage = 'options-general.php';
/* we use settings menu, no need for highest level menu */ /* we use settings menu, no need for highest level menu */
add_submenu_page('settings.php', 'Edit WP-FFPC options', __('WP-FFPC', WP_FFPC_PARAM ), 10, WP_FFPC_OPTIONS_PAGE , array ( $this , 'admin_panel' ) ); add_submenu_page( $optionspage, 'Edit WP-FFPC options', __('WP-FFPC', WP_FFPC_PARAM ), 10, WP_FFPC_OPTIONS_PAGE , array ( $this , 'admin_panel' ) );
} }
/** /**
@ -527,10 +545,15 @@ if (!class_exists('WPFFPC')) {
* *
*/ */
function check_for_network( ) { function check_for_network( ) {
if ( is_multisite() ) { if ( is_multisite() )
{
$plugins = get_site_option( 'active_sitewide_plugins'); $plugins = get_site_option( 'active_sitewide_plugins');
if ( isset($plugins['wp-ffpc/wp-ffpc.php']) ) { /* see if plugins is active */
if ( isset($plugins['wp-ffpc/wp-ffpc.php']) )
{
$this->network = true; $this->network = true;
/* replace settings link */
$this->settingslink = str_replace( 'options-general.php' , 'settings.php' , $this->settingslink );
} }
} }
} }
@ -760,6 +783,17 @@ if (!class_exists('WPFFPC')) {
} }
/**
*
*
*/
function settings_link ( $links ) {
$settings_link = '<a href="' . $this->settingslink . '">' . __( 'Settings', WP_FFPC_PARAM ) . '</a>';
array_unshift( $links, $settings_link );
return $links;
}
/** /**
* splits config parameter "hosts" into an array of server string, host and port * splits config parameter "hosts" into an array of server string, host and port
* to be used in later config * to be used in later config