PDF rausgenommen
This commit is contained in:
156
msd2/wordpress/wp-content/plugins/cachify/CHANGELOG.md
Normal file
156
msd2/wordpress/wp-content/plugins/cachify/CHANGELOG.md
Normal file
@ -0,0 +1,156 @@
|
||||
# Changelog
|
||||
|
||||
|
||||
### 2.1.9 ###
|
||||
* Vervollständigung des Cachify-Pfades in `robots.txt`: `Disallow: /wp-content/cache/cachify/`
|
||||
* *Release-Zeitaufwand (Development & QA): 0,75 Stunden*
|
||||
|
||||
### 2.1.8 ###
|
||||
* HHVM-Unterstützung für die *Memcached* Caching-Methode (Danke, [Ulrich Block](http://www.ulrich-block.de))
|
||||
|
||||
### 2.1.7 ###
|
||||
* Cache-Leerung bei Custom Post Types
|
||||
* Einführung zusätzlicher Sicherheitsabfragen
|
||||
* Code-Refactoring
|
||||
|
||||
### 2.1.6 ###
|
||||
* Button "Cache leeren" sichtbar sowohl in WP 3.8 wie WP 3.9
|
||||
|
||||
### 2.1.5 ###
|
||||
* Support für WordPress 3.9
|
||||
* Button "Cache leeren" sichtbar bei jeder Bildschirmauflösung
|
||||
|
||||
### 2.1.4 ###
|
||||
* Support für WordPress 3.8.1
|
||||
|
||||
### 2.1.3 ###
|
||||
* Manuelle Auswahl: Beim Artikel-Update nur den Seitencache löschen
|
||||
* Lokalisierung der Plugin-Dateien
|
||||
* Umbauten am Plugin-Core
|
||||
* Detaillierter auf [Google+](https://plus.google.com/+SergejMüller/posts/By2PEtRMk8g)
|
||||
|
||||
### 2.1.2 ###
|
||||
* Optimierung für WordPress 3.8
|
||||
* Option hinzugefügt: Neue Kommentare lösen einen Cache-Reset aus
|
||||
|
||||
### 2.1.1 ###
|
||||
* Hook `cachify_skip_cache` für die Steuerung der Cache-Generierung
|
||||
* Support für das MP6 Plugin
|
||||
* Detaillierter auf [Google+](https://plus.google.com/110569673423509816572/posts/S1mpFsG3NZC)
|
||||
|
||||
### 2.1.0 ###
|
||||
* Cache-Leerung bei Plugin-Deaktivierung
|
||||
|
||||
### 2.0.9 ###
|
||||
* Quelltext-Minimierung als Selektbox und Hook
|
||||
* Interne Umstellung auf Konstanten
|
||||
|
||||
### 2.0.7 ###
|
||||
* Unterstützung für Memcached
|
||||
* WordPress 3.6 Support
|
||||
* Cache-Neuaufbau beim Theme-Wechsel
|
||||
* Quelltext-Optimierungen
|
||||
|
||||
### 2.0.6 ###
|
||||
* Cache-Neuaufbau einer Blogseite nur bei Kommentaren, die freigegeben sind
|
||||
|
||||
### 2.0.5 ###
|
||||
* Cache-Leerung nach einem WordPress-Upgrade
|
||||
* Keine Cache-Ausgabe für Jetpack Mobile Theme
|
||||
* Abfrage auf eingeloggte Nutzer bei APC als Caching-Methode
|
||||
* Änderung der Systemvoraussetzungen
|
||||
* Cache-Reset nach WordPress-Update
|
||||
|
||||
### 2.0.4 ###
|
||||
* Bessere Trennung der Cache-Gesamtgröße im Dashboard-Widget "Auf einen Blick"
|
||||
|
||||
### 2.0.3 ###
|
||||
* Cache-Leerung beim Veröffentlichen verfügbarer Custom Post Types
|
||||
* Noindex in der von WordPress generierten `robots.txt` für den Ordner mit HDD-Cache
|
||||
* Hook `cachify_flush_cache` zum Leeren des Cache aus Drittanwendungen
|
||||
|
||||
### 2.0.2 ###
|
||||
* Unterstützung für WordPress 3.4
|
||||
* Hochauflösende Icons für iPad & Co.
|
||||
* Anpassungen für ältere PHP5-Versionen
|
||||
* Entfernung des Plugin-Icons aus der Sidebar
|
||||
|
||||
### 2.0.1 ###
|
||||
* Verbesserter Autoload-Prozess
|
||||
* Diverse Umbenennungen der Optionen
|
||||
* Cache-Neuaufbau bei geplanten Beiträgen (Cachify DB)
|
||||
|
||||
### 2.0 ###
|
||||
* Überarbeitung der GUI
|
||||
* Source Code-Modularisierung
|
||||
* Cache-Größe auf dem Dashboard
|
||||
* Festplatte als Ablageort für Cache
|
||||
* Produktseite online: http://cachify.de
|
||||
* Cache-Neuaufbau bei Kommentarstatusänderungen
|
||||
* APC-Anforderungen: APC 3.0.0, empfohlen 3.1.4
|
||||
* Optional: Kein Cache für kommentierende Nutzer
|
||||
* Schnellübersicht der Optionen als Inline-Hilfe
|
||||
* Mindestanforderungen: WordPress 3.1 & PHP 5.1.2
|
||||
|
||||
### 1.5.1 ###
|
||||
* `zlib.output_compression = Off` für Apache Webserver
|
||||
|
||||
### 1.5 ###
|
||||
* Überarbeitung des Regexp für HTML-Minify
|
||||
* Reduzierung des Toolbar-Buttons auf das Icon
|
||||
* Formatierung und Kommentierung des Quelltextes
|
||||
|
||||
### 1.4 ###
|
||||
* Xmas Edition
|
||||
|
||||
### 1.3 ###
|
||||
* Unterstützung für APC (Alternative PHP Cache)
|
||||
* Umpositionierung des Admin Bar Buttons
|
||||
|
||||
### 1.2.1 ###
|
||||
* Icon für die "Cache leeren" Schaltfläche in der Admin Bar
|
||||
|
||||
### 1.2 ###
|
||||
* Schaltfläche "Cache leeren" in der Adminbar (ab WordPress 3.1)
|
||||
* `flush_cache` auf public gesetzt, um von [wpSEO](http://wpseo.de "WordPress SEO Plugin") ansprechen zu können
|
||||
* Ausführliche Tests unter WordPress 3.3
|
||||
|
||||
### 1.1 ###
|
||||
* Interne Prüfung auf fehlerhafte Cache-Generierung
|
||||
* Anpassungen an der Code-Struktur
|
||||
* Entfernung der Inline-Hilfe
|
||||
* Verknüpfung der Online-Hilfe mit Optionen
|
||||
|
||||
### 1.0 ###
|
||||
* Leerung des Cache beim Aktualisieren von statischen Seiten
|
||||
* Seite mit Plugin-Einstellungen
|
||||
* Inline-Dokumentation in der Optionsseite
|
||||
* Ausschluss von Passwort-geschützten Seiten
|
||||
* WordPress 3.2 Support
|
||||
* Unterstützung der WordPress Multisite Blogs
|
||||
* Umstellung auf den template_redirect-Hook (Plugin-Kompatibilität)
|
||||
* Interne Code-Bereinigung
|
||||
|
||||
### 0.9.2 ###
|
||||
* HTML-Kompression
|
||||
* Flattr-Link
|
||||
|
||||
### 0.9.1 ###
|
||||
* Cache-Reset bei geplanten Beiträgen
|
||||
* Unterstützung für das Carrington-Mobile Theme
|
||||
|
||||
### 0.9 ###
|
||||
* Workaround für Redirects
|
||||
|
||||
### 0.8 ###
|
||||
* Blacklist für PostIDs
|
||||
* Blacklist für UserAgents
|
||||
* Ausnahme für WP Touch
|
||||
* Ausgabe des Zeitpunktes der Generierung
|
||||
* Umbenennung der Konstanten
|
||||
|
||||
### 0.7 ###
|
||||
* Ausgabe des Speicherverbrauchs
|
||||
|
||||
### 0.6 ###
|
||||
* Live auf wordpress.org
|
28
msd2/wordpress/wp-content/plugins/cachify/apc/proxy.php
Normal file
28
msd2/wordpress/wp-content/plugins/cachify/apc/proxy.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
if ( ! empty($_COOKIE) ) {
|
||||
foreach ( $_COOKIE as $k => $v ) {
|
||||
if ( preg_match('/^(wp-postpass|wordpress_logged_in|comment_author)_/', $k) ) {
|
||||
$_cachify_logged_in = true; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
empty($_cachify_logged_in)
|
||||
&& ( strpos( filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING), '/wp-admin/' ) === false )
|
||||
&& ( strpos( filter_input(INPUT_SERVER, 'HTTP_ACCEPT_ENCODING', FILTER_SANITIZE_STRING), 'gzip' ) !== false )
|
||||
&& extension_loaded('apc')
|
||||
&& ( $cache = apc_fetch(md5($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']) . '.cachify') )
|
||||
) {
|
||||
ini_set('zlib.output_compression', 'Off');
|
||||
|
||||
header('Vary: Accept-Encoding');
|
||||
header('X-Powered-By: Cachify');
|
||||
header('Content-Encoding: gzip');
|
||||
header('Content-Length: ' .strlen($cache));
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
|
||||
echo $cache;
|
||||
exit;
|
||||
}
|
90
msd2/wordpress/wp-content/plugins/cachify/cachify.php
Normal file
90
msd2/wordpress/wp-content/plugins/cachify/cachify.php
Normal file
@ -0,0 +1,90 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: Cachify
|
||||
Description: Easy to use WordPress caching plugin. Serving static blog pages from database, disk, Memcached or APC.
|
||||
Author: pluginkollektiv
|
||||
Author URI: http://pluginkollektiv.org
|
||||
Plugin URI: https://wordpress.org/plugins/cachify/
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Version: 2.2.4
|
||||
Text Domain: cachify
|
||||
Domain Path: /lang
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (C) 2011-2015 Sergej Müller
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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 Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* Quit */
|
||||
defined('ABSPATH') OR exit;
|
||||
|
||||
|
||||
/* Konstanten */
|
||||
define('CACHIFY_FILE', __FILE__);
|
||||
define('CACHIFY_DIR', dirname(__FILE__));
|
||||
define('CACHIFY_BASE', plugin_basename(__FILE__));
|
||||
define('CACHIFY_CACHE_DIR', WP_CONTENT_DIR. '/cache/cachify');
|
||||
|
||||
|
||||
/* Hooks */
|
||||
add_action(
|
||||
'plugins_loaded',
|
||||
array(
|
||||
'Cachify',
|
||||
'instance'
|
||||
)
|
||||
);
|
||||
register_activation_hook(
|
||||
__FILE__,
|
||||
array(
|
||||
'Cachify',
|
||||
'on_activation'
|
||||
)
|
||||
);
|
||||
register_deactivation_hook(
|
||||
__FILE__,
|
||||
array(
|
||||
'Cachify',
|
||||
'on_deactivation'
|
||||
)
|
||||
);
|
||||
register_uninstall_hook(
|
||||
__FILE__,
|
||||
array(
|
||||
'Cachify',
|
||||
'on_uninstall'
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
/* Autoload Init */
|
||||
spl_autoload_register('cachify_autoload');
|
||||
|
||||
/* Autoload Funktion */
|
||||
function cachify_autoload($class) {
|
||||
if ( in_array($class, array('Cachify', 'Cachify_APC', 'Cachify_DB', 'Cachify_HDD', 'Cachify_MEMCACHED')) ) {
|
||||
require_once(
|
||||
sprintf(
|
||||
'%s/inc/%s.class.php',
|
||||
CACHIFY_DIR,
|
||||
strtolower($class)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
29
msd2/wordpress/wp-content/plugins/cachify/css/dashboard.css
Normal file
29
msd2/wordpress/wp-content/plugins/cachify/css/dashboard.css
Normal file
@ -0,0 +1,29 @@
|
||||
/* @group Dashboard */
|
||||
|
||||
@font-face {
|
||||
font-family: 'cachifyIcons';
|
||||
src: url('data:font/opentype;base64,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') format('woff');
|
||||
}
|
||||
|
||||
#dashboard_right_now .cachify-icon:before {
|
||||
color: #82878c;
|
||||
font-family: "cachifyIcons";
|
||||
}
|
||||
#dashboard_right_now .cachify-icon--hdd:before {
|
||||
margin: 3px 7px 0 2px;
|
||||
content: "\e801";
|
||||
font-size: 16px;
|
||||
}
|
||||
#dashboard_right_now .cachify-icon--db:before {
|
||||
margin: 1px 9px 0 3px;
|
||||
content: "\e802";
|
||||
font-size: 18px;
|
||||
}
|
||||
#dashboard_right_now .cachify-icon--apc:before,
|
||||
#dashboard_right_now .cachify-icon--memcached:before {
|
||||
margin: 3px 6px 0 0;
|
||||
content: "\e800";
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/* @end group */
|
1
msd2/wordpress/wp-content/plugins/cachify/css/dashboard.min.css
vendored
Normal file
1
msd2/wordpress/wp-content/plugins/cachify/css/dashboard.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
@font-face{font-family:cachifyIcons;src:url(data:font/opentype;base64,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) format('woff')}#dashboard_right_now .cachify-icon:before{color:#82878c;font-family:cachifyIcons}#dashboard_right_now .cachify-icon--hdd:before{margin:3px 7px 0 2px;content:"\e801";font-size:16px}#dashboard_right_now .cachify-icon--db:before{margin:1px 9px 0 3px;content:"\e802";font-size:18px}#dashboard_right_now .cachify-icon--apc:before,#dashboard_right_now .cachify-icon--memcached:before{margin:3px 6px 0 0;content:"\e800";font-size:13px}
|
1811
msd2/wordpress/wp-content/plugins/cachify/inc/cachify.class.php
Normal file
1811
msd2/wordpress/wp-content/plugins/cachify/inc/cachify.class.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,188 @@
|
||||
<?php
|
||||
|
||||
|
||||
/* Quit */
|
||||
defined('ABSPATH') OR exit;
|
||||
|
||||
|
||||
/**
|
||||
* Cachify_APC
|
||||
*/
|
||||
|
||||
final class Cachify_APC {
|
||||
|
||||
|
||||
/**
|
||||
* Availability check
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.0.7
|
||||
*
|
||||
* @return boolean true/false TRUE when installed
|
||||
*/
|
||||
|
||||
public static function is_available()
|
||||
{
|
||||
return extension_loaded('apc');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Caching method as string
|
||||
*
|
||||
* @since 2.1.2
|
||||
* @change 2.1.2
|
||||
*
|
||||
* @return string Caching method
|
||||
*/
|
||||
|
||||
public static function stringify_method() {
|
||||
return 'APC';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Speicherung im Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @param string $hash Hash des Eintrags
|
||||
* @param string $data Inhalt des Eintrags
|
||||
* @param integer $lifetime Lebensdauer des Eintrags
|
||||
*/
|
||||
|
||||
public static function store_item($hash, $data, $lifetime)
|
||||
{
|
||||
/* Leer? */
|
||||
if ( empty($hash) or empty($data) ) {
|
||||
wp_die('APC add item: Empty input.');
|
||||
}
|
||||
|
||||
/* Store */
|
||||
apc_store(
|
||||
$hash,
|
||||
gzencode( $data . self::_cache_signatur(), 9),
|
||||
$lifetime
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Lesen aus dem Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @param string $hash Hash des Eintrags
|
||||
* @return mixed $diff Wert des Eintrags
|
||||
*/
|
||||
|
||||
public static function get_item($hash)
|
||||
{
|
||||
/* Leer? */
|
||||
if ( empty($hash) ) {
|
||||
wp_die('APC get item: Empty input.');
|
||||
}
|
||||
|
||||
return ( function_exists('apc_exists') ? apc_exists($hash) : apc_fetch($hash) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Entfernung aus dem Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @param string $hash Hash des Eintrags
|
||||
* @param string $url URL des Eintrags [optional]
|
||||
*/
|
||||
|
||||
public static function delete_item($hash, $url = '')
|
||||
{
|
||||
/* Leer? */
|
||||
if ( empty($hash) ) {
|
||||
wp_die('APC delete item: Empty input.');
|
||||
}
|
||||
|
||||
/* Löschen */
|
||||
apc_delete($hash);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Leerung des Cache
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @change 2.0.7
|
||||
*/
|
||||
|
||||
public static function clear_cache()
|
||||
{
|
||||
if ( ! self::is_available() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
@apc_clear_cache('user');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ausgabe des Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*/
|
||||
|
||||
public static function print_cache()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ermittlung der Cache-Größe
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @return mixed $diff Cache-Größe
|
||||
*/
|
||||
|
||||
public static function get_stats()
|
||||
{
|
||||
/* Infos */
|
||||
$data = apc_cache_info('user');
|
||||
|
||||
/* Leer */
|
||||
if ( empty($data['mem_size']) ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return $data['mem_size'];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generierung der Signatur
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0.5
|
||||
*
|
||||
* @return string $diff Signatur als String
|
||||
*/
|
||||
|
||||
private static function _cache_signatur()
|
||||
{
|
||||
return sprintf(
|
||||
"\n\n<!-- %s\n%s @ %s -->",
|
||||
'Cachify | http://cachify.de',
|
||||
'APC Cache',
|
||||
date_i18n(
|
||||
'd.m.Y H:i:s',
|
||||
current_time('timestamp')
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,272 @@
|
||||
<?php
|
||||
|
||||
|
||||
/* Quit */
|
||||
defined('ABSPATH') OR exit;
|
||||
|
||||
|
||||
/**
|
||||
* Cachify_DB
|
||||
*/
|
||||
|
||||
final class Cachify_DB {
|
||||
|
||||
|
||||
/**
|
||||
* Availability check
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.0.7
|
||||
*
|
||||
* @return boolean true/false TRUE when installed
|
||||
*/
|
||||
|
||||
public static function is_available()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Caching method as string
|
||||
*
|
||||
* @since 2.1.2
|
||||
* @change 2.1.2
|
||||
*
|
||||
* @return string Caching method
|
||||
*/
|
||||
|
||||
public static function stringify_method() {
|
||||
return 'DB';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Speicherung im Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @param string $hash Hash des Eintrags
|
||||
* @param string $data Inhalt des Eintrags
|
||||
* @param integer $lifetime Lebensdauer des Eintrags
|
||||
*/
|
||||
|
||||
public static function store_item($hash, $data, $lifetime)
|
||||
{
|
||||
/* Leer? */
|
||||
if ( empty($hash) or empty($data) ) {
|
||||
wp_die('DB add item: Empty input.');
|
||||
}
|
||||
|
||||
/* Store */
|
||||
set_transient(
|
||||
$hash,
|
||||
array(
|
||||
'data' => $data,
|
||||
'meta' => array(
|
||||
'queries' => self::_page_queries(),
|
||||
'timer' => self::_page_timer(),
|
||||
'memory' => self::_page_memory(),
|
||||
'time' => current_time('timestamp')
|
||||
)
|
||||
),
|
||||
$lifetime
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Lesen aus dem Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @param string $hash Hash des Eintrags
|
||||
* @return mixed $diff Wert des Eintrags
|
||||
*/
|
||||
|
||||
public static function get_item($hash)
|
||||
{
|
||||
/* Leer? */
|
||||
if ( empty($hash) ) {
|
||||
wp_die('DB get item: Empty input.');
|
||||
}
|
||||
|
||||
return get_transient($hash);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Entfernung aus dem Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @param string $hash Hash des Eintrags
|
||||
* @param string $url URL des Eintrags [optional]
|
||||
*/
|
||||
|
||||
public static function delete_item($hash, $url = '')
|
||||
{
|
||||
/* Leer? */
|
||||
if ( empty($hash) ) {
|
||||
wp_die('DB delete item: Empty input.');
|
||||
}
|
||||
|
||||
/* Löschen */
|
||||
delete_transient($hash);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Leerung des Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*/
|
||||
|
||||
public static function clear_cache()
|
||||
{
|
||||
/* Init */
|
||||
global $wpdb;
|
||||
|
||||
/* Löschen */
|
||||
$wpdb->query("DELETE FROM `" .$wpdb->options. "` WHERE `option_name` LIKE ('\_transient%.cachify')");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ausgabe des Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0.2
|
||||
*
|
||||
* @param array $cache Array mit Cache-Werten
|
||||
*/
|
||||
|
||||
public static function print_cache($cache)
|
||||
{
|
||||
/* Kein Array? */
|
||||
if ( ! is_array($cache) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Content */
|
||||
echo $cache['data'];
|
||||
|
||||
/* Signatur */
|
||||
if ( isset($cache['meta']) ) {
|
||||
echo self::_cache_signatur($cache['meta']);
|
||||
}
|
||||
|
||||
/* Raus */
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ermittlung der Cache-Größe
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @return integer $diff Spaltengröße
|
||||
*/
|
||||
|
||||
public static function get_stats()
|
||||
{
|
||||
/* Init */
|
||||
global $wpdb;
|
||||
|
||||
/* Auslesen */
|
||||
return $wpdb->get_var(
|
||||
"SELECT SUM( CHAR_LENGTH(option_value) ) FROM `" .$wpdb->options. "` WHERE `option_name` LIKE ('\_transient%.cachify')"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generierung der Signatur
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0.5
|
||||
*
|
||||
* @param array $meta Inhalt der Metadaten
|
||||
* @return string $diff Signatur als String
|
||||
*/
|
||||
|
||||
private static function _cache_signatur($meta)
|
||||
{
|
||||
/* Kein Array? */
|
||||
if ( ! is_array($meta) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
return sprintf(
|
||||
"\n\n<!--\n%s\n%s\n%s\n%s\n-->",
|
||||
'Cachify | http://cachify.de',
|
||||
sprintf(
|
||||
'Ohne Plugin: %d DB-Anfragen, %s Sekunden, %s',
|
||||
$meta['queries'],
|
||||
$meta['timer'],
|
||||
$meta['memory']
|
||||
),
|
||||
sprintf(
|
||||
'Mit Plugin: %d DB-Anfragen, %s Sekunden, %s',
|
||||
self::_page_queries(),
|
||||
self::_page_timer(),
|
||||
self::_page_memory()
|
||||
),
|
||||
sprintf(
|
||||
'Generiert: %s zuvor',
|
||||
human_time_diff($meta['time'], current_time('timestamp'))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Rückgabe der Query-Anzahl
|
||||
*
|
||||
* @since 0.1
|
||||
* @change 2.0
|
||||
*
|
||||
* @return intval $diff Query-Anzahl
|
||||
*/
|
||||
|
||||
private static function _page_queries()
|
||||
{
|
||||
return $GLOBALS['wpdb']->num_queries;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Rückgabe der Ausführungszeit
|
||||
*
|
||||
* @since 0.1
|
||||
* @change 2.0
|
||||
*
|
||||
* @return intval $diff Anzahl der Sekunden
|
||||
*/
|
||||
|
||||
private static function _page_timer()
|
||||
{
|
||||
return timer_stop(0, 2);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Rückgabe des Speicherverbrauchs
|
||||
*
|
||||
* @since 0.7
|
||||
* @change 2.0
|
||||
*
|
||||
* @return string $diff Konvertierter Größenwert
|
||||
*/
|
||||
|
||||
private static function _page_memory()
|
||||
{
|
||||
return ( function_exists('memory_get_usage') ? size_format(memory_get_usage(), 2) : 0 );
|
||||
}
|
||||
}
|
@ -0,0 +1,392 @@
|
||||
<?php
|
||||
|
||||
|
||||
/* Quit */
|
||||
defined('ABSPATH') OR exit;
|
||||
|
||||
|
||||
/**
|
||||
* Cachify_HDD
|
||||
*/
|
||||
|
||||
final class Cachify_HDD {
|
||||
|
||||
|
||||
/**
|
||||
* Availability check
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.0.7
|
||||
*
|
||||
* @return boolean true/false TRUE when installed
|
||||
*/
|
||||
|
||||
public static function is_available()
|
||||
{
|
||||
return get_option('permalink_structure');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Caching method as string
|
||||
*
|
||||
* @since 2.1.2
|
||||
* @change 2.1.2
|
||||
*
|
||||
* @return string Caching method
|
||||
*/
|
||||
|
||||
public static function stringify_method() {
|
||||
return 'HDD';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Speicherung im Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @param string $hash Hash des Eintrags [optional]
|
||||
* @param string $data Inhalt des Eintrags
|
||||
* @param integer $lifetime Lebensdauer des Eintrags [optional]
|
||||
*/
|
||||
|
||||
public static function store_item($hash, $data, $lifetime)
|
||||
{
|
||||
/* Leer? */
|
||||
if ( empty($data) ) {
|
||||
wp_die('HDD add item: Empty input.');
|
||||
}
|
||||
|
||||
/* Speichern */
|
||||
self::_create_files(
|
||||
$data . self::_cache_signatur()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Lesen aus dem Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @return boolean $diff TRUE wenn Cache vorhanden
|
||||
*/
|
||||
|
||||
public static function get_item()
|
||||
{
|
||||
return is_readable(
|
||||
self::_file_html()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Entfernen aus dem Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @param string $hash Hash des Eintrags [optional]
|
||||
* @param string $url URL des Eintrags
|
||||
*/
|
||||
|
||||
public static function delete_item($hash = '', $url)
|
||||
{
|
||||
/* Leer? */
|
||||
if ( empty($url) ) {
|
||||
wp_die('HDD delete item: Empty input.');
|
||||
}
|
||||
|
||||
/* Löschen */
|
||||
self::_clear_dir(
|
||||
self::_file_path($url)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Leerung des Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*/
|
||||
|
||||
public static function clear_cache()
|
||||
{
|
||||
self::_clear_dir(
|
||||
CACHIFY_CACHE_DIR
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ausgabe des Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*/
|
||||
|
||||
public static function print_cache()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ermittlung der Cache-Größe
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @return integer $diff Ordnergröße
|
||||
*/
|
||||
|
||||
public static function get_stats()
|
||||
{
|
||||
return self::_dir_size( CACHIFY_CACHE_DIR );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generierung der Signatur
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0.5
|
||||
*
|
||||
* @return string $diff Signatur als String
|
||||
*/
|
||||
|
||||
private static function _cache_signatur()
|
||||
{
|
||||
return sprintf(
|
||||
"\n\n<!-- %s\n%s @ %s -->",
|
||||
'Cachify | http://cachify.de',
|
||||
'HDD Cache',
|
||||
date_i18n(
|
||||
'd.m.Y H:i:s',
|
||||
current_time('timestamp')
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialisierung des Cache-Speichervorgangs
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @param string $data Cache-Inhalt
|
||||
*/
|
||||
|
||||
private static function _create_files($data)
|
||||
{
|
||||
/* Ordner anlegen */
|
||||
if ( ! wp_mkdir_p( self::_file_path() ) ) {
|
||||
wp_die('Unable to create directory.');
|
||||
}
|
||||
|
||||
/* Dateien schreiben */
|
||||
self::_create_file( self::_file_html(), $data );
|
||||
self::_create_file( self::_file_gzip(), gzencode($data, 9) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Anlegen der Cache-Datei
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @param string $file Pfad der Cache-Datei
|
||||
* @param string $data Cache-Inhalt
|
||||
*/
|
||||
|
||||
private static function _create_file($file, $data)
|
||||
{
|
||||
/* Beschreibbar? */
|
||||
if ( ! $handle = @fopen($file, 'wb') ) {
|
||||
wp_die('Could not write file.');
|
||||
}
|
||||
|
||||
/* Schreiben */
|
||||
@fwrite($handle, $data);
|
||||
fclose($handle);
|
||||
clearstatcache();
|
||||
|
||||
/* Permissions */
|
||||
$stat = @stat( dirname($file) );
|
||||
$perms = $stat['mode'] & 0007777;
|
||||
$perms = $perms & 0000666;
|
||||
@chmod($file, $perms);
|
||||
clearstatcache();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Rekrusive Leerung eines Ordners
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0.5
|
||||
*
|
||||
* @param string $dir Ordnerpfad
|
||||
*/
|
||||
|
||||
private static function _clear_dir($dir) {
|
||||
/* Weg mit dem Slash */
|
||||
$dir = untrailingslashit($dir);
|
||||
|
||||
/* Ordner? */
|
||||
if ( ! is_dir($dir) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Einlesen */
|
||||
$objects = array_diff(
|
||||
scandir($dir),
|
||||
array('..', '.')
|
||||
);
|
||||
|
||||
/* Leer? */
|
||||
if ( empty($objects) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Loopen */
|
||||
foreach ( $objects as $object ) {
|
||||
/* Um Pfad erweitern */
|
||||
$object = $dir. DIRECTORY_SEPARATOR .$object;
|
||||
|
||||
/* Ordner/Datei */
|
||||
if ( is_dir($object) ) {
|
||||
self::_clear_dir($object);
|
||||
} else {
|
||||
unlink($object);
|
||||
}
|
||||
}
|
||||
|
||||
/* Killen */
|
||||
@rmdir($dir);
|
||||
|
||||
/* Aufräumen */
|
||||
clearstatcache();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ermittlung der Ordnergröße
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @param string $dir Ordnerpfad
|
||||
* @return mixed $size Ordnergröße
|
||||
*/
|
||||
|
||||
public static function _dir_size($dir = '.')
|
||||
{
|
||||
/* Ordner? */
|
||||
if ( ! is_dir($dir) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Einlesen */
|
||||
$objects = array_diff(
|
||||
scandir($dir),
|
||||
array('..', '.')
|
||||
);
|
||||
|
||||
/* Leer? */
|
||||
if ( empty($objects) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Init */
|
||||
$size = 0;
|
||||
|
||||
/* Loopen */
|
||||
foreach ( $objects as $object ) {
|
||||
/* Um Pfad erweitern */
|
||||
$object = $dir. DIRECTORY_SEPARATOR .$object;
|
||||
|
||||
/* Ordner/Datei */
|
||||
if ( is_dir($object) ) {
|
||||
$size += self::_dir_size($object);
|
||||
} else {
|
||||
$size += filesize($object);
|
||||
}
|
||||
}
|
||||
|
||||
return $size;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Pfad der Cache-Datei
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @param string $path Request-URI oder Permalink [optional]
|
||||
* @return string $diff Pfad zur Cache-Datei
|
||||
*/
|
||||
|
||||
private static function _file_path($path = NULL)
|
||||
{
|
||||
$prefix = is_ssl() ? 'https-' : '';
|
||||
|
||||
$path = sprintf(
|
||||
'%s%s%s%s%s',
|
||||
CACHIFY_CACHE_DIR,
|
||||
DIRECTORY_SEPARATOR,
|
||||
$prefix,
|
||||
parse_url(
|
||||
'http://' .strtolower($_SERVER['HTTP_HOST']),
|
||||
PHP_URL_HOST
|
||||
),
|
||||
parse_url(
|
||||
( $path ? $path : $_SERVER['REQUEST_URI'] ),
|
||||
PHP_URL_PATH
|
||||
)
|
||||
);
|
||||
|
||||
if ( validate_file($path) > 0 ) {
|
||||
wp_die('Invalide file path.');
|
||||
}
|
||||
|
||||
return trailingslashit($path);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Pfad der HTML-Datei
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @return string $diff Pfad zur HTML-Datei
|
||||
*/
|
||||
|
||||
private static function _file_html()
|
||||
{
|
||||
return self::_file_path(). 'index.html';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Pfad der GZIP-Datei
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @return string $diff Pfad zur GZIP-Datei
|
||||
*/
|
||||
|
||||
private static function _file_gzip()
|
||||
{
|
||||
return self::_file_path(). 'index.html.gz';
|
||||
}
|
||||
}
|
@ -0,0 +1,306 @@
|
||||
<?php
|
||||
|
||||
|
||||
/* Quit */
|
||||
defined('ABSPATH') OR exit;
|
||||
|
||||
|
||||
/**
|
||||
* Cachify_MEMCACHED
|
||||
*/
|
||||
|
||||
final class Cachify_MEMCACHED {
|
||||
|
||||
|
||||
/**
|
||||
* Memcached-Object
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @var object
|
||||
*/
|
||||
|
||||
private static $_memcached;
|
||||
|
||||
|
||||
/**
|
||||
* Availability check
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.0.7
|
||||
*
|
||||
* @return boolean true/false TRUE when installed
|
||||
*/
|
||||
|
||||
public static function is_available()
|
||||
{
|
||||
return class_exists('Memcached') && isset($_SERVER['SERVER_SOFTWARE']) && strpos(strtolower($_SERVER['SERVER_SOFTWARE']), 'nginx') !== false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Caching method as string
|
||||
*
|
||||
* @since 2.1.2
|
||||
* @change 2.1.2
|
||||
*
|
||||
* @return string Caching method
|
||||
*/
|
||||
|
||||
public static function stringify_method() {
|
||||
return 'Memcached';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Speicherung im Cache
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.0.7
|
||||
*
|
||||
* @param string $hash Hash des Eintrags
|
||||
* @param string $data Inhalt des Eintrags
|
||||
* @param integer $lifetime Lebensdauer des Eintrags
|
||||
*/
|
||||
|
||||
public static function store_item($hash, $data, $lifetime)
|
||||
{
|
||||
/* Empty? */
|
||||
if ( empty($data) ) {
|
||||
wp_die('MEMCACHE add item: Empty input.');
|
||||
}
|
||||
|
||||
/* Server connect */
|
||||
if ( ! self::_connect_server() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Add item */
|
||||
self::$_memcached->set(
|
||||
self::_file_path(),
|
||||
$data . self::_cache_signatur(),
|
||||
$lifetime
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Lesen aus dem Cache
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.0.7
|
||||
*
|
||||
* @param string $hash Hash des Eintrags
|
||||
* @return mixed $diff Wert des Eintrags
|
||||
*/
|
||||
|
||||
public static function get_item($hash)
|
||||
{
|
||||
/* Server connect */
|
||||
if ( ! self::_connect_server() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Get item */
|
||||
return self::$_memcached->get(
|
||||
self::_file_path()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Entfernung aus dem Cache
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.0.7
|
||||
*
|
||||
* @param string $hash Hash des Eintrags
|
||||
* @param string $url URL des Eintrags [optional]
|
||||
*/
|
||||
|
||||
public static function delete_item($hash, $url = '')
|
||||
{
|
||||
/* Server connect */
|
||||
if ( ! self::_connect_server() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Delete */
|
||||
self::$_memcached->delete(
|
||||
self::_file_path($url)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Leerung des Cache
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.0.7
|
||||
*/
|
||||
|
||||
public static function clear_cache()
|
||||
{
|
||||
/* Server connect */
|
||||
if ( ! self::_connect_server() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Flush */
|
||||
@self::$_memcached->flush();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ausgabe des Cache
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.0.7
|
||||
*/
|
||||
|
||||
public static function print_cache()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ermittlung der Cache-Größe
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.0.7
|
||||
*
|
||||
* @return mixed $diff Cache-Größe
|
||||
*/
|
||||
|
||||
public static function get_stats()
|
||||
{
|
||||
/* Server connect */
|
||||
if ( ! self::_connect_server() ) {
|
||||
wp_die('MEMCACHE: Not enabled.');
|
||||
}
|
||||
|
||||
/* Infos */
|
||||
$data = self::$_memcached->getStats();
|
||||
|
||||
/* No stats? */
|
||||
if ( empty($data) ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Get first key */
|
||||
$data = $data[key($data)];
|
||||
|
||||
/* Leer */
|
||||
if ( empty($data['bytes']) ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return $data['bytes'];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generierung der Signatur
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.0.7
|
||||
*
|
||||
* @return string $diff Signatur als String
|
||||
*/
|
||||
|
||||
private static function _cache_signatur()
|
||||
{
|
||||
return sprintf(
|
||||
"\n\n<!-- %s\n%s @ %s -->",
|
||||
'Cachify | http://cachify.de',
|
||||
'Memcached',
|
||||
date_i18n(
|
||||
'd.m.Y H:i:s',
|
||||
current_time('timestamp')
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Pfad der Cache-Datei
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.0.7
|
||||
*
|
||||
* @param string $path Request-URI oder Permalink [optional]
|
||||
* @return string $diff Pfad zur Cache-Datei
|
||||
*/
|
||||
|
||||
private static function _file_path($path = NULL)
|
||||
{
|
||||
return trailingslashit(
|
||||
sprintf(
|
||||
'%s%s',
|
||||
$_SERVER['HTTP_HOST'],
|
||||
parse_url(
|
||||
( $path ? $path : $_SERVER['REQUEST_URI'] ),
|
||||
PHP_URL_PATH
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Connect to Memcached server
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.1.8
|
||||
*
|
||||
* @hook array cachify_memcached_servers Array with memcached servers
|
||||
*
|
||||
* @return boolean true/false TRUE bei Erfolg
|
||||
*/
|
||||
|
||||
private static function _connect_server()
|
||||
{
|
||||
/* Not enabled? */
|
||||
if ( ! self::is_available() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Already connected */
|
||||
if ( is_object(self::$_memcached) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Init */
|
||||
self::$_memcached = new Memcached();
|
||||
|
||||
/* Set options */
|
||||
if ( defined('HHVM_VERSION') ) {
|
||||
self::$_memcached->setOption( Memcached::OPT_COMPRESSION, false );
|
||||
self::$_memcached->setOption( Memcached::OPT_BUFFER_WRITES, true );
|
||||
self::$_memcached->setOption( Memcached::OPT_BINARY_PROTOCOL, true );
|
||||
} else {
|
||||
self::$_memcached->setOptions(
|
||||
array(
|
||||
Memcached::OPT_COMPRESSION => false,
|
||||
Memcached::OPT_BUFFER_WRITES => true,
|
||||
Memcached::OPT_BINARY_PROTOCOL => true
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/* Connect */
|
||||
self::$_memcached->addServers(
|
||||
(array)apply_filters(
|
||||
'cachify_memcached_servers',
|
||||
array(
|
||||
array(
|
||||
'127.0.0.1',
|
||||
11211
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
44
msd2/wordpress/wp-content/plugins/cachify/js/post.js
Normal file
44
msd2/wordpress/wp-content/plugins/cachify/js/post.js
Normal file
@ -0,0 +1,44 @@
|
||||
jQuery(document).ready(
|
||||
function($) {
|
||||
|
||||
$('.edit-cachify-status', '#misc-publishing-actions').click(
|
||||
function(e) {
|
||||
$(this)
|
||||
.next(':hidden')
|
||||
.slideDown('fast')
|
||||
.end()
|
||||
.hide();
|
||||
|
||||
e.preventDefault();
|
||||
}
|
||||
);
|
||||
|
||||
$('.save-cachify-status', '#misc-publishing-actions').click(
|
||||
function(e) {
|
||||
$(this)
|
||||
.parent()
|
||||
.slideUp('fast')
|
||||
.prev(':hidden')
|
||||
.show();
|
||||
|
||||
$('#output-cachify-status').text(
|
||||
$('#cachify_status').children('option:selected').text()
|
||||
);
|
||||
|
||||
e.preventDefault();
|
||||
}
|
||||
);
|
||||
|
||||
$('.cancel-cachify-status', '#misc-publishing-actions').click(
|
||||
function(e) {
|
||||
$(this)
|
||||
.parent()
|
||||
.slideUp('fast')
|
||||
.prev(':hidden')
|
||||
.show();
|
||||
|
||||
e.preventDefault();
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
2
msd2/wordpress/wp-content/plugins/cachify/js/post.min.js
vendored
Normal file
2
msd2/wordpress/wp-content/plugins/cachify/js/post.min.js
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
jQuery(document).ready(function(a){a(".edit-cachify-status","#misc-publishing-actions").click(function(b){a(this).next(":hidden").slideDown("fast").end().hide();b.preventDefault()});a(".save-cachify-status","#misc-publishing-actions").click(function(b){a(this).parent().slideUp("fast").prev(":hidden").show();a("#output-cachify-status").text(a("#cachify_status").children("option:selected").text());b.preventDefault()});a(".cancel-cachify-status","#misc-publishing-actions").click(function(b){a(this).parent().slideUp("fast").prev(":hidden").show();
|
||||
b.preventDefault()})});
|
90
msd2/wordpress/wp-content/plugins/cachify/readme.txt
Normal file
90
msd2/wordpress/wp-content/plugins/cachify/readme.txt
Normal file
@ -0,0 +1,90 @@
|
||||
# Cachify #
|
||||
* Contributors: pluginkollektiv
|
||||
* Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LG5VC9KXMAYXJ
|
||||
* Tags: apc, cache, caching, performance
|
||||
* Requires at least: 3.8
|
||||
* Tested up to: 4.6
|
||||
* Stable tag: 2.2.4
|
||||
* License: GPLv2 or later
|
||||
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Smart, efficient cache solution for WordPress. Use DB, HDD, APC or Memcached for storing your blog pages. Make WordPress faster!
|
||||
|
||||
## Description ##
|
||||
*Cachify* optimizes your page loads by caching posts, pages and custom post types as static content. You can choose between caching via database, on the web server’s hard drive (HDD), or—thanks to APC (Alternative PHP Cache)—directly in the web server’s system cache. Whenever a page or post is loaded, it can be pulled directly from the cache. The amount of database queries and PHP requests will dramatically decrease towards zero, depending on the caching method you chose.
|
||||
|
||||
### Features ###
|
||||
* Works with custom post types.
|
||||
* Caching methods: DB, HDD, APC and Memcached.
|
||||
* “Flush Cache” button in the WordPress toolbar.
|
||||
* Ready for WordPress Multisite.
|
||||
* Optional compression of HTML markup.
|
||||
* White lists for posts and user agents.
|
||||
* Manual and automatic cache reset.
|
||||
* Automatic cache management.
|
||||
* Dashboard widget for cached objects.
|
||||
* Settings for Apache and Nginx servers.
|
||||
* Extendability via hooks/filters.
|
||||
|
||||
> #### Auf Deutsch? ####
|
||||
> Für eine ausführliche Dokumentation besuche bitte das [Cachify-Wiki](https://github.com/pluginkollektiv/cachify/wiki).
|
||||
>
|
||||
> **Community-Support auf Deutsch** erhältst du in einem der [deutschsprachigen Foren](https://de.forums.wordpress.org/forum/plugins); im [Plugin-Forum für Cachify](https://wordpress.org/support/plugin/cachify) wird, wie in allen Plugin-Foren auf wordpress.org, ausschließlich **Englisch** gesprochen.
|
||||
|
||||
### Support ###
|
||||
* Community support via the [support forums on wordpress.org](https://wordpress.org/support/plugin/cachify)
|
||||
* We don’t handle support via e-mail, Twitter, GitHub issues etc.
|
||||
|
||||
### Contribute ###
|
||||
* Active development of this plugin is handled on GitHub.
|
||||
* Pull requests for documented bugs are highly appreciated.
|
||||
* If you think you’ve found a bug (e.g. you’re experiencing unexpected behavior), please post at the [support forums](https://wordpress.org/support/plugin/cachify) first.
|
||||
|
||||
### Credits ###
|
||||
* Author: [Sergej Müller](https://sergejmueller.github.io/)
|
||||
* Maintainers: [pluginkollektiv](http://pluginkollektiv.org)
|
||||
|
||||
## Installation ##
|
||||
* If you don’t know how to install a plugin for WordPress, [here’s how](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins).
|
||||
|
||||
### Requirements ###
|
||||
* PHP 5.2.4 or greater
|
||||
* WordPress 3.8 or greater
|
||||
* APC 3.1.4 or greater (optional)
|
||||
* Memcached in Nginx (optional)
|
||||
|
||||
|
||||
## Changelog ##
|
||||
|
||||
### 2.2.4 ###
|
||||
* Fixes caching for mixed HTTPS and HTTP setups
|
||||
* Fixes an issue with the icon styling in the admin toolbar
|
||||
* Ensures compatibility with the latest WordPress version
|
||||
|
||||
### 2.2.3 ###
|
||||
* New: Generated a POT file
|
||||
* New: Added German formal translation
|
||||
* Updated, translated + formatted README.md
|
||||
* Updated expired link URLs in plugin and languages files
|
||||
* Updated [plugin authors](https://gist.github.com/glueckpress/f058c0ab973d45a72720)
|
||||
|
||||
### 2.2.2 ###
|
||||
* Fix: Parameter-Rückgabe beim Filter `dashboard_glance_items`
|
||||
* Großzügige Anwendung des Filters `esc_html`
|
||||
|
||||
### 2.2.1 ###
|
||||
* Fix für die Meldung "Call to undefined function is_plugin_active_for_network" in WordPress-Multisite
|
||||
|
||||
### 2.2.0 ###
|
||||
* Werkzeugleiste: Anzeige des "Cache leeren" Buttons im Frontend der Website
|
||||
* Werkzeugleiste: Steuerung der Anzeige des "Cache leeren" Buttons via Hook
|
||||
|
||||
For the complete changelog, check out our [GitHub repository](https://github.com/pluginkollektiv/cachify).
|
||||
|
||||
## Upgrade Notice ##
|
||||
|
||||
### 2.2.4 ###
|
||||
This is mainly a maintenance release ensuring compatibility with the latest version of WordPress. Expect bigger changes in 2.3.0 soon!
|
||||
|
||||
## Screenshots ##
|
||||
1. Cachify Dashboard Widget
|
156
msd2/wordpress/wp-content/plugins/cachify/trunk/CHANGELOG.md
Normal file
156
msd2/wordpress/wp-content/plugins/cachify/trunk/CHANGELOG.md
Normal file
@ -0,0 +1,156 @@
|
||||
# Changelog
|
||||
|
||||
|
||||
### 2.1.9 ###
|
||||
* Vervollständigung des Cachify-Pfades in `robots.txt`: `Disallow: /wp-content/cache/cachify/`
|
||||
* *Release-Zeitaufwand (Development & QA): 0,75 Stunden*
|
||||
|
||||
### 2.1.8 ###
|
||||
* HHVM-Unterstützung für die *Memcached* Caching-Methode (Danke, [Ulrich Block](http://www.ulrich-block.de))
|
||||
|
||||
### 2.1.7 ###
|
||||
* Cache-Leerung bei Custom Post Types
|
||||
* Einführung zusätzlicher Sicherheitsabfragen
|
||||
* Code-Refactoring
|
||||
|
||||
### 2.1.6 ###
|
||||
* Button "Cache leeren" sichtbar sowohl in WP 3.8 wie WP 3.9
|
||||
|
||||
### 2.1.5 ###
|
||||
* Support für WordPress 3.9
|
||||
* Button "Cache leeren" sichtbar bei jeder Bildschirmauflösung
|
||||
|
||||
### 2.1.4 ###
|
||||
* Support für WordPress 3.8.1
|
||||
|
||||
### 2.1.3 ###
|
||||
* Manuelle Auswahl: Beim Artikel-Update nur den Seitencache löschen
|
||||
* Lokalisierung der Plugin-Dateien
|
||||
* Umbauten am Plugin-Core
|
||||
* Detaillierter auf [Google+](https://plus.google.com/+SergejMüller/posts/By2PEtRMk8g)
|
||||
|
||||
### 2.1.2 ###
|
||||
* Optimierung für WordPress 3.8
|
||||
* Option hinzugefügt: Neue Kommentare lösen einen Cache-Reset aus
|
||||
|
||||
### 2.1.1 ###
|
||||
* Hook `cachify_skip_cache` für die Steuerung der Cache-Generierung
|
||||
* Support für das MP6 Plugin
|
||||
* Detaillierter auf [Google+](https://plus.google.com/110569673423509816572/posts/S1mpFsG3NZC)
|
||||
|
||||
### 2.1.0 ###
|
||||
* Cache-Leerung bei Plugin-Deaktivierung
|
||||
|
||||
### 2.0.9 ###
|
||||
* Quelltext-Minimierung als Selektbox und Hook
|
||||
* Interne Umstellung auf Konstanten
|
||||
|
||||
### 2.0.7 ###
|
||||
* Unterstützung für Memcached
|
||||
* WordPress 3.6 Support
|
||||
* Cache-Neuaufbau beim Theme-Wechsel
|
||||
* Quelltext-Optimierungen
|
||||
|
||||
### 2.0.6 ###
|
||||
* Cache-Neuaufbau einer Blogseite nur bei Kommentaren, die freigegeben sind
|
||||
|
||||
### 2.0.5 ###
|
||||
* Cache-Leerung nach einem WordPress-Upgrade
|
||||
* Keine Cache-Ausgabe für Jetpack Mobile Theme
|
||||
* Abfrage auf eingeloggte Nutzer bei APC als Caching-Methode
|
||||
* Änderung der Systemvoraussetzungen
|
||||
* Cache-Reset nach WordPress-Update
|
||||
|
||||
### 2.0.4 ###
|
||||
* Bessere Trennung der Cache-Gesamtgröße im Dashboard-Widget "Auf einen Blick"
|
||||
|
||||
### 2.0.3 ###
|
||||
* Cache-Leerung beim Veröffentlichen verfügbarer Custom Post Types
|
||||
* Noindex in der von WordPress generierten `robots.txt` für den Ordner mit HDD-Cache
|
||||
* Hook `cachify_flush_cache` zum Leeren des Cache aus Drittanwendungen
|
||||
|
||||
### 2.0.2 ###
|
||||
* Unterstützung für WordPress 3.4
|
||||
* Hochauflösende Icons für iPad & Co.
|
||||
* Anpassungen für ältere PHP5-Versionen
|
||||
* Entfernung des Plugin-Icons aus der Sidebar
|
||||
|
||||
### 2.0.1 ###
|
||||
* Verbesserter Autoload-Prozess
|
||||
* Diverse Umbenennungen der Optionen
|
||||
* Cache-Neuaufbau bei geplanten Beiträgen (Cachify DB)
|
||||
|
||||
### 2.0 ###
|
||||
* Überarbeitung der GUI
|
||||
* Source Code-Modularisierung
|
||||
* Cache-Größe auf dem Dashboard
|
||||
* Festplatte als Ablageort für Cache
|
||||
* Produktseite online: http://cachify.de
|
||||
* Cache-Neuaufbau bei Kommentarstatusänderungen
|
||||
* APC-Anforderungen: APC 3.0.0, empfohlen 3.1.4
|
||||
* Optional: Kein Cache für kommentierende Nutzer
|
||||
* Schnellübersicht der Optionen als Inline-Hilfe
|
||||
* Mindestanforderungen: WordPress 3.1 & PHP 5.1.2
|
||||
|
||||
### 1.5.1 ###
|
||||
* `zlib.output_compression = Off` für Apache Webserver
|
||||
|
||||
### 1.5 ###
|
||||
* Überarbeitung des Regexp für HTML-Minify
|
||||
* Reduzierung des Toolbar-Buttons auf das Icon
|
||||
* Formatierung und Kommentierung des Quelltextes
|
||||
|
||||
### 1.4 ###
|
||||
* Xmas Edition
|
||||
|
||||
### 1.3 ###
|
||||
* Unterstützung für APC (Alternative PHP Cache)
|
||||
* Umpositionierung des Admin Bar Buttons
|
||||
|
||||
### 1.2.1 ###
|
||||
* Icon für die "Cache leeren" Schaltfläche in der Admin Bar
|
||||
|
||||
### 1.2 ###
|
||||
* Schaltfläche "Cache leeren" in der Adminbar (ab WordPress 3.1)
|
||||
* `flush_cache` auf public gesetzt, um von [wpSEO](http://wpseo.de "WordPress SEO Plugin") ansprechen zu können
|
||||
* Ausführliche Tests unter WordPress 3.3
|
||||
|
||||
### 1.1 ###
|
||||
* Interne Prüfung auf fehlerhafte Cache-Generierung
|
||||
* Anpassungen an der Code-Struktur
|
||||
* Entfernung der Inline-Hilfe
|
||||
* Verknüpfung der Online-Hilfe mit Optionen
|
||||
|
||||
### 1.0 ###
|
||||
* Leerung des Cache beim Aktualisieren von statischen Seiten
|
||||
* Seite mit Plugin-Einstellungen
|
||||
* Inline-Dokumentation in der Optionsseite
|
||||
* Ausschluss von Passwort-geschützten Seiten
|
||||
* WordPress 3.2 Support
|
||||
* Unterstützung der WordPress Multisite Blogs
|
||||
* Umstellung auf den template_redirect-Hook (Plugin-Kompatibilität)
|
||||
* Interne Code-Bereinigung
|
||||
|
||||
### 0.9.2 ###
|
||||
* HTML-Kompression
|
||||
* Flattr-Link
|
||||
|
||||
### 0.9.1 ###
|
||||
* Cache-Reset bei geplanten Beiträgen
|
||||
* Unterstützung für das Carrington-Mobile Theme
|
||||
|
||||
### 0.9 ###
|
||||
* Workaround für Redirects
|
||||
|
||||
### 0.8 ###
|
||||
* Blacklist für PostIDs
|
||||
* Blacklist für UserAgents
|
||||
* Ausnahme für WP Touch
|
||||
* Ausgabe des Zeitpunktes der Generierung
|
||||
* Umbenennung der Konstanten
|
||||
|
||||
### 0.7 ###
|
||||
* Ausgabe des Speicherverbrauchs
|
||||
|
||||
### 0.6 ###
|
||||
* Live auf wordpress.org
|
90
msd2/wordpress/wp-content/plugins/cachify/trunk/README.md
Normal file
90
msd2/wordpress/wp-content/plugins/cachify/trunk/README.md
Normal file
@ -0,0 +1,90 @@
|
||||
# Cachify #
|
||||
* Contributors: pluginkollektiv
|
||||
* Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LG5VC9KXMAYXJ
|
||||
* Tags: apc, cache, caching, performance
|
||||
* Requires at least: 3.8
|
||||
* Tested up to: 4.6
|
||||
* Stable tag: 2.2.4
|
||||
* License: GPLv2 or later
|
||||
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Smart, efficient cache solution for WordPress. Use DB, HDD, APC or Memcached for storing your blog pages. Make WordPress faster!
|
||||
|
||||
## Description ##
|
||||
*Cachify* optimizes your page loads by caching posts, pages and custom post types as static content. You can choose between caching via database, on the web server’s hard drive (HDD), or—thanks to APC (Alternative PHP Cache)—directly in the web server’s system cache. Whenever a page or post is loaded, it can be pulled directly from the cache. The amount of database queries and PHP requests will dramatically decrease towards zero, depending on the caching method you chose.
|
||||
|
||||
### Features ###
|
||||
* Works with custom post types.
|
||||
* Caching methods: DB, HDD, APC and Memcached.
|
||||
* “Flush Cache” button in the WordPress toolbar.
|
||||
* Ready for WordPress Multisite.
|
||||
* Optional compression of HTML markup.
|
||||
* White lists for posts and user agents.
|
||||
* Manual and automatic cache reset.
|
||||
* Automatic cache management.
|
||||
* Dashboard widget for cached objects.
|
||||
* Settings for Apache and Nginx servers.
|
||||
* Extendability via hooks/filters.
|
||||
|
||||
> #### Auf Deutsch? ####
|
||||
> Für eine ausführliche Dokumentation besuche bitte das [Cachify-Wiki](https://github.com/pluginkollektiv/cachify/wiki).
|
||||
>
|
||||
> **Community-Support auf Deutsch** erhältst du in einem der [deutschsprachigen Foren](https://de.forums.wordpress.org/forum/plugins); im [Plugin-Forum für Cachify](https://wordpress.org/support/plugin/cachify) wird, wie in allen Plugin-Foren auf wordpress.org, ausschließlich **Englisch** gesprochen.
|
||||
|
||||
### Support ###
|
||||
* Community support via the [support forums on wordpress.org](https://wordpress.org/support/plugin/cachify)
|
||||
* We don’t handle support via e-mail, Twitter, GitHub issues etc.
|
||||
|
||||
### Contribute ###
|
||||
* Active development of this plugin is handled on GitHub.
|
||||
* Pull requests for documented bugs are highly appreciated.
|
||||
* If you think you’ve found a bug (e.g. you’re experiencing unexpected behavior), please post at the [support forums](https://wordpress.org/support/plugin/cachify) first.
|
||||
|
||||
### Credits ###
|
||||
* Author: [Sergej Müller](https://sergejmueller.github.io/)
|
||||
* Maintainers: [pluginkollektiv](http://pluginkollektiv.org)
|
||||
|
||||
## Installation ##
|
||||
* If you don’t know how to install a plugin for WordPress, [here’s how](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins).
|
||||
|
||||
### Requirements ###
|
||||
* PHP 5.2.4 or greater
|
||||
* WordPress 3.8 or greater
|
||||
* APC 3.1.4 or greater (optional)
|
||||
* Memcached in Nginx (optional)
|
||||
|
||||
|
||||
## Changelog ##
|
||||
|
||||
### 2.2.4 ###
|
||||
* Fixes caching for mixed HTTPS and HTTP setups
|
||||
* Fixes an issue with the icon styling in the admin toolbar
|
||||
* Ensures compatibility with the latest WordPress version
|
||||
|
||||
### 2.2.3 ###
|
||||
* New: Generated a POT file
|
||||
* New: Added German formal translation
|
||||
* Updated, translated + formatted README.md
|
||||
* Updated expired link URLs in plugin and languages files
|
||||
* Updated [plugin authors](https://gist.github.com/glueckpress/f058c0ab973d45a72720)
|
||||
|
||||
### 2.2.2 ###
|
||||
* Fix: Parameter-Rückgabe beim Filter `dashboard_glance_items`
|
||||
* Großzügige Anwendung des Filters `esc_html`
|
||||
|
||||
### 2.2.1 ###
|
||||
* Fix für die Meldung "Call to undefined function is_plugin_active_for_network" in WordPress-Multisite
|
||||
|
||||
### 2.2.0 ###
|
||||
* Werkzeugleiste: Anzeige des "Cache leeren" Buttons im Frontend der Website
|
||||
* Werkzeugleiste: Steuerung der Anzeige des "Cache leeren" Buttons via Hook
|
||||
|
||||
For the complete changelog, check out our [GitHub repository](https://github.com/pluginkollektiv/cachify).
|
||||
|
||||
## Upgrade Notice ##
|
||||
|
||||
### 2.2.4 ###
|
||||
This is mainly a maintenance release ensuring compatibility with the latest version of WordPress. Expect bigger changes in 2.3.0 soon!
|
||||
|
||||
## Screenshots ##
|
||||
1. Cachify Dashboard Widget
|
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
if ( ! empty($_COOKIE) ) {
|
||||
foreach ( $_COOKIE as $k => $v ) {
|
||||
if ( preg_match('/^(wp-postpass|wordpress_logged_in|comment_author)_/', $k) ) {
|
||||
$_cachify_logged_in = true; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
empty($_cachify_logged_in)
|
||||
&& ( strpos( filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING), '/wp-admin/' ) === false )
|
||||
&& ( strpos( filter_input(INPUT_SERVER, 'HTTP_ACCEPT_ENCODING', FILTER_SANITIZE_STRING), 'gzip' ) !== false )
|
||||
&& extension_loaded('apc')
|
||||
&& ( $cache = apc_fetch(md5($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']) . '.cachify') )
|
||||
) {
|
||||
ini_set('zlib.output_compression', 'Off');
|
||||
|
||||
header('Vary: Accept-Encoding');
|
||||
header('X-Powered-By: Cachify');
|
||||
header('Content-Encoding: gzip');
|
||||
header('Content-Length: ' .strlen($cache));
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
|
||||
echo $cache;
|
||||
exit;
|
||||
}
|
90
msd2/wordpress/wp-content/plugins/cachify/trunk/cachify.php
Normal file
90
msd2/wordpress/wp-content/plugins/cachify/trunk/cachify.php
Normal file
@ -0,0 +1,90 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: Cachify
|
||||
Description: Easy to use WordPress caching plugin. Serving static blog pages from database, disk, Memcached or APC.
|
||||
Author: pluginkollektiv
|
||||
Author URI: http://pluginkollektiv.org
|
||||
Plugin URI: https://wordpress.org/plugins/cachify/
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Version: 2.2.4
|
||||
Text Domain: cachify
|
||||
Domain Path: /lang
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (C) 2011-2015 Sergej Müller
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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 Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* Quit */
|
||||
defined('ABSPATH') OR exit;
|
||||
|
||||
|
||||
/* Konstanten */
|
||||
define('CACHIFY_FILE', __FILE__);
|
||||
define('CACHIFY_DIR', dirname(__FILE__));
|
||||
define('CACHIFY_BASE', plugin_basename(__FILE__));
|
||||
define('CACHIFY_CACHE_DIR', WP_CONTENT_DIR. '/cache/cachify');
|
||||
|
||||
|
||||
/* Hooks */
|
||||
add_action(
|
||||
'plugins_loaded',
|
||||
array(
|
||||
'Cachify',
|
||||
'instance'
|
||||
)
|
||||
);
|
||||
register_activation_hook(
|
||||
__FILE__,
|
||||
array(
|
||||
'Cachify',
|
||||
'on_activation'
|
||||
)
|
||||
);
|
||||
register_deactivation_hook(
|
||||
__FILE__,
|
||||
array(
|
||||
'Cachify',
|
||||
'on_deactivation'
|
||||
)
|
||||
);
|
||||
register_uninstall_hook(
|
||||
__FILE__,
|
||||
array(
|
||||
'Cachify',
|
||||
'on_uninstall'
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
/* Autoload Init */
|
||||
spl_autoload_register('cachify_autoload');
|
||||
|
||||
/* Autoload Funktion */
|
||||
function cachify_autoload($class) {
|
||||
if ( in_array($class, array('Cachify', 'Cachify_APC', 'Cachify_DB', 'Cachify_HDD', 'Cachify_MEMCACHED')) ) {
|
||||
require_once(
|
||||
sprintf(
|
||||
'%s/inc/%s.class.php',
|
||||
CACHIFY_DIR,
|
||||
strtolower($class)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
/* @group Dashboard */
|
||||
|
||||
@font-face {
|
||||
font-family: 'cachifyIcons';
|
||||
src: url('data:font/opentype;base64,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') format('woff');
|
||||
}
|
||||
|
||||
#dashboard_right_now .cachify-icon:before {
|
||||
color: #82878c;
|
||||
font-family: "cachifyIcons";
|
||||
}
|
||||
#dashboard_right_now .cachify-icon--hdd:before {
|
||||
margin: 3px 7px 0 2px;
|
||||
content: "\e801";
|
||||
font-size: 16px;
|
||||
}
|
||||
#dashboard_right_now .cachify-icon--db:before {
|
||||
margin: 1px 9px 0 3px;
|
||||
content: "\e802";
|
||||
font-size: 18px;
|
||||
}
|
||||
#dashboard_right_now .cachify-icon--apc:before,
|
||||
#dashboard_right_now .cachify-icon--memcached:before {
|
||||
margin: 3px 6px 0 0;
|
||||
content: "\e800";
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/* @end group */
|
1
msd2/wordpress/wp-content/plugins/cachify/trunk/css/dashboard.min.css
vendored
Normal file
1
msd2/wordpress/wp-content/plugins/cachify/trunk/css/dashboard.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
@font-face{font-family:cachifyIcons;src:url(data:font/opentype;base64,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) format('woff')}#dashboard_right_now .cachify-icon:before{color:#82878c;font-family:cachifyIcons}#dashboard_right_now .cachify-icon--hdd:before{margin:3px 7px 0 2px;content:"\e801";font-size:16px}#dashboard_right_now .cachify-icon--db:before{margin:1px 9px 0 3px;content:"\e802";font-size:18px}#dashboard_right_now .cachify-icon--apc:before,#dashboard_right_now .cachify-icon--memcached:before{margin:3px 6px 0 0;content:"\e800";font-size:13px}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,188 @@
|
||||
<?php
|
||||
|
||||
|
||||
/* Quit */
|
||||
defined('ABSPATH') OR exit;
|
||||
|
||||
|
||||
/**
|
||||
* Cachify_APC
|
||||
*/
|
||||
|
||||
final class Cachify_APC {
|
||||
|
||||
|
||||
/**
|
||||
* Availability check
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.0.7
|
||||
*
|
||||
* @return boolean true/false TRUE when installed
|
||||
*/
|
||||
|
||||
public static function is_available()
|
||||
{
|
||||
return extension_loaded('apc');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Caching method as string
|
||||
*
|
||||
* @since 2.1.2
|
||||
* @change 2.1.2
|
||||
*
|
||||
* @return string Caching method
|
||||
*/
|
||||
|
||||
public static function stringify_method() {
|
||||
return 'APC';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Speicherung im Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @param string $hash Hash des Eintrags
|
||||
* @param string $data Inhalt des Eintrags
|
||||
* @param integer $lifetime Lebensdauer des Eintrags
|
||||
*/
|
||||
|
||||
public static function store_item($hash, $data, $lifetime)
|
||||
{
|
||||
/* Leer? */
|
||||
if ( empty($hash) or empty($data) ) {
|
||||
wp_die('APC add item: Empty input.');
|
||||
}
|
||||
|
||||
/* Store */
|
||||
apc_store(
|
||||
$hash,
|
||||
gzencode( $data . self::_cache_signatur(), 9),
|
||||
$lifetime
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Lesen aus dem Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @param string $hash Hash des Eintrags
|
||||
* @return mixed $diff Wert des Eintrags
|
||||
*/
|
||||
|
||||
public static function get_item($hash)
|
||||
{
|
||||
/* Leer? */
|
||||
if ( empty($hash) ) {
|
||||
wp_die('APC get item: Empty input.');
|
||||
}
|
||||
|
||||
return ( function_exists('apc_exists') ? apc_exists($hash) : apc_fetch($hash) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Entfernung aus dem Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @param string $hash Hash des Eintrags
|
||||
* @param string $url URL des Eintrags [optional]
|
||||
*/
|
||||
|
||||
public static function delete_item($hash, $url = '')
|
||||
{
|
||||
/* Leer? */
|
||||
if ( empty($hash) ) {
|
||||
wp_die('APC delete item: Empty input.');
|
||||
}
|
||||
|
||||
/* Löschen */
|
||||
apc_delete($hash);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Leerung des Cache
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @change 2.0.7
|
||||
*/
|
||||
|
||||
public static function clear_cache()
|
||||
{
|
||||
if ( ! self::is_available() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
@apc_clear_cache('user');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ausgabe des Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*/
|
||||
|
||||
public static function print_cache()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ermittlung der Cache-Größe
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @return mixed $diff Cache-Größe
|
||||
*/
|
||||
|
||||
public static function get_stats()
|
||||
{
|
||||
/* Infos */
|
||||
$data = apc_cache_info('user');
|
||||
|
||||
/* Leer */
|
||||
if ( empty($data['mem_size']) ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return $data['mem_size'];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generierung der Signatur
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0.5
|
||||
*
|
||||
* @return string $diff Signatur als String
|
||||
*/
|
||||
|
||||
private static function _cache_signatur()
|
||||
{
|
||||
return sprintf(
|
||||
"\n\n<!-- %s\n%s @ %s -->",
|
||||
'Cachify | http://cachify.de',
|
||||
'APC Cache',
|
||||
date_i18n(
|
||||
'd.m.Y H:i:s',
|
||||
current_time('timestamp')
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,272 @@
|
||||
<?php
|
||||
|
||||
|
||||
/* Quit */
|
||||
defined('ABSPATH') OR exit;
|
||||
|
||||
|
||||
/**
|
||||
* Cachify_DB
|
||||
*/
|
||||
|
||||
final class Cachify_DB {
|
||||
|
||||
|
||||
/**
|
||||
* Availability check
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.0.7
|
||||
*
|
||||
* @return boolean true/false TRUE when installed
|
||||
*/
|
||||
|
||||
public static function is_available()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Caching method as string
|
||||
*
|
||||
* @since 2.1.2
|
||||
* @change 2.1.2
|
||||
*
|
||||
* @return string Caching method
|
||||
*/
|
||||
|
||||
public static function stringify_method() {
|
||||
return 'DB';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Speicherung im Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @param string $hash Hash des Eintrags
|
||||
* @param string $data Inhalt des Eintrags
|
||||
* @param integer $lifetime Lebensdauer des Eintrags
|
||||
*/
|
||||
|
||||
public static function store_item($hash, $data, $lifetime)
|
||||
{
|
||||
/* Leer? */
|
||||
if ( empty($hash) or empty($data) ) {
|
||||
wp_die('DB add item: Empty input.');
|
||||
}
|
||||
|
||||
/* Store */
|
||||
set_transient(
|
||||
$hash,
|
||||
array(
|
||||
'data' => $data,
|
||||
'meta' => array(
|
||||
'queries' => self::_page_queries(),
|
||||
'timer' => self::_page_timer(),
|
||||
'memory' => self::_page_memory(),
|
||||
'time' => current_time('timestamp')
|
||||
)
|
||||
),
|
||||
$lifetime
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Lesen aus dem Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @param string $hash Hash des Eintrags
|
||||
* @return mixed $diff Wert des Eintrags
|
||||
*/
|
||||
|
||||
public static function get_item($hash)
|
||||
{
|
||||
/* Leer? */
|
||||
if ( empty($hash) ) {
|
||||
wp_die('DB get item: Empty input.');
|
||||
}
|
||||
|
||||
return get_transient($hash);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Entfernung aus dem Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @param string $hash Hash des Eintrags
|
||||
* @param string $url URL des Eintrags [optional]
|
||||
*/
|
||||
|
||||
public static function delete_item($hash, $url = '')
|
||||
{
|
||||
/* Leer? */
|
||||
if ( empty($hash) ) {
|
||||
wp_die('DB delete item: Empty input.');
|
||||
}
|
||||
|
||||
/* Löschen */
|
||||
delete_transient($hash);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Leerung des Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*/
|
||||
|
||||
public static function clear_cache()
|
||||
{
|
||||
/* Init */
|
||||
global $wpdb;
|
||||
|
||||
/* Löschen */
|
||||
$wpdb->query("DELETE FROM `" .$wpdb->options. "` WHERE `option_name` LIKE ('\_transient%.cachify')");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ausgabe des Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0.2
|
||||
*
|
||||
* @param array $cache Array mit Cache-Werten
|
||||
*/
|
||||
|
||||
public static function print_cache($cache)
|
||||
{
|
||||
/* Kein Array? */
|
||||
if ( ! is_array($cache) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Content */
|
||||
echo $cache['data'];
|
||||
|
||||
/* Signatur */
|
||||
if ( isset($cache['meta']) ) {
|
||||
echo self::_cache_signatur($cache['meta']);
|
||||
}
|
||||
|
||||
/* Raus */
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ermittlung der Cache-Größe
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @return integer $diff Spaltengröße
|
||||
*/
|
||||
|
||||
public static function get_stats()
|
||||
{
|
||||
/* Init */
|
||||
global $wpdb;
|
||||
|
||||
/* Auslesen */
|
||||
return $wpdb->get_var(
|
||||
"SELECT SUM( CHAR_LENGTH(option_value) ) FROM `" .$wpdb->options. "` WHERE `option_name` LIKE ('\_transient%.cachify')"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generierung der Signatur
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0.5
|
||||
*
|
||||
* @param array $meta Inhalt der Metadaten
|
||||
* @return string $diff Signatur als String
|
||||
*/
|
||||
|
||||
private static function _cache_signatur($meta)
|
||||
{
|
||||
/* Kein Array? */
|
||||
if ( ! is_array($meta) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
return sprintf(
|
||||
"\n\n<!--\n%s\n%s\n%s\n%s\n-->",
|
||||
'Cachify | http://cachify.de',
|
||||
sprintf(
|
||||
'Ohne Plugin: %d DB-Anfragen, %s Sekunden, %s',
|
||||
$meta['queries'],
|
||||
$meta['timer'],
|
||||
$meta['memory']
|
||||
),
|
||||
sprintf(
|
||||
'Mit Plugin: %d DB-Anfragen, %s Sekunden, %s',
|
||||
self::_page_queries(),
|
||||
self::_page_timer(),
|
||||
self::_page_memory()
|
||||
),
|
||||
sprintf(
|
||||
'Generiert: %s zuvor',
|
||||
human_time_diff($meta['time'], current_time('timestamp'))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Rückgabe der Query-Anzahl
|
||||
*
|
||||
* @since 0.1
|
||||
* @change 2.0
|
||||
*
|
||||
* @return intval $diff Query-Anzahl
|
||||
*/
|
||||
|
||||
private static function _page_queries()
|
||||
{
|
||||
return $GLOBALS['wpdb']->num_queries;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Rückgabe der Ausführungszeit
|
||||
*
|
||||
* @since 0.1
|
||||
* @change 2.0
|
||||
*
|
||||
* @return intval $diff Anzahl der Sekunden
|
||||
*/
|
||||
|
||||
private static function _page_timer()
|
||||
{
|
||||
return timer_stop(0, 2);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Rückgabe des Speicherverbrauchs
|
||||
*
|
||||
* @since 0.7
|
||||
* @change 2.0
|
||||
*
|
||||
* @return string $diff Konvertierter Größenwert
|
||||
*/
|
||||
|
||||
private static function _page_memory()
|
||||
{
|
||||
return ( function_exists('memory_get_usage') ? size_format(memory_get_usage(), 2) : 0 );
|
||||
}
|
||||
}
|
@ -0,0 +1,392 @@
|
||||
<?php
|
||||
|
||||
|
||||
/* Quit */
|
||||
defined('ABSPATH') OR exit;
|
||||
|
||||
|
||||
/**
|
||||
* Cachify_HDD
|
||||
*/
|
||||
|
||||
final class Cachify_HDD {
|
||||
|
||||
|
||||
/**
|
||||
* Availability check
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.0.7
|
||||
*
|
||||
* @return boolean true/false TRUE when installed
|
||||
*/
|
||||
|
||||
public static function is_available()
|
||||
{
|
||||
return get_option('permalink_structure');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Caching method as string
|
||||
*
|
||||
* @since 2.1.2
|
||||
* @change 2.1.2
|
||||
*
|
||||
* @return string Caching method
|
||||
*/
|
||||
|
||||
public static function stringify_method() {
|
||||
return 'HDD';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Speicherung im Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @param string $hash Hash des Eintrags [optional]
|
||||
* @param string $data Inhalt des Eintrags
|
||||
* @param integer $lifetime Lebensdauer des Eintrags [optional]
|
||||
*/
|
||||
|
||||
public static function store_item($hash, $data, $lifetime)
|
||||
{
|
||||
/* Leer? */
|
||||
if ( empty($data) ) {
|
||||
wp_die('HDD add item: Empty input.');
|
||||
}
|
||||
|
||||
/* Speichern */
|
||||
self::_create_files(
|
||||
$data . self::_cache_signatur()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Lesen aus dem Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @return boolean $diff TRUE wenn Cache vorhanden
|
||||
*/
|
||||
|
||||
public static function get_item()
|
||||
{
|
||||
return is_readable(
|
||||
self::_file_html()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Entfernen aus dem Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @param string $hash Hash des Eintrags [optional]
|
||||
* @param string $url URL des Eintrags
|
||||
*/
|
||||
|
||||
public static function delete_item($hash = '', $url)
|
||||
{
|
||||
/* Leer? */
|
||||
if ( empty($url) ) {
|
||||
wp_die('HDD delete item: Empty input.');
|
||||
}
|
||||
|
||||
/* Löschen */
|
||||
self::_clear_dir(
|
||||
self::_file_path($url)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Leerung des Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*/
|
||||
|
||||
public static function clear_cache()
|
||||
{
|
||||
self::_clear_dir(
|
||||
CACHIFY_CACHE_DIR
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ausgabe des Cache
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*/
|
||||
|
||||
public static function print_cache()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ermittlung der Cache-Größe
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @return integer $diff Ordnergröße
|
||||
*/
|
||||
|
||||
public static function get_stats()
|
||||
{
|
||||
return self::_dir_size( CACHIFY_CACHE_DIR );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generierung der Signatur
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0.5
|
||||
*
|
||||
* @return string $diff Signatur als String
|
||||
*/
|
||||
|
||||
private static function _cache_signatur()
|
||||
{
|
||||
return sprintf(
|
||||
"\n\n<!-- %s\n%s @ %s -->",
|
||||
'Cachify | http://cachify.de',
|
||||
'HDD Cache',
|
||||
date_i18n(
|
||||
'd.m.Y H:i:s',
|
||||
current_time('timestamp')
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialisierung des Cache-Speichervorgangs
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @param string $data Cache-Inhalt
|
||||
*/
|
||||
|
||||
private static function _create_files($data)
|
||||
{
|
||||
/* Ordner anlegen */
|
||||
if ( ! wp_mkdir_p( self::_file_path() ) ) {
|
||||
wp_die('Unable to create directory.');
|
||||
}
|
||||
|
||||
/* Dateien schreiben */
|
||||
self::_create_file( self::_file_html(), $data );
|
||||
self::_create_file( self::_file_gzip(), gzencode($data, 9) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Anlegen der Cache-Datei
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @param string $file Pfad der Cache-Datei
|
||||
* @param string $data Cache-Inhalt
|
||||
*/
|
||||
|
||||
private static function _create_file($file, $data)
|
||||
{
|
||||
/* Beschreibbar? */
|
||||
if ( ! $handle = @fopen($file, 'wb') ) {
|
||||
wp_die('Could not write file.');
|
||||
}
|
||||
|
||||
/* Schreiben */
|
||||
@fwrite($handle, $data);
|
||||
fclose($handle);
|
||||
clearstatcache();
|
||||
|
||||
/* Permissions */
|
||||
$stat = @stat( dirname($file) );
|
||||
$perms = $stat['mode'] & 0007777;
|
||||
$perms = $perms & 0000666;
|
||||
@chmod($file, $perms);
|
||||
clearstatcache();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Rekrusive Leerung eines Ordners
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0.5
|
||||
*
|
||||
* @param string $dir Ordnerpfad
|
||||
*/
|
||||
|
||||
private static function _clear_dir($dir) {
|
||||
/* Weg mit dem Slash */
|
||||
$dir = untrailingslashit($dir);
|
||||
|
||||
/* Ordner? */
|
||||
if ( ! is_dir($dir) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Einlesen */
|
||||
$objects = array_diff(
|
||||
scandir($dir),
|
||||
array('..', '.')
|
||||
);
|
||||
|
||||
/* Leer? */
|
||||
if ( empty($objects) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Loopen */
|
||||
foreach ( $objects as $object ) {
|
||||
/* Um Pfad erweitern */
|
||||
$object = $dir. DIRECTORY_SEPARATOR .$object;
|
||||
|
||||
/* Ordner/Datei */
|
||||
if ( is_dir($object) ) {
|
||||
self::_clear_dir($object);
|
||||
} else {
|
||||
unlink($object);
|
||||
}
|
||||
}
|
||||
|
||||
/* Killen */
|
||||
@rmdir($dir);
|
||||
|
||||
/* Aufräumen */
|
||||
clearstatcache();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ermittlung der Ordnergröße
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @param string $dir Ordnerpfad
|
||||
* @return mixed $size Ordnergröße
|
||||
*/
|
||||
|
||||
public static function _dir_size($dir = '.')
|
||||
{
|
||||
/* Ordner? */
|
||||
if ( ! is_dir($dir) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Einlesen */
|
||||
$objects = array_diff(
|
||||
scandir($dir),
|
||||
array('..', '.')
|
||||
);
|
||||
|
||||
/* Leer? */
|
||||
if ( empty($objects) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Init */
|
||||
$size = 0;
|
||||
|
||||
/* Loopen */
|
||||
foreach ( $objects as $object ) {
|
||||
/* Um Pfad erweitern */
|
||||
$object = $dir. DIRECTORY_SEPARATOR .$object;
|
||||
|
||||
/* Ordner/Datei */
|
||||
if ( is_dir($object) ) {
|
||||
$size += self::_dir_size($object);
|
||||
} else {
|
||||
$size += filesize($object);
|
||||
}
|
||||
}
|
||||
|
||||
return $size;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Pfad der Cache-Datei
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @param string $path Request-URI oder Permalink [optional]
|
||||
* @return string $diff Pfad zur Cache-Datei
|
||||
*/
|
||||
|
||||
private static function _file_path($path = NULL)
|
||||
{
|
||||
$prefix = is_ssl() ? 'https-' : '';
|
||||
|
||||
$path = sprintf(
|
||||
'%s%s%s%s%s',
|
||||
CACHIFY_CACHE_DIR,
|
||||
DIRECTORY_SEPARATOR,
|
||||
$prefix,
|
||||
parse_url(
|
||||
'http://' .strtolower($_SERVER['HTTP_HOST']),
|
||||
PHP_URL_HOST
|
||||
),
|
||||
parse_url(
|
||||
( $path ? $path : $_SERVER['REQUEST_URI'] ),
|
||||
PHP_URL_PATH
|
||||
)
|
||||
);
|
||||
|
||||
if ( validate_file($path) > 0 ) {
|
||||
wp_die('Invalide file path.');
|
||||
}
|
||||
|
||||
return trailingslashit($path);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Pfad der HTML-Datei
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @return string $diff Pfad zur HTML-Datei
|
||||
*/
|
||||
|
||||
private static function _file_html()
|
||||
{
|
||||
return self::_file_path(). 'index.html';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Pfad der GZIP-Datei
|
||||
*
|
||||
* @since 2.0
|
||||
* @change 2.0
|
||||
*
|
||||
* @return string $diff Pfad zur GZIP-Datei
|
||||
*/
|
||||
|
||||
private static function _file_gzip()
|
||||
{
|
||||
return self::_file_path(). 'index.html.gz';
|
||||
}
|
||||
}
|
@ -0,0 +1,306 @@
|
||||
<?php
|
||||
|
||||
|
||||
/* Quit */
|
||||
defined('ABSPATH') OR exit;
|
||||
|
||||
|
||||
/**
|
||||
* Cachify_MEMCACHED
|
||||
*/
|
||||
|
||||
final class Cachify_MEMCACHED {
|
||||
|
||||
|
||||
/**
|
||||
* Memcached-Object
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @var object
|
||||
*/
|
||||
|
||||
private static $_memcached;
|
||||
|
||||
|
||||
/**
|
||||
* Availability check
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.0.7
|
||||
*
|
||||
* @return boolean true/false TRUE when installed
|
||||
*/
|
||||
|
||||
public static function is_available()
|
||||
{
|
||||
return class_exists('Memcached') && isset($_SERVER['SERVER_SOFTWARE']) && strpos(strtolower($_SERVER['SERVER_SOFTWARE']), 'nginx') !== false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Caching method as string
|
||||
*
|
||||
* @since 2.1.2
|
||||
* @change 2.1.2
|
||||
*
|
||||
* @return string Caching method
|
||||
*/
|
||||
|
||||
public static function stringify_method() {
|
||||
return 'Memcached';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Speicherung im Cache
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.0.7
|
||||
*
|
||||
* @param string $hash Hash des Eintrags
|
||||
* @param string $data Inhalt des Eintrags
|
||||
* @param integer $lifetime Lebensdauer des Eintrags
|
||||
*/
|
||||
|
||||
public static function store_item($hash, $data, $lifetime)
|
||||
{
|
||||
/* Empty? */
|
||||
if ( empty($data) ) {
|
||||
wp_die('MEMCACHE add item: Empty input.');
|
||||
}
|
||||
|
||||
/* Server connect */
|
||||
if ( ! self::_connect_server() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Add item */
|
||||
self::$_memcached->set(
|
||||
self::_file_path(),
|
||||
$data . self::_cache_signatur(),
|
||||
$lifetime
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Lesen aus dem Cache
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.0.7
|
||||
*
|
||||
* @param string $hash Hash des Eintrags
|
||||
* @return mixed $diff Wert des Eintrags
|
||||
*/
|
||||
|
||||
public static function get_item($hash)
|
||||
{
|
||||
/* Server connect */
|
||||
if ( ! self::_connect_server() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Get item */
|
||||
return self::$_memcached->get(
|
||||
self::_file_path()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Entfernung aus dem Cache
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.0.7
|
||||
*
|
||||
* @param string $hash Hash des Eintrags
|
||||
* @param string $url URL des Eintrags [optional]
|
||||
*/
|
||||
|
||||
public static function delete_item($hash, $url = '')
|
||||
{
|
||||
/* Server connect */
|
||||
if ( ! self::_connect_server() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Delete */
|
||||
self::$_memcached->delete(
|
||||
self::_file_path($url)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Leerung des Cache
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.0.7
|
||||
*/
|
||||
|
||||
public static function clear_cache()
|
||||
{
|
||||
/* Server connect */
|
||||
if ( ! self::_connect_server() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Flush */
|
||||
@self::$_memcached->flush();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ausgabe des Cache
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.0.7
|
||||
*/
|
||||
|
||||
public static function print_cache()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ermittlung der Cache-Größe
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.0.7
|
||||
*
|
||||
* @return mixed $diff Cache-Größe
|
||||
*/
|
||||
|
||||
public static function get_stats()
|
||||
{
|
||||
/* Server connect */
|
||||
if ( ! self::_connect_server() ) {
|
||||
wp_die('MEMCACHE: Not enabled.');
|
||||
}
|
||||
|
||||
/* Infos */
|
||||
$data = self::$_memcached->getStats();
|
||||
|
||||
/* No stats? */
|
||||
if ( empty($data) ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Get first key */
|
||||
$data = $data[key($data)];
|
||||
|
||||
/* Leer */
|
||||
if ( empty($data['bytes']) ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return $data['bytes'];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generierung der Signatur
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.0.7
|
||||
*
|
||||
* @return string $diff Signatur als String
|
||||
*/
|
||||
|
||||
private static function _cache_signatur()
|
||||
{
|
||||
return sprintf(
|
||||
"\n\n<!-- %s\n%s @ %s -->",
|
||||
'Cachify | http://cachify.de',
|
||||
'Memcached',
|
||||
date_i18n(
|
||||
'd.m.Y H:i:s',
|
||||
current_time('timestamp')
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Pfad der Cache-Datei
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.0.7
|
||||
*
|
||||
* @param string $path Request-URI oder Permalink [optional]
|
||||
* @return string $diff Pfad zur Cache-Datei
|
||||
*/
|
||||
|
||||
private static function _file_path($path = NULL)
|
||||
{
|
||||
return trailingslashit(
|
||||
sprintf(
|
||||
'%s%s',
|
||||
$_SERVER['HTTP_HOST'],
|
||||
parse_url(
|
||||
( $path ? $path : $_SERVER['REQUEST_URI'] ),
|
||||
PHP_URL_PATH
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Connect to Memcached server
|
||||
*
|
||||
* @since 2.0.7
|
||||
* @change 2.1.8
|
||||
*
|
||||
* @hook array cachify_memcached_servers Array with memcached servers
|
||||
*
|
||||
* @return boolean true/false TRUE bei Erfolg
|
||||
*/
|
||||
|
||||
private static function _connect_server()
|
||||
{
|
||||
/* Not enabled? */
|
||||
if ( ! self::is_available() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Already connected */
|
||||
if ( is_object(self::$_memcached) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Init */
|
||||
self::$_memcached = new Memcached();
|
||||
|
||||
/* Set options */
|
||||
if ( defined('HHVM_VERSION') ) {
|
||||
self::$_memcached->setOption( Memcached::OPT_COMPRESSION, false );
|
||||
self::$_memcached->setOption( Memcached::OPT_BUFFER_WRITES, true );
|
||||
self::$_memcached->setOption( Memcached::OPT_BINARY_PROTOCOL, true );
|
||||
} else {
|
||||
self::$_memcached->setOptions(
|
||||
array(
|
||||
Memcached::OPT_COMPRESSION => false,
|
||||
Memcached::OPT_BUFFER_WRITES => true,
|
||||
Memcached::OPT_BINARY_PROTOCOL => true
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/* Connect */
|
||||
self::$_memcached->addServers(
|
||||
(array)apply_filters(
|
||||
'cachify_memcached_servers',
|
||||
array(
|
||||
array(
|
||||
'127.0.0.1',
|
||||
11211
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
44
msd2/wordpress/wp-content/plugins/cachify/trunk/js/post.js
Normal file
44
msd2/wordpress/wp-content/plugins/cachify/trunk/js/post.js
Normal file
@ -0,0 +1,44 @@
|
||||
jQuery(document).ready(
|
||||
function($) {
|
||||
|
||||
$('.edit-cachify-status', '#misc-publishing-actions').click(
|
||||
function(e) {
|
||||
$(this)
|
||||
.next(':hidden')
|
||||
.slideDown('fast')
|
||||
.end()
|
||||
.hide();
|
||||
|
||||
e.preventDefault();
|
||||
}
|
||||
);
|
||||
|
||||
$('.save-cachify-status', '#misc-publishing-actions').click(
|
||||
function(e) {
|
||||
$(this)
|
||||
.parent()
|
||||
.slideUp('fast')
|
||||
.prev(':hidden')
|
||||
.show();
|
||||
|
||||
$('#output-cachify-status').text(
|
||||
$('#cachify_status').children('option:selected').text()
|
||||
);
|
||||
|
||||
e.preventDefault();
|
||||
}
|
||||
);
|
||||
|
||||
$('.cancel-cachify-status', '#misc-publishing-actions').click(
|
||||
function(e) {
|
||||
$(this)
|
||||
.parent()
|
||||
.slideUp('fast')
|
||||
.prev(':hidden')
|
||||
.show();
|
||||
|
||||
e.preventDefault();
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
2
msd2/wordpress/wp-content/plugins/cachify/trunk/js/post.min.js
vendored
Normal file
2
msd2/wordpress/wp-content/plugins/cachify/trunk/js/post.min.js
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
jQuery(document).ready(function(a){a(".edit-cachify-status","#misc-publishing-actions").click(function(b){a(this).next(":hidden").slideDown("fast").end().hide();b.preventDefault()});a(".save-cachify-status","#misc-publishing-actions").click(function(b){a(this).parent().slideUp("fast").prev(":hidden").show();a("#output-cachify-status").text(a("#cachify_status").children("option:selected").text());b.preventDefault()});a(".cancel-cachify-status","#misc-publishing-actions").click(function(b){a(this).parent().slideUp("fast").prev(":hidden").show();
|
||||
b.preventDefault()})});
|
Reference in New Issue
Block a user