Compare commits
101 commits
mcachesock
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
b894610cb1 | ||
|
eac45ed95e | ||
|
705afd1535 | ||
|
b19e446e0f | ||
|
24430be27a | ||
|
4b5bce6cc4 | ||
|
87b2f986a1 | ||
|
dade9fe586 | ||
|
03f393950f | ||
|
c48d971ddf | ||
|
ee76a2a9d8 | ||
|
d09fa5828b | ||
|
8ab0a0d99a | ||
|
32bd2f7b0e | ||
|
9de0ad8f30 | ||
|
18ad72f799 | ||
|
62f3d0ab00 | ||
|
06bee4b178 | ||
|
c09ebac154 | ||
|
9f029e2414 | ||
|
c84498d069 | ||
|
fedcdfc278 | ||
|
457ad184c4 | ||
|
7b16741af8 | ||
|
f0c71ec396 | ||
|
d715c6fbaf | ||
|
f64c17a8f9 | ||
|
0da7a83f0e | ||
|
2df573d955 | ||
|
098f05985c | ||
|
65325033fa | ||
|
42bc1771fa | ||
|
6f19008509 | ||
|
525fc33839 | ||
|
a4c870cc0c | ||
|
c8589b3a54 | ||
|
1cd2d80e1e | ||
|
37d3e25cea | ||
|
84f23c9548 | ||
|
eb6381157c | ||
|
ecf3e25ac4 | ||
|
17669f272b | ||
|
5d86db9cb1 | ||
|
a3a032df8c | ||
|
01fba9fae8 | ||
|
d0dc5cf6d7 | ||
|
4275199cf2 | ||
|
e3c5b8a2cc | ||
|
bce799cabd | ||
|
6280cc4ef1 | ||
|
cae67b0137 | ||
|
fdc985a261 | ||
|
4fd04af3ea | ||
|
238d54a194 | ||
|
eb49420052 | ||
|
4e647efb2c | ||
|
42743def8d | ||
|
8d14b21ad8 | ||
|
0356107ea7 | ||
|
49c4da89f9 | ||
|
a3d00edf60 | ||
|
74869fa77f | ||
|
d439747564 | ||
|
815cf8e045 | ||
|
b1d869adc0 | ||
|
07dde1e137 | ||
|
ab5951ebd8 | ||
|
fdd615eab8 | ||
|
b2367f2fe4 | ||
|
8eab1f88ce | ||
|
ef4baf95c6 | ||
|
77d94b25c9 | ||
|
304393e66a | ||
|
bdcae2f62f | ||
|
14b1d416d1 | ||
|
bc825f4cae | ||
|
2b2345c763 | ||
|
aaf703fd8d | ||
|
b6f8bf157d | ||
|
9804bc515e | ||
|
6e4d474796 | ||
|
58fcf95b9a | ||
|
a9cf7ff058 | ||
|
f95f0a3f2c | ||
|
3a96ad631e | ||
|
6cd27fe498 | ||
|
ac87d69e3c | ||
|
ac0fa7830e | ||
|
f21ce58780 | ||
|
11e414795b | ||
|
cb7322ea01 | ||
|
d0ba9f4a5c | ||
|
ff12e67060 | ||
|
612af9b6e7 | ||
|
24d81687eb | ||
|
e06e6991be | ||
|
1f3a4fecb2 | ||
|
e019caa4ad | ||
|
cc68f59215 | ||
|
e068f39556 | ||
|
9d5b24e2b0 |
20 changed files with 5327 additions and 2095 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
vendor
|
||||
composer.lock
|
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -1,3 +0,0 @@
|
|||
[submodule "wp-common"]
|
||||
path = wp-common
|
||||
url = https://github.com/petermolnar/wp-common.git
|
92
backends/apc.php
Normal file
92
backends/apc.php
Normal file
|
@ -0,0 +1,92 @@
|
|||
<?php
|
||||
|
||||
if (!class_exists('WP_FFPC_Backend_apc')):
|
||||
|
||||
class WP_FFPC_Backend_apc extends WP_FFPC_Backend {
|
||||
|
||||
/**
|
||||
* init apc backend: test APC availability and set alive status
|
||||
*/
|
||||
protected function _init () {
|
||||
/* verify apc functions exist, apc extension is loaded */
|
||||
if ( ! function_exists( 'apc_cache_info' ) ) {
|
||||
$this->log ( 'APC extension missing' );
|
||||
return false;
|
||||
}
|
||||
|
||||
/* verify apc is working */
|
||||
if ( apc_cache_info("user",true) ) {
|
||||
$this->log ( 'backend OK' );
|
||||
$this->alive = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* health checker for APC
|
||||
*
|
||||
* @return boolean Aliveness status
|
||||
*
|
||||
*/
|
||||
protected function _status () {
|
||||
$this->status = true;
|
||||
return $this->alive;
|
||||
}
|
||||
|
||||
/**
|
||||
* get function for APC backend
|
||||
*
|
||||
* @param string $key Key to get values for
|
||||
*
|
||||
* @return mixed Fetched data based on key
|
||||
*
|
||||
*/
|
||||
protected function _get ( &$key ) {
|
||||
return apc_fetch( $key );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set function for APC backend
|
||||
*
|
||||
* @param string $key Key to set with
|
||||
* @param mixed $data Data to set
|
||||
*
|
||||
* @return boolean APC store outcome
|
||||
*/
|
||||
protected function _set ( &$key, &$data, &$expire ) {
|
||||
return apc_store( $key , $data , $expire );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Flushes APC user entry storage
|
||||
*
|
||||
* @return boolean APC flush outcome status
|
||||
*
|
||||
*/
|
||||
protected function _flush ( ) {
|
||||
return apc_clear_cache('user');
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes entry from APC or flushes APC user entry storage
|
||||
*
|
||||
* @param mixed $keys Keys to clear, string or array
|
||||
*/
|
||||
protected function _clear ( &$keys ) {
|
||||
/* make an array if only one string is present, easier processing */
|
||||
if ( !is_array ( $keys ) )
|
||||
$keys = array ( $keys => true );
|
||||
|
||||
foreach ( $keys as $key => $dummy ) {
|
||||
if ( ! apc_delete ( $key ) ) {
|
||||
$this->log ( sprintf( 'Failed to delete APC entry: %s', $key ), LOG_WARNING );
|
||||
//throw new Exception ( __translate__('Deleting APC entry failed with key ', $this->plugin_constant ) . $key );
|
||||
}
|
||||
else {
|
||||
$this->log ( sprintf( 'APC entry delete: %s', $key ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
endif;
|
92
backends/apcu.php
Normal file
92
backends/apcu.php
Normal file
|
@ -0,0 +1,92 @@
|
|||
<?php
|
||||
|
||||
if (!class_exists('WP_FFPC_Backend_apcu')):
|
||||
|
||||
class WP_FFPC_Backend_apcu extends WP_FFPC_Backend {
|
||||
|
||||
/**
|
||||
* init apcu backend: test APCu availability and set alive status
|
||||
*/
|
||||
protected function _init () {
|
||||
/* verify apcu functions exist, apcu extension is loaded */
|
||||
if ( ! function_exists( 'apcu_cache_info' ) ) {
|
||||
$this->log ( 'APCu extension missing' );
|
||||
return false;
|
||||
}
|
||||
|
||||
/* verify apcu is working */
|
||||
if ( @apcu_cache_info("user") != false ) {
|
||||
$this->log ( 'backend OK' );
|
||||
$this->alive = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* health checker for APC
|
||||
*
|
||||
* @return boolean Aliveness status
|
||||
*
|
||||
*/
|
||||
protected function _status () {
|
||||
$this->status = true;
|
||||
return $this->alive;
|
||||
}
|
||||
|
||||
/**
|
||||
* get function for APC backend
|
||||
*
|
||||
* @param string $key Key to get values for
|
||||
*
|
||||
* @return mixed Fetched data based on key
|
||||
*
|
||||
*/
|
||||
protected function _get ( &$key ) {
|
||||
return apcu_fetch( $key );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set function for APC backend
|
||||
*
|
||||
* @param string $key Key to set with
|
||||
* @param mixed $data Data to set
|
||||
*
|
||||
* @return boolean APC store outcome
|
||||
*/
|
||||
protected function _set ( &$key, &$data, &$expire ) {
|
||||
return apcu_store( $key , $data , $expire );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Flushes APC user entry storage
|
||||
*
|
||||
* @return boolean APC flush outcome status
|
||||
*
|
||||
*/
|
||||
protected function _flush ( ) {
|
||||
return apcu_clear_cache();
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes entry from APC or flushes APC user entry storage
|
||||
*
|
||||
* @param mixed $keys Keys to clear, string or array
|
||||
*/
|
||||
protected function _clear ( &$keys ) {
|
||||
/* make an array if only one string is present, easier processing */
|
||||
if ( !is_array ( $keys ) )
|
||||
$keys = array ( $keys => true );
|
||||
|
||||
foreach ( $keys as $key => $dummy ) {
|
||||
if ( ! apcu_delete ( $key ) ) {
|
||||
$this->log ( sprintf( 'Failed to delete APC entry: %s', $key ), LOG_WARNING );
|
||||
//throw new Exception ( __translate__('Deleting APC entry failed with key ', 'wp-ffpc' ) . $key );
|
||||
}
|
||||
else {
|
||||
$this->log ( sprintf( 'APC entry delete: %s', $key ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
endif;
|
122
backends/memcache.php
Normal file
122
backends/memcache.php
Normal file
|
@ -0,0 +1,122 @@
|
|||
<?php
|
||||
|
||||
if (!class_exists('WP_FFPC_Backend_memcache')):
|
||||
|
||||
class WP_FFPC_Backend_memcache extends WP_FFPC_Backend {
|
||||
/**
|
||||
* init memcache backend
|
||||
*/
|
||||
protected function _init () {
|
||||
/* Memcached class does not exist, Memcache extension is not available */
|
||||
if (!class_exists('Memcache')) {
|
||||
$this->log ( 'PHP Memcache extension missing', LOG_WARNING );
|
||||
return false;
|
||||
}
|
||||
|
||||
/* check for existing server list, otherwise we cannot add backends */
|
||||
if ( empty ( $this->options['servers'] ) && ! $this->alive ) {
|
||||
$this->log ( "servers list is empty, init failed", LOG_WARNING );
|
||||
return false;
|
||||
}
|
||||
|
||||
/* check is there's no backend connection yet */
|
||||
if ( $this->connection === NULL )
|
||||
$this->connection = new Memcache();
|
||||
|
||||
/* check if initialization was success or not */
|
||||
if ( $this->connection === NULL ) {
|
||||
$this->log ( 'error initializing Memcache PHP extension, exiting' );
|
||||
return false;
|
||||
}
|
||||
|
||||
/* adding servers */
|
||||
foreach ( $this->options['servers'] as $server_id => $server ) {
|
||||
/* in case of unix socket */
|
||||
if ( $server['port'] === 0 )
|
||||
$this->status[$server_id] = $this->connection->connect ( 'unix:/' . $server['host'] );
|
||||
else
|
||||
$this->status[$server_id] = $this->connection->connect ( $server['host'] , $server['port'] );
|
||||
|
||||
$this->log ( sprintf( '%s added', $server_id ) );
|
||||
}
|
||||
|
||||
/* backend is now alive */
|
||||
$this->alive = true;
|
||||
$this->_status();
|
||||
}
|
||||
|
||||
/**
|
||||
* check current backend alive status for Memcached
|
||||
*
|
||||
*/
|
||||
protected function _status () {
|
||||
/* server status will be calculated by getting server stats */
|
||||
$this->log ( "checking server statuses" );
|
||||
/* get servers statistic from connection */
|
||||
foreach ( $this->options['servers'] as $server_id => $server ) {
|
||||
if ( $server['port'] === 0 )
|
||||
$this->status[$server_id] = $this->connection->getServerStatus( $server['host'], 11211 );
|
||||
else
|
||||
$this->status[$server_id] = $this->connection->getServerStatus( $server['host'], $server['port'] );
|
||||
if ( $this->status[$server_id] == 0 )
|
||||
$this->log ( sprintf( '%s server is down', $server_id ) );
|
||||
else
|
||||
$this->log ( sprintf( '%s server is up & running', $server_id ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get function for Memcached backend
|
||||
*
|
||||
* @param string $key Key to get values for
|
||||
*
|
||||
*/
|
||||
protected function _get ( &$key ) {
|
||||
return $this->connection->get($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set function for Memcached backend
|
||||
*
|
||||
* @param string $key Key to set with
|
||||
* @param mixed $data Data to set
|
||||
*
|
||||
*/
|
||||
protected function _set ( &$key, &$data, &$expire ) {
|
||||
$result = $this->connection->set ( $key, $data , 0 , $expire );
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Flush memcached entries
|
||||
*/
|
||||
protected function _flush ( ) {
|
||||
return $this->connection->flush();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Removes entry from Memcached or flushes Memcached storage
|
||||
*
|
||||
* @param mixed $keys String / array of string of keys to delete entries with
|
||||
*/
|
||||
protected function _clear ( &$keys ) {
|
||||
/* make an array if only one string is present, easier processing */
|
||||
if ( !is_array ( $keys ) )
|
||||
$keys = array ( $keys => true );
|
||||
|
||||
foreach ( $keys as $key => $dummy ) {
|
||||
$kresult = $this->connection->delete( $key );
|
||||
|
||||
if ( $kresult === false ) {
|
||||
$this->log ( sprintf( 'unable to delete entry: %s', $key ) );
|
||||
}
|
||||
else {
|
||||
$this->log ( sprintf( 'entry deleted: %s', $key ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
endif;
|
159
backends/memcached.php
Normal file
159
backends/memcached.php
Normal file
|
@ -0,0 +1,159 @@
|
|||
<?php
|
||||
|
||||
if (!class_exists('WP_FFPC_Backend_memcached')):
|
||||
|
||||
class WP_FFPC_Backend_memcached extends WP_FFPC_Backend {
|
||||
|
||||
protected function _init () {
|
||||
/* Memcached class does not exist, Memcached extension is not available */
|
||||
if (!class_exists('Memcached')) {
|
||||
$this->log ( ' Memcached extension missing, wp-ffpc will not be able to function correctly!', LOG_WARNING );
|
||||
return false;
|
||||
}
|
||||
|
||||
/* check for existing server list, otherwise we cannot add backends */
|
||||
if ( empty ( $this->options['servers'] ) && ! $this->alive ) {
|
||||
$this->log ( "Memcached servers list is empty, init failed", LOG_WARNING );
|
||||
return false;
|
||||
}
|
||||
|
||||
/* check is there's no backend connection yet */
|
||||
if ( $this->connection === NULL ) {
|
||||
$this->connection = new Memcached();
|
||||
|
||||
/* use binary and not compressed format, good for nginx and still fast */
|
||||
$this->connection->setOption( Memcached::OPT_COMPRESSION , false );
|
||||
if ($this->options['memcached_binary']){
|
||||
$this->connection->setOption( Memcached::OPT_BINARY_PROTOCOL , true );
|
||||
}
|
||||
|
||||
if ( version_compare( phpversion( 'memcached' ) , '2.0.0', '>=' ) && ini_get( 'memcached.use_sasl' ) == 1 && isset($this->options['authpass']) && !empty($this->options['authpass']) && isset($this->options['authuser']) && !empty($this->options['authuser']) ) {
|
||||
$this->connection->setSaslAuthData ( $this->options['authuser'], $this->options['authpass']);
|
||||
}
|
||||
}
|
||||
|
||||
/* check if initialization was success or not */
|
||||
if ( $this->connection === NULL ) {
|
||||
$this->log ( 'error initializing Memcached PHP extension, exiting' );
|
||||
return false;
|
||||
}
|
||||
|
||||
/* check if we already have list of servers, only add server(s) if it's not already connected */
|
||||
$servers_alive = array();
|
||||
if ( !empty ( $this->status ) ) {
|
||||
$servers_alive = $this->connection->getServerList();
|
||||
/* create check array if backend servers are already connected */
|
||||
if ( !empty ( $servers ) ) {
|
||||
foreach ( $servers_alive as $skey => $server ) {
|
||||
$skey = $server['host'] . ":" . $server['port'];
|
||||
$servers_alive[ $skey ] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* adding servers */
|
||||
foreach ( $this->options['servers'] as $server_id => $server ) {
|
||||
/* reset server status to unknown */
|
||||
//$this->status[$server_id] = -1;
|
||||
|
||||
/* only add servers that does not exists already in connection pool */
|
||||
if ( !@array_key_exists($server_id , $servers_alive ) ) {
|
||||
$this->connection->addServer( $server['host'], $server['port'] );
|
||||
$this->log ( sprintf( '%s added', $server_id ) );
|
||||
}
|
||||
}
|
||||
|
||||
/* backend is now alive */
|
||||
$this->alive = true;
|
||||
$this->_status();
|
||||
}
|
||||
|
||||
/**
|
||||
* sets current backend alive status for Memcached servers
|
||||
*
|
||||
*/
|
||||
protected function _status () {
|
||||
/* server status will be calculated by getting server stats */
|
||||
$this->log ( "checking server statuses");
|
||||
/* get server list from connection */
|
||||
$servers = $this->connection->getServerList();
|
||||
|
||||
foreach ( $servers as $server ) {
|
||||
$server_id = $server['host'] . self::port_separator . $server['port'];
|
||||
/* reset server status to offline */
|
||||
$this->status[$server_id] = 0;
|
||||
if ($this->connection->set('wp-ffpc', time())) {
|
||||
$this->log ( sprintf( '%s server is up & running', $server_id ) );
|
||||
$this->status[$server_id] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* get function for Memcached backend
|
||||
*
|
||||
* @param string $key Key to get values for
|
||||
*
|
||||
*/
|
||||
protected function _get ( &$key ) {
|
||||
return $this->connection->get($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set function for Memcached backend
|
||||
*
|
||||
* @param string $key Key to set with
|
||||
* @param mixed $data Data to set
|
||||
*
|
||||
*/
|
||||
protected function _set ( &$key, &$data, &$expire ) {
|
||||
$result = $this->connection->set ( $key, $data , $expire );
|
||||
|
||||
/* if storing failed, log the error code */
|
||||
if ( $result === false ) {
|
||||
$code = $this->connection->getResultCode();
|
||||
$this->log ( sprintf( 'unable to set entry: %s', $key ) );
|
||||
$this->log ( sprintf( 'Memcached error code: %s', $code ) );
|
||||
//throw new Exception ( 'Unable to store Memcached entry ' . $key . ', error code: ' . $code );
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Flush memcached entries
|
||||
*/
|
||||
protected function _flush ( ) {
|
||||
return $this->connection->flush();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Removes entry from Memcached or flushes Memcached storage
|
||||
*
|
||||
* @param mixed $keys String / array of string of keys to delete entries with
|
||||
*/
|
||||
protected function _clear ( &$keys ) {
|
||||
|
||||
/* make an array if only one string is present, easier processing */
|
||||
if ( !is_array ( $keys ) )
|
||||
$keys = array ( $keys => true );
|
||||
|
||||
foreach ( $keys as $key => $dummy ) {
|
||||
$kresult = $this->connection->delete( $key );
|
||||
|
||||
if ( $kresult === false ) {
|
||||
$code = $this->connection->getResultCode();
|
||||
$this->log ( sprintf( 'unable to delete entry: %s', $key ) );
|
||||
$this->log ( sprintf( 'Memcached error code: %s', $code ) );
|
||||
}
|
||||
else {
|
||||
$this->log ( sprintf( 'entry deleted: %s', $key ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
endif;
|
11
composer.json
Normal file
11
composer.json
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"name": "petermolnar/wp-ffpc",
|
||||
"type": "wordpress-plugin",
|
||||
"homepage": "https://github.com/petermolnar/wp-ffpc",
|
||||
"license": "GPLv3",
|
||||
"description": "WordPress Plugin WP-FFPC",
|
||||
"keywords": ["plugin", "cache", "page cache", "full page cache", "nginx", "memcached", "apc", "speed"],
|
||||
"require": {
|
||||
"composer/installers": "~1.0.0"
|
||||
}
|
||||
}
|
BIN
languages/wp-ffpc-it_IT.mo
Normal file
BIN
languages/wp-ffpc-it_IT.mo
Normal file
Binary file not shown.
759
languages/wp-ffpc-it_IT.po
Normal file
759
languages/wp-ffpc-it_IT.po
Normal file
|
@ -0,0 +1,759 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WP-FFPC\n"
|
||||
"POT-Creation-Date: 2016-04-21 17:14+0200\n"
|
||||
"PO-Revision-Date: 2016-04-21 17:14+0200\n"
|
||||
"Last-Translator: Gabriele Lauricella <gab.lau@gmail.com>\n"
|
||||
"Language-Team: Gabriele Lauricella <gab.lau@gmail.com>\n"
|
||||
"Language: it_IT\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Generator: Poedit 1.8.4\n"
|
||||
"X-Poedit-Basepath: ..\n"
|
||||
"X-Poedit-WPHeader: wp-ffpc.php\n"
|
||||
"X-Poedit-SourceCharset: UTF-8\n"
|
||||
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
|
||||
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
|
||||
"_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
|
||||
"X-Poedit-SearchPath-0: .\n"
|
||||
"X-Poedit-SearchPathExcluded-0: *.js\n"
|
||||
|
||||
#: wp-ffpc-abstract.php:381
|
||||
msgid "Default : "
|
||||
msgstr "Predefinito :"
|
||||
|
||||
#: wp-ffpc-abstract.php:464
|
||||
msgid ""
|
||||
"This plugin helped your business? I'd appreciate a coffee in return :) "
|
||||
"Please!"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-abstract.php:479
|
||||
msgid "Donation for "
|
||||
msgstr "Donazione per"
|
||||
|
||||
#: wp-ffpc-abstract.php:481
|
||||
msgid "Donate via PayPal"
|
||||
msgstr "Dona con PayPal"
|
||||
|
||||
#: wp-ffpc-abstract.php:501
|
||||
#, fuzzy, php-format
|
||||
msgid " – updating network option %s"
|
||||
msgstr "Aggiornamento tema: %s"
|
||||
|
||||
#: wp-ffpc-abstract.php:505
|
||||
#, fuzzy, php-format
|
||||
msgid "- updating option %s"
|
||||
msgstr "Aggiornamento in corso"
|
||||
|
||||
#: wp-ffpc-abstract.php:516
|
||||
#, fuzzy, php-format
|
||||
msgid "- getting network option %s"
|
||||
msgstr "Errore nell'ottenere la struttura della tabella %s"
|
||||
|
||||
#: wp-ffpc-abstract.php:520
|
||||
#, fuzzy, php-format
|
||||
msgid " – getting option %s"
|
||||
msgstr "Errore nell'ottenere la struttura della tabella %s"
|
||||
|
||||
#: wp-ffpc-abstract.php:533
|
||||
#, fuzzy, php-format
|
||||
msgid " – deleting network option %s"
|
||||
msgstr "Amministratore del network: %s"
|
||||
|
||||
#: wp-ffpc-abstract.php:537
|
||||
#, fuzzy, php-format
|
||||
msgid " – deleting option %s"
|
||||
msgstr "eliminazione del file allegato..."
|
||||
|
||||
#: wp-ffpc-abstract.php:614
|
||||
#, php-format
|
||||
msgid "%s"
|
||||
msgstr "%s"
|
||||
|
||||
#: wp-ffpc-class.php:126
|
||||
#, php-format
|
||||
msgid ""
|
||||
"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."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:134
|
||||
msgid "APC"
|
||||
msgstr "APC"
|
||||
|
||||
#: wp-ffpc-class.php:135
|
||||
msgid "APCu"
|
||||
msgstr "APCu"
|
||||
|
||||
#: wp-ffpc-class.php:136
|
||||
msgid "PHP Memcache"
|
||||
msgstr "PHP Memcache"
|
||||
|
||||
#: wp-ffpc-class.php:137
|
||||
msgid "PHP Memcached"
|
||||
msgstr "PHP Memcached"
|
||||
|
||||
#: wp-ffpc-class.php:138
|
||||
msgid "Redis (experimental, it will break!)"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:152
|
||||
#, fuzzy
|
||||
msgid "flush cache"
|
||||
msgstr ""
|
||||
"Importante: Non dimenticare di svuotare la cache usando WP Super Cache "
|
||||
"quando attivi o disattivi la modalità di manutenzione."
|
||||
|
||||
#: wp-ffpc-class.php:153
|
||||
#, fuzzy
|
||||
msgid "only modified post"
|
||||
msgstr "Può essere modificato solo dall'admin o se vuoto"
|
||||
|
||||
#: wp-ffpc-class.php:154
|
||||
msgid "modified post and all related taxonomies"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:159
|
||||
msgid "The HTTP scheme (i.e. http, https)."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:160
|
||||
msgid ""
|
||||
"Host in the header of request or name of the server processing the request "
|
||||
"if the Host header is not available."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:161
|
||||
msgid ""
|
||||
"The *original* request URI as received from the client including the args"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:162
|
||||
msgid "Name of user, authenticated by the Auth Basic Module"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:163
|
||||
msgid "PHP Session Cookie ID, if set ( empty if not )"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:164
|
||||
msgid "First HTTP Accept Lang set in the HTTP request"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:174
|
||||
msgid "do not use timed precache"
|
||||
msgstr "non utilizzare il precache temporizzato"
|
||||
|
||||
#: wp-ffpc-class.php:221
|
||||
msgid "WP-FFPC Settings"
|
||||
msgstr "WP-FFPC Impostazioni"
|
||||
|
||||
#: wp-ffpc-class.php:226
|
||||
msgid ""
|
||||
"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."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:230
|
||||
#, php-format
|
||||
msgid ""
|
||||
"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!"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:234
|
||||
#, php-format
|
||||
msgid ""
|
||||
"Advanced cache file (%s) is not writeable!<br />Please change the "
|
||||
"permissions on the file."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:238
|
||||
#, php-format
|
||||
msgid "Advanced cache file is yet to be generated, please save %s"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:243
|
||||
#, php-format
|
||||
msgid ""
|
||||
"%s cache backend activated but no PHP %s extension was found.<br />Please "
|
||||
"either use different backend or activate the module!"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:254
|
||||
msgid ""
|
||||
"WARNING: Memcache extension is configured to use binary mode. This is very "
|
||||
"buggy and the plugin will most probably not work correctly. <br />Please "
|
||||
"consider to change either to ASCII mode or to Memcached extension."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:307
|
||||
msgid ""
|
||||
"WP-FFPC settings were upgraded; please double check if everything is still "
|
||||
"working correctly."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:362
|
||||
msgid ""
|
||||
"<p>Please visit <a href=\"http://wordpress.org/support/plugin/wp-ffpc\">the "
|
||||
"official support forum of the plugin</a> for help.</p>"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:386
|
||||
msgid "<h3>Sample config for nginx to utilize the data entries</h3>"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:387
|
||||
msgid ""
|
||||
"<div class=\"update-nag\">This is not meant to be a copy-paste "
|
||||
"configuration; you most probably have to tailor it to your needs.</div>"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:388
|
||||
msgid ""
|
||||
"<div class=\"update-nag\"><strong>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 <a href=\"http://wiki.nginx.org/HttpSetMiscModule"
|
||||
"\">HttpSetMiscModule</a>. Otherwise set_sha1 function is not available in "
|
||||
"nginx.</strong></div>"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:393
|
||||
msgid "nginx example"
|
||||
msgstr "esempio nginx"
|
||||
|
||||
#: wp-ffpc-class.php:443
|
||||
msgid "Settings saved."
|
||||
msgstr "Impostazioni salvate."
|
||||
|
||||
#: wp-ffpc-class.php:450
|
||||
#, fuzzy
|
||||
msgid "Plugin options deleted."
|
||||
msgstr "OPZIONI CANCELLATE!"
|
||||
|
||||
#: wp-ffpc-class.php:457
|
||||
msgid "Cache flushed."
|
||||
msgstr "Cache svuotata."
|
||||
|
||||
#: wp-ffpc-class.php:464
|
||||
msgid ""
|
||||
"Precache process was started, it is now running in the background, please be "
|
||||
"patient, it may take a very long time to finish."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:472
|
||||
msgid " settings"
|
||||
msgstr " impostazioni"
|
||||
|
||||
#: wp-ffpc-class.php:475
|
||||
msgid "Driver: "
|
||||
msgstr "Driver: "
|
||||
|
||||
#: wp-ffpc-class.php:480
|
||||
msgid "<strong>Backend status:</strong><br />"
|
||||
msgstr "<strong>Stato Backend:</strong><br />"
|
||||
|
||||
#: wp-ffpc-class.php:490
|
||||
msgid "<span class=\"error-msg\">down</span><br />"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:492
|
||||
msgid "<span class=\"ok-msg\">up & running</span><br />"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:494
|
||||
msgid ""
|
||||
"<span class=\"error-msg\">unknown, please try re-saving settings!</span><br /"
|
||||
">"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:513
|
||||
#, fuzzy
|
||||
msgid "Set cache type"
|
||||
msgstr "Tipo di cache:"
|
||||
|
||||
#: wp-ffpc-class.php:516
|
||||
msgid "Select backend"
|
||||
msgstr "Selezionare un backend:"
|
||||
|
||||
#: wp-ffpc-class.php:522
|
||||
msgid "Select backend storage driver"
|
||||
msgstr "Selezionare il driver di backend"
|
||||
|
||||
#: wp-ffpc-class.php:526
|
||||
msgid "Expiration time for posts"
|
||||
msgstr "Tempo di scadenza per Articoli e Pagine"
|
||||
|
||||
#: wp-ffpc-class.php:530
|
||||
msgid ""
|
||||
"Sets validity time of post entry in seconds, including custom post types and "
|
||||
"pages."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:534
|
||||
#, fuzzy
|
||||
msgid "Browser cache expiration time of posts"
|
||||
msgstr "Tempo di scadenza cache (secondi)"
|
||||
|
||||
#: wp-ffpc-class.php:538
|
||||
msgid "Sets validity time of posts/pages/singles for the browser cache."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:542
|
||||
#, fuzzy
|
||||
msgid "Expiration time for taxonomy"
|
||||
msgstr "Tempo di scadenza cache (secondi)"
|
||||
|
||||
#: wp-ffpc-class.php:546
|
||||
msgid ""
|
||||
"Sets validity time of taxonomy entry in seconds, including custom taxonomy."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:550
|
||||
#, fuzzy
|
||||
msgid "Browser cache expiration time of taxonomy"
|
||||
msgstr "Tempo di scadenza cache (secondi)"
|
||||
|
||||
#: wp-ffpc-class.php:554
|
||||
msgid "Sets validity time of taxonomy for the browser cache."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:558
|
||||
msgid "Expiration time for home"
|
||||
msgstr "Tempo di scadenza per Homepage"
|
||||
|
||||
#: wp-ffpc-class.php:562
|
||||
msgid "Sets validity time of home on server side."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:566
|
||||
#, fuzzy
|
||||
msgid "Browser cache expiration time of home"
|
||||
msgstr "Tempo di scadenza cache (secondi)"
|
||||
|
||||
#: wp-ffpc-class.php:570
|
||||
msgid "Sets validity time of home for the browser cache."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:574
|
||||
msgid "Charset"
|
||||
msgstr "Codifica di caratteri"
|
||||
|
||||
#: wp-ffpc-class.php:578
|
||||
msgid "Charset of HTML and XML (pages and feeds) data."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:582
|
||||
#, fuzzy
|
||||
msgid "Cache invalidation method"
|
||||
msgstr "Metodo di spedizione:"
|
||||
|
||||
#: wp-ffpc-class.php:588
|
||||
msgid "Select cache invalidation method."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:604
|
||||
#, fuzzy
|
||||
msgid "Invalidate on comment actions"
|
||||
msgstr "Azioni Multiple"
|
||||
|
||||
#: wp-ffpc-class.php:608
|
||||
msgid "Trigger cache invalidation when a comments is posted, edited, trashed. "
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:612
|
||||
msgid "Data prefix"
|
||||
msgstr "Prefisso dati"
|
||||
|
||||
#: wp-ffpc-class.php:616
|
||||
msgid ""
|
||||
"Prefix for HTML content keys, can be used in nginx.<br /><strong>WARNING</"
|
||||
"strong>: changing this will result the previous cache to becomes invalid!"
|
||||
"<br />If you are caching with nginx, you should update your nginx "
|
||||
"configuration and reload nginx after changing this value."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:620
|
||||
msgid "Meta prefix"
|
||||
msgstr "Prefisso meta"
|
||||
|
||||
#: wp-ffpc-class.php:624
|
||||
msgid ""
|
||||
"Prefix for meta content keys, used only with PHP processing.<br /"
|
||||
"><strong>WARNING</strong>: changing this will result the previous cache to "
|
||||
"becomes invalid!"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:628
|
||||
msgid "Key scheme"
|
||||
msgstr "Schema Chiave"
|
||||
|
||||
#: wp-ffpc-class.php:632
|
||||
msgid ""
|
||||
"Key layout; <strong>use the guide below to change it</strong>.<br /"
|
||||
"><strong>WARNING</strong>: changing this will result the previous cache to "
|
||||
"becomes invalid!<br />If you are caching with nginx, you should update your "
|
||||
"nginx configuration and reload nginx after changing this value."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:641
|
||||
msgid "SHA1 hash key"
|
||||
msgstr "Hash Chiavi in SHA1"
|
||||
|
||||
#: wp-ffpc-class.php:645
|
||||
msgid ""
|
||||
"Occasionally URL can be too long to be used as key for the backend storage, "
|
||||
"especially with memcached. Turn on this feature to use SHA1 hash of the URL "
|
||||
"as key instead. Please be aware that you have to add ( or uncomment ) a line "
|
||||
"and a <strong>module</strong> in nginx if you want nginx to fetch the data "
|
||||
"directly; for details, please see the nginx example tab."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:654
|
||||
msgid "Debug & in-depth settings"
|
||||
msgstr "Debug & Impostazioni Avanzate"
|
||||
|
||||
#: wp-ffpc-class.php:655
|
||||
msgid "Notes"
|
||||
msgstr "Note"
|
||||
|
||||
#: wp-ffpc-class.php:656
|
||||
msgid ""
|
||||
"The former method of debug logging flag has been removed. In case you need "
|
||||
"debug log from WP-FFPC please set both the <a href=\"http://codex.wordpress."
|
||||
"org/WP_DEBUG\">WP_DEBUG</a> and the WP_FFPC__DEBUG_MODE constants `true` in "
|
||||
"wp-config.php.<br /> This will enable NOTICE level messages apart from the "
|
||||
"WARNING level ones which are always displayed."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:660
|
||||
msgid "Enable X-Pingback header preservation"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:664
|
||||
msgid "Preserve X-Pingback URL in response header."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:668
|
||||
msgid "Add X-Cache-Engine header"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:672
|
||||
msgid "Add X-Cache-Engine HTTP header to HTTP responses."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:676
|
||||
#, fuzzy
|
||||
msgid "Add HTML debug comment"
|
||||
msgstr "Aggiungere un nuovo commento"
|
||||
|
||||
#: wp-ffpc-class.php:680
|
||||
msgid ""
|
||||
"Adds comment string including plugin name, cache engine and page generation "
|
||||
"time to every generated entry before closing <body> tag."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:688
|
||||
msgid "Set cache additions/excepions"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:691
|
||||
msgid "Enable cache for logged in users"
|
||||
msgstr "Abilitare la cache per gli utenti registrati"
|
||||
|
||||
#: wp-ffpc-class.php:695
|
||||
msgid "Cache pages even if user is logged in."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:699
|
||||
msgid "Excludes"
|
||||
msgstr "Esclusioni"
|
||||
|
||||
#: wp-ffpc-class.php:704
|
||||
msgid "Exclude home"
|
||||
msgstr "Escludi Homepage"
|
||||
|
||||
#: wp-ffpc-class.php:705
|
||||
msgid "Exclude feeds"
|
||||
msgstr "Escludi Feed"
|
||||
|
||||
#: wp-ffpc-class.php:706
|
||||
msgid "Exclude archives"
|
||||
msgstr "Escludi Archivi"
|
||||
|
||||
#: wp-ffpc-class.php:707
|
||||
msgid "Exclude pages"
|
||||
msgstr "Escludi Pagine"
|
||||
|
||||
#: wp-ffpc-class.php:708
|
||||
#, fuzzy
|
||||
msgid "Exclude singulars"
|
||||
msgstr "Escludi"
|
||||
|
||||
#: wp-ffpc-class.php:709
|
||||
msgid "Dynamic requests"
|
||||
msgstr "Richieste dinamiche"
|
||||
|
||||
#: wp-ffpc-class.php:710
|
||||
msgid "WooCommerce"
|
||||
msgstr "WooCommerce"
|
||||
|
||||
#: wp-ffpc-class.php:717
|
||||
msgid "Never cache home."
|
||||
msgstr "Nessuna cache per la homepage."
|
||||
|
||||
#: wp-ffpc-class.php:721
|
||||
msgid "Never cache feeds."
|
||||
msgstr "Nessuna cache per i Feed."
|
||||
|
||||
#: wp-ffpc-class.php:725
|
||||
msgid "Never cache archives."
|
||||
msgstr "Nessuna cache per gli Archivi."
|
||||
|
||||
#: wp-ffpc-class.php:729
|
||||
msgid "Never cache pages."
|
||||
msgstr "Nessuna cache per le Pagine."
|
||||
|
||||
#: wp-ffpc-class.php:733
|
||||
#, fuzzy
|
||||
msgid "Never cache singulars."
|
||||
msgstr "Cache"
|
||||
|
||||
#: wp-ffpc-class.php:737
|
||||
#, fuzzy
|
||||
msgid "Exclude every URL with \"?\" in it."
|
||||
msgstr "Escludi"
|
||||
|
||||
#: wp-ffpc-class.php:742
|
||||
msgid "Exclude dynamic WooCommerce page."
|
||||
msgstr "Escludere la pagine dinamiche di WooCommerce."
|
||||
|
||||
#: wp-ffpc-class.php:750
|
||||
#, fuzzy
|
||||
msgid "Exclude based on cookies"
|
||||
msgstr "Escludi"
|
||||
|
||||
#: wp-ffpc-class.php:754
|
||||
msgid ""
|
||||
"Exclude content based on cookies names starting with this from caching. "
|
||||
"Separate multiple cookies names with commas.<br />If you are caching with "
|
||||
"nginx, you should update your nginx configuration and reload nginx after "
|
||||
"changing this value."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:758
|
||||
msgid "Don't cache following URL paths - use with caution!"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:766
|
||||
msgid "Regular expressions use you must! e.g. <em>pattern1|pattern2|etc</em>"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:770
|
||||
msgid "Exclude from cache based on content"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:774
|
||||
msgid ""
|
||||
"Enter a regex pattern that will trigger excluding content from caching. Eg. "
|
||||
"<!--nocache-->. Regular expressions use you must! e.g. <em>pattern1|pattern2|"
|
||||
"etc</em><br />\n"
|
||||
"\t\t\t\t\t<strong>WARNING:</strong> 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."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:782
|
||||
#, fuzzy
|
||||
msgid "Backend server settings"
|
||||
msgstr "Impostazioni di backend"
|
||||
|
||||
#: wp-ffpc-class.php:785
|
||||
msgid "Hosts"
|
||||
msgstr "Host"
|
||||
|
||||
#: wp-ffpc-class.php:790
|
||||
msgid ""
|
||||
"List of backends, with the following syntax: <br />- 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 : .<br />- for a unix "
|
||||
"socket enter: unix://[socket_path]"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:793
|
||||
msgid "Authentication ( only for SASL enabled Memcached or Redis)"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:796
|
||||
msgid ""
|
||||
"WARNING: you've entered username and/or password for memcached "
|
||||
"authentication ( or your browser's autocomplete did ) which will not work "
|
||||
"unless you enable memcached sasl in the PHP settings: add `memcached."
|
||||
"use_sasl=1` to php.ini"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:799
|
||||
#, fuzzy
|
||||
msgid "Authentication: username"
|
||||
msgstr "Autenticazione non riuscita"
|
||||
|
||||
#: wp-ffpc-class.php:804
|
||||
#, fuzzy
|
||||
msgid "Username for authentication with backends"
|
||||
msgstr "Nome utente"
|
||||
|
||||
#: wp-ffpc-class.php:808
|
||||
#, fuzzy
|
||||
msgid "Authentication: password"
|
||||
msgstr "Autenticazione non riuscita"
|
||||
|
||||
#: wp-ffpc-class.php:813
|
||||
msgid ""
|
||||
"Password for authentication with for backends - WARNING, the password will "
|
||||
"be stored in an unsecure format!"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:816
|
||||
msgid "Memcached specific settings"
|
||||
msgstr "Impostazioni specifiche Memcached"
|
||||
|
||||
#: wp-ffpc-class.php:818
|
||||
#, fuzzy
|
||||
msgid "Enable memcached binary mode"
|
||||
msgstr "Abilita la modalità assistita"
|
||||
|
||||
#: wp-ffpc-class.php:822
|
||||
msgid ""
|
||||
"Some memcached proxies and implementations only support the ASCII protocol."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:830
|
||||
msgid "Precache settings & log from previous pre-cache generation"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:833
|
||||
msgid "Precache schedule"
|
||||
msgstr "Pianificazione precache"
|
||||
|
||||
#: wp-ffpc-class.php:839
|
||||
msgid "Schedule autorun for precache with WP-Cron"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:860
|
||||
msgid "No precache log was found!"
|
||||
msgstr "Non è stato trovato alcun registro precache!"
|
||||
|
||||
#: wp-ffpc-class.php:863
|
||||
msgid "Time of run: "
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:887
|
||||
msgid "Save Changes"
|
||||
msgstr "Salva modifiche"
|
||||
|
||||
#: wp-ffpc-class.php:897 wp-ffpc-class.php:903 wp-ffpc-class.php:919
|
||||
#: wp-ffpc-class.php:930
|
||||
msgid "Precache"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:898
|
||||
msgid "Empty cache"
|
||||
msgstr "Svuota la cache"
|
||||
|
||||
#: wp-ffpc-class.php:899
|
||||
msgid "Reset settings"
|
||||
msgstr "Azzerare impostazioni"
|
||||
|
||||
#: wp-ffpc-class.php:907
|
||||
msgid ""
|
||||
"Precache functionality is disabled due to unavailable system call function. "
|
||||
"<br />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: "
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:910
|
||||
msgid "Pre-cache"
|
||||
msgstr "Pre-cache"
|
||||
|
||||
#: wp-ffpc-class.php:914
|
||||
msgid ""
|
||||
"Start a background process that visits all permalinks of all blogs it can "
|
||||
"found thus forces WordPress to generate cached version of all the pages.<br /"
|
||||
">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."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:922
|
||||
msgid "Clear cache"
|
||||
msgstr "Elimina Cache"
|
||||
|
||||
#: wp-ffpc-class.php:925
|
||||
msgid ""
|
||||
"Clear all entries in the storage, including the ones that were set by other "
|
||||
"processes."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:933
|
||||
msgid "Reset options"
|
||||
msgstr "Ripristina le opzioni"
|
||||
|
||||
#: wp-ffpc-class.php:936
|
||||
#, fuzzy
|
||||
msgid "Reset settings to defaults."
|
||||
msgstr "Reimposta impostazioni"
|
||||
|
||||
#: wp-ffpc-class.php:947
|
||||
msgid "Cache type"
|
||||
msgstr "Tipo di cache:"
|
||||
|
||||
#: wp-ffpc-class.php:948
|
||||
msgid "Debug & in-depth"
|
||||
msgstr "Debug & Avanzate"
|
||||
|
||||
#: wp-ffpc-class.php:949
|
||||
msgid "Cache exceptions"
|
||||
msgstr "Eccezioni della cache"
|
||||
|
||||
#: wp-ffpc-class.php:950
|
||||
msgid "Backend settings"
|
||||
msgstr "Impostazioni di backend"
|
||||
|
||||
#: wp-ffpc-class.php:951
|
||||
msgid "Precache & precache log"
|
||||
msgstr "Pre-cache & Registro"
|
||||
|
||||
#: wp-ffpc-class.php:968
|
||||
#, fuzzy
|
||||
msgid "Scheduling WP-CRON event"
|
||||
msgstr "Ultima esecuzione giornaliera di WP-Cron: %s"
|
||||
|
||||
#: wp-ffpc-class.php:972
|
||||
msgid "Clearing WP-CRON scheduled hook "
|
||||
msgstr ""
|
||||
|
||||
#. Plugin Name of the plugin/theme
|
||||
msgid "WP-FFPC"
|
||||
msgstr "WP-FFPC"
|
||||
|
||||
#. Plugin URI of the plugin/theme
|
||||
msgid "https://github.com/petermolnar/wp-ffpc"
|
||||
msgstr "https://github.com/petermolnar/wp-ffpc"
|
||||
|
||||
#. Description of the plugin/theme
|
||||
msgid "WordPress in-memory full page cache plugin"
|
||||
msgstr ""
|
||||
|
||||
#. Author of the plugin/theme
|
||||
msgid "Peter Molnar <hello@petermolnar.eu>"
|
||||
msgstr "Peter Molnar <hello@petermolnar.eu>"
|
||||
|
||||
#. Author URI of the plugin/theme
|
||||
msgid "http://petermolnar.eu/"
|
||||
msgstr "http://petermolnar.eu/"
|
735
languages/wp-ffpc.pot
Normal file
735
languages/wp-ffpc.pot
Normal file
|
@ -0,0 +1,735 @@
|
|||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
||||
"Project-Id-Version: WP-FFPC\n"
|
||||
"POT-Creation-Date: 2016-04-21 17:14+0200\n"
|
||||
"PO-Revision-Date: 2016-04-21 15:44+0200\n"
|
||||
"Last-Translator: Gabriele Lauricella <gab.lau@gmail.com>\n"
|
||||
"Language-Team: Gabriele Lauricella <gab.lau@gmail.com>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 1.8.4\n"
|
||||
"X-Poedit-Basepath: ..\n"
|
||||
"X-Poedit-WPHeader: wp-ffpc.php\n"
|
||||
"X-Poedit-SourceCharset: UTF-8\n"
|
||||
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
|
||||
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
|
||||
"_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
|
||||
"X-Poedit-SearchPath-0: .\n"
|
||||
"X-Poedit-SearchPathExcluded-0: *.js\n"
|
||||
|
||||
#: wp-ffpc-abstract.php:381
|
||||
msgid "Default : "
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-abstract.php:464
|
||||
msgid ""
|
||||
"This plugin helped your business? I'd appreciate a coffee in return :) "
|
||||
"Please!"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-abstract.php:479
|
||||
msgid "Donation for "
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-abstract.php:481
|
||||
msgid "Donate via PayPal"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-abstract.php:501
|
||||
#, php-format
|
||||
msgid " – updating network option %s"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-abstract.php:505
|
||||
#, php-format
|
||||
msgid "- updating option %s"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-abstract.php:516
|
||||
#, php-format
|
||||
msgid "- getting network option %s"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-abstract.php:520
|
||||
#, php-format
|
||||
msgid " – getting option %s"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-abstract.php:533
|
||||
#, php-format
|
||||
msgid " – deleting network option %s"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-abstract.php:537
|
||||
#, php-format
|
||||
msgid " – deleting option %s"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-abstract.php:614
|
||||
#, php-format
|
||||
msgid "%s"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:126
|
||||
#, php-format
|
||||
msgid ""
|
||||
"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."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:134
|
||||
msgid "APC"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:135
|
||||
msgid "APCu"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:136
|
||||
msgid "PHP Memcache"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:137
|
||||
msgid "PHP Memcached"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:138
|
||||
msgid "Redis (experimental, it will break!)"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:152
|
||||
msgid "flush cache"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:153
|
||||
msgid "only modified post"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:154
|
||||
msgid "modified post and all related taxonomies"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:159
|
||||
msgid "The HTTP scheme (i.e. http, https)."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:160
|
||||
msgid ""
|
||||
"Host in the header of request or name of the server processing the request "
|
||||
"if the Host header is not available."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:161
|
||||
msgid ""
|
||||
"The *original* request URI as received from the client including the args"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:162
|
||||
msgid "Name of user, authenticated by the Auth Basic Module"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:163
|
||||
msgid "PHP Session Cookie ID, if set ( empty if not )"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:164
|
||||
msgid "First HTTP Accept Lang set in the HTTP request"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:174
|
||||
msgid "do not use timed precache"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:221
|
||||
msgid "WP-FFPC Settings"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:226
|
||||
msgid ""
|
||||
"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."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:230
|
||||
#, php-format
|
||||
msgid ""
|
||||
"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!"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:234
|
||||
#, php-format
|
||||
msgid ""
|
||||
"Advanced cache file (%s) is not writeable!<br />Please change the "
|
||||
"permissions on the file."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:238
|
||||
#, php-format
|
||||
msgid "Advanced cache file is yet to be generated, please save %s"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:243
|
||||
#, php-format
|
||||
msgid ""
|
||||
"%s cache backend activated but no PHP %s extension was found.<br />Please "
|
||||
"either use different backend or activate the module!"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:254
|
||||
msgid ""
|
||||
"WARNING: Memcache extension is configured to use binary mode. This is very "
|
||||
"buggy and the plugin will most probably not work correctly. <br />Please "
|
||||
"consider to change either to ASCII mode or to Memcached extension."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:307
|
||||
msgid ""
|
||||
"WP-FFPC settings were upgraded; please double check if everything is still "
|
||||
"working correctly."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:362
|
||||
msgid ""
|
||||
"<p>Please visit <a href=\"http://wordpress.org/support/plugin/wp-ffpc\">the "
|
||||
"official support forum of the plugin</a> for help.</p>"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:386
|
||||
msgid "<h3>Sample config for nginx to utilize the data entries</h3>"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:387
|
||||
msgid ""
|
||||
"<div class=\"update-nag\">This is not meant to be a copy-paste "
|
||||
"configuration; you most probably have to tailor it to your needs.</div>"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:388
|
||||
msgid ""
|
||||
"<div class=\"update-nag\"><strong>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 <a href=\"http://wiki.nginx.org/HttpSetMiscModule"
|
||||
"\">HttpSetMiscModule</a>. Otherwise set_sha1 function is not available in "
|
||||
"nginx.</strong></div>"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:393
|
||||
msgid "nginx example"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:443
|
||||
msgid "Settings saved."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:450
|
||||
msgid "Plugin options deleted."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:457
|
||||
msgid "Cache flushed."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:464
|
||||
msgid ""
|
||||
"Precache process was started, it is now running in the background, please be "
|
||||
"patient, it may take a very long time to finish."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:472
|
||||
msgid " settings"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:475
|
||||
msgid "Driver: "
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:480
|
||||
msgid "<strong>Backend status:</strong><br />"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:490
|
||||
msgid "<span class=\"error-msg\">down</span><br />"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:492
|
||||
msgid "<span class=\"ok-msg\">up & running</span><br />"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:494
|
||||
msgid ""
|
||||
"<span class=\"error-msg\">unknown, please try re-saving settings!</span><br /"
|
||||
">"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:513
|
||||
msgid "Set cache type"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:516
|
||||
msgid "Select backend"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:522
|
||||
msgid "Select backend storage driver"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:526
|
||||
msgid "Expiration time for posts"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:530
|
||||
msgid ""
|
||||
"Sets validity time of post entry in seconds, including custom post types and "
|
||||
"pages."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:534
|
||||
msgid "Browser cache expiration time of posts"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:538
|
||||
msgid "Sets validity time of posts/pages/singles for the browser cache."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:542
|
||||
msgid "Expiration time for taxonomy"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:546
|
||||
msgid ""
|
||||
"Sets validity time of taxonomy entry in seconds, including custom taxonomy."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:550
|
||||
msgid "Browser cache expiration time of taxonomy"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:554
|
||||
msgid "Sets validity time of taxonomy for the browser cache."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:558
|
||||
msgid "Expiration time for home"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:562
|
||||
msgid "Sets validity time of home on server side."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:566
|
||||
msgid "Browser cache expiration time of home"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:570
|
||||
msgid "Sets validity time of home for the browser cache."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:574
|
||||
msgid "Charset"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:578
|
||||
msgid "Charset of HTML and XML (pages and feeds) data."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:582
|
||||
msgid "Cache invalidation method"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:588
|
||||
msgid "Select cache invalidation method."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:604
|
||||
msgid "Invalidate on comment actions"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:608
|
||||
msgid "Trigger cache invalidation when a comments is posted, edited, trashed. "
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:612
|
||||
msgid "Data prefix"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:616
|
||||
msgid ""
|
||||
"Prefix for HTML content keys, can be used in nginx.<br /><strong>WARNING</"
|
||||
"strong>: changing this will result the previous cache to becomes invalid!"
|
||||
"<br />If you are caching with nginx, you should update your nginx "
|
||||
"configuration and reload nginx after changing this value."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:620
|
||||
msgid "Meta prefix"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:624
|
||||
msgid ""
|
||||
"Prefix for meta content keys, used only with PHP processing.<br /"
|
||||
"><strong>WARNING</strong>: changing this will result the previous cache to "
|
||||
"becomes invalid!"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:628
|
||||
msgid "Key scheme"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:632
|
||||
msgid ""
|
||||
"Key layout; <strong>use the guide below to change it</strong>.<br /"
|
||||
"><strong>WARNING</strong>: changing this will result the previous cache to "
|
||||
"becomes invalid!<br />If you are caching with nginx, you should update your "
|
||||
"nginx configuration and reload nginx after changing this value."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:641
|
||||
msgid "SHA1 hash key"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:645
|
||||
msgid ""
|
||||
"Occasionally URL can be too long to be used as key for the backend storage, "
|
||||
"especially with memcached. Turn on this feature to use SHA1 hash of the URL "
|
||||
"as key instead. Please be aware that you have to add ( or uncomment ) a line "
|
||||
"and a <strong>module</strong> in nginx if you want nginx to fetch the data "
|
||||
"directly; for details, please see the nginx example tab."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:654
|
||||
msgid "Debug & in-depth settings"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:655
|
||||
msgid "Notes"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:656
|
||||
msgid ""
|
||||
"The former method of debug logging flag has been removed. In case you need "
|
||||
"debug log from WP-FFPC please set both the <a href=\"http://codex.wordpress."
|
||||
"org/WP_DEBUG\">WP_DEBUG</a> and the WP_FFPC__DEBUG_MODE constants `true` in "
|
||||
"wp-config.php.<br /> This will enable NOTICE level messages apart from the "
|
||||
"WARNING level ones which are always displayed."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:660
|
||||
msgid "Enable X-Pingback header preservation"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:664
|
||||
msgid "Preserve X-Pingback URL in response header."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:668
|
||||
msgid "Add X-Cache-Engine header"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:672
|
||||
msgid "Add X-Cache-Engine HTTP header to HTTP responses."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:676
|
||||
msgid "Add HTML debug comment"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:680
|
||||
msgid ""
|
||||
"Adds comment string including plugin name, cache engine and page generation "
|
||||
"time to every generated entry before closing <body> tag."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:688
|
||||
msgid "Set cache additions/excepions"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:691
|
||||
msgid "Enable cache for logged in users"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:695
|
||||
msgid "Cache pages even if user is logged in."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:699
|
||||
msgid "Excludes"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:704
|
||||
msgid "Exclude home"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:705
|
||||
msgid "Exclude feeds"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:706
|
||||
msgid "Exclude archives"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:707
|
||||
msgid "Exclude pages"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:708
|
||||
msgid "Exclude singulars"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:709
|
||||
msgid "Dynamic requests"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:710
|
||||
msgid "WooCommerce"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:717
|
||||
msgid "Never cache home."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:721
|
||||
msgid "Never cache feeds."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:725
|
||||
msgid "Never cache archives."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:729
|
||||
msgid "Never cache pages."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:733
|
||||
msgid "Never cache singulars."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:737
|
||||
msgid "Exclude every URL with \"?\" in it."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:742
|
||||
msgid "Exclude dynamic WooCommerce page."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:750
|
||||
msgid "Exclude based on cookies"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:754
|
||||
msgid ""
|
||||
"Exclude content based on cookies names starting with this from caching. "
|
||||
"Separate multiple cookies names with commas.<br />If you are caching with "
|
||||
"nginx, you should update your nginx configuration and reload nginx after "
|
||||
"changing this value."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:758
|
||||
msgid "Don't cache following URL paths - use with caution!"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:766
|
||||
msgid "Regular expressions use you must! e.g. <em>pattern1|pattern2|etc</em>"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:770
|
||||
msgid "Exclude from cache based on content"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:774
|
||||
msgid ""
|
||||
"Enter a regex pattern that will trigger excluding content from caching. Eg. "
|
||||
"<!--nocache-->. Regular expressions use you must! e.g. <em>pattern1|pattern2|"
|
||||
"etc</em><br />\n"
|
||||
"\t\t\t\t\t<strong>WARNING:</strong> 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."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:782
|
||||
msgid "Backend server settings"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:785
|
||||
msgid "Hosts"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:790
|
||||
msgid ""
|
||||
"List of backends, with the following syntax: <br />- 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 : .<br />- for a unix "
|
||||
"socket enter: unix://[socket_path]"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:793
|
||||
msgid "Authentication ( only for SASL enabled Memcached or Redis)"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:796
|
||||
msgid ""
|
||||
"WARNING: you've entered username and/or password for memcached "
|
||||
"authentication ( or your browser's autocomplete did ) which will not work "
|
||||
"unless you enable memcached sasl in the PHP settings: add `memcached."
|
||||
"use_sasl=1` to php.ini"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:799
|
||||
msgid "Authentication: username"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:804
|
||||
msgid "Username for authentication with backends"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:808
|
||||
msgid "Authentication: password"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:813
|
||||
msgid ""
|
||||
"Password for authentication with for backends - WARNING, the password will "
|
||||
"be stored in an unsecure format!"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:816
|
||||
msgid "Memcached specific settings"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:818
|
||||
msgid "Enable memcached binary mode"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:822
|
||||
msgid ""
|
||||
"Some memcached proxies and implementations only support the ASCII protocol."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:830
|
||||
msgid "Precache settings & log from previous pre-cache generation"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:833
|
||||
msgid "Precache schedule"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:839
|
||||
msgid "Schedule autorun for precache with WP-Cron"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:860
|
||||
msgid "No precache log was found!"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:863
|
||||
msgid "Time of run: "
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:887
|
||||
msgid "Save Changes"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:897 wp-ffpc-class.php:903 wp-ffpc-class.php:919
|
||||
#: wp-ffpc-class.php:930
|
||||
msgid "Precache"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:898
|
||||
msgid "Empty cache"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:899
|
||||
msgid "Reset settings"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:907
|
||||
msgid ""
|
||||
"Precache functionality is disabled due to unavailable system call function. "
|
||||
"<br />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: "
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:910
|
||||
msgid "Pre-cache"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:914
|
||||
msgid ""
|
||||
"Start a background process that visits all permalinks of all blogs it can "
|
||||
"found thus forces WordPress to generate cached version of all the pages.<br /"
|
||||
">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."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:922
|
||||
msgid "Clear cache"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:925
|
||||
msgid ""
|
||||
"Clear all entries in the storage, including the ones that were set by other "
|
||||
"processes."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:933
|
||||
msgid "Reset options"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:936
|
||||
msgid "Reset settings to defaults."
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:947
|
||||
msgid "Cache type"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:948
|
||||
msgid "Debug & in-depth"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:949
|
||||
msgid "Cache exceptions"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:950
|
||||
msgid "Backend settings"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:951
|
||||
msgid "Precache & precache log"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:968
|
||||
msgid "Scheduling WP-CRON event"
|
||||
msgstr ""
|
||||
|
||||
#: wp-ffpc-class.php:972
|
||||
msgid "Clearing WP-CRON scheduled hook "
|
||||
msgstr ""
|
||||
|
||||
#. Plugin Name of the plugin/theme
|
||||
msgid "WP-FFPC"
|
||||
msgstr ""
|
||||
|
||||
#. Plugin URI of the plugin/theme
|
||||
msgid "https://github.com/petermolnar/wp-ffpc"
|
||||
msgstr ""
|
||||
|
||||
#. Description of the plugin/theme
|
||||
msgid "WordPress in-memory full page cache plugin"
|
||||
msgstr ""
|
||||
|
||||
#. Author of the plugin/theme
|
||||
msgid "Peter Molnar <hello@petermolnar.eu>"
|
||||
msgstr ""
|
||||
|
||||
#. Author URI of the plugin/theme
|
||||
msgid "http://petermolnar.eu/"
|
||||
msgstr ""
|
383
readme.txt
383
readme.txt
|
@ -1,39 +1,72 @@
|
|||
=== WP-FFPC ===
|
||||
Contributors: cadeyrn
|
||||
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XU3DG7LLA76WC
|
||||
Tags: cache, page cache, full page cache, nginx, memcached, apc, speed
|
||||
Tags: cache, nginx, memcached, apc
|
||||
Requires at least: 3.0
|
||||
Tested up to: 3.5.2
|
||||
Stable tag: 1.2.2
|
||||
Tested up to: 4.7.2
|
||||
Stable tag: 1.11.2
|
||||
License: GPLv3
|
||||
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
Fastest way of cache for WordPress: memcached + nginx!
|
||||
A fast, memory based full page cache plugin supporting APC or memcached.
|
||||
|
||||
== Description ==
|
||||
WP-FFPC ( WordPress Fast Full Page Cache ) is a cache plugin for [WordPress](http://wordpress.org/ "WordPress"). It works with any webserver, including apache2, lighttpd, nginx, however, can be connected with [NGiNX](http://NGiNX.org "NGiNX") through memcached for unbeatable speed.
|
||||
Supports PHP Memcached, PHP Memcache and APC as storage engines, subdomain and domain based WordPress Networks.
|
||||
|
||||
**WARNING** The development of WP-FFPC had been put on hold.
|
||||
If you need new features, please send code and pull requests to [WP FFPC @ Github](https://github.com/petermolnar/wp-ffpc).
|
||||
|
||||
*A short why: I developed this plugin in 2010 to support my own site. Right now, as it is, it's working on a few sites I still maintain for friends and since I don't need any additional features, I'm not planning to extend it with things I have no real use of. During the past years I've received some heartwarming donations - unfortunately the amount never came close to consider the project financially beneficial. I removed the donation links and put it on hold for now.*
|
||||
|
||||
|
||||
WP-FFPC is a cache plugin for [WordPress](http://wordpress.org/ "WordPress").
|
||||
It works with any webserver, including, but not limited to, apache2, lighttpd, nginx.
|
||||
|
||||
It can be configured together with [NGiNX](http://NGiNX.org "NGiNX") but use [memcached plugin](http://nginx.org/en/docs/http/ngx_http_memcached_module.html "memcached plugin") directly from the webserver, bypassing PHP.
|
||||
|
||||
= Requirements =
|
||||
|
||||
**This plugin does not kick in right after activation**. You have to adjust the setting in Settings -> WP-FFPC and save the settings.*
|
||||
|
||||
* WordPress >= 3.0
|
||||
* **at least one** of the following for storage backend:
|
||||
* memcached with [PHP Memcached](http://php.net/manual/en/book.memcached.php "Memcached") > 0.1.0
|
||||
* memcached with [PHP Memcache](http://php.net/manual/en/book.memcache.php "Memcache") > 2.1.0
|
||||
* [APC](http://php.net/manual/en/book.apc.php "APC")
|
||||
* [APCu](http://pecl.php.net/package/APCu "APC User Cache")
|
||||
* PHP 5.3+ is really highly recommended, see "Known issues"
|
||||
|
||||
|
||||
= Known issues =
|
||||
|
||||
* errors will not be displayed on the admin section if PHP < 5.3, only in the logs. This is due to the limitations of displaying the errors ( admin_notices is a hook, not a filter ) and due to the lack of proper anonymus functions in older PHP.
|
||||
* **If you're using PHP 5.4+ avoid the APC backend: the plugin with that setup can even make your site slower.** Please use APCu or memcached in this case.
|
||||
|
||||
= Features: =
|
||||
* Wordpress Network support ( for subdomain layout )
|
||||
* cache exclude possibilities ( home, feeds, archieves, pages, singles )
|
||||
|
||||
* various backends
|
||||
* memcached with [PHP Memcached](http://php.net/manual/en/book.memcached.php "Memcached")
|
||||
* memcached with [PHP Memcache](http://php.net/manual/en/book.memcache.php "Memcache")
|
||||
* [APC](http://php.net/manual/en/book.apc.php "APC")
|
||||
* [APCu](http://pecl.php.net/package/APCu "APC User Cache")
|
||||
* cache exclude options ( home, feeds, archives, pages, singles; regex based url exclusion )
|
||||
* minor Woocommerce support
|
||||
* (optional) cache for logged-in users
|
||||
* 404 caching
|
||||
* canonical redirects caching
|
||||
* Last Modified HTTP header support ( for 304 responses )
|
||||
* Last Modified HTTP header support (for 304 responses)
|
||||
* shortlink HTTP header preservation
|
||||
* pingback HTTP header preservation
|
||||
* talkative log for [WP_DEBUG](http://codex.wordpress.org/WP_DEBUG "WP_DEBUG")
|
||||
* multiple memcached upstream support
|
||||
* precache ( manually or by timed by wp-cron )
|
||||
* [NGiNX](http://NGiNX.org "NGiNX") compatibility
|
||||
* varying expiration time for posts, taxonomies and home
|
||||
* (**warning**: untested since WordPress 3.8) Wordpress Network support
|
||||
* fully supported domain/subdomain based WordPress Networks on per site setup as well
|
||||
* will work in Network Enabled mode only for subdirectory based Multisites ( per site settings will not work in this case )
|
||||
|
||||
Many thanks for contributors, supporters, testers & bug reporters:
|
||||
|
||||
* [Harold Kyle](https://github.com/haroldkyle "Harold Kyle")
|
||||
* [Eric Gilette](http://www.ericgillette.com/ "Eric Gilette")
|
||||
* [doconeill](http://wordpress.org/support/profile/doconeill "doconeill")
|
||||
* [Mark Costlow](mailto:cheeks@swcp.com "Mark Costlow").
|
||||
Many thanks for donations, contributors, supporters, testers & bug reporters:
|
||||
|
||||
Harold Kyle, Eric Gilette, doconeill, Mark Costlow, Jason Miller, Dave Clark, Miguel Clara, Anton Pelešev, Firas Dib, CotswoldPhoto, tamagokun, Many Ayromlou, mailgarant.nl, Christian Rößner, Ameir Abdeldayem, Alvaro Gonzalez, Meint Post, Knut Sparhell, Christian Kernbeis, Gausden Barry, Maksim Bukreyeu, Lissome Hong Kong Limited, Gabriele Lauricella, 7th Veil, LLC, Julia Harsch, Grant Berntsen, Jorgen Ilstad, Cinema Minima for Movie Makers Worldwide
|
||||
|
||||
== Installation ==
|
||||
|
||||
|
@ -50,32 +83,27 @@ A short configuration example is generated on the plugin settings page, under `N
|
|||
|
||||
== Frequently Asked Questions ==
|
||||
|
||||
= How to use the plugin on Amazon Linux? =
|
||||
You have to remove the default yum package, named `php-pecl-memcache` and install `Memcached` through PECL.
|
||||
= The plugin is not working! =
|
||||
|
||||
= How to use the plugin in a WordPress Network =
|
||||
From version 1.0, the plugin supports subdomain based WordPress Network with possible different per site cache settings. If the plugin is network active, obviously the network wide settings will be used for all of the sites. If it's activated only on some of the sites, the other will not be affected and even the cache storage backend can be different from site to site.
|
||||
Did you save the settings as mentioned in this document?
|
||||
Do you have at lest one supported backend?
|
||||
|
||||
= What are the plugin's requirements? =
|
||||
= It's making my site slower than it was! =
|
||||
|
||||
* WordPress >= 3.0
|
||||
So far this only happened if PHP 5.4 or higher was used with APC.
|
||||
Please avoid this setup; PHP 5.4 shipped opcache and APC is full of bugs since then. Use APCu with PHP 5.4+.
|
||||
|
||||
and **at least one** of the following for storage backend:
|
||||
= Does it support mobile theme switching? =
|
||||
|
||||
* PHP APC
|
||||
* PHP Memcached > 0.1.0
|
||||
* PHP Memcache > 2.1.0
|
||||
No, it doesn't, and with the way it's currently working, it never will.
|
||||
WP-FFPC is using the URL as key for caching, so it can't differentiate if there is no change in the URL.
|
||||
*(I personally also disagree with separation of mobile and non-mobile theme; you need to support a plethora of screen sizes and resolutions, so just use responsive designs instead of splitted logics.)*
|
||||
|
||||
= How logging works in the plugin? =
|
||||
Log levels by default ( if logging enabled ) includes warning and error level standard PHP messages.
|
||||
Additional info level log is available when [WP_DEBUG](http://codex.wordpress.org/WP_DEBUG "WP_DEBUG") is enabled.
|
||||
= Can you please add '(insert shiny new feature here)'? =
|
||||
|
||||
= How can I contribute? =
|
||||
In order to make contributions a lot easier, I've moved the plugin development to [GitHub](https://github.com/petermolnar/wp-ffpc "GitHub"), feel free to fork and put shiny, new things in it and get in touch with me [hello@petermolnar.eu](mailto:hello@petermolnar.eu "hello@petermolnar.eu") when you have it ready.
|
||||
Sure. Send me a code and a pull request on [WP FFPC @ Github](https://github.com/petermolnar/wp-ffpc).
|
||||
Unfortunately I don't have the resources to code it myself, but there are plenty of WordPress developers who would probably do it for a minor fee.
|
||||
|
||||
= Where can I turn for support? =
|
||||
I provide support for the plugin as best as I can, but it comes without guarantee.
|
||||
Please post feature requests to [WP-FFPC feature request topic](http://wordpress.org/support/topic/feature-requests-14 "WP-FFPC feature request topic") and any questions on the forum.
|
||||
|
||||
== Screenshots ==
|
||||
|
||||
|
@ -87,6 +115,291 @@ Please post feature requests to [WP-FFPC feature request topic](http://wordpress
|
|||
|
||||
== Changelog ==
|
||||
|
||||
Version numbering logic:
|
||||
|
||||
* every A. indicates BIG changes.
|
||||
* every .B version indicates new features.
|
||||
* every ..C indicates bugfixes for A.B version.
|
||||
|
||||
= 1.11.2 =
|
||||
*2017-02-08*
|
||||
|
||||
* annoying typos in text
|
||||
|
||||
= 1.11.1 =
|
||||
*2017-02-08*
|
||||
|
||||
* exclude cache for WooCommerce
|
||||
* fix load textdomain
|
||||
* add Italian (it_IT) translation
|
||||
* nonexistent redis support removed (it never got to a usable stable state, mostly due to the chaos with the redis php modules)
|
||||
* readme cleaned up for development hibernation
|
||||
* donation link removed
|
||||
* WP version compatibility bumped
|
||||
|
||||
= 1.11.0 =
|
||||
*2016-01-15*
|
||||
|
||||
* merged filter for HTML before it hits the cache
|
||||
* refactored logging
|
||||
|
||||
= 1.10.1 =
|
||||
*2015-10-30*
|
||||
|
||||
* fixed nginx configuration sample snippets
|
||||
* nginx configuration moved from Settings tab to Help tab, so if you're looking for the "nginx" tab, you need to look under "Help" on the WP-FFPC Settings page.
|
||||
|
||||
= 1.10.0 =
|
||||
*2015-10-23*
|
||||
|
||||
*IMPORTANT, READ THIS*
|
||||
|
||||
* Proper browser cache support:
|
||||
* new options to set real browser cache expiry for singles, taxonomy and home
|
||||
* added Etag support based on browser cache expiry
|
||||
* added proper Expires header according to cache entry generation time + browser cache expiry
|
||||
* added support for Last Modified header for home & taxonomy ( singles already had it) based on the last post modified date within the taxonomy
|
||||
|
||||
= 1.9.1 =
|
||||
*2015-10-18*
|
||||
|
||||
* bugfix for is_writable check failures ( see: https://wordpress.org/support/topic/settings-saved-but-getting-not-saved-error-message)
|
||||
* bugfix for memcached.protocol notice
|
||||
* typo fixes
|
||||
* replace variable with string constant in translatable messages
|
||||
|
||||
= 1.9.0 =
|
||||
*2015-10-14*
|
||||
|
||||
* adding exclude option based on text entry matching ( regex )
|
||||
|
||||
= 1.8.4 =
|
||||
*2015-10-13*
|
||||
|
||||
* changes in HTML debug comment: instead of the former, single comment, now 2 comments are added. The first is added when the cache entry is generated; the second only appears if the page was served from the cached entry. Please note that this last bit will - should - change with every single refresh.
|
||||
* backend code is now split into separate files
|
||||
* more debug code
|
||||
|
||||
= 1.8.3 =
|
||||
*2015-05-07*
|
||||
|
||||
* small change in key creation: prefix is kept in front of sha1 hashes for debugging purposes
|
||||
|
||||
= 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*
|
||||
|
||||
* fixing the wrong release of 1.8.0
|
||||
|
||||
= 1.8.0 =
|
||||
*2015-04-29*
|
||||
|
||||
What's new:
|
||||
|
||||
* backend keys are now sha1 hashes instead of full url; this is to prevent too long key error with memcached
|
||||
|
||||
Under the hood:
|
||||
* wp-common is removed; no more git submodules
|
||||
* logging method changed
|
||||
|
||||
= 1.7.9 =
|
||||
*2015-02-02*
|
||||
|
||||
What's new:
|
||||
|
||||
* detailed log messages for other log message clarification
|
||||
* added auto-upgrade for advanced-cache.php on plugin upgrade
|
||||
|
||||
|
||||
= 1.7.8 =
|
||||
*2015-01-30*
|
||||
|
||||
What's new:
|
||||
|
||||
* merged pull request for [wp-ffpc-purge](https://github.com/zeroturnaround/wp-ffpc-purge)
|
||||
|
||||
|
||||
= 1.7.7 =
|
||||
*2015-01-14*
|
||||
|
||||
What's fixed:
|
||||
|
||||
* fixed alert backwards compatibility for PHP < 5.3
|
||||
|
||||
|
||||
= 1.7.6 =
|
||||
*2015-01-09*
|
||||
|
||||
What's fixed:
|
||||
|
||||
* anonymus function call only for PHP 5.3
|
||||
|
||||
= 1.7.5 =
|
||||
*2014-12-29*
|
||||
|
||||
What's fixed:
|
||||
|
||||
* wp-ffpc was not actually alerting when it had issues; this should be fixed now
|
||||
|
||||
This was a really bad bug and it could have cause a lot of issues since the plugin was probably not working in some cases when the alerts went unnoticed. Due to WordPress restrictions on admin_notices hook I had to use PHP features only present since 5.3. Please keep this in mind.
|
||||
|
||||
|
||||
= 1.7.4 =
|
||||
*2014-12-17*
|
||||
|
||||
What's changed:
|
||||
|
||||
* localhost cache forced exclude removed; instead please use `define('WP_CACHE', $_SERVER['REMOTE_ADDR'] !== '127.0.0.1');` instead as pointed out by [plescheff](https://github.com/petermolnar/wp-ffpc/commit/eb4942005273822aec8c2da09f0e763807f94f9c#commitcomment-9006031) if required
|
||||
* compatibility tested up to WordPress 4.1
|
||||
|
||||
= 1.7.3 =
|
||||
*2014-12-17*
|
||||
|
||||
What's fixed:
|
||||
|
||||
* expiration time set to '0' resulted instant expiration instead of infinite keep; fixed now
|
||||
|
||||
= 1.7.2 =
|
||||
*2014-12-08*
|
||||
|
||||
What's changed:
|
||||
|
||||
* merged pull request for memcached proxy compatibility; memcached binary mode if off by default from now on
|
||||
|
||||
= 1.7.1 =
|
||||
*2014-12-04*
|
||||
|
||||
What's fixed:
|
||||
|
||||
* [Unable to determine path from Post Permalink](https://wordpress.org/support/topic/unable-to-determine-path-from-post-permalink) noise fixed
|
||||
* potential Multisite precache bug fixed ( database prefixes were not set according to original prefix )
|
||||
|
||||
What's new:
|
||||
|
||||
* added permanent cache exception of localhost
|
||||
|
||||
What's changed:
|
||||
|
||||
* pingback header preservation is now off by default and can manually be turned on
|
||||
|
||||
= 1.7.0 =
|
||||
*2014-09-19*
|
||||
|
||||
What's new:
|
||||
|
||||
* added varying expiration time options
|
||||
|
||||
What's changed:
|
||||
|
||||
* **dropped Xcache support**: the reasons behind this is the outstandingly terrible documentation of Xcache
|
||||
* **dropped persistent memcache mode**: no one was using it and even if the were only caused trouble
|
||||
* **removed '/wp-' hardcoded cache exception**; this is now the default in the regex exceptions field as ^/wp-; please add this manually in case you've already been using the regex field
|
||||
|
||||
= 1.6.4 =
|
||||
*2014-09-12*
|
||||
|
||||
What's fixed:
|
||||
|
||||
* downgraded log level from halting-level fatal to warning ( thank you PHP for the consistent naming... ) in case the selected extension is missing
|
||||
* leftover code parts cleanup
|
||||
|
||||
= 1.6.3 =
|
||||
*2014-09-12*
|
||||
|
||||
What's fixed:
|
||||
|
||||
* there were still some alway-on log messages
|
||||
|
||||
= 1.6.2 =
|
||||
*2014-09-05*
|
||||
|
||||
What's fixed:
|
||||
|
||||
* merge pulled from [plescheff](https://github.com/petermolnar/wp-ffpc/pull/25)
|
||||
* fixed bug of alway-on log messages ( warning was set to default where notice should have been )
|
||||
|
||||
= 1.6.1 =
|
||||
*2014-09-04*
|
||||
|
||||
What's fixed:
|
||||
|
||||
1.6 release, correcting SVN madness with non-recursive copies.
|
||||
|
||||
= 1.6.0 =
|
||||
*2014-05-30*
|
||||
|
||||
What's new:
|
||||
|
||||
* added functionality to exclude regex urls, contribution from [plescheff](https://github.com/plescheff/wp-ffpc/commit/3c875ad4fe1e083d3968421dd83b9c179c686649)
|
||||
* added functionality to include "?" containing URL
|
||||
|
||||
What's fixed:
|
||||
|
||||
* some warning messages removed in case there's not a single backend installed when the plugin is activated
|
||||
* fixed issue of resetting settings when new version of defaults was released
|
||||
|
||||
Under the hood:
|
||||
|
||||
* major changes to the abstract wp-common class for better interoperability between my plugins
|
||||
|
||||
|
||||
= 1.5.0 =
|
||||
*2014-05-30*
|
||||
|
||||
What's new:
|
||||
|
||||
* APCu backend added ( APCu is a stripped version of APC with only user object cache functionality what can be used with PHP 5.4 & 5.5 besides [Opcache](http://php.net/manual/en/book.opcache.php "PHP Opcache") )
|
||||
|
||||
= 1.4.0 =
|
||||
*2014-05-12*
|
||||
|
||||
What's new:
|
||||
|
||||
* Xcache backend added ( theoretical, partially tested, volunteer testers required )
|
||||
|
||||
What's fixed:
|
||||
|
||||
* invalidation for comment actions added
|
||||
|
||||
= 1.3.3 =
|
||||
*2014-04-29*
|
||||
|
||||
What's changed:
|
||||
|
||||
* removed broadcast message
|
||||
* better logs ( additional logs and adding translation compatibility )
|
||||
|
||||
= 1.3.2 =
|
||||
*2014-04-09*
|
||||
|
||||
What's fixed:
|
||||
|
||||
* 1.3.1 was a quickfix for an uncommitted change required for 1.3 to work.
|
||||
* removed PHP warning in case WP_CACHE was off ( see https://github.com/petermolnar/wp-ffpc/issues/14 )
|
||||
* PHP notices in log from [Harold Kyle](https://github.com/haroldkyle "Harold Kyle")
|
||||
* ms is really second
|
||||
|
||||
|
||||
= 1.3 =
|
||||
*2014-04-04*
|
||||
|
||||
What's fixed:
|
||||
|
||||
* uninstall will not fail anymore ( and I hate PHP for it's retarted language restrictions )
|
||||
* typo fix for memcache functions from [Dave Clark](https://github.com/dkcwd "Dave Clark")
|
||||
* uninstall security lines from [Dave Clark](https://github.com/dkcwd "Dave Clark")
|
||||
* modification to nginx sample file from [Harold Kyle](https://github.com/haroldkyle "Harold Kyle") to skip all urls with query string present
|
||||
|
||||
What's new:
|
||||
|
||||
* added unix socket memcache module support ( ONLY for memcache backend for now )
|
||||
|
||||
= 1.2.2 =
|
||||
*2013-11-07*
|
||||
|
||||
|
@ -274,4 +587,4 @@ There are major problems with the "memcache" driver, the source is yet unkown. T
|
|||
= 0.1 =
|
||||
*2012-02-16*
|
||||
|
||||
* first public release
|
||||
* first public release
|
|
@ -3,10 +3,13 @@
|
|||
* uninstall file for WP-FFPC; uninstall hook does not remove the databse options
|
||||
*/
|
||||
|
||||
// exit if uninstall not called from WordPress
|
||||
if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/* get the worker file */
|
||||
include_once ( 'wp-ffpc.php' );
|
||||
|
||||
/* run uninstall function */
|
||||
$wp_ffpc->plugin_uninstall();
|
||||
|
||||
?>
|
||||
|
|
194
wp-admin.css
Normal file
194
wp-admin.css
Normal file
|
@ -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 );
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 3f1571dac3eeea09b0c6cfadb9616bb301d3bcf5
|
629
wp-ffpc-abstract.php
Normal file
629
wp-ffpc-abstract.php
Normal file
|
@ -0,0 +1,629 @@
|
|||
<?php
|
||||
|
||||
defined('ABSPATH') or die("Walk away.");
|
||||
|
||||
/* __ only availabe if we're running from the inside of wordpress, not in advanced-cache.php phase */
|
||||
if ( !function_exists ('__translate__') ) {
|
||||
/* __ only availabe if we're running from the inside of wordpress, not in advanced-cache.php phase */
|
||||
if ( function_exists ( '__' ) ) {
|
||||
function __translate__ ( $text, $domain ) { return __($text, $domain); }
|
||||
}
|
||||
else {
|
||||
function __translate__ ( $text, $domain ) { return $text; }
|
||||
}
|
||||
}
|
||||
|
||||
if ( !function_exists ('__debug__') ) {
|
||||
/* __ only availabe if we're running from the inside of wordpress, not in advanced-cache.php phase */
|
||||
function __debug__ ( $text ) {
|
||||
if ( defined('WP_FFPC__DEBUG_MODE') && WP_FFPC__DEBUG_MODE == true)
|
||||
error_log ( __FILE__ . ': ' . $text );
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('WP_FFPC_ABSTRACT')):
|
||||
|
||||
/**
|
||||
* abstract class for common, required functionalities
|
||||
*
|
||||
*/
|
||||
abstract class WP_FFPC_ABSTRACT {
|
||||
|
||||
const slug_save = '&saved=true';
|
||||
const slug_delete = '&deleted=true';
|
||||
const common_slug = 'wp-common/';
|
||||
|
||||
protected $plugin_constant;
|
||||
protected $options = array();
|
||||
protected $defaults = array();
|
||||
protected $status = 0;
|
||||
protected $network = false;
|
||||
protected $settings_link = '';
|
||||
protected $settings_slug = '';
|
||||
protected $plugin_url;
|
||||
protected $plugin_dir;
|
||||
protected $common_url;
|
||||
protected $common_dir;
|
||||
protected $plugin_file;
|
||||
protected $plugin_name;
|
||||
protected $plugin_version;
|
||||
protected $plugin_settings_page;
|
||||
protected $button_save;
|
||||
protected $button_delete;
|
||||
protected $capability = 'manage_options';
|
||||
protected $admin_css_handle;
|
||||
protected $admin_css_url;
|
||||
protected $utils = null;
|
||||
|
||||
protected $donation_business_name;
|
||||
protected $donation_item_name;
|
||||
protected $donation_business_id;
|
||||
protected $donation = false;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*
|
||||
* @param string $plugin_constant General plugin identifier, same as directory & base PHP file name
|
||||
* @param string $plugin_version Version number of the parameter
|
||||
* @param string $plugin_name Readable name of the plugin
|
||||
* @param mixed $defaults Default value(s) for plugin option(s)
|
||||
* @param string $donation_link Donation link of plugin
|
||||
*
|
||||
*/
|
||||
public function __construct( $plugin_constant, $plugin_version, $plugin_name, $defaults, $donation_business_name = false, $donation_item_name = false, $donation_business_id = false ) {
|
||||
|
||||
$this->plugin_constant = $plugin_constant;
|
||||
$this->plugin_file = $this->plugin_constant . '/' . $this->plugin_constant . '.php';
|
||||
|
||||
$this->plugin_version = $plugin_version;
|
||||
$this->plugin_name = $plugin_name;
|
||||
$this->defaults = $defaults;
|
||||
|
||||
$this->plugin_settings_page = $this->plugin_constant .'-settings';
|
||||
|
||||
$this->button_save = $this->plugin_constant . '-save';
|
||||
$this->button_delete = $this->plugin_constant . '-delete';
|
||||
|
||||
if ( !empty( $donation_business_name ) && !empty( $donation_item_name ) && !empty( $donation_business_id ) ) {
|
||||
$this->donation_business_name = $donation_business_name;
|
||||
$this->donation_item_name = $donation_item_name;
|
||||
$this->donation_business_id = $donation_business_id;
|
||||
$this->donation = true;
|
||||
}
|
||||
|
||||
//$this->utils = new PluginUtils();
|
||||
|
||||
/* we need network wide plugin check functions */
|
||||
if ( ! function_exists( 'is_plugin_active_for_network' ) )
|
||||
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
||||
|
||||
/* check if plugin is network-activated */
|
||||
if ( @is_plugin_active_for_network ( $this->plugin_file ) ) {
|
||||
$this->network = true;
|
||||
$this->settings_slug = 'settings.php';
|
||||
}
|
||||
else {
|
||||
$this->settings_slug = 'options-general.php';
|
||||
}
|
||||
|
||||
/* set the settings page link string */
|
||||
$this->settings_link = $this->settings_slug . '?page=' . $this->plugin_settings_page;
|
||||
|
||||
/* initialize plugin, plugin specific init functions */
|
||||
$this->plugin_post_construct();
|
||||
|
||||
add_action( 'init', array(&$this,'plugin_init'));
|
||||
add_action( 'admin_enqueue_scripts', array(&$this,'enqueue_admin_css_js'));
|
||||
add_action( 'plugins_loaded', array(&$this,'plugin_load_textdomain'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* activation hook function, to be extended
|
||||
*/
|
||||
abstract function plugin_activate();
|
||||
|
||||
/**
|
||||
* deactivation hook function, to be extended
|
||||
*/
|
||||
abstract function plugin_deactivate ();
|
||||
|
||||
/**
|
||||
* runs within the __construct, after all the initial settings
|
||||
*/
|
||||
abstract function plugin_post_construct();
|
||||
|
||||
/**
|
||||
* first init hook function, to be extended, before options were read
|
||||
*/
|
||||
abstract function plugin_pre_init();
|
||||
|
||||
/**
|
||||
* second init hook function, to be extended, after options were read
|
||||
*/
|
||||
abstract function plugin_post_init();
|
||||
|
||||
public function plugin_init() {
|
||||
|
||||
/* initialize plugin, plugin specific init functions */
|
||||
$this->plugin_pre_init();
|
||||
|
||||
/* get the options */
|
||||
$this->plugin_options_read();
|
||||
|
||||
register_activation_hook( $this->plugin_file , array( &$this, 'plugin_activate' ) );
|
||||
register_deactivation_hook( $this->plugin_file , array( &$this, 'plugin_deactivate' ) );
|
||||
|
||||
/* register settings pages */
|
||||
if ( $this->network )
|
||||
add_filter( "network_admin_plugin_action_links_" . $this->plugin_file, array( &$this, 'plugin_settings_link' ) );
|
||||
else
|
||||
add_filter( "plugin_action_links_" . $this->plugin_file, array( &$this, 'plugin_settings_link' ) );
|
||||
|
||||
/* register admin init, catches $_POST and adds submenu to admin menu */
|
||||
if ( $this->network )
|
||||
add_action('network_admin_menu', array( &$this , 'plugin_admin_init') );
|
||||
else
|
||||
add_action('admin_menu', array( &$this , 'plugin_admin_init') );
|
||||
|
||||
add_filter('contextual_help', array( &$this, 'plugin_admin_help' ), 10, 2);
|
||||
|
||||
/* setup plugin, plugin specific setup functions that need options */
|
||||
$this->plugin_post_init();
|
||||
}
|
||||
|
||||
/**
|
||||
* admin panel, load plugin textdomain
|
||||
*/
|
||||
public function plugin_load_textdomain() {
|
||||
load_plugin_textdomain( 'wp-ffpc', false , dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* admin panel, the HTML usually
|
||||
*/
|
||||
abstract function plugin_admin_panel();
|
||||
|
||||
/**
|
||||
* admin help menu
|
||||
*/
|
||||
abstract function plugin_admin_help( $contextual_help, $screen_id );
|
||||
|
||||
/**
|
||||
* admin init called by WordPress add_action, needs to be public
|
||||
*/
|
||||
public function plugin_admin_init() {
|
||||
|
||||
/* save parameter updates, if there are any */
|
||||
if ( isset( $_POST[ $this->button_save ] ) && check_admin_referer( 'wp-ffpc') ) {
|
||||
|
||||
$this->plugin_options_save();
|
||||
$this->status = 1;
|
||||
header( "Location: ". $this->settings_link . self::slug_save );
|
||||
}
|
||||
|
||||
/* delete parameters if requested */
|
||||
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 );
|
||||
}
|
||||
|
||||
/* load additional moves */
|
||||
$this->plugin_extend_admin_init();
|
||||
|
||||
/* add submenu to settings pages */
|
||||
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' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* to be extended
|
||||
*
|
||||
*/
|
||||
abstract function plugin_extend_admin_init();
|
||||
|
||||
/**
|
||||
* callback function to add settings link to plugins page
|
||||
*
|
||||
* @param array $links Current links to add ours to
|
||||
*
|
||||
*/
|
||||
public function plugin_settings_link ( $links ) {
|
||||
$settings_link = '<a href="' . $this->settings_link . '">' . __translate__( 'Settings', 'wp-ffpc') . '</a>';
|
||||
array_unshift( $links, $settings_link );
|
||||
return $links;
|
||||
}
|
||||
|
||||
/* add admin styling */
|
||||
public function enqueue_admin_css_js(){
|
||||
/* jquery ui tabs is provided by WordPress */
|
||||
wp_enqueue_script ( "jquery-ui-tabs" );
|
||||
wp_enqueue_script ( "jquery-ui-slider" );
|
||||
|
||||
/* additional admin styling */
|
||||
wp_register_style( $this->admin_css_handle, $this->admin_css_url, array('dashicons'), false, 'all' );
|
||||
wp_enqueue_style( $this->admin_css_handle );
|
||||
}
|
||||
|
||||
/**
|
||||
* deletes saved options from database
|
||||
*/
|
||||
protected function plugin_options_delete () {
|
||||
static::_delete_option ( $this->plugin_constant, $this->network );
|
||||
|
||||
/* additional moves */
|
||||
$this->plugin_extend_options_delete();
|
||||
}
|
||||
|
||||
/**
|
||||
* hook to add functionality into plugin_options_read
|
||||
*/
|
||||
abstract function plugin_extend_options_delete ();
|
||||
|
||||
/**
|
||||
* reads options stored in database and reads merges them with default values
|
||||
*/
|
||||
protected function plugin_options_read () {
|
||||
$options = static::_get_option ( $this->plugin_constant, $this->network );
|
||||
|
||||
/* this is the point to make any migrations from previous versions */
|
||||
$this->plugin_options_migrate( $options );
|
||||
|
||||
/* map missing values from default */
|
||||
foreach ( $this->defaults as $key => $default )
|
||||
if ( !@array_key_exists ( $key, $options ) )
|
||||
$options[$key] = $default;
|
||||
|
||||
/* removed unused keys, rare, but possible */
|
||||
foreach ( @array_keys ( $options ) as $key )
|
||||
if ( !@array_key_exists( $key, $this->defaults ) )
|
||||
unset ( $options[$key] );
|
||||
|
||||
/* any additional read hook */
|
||||
$this->plugin_extend_options_read( $options );
|
||||
|
||||
$this->options = $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* hook for parameter migration, runs right after options read from DB
|
||||
*/
|
||||
abstract function plugin_options_migrate( &$options );
|
||||
|
||||
/**
|
||||
* hook to add functionality into plugin_options_read, runs after defaults check
|
||||
*/
|
||||
abstract function plugin_extend_options_read ( &$options );
|
||||
|
||||
/**
|
||||
* used on update and to save current options to database
|
||||
*
|
||||
* @param boolean $activating [optional] true on activation hook
|
||||
*
|
||||
*/
|
||||
protected function plugin_options_save ( $activating = false ) {
|
||||
|
||||
/* only try to update defaults if it's not activation hook, $_POST is not empty and the post
|
||||
is ours */
|
||||
if ( !$activating && !empty ( $_POST ) && isset( $_POST[ $this->button_save ] ) ) {
|
||||
/* we'll only update those that exist in the defaults array */
|
||||
$options = $this->defaults;
|
||||
|
||||
foreach ( $options as $key => $default )
|
||||
{
|
||||
/* $_POST element is available */
|
||||
if ( !empty( $_POST[$key] ) ) {
|
||||
$update = $_POST[$key];
|
||||
|
||||
/* get rid of slashes in strings, just in case */
|
||||
if ( is_string ( $update ) )
|
||||
$update = stripslashes($update);
|
||||
|
||||
$options[$key] = $update;
|
||||
}
|
||||
/* empty $_POST element: when HTML form posted, empty checkboxes a 0 input
|
||||
values will not be part of the $_POST array, thus we need to check
|
||||
if this is the situation by checking the types of the elements,
|
||||
since a missing value means update from an integer to 0
|
||||
*/
|
||||
elseif ( empty( $_POST[$key] ) && ( is_bool ( $default ) || is_int( $default ) ) ) {
|
||||
$options[$key] = 0;
|
||||
}
|
||||
elseif ( empty( $_POST[$key] ) && is_array( $default) ) {
|
||||
$options[$key] = array();
|
||||
}
|
||||
}
|
||||
|
||||
/* update the options array */
|
||||
$this->options = $options;
|
||||
}
|
||||
|
||||
/* set plugin version */
|
||||
$this->options['version'] = $this->plugin_version;
|
||||
|
||||
/* call hook function for additional moves before saving the values */
|
||||
$this->plugin_extend_options_save( $activating );
|
||||
|
||||
/* save options to database */
|
||||
static::_update_option ( $this->plugin_constant , $this->options, $this->network );
|
||||
}
|
||||
|
||||
/**
|
||||
* hook to add functionality into plugin_options_save
|
||||
*/
|
||||
abstract function plugin_extend_options_save ( $activating );
|
||||
|
||||
/**
|
||||
* function to easily print a variable
|
||||
*
|
||||
* @param mixed $var Variable to dump
|
||||
* @param boolean $ret Return text instead of printing if true
|
||||
*
|
||||
*/
|
||||
protected function print_var ( $var , $ret = false ) {
|
||||
if ( @is_array ( $var ) || @is_object( $var ) || @is_bool( $var ) )
|
||||
$var = var_export ( $var, true );
|
||||
|
||||
if ( $ret )
|
||||
return $var;
|
||||
else
|
||||
echo $var;
|
||||
}
|
||||
|
||||
/**
|
||||
* print value of an element from defaults array
|
||||
*
|
||||
* @param mixed $e Element index of $this->defaults array
|
||||
*
|
||||
*/
|
||||
protected function print_default ( $e ) {
|
||||
_e('Default : ', 'wp-ffpc');
|
||||
$select = 'select_' . $e;
|
||||
if ( @is_array ( $this->$select ) ) {
|
||||
$x = $this->$select;
|
||||
$this->print_var ( $x[ $this->defaults[ $e ] ] );
|
||||
}
|
||||
else {
|
||||
$this->print_var ( $this->defaults[ $e ] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* select options field processor
|
||||
*
|
||||
* @param elements
|
||||
* array to build <option> values of
|
||||
*
|
||||
* @param $current
|
||||
* the current active element
|
||||
*
|
||||
* @param $print
|
||||
* boolean: is true, the options will be printed, otherwise the string will be returned
|
||||
*
|
||||
* @return
|
||||
* prints or returns the options string
|
||||
*
|
||||
*/
|
||||
protected function print_select_options ( $elements, $current, $valid = false, $print = true ) {
|
||||
|
||||
if ( is_array ( $valid ) )
|
||||
$check_disabled = true;
|
||||
else
|
||||
$check_disabled = false;
|
||||
|
||||
$opt = '';
|
||||
foreach ($elements as $value => $name ) {
|
||||
//$disabled .= ( @array_key_exists( $valid[ $value ] ) && $valid[ $value ] == false ) ? ' disabled="disabled"' : '';
|
||||
$opt .= '<option value="' . $value . '" ';
|
||||
$opt .= selected( $value , $current );
|
||||
|
||||
// ugly tree level valid check to prevent array warning messages
|
||||
if ( is_array( $valid ) && isset ( $valid [ $value ] ) && $valid [ $value ] == false )
|
||||
$opt .= ' disabled="disabled"';
|
||||
|
||||
$opt .= '>';
|
||||
$opt .= $name;
|
||||
$opt .= "</option>\n";
|
||||
}
|
||||
|
||||
if ( $print )
|
||||
echo $opt;
|
||||
else
|
||||
return $opt;
|
||||
}
|
||||
|
||||
/**
|
||||
* creates PayPal donation form based on plugin details
|
||||
*
|
||||
*/
|
||||
protected function plugin_donation_form () {
|
||||
if ( $this->donation ) :
|
||||
?>
|
||||
<script>
|
||||
jQuery(document).ready(function($) {
|
||||
jQuery(function() {
|
||||
var select = $( "#amount" );
|
||||
var slider = $( '<div id="donation-slider"></div>' ).insertAfter( select ).slider({
|
||||
min: 1,
|
||||
max: 8,
|
||||
range: "min",
|
||||
value: select[ 0 ].selectedIndex + 1,
|
||||
slide: function( event, ui ) {
|
||||
select[ 0 ].selectedIndex = ui.value - 1;
|
||||
}
|
||||
});
|
||||
$( "#amount" ).change(function() {
|
||||
slider.slider( "value", this.selectedIndex + 1 );
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" class="<?php echo $this->plugin_constant ?>-donation">
|
||||
<label for="amount"><?php _e( "This plugin helped your business? I'd appreciate a coffee in return :) Please!", 'wp-ffpc'); ?></label>
|
||||
<select name="amount" id="amount">
|
||||
<option value="3">3$</option>
|
||||
<option value="5">5$</option>
|
||||
<option value="10" selected="selected">10$</option>
|
||||
<option value="15">15$</option>
|
||||
<option value="30">30$</option>
|
||||
<option value="42">42$</option>
|
||||
<option value="75">75$</option>
|
||||
<option value="100">100$</option>
|
||||
</select>
|
||||
<input type="hidden" id="cmd" name="cmd" value="_donations" />
|
||||
<input type="hidden" id="tax" name="tax" value="0" />
|
||||
<input type="hidden" id="business" name="business" value="<?php echo $this->donation_business_id ?>" />
|
||||
<input type="hidden" id="bn" name="bn" value="<?php echo $this->donation_business_name ?>" />
|
||||
<input type="hidden" id="item_name" name="item_name" value="<?php _e('Donation for ', 'wp-ffpc'); echo $this->donation_item_name ?>" />
|
||||
<input type="hidden" id="currency_code" name="currency_code" value="USD" />
|
||||
<input type="submit" name="submit" value="<?php _e('Donate via PayPal', 'wp-ffpc') ?>" class="button-secondary" />
|
||||
</form>
|
||||
<?php
|
||||
endif;
|
||||
}
|
||||
|
||||
public function getoption ( $key ) {
|
||||
return ( empty ( $this->options[ $key] ) ) ? false : $this->options[ $key];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* UTILS
|
||||
*/
|
||||
/**
|
||||
* option update; will handle network wide or standalone site options
|
||||
*
|
||||
*/
|
||||
public static function _update_option ( $optionID, $data, $network = false ) {
|
||||
if ( $network ) {
|
||||
static::debug( sprintf( __( ' – updating network option %s', 'PluginUtils' ), $optionID ) );
|
||||
update_site_option( $optionID , $data );
|
||||
}
|
||||
else {
|
||||
static::debug( sprintf( __( '- updating option %s', 'PluginUtils' ), $optionID ));
|
||||
update_option( $optionID , $data );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* read option; will handle network wide or standalone site options
|
||||
*
|
||||
*/
|
||||
public static function _get_option ( $optionID, $network = false ) {
|
||||
if ( $network ) {
|
||||
static::debug ( sprintf( __( '- getting network option %s', 'PluginUtils' ), $optionID ) );
|
||||
$options = get_site_option( $optionID );
|
||||
}
|
||||
else {
|
||||
static::debug( sprintf( __( ' – getting option %s', 'PluginUtils' ), $optionID ));
|
||||
$options = get_option( $optionID );
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* clear option; will handle network wide or standalone site options
|
||||
*
|
||||
*/
|
||||
public static function _delete_option ( $optionID, $network = false ) {
|
||||
if ( $network ) {
|
||||
static::debug ( sprintf( __( ' – deleting network option %s', 'PluginUtils' ), $optionID ) );
|
||||
delete_site_option( $optionID );
|
||||
}
|
||||
else {
|
||||
static::debug ( sprintf( __( ' – deleting option %s', 'PluginUtils' ), $optionID ) );
|
||||
delete_option( $optionID );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* read option; will handle network wide or standalone site options
|
||||
*
|
||||
*/
|
||||
public static function _site_url ( $site = '', $network = false ) {
|
||||
if ( $network && !empty( $site ) )
|
||||
$url = get_blog_option ( $site, 'siteurl' );
|
||||
else
|
||||
$url = get_bloginfo ( 'url' );
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* replaces http:// with https:// in an url if server is currently running on https
|
||||
*
|
||||
* @param string $url URL to check
|
||||
*
|
||||
* @return string URL with correct protocol
|
||||
*
|
||||
*/
|
||||
public static function replace_if_ssl ( $url ) {
|
||||
if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' )
|
||||
$_SERVER['HTTPS'] = 'on';
|
||||
|
||||
if ( isset($_SERVER['HTTPS']) && (( strtolower($_SERVER['HTTPS']) == 'on' ) || ( $_SERVER['HTTPS'] == '1' ) ))
|
||||
$url = str_replace ( 'http://' , 'https://' , $url );
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
static function debug( $message, $level = LOG_NOTICE ) {
|
||||
if ( @is_array( $message ) || @is_object ( $message ) )
|
||||
$message = json_encode($message);
|
||||
|
||||
|
||||
switch ( $level ) {
|
||||
case LOG_ERR :
|
||||
wp_die( '<h1>Error:</h1>' . '<p>' . $message . '</p>' );
|
||||
exit;
|
||||
default:
|
||||
if ( !defined( 'WP_DEBUG' ) || WP_DEBUG != true || !defined( 'WP_FFPC__DEBUG_MODE' ) || WP_FFPC__DEBUG_MODE != true )
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
error_log( __CLASS__ . ": " . $message );
|
||||
}
|
||||
|
||||
/**
|
||||
* display formatted alert message
|
||||
*
|
||||
* @param string $msg Error message
|
||||
* @param string $error "level" of error
|
||||
* @param boolean $network WordPress network or not, DEPRECATED
|
||||
*
|
||||
*/
|
||||
static public function alert ( $msg, $level=LOG_WARNING, $network=false ) {
|
||||
if ( empty($msg)) return false;
|
||||
|
||||
switch ($level) {
|
||||
case LOG_ERR:
|
||||
case LOG_WARNING:
|
||||
$css = "error";
|
||||
break;
|
||||
default:
|
||||
$css = "updated";
|
||||
break;
|
||||
}
|
||||
|
||||
$r = '<div class="'. $css .'"><p>'. sprintf ( __('%s', 'PluginUtils' ), $msg ) .'</p></div>';
|
||||
if ( version_compare(phpversion(), '5.3.0', '>=')) {
|
||||
add_action('admin_notices', function() use ($r) { echo $r; }, 10 );
|
||||
}
|
||||
else {
|
||||
global $tmp;
|
||||
$tmp = $r;
|
||||
$f = create_function ( '', 'global $tmp; echo $tmp;' );
|
||||
add_action('admin_notices', $f );
|
||||
}
|
||||
static::debug( $msg, $level );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
endif;
|
|
@ -1,57 +1,91 @@
|
|||
<?php
|
||||
|
||||
defined('ABSPATH') or die("Walk away.");
|
||||
|
||||
/**
|
||||
* advanced cache worker of WordPress plugin WP-FFPC
|
||||
*/
|
||||
|
||||
/* check for WP cache enabled*/
|
||||
if ( !WP_CACHE )
|
||||
return false;
|
||||
function __wp_ffpc_debug__ ( $text ) {
|
||||
if ( defined('WP_FFPC__DEBUG_MODE') && WP_FFPC__DEBUG_MODE == true)
|
||||
error_log ( 'WP_FFPC_ACache' . ': ' . $text );
|
||||
}
|
||||
|
||||
/* check for config */
|
||||
if (!isset($wp_ffpc_config))
|
||||
/* check for WP cache enabled*/
|
||||
if ( !defined('WP_CACHE') || WP_CACHE != true ) {
|
||||
__wp_ffpc_debug__('WP_CACHE is not true');
|
||||
return false;
|
||||
}
|
||||
|
||||
/* no cache for post request (comments, plugins and so on) */
|
||||
if ($_SERVER["REQUEST_METHOD"] == 'POST')
|
||||
if ($_SERVER["REQUEST_METHOD"] == 'POST') {
|
||||
__wp_ffpc_debug__('POST requests are never cached');
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to avoid enabling the cache if sessions are managed
|
||||
* with request parameters and a session is active
|
||||
*/
|
||||
if (defined('SID') && SID != '')
|
||||
if (defined('SID') && SID != '') {
|
||||
__wp_ffpc_debug__('SID found, skipping cache');
|
||||
return false;
|
||||
}
|
||||
|
||||
/* check for config */
|
||||
if (!isset($wp_ffpc_config)) {
|
||||
__wp_ffpc_debug__('wp_ffpc_config variable not found');
|
||||
return false;
|
||||
}
|
||||
|
||||
/* request uri */
|
||||
$wp_ffpc_uri = $_SERVER['REQUEST_URI'];
|
||||
|
||||
/* no cache for uri with query strings, things usually go bad that way */
|
||||
if ( stripos($wp_ffpc_uri, '?') !== false)
|
||||
return false;
|
||||
|
||||
/* no cache for pages starting with /wp- like WP admin */
|
||||
if (stripos($wp_ffpc_uri, '/wp-') !== false)
|
||||
return false;
|
||||
|
||||
/* no cache for robots.txt */
|
||||
if ( stripos($wp_ffpc_uri, 'robots.txt') )
|
||||
if ( stripos($wp_ffpc_uri, 'robots.txt') ) {
|
||||
__wp_ffpc_debug__ ( 'Skippings robots.txt hit');
|
||||
return false;
|
||||
}
|
||||
|
||||
/* multisite files can be too large for memcached */
|
||||
if ( function_exists('is_multisite') && stripos($wp_ffpc_uri, '/files/') )
|
||||
if ( is_multisite() )
|
||||
return false;
|
||||
if ( function_exists('is_multisite') && stripos($wp_ffpc_uri, '/files/') && is_multisite() ) {
|
||||
__wp_ffpc_debug__ ( 'Skippings multisite /files/ hit');
|
||||
return false;
|
||||
}
|
||||
|
||||
/* check if config is network active: use network config */
|
||||
if (!empty ( $wp_ffpc_config['network'] ) )
|
||||
if (!empty ( $wp_ffpc_config['network'] ) ) {
|
||||
$wp_ffpc_config = $wp_ffpc_config['network'];
|
||||
__wp_ffpc_debug__('using "network" level config');
|
||||
}
|
||||
/* check if config is active for site : use site config */
|
||||
elseif ( !empty ( $wp_ffpc_config[ $_SERVER['HTTP_HOST'] ] ) )
|
||||
elseif ( !empty ( $wp_ffpc_config[ $_SERVER['HTTP_HOST'] ] ) ) {
|
||||
$wp_ffpc_config = $wp_ffpc_config[ $_SERVER['HTTP_HOST'] ];
|
||||
__wp_ffpc_debug__("using {$_SERVER['HTTP_HOST']} level config");
|
||||
}
|
||||
/* plugin config not found :( */
|
||||
else
|
||||
else {
|
||||
__wp_ffpc_debug__("no usable config found");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* no cache for WooCommerce URL patterns */
|
||||
if ( isset($wp_ffpc_config['nocache_woocommerce']) && !empty($wp_ffpc_config['nocache_woocommerce']) &&
|
||||
isset($wp_ffpc_config['nocache_woocommerce_url']) && trim($wp_ffpc_config['nocache_woocommerce_url']) ) {
|
||||
$pattern = sprintf('#%s#', trim($wp_ffpc_config['nocache_woocommerce_url']));
|
||||
if ( preg_match($pattern, $wp_ffpc_uri) ) {
|
||||
__wp_ffpc_debug__ ( "Cache exception based on WooCommenrce URL regex pattern matched, skipping");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* no cache for uri with query strings, things usually go bad that way */
|
||||
if ( isset($wp_ffpc_config['nocache_dyn']) && !empty($wp_ffpc_config['nocache_dyn']) && stripos($wp_ffpc_uri, '?') !== false ) {
|
||||
__wp_ffpc_debug__ ( 'Dynamic url cache is disabled ( url with "?" ), skipping');
|
||||
return false;
|
||||
}
|
||||
|
||||
/* check for cookies that will make us not cache the content, like logged in WordPress cookie */
|
||||
if ( isset($wp_ffpc_config['nocache_cookies']) && !empty($wp_ffpc_config['nocache_cookies']) ) {
|
||||
$nocache_cookies = array_map('trim',explode(",", $wp_ffpc_config['nocache_cookies'] ) );
|
||||
|
||||
|
@ -60,6 +94,7 @@ if ( isset($wp_ffpc_config['nocache_cookies']) && !empty($wp_ffpc_config['nocach
|
|||
/* check for any matches to user-added cookies to no-cache */
|
||||
foreach ( $nocache_cookies as $nocache_cookie ) {
|
||||
if( strpos( $n, $nocache_cookie ) === 0 ) {
|
||||
__wp_ffpc_debug__ ( "Cookie exception matched: {$n}, skipping");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -67,11 +102,23 @@ if ( isset($wp_ffpc_config['nocache_cookies']) && !empty($wp_ffpc_config['nocach
|
|||
}
|
||||
}
|
||||
|
||||
/* no cache for excluded URL patterns */
|
||||
if ( isset($wp_ffpc_config['nocache_url']) && trim($wp_ffpc_config['nocache_url']) ) {
|
||||
$pattern = sprintf('#%s#', trim($wp_ffpc_config['nocache_url']));
|
||||
if ( preg_match($pattern, $wp_ffpc_uri) ) {
|
||||
__wp_ffpc_debug__ ( "Cache exception based on URL regex pattern matched, skipping");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* canonical redirect storage */
|
||||
$wp_ffpc_redirect = null;
|
||||
/* fires up the backend storage array with current config */
|
||||
include_once ('wp-ffpc-backend.php');
|
||||
$wp_ffpc_backend = new WP_FFPC_Backend( $wp_ffpc_config );
|
||||
$backend_class = 'WP_FFPC_Backend_' . $wp_ffpc_config['cache_type'];
|
||||
$wp_ffpc_backend = new $backend_class ( $wp_ffpc_config );
|
||||
|
||||
//$wp_ffpc_backend = new WP_FFPC_Backend( $wp_ffpc_config );
|
||||
|
||||
/* no cache for for logged in users unless it's set
|
||||
identifier cookies are listed in backend as var for easier usage
|
||||
|
@ -81,28 +128,34 @@ if ( !isset($wp_ffpc_config['cache_loggedin']) || $wp_ffpc_config['cache_loggedi
|
|||
foreach ($_COOKIE as $n=>$v) {
|
||||
foreach ( $wp_ffpc_backend->cookies as $nocache_cookie ) {
|
||||
if( strpos( $n, $nocache_cookie ) === 0 ) {
|
||||
__wp_ffpc_debug__ ( "No cache for cookie: {$n}, skipping");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* will store time of page generation */
|
||||
$wp_ffpc_gentime = 0;
|
||||
|
||||
/* backend connection failed, no caching :( */
|
||||
if ( $wp_ffpc_backend->status() === false )
|
||||
if ( $wp_ffpc_backend->status() === false ) {
|
||||
__wp_ffpc_debug__ ( "Backend offline");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* try to get data & meta keys for current page */
|
||||
$wp_ffpc_keys = array ( 'meta' => $wp_ffpc_config['prefix_meta'], 'data' => $wp_ffpc_config['prefix_data'] );
|
||||
$wp_ffpc_values = array();
|
||||
|
||||
__wp_ffpc_debug__ ( "Trying to fetch entries");
|
||||
|
||||
foreach ( $wp_ffpc_keys as $internal => $key ) {
|
||||
$value = $wp_ffpc_backend->get ( $wp_ffpc_backend->key ( $key ) );
|
||||
$key = $wp_ffpc_backend->key ( $key );
|
||||
$value = $wp_ffpc_backend->get ( $key );
|
||||
|
||||
if ( ! $value ) {
|
||||
__wp_ffpc_debug__("No cached data found");
|
||||
/* does not matter which is missing, we need both, if one fails, no caching */
|
||||
wp_ffpc_start();
|
||||
return;
|
||||
|
@ -110,19 +163,25 @@ foreach ( $wp_ffpc_keys as $internal => $key ) {
|
|||
else {
|
||||
/* store results */
|
||||
$wp_ffpc_values[ $internal ] = $value;
|
||||
__wp_ffpc_debug__('Got value for ' . $internal);
|
||||
}
|
||||
}
|
||||
|
||||
/* serve cache 404 status */
|
||||
if ( isset( $wp_ffpc_values['meta']['status'] ) && $wp_ffpc_values['meta']['status'] == 404 ) {
|
||||
__wp_ffpc_debug__("Serving 404");
|
||||
header("HTTP/1.1 404 Not Found");
|
||||
// flush();
|
||||
// die();
|
||||
/* if I kill the page serving here, the 404 page will not be showed at all, so we do not do that
|
||||
* flush();
|
||||
* die();
|
||||
*/
|
||||
}
|
||||
|
||||
/* server redirect cache */
|
||||
if ( isset( $wp_ffpc_values['meta']['redirect'] ) && $wp_ffpc_values['meta']['redirect'] ) {
|
||||
__wp_ffpc_debug__("Serving redirect to {$wp_ffpc_values['meta']['redirect']}");
|
||||
header('Location: ' . $wp_ffpc_values['meta']['redirect'] );
|
||||
/* cut the connection as fast as possible */
|
||||
flush();
|
||||
die();
|
||||
}
|
||||
|
@ -132,7 +191,9 @@ if ( array_key_exists( "HTTP_IF_MODIFIED_SINCE" , $_SERVER ) && !empty( $wp_ffpc
|
|||
$if_modified_since = strtotime(preg_replace('/;.*$/', '', $_SERVER["HTTP_IF_MODIFIED_SINCE"]));
|
||||
/* check is cache is still valid */
|
||||
if ( $if_modified_since >= $wp_ffpc_values['meta']['lastmodified'] ) {
|
||||
__wp_ffpc_debug__("Serving 304 Not Modified");
|
||||
header("HTTP/1.0 304 Not Modified");
|
||||
/* connection cut for faster serving */
|
||||
flush();
|
||||
die();
|
||||
}
|
||||
|
@ -144,31 +205,69 @@ if ( array_key_exists( "HTTP_IF_MODIFIED_SINCE" , $_SERVER ) && !empty( $wp_ffpc
|
|||
if (!empty ( $wp_ffpc_values['meta']['mime'] ) )
|
||||
header('Content-Type: ' . $wp_ffpc_values['meta']['mime']);
|
||||
|
||||
/* don't allow browser caching of page */
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0');
|
||||
header('Pragma: no-cache');
|
||||
/* set expiry date */
|
||||
if (isset($wp_ffpc_values['meta']['expire']) && !empty ( $wp_ffpc_values['meta']['expire'] ) ) {
|
||||
$hash = md5 ( $wp_ffpc_uri . $wp_ffpc_values['meta']['expire'] );
|
||||
|
||||
/* expire at this very moment */
|
||||
header('Expires: ' . gmdate("D, d M Y H:i:s", time() ) . " GMT");
|
||||
switch ($wp_ffpc_values['meta']['type']) {
|
||||
case 'home':
|
||||
case 'feed':
|
||||
$expire = $wp_ffpc_config['browsercache_home'];
|
||||
break;
|
||||
case 'archive':
|
||||
$expire = $wp_ffpc_config['browsercache_taxonomy'];
|
||||
break;
|
||||
case 'single':
|
||||
$expire = $wp_ffpc_config['browsercache'];
|
||||
break;
|
||||
default:
|
||||
$expire = 0;
|
||||
}
|
||||
|
||||
header('Cache-Control: public,max-age='.$expire.',s-maxage='.$expire.',must-revalidate');
|
||||
header('Expires: ' . gmdate("D, d M Y H:i:s", $wp_ffpc_values['meta']['expire'] ) . " GMT");
|
||||
header('ETag: '. $hash);
|
||||
unset($expire, $hash);
|
||||
}
|
||||
else {
|
||||
/* in case there is no expiry set, expire immediately and don't serve Etag; browser cache is disabled */
|
||||
header('Expires: ' . gmdate("D, d M Y H:i:s", time() ) . " GMT");
|
||||
/* if I set these, the 304 not modified will never, ever kick in, so not setting these
|
||||
* leaving here as a reminder why it should not be set */
|
||||
//header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0, s-maxage=0, post-check=0, pre-check=0');
|
||||
//header('Pragma: no-cache');
|
||||
}
|
||||
|
||||
/* if shortlinks were set */
|
||||
if (!empty ( $wp_ffpc_values['meta']['shortlink'] ) )
|
||||
if (isset($wp_ffpc_values['meta']['shortlink']) && !empty ( $wp_ffpc_values['meta']['shortlink'] ) )
|
||||
header( 'Link:<'. $wp_ffpc_values['meta']['shortlink'] .'>; rel=shortlink' );
|
||||
|
||||
/* if last modifications were set (for posts & pages) */
|
||||
if ( !empty($wp_ffpc_values['meta']['lastmodified']) )
|
||||
if (isset($wp_ffpc_values['meta']['lastmodified']) && !empty($wp_ffpc_values['meta']['lastmodified']) )
|
||||
header( 'Last-Modified: ' . gmdate("D, d M Y H:i:s", $wp_ffpc_values['meta']['lastmodified'] ). " GMT" );
|
||||
|
||||
/* pingback urls, if existx */
|
||||
if ( !empty( $wp_ffpc_values['meta']['pingback'] ) )
|
||||
if ( isset($wp_ffpc_values['meta']['pingback']) && !empty( $wp_ffpc_values['meta']['pingback'] ) && isset($wp_ffpc_config['pingback_header']) && $wp_ffpc_config['pingback_header'] )
|
||||
header( 'X-Pingback: ' . $wp_ffpc_values['meta']['pingback'] );
|
||||
|
||||
/* for debugging */
|
||||
if ( $wp_ffpc_config['response_header'] )
|
||||
if ( isset($wp_ffpc_config['response_header']) && $wp_ffpc_config['response_header'] )
|
||||
header( 'X-Cache-Engine: WP-FFPC with ' . $wp_ffpc_config['cache_type'] .' via PHP');
|
||||
|
||||
/* HTML data */
|
||||
echo $wp_ffpc_values['data'];
|
||||
if ( isset($wp_ffpc_config['generate_time']) && $wp_ffpc_config['generate_time'] == '1' && stripos($wp_ffpc_values['data'], '</body>') ) {
|
||||
$mtime = explode ( " ", microtime() );
|
||||
$wp_ffpc_gentime = ( $mtime[1] + $mtime[0] ) - $wp_ffpc_gentime;
|
||||
|
||||
$insertion = "\n<!-- WP-FFPC cache output stats\n\tcache engine: ". $wp_ffpc_config['cache_type'] ."\n\tUNIX timestamp: ". time() . "\n\tdate: ". date( 'c' ) . "\n\tfrom server: ". $_SERVER['SERVER_ADDR'] . " -->\n";
|
||||
$index = stripos( $wp_ffpc_values['data'] , '</body>' );
|
||||
|
||||
$wp_ffpc_values['data'] = substr_replace( $wp_ffpc_values['data'], $insertion, $index, 0);
|
||||
}
|
||||
|
||||
__wp_ffpc_debug__("Serving data");
|
||||
echo trim($wp_ffpc_values['data']);
|
||||
|
||||
flush();
|
||||
die();
|
||||
|
||||
|
@ -230,18 +329,99 @@ function wp_ffpc_callback( $buffer ) {
|
|||
if (strlen($buffer) == 0)
|
||||
return '';
|
||||
|
||||
if ( is_home() )
|
||||
$meta['type'] = 'home';
|
||||
elseif (is_feed() )
|
||||
$meta['type'] = 'feed';
|
||||
elseif ( is_archive() )
|
||||
if ( isset($wp_ffpc_config[ 'nocache_comment' ]) && !empty($wp_ffpc_config[ 'nocache_comment' ]) && trim($wp_ffpc_config[ 'nocache_comment' ])) {
|
||||
$pattern = sprintf('#%s#', trim($wp_ffpc_config['nocache_comment']));
|
||||
__wp_ffpc_debug__ ( sprintf("Testing comment with pattern: %s", $pattern));
|
||||
if ( preg_match($pattern, $buffer) ) {
|
||||
__wp_ffpc_debug__ ( "Cache exception based on content regex pattern matched, skipping");
|
||||
return $buffer;
|
||||
}
|
||||
}
|
||||
|
||||
if ( is_home() || is_feed() ) {
|
||||
if (is_home())
|
||||
$meta['type'] = 'home';
|
||||
elseif(is_feed())
|
||||
$meta['type'] = 'feed';
|
||||
|
||||
if (isset($wp_ffpc_config['browsercache_home']) && !empty($wp_ffpc_config['browsercache_home']) && $wp_ffpc_config['browsercache_home'] > 0) {
|
||||
$meta['expire'] = time() + $wp_ffpc_config['browsercache_home'];
|
||||
}
|
||||
|
||||
__wp_ffpc_debug__( 'Getting latest post for for home & feed');
|
||||
/* get newest post and set last modified accordingly */
|
||||
$args = array(
|
||||
'numberposts' => 1,
|
||||
'orderby' => 'modified',
|
||||
'order' => 'DESC',
|
||||
'post_status' => 'publish',
|
||||
);
|
||||
|
||||
$recent_post = wp_get_recent_posts( $args, OBJECT );
|
||||
if ( !empty($recent_post)) {
|
||||
$recent_post = array_pop($recent_post);
|
||||
if (!empty ( $recent_post->post_modified_gmt ) ) {
|
||||
$meta['lastmodified'] = strtotime ( $recent_post->post_modified_gmt );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
elseif ( is_archive() ) {
|
||||
$meta['type'] = 'archive';
|
||||
elseif ( is_single() )
|
||||
if (isset($wp_ffpc_config['browsercache_taxonomy']) && !empty($wp_ffpc_config['browsercache_taxonomy']) && $wp_ffpc_config['browsercache_taxonomy'] > 0) {
|
||||
$meta['expire'] = time() + $wp_ffpc_config['browsercache_taxonomy'];
|
||||
}
|
||||
|
||||
global $wp_query;
|
||||
|
||||
if ( null != $wp_query->tax_query && !empty($wp_query->tax_query)) {
|
||||
__wp_ffpc_debug__( 'Getting latest post for taxonomy: ' . json_encode($wp_query->tax_query));
|
||||
|
||||
$args = array(
|
||||
'numberposts' => 1,
|
||||
'orderby' => 'modified',
|
||||
'order' => 'DESC',
|
||||
'post_status' => 'publish',
|
||||
'tax_query' => $wp_query->tax_query,
|
||||
);
|
||||
|
||||
$recent_post = get_posts( $args, OBJECT );
|
||||
|
||||
if ( !empty($recent_post)) {
|
||||
$recent_post = array_pop($recent_post);
|
||||
if (!empty ( $recent_post->post_modified_gmt ) ) {
|
||||
$meta['lastmodified'] = strtotime ( $recent_post->post_modified_gmt );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
elseif ( is_single() || is_page() ) {
|
||||
$meta['type'] = 'single';
|
||||
elseif ( is_page() )
|
||||
$meta['type'] = 'page';
|
||||
else
|
||||
if (isset($wp_ffpc_config['browsercache']) && !empty($wp_ffpc_config['browsercache']) && $wp_ffpc_config['browsercache'] > 0) {
|
||||
$meta['expire'] = time() + $wp_ffpc_config['browsercache'];
|
||||
}
|
||||
|
||||
/* try if post is available
|
||||
if made with archieve, last listed post can make this go bad
|
||||
*/
|
||||
global $post;
|
||||
if ( !empty($post) && !empty ( $post->post_modified_gmt ) ) {
|
||||
/* get last modification data */
|
||||
$meta['lastmodified'] = strtotime ( $post->post_modified_gmt );
|
||||
|
||||
/* get shortlink, if possible */
|
||||
if (function_exists('wp_get_shortlink')) {
|
||||
$shortlink = wp_get_shortlink( );
|
||||
if (!empty ( $shortlink ) )
|
||||
$meta['shortlink'] = $shortlink;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
$meta['type'] = 'unknown';
|
||||
}
|
||||
|
||||
if ( $meta['type'] != 'unknown' ) {
|
||||
/* check if caching is disabled for page type */
|
||||
|
@ -253,7 +433,7 @@ function wp_ffpc_callback( $buffer ) {
|
|||
}
|
||||
}
|
||||
|
||||
if ( is_404() )
|
||||
if ( is_404() )
|
||||
$meta['status'] = 404;
|
||||
|
||||
/* redirect page */
|
||||
|
@ -269,42 +449,44 @@ function wp_ffpc_callback( $buffer ) {
|
|||
/* set mimetype */
|
||||
$meta['mime'] = $meta['mime'] . $wp_ffpc_config['charset'];
|
||||
|
||||
/* try if post is available
|
||||
if made with archieve, last listed post can make this go bad
|
||||
*/
|
||||
global $post;
|
||||
if ( !empty($post) && ( $meta['type'] == 'single' || $meta['type'] == 'page' ) && !empty ( $post->post_modified_gmt ) ) {
|
||||
/* get last modification data */
|
||||
$meta['lastmodified'] = strtotime ( $post->post_modified_gmt );
|
||||
|
||||
/* get shortlink, if possible */
|
||||
if (function_exists('wp_get_shortlink')) {
|
||||
$shortlink = wp_get_shortlink( );
|
||||
if (!empty ( $shortlink ) )
|
||||
$meta['shortlink'] = $shortlink;
|
||||
}
|
||||
}
|
||||
|
||||
/* store pingback url if pingbacks are enabled */
|
||||
if ( get_option ( 'default_ping_status' ) == 'open' )
|
||||
$meta['pingback'] = get_bloginfo('pingback_url');
|
||||
|
||||
$to_store = $buffer;
|
||||
|
||||
/* add generation info is option is set, but only to HTML */
|
||||
if ( $wp_ffpc_config['generate_time'] == '1' && stripos($buffer, '</body>') ) {
|
||||
global $wp_ffpc_gentime;
|
||||
$mtime = explode ( " ", microtime() );
|
||||
$wp_ffpc_gentime = ( $mtime[1] + $mtime[0] )- $wp_ffpc_gentime;
|
||||
|
||||
$insertion = "\n<!-- \nWP-FFPC \n\tcache engine: ". $wp_ffpc_config['cache_type'] ."\n\tpage generation time: ". round( $wp_ffpc_gentime, 3 ) ." seconds\n\tgeneraton UNIX timestamp: ". time() . "\n\tgeneraton date: ". date( 'c' ) . "\n\tserver: ". $_SERVER['SERVER_ADDR'] . "\n-->\n";
|
||||
$insertion = "\n<!-- WP-FFPC cache generation stats" . "\n\tgeneration time: ". round( $wp_ffpc_gentime, 3 ) ." seconds\n\tgeneraton UNIX timestamp: ". time() . "\n\tgeneraton date: ". date( 'c' ) . "\n\tgenerator server: ". $_SERVER['SERVER_ADDR'] . " -->\n";
|
||||
$index = stripos( $buffer , '</body>' );
|
||||
|
||||
$buffer = substr_replace( $buffer, $insertion, $index, 0);
|
||||
$to_store = substr_replace( $buffer, $insertion, $index, 0);
|
||||
}
|
||||
|
||||
$wp_ffpc_backend->set ( $wp_ffpc_backend->key ( $wp_ffpc_config['prefix_meta'] ) , $meta );
|
||||
$wp_ffpc_backend->set ( $wp_ffpc_backend->key ( $wp_ffpc_config['prefix_data'] ) , $buffer );
|
||||
/**
|
||||
* Allows to edit the content to be stored in cache.
|
||||
*
|
||||
* This hooks allows the user to edit the page content right before it is about
|
||||
* to be stored in the cache. This could be useful for alterations like
|
||||
* minification.
|
||||
*
|
||||
* @since 1.10.2
|
||||
*
|
||||
* @param string $to_store The content to be stored in cache.
|
||||
*/
|
||||
$to_store = apply_filters( 'wp-ffpc-to-store', $to_store );
|
||||
|
||||
if ( $meta['status'] == 404 ) {
|
||||
$prefix_meta = $wp_ffpc_backend->key ( $wp_ffpc_config['prefix_meta'] );
|
||||
$wp_ffpc_backend->set ( $prefix_meta, $meta );
|
||||
|
||||
$prefix_data = $wp_ffpc_backend->key ( $wp_ffpc_config['prefix_data'] );
|
||||
$wp_ffpc_backend->set ( $prefix_data , $to_store );
|
||||
|
||||
if ( !empty( $meta['status'] ) && $meta['status'] == 404 ) {
|
||||
header("HTTP/1.1 404 Not Found");
|
||||
}
|
||||
else {
|
||||
|
@ -313,8 +495,6 @@ function wp_ffpc_callback( $buffer ) {
|
|||
}
|
||||
|
||||
/* echoes HTML out */
|
||||
return $buffer;
|
||||
return trim($buffer);
|
||||
}
|
||||
/*** END GENERATING CACHE ENTRY ***/
|
||||
|
||||
?>
|
||||
|
|
1311
wp-ffpc-backend.php
1311
wp-ffpc-backend.php
File diff suppressed because it is too large
Load diff
2320
wp-ffpc-class.php
2320
wp-ffpc-class.php
File diff suppressed because it is too large
Load diff
|
@ -1,118 +1,107 @@
|
|||
http {
|
||||
# --- contents of {nginx config dir, usuall /etc/nginx}/fastcgi_params ---
|
||||
fastcgi_param SCRIPT_NAME $script_name;
|
||||
fastcgi_param PATH_INFO $path_info;
|
||||
fastcgi_param QUERY_STRING $query_string;
|
||||
fastcgi_param REQUEST_METHOD $request_method;
|
||||
fastcgi_param CONTENT_TYPE $content_type;
|
||||
fastcgi_param CONTENT_LENGTH $content_length;
|
||||
fastcgi_param SCRIPT_NAME $script_name;
|
||||
fastcgi_param REQUEST_URI $request_uri;
|
||||
fastcgi_param DOCUMENT_URI $document_uri;
|
||||
fastcgi_param DOCUMENT_ROOT $document_root;
|
||||
fastcgi_param SERVER_PROTOCOL $server_protocol;
|
||||
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
|
||||
fastcgi_param SERVER_SOFTWARE nginx;
|
||||
fastcgi_param REMOTE_ADDR $remote_addr;
|
||||
fastcgi_param REMOTE_PORT $remote_port;
|
||||
fastcgi_param SERVER_ADDR $server_addr;
|
||||
fastcgi_param SERVER_PORT $server_port;
|
||||
fastcgi_param SERVER_NAME $server_name;
|
||||
fastcgi_param HTTPS $https if_not_empty;
|
||||
fastcgi_param SSL_PROTOCOL $ssl_protocol if_not_empty;
|
||||
fastcgi_param SSL_CIPHER $ssl_cipher if_not_empty;
|
||||
fastcgi_param SSL_SESSION_ID $ssl_session_id if_not_empty;
|
||||
fastcgi_param SSL_CLIENT_VERIFY $ssl_client_verify if_not_empty;
|
||||
fastcgi_param REDIRECT_STATUS 200;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_connect_timeout 10;
|
||||
fastcgi_send_timeout 360;
|
||||
fastcgi_read_timeout 3600;
|
||||
fastcgi_buffer_size 512k;
|
||||
fastcgi_buffers 512 512k;
|
||||
fastcgi_intercept_errors on;
|
||||
|
||||
# memcached servers, generated according to wp-ffpc config
|
||||
upstream memcached-servers {
|
||||
|
||||
|
||||
# --- part needs to go inside the http { } block of nginx ---
|
||||
# --- memcached ---
|
||||
upstream memcached {
|
||||
MEMCACHED_SERVERS
|
||||
}
|
||||
}
|
||||
|
||||
# PHP-FPM upstream; change it accordingly to your local config!
|
||||
upstream php-fpm {
|
||||
server 127.0.0.1:9000;
|
||||
}
|
||||
# --- PHP-FPM upstream --- change it accordingly to your local config!
|
||||
upstream php-fpm {
|
||||
server 127.0.0.1:9000;
|
||||
}
|
||||
|
||||
server {
|
||||
## Listen ports
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
# use _ if you want to accept everything, or replace _ with domain
|
||||
server_name _;
|
||||
# --- part needs to go inside the server { } block of nginx ---
|
||||
set $memcached_raw_key KEYFORMAT;
|
||||
|
||||
# root of WordPress
|
||||
root SERVERROOT;
|
||||
HASHEDORNOT
|
||||
|
||||
# set up logging
|
||||
access_log /var/log/nginx/SERVERLOG.access.log;
|
||||
error_log /var/log/nginx/SERVERLOG.error.log;
|
||||
set $memcached_request 1;
|
||||
|
||||
## PHP5-FPM
|
||||
location ~ (\.php) {
|
||||
# these settings are usually in fastcgi_params
|
||||
if ($request_method = POST ) {
|
||||
set $memcached_request 0;
|
||||
}
|
||||
|
||||
fastcgi_index index.php;
|
||||
fastcgi_connect_timeout 10;
|
||||
fastcgi_send_timeout 180;
|
||||
fastcgi_read_timeout 180;
|
||||
fastcgi_buffer_size 512k;
|
||||
fastcgi_buffers 4 256k;
|
||||
fastcgi_busy_buffers_size 512k;
|
||||
fastcgi_temp_file_write_size 512k;
|
||||
fastcgi_intercept_errors on;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
||||
fastcgi_keep_conn on;
|
||||
if ( $uri ~ "/wp-" ) {
|
||||
set $memcached_request 0;
|
||||
}
|
||||
|
||||
fastcgi_param QUERY_STRING $query_string;
|
||||
fastcgi_param REQUEST_METHOD $request_method;
|
||||
fastcgi_param CONTENT_TYPE $content_type;
|
||||
fastcgi_param CONTENT_LENGTH $content_length;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
|
||||
fastcgi_param REQUEST_URI $request_uri;
|
||||
fastcgi_param DOCUMENT_URI $document_uri;
|
||||
fastcgi_param DOCUMENT_ROOT $document_root;
|
||||
fastcgi_param SERVER_PROTOCOL $server_protocol;
|
||||
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
|
||||
fastcgi_param SERVER_SOFTWARE nginx;
|
||||
fastcgi_param REMOTE_ADDR $remote_addr;
|
||||
fastcgi_param REMOTE_PORT $remote_port;
|
||||
fastcgi_param SERVER_ADDR $server_addr;
|
||||
fastcgi_param SERVER_PORT $server_port;
|
||||
fastcgi_param SERVER_NAME $server_name;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
|
||||
fastcgi_param REDIRECT_STATUS 200;
|
||||
if ( $args ) {
|
||||
set $memcached_request 0;
|
||||
}
|
||||
|
||||
# uncomment these for HTTPS usage
|
||||
#fastcgi_param HTTPS $https if_not_empty;
|
||||
#fastcgi_param SSL_PROTOCOL $ssl_protocol if_not_empty;
|
||||
#fastcgi_param SSL_CIPHER $ssl_cipher if_not_empty;
|
||||
#fastcgi_param SSL_SESSION_ID $ssl_session_id if_not_empty;
|
||||
#fastcgi_param SSL_CLIENT_VERIFY $ssl_client_verify if_not_empty;
|
||||
LOGGEDIN_EXCEPTION
|
||||
|
||||
fastcgi_pass php-fpm;
|
||||
}
|
||||
COOKIES_EXCEPTION
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ @memcached;
|
||||
}
|
||||
|
||||
# try to get result from memcached
|
||||
location @memcached {
|
||||
default_type text/html;
|
||||
set $memcached_key DATAPREFIX;
|
||||
set $memcached_request 1;
|
||||
location ~ ^(?<script_name>.+?\.php)(?<path_info>.*)$ {
|
||||
default_type text/html;
|
||||
|
||||
# exceptions
|
||||
# avoid cache serve of POST requests
|
||||
if ($request_method = POST ) {
|
||||
set $memcached_request 0;
|
||||
}
|
||||
if ( $memcached_request = 1) {
|
||||
RESPONSE_HEADER
|
||||
memcached_pass memcached;
|
||||
error_page 404 = @fallback;
|
||||
}
|
||||
|
||||
# avoid cache serve of wp-admin-like pages, starting with "wp-"
|
||||
if ( $uri ~ "/wp-" ) {
|
||||
set $memcached_request 0;
|
||||
}
|
||||
fastcgi_split_path_info ^(?<script_name>.+?\.php)(?<path_info>.*)$;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$script_name;
|
||||
fastcgi_param PATH_TRANSLATED $document_root$path_info;
|
||||
include params/fastcgi;
|
||||
fastcgi_keep_conn on;
|
||||
fastcgi_pass php-fpm;
|
||||
}
|
||||
|
||||
LOGGEDIN_EXCEPTION
|
||||
location / {
|
||||
try_files $uri $uri/ @rewrites;
|
||||
}
|
||||
|
||||
COOKIES_EXCEPTION
|
||||
location @fallback {
|
||||
# add_header X-Cache-Engine "WP-FFPC nginx via memcached - fallback - not cached";
|
||||
|
||||
if ( $memcached_request = 1) {
|
||||
RESPONSE_HEADER
|
||||
memcached_pass memcached-servers;
|
||||
error_page 404 = @rewrites;
|
||||
}
|
||||
fastcgi_split_path_info ^(?<script_name>.+?\.php)(?<path_info>.*)$;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$script_name;
|
||||
fastcgi_param PATH_TRANSLATED $document_root$path_info;
|
||||
include fastcgi_params;
|
||||
fastcgi_keep_conn on;
|
||||
fastcgi_pass php-fpm;
|
||||
}
|
||||
|
||||
if ( $memcached_request = 0) {
|
||||
rewrite ^ /index.php last;
|
||||
}
|
||||
}
|
||||
location @rewrites {
|
||||
rewrite ^ /index.php last;
|
||||
}
|
||||
|
||||
## rewrite rules
|
||||
location @rewrites {
|
||||
add_header X-Cache-Engine "";
|
||||
rewrite ^ /index.php last;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
95
wp-ffpc.php
95
wp-ffpc.php
|
@ -1,55 +1,72 @@
|
|||
<?php
|
||||
/*
|
||||
Plugin Name: WP-FFPC
|
||||
Plugin URI: http://petermolnar.eu/wordpress/wp-ffpc
|
||||
Description: WordPress cache plugin for memcached & nginx - unbeatable speed
|
||||
Version: 1.2
|
||||
Plugin URI: https://github.com/petermolnar/wp-ffpc
|
||||
Description: WordPress in-memory full page cache plugin
|
||||
Version: 1.11.2
|
||||
Author: Peter Molnar <hello@petermolnar.eu>
|
||||
Author URI: http://petermolnar.eu/
|
||||
Author URI: http://petermolnar.net/
|
||||
License: GPLv3
|
||||
Text Domain: wp-ffpc
|
||||
Domain Path: /languages/
|
||||
*/
|
||||
|
||||
/* Copyright 2010-2013 Peter Molnar ( hello@petermolnar.eu )
|
||||
/*Copyright 2010-2017 Peter Molnar ( hello@petermolnar.eu )
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License, version 3, as
|
||||
published by the Free Software Foundation.
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License, version 3, as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA02110-1301USA
|
||||
*/
|
||||
|
||||
defined('ABSPATH') or die("Walk away.");
|
||||
|
||||
include_once ( 'wp-ffpc-class.php' );
|
||||
|
||||
$wp_ffpc_defaults = array (
|
||||
'hosts'=>'127.0.0.1:11211',
|
||||
'expire'=>300,
|
||||
'invalidation_method'=>0,
|
||||
'prefix_meta' =>'meta-',
|
||||
'prefix_data' =>'data-',
|
||||
'charset' => 'utf-8',
|
||||
'log' => true,
|
||||
'cache_type' => 'memcached',
|
||||
'cache_loggedin' => false,
|
||||
'nocache_home' => false,
|
||||
'nocache_feed' => false,
|
||||
'nocache_archive' => false,
|
||||
'nocache_single' => false,
|
||||
'nocache_page' => false,
|
||||
'nocache_cookies' => false,
|
||||
'persistent' => false,
|
||||
'response_header' => false,
|
||||
'generate_time' => false,
|
||||
'precache_schedule' => 'null',
|
||||
'key' => '$scheme://$host$request_uri',
|
||||
$wp_ffpc_defaults= array (
|
||||
'hosts' => '127.0.0.1:11211',
|
||||
'memcached_binary' => false,
|
||||
'authpass' => '',
|
||||
'authuser' => '',
|
||||
'browsercache' => 0,
|
||||
'browsercache_home' => 0,
|
||||
'browsercache_taxonomy' => 0,
|
||||
'expire' => 300,
|
||||
'expire_home' => 300,
|
||||
'expire_taxonomy' => 300,
|
||||
'invalidation_method' => 0,
|
||||
'prefix_meta' => 'meta-',
|
||||
'prefix_data' => 'data-',
|
||||
'charset' => 'utf-8',
|
||||
'log' => true,
|
||||
'cache_type' => 'memcached',
|
||||
'cache_loggedin' => false,
|
||||
'nocache_home' => false,
|
||||
'nocache_feed' => false,
|
||||
'nocache_archive' => false,
|
||||
'nocache_single' => false,
|
||||
'nocache_page' => false,
|
||||
'nocache_cookies' => false,
|
||||
'nocache_dyn' => true,
|
||||
'nocache_woocommerce' => true,
|
||||
'nocache_woocommerce_url' => '',
|
||||
'nocache_url' => '^/wp-',
|
||||
'nocache_comment' => '',
|
||||
'response_header' => false,
|
||||
'generate_time' => false,
|
||||
'precache_schedule' => 'null',
|
||||
'key' => '$scheme://$host$request_uri',
|
||||
'comments_invalidate' => true,
|
||||
'pingback_header' => false,
|
||||
'hashkey' => false,
|
||||
);
|
||||
|
||||
$wp_ffpc = new WP_FFPC ( 'wp-ffpc', '1.2', '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.11.2', 'WP-FFPC', $wp_ffpc_defaults );
|
Loading…
Reference in a new issue