+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ObjectCache_Plugin.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ObjectCache_Plugin.php
new file mode 100644
index 00000000..e8a98dc2
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ObjectCache_Plugin.php
@@ -0,0 +1,334 @@
+_config = Dispatcher::config();
+ }
+
+ /**
+ * Runs plugin
+ */
+ public function run() {
+ // phpcs:ignore WordPress.WP.CronInterval.ChangeDetected
+ add_filter( 'cron_schedules', array( $this, 'cron_schedules' ) );
+
+ add_filter( 'w3tc_footer_comment', array( $this, 'w3tc_footer_comment' ) );
+
+ if ( 'file' === $this->_config->get_string( 'objectcache.engine' ) ) {
+ add_action( 'w3_objectcache_cleanup', array( $this, 'cleanup' ) );
+ }
+
+ add_action( 'save_post', array( $this, 'on_post_change' ), 0, 2 );
+ add_action( 'delete_post', array( $this, 'on_post_change' ), 0, 2 );
+
+ add_action( 'comment_post', array( $this, 'on_comment_change' ), 0 );
+ add_action( 'edit_comment', array( $this, 'on_comment_change' ), 0 );
+ add_action( 'delete_comment', array( $this, 'on_comment_change' ), 0 );
+ add_action( 'wp_set_comment_status', array( $this, 'on_comment_status' ), 0, 2 );
+ add_action( 'trackback_post', array( $this, 'on_comment_change' ), 0 );
+ add_action( 'pingback_post', array( $this, 'on_comment_change' ), 0 );
+
+ add_action( 'switch_theme', array( $this, 'on_change' ), 0 );
+
+ add_action( 'updated_option', array( $this, 'on_change_option' ), 0, 1 );
+ add_action( 'added_option', array( $this, 'on_change_option' ), 0, 1 );
+ add_action( 'delete_option', array( $this, 'on_change_option' ), 0, 1 );
+
+ add_action( 'edit_user_profile_update', array( $this, 'on_change_profile' ), 0 );
+
+ add_filter( 'w3tc_admin_bar_menu', array( $this, 'w3tc_admin_bar_menu' ) );
+
+ // usage statistics handling.
+ add_action( 'w3tc_usage_statistics_of_request', array( $this, 'w3tc_usage_statistics_of_request' ), 10, 1 );
+ add_filter( 'w3tc_usage_statistics_metrics', array( $this, 'w3tc_usage_statistics_metrics' ) );
+ add_filter( 'w3tc_usage_statistics_sources', array( $this, 'w3tc_usage_statistics_sources' ) );
+
+ if ( Util_Environment::is_wpmu() ) {
+ add_action( 'wp_uninitialize_site', array( $this, 'on_change' ), 0 );
+ add_action( 'wp_update_site', array( $this, 'on_change' ), 0 );
+ add_action( 'switch_blog', array( $this, 'switch_blog' ), 0, 2 );
+ }
+ }
+
+ /**
+ * Does disk cache cleanup
+ *
+ * @return void
+ */
+ public function cleanup() {
+ $w3_cache_file_cleaner = new Cache_File_Cleaner(
+ array(
+ 'cache_dir' => Util_Environment::cache_blog_dir( 'object' ),
+ 'clean_timelimit' => $this->_config->get_integer( 'timelimit.cache_gc' ),
+ )
+ );
+
+ $w3_cache_file_cleaner->clean();
+ }
+
+ /**
+ * Cron schedules filter
+ *
+ * @param array $schedules Schedules.
+ *
+ * @return array
+ */
+ public function cron_schedules( $schedules ) {
+ $gc = $this->_config->get_integer( 'objectcache.file.gc' );
+
+ return array_merge(
+ $schedules,
+ array(
+ 'w3_objectcache_cleanup' => array(
+ 'interval' => $gc,
+ 'display' => sprintf(
+ // translators: 1 interval in seconds.
+ __( '[W3TC] Object Cache file GC (every %d seconds)', 'w3-total-cache' ),
+ $gc
+ ),
+ ),
+ )
+ );
+ }
+
+ /**
+ * Change action
+ */
+ public function on_change() {
+ if ( ! self::$flushed ) {
+ $flush = Dispatcher::component( 'CacheFlush' );
+ $flush->objectcache_flush();
+ self::$flushed = true;
+ }
+ }
+
+ /**
+ * Change post action
+ *
+ * @param integer $post_id Post ID.
+ * @param mixed $post Post.
+ */
+ public function on_post_change( $post_id = 0, $post = null ) {
+ if ( ! self::$flushed ) {
+ if ( is_null( $post ) ) {
+ $post = $post_id;
+ }
+
+ if ( $post_id > 0 && ! Util_Environment::is_flushable_post( $post, 'objectcache', $this->_config ) ) {
+ return;
+ }
+
+ $flush = Dispatcher::component( 'CacheFlush' );
+ $flush->objectcache_flush();
+ self::$flushed = true;
+ }
+ }
+
+ /**
+ * Change action
+ *
+ * @param string $option Option key.
+ */
+ public function on_change_option( $option ) {
+ if ( 'cron' === $option ) {
+ wp_cache_delete( $option );
+ }
+
+ $do_flush = defined( 'WP_ADMIN' )
+ || $this->_config->get_boolean( 'cluster.messagebus.enabled' )
+ || $this->_config->get_boolean( 'objectcache.purge.all' );
+
+ if ( ! self::$flushed && $do_flush ) {
+ $flush = Dispatcher::component( 'CacheFlush' );
+ $flush->objectcache_flush();
+ self::$flushed = true;
+ }
+ }
+
+ /**
+ * Flush cache when user profile is updated
+ *
+ * @param integer $user_id User ID.
+ */
+ public function on_change_profile( $user_id ) {
+ if ( ! self::$flushed ) {
+ if ( Util_Environment::is_wpmu() ) {
+ $blogs = get_blogs_of_user( $user_id, true );
+ if ( $blogs ) {
+ global $w3_multisite_blogs;
+ $w3_multisite_blogs = $blogs;
+ }
+ }
+
+ $flush = Dispatcher::component( 'CacheFlush' );
+ $flush->objectcache_flush();
+
+ self::$flushed = true;
+ }
+ }
+
+ /**
+ * Switch blog action
+ *
+ * @param integer $blog_id Blog ID.
+ * @param integer $previous_blog_id Previous Blog ID.
+ */
+ public function switch_blog( $blog_id, $previous_blog_id ) {
+ $o = Dispatcher::component( 'ObjectCache_WpObjectCache_Regular' );
+ $o->switch_blog( $blog_id );
+ }
+
+
+ /**
+ * Comment change action
+ *
+ * @param integer $comment_id Comment ID.
+ */
+ public function on_comment_change( $comment_id ) {
+ $post_id = 0;
+
+ if ( $comment_id ) {
+ $comment = get_comment( $comment_id, ARRAY_A );
+ $post_id = ( ! empty( $comment['comment_post_ID'] ) ? (int) $comment['comment_post_ID'] : 0 );
+ }
+
+ $this->on_post_change( $post_id );
+ }
+
+ /**
+ * Comment status action fired immediately after transitioning a comment’s status from one to another
+ * in the database and removing the comment from the object cache, but prior to all status transition hooks.
+ *
+ * @link https://developer.wordpress.org/reference/functions/wp_set_comment_status/
+ *
+ * @param integer $comment_id Comment ID.
+ * @param string $status Status.
+ */
+ public function on_comment_status( $comment_id, $status ) {
+ $this->on_comment_change( $comment_id );
+ }
+
+ /**
+ * Setup admin menu elements
+ *
+ * @param array $menu_items Menu items.
+ */
+ public function w3tc_admin_bar_menu( $menu_items ) {
+ $menu_items['20410.objectcache'] = array(
+ 'id' => 'w3tc_flush_objectcache',
+ 'parent' => 'w3tc_flush',
+ 'title' => __( 'Object Cache', 'w3-total-cache' ),
+ 'href' => wp_nonce_url( admin_url( 'admin.php?page=w3tc_dashboard&w3tc_flush_objectcache' ), 'w3tc' ),
+ );
+
+ return $menu_items;
+ }
+
+ /**
+ * Setup admin menu elements
+ *
+ * @param array $strings Strings.
+ */
+ public function w3tc_footer_comment( $strings ) {
+ $o = Dispatcher::component( 'ObjectCache_WpObjectCache_Regular' );
+ $strings = $o->w3tc_footer_comment( $strings );
+
+ return $strings;
+ }
+
+ /**
+ * Usage statistics of request filter
+ *
+ * @param object $storage Storage object.
+ */
+ public function w3tc_usage_statistics_of_request( $storage ) {
+ $o = Dispatcher::component( 'ObjectCache_WpObjectCache_Regular' );
+ $o->w3tc_usage_statistics_of_request( $storage );
+ }
+
+ /**
+ * Retrive usage statistics metrics
+ *
+ * @param array $metrics Metrics.
+ */
+ public function w3tc_usage_statistics_metrics( $metrics ) {
+ $metrics = array_merge(
+ $metrics,
+ array(
+ 'objectcache_get_total',
+ 'objectcache_get_hits',
+ 'objectcache_sets',
+ 'objectcache_flushes',
+ 'objectcache_time_ms',
+ )
+ );
+
+ return $metrics;
+ }
+
+ /**
+ * Usage Statisitcs sources filter.
+ *
+ * @param array $sources Sources.
+ *
+ * @return array
+ */
+ public function w3tc_usage_statistics_sources( $sources ) {
+ $c = Dispatcher::config();
+ if ( 'apc' === $c->get_string( 'objectcache.engine' ) ) {
+ $sources['apc_servers']['objectcache'] = array(
+ 'name' => __( 'Object Cache', 'w3-total-cache' ),
+ );
+ } elseif ( 'memcached' === $c->get_string( 'objectcache.engine' ) ) {
+ $sources['memcached_servers']['objectcache'] = array(
+ 'servers' => $c->get_array( 'objectcache.memcached.servers' ),
+ 'username' => $c->get_string( 'objectcache.memcached.username' ),
+ 'password' => $c->get_string( 'objectcache.memcached.password' ),
+ 'binary_protocol' => $c->get_boolean( 'objectcache.memcached.binary_protocol' ),
+ 'name' => __( 'Object Cache', 'w3-total-cache' ),
+ );
+ } elseif ( 'redis' === $c->get_string( 'objectcache.engine' ) ) {
+ $sources['redis_servers']['objectcache'] = array(
+ 'servers' => $c->get_array( 'objectcache.redis.servers' ),
+ 'verify_tls_certificates' => $c->get_boolean( 'objectcache.redis.verify_tls_certificates' ),
+ 'username' => $c->get_boolean( 'objectcache.redis.username' ),
+ 'dbid' => $c->get_integer( 'objectcache.redis.dbid' ),
+ 'password' => $c->get_string( 'objectcache.redis.password' ),
+ 'name' => __( 'Object Cache', 'w3-total-cache' ),
+ );
+ }
+
+ return $sources;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ObjectCache_Plugin_Admin.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ObjectCache_Plugin_Admin.php
new file mode 100644
index 00000000..0e7c0116
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ObjectCache_Plugin_Admin.php
@@ -0,0 +1,98 @@
+getf_boolean( 'objectcache.enabled' ) ) {
+ add_filter( 'w3tc_errors', array( $this, 'w3tc_errors' ) );
+ add_filter( 'w3tc_notes', array( $this, 'w3tc_notes' ) );
+ add_filter( 'w3tc_usage_statistics_summary_from_history', array(
+ $this, 'w3tc_usage_statistics_summary_from_history' ), 10, 2 );
+ }
+ }
+
+
+
+ public function w3tc_errors( $errors ) {
+ $c = Dispatcher::config();
+
+ if ( $c->get_string( 'objectcache.engine' ) == 'memcached' ) {
+ $memcached_servers = $c->get_array(
+ 'objectcache.memcached.servers' );
+ $memcached_binary_protocol = $c->get_boolean(
+ 'objectcache.memcached.binary_protocol' );
+ $memcached_username = $c->get_string(
+ 'objectcache.memcached.username' );
+ $memcached_password = $c->get_string(
+ 'objectcache.memcached.password' );
+
+ if ( !Util_Installed::is_memcache_available( $memcached_servers, $memcached_binary_protocol, $memcached_username, $memcached_password ) ) {
+ if ( !isset( $errors['memcache_not_responding.details'] ) )
+ $errors['memcache_not_responding.details'] = array();
+
+ $errors['memcache_not_responding.details'][] = sprintf(
+ __( 'Object Cache: %s.', 'w3-total-cache' ),
+ implode( ', ', $memcached_servers ) );
+ }
+ }
+
+ return $errors;
+ }
+
+
+
+ public function w3tc_notes( $notes ) {
+ $c = Dispatcher::config();
+ $state = Dispatcher::config_state();
+ $state_note = Dispatcher::config_state_note();
+
+ /**
+ * Show notification when object cache needs to be emptied
+ */
+ if ( $state_note->get( 'objectcache.show_note.flush_needed' ) &&
+ !is_network_admin() /* flushed dont work under network admin */ &&
+ !$c->is_preview() ) {
+ $notes['objectcache_flush_needed'] = sprintf(
+ __( 'The setting change(s) made either invalidate the cached data or modify the behavior of the site. %s now to provide a consistent user experience.',
+ 'w3-total-cache' ),
+ Util_Ui::button_link(
+ __( 'Empty the object cache', 'w3-total-cache' ),
+ Util_Ui::url( array( 'w3tc_flush_objectcache' => 'y' ) ) ) );
+ }
+
+ return $notes;
+ }
+
+
+
+ public function w3tc_usage_statistics_summary_from_history( $summary, $history ) {
+ // counters
+ $get_total = Util_UsageStatistics::sum( $history, 'objectcache_get_total' );
+ $get_hits = Util_UsageStatistics::sum( $history, 'objectcache_get_hits' );
+ $sets = Util_UsageStatistics::sum( $history, 'objectcache_sets' );
+
+ $c = Dispatcher::config();
+ $e = $c->get_string( 'objectcache.engine' );
+
+ $summary['objectcache'] = array(
+ 'get_total' => Util_UsageStatistics::integer( $get_total ),
+ 'get_hits' => Util_UsageStatistics::integer( $get_hits ),
+ 'sets' => Util_UsageStatistics::integer( $sets ),
+ 'flushes' => Util_UsageStatistics::integer(
+ Util_UsageStatistics::sum( $history, 'objectcache_flushes' ) ),
+ 'time_ms' => Util_UsageStatistics::integer(
+ Util_UsageStatistics::sum( $history, 'objectcache_time_ms' ) ),
+ 'calls_per_second' => Util_UsageStatistics::value_per_period_seconds(
+ $get_total + $sets, $summary ),
+ 'hit_rate' => Util_UsageStatistics::percent(
+ $get_hits, $get_total ),
+ 'engine_name' => Cache::engine_name( $e )
+ );
+
+ return $summary;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ObjectCache_WpObjectCache.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ObjectCache_WpObjectCache.php
new file mode 100644
index 00000000..30e50da9
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ObjectCache_WpObjectCache.php
@@ -0,0 +1,262 @@
+_config = Dispatcher::config();
+ $this->_default_cache = Dispatcher::component(
+ 'ObjectCache_WpObjectCache_Regular' );
+ $this->_caches[] = $this->_default_cache;
+ }
+
+ /**
+ * Registers cache object so that its used for specific groups of
+ * object cache instead of default cache
+ */
+ public function register_cache( $cache, $use_for_object_groups ) {
+ $this->_caches[] = $cache;
+ foreach ( $use_for_object_groups as $group )
+ $this->_cache_by_group[$group] = $cache;
+ }
+
+ /**
+ * Get from the cache
+ *
+ * @param string $id
+ * @param string $group
+ * @return mixed
+ */
+ function get( $id, $group = 'default', $force = false, &$found = null ) {
+ $cache = $this->_get_engine( $group );
+ return $cache->get( $id, $group, $force, $found );
+ }
+
+ /**
+ * Retrieves multiple values from the cache in one call.
+ *
+ * @since 2.2.8
+ *
+ * @param array $ids Array of keys under which the cache contents are stored.
+ * @param string $group Optional. Where the cache contents are grouped. Default 'default'.
+ * @param bool $force Optional. Whether to force an update of the local cache
+ * from the persistent cache. Default false.
+ *
+ * @return array Array of return values, grouped by key. Each value is either
+ * the cache contents on success, or false on failure.
+ */
+ public function get_multiple( $ids, $group = 'default', $force = false ) {
+ $cache = $this->_get_engine( $group );
+ return $cache->get_multiple( $ids, $group, $force );
+ }
+
+ /**
+ * Set to the cache
+ *
+ * @param string $id
+ * @param mixed $data
+ * @param string $group
+ * @param integer $expire
+ * @return boolean
+ */
+ function set( $id, $data, $group = 'default', $expire = 0 ) {
+ $cache = $this->_get_engine( $group );
+ return $cache->set( $id, $data, $group, $expire );
+ }
+
+ /**
+ * Sets multiple values to the cache in one call.
+ *
+ * @since 2.2.8
+ *
+ * @param array $data Array of key and value to be set.
+ * @param string $group Optional. Where the cache contents are grouped. Default empty.
+ * @param int $expire Optional. When to expire the cache contents, in seconds.
+ * Default 0 (no expiration).
+ *
+ * @return bool[] Array of return values, grouped by key. Each value is always true.
+ */
+ public function set_multiple( $data, $group = 'default', $expire = 0 ) {
+ $cache = $this->_get_engine( $group );
+ return $cache->set_multiple( $data, $group, $expire );
+ }
+
+ /**
+ * Delete from the cache
+ *
+ * @param string $id
+ * @param string $group
+ * @param bool $force
+ * @return boolean
+ */
+ function delete( $id, $group = 'default', $force = false ) {
+ $cache = $this->_get_engine( $group );
+ return $cache->delete( $id, $group, $force );
+ }
+
+ /**
+ * Deletes multiple values from the cache in one call.
+ *
+ * @since 2.2.8
+ *
+ * @param array $keys Array of keys to be deleted.
+ * @param string $group Optional. Where the cache contents are grouped. Default empty.
+ *
+ * @return bool[] Array of return values, grouped by key. Each value is either
+ * true on success, or false if the contents were not deleted.
+ */
+ public function delete_multiple( $keys, $group = 'default' ) {
+ $cache = $this->_get_engine( $group );
+ return $cache->delete_multiple( $keys, $group );
+ }
+
+ /**
+ * Add to the cache
+ *
+ * @param string $id
+ * @param mixed $data
+ * @param string $group
+ * @param integer $expire
+ * @return boolean
+ */
+ function add( $id, $data, $group = 'default', $expire = 0 ) {
+ $cache = $this->_get_engine( $group );
+ return $cache->add( $id, $data, $group, $expire );
+ }
+
+ /**
+ * Adds multiple values to the cache in one call.
+ *
+ * @since 2.2.8
+ *
+ * @param array $data Array of keys and values to be added.
+ * @param string $group Optional. Where the cache contents are grouped. Default empty.
+ * @param int $expire Optional. When to expire the cache contents, in seconds.
+ * Default 0 (no expiration).
+ *
+ * @return bool[] Array of return values, grouped by key. Each value is either
+ * true on success, or false if cache key and group already exist.
+ */
+ public function add_multiple( array $data, $group = '', $expire = 0 ) {
+ $cache = $this->_get_engine( $group );
+ return $cache->add_multiple( $data, $group, $expire );
+ }
+
+ /**
+ * Replace in the cache
+ *
+ * @param string $id
+ * @param mixed $data
+ * @param string $group
+ * @param integer $expire
+ * @return boolean
+ */
+ function replace( $id, $data, $group = 'default', $expire = 0 ) {
+ $cache = $this->_get_engine( $group );
+ return $cache->replace( $id, $data, $group, $expire );
+ }
+
+ /**
+ * Reset keys
+ *
+ * @return boolean
+ */
+ function reset() {
+ $result = true;
+ foreach ( $this->_caches as $engine )
+ $result = $result && $engine->reset();
+ return $result;
+ }
+
+ /**
+ * Flush cache
+ *
+ * @return boolean
+ */
+ function flush() {
+ $result = true;
+ foreach ( $this->_caches as $engine )
+ $result = $result && $engine->flush();
+ return $result;
+ }
+
+ /**
+ * Add global groups
+ *
+ * @param array $groups
+ * @return void
+ */
+ function add_global_groups( $groups ) {
+ if ( !is_array( $groups ) )
+ $groups = array( $groups );
+
+ foreach ( $groups as $group ) {
+ $cache = $this->_get_engine( $group );
+ $cache->add_global_groups( array( $group ) );
+ }
+ }
+
+ /**
+ * Add non-persistent groups
+ *
+ * @param array $groups
+ * @return void
+ */
+ function add_nonpersistent_groups( $groups ) {
+ if ( !is_array( $groups ) )
+ $groups = array( $groups );
+
+ foreach ( $groups as $group ) {
+ $cache = $this->_get_engine( $group );
+ $cache->add_nonpersistent_groups( array( $group ) );
+ }
+ }
+
+ /**
+ * Return engine based on which group the OC value belongs to.
+ *
+ * @param string $group
+ * @return mixed
+ */
+ private function _get_engine( $group = '' ) {
+ if ( isset( $this->_cache_by_group[$group] ) )
+ return $this->_cache_by_group[$group];
+
+ return $this->_default_cache;
+ }
+
+ /**
+ * Decrement numeric cache item's value
+ *
+ * @param int|string $id The cache key to increment
+ * @param int $offset The amount by which to decrement the item's value. Default is 1.
+ * @param string $group The group the key is in.
+ * @return bool|int False on failure, the item's new value on success.
+ */
+ function decr( $id, $offset = 1, $group = 'default' ) {
+ $cache = $this->_get_engine( $group );
+ return $cache->decr( $id, $offset, $group );
+ }
+
+ /**
+ * Increment numeric cache item's value
+ *
+ * @param int|string $id The cache key to increment
+ * @param int $offset The amount by which to increment the item's value. Default is 1.
+ * @param string $group The group the key is in.
+ * @return false|int False on failure, the item's new value on success.
+ */
+ function incr( $id, $offset = 1, $group = 'default' ) {
+ $cache = $this->_get_engine( $group );
+ return $cache->incr( $id, $offset, $group );
+ }
+
+ function switch_to_blog( $blog_id ) {
+ foreach ( $this->_caches as $cache )
+ $cache->switch_blog( $blog_id );
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ObjectCache_WpObjectCache_Regular.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ObjectCache_WpObjectCache_Regular.php
new file mode 100644
index 00000000..7ba3900b
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ObjectCache_WpObjectCache_Regular.php
@@ -0,0 +1,1000 @@
+_config = Dispatcher::config();
+ $this->_lifetime = $this->_config->get_integer( 'objectcache.lifetime' );
+ $this->_debug = $this->_config->get_boolean( 'objectcache.debug' );
+ $this->_caching = $this->_can_cache();
+ $this->global_groups = $this->_config->get_array( 'objectcache.groups.global' );
+ $this->nonpersistent_groups = $this->_config->get_array(
+ 'objectcache.groups.nonpersistent' );
+ $this->stats_enabled = $this->_config->get_boolean( 'stats.enabled' );
+
+ $this->_blog_id = Util_Environment::blog_id();
+ }
+
+ /**
+ * Get from the cache
+ *
+ * @param string $id
+ * @param string $group
+ * @return mixed
+ */
+ function get( $id, $group = 'default', $force = false, &$found = null ) {
+ if ( $this->_debug || $this->stats_enabled ) {
+ $time_start = Util_Debug::microtime();
+ }
+
+ if ( empty( $group ) ) {
+ $group = 'default';
+ }
+
+ $key = $this->_get_cache_key( $id, $group );
+ $in_incall_cache = isset( $this->cache[$key] );
+ $fallback_used = false;
+
+ $cache_total_inc = 0;
+ $cache_hits_inc = 0;
+
+ if ( $in_incall_cache && !$force ) {
+ $found = true;
+ $value = $this->cache[$key];
+ } elseif ( $this->_caching &&
+ !in_array( $group, $this->nonpersistent_groups ) &&
+ $this->_check_can_cache_runtime( $group ) ) {
+ $cache = $this->_get_cache( null, $group );
+ $v = $cache->get( $key );
+
+ /* for debugging
+ $a = $cache->_get_with_old_raw( $key );
+ $path = $cache->get_full_path( $key);
+ $returned = 'x ' . $path . ' ' .
+ (is_readable( $path ) ? ' readable ' : ' not-readable ') .
+ json_encode($a);
+ */
+
+ $cache_total_inc = 1;
+
+ if ( is_array( $v ) && isset( $v['content'] ) ) {
+ $found = true;
+ $value = $v['content'];
+ $cache_hits_inc = 1;
+ } else {
+ $found = false;
+ $value = false;
+ }
+ } else {
+ $found = false;
+ $value = false;
+ }
+
+ if ( $value === null ) {
+ $value = false;
+ }
+
+ if ( is_object( $value ) ) {
+ $value = clone $value;
+ }
+
+ if ( !$found &&
+ $this->_is_transient_group( $group ) &&
+ $this->_config->get_boolean( 'objectcache.fallback_transients' ) ) {
+ $fallback_used = true;
+ $value = $this->_transient_fallback_get( $id, $group );
+ $found = ( $value !== false );
+ }
+
+ if ( $found ) {
+ if ( !$in_incall_cache ) {
+ $this->cache[$key] = $value;
+ }
+ }
+
+ /**
+ * Add debug info
+ */
+ if ( !$in_incall_cache ) {
+ $this->cache_total += $cache_total_inc;
+ $this->cache_hits += $cache_hits_inc;
+
+ if ( $this->_debug || $this->stats_enabled ) {
+ $time = Util_Debug::microtime() - $time_start;
+ $this->time_total += $time;
+
+ if ( $this->_debug ) {
+ if ( $fallback_used ) {
+ if ( !$found ) {
+ $returned = 'not in db';
+ } else {
+ $returned = 'from db fallback';
+ }
+ } else {
+ if ( !$found ) {
+ if ( $cache_total_inc <= 0 ) {
+ $returned = 'not tried cache';
+ } else {
+ $returned = 'not in cache';
+ }
+ } else {
+ $returned = 'from persistent cache';
+ }
+ }
+
+ $this->log_call( array(
+ date( 'r' ),
+ 'get',
+ $group,
+ $id,
+ $returned,
+ ( $value ? strlen( serialize( $value ) ) : 0 ),
+ (int)($time * 1000000)
+ ) );
+ }
+ }
+ }
+
+ return $value;
+ }
+
+ /**
+ * Get multiple from the cache
+ *
+ * @since 2.2.8
+ *
+ * @param string $ids IDs.
+ * @param string $group Group.
+ * @param bool $force Force flag.
+ *
+ * @return mixed
+ */
+ public function get_multiple( $ids, $group = 'default', $force = false ) {
+ $found_cache = array();
+ foreach ( $ids as $id ) {
+ $found_cache[ $id ] = $this->get( $id, $group, $force );
+ }
+ return $found_cache;
+ }
+
+ /**
+ * Set to the cache
+ *
+ * @param string $id
+ * @param mixed $data
+ * @param string $group
+ * @param integer $expire
+ * @return boolean
+ */
+ function set( $id, $data, $group = 'default', $expire = 0 ) {
+ if ( $this->_debug || $this->stats_enabled ) {
+ $time_start = Util_Debug::microtime();
+ }
+
+ if ( empty( $group ) ) {
+ $group = 'default';
+ }
+
+ $key = $this->_get_cache_key( $id, $group );
+
+ if ( is_object( $data ) ) {
+ $data = clone $data;
+ }
+
+ $this->cache[$key] = $data;
+ $return = true;
+ $ext_return = NULL;
+ $cache_sets_inc = 0;
+
+ if ( $this->_caching &&
+ !in_array( $group, $this->nonpersistent_groups ) &&
+ $this->_check_can_cache_runtime( $group ) ) {
+ $cache = $this->_get_cache( null, $group );
+
+ if ( $id == 'alloptions' && $group == 'options' ) {
+ // alloptions are deserialized on the start when some classes are not loaded yet
+ // so postpone it until requested
+ foreach ( $data as $k => $v ) {
+ if ( is_object( $v ) ) {
+ $data[$k] = serialize( $v );
+ }
+ }
+ }
+
+ $v = array( 'content' => $data );
+ $cache_sets_inc = 1;
+ $ext_return = $cache->set( $key, $v,
+ ( $expire ? $expire : $this->_lifetime ) );
+ $return = $ext_return;
+ }
+
+ if ( $this->_is_transient_group( $group ) &&
+ $this->_config->get_boolean( 'objectcache.fallback_transients' ) ) {
+ $this->_transient_fallback_set( $id, $data, $group, $expire );
+ }
+
+ if ( $this->_debug || $this->stats_enabled ) {
+ $time = Util_Debug::microtime() - $time_start;
+
+ $this->cache_sets += $cache_sets_inc;
+ $this->time_total += $time;
+
+ if ( $this->_debug ) {
+ if ( is_null( $ext_return ) ) {
+ $reason = 'not set ' . $this->cache_reject_reason;
+ } else if ( $ext_return ) {
+ $reason = 'put in cache';
+ } else {
+ $reason = 'failed';
+ }
+
+ $this->log_call( array(
+ date( 'r' ),
+ 'set',
+ $group,
+ $id,
+ $reason,
+ ( $data ? strlen( serialize( $data ) ) : 0 ),
+ (int)($time * 1000000)
+ ) );
+ }
+ }
+
+ return $return;
+ }
+
+ /**
+ * Sets multiple values to the cache in one call.
+ *
+ * @since 2.2.8
+ *
+ * @param array $data Array of keys and values to be set.
+ * @param string $group Optional. Where the cache contents are grouped. Default empty.
+ * @param int $expire Optional. When to expire the cache contents, in seconds.
+ * Default 0 (no expiration).
+ *
+ * @return bool[] Array of return values, grouped by key. Each value is either
+ * true on success, or false on failure.
+ */
+ public function set_multiple( array $data, $group = '', $expire = 0 ) {
+ $values = array();
+ foreach ( $data as $key => $value ) {
+ $values[ $key ] = $this->set( $key, $value, $group, $expire );
+ }
+ return $values;
+ }
+
+ /**
+ * Delete from the cache
+ *
+ * @param string $id
+ * @param string $group
+ * @param bool $force
+ * @return boolean
+ */
+ function delete( $id, $group = 'default', $force = false ) {
+ if ( !$force && $this->get( $id, $group ) === false ) {
+ return false;
+ }
+
+ $key = $this->_get_cache_key( $id, $group );
+ $return = true;
+ unset( $this->cache[$key] );
+
+ if ( $this->_caching && !in_array( $group, $this->nonpersistent_groups ) ) {
+ $cache = $this->_get_cache( null, $group );
+ $return = $cache->delete( $key );
+ }
+
+ if ( $this->_is_transient_group( $group ) &&
+ $this->_config->get_boolean( 'objectcache.fallback_transients' ) ) {
+ $this->_transient_fallback_delete( $id, $group );
+ }
+
+ if ( $this->_debug ) {
+ $this->log_call( array(
+ date( 'r' ),
+ 'delete',
+ $group,
+ $id,
+ ( $return ? 'deleted' : 'discarded' ),
+ 0,
+ 0
+ ) );
+ }
+
+ return $return;
+ }
+
+ /**
+ * Deletes multiple values from the cache in one call.
+ *
+ * @since 2.2.8
+ *
+ * @param array $keys Array of keys under which the cache to deleted.
+ * @param string $group Optional. Where the cache contents are grouped. Default empty.
+ *
+ * @return bool[] Array of return values, grouped by key. Each value is either
+ * true on success, or false if the contents were not deleted.
+ */
+ public function delete_multiple( array $keys, $group = '' ) {
+ $values = array();
+ foreach ( $keys as $key ) {
+ $values[ $key ] = $this->delete( $key, $group );
+ }
+ return $values;
+ }
+
+ /**
+ * Add to the cache
+ *
+ * @param string $id
+ * @param mixed $data
+ * @param string $group
+ * @param integer $expire
+ * @return boolean
+ */
+ function add( $id, $data, $group = 'default', $expire = 0 ) {
+ if ( $this->get( $id, $group ) !== false ) {
+ return false;
+ }
+
+ return $this->set( $id, $data, $group, $expire );
+ }
+
+ /**
+ * Add multiple to the cache
+ *
+ * @since 2.2.8
+ *
+ * @param array $data Array of keys and values to be added.
+ * @param string $group Optional. Where the cache contents are grouped. Default empty.
+ * @param int $expire Optional. When to expire the cache contents, in seconds.
+ * Default 0 (no expiration).
+ *
+ * @return bool[] Array of return values, grouped by key. Each value is either
+ * true on success, or false if cache key and group already exist.
+ */
+ public function add_multiple( array $data, $group = '', $expire = 0 ) {
+ $values = array();
+ foreach ( $data as $key => $value ) {
+ $values[ $key ] = $this->add( $key, $value, $group, $expire );
+ }
+ return $values;
+ }
+
+ /**
+ * Replace in the cache
+ *
+ * @param string $id
+ * @param mixed $data
+ * @param string $group
+ * @param integer $expire
+ * @return boolean
+ */
+ function replace( $id, $data, $group = 'default', $expire = 0 ) {
+ if ( $this->get( $id, $group ) === false ) {
+ return false;
+ }
+
+ return $this->set( $id, $data, $group, $expire );
+ }
+
+ /**
+ * Reset keys
+ *
+ * @return boolean
+ */
+ function reset() {
+ $this->cache = array();
+
+ return true;
+ }
+
+ /**
+ * Flush cache
+ *
+ * @return boolean
+ */
+ function flush( $reason = '' ) {
+ if ( $this->_debug || $this->stats_enabled ) {
+ $time_start = Util_Debug::microtime();
+ }
+ if ( $this->_config->get_boolean( 'objectcache.debug_purge' ) ) {
+ Util_Debug::log_purge( 'objectcache', 'flush', $reason );
+ }
+
+ $this->cache = array();
+
+ global $w3_multisite_blogs;
+ if ( isset( $w3_multisite_blogs ) ) {
+ foreach ( $w3_multisite_blogs as $blog ) {
+ $cache = $this->_get_cache( $blog->userblog_id );
+ $cache->flush();
+ }
+ } else {
+ $cache = $this->_get_cache( 0 );
+ $cache->flush();
+
+ $cache = $this->_get_cache();
+ $cache->flush();
+ }
+
+ if ( $this->_debug || $this->stats_enabled ) {
+ $time = Util_Debug::microtime() - $time_start;
+
+ $this->cache_flushes++;
+ $this->time_total += $time;
+
+ if ( $this->_debug ) {
+ $this->log_call( array(
+ date( 'r' ),
+ 'flush',
+ '',
+ '',
+ $reason,
+ 0,
+ (int)($time * 1000000)
+ ) );
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Add global groups
+ *
+ * @param array $groups
+ * @return void
+ */
+ function add_global_groups( $groups ) {
+ if ( !is_array( $groups ) ) {
+ $groups = (array) $groups;
+ }
+
+ $this->global_groups = array_merge( $this->global_groups, $groups );
+ $this->global_groups = array_unique( $this->global_groups );
+ }
+
+ /**
+ * Add non-persistent groups
+ *
+ * @param array $groups
+ * @return void
+ */
+ function add_nonpersistent_groups( $groups ) {
+ if ( !is_array( $groups ) ) {
+ $groups = (array) $groups;
+ }
+
+ $this->nonpersistent_groups = array_merge( $this->nonpersistent_groups, $groups );
+ $this->nonpersistent_groups = array_unique( $this->nonpersistent_groups );
+ }
+
+ /**
+ * Increment numeric cache item's value
+ *
+ * @param int|string $key The cache key to increment
+ * @param int $offset The amount by which to increment the item's value. Default is 1.
+ * @param string $group The group the key is in.
+ * @return bool|int False on failure, the item's new value on success.
+ */
+ function incr( $key, $offset = 1, $group = 'default' ) {
+ $value = $this->get( $key, $group );
+ if ( $value === false )
+ return false;
+
+ if ( !is_numeric( $value ) )
+ $value = 0;
+
+ $offset = (int) $offset;
+ $value += $offset;
+
+ if ( $value < 0 )
+ $value = 0;
+ $this->replace( $key, $value, $group );
+ return $value;
+ }
+
+ /**
+ * Decrement numeric cache item's value
+ *
+ * @param int|string $key The cache key to increment
+ * @param int $offset The amount by which to decrement the item's value. Default is 1.
+ * @param string $group The group the key is in.
+ * @return bool|int False on failure, the item's new value on success.
+ */
+ function decr( $key, $offset = 1, $group = 'default' ) {
+ $value = $this->get( $key, $group );
+ if ( $value === false )
+ return false;
+
+ if ( !is_numeric( $value ) )
+ $value = 0;
+
+ $offset = (int) $offset;
+ $value -= $offset;
+
+ if ( $value < 0 )
+ $value = 0;
+ $this->replace( $key, $value, $group );
+ return $value;
+ }
+
+ private function _transient_fallback_get( $transient, $group ) {
+ if ( $group == 'transient' ) {
+ $transient_option = '_transient_' . $transient;
+ if ( function_exists( 'wp_installing') && ! wp_installing() ) {
+ // If option is not in alloptions, it is not autoloaded and thus has a timeout
+ $alloptions = wp_load_alloptions();
+ if ( !isset( $alloptions[$transient_option] ) ) {
+ $transient_timeout = '_transient_timeout_' . $transient;
+ $timeout = get_option( $transient_timeout );
+ if ( false !== $timeout && $timeout < time() ) {
+ delete_option( $transient_option );
+ delete_option( $transient_timeout );
+ $value = false;
+ }
+ }
+ }
+
+ if ( ! isset( $value ) )
+ $value = get_option( $transient_option );
+ } elseif ( $group == 'site-transient' ) {
+ // Core transients that do not have a timeout. Listed here so querying timeouts can be avoided.
+ $no_timeout = array('update_core', 'update_plugins', 'update_themes');
+ $transient_option = '_site_transient_' . $transient;
+ if ( ! in_array( $transient, $no_timeout ) ) {
+ $transient_timeout = '_site_transient_timeout_' . $transient;
+ $timeout = get_site_option( $transient_timeout );
+ if ( false !== $timeout && $timeout < time() ) {
+ delete_site_option( $transient_option );
+ delete_site_option( $transient_timeout );
+ $value = false;
+ }
+ }
+
+ if ( ! isset( $value ) )
+ $value = get_site_option( $transient_option );
+ } else {
+ $value = false;
+ }
+
+ return $value;
+ }
+
+ private function _transient_fallback_delete( $transient, $group ) {
+ if ( $group == 'transient' ) {
+ $option_timeout = '_transient_timeout_' . $transient;
+ $option = '_transient_' . $transient;
+ $result = delete_option( $option );
+ if ( $result )
+ delete_option( $option_timeout );
+ } elseif ( $group == 'site-transient' ) {
+ $option_timeout = '_site_transient_timeout_' . $transient;
+ $option = '_site_transient_' . $transient;
+ $result = delete_site_option( $option );
+ if ( $result )
+ delete_site_option( $option_timeout );
+ }
+ }
+
+ private function _transient_fallback_set( $transient, $value, $group, $expiration ) {
+ if ( $group == 'transient' ) {
+ $transient_timeout = '_transient_timeout_' . $transient;
+ $transient_option = '_transient_' . $transient;
+ if ( false === get_option( $transient_option ) ) {
+ $autoload = 'yes';
+ if ( $expiration ) {
+ $autoload = 'no';
+ add_option( $transient_timeout, time() + $expiration, '', 'no' );
+ }
+ $result = add_option( $transient_option, $value, '', $autoload );
+ } else {
+ // If expiration is requested, but the transient has no timeout option,
+ // delete, then re-create transient rather than update.
+ $update = true;
+ if ( $expiration ) {
+ if ( false === get_option( $transient_timeout ) ) {
+ delete_option( $transient_option );
+ add_option( $transient_timeout, time() + $expiration, '', 'no' );
+ $result = add_option( $transient_option, $value, '', 'no' );
+ $update = false;
+ } else {
+ update_option( $transient_timeout, time() + $expiration );
+ }
+ }
+ if ( $update ) {
+ $result = update_option( $transient_option, $value );
+ }
+ }
+ } elseif ( $group == 'site-transient' ) {
+ $transient_timeout = '_site_transient_timeout_' . $transient;
+ $option = '_site_transient_' . $transient;
+ if ( false === get_site_option( $option ) ) {
+ if ( $expiration )
+ add_site_option( $transient_timeout, time() + $expiration );
+ $result = add_site_option( $option, $value );
+ } else {
+ if ( $expiration )
+ update_site_option( $transient_timeout, time() + $expiration );
+ $result = update_site_option( $option, $value );
+ }
+ }
+ }
+
+ /**
+ * Switches context to another blog
+ *
+ * @param integer $blog_id
+ */
+ function switch_blog( $blog_id ) {
+ $this->reset();
+ $this->_blog_id = $blog_id;
+ }
+
+ /**
+ * Returns cache key
+ *
+ * @param string $id
+ * @param string $group
+ * @return string
+ */
+ function _get_cache_key( $id, $group = 'default' ) {
+ if ( !$group ) {
+ $group = 'default';
+ }
+
+ $blog_id = $this->_blog_id;
+ if ( in_array( $group, $this->global_groups ) )
+ $blog_id = 0;
+
+ return $blog_id . $group . $id;
+ }
+
+ public function get_usage_statistics_cache_config() {
+ $engine = $this->_config->get_string( 'objectcache.engine' );
+
+ switch ( $engine ) {
+ case 'memcached':
+ $engineConfig = array(
+ 'servers' => $this->_config->get_array( 'objectcache.memcached.servers' ),
+ 'persistent' => $this->_config->get_boolean( 'objectcache.memcached.persistent' ),
+ 'aws_autodiscovery' => $this->_config->get_boolean( 'objectcache.memcached.aws_autodiscovery' ),
+ 'username' => $this->_config->get_string( 'objectcache.memcached.username' ),
+ 'password' => $this->_config->get_string( 'objectcache.memcached.password' ),
+ 'binary_protocol' => $this->_config->get_boolean( 'objectcache.memcached.binary_protocol' )
+ );
+ break;
+
+ case 'redis':
+ $engineConfig = array(
+ 'servers' => $this->_config->get_array( 'objectcache.redis.servers' ),
+ 'verify_tls_certificates' => $this->_config->get_boolean( 'objectcache.redis.verify_tls_certificates' ),
+ 'persistent' => $this->_config->get_boolean( 'objectcache.redis.persistent' ),
+ 'timeout' => $this->_config->get_integer( 'objectcache.redis.timeout' ),
+ 'retry_interval' => $this->_config->get_integer( 'objectcache.redis.retry_interval' ),
+ 'read_timeout' => $this->_config->get_integer( 'objectcache.redis.read_timeout' ),
+ 'dbid' => $this->_config->get_integer( 'objectcache.redis.dbid' ),
+ 'password' => $this->_config->get_string( 'objectcache.redis.password' )
+ );
+ break;
+
+ default:
+ $engineConfig = array();
+ }
+
+ $engineConfig['engine'] = $engine;
+ return $engineConfig;
+ }
+
+ /**
+ * Returns cache object
+ *
+ * @param int|null $blog_id
+ * @param string $group
+ * @return W3_Cache_Base
+ */
+ function _get_cache( $blog_id = null, $group = '' ) {
+ static $cache = array();
+
+ if ( is_null( $blog_id ) && !in_array( $group, $this->global_groups ) )
+ $blog_id = $this->_blog_id;
+ elseif ( is_null( $blog_id ) )
+ $blog_id = 0;
+
+ if ( !isset( $cache[$blog_id] ) ) {
+ $engine = $this->_config->get_string( 'objectcache.engine' );
+
+ switch ( $engine ) {
+ case 'memcached':
+ $engineConfig = array(
+ 'servers' => $this->_config->get_array( 'objectcache.memcached.servers' ),
+ 'persistent' => $this->_config->get_boolean(
+ 'objectcache.memcached.persistent' ),
+ 'aws_autodiscovery' => $this->_config->get_boolean( 'objectcache.memcached.aws_autodiscovery' ),
+ 'username' => $this->_config->get_string( 'objectcache.memcached.username' ),
+ 'password' => $this->_config->get_string( 'objectcache.memcached.password' ),
+ 'binary_protocol' => $this->_config->get_boolean( 'objectcache.memcached.binary_protocol' )
+ );
+ break;
+
+ case 'redis':
+ $engineConfig = array(
+ 'servers' => $this->_config->get_array( 'objectcache.redis.servers' ),
+ 'verify_tls_certificates' => $this->_config->get_boolean( 'objectcache.redis.verify_tls_certificates' ),
+ 'persistent' => $this->_config->get_boolean( 'objectcache.redis.persistent' ),
+ 'timeout' => $this->_config->get_integer( 'objectcache.redis.timeout' ),
+ 'retry_interval' => $this->_config->get_integer( 'objectcache.redis.retry_interval' ),
+ 'read_timeout' => $this->_config->get_integer( 'objectcache.redis.read_timeout' ),
+ 'dbid' => $this->_config->get_integer( 'objectcache.redis.dbid' ),
+ 'password' => $this->_config->get_string( 'objectcache.redis.password' )
+ );
+ break;
+
+ case 'file':
+ $engineConfig = array(
+ 'section' => 'object',
+ 'locking' => $this->_config->get_boolean( 'objectcache.file.locking' ),
+ 'flush_timelimit' => $this->_config->get_integer( 'timelimit.cache_flush' )
+ );
+ break;
+
+ default:
+ $engineConfig = array();
+ }
+ $engineConfig['blog_id'] = $blog_id;
+ $engineConfig['module'] = 'object';
+ $engineConfig['host'] = Util_Environment::host();
+ $engineConfig['instance_id'] = Util_Environment::instance_id();
+
+ $cache[$blog_id] = Cache::instance( $engine, $engineConfig );
+ }
+
+ return $cache[$blog_id];
+ }
+
+ /**
+ * Check if caching allowed on init
+ *
+ * @return boolean
+ */
+ function _can_cache() {
+ /**
+ * Skip if disabled
+ */
+ if ( !$this->_config->getf_boolean( 'objectcache.enabled' ) ) {
+ $this->cache_reject_reason = 'objectcache.disabled';
+
+ return false;
+ }
+
+ /**
+ * Check for DONOTCACHEOBJECT constant
+ */
+ if ( defined( 'DONOTCACHEOBJECT' ) && DONOTCACHEOBJECT ) {
+ $this->cache_reject_reason = 'DONOTCACHEOBJECT';
+
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns if we can cache, that condition can change in runtime
+ *
+ * @param unknown $group
+ * @return boolean
+ */
+ function _check_can_cache_runtime( $group ) {
+ //Need to be handled in wp admin as well as frontend
+ if ( $this->_is_transient_group( $group ) )
+ return true;
+
+ if ( $this->_can_cache_dynamic != null )
+ return $this->_can_cache_dynamic;
+
+ if ( $this->_config->get_boolean( 'objectcache.enabled_for_wp_admin' ) ) {
+ $this->_can_cache_dynamic = true;
+ } else {
+ if ( $this->_caching ) {
+ if ( defined( 'WP_ADMIN' ) &&
+ ( !defined( 'DOING_AJAX' ) || !DOING_AJAX ) ) {
+ $this->_can_cache_dynamic = false;
+ $this->cache_reject_reason = 'WP_ADMIN defined';
+ return $this->_can_cache_dynamic;
+ }
+ }
+ }
+
+ return $this->_caching;
+ }
+
+ private function _is_transient_group( $group ) {
+ return in_array( $group, array( 'transient', 'site-transient' ) ) ;
+ }
+
+ public function w3tc_footer_comment( $strings ) {
+ $reason = $this->get_reject_reason();
+ $append = empty( $reason ) ? '' : sprintf( ' (%1$s)', $reason );
+
+ $strings[] = sprintf(
+ // translators: 1: Cache hits, 2: Cache total cache objects, 3: Engine anme, 4: Reason.
+ __( 'Object Caching %1$d/%2$d objects using %3$s%4$s', 'w3-total-cache' ),
+ $this->cache_hits,
+ $this->cache_total,
+ Cache::engine_name( $this->_config->get_string( 'objectcache.engine' ) ),
+ $append
+ );
+
+ if ( $this->_config->get_boolean( 'objectcache.debug' ) ) {
+ $strings[] = '';
+ $strings[] = 'Object Cache debug info:';
+ $strings[] = sprintf( "%s%s", str_pad( 'Caching: ', 20 ),
+ ( $this->_caching ? 'enabled' : 'disabled' ) );
+
+ $strings[] = sprintf( "%s%d", str_pad( 'Total calls: ', 20 ), $this->cache_total );
+ $strings[] = sprintf( "%s%d", str_pad( 'Cache hits: ', 20 ), $this->cache_hits );
+ $strings[] = sprintf( "%s%.4f", str_pad( 'Total time: ', 20 ), $this->time_total );
+
+ if ( $this->log_filehandle ) {
+ fclose( $this->log_filehandle );
+ $this->log_filehandle = false;
+ }
+ }
+
+ return $strings;
+ }
+
+ public function w3tc_usage_statistics_of_request( $storage ) {
+ $storage->counter_add( 'objectcache_get_total', $this->cache_total );
+ $storage->counter_add( 'objectcache_get_hits', $this->cache_hits );
+ $storage->counter_add( 'objectcache_sets', $this->cache_sets );
+ $storage->counter_add( 'objectcache_flushes', $this->cache_flushes );
+ $storage->counter_add( 'objectcache_time_ms', (int)($this->time_total * 1000) );
+ }
+
+ public function get_reject_reason() {
+ if ( is_null( $this->cache_reject_reason ) )
+ return '';
+ return $this->_get_reject_reason_message( $this->cache_reject_reason );
+ }
+
+ /**
+ *
+ *
+ * @param unknown $key
+ * @return string|void
+ */
+ private function _get_reject_reason_message( $key ) {
+ if ( !function_exists( '__' ) )
+ return $key;
+
+ switch ( $key ) {
+ case 'objectcache.disabled':
+ return __( 'Object caching is disabled', 'w3-total-cache' );
+ case 'DONOTCACHEOBJECT':
+ return __( 'DONOTCACHEOBJECT constant is defined', 'w3-total-cache' );
+ default:
+ return '';
+ }
+ }
+
+
+
+ private function log_call( $line ) {
+ if ( !$this->log_filehandle ) {
+ $filename = Util_Debug::log_filename( 'objectcache-calls' );
+ $this->log_filehandle = fopen( $filename, 'a' );
+ }
+
+ fputcsv ( $this->log_filehandle, $line, "\t" );
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/PageSpeed_Api.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/PageSpeed_Api.php
new file mode 100644
index 00000000..7bcd8792
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/PageSpeed_Api.php
@@ -0,0 +1,607 @@
+config = Dispatcher::config();
+ $this->client = new \W3TCG_Google_Client();
+ $this->client->setApplicationName( 'W3TC PageSpeed Analyzer' );
+ $this->client->setAuthConfig( $this->get_client_json() );
+ $this->client->setRedirectUri( $this->get_w3tc_api_url( 'google/authorize-out/' ) );
+ $this->client->addScope( 'openid' );
+ $this->client->setAccessType( 'offline' );
+ $this->client->setApprovalPrompt( 'force' );
+ $this->client->setDefer( true );
+
+ if ( ! empty( $access_token_json ) ) {
+ $this->client->setAccessToken( $access_token_json );
+ $this->maybe_refresh_token();
+ }
+ }
+ /**
+ * Run PageSpeed API.
+ *
+ * @since 2.3.0
+ *
+ * @return void
+ */
+ public function run() {
+ add_action( 'admin_notices', array( $this, 'authorize_notice' ) );
+ }
+ /**
+ * Fully analyze URL via PageSpeed API.
+ *
+ * @since 2.3.0
+ *
+ * @param string $url URL to analyze via PageSpeed API.
+ *
+ * @return array
+ */
+ public function analyze( $url ) {
+ $mobile = $this->analyze_strategy( $url, 'mobile' );
+ $desktop = $this->analyze_strategy( $url, 'desktop' );
+ return array(
+ 'mobile' => $mobile,
+ 'desktop' => $desktop,
+ 'test_url' => Util_Environment::url_format(
+ $this->get_pagespeed_url(),
+ array( 'url' => $url )
+ ),
+ );
+ }
+
+ /**
+ * Analyze URL via PageSpeed API using strategy.
+ *
+ * @since 2.3.0
+ *
+ * @param string $url URL to analyze.
+ * @param string $strategy Strategy to use desktop/mobile.
+ *
+ * @return array
+ */
+ public function analyze_strategy( $url, $strategy ) {
+ $data = $this->process_request(
+ array(
+ 'url' => $url,
+ 'category' => 'performance',
+ 'strategy' => $strategy,
+ )
+ );
+
+ if ( ! empty( Util_PageSpeed::get_value_recursive( $data, array( 'error', 'code' ) ) ) ) {
+ return array(
+ 'error' => array(
+ 'code' => Util_PageSpeed::get_value_recursive( $data, array( 'error', 'code' ) ),
+ 'message' => Util_PageSpeed::get_value_recursive( $data, array( 'error', 'message' ) ),
+ ),
+ );
+ }
+
+ return array_merge_recursive(
+ PageSpeed_Data::prepare_pagespeed_data( $data ),
+ PageSpeed_Instructions::get_pagespeed_instructions()
+ );
+ }
+
+ /**
+ * Make API request.
+ *
+ * @since 2.3.0
+ *
+ * @param string $query API request query.
+ *
+ * @return array
+ */
+ public function process_request( $query ) {
+ $access_token_json = $this->client->getAccessToken();
+
+ if ( empty( $access_token_json ) ) {
+ return array(
+ 'error' => array(
+ 'code' => 403,
+ 'message' => __( 'Missing Google access token.', 'w3-total-cache' ),
+ ),
+ );
+ }
+
+ $access_token = json_decode( $access_token_json );
+
+ $request = Util_Environment::url_format(
+ $this->get_pagespeed_url(),
+ array_merge(
+ $query,
+ array(
+ 'quotaUser' => Util_Http::generate_site_id(),
+ 'access_token' => $access_token->access_token,
+ )
+ )
+ );
+
+ // Attempt the request up to x times with an increasing delay between each attempt. Uses W3TC_PAGESPEED_MAX_ATTEMPTS constant if defined.
+ $attempts = 0;
+
+ while ( ++$attempts <= $this->get_max_attempts() ) {
+ try {
+ $response = wp_remote_get(
+ $request,
+ array(
+ 'timeout' => 60,
+ )
+ );
+
+ if ( ! is_wp_error( $response ) && 200 === $response['response']['code'] ) {
+ break;
+ }
+ } catch ( \Exception $e ) {
+ if ( $attempts >= $this->get_max_attempts() ) {
+ return array(
+ 'error' => array(
+ 'code' => 500,
+ 'message' => $e->getMessage(),
+ ),
+ );
+ }
+ }
+
+ // Sleep for a cumulative .5 seconds each attempt.
+ usleep( $attempts * 500000 );
+ };
+
+ if ( isset( $response['response']['code'] ) && 200 !== $response['response']['code'] ) {
+ // Google PageSpeed Insights sometimes will return a 500 and message body with details so we still grab the body response.
+ $decoded_body = json_decode( wp_remote_retrieve_body( $response ), true );
+ return array(
+ 'error' => array(
+ 'code' => $response['response']['code'],
+ 'message' => ( ! empty( $decoded_body['error']['message'] ) ? $decoded_body['error']['message'] : $response['response']['message'] ),
+ ),
+ );
+ }
+
+ return json_decode( wp_remote_retrieve_body( $response ), true );
+ }
+
+ /**
+ * Checks if the Google access token is expired and attempts to refresh.
+ *
+ * @since 2.3.0
+ *
+ * @return void
+ */
+ public function maybe_refresh_token() {
+ if ( $this->client->isAccessTokenExpired() && ! empty( $this->config->get_string( 'widget.pagespeed.w3tc_pagespeed_key' ) ) ) {
+ $this->refresh_token();
+ }
+ }
+
+ /**
+ * Refreshes the Google access token if a valid refresh token is defined.
+ *
+ * @return string
+ */
+ public function refresh_token() {
+ $initial_refresh_token = $this->client->getRefreshToken();
+ if ( empty( $initial_refresh_token ) ) {
+ $initial_refresh_token_json = $this->get_refresh_token( Util_Http::generate_site_id(), $this->config->get_string( 'widget.pagespeed.w3tc_pagespeed_key' ) );
+ $initial_refresh_token = json_decode( $initial_refresh_token_json );
+ if ( ! empty( $initial_refresh_token->error ) ) {
+ $refresh_url = $this->get_w3tc_api_url( 'google/get-token' ) . '/' . Util_Http::generate_site_id() . '/' . $this->config->get_string( 'widget.pagespeed.w3tc_pagespeed_key' );
+ $error_code = ! empty( $initial_refresh_token->error->code ) ? $initial_refresh_token->error->code : 'N/A';
+ $error_message = ! empty( $initial_refresh_token->error->message ) ? $initial_refresh_token->error->message : 'N/A';
+ return wp_json_encode(
+ array(
+ 'error' => '' . esc_html__( 'API request error!', 'w3-total-cache' ) . '
+ ' . esc_html__( 'Refresh URL : ', 'w3-total-cache' ) . $refresh_url . '
+ ' . esc_html__( 'Response Code : ', 'w3-total-cache' ) . $error_code . '
+ ' . esc_html__( 'Response Message : ', 'w3-total-cache' ) . $error_message . '
',
+ )
+ );
+ }
+ }
+
+ try {
+ $this->client->refreshToken( $initial_refresh_token->refresh_token );
+ } catch ( \Exception $e ) {
+ return wp_json_encode(
+ array(
+ 'error' => array(
+ 'code' => 500,
+ 'message' => $e->getMessage(),
+ ),
+ )
+ );
+ }
+
+ $new_access_token = json_decode( $this->client->getAccessToken() );
+
+ if ( ! empty( $new_access_token->refresh_token ) ) {
+ $new_refresh_token = $new_access_token->refresh_token;
+ unset( $new_access_token->refresh_token );
+
+ $request = Util_Environment::url_format(
+ $this->get_w3tc_api_url( 'google/update-token' ),
+ array(
+ 'site_id' => Util_Http::generate_site_id(),
+ 'w3tc_pagespeed_key' => $this->config->get_string( 'widget.pagespeed.w3tc_pagespeed_key' ),
+ 'refresh_token' => $new_refresh_token,
+ )
+ );
+
+ $response = wp_remote_get(
+ $request,
+ array(
+ 'timeout' => 60,
+ )
+ );
+
+ if ( is_wp_error( $response ) ) {
+ return wp_json_encode(
+ array(
+ 'error' => array(
+ 'code' => $response->get_error_code(),
+ 'message' => $response->get_error_message(),
+ ),
+ )
+ );
+ } elseif ( isset( $response['error']['code'] ) && 200 !== $response['error']['code'] ) {
+ if ( 'update-token-missing-site-id' === $response['error']['id'] ) {
+ $message = __( 'No site ID provided for Google access record update!', 'w3-total-cache' );
+ } elseif ( 'update-token-missing-w3tc-pagespeed-key' === $response['error']['id'] ) {
+ $message = __( 'No W3 key provided for Google access record update!', 'w3-total-cache' );
+ } elseif ( 'update-token-missing-refresh-token' === $response['error']['id'] ) {
+ $message = __( 'No refresh token provided for Google access record update!', 'w3-total-cache' );
+ } elseif ( 'update-token-not-found' === $response['error']['id'] ) {
+ $message = __( 'No matching Google access record found for W3 key!', 'w3-total-cache' );
+ }
+
+ return wp_json_encode(
+ array(
+ 'error' => array(
+ 'code' => $response['error']['code'],
+ 'message' => $message,
+ ),
+ )
+ );
+ }
+ }
+
+ $this->config->set( 'widget.pagespeed.access_token', wp_json_encode( $new_access_token ) );
+ $this->config->save();
+
+ return wp_json_encode( array( 'access_key' => $new_access_token ) );
+ }
+
+ /**
+ * Creates new Google access token from authorize request response.
+ *
+ * @since 2.3.0
+ *
+ * @param string $gacode New Google access authentication code.
+ * @param string $w3tc_pagespeed_key W3 API access key.
+ *
+ * @return string
+ */
+ public function process_authorization_response( $gacode, $w3tc_pagespeed_key ) {
+ if ( empty( $gacode ) ) {
+ return wp_json_encode(
+ array(
+ 'error' => array(
+ 'code' => 409,
+ 'message' => __( 'Missing/invalid Google access authentication code.', 'w3-total-cache' ),
+ ),
+ )
+ );
+ } elseif ( empty( $w3tc_pagespeed_key ) ) {
+ return wp_json_encode(
+ array(
+ 'error' => array(
+ 'code' => 409,
+ 'message' => __( 'Missing/invalid W3 API key.', 'w3-total-cache' ),
+ ),
+ )
+ );
+ }
+
+ try {
+ $this->client->authenticate( $gacode );
+ } catch ( \Exception $e ) {
+ return wp_json_encode(
+ array(
+ 'error' => array(
+ 'code' => 500,
+ 'message' => $e->getMessage(),
+ ),
+ )
+ );
+ }
+
+ $access_token_json = $this->client->getAccessToken();
+
+ if ( empty( $access_token_json ) ) {
+ return wp_json_encode(
+ array(
+ 'error' => array(
+ 'code' => 409,
+ 'message' => __( 'Missing/invalid Google access token JSON setting after authentication.', 'w3-total-cache' ),
+ ),
+ )
+ );
+ }
+
+ $access_token = ( ! empty( $access_token_json ) ? json_decode( $access_token_json ) : '' );
+
+ $request = Util_Environment::url_format(
+ $this->get_w3tc_api_url( 'google/update-token' ),
+ array(
+ 'site_id' => Util_Http::generate_site_id(),
+ 'w3tc_pagespeed_key' => $w3tc_pagespeed_key,
+ 'refresh_token' => $access_token->refresh_token,
+ )
+ );
+
+ $response = wp_remote_get(
+ $request,
+ array(
+ 'timeout' => 60,
+ )
+ );
+
+ if ( is_wp_error( $response ) ) {
+ return wp_json_encode(
+ array(
+ 'error' => array(
+ 'code' => $response->get_error_code(),
+ 'message' => $response->get_error_message(),
+ ),
+ )
+ );
+ } elseif ( isset( $response['error']['code'] ) && 200 !== $response['error']['code'] ) {
+ if ( 'update-token-missing-site-id' === $response['error']['id'] ) {
+ $message = __( 'No site ID provided for Google access record update!', 'w3-total-cache' );
+ } elseif ( 'update-token-missing-w3tc-pagespeed-key' === $response['error']['id'] ) {
+ $message = __( 'No W3 key provided for Google access record update!', 'w3-total-cache' );
+ } elseif ( 'update-token-missing-refresh-token' === $response['error']['id'] ) {
+ $message = __( 'No refresh token provided for Google access record update!', 'w3-total-cache' );
+ } elseif ( 'update-token-not-found' === $response['error']['id'] ) {
+ $message = __( 'No matching Google access record found for W3 key!', 'w3-total-cache' );
+ }
+ return wp_json_encode(
+ array(
+ 'error' => array(
+ 'code' => $response['error']['code'],
+ 'message' => $message,
+ ),
+ )
+ );
+ }
+
+ unset( $access_token->refresh_token );
+
+ $this->config->set( 'widget.pagespeed.access_token', wp_json_encode( $access_token ) );
+ $this->config->set( 'widget.pagespeed.w3tc_pagespeed_key', $w3tc_pagespeed_key );
+ $this->config->save();
+
+ return wp_json_encode( array( 'refresh_token' => $access_token ) );
+ }
+
+ /**
+ * Fetches Google refresh token from W3 API server.
+ *
+ * @since 2.3.0
+ *
+ * @param string $site_id Site ID.
+ * @param string $w3tc_pagespeed_key W3 API access key.
+ *
+ * @return string
+ */
+ public function get_refresh_token( $site_id, $w3tc_pagespeed_key ) {
+ if ( empty( $site_id ) ) {
+ return wp_json_encode(
+ array(
+ 'error' => array(
+ 'code' => 409,
+ 'message' => __( 'Missing/invalid Site ID.', 'w3-total-cache' ),
+ ),
+ )
+ );
+ } elseif ( empty( $w3tc_pagespeed_key ) ) {
+ return wp_json_encode(
+ array(
+ 'error' => array(
+ 'code' => 409,
+ 'message' => __( 'Missing/invalid W3 API key.', 'w3-total-cache' ),
+ ),
+ )
+ );
+ }
+
+ $request = $this->get_w3tc_api_url( 'google/get-token' ) . '/' . $site_id . '/' . $w3tc_pagespeed_key;
+
+ $response = wp_remote_get(
+ $request,
+ array(
+ 'timeout' => 60,
+ )
+ );
+
+ if ( is_wp_error( $response ) ) {
+ return wp_json_encode(
+ array(
+ 'error' => array(
+ 'code' => $response->get_error_code(),
+ 'message' => $response->get_error_message(),
+ ),
+ )
+ );
+ } elseif ( isset( $response['error']['code'] ) && 200 !== $response['error']['code'] ) {
+ if ( 'get-token-missing-site-id' === $response['error']['id'] ) {
+ $message = __( 'No site ID provided for Google access record update!', 'w3-total-cache' );
+ } elseif ( 'get-token-missing-w3tc-pagespeed-key' === $response['error']['id'] ) {
+ $message = __( 'No W3 key provided for Google access record update!', 'w3-total-cache' );
+ } elseif ( 'get-token-not-found' === $response['error']['id'] ) {
+ $message = __( 'No matching Google access record found for W3 key!', 'w3-total-cache' );
+ } elseif ( 'get-token-bad-record' === $response['error']['id'] ) {
+ $message = __( 'Matching Google access record found but the refresh token value is blank!', 'w3-total-cache' );
+ }
+
+ return wp_json_encode(
+ array(
+ 'error' => array(
+ 'code' => $response['error']['code'],
+ 'message' => $message,
+ ),
+ )
+ );
+ }
+
+ // Response body should contain a JSON format string.
+ return wp_remote_retrieve_body( $response );
+ }
+
+ /**
+ * Get Google Client JSON config.
+ *
+ * @since 2.3.0
+ *
+ * @return string
+ */
+ public function get_client_json() {
+ $client_json = defined( 'W3TC_GOOGLE_CLIENT_JSON' ) && W3TC_GOOGLE_CLIENT_JSON ? W3TC_GOOGLE_CLIENT_JSON : $this->google_client_json;
+ $client = json_decode( $client_json );
+ foreach ( $client->web->redirect_uris as $redirect_uri_key => $redirect_uri_value ) {
+ $client->web->redirect_uris[ $redirect_uri_key ] = $this->get_w3tc_api_url( $redirect_uri_value );
+ }
+ return wp_json_encode( $client );
+ }
+
+ /**
+ * Get W3TC PageSpeed API max attempts.
+ *
+ * @since 2.3.0
+ *
+ * @return int
+ */
+ public function get_max_attempts() {
+ return defined( 'W3TC_PAGESPEED_MAX_ATTEMPTS' ) && W3TC_PAGESPEED_MAX_ATTEMPTS ? W3TC_PAGESPEED_MAX_ATTEMPTS : $this->retry_attempts;
+ }
+
+ /**
+ * Get Google PageSpeed API URL.
+ *
+ * @since 2.3.0
+ *
+ * @return string
+ */
+ public function get_pagespeed_url() {
+ return defined( 'W3TC_PAGESPEED_API_URL' ) && W3TC_PAGESPEED_API_URL ? W3TC_PAGESPEED_API_URL : $this->pagespeed_api_base_url;
+ }
+
+ /**
+ * Get W3TC API server URL target.
+ *
+ * @since 2.3.0
+ *
+ * @param string $target API target URI.
+ *
+ * @return string
+ */
+ public function get_w3tc_api_url( $target ) {
+ return defined( 'W3TC_API2_URL' ) && W3TC_API2_URL ?
+ trailingslashit( W3TC_API2_URL ) . $target :
+ trailingslashit( $this->w3tc_api_base_url ) . $target;
+ }
+
+ /**
+ * PageSpeed authorize admin notice.
+ *
+ * @since 2.3.0
+ */
+ public function authorize_notice() {
+ if ( current_user_can( 'manage_options' ) && get_option( 'w3tcps_authorize_success' ) ) {
+ echo '' . esc_html( get_option( 'w3tcps_authorize_success' ) ) . '
';
+ delete_option( 'w3tcps_authorize_success ' );
+ } elseif ( current_user_can( 'manage_options' ) && get_option( 'w3tcps_authorize_fail' ) ) {
+ echo '' . esc_html( get_option( 'w3tcps_authorize_fail' ) ) . '
' . wp_kses( get_option( 'w3tcps_authorize_fail_message' ), Util_PageSpeed::get_allowed_tags() ) . '
';
+ delete_option( 'w3tcps_authorize_fail ' );
+ delete_option( 'w3tcps_authorize_fail_message ' );
+ }
+ }
+
+ /**
+ * Reset authentication.
+ *
+ * @since 2.3.0
+ */
+ public function reset() {
+ $access_token = $this->client->getAccessToken();
+ $this->client->revokeToken( $access_token );
+ $this->config->set( 'widget.pagespeed.access_token', '' );
+ $this->config->set( 'widget.pagespeed.w3key', '' );
+ $this->config->save();
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/PageSpeed_Data.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/PageSpeed_Data.php
new file mode 100644
index 00000000..940aa8a1
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/PageSpeed_Data.php
@@ -0,0 +1,459 @@
+ Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'categories', 'performance', 'score' ) ) * 100,
+ 'first-contentful-paint' => array(
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'first-contentful-paint', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'first-contentful-paint', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'first-contentful-paint', 'displayValue' ) ),
+ ),
+ 'largest-contentful-paint' => array(
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'largest-contentful-paint', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'largest-contentful-paint', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'largest-contentful-paint', 'displayValue' ) ),
+ ),
+ 'interactive' => array(
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'interactive', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'interactive', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'interactive', 'displayValue' ) ),
+ ),
+ 'cumulative-layout-shift' => array(
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'cumulative-layout-shift', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'cumalative-layout-shift', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'cumulative-layout-shift', 'displayValue' ) ),
+ ),
+ 'total-blocking-time' => array(
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'total-blocking-time', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'total-blocking-time', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'total-blocking-time', 'displayValue' ) ),
+ ),
+ 'speed-index' => array(
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'speed-index', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'speed-index', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'speed-index', 'displayValue' ) ),
+ ),
+ 'screenshots' => array(
+ 'final' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'final-screenshot', 'title' ) ),
+ 'screenshot' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'final-screenshot', 'details', 'data' ) ),
+ ),
+ 'other' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'screenshot-thumbnails', 'title' ) ),
+ 'screenshots' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'screenshot-thumbnails', 'details', 'items' ) ),
+ ),
+ ),
+ 'opportunities' => array(
+ 'render-blocking-resources' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'render-blocking-resources', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'render-blocking-resources', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'render-blocking-resources', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'render-blocking-resources', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'render-blocking-resources', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'render-blocking-resources', 'details', 'items' ) ),
+ 'type' => array(
+ 'FCP',
+ 'LCP',
+ ),
+ ),
+ 'unused-css-rules' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unused-css-rules', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unused-css-rules', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unused-css-rules', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unused-css-rules', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unused-css-rules', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unused-css-rules', 'details', 'items' ) ),
+ 'type' => array(
+ 'FCP',
+ 'LCP',
+ ),
+ ),
+ 'unminified-css' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unminified-css', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unminified-css', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unminified-css', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unminified-css', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unminified-css', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unminified-css', 'details', 'items' ) ),
+ 'type' => array(
+ 'FCP',
+ 'LCP',
+ ),
+ ),
+ 'unminified-javascript' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unminified-javascript', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unminified-javascript', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unminified-javascript', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unminified-javascript', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unminified-javascript', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unminified-javascript', 'details', 'items' ) ),
+ 'type' => array(
+ 'FCP',
+ 'LCP',
+ ),
+ ),
+ 'unused-javascript' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unused-javascript', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unused-javascript', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unused-javascript', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unused-javascript', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unused-javascript', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unused-javascript', 'details', 'items' ) ),
+ 'type' => array(
+ 'LCP',
+ ),
+ ),
+ 'uses-responsive-images' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-responsive-images', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-responsive-images', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-responsive-images', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-responsive-images', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-responsive-images', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-responsive-images', 'details', 'items' ) ),
+ ),
+ 'offscreen-images' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'offscreen-images', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'offscreen-images', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'offscreen-images', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'offscreen-images', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'offscreen-images', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'offscreen-images', 'details', 'items' ) ),
+ ),
+ 'uses-optimized-images' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-optimized-images', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-optimized-images', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-optimized-images', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-optimized-images', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-optimized-images', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-optimized-images', 'details', 'items' ) ),
+ ),
+ 'modern-image-formats' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'modern-image-formats', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'modern-image-formats', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'modern-image-formats', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'modern-image-formats', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'modern-image-formats', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'modern-image-formats', 'details', 'items' ) ),
+ ),
+ 'uses-text-compression' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-text-compression', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-text-compression', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-text-compression', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-text-compression', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-text-compression', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-text-compression', 'details', 'items' ) ),
+ 'type' => array(
+ 'FCP',
+ 'LCP',
+ ),
+ ),
+ 'uses-rel-preconnect' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-rel-preconnect', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-rel-preconnect', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-rel-preconnect', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-rel-preconnect', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-rel-preconnect', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-rel-preconnect', 'details', 'items' ) ),
+ 'type' => array(
+ 'FCP',
+ 'LCP',
+ ),
+ ),
+ 'server-response-time' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'server-response-time', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'server-response-time', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'server-response-time', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'server-response-time', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'server-response-time', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'server-response-time', 'details', 'items' ) ),
+ 'type' => array(
+ 'FCP',
+ 'LCP',
+ ),
+ ),
+ 'redirects' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'redirects', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'redirects', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'redirects', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'redirects', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'redirects', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'redirects', 'details', 'items' ) ),
+ 'type' => array(
+ 'FCP',
+ 'LCP',
+ ),
+ ),
+ 'uses-rel-preload' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-rel-preload', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-rel-preload', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-rel-preload', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-rel-preload', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-rel-preload', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-rel-preload', 'details', 'items' ) ),
+ 'type' => array(
+ 'FCP',
+ 'LCP',
+ ),
+ ),
+ 'efficient-animated-content' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'efficient-animated-content', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'efficient-animated-content', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'efficient-animated-content', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'efficient-animated-content', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'efficient-animated-content', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'efficient-animated-content', 'details', 'items' ) ),
+ 'type' => array(
+ 'LCP',
+ ),
+ ),
+ 'duplicated-javascript' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'duplicated-javascript', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'duplicated-javascript', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'duplicated-javascript', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'duplicated-javascript', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'duplicated-javascript', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'duplicated-javascript', 'details', 'items' ) ),
+ 'type' => array(
+ 'TBT',
+ ),
+ ),
+ 'legacy-javascript' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'legacy-javascript', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'legacy-javascript', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'legacy-javascript', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'legacy-javascript', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'legacy-javascript', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'legacy-javascript', 'details', 'items' ) ),
+ 'type' => array(
+ 'TBT',
+ ),
+ ),
+ 'total-byte-weight' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'total-byte-weight', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'total-byte-weight', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'total-byte-weight', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'total-byte-weight', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'total-byte-weight', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'total-byte-weight', 'details', 'items' ) ),
+ 'type' => array(
+ 'LCP',
+ ),
+ ),
+ 'dom-size' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'dom-size', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'dom-size', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'dom-size', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'dom-size', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'dom-size', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'dom-size', 'details', 'items' ) ),
+ 'type' => array(
+ 'TBT',
+ ),
+ ),
+ 'user-timings' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'user-timings', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'user-timings', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'user-timings', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'user-timings', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'user-timings', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'user-timings', 'details', 'items' ) ),
+ ),
+ 'bootup-time' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'bootup-time', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'bootup-time', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'bootup-time', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'bootup-time', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'bootup-time', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'bootup-time', 'details', 'items' ) ),
+ 'type' => array(
+ 'TBT',
+ ),
+ ),
+ 'mainthread-work-breakdown' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'mainthread-work-breakdown', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'mainthread-work-breakdown', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'mainthread-work-breakdown', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'mainthread-work-breakdown', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'mainthread-work-breakdown', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'mainthread-work-breakdown', 'details', 'items' ) ),
+ 'type' => array(
+ 'TBT',
+ ),
+ ),
+ 'third-party-summary' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'third-party-summary', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'third-party-summary', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'third-party-summary', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'third-party-summary', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'third-party-summary', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'third-party-summary', 'details', 'items' ) ),
+ 'type' => array(
+ 'TBT',
+ ),
+ ),
+ 'third-party-facades' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'third-party-facades', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'third-party-facades', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'third-party-facades', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'third-party-facades', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'third-party-facades', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'third-party-facades', 'details', 'items' ) ),
+ 'type' => array(
+ 'TBT',
+ ),
+ ),
+ 'lcp-lazy-loaded' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'lcp-lazy-loaded', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'lcp-lazy-loaded', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'lcp-lazy-loaded', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'lcp-lazy-loaded', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'lcp-lazy-loaded', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'lcp-lazy-loaded', 'details', 'items' ) ),
+ ),
+ 'uses-passive-event-listeners' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-passive-event-listeners', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-passive-event-listeners', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-passive-event-listeners', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-passive-event-listeners', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-passive-event-listeners', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-passive-event-listeners', 'details', 'items' ) ),
+ ),
+ 'no-document-write' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'no-document-write', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'no-document-write', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'no-document-write', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'no-document-write', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'no-document-write', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'no-document-write', 'details', 'items' ) ),
+ ),
+ 'non-composited-animations' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'non-composited-animations', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'non-composited-animations', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'non-composited-animations', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'non-composited-animations', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'non-composited-animations', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'non-composited-animations', 'details', 'items' ) ),
+ 'type' => array(
+ 'CLS',
+ ),
+ ),
+ 'unsized-images' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unsized-images', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unsized-images', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unsized-images', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unsized-images', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unsized-images', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'unsized-images', 'details', 'items' ) ),
+ 'type' => array(
+ 'CLS',
+ ),
+ ),
+ 'viewport' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'viewport', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'viewport', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'viewport', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'viewport', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'viewport', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'viewport', 'details', 'items' ) ),
+ 'type' => array(
+ 'TBT',
+ ),
+ ),
+ ),
+ 'diagnostics' => array(
+ 'font-display' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'font-display', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'font-display', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'font-display', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'font-display', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'font-display', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'font-display', 'details', 'items' ) ),
+ 'type' => array(
+ 'FCP',
+ 'LCP',
+ ),
+ ),
+ 'uses-long-cache-ttl' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-long-cache-ttl', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-long-cache-ttl', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-long-cache-ttl', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-long-cache-ttl', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-long-cache-ttl', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'uses-long-cache-ttl', 'details', 'items' ) ),
+ ),
+ 'critical-request-chains' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'critical-request-chains', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'critical-request-chains', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'critical-request-chains', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'critical-request-chains', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'critical-request-chains', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'critical-request-chains', 'details', 'items' ) ),
+ 'type' => array(
+ 'FCP',
+ 'LCP',
+ ),
+ ),
+ 'largest-contentful-paint-element' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'largest-contentful-paint-element', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'largest-contentful-paint-element', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'largest-contentful-paint-element', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'largest-contentful-paint-element', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'largest-contentful-paint-element', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'largest-contentful-paint-element', 'details', 'items' ) ),
+ 'type' => array(
+ 'LCP',
+ ),
+ ),
+ 'layout-shift-elements' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'layout-shift-elements', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'layout-shift-elements', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'layout-shift-elements', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'layout-shift-elements', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'layout-shift-elements', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'layout-shift-elements', 'details', 'items' ) ),
+ 'type' => array(
+ 'CLS',
+ ),
+ ),
+ 'long-tasks' => array(
+ 'title' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'long-tasks', 'title' ) ),
+ 'description' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'long-tasks', 'description' ) ),
+ 'score' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'long-tasks', 'score' ) ),
+ 'scoreDisplayMode' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'long-tasks', 'scoreDisplayMode' ) ),
+ 'displayValue' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'long-tasks', 'displayValue' ) ),
+ 'details' => Util_PageSpeed::get_value_recursive( $data, array( 'lighthouseResult', 'audits', 'long-tasks', 'details', 'items' ) ),
+ 'type' => array(
+ 'TBT',
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/PageSpeed_Instructions.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/PageSpeed_Instructions.php
new file mode 100644
index 00000000..46434b11
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/PageSpeed_Instructions.php
@@ -0,0 +1,647 @@
+ array(
+ 'render-blocking-resources' => array(
+ 'instructions' =>
+ '' . wp_kses(
+ sprintf(
+ // translators: 1 W3TC plugin name, 2 HTML a tag to W3TC Minify JS admin page
+ // translators: 3 HTML a tag to W3TC general settings user experience section
+ // translators: 4 HTML a tag to W3TC user expereince advanced settings page
+ // translators: 5 HTML a tag to W3TC Minify CSS admin page, 6 HTML line break tag.
+ esc_html__(
+ '%1$s can eliminate render blocking resources.%6$sOnce Minified, you can defer JS in the
+ %2$s.%6$sThe Defer Scripts (PRO FEATURE) can also be used with or without Minify to defer
+ the loading of JS files containing the "src" attribute. Scripts matched using this
+ feature will be excluded from the Minify process. To enable this feature navigate
+ to %3$s and check the "Defer JavaScript" checkbox. Once enabled the settings can be found
+ at %4$s.%6$sRender blocking CSS can be eliminated in %5$s using the "Eliminate Render
+ blocking CSS by moving it to HTTP body" (PRO FEATURE).',
+ 'w3-total-cache'
+ ),
+ 'W3 Total Cache',
+ '' . esc_html__( 'Performance » Minify » JS', 'w3-total-cache' ) . ' ',
+ '' . esc_html__( 'Performance » General Settings » User Experience', 'w3-total-cache' ) . ' ',
+ '' . esc_html__( 'Performance » User Experience', 'w3-total-cache' ) . ' ',
+ '' . esc_html__( 'Performance » Minify » CSS', 'w3-total-cache' ) . ' ',
+ ' '
+ ),
+ $allowed_tags
+ ) . '
',
+ ),
+ 'unused-css-rules' => array(
+ 'instructions' =>
+ '' . esc_html__( 'Some themes and plugins are loading CSS files or parts of the CSS files on all pages and not only on the pages that should be loading on. For eaxmple if you are using some contact form plugin, there is a chance that the CSS file of that plugin will load not only on the /contact/ page, but on all other pages as well and this is why the unused CSS should be removed.', 'w3-total-cache' ) . '
+ ' . esc_html__( 'Open your Chrome browser, go to “Developer Tools”, click on “More Tools” and then “Coverage”.', 'w3-total-cache' ) . '
+ ' . esc_html__( 'Coverage will open up. We will see buttons for start capturing coverage, to reload and start capturing coverage and to stop capturing coverage and show results.', 'w3-total-cache' ) . '
+ ' . esc_html__( 'If you have a webpage you want to analyze its code coverage. Load the webpage and click on the o button in the Coverage tab.', 'w3-total-cache' ) . '
+ ' . esc_html__( 'After sometime, a table will show up in the tab with the resources it analyzed, and how much code is used in the webpage. All the files linked in the webpage (css, js) will be listed in the Coverage tab. Clicking on any resource there will open that resource in the Sources panel with a breakdown of Total Bytes and Unused Bytes.', 'w3-total-cache' ) . '
+ ' . esc_html__( 'With this breakdown, we can see how many unused bytes are in our CSS files, so we can manually remove them.', 'w3-total-cache' ) . '
',
+ ),
+ 'unminified-css' => array(
+ 'instructions' =>
+ '' . wp_kses(
+ sprintf(
+ // translators: 1 HTML a tag to W3TC Minify CSS admin page, 2 HTML acronym for CSS, 3 HTML acronym for JS, 4 HTML a tag to W3 API FAQ page containing HTML acronym tag for FAQ.
+ esc_html__(
+ 'On the %1$s tab all of the recommended settings are preset. Use the help button to simplify discovery of your %2$s and %3$s files and groups. Pay close attention to the method and location of your %3$s group embeddings. See the plugin\'s %4$s for more information on usage.',
+ 'w3-total-cache'
+ ),
+ '' . esc_html__( 'Minify', 'w3-total-cache' ) . ' ',
+ '' . esc_html__( 'CSS', 'w3-total-cache' ) . ' ',
+ '' . esc_html__( 'JS', 'w3-total-cache' ) . ' ',
+ '' . esc_html__( 'FAQ', 'w3-total-cache' ) . ' '
+ ),
+ $allowed_tags
+ ) . '
',
+ ),
+ 'unminified-javascript' => array(
+ 'instructions' =>
+ '' . wp_kses(
+ sprintf(
+ // translators: 1 HTML a tag to W3TC Minify CSS admin page, 2 HTML acronym for CSS, 3 HTML acronym for JS, 4 HTML a tag to W3 API FAQ page containing HTML acronym tag for FAQ.
+ esc_html__(
+ 'On the %1$s tab all of the recommended settings are preset. Use the help button to simplify discovery of your %2$s and %3$s files and groups. Pay close attention to the method and location of your %3$s group embeddings. See the plugin\'s %4$s for more information on usage.',
+ 'w3-total-cache'
+ ),
+ '' . esc_html__( 'Minify', 'w3-total-cache' ) . ' ',
+ '' . esc_html__( 'CSS', 'w3-total-cache' ) . ' ',
+ '' . esc_html__( 'JS', 'w3-total-cache' ) . ' ',
+ '' . esc_html__( 'FAQ', 'w3-total-cache' ) . ' '
+ ),
+ $allowed_tags
+ ) . '
',
+ ),
+ 'unused-javascript' => array(
+ 'instructions' =>
+ '' . esc_html__( 'Some themes and plugins are loading JS files or parts of the JS files on all pages and not only on the pages that should be loading on. For eaxmple if you are using some contact form plugin, there is a chance that the JS file of that plugin will load not only on the /contact/ page, but on all other pages as well and this is why the unused JS should be removed.', 'w3-total-cache' ) . '
+ ' . esc_html__( 'Open your Chrome browser, go to “Developer Tools”, click on “More Tools” and then “Coverage”.', 'w3-total-cache' ) . '
+ ' . esc_html__( 'Coverage will open up. We will see buttons for start capturing coverage, to reload and start capturing coverage and to stop capturing coverage and show results.', 'w3-total-cache' ) . '
+ ' . esc_html__( 'If you have a webpage you want to analyze its code coverage. Load the webpage and click on the o button in the Coverage tab.', 'w3-total-cache' ) . '
+ ' . esc_html__( 'After sometime, a table will show up in the tab with the resources it analyzed, and how much code is used in the webpage. All the files linked in the webpage (css, js) will be listed in the Coverage tab. Clicking on any resource there will open that resource in the Sources panel with a breakdown of Total Bytes and Unused Bytes.', 'w3-total-cache' ) . '
+ ' . esc_html__( 'With this breakdown, we can see how many unused bytes are in our JS files, so we can manually remove them.', 'w3-total-cache' ) . '
',
+ ),
+ 'uses-responsive-images' => array(
+ 'instructions' =>
+ '' . wp_kses(
+ sprintf(
+ // translators: 1 HTML a tag to helpx.adobe.com for optimizing-image-jped-format.
+ esc_html__(
+ 'It\'s important to prepare images before uloading them to the website. This should be done before the Image is uploaded and can be done by using some image optimization tool like %1$s.',
+ 'w3-total-cache'
+ ),
+ '' . esc_html__( 'photoshop', 'w3-total-cache' ) . ' '
+ ),
+ $allowed_tags
+ ) . '
+ ' . esc_html__( 'Using srcset:', 'w3-total-cache' ) . '
+ ' . esc_html__( 'The srcset HTML tag provides the browser with variations of an image (including a fallback image) and instructs the browser to use specific images depending on the situation.', 'w3-total-cache' ) . '
+ ' . esc_html__( 'Essentially, you create various sizes of your image, and then utilize the srcset tag to define when the images get served. This is useful for responsive design when you have multiple images to deliver across several devices and dimensions.', 'w3-total-cache' ) . '
+ ' . esc_html__( 'For example, let\'s say you want to send a high-resolution image to only those users that have high-resolution screens, as determined by the Device pixel ratio (DPR). The code would look like this:', 'w3-total-cache' ) . '
+ ' . esc_html( ' ' ) . '
+ ' . esc_html__( 'Use image optimization plugin.', 'w3-total-cache' ) . '
',
+ ),
+ 'offscreen-images' => array(
+ 'instructions' => '' . esc_html__( 'Enable lazy load for images.', 'w3-total-cache' ) . '
',
+ ),
+ 'uses-optimized-images' => array(
+ 'instructions' =>
+ '' . sprintf(
+ // translators: 1 W3TC plugin name, opening HTML a tag to Image Service extension, 3 closing HTML a tag.
+ esc_html__(
+ 'Use %1$s %2$sWebP Converter%3$s to convert media library images to WebP.',
+ 'w3-total-cache'
+ ),
+ 'W3 Total Cache',
+ '',
+ ' '
+ ) . '
',
+ ),
+ 'modern-image-formats' => array(
+ 'instructions' =>
+ '' . sprintf(
+ // translators: 1 W3TC plugin name, opening HTML a tag to Image Service extension, 3 closing HTML a tag.
+ esc_html__(
+ 'Use %1$s %2$sWebP Converter%3$s to convert media library images to WebP.',
+ 'w3-total-cache'
+ ),
+ 'W3 Total Cache',
+ '',
+ ' '
+ ) . '
',
+ ),
+ 'uses-text-compression' => array(
+ 'instructions' =>
+ '' . wp_kses(
+ sprintf(
+ // translators: 1 W3TC plugin name, 2 HTML a tag to kjdev php-ext-brotli.
+ esc_html__(
+ 'Use %1$s Browser Caching - Peformance>Browser Cache - Enable Gzip compression or Brotli compression (Gzip compression is most common and for Brotli compression you need to install %2$s on your server.',
+ 'w3-total-cache'
+ ),
+ 'W3 Total Cache',
+ '' . esc_html__( 'Brotli extension', 'w3-total-cache' ) . ' '
+ ),
+ $allowed_tags
+ ) . '
',
+ ),
+ 'uses-rel-preconnect' => array(
+ 'instructions' =>
+ '' . esc_html__( 'Look at the list of third-party resources flagged by Google Page speed and add preconnect or dns-prefetch to their link tags depending on whether the resource is critical or not.', 'w3-total-cache' ) . '
+
+
+ ' . esc_html__( 'Add preconnect for critical third-party domains. Out of the list of third-party resources flagged by Google Page speed, identify the critical third-party resources and add the following code to the link tag:', 'w3-total-cache' ) . '
+ ' . esc_html( ' ' ) . '
+ ' . esc_html__( 'Where "https://third-party-example.com" is the critical third-party domain your page intends to connect to.', 'w3-total-cache' ) . '
+
+
+ ' . esc_html__( 'Add dns-prefetch for all other third-party domains. For all other third-party scripts, including non-critical ones, add the following code to the link tag:', 'w3-total-cache' ) . '
+ ' . esc_html( ' ' ) . '
+ ' . esc_html__( 'Where "https://third-party-example.com" is the domain of the respective third-party resource.', 'w3-total-cache' ) . '
+
+ ',
+ ),
+ 'server-response-time' => array(
+ 'instructions' =>
+ '' . sprintf(
+ // translators: 1 W3TC plugin name, 2 opening HTML a tag to Page Cache setting, 3 closing HTML a tag.
+ esc_html__(
+ 'Use %1$s %2$sPage Caching%3$s (fastest module)',
+ 'w3-total-cache'
+ ),
+ 'W3 Total Cache',
+ '',
+ ' '
+ ) . '
',
+ ),
+ 'redirects' => array(
+ 'instructions' =>
+ '' . esc_html__( 'When dealing with server-side redirects, we recommend that they be executed via web server configuration as they are often faster than application-level configuration.', 'w3-total-cache' ) . '
+ ' . esc_html__( 'Avoid client-side redirects, as much as possible, as they are slower, non-cacheable and may not be supported by browsers by default.', 'w3-total-cache' ) . '
+ ' . esc_html__( 'Wherever possible, avoid landing page redirects; especially, the practice of executing separate, individual redirects for reasons such as protocol change, adding www, mobile-specific page, geo-location, and subdomain.', 'w3-total-cache' ) . '
+ ' . esc_html__( 'Always redirect to the preferred version of the URL, especially, when redirects are dynamically generated. This helps eliminate unnecessary redirects.', 'w3-total-cache' ) . '
+ ' . esc_html__( 'Similarly, remove temporary redirects if not needed anymore.', 'w3-total-cache' ) . '
+ ' . esc_html__( 'Remember that combining multiple redirects into a single redirect is the most effective way to improve web performance.', 'w3-total-cache' ) . '
',
+ ),
+ 'uses-rel-preload' => array(
+ 'instructions' =>
+ '' . sprintf(
+ // translators: 1 W3TC plugin name.
+ esc_html__(
+ 'JS and CSS - Use HTTP2/Push for %1$s Minified files',
+ 'w3-total-cache'
+ ),
+ 'W3 Total Cache'
+ ) . '
+ ' . esc_html__( 'Preload fonts hosted on the server: ', 'w3-total-cache' ) . '' . esc_html( ' ' ) . '
',
+ ),
+ 'efficient-animated-content' => array(
+ 'instructions' =>
+ '' . sprintf(
+ // translators: 1 W3TC plugin name, opening HTML a tag to Image Service extension, 3 closing HTML a tag.
+ esc_html__(
+ 'Use %1$s %2$sWebP Converter%3$s to convert media library images to WebP.',
+ 'w3-total-cache'
+ ),
+ 'W3 Total Cache',
+ '',
+ ' '
+ ) . '
',
+ ),
+ 'duplicated-javascript' => array(
+ 'instructions' =>
+ '' . esc_html__( 'Incorporate good site building practices into your development workflow to ensure you avoid duplication of JavaScript modules in the first place.', 'w3-total-cache' ) . '
+ ' .
+ wp_kses(
+ sprintf(
+ // translators: 1 HTML a tag to Zillow Webpack-Stats-Duplicates.
+ esc_html__(
+ 'To fix this audit, use a tool like %1$s to identify duplicate modules',
+ 'w3-total-cache'
+ ),
+ '' . esc_html__( 'webpack-stats-duplicates', 'w3-total-cache' ) . ' '
+ ),
+ $allowed_tags
+ ) . '
',
+ ),
+ 'legacy-javascript' => array(
+ 'instructions' =>
+ '' . esc_html__( 'One way to deal with this issue is to load polyfills, only when needed, which can provide feature-detection support at JavaScript runtime. However, it is often very difficult to implement in practice.', 'w3-total-cache' ) . '
+ ' . esc_html__( 'Implement modern feature-detection using ', 'w3-total-cache' ) . '' . esc_html( '
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/SystemOpCache_AdminActions.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/SystemOpCache_AdminActions.php
new file mode 100644
index 00000000..46e8ef0c
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/SystemOpCache_AdminActions.php
@@ -0,0 +1,21 @@
+flush();
+
+ if ( $success ) {
+ Util_Admin::redirect_with_custom_messages2( array(
+ 'notes' => array( 'OPCache was flushed successfully' )
+ ), true );
+ } else {
+ Util_Admin::redirect_with_custom_messages2( array(
+ 'errors' => array( 'Failed to flush OPCache' )
+ ), true );
+ }
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/SystemOpCache_Core.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/SystemOpCache_Core.php
new file mode 100644
index 00000000..bf6f0b8e
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/SystemOpCache_Core.php
@@ -0,0 +1,45 @@
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/SystemOpCache_Plugin_Admin.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/SystemOpCache_Plugin_Admin.php
new file mode 100644
index 00000000..41b31993
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/SystemOpCache_Plugin_Admin.php
@@ -0,0 +1,61 @@
+ 'system_opcache', 'text' => 'System OPcache' );
+ return $anchors;
+ }
+
+
+
+ static public function w3tc_admin_actions( $handlers ) {
+ $handlers['opcache'] = 'SystemOpCache_AdminActions';
+
+ return $handlers;
+ }
+
+
+
+ public function w3tc_settings_general_boxarea_system_opcache() {
+ $opcode_engine = 'Not Available';
+ $validate_timestamps = false;
+
+ if ( Util_Installed::opcache() ) {
+ $opcode_engine = 'OPcache';
+ $validate_timestamps = Util_Installed::is_opcache_validate_timestamps();
+ } else if ( Util_Installed::apc_opcache() ) {
+ $opcode_engine = 'APC';
+ $engine_status = Util_Installed::is_apc_validate_timestamps();
+ }
+
+ include W3TC_DIR . '/SystemOpCache_GeneralPage_View.php';
+ }
+
+
+
+ public function w3tc_admin_bar_menu( $menu_items ) {
+ $menu_items['20910.system_opcache'] = array(
+ 'id' => 'w3tc_flush_opcache',
+ 'parent' => 'w3tc_flush',
+ 'title' => __( 'Opcode Cache', 'w3-total-cache' ),
+ 'href' => Util_Ui::url( array( 'page' => 'w3tc_dashboard', 'w3tc_opcache_flush' => '' ) ),
+ );
+
+ return $menu_items;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_AdminActions.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_AdminActions.php
new file mode 100644
index 00000000..ab4f9a46
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_AdminActions.php
@@ -0,0 +1,23 @@
+_config = Dispatcher::config();
+ }
+
+
+
+ public function w3tc_ustats_note_disable() {
+ $this->_config->set( 'stats.enabled', false );
+ $this->_config->save();
+
+ Util_Admin::redirect( array(), true );
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Core.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Core.php
new file mode 100644
index 00000000..c5509fe4
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Core.php
@@ -0,0 +1,80 @@
+storage = new UsageStatistics_StorageWriter();
+ }
+
+
+
+ public function add_shutdown_handler() {
+ $this->shutdown_handler_added = true;
+ add_action( 'shutdown', array(
+ $this,
+ 'shutdown'
+ ), 100000, 0 );
+
+ if ( !is_null( $this->hotspot_flushing_state_on_exit_attempt ) )
+ add_action( 'init', array(
+ $this, 'init_when_exit_requested' ) );
+ }
+
+
+
+ public function is_shutdown_handler_added() {
+ return $this->shutdown_handler_added;
+ }
+
+
+
+ public function init_when_exit_requested() {
+ exit();
+ }
+
+
+
+ public function shutdown() {
+ if ( !is_null( $this->hotspot_flushing_state_on_exit_attempt ) )
+ $this->storage->finish_flush_hotspot_data();
+ else
+ $this->storage->maybe_flush_hotspot_data();
+
+ do_action( 'w3tc_usage_statistics_of_request', $this->storage );
+ }
+
+
+
+ /**
+ * $metrics_function has to be added by add_action on plugin load
+ */
+ public function apply_metrics_before_init_and_exit( $metrics_function ) {
+ // plugin already loaded, metrics will be added normal way
+ // by shutdown
+
+ if ( $this->shutdown_handler_added ) {
+ return;
+ }
+
+ $this->hotspot_flushing_state_on_exit_attempt =
+ $this->storage->begin_flush_hotspot_data();
+
+ // flush wants to happen in that process, need to pass through whole
+ // wp request processing further
+ if ( $this->hotspot_flushing_state_on_exit_attempt != 'not_needed' ) {
+ return;
+ }
+
+ call_user_func( $metrics_function, $this->storage );
+ exit();
+ }
+
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_GeneralPage.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_GeneralPage.php
new file mode 100644
index 00000000..dbc873ed
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_GeneralPage.php
@@ -0,0 +1,35 @@
+ 'stats',
+ 'text' => __( 'Statistics', 'w3-total-cache' ),
+ );
+ return $anchors;
+ }
+
+
+
+ public function w3tc_settings_general_boxarea_stats() {
+ include W3TC_DIR . '/UsageStatistics_GeneralPage_View.php';
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_GeneralPage_View.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_GeneralPage_View.php
new file mode 100644
index 00000000..eda76043
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_GeneralPage_View.php
@@ -0,0 +1,172 @@
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page.php
new file mode 100644
index 00000000..ab51bb6d
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page.php
@@ -0,0 +1,186 @@
+get_boolean( 'stats.enabled' ) &&
+ Util_Environment::is_w3tc_pro( $c ) );
+ if ( !$enabled ) {
+ if ( !Util_Environment::is_w3tc_pro( $c ) ) {
+ include W3TC_DIR . '/UsageStatistics_Page_View_Free.php';
+ } else {
+ include W3TC_DIR . '/UsageStatistics_Page_View_Disabled.php';
+ }
+
+ return;
+ }
+
+ $view_val = Util_Request::get_string( 'view' );
+ if ( ! empty( $view_val ) && 'db_requests' === $view_val ) {
+ $storage = new UsageStatistics_StorageReader();
+ $summary = $storage->get_history_summary();
+ $timestamp_start = $summary['period']['timestamp_start'];
+
+ $sort_val = Util_Request::get_string( 'sort' );
+ $sort_column = ! empty( $sort_val ) ? $sort_val : '';
+ if ( !in_array( $sort_column, array(
+ 'query', 'count_total', 'count_hit', 'avg_size',
+ 'avg_time_ms', 'sum_time_ms' ) ) ) {
+ $sort_column = 'sum_time_ms';
+ }
+
+ if ( !$c->get_boolean( 'dbcache.debug' ) ) {
+ include W3TC_DIR . '/UsageStatistics_Page_View_NoDebugMode.php';
+ return;
+ }
+
+ $reader = new UsageStatistics_Source_DbQueriesLog( $timestamp_start,
+ $sort_column );
+ $items = $reader->list_entries();
+
+ $result = array(
+ 'date_min' =>
+ Util_UsageStatistics::time_mins( $timestamp_start ),
+ 'date_max' => Util_UsageStatistics::time_mins( time() ),
+ 'sort_column' => $sort_column,
+ 'items' => $items
+ );
+
+ include W3TC_DIR . '/UsageStatistics_Page_DbRequests_View.php';
+ } elseif ( ! empty( $view_val ) && 'oc_requests' === $view_val ) {
+ $storage = new UsageStatistics_StorageReader();
+ $summary = $storage->get_history_summary();
+ $timestamp_start = $summary['period']['timestamp_start'];
+
+ $sort_val = Util_Request::get_string( 'sort' );
+ $sort_column = ! empty( $sort_val ) ? $sort_val : '';
+ if ( !in_array( $sort_column, array(
+ 'group', 'count_total', 'count_get_total', 'count_get_hit',
+ 'count_set', 'avg_size', 'sum_size', 'sum_time_ms' ) ) ) {
+ $sort_column = 'sum_time_ms';
+ }
+
+ if ( !$c->get_boolean( 'objectcache.debug' ) ) {
+ include W3TC_DIR . '/UsageStatistics_Page_View_NoDebugMode.php';
+ return;
+ }
+
+ $reader = new UsageStatistics_Source_ObjectCacheLog( $timestamp_start,
+ $sort_column );
+ $items = $reader->list_entries();
+
+ $result = array(
+ 'date_min' =>
+ Util_UsageStatistics::time_mins( $timestamp_start ),
+ 'date_max' => Util_UsageStatistics::time_mins( time() ),
+ 'sort_column' => $sort_column,
+ 'items' => $items
+ );
+
+ include W3TC_DIR . '/UsageStatistics_Page_ObjectCacheLog_View.php';
+ } elseif ( ! empty( $view_val ) && 'pagecache_requests' === $view_val ) {
+ $storage = new UsageStatistics_StorageReader();
+ $summary = $storage->get_history_summary();
+ $timestamp_start = $summary['period']['timestamp_start'];
+
+ $sort_val = Util_Request::get_string( 'sort' );
+ $sort_column = ! empty( $sort_val ) ? $sort_val : '';
+ if ( !in_array( $sort_column, array(
+ 'uri', 'count', 'avg_size', 'avg_time_ms',
+ 'sum_time_ms' ) ) ) {
+ $sort_column = 'sum_time_ms';
+ }
+
+ if ( !$c->get_boolean( 'pgcache.debug' ) ) {
+ include W3TC_DIR . '/UsageStatistics_Page_View_NoDebugMode.php';
+ return;
+ }
+
+ $reader = new UsageStatistics_Source_PageCacheLog(
+ $timestamp_start,
+ Util_Request::get_string( 'status' ),
+ $sort_column
+ );
+ $items = $reader->list_entries();
+
+ $result = array(
+ 'date_min' =>
+ Util_UsageStatistics::time_mins( $timestamp_start ),
+ 'date_max' => Util_UsageStatistics::time_mins( time() ),
+ 'sort_column' => $sort_column,
+ 'items' => $items
+ );
+
+ include W3TC_DIR . '/UsageStatistics_Page_PageCacheRequests_View.php';
+ } else {
+ $c = Dispatcher::config();
+
+ $php_php_requests_pagecache_hit_name = 'Cache hit';
+ if ( $c->get_boolean( 'pgcache.enabled' ) &&
+ $c->get_string( 'pgcache.engine' ) == 'file_generic' ) {
+ $php_php_requests_pagecache_hit_name = 'Cache fallback hit';
+ }
+
+ include W3TC_DIR . '/UsageStatistics_Page_View.php';
+ }
+ }
+
+
+
+ public function sort_link( $result, $name, $sort_column ) {
+ if ( $result['sort_column'] == $sort_column ) {
+ echo '' . esc_html( $name ) . ' ';
+ return;
+ }
+
+ $new_query_string = $_GET;
+ $new_query_string['sort'] = sanitize_text_field( $sort_column );
+
+ echo '' . esc_html( $name ) . ' ';
+ }
+
+
+
+ public function summary_item( $id, $name, $checked = false, $extra_class = '', $column_background = '', $link_key = '' ) {
+ echo '';
+ }
+
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_DbRequests_View.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_DbRequests_View.php
new file mode 100644
index 00000000..fc5cca54
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_DbRequests_View.php
@@ -0,0 +1,44 @@
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_ObjectCacheLog_View.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_ObjectCacheLog_View.php
new file mode 100644
index 00000000..3f76675e
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_ObjectCacheLog_View.php
@@ -0,0 +1,48 @@
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_PageCacheRequests_View.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_PageCacheRequests_View.php
new file mode 100644
index 00000000..c850f5a2
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_PageCacheRequests_View.php
@@ -0,0 +1,42 @@
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_View.css b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_View.css
new file mode 100644
index 00000000..8f5754ad
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_View.css
@@ -0,0 +1,103 @@
+.ustats_ad {
+ max-width: 600px;
+ margin: auto;
+ padding-top: 50px;
+}
+.ustats_ad_metabox .inside {
+ background: url('./pub/img/stats-bg.png');
+ background-repeat: no-repeat;
+ background-size: cover;
+ min-height: 400px;
+ font-weight: bold;
+}
+
+.ustats_content {
+ text-align: right;
+}
+.ustats_p {
+ text-align: center;
+}
+.ustats_block {
+ width: 100%;
+ display: none;
+ margin-bottom: 10px;
+
+}
+.ustats_block_data {
+ width: 30%;
+ padding-bottom: 10px;
+}
+.ustats_block_data div {
+ display: none;
+}
+.ustats_block_data .ustats_header {
+ font-weight: bold;
+ display: block;
+}
+.ustats_block_chart {
+ width: 70%;
+ height: 200px;
+}
+.ustats_block_chart canvas {
+ display: block;
+ height: 200px;
+ width: 800px;
+}
+
+.ustats_table {
+ width: 100%;
+ padding-left: 20px;
+ padding-right: 20px;
+}
+
+td.ustats_td {
+ padding: 0;
+ padding-right: 10px;
+ font-weight: bold;
+ color: #333;
+}
+
+td.ustats_td_header_name {
+ padding: 0;
+ padding-right: 5px;
+ padding-top: 5px;
+ text-align: left;
+ font-weight: bold;
+ color: #333;
+}
+
+td.ustats_td_header {
+ padding: 0;
+ padding-right: 5px;
+ padding-top: 5px;
+ text-align: right;
+ font-weight: bold;
+ color: #333;
+}
+
+td.ustats_td_value {
+ padding: 0;
+ padding-right: 8px;
+ text-align: right;
+ color: #333;
+}
+
+/* specific cache areas */
+.ustats_php_php_requests_pagecache_hit,
+.ustats_php_php_requests_pagecache_miss {
+ padding-left: 20px;
+}
+.ustats_block_data div.ustats_php_php_requests_pagecache_miss_level2_wrap {
+ display: flex;
+ padding-left: 40px;
+ flex-wrap: wrap;
+}
+.ustats_php_php_requests_pagecache_miss_level2 {
+ width: 50%;
+}
+
+@media (max-width: 1500px) {
+ .ustats_php_php_requests_pagecache_miss_level2 {
+ width: 100%
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_View.js b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_View.js
new file mode 100644
index 00000000..08d79fc4
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_View.js
@@ -0,0 +1,807 @@
+jQuery(document).ready(function($) {
+ var lastData;
+
+
+
+ function load() {
+ top_object = $('.ustats_top');
+ $('.ustats_loading').removeClass('w3tc_hidden');
+ $('.ustats_content').addClass('w3tc_hidden');
+ $('.ustats_error').addClass('w3tc_none');
+ $('.ustats_nodata').addClass('w3tc_none');
+
+ $.getJSON(ajaxurl + '?action=w3tc_ajax&_wpnonce=' + w3tc_nonce +
+ '&w3tc_action=ustats_get',
+ function(data) {
+ lastData = data;
+
+ // show sections with data
+ for (p in data) {
+ var v = data[p];
+ jQuery('.ustats_' + p).css('display', 'flex');
+ }
+
+ setValues(data, 'ustats_');
+
+ if (data.period.seconds)
+ $('.ustats_content').removeClass('w3tc_hidden');
+ else
+ $('.ustats_nodata').removeClass('w3tc_none');
+
+ $('.ustats_loading').addClass('w3tc_hidden');
+
+ setCharts(data);
+
+ setRefresh(
+ (data && data.period ? data.period.to_update_secs : 0));
+
+ showMetaboxes();
+ }
+ ).fail(function() {
+ $('.ustats_error').removeClass('w3tc_none');
+ $('.ustats_content').addClass('w3tc_hidden');
+ $('.ustats_loading').addClass('w3tc_hidden');
+ });
+ }
+
+
+
+ //
+ // chart commons
+ //
+ var chartOptions = {
+ //aspectRatio: 4,
+ maintainAspectRatio: false,
+ animation: false,
+ legend: false,
+ scales: {
+ yAxes: [{
+ ticks: {
+ beginAtZero: true
+ }
+ }]
+ }
+ };
+
+
+
+ var chartDateLabels = [];
+ var chartGraphValues = {};
+ var charts = {};
+
+
+
+ function setCharts(data) {
+ // collect functors that prepare data for their own chart
+ var processors = [];
+ processors.push(setChartsPageCache());
+ processors.push(setChartsDb());
+ processors.push(setChartsOc());
+ processors.push(setChartsPhp());
+ processors.push(setChartsCpu());
+ processors.push(setChartsWpdb());
+ processors.push(setChartsAccessLog());
+ processors.push(setChartsMemcached());
+ processors.push(setChartsRedis());
+ processors.push(setChartsApc());
+
+ // prepare collections
+ var columnsToCollect = [];
+
+ for (var i = 0; i < processors.length; i++) {
+ for (var id in processors[i].chartDatasets) {
+ var datasets = [];
+ for (var i2 = 0; i2 < processors[i].chartDatasets[id].length; i2++) {
+ var datasetTemplate = processors[i].chartDatasets[id][i2];
+ var dataColumnString;
+ if (Array.isArray(datasetTemplate.dataColumn)) {
+ dataColumnString = datasetTemplate.dataColumn.join('.');
+ } else {
+ dataColumnString = datasetTemplate.dataColumn;
+ }
+
+ chartGraphValues[dataColumnString] = [];
+ columnsToCollect.push({
+ target: dataColumnString,
+ column: datasetTemplate.dataColumn
+ });
+ datasets.push({
+ label: datasetTemplate.label,
+ data: chartGraphValues[dataColumnString],
+ backgroundColor: datasetTemplate.backgroundColor
+ });
+ }
+
+ charts[id].data.datasets = datasets;
+ }
+ }
+
+ // collect data for charts
+ var history = data.history;
+ chartDateLabels.length = 0;
+ for (var i = 0; i < history.length; i++) {
+ var historyItem = history[i];
+ var dateFormatted = '';
+ if (history[i].timestamp_start) {
+ var d = new Date(parseInt(history[i].timestamp_start) * 1000);
+ dateFormatted = dateFormat(d);
+ }
+
+ chartDateLabels.push(dateFormatted);
+
+ // custom preprocess history row
+ for (var i2 = 0; i2 < processors.length; i2++) {
+ if (processors[i2].preprocess) {
+ processors[i2].preprocess(historyItem);
+ }
+ }
+
+ // collect metrics for graphs
+ for (var i2 = 0; i2 < columnsToCollect.length; i2++) {
+ var c = columnsToCollect[i2];
+ var v;
+ if (Array.isArray(c.column)) {
+ if (v = historyItem[c.column[0]]) {
+ v = historyItem[c.column[0]][c.column[1]];
+ }
+ } else {
+ v = historyItem[c.column];
+ }
+
+ chartGraphValues[c.target].push(v);
+ }
+ }
+
+ // visualize
+ for (var c in charts) {
+ charts[c].update();
+ }
+ }
+
+
+
+ $('.w3tcus_chart_check').click(function() {
+ setCharts(lastData);
+ });
+
+
+
+ //
+ // PageCache chart
+ //
+ function setChartsPageCache() {
+ if (!charts['pagecache']) {
+ var ctx = $('#w3tcus_pagecache_chart');
+ charts['pagecache'] = new Chart(ctx, {
+ type: 'bar',
+ data: {
+ labels: chartDateLabels,
+ },
+ options: chartOptions
+ });
+ }
+
+
+ return {
+ chartDatasets: {
+ pagecache: [{
+ label: 'Time (ms)',
+ dataColumn: 'pagecache_requests_time_ms',
+ backgroundColor: '#0073aa'
+ }
+ ]
+ },
+ preprocess: function(historyItem) {
+ v = 0;
+ if (historyItem.pagecache_requests_time_10ms && historyItem.php_requests) {
+ v = ((historyItem.pagecache_requests_time_10ms * 10) /
+ historyItem.php_requests).toFixed(0);
+ }
+ historyItem.pagecache_requests_time_ms = v;
+ }
+ };
+ }
+
+
+
+ //
+ // Database chart
+ //
+ function setChartsDb() {
+ if (!charts['db']) {
+ var ctx = $('#w3tcus_dbcache_chart');
+ charts['db'] = new Chart(ctx, {
+ type: 'bar',
+ data: {
+ labels: chartDateLabels,
+ },
+ options: chartOptions
+ });
+
+ var ctx = $('#w3tcus_dbcache_time_chart');
+ charts['db_time'] = new Chart(ctx, {
+ type: 'bar',
+ data: {
+ labels: chartDateLabels,
+ },
+ options: chartOptions
+ });
+ }
+
+
+ return {
+ chartDatasets: {
+ db_time: [{
+ label: 'Time (ms)',
+ dataColumn: 'dbcache_time_ms',
+ backgroundColor: '#0073aa'
+ }
+ ],
+ db: [{
+ label: 'Calls',
+ dataColumn: 'dbcache_calls_total',
+ backgroundColor: '#0073aa'
+ }, {
+ label: 'Hits',
+ dataColumn: 'dbcache_calls_hits',
+ backgroundColor: 'green'
+ }
+ ]
+ }
+ };
+ }
+
+
+
+ //
+ // OC chart
+ //
+ function setChartsOc(data) {
+ if (!charts['oc']) {
+ var ctx = $('#w3tcus_objectcache_chart');
+ charts['oc'] = new Chart(ctx, {
+ type: 'bar',
+ data: {
+ labels: chartDateLabels
+ },
+ options: chartOptions
+ });
+
+ var ctx = $('#w3tcus_objectcache_time_chart');
+ charts['oc_time'] = new Chart(ctx, {
+ type: 'bar',
+ data: {
+ labels: chartDateLabels
+ },
+ options: chartOptions
+ });
+ }
+
+ return {
+ chartDatasets: {
+ oc_time: [{
+ label: 'Time (ms)',
+ dataColumn: 'objectcache_time_ms',
+ backgroundColor: '#0073aa'
+ }
+ ],
+ oc: [{
+ label: 'Gets',
+ dataColumn: 'objectcache_get_total',
+ backgroundColor: '#0073aa'
+ }, {
+ label: 'Hits',
+ dataColumn: 'objectcache_get_hits',
+ backgroundColor: 'green'
+ }, {
+ label: 'Sets',
+ dataColumn: 'objectcache_sets',
+ backgroundColor: 'red'
+ }
+ ]
+ }
+ };
+ }
+
+
+
+ //
+ // PHP chart
+ //
+ function setChartsPhp(data) {
+ if (!charts['phpMemory']) {
+ var ctx = $('#w3tcus_php_memory_chart');
+ charts['phpMemory'] = new Chart(ctx, {
+ type: 'bar',
+ data: {
+ labels: chartDateLabels,
+ },
+ options: chartOptions
+ });
+ }
+ if (!charts['phpRequests']) {
+ var ctx = $('#w3tcus_php_requests_chart');
+ charts['phpRequests'] = new Chart(ctx, {
+ type: 'bar',
+ data: {
+ labels: chartDateLabels
+ },
+ options: chartOptions
+ });
+ }
+
+ var phpRequestsDatasets = [];
+ $('.w3tcus_chart_check').each(function() {
+ if ($(this).is(':checked')) {
+ var dataColumn = $(this).data('column');
+ var backgroundColor = $(this).data('background');
+ if (!backgroundColor) {
+ backgroundColor = '#0073aa';
+ }
+
+ if (startsWith(dataColumn, 'php_php_requests')) {
+ phpRequestsDatasets.push({
+ label: $(this).data('name'),
+ dataColumn: dataColumn.substr(4),
+ backgroundColor: backgroundColor
+ });
+ }
+ }
+ });
+
+ return {
+ chartDatasets: {
+ phpMemory: [{
+ label: 'MB',
+ dataColumn: 'php_memory_mb',
+ backgroundColor: '#0073aa'
+ }
+ ],
+ phpRequests: phpRequestsDatasets
+ },
+ preprocess: function(historyItem) {
+ var v = 0;
+ if (historyItem.php_requests) {
+ v = (historyItem.php_memory_100kb / 100.0 / historyItem.php_requests).toFixed(2)
+ }
+ historyItem.php_memory_mb = v;
+
+ historyItem.php_requests_pagecache_miss =
+ historyItem.php_requests - historyItem.php_requests_pagecache_hit;
+ }
+ };
+ }
+
+
+
+ //
+ // CPU chart
+ //
+ function setChartsCpu(data) {
+ if (!charts['cpu']) {
+ var ctx = $('#w3tcus_cpu_chart');
+ charts['cpu'] = new Chart(ctx, {
+ type: 'bar',
+ data: {
+ labels: chartDateLabels,
+ },
+ options: chartOptions
+ });
+ }
+
+ return {
+ chartDatasets: {
+ cpu: [{
+ label: 'CPU',
+ dataColumn: 'cpu',
+ backgroundColor: '#0073aa'
+ }
+ ]
+ }
+ };
+ }
+
+
+
+ //
+ // WPDB chart
+ //
+ function setChartsWpdb(data) {
+ if (!charts['wpdb']) {
+ var ctx = $('#w3tcus_wpdb_chart');
+ charts['wpdb'] = new Chart(ctx, {
+ type: 'bar',
+ data: {
+ labels: chartDateLabels,
+ },
+ options: chartOptions
+ });
+ }
+
+ return {
+ chartDatasets: {
+ wpdb: [{
+ label: 'Total',
+ dataColumn: 'wpdb_calls_total',
+ backgroundColor: '#0073aa'
+ }]
+ }
+ };
+ }
+
+
+
+ //
+ // Access Log chart
+ //
+ function setChartsAccessLog(data) {
+ if (!charts['accessLogRequests']) {
+ var ctx = $('#w3tcus_access_log_chart_requests');
+ charts['accessLogRequests'] = new Chart(ctx, {
+ type: 'bar',
+ data: {
+ labels: chartDateLabels,
+ },
+ options: chartOptions
+ });
+ }
+ if (!charts['accessLogTiming']) {
+ var ctx = $('#w3tcus_access_log_chart_timing');
+ charts['accessLogTiming'] = new Chart(ctx, {
+ type: 'bar',
+ data: {
+ labels: chartDateLabels
+ },
+ options: chartOptions
+ });
+ }
+
+ return {
+ chartDatasets: {
+ accessLogRequests: [{
+ label: 'Dynamic',
+ dataColumn: ['access_log', 'dynamic_count'],
+ backgroundColor: '#0073aa'
+ }, {
+ label: 'Static',
+ dataColumn: ['access_log', 'static_count'],
+ backgroundColor: '#0073aa'
+ }
+ ],
+ accessLogTiming: [{
+ label: 'Dynamic',
+ dataColumn: ['access_log', 'dynamic_timing'],
+ backgroundColor: '#0073aa'
+ }, {
+ label: 'Static',
+ dataColumn: ['access_log', 'static_timing'],
+ backgroundColor: '#0073aa'
+ }
+ ]
+ },
+ preprocess: function(historyItem) {
+ var dc = 0, sc = 0, dt = 0, st = 0;
+ if (historyItem.access_log) {
+ var a = historyItem.access_log;
+ dc = a.dynamic_count;
+ if (dc) {
+ dt = (a.dynamic_timetaken_ms / dc).toFixed(2);
+ }
+
+ sc = a.static_count;
+ if (sc) {
+ st = (a.static_timetaken_ms / dc).toFixed(2);
+ }
+
+ historyItem['access_log']['dynamic_timing'] = dt;
+ historyItem['access_log']['static_timing'] = st;
+ }
+ }
+ };
+ }
+
+
+
+ //
+ // Memcached chart
+ //
+ function setChartsMemcached(data) {
+ if (!charts['memcachedSize']) {
+ var ctx = $('#w3tcus_memcached_size_chart');
+ charts['memcachedSize'] = new Chart(ctx, {
+ type: 'bar',
+ data: {
+ labels: chartDateLabels
+ },
+ options: chartOptions
+ });
+ }
+
+ if (!charts['memcachedHit']) {
+ var ctx = $('#w3tcus_memcached_hit_chart');
+ charts['memcachedHit'] = new Chart(ctx, {
+ type: 'bar',
+ data: {
+ labels: chartDateLabels
+ },
+ options: chartOptions
+ });
+ }
+
+ var prevCalls = -1;
+ var prevHits = -1;
+
+ return {
+ chartDatasets: {
+ memcachedSize: [{
+ label: 'MB',
+ dataColumn: 'memcached_size_mb',
+ backgroundColor: '#0073aa'
+ }],
+ memcachedHit: [{
+ label: 'Calls',
+ dataColumn: 'memcached_requests_total',
+ backgroundColor: '#0073aa'
+ }, {
+ label: 'Hits',
+ dataColumn: 'memcached_requests_hits',
+ backgroundColor: 'green'
+ }
+ ]
+ },
+ preprocess: function(historyItem) {
+ var size = 0;
+ var calls = 0;
+ var hits = 0;
+ if (historyItem.memcached && historyItem.memcached.size_used) {
+ size = (historyItem.memcached.size_used / 1024.0 / 1024.0).toFixed(2);
+ if (prevCalls >= 0 && historyItem.memcached.get_calls >= prevCalls) {
+ calls = historyItem.memcached.get_calls - prevCalls;
+ hits = historyItem.memcached.get_hits - prevHits;
+ }
+
+ if (calls > 10000) {
+ calls = 0;
+ hits = 0;
+ }
+ prevCalls = historyItem.memcached.get_calls;
+ prevHits = historyItem.memcached.get_hits;
+ }
+
+ historyItem.memcached_size_mb = size;
+ historyItem.memcached_requests_total = calls;
+ historyItem.memcached_requests_hits = hits;
+ }
+ };
+ }
+
+
+
+ //
+ // Redis chart
+ //
+ function setChartsRedis(data) {
+ if (!charts['redisSize']) {
+ var ctx = $('#w3tcus_redis_size_chart');
+ charts['redisSize'] = new Chart(ctx, {
+ type: 'bar',
+ data: {
+ labels: chartDateLabels
+ },
+ options: chartOptions
+ });
+ }
+
+ if (!charts['redisHit']) {
+ var ctx = $('#w3tcus_redis_hit_chart');
+ charts['redisHit'] = new Chart(ctx, {
+ type: 'bar',
+ data: {
+ labels: chartDateLabels
+ },
+ options: chartOptions
+ });
+ }
+
+ var prevCalls = -1;
+ var prevHits = -1;
+
+ return {
+ chartDatasets: {
+ redisSize: [{
+ label: 'MB',
+ dataColumn: 'redis_size_mb',
+ backgroundColor: '#0073aa'
+ }],
+ redisHit: [{
+ label: 'Calls',
+ dataColumn: 'redis_requests_total',
+ backgroundColor: '#0073aa'
+ }, {
+ label: 'Hits',
+ dataColumn: 'redis_requests_hits',
+ backgroundColor: 'green'
+ }
+ ]
+ },
+ preprocess: function(historyItem) {
+ var size = 0;
+ var calls = 0;
+ var hits = 0;
+ if (historyItem.redis && historyItem.redis.size_used) {
+ size = (historyItem.redis.size_used / 1024.0 / 1024.0).toFixed(2);
+ if (prevCalls >= 0 && historyItem.redis.get_calls >= prevCalls) {
+ calls = historyItem.redis.get_calls - prevCalls;
+ hits = historyItem.redis.get_hits - prevHits;
+ }
+
+ if (calls > 10000) {
+ calls = 0;
+ hits = 0;
+ }
+ prevCalls = historyItem.redis.get_calls;
+ prevHits = historyItem.redis.get_hits;
+ }
+
+ historyItem.redis_size_mb = size;
+ historyItem.redis_requests_total = calls;
+ historyItem.redis_requests_hits = hits;
+ }
+ };
+ }
+
+
+
+ //
+ // APC chart
+ //
+ function setChartsApc(data) {
+ if (!charts['apcSize']) {
+ var ctx = $('#w3tcus_apc_size_chart');
+ charts['apcSize'] = new Chart(ctx, {
+ type: 'bar',
+ data: {
+ labels: chartDateLabels
+ },
+ options: chartOptions
+ });
+ }
+
+ if (!charts['apcHit']) {
+ var ctx = $('#w3tcus_apc_hit_chart');
+ charts['apcHit'] = new Chart(ctx, {
+ type: 'bar',
+ data: {
+ labels: chartDateLabels
+ },
+ options: chartOptions
+ });
+ }
+
+ var prevCalls = -1;
+ var prevHits = -1;
+
+ return {
+ chartDatasets: {
+ apcSize: [{
+ label: 'MB',
+ dataColumn: 'apc_size_mb',
+ backgroundColor: '#0073aa'
+ }],
+ apcHit: [{
+ label: 'Calls',
+ dataColumn: 'apc_requests_total',
+ backgroundColor: '#0073aa'
+ }, {
+ label: 'Hits',
+ dataColumn: 'apc_requests_hits',
+ backgroundColor: 'green'
+ }
+ ]
+ },
+ preprocess: function(historyItem) {
+ var size = 0;
+ var calls = 0;
+ var hits = 0;
+ if (historyItem.apc && historyItem.apc.size_used) {
+ size = (historyItem.apc.size_used / 1024.0 / 1024.0).toFixed(2);
+ if (prevCalls >= 0 && historyItem.apc.get_total >= prevCalls) {
+ calls = historyItem.apc.get_total - prevCalls;
+ hits = historyItem.apc.get_hits - prevHits;
+ }
+
+ if (calls > 10000) {
+ calls = 0;
+ hits = 0;
+ }
+ prevCalls = historyItem.apc.get_total;
+ prevHits = historyItem.apc.get_hits;
+ }
+
+ historyItem.apc_size_mb = size;
+ historyItem.apc_requests_total = calls;
+ historyItem.apc_requests_hits = hits;
+ }
+ };
+ }
+
+
+
+ //
+ // Utils
+ //
+ function startsWith(s, prefix) {
+ return s && s.substr(0, prefix.length) == prefix;
+ }
+
+
+
+ function dateFormat(d) {
+ return ("0" + d.getUTCHours()).slice(-2) + ":" +
+ ("0" + d.getUTCMinutes()).slice(-2);
+ }
+
+
+
+ function setValues(data, css_class_prefix) {
+ for (p in data) {
+ var v = data[p];
+ if (typeof(v) != 'string' && typeof(v) != 'number')
+ setValues(v, css_class_prefix + p + '_');
+ else {
+ jQuery('.' + css_class_prefix + p + ' span').html(v);
+ if (jQuery('.' + css_class_prefix + p).hasClass('w3tcus_inline')) {
+ jQuery('.' + css_class_prefix + p).css('display', 'inline');
+ } else {
+ jQuery('.' + css_class_prefix + p).css('display', 'block');
+ }
+ }
+ }
+ }
+
+
+
+ var seconds_timer_id;
+ function setRefresh(new_seconds_till_refresh) {
+ clearTimeout(seconds_timer_id);
+ var seconds_till_refresh = new_seconds_till_refresh;
+
+ seconds_timer_id = setInterval(function() {
+ seconds_till_refresh--;
+ if (seconds_till_refresh <= 0) {
+ clearTimeout(seconds_timer_id);
+ seconds_timer_id = null;
+ load();
+ return;
+ }
+
+ jQuery('.ustats_reload').text('Will be recalculated in ' +
+ seconds_till_refresh + ' second' +
+ (seconds_till_refresh > 1 ? 's' : ''));
+ }, 1000);
+ }
+
+
+
+ function showMetaboxes() {
+ jQuery('.metabox-holder').each(function() {
+ var visible = false;
+ jQuery(this).find('.ustats_block').each(function() {
+ visible |= jQuery(this).css('display') != 'none';
+ });
+
+ jQuery(this).css('display', (visible ? '' : 'none'));
+ });
+ }
+
+
+ //
+ // Main entry
+ //
+ load();
+
+ $('.ustats_reload').click(function(e) {
+ event.preventDefault();
+ load();
+ })
+});
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_View.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_View.php
new file mode 100644
index 00000000..51b75f1d
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_View.php
@@ -0,0 +1,490 @@
+
+
+
+
+
+
+ .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_View_Ad.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_View_Ad.php
new file mode 100644
index 00000000..9b521137
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_View_Ad.php
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_View_Disabled.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_View_Disabled.php
new file mode 100644
index 00000000..0531bb06
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_View_Disabled.php
@@ -0,0 +1,21 @@
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_View_Free.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_View_Free.php
new file mode 100644
index 00000000..d28b52bd
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_View_Free.php
@@ -0,0 +1,21 @@
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_View_NoDebugMode.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_View_NoDebugMode.php
new file mode 100644
index 00000000..daae0be9
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Page_View_NoDebugMode.php
@@ -0,0 +1,20 @@
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Plugin.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Plugin.php
new file mode 100644
index 00000000..0e492b70
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Plugin.php
@@ -0,0 +1,50 @@
+add_shutdown_handler();
+
+ // usage default statistics handling
+ add_action( 'w3tc_usage_statistics_of_request', array(
+ $this, 'w3tc_usage_statistics_of_request' ), 10, 1 );
+ add_filter( 'w3tc_usage_statistics_metrics', array(
+ $this, 'w3tc_usage_statistics_metrics' ) );
+ add_filter( 'w3tc_usage_statistics_metric_values', array(
+ '\W3TC\UsageStatistics_Sources',
+ 'w3tc_usage_statistics_metric_values' ) );
+ add_filter( 'w3tc_usage_statistics_history_set', array(
+ '\W3TC\UsageStatistics_Sources',
+ 'w3tc_usage_statistics_history_set' ) );
+
+ UsageStatistics_Source_Wpdb::init();
+ }
+
+
+
+ public function w3tc_usage_statistics_of_request( $storage ) {
+ $used_100kb = memory_get_peak_usage( true ) / 1024 / 10.24;
+
+ $storage->counter_add( 'php_memory_100kb', $used_100kb );
+ $storage->counter_add( 'php_requests', 1 );
+
+/* keep for mode when pagecache not enabled, otherwise it shows own stats similar to that
+ if ( defined( 'WP_ADMIN' ) ) {
+ $storage->counter_add( 'php_requests_wp_admin', 1 );
+ }
+ if ( defined( 'DOING_AJAX' ) ) {
+ $storage->counter_add( 'php_requests_ajax', 1 );
+ }
+*/
+ }
+
+
+
+ public function w3tc_usage_statistics_metrics( $metrics ) {
+ return array_merge( $metrics, array(
+ 'php_memory_100kb', 'php_requests' ) );
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Plugin_Admin.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Plugin_Admin.php
new file mode 100644
index 00000000..f606b921
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Plugin_Admin.php
@@ -0,0 +1,118 @@
+get( 'stats.slot_seconds' ) !=
+ $old_config->get( 'stats.slot_seconds' ) ) {
+ // flush all stats otherwise will be inconsistent
+ $storage = new UsageStatistics_StorageWriter();
+ $storage->reset();
+ }
+ }
+
+ public function w3tc_notes( $notes ) {
+ $c = Dispatcher::config();
+ $state_master = Dispatcher::config_state_master();
+
+ if ( $c->get_boolean( 'stats.enabled' ) &&
+ !$state_master->get_boolean( 'common.hide_note_stats_enabled' ) ) {
+ $notes['stats_enabled'] = sprintf(
+ __( 'W3 Total Cache: Statistics collection is currently enabled. This consumes additional resources, and is not recommended to be run continuously. %s %s',
+ 'w3-total-cache' ),
+ Util_Ui::button_link(
+ __( 'Disable statistics', 'w3-total-cache' ),
+ Util_Ui::url( array( 'w3tc_ustats_note_disable' => 'y' ) ),
+ false, 'button',
+ 'w3tc_note_stats_disable' ),
+ Util_Ui::button_hide_note2( array(
+ 'w3tc_default_config_state_master' => 'y',
+ 'key' => 'common.hide_note_stats_enabled',
+ 'value' => 'true' ) ) );
+ }
+
+ return $notes;
+ }
+
+
+
+ public function w3tc_admin_menu( $menu ) {
+ $menu['w3tc_stats'] = array(
+ 'page_title' => __( 'Statistics', 'w3-total-cache' ),
+ 'menu_text' => __( 'Statistics', 'w3-total-cache' ),
+ 'visible_always' => false,
+ 'order' => 2250
+ );
+
+ return $menu;
+ }
+
+
+
+ public function w3tc_ajax_ustats_get() {
+ $storage = new UsageStatistics_StorageReader();
+ $summary = $storage->get_history_summary();
+
+ if ( defined( 'W3TC_DEBUG' ) ) {
+ echo json_encode( $summary ,JSON_PRETTY_PRINT );
+ exit();
+ }
+
+ echo json_encode( $summary );
+ exit();
+ }
+
+ /**
+ * Ajax: Test access log path.
+ */
+ public function w3tc_ajax_ustats_access_log_test() {
+ $nonce_val = Util_Request::get_array( '_wpnonce' )[0];
+ $nonce = isset( $nonce_val ) ? $nonce_val : false;
+
+ if ( ! wp_verify_nonce( $nonce, 'w3tc' ) ) {
+ wp_die( esc_html__( 'Invalid WordPress nonce. Please reload the page and try again.', 'w3-total-cache' ) );
+ }
+
+ $handle = false;
+ $filename_val = Util_Request::get_string( 'filename' );
+ $filepath = ! empty( $filename_val ) ? str_replace( '://', '/', $filename_val ) : null;
+
+ if ( $filepath ) {
+ $handle = @fopen( $filepath, 'rb' ); // phpcs:ignore WordPress
+ }
+
+ if ( $handle ) {
+ esc_html_e( 'Success', 'w3-total-cache' );
+ } else {
+ esc_html_e( 'Failed to open file', 'w3-total-cache' );
+ }
+
+ wp_die();
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Source_AccessLog.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Source_AccessLog.php
new file mode 100644
index 00000000..bb9aaad9
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Source_AccessLog.php
@@ -0,0 +1,382 @@
+ $dynamic_requests_total,
+ 'dynamic_requests_total' => Util_UsageStatistics::integer(
+ $dynamic_requests_total ),
+ 'dynamic_requests_per_second' => Util_UsageStatistics::value_per_period_seconds(
+ $dynamic_requests_total, $summary ),
+ 'dynamic_requests_timing' => Util_UsageStatistics::integer_divideby(
+ $dynamic_timetaken_ms_total, $dynamic_requests_total ),
+ 'static_requests_total' => Util_UsageStatistics::integer(
+ $static_requests_total ),
+ 'static_requests_per_second' => Util_UsageStatistics::value_per_period_seconds(
+ $static_requests_total, $summary ),
+ 'static_requests_timing' => Util_UsageStatistics::integer_divideby(
+ $static_timetaken_ms_total, $static_requests_total ),
+ );
+
+ return $summary;
+ }
+
+
+
+ /**
+ * array( 'webserver', 'format', 'filename' )
+ */
+ public function __construct( $data ) {
+ $format = $data['format'];
+ $webserver = $data['webserver'];
+ $this->accesslog_filename = str_replace( '://', '/', $data['filename'] );
+
+ if ( $webserver == 'nginx' ) {
+ $line_regexp = $this->logformat_to_regexp_nginx( $format );
+ } else {
+ $line_regexp = $this->logformat_to_regexp_apache( $format );
+ }
+
+ $this->line_regexp = apply_filters( 'w3tc_ustats_access_log_format_regexp',
+ $line_regexp );
+ }
+
+
+
+ public function w3tc_usage_statistics_history_set( $history ) {
+ $this->max_already_counted_timestamp = (int)get_site_option( 'w3tc_stats_history_access_log' );
+ if ( isset( $history[0]['timestamp_start'] ) &&
+ $history[0]['timestamp_start'] > $this->max_already_counted_timestamp ) {
+ $this->max_already_counted_timestamp = $history[0]['timestamp_start'] - 1;
+ }
+
+ $this->history = $history;
+ $this->min_time = time();
+ $this->setup_history_item( count( $history ) - 1 );
+
+ $h = @fopen( $this->accesslog_filename, 'rb' );
+ if ( !$h ) {
+ error_log( 'Failed to open access log for usage statisics collection' );
+ return $history;
+ }
+
+ fseek( $h, 0, SEEK_END );
+ $pos = ftell( $h );
+ $unparsed_head = '';
+
+ while ( $pos >= 0 && $this->more_log_needed ) {
+ $pos -= 8192;
+ if ( $pos <= 0 ) {
+ $pos = 0;
+ }
+ fseek( $h, $pos );
+
+ $s = fread( $h, 8192 );
+
+ $unparsed_head = $this->parse_string( $s . $unparsed_head, $pos > 0 );
+ if ( $pos <= 0 ) {
+ $this->more_log_needed = false;
+ }
+ }
+
+ if ( defined( 'W3TC_DEBUG' ) && W3TC_DEBUG ) {
+ Util_Debug::log( 'time',
+ "period " .
+ date( DATE_ATOM, $this->max_already_counted_timestamp ) . ' - ' .
+ date( DATE_ATOM, $this->max_now_counted_timestamp ) . "\n" .
+ "min line: " . $this->min_line . "\n" .
+ "max line: " . $this->max_line );
+ }
+
+ if ( !is_null( $this->max_now_counted_timestamp ) ) {
+ update_site_option( 'w3tc_stats_history_access_log',
+ $this->max_now_counted_timestamp );
+ }
+
+ return $this->history;
+ }
+
+
+
+ private function setup_history_item( $pos ) {
+ $this->history_current_pos = $pos;
+
+ if ( !isset( $this->history[$pos]['access_log'] ) ) {
+ $this->history[$pos]['access_log'] = array(
+ 'dynamic_count' => 0,
+ 'dynamic_timetaken_ms' => 0,
+ 'static_count' => 0,
+ 'static_timetaken_ms' => 0,
+ );
+ }
+
+ $this->history_current_item = &$this->history[$pos]['access_log'];
+ $this->history_current_timestamp_start = $this->history[$pos]['timestamp_start'];
+ $this->history_current_timestamp_end = $this->history[$pos]['timestamp_end'];
+ }
+
+
+
+ private function parse_string( $s, $skip_first_line ) {
+ $s_length = strlen( $s );
+ $unparsed_head = '';
+ $lines = array();
+
+ $n = 0;
+ if ( $skip_first_line ) {
+ for ( ; $n < $s_length; $n++ ) {
+ $c = substr( $s, $n, 1 );
+ if ( $c == "\r" || $c == "\n" ) {
+ $unparsed_head = substr( $s, 0, $n + 1 );
+ break;
+ }
+ }
+ }
+
+ $line_start = $n;
+ $line_elements = array();
+ $line_element_start = $n;
+
+ for ( ; $n < $s_length; $n++ ) {
+ $c = substr( $s, $n, 1 );
+ if ( $c == "\r" || $c == "\n" ) {
+ if ( $n > $line_start ) {
+ $lines[] = substr( $s, $line_start, $n - $line_start );
+ }
+
+ $line_start = $n + 1;
+ }
+ }
+
+ // last line comes first, boundary checks logic based on that
+ for ( $n = count( $lines ) - 1; $n >= 0; $n-- ) {
+ $this->push_line( $lines[$n] );
+ }
+
+ return $unparsed_head;
+ }
+
+
+
+ private function push_line( $line ) {
+ $e = array();
+ preg_match( $this->line_regexp, $line, $e );
+
+ $e = apply_filters( 'w3tc_ustats_access_log_line_elements', $e, $line );
+ if ( !isset( $e['request_line'] ) || !isset( $e['date'] ) ) {
+ if ( defined( 'W3TC_DEBUG' ) && W3TC_DEBUG ) {
+ Util_Debug::log( 'time',
+ "line $line cant be parsed using regexp $this->line_regexp, request_line or date elements missing"
+ );
+ }
+ return;
+ }
+
+ $date_string = $e['date'];
+ $time = strtotime($date_string);
+
+ // dont read more if we touched entries before timeperiod of collection
+ if ( $time <= $this->max_already_counted_timestamp ) {
+ $this->more_log_needed = false;
+ return;
+ }
+ if ( $time > $this->history_current_timestamp_end ) {
+ return;
+ }
+ while ( $time < $this->history_current_timestamp_start ) {
+ if ( $this->history_current_pos <= 0 ) {
+ $this->more_log_needed = false;
+ return;
+ }
+ $this->setup_history_item( $this->history_current_pos - 1 );
+ }
+ if ( is_null( $this->max_now_counted_timestamp ) ) {
+ $this->max_now_counted_timestamp = $time;
+ }
+
+ if ( defined( 'W3TC_DEBUG' ) && W3TC_DEBUG ) {
+ if ($time < $this->min_time) {
+ $this->min_line = $line;
+ $this->min_time = $time;
+ }
+ if ($time > $this->max_time) {
+ $this->max_line = $line;
+ $this->max_time = $time;
+ }
+ }
+
+ $http_request_line = $e['request_line'];
+ $http_request_line_items = explode( ' ', $http_request_line );
+ $uri = $http_request_line_items[1];
+
+ $time_ms = 0;
+ if ( isset( $e['time_taken_microsecs'] ) ) {
+ $time_ms = (int)($e['time_taken_microsecs'] / 1000);
+ } elseif ( isset( $e['time_taken_ms'] ) ) {
+ $time_ms = (int)$e['time_taken_ms'];
+ }
+
+ $m = null;
+ preg_match('~\\.([a-zA-Z0-9]+)(\?.+)?$~', $uri, $m );
+ if ( $m && $m[1] != 'php') {
+ $this->history_current_item['static_count']++;
+ $this->history_current_item['static_timetaken_ms'] += $time_ms;
+ } else {
+ $this->history_current_item['dynamic_count']++;
+ $this->history_current_item['dynamic_timetaken_ms'] += $time_ms;
+ }
+ }
+
+
+
+ // default: %h %l %u %t \"%r\" %>s %b
+ // common : %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"
+ public function logformat_to_regexp_apache( $format ) {
+ // remove modifiers like %>s, %!400,501{User-agent}i
+ $format = preg_replace('~%[<>!0-9]([a-zA-Z{])~', '%$1', $format);
+
+ // remove modifiers %{User-agent}^ti, %{User-agent}^to
+ $format = preg_replace('~%({[^}]+})(^ti|^to)~', '%$1z', $format);
+
+ // take all quoted vars
+ $format = preg_replace_callback('~\\\"(%[a-zA-Z%]|%{[^}]+}[a-zA-Z])\\\"~',
+ array( $this, 'logformat_to_regexp_apache_element_quoted' ),
+ $format);
+
+ // take all remaining vars
+ $format = preg_replace_callback('~(%[a-zA-Z%]|%{[^}]+}[a-zA-Z])~',
+ array( $this, 'logformat_to_regexp_apache_element_naked' ),
+ $format);
+
+ return '~' . $format . '~';
+ }
+
+
+
+ public function logformat_to_regexp_apache_element_quoted( $match ) {
+ $v = $match[1];
+
+ if ( $v == '%r' ) {
+ return '\"(?[^"]+)\"';
+ }
+
+ // default behavior, expected value doesnt contain spaces
+ return '\"([^"]+)\"';
+ }
+
+
+
+ public function logformat_to_regexp_apache_element_naked( $match ) {
+ $v = $match[1];
+
+ if ( $v == '%t' ) {
+ return '\[(?[^\]]+)\]';
+ } elseif ( $v == '%D' ) {
+ return '(?[0-9]+)';
+ }
+
+ // default behavior, expected value doesnt contain spaces
+ return '([^ ]+)';
+ }
+
+
+
+ // default: $remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"
+ // w3tc: $remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_time
+ public function logformat_to_regexp_nginx( $format ) {
+ // escape quotes
+ $format = preg_replace_callback('~([\"\[\]])~',
+ array( $this, 'logformat_to_regexp_nginx_quote' ),
+ $format);
+
+ // take all quoted vars
+ $format = preg_replace_callback('~\\\"(\$[a-zA-Z0-9_]+)\\\"~',
+ array( $this, 'logformat_to_regexp_nginx_element_quoted' ),
+ $format);
+
+ // take all remaining vars
+ $format = preg_replace_callback('~(\$[a-zA-Z0-9_]+)~',
+ array( $this, 'logformat_to_regexp_nginx_element_naked' ),
+ $format);
+
+ return '~' . $format . '~';
+ }
+
+
+
+ public function logformat_to_regexp_nginx_quote( $match ) {
+ return '\\' . $match[1];
+ }
+
+
+
+ public function logformat_to_regexp_nginx_element_quoted( $match ) {
+ $v = $match[1];
+
+ if ( $v == '$request' ) {
+ return '\"(?[^"]+)\"';
+ }
+
+ // default behavior, expected value doesnt contain spaces
+ return '\"([^"]+)\"';
+ }
+
+
+
+ public function logformat_to_regexp_nginx_element_naked( $match ) {
+ $v = $match[1];
+
+ if ( $v == '$time_local' ) {
+ return '(?[^\]]+)';
+ } elseif ( $v == '$request_time' ) {
+ return '(?[0-9.]+)';
+ }
+
+ // default behavior, expected value doesnt contain spaces
+ return '([^ ]+)';
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Source_DbQueriesLog.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Source_DbQueriesLog.php
new file mode 100644
index 00000000..7c31cc64
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Source_DbQueriesLog.php
@@ -0,0 +1,153 @@
+timestamp_start = $timestamp_start;
+ $this->sort_column = $sort_column;
+ }
+
+ /**
+ * Lists entries from log
+ **/
+ public function list_entries() {
+ $log_filename = Util_Debug::log_filename( 'dbcache-queries' );
+ $h = @fopen( $log_filename, 'rb' );
+ if ( !$h ) {
+ throw new \Exception( 'Failed to open log file' . $log_filename );
+ }
+
+ fseek( $h, 0, SEEK_END );
+ $pos = ftell( $h );
+ $unparsed_head = '';
+
+ while ( $pos >= 0 && $this->more_log_needed ) {
+ $pos -= 8192;
+ if ( $pos <= 0 ) {
+ $pos = 0;
+ }
+ fseek( $h, $pos );
+
+ $s = fread( $h, 8192 );
+
+ $unparsed_head = $this->parse_string( $s . $unparsed_head, $pos > 0 );
+ if ( $pos <= 0 ) {
+ $this->more_log_needed = false;
+ }
+ }
+
+ $output = array();
+ foreach ( $this->by_query as $query => $data ) {
+ $output[] = array(
+ 'query' => $query,
+ 'count_total' => $data['count_total'],
+ 'count_hit' => $data['count_hit'],
+ 'avg_size' => (int)( $data['sum_size'] / $data['count_total'] ),
+ 'avg_time_ms' => (int)( $data['sum_time_ms'] / $data['count_total'] ),
+ 'sum_time_ms' => (int)$data['sum_time_ms'],
+ 'reasons' => $data['reasons']
+ );
+ }
+
+ usort( $output, function($a, $b) {
+ return (int)($b[$this->sort_column]) - (int)($a[$this->sort_column]);
+ });
+
+ $output = array_slice( $output, 0, 200 );
+
+ return $output;
+ }
+
+
+
+ private function parse_string( $s, $skip_first_line ) {
+ $s_length = strlen( $s );
+ $unparsed_head = '';
+
+ $n = 0;
+ if ( $skip_first_line ) {
+ for ( ; $n < $s_length; $n++ ) {
+ $c = substr( $s, $n, 1 );
+ if ( $c == "\r" || $c == "\n" ) {
+ $unparsed_head = substr( $s, 0, $n + 1 );
+ break;
+ }
+ }
+ }
+
+ $line_start = $n;
+ for ( ; $n < $s_length; $n++ ) {
+ $c = substr( $s, $n, 1 );
+ if ( $c == "\r" || $c == "\n" ) {
+ if ( $n > $line_start ) {
+ $this->push_line( substr( $s, $line_start, $n - $line_start ) );
+ }
+
+ $line_start = $n + 1;
+ }
+ }
+
+ return $unparsed_head;
+ }
+
+
+
+ private function push_line( $line ) {
+ $matches = str_getcsv( $line, "\t" );
+
+ if ( !$matches ) {
+ return;
+ }
+
+ $date_string = $matches[0];
+ $query = $matches[2];
+ $time_taken_ms = isset( $matches[3] ) ? (float)$matches[3] / 1000 : 0;
+ $reason = isset( $matches[4] ) ? $matches[4] : '';
+ $hit = isset( $matches[5] ) ? $matches[5] : false;
+ $size = isset( $matches[6] ) ? $matches[6] : 0;
+
+ $time = strtotime($date_string);
+
+ // dont read more if we touched entries before timeperiod of collection
+ if ( $time < $this->timestamp_start ) {
+ $this->more_log_needed = false;
+ }
+
+ if ( !isset( $this->by_query[$query] ) ) {
+ $this->by_query[$query] = array(
+ 'count_total' => 0,
+ 'count_hit' => 0,
+ 'sum_size' => 0,
+ 'sum_time_ms' => 0,
+ 'reasons' => array()
+ );
+ }
+
+ $this->by_query[$query]['count_total']++;
+ if ($hit) {
+ $this->by_query[$query]['count_hit']++;
+ }
+ $this->by_query[$query]['sum_size'] += $size;
+ $this->by_query[$query]['sum_time_ms'] += $time_taken_ms;
+
+ if ( !in_array( $reason, $this->by_query[$query]['reasons']) ) {
+ $this->by_query[$query]['reasons'][] = $reason;
+ }
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Source_ObjectCacheLog.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Source_ObjectCacheLog.php
new file mode 100644
index 00000000..4a4d46b3
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Source_ObjectCacheLog.php
@@ -0,0 +1,164 @@
+timestamp_start = $timestamp_start;
+ $this->sort_column = $sort_column;
+ }
+
+ /**
+ * Lists entries from log
+ **/
+ public function list_entries() {
+ $log_filename = Util_Debug::log_filename( 'objectcache-calls' );
+ $h = @fopen( $log_filename, 'rb' );
+ if ( !$h ) {
+ throw new \Exception( 'Failed to open log file' . $log_filename );
+ }
+
+ fseek( $h, 0, SEEK_END );
+ $pos = ftell( $h );
+ $unparsed_head = '';
+
+ while ( $pos >= 0 && $this->more_log_needed ) {
+ $pos -= 8192;
+ if ( $pos <= 0 ) {
+ $pos = 0;
+ }
+ fseek( $h, $pos );
+
+ $s = fread( $h, 8192 );
+
+ $unparsed_head = $this->parse_string( $s . $unparsed_head, $pos > 0 );
+ if ( $pos <= 0 ) {
+ $this->more_log_needed = false;
+ }
+ }
+
+ $output = array();
+ foreach ( $this->by_group as $group => $data ) {
+ $output[] = array(
+ 'group' => $group,
+ 'count_total' => $data['count_total'],
+ 'count_get_total' => $data['count_get_total'],
+ 'count_get_hit' => $data['count_get_hit'],
+ 'count_set' => $data['count_set'],
+ 'sum_size' => $data['sum_size'],
+ 'avg_size' => $data['count_total'] ? (int)( $data['sum_size'] / $data['count_total'] ) : 0,
+ 'sum_time_ms' => (int)$data['sum_time_ms']
+ );
+ }
+
+ usort( $output, function($a, $b) {
+ return (int)($b[$this->sort_column]) - (int)($a[$this->sort_column]);
+ });
+
+ $output = array_slice( $output, 0, 200 );
+
+ return $output;
+ }
+
+
+
+ private function parse_string( $s, $skip_first_line ) {
+ $s_length = strlen( $s );
+ $unparsed_head = '';
+
+ $n = 0;
+ if ( $skip_first_line ) {
+ for ( ; $n < $s_length; $n++ ) {
+ $c = substr( $s, $n, 1 );
+ if ( $c == "\r" || $c == "\n" ) {
+ $unparsed_head = substr( $s, 0, $n + 1 );
+ break;
+ }
+ }
+ }
+
+ $line_start = $n;
+ for ( ; $n < $s_length; $n++ ) {
+ $c = substr( $s, $n, 1 );
+ if ( $c == "\r" || $c == "\n" ) {
+ if ( $n > $line_start ) {
+ $this->push_line( substr( $s, $line_start, $n - $line_start ) );
+ }
+
+ $line_start = $n + 1;
+ }
+ }
+
+ return $unparsed_head;
+ }
+
+
+
+ private function push_line( $line ) {
+ $matches = str_getcsv( $line, "\t" );
+
+ if ( !$matches ) {
+ return;
+ }
+
+ $date_string = $matches[0];
+ $op = $matches[1];
+ $group = $matches[2];
+ $id = $matches[3];
+ $reason = $matches[4];
+ $size = (int)$matches[5];
+ $time_taken_ms = isset( $matches[6] ) ? (float)$matches[6] / 1000 : 0;
+
+ $time = strtotime($date_string);
+
+ // dont read more if we touched entries before timeperiod of collection
+ if ( $time < $this->timestamp_start ) {
+ $this->more_log_needed = false;
+ }
+
+ if ( $reason == 'not tried cache' ||
+ substr( $reason, 0, 7 ) == 'not set' ) {
+ return; // it's not cache-related activity
+ }
+
+ if ( !isset( $this->by_group[$group] ) ) {
+ $this->by_group[$group] = array(
+ 'count_total' => 0,
+ 'count_get_total' => 0,
+ 'count_get_hit' => 0,
+ 'count_set' => 0,
+ 'sum_size' => 0,
+ 'sum_time_ms' => 0
+ );
+ }
+
+ if ( $op == 'get' ) {
+ $this->by_group[$group]['count_total']++;
+ $this->by_group[$group]['count_get_total']++;
+ if ($reason == 'from persistent cache') {
+ $this->by_group[$group]['count_get_hit']++;
+ }
+ } elseif ( $op == 'set' ) {
+ $this->by_group[$group]['count_total']++;
+ $this->by_group[$group]['count_set']++;
+ }
+
+ $this->by_group[$group]['sum_size'] += $size;
+ $this->by_group[$group]['sum_time_ms'] += $time_taken_ms;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Source_PageCacheLog.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Source_PageCacheLog.php
new file mode 100644
index 00000000..52651bf8
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Source_PageCacheLog.php
@@ -0,0 +1,154 @@
+timestamp_start = $timestamp_start;
+ $this->process_status = $process_status;
+ $this->sort_column = $sort_column;
+ }
+
+ /**
+ * Lists entries from log with specified cache reject reason code
+ **/
+ public function list_entries() {
+ $log_filename = Util_Debug::log_filename( 'pagecache' );
+ $h = @fopen( $log_filename, 'rb' );
+ if ( !$h ) {
+ throw new \Exception( 'Failed to open pagecache log file' . $log_filename );
+ }
+
+ fseek( $h, 0, SEEK_END );
+ $pos = ftell( $h );
+ $unparsed_head = '';
+
+ while ( $pos >= 0 && $this->more_log_needed ) {
+ $pos -= 8192;
+ if ( $pos <= 0 ) {
+ $pos = 0;
+ }
+ fseek( $h, $pos );
+
+ $s = fread( $h, 8192 );
+
+ $unparsed_head = $this->parse_string( $s . $unparsed_head, $pos > 0 );
+ if ( $pos <= 0 ) {
+ $this->more_log_needed = false;
+ }
+ }
+
+ $output = array();
+ foreach ( $this->by_uri as $uri => $data ) {
+ $output[] = array(
+ 'uri' => $uri,
+ 'count' => $data['count'],
+ 'avg_size' => (int)( $data['sum_size'] / $data['count'] ),
+ 'avg_time_ms' => (int)( $data['sum_time_ms'] / $data['count'] ),
+ 'sum_time_ms' => $data['sum_time_ms'],
+ 'reasons' => $data['reasons']
+ );
+ }
+
+ usort( $output, function($a, $b) {
+ return (int)($b[$this->sort_column]) - (int)($a[$this->sort_column]);
+ });
+
+ return $output;
+ }
+
+
+
+ private function parse_string( $s, $skip_first_line ) {
+ $s_length = strlen( $s );
+ $unparsed_head = '';
+
+ $n = 0;
+ if ( $skip_first_line ) {
+ for ( ; $n < $s_length; $n++ ) {
+ $c = substr( $s, $n, 1 );
+ if ( $c == "\r" || $c == "\n" ) {
+ $unparsed_head = substr( $s, 0, $n + 1 );
+ break;
+ }
+ }
+ }
+
+ $line_start = $n;
+ for ( ; $n < $s_length; $n++ ) {
+ $c = substr( $s, $n, 1 );
+ if ( $c == "\r" || $c == "\n" ) {
+ if ( $n > $line_start ) {
+ $this->push_line( substr( $s, $line_start, $n - $line_start ) );
+ }
+
+ $line_start = $n + 1;
+ }
+ }
+
+ return $unparsed_head;
+ }
+
+
+
+ private function push_line( $line ) {
+ $matches = null;
+ preg_match(
+ '/\[([^>\]]+)\] \[([^>\]]+)\] \[([^>\]]+)\] finished in (\d+) size (\d+) with process status ([^ ]+) reason (.*)/',
+ $line, $matches);
+
+ if ( !$matches ) {
+ return;
+ }
+
+ $date_string = $matches[1];
+ $uri = $matches[2];
+ $time_taken_ms = $matches[4];
+ $size = $matches[5];
+ $status = $matches[6];
+ $reason = $matches[7];
+ $time = strtotime($date_string);
+
+ // dont read more if we touched entries before timeperiod of collection
+ if ( $time < $this->timestamp_start ) {
+ $this->more_log_needed = false;
+ }
+
+ if ( $status != $this->process_status ) {
+ return;
+ }
+
+ if ( !isset( $this->by_uri[$uri] ) ) {
+ $this->by_uri[$uri] = array(
+ 'count' => 0,
+ 'sum_size' => 0,
+ 'sum_time_ms' => 0,
+ 'reasons' => array()
+ );
+ }
+
+ $this->by_uri[$uri]['count']++;
+ $this->by_uri[$uri]['sum_size'] += $size;
+ $this->by_uri[$uri]['sum_time_ms'] += $time_taken_ms;
+
+ if ( !in_array( $reason, $this->by_uri[$uri]['reasons']) ) {
+ $this->by_uri[$uri]['reasons'][] = $reason;
+ }
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Source_Wpdb.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Source_Wpdb.php
new file mode 100644
index 00000000..9b34d1e3
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Source_Wpdb.php
@@ -0,0 +1,61 @@
+ Util_UsageStatistics::integer(
+ $wpdb_calls_total ),
+ 'calls_per_second' => Util_UsageStatistics::value_per_period_seconds(
+ $wpdb_calls_total, $summary )
+ );
+
+ return $summary;
+ }
+
+
+
+ public function w3tc_usage_statistics_of_request( $storage ) {
+ $storage->counter_add( 'wpdb_calls_total', $this->query_total );
+ }
+
+
+
+ public function query( $q ) {
+ $this->query_total++;
+ return $q;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Sources.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Sources.php
new file mode 100644
index 00000000..134e1185
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Sources.php
@@ -0,0 +1,130 @@
+ 0 ) {
+ if ( !isset( $summary['php'] ) ) {
+ $summary['php'] = array();
+ }
+
+ $summary['php']['memory'] = Util_UsageStatistics::bytes_to_size(
+ $php_memory_100kb / $php_requests * 1024 * 10.24 );
+
+ $summary['php']['php_requests_v'] = $php_requests;
+ $summary['php']['php_requests'] =
+ Util_UsageStatistics::integer( $php_requests );
+ $summary['php']['php_requests_per_second'] =
+ Util_UsageStatistics::value_per_period_seconds( $php_requests,
+ $summary );
+ }
+
+ // apc
+ if ( count( $summary['apc_servers'] ) > 0 ) {
+ $apc = new UsageStatistics_Sources_Apc(
+ $summary['apc_servers'] );
+ $summary['apc'] = $apc->get_summary();
+ }
+
+ // memcached
+ if ( count( $summary['memcached_servers'] ) > 0 ) {
+ $memcached = new UsageStatistics_Sources_Memcached(
+ $summary['memcached_servers'] );
+ $summary['memcached'] = $memcached->get_summary();
+ }
+
+ // redis
+ if ( count( $summary['redis_servers'] ) > 0 ) {
+ $redis = new UsageStatistics_Sources_Redis(
+ $summary['redis_servers'] );
+ $summary['redis'] = $redis->get_summary();
+ }
+
+ // cpu snapshot
+ $c = Dispatcher::config();
+ if ( $c->get_boolean( 'stats.cpu.enabled' ) ) {
+ $summary['cpu'] = array(
+ 'avg' => round( Util_UsageStatistics::avg( $history, 'cpu' ), 2 )
+ );
+ }
+
+ // access log data
+ if ( $c->get_boolean( 'stats.access_log.enabled' ) ) {
+ $o = new UsageStatistics_Source_AccessLog( array(
+ 'webserver' => $c->get_string( 'stats.access_log.webserver' ),
+ 'filename' => $c->get_string( 'stats.access_log.filename' ),
+ 'format' => $c->get_string( 'stats.access_log.format' )
+ ) );
+
+ $summary = $o->w3tc_usage_statistics_summary_from_history(
+ $summary, $history );
+ }
+
+ return $summary;
+ }
+
+
+
+ static public function w3tc_usage_statistics_metric_values( $metric_values ) {
+ $sources = array(
+ 'memcached_servers' => array(),
+ 'redis_servers' => array(),
+ 'apc_servers' => array()
+ );
+
+ $sources = apply_filters( 'w3tc_usage_statistics_sources',
+ $sources );
+
+ if ( count( $sources['memcached_servers'] ) > 0 ) {
+ $memcached = new UsageStatistics_Sources_Memcached(
+ $sources['memcached_servers'] );
+ $metric_values['memcached'] = $memcached->get_snapshot();
+ }
+ if ( count( $sources['apc_servers'] ) > 0 ) {
+ $apc = new UsageStatistics_Sources_Apc(
+ $sources['apc_servers']
+ );
+ $metric_values['apc'] = $apc->get_snapshot();
+ }
+ if ( count( $sources['redis_servers'] ) > 0 ) {
+ $redis = new UsageStatistics_Sources_Redis(
+ $sources['redis_servers'] );
+ $metric_values['redis'] = $redis->get_snapshot();
+ }
+
+ $c = Dispatcher::config();
+ if ( $c->get_boolean( 'stats.cpu.enabled' ) ) {
+ // cpu snapshot
+ $cpu = sys_getloadavg();
+ if ( isset( $cpu[0] ) ) {
+ $metric_values['cpu'] = $cpu[0];
+ }
+ }
+
+ return $metric_values;
+ }
+
+
+
+ static public function w3tc_usage_statistics_history_set( $history ) {
+ $c = Dispatcher::config();
+ if ( $c->get_boolean( 'stats.access_log.enabled' ) ) {
+ // read access log
+ $o = new UsageStatistics_Source_AccessLog( array(
+ 'webserver' => $c->get_string( 'stats.access_log.webserver' ),
+ 'filename' => $c->get_string( 'stats.access_log.filename' ),
+ 'format' => $c->get_string( 'stats.access_log.format' )
+ ) );
+
+ $history = $o->w3tc_usage_statistics_history_set( $history );
+ }
+
+ return $history;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Sources_Apc.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Sources_Apc.php
new file mode 100644
index 00000000..286766c9
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Sources_Apc.php
@@ -0,0 +1,63 @@
+ $i ) {
+ $this->module_names[] = $i['name'];
+ }
+ }
+
+
+
+ public function get_snapshot() {
+ $cache = apcu_cache_info();
+
+ return array(
+ 'items' => $cache['num_entries'],
+ 'size_used' => $cache['mem_size'],
+ 'get_hits' => $cache['num_hits'],
+ 'get_total' => ( $cache['num_hits'] + $cache['num_misses'] )
+ );
+ }
+
+
+
+ public function get_summary() {
+ $cache = apcu_cache_info();
+
+ $time = time();
+ $runtime = $time - $cache['start_time'];
+
+ $mem = apcu_sma_info();
+ $mem_size = $mem['num_seg'] * $mem['seg_size'];
+ $mem_avail = $mem['avail_mem'];
+ $mem_used = $mem_size - $mem_avail;
+
+ $sum = array(
+ 'used_by' => implode( ',', $this->module_names ),
+ 'items' => $cache['num_entries'],
+ 'size_used' => Util_UsageStatistics::bytes_to_size( $cache['mem_size'] ),
+ 'get_hits' => $cache['num_hits'],
+ 'get_total' => ( $cache['num_hits'] + $cache['num_misses'] ),
+ 'runtime_secs' => $runtime,
+ 'evictions' => $cache['expunges'],
+ 'size_percent' => Util_UsageStatistics::percent(
+ $mem_used, $mem_avail )
+ );
+
+ if ( $sum['runtime_secs'] != 0 ) {
+ $sum['requests_per_second'] = sprintf( '%.2f',
+ $sum['get_total'] / $sum['runtime_secs'] );
+ }
+
+ $sum['get_hit_rate'] = Util_UsageStatistics::percent2(
+ $sum, 'get_hits', 'get_total' );
+
+ return $sum;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Sources_Memcached.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Sources_Memcached.php
new file mode 100644
index 00000000..2d8b751a
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Sources_Memcached.php
@@ -0,0 +1,104 @@
+servers = array();
+
+ foreach ( $server_descriptors as $i ) {
+ foreach ( $i['servers'] as $host_port ) {
+ if ( !isset( $this->servers[$host_port] ) )
+ $this->servers[$host_port] = array(
+ 'username' => $i['username'],
+ 'password' => $i['password'],
+ 'module_names' => array( $i['name'] )
+ );
+ else
+ $this->servers[$host_port]['module_names'][] = $i['name'];
+ }
+ }
+ }
+
+
+
+ public function get_snapshot() {
+ $size_used = 0;
+ $get_calls = 0;
+ $get_hits = 0;
+
+ foreach ( $this->servers as $host_port => $i ) {
+ $cache = Cache::instance( 'memcached',
+ array(
+ 'servers' => array( $host_port ),
+ 'username' => $i['username'],
+ 'password' => $i['password']
+ ) );
+
+ $stats = $cache->get_statistics();
+
+ $size_used += Util_UsageStatistics::v( $stats, 'bytes' );
+ $get_calls += Util_UsageStatistics::v( $stats, 'cmd_get' );
+ $get_hits += Util_UsageStatistics::v( $stats, 'get_hits' );
+ }
+
+ return array(
+ 'size_used' => $size_used,
+ 'get_calls' => $get_calls,
+ 'get_hits' => $get_hits
+ );
+ }
+
+
+
+ public function get_summary() {
+ $sum = array(
+ 'module_names' => array(),
+ 'size_used' => 0,
+ 'size_maxbytes' => 0,
+ 'get_total' => 0,
+ 'get_hits' => 0,
+ 'evictions' => 0,
+ 'uptime' => 0
+ );
+
+ foreach ( $this->servers as $host_port => $i ) {
+ $cache = Cache::instance( 'memcached',
+ array(
+ 'servers' => array( $host_port ),
+ 'username' => $i['username'],
+ 'password' => $i['password']
+ ) );
+
+ $stats = $cache->get_statistics();
+
+ $sum['module_names'] =
+ array_merge( $sum['module_names'], $i['module_names'] );
+ $sum['size_used'] += Util_UsageStatistics::v3( $stats, 'bytes');
+ $sum['size_maxbytes'] += Util_UsageStatistics::v3( $stats, 'limit_maxbytes' );
+ $sum['get_total'] += Util_UsageStatistics::v3( $stats, 'cmd_get' );
+ $sum['get_hits'] += Util_UsageStatistics::v3( $stats, 'get_hits' );
+ $sum['evictions'] += Util_UsageStatistics::v3( $stats, 'evictions' );
+ $sum['uptime'] += Util_UsageStatistics::v3( $stats, 'uptime' );
+ }
+
+ $summary = array(
+ 'module_names' => implode( ',', $sum['module_names'] ),
+ 'size_percent' => Util_UsageStatistics::percent2(
+ $sum, 'size_used', 'size_maxbytes' ),
+ 'size_used' => Util_UsageStatistics::bytes_to_size2(
+ $sum, 'size_used' ),
+ 'get_hit_rate' => Util_UsageStatistics::percent2(
+ $sum, 'get_hits', 'get_total' ),
+ 'evictions_per_second' => Util_UsageStatistics::value_per_second(
+ $sum, 'evictions', 'uptime' )
+ );
+
+ return $summary;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Sources_Redis.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Sources_Redis.php
new file mode 100644
index 00000000..0d00f484
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_Sources_Redis.php
@@ -0,0 +1,129 @@
+servers = array();
+
+ foreach ( $server_descriptors as $i ) {
+ foreach ( $i['servers'] as $host_port ) {
+ if ( ! isset( $this->servers[ $host_port ] ) ) {
+ $this->servers[ $host_port ] = array(
+ 'password' => $i['password'],
+ 'dbid' => $i['dbid'],
+ 'module_names' => array( $i['name'] ),
+ );
+ } else {
+ $this->servers[ $host_port ]['module_names'][] = $i['name'];
+ }
+ }
+ }
+ }
+
+ /**
+ * Get snapshot stats.
+ */
+ public function get_snapshot() {
+ $size_used = 0;
+ $get_calls = 0;
+ $get_hits = 0;
+
+ foreach ( $this->servers as $host_port => $i ) {
+ $cache = Cache::instance(
+ 'redis',
+ array(
+ 'servers' => array( $host_port ),
+ 'password' => $i['password'],
+ 'dbid' => $i['dbid'],
+ 'timeout' => 0,
+ 'retry_interval' => 0,
+ 'read_timeout' => 0,
+ )
+ );
+
+ $stats = $cache->get_statistics();
+
+ $size_used += Util_UsageStatistics::v( $stats, 'used_memory' );
+ $get_calls +=
+ Util_UsageStatistics::v3( $stats, 'keyspace_hits' ) +
+ Util_UsageStatistics::v3( $stats, 'keyspace_misses' );
+ $get_hits += Util_UsageStatistics::v( $stats, 'keyspace_hits' );
+ }
+
+ return array(
+ 'size_used' => $size_used,
+ 'get_calls' => $get_calls,
+ 'get_hits' => $get_hits,
+ );
+ }
+
+ /**
+ * Get stats summary.
+ */
+ public function get_summary() {
+ $sum = array(
+ 'module_names' => array(),
+ 'size_used' => 0,
+ 'size_maxbytes' => 0,
+ 'get_total' => 0,
+ 'get_hits' => 0,
+ 'evictions' => 0,
+ 'uptime' => 0,
+ );
+
+ foreach ( $this->servers as $host_port => $i ) {
+ $cache = Cache::instance(
+ 'redis',
+ array(
+ 'servers' => array( $host_port ),
+ 'password' => $i['password'],
+ 'dbid' => $i['dbid'],
+ 'timeout' => 0,
+ 'retry_interval' => 0,
+ 'read_timeout' => 0,
+ )
+ );
+
+ $stats = $cache->get_statistics();
+
+ $sum['module_names'] = array_merge( $sum['module_names'], $i['module_names'] );
+ $sum['size_used'] += Util_UsageStatistics::v3( $stats, 'used_memory' );
+ $sum['get_total'] +=
+ Util_UsageStatistics::v3( $stats, 'keyspace_hits' ) +
+ Util_UsageStatistics::v3( $stats, 'keyspace_misses' );
+ $sum['get_hits'] += Util_UsageStatistics::v3( $stats, 'keyspace_hits' );
+ $sum['evictions'] += Util_UsageStatistics::v3( $stats, 'evicted_keys' );
+ $sum['uptime'] += Util_UsageStatistics::v3( $stats, 'uptime_in_seconds' );
+ }
+
+ $summary = array(
+ 'module_names' => implode( ',', $sum['module_names'] ),
+ 'size_used' => Util_UsageStatistics::bytes_to_size2( $sum, 'size_used' ),
+ 'get_hit_rate' => Util_UsageStatistics::percent2( $sum, 'get_hits', 'get_total' ),
+ 'evictions_per_second' => Util_UsageStatistics::value_per_second( $sum, 'evictions', 'uptime' ),
+ );
+
+ return $summary;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_StorageReader.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_StorageReader.php
new file mode 100644
index 00000000..e9ce5258
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_StorageReader.php
@@ -0,0 +1,66 @@
+maybe_flush_hotspot_data();
+
+ $history_encoded = get_site_option( 'w3tc_stats_history' );
+ $history = null;
+ if ( !empty( $history_encoded ) )
+ $history = json_decode( $history_encoded, true );
+ if ( !is_array( $history ) )
+ $history = array();
+
+ $summary = array(
+ 'memcached_servers' => array(),
+ 'redis_servers' => array(),
+ 'apc_servers' => array()
+ );
+
+ $summary = apply_filters( 'w3tc_usage_statistics_sources', $summary );
+
+ if ( count( $history ) <= 0 ) {
+ $summary = array( 'period' => array() );
+ } else {
+ $timestamp_start = $history[0]['timestamp_start'];
+ $timestamp_end = $history[count( $history ) - 1]['timestamp_end'];
+
+ $period = array(
+ 'timestamp_start' => $timestamp_start,
+ 'timestamp_start_mins' =>
+ Util_UsageStatistics::time_mins( $timestamp_start ),
+ 'timestamp_end' => $timestamp_end,
+ 'timestamp_end_mins' =>
+ Util_UsageStatistics::time_mins( $timestamp_end ),
+ );
+
+ $period['seconds'] = $timestamp_end - $timestamp_start;
+ $summary['period'] = $period;
+ $summary['timeout_time'] = time() + 15;
+
+ $summary = apply_filters( 'w3tc_usage_statistics_summary_from_history',
+ $summary, $history );
+ }
+
+ $summary['period']['to_update_secs'] = (int)$w->get_hotspot_end() - time() + 1;
+
+ unset( $summary['memcached_servers'] );
+ unset( $summary['redis_servers'] );
+
+ while ( count($history) < $this->items_to_return ) {
+ array_unshift( $history, array() );
+ }
+
+ $summary['history'] = $history;
+ return $summary;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_StorageWriter.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_StorageWriter.php
new file mode 100644
index 00000000..6e248d50
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UsageStatistics_StorageWriter.php
@@ -0,0 +1,370 @@
+cache_storage = Dispatcher::get_usage_statistics_cache();
+
+ $c = Dispatcher::config();
+ $this->slot_interval_seconds = $c->get_integer( 'stats.slot_seconds' );
+
+ $this->keep_history_interval_seconds =
+ $c->get_integer( 'stats.slots_count' ) *
+ $this->slot_interval_seconds;
+ $this->slots_count = $c->get_integer( 'stats.slots_count' );
+ }
+
+
+
+ public function reset() {
+ if ( !is_null( $this->cache_storage ) ) {
+ $this->cache_storage->set( 'hotspot_endtime',
+ array( 'content' => 0 ) );
+ }
+
+ update_site_option( 'w3tc_stats_hotspot_start', time() );
+ update_site_option( 'w3tc_stats_history', '' );
+ }
+
+
+
+ public function counter_add( $metric, $value ) {
+ if ( !is_null( $this->cache_storage ) ) {
+ $this->cache_storage->counter_add( $metric, $value );
+ }
+ }
+
+
+
+ public function get_hotspot_end() {
+ if ( is_null( $this->hotspot_endtime ) ) {
+ $v = $this->cache_storage->get( 'hotspot_endtime' );
+ $this->hotspot_endtime = ( isset( $v['content'] ) ? $v['content'] : 0 );
+ }
+
+ return $this->hotspot_endtime;
+ }
+
+
+
+ private function get_option_storage() {
+ if ( is_multisite() )
+ return new _OptionStorageWpmu();
+ else
+ return new _OptionStorageSingleSite();
+ }
+
+
+ public function maybe_flush_hotspot_data() {
+ $result = $this->begin_flush_hotspot_data();
+ if ( $result == 'not_needed' )
+ return;
+
+ $this->finish_flush_hotspot_data();
+ }
+
+
+
+ /**
+ * Returns if finish_* should be called.
+ * It tries to pass as litte processes as possible to
+ * flushing_begin if multiple processes come here
+ * at the same time when hotspot time ended.
+ */
+ public function begin_flush_hotspot_data() {
+ $hotspot_endtime = $this->get_hotspot_end();
+ if ( is_null( $hotspot_endtime ) ) {
+ // if cache not recognized - means nothing is cached at all
+ // so stats not collected
+ return 'not_needed';
+ }
+
+ $hotspot_endtime_int = (int)$hotspot_endtime;
+ $this->now = time();
+
+ if ( $hotspot_endtime_int <= 0 ) {
+ $this->flush_state = 'require_db';
+ } elseif ( $this->now < $hotspot_endtime_int ) {
+ $this->flush_state = 'not_needed';
+ } else {
+ // rand value makes value unique for each process,
+ // so as a result next replace works as a lock
+ // passing only single process further
+ $this->new_hotspot_endtime = $this->now + $this->slot_interval_seconds +
+ ( rand( 1, 9999 ) / 10000.0 );
+
+ $succeeded = $this->cache_storage->set_if_maybe_equals( 'hotspot_endtime',
+ array( 'content' => $hotspot_endtime ),
+ array( 'content' => $this->new_hotspot_endtime ) );
+ $this->flush_state =
+ ( $succeeded ? 'flushing_began_by_cache' : 'not_needed' );
+ }
+
+ return $this->flush_state;
+ }
+
+
+
+ public function finish_flush_hotspot_data() {
+ $option_storage = $this->get_option_storage();
+
+ if ( $this->flush_state == 'not_needed' )
+ return;
+
+ if ( $this->flush_state != 'require_db' &&
+ $this->flush_state != 'flushing_began_by_cache' )
+ throw new Exception( 'unknown usage stats state ' . $this->flush_state );
+
+ // check whats there in db
+ $this->hotspot_endtime = $option_storage->get_hotspot_end();
+ $hotspot_endtime_int = (int)$this->hotspot_endtime;
+
+ if ( $this->now < $hotspot_endtime_int ) {
+ // update cache, since there is something old/missing in cache
+ $this->cache_storage->set( 'hotspot_endtime',
+ array( 'content' => $this->hotspot_endtime ) );
+ return; // not neeeded really, db state after
+ }
+ if ( $this->new_hotspot_endtime <= 0 )
+ $this->new_hotspot_endtime = $this->now +
+ $this->slot_interval_seconds +
+ ( rand( 1, 9999 ) / 10000.0 );
+
+ if ( $hotspot_endtime_int <= 0 ) {
+ // no data in options, initialization
+ $this->cache_storage->set( 'hotspot_endtime',
+ array( 'content' => $this->new_hotspot_endtime ) );
+ update_site_option( 'w3tc_stats_hotspot_start', time() );
+ $option_storage->set_hotspot_end( $this->new_hotspot_endtime );
+ return;
+ }
+
+ // try to become the process who makes flushing by
+ // performing atomic database update
+
+ // rand value makes value unique for each process,
+ // so as a result next replace works as a lock
+ // passing only single process further
+ $succeeded = $option_storage->prolong_hotspot_end(
+ $this->hotspot_endtime, $this->new_hotspot_endtime );
+ if ( !$succeeded )
+ return;
+
+ $this->cache_storage->set( 'hotspot_endtime',
+ array( 'content' => $this->new_hotspot_endtime ) );
+
+
+ // flush data
+ $metrics = array();
+ $metrics = apply_filters( 'w3tc_usage_statistics_metrics', $metrics );
+
+ $metric_values = array();
+ $metric_values['timestamp_start'] = get_site_option( 'w3tc_stats_hotspot_start' );
+ $metric_values['timestamp_end'] = $hotspot_endtime_int;
+
+ // try to limit time between get and reset of counter value
+ // to loose as small as posssible
+ foreach ( $metrics as $metric ) {
+ $metric_values[$metric] = $this->cache_storage->counter_get( $metric );
+ $this->cache_storage->counter_set( $metric, 0 );
+ }
+
+ $metric_values = apply_filters( 'w3tc_usage_statistics_metric_values',
+ $metric_values );
+
+ $history_encoded = get_site_option( 'w3tc_stats_history' );
+ $history = null;
+ if ( !empty( $history_encoded ) )
+ $history = json_decode( $history_encoded, true );
+ if ( !is_array( $history ) )
+ $history = array();
+
+ $time_keep_border = time() - $this->keep_history_interval_seconds;
+
+ if ( $hotspot_endtime_int < $time_keep_border )
+ $history = array(
+ array(
+ 'timestamp_start' => $time_keep_border,
+ 'timestamp_end' => (int)$this->new_hotspot_endtime -
+ $this->slot_interval_seconds - 1
+ )
+ ); // this was started too much time from now
+ else {
+ // add collected
+ $history[] = $metric_values;
+
+ // if we empty place later - fill it
+ for ( ;; ) {
+ $metric_values = array(
+ 'timestamp_start' => $metric_values['timestamp_end']
+ );
+ $metric_values['timestamp_end'] =
+ $metric_values['timestamp_start'] + $this->slot_interval_seconds;
+ if ( $metric_values['timestamp_end'] < $this->now )
+ $history[] = $metric_values;
+ else
+ break;
+ }
+
+ // make sure we have at least one value in history
+ for ( ;count( $history ) > $this->slots_count; ) {
+ if ( !isset( $history[0]['timestamp_end'] ) ||
+ $history[0]['timestamp_end'] < $time_keep_border )
+ array_shift( $history );
+ else
+ break;
+ }
+ }
+
+ $history = apply_filters(
+ 'w3tc_usage_statistics_history_set', $history );
+
+ update_site_option( 'w3tc_stats_hotspot_start', $this->now );
+ update_site_option( 'w3tc_stats_history', json_encode( $history ) );
+ }
+}
+
+
+
+/**
+ * Can update option by directly incrementing current value,
+ * not via get+set operation
+ */
+class _OptionStorageSingleSite {
+ private $option_hotspot_end = 'w3tc_stats_hotspot_end';
+
+
+
+ public function get_hotspot_end() {
+ global $wpdb;
+
+ $row = $wpdb->get_row( $wpdb->prepare(
+ 'SELECT option_value ' .
+ 'FROM ' . $wpdb->options . ' ' .
+ 'WHERE option_name = %s LIMIT 1',
+ $this->option_hotspot_end ) );
+
+ if ( !is_object( $row ) )
+ return false;
+
+ $v = $row->option_value;
+ return $v;
+ }
+
+
+
+ public function set_hotspot_end( $new_value ) {
+ update_site_option( $this->option_hotspot_end, $new_value );
+ }
+
+
+
+ /**
+ * Performs atomic update of option value
+ * from old to new value. Makes sure that only single process updates it.
+ * Only single process gets true return value when multiple tries to do that.
+ */
+ public function prolong_hotspot_end( $old_value, $new_value ) {
+ global $wpdb;
+
+ $q = $wpdb->prepare(
+ 'UPDATE ' . $wpdb->options . ' ' .
+ 'SET option_value = %s ' .
+ 'WHERE option_name = %s AND option_value = %s', $new_value,
+ $this->option_hotspot_end, $old_value );
+
+ $result = $wpdb->query( $q );
+ $succeeded = ( $result > 0 );
+
+ return $succeeded;
+ }
+}
+
+
+
+/**
+ * Can update option by directly incrementing current value,
+ * not via get+set operation
+ */
+class _OptionStorageWpmu {
+ private $option_hotspot_end = 'w3tc_stats_hotspot_end';
+
+
+
+ public function get_hotspot_end() {
+ global $wpdb;
+
+ $row = $wpdb->get_row( $wpdb->prepare(
+ 'SELECT meta_value ' .
+ 'FROM ' . $wpdb->sitemeta . ' ' .
+ 'WHERE site_id = %d AND meta_key = %s',
+ $wpdb->siteid, $this->option_hotspot_end ) );
+
+ if ( !is_object( $row ) )
+ return false;
+
+ $v = $row->meta_value;
+ return $v;
+ }
+
+ /**
+ * Performs atomic update of option value
+ * from old to new value. Makes sure that only single process updates it.
+ * Only single process gets true return value when multiple tries to do that.
+ */
+ public function set_hotspot_end( $new_value ) {
+ update_site_option( $this->option_hotspot_end, $new_value );
+ }
+
+
+
+ /**
+ * Performs atomic update of option value
+ * from old to new value. Makes sure that only single process updates it.
+ * Only single process gets true return value when multiple tries to do that.
+ */
+ public function prolong_hotspot_end( $old_value, $new_value ) {
+ global $wpdb;
+
+ $result = $wpdb->query( $wpdb->prepare(
+ 'UPDATE ' . $wpdb->sitemeta . ' ' .
+ 'SET meta_value = %s ' .
+ 'WHERE site_id = %d AND meta_key = %s AND meta_value = %s',
+ $new_value, $wpdb->siteid, $this->option_hotspot_end, $old_value ) );
+ $succeeded = ( $result > 0 );
+
+ return $succeeded;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_DeferScripts_Extension.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_DeferScripts_Extension.php
new file mode 100644
index 00000000..e5cd2987
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_DeferScripts_Extension.php
@@ -0,0 +1,308 @@
+config = Dispatcher::config();
+ }
+
+ /**
+ * Runs User Experience DeferScripts feature.
+ *
+ * @since 2.4.2
+ *
+ * @return void
+ */
+ public function run() {
+ if ( ! Util_Environment::is_w3tc_pro( $this->config ) ) {
+ $this->config->set_extension_active_frontend( 'user-experience-defer-scripts', false );
+ return;
+ }
+
+ Util_Bus::add_ob_callback( 'deferscripts', array( $this, 'ob_callback' ) );
+
+ add_filter( 'w3tc_minify_js_script_tags', array( $this, 'w3tc_minify_js_script_tags' ) );
+ add_filter( 'w3tc_save_options', array( $this, 'w3tc_save_options' ) );
+
+ add_action( 'w3tc_userexperience_page', array( $this, 'w3tc_userexperience_page' ), 11 );
+
+ /**
+ * This filter is documented in Generic_AdminActions_Default.php under the read_request method.
+ */
+ add_filter( 'w3tc_config_key_descriptor', array( $this, 'w3tc_config_key_descriptor' ), 10, 2 );
+ }
+
+ /**
+ * Processes the page content buffer to defer JS.
+ *
+ * @since 2.4.2
+ *
+ * @param string $buffer page content buffer.
+ *
+ * @return string
+ */
+ public function ob_callback( $buffer ) {
+ if ( '' === $buffer || ! \W3TC\Util_Content::is_html_xml( $buffer ) ) {
+ return $buffer;
+ }
+
+ $can_process = array(
+ 'enabled' => true,
+ 'buffer' => $buffer,
+ 'reason' => null,
+ );
+
+ $can_process = $this->can_process( $can_process );
+ $can_process = apply_filters( 'w3tc_deferscripts_can_process', $can_process );
+
+ // set reject reason in comment.
+ if ( $can_process['enabled'] ) {
+ $reject_reason = '';
+ } else {
+ $reject_reason = empty( $can_process['reason'] ) ? ' (not specified)' : ' (' . $can_process['reason'] . ')';
+ }
+
+ $buffer = str_replace(
+ '{w3tc_deferscripts_reject_reason}',
+ $reject_reason,
+ $buffer
+ );
+
+ // processing.
+ if ( ! $can_process['enabled'] ) {
+ return $buffer;
+ }
+
+ $this->mutator = new UserExperience_DeferScripts_Mutator( $this->config );
+
+ $buffer = $this->mutator->run( $buffer );
+
+ // embed lazyload script.
+ if ( $this->mutator->content_modified() ) {
+ $buffer = apply_filters( 'w3tc_deferscripts_embed_script', $buffer );
+
+ $is_embed_script = apply_filters( 'w3tc_deferscripts_is_embed_script', true );
+ if ( $is_embed_script ) {
+ $buffer = $this->embed_script( $buffer );
+ }
+ }
+
+ return $buffer;
+ }
+
+ /**
+ * Checks if the request can be processed for defer JS.
+ *
+ * @since 2.4.2
+ *
+ * @param boolean $can_process flag representing if defer JS can be executed.
+ *
+ * @return boolean
+ */
+ private function can_process( $can_process ) {
+ if ( defined( 'WP_ADMIN' ) ) {
+ $can_process['enabled'] = false;
+ $can_process['reason'] = 'WP_ADMIN';
+
+ return $can_process;
+ }
+
+ if ( defined( 'SHORTINIT' ) && SHORTINIT ) {
+ $can_process['enabled'] = false;
+ $can_process['reason'] = 'SHORTINIT';
+
+ return $can_process;
+ }
+
+ if ( function_exists( 'is_feed' ) && is_feed() ) {
+ $can_process['enabled'] = false;
+ $can_process['reason'] = 'feed';
+
+ return $can_process;
+ }
+
+ return $can_process;
+ }
+
+ /**
+ * Adds defer JS message to W3TC footer comment.
+ *
+ * @since 2.4.2
+ *
+ * @param array $strings array of W3TC footer comments.
+ *
+ * @return array
+ */
+ public function w3tc_footer_comment( $strings ) {
+ $strings[] = __( 'Defer Scripts', 'w3-total-cache' ) . '{w3tc_deferscripts_reject_reason}';
+ return $strings;
+ }
+
+ /**
+ * Embeds the defer JS script in buffer.
+ *
+ * @since 2.4.2
+ *
+ * @param string $buffer page content buffer.
+ *
+ * @return string
+ */
+ private function embed_script( $buffer ) {
+ $config_timeout = $this->config->get_integer(
+ array(
+ 'user-experience-defer-scripts',
+ 'timeout',
+ )
+ );
+
+ $content = file_get_contents( W3TC_DIR . '/UserExperience_DeferScripts_Script.js' );
+ $content = str_replace(
+ '{config_timeout}',
+ $config_timeout,
+ $content
+ );
+
+ $footer_script = '';
+
+ $buffer = preg_replace(
+ '~]*)*>~Ui',
+ $footer_script . '\\0',
+ $buffer,
+ 1
+ );
+
+ return $buffer;
+ }
+
+ /**
+ * Filters script tags that are flaged as deferred. This is used to prevent Minify from touching scripts deferred by this feature.
+ *
+ * @since 2.4.2
+ *
+ * @param array $script_tags array of script tags.
+ *
+ * @return array
+ */
+ public function w3tc_minify_js_script_tags( $script_tags ) {
+ if ( ! is_null( $this->mutator ) ) {
+ $script_tags = $this->mutator->w3tc_minify_js_script_tags( $script_tags );
+ }
+
+ return $script_tags;
+ }
+
+ /**
+ * Renders the user experience defer JS settings page.
+ *
+ * @since 2.4.2
+ *
+ * @return void
+ */
+ public function w3tc_userexperience_page() {
+ if ( self::is_enabled() ) {
+ include __DIR__ . '/UserExperience_DeferScripts_Page_View.php';
+ }
+ }
+
+ /**
+ * Specify config key typing for fields that need it.
+ *
+ * @since 2.4.2
+ *
+ * @param mixed $descriptor Descriptor.
+ * @param mixed $key Compound key array.
+ *
+ * @return array
+ */
+ public function w3tc_config_key_descriptor( $descriptor, $key ) {
+ if ( is_array( $key ) && 'user-experience-defer-scripts.includes' === implode( '.', $key ) ) {
+ $descriptor = array( 'type' => 'array' );
+ }
+
+ return $descriptor;
+ }
+
+ /**
+ * Performs actions on save.
+ *
+ * @since 2.4.2
+ *
+ * @param array $data Array of save data.
+ *
+ * @return array
+ */
+ public function w3tc_save_options( $data ) {
+ $new_config = $data['new_config'];
+ $old_config = $data['old_config'];
+
+ if (
+ $new_config->get_array( array( 'user-experience-defer-scripts', 'timeout' ) ) !== $old_config->get_array( array( 'user-experience-defer-scripts', 'timeout' ) )
+ || $new_config->get_array( array( 'user-experience-defer-scripts', 'includes' ) ) !== $old_config->get_array( array( 'user-experience-defer-scripts', 'includes' ) )
+ ) {
+ $minify_enabled = $this->config->get_boolean( 'minify.enabled' );
+ $pgcache_enabled = $this->config->get_boolean( 'pgcache.enabled' );
+ if ( $minify_enabled || $pgcache_enabled ) {
+ $state = Dispatcher::config_state();
+ if ( $minify_enabled ) {
+ $state->set( 'minify.show_note.need_flush', true );
+ }
+ if ( $pgcache_enabled ) {
+ $state->set( 'common.show_note.flush_posts_needed', true );
+ }
+ $state->save();
+ }
+ }
+
+ return $data;
+ }
+
+ /**
+ * Gets the enabled status of the extension.
+ *
+ * @since 2.5.1
+ *
+ * @return bool
+ */
+ public static function is_enabled() {
+ $config = Dispatcher::config();
+ $extensions_active = $config->get_array( 'extensions.active' );
+ return Util_Environment::is_w3tc_pro( $config ) && array_key_exists( 'user-experience-defer-scripts', $extensions_active );
+ }
+}
+
+$o = new UserExperience_DeferScripts_Extension();
+$o->run();
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_DeferScripts_Mutator.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_DeferScripts_Mutator.php
new file mode 100644
index 00000000..03c929b7
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_DeferScripts_Mutator.php
@@ -0,0 +1,175 @@
+config = $config;
+ }
+
+ /**
+ * Runs User Experience DeferScripts Mutator.
+ *
+ * @since 2.4.2
+ *
+ * @param string $buffer Buffer string containing browser output.
+ *
+ * @return string
+ */
+ public function run( $buffer ) {
+ $r = apply_filters(
+ 'w3tc_deferscripts_mutator_before',
+ array(
+ 'buffer' => $buffer,
+ 'modified' => $this->modified,
+ )
+ );
+
+ $buffer = $r['buffer'];
+ $this->modified = $r['modified'];
+
+ $this->includes = $this->config->get_array(
+ array(
+ 'user-experience-defer-scripts',
+ 'includes',
+ )
+ );
+
+ $buffer = preg_replace_callback(
+ '~~is',
+ array( $this, 'placeholder' ), $buffer );
+
+ // styles
+ $buffer = preg_replace_callback(
+ '~\s*~is',
+ array($this, 'placeholder'), $buffer);
+
+ return $buffer;
+ }
+
+
+
+ public function restore_unmutable( $buffer ) {
+ return str_replace(
+ array_keys( $this->placeholders ),
+ array_values( $this->placeholders ),
+ $buffer
+ );
+ }
+
+
+
+ public function placeholder( $matches ) {
+ $key = '{' .$this->placeholder_base . count( $this->placeholders ) . '}';
+ $this->placeholders[$key] = $matches[0];
+ return $key;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_LazyLoad_Page_View.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_LazyLoad_Page_View.php
new file mode 100644
index 00000000..d0372f1c
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_LazyLoad_Page_View.php
@@ -0,0 +1,215 @@
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_LazyLoad_Plugin.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_LazyLoad_Plugin.php
new file mode 100644
index 00000000..21cb4eaa
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_LazyLoad_Plugin.php
@@ -0,0 +1,231 @@
+config = Dispatcher::config();
+ }
+
+
+
+ public function run() {
+ Util_Bus::add_ob_callback( 'lazyload', array( $this, 'ob_callback' ) );
+ $this->metaslider_hooks();
+
+ if ( $this->config->get_boolean( 'lazyload.googlemaps.google_maps_easy' ) ) {
+ $p = new UserExperience_LazyLoad_GoogleMaps_GoogleMapsEasy();
+
+ add_filter( 'w3tc_lazyload_mutator_before',
+ array( $p, 'w3tc_lazyload_mutator_before' ) );
+ }
+ if ( $this->config->get_boolean( 'lazyload.googlemaps.wp_google_maps' ) ) {
+ add_filter( 'w3tc_lazyload_mutator_before', array(
+ new UserExperience_LazyLoad_GoogleMaps_WPGoogleMaps(),
+ 'w3tc_lazyload_mutator_before'
+ ) );
+ }
+ if ( $this->config->get_boolean( 'lazyload.googlemaps.wp_google_map_plugin' ) ) {
+ $p = new UserExperience_LazyLoad_GoogleMaps_WPGoogleMapPlugin();
+
+ add_filter( 'w3tc_lazyload_mutator_before',
+ array( $p, 'w3tc_lazyload_mutator_before' ) );
+ }
+
+ add_filter( 'wp_get_attachment_url',
+ array( $this, 'wp_get_attachment_url' ), 10, 2 );
+ add_filter( 'w3tc_footer_comment',
+ array( $this, 'w3tc_footer_comment' ) );
+
+ }
+
+
+
+ public function ob_callback( $buffer ) {
+ if ( $buffer == '' || !\W3TC\Util_Content::is_html_xml( $buffer ) ) {
+ return $buffer;
+ }
+
+ $can_process = array(
+ 'enabled' => true,
+ 'buffer' => $buffer,
+ 'reason' => null
+ );
+
+ $can_process = $this->can_process( $can_process );
+ $can_process = apply_filters( 'w3tc_lazyload_can_process', $can_process );
+
+ // set reject reason in comment
+ if ( $can_process['enabled'] ) {
+ $reject_reason = '';
+ } else {
+ $reject_reason = empty( $can_process['reason'] ) ?
+ ' (not specified)' : ' (' . $can_process['reason'] . ')';
+ }
+
+ $buffer = str_replace( '{w3tc_lazyload_reject_reason}',
+ $reject_reason, $buffer );
+
+ // processing
+ if ( !$can_process['enabled'] ) {
+ return $buffer;
+ }
+
+ $mutator = new UserExperience_LazyLoad_Mutator( $this->config, $this->posts_by_url );
+ $buffer = $mutator->run( $buffer );
+
+ // embed lazyload script
+ if ( $mutator->content_modified() ) {
+ $buffer = apply_filters( 'w3tc_lazyload_embed_script', $buffer );
+
+ $is_embed_script = apply_filters( 'w3tc_lazyload_is_embed_script', true );
+ if ( $is_embed_script ) {
+ $buffer = $this->embed_script( $buffer );
+ }
+ }
+
+ return $buffer;
+ }
+
+
+
+ private function can_process( $can_process ) {
+ if ( defined( 'WP_ADMIN' ) ) {
+ $can_process['enabled'] = false;
+ $can_process['reason'] = 'WP_ADMIN';
+
+ return $can_process;
+ }
+
+ if ( defined( 'SHORTINIT' ) && SHORTINIT ) {
+ $can_process['enabled'] = false;
+ $can_process['reason'] = 'SHORTINIT';
+
+ return $can_process;
+ }
+
+ if ( function_exists( 'is_feed' ) && is_feed() ) {
+ $can_process['enabled'] = false;
+ $can_process['reason'] = 'feed';
+
+ return $can_process;
+ }
+
+ return $can_process;
+ }
+
+
+
+ public function w3tc_footer_comment( $strings ) {
+ $strings[] = __( 'Lazy Loading', 'w3-total-cache' ) . '{w3tc_lazyload_reject_reason}';
+ return $strings;
+ }
+
+
+
+ private function embed_script( $buffer ) {
+ $js_url = plugins_url( 'pub/js/lazyload.min.js', W3TC_FILE );
+ $method = $this->config->get_string( 'lazyload.embed_method' );
+
+ $fireEvent = 'function(t){var e;try{e=new CustomEvent("w3tc_lazyload_loaded",{detail:{e:t}})}catch(a){(e=document.createEvent("CustomEvent")).initCustomEvent("w3tc_lazyload_loaded",!1,!1,{e:t})}window.dispatchEvent(e)}';
+
+ $thresholds = '';
+ $config_threshold = $this->config->get_string( 'lazyload.threshold' );
+ if ( !empty( $config_threshold ) ) {
+ $thresholds = 'thresholds:' . json_encode( $config_threshold ) . ',';
+ }
+
+ $config = '{elements_selector:".lazy",' . $thresholds . 'callback_loaded:' . $fireEvent . '}';
+
+ $on_initialized_javascript = apply_filters( 'w3tc_lazyload_on_initialized_javascript', '' );
+
+ if ( $method == 'async_head' ) {
+ $on_initialized_javascript_wrapped = '';
+ if ( !empty( $on_initialized_javascript ) ) {
+ // LazyLoad::Initialized fired just before making LazyLoad global
+ // so next execution cycle have it
+ $on_initialized_javascript_wrapped =
+ 'window.addEventListener("LazyLoad::Initialized", function(){' .
+ 'setTimeout(function() {' .
+ $on_initialized_javascript .
+ '}, 1);' .
+ '});';
+ }
+
+ $embed_script =
+ '' .
+ ' ';
+
+ $buffer = preg_replace( '~]*)*>~Ui',
+ '\\0' . $embed_script, $buffer, 1 );
+
+ // load lazyload in footer to make sure DOM is ready at the moment of initialization
+ $footer_script =
+ '' .
+ '';
+ $buffer = preg_replace( '~]*)*>~Ui',
+ $footer_script . '\\0', $buffer, 1 );
+
+ } elseif ( $method == 'inline_footer' ) {
+ $footer_script =
+ '' .
+ '';
+ $buffer = preg_replace( '~]*)*>~Ui',
+ $footer_script . '\\0', $buffer, 1 );
+ } else { // 'sync_head'
+ $head_script =
+ '' .
+ '';
+ $buffer = preg_replace( '~]*)*>~Ui',
+ '\\0' . $head_script, $buffer, 1 );
+
+ $footer_script =
+ '';
+ $buffer = preg_replace( '~]*)*>~Ui',
+ $footer_script . '\\0', $buffer, 1 );
+ }
+
+ return $buffer;
+ }
+
+
+
+ public function wp_get_attachment_url( $url, $post_id ) {
+ $this->posts_by_url[$url] = $post_id;
+ return $url;
+ }
+
+
+
+ private function metaslider_hooks() {
+ add_filter( 'metaslider_nivo_slider_get_html',
+ array( $this, 'metaslider_nivo_slider_get_html' ) );
+ }
+
+
+
+ public function metaslider_nivo_slider_get_html( $content ) {
+ // nivo slider use "src" attr of tags to populate
+ // own image via JS, i.e. cant be replaced by lazyloading
+ $content = preg_replace(
+ '~(\s+)(class=)([\"\'])(.*?)([\"\'])~',
+ '$1$2$3$4 no-lazy$5', $content
+ );
+
+ return $content;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_OEmbed_Extension.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_OEmbed_Extension.php
new file mode 100644
index 00000000..93d55dcb
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_OEmbed_Extension.php
@@ -0,0 +1,19 @@
+run();
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Page.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Page.php
new file mode 100644
index 00000000..128f9035
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Page.php
@@ -0,0 +1,9 @@
+
+
+ Lazy loading is currently
+ get_boolean( 'lazyload.enabled' ) ): ?>
+ enabled .
+
+ disabled .
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Plugin_Admin.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Plugin_Admin.php
new file mode 100644
index 00000000..5bbc1e85
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Plugin_Admin.php
@@ -0,0 +1,91 @@
+ __( 'User Experience', 'w3-total-cache' ),
+ 'menu_text' => __( 'User Experience', 'w3-total-cache' ),
+ 'visible_always' => false,
+ 'order' => 1200,
+ );
+
+ return $menu;
+ }
+
+ /**
+ * Configures extensions for user experience.
+ *
+ * @param array $extensions Extensions array.
+ * @param object $config Config object.
+ *
+ * @return array
+ */
+ public static function w3tc_extensions( $extensions, $config ) {
+ $extensions['user-experience-defer-scripts'] = array(
+ 'public' => false,
+ 'extension_id' => 'user-experience-defer-scripts',
+ 'path' => 'w3-total-cache/UserExperience_DeferScripts_Extension.php',
+ );
+ $extensions['user-experience-preload-requests'] = array(
+ 'public' => false,
+ 'extension_id' => 'user-experience-preload-requests',
+ 'path' => 'w3-total-cache/UserExperience_Preload_Requests_Extension.php',
+ );
+ $extensions['user-experience-remove-cssjs'] = array(
+ 'public' => false,
+ 'extension_id' => 'user-experience-remove-cssjs',
+ 'path' => 'w3-total-cache/UserExperience_Remove_CssJs_Extension.php',
+ );
+ $extensions['user-experience-emoji'] = array(
+ 'public' => false,
+ 'extension_id' => 'user-experience-emoji',
+ 'path' => 'w3-total-cache/UserExperience_Emoji_Extension.php',
+ );
+ $extensions['user-experience-oembed'] = array(
+ 'public' => false,
+ 'extension_id' => 'user-experience-oembed',
+ 'path' => 'w3-total-cache/UserExperience_OEmbed_Extension.php',
+ );
+
+ return $extensions;
+ }
+
+ /**
+ * Render user experience advanced settings page.
+ *
+ * @return void
+ */
+ public function w3tc_settings_page_w3tc_userexperience() {
+ $v = new UserExperience_Page();
+ $v->render_content();
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Plugin_Jquery.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Plugin_Jquery.php
new file mode 100644
index 00000000..67891c3e
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Plugin_Jquery.php
@@ -0,0 +1,69 @@
+_config = Dispatcher::config();
+ }
+
+ /**
+ * Run.
+ *
+ * @since 0.14.4
+ */
+ public function run() {
+ // Disable jquery-migrate on the front-end, if configured.
+ if ( ! is_admin() && $this->_config->get_boolean( 'jquerymigrate.disabled' ) ) {
+ add_action( 'wp_default_scripts', array( $this, 'disable_jquery_migrate' ) );
+ }
+ }
+
+ /**
+ * Disable jquery-migrate.
+ *
+ * @since 0.14.4
+ *
+ * @link https://developer.wordpress.org/reference/hooks/wp_default_scripts/
+ * @link https://core.trac.wordpress.org/browser/tags/5.4/src/wp-includes/class.wp-dependencies.php
+ *
+ * @param WP_Scripts $scripts WP_Scripts instance.
+ */
+ public function disable_jquery_migrate( $scripts ) {
+ if ( isset( $scripts->registered['jquery'] ) ) {
+ $script = $scripts->registered['jquery'];
+
+ if ( $script->deps ) {
+ $script->deps = array_diff( $script->deps, array( 'jquery-migrate' ) );
+ }
+ }
+
+ unset( $scripts->registered['jquery-migrate'] );
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Preload_Requests_Extension.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Preload_Requests_Extension.php
new file mode 100644
index 00000000..d2a891f3
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Preload_Requests_Extension.php
@@ -0,0 +1,205 @@
+config = Dispatcher::config();
+ }
+
+ /**
+ * Runs User Experience DNS Prefetc feature.
+ *
+ * @since 2.5.1
+ *
+ * @return void
+ */
+ public function run() {
+ if ( ! Util_Environment::is_w3tc_pro( $this->config ) ) {
+ $this->config->set_extension_active_frontend( 'user-experience-preload-requests', false );
+ return;
+ }
+
+ // Applies logic to display page cache flush notice if Preload Requests settings are altered and saved.
+ add_filter( 'w3tc_save_options', array( $this, 'w3tc_save_options' ) );
+
+ // Renders the Preload Reqeusts settings metabox on the User Expereince advanced setting page.
+ add_action( 'w3tc_userexperience_page', array( $this, 'w3tc_userexperience_page' ), 20 );
+
+ // This filter is documented in Generic_AdminActions_Default.php under the read_request method.
+ add_filter( 'w3tc_config_key_descriptor', array( $this, 'w3tc_config_key_descriptor' ), 10, 2 );
+
+ // Applies dns-prefetch, preconnect, and preload headers.
+ add_action( 'wp_head', array( $this, 'w3tc_preload_requests_headers' ) );
+ add_action( 'admin_head', array( $this, 'w3tc_preload_requests_headers' ) );
+ }
+
+ /**
+ * Renders the user experience Preload Requests settings page.
+ *
+ * @since 2.5.1
+ *
+ * @return void
+ */
+ public function w3tc_userexperience_page() {
+ if ( self::is_enabled() ) {
+ include __DIR__ . '/UserExperience_Preload_Requests_Page_View.php';
+ }
+ }
+
+ /**
+ * Specify config key typing for fields that need it.
+ *
+ * @since 2.5.1
+ *
+ * @param mixed $descriptor Descriptor.
+ * @param mixed $key Compound key array.
+ *
+ * @return array
+ */
+ public function w3tc_config_key_descriptor( $descriptor, $key ) {
+ if (
+ is_array( $key )
+ && in_array(
+ implode( '.', $key ),
+ array(
+ 'user-experience-preload-requests.dns-prefetch',
+ 'user-experience-preload-requests.preconnect',
+ 'user-experience-preload-requests.preload-css',
+ 'user-experience-preload-requests.preload-js',
+ 'user-experience-preload-requests.preload-fonts',
+ 'user-experience-preload-requests.preload-images',
+ 'user-experience-preload-requests.preload-videos',
+ 'user-experience-preload-requests.preload-audio',
+ 'user-experience-preload-requests.preload-documents',
+ )
+ )
+ ) {
+ $descriptor = array( 'type' => 'array' );
+ }
+
+ return $descriptor;
+ }
+
+ /**
+ * Performs actions on save.
+ *
+ * @since 2.5.1
+ *
+ * @param array $data Array of save data.
+ *
+ * @return array
+ */
+ public function w3tc_save_options( $data ) {
+ $new_config = $data['new_config'];
+ $old_config = $data['old_config'];
+
+ $new_includes = $new_config->get_array( array( 'user-experience-preload-requests', 'includes' ) );
+ $old_includes = $old_config->get_array( array( 'user-experience-preload-requests', 'includes' ) );
+
+ if ( $new_includes !== $old_includes && $this->config->get_boolean( 'pgcache.enabled' ) ) {
+ $state = Dispatcher::config_state();
+ $state->set( 'common.show_note.flush_posts_needed', true );
+ $state->save();
+ }
+
+ return $data;
+ }
+
+ /**
+ * Applies the Preload Requests headers for wp_head and admin_head.
+ *
+ * @since 2.5.1
+ *
+ * @return void
+ */
+ public function w3tc_preload_requests_headers() {
+ // Preconnect hints should be printed first so they take priority. If not supported then dns-prefetch will be the fallback.
+ $preconnect = $this->config->get_array( array( 'user-experience-preload-requests', 'preconnect' ) );
+ foreach ( $preconnect as $url ) {
+ echo ' ';
+ }
+
+ $dns_prefetch = $this->config->get_array( array( 'user-experience-preload-requests', 'dns-prefetch' ) );
+ foreach ( $dns_prefetch as $url ) {
+ echo ' ';
+ }
+
+ $preload_css = $this->config->get_array( array( 'user-experience-preload-requests', 'preload-css' ) );
+ foreach ( $preload_css as $url ) {
+ echo ' ';
+ }
+
+ $preload_js = $this->config->get_array( array( 'user-experience-preload-requests', 'preload-js' ) );
+ foreach ( $preload_js as $url ) {
+ echo ' ';
+ }
+
+ $preload_fonts = $this->config->get_array( array( 'user-experience-preload-requests', 'preload-fonts' ) );
+ foreach ( $preload_fonts as $url ) {
+ echo ' ';
+ }
+
+ $preload_images = $this->config->get_array( array( 'user-experience-preload-requests', 'preload-images' ) );
+ foreach ( $preload_images as $url ) {
+ echo ' ';
+ }
+
+ $preload_videos = $this->config->get_array( array( 'user-experience-preload-requests', 'preload-videos' ) );
+ foreach ( $preload_videos as $url ) {
+ echo ' ';
+ }
+
+ $preload_audio = $this->config->get_array( array( 'user-experience-preload-requests', 'preload-audio' ) );
+ foreach ( $preload_audio as $url ) {
+ echo ' ';
+ }
+
+ $preload_documents = $this->config->get_array( array( 'user-experience-preload-requests', 'preload-documents' ) );
+ foreach ( $preload_documents as $url ) {
+ echo ' ';
+ }
+ }
+
+ /**
+ * Gets the enabled status of the extension.
+ *
+ * @since 2.5.1
+ *
+ * @return bool
+ */
+ public static function is_enabled() {
+ $config = Dispatcher::config();
+ $extensions_active = $config->get_array( 'extensions.active' );
+ return Util_Environment::is_w3tc_pro( $config ) && array_key_exists( 'user-experience-preload-requests', $extensions_active );
+ }
+}
+
+$o = new UserExperience_Preload_Requests_Extension();
+$o->run();
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Preload_Requests_Page_View.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Preload_Requests_Page_View.php
new file mode 100644
index 00000000..c531e6f6
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Preload_Requests_Page_View.php
@@ -0,0 +1,111 @@
+
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Remove_CssJs_Extension.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Remove_CssJs_Extension.php
new file mode 100644
index 00000000..f1ea0331
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Remove_CssJs_Extension.php
@@ -0,0 +1,254 @@
+config = Dispatcher::config();
+ }
+
+ /**
+ * Runs User Experience Remove Css/Js feature.
+ *
+ * @since 2.7.0
+ *
+ * @return void
+ */
+ public function run() {
+ if ( ! Util_Environment::is_w3tc_pro( $this->config ) ) {
+ $this->config->set_extension_active_frontend( 'user-experience-remove-cssjs', false );
+ return;
+ }
+
+ Util_Bus::add_ob_callback( 'removecssjs', array( $this, 'ob_callback' ) );
+
+ add_filter( 'w3tc_save_options', array( $this, 'w3tc_save_options' ) );
+
+ add_action( 'w3tc_userexperience_page', array( $this, 'w3tc_userexperience_page' ), 12 );
+
+ /**
+ * This filter is documented in Generic_AdminActions_Default.php under the read_request method.
+ */
+ add_filter( 'w3tc_config_key_descriptor', array( $this, 'w3tc_config_key_descriptor' ), 10, 2 );
+ }
+
+ /**
+ * Processes the page content buffer to remove target CSS/JS.
+ *
+ * @since 2.7.0
+ *
+ * @param string $buffer page content buffer.
+ *
+ * @return string
+ */
+ public function ob_callback( $buffer ) {
+ if ( '' === $buffer || ! \W3TC\Util_Content::is_html_xml( $buffer ) ) {
+ return $buffer;
+ }
+
+ $can_process = array(
+ 'enabled' => true,
+ 'buffer' => $buffer,
+ 'reason' => null,
+ );
+
+ $can_process = $this->can_process( $can_process );
+ $can_process = apply_filters( 'w3tc_remove_cssjs_can_process', $can_process );
+
+ // set reject reason in comment.
+ if ( $can_process['enabled'] ) {
+ $reject_reason = '';
+ } else {
+ $reject_reason = empty( $can_process['reason'] ) ? ' (not specified)' : ' (' . $can_process['reason'] . ')';
+ }
+
+ $buffer = str_replace(
+ '{w3tc_remove_cssjs_reject_reason}',
+ $reject_reason,
+ $buffer
+ );
+
+ // processing.
+ if ( ! $can_process['enabled'] ) {
+ return $buffer;
+ }
+
+ $this->mutator = new UserExperience_Remove_CssJs_Mutator( $this->config );
+
+ $buffer = $this->mutator->run( $buffer );
+
+ return $buffer;
+ }
+
+ /**
+ * Checks if the request can be processed for remove CSS/JS.
+ *
+ * @since 2.7.0
+ *
+ * @param boolean $can_process flag representing if remove CSS/JS can be executed.
+ *
+ * @return boolean
+ */
+ private function can_process( $can_process ) {
+ if ( defined( 'WP_ADMIN' ) ) {
+ $can_process['enabled'] = false;
+ $can_process['reason'] = 'WP_ADMIN';
+
+ return $can_process;
+ }
+
+ if ( defined( 'SHORTINIT' ) && SHORTINIT ) {
+ $can_process['enabled'] = false;
+ $can_process['reason'] = 'SHORTINIT';
+
+ return $can_process;
+ }
+
+ if ( function_exists( 'is_feed' ) && is_feed() ) {
+ $can_process['enabled'] = false;
+ $can_process['reason'] = 'feed';
+
+ return $can_process;
+ }
+
+ return $can_process;
+ }
+
+ /**
+ * Adds remove CSS/JS message to W3TC footer comment.
+ *
+ * @since 2.7.0
+ *
+ * @param array $strings array of W3TC footer comments.
+ *
+ * @return array
+ */
+ public function w3tc_footer_comment( $strings ) {
+ $strings[] = __( 'Remove CSS/JS', 'w3-total-cache' ) . '{w3tc_remove_cssjs_reject_reason}';
+ return $strings;
+ }
+
+ /**
+ * Renders the user experience remove CSS/JS settings page.
+ *
+ * @since 2.7.0
+ *
+ * @return void
+ */
+ public function w3tc_userexperience_page() {
+ if ( self::is_enabled() ) {
+ include __DIR__ . '/UserExperience_Remove_CssJs_Page_View.php';
+ }
+ }
+
+ /**
+ * Specify config key typing for fields that need it.
+ *
+ * @since 2.7.0
+ *
+ * @param mixed $descriptor Descriptor.
+ * @param mixed $key Compound key array.
+ *
+ * @return array
+ */
+ public function w3tc_config_key_descriptor( $descriptor, $key ) {
+ if ( is_array( $key ) && 'user-experience-remove-cssjs.includes' === implode( '.', $key ) ) {
+ $descriptor = array( 'type' => 'array' );
+ }
+
+ return $descriptor;
+ }
+
+ /**
+ * Performs actions on save.
+ *
+ * @since 2.7.0
+ *
+ * @param array $data Array of save data.
+ *
+ * @return array
+ */
+ public function w3tc_save_options( $data ) {
+ $new_config = $data['new_config'];
+ $old_config = $data['old_config'];
+
+ $old_cssjs_includes = $old_config->get_array( array( 'user-experience-remove-cssjs', 'includes' ) );
+ $old_cssjs_singles = $old_config->get_array( 'user-experience-remove-cssjs-singles' );
+ $new_cssjs_includes = $new_config->get_array( array( 'user-experience-remove-cssjs', 'includes' ) );
+ $new_cssjs_singles = $new_config->get_array( 'user-experience-remove-cssjs-singles' );
+
+ foreach ( $new_cssjs_singles as $url => $pages ) {
+ if ( is_string( $pages['includes'] ) ) {
+ $new_cssjs_singles[ $url ]['includes'] = Util_Environment::textarea_to_array( $pages['includes'] );
+ }
+ }
+
+ $new_config->set( 'user-experience-remove-cssjs-singles', $new_cssjs_singles );
+
+ if ( $new_cssjs_includes !== $old_cssjs_includes || $new_cssjs_singles !== $old_cssjs_singles ) {
+ $minify_enabled = $this->config->get_boolean( 'minify.enabled' );
+ $pgcache_enabled = $this->config->get_boolean( 'pgcache.enabled' );
+ if ( $minify_enabled || $pgcache_enabled ) {
+ $state = Dispatcher::config_state();
+ if ( $minify_enabled ) {
+ $state->set( 'minify.show_note.need_flush', true );
+ }
+ if ( $pgcache_enabled ) {
+ $state->set( 'common.show_note.flush_posts_needed', true );
+ }
+ $state->save();
+ }
+ }
+
+ return $data;
+ }
+
+ /**
+ * Gets the enabled status of the extension.
+ *
+ * @since 2.5.1
+ *
+ * @return bool
+ */
+ public static function is_enabled() {
+ $config = Dispatcher::config();
+ $extensions_active = $config->get_array( 'extensions.active' );
+ return Util_Environment::is_w3tc_pro( $config ) && array_key_exists( 'user-experience-remove-cssjs', $extensions_active );
+ }
+}
+
+$o = new UserExperience_Remove_CssJs_Extension();
+$o->run();
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Remove_CssJs_Mutator.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Remove_CssJs_Mutator.php
new file mode 100644
index 00000000..d543cb45
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Remove_CssJs_Mutator.php
@@ -0,0 +1,167 @@
+config = $config;
+ }
+
+ /**
+ * Runs User Experience Remove CSS/JS Mutator.
+ *
+ * @since 2.7.0
+ *
+ * @param string $buffer Buffer string containing browser output.
+ *
+ * @return string
+ */
+ public function run( $buffer ) {
+ $r = apply_filters(
+ 'w3tc_remove_cssjs_mutator_before',
+ array(
+ 'buffer' => $buffer,
+ )
+ );
+
+ $buffer = $r['buffer'];
+
+ // Sets includes whose matches will be stripped site-wide.
+ $this->includes = $this->config->get_array(
+ array(
+ 'user-experience-remove-cssjs',
+ 'includes',
+ )
+ );
+
+ // Sets singles includes data whose matches will be removed on mated pages.
+ $this->singles_includes = $this->config->get_array( 'user-experience-remove-cssjs-singles' );
+
+ $buffer = preg_replace_callback(
+ '~( )|()~is',
+ array( $this, 'remove_content' ),
+ $buffer
+ );
+
+ return $buffer;
+ }
+
+ /**
+ * Removes matched link/script tag from HTML content.
+ *
+ * @since 2.7.0
+ *
+ * @param array $matches array of matched CSS/JS entries.
+ *
+ * @return string
+ */
+ public function remove_content( $matches ) {
+ $content = $matches[0];
+
+ if ( is_main_query() && $this->is_content_included( $content ) ) {
+ return '';
+ }
+
+ return $content;
+ }
+
+ /**
+ * Checks if content has already been removed.
+ *
+ * @since 2.7.0
+ *
+ * @param string $content script tag string.
+ *
+ * @return boolean
+ */
+ private function is_content_included( $content ) {
+ global $wp;
+
+ // Always removes matched CSS/JS for home page.
+ if ( is_front_page() ) {
+ foreach ( $this->includes as $include ) {
+ if ( ! empty( $include ) ) {
+ if ( strpos( $content, $include ) !== false ) {
+ return true;
+ }
+ }
+ }
+ }
+
+ // Build array of possible current page relative/absolute URLs.
+ $current_pages = array(
+ $wp->request,
+ trailingslashit( $wp->request ),
+ home_url( $wp->request ),
+ trailingslashit( home_url( $wp->request ) ),
+ );
+
+ // Only removes matched CSS/JS on matching pages.
+ foreach ( $this->singles_includes as $include => $pages ) {
+ if (
+ ! empty( $pages )
+ // Check if the given single CSS/JS remove rule URL is present in HTML content.
+ && strpos( $content, $include ) !== false
+ // Check if current page matches defined pages for given single CSS/JS remove rule.
+ && array_intersect(
+ $current_pages,
+ // Remove leading / value from included page value(s) as the $wp->request excludes them.
+ array_map(
+ function ( $value ) {
+ return ltrim( $value, '/' );
+ },
+ $pages['includes']
+ )
+ )
+ ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Remove_CssJs_Page_View.js b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Remove_CssJs_Page_View.js
new file mode 100644
index 00000000..bfb2a791
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Remove_CssJs_Page_View.js
@@ -0,0 +1,83 @@
+/**
+ * File: UserExperience_Remove_CssJs_Page_View.js
+ *
+ * @since 2.7.0
+ *
+ * @package W3TC
+ */
+
+jQuery(function() {
+ jQuery(document).on(
+ 'click',
+ '#w3tc_remove_cssjs_singles_add',
+ function() {
+ var single = prompt('Enter CSS/JS URL.');
+
+ if (single !== null) {
+ var exists = false;
+
+ jQuery('.remove_cssjs_singles_path').each(
+ function() {
+ if (jQuery(this).html() == single) {
+ alert('Entry already exists!');
+ exists = true;
+ return false;
+ }
+ }
+ );
+
+ if (!exists) {
+ var li = jQuery(
+ '' +
+ '' +
+ ' '
+ );
+
+ jQuery('#remove_cssjs_singles').append(li);
+ w3tc_remove_cssjs_singles_clear();
+ window.location.hash = '#remove_cssjs_singles_' + single;
+ li.find('textarea').focus();
+ }
+ } else {
+ alert('Empty CSS/JS URL!');
+ }
+ }
+ );
+
+ jQuery(document).on(
+ 'click',
+ '.w3tc_remove_cssjs_singles_delete',
+ function () {
+ if (confirm('Are you sure want to delete this entry?')) {
+ jQuery(this).parents('#remove_cssjs_singles li').remove();
+ w3tc_remove_cssjs_singles_clear();
+ w3tc_beforeupload_bind();
+ }
+ }
+ );
+
+ w3tc_remove_cssjs_singles_clear();
+});
+
+function w3tc_remove_cssjs_singles_clear() {
+ if (!jQuery('#remove_cssjs_singles li').length) {
+ jQuery('#remove_cssjs_singles_empty').show();
+ } else {
+ jQuery('#remove_cssjs_singles_empty').hide();
+ }
+}
\ No newline at end of file
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Remove_CssJs_Page_View.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Remove_CssJs_Page_View.php
new file mode 100644
index 00000000..1e985641
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/UserExperience_Remove_CssJs_Page_View.php
@@ -0,0 +1,89 @@
+ $c->get_array( 'user-experience-remove-cssjs-singles' ),
+);
+
+Util_Ui::postbox_header( esc_html__( 'Remove CSS/JS On Homepage', 'w3-total-cache' ), '', 'remove-cssjs' );
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+ $single_config ) {
+ ?>
+
+
+
+
+
+
+', addslashes( $reactivate_url ) );
+
+ self::_error( sprintf( __( '%s then %s.', 'w3-total-cache' ), $e->getMessage(), $reactivate_button ) );
+ }
+
+ /**
+ * W3 writable error
+ *
+ * @param string $path
+ * @param string[] $chmod_dirs Directories that should be chmod 777 inorder to write
+ */
+ static public function throw_on_write_error( $path, $chmod_dirs = array() ) {
+
+ $chmods = '';
+ if ( $chmod_dirs ) {
+ $chmods = '';
+ foreach ( $chmod_dirs as $dir ) {
+ $chmods .= sprintf( __( 'chmod 777 %s ', 'w3-total-cache' ), $dir );
+ }
+ } else {
+ $chmods = sprintf( 'chmod 777 %s ',
+ ( file_exists( $path ) ? $path : dirname( $path ) ) );
+ }
+ if ( Util_File::check_open_basedir( $path ) ) {
+ $error = sprintf(
+ __( '%s could not be created, please run following command: %s',
+ 'w3-total-cache' ),
+ $path, $chmods );
+ } else {
+ $error = sprintf(
+ __( '%s could not be created, open_basedir restriction in effect, please check your php.ini settings:open_basedir = "%s" ',
+ 'w3-total-cache' ),
+ $path, ini_get( 'open_basedir' ) );
+ }
+
+ throw new \Exception( $error );
+ }
+
+ /**
+ * Creates maintenance mode file
+ *
+ * @param unknown $time
+ */
+ static public function enable_maintenance_mode( $time = null ) {
+ if ( is_null( $time ) )
+ $time = 'time()';
+ Util_WpFile::write_to_file( Util_Environment::site_path() . '/.maintenance', "" );
+ }
+
+ /**
+ * Deletes maintenance mode file
+ */
+ static public function disable_maintenance_mode() {
+ Util_WpFile::delete_file( Util_Environment::site_path() . '/.maintenance' );
+ }
+
+ /**
+ * Used to display Util_Environment_Exceptions in UI
+ *
+ * @param Util_Environment_Exceptions $exs
+ * @return array(before_errors = [], required_changes =>, later_errors => [])
+ */
+ static public function parse_environment_exceptions( $exs ) {
+ $exceptions = $exs->exceptions();
+
+ $commands = '';
+ $required_changes = '';
+ $before_errors = array();
+ $later_errors = array();
+ $operation_error_already_shown = false;
+
+ foreach ( $exceptions as $ex ) {
+ if ( $ex instanceof Util_WpFile_FilesystemOperationException ) {
+ if ( !$operation_error_already_shown ) {
+ $m = $ex->getMessage();
+ if ( strlen( $m ) > 0 ) {
+ $before_errors[] = $m;
+ // if multiple operations failed when
+ // they tried to fix environment - show only first
+ // otherwise can duplication information about
+ // absense of permissions
+ $operation_error_already_shown = true;
+ }
+ if ( $ex instanceof Util_WpFile_FilesystemWriteException ) {
+ $required_changes .= sprintf(
+ __( 'Create the %s file and paste the following text into it: ',
+ 'w3-total-cache' ),
+ $ex->filename(), esc_textarea( $ex->file_contents() ) );
+ } else if ( $ex instanceof Util_WpFile_FilesystemModifyException ) {
+ $modification_content = $ex->file_contents();
+ if ( strlen( $modification_content ) > 0 )
+ $modification_content =
+ '';
+ $required_changes .=
+ $ex->modification_description() .
+ $modification_content .
+ ' ';
+ } else if ( $ex instanceof Util_WpFile_FilesystemCopyException ) {
+ $commands .= 'cp ' . $ex->source_filename() . ' ' .
+ $ex->destination_filename() . ' ';
+ } else if ( $ex instanceof Util_WpFile_FilesystemMkdirException ) {
+ $commands .= 'mkdir ' . $ex->folder() . ' ';
+ $commands .= 'chmod 777 ' . $ex->folder() . ' ';
+ } else if ( $ex instanceof Util_WpFile_FilesystemRmException ) {
+ $commands .= 'rm ' . $ex->filename() . ' ';
+ } else if ( $ex instanceof Util_WpFile_FilesystemRmdirException ) {
+ $commands .= 'rm -rf ' . $ex->folder() . ' ';
+ } else if ( $ex instanceof Util_WpFile_FilesystemChmodException ) {
+ $commands .= 'chmod 777 ' . $ex->filename() . ' ';
+ }
+ }
+ } else if ( $ex instanceof Util_Environment_Exception ) {
+ $t = $ex->technical_message();
+ if ( strlen( $t ) > 0 ) {
+ $t = ' ' .
+ '' .
+ __( 'Technical info', 'w3-total-cache' ).' ' .
+ '' .
+ $t . '
';
+ }
+
+ $later_errors[] = $ex->getMessage() . $t;
+ } else {
+ // unknown command
+ $later_errors[] = $ex->getMessage();
+ }
+ }
+
+ if ( strlen( $commands ) > 0 ) {
+ $required_changes .= __( 'Execute next commands in a shell:', 'w3-total-cache' ) .
+ '' . $commands . ' ';
+ }
+
+ return array(
+ 'before_errors' => $before_errors,
+ 'required_changes' => $required_changes,
+ 'later_errors' => $later_errors
+ );
+ }
+
+ /**
+ *
+ *
+ * @return string[] error messages
+ */
+ static public function deactivate_plugin() {
+ $errors = array();
+ try {
+ $environment = Dispatcher::component( 'Root_Environment' );
+ $environment->fix_after_deactivation();
+ deactivate_plugins( plugin_basename( W3TC_FILE ) );
+ } catch ( SelfTestExceptions $exs ) {
+ $r = Util_Activation::parse_environment_exceptions( $exs );
+
+ foreach ( $r['before_errors'] as $e )
+ $errors[] = $e;
+
+ if ( strlen( $r['required_changes'] ) > 0 ) {
+ $changes_style = 'border: 1px solid black; ' .
+ 'background: white; ' .
+ 'margin: 10px 30px 10px 30px; ' .
+ 'padding: 10px; display: none';
+ $ftp_style = 'border: 1px solid black; background: white; ' .
+ 'margin: 10px 30px 10px 30px; ' .
+ 'padding: 10px; display: none';
+ $ftp_form = str_replace( 'class="wrap"', '',
+ $exs->credentials_form() );
+ $ftp_form = str_replace( '', '', $ftp_form );
+ $ftp_form = str_replace( ' ', '', $ftp_form );
+ $ftp_form = str_replace( 'id="upgrade" class="button"',
+ 'id="upgrade" class="button w3tc-button-save"', $ftp_form );
+
+ $error = sprintf( '
+ %s
+
+
+ %s
+ %s
+
+
+ %s
+ %s
+
',
+ __( 'W3 Total Cache Error: Files and directories could not be automatically deleted.' , 'w3-total-cache' ),
+ __( 'Please execute commands manually' , 'w3-total-cache' ),
+ __( 'or use FTP form to allow W3 Total Cache make it automatically.' ,
+ 'w3-total-cache' ),
+ Util_Ui::button(
+ __( 'View required changes', 'w3-total-cache' ),
+ '',
+ 'w3tc-show-required-changes'
+ ),
+ Util_Ui::button(
+ __( 'Update via FTP', 'w3-total-cache' ),
+ '',
+ 'w3tc-show-ftp-form'
+ )
+ ) . '' . $r['required_changes'] . '
' .
+ '' .
+ $ftp_form . '
';
+
+ $errors[] = $error;
+ }
+ return $errors;
+ }
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Admin.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Admin.php
new file mode 100644
index 00000000..48336a7e
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Admin.php
@@ -0,0 +1,845 @@
+ $page ), $params );
+ }
+ }
+
+ Util_Environment::redirect( $url, $params );
+ }
+
+ /**
+ * Redirect function to current admin page with errors and messages specified.
+ *
+ * @static
+ *
+ * @param array $params Parameters.
+ * @param array $errors Errors.
+ * @param array $notes Notes.
+ * @param bool $check_referrer Check referrer.
+ * @return void
+ */
+ public static function redirect_with_custom_messages( $params, $errors = null, $notes = null, $check_referrer = false ) {
+ if ( empty( $errors ) && self::single_system_item( $notes ) ) {
+ self::redirect( array_merge( $params, array( 'w3tc_note' => $notes[0] ) ), $check_referrer );
+ return;
+ }
+ if ( self::single_system_item( $errors ) && empty( $notes ) ) {
+ self::redirect( array_merge( $params, array( 'w3tc_error' => $errors[0] ) ), $check_referrer );
+ return;
+ }
+
+ $message_id = uniqid();
+ update_option(
+ 'w3tc_message',
+ array(
+ $message_id => array(
+ 'errors' => $errors,
+ 'notes' => $notes,
+ ),
+ ),
+ 'yes'
+ );
+
+ self::redirect( array_merge( $params, array( 'w3tc_message' => $message_id ) ), $check_referrer );
+ }
+
+
+
+ /**
+ * Special redirect with ability to pass custom_message_id based on $data.
+ * query_string
+ * actions - which actions to call on render
+ * errors
+ * notes
+ *
+ * @static
+ *
+ * @param array $data Data.
+ */
+ public static function redirect_with_custom_messages2( $data ) {
+ if ( ! isset( $data['query_string']['page'] ) ) {
+ $data['query_string']['page'] = Util_Request::get_string( 'page' );
+
+ if ( 'w3tc_extensions' === $data['query_string']['page'] ) {
+ $data['query_string']['extension'] = Util_Request::get_string( 'extension' );
+ $data['query_string']['action'] = Util_Request::get_string( 'action' );
+ }
+ }
+
+ $message_id = uniqid();
+
+ update_option( 'w3tc_message', array( $message_id => $data ), 'yes' );
+
+ $data['query_string']['w3tc_message'] = $message_id;
+
+ Util_Environment::redirect( 'admin.php', $data['query_string'] );
+ }
+
+
+ /**
+ * Custom message id.
+ *
+ * @static
+ *
+ * @param array $errors Errors.
+ * @param array $notes Notes.
+ */
+ public static function custom_message_id( $errors = null, $notes = null ) {
+ $message_id = uniqid();
+ update_option(
+ 'w3tc_message',
+ array(
+ $message_id => array(
+ 'errors' => $errors,
+ 'notes' => $notes,
+ ),
+ ),
+ 'yes'
+ );
+
+ return 'w3tc_message=' . $message_id;
+ }
+
+ /**
+ * Checks if contains single message item.
+ *
+ * @static
+ *
+ * @param array $a Array.
+ * @return bool
+ */
+ public static function single_system_item( $a ) {
+ if ( ! is_array( $a ) || count( $a ) !== 1 ) {
+ return false;
+ }
+
+ $first_key = array_keys( $a );
+ $first_key = $first_key[0];
+ $pos = strpos( $a[ $first_key ], ' ' );
+
+ if ( false === $pos ) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Save config, can't decline save process. (difference from action_save).
+ *
+ * Do some actions on config keys update.
+ *
+ * Used in several places such as:
+ *
+ * 1. common config save
+ * 2. import settings
+ *
+ * @static
+ *
+ * @param Config $current_config Current config.
+ * @param Config $new_config New config.
+ * @return bool
+ * @throws \Exception Exception.
+ */
+ public static function config_save( $current_config, $new_config ) {
+ $master_config = ( $new_config->is_master() ? $new_config : Dispatcher::config_master() );
+
+ if ( $master_config->get_integer( 'common.instance_id', 0 ) == 0 ) {
+ $master_config->set( 'common.instance_id', mt_rand() );
+
+ if ( ! $new_config->is_master() ) {
+ $master_config->save();
+ }
+ }
+
+ $old_config = new Config();
+ $browsercache_dependencies = array();
+
+ if ( $new_config->get_boolean( 'browsercache.enabled' ) ) {
+ $browsercache_dependencies = array_merge(
+ $browsercache_dependencies,
+ array(
+ 'browsercache.rewrite',
+ 'browsercache.cssjs.replace',
+ 'browsercache.html.replace',
+ 'browsercache.other.replace',
+ )
+ );
+
+ if ( $new_config->get_boolean( 'browsercache.cssjs.replace' ) ) {
+ $browsercache_dependencies = array_merge(
+ $browsercache_dependencies,
+ array(
+ 'browsercache.cssjs.compression',
+ 'browsercache.cssjs.expires',
+ 'browsercache.cssjs.lifetime',
+ 'browsercache.cssjs.cache.control',
+ 'browsercache.cssjs.cache.policy',
+ 'browsercache.cssjs.etag',
+ 'browsercache.cssjs.w3tc',
+ )
+ );
+ }
+
+ if ( $new_config->get_boolean( 'browsercache.html.replace' ) ) {
+ $browsercache_dependencies = array_merge(
+ $browsercache_dependencies,
+ array(
+ 'browsercache.html.compression',
+ 'browsercache.html.expires',
+ 'browsercache.html.lifetime',
+ 'browsercache.html.cache.control',
+ 'browsercache.html.cache.policy',
+ 'browsercache.html.etag',
+ 'browsercache.html.w3tc',
+ )
+ );
+ }
+
+ if ( $new_config->get_boolean( 'browsercache.other.replace' ) ) {
+ $browsercache_dependencies = array_merge(
+ $browsercache_dependencies,
+ array(
+ 'browsercache.other.compression',
+ 'browsercache.other.expires',
+ 'browsercache.other.lifetime',
+ 'browsercache.other.cache.control',
+ 'browsercache.other.cache.policy',
+ 'browsercache.other.etag',
+ 'browsercache.other.w3tc',
+ )
+ );
+ }
+
+ $old_bc_dependencies_values = array();
+ $new_bc_dependencies_values = array();
+
+ foreach ( $browsercache_dependencies as $key ) {
+ $old_bc_dependencies_values[] = $old_config->get( $key );
+ $new_bc_dependencies_values[] = $new_config->get( $key );
+ }
+
+ if ( serialize( $old_bc_dependencies_values ) != serialize( $new_bc_dependencies_values ) ) {
+ $state_note = Dispatcher::config_state_note();
+ $state_note->set( 'common.show_note.flush_statics_needed', true );
+ }
+ }
+
+ /**
+ * Show need empty page cache notification
+ */
+ $cache_flush = Dispatcher::component( 'CacheFlush' );
+ if ( $cache_flush->flushable_posts() ) {
+
+ $pgcache_dependencies = array_merge(
+ $browsercache_dependencies,
+ array(
+ 'pgcache.debug',
+ 'pgcache.cache.query',
+ 'pgcache.cache.home',
+ 'pgcache.cache.feed',
+ 'pgcache.cache.nginx_handle_xml',
+ 'pgcache.cache.ssl',
+ 'pgcache.cache.404',
+ 'pgcache.cache.headers',
+ 'pgcache.compatibility',
+ 'pgcache.remove_charset',
+ 'pgcache.accept.uri',
+ 'pgcache.accept.files',
+ 'pgcache.accept.qs',
+ 'pgcache.late_init',
+ 'pgcache.mirrors.enabled',
+ 'pgcache.reject.front_page',
+ 'pgcache.reject.logged',
+ 'pgcache.reject.logged_roles',
+ 'pgcache.reject.uri',
+ 'pgcache.reject.ua',
+ 'pgcache.reject.cookie',
+ 'pgcache.reject.request_head',
+ 'dbcache.enabled',
+ 'objectcache.enabled',
+ 'minify.enabled',
+ 'mobile.enabled',
+ 'referrer.enabled',
+ )
+ );
+
+ if ( $new_config->get_boolean( 'pgcache.mirrors.enabled' ) ) {
+ $pgcache_dependencies = array_merge( $pgcache_dependencies, array( 'pgcache.mirrors.home_urls' ) );
+ }
+ if ( $new_config->get_boolean( 'dbcache.enabled' ) ) {
+ $pgcache_dependencies = array_merge( $pgcache_dependencies, array( 'dbcache.debug' ) );
+ }
+
+ if ( $new_config->getf_boolean( 'objectcache.enabled' ) ) {
+ $pgcache_dependencies = array_merge( $pgcache_dependencies, array( 'objectcache.debug' ) );
+ }
+
+ if ( $new_config->get_boolean( 'minify.enabled' ) ) {
+ $pgcache_dependencies = array_merge(
+ $pgcache_dependencies,
+ array(
+ 'minify.auto',
+ 'minify.debug',
+ 'minify.rewrite',
+ 'minify.html.enable',
+ 'minify.html.engine',
+ 'minify.html.inline.css',
+ 'minify.html.inline.js',
+ 'minify.html.strip.crlf',
+ 'minify.html.comments.ignore',
+ 'minify.css.enable',
+ 'minify.css.engine',
+ 'minify.css.groups',
+ 'minify.js.enable',
+ 'minify.js.engine',
+ 'minify.js.groups',
+ 'minify.htmltidy.options.clean',
+ 'minify.htmltidy.options.hide-comments',
+ 'minify.htmltidy.options.wrap',
+ 'minify.reject.logged',
+ 'minify.reject.ua',
+ 'minify.reject.uri',
+ )
+ );
+ }
+
+ $modules = Dispatcher::component( 'ModuleStatus' );
+ if ( $modules->is_running( 'cdn' ) ) {
+ $pgcache_dependencies = array_merge(
+ $pgcache_dependencies,
+ array(
+ 'cdn.enabled',
+ 'cdn.debug',
+ 'cdn.engine',
+ 'cdn.uploads.enable',
+ 'cdn.includes.enable',
+ 'cdn.includes.files',
+ 'cdn.theme.enable',
+ 'cdn.theme.files',
+ 'cdn.minify.enable',
+ 'cdn.custom.enable',
+ 'cdn.custom.files',
+ 'cdn.ftp.domain',
+ 'cdn.ftp.ssl',
+ 'cdn.s3.cname',
+ 'cdn.s3.ssl',
+ 'cdn.cf.cname',
+ 'cdn.cf.ssl',
+ 'cdn.cf2.cname',
+ 'cdn.cf2.ssl',
+ 'cdn.rscf.cname',
+ 'cdn.rscf.ssl',
+ 'cdn.azure.cname',
+ 'cdn.azure.ssl',
+ 'cdn.mirror.domain',
+ 'cdn.mirror.ssl',
+ 'cdn.cotendo.domain',
+ 'cdn.cotendo.ssl',
+ 'cdn.edgecast.domain',
+ 'cdn.edgecast.ssl',
+ 'cdn.att.domain',
+ 'cdn.att.ssl',
+ 'cdn.reject.logged_roles',
+ 'cdn.reject.roles',
+ 'cdn.reject.ua',
+ 'cdn.reject.uri',
+ 'cdn.reject.files',
+ )
+ );
+ } elseif ( $old_config->get_boolean( 'cdn.enabled' ) && ! $new_config->get_boolean( 'cdn.enabled' ) ) {
+ $pgcache_dependencies = array_merge( $pgcache_dependencies, array( 'cdn.enabled' ) );
+ }
+
+ if ( $new_config->get_boolean( 'mobile.enabled' ) ) {
+ $pgcache_dependencies = array_merge( $pgcache_dependencies, array( 'mobile.rgroups' ) );
+ }
+
+ if ( $new_config->get_boolean( 'referrer.enabled' ) ) {
+ $pgcache_dependencies = array_merge( $pgcache_dependencies, array( 'referrer.rgroups' ) );
+ }
+
+ if ( $new_config->get_boolean( 'browsercache.enabled' ) && $new_config->get_string( 'pgcache.engine' ) === 'file_generic' ) {
+ $pgcache_dependencies = array_merge(
+ $pgcache_dependencies,
+ array(
+ 'browsercache.html.last_modified',
+ 'browsercache.other.last_modified',
+ )
+ );
+ }
+
+ $old_pgcache_dependencies_values = array();
+ $new_pgcache_dependencies_values = array();
+
+ foreach ( $pgcache_dependencies as $pgcache_dependency ) {
+ $old_pgcache_dependencies_values[] = $old_config->get( $pgcache_dependency );
+ $new_pgcache_dependencies_values[] = $new_config->get( $pgcache_dependency );
+ }
+
+ if ( serialize( $old_pgcache_dependencies_values ) != serialize( $new_pgcache_dependencies_values ) ) {
+ $state_note = Dispatcher::config_state_note();
+ $state_note->set( 'common.show_note.flush_posts_needed', true );
+ }
+ }
+
+ /**
+ * Show need empty minify notification
+ */
+ if ( $current_config->get_boolean( 'minify.enabled' ) && $new_config->get_boolean( 'minify.enabled' ) && ( ( $new_config->get_boolean( 'minify.css.enable' ) && ( $new_config->get_boolean( 'minify.auto' ) || count( $new_config->get_array( 'minify.css.groups' ) ) ) ) || ( $new_config->get_boolean( 'minify.js.enable' ) && ( $new_config->get_boolean( 'minify.auto' ) || count( $new_config->get_array( 'minify.js.groups' ) ) ) ) ) ) {
+ $minify_dependencies = array_merge(
+ $browsercache_dependencies,
+ array(
+ 'minify.auto',
+ 'minify.debug',
+ 'minify.options',
+ 'minify.symlinks',
+ 'minify.css.enable',
+ 'minify.js.enable',
+ )
+ );
+
+ if ( $new_config->get_boolean( 'minify.css.enable' ) && ( $new_config->get_boolean( 'minify.auto' ) || count( $new_config->get_array( 'minify.css.groups' ) ) ) ) {
+ $minify_dependencies = array_merge(
+ $minify_dependencies,
+ array(
+ 'minify.css.engine',
+ 'minify.css.method',
+ 'minify.css.strip.comments',
+ 'minify.css.strip.crlf',
+ 'minify.css.imports',
+ 'minify.css.groups',
+ 'minify.yuicss.path.java',
+ 'minify.yuicss.path.jar',
+ 'minify.yuicss.options.line-break',
+ 'minify.csstidy.options.remove_bslash',
+ 'minify.csstidy.options.compress_colors',
+ 'minify.csstidy.options.compress_font-weight',
+ 'minify.csstidy.options.lowercase_s',
+ 'minify.csstidy.options.optimise_shorthands',
+ 'minify.csstidy.options.remove_last_;',
+ 'minify.csstidy.options.remove_space_before_important',
+ 'minify.csstidy.options.case_properties',
+ 'minify.csstidy.options.sort_properties',
+ 'minify.csstidy.options.sort_selectors',
+ 'minify.csstidy.options.merge_selectors',
+ 'minify.csstidy.options.discard_invalid_selectors',
+ 'minify.csstidy.options.discard_invalid_properties',
+ 'minify.csstidy.options.css_level',
+ 'minify.csstidy.options.preserve_css',
+ 'minify.csstidy.options.timestamp',
+ 'minify.csstidy.options.template',
+ )
+ );
+ }
+
+ if ( $new_config->get_boolean( 'minify.js.enable' ) && ( $new_config->get_boolean( 'minify.auto' ) || count( $new_config->get_array( 'minify.js.groups' ) ) ) ) {
+ $minify_dependencies = array_merge(
+ $minify_dependencies,
+ array(
+ 'minify.js.engine',
+ 'minify.js.method',
+ 'minify.js.combine.header',
+ 'minify.js.combine.body',
+ 'minify.js.combine.footer',
+ 'minify.js.strip.comments',
+ 'minify.js.strip.crlf',
+ 'minify.js.groups',
+ 'minify.yuijs.path.java',
+ 'minify.yuijs.path.jar',
+ 'minify.yuijs.options.line-break',
+ 'minify.yuijs.options.nomunge',
+ 'minify.yuijs.options.preserve-semi',
+ 'minify.yuijs.options.disable-optimizations',
+ 'minify.ccjs.path.java',
+ 'minify.ccjs.path.jar',
+ 'minify.ccjs.options.compilation_level',
+ 'minify.ccjs.options.formatting',
+ )
+ );
+ }
+
+ $modules = Dispatcher::component( 'ModuleStatus' );
+ if ( $modules->is_running( 'cdn' ) ) {
+ $minify_dependencies = array_merge( $minify_dependencies, array( 'cdn.engine', 'cdn.enabled' ) );
+ } elseif ( $old_config->get_boolean( 'cdn.enabled' ) && ! $new_config->get_boolean( 'cdn.enabled' ) ) {
+ $minify_dependencies = array_merge( $minify_dependencies, array( 'cdn.enabled' ) );
+ }
+
+ $old_minify_dependencies_values = array();
+ $new_minify_dependencies_values = array();
+
+ foreach ( $minify_dependencies as $minify_dependency ) {
+ $old_minify_dependencies_values[] = $old_config->get( $minify_dependency );
+ $new_minify_dependencies_values[] = $new_config->get( $minify_dependency );
+ }
+
+ if ( serialize( $old_minify_dependencies_values ) != serialize( $new_minify_dependencies_values ) ) {
+ $state_note = Dispatcher::config_state_note();
+ $state_note->set( 'minify.show_note.need_flush', true );
+ }
+ }
+
+ if ( $new_config->get_boolean( 'cdn.enabled' ) && ! Cdn_Util::is_engine_mirror( $new_config->get_string( 'cdn.engine' ) ) ) {
+ /**
+ * Show notification when CDN enabled
+ */
+ if ( ! $old_config->get_boolean( 'cdn.enabled' ) ) {
+ $state = Dispatcher::config_state();
+ $state->set( 'cdn.show_note_cdn_upload', true );
+ $state->save();
+ }
+
+ /**
+ * Show notification when Browser Cache settings changes
+ */
+ $cdn_dependencies = array( 'browsercache.enabled' );
+
+ if ( $new_config->get_boolean( 'cdn.enabled' ) ) {
+ $cdn_dependencies = array(
+ 'browsercache.cssjs.compression',
+ 'browsercache.cssjs.expires',
+ 'browsercache.cssjs.lifetime',
+ 'browsercache.cssjs.cache.control',
+ 'browsercache.cssjs.cache.policy',
+ 'browsercache.cssjs.etag',
+ 'browsercache.cssjs.w3tc',
+ 'browsercache.html.compression',
+ 'browsercache.html.expires',
+ 'browsercache.html.lifetime',
+ 'browsercache.html.cache.control',
+ 'browsercache.html.cache.policy',
+ 'browsercache.html.etag',
+ 'browsercache.html.w3tc',
+ 'browsercache.other.compression',
+ 'browsercache.other.expires',
+ 'browsercache.other.lifetime',
+ 'browsercache.other.cache.control',
+ 'browsercache.other.cache.policy',
+ 'browsercache.other.etag',
+ 'browsercache.other.w3tc',
+ );
+ }
+
+ $old_cdn_dependencies_values = array();
+ $new_cdn_dependencies_values = array();
+
+ foreach ( $cdn_dependencies as $cdn_dependency ) {
+ $old_cdn_dependencies_values[] = $old_config->get( $cdn_dependency );
+ $new_cdn_dependencies_values[] = $new_config->get( $cdn_dependency );
+ }
+
+ if ( serialize( $old_cdn_dependencies_values ) !== serialize( $new_cdn_dependencies_values ) ) {
+ $state = Dispatcher::config_state();
+ $state->set( 'cdn.show_note_cdn_reupload', true );
+ $state->save();
+ }
+ }
+
+ /**
+ * Show need empty object cache notification
+ */
+ if ( $current_config->getf_boolean( 'objectcache.enabled' ) ) {
+ $objectcache_dependencies = array(
+ 'objectcache.groups.global',
+ 'objectcache.groups.nonpersistent',
+ );
+
+ $old_objectcache_dependencies_values = array();
+ $new_objectcache_dependencies_values = array();
+
+ foreach ( $objectcache_dependencies as $objectcache_dependency ) {
+ $old_objectcache_dependencies_values[] = $old_config->get( $objectcache_dependency );
+ $new_objectcache_dependencies_values[] = $new_config->get( $objectcache_dependency );
+ }
+
+ if ( serialize( $old_objectcache_dependencies_values ) != serialize( $new_objectcache_dependencies_values ) ) {
+ $state_note = Dispatcher::config_state_note();
+ $state_note->set( 'objectcache.show_note.flush_needed', true );
+ }
+ }
+
+ do_action( 'w3tc_saved_options', $new_config );
+
+ /**
+ * Save config
+ */
+ try {
+ $new_config->save();
+ } catch ( \Exception $ex ) {
+ // try to fix environment, it potentially can be fixed silently don't show error here, it will be called again later in admin_notices.
+ try {
+ $environment = Dispatcher::component( 'Root_Environment' );
+ $environment->fix_in_wpadmin( $new_config );
+ } catch ( \Exception $ex ) { // phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedCatch
+ // Do nothing.
+ }
+
+ // Retry save process and complain now on failure.
+ try {
+ $new_config->save();
+ } catch ( \Exception $ex ) {
+ throw new \Exception(
+ 'Can\'t change configuration : ' . $ex->getMessage()
+ );
+ }
+ }
+
+ $w3_plugin_cdn = Dispatcher::component( 'Cdn_Core_Admin' );
+
+ /**
+ * Empty caches on engine change or cache enable/disable
+ */
+ if ( $old_config->get_string( 'pgcache.engine' ) !=
+ $new_config->get_string( 'pgcache.engine' ) ||
+ $old_config->get_string( 'pgcache.enabled' ) !=
+ $new_config->get_string( 'pgcache.enabled' ) ) {
+ $pgcacheflush = Dispatcher::component( 'PgCache_Flush' );
+ $v = $pgcacheflush->flush();
+ }
+
+ if ( $old_config->get_string( 'dbcache.engine' ) != $new_config->get_string( 'dbcache.engine' ) || $old_config->get_string( 'dbcache.enabled' ) != $new_config->get_string( 'dbcache.enabled' ) ) {
+ w3tc_dbcache_flush();
+ }
+
+ if ( $old_config->get_string( 'objectcache.engine' ) != $new_config->get_string( 'objectcache.engine' ) || $old_config->getf_boolean( 'objectcache.enabled' ) !== $new_config->getf_boolean( 'objectcache.enabled' ) ) {
+ w3tc_objectcache_flush();
+ }
+
+ if ( $old_config->get_string( 'minify.engine' ) != $new_config->get_string( 'minify.engine' ) || $old_config->get_string( 'minify.enabled' ) != $new_config->get_string( 'minify.enabled' ) ) {
+ w3tc_minify_flush();
+ }
+
+ /**
+ * Update CloudFront CNAMEs
+ */
+ if ( $new_config->get_boolean( 'cdn.enabled' ) && in_array( $new_config->get_string( 'cdn.engine' ), array( 'cf', 'cf2' ) ) ) {
+ if ( $new_config->get_string( 'cdn.engine' ) == 'cf' ) {
+ $old_cnames = $old_config->get_array( 'cdn.cf.cname' );
+ $new_cnames = $new_config->get_array( 'cdn.cf.cname' );
+ } else {
+ $old_cnames = $old_config->get_array( 'cdn.cf2.cname' );
+ $new_cnames = $new_config->get_array( 'cdn.cf2.cname' );
+ }
+ }
+
+ /**
+ * Refresh config
+ */
+ $current_config->load();
+
+ /**
+ * React to config changes
+ */
+ $environment = Dispatcher::component( 'Root_Environment' );
+ $environment->fix_on_event( $new_config, 'config_change', $old_config );
+
+ /**
+ * Auto upload browsercache files to CDN
+ */
+ if ( $new_config->get_boolean( 'cdn.enabled' ) && $new_config->get_string( 'cdn.engine' ) == 'ftp' ) {
+ self::cdn_delete_browsercache( $current_config );
+ self::cdn_upload_browsercache( $current_config );
+ }
+
+ return true;
+ }
+
+
+
+ /**
+ * Uploads minify files to CDN.
+ *
+ * @static
+ *
+ * @return void
+ */
+ public static function cdn_upload_minify() {
+ $w3_plugin_cdn = Dispatcher::component( 'Cdn_Plugin' );
+ $common = Dispatcher::component( 'Cdn_Core' );
+
+ $files = $w3_plugin_cdn->get_files_minify();
+
+ $upload = array();
+ $results = array();
+
+ foreach ( $files as $file ) {
+ $upload[] = $common->build_file_descriptor(
+ $common->docroot_filename_to_absolute_path( $file ),
+ $common->uri_to_cdn_uri( $common->docroot_filename_to_uri( $file ) )
+ );
+ }
+
+ $common->upload( $upload, true, $results );
+ }
+
+ /**
+ * Uploads Browser Cache .htaccess to FTP.
+ *
+ * @static
+ *
+ * @param Config $config Config.
+ * @return void
+ */
+ public static function cdn_upload_browsercache( $config ) {
+ $common = Dispatcher::component( 'Cdn_Core' );
+
+ Dispatcher::component( 'Cdn_Core_Admin' );
+
+ $ce = Dispatcher::component( 'Cdn_Environment' );
+ $rules = $ce->rules_generate_for_ftp( $config );
+
+ if ( $config->get_boolean( 'browsercache.enabled' ) ) {
+ $be = Dispatcher::component( 'BrowserCache_Environment' );
+ $rules .= $be->rules_cache_generate_for_ftp( $config );
+ }
+
+ $cdn_path = Util_Rule::get_cdn_rules_path();
+ $tmp_path = W3TC_CACHE_TMP_DIR . '/' . $cdn_path;
+
+ if ( @file_put_contents( $tmp_path, $rules ) ) {
+ $results = array();
+ $upload = array( $common->build_file_descriptor( $tmp_path, $cdn_path ) );
+
+ $common->upload( $upload, true, $results );
+ }
+ }
+
+ /**
+ * Deletes Browser Cache .htaccess from FTP.
+ *
+ * @static
+ *
+ * @return void
+ */
+ public static function cdn_delete_browsercache() {
+ $common = Dispatcher::component( 'Cdn_Core' );
+ $cdn_path = Util_Rule::get_cdn_rules_path();
+ $tmp_path = W3TC_CACHE_TMP_DIR . '/' . $cdn_path;
+ $results = array();
+ $delete = array( $common->build_file_descriptor( $tmp_path, $cdn_path ) );
+
+ $common->delete( $delete, false, $results );
+ }
+
+
+ /**
+ * Returns cookie domain.
+ *
+ * @static
+ *
+ * @return string
+ */
+ public static function get_cookie_domain() {
+ $site_url = get_option( 'siteurl' );
+ $parse_url = @parse_url( $site_url );
+
+ if ( $parse_url && ! empty( $parse_url['host'] ) ) {
+ return $parse_url['host'];
+ }
+
+ return isset( $_SERVER['HTTP_HOST'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_HOST'] ) ) : '';
+ }
+
+ /**
+ * Returns current w3tc admin page.
+ *
+ * @static
+ *
+ * @return string
+ */
+ public static function get_current_page() {
+ $page = Util_Request::get_string( 'page' );
+
+ if ( substr( $page, 0, 5 ) === 'w3tc_' ) {
+ return $page;
+ }
+
+ return 'w3tc_dashboard';
+ }
+
+ /**
+ * Returns current w3tc extension id.
+ *
+ * @static
+ *
+ * @return string
+ */
+ public static function get_current_extension() {
+ $page = Util_Request::get_string( 'page' );
+ $extension = Util_Request::get_string( 'extension' );
+
+ if ( substr( $page, 0, 5 ) === 'w3tc_' && ! empty( $extension ) ) {
+ return $extension;
+ }
+
+ return '';
+ }
+
+ /**
+ * Check if current page is a W3TC admin page.
+ *
+ * @static
+ *
+ * @return bool
+ */
+ public static function is_w3tc_admin_page() {
+ $page_val = Util_Request::get_string( 'page' );
+ if ( ! empty( $page_val ) && 'w3tc_' === substr( $page_val, 0, 5 ) ) {
+ return true;
+ }
+
+ $action_val = Util_Request::get_string( 'action' );
+ if ( ! empty( $action_val ) && 'w3tc_' === substr( $action_val, 0, 5 ) ) {
+ return true;
+ }
+
+ return false;
+ }
+
+
+ /**
+ * Returns current WordPress page.
+ *
+ * @static
+ *
+ * @return string
+ */
+ public static function get_current_wp_page() {
+ return Util_Request::get_string( 'page' );
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_AttachToActions.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_AttachToActions.php
new file mode 100644
index 00000000..0f0ae25a
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_AttachToActions.php
@@ -0,0 +1,155 @@
+flush_post( $post_id );
+ }
+
+ /**
+ * Post changed action
+ *
+ * @link https://developer.wordpress.org/reference/hooks/save_post/
+ *
+ * @param integer $post_id Post ID.
+ * @param WP_Post $post Post.
+ *
+ * @return void
+ */
+ public function on_post_change( $post_id, $post = null ) {
+ if ( is_null( $post ) ) {
+ $post = get_post( $post_id );
+ }
+
+ // if attachment changed - parent post has to be flushed
+ // since there are usually attachments content like title
+ // on the page (gallery).
+ if ( isset( $post->post_type ) && 'attachment' === $post->post_type ) {
+ $post_id = $post->post_parent;
+ $post = get_post( $post_id );
+ }
+
+ if ( ! Util_Environment::is_flushable_post( $post, 'posts', Dispatcher::config() ) ) {
+ return;
+ }
+
+ $cacheflush = Dispatcher::component( 'CacheFlush' );
+ $cacheflush->flush_post( $post_id );
+ }
+
+ /**
+ * Comment change action.
+ *
+ * @param integer $comment_id Comment ID.
+ */
+ public function on_comment_change( $comment_id ) {
+ $post_id = 0;
+
+ if ( $comment_id ) {
+ $comment = get_comment( $comment_id, ARRAY_A );
+ $post_id = ( ! empty( $comment['comment_post_ID'] ) ? (int) $comment['comment_post_ID'] : 0 );
+ }
+
+ $this->on_post_change( $post_id );
+ }
+
+ /**
+ * Comment status action fired immediately after transitioning a comment’s status from one to another
+ * in the database and removing the comment, but prior to all status transition hooks.
+ *
+ * @link https://developer.wordpress.org/reference/functions/wp_set_comment_status/
+ *
+ * @param integer $comment_id Comment ID.
+ * @param string $status Status.
+ */
+ public function on_comment_status( $comment_id, $status ) {
+ $this->on_comment_change( $comment_id );
+ }
+
+ /**
+ * Change action
+ */
+ public function on_change() {
+ $cacheflush = Dispatcher::component( 'CacheFlush' );
+ $cacheflush->flush_posts();
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Bus.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Bus.php
new file mode 100644
index 00000000..0aa2dfab
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Bus.php
@@ -0,0 +1,27 @@
+ __( 'Memcached hostname:port / IP :port:', 'w3-total-cache' ),
+ 'memcached.persistent' => __( 'Persistent connection', 'w3-total-cache' ),
+ 'memcached.username' => __( 'Memcached username:', 'w3-total-cache' ),
+ 'memcached.password' => __( 'Memcached password:', 'w3-total-cache' ),
+ 'memcached.binary_protocol' => __( 'Binary protocol', 'w3-total-cache' ),
+ 'redis.servers' => __( 'Redis hostname:port / IP :port:', 'w3-total-cache' ),
+ 'redis.verify_tls_certificates' => __( 'Verify TLS Certificates', 'w3-total-cache' ),
+ 'redis.persistent' => __( 'Persistent connection', 'w3-total-cache' ),
+ 'redis.timeout' => __( 'Connection timeout', 'w3-total-cache' ),
+ 'redis.retry_interval' => __( 'Connection retry interval', 'w3-total-cache' ),
+ 'redis.read_timeout' => __( 'Connection read timeout', 'w3-total-cache' ),
+ 'redis.dbid' => __( 'Redis Database ID:', 'w3-total-cache' ),
+ 'redis.password' => __( 'Redis password:', 'w3-total-cache' ),
+ );
+ }
+
+ return $keys[ $key ];
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Content.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Content.php
new file mode 100644
index 00000000..bc2797a4
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Content.php
@@ -0,0 +1,110 @@
+ 1000 ) {
+ $content = substr( $content, 0, 1000 );
+ }
+
+ if ( strstr( $content, '~s', '', $content );
+ }
+
+ $content = ltrim( $content, "\x00\x09\x0A\x0D\x20\xBB\xBF\xEF" );
+ return $content;
+ }
+
+ /**
+ * If content can handle HTML comments, can disable printout per request using filter 'w3tc_can_print_comment'
+ *
+ * @param unknown $buffer
+ * @return bool
+ */
+ static public function can_print_comment( $buffer ) {
+ if ( function_exists( 'apply_filters' ) )
+ return apply_filters( 'w3tc_can_print_comment', Util_Content::is_html_xml( $buffer ) && !defined( 'DOING_AJAX' ) );
+ return Util_Content::is_html_xml( $buffer ) && !defined( 'DOING_AJAX' );
+ }
+
+ /**
+ * Returns GMT date
+ *
+ * @param integer $time
+ * @return string
+ */
+ static public function http_date( $time ) {
+ return gmdate( 'D, d M Y H:i:s \G\M\T', $time );
+ }
+
+ /**
+ * Escapes HTML comment
+ *
+ * @param string $comment
+ * @return mixed
+ */
+ static public function escape_comment( $comment ) {
+ while ( strstr( $comment, '--' ) !== false ) {
+ $comment = str_replace( '--', '- -', $comment );
+ }
+
+ return $comment;
+ }
+
+
+
+ /**
+ * Deprecated. Added to prevent loading-order errors during upgrades
+ * from older w3tc plugin versions
+ **/
+ static public function is_database_error() {
+ return false;
+ }
+
+
+
+ /**
+ * Converts
+ * 127.0.0.1:1234 to ( '123.0.0.1', 1234 )
+ * tls://127.0.0.1:1234 to ( 'tls://123.0.0.1', 1234 )
+ * unix:/my/pipe to ( 'unix:/my/pipe', 0 )
+ *
+ * Doesnt fit to that class perfectly but selected due to common usage
+ * of loaded classes
+ */
+ static public function endpoint_to_host_port( $server, $port_default = 0 ) {
+ $p = strrpos( $server, ':' );
+ if ( substr( $server, 0, 5 ) == 'unix:' || $p === false ) {
+ return array( trim( $server ), $port_default );
+ }
+
+ return array(
+ trim( substr( $server, 0, $p ) ),
+ (int)substr( $server, $p + 1 ) );
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Debug.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Debug.php
new file mode 100644
index 00000000..1e05d04d
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Debug.php
@@ -0,0 +1,167 @@
+', '..' );
+ $filename = Util_Debug::log_filename( $module );
+
+ return @file_put_contents( $filename, '[' . date( 'r' ) . '] ' .
+ $message . "\n", FILE_APPEND );
+ }
+
+
+
+ /**
+ * Log cache purge event
+ */
+ static public function log_purge( $module, $message, $parameters = null,
+ $explicit_postfix = null ) {
+ $backtrace = debug_backtrace( 0 );
+ $backtrace_lines = array();
+ $pos = 0;
+ for ( $n = 2; $n < count( $backtrace ); $n++ ) {
+ if ( !Util_Debug::log_purge_should_print_item( $backtrace, $n ) ) {
+ continue;
+ }
+
+ $i = $backtrace[$n];
+ $filename = isset( $i['file'] ) ? $i['file'] : '';
+ $filename = str_replace( ABSPATH, '', $filename );
+
+ $line = isset( $i['line'] ) ? $i['line'] : '';
+
+ $method = ( !empty( $i['class'] ) ? $i['class'] . '--' : '' ) .
+ $i['function'];
+ $args = ' ' . Util_Debug::encode_params( $i['args'] );
+ $backtrace_lines[] = "\t#" . ( $pos ) . ' ' .
+ $filename . '(' . $line . '): ' . $method . $args;
+ $pos++;
+ }
+
+ $message = $message;
+ if ( !is_null( $parameters ) ) {
+ $message .= Util_Debug::encode_params( $parameters );
+ }
+
+ $user = function_exists( 'wp_get_current_user' ) ? wp_get_current_user() : null;
+ $username = ( empty( $user ) ? 'anonymous' : $user->user_login );
+ $message .= "\n\tusername:$username";
+
+ if ( is_array( $explicit_postfix ) ) {
+ $message .= "\n\t" . implode( "\n\t", $explicit_postfix );
+ }
+
+ $message .= "\n" . implode( "\n", $backtrace_lines );
+
+ return Util_Debug::log( $module . '-purge', $message );
+ }
+
+
+
+ static private function log_purge_should_print_item( $backtrace, $n ) {
+ if ( !empty( $backtrace[$n]['class']) &&
+ $backtrace[$n]['class'] == 'W3TC\\CacheFlush_Locally' ) {
+ return false;
+ }
+ if ( !empty( $backtrace[$n]['class']) &&
+ $backtrace[$n]['class'] == 'WP_Hook' &&
+ !empty( $backtrace[$n + 1]['function'] ) ) {
+ $f = $backtrace[$n + 1]['function'];
+ if ( $f == 'do_action' || $f == 'apply_filters' ) {
+ return false;
+ }
+
+ return Util_Debug::log_purge_should_print_item( $backtrace, $n + 1 );
+ }
+
+ return true;
+ }
+
+
+
+ static private function encode_params( $args ) {
+ $args_strings = array();
+ if ( !is_array( $args ) ) {
+ $s = (string)$args;
+
+ if ( strlen( $s ) > 100 ) {
+ $s = substr( $s, 0, 98 ) . '..';
+ }
+
+ $args_strings[] = $s;
+ } else {
+ foreach ( $args as $arg ) {
+ $s = json_encode( $arg,
+ JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE );
+ if ( strlen( $s ) > 100 ) {
+ $s = substr( $s, 0, 98 ) . '..';
+ }
+
+ $args_strings[] = $s;
+ }
+ }
+
+ return '(' . implode( ', ', $args_strings ) . ')';
+ }
+
+ /**
+ * Clean debug output with label headers.
+ */
+ static public function debug( $label, $data ) {
+ error_log('===============Debug ' . $label . ' Start===============');
+ error_log(print_r($data,true));
+ error_log('===============Debug ' . $label . ' End===============');
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_DebugPurgeLog_Reader.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_DebugPurgeLog_Reader.php
new file mode 100644
index 00000000..a5569862
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_DebugPurgeLog_Reader.php
@@ -0,0 +1,129 @@
+_read( $module );
+ }
+
+
+
+ private function _read( $module ) {
+ $log_filename = Util_Debug::log_filename( $module . '-purge' );
+ if ( !file_exists( $log_filename) ) {
+ return array();
+ }
+
+ $h = @fopen( $log_filename, 'rb' );
+ if ( !$h ) {
+ throw new \Exception( 'Failed to open log file' . $log_filename );
+ }
+
+ fseek( $h, 0, SEEK_END );
+ $pos = ftell( $h );
+ $unparsed_head = '';
+
+ $more_log_needed = true;
+
+ while ( $pos >= 0 ) {
+ $to_read = 26;
+ $pos -= $to_read;
+ if ( $pos <= 0 ) {
+ $to_read = $to_read + $pos;
+ $pos = 0;
+ }
+ fseek( $h, $pos );
+
+ $s = fread( $h, $to_read );
+
+ $unparsed_head = $this->parse_string( $s . $unparsed_head );
+ if ( count( $this->lines ) > 100 ) {
+ break;
+ }
+ if ( $pos <= 0 ) {
+ $this->push_line( $unparsed_head );
+ break;
+ }
+ }
+
+ return $this->lines;
+ }
+
+
+
+ private function parse_string( $s ) {
+ $first_unparsed = strlen( $s );
+ $pos = $first_unparsed;
+
+ for ( ; $pos >= 0; $pos-- ) {
+ $c = substr( $s, $pos, 1 );
+ if ( $c == "\r" || $c == "\n" ) {
+ $this->push_line( substr( $s, $pos + 1, $first_unparsed - $pos - 1 ) );
+ $first_unparsed = $pos;
+ }
+ }
+
+ return substr( $s, 0, $first_unparsed );
+ }
+
+
+
+ private function push_line( $line ) {
+ if ( empty( $line ) ) {
+ return;
+ }
+
+ if ( substr( $line, 0, 1) == "\t" ) {
+ array_unshift( $this->current_item, $line );
+ return;
+ }
+
+ // split secondary lines to urls and backtrace
+ $postfix = array();
+ $backtrace = array();
+ $username = '';
+ foreach ( $this->current_item as $item ) {
+ $item = trim( $item );
+ if ( preg_match( '~^(#[^ ]+) ([^:]+): (.*)~', $item, $m ) ) {
+ $backtrace[] = array(
+ 'number' => $m[1],
+ 'filename' => $m[2],
+ 'function' => $m[3]
+ );
+ } elseif ( preg_match( '~^username:(.*)~', $item, $m ) ) {
+ $username = $m[1];
+ } else {
+ $postfix[] = $item;
+ }
+ }
+
+ $m = null;
+ if ( preg_match( '~\\[([^\\]]+)\\] (.*)~', $line, $m ) ) {
+ $this->lines[] = array(
+ 'date' => $m[1],
+ 'message' => $m[2],
+ 'username' => $username,
+ 'postfix' => $postfix,
+ 'backtrace' => $backtrace
+ );
+ }
+
+ $this->current_item = array();
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Environment.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Environment.php
new file mode 100644
index 00000000..7baf6063
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Environment.php
@@ -0,0 +1,1615 @@
+ $value ) {
+ if ( $skip_empty && empty( $value ) ) {
+ continue;
+ }
+
+ array_push( $stack, $key );
+
+ if ( is_array( $value ) ) {
+ if ( count( $value ) ) {
+ $str .= ( ! empty( $str ) ? '&' : '' ) .
+ self::url_query( $value, $skip_empty, $key );
+ }
+ } else {
+ $name = '';
+
+ foreach ( $stack as $key ) {
+ $name .= ( ! empty( $name ) ? '[' . $key . ']' : $key );
+ }
+ $str .= ( ! empty( $str ) ? $separator : '' ) . $name . '=' . rawurlencode( $value );
+ }
+
+ array_pop( $stack );
+ }
+
+ return $str;
+ }
+
+ /**
+ * Returns URL from filename/dirname.
+ *
+ * @static
+ *
+ * @param string $filename Filename.
+ * @param bool $use_site_url Use siteurl.
+ * @return string
+ */
+ public static function filename_to_url( $filename, $use_site_url = false ) {
+ /**
+ * Using wp-content instead of document_root as known dir since dirbased
+ * multisite wp adds blogname to the path inside site_url.
+ */
+ if ( substr( $filename, 0, strlen( WP_CONTENT_DIR ) ) === WP_CONTENT_DIR ) {
+ // This is the default location of the wp-content/cache directory.
+ $location = WP_CONTENT_DIR;
+ } else if ( substr( $filename, 0, strlen( W3TC_CACHE_DIR ) ) === W3TC_CACHE_DIR ) {
+ // This is needed in the event the cache directory is moved outside of wp-content and replace with a symbolic link.
+ $location = substr( W3TC_CACHE_DIR, 0, -strlen( '/cache' ) );
+ } else if ( substr( $filename, 0, strlen( W3TC_CONFIG_DIR ) ) === W3TC_CONFIG_DIR ) {
+ // This is needed in the event the cache directory is moved outside of wp-content and replace with a symbolic link.
+ $location = substr( W3TC_CONFIG_DIR, 0, -strlen( '/w3tc-config' ) );
+ } else {
+ return '';
+ }
+
+ $uri_from_location = substr( $filename, strlen( $location ) );
+
+ if ( DIRECTORY_SEPARATOR != '/' ) {
+ $uri_from_location = str_replace( DIRECTORY_SEPARATOR, '/', $uri_from_location );
+ }
+
+ $url = content_url( $uri_from_location );
+ $url = apply_filters( 'w3tc_filename_to_url', $url );
+
+ return $url;
+ }
+
+ /**
+ * Returns true if database cluster is used.
+ *
+ * @static
+ *
+ * @return bool
+ */
+ public static function is_dbcluster( $config = null ) {
+ if ( is_null( $config ) ) {
+ // fallback for compatibility with older wp-content/db.php
+ $config = \W3TC\Dispatcher::config();
+ }
+
+ if ( !self::is_w3tc_pro( $config ) ) {
+ return false;
+ }
+
+ if ( isset( $GLOBALS['w3tc_dbcluster_config'] ) ) {
+ return true;
+ }
+
+ return defined( 'W3TC_FILE_DB_CLUSTER_CONFIG' ) &&
+ @file_exists( W3TC_FILE_DB_CLUSTER_CONFIG ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
+ }
+
+ /**
+ * Returns true if WPMU uses vhosts.
+ *
+ * @static
+ *
+ * @return bool
+ */
+ public static function is_wpmu_subdomain() {
+ return (
+ ( defined( 'SUBDOMAIN_INSTALL' ) && SUBDOMAIN_INSTALL ) ||
+ ( defined( 'VHOST' ) && 'yes' === VHOST )
+ );
+ }
+
+ /**
+ * Returns if there is multisite mode.
+ *
+ * @static
+ *
+ * @return bool
+ */
+ public static function is_wpmu() {
+ static $wpmu = null;
+
+ if ( null === $wpmu ) {
+ $wpmu = (
+ file_exists( ABSPATH . 'wpmu-settings.php' ) ||
+ ( defined( 'MULTISITE' ) && MULTISITE ) ||
+ defined( 'SUNRISE' ) ||
+ self::is_wpmu_subdomain()
+ );
+ }
+
+ return $wpmu;
+ }
+
+ /**
+ * Is using master config.
+ *
+ * @static
+ *
+ * @return bool
+ */
+ public static function is_using_master_config() {
+ if ( is_null( self::$is_using_master_config ) ) {
+ if ( ! self::is_wpmu() ) {
+ self::$is_using_master_config = true;
+ } elseif ( is_network_admin() ) {
+ self::$is_using_master_config = true;
+ } else {
+ $blog_data = Util_WpmuBlogmap::get_current_blog_data();
+ if ( is_null( $blog_data ) ) {
+ self::$is_using_master_config = true;
+ } else {
+ self::$is_using_master_config = ( 'm' === $blog_data[0] );
+ }
+ }
+ }
+
+ return self::$is_using_master_config;
+ }
+
+ /**
+ * Returns header W3TC adds to responses powered by itself.
+ *
+ * @static
+ *
+ * @return string
+ */
+ public static function w3tc_header() {
+ return W3TC_POWERED_BY .
+ '/' . W3TC_VERSION;
+ }
+
+ /**
+ * Check if URL is valid.
+ *
+ * @static
+ *
+ * @param string $url URL.
+ * @return bool
+ */
+ public static function is_url( $url ) {
+ return preg_match( '~^(https?:)?//~', $url );
+ }
+
+ /**
+ * Returns true if current connection is secure.
+ *
+ * @static
+ *
+ * @return bool
+ */
+ public static function is_https() {
+ $https = isset( $_SERVER['HTTPS'] ) ?
+ htmlspecialchars( stripslashes( $_SERVER['HTTPS'] ) ) : ''; // phpcs:ignore
+ $server_port = isset( $_SERVER['SERVER_PORT'] ) ?
+ htmlspecialchars( stripslashes( $_SERVER['SERVER_PORT'] ) ) : ''; // phpcs:ignore
+ $http_x_forwarded_proto = isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) ?
+ htmlspecialchars( stripslashes( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) ) : ''; // phpcs:ignore
+
+ switch ( true ) {
+ case ( self::to_boolean( $https ) ):
+ case ( 433 === (int) $server_port ):
+ case ( 'https' === $http_x_forwarded_proto ):
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Moves user to preview-mode or opposite.
+ *
+ * @static
+ */
+ public static function set_preview( $is_enabled ) {
+ if ( $is_enabled ) {
+ setcookie( 'w3tc_preview', '*', 0, '/' );
+ } else {
+ setcookie( 'w3tc_preview', '', time() - 3600, '/' );
+ }
+ }
+
+ /**
+ * Retuns true if preview settings active.
+ *
+ * @static
+ *
+ * @return bool
+ */
+ public static function is_preview_mode() {
+ return ! empty( $_COOKIE['w3tc_preview'] );
+ }
+
+ /**
+ * Returns true if server is Apache.
+ *
+ * @static
+ *
+ * @return bool
+ */
+ public static function is_apache() {
+ // Assume apache when unknown, since most common.
+ if ( empty( $_SERVER['SERVER_SOFTWARE'] ) ) {
+ return true;
+ }
+
+ return isset( $_SERVER['SERVER_SOFTWARE'] ) && stristr( htmlspecialchars( stripslashes( $_SERVER['SERVER_SOFTWARE'] ) ), 'Apache' ) !== false; // phpcs:ignore
+ }
+
+
+ /**
+ * Check whether server is LiteSpeed.
+ *
+ * @static
+ *
+ * @return bool
+ */
+ public static function is_litespeed() {
+ return isset( $_SERVER['SERVER_SOFTWARE'] ) && stristr( htmlspecialchars( stripslashes( $_SERVER['SERVER_SOFTWARE'] ) ), 'LiteSpeed' ) !== false; // phpcs:ignore
+ }
+
+ /**
+ * Returns true if server is nginx.
+ *
+ * @static
+ *
+ * @return bool
+ */
+ public static function is_nginx() {
+ return isset( $_SERVER['SERVER_SOFTWARE'] ) && stristr( htmlspecialchars( stripslashes( $_SERVER['SERVER_SOFTWARE'] ) ), 'nginx' ) !== false; // phpcs:ignore
+ }
+
+ /**
+ * Returns true if server is nginx.
+ *
+ * @static
+ *
+ * @return bool
+ */
+ public static function is_iis() {
+ return isset( $_SERVER['SERVER_SOFTWARE'] ) && stristr( htmlspecialchars( stripslashes( $_SERVER['SERVER_SOFTWARE'] ) ), 'IIS' ) !== false; // phpcs:ignore
+ }
+
+ /**
+ * Returns host/domain from URL.
+ *
+ * @static
+ *
+ * @param string $url URL.
+ * @return string
+ */
+ public static function url_to_host( $url ) {
+ $a = parse_url( $url ); // phpcs:ignore WordPress.WP.AlternativeFunctions.parse_url_parse_url
+
+ if ( isset( $a['host'] ) ) {
+ return $a['host'];
+ }
+
+ return '';
+ }
+
+ /**
+ * Returns path from URL. Without trailing slash.
+ *
+ * @static
+ *
+ * @param string $url URL.
+ */
+ public static function url_to_uri( $url ) {
+ $uri = @parse_url( $url, PHP_URL_PATH );
+
+ // Convert FALSE and other return values to string.
+ if ( empty( $uri ) ) {
+ return '';
+ }
+
+ return rtrim( $uri, '/' );
+ }
+
+ /**
+ * Returns current blog ID.
+ *
+ * @static
+ *
+ * @return int
+ */
+ public static function blog_id() {
+ global $w3_current_blog_id;
+
+ if ( ! is_null( $w3_current_blog_id ) ) {
+ return $w3_current_blog_id;
+ }
+
+ if ( ! self::is_wpmu() || is_network_admin() ) {
+ $w3_current_blog_id = 0;
+ return $w3_current_blog_id;
+ }
+
+ $blog_data = Util_WpmuBlogmap::get_current_blog_data();
+
+ if ( ! is_null( $blog_data ) ) {
+ $w3_current_blog_id = substr( $blog_data, 1 );
+ } else {
+ $w3_current_blog_id = 0;
+ }
+
+ return $w3_current_blog_id;
+ }
+
+ /**
+ * Memoized version of wp_upload_dir. That function is quite slow
+ * for a number of times CDN calls it.
+ *
+ * @static
+ *
+ * @return string
+ */
+ public static function wp_upload_dir() {
+ static $values_by_blog = array();
+
+ $blog_id = self::blog_id();
+
+ if ( ! isset( $values_by_blog[ $blog_id ] ) )
+ $values_by_blog[ $blog_id ] = wp_upload_dir();
+
+ return $values_by_blog[ $blog_id ];
+ }
+
+ /**
+ * Returns path to section's cache dir.
+ *
+ * @static
+ *
+ * @param string $section Section.
+ * @return string
+ */
+ public static function cache_dir( $section ) {
+ return W3TC_CACHE_DIR . DIRECTORY_SEPARATOR . $section;
+ }
+
+ /**
+ * Returns path to blog's cache dir.
+ *
+ * @static
+ *
+ * @param string $section Section.
+ * @param int $blog_id Blog id.
+ * @return string
+ */
+ public static function cache_blog_dir( $section, $blog_id = null ) {
+ if ( ! self::is_wpmu() ) {
+ $postfix = '';
+ } else {
+ if ( is_null( $blog_id ) ) {
+ $blog_id = self::blog_id();
+ }
+
+ $postfix = DIRECTORY_SEPARATOR . sprintf( '%d', $blog_id );
+
+ if ( defined( 'W3TC_BLOG_LEVELS' ) ) {
+ for ( $n = 0; $n < W3TC_BLOG_LEVELS; $n++ ) {
+ $postfix = DIRECTORY_SEPARATOR .
+ substr( $postfix, strlen( $postfix ) - 1 - $n, 1 ) .
+ $postfix;
+ }
+ }
+ }
+
+ return self::cache_dir( $section ) . $postfix;
+ }
+
+ /**
+ * Cache blog minify directory.
+ *
+ * @static
+ *
+ * @return string
+ */
+ public static function cache_blog_minify_dir() {
+ // when minify manual used with a shared config - shared
+ // minify urls has to be used too, since CDN upload is possible
+ // only from network admin
+ if ( self::is_wpmu() && self::is_using_master_config() && ! Dispatcher::config()->get_boolean( 'minify.auto' ) ) {
+ $path = self::cache_blog_dir( 'minify', 0 );
+ } else {
+ $path = self::cache_blog_dir( 'minify' );
+ }
+
+ return $path;
+ }
+
+ /**
+ * Returns URL regexp from URL.
+ *
+ * @static
+ *
+ * @param string $url URL.
+ * @return string
+ */
+ public static function get_url_regexp( $url ) {
+ $url = preg_replace( '~(https?:)?//~i', '', $url );
+ $url = preg_replace( '~^www\.~i', '', $url );
+
+ $regexp = '(https?:)?//(www\.)?' . self::preg_quote( $url );
+
+ return $regexp;
+ }
+
+ /**
+ * Returns SSL URL if current connection is https.
+ *
+ * @static
+ *
+ * @param string $url URL.
+ * @return string
+ */
+ public static function url_to_maybe_https( $url ) {
+ if ( self::is_https() ) {
+ $url = str_replace( 'http://', 'https://', $url );
+ }
+
+ return $url;
+ }
+
+ /**
+ * Get domain URL.
+ *
+ * @static
+ *
+ * @return string
+ */
+
+ public static function home_domain_root_url() {
+ $home_url = get_home_url();
+ $parse_url = @parse_url( $home_url ); // phpcs:ignore
+
+ if ( $parse_url && isset( $parse_url['scheme'] ) && isset( $parse_url['host'] ) ) {
+ $scheme = $parse_url['scheme'];
+ $host = $parse_url['host'];
+ $port = ( isset( $parse_url['port'] ) && 80 != $parse_url['port'] ? ':' . (int) $parse_url['port'] : '' ); // phpcs:ignore
+ $domain_url = sprintf( '%s://%s%s', $scheme, $host, $port );
+
+ return $domain_url;
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns domain url regexp.
+ *
+ * @static
+ *
+ * @return string
+ */
+ public static function home_domain_root_url_regexp() {
+ $domain_url = self::home_domain_root_url();
+ $regexp = self::get_url_regexp( $domain_url );
+
+ return $regexp;
+ }
+
+ /**
+ * Returns SSL home url.
+ *
+ * @static
+ *
+ * @return string
+ */
+ public static function home_url_maybe_https() {
+ $home_url = get_home_url();
+ $ssl = self::url_to_maybe_https( $home_url );
+
+ return $ssl;
+ }
+
+ /**
+ * Returns home url regexp.
+ *
+ * @static
+ *
+ * @return string
+ */
+ public static function home_url_regexp() {
+ $home_url = get_home_url();
+ $regexp = self::get_url_regexp( $home_url );
+
+ return $regexp;
+ }
+
+ /**
+ * Copy of WordPress get_home_path, but accessible not only for wp-admin
+ * Get the absolute filesystem path to the root of the WordPress installation
+ * (i.e. filesystem path of siteurl).
+ *
+ * @static
+ *
+ * @return string Full filesystem path to the root of the WordPress installation.
+ */
+ public static function site_path() {
+ $home = set_url_scheme( get_option( 'home' ), 'http' );
+ $siteurl = set_url_scheme( get_option( 'siteurl' ), 'http' );
+
+ $home_path = ABSPATH;
+ if ( ! empty( $home ) && 0 !== strcasecmp( $home, $siteurl ) ) {
+ $wp_path_rel_to_home = str_ireplace( $home, '', $siteurl ); // $siteurl - $home.
+
+ // fix of get_home_path, used when index.php is moved outside of wp folder.
+ $script_filename = isset( $_SERVER['SCRIPT_FILENAME'] ) ?
+ htmlspecialchars( stripslashes( $_SERVER['SCRIPT_FILENAME'] ) ) : ''; // phpcs:ignore
+
+ $pos = strripos(
+ str_replace( '\\', '/', $script_filename ),
+ trailingslashit( $wp_path_rel_to_home )
+ );
+
+ if ( false !== $pos ) {
+ $home_path = substr( $script_filename, 0, $pos );
+ $home_path = trailingslashit( $home_path );
+ } else if ( defined( 'WP_CLI' ) ) {
+ $pos = strripos(
+ str_replace( '\\', '/', ABSPATH ),
+ trailingslashit( $wp_path_rel_to_home )
+ );
+
+ if ( $pos !== false ) {
+ $home_path = substr( ABSPATH, 0, $pos );
+ $home_path = trailingslashit( $home_path );
+ }
+ }
+ }
+
+ return str_replace( '\\', DIRECTORY_SEPARATOR, $home_path );
+ }
+
+ /**
+ * Returns absolute path to document root.
+ * No trailing slash!
+ *
+ * @static
+ *
+ * @return string
+ */
+ public static function document_root() {
+ static $document_root = null;
+
+ if ( ! is_null( $document_root ) ) {
+ return $document_root;
+ }
+
+ $c = Dispatcher::config();
+ $docroot_fix = $c->get_boolean( 'docroot_fix.enable' );
+
+ if ( $docroot_fix ) {
+ $document_root = untrailingslashit( ABSPATH );
+ return $document_root;
+ }
+
+ if ( ! empty( $_SERVER['SCRIPT_FILENAME'] ) && ! empty( $_SERVER['PHP_SELF'] ) ) {
+ $script_filename = self::normalize_path(
+ htmlspecialchars( stripslashes( $_SERVER['SCRIPT_FILENAME'] ) ) // phpcs:ignore
+ );
+ $php_self = self::normalize_path(
+ htmlspecialchars( stripslashes( $_SERVER['PHP_SELF'] ) ) // phpcs:ignore
+ );
+ if ( substr( $script_filename, -strlen( $php_self ) ) == $php_self ) {
+ $document_root = substr( $script_filename, 0, -strlen( $php_self ) );
+ $document_root = realpath( $document_root );
+ return $document_root;
+ }
+ }
+
+ if ( ! empty( $_SERVER['PATH_TRANSLATED'] ) && ! empty( $_SERVER['PHP_SELF'] ) ) {
+ $document_root = substr(
+ self::normalize_path( htmlspecialchars( stripslashes( $_SERVER['PATH_TRANSLATED'] ) ) ), // phpcs:ignore
+ 0,
+ -strlen( self::normalize_path( htmlspecialchars( stripslashes( $_SERVER['PHP_SELF'] ) ) ) ) // phpcs:ignore
+ );
+ } elseif ( ! empty( $_SERVER['DOCUMENT_ROOT'] ) ) {
+ $document_root = self::normalize_path( htmlspecialchars( stripslashes( $_SERVER['DOCUMENT_ROOT'] ) ) ); // phpcs:ignore
+ } else {
+ $document_root = ABSPATH;
+ }
+
+ $document_root = realpath( $document_root );
+ return $document_root;
+ }
+
+ /**
+ * Returns absolute path to blog install dir
+ *
+ * Example:
+ *
+ * DOCUMENT_ROOT=/var/www/vhosts/domain.com
+ * install dir=/var/www/vhosts/domain.com/site/blog
+ * return /var/www/vhosts/domain.com/site/blog
+ *
+ * No trailing slash!
+ *
+ * @static
+ *
+ * @return string
+ */
+ public static function site_root() {
+ $site_root = ABSPATH;
+ $site_root = realpath( $site_root );
+ $site_root = self::normalize_path( $site_root );
+
+ return $site_root;
+ }
+
+ /**
+ * Returns blog path.
+ *
+ * Example:
+ *
+ * siteurl=http://domain.com/site/blog
+ * return /site/blog/
+ *
+ * With trailing slash!
+ *
+ * @static
+ *
+ * @return string
+ */
+ public static function site_url_uri() {
+ return self::url_to_uri( site_url() ) . '/';
+ }
+
+ /**
+ * Returns home domain.
+ *
+ * @static
+ *
+ * @return string
+ */
+ public static function home_url_host() {
+ $home_url = get_home_url();
+ $parse_url = @parse_url( $home_url ); // phpcs:ignore
+
+ if ( $parse_url && isset( $parse_url['host'] ) ) {
+ return $parse_url['host'];
+ }
+
+ return self::host();
+ }
+
+ /**
+ * Returns home path.
+ *
+ * Example:
+ *
+ * home=http://domain.com/site/
+ * siteurl=http://domain.com/site/blog
+ * return /site/
+ *
+ * With trailing slash!
+ *
+ * @static
+ *
+ * @return string
+ */
+ public static function home_url_uri() {
+ return self::url_to_uri( get_home_url() ) . '/';
+ }
+
+ /**
+ * Network home URL.
+ *
+ * @static
+ *
+ * @return string
+ */
+ public static function network_home_url_uri() {
+ $uri = network_home_url( '', 'relative' );
+
+ /*
+ * There is a bug in WP where network_home_url can return
+ * a non-relative URI even though scheme is set to relative.
+ */
+ if ( self::is_url( $uri ) ) {
+ $uri = parse_url( $uri, PHP_URL_PATH );
+ }
+
+ if ( empty( $uri ) ) {
+ return '/';
+ }
+
+ return $uri;
+ }
+
+ /**
+ * Returns server hostname with port.
+ *
+ * @static
+ *
+ * @return string
+ */
+ public static function host_port() {
+ static $host = null;
+
+ if ( null === $host ) {
+ if ( ! empty( $_SERVER['HTTP_HOST'] ) ) {
+ // HTTP_HOST sometimes is not set causing warning.
+ $host = htmlspecialchars( stripslashes( $_SERVER['HTTP_HOST'] ) ); // phpcs:ignore
+ } else {
+ $host = '';
+ }
+ }
+
+ return $host;
+ }
+
+ /**
+ * Host.
+ *
+ * @static
+ *
+ * @return string
+ */
+ public static function host() {
+ $host_port = self::host_port();
+
+ $pos = strpos( $host_port, ':' );
+
+ if ( $pos === false ) {
+ return $host_port;
+ }
+
+ return substr( $host_port, 0, $pos );
+ }
+
+ /**
+ * Returns WP config file path.
+ *
+ * @static
+ *
+ * @return string
+ */
+ public static function wp_config_path() {
+ $search = array(
+ ABSPATH . 'wp-config.php',
+ dirname( ABSPATH ) . DIRECTORY_SEPARATOR . 'wp-config.php',
+ );
+
+ foreach ( $search as $path ) {
+ if ( file_exists( $path ) ) {
+ return $path;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Parses path.
+ *
+ * @static
+ *
+ * @param string $path Path.
+ * @return mixed
+ */
+ public static function parse_path( $path ) {
+ $path = str_replace(
+ array(
+ '%BLOG_ID%',
+ '%POST_ID%',
+ '%BLOG_ID%',
+ '%HOST%',
+ ),
+ array(
+ ( isset( $GLOBALS['blog_id'] ) && is_numeric( $GLOBALS['blog_id'] ) ? (int) $GLOBALS['blog_id'] : 0 ),
+ ( isset( $GLOBALS['post_id'] ) && is_numeric( $GLOBALS['post_id'] ) ?
+ (int) $GLOBALS['post_id'] : 0 ),
+ self::blog_id(),
+ self::host(),
+ ),
+ $path
+ );
+
+ return $path;
+ }
+
+ /**
+ * Normalizes file name.
+ *
+ * Relative to site root!
+ *
+ * @static
+ *
+ * @param string $file File path.
+ * @return string
+ */
+ public static function normalize_file( $file ) {
+ if ( self::is_url( $file ) ) {
+ if ( strstr( $file, '?' ) === false ) {
+ $home_url_regexp = '~' . self::home_url_regexp() . '~i';
+ $file = preg_replace( $home_url_regexp, '', $file );
+ }
+ }
+
+ if ( ! self::is_url( $file ) ) {
+ $file = self::normalize_path( $file );
+ $file = str_replace( self::site_root(), '', $file );
+ $file = ltrim( $file, '/' );
+ }
+
+ return $file;
+ }
+
+ /**
+ * Normalizes file name for minify.
+ *
+ * Relative to document root!
+ *
+ * @static
+ *
+ * @param string $file
+ * @return string
+ */
+ public static function normalize_file_minify( $file ) {
+ if ( self::is_url( $file ) ) {
+ if ( strstr( $file, '?' ) === false ) {
+ $domain_url_regexp = '~' . self::home_domain_root_url_regexp() . '~i';
+ $file = preg_replace( $domain_url_regexp, '', $file );
+ }
+ }
+
+ if ( ! self::is_url( $file ) ) {
+ $file = self::normalize_path( $file );
+ $file = str_replace( self::document_root(), '', $file );
+ $file = ltrim( $file, '/' );
+ }
+
+ return $file;
+ }
+
+ /**
+ * Normalizes file name for minify.
+ * Relative to document root!
+ *
+ * @static
+ *
+ * @param string $file File path.
+ * @return string
+ */
+ public static function url_to_docroot_filename( $url ) {
+ $data = array(
+ 'home_url' => get_home_url(),
+ 'url' => $url,
+ );
+
+ $data = apply_filters( 'w3tc_url_to_docroot_filename', $data );
+
+ $home_url = $data['home_url'];
+ $normalized_url = $data['url'];
+ $normalized_url = self::remove_query_all( $normalized_url );
+
+ // Cut protocol.
+ $normalized_url = preg_replace( '~^http(s)?://~', '//', $normalized_url );
+ $home_url = preg_replace( '~^http(s)?://~', '//', $home_url );
+
+ if ( substr( $normalized_url, 0, strlen( $home_url ) ) !== $home_url ) {
+ // Not a home url, return unchanged since cant be converted to filename.
+ return null;
+ }
+
+ $path_relative_to_home = str_replace( $home_url, '', $normalized_url );
+ $home = set_url_scheme( get_option( 'home' ), 'http' );
+ $siteurl = set_url_scheme( get_option( 'siteurl' ), 'http' );
+ $home_path = rtrim( Util_Environment::site_path(), '/' );
+
+ // Adjust home_path if site is not is home.
+ if ( ! empty( $home ) && 0 !== strcasecmp( $home, $siteurl ) ) {
+ // $siteurl - $home/
+ $wp_path_rel_to_home = rtrim( str_ireplace( $home, '', $siteurl ), '/' );
+
+ if ( substr( $home_path, -strlen( $wp_path_rel_to_home ) ) ==
+ $wp_path_rel_to_home ) {
+ $home_path = substr( $home_path, 0, -strlen( $wp_path_rel_to_home ) );
+ }
+ }
+
+ // Common encoded characters.
+ $path_relative_to_home = str_replace( '%20', ' ', $path_relative_to_home );
+
+ $full_filename = $home_path . DIRECTORY_SEPARATOR .
+ trim( $path_relative_to_home, DIRECTORY_SEPARATOR );
+
+ $docroot = self::document_root();
+
+ if ( substr( $full_filename, 0, strlen( $docroot ) ) == $docroot ) {
+ $docroot_filename = substr( $full_filename, strlen( $docroot ) );
+ } else {
+ $docroot_filename = $path_relative_to_home;
+ }
+
+ /*
+ * Sometimes urls (coming from other plugins/themes)
+ * contain multiple "/" like "my-folder//myfile.js" which
+ * fails to recognize by filesystem, while url is accessible.
+ */
+ $docroot_filename = str_replace( '//', DIRECTORY_SEPARATOR, $docroot_filename );
+
+ return ltrim( $docroot_filename, DIRECTORY_SEPARATOR );
+ }
+
+ /**
+ * Document root to full filename.
+ *
+ * @static
+ *
+ * @param string $docroot_filename Document filename.
+ * @return strin
+ */
+ public static function docroot_to_full_filename( $docroot_filename ) {
+ return rtrim( Util_Environment::document_root(), DIRECTORY_SEPARATOR ) .
+ DIRECTORY_SEPARATOR . $docroot_filename;
+ }
+
+ /**
+ * Removes WP query string from URL.
+ *
+ * @static
+ */
+ public static function remove_query( $url ) {
+ $url = preg_replace( '~(\?|&|&|&)+ver=[a-z0-9-_\.]+~i', '', $url );
+
+ return $url;
+ }
+
+ /**
+ * Removes all query strings from url.
+ *
+ * @static
+ *
+ * @param string $url URL.
+ * @return string
+ */
+ public static function remove_query_all( $url ) {
+ $pos = strpos( $url, '?' );
+ if ( $pos === false ) {
+ return $url;
+ }
+
+ return substr( $url, 0, $pos );
+ }
+
+ /**
+ * Converts win path to unix.
+ *
+ * @static
+ *
+ * @param string $path Path.
+ * @return string
+ */
+ public static function normalize_path( $path ) {
+ $path = preg_replace( '~[/\\\]+~', '/', $path );
+ $path = rtrim( $path, '/' );
+
+ return $path;
+ }
+
+ /**
+ * Returns real path of given path.
+ *
+ * @static
+ *
+ * @param string $path Path.
+ * @return string
+ */
+ public static function realpath( $path ) {
+ $path = self::normalize_path( $path );
+ $parts = explode( '/', $path );
+ $absolutes = array();
+
+ foreach ( $parts as $part ) {
+ if ( '.' == $part ) {
+ continue;
+ }
+
+ if ( '..' == $part ) {
+ array_pop( $absolutes );
+ } else {
+ $absolutes[] = $part;
+ }
+ }
+
+ return implode( '/', $absolutes );
+ }
+
+ /**
+ * Returns real path of given path.
+ *
+ * @static
+ *
+ * @param string $path Path.
+ * @return string
+ */
+ public static function path_remove_dots( $path ) {
+ $parts = explode( '/', $path );
+ $absolutes = array();
+
+ foreach ( $parts as $part ) {
+ if ( '.' == $part ) {
+ continue;
+ }
+ if ( '..' == $part ) {
+ array_pop( $absolutes );
+ } else {
+ $absolutes[] = $part;
+ }
+ }
+
+ return implode( '/', $absolutes );
+ }
+
+ /**
+ * Returns full URL from relative one.
+ *
+ * @static
+ *
+ * @param string $relative_url Relative URL.
+ * @return string
+ */
+ public static function url_relative_to_full( $relative_url ) {
+ $relative_url = self::path_remove_dots( $relative_url );
+
+ if ( version_compare( PHP_VERSION, '5.4.7' ) < 0 ) {
+ if ( substr( $relative_url, 0, 2 ) === '//' ) {
+ $relative_url = ( self::is_https() ? 'https' : 'http' ) . ':' . $relative_url;
+ }
+ }
+
+ $rel = parse_url( $relative_url );
+ // it's full url already
+ if ( isset( $rel['scheme'] ) || isset( $rel['host'] ) )
+ return $relative_url;
+
+ if ( !isset( $rel['host'] ) ) {
+ $home_parsed = parse_url( get_home_url() );
+ $rel['host'] = $home_parsed['host'];
+ if ( isset( $home_parsed['port'] ) ) {
+ $rel['port'] = $home_parsed['port'];
+ }
+ }
+
+ $scheme = isset( $rel['scheme'] ) ? $rel['scheme'] . '://' : '//';
+ $host = isset( $rel['host'] ) ? $rel['host'] : '';
+ $port = isset( $rel['port'] ) ? ':' . $rel['port'] : '';
+ $path = isset( $rel['path'] ) ? $rel['path'] : '';
+ $query = isset( $rel['query'] ) ? '?' . $rel['query'] : '';
+ return "$scheme$host$port$path$query";
+ }
+
+ /**
+ * Redirects to URL.
+ *
+ * @static
+ *
+ * @param string $url URL.
+ * @param array $params Parameters.
+ */
+ public static function redirect( $url = '', $params = array() ) {
+ $url = self::url_format( $url, $params );
+ if ( function_exists( 'do_action' ) ) {
+ do_action( 'w3tc_redirect' );
+ }
+
+ @header( 'Location: ' . $url ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
+ exit();
+ }
+
+ /**
+ * Redirects to URL.
+ *
+ * @static
+ *
+ * @param string $url URL.
+ * @param array $params Parameters.
+ * @param bool $safe_redirect Safe redirect or not.
+ */
+ public static function safe_redirect_temp( $url = '', $params = array(), $safe_redirect = false ) {
+ $url = self::url_format( $url, $params );
+
+ if ( function_exists( 'do_action' ) ) {
+ do_action( 'w3tc_redirect' );
+ }
+
+ $status_code = 302;
+
+ $protocol = isset( $_SERVER['SERVER_PROTOCOL'] ) ?
+ htmlspecialchars( stripslashes( $_SERVER['SERVER_PROTOCOL'] ) ) : ''; // phpcs:ignore
+
+ if ( 'HTTP/1.1' === $protocol ) {
+ $status_code = 307;
+ }
+
+ $text = get_status_header_desc( $status_code );
+ if ( ! empty( $text ) ) {
+ $status_header = "$protocol $status_code $text";
+ @header( $status_header, true, $status_code );
+ }
+
+ add_action(
+ 'wp_safe_redirect_fallback',
+ array( '\W3TC\Util_Environment', 'wp_safe_redirect_fallback' )
+ );
+
+ @header( 'Cache-Control: no-cache' ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
+ wp_safe_redirect( $url, $status_code );
+ exit();
+ }
+
+ /**
+ * Fallback for wp_sfe_redirect().
+ *
+ * @static
+ *
+ * @param string $url URL.
+ * @return string
+ */
+ public static function wp_safe_redirect_fallback( $url ) {
+ return home_url( '?w3tc_repeat=invalid' );
+ }
+
+ /**
+ * Detects post ID.
+ *
+ * @static
+ *
+ * @return int
+ */
+ public static function detect_post_id() {
+ global $posts, $comment_post_ID, $post_ID; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
+
+ $p_val = Util_Request::get_integer( 'p' );
+
+ if ( $post_ID ) {
+ return $post_ID;
+ } elseif ( $comment_post_ID ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
+ return $comment_post_ID; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
+ } elseif ( ( is_single() || is_page() ) && is_array( $posts ) && isset( $posts[0]->ID ) ) {
+ return $posts[0]->ID;
+ } elseif ( isset( $posts->ID ) ) {
+ return $posts->ID;
+ } elseif ( ! empty( $p_val ) ) {
+ return $p_val;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Get W3TC instance id.
+ *
+ * @static
+ *
+ * @return int
+ */
+ public static function instance_id() {
+ if ( defined( 'W3TC_INSTANCE_ID' ) ) {
+ return W3TC_INSTANCE_ID;
+ }
+
+ static $instance_id;
+
+ if ( ! isset( $instance_id ) ) {
+ $config = Dispatcher::config();
+ $instance_id = $config->get_integer( 'common.instance_id', 0 );
+ }
+
+ return $instance_id;
+ }
+
+ /**
+ * Get W3TC edition.
+ *
+ * @static
+ *
+ * @param Config $config Config.
+ * @return string
+ */
+ public static function w3tc_edition( $config = null ) {
+ if ( self::is_w3tc_pro( $config ) && self::is_w3tc_pro_dev() ) {
+ return 'pro development';
+ }
+
+ if ( self::is_w3tc_pro( $config ) ) {
+ return 'pro';
+ }
+
+ return 'community';
+ }
+
+ /**
+ * Is W3TC Pro.
+ *
+ * @static
+ *
+ * @param Config $config Config.
+ * @return bool
+ */
+ public static function is_w3tc_pro( $config = null ) {
+ if ( defined( 'W3TC_PRO' ) && W3TC_PRO ) {
+ return true;
+ }
+
+ if ( defined( 'W3TC_ENTERPRISE' ) && W3TC_ENTERPRISE ) {
+ return true;
+ }
+
+ if ( is_object( $config ) ) {
+ $plugin_type = $config->get_string( 'plugin.type' );
+
+ if ( 'pro' === $plugin_type || 'pro_dev' === $plugin_type ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Enable Pro Dev mode support.
+ *
+ * @static
+ *
+ * @return bool
+ */
+ public static function is_w3tc_pro_dev() {
+ return defined( 'W3TC_PRO_DEV_MODE' ) && W3TC_PRO_DEV_MODE;
+ }
+
+ /**
+ * Quotes regular expression string.
+ *
+ * @static
+ *
+ * @param string $string String.
+ * @param string $delimiter Delimeter.
+ * @return string
+ */
+ public static function preg_quote( $string, $delimiter = '~' ) {
+ $string = preg_quote( $string, $delimiter );
+ $string = strtr(
+ $string,
+ array( ' ' => '\ ' )
+ );
+
+ return $string;
+ }
+
+ /**
+ * Returns true if zlib output compression is enabled otherwise false.
+ *
+ * @static
+ *
+ * @return bool
+ */
+ public static function is_zlib_enabled() {
+ return self::to_boolean( ini_get( 'zlib.output_compression' ) );
+ }
+
+ /**
+ * Recursive strips slahes from the var.
+ *
+ * @static
+ *
+ * @param mixed $var Value.
+ * @return mixed
+ */
+ public static function stripslashes( $var ) {
+ if ( is_string( $var ) ) {
+ return stripslashes( $var );
+ } elseif ( is_array( $var ) ) {
+ $var = array_map( array( '\W3TC\Util_Environment', 'stripslashes' ), $var );
+ }
+
+ return $var;
+ }
+
+ /**
+ * Checks if post should be flushed or not. Returns true if it should not be flushed.
+ *
+ * @static
+ *
+ * @param object $post Post object.
+ * @param string $module Which cache module to check against (pgcache, varnish, dbcache or objectcache).
+ * @param Config $config Config.
+ * @return bool
+ */
+ public static function is_flushable_post( $post, $module, $config ) {
+ if ( is_numeric( $post ) ) {
+ $post = get_post( $post );
+ }
+
+ $post_status = array( 'publish' );
+
+ /**
+ * Dont flush when we have post "attachment"
+ * its child of the post and is flushed always when post is published, while not changed in fact.
+ */
+ $post_type = array( 'revision', 'attachment' );
+ switch ( $module ) {
+ case 'pgcache':
+ case 'varnish':
+ case 'posts': // Means html content of post pages.
+ if ( ! $config->get_boolean( 'pgcache.reject.logged' ) ) {
+ $post_status[] = 'private';
+ }
+ break;
+ case 'dbcache':
+ if ( ! $config->get_boolean( 'dbcache.reject.logged' ) ) {
+ $post_status[] = 'private';
+ }
+ break;
+ }
+
+ $flushable = is_object( $post ) && ! in_array( $post->post_type, $post_type, true ) && in_array( $post->post_status, $post_status, true );
+
+ return apply_filters( 'w3tc_flushable_post', $flushable, $post, $module );
+ }
+
+ /**
+ * Checks if post belongs to a custom post type.
+ *
+ * @since 2.1.7
+ * @static
+ *
+ * @param object $post Post object.
+ * @return bool
+ */
+ public static function is_custom_post_type( $post ) {
+ $post_type = get_post_type_object( $post->post_type );
+
+ // post type not found belongs to default post type(s).
+ if ( empty( $post_type ) ) {
+ return false;
+ }
+
+ // check if custom.
+ if ( false === $post_type->_builtin ) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Converts value to boolean.
+ *
+ * @static
+ *
+ * @param mixed $value Value.
+ * @return bool
+ */
+ public static function to_boolean( $value ) {
+ if ( is_string( $value ) ) {
+ switch ( strtolower( $value ) ) {
+ case '+':
+ case '1':
+ case 'y':
+ case 'on':
+ case 'yes':
+ case 'true':
+ case 'enabled':
+ return true;
+
+ case '-':
+ case '0':
+ case 'n':
+ case 'no':
+ case 'off':
+ case 'false':
+ case 'disabled':
+ return false;
+ }
+ }
+
+ return (boolean) $value;
+ }
+
+ /**
+ * Returns the apache, nginx version.
+ *
+ * @static
+ *
+ * @return string
+ */
+ public static function get_server_version() {
+ $sig = explode(
+ '/',
+ isset( $_SERVER['SERVER_SOFTWARE'] ) ?
+ htmlspecialchars( stripslashes( $_SERVER['SERVER_SOFTWARE'] ) ) : '' // phpcs:ignore
+ );
+ $temp = isset( $sig[1] ) ? explode( ' ', $sig[1] ) : array( '0' );
+ $version = $temp[0];
+
+ return $version;
+ }
+
+ /**
+ * Checks if current request is REST REQUEST.
+ *
+ * @static
+ */
+ public static function is_rest_request( $url ) {
+ if ( defined( 'REST_REQUEST' ) && REST_REQUEST )
+ return true;
+
+ // in case when called before constant is set
+ // wp filters are not available in that case
+ return preg_match( '~' . W3TC_WP_JSON_URI . '~', $url );
+ }
+
+ /**
+ * Reset microcache.
+ *
+ * @static
+ */
+ public static function reset_microcache() {
+ global $w3_current_blog_id;
+ $w3_current_blog_id = null;
+
+ self::$is_using_master_config = null;
+ }
+
+ /**
+ * Removes blank lines, trim values, removes duplicates, and sorts array.
+ *
+ * @since 2.4.3
+ *
+ * @param array $values Array of values.
+ *
+ * @return array
+ */
+ public static function clean_array( $values ) {
+ if ( ! empty( $values ) && is_array( $values ) ) {
+ $values = array_unique(
+ array_filter(
+ array_map(
+ 'trim',
+ $values
+ ),
+ 'strlen'
+ )
+ );
+ sort( $values );
+ }
+
+ return $values;
+ }
+
+ /**
+ * Parses textarea setting value from string to array.
+ *
+ * @since 2.4.3
+ *
+ * @param string $value Value.
+ *
+ * @return array
+ */
+ public static function textarea_to_array( $value ) {
+ $values_array = array();
+
+ if ( ! empty( $value ) ) {
+ $values_array = self::clean_array(
+ preg_split(
+ '/\R/',
+ $value,
+ 0,
+ PREG_SPLIT_NO_EMPTY
+ )
+ );
+ }
+
+ return $values_array;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Environment_Exception.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Environment_Exception.php
new file mode 100644
index 00000000..ea258132
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Environment_Exception.php
@@ -0,0 +1,15 @@
+technical_message = $technical_message;
+ }
+
+ public function technical_message() {
+ return $this->technical_message;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Environment_Exceptions.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Environment_Exceptions.php
new file mode 100644
index 00000000..ee1d8ebd
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Environment_Exceptions.php
@@ -0,0 +1,49 @@
+exceptions = array();
+ }
+
+ public function push( $ex ) {
+ if ( $ex instanceof Util_Environment_Exceptions ) {
+ foreach ( $ex->exceptions() as $ex2 )
+ $this->push( $ex2 );
+ } else {
+ if ( $this->credentials_form == null &&
+ $ex instanceof Util_WpFile_FilesystemOperationException &&
+ $ex->credentials_form() != null )
+ $this->credentials_form = $ex->credentials_form();
+ $this->exceptions[] = $ex;
+ }
+ }
+
+ /**
+ *
+ *
+ * @return Exception[]
+ */
+ public function exceptions() {
+ return $this->exceptions;
+ }
+
+ public function credentials_form() {
+ return $this->credentials_form;
+ }
+
+ public function getCombinedMessage() {
+ $s = '';
+ foreach ( $this->exceptions as $m ) {
+ $s .= $m->getMessage() . "\r\n";
+ }
+
+ return $s;
+ }
+
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_File.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_File.php
new file mode 100644
index 00000000..3c065ecf
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_File.php
@@ -0,0 +1,478 @@
+= count( $filename_parts ) ||
+ $equal_number >= count( $base_dir_parts ) )
+ break;
+ if ( $filename_parts[$equal_number] != $base_dir_parts[$equal_number] )
+ break;
+ }
+
+ $relative_dir = str_repeat( '../', count( $base_dir_parts ) - $equal_number );
+ $relative_dir .= implode( '/', array_slice( $filename_parts, $equal_number ) );
+
+ return $relative_dir;
+ }
+
+ /**
+ * Returns open basedirs
+ *
+ * @return array
+ */
+ static public function get_open_basedirs() {
+ $open_basedir_ini = ini_get( 'open_basedir' );
+ $open_basedirs = ( W3TC_WIN ? preg_split( '~[;,]~', $open_basedir_ini ) : explode( ':', $open_basedir_ini ) );
+ $result = array();
+
+ foreach ( $open_basedirs as $open_basedir ) {
+ $open_basedir = trim( $open_basedir );
+ if ( !empty( $open_basedir ) && $open_basedir != '' ) {
+ $result[] = Util_Environment::realpath( $open_basedir );
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Checks if path is restricted by open_basedir
+ *
+ * @param string $path
+ * @return boolean
+ */
+ static public function check_open_basedir( $path ) {
+ $path = Util_Environment::realpath( $path );
+ $open_basedirs = Util_File::get_open_basedirs();
+
+ if ( !count( $open_basedirs ) ) {
+ return true;
+ }
+
+ foreach ( $open_basedirs as $open_basedir ) {
+ if ( strstr( $path, $open_basedir ) !== false ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Get the octal file permission number of a file or directory.
+ *
+ * @param string $file File path.
+ * @return int
+ */
+ public static function get_file_permissions( $file ) {
+ if ( function_exists( 'fileperms' ) && $fileperms = @fileperms( $file ) ) { // phpcs:ignore
+ $fileperms = 0777 & $fileperms;
+ } else {
+ clearstatcache();
+ $stat = @stat( $file ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
+
+ if ( $stat ) {
+ $fileperms = 0777 & $stat['mode'];
+ } else {
+ $fileperms = 0;
+ }
+ }
+ return intval( decoct( $fileperms ) );
+ }
+
+ static public function get_file_owner( $file = '' ) {
+ $fileowner = $filegroup = 'unknown';
+ if ( $file ) {
+ if ( function_exists( 'fileowner' ) && function_exists( 'fileowner' ) ) {
+ $fileowner = @fileowner( $file );
+ $filegroup = @filegroup( $file );
+ if ( function_exists( 'posix_getpwuid' ) && function_exists( 'posix_getgrgid' ) ) {
+ $fileowner = @posix_getpwuid( $fileowner );
+ $fileowner = $fileowner['name'];
+ $filegroup = @posix_getgrgid( $filegroup );
+ $filegroup = $filegroup['name'];
+ }
+ }
+ } else {
+ if ( function_exists( 'getmyuid' ) && function_exists( 'getmygid' ) ) {
+ $fileowner = @getmyuid();
+ $filegroup = @getmygid();
+ if ( function_exists( 'posix_getpwuid' ) && function_exists( 'posix_getgrgid' ) ) {
+ $fileowner = @posix_getpwuid( $fileowner );
+ $fileowner = $fileowner['name'];
+ $filegroup = @posix_getgrgid( $filegroup );
+ $filegroup = $filegroup['name'];
+ }
+ }
+ }
+ return $fileowner . ':' . $filegroup;
+ }
+
+ /**
+ * Creates W3TC_CACHE_TMP_DIR dir if required
+ *
+ * @throws Exception
+ * @return string
+ */
+ static public function create_tmp_dir() {
+ if ( !is_dir( W3TC_CACHE_TMP_DIR ) || !is_writable( W3TC_CACHE_TMP_DIR ) ) {
+ Util_File::mkdir_from( W3TC_CACHE_TMP_DIR, W3TC_CACHE_DIR );
+
+ if ( !is_dir( W3TC_CACHE_TMP_DIR ) || !is_writable( W3TC_CACHE_TMP_DIR ) ) {
+ $e = error_get_last();
+ $description = ( isset( $e['message'] ) ? $e['message'] : '' );
+
+ throw new \Exception( 'Can\'t create folder ' .
+ W3TC_CACHE_TMP_DIR . ' : ' . $description );
+ }
+ }
+
+ return W3TC_CACHE_TMP_DIR;
+ }
+
+ /**
+ * Atomically writes file inside W3TC_CACHE_DIR dir
+ *
+ * @param unknown $filename
+ * @param unknown $content
+ * @throws Exception
+ * @return void
+ */
+ static public function file_put_contents_atomic( $filename, $content ) {
+ Util_File::create_tmp_dir();
+ $temp = tempnam( W3TC_CACHE_TMP_DIR, 'temp' );
+
+ try {
+ if ( !( $f = @fopen( $temp, 'wb' ) ) ) {
+ if ( file_exists( $temp ) )
+ @unlink( $temp );
+ throw new \Exception( 'Can\'t write to temporary file ' .
+ $temp . ' ' );
+ }
+
+ fwrite( $f, $content );
+ fclose( $f );
+
+ if ( !@rename( $temp, $filename ) ) {
+ @unlink( $filename );
+ if ( !@rename( $temp, $filename ) ) {
+ Util_File::mkdir_from( dirname( $filename ), W3TC_CACHE_DIR );
+ if ( !@rename( $temp, $filename ) ) {
+ throw new \Exception( 'Can\'t write to file ' .
+ $filename . ' ' );
+ }
+ }
+ }
+
+ $chmod = 0644;
+ if ( defined( 'FS_CHMOD_FILE' ) )
+ $chmod = FS_CHMOD_FILE;
+ @chmod( $filename, $chmod );
+ } catch ( \Exception $ex ) {
+ if ( file_exists( $temp ) )
+ @unlink( $temp );
+ throw $ex;
+ }
+ }
+
+
+ /**
+ * Takes a W3TC settings array and formats it to a PHP String
+ *
+ * @param unknown $data
+ * @return string
+ */
+ static public function format_data_as_settings_file( $data ) {
+ $config = " $value )
+ $config .= Util_File::format_array_entry_as_settings_file_entry( 1, $key, $value );
+ $config .= ");";
+ return $config;
+ }
+
+
+ /**
+ * Writes array item to file
+ *
+ * @param int $tabs
+ * @param string $key
+ * @param mixed $value
+ * @return string
+ */
+ static public function format_array_entry_as_settings_file_entry( $tabs, $key, $value ) {
+ $item = str_repeat( "\t", $tabs );
+
+ if ( is_numeric( $key ) && (string)(int)$key === (string)$key ) {
+ $item .= sprintf( "%d => ", $key );
+ } else {
+ $item .= sprintf( "'%s' => ", addcslashes( $key, "'\\" ) );
+ }
+
+ switch ( gettype( $value ) ) {
+ case 'object':
+ case 'array':
+ $item .= "array(\r\n";
+ foreach ( (array)$value as $k => $v ) {
+ $item .= Util_File::format_array_entry_as_settings_file_entry( $tabs + 1, $k, $v );
+ }
+ $item .= sprintf( "%s),\r\n", str_repeat( "\t", $tabs ) );
+ return $item;
+
+ case 'integer':
+ $data = (string)$value;
+ break;
+
+ case 'double':
+ $data = (string)$value;
+ break;
+
+ case 'boolean':
+ $data = ( $value ? 'true' : 'false' );
+ break;
+
+ case 'NULL':
+ $data = 'null';
+ break;
+
+ default:
+ case 'string':
+ $data = "'" . addcslashes( $value, "'\\" ) . "'";
+ break;
+ }
+
+ $item .= $data . ",\r\n";
+
+ return $item;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Http.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Http.php
new file mode 100644
index 00000000..6f4944c1
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Http.php
@@ -0,0 +1,224 @@
+ W3TC_POWERED_BY
+ ), $args );
+
+ return wp_remote_request( $url, $args );
+ }
+
+ /**
+ * Sends HTTP GET request
+ *
+ * @param string $url
+ * @param array $args
+ * @return array|WP_Error
+ */
+ static public function get( $url, $args = array() ) {
+ $args = array_merge( $args, array(
+ 'method' => 'GET'
+ ) );
+
+ return self::request( $url, $args );
+ }
+
+ /**
+ * Downloads URL into a file
+ *
+ * @param string $url
+ * @param string $file
+ * @return boolean
+ */
+ static public function download( $url, $file, $args = array() ) {
+ if ( strpos( $url, '//' ) === 0 ) {
+ $url = ( Util_Environment::is_https() ? 'https:' : 'http:' ) . $url;
+ }
+
+ $response = self::get( $url, $args );
+
+ if ( !is_wp_error( $response ) && $response['response']['code'] == 200 ) {
+ return @file_put_contents( $file, $response['body'] );
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns upload info
+ *
+ * @return array
+ */
+ static public function upload_info() {
+ static $upload_info = null;
+
+ if ( $upload_info === null ) {
+ $upload_info = Util_Environment::wp_upload_dir();
+
+ if ( empty( $upload_info['error'] ) ) {
+ $parse_url = @parse_url( $upload_info['baseurl'] );
+
+ if ( $parse_url ) {
+ $baseurlpath = ( !empty( $parse_url['path'] ) ? trim( $parse_url['path'], '/' ) : '' );
+ } else {
+ $baseurlpath = 'wp-content/uploads';
+ }
+
+ $upload_info['baseurlpath'] = '/' . $baseurlpath . '/';
+ } else {
+ $upload_info = false;
+ }
+ }
+
+ return $upload_info;
+ }
+
+ /**
+ * Test the time to first byte.
+ *
+ * @param string $url URL address.
+ * @param bool $nocache Whether or not to request no cache response, by sending a Cache-Control header.
+ * @return float|false Time in seconds until the first byte is about to be transferred or false on error.
+ */
+ public static function ttfb( $url, $nocache = false ) {
+ $ch = curl_init( esc_url( $url ) ); // phpcs:ignore WordPress.WP.AlternativeFunctions
+
+ $pass = (bool) $ch;
+ $ttfb = false;
+ $opts = array(
+ CURLOPT_FORBID_REUSE => 1,
+ CURLOPT_FRESH_CONNECT => 1,
+ CURLOPT_HEADER => 0,
+ CURLOPT_RETURNTRANSFER => 1,
+ CURLOPT_FOLLOWLOCATION => 1,
+ CURLOPT_SSL_VERIFYPEER => false,
+ CURLOPT_USERAGENT => 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ),
+ );
+
+ if ( $nocache ) {
+ $opts[ CURLOPT_HTTPHEADER ] = array(
+ 'Cache-Control: no-cache',
+ 'Pragma: no-cache',
+ );
+
+ $qs_arr = explode( '&', wp_parse_url( $url, PHP_URL_QUERY ) );
+ array_push( $qs_arr, 'time=' . microtime( true ) );
+
+ $opts[ CURLOPT_URL ] = $url . '?' . implode( '&', $qs_arr );
+ }
+
+ if ( $ch ) {
+ $pass = curl_setopt_array( $ch, $opts ); // phpcs:ignore WordPress.WP.AlternativeFunctions
+ }
+
+ if ( $pass ) {
+ $pass = (bool) curl_exec( $ch ); // phpcs:ignore WordPress.WP.AlternativeFunctions
+ }
+
+ if ( $pass ) {
+ $ttfb = curl_getinfo( $ch, CURLINFO_STARTTRANSFER_TIME ); // phpcs:ignore WordPress.WP.AlternativeFunctions
+ }
+
+ if ( $ch ) {
+ curl_close( $ch ); // phpcs:ignore WordPress.WP.AlternativeFunctions
+ }
+
+ return $ttfb;
+ }
+
+ /**
+ * Retrieve HTTP headers.
+ *
+ * @param string $url URL address.
+ * @return array
+ */
+ public static function get_headers( $url ) {
+ $ch = curl_init( $url ); // phpcs:ignore WordPress.WP.AlternativeFunctions
+ $pass = (bool) $ch;
+ $headers = array();
+ $opts = array(
+ CURLOPT_FORBID_REUSE => 1,
+ CURLOPT_FRESH_CONNECT => 1,
+ CURLOPT_HEADER => 1,
+ CURLOPT_RETURNTRANSFER => 1,
+ CURLOPT_FOLLOWLOCATION => 1,
+ CURLOPT_SSL_VERIFYPEER => false,
+ CURLOPT_USERAGENT => 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ),
+ CURLOPT_HTTPHEADER => array(
+ 'Cache-Control: no-cache',
+ 'Pragma: no-cache',
+ ),
+ );
+
+ if ( $pass ) {
+ $pass = curl_setopt_array( $ch, $opts ); // phpcs:ignore WordPress.WP.AlternativeFunctions
+ }
+
+ if ( $pass ) {
+ $response = curl_exec( $ch ); // phpcs:ignore WordPress.WP.AlternativeFunctions
+ }
+
+ if ( $response ) {
+ $header_size = curl_getinfo( $ch, CURLINFO_HEADER_SIZE ); // phpcs:ignore WordPress.WP.AlternativeFunctions
+ $header = substr( $response, 0, $header_size );
+
+ foreach ( explode( "\r\n", $header ) as $index => $line ) {
+ if ( 0 === $index ) {
+ $headers['http_code'] = $line;
+ $http_code_arr = explode( ' ', $line );
+ $headers['protocol'] = $http_code_arr[0];
+ $headers['status'] = $http_code_arr[1];
+ } elseif ( ! empty( $line ) && false !== strpos( $line, ':' ) ) {
+ list ( $key, $value ) = explode( ': ', $line );
+ $headers[ $key ] = $value;
+ }
+ }
+ }
+
+ if ( $ch ) {
+ curl_close( $ch ); // phpcs:ignore WordPress.WP.AlternativeFunctions
+ }
+
+ return $headers;
+ }
+
+ /**
+ * Generate unique md5 value based on domain.
+ *
+ * @return string
+ */
+ public static function generate_site_id() {
+ return md5( network_home_url() );
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Installed.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Installed.php
new file mode 100644
index 00000000..289df189
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Installed.php
@@ -0,0 +1,163 @@
+ $servers,
+ 'persistent' => false,
+ 'binary_protocol' => $binary_protocol,
+ 'username' => $username,
+ 'password' => $password
+ )
+ );
+
+ if ( is_null( $memcached ) ) {
+ return false;
+ }
+
+ $test_string = sprintf( 'test_' . md5( time() ) );
+ $test_value = array( 'content' => $test_string );
+
+ $memcached->set( $test_string, $test_value, 60 );
+
+ $test_value = $memcached->get( $test_string );
+ $results[ $key ] = ( ! empty( $test_value['content'] ) && $test_value['content'] === $test_string );
+ }
+
+ return $results[ $key ];
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Mime.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Mime.php
new file mode 100644
index 00000000..b17d0521
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Mime.php
@@ -0,0 +1,117 @@
+ $type ) {
+ if ( preg_match( '~\.(' . $extension . ')$~i', $file ) ) {
+ if ( is_array( $type ) )
+ $mime_type = array_pop( $type );
+ else
+ $mime_type = $type;
+ break;
+ }
+ }
+
+ /**
+ * Try to detect using file info function
+ */
+ if ( !$mime_type && function_exists( 'finfo_open' ) ) {
+ $finfo = @finfo_open( FILEINFO_MIME );
+
+ if ( !$finfo ) {
+ $finfo = @finfo_open( FILEINFO_MIME );
+ }
+
+ if ( $finfo ) {
+ $mime_type = @finfo_file( $finfo, $file );
+
+ if ( $mime_type ) {
+ $extra_mime_type_info = strpos( $mime_type, "; " );
+
+ if ( $extra_mime_type_info ) {
+ $mime_type = substr( $mime_type, 0, $extra_mime_type_info );
+ }
+
+ if ( $mime_type == 'application/octet-stream' ) {
+ $mime_type = false;
+ }
+ }
+
+ @finfo_close( $finfo );
+ }
+ }
+
+ /**
+ * Try to detect using mime type function
+ */
+ if ( !$mime_type && function_exists( 'mime_content_type' ) ) {
+ $mime_type = @mime_content_type( $file );
+ }
+
+ /**
+ * If detection failed use default mime type
+ */
+ if ( !$mime_type ) {
+ $mime_type = 'application/octet-stream';
+ }
+
+ $cache[$file] = $mime_type;
+ }
+
+ return $cache[$file];
+ }
+
+
+
+ static public function sections_to_mime_types_map() {
+ static $sections_to_mime_types_array = null;
+
+ if ( is_null( $sections_to_mime_types_array ) ) {
+ $sections_to_mime_types_array = array(
+ 'cssjs' => include W3TC_INC_DIR . '/mime/cssjs.php',
+ 'html' => include W3TC_INC_DIR . '/mime/html.php',
+ 'other' => include W3TC_INC_DIR . '/mime/other.php'
+ );
+ }
+
+ return $sections_to_mime_types_array;
+ }
+
+
+
+ static public function mime_type_to_section( $mime_type ) {
+ static $mime_type_to_section_array = null;
+
+ if ( is_null( $mime_type_to_section_array ) ) {
+ $sections = self::sections_to_mime_types_map();
+
+ $mime_type_to_section_array = array();
+
+ foreach ( $sections as $section => $mime_types ) {
+ foreach ( $mime_types as $mime_type ) {
+ $mime_type_to_section_array[$mime_type] = $section;
+ }
+ }
+ }
+
+ return isset( $mime_type_to_section_array[$mime_type] ) ?
+ $mime_type_to_section_array[$mime_type] : null;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_PageSpeed.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_PageSpeed.php
new file mode 100644
index 00000000..a0c0049f
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_PageSpeed.php
@@ -0,0 +1,832 @@
+= 90 ) {
+ $color = '#0c6';
+ } elseif ( $score >= 50 && $score < 90 ) {
+ $color = '#fa3';
+ } elseif ( $score >= 0 && $score < 50 ) {
+ $color = '#f33';
+ }
+ }
+ return $color;
+ }
+
+ /**
+ * Render the PageSpeed desktop/mobile score guage.
+ *
+ * @param array $data PageSpeed desktop/mobile data containing score key.
+ * @param string $icon Desktop/Mobile icon value.
+ *
+ * @return void
+ */
+ public static function print_gauge( $data, $icon ) {
+ if ( ! isset( $data ) || empty( $data['score'] ) || empty( $icon ) ) {
+ return;
+ }
+
+ $color = self::get_gauge_color( $data['score'] );
+ $angle = self::get_gauge_angle( $data['score'] );
+
+ ?>
+
+ = 90 ) {
+ $bar = '' . esc_html( $metric['displayValue'] ) . '
';
+ } elseif ( $metric['score'] >= 50 && $metric['score'] < 90 ) {
+ $bar = '' . esc_html( $metric['displayValue'] ) . '
';
+ } elseif ( $metric['score'] < 50 ) {
+ $bar = '' . esc_html( $metric['displayValue'] ) . '
';
+ }
+
+ echo wp_kses(
+ '' . $bar . '
',
+ array(
+ 'div' => array(
+ 'style' => array(),
+ 'class' => array(),
+ ),
+ 'span' => array(
+ 'class' => array(),
+ ),
+ )
+ );
+ }
+
+ /**
+ * Render core metric for desktop/mobile. Used by PageSpeed page.
+ *
+ * @param array $data PageSpeed data.
+ * @param string $metric Metric key.
+ * @param string $name Metric name.
+ * @param bool $widget Widget flag to add line break between desktop/mobile metric.
+ *
+ * @return void
+ */
+ public static function print_bar_combined_with_icon( $data, $metric, $name, $widget = false ) {
+ if ( ! isset( $data ) || empty( $metric ) || empty( $name ) ) {
+ return;
+ }
+
+ $widget_break = $widget ? ' ' : '';
+
+ ?>
+
+
+
+ = 90 ) {
+ $notice = 'notice notice-success inline';
+ } elseif ( $score >= 50 && $score < 90 ) {
+ $noitce = 'notice notice-warning inline';
+ } elseif ( $score >= 0 && $score < 50 ) {
+ $notice = 'notice notice-error inline';
+ }
+ }
+ return $notice;
+ }
+
+ /**
+ * Get PageSpeed metric grade.
+ *
+ * @param int $score PageSpeed desktop/mobile score.
+ * @param string $display_mode PageSpeed desktop/mobile score display mode.
+ *
+ * @return string
+ */
+ public static function get_breakdown_grade( $score, $display_mode ) {
+ $grade = 'w3tcps_blank';
+ if ( isset( $display_mode ) && in_array( $display_mode, array( 'metric', 'metricSavings' ), true ) && isset( $score ) && is_numeric( $score ) ) {
+ if ( $score >= 90 ) {
+ $grade = 'w3tcps_pass';
+ } elseif ( $score >= 50 && $score < 90 ) {
+ $grade = 'w3tcps_average';
+ } elseif ( $score >= 0 && $score < 50 ) {
+ $grade = 'w3tcps_fail';
+ }
+ }
+ return $grade;
+ }
+
+ /**
+ * Render the final generated screenshot.
+ *
+ * @param array $data PageSpeed data.
+ *
+ * @return void
+ */
+ public static function print_final_screenshot( $data ) {
+ if ( isset( $data ) && isset( $data['screenshots']['final']['screenshot'] ) ) {
+ echo ' ';
+ }
+ }
+
+ /**
+ * Render all "building" screenshots.
+ *
+ * @param mixed $data PageSpeed desktop/mobile score.
+ *
+ * @return void
+ */
+ public static function print_screenshots( $data ) {
+ if ( isset( $data ) && isset( $data['screenshots']['other']['screenshots'] ) ) {
+ foreach ( $data['screenshots']['other']['screenshots'] as $screenshot ) {
+ echo ' ';
+ }
+ }
+ }
+
+ /**
+ * Render all metric data into listable items.
+ *
+ * @param array $data PageSpeed desktop/mobile score.
+ *
+ * @return void
+ */
+ public static function print_breakdown( $data ) {
+ if ( ! isset( $data ) || ( empty( $data['opportunities'] ) && empty( $data['diagnostics'] ) ) ) {
+ return;
+ }
+
+ $opportunities = '';
+ $diagnostics = '';
+ $passed_audits = '';
+
+ foreach ( $data['opportunities'] as $opportunity ) {
+ $opportunity['score'] *= 100;
+
+ $notice = 'notice notice-info inline';
+ $grade = 'w3tcps_blank';
+ if ( isset( $opportunity['score'] ) ) {
+ $notice = self::get_breakdown_bg( $opportunity['score'], $opportunity['scoreDisplayMode'] );
+ $grade = self::get_breakdown_grade( $opportunity['score'], $opportunity['scoreDisplayMode'] );
+ }
+
+ $audit_classes = '';
+ if ( isset( $opportunity['type'] ) ) {
+ foreach ( $opportunity['type'] as $type ) {
+ $audit_classes .= ' ' . $type;
+ }
+ }
+
+ $opportunity['description'] = preg_replace( '/(.*?)(\[.*?\])\((.*?)\)(.*?[,.?!]*)/', '$1$2 $4', esc_html( $opportunity['description'] ) );
+
+ $headers = '';
+ $items = '';
+
+ $opportunity['details'] = $opportunity['details'] ?? array();
+ foreach ( $opportunity['details'] as $item ) {
+ $headers = '';
+ $items .= '';
+ if ( isset( $item['url'] ) ) {
+ $headers .= '' . esc_html__( 'URL', 'w3-total-cache' ) . ' ';
+ if ( filter_var( $item['url'], FILTER_VALIDATE_URL ) !== false ) {
+ // The value is confirmed as a valid URL. We create a HTML link with the full URL value but display it with a trucated value.
+ $items .= ' ' . esc_url( $item['url'] ) . ' ';
+ } else {
+ // For certain metrics Google uses the 'url' field for non-URL values. These are often HTML/CSS that shouldn't be escaped and will be displayed as plain text.
+ $items .= '' . esc_html( $item['url'] ) . ' ';
+ }
+ }
+ if ( isset( $item['source'] ) ) {
+ $headers .= '' . esc_html__( 'URL', 'w3-total-cache' ) . ' ';
+ if ( filter_var( $item['source']['url'], FILTER_VALIDATE_URL ) !== false ) {
+ // The value is confirmed as a valid URL. We create a HTML link with the full URL value but display it with a trucated value.
+ $items .= ' ' . esc_url( $item['url'] ) . ' ';
+ } else {
+ // For certain metrics Google uses the 'url' field for non-URL values. These are often HTML/CSS that shouldn't be escaped and will be displayed as plain text.
+ $items .= '' . esc_html( $item['source']['url'] ) . ' ';
+ }
+ }
+ if ( isset( $item['totalBytes'] ) ) {
+ $headers .= '' . esc_html__( 'Total Bytes', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['totalBytes'] ) . ' ';
+ }
+ if ( isset( $item['wastedBytes'] ) ) {
+ $headers .= '' . esc_html__( 'Wasted Bytes', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['wastedBytes'] ) . ' ';
+ }
+ if ( isset( $item['wastedPercent'] ) ) {
+ $headers .= '' . esc_html__( 'Wasted Percentage', 'w3-total-cache' ) . ' ';
+ $items .= '' . round( $item['wastedPercent'], 2 ) . '% ';
+ }
+ if ( isset( $item['wastedMs'] ) ) {
+ $headers .= '' . esc_html__( 'Wasted Miliseconds', 'w3-total-cache' ) . ' ';
+ $items .= '' . round( $item['wastedMs'], 2 ) . ' ';
+ }
+ if ( isset( $item['label'] ) ) {
+ $headers .= '' . esc_html__( 'Type', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['label'] ) . ' ';
+ }
+ if ( isset( $item['groupLabel'] ) ) {
+ $headers .= '' . esc_html__( 'Group', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['groupLabel'] ) . ' ';
+ }
+ if ( isset( $item['requestCount'] ) ) {
+ $headers .= '' . esc_html__( 'Requests', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['requestCount'] ) . ' ';
+ }
+ if ( isset( $item['transferSize'] ) ) {
+ $headers .= '' . esc_html__( 'Transfer Size', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['transferSize'] ) . ' ';
+ }
+ if ( isset( $item['startTime'] ) ) {
+ $headers .= '' . esc_html__( 'Start Time', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['startTime'] ) . ' ';
+ }
+ if ( isset( $item['duration'] ) ) {
+ $headers .= '' . esc_html__( 'Duration', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['duration'] ) . ' ';
+ }
+ if ( isset( $item['scriptParseCompile'] ) ) {
+ $headers .= '' . esc_html__( 'Parse/Compile Time', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['scriptParseCompile'] ) . ' ';
+ }
+ if ( isset( $item['scripting'] ) ) {
+ $headers .= '' . esc_html__( 'Execution Time', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['scripting'] ) . ' ';
+ }
+ if ( isset( $item['total'] ) ) {
+ $headers .= '' . esc_html__( 'Total', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['total'] ) . ' ';
+ }
+ if ( isset( $item['cacheLifetimeMs'] ) ) {
+ $headers .= '' . esc_html__( 'Cache Lifetime Miliseconds', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['cacheLifetimeMs'] ) . ' ';
+ }
+ if ( isset( $item['cacheHitProbability'] ) ) {
+ $headers .= '' . esc_html__( 'Cache Hit Probability', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['cacheHitProbability'] ) . ' ';
+ }
+ if ( isset( $item['value'] ) && isset( $item['statistic'] ) ) {
+ $headers .= '' . esc_html__( 'Statistic', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['statistic'] ) . ' ';
+
+ $headers .= '' . esc_html__( 'Element', 'w3-total-cache' ) . ' ';
+ $items .= '';
+ if ( isset( $item['node'] ) ) {
+ $items .= '' . __( 'Snippet', 'w3-total-cache' ) . ': ' . esc_html( $item['node']['snippet'] ) . '
';
+ $items .= '' . __( 'Selector', 'w3-total-cache' ) . ': ' . esc_html( $item['node']['selector'] ) . '
';
+ }
+ $items .= ' ';
+
+ $headers .= '' . esc_html__( 'Value', 'w3-total-cache' ) . ' ';
+ $items .= is_array( $item['value'] ) ? '' . esc_html( $item['value']['value'] ) . ' ' : '' . esc_html( $item['value'] ) . ' ';
+ } elseif ( isset( $item['node'] ) ) {
+ $headers .= '' . esc_html__( 'Element', 'w3-total-cache' ) . ' ';
+ $items .= '';
+ $items .= '' . __( 'Snippet', 'w3-total-cache' ) . ': ' . esc_html( $item['node']['snippet'] ) . '
';
+ $items .= '' . __( 'Selector', 'w3-total-cache' ) . ': ' . esc_html( $item['node']['selector'] ) . '
';
+ $items .= ' ';
+ }
+ if ( isset( $item['headings'] ) && isset( $item['items'] ) ) {
+ $items .= '';
+ foreach ( $item['items'] as $sub_item ) {
+ $items .= '';
+ if ( isset( $sub_item['node'] ) ) {
+ $items .= '';
+ $items .= '' . __( 'Snippet', 'w3-total-cache' ) . ': ' . esc_html( $sub_item['node']['snippet'] ) . '
';
+ $items .= '' . __( 'Selector', 'w3-total-cache' ) . ': ' . esc_html( $sub_item['node']['selector'] ) . '
';
+ $items .= ' ';
+ }
+ if ( isset( $sub_item['phase'] ) && isset( $sub_item['timing'] ) && isset( $sub_item['percent'] ) ) {
+ $items .= '' . esc_html( $sub_item['phase'] ) . ' ';
+ $items .= '' . esc_html( $sub_item['percent'] ) . ' ';
+ $items .= '' . esc_html( $sub_item['timing'] ) . ' ms ';
+ }
+ $items .= ' ';
+ }
+ $items .= '
';
+ }
+ if ( isset( $item['responseTime'] ) ) {
+ $headers .= '' . esc_html__( 'Response Time', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['responseTime'] ) . ' ';
+ }
+ $items .= ' ';
+ }
+
+ $items = ( isset( $items ) ? $items : '' . esc_html__( 'No identified items were provided by Google PageSpeed Insights API for this metric', 'w3-total-cache' ) . '
' );
+ if ( $opportunity['score'] >= 90 || in_array( $opportunity['scoreDisplayMode'], array( 'notApplicable' ), true ) ) {
+ $passed_audits .= '
+
+
' . esc_html( $opportunity['title'] ) . ( isset( $opportunity['displayValue'] ) ? ' - ' . esc_html( $opportunity['displayValue'] ) : '' ) . '
+
+
' . $opportunity['description'] . '
+
+
+
+
+
' . $opportunity['instructions'] . '
+
+
+
+
';
+ } else {
+ $opportunities .= '
+
+
' . esc_html( $opportunity['title'] ) . ( isset( $opportunity['displayValue'] ) ? ' - ' . esc_html( $opportunity['displayValue'] ) : '' ) . '
+
+
' . $opportunity['description'] . '
+
+
+
+
+
' . $opportunity['instructions'] . '
+
+
+
+
';
+ }
+ }
+
+ foreach ( $data['diagnostics'] as $diagnostic ) {
+ $diagnostic['score'] *= 100;
+
+ $notice = 'notice notice-info inline';
+ $grade = 'w3tcps_blank';
+ if ( isset( $diagnostic['score'] ) ) {
+ $notice = self::get_breakdown_bg( $diagnostic['score'], $diagnostic['scoreDisplayMode'] );
+ $grade = self::get_breakdown_grade( $diagnostic['score'], $diagnostic['scoreDisplayMode'] );
+ }
+
+ $audit_classes = '';
+ foreach ( $opportunity['type'] as $type ) {
+ $audit_classes .= ' ' . $type;
+ }
+
+ $diagnostic['description'] = preg_replace( '/(.*?)(\[.*?\])\((.*?)\)(.*?[,.?!]*)/', '$1$2 $4', esc_html( $diagnostic['description'] ) );
+
+ $headers = '';
+ $items = '';
+
+ $diagnostic['details'] = $diagnostic['details'] ?? array();
+ foreach ( $diagnostic['details'] as $item ) {
+ $headers = '';
+ $items .= '';
+ if ( isset( $item['url'] ) ) {
+ $headers .= '' . esc_html__( 'URL', 'w3-total-cache' ) . ' ';
+ if ( filter_var( $item['url'], FILTER_VALIDATE_URL ) !== false ) {
+ // The value is confirmed as a valid URL. We create a HTML link with the full URL value but display it with a trucated value.
+ $items .= '' . esc_url( $item['url'] ) . ' ';
+ } else {
+ // For certain metrics Google uses the 'url' field for non-URL values. These are often HTML/CSS that shouldn't be escaped and will be displayed as plain text.
+ $items .= '' . esc_html( $item['url'] ) . ' ';
+ }
+ }
+ if ( isset( $item['source'] ) ) {
+ $headers .= '' . esc_html__( 'URL', 'w3-total-cache' ) . ' ';
+ if ( filter_var( $item['source']['url'], FILTER_VALIDATE_URL ) !== false ) {
+ // The value is confirmed as a valid URL. We create a HTML link with the full URL value but display it with a trucated value.
+ $items .= '' . esc_url( $item['url'] ) . ' ';
+ } else {
+ // For certain metrics Google uses the 'url' field for non-URL values. These are often HTML/CSS that shouldn't be escaped and will be displayed as plain text.
+ $items .= '' . esc_html( $item['source']['url'] ) . ' ';
+ }
+ }
+ if ( isset( $item['totalBytes'] ) ) {
+ $headers .= '' . esc_html__( 'Total Bytes', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['totalBytes'] ) . ' ';
+ }
+ if ( isset( $item['wastedBytes'] ) ) {
+ $headers .= '' . esc_html__( 'Wasted Bytes', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['wastedBytes'] ) . ' ';
+ }
+ if ( isset( $item['wastedPercent'] ) ) {
+ $headers .= '' . esc_html__( 'Wasted Percentage', 'w3-total-cache' ) . ' ';
+ $items .= '' . round( $item['wastedPercent'], 2 ) . '% ';
+ }
+ if ( isset( $item['wastedMs'] ) ) {
+ $headers .= '' . esc_html__( 'Wasted Miliseconds', 'w3-total-cache' ) . ' ';
+ $items .= '' . round( $item['wastedMs'], 2 ) . ' ';
+ }
+ if ( isset( $item['label'] ) ) {
+ $headers .= '' . esc_html__( 'Type', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['label'] ) . ' ';
+ }
+ if ( isset( $item['groupLabel'] ) ) {
+ $headers .= '' . esc_html__( 'Group', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['groupLabel'] ) . ' ';
+ }
+ if ( isset( $item['requestCount'] ) ) {
+ $headers .= '' . esc_html__( 'Requests', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['requestCount'] ) . ' ';
+ }
+ if ( isset( $item['transferSize'] ) ) {
+ $headers .= '' . esc_html__( 'Transfer Size', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['transferSize'] ) . ' ';
+ }
+ if ( isset( $item['startTime'] ) ) {
+ $headers .= '' . esc_html__( 'Start Time', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['startTime'] ) . ' ';
+ }
+ if ( isset( $item['duration'] ) ) {
+ $headers .= '' . esc_html__( 'Duration', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['duration'] ) . ' ';
+ }
+ if ( isset( $item['scriptParseCompile'] ) ) {
+ $headers .= '' . esc_html__( 'Parse/Compile Time', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['scriptParseCompile'] ) . ' ';
+ }
+ if ( isset( $item['scripting'] ) ) {
+ $headers .= '' . esc_html__( 'Execution Time', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['scripting'] ) . ' ';
+ }
+ if ( isset( $item['total'] ) ) {
+ $headers .= '' . esc_html__( 'Total', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['total'] ) . ' ';
+ }
+ if ( isset( $item['cacheLifetimeMs'] ) ) {
+ $headers .= '' . esc_html__( 'Cache Lifetime Miliseconds', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['cacheLifetimeMs'] ) . ' ';
+ }
+ if ( isset( $item['cacheHitProbability'] ) ) {
+ $headers .= '' . esc_html__( 'Cache Hit Probability', 'w3-total-cache' ) . ' ';
+ $items .= '' . ( esc_html( $item['cacheHitProbability'] ) * 100 ) . '% ';
+ }
+ if ( isset( $item['value'] ) && isset( $item['statistic'] ) ) {
+ $headers .= '' . esc_html__( 'Statistic', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['statistic'] ) . ' ';
+
+ $headers .= '' . esc_html__( 'Element', 'w3-total-cache' ) . ' ';
+ $items .= '';
+ if ( isset( $item['node'] ) ) {
+ $items .= '' . __( 'Snippet', 'w3-total-cache' ) . ': ' . esc_html( $item['node']['snippet'] ) . '
';
+ $items .= '' . __( 'Selector', 'w3-total-cache' ) . ': ' .esc_html( $item['node']['selector'] ) . '
';
+ }
+ $items .= ' ';
+
+ $headers .= '' . esc_html__( 'Value', 'w3-total-cache' ) . ' ';
+ $items .= is_array( $item['value'] ) ? '' . esc_html( $item['value']['value'] ) . ' ' : '' . esc_html( $item['value'] ) . ' ';
+ } elseif ( isset( $item['node'] ) ) {
+ $headers .= '' . esc_html__( 'Element', 'w3-total-cache' ) . ' ';
+ $items .= '';
+ $items .= '' . __( 'Snippet', 'w3-total-cache' ) . ': ' . esc_html( $item['node']['snippet'] ) . '
';
+ $items .= '' . __( 'Selector', 'w3-total-cache' ) . ': ' . esc_html( $item['node']['selector'] ) . '
';
+ $items .= ' ';
+ }
+ if ( isset( $item['headings'] ) && isset( $item['items'] ) ) {
+ $items .= '';
+ foreach ( $item['items'] as $sub_item ) {
+ $items .= '';
+ if ( isset( $sub_item['node'] ) ) {
+ $items .= '';
+ $items .= '' . __( 'Snippet', 'w3-total-cache' ) . ': ' . esc_html( $sub_item['node']['snippet'] ) . '
';
+ $items .= '' . __( 'Selector', 'w3-total-cache' ) . ': ' . esc_html( $sub_item['node']['selector'] ) . '
';
+ $items .= ' ';
+ }
+ if ( isset( $sub_item['phase'] ) && isset( $sub_item['timing'] ) && isset( $sub_item['percent'] ) ) {
+ $items .= '' . esc_html( $sub_item['phase'] ) . ' ';
+ $items .= '' . esc_html( $sub_item['percent'] ) . ' ';
+ $items .= '' . esc_html( $sub_item['timing'] ) . ' ms ';
+ }
+ $items .= ' ';
+ }
+ $items .= '
';
+ }
+ if ( isset( $item['responseTime'] ) ) {
+ $headers .= '' . esc_html__( 'Response Time', 'w3-total-cache' ) . ' ';
+ $items .= '' . esc_html( $item['responseTime'] ) . ' ';
+ }
+ $items .= ' ';
+ }
+
+ $items = ( isset( $items ) ? $items : '' . esc_html__( 'No identified items were provided by Google PageSpeed Insights API for this metric', 'w3-total-cache' ) . '
' );
+
+ if ( $diagnostic['score'] >= 90 || in_array( $diagnostic['scoreDisplayMode'], array( 'notApplicable' ), true ) ) {
+ $passed_audits .= '
+
+
' . esc_html( $diagnostic['title'] ) . ( isset( $diagnostic['displayValue'] ) ? ' - ' . esc_html( $diagnostic['displayValue'] ) : '' ) . '
+
+
' . $diagnostic['description'] . '
+
+
+
+
+
' . $diagnostic['instructions'] . '
+
+
+
+
';
+ } else {
+ $diagnostics .= '
+
+
' . esc_html( $diagnostic['title'] ) . ( isset( $diagnostic['displayValue'] ) ? ' - ' . esc_html( $diagnostic['displayValue'] ) : '' ) . '
+
+
' . $diagnostic['description'] . '
+
+
+
+
+
' . $diagnostic['instructions'] . '
+
+
+
+
';
+ }
+ }
+
+ $allowed_tags = self::get_allowed_tags();
+
+ echo wp_kses(
+ '
+
' . esc_html__( 'Opportunities', 'w3-total-cache' ) . ' ' . $opportunities . '
+
' . esc_html__( 'Diagnostics', 'w3-total-cache' ) . ' ' . $diagnostics . '
+
' . esc_html__( 'Passed Audits', 'w3-total-cache' ) . ' ' . $passed_audits . '
+
',
+ $allowed_tags
+ );
+ }
+
+ /**
+ * Recursively get value based on series of key decendents.
+ *
+ * @param array $data PageSpeed data.
+ * @param array $elements Array of key decendents.
+ *
+ * @return object | null
+ */
+ public static function get_value_recursive( $data, $elements ) {
+ if ( empty( $elements ) ) {
+ return $data;
+ }
+
+ $key = array_shift( $elements );
+ if ( ! isset( $data[ $key ] ) ) {
+ return null;
+ }
+
+ return self::get_value_recursive( $data[ $key ], $elements );
+ }
+
+ /**
+ * Return wp_kses allowed HTML tags/attributes.
+ *
+ * @return array
+ */
+ public static function get_allowed_tags() {
+ return array(
+ 'div' => array(
+ 'id' => array(),
+ 'class' => array(),
+ ),
+ 'span' => array(
+ 'id' => array(),
+ 'class' => array(),
+ 'title' => array(),
+ 'gatitle' => array(),
+ 'copyurl' => array(),
+ ),
+ 'p' => array(
+ 'id' => array(),
+ 'class' => array(),
+ ),
+ 'table' => array(
+ 'id' => array(),
+ 'class' => array(),
+ ),
+ 'tr' => array(
+ 'id' => array(),
+ 'class' => array(),
+ ),
+ 'td' => array(
+ 'id' => array(),
+ 'class' => array(),
+ ),
+ 'th' => array(
+ 'id' => array(),
+ 'class' => array(),
+ ),
+ 'b' => array(
+ 'id' => array(),
+ 'class' => array(),
+ ),
+ 'br' => array(),
+ 'a' => array(
+ 'id' => array(),
+ 'class' => array(),
+ 'href' => array(),
+ 'target' => array(),
+ 'rel' => array(),
+ 'title' => array(),
+ ),
+ 'link' => array(
+ 'id' => array(),
+ 'class' => array(),
+ 'href' => array(),
+ 'rel' => array(),
+ 'as' => array(),
+ 'type' => array(),
+ ),
+ 'code' => array(
+ 'id' => array(),
+ 'class' => array(),
+ ),
+ 'img' => array(
+ 'id' => array(),
+ 'class' => array(),
+ 'srcset' => array(),
+ 'src' => array(),
+ 'alt' => array(),
+ ),
+ 'ul' => array(
+ 'id' => array(),
+ 'class' => array(),
+ ),
+ 'ol' => array(
+ 'id' => array(),
+ 'class' => array(),
+ ),
+ 'li' => array(
+ 'id' => array(),
+ 'class' => array(),
+ ),
+ 'h3' => array(
+ 'id' => array(),
+ 'class' => array(),
+ ),
+ );
+ }
+
+ /**
+ * Get cache life time.
+ *
+ * @return int
+ */
+ public static function get_cache_life() {
+ return 3600;
+ }
+
+ /**
+ * Conver seconds into string breaking down days/hours/minutes/seconds.
+ *
+ * @param int $seconds Seconds.
+ *
+ * @return string
+ */
+ public static function seconds_to_str( $seconds ) {
+ $buffer = '';
+ if ( $seconds >= 86400 ) {
+ $days = floor( $seconds / 86400 );
+ $seconds = $seconds % 86400;
+ $buffer .= $days . ' day' . ( $days > 1 ? 's' : '' ) . ( $seconds > 0 ? ', ' : '' );
+ }
+ if ( $seconds >= 3600 ) {
+ $hours = floor( $seconds / 3600 );
+ $seconds = $seconds % 3600;
+ $buffer .= $hours . ' hour' . ( $hours > 1 ? 's' : '' ) . ( $seconds > 0 ? ', ' : '' );
+ }
+ if ( $seconds >= 60 ) {
+ $minutes = floor( $seconds / 60 );
+ $seconds = $seconds % 60;
+ $buffer .= $minutes . ' minute' . ( $minutes > 1 ? 's' : '' ) . ( $seconds > 0 ? ', ' : '' );
+ }
+ if ( $seconds > 0 ) {
+ $buffer .= $seconds . ' second' . ( $seconds > 1 ? 's' : '' );
+ }
+ return $buffer;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_PageUrls.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_PageUrls.php
new file mode 100644
index 00000000..fb595934
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_PageUrls.php
@@ -0,0 +1,991 @@
+post_type;
+ $archive_link = get_post_type_archive_link($post_type);
+ $posts_page_uri = str_replace( home_url(), '', $archive_link );
+
+ if ( $posts_page_uri ) {
+ $full_urls[] = $archive_link;
+ $full_urls = array_merge( $full_urls, self::get_older_pages( $posts_page_uri, $limit_post_pages, $post_type ) );
+ }
+
+ $cpt_archive_urls[$limit_post_pages] = $full_urls;
+ }
+
+ return $cpt_archive_urls[$limit_post_pages];
+ }
+
+ /**
+ * Return older pages listing posts
+ *
+ * @param unknown $posts_page_uri
+ * @param int $limit_post_pages default is 10
+ * @param string $post_type default is post
+ * @return array
+ */
+ static private function get_older_pages( $posts_page_uri, $limit_post_pages = 10, $post_type = 'post' ) {
+ $full_urls = array();
+ $count_posts = wp_count_posts($post_type);
+ $posts_number = $count_posts->publish;
+ $posts_per_page = get_option( 'posts_per_page' );
+ $posts_pages_number = @ceil( $posts_number / $posts_per_page );
+
+ if ( $limit_post_pages > 0 && $posts_pages_number > $limit_post_pages ) {
+ $posts_pages_number = $limit_post_pages;
+ }
+
+ for ( $pagenum = 2; $pagenum <= $posts_pages_number; $pagenum++ ) {
+ $home_pagenum_link = self::get_pagenum_link( $posts_page_uri, $pagenum );
+ $full_urls[] = $home_pagenum_link;
+ }
+ return $full_urls;
+ }
+
+ /**
+ * Returns all urls related to a post
+ *
+ * @param unknown $post_id
+ * @return array
+ */
+ static public function get_post_urls( $post_id ) {
+ static $post_urls = array();
+
+ if ( !isset( $post_urls[$post_id] ) ) {
+ $full_urls = array();
+ $post_link = get_permalink( $post_id );
+ $post_uri = str_replace( Util_Environment::home_domain_root_url(), '', $post_link );
+
+ $full_urls[] = $post_link;
+ $uris[] = $post_uri;
+ $post = get_post( $post_id );
+ $matches =array();
+ if ( $post && ( $post_pages_number = preg_match_all( '/\<\!\-\-nextpage\-\-\>/', $post->post_content, $matches ) )>0 ) {
+ global $wp_rewrite;
+ $post_pages_number++;
+ for ( $pagenum = 2; $pagenum <= $post_pages_number; $pagenum++ ) {
+ if ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_on_front' ) == $post->ID )
+ $post_pagenum_link = trailingslashit( $post_link ) . user_trailingslashit( "$wp_rewrite->pagination_base/" . $pagenum, 'single_paged' );
+ else
+ $post_pagenum_link = trailingslashit( $post_link ) . user_trailingslashit( $pagenum, 'single_paged' );
+ $full_urls[] = $post_pagenum_link;
+ }
+ }
+
+ $post_urls[$post_id] = $full_urls;
+ }
+ return $post_urls[$post_id];
+ }
+
+ /**
+ * Return full urls for the posts comment pages
+ *
+ * @param unknown $post_id
+ * @return array
+ */
+ static public function get_post_comments_urls( $post_id ) {
+ static $post_comments_urls = array();
+
+ if ( !isset( $post_comments_urls[$post_id] ) ) {
+ $full_urls = array();
+ $comments_number = get_comments_number( $post_id );
+ $comments_per_page = get_option( 'comments_per_page' );
+ $comments_pages_number = @ceil( $comments_number / $comments_per_page );
+
+ for ( $pagenum = 1; $pagenum <= $comments_pages_number; $pagenum++ ) {
+ $comments_pagenum_link = self::get_comments_pagenum_link( $post_id, $pagenum );
+
+ $full_urls[] = $comments_pagenum_link;
+ }
+ $post_comments_urls[$post_id] = $full_urls;
+ }
+ return $post_comments_urls[$post_id];
+ }
+
+ /**
+ * Return full urls for the authors pages
+ *
+ * @param unknown $post_author
+ * @param int $limit_post_pages default is 10
+ * @return array
+ */
+ static public function get_post_author_urls( $post_author, $limit_post_pages = 10 ) {
+ static $feed_author_urls = array();
+
+ $key = md5( $post_author . ',' . $limit_post_pages );
+ if ( !isset( $post_author_urls[$key] ) ) {
+ $full_urls = array();
+ $posts_number = count_user_posts( $post_author );
+ $posts_per_page = get_option( 'posts_per_page' );
+ $posts_pages_number = @ceil( $posts_number / $posts_per_page );
+
+ if ( $limit_post_pages > 0 && $posts_pages_number > $limit_post_pages ) {
+ $posts_pages_number = $limit_post_pages;
+ }
+
+ $author_link = get_author_posts_url( $post_author );
+ $author_uri = str_replace( Util_Environment::home_domain_root_url(), '', $author_link );
+
+ for ( $pagenum = 1; $pagenum <= $posts_pages_number; $pagenum++ ) {
+ $author_pagenum_link = self::get_pagenum_link( $author_uri, $pagenum );
+ $full_urls[] = $author_pagenum_link;
+ }
+ $post_author_urls[$key] = $full_urls;
+ }
+ return $post_author_urls[$key];
+ }
+
+ /**
+ * Returns full urls to post terms pages
+ *
+ * @param unknown $terms
+ * @param int $limit_post_pages default is 10
+ * @return array
+ */
+ static public function get_post_terms_urls( $terms, $limit_post_pages = 10 ) {
+ static $post_terms_urls = array();
+
+ $key = md5( self::_term_hash( $terms ) . ',' . $limit_post_pages );
+ if ( !isset( $post_terms_urls[$key] ) ) {
+ $full_urls = array();
+ $posts_per_page = get_option( 'posts_per_page' );
+
+ foreach ( $terms as $term ) {
+ $term_link = get_term_link( $term, $term->taxonomy );
+ $term_uri = str_replace( Util_Environment::home_domain_root_url(), '', $term_link );
+ $posts_pages_number = @ceil( $term->count / $posts_per_page );
+
+ if ( $limit_post_pages > 0 && $posts_pages_number > $limit_post_pages ) {
+ $posts_pages_number = $limit_post_pages;
+ }
+
+ for ( $pagenum = 1; $pagenum <= $posts_pages_number; $pagenum++ ) {
+ $term_pagenum_link = self::get_pagenum_link( $term_uri, $pagenum );
+ $full_urls[] = $term_pagenum_link;
+ }
+ }
+ $post_terms_urls[$key] = $full_urls;
+ }
+ return $post_terms_urls[$key];
+
+ }
+
+ /**
+ * Return full urls for daily archive pages based on provided post
+ *
+ * @param unknown $post
+ * @param int $limit_post_pages default is 10
+ * @return array
+ */
+ static public function get_daily_archive_urls( $post, $limit_post_pages = 10 ) {
+ static $daily_archive_urls = array();
+
+ $post_type = $post->post_type;
+ $archive_slug = self::_get_archive_slug( $post );
+
+ $key = md5( $post->ID . ',' . $limit_post_pages );
+ if ( !isset( $daily_archive_urls[$key] ) ) {
+ $full_urls = array();
+ $post_date = strtotime( $post->post_date );
+ $post_year = gmdate( 'Y', $post_date );
+ $post_month = gmdate( 'm', $post_date );
+ $post_day = gmdate( 'd', $post_date );
+ $posts_per_page = get_option( 'posts_per_page' );
+ $posts_number = self::get_archive_posts_count( $post_year, $post_month, $post_day, $post_type );
+ $posts_pages_number = @ceil( $posts_number / $posts_per_page );
+
+ if ( $limit_post_pages > 0 && $posts_pages_number > $limit_post_pages ) {
+ $posts_pages_number = $limit_post_pages;
+ }
+
+ $day_link = get_day_link( $post_year, $post_month, $post_day );
+ $day_uri = $archive_slug . str_replace( Util_Environment::home_domain_root_url(), '', $day_link );
+
+ for ( $pagenum = 1; $pagenum <= $posts_pages_number; $pagenum++ ) {
+ $day_pagenum_link = self::get_pagenum_link( $day_uri, $pagenum );
+ $full_urls[] = $day_pagenum_link;
+ }
+ $daily_archive_urls[$key] = $full_urls;
+ }
+ return $daily_archive_urls[$key];
+ }
+
+ /**
+ * Return full urls for montly archive pages based on provided post
+ *
+ * @param unknown $post
+ * @param int $limit_post_pages default is 10
+ * @return array
+ */
+ static public function get_monthly_archive_urls( $post, $limit_post_pages = 10 ) {
+ static $monthly_archive_urls = array();
+
+ $post_type = $post->post_type;
+ $archive_slug = self::_get_archive_slug( $post );
+
+ $key = md5( $post->ID . ',' . $limit_post_pages );
+ if ( !isset( $monthly_archive_urls[$key] ) ) {
+ $full_urls = array();
+ $post_date = strtotime( $post->post_date );
+ $post_year = gmdate( 'Y', $post_date );
+ $post_month = gmdate( 'm', $post_date );
+
+ $posts_per_page = get_option( 'posts_per_page' );
+ $posts_number = self::get_archive_posts_count( $post_year, $post_month, '', $post_type );
+ $posts_pages_number = @ceil( $posts_number / $posts_per_page );
+
+ if ( $limit_post_pages > 0 && $posts_pages_number > $limit_post_pages ) {
+ $posts_pages_number = $limit_post_pages;
+ }
+
+ $month_link = get_month_link( $post_year, $post_month );
+ $month_uri = $archive_slug . str_replace( Util_Environment::home_domain_root_url(), '', $month_link );
+
+ for ( $pagenum = 1; $pagenum <= $posts_pages_number; $pagenum++ ) {
+ $month_pagenum_link = self::get_pagenum_link( $month_uri, $pagenum );
+ $full_urls[] = $month_pagenum_link;
+ }
+
+ $monthly_archive_urls[$key] = $full_urls;
+ }
+ return $monthly_archive_urls[$key];
+ }
+
+ /**
+ * Return full urls for yearly archive pages based on provided post
+ *
+ * @param unknown $post
+ * @param int $limit_post_pages default is 10
+ * @return array
+ */
+ static public function get_yearly_archive_urls( $post, $limit_post_pages = 10 ) {
+ static $yearly_archive_urls = array();
+
+ $post_type = $post->post_type;
+ $archive_slug = self::_get_archive_slug( $post );
+
+ $key = md5( $post->ID . ',' . $limit_post_pages );
+ if ( !isset( $yearly_archive_urls[$key] ) ) {
+
+ $full_urls = array();
+ $post_date = strtotime( $post->post_date );
+ $post_year = gmdate( 'Y', $post_date );
+
+ $posts_per_page = get_option( 'posts_per_page' );
+ $posts_number =self::get_archive_posts_count( $post_year, '', '', $post_type );
+ $posts_pages_number = @ceil( $posts_number / $posts_per_page );
+
+ if ( $limit_post_pages > 0 && $posts_pages_number > $limit_post_pages ) {
+ $posts_pages_number = $limit_post_pages;
+ }
+
+ $year_link = get_year_link( $post_year );
+ $year_uri = $archive_slug . str_replace( Util_Environment::home_domain_root_url(), '', $year_link );
+
+ for ( $pagenum = 1; $pagenum <= $posts_pages_number; $pagenum++ ) {
+ $year_pagenum_link = self::get_pagenum_link( $year_uri, $pagenum );
+ $full_urls[] = $year_pagenum_link;
+ }
+ $yearly_archive_urls[$key] = $full_urls;
+ }
+ return $yearly_archive_urls[$key];
+ }
+
+ /**
+ * Return full urls for the provided feed types
+ *
+ * @param unknown $feeds
+ * @param string|null $post_type
+ * @return array
+ */
+ static public function get_feed_urls( $feeds, $post_type = null ) {
+ static $feed_urls = array();
+
+ $key = md5( implode( ',', $feeds ) . $post_type );
+ if ( !isset( $feed_urls[$key] ) ) {
+ $full_urls = array();
+ foreach ( $feeds as $feed ) {
+ $feed_link = self::get_feed_link( $feed, $post_type );
+
+ $full_urls[] = $feed_link;
+ }
+ $feed_urls[$key] = $full_urls;
+ }
+ return $feed_urls[$key];
+ }
+
+ /**
+ * Return full urls for the provided post id and feed types
+ *
+ * @param unknown $post_id
+ * @param unknown $feeds
+ * @return array
+ */
+ static public function get_feed_comments_urls( $post_id, $feeds ) {
+ static $feed_comments_urls = array();
+
+ $key = md5( implode( ',', $feeds ) . $post_id );
+ if ( !isset( $feed_comments_urls[$key] ) ) {
+ $full_urls = array();
+ foreach ( $feeds as $feed ) {
+ $post_comments_feed_link = self::get_post_comments_feed_link( $post_id, $feed );
+ $full_urls[] = $post_comments_feed_link;
+ }
+ $feed_comments_urls[$key] = $full_urls;
+ }
+ return $feed_comments_urls[$key];
+ }
+
+ /**
+ * Returns full urls for the provided post author and feed types
+ *
+ * @param unknown $post_author
+ * @param unknown $feeds
+ * @return array
+ */
+ static public function get_feed_author_urls( $post_author, $feeds ) {
+ static $post_author_urls = array();
+
+ $key = md5( implode( ',', $feeds ) . $post_author );
+ if ( !isset( $feed_author_urls[$key] ) ) {
+ $full_urls = array();
+ foreach ( $feeds as $feed ) {
+ $author_feed_link = self::get_author_feed_link( $post_author, $feed );
+ $full_urls[] = $author_feed_link;
+ }
+ $feed_author_urls[$key] = $full_urls;
+ }
+ return $feed_author_urls[$key];
+ }
+
+ /**
+ * Returns full urls for the provided terms and feed types
+ *
+ * @param unknown $terms
+ * @param unknown $feeds
+ * @return array
+ */
+ static public function get_feed_terms_urls( $terms, $feeds ) {
+ static $feed_terms_urls = array();
+
+ $key = md5( implode( ',', $feeds ) . self::_term_hash( $terms ) );
+ if ( !isset( $feed_terms_urls[$key] ) ) {
+ $full_urls = array();
+ foreach ( $terms as $term ) {
+ foreach ( $feeds as $feed ) {
+ $term_feed_link = self::get_term_feed_link( $term->term_id, $term->taxonomy, $feed );
+ $full_urls[] = $term_feed_link;
+ }
+ }
+ $feed_terms_urls[$key] = $full_urls;
+ }
+ return $feed_terms_urls[$key];
+ }
+
+ /**
+ * Returns full urls for the provided url path based pages, ie /some/page.
+ *
+ * @param unknown $pages
+ * @return array
+ */
+ static public function get_pages_urls( $pages ) {
+ static $pages_urls = array();
+
+ $key = md5( implode( ',', $pages ) );
+ if ( !isset( $pages_urls[$key] ) ) {
+ $full_urls = array();
+ foreach ( $pages as $uri ) {
+ if ( $uri ) {
+ $page_link = get_home_url() . '/' . trim( $uri, '/' ) .
+ ( strpos( $uri, '?' ) !== FALSE ? '': '/' );
+ $full_urls[] = $page_link;
+ }
+ }
+ $pages_urls[$key] = $full_urls;
+ }
+ return $pages_urls[$key];
+ }
+
+ /**
+ * Workaround for get_pagenum_link function
+ *
+ * @param string $url
+ * @param int $pagenum
+ * @return string
+ */
+ public static function get_pagenum_link( $url, $pagenum = 1 ) {
+ $request_uri = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
+ $_SERVER['REQUEST_URI'] = $url;
+
+ if ( is_admin() ) {
+ $link = self::get_pagenum_link_admin( $pagenum );
+ } else {
+ $link = get_pagenum_link( $pagenum );
+ }
+
+ $_SERVER['REQUEST_URI'] = $request_uri;
+
+ return $link;
+ }
+
+
+ /**
+ * Workaround for get_pagenum_link static public function when in admin
+ *
+ * @param unknown $pagenum
+ * @return string
+ */
+ static public function get_pagenum_link_admin( $pagenum ) {
+ global $wp_rewrite;
+
+ $pagenum = (int) $pagenum;
+
+ $request = remove_query_arg( 'paged' );
+
+ $home_root = parse_url( home_url() );
+ $home_root = ( isset( $home_root['path'] ) ) ? $home_root['path'] : '';
+ $home_root = preg_quote( trailingslashit( $home_root ), '|' );
+
+ $request = preg_replace( '|^'. $home_root . '|', '', $request );
+ $request = preg_replace( '|^/+|', '', $request );
+ $qs_regex = '|\?.*?$|';
+ preg_match( $qs_regex, $request, $qs_match );
+
+ if ( !empty( $qs_match[0] ) ) {
+ $query_string = $qs_match[0];
+ $request = preg_replace( $qs_regex, '', $request );
+ } else {
+ $query_string = '';
+ }
+
+ $request = preg_replace( "|$wp_rewrite->pagination_base/\d+/?$|", '', $request );
+ $request = preg_replace( '|^index\.php|', '', $request );
+ $request = ltrim( $request, '/' );
+
+ $base = trailingslashit( get_bloginfo( 'url' ) );
+
+ if ( !is_null( $wp_rewrite ) &&
+ $wp_rewrite->using_index_permalinks() &&
+ ( $pagenum > 1 || '' != $request ) )
+ $base .= 'index.php/';
+
+ if ( $pagenum > 1 ) {
+ $request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( $wp_rewrite->pagination_base . "/" . $pagenum, 'paged' );
+ }
+
+ $result = $base . $request . $query_string;
+ $result = apply_filters( 'get_pagenum_link', $result, $pagenum );
+ return $result;
+ }
+
+ /**
+ * Workaround for get_comments_pagenum_link function
+ *
+ * @param integer $post_id
+ * @param integer $pagenum
+ * @param integer $max_page
+ * @return string
+ */
+ static public function get_comments_pagenum_link( $post_id, $pagenum = 1, $max_page = 0 ) {
+ if ( isset( $GLOBALS['post'] ) && is_object( $GLOBALS['post'] ) ) {
+ $old_post = &$GLOBALS['post'];
+ } else {
+ $GLOBALS['post'] = new \stdClass();
+ $old_post = null;
+ }
+
+ $GLOBALS['post']->ID = $post_id;
+
+ $link = get_comments_pagenum_link( $pagenum, $max_page );
+
+ if ( $old_post ) {
+ $GLOBALS['post'] = &$old_post;
+ }
+
+ return $link;
+ }
+
+ /**
+ * Returns number of posts in the archive.
+ *
+ * @global $wpdb
+ *
+ * @param int $year Year.
+ * @param int $month Month.
+ * @param int $day Day number.
+ * @param string $post_type Post type.
+ * @return int
+ */
+ public static function get_archive_posts_count( $year = 0, $month = 0, $day = 0, $post_type = 'post' ) {
+ global $wpdb;
+
+ $filters = array(
+ 'post_type = "' . $post_type .'"',
+ 'post_status = "publish"'
+ );
+
+ if ( $year ) {
+ $filters[] = sprintf( 'YEAR(post_date) = %d', $year );
+ }
+
+ if ( $month ) {
+ $filters[] = sprintf( 'MONTH(post_date) = %d', $month );
+ }
+
+ if ( $day ) {
+ $filters[] = sprintf( 'DAY(post_date) = %d', $day );
+ }
+
+ $where = implode( ' AND ', $filters );
+
+ $sql = sprintf( 'SELECT COUNT(*) FROM %s WHERE %s', $wpdb->posts, $where );
+
+ $count = (int) $wpdb->get_var( $sql );
+
+ return $count;
+ }
+
+ /**
+ * Workaround for get_feed_link function, remove filtering.
+ *
+ * @param string $feed
+ * @param null|string $post_type
+ * @return mixed
+ */
+ static public function get_feed_link( $feed = '', $post_type=null ) {
+ /**
+ *
+ *
+ * @var $wp_rewrite WP_Rewrite
+ */
+ global $wp_rewrite;
+
+ if ( $post_type )
+ return get_post_type_archive_feed_link( $post_type, $feed );
+
+ $permalink = $wp_rewrite->get_feed_permastruct();
+ if ( '' != $permalink ) {
+ if ( false !== strpos( $feed, 'comments_' ) ) {
+ $feed = str_replace( 'comments_', '', $feed );
+ $permalink = $wp_rewrite->get_comment_feed_permastruct();
+ }
+
+ if ( get_default_feed() == $feed )
+ $feed = '';
+
+ $permalink = str_replace( '%feed%', $feed, $permalink );
+ $permalink = preg_replace( '#/+#', '/', "/$permalink" );
+ $output = home_url( user_trailingslashit( $permalink, 'feed' ) );
+ } else {
+ if ( empty( $feed ) )
+ $feed = get_default_feed();
+
+ if ( false !== strpos( $feed, 'comments_' ) )
+ $feed = str_replace( 'comments_', 'comments-', $feed );
+
+ $output = home_url( "?feed={$feed}" );
+ }
+
+ return $output;
+ }
+
+ /**
+ * Workaround for get_post_comments_feed_link function, remove filtering.
+ *
+ * @param int $post_id
+ * @param string $feed
+ * @return string
+ */
+ static public function get_post_comments_feed_link( $post_id = 0, $feed = '' ) {
+ $post_id = absint( $post_id );
+
+ if ( ! $post_id )
+ $post_id = get_the_ID();
+
+ if ( empty( $feed ) )
+ $feed = get_default_feed();
+
+ if ( '' != get_option( 'permalink_structure' ) ) {
+ if ( 'page' == get_option( 'show_on_front' ) && $post_id == get_option( 'page_on_front' ) )
+ $url = _get_page_link( $post_id );
+ else
+ $url = get_permalink( $post_id );
+
+ $url = trailingslashit( $url ) . 'feed';
+ if ( $feed != get_default_feed() )
+ $url .= "/$feed";
+ $url = user_trailingslashit( $url, 'single_feed' );
+ } else {
+ $type = get_post_field( 'post_type', $post_id );
+ if ( 'page' == $type )
+ $url = home_url( "?feed=$feed&page_id=$post_id" );
+ else
+ $url = home_url( "?feed=$feed&p=$post_id" );
+ }
+
+ return $url;
+ }
+
+ /**
+ * Workaround for get_author_feed_link function, remove filtering.
+ *
+ * @param unknown $author_id
+ * @param string $feed
+ * @return string
+ */
+ static public function get_author_feed_link( $author_id, $feed = '' ) {
+ $author_id = (int) $author_id;
+ $permalink_structure = get_option( 'permalink_structure' );
+
+ if ( empty( $feed ) )
+ $feed = get_default_feed();
+
+ if ( '' == $permalink_structure ) {
+ $link = home_url( "?feed=$feed&author=" . $author_id );
+ } else {
+ $link = get_author_posts_url( $author_id );
+ if ( $feed == get_default_feed() )
+ $feed_link = 'feed';
+ else
+ $feed_link = "feed/$feed";
+
+ $link = trailingslashit( $link ) . user_trailingslashit( $feed_link, 'feed' );
+ }
+
+ return $link;
+ }
+
+ /**
+ * Workaround for get_term_feed_link function, remove filtering.
+ *
+ * @param unknown $term_id
+ * @param string $taxonomy
+ * @param string $feed
+ * @return bool|string
+ */
+ static public function get_term_feed_link( $term_id, $taxonomy = 'category', $feed = '' ) {
+ $term_id = ( int ) $term_id;
+
+ $term = get_term( $term_id, $taxonomy );
+
+ if ( empty( $term ) || is_wp_error( $term ) )
+ return false;
+
+ if ( empty( $feed ) )
+ $feed = get_default_feed();
+
+ $permalink_structure = get_option( 'permalink_structure' );
+
+ if ( '' == $permalink_structure ) {
+ if ( 'category' == $taxonomy ) {
+ $link = home_url( "?feed=$feed&cat=$term_id" );
+ }
+ elseif ( 'post_tag' == $taxonomy ) {
+ $link = home_url( "?feed=$feed&tag=$term->slug" );
+ } else {
+ $t = get_taxonomy( $taxonomy );
+ $link = home_url( "?feed=$feed&$t->query_var=$term->slug" );
+ }
+ } else {
+ $link = get_term_link( $term_id, $term->taxonomy );
+ if ( $feed == get_default_feed() )
+ $feed_link = 'feed';
+ else
+ $feed_link = "feed/$feed";
+
+ $link = trailingslashit( $link ) . user_trailingslashit( $feed_link, 'feed' );
+ }
+
+ return $link;
+ }
+
+ static public function get_rest_posts_urls() {
+ static $posts_urls = array();
+
+ if ( empty( $posts_urls ) ) {
+ $types = get_post_types( array( 'show_in_rest' => true ), 'objects' );
+ $wp_json_base = self::wp_json_base();
+
+ foreach ( $types as $post_type ) {
+ $rest_base = ( !empty( $post_type->rest_base ) ?
+ $post_type->rest_base : $post_type->name );
+
+ $posts_urls[] = $wp_json_base . $rest_base;
+ }
+ }
+
+ return $posts_urls;
+ }
+
+ static public function get_rest_post_urls( $post_id ) {
+ static $post_urls = array();
+
+ if ( !isset( $post_urls[$post_id] ) ) {
+ $post = get_post( $post_id );
+ $urls = array();
+ $wp_json_base = self::wp_json_base();
+
+ if ( $post ) {
+ $post_type = get_post_type_object( $post->post_type );
+ $rest_base = ( !empty( $post_type->rest_base ) ?
+ $post_type->rest_base : $post_type->name );
+
+ $urls[] = $wp_json_base . $rest_base . '/' . $post->ID;
+ }
+
+ $post_urls[$post_id] = $urls;
+ }
+
+ return $post_urls[$post_id];
+ }
+
+ static private function wp_json_base() {
+ $wp_json_base = rtrim( get_home_url(), '/' ) . W3TC_WP_JSON_URI;
+ $wp_json_base = apply_filters( 'w3tc_pageurls_wp_json_base', $wp_json_base );
+ return $wp_json_base;
+ }
+
+ static public function complement_with_mirror_urls( $queued_urls ) {
+ $config = Dispatcher::config();
+
+ if ( !$config->get_boolean( 'pgcache.mirrors.enabled' ) ||
+ Util_Environment::is_wpmu_subdomain() )
+ return $queued_urls;
+
+ $home_urls = $config->get_array( 'pgcache.mirrors.home_urls' );
+
+ $url_prefix = trailingslashit( get_home_url() );
+ $mirror_urls = array();
+
+ foreach ( $queued_urls as $url ) {
+ if ( substr( $url, 0, strlen( $url_prefix ) ) != $url_prefix )
+ continue;
+
+ foreach ( $home_urls as $home ) {
+ if ( !empty( $home ) ) {
+ $mirror_urls[] = trailingslashit( $home ) .
+ substr( $url, strlen( $url_prefix ) );
+ }
+ }
+ }
+
+ return array_merge( $queued_urls, $mirror_urls );
+ }
+
+ static private function _term_hash( $terms ) {
+ $term_hash = array();
+ foreach ( $terms as $term )
+ $term_hash[] = $term->term_id;
+ $term_hashed = md5( implode( ',', $term_hash ) );
+ return $term_hashed;
+ }
+
+ /**
+ *
+ *
+ * @param unknown $post
+ * @return string
+ */
+ static private function _get_archive_slug( $post ) {
+ $archive_slug = '';
+ global $wp_post_types;
+ $args = $wp_post_types[$post->post_type];
+ if ( $args->has_archive ) {
+ global $wp_rewrite;
+ $archive_slug = $args->has_archive === true ? $args->rewrite['slug'] : $args->has_archive;
+ if ( $args->rewrite['with_front'] )
+ $archive_slug = substr( $wp_rewrite->front, 1 ) . $archive_slug;
+ else
+ $archive_slug = $wp_rewrite->root . $archive_slug;
+ }
+ return $archive_slug;
+ }
+
+ /**
+ * Gets page title based on key.
+ *
+ * @since 2.4.0
+ *
+ * @param string $id Page ID.
+ * @return array
+ */
+ public static function get_page_mapping( $id ) {
+ $map = array(
+ 'w3tc_dashboard' => array(
+ 'page_name' => esc_html__( 'Dashboard', 'w3-total-cache' ),
+ ),
+ 'w3tc_feature_showcase' => array(
+ 'page_name' => esc_html__( 'Feature Showcase', 'w3-total-cache' ),
+ ),
+ 'w3tc_general' => array(
+ 'page_name' => esc_html__( 'General Settings', 'w3-total-cache' ),
+ ),
+ 'w3tc_pgcache' => array(
+ 'page_name' => esc_html__( 'Page Cache', 'w3-total-cache' ),
+ 'parent_name' => esc_html__( 'General Settings', 'w3-total-cache' ),
+ 'parent_link' => esc_url( Util_Ui::admin_url( 'admin.php?page=w3tc_general' ) ),
+ ),
+ 'w3tc_minify' => array(
+ 'page_name' => esc_html__( 'Minify', 'w3-total-cache' ),
+ 'parent_name' => esc_html__( 'General Settings', 'w3-total-cache' ),
+ 'parent_link' => esc_url( Util_Ui::admin_url( 'admin.php?page=w3tc_general' ) ),
+ ),
+ 'w3tc_dbcache' => array(
+ 'page_name' => esc_html__( 'Database Cache', 'w3-total-cache' ),
+ 'parent_name' => esc_html__( 'General Settings', 'w3-total-cache' ),
+ 'parent_link' => esc_url( Util_Ui::admin_url( 'admin.php?page=w3tc_general' ) ),
+ ),
+ 'w3tc_objectcache' => array(
+ 'page_name' => esc_html__( 'Object Cache', 'w3-total-cache' ),
+ 'parent_name' => esc_html__( 'General Settings', 'w3-total-cache' ),
+ 'parent_link' => esc_url( Util_Ui::admin_url( 'admin.php?page=w3tc_general' ) ),
+ ),
+ 'w3tc_browsercache' => array(
+ 'page_name' => esc_html__( 'Browser Cache', 'w3-total-cache' ),
+ 'parent_name' => esc_html__( 'General Settings', 'w3-total-cache' ),
+ 'parent_link' => esc_url( Util_Ui::admin_url( 'admin.php?page=w3tc_general' ) ),
+ ),
+ 'w3tc_cachegroups' => array(
+ 'page_name' => esc_html__( 'Cache Groups', 'w3-total-cache' ),
+ 'parent_name' => esc_html__( 'General Settings', 'w3-total-cache' ),
+ 'parent_link' => esc_url( Util_Ui::admin_url( 'admin.php?page=w3tc_general' ) ),
+ ),
+ 'w3tc_cdn' => array(
+ 'page_name' => esc_html__( 'CDN', 'w3-total-cache' ),
+ 'parent_name' => esc_html__( 'General Settings', 'w3-total-cache' ),
+ 'parent_link' => esc_url( Util_Ui::admin_url( 'admin.php?page=w3tc_general' ) ),
+ ),
+ 'w3tc_fragmentcache' => array(
+ 'page_name' => esc_html__( 'Fragment Cache', 'w3-total-cache' ),
+ 'parent_name' => esc_html__( 'General Settings', 'w3-total-cache' ),
+ 'parent_link' => esc_url( Util_Ui::admin_url( 'admin.php?page=w3tc_general' ) ),
+ ),
+ 'w3tc_support' => array(
+ 'page_name' => esc_html__( 'Support', 'w3-total-cache' ),
+ ),
+ 'w3tc_pagespeed' => array(
+ 'page_name' => esc_html__( 'Google PageSpeed', 'w3-total-cache' ),
+ ),
+ 'w3tc_userexperience' => array(
+ 'page_name' => esc_html__( 'User Experience', 'w3-total-cache' ),
+ 'parent_name' => esc_html__( 'General Settings', 'w3-total-cache' ),
+ 'parent_link' => esc_url( Util_Ui::admin_url( 'admin.php?page=w3tc_general' ) ),
+ ),
+ 'w3tc_install' => array(
+ 'page_name' => esc_html__( 'Install', 'w3-total-cache' ),
+ ),
+ 'w3tc_setup_guide' => array(
+ 'page_name' => esc_html__( 'Setup Guide', 'w3-total-cache' ),
+ ),
+ 'w3tc_extensions' => array(
+ 'page_name' => esc_html__( 'Extensions', 'w3-total-cache' ),
+ ),
+ 'w3tc_stats' => array(
+ 'page_name' => esc_html__( 'Statistics', 'w3-total-cache' ),
+ ),
+ 'w3tc_extension_page_imageservice' => array(
+ 'page_name' => esc_html__( 'WebP Converter', 'w3-total-cache' ),
+ 'parent_name' => esc_html__( 'Extensions', 'w3-total-cache' ),
+ 'parent_link' => esc_url( Util_Ui::admin_url( 'admin.php?page=w3tc_extensions#imageservice' ) ),
+ ),
+ 'w3tc_monitoring' => array(
+ 'page_name' => esc_html__( 'Monitoring', 'w3-total-cache' ),
+ 'parent_name' => esc_html__( 'General Settings', 'w3-total-cache' ),
+ 'parent_link' => esc_url( Util_Ui::admin_url( 'admin.php?page=w3tc_general' ) ),
+ ),
+ 'w3tc_about' => array(
+ 'page_name' => esc_html__( 'About', 'w3-total-cache' ),
+ ),
+ 'swarmify' => array(
+ 'page_name' => 'Swarmify',
+ 'parent_name' => esc_html__( 'Extensions', 'w3-total-cache' ),
+ 'parent_link' => esc_url( Util_Ui::admin_url( 'admin.php?page=w3tc_extensions#swarmify' ) ),
+ ),
+ 'cloudflare' => array(
+ 'page_name' => 'CloudFlare',
+ 'parent_name' => esc_html__( 'Extensions', 'w3-total-cache' ),
+ 'parent_link' => esc_url( Util_Ui::admin_url( 'admin.php?page=w3tc_extensions#cloudflare' ) ),
+ ),
+ 'amp' => array(
+ 'page_name' => 'AMP',
+ 'parent_name' => esc_html__( 'Extensions', 'w3-total-cache' ),
+ 'parent_link' => esc_url( Util_Ui::admin_url( 'admin.php?page=w3tc_extensions#amp' ) ),
+ ),
+ );
+
+ $map = apply_filters( 'w3tc_page_mapping', $map );
+
+ return ! empty( $map[ $id ] ) ? $map[ $id ] : array();
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Request.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Request.php
new file mode 100644
index 00000000..dd500d66
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Request.php
@@ -0,0 +1,154 @@
+ $value ) {
+ if ( strpos( $key, $prefix ) === 0 || strpos( $key, str_replace( '.', '_', $prefix ) ) === 0 ) {
+ $array[ substr( $key, strlen( $prefix ) ) ] = $value;
+ }
+ }
+ return $array;
+ }
+
+ /**
+ * Returns request array.
+ *
+ * @return array
+ */
+ public static function get_request() {
+ if ( ! isset( $_GET ) ) {
+ $_GET = array();
+ }
+
+ if ( ! isset( $_POST ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
+ $_POST = array();
+ }
+
+ return array_merge( $_GET, $_POST ); // phpcs:ignore
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Rule.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Rule.php
new file mode 100644
index 00000000..4c1263d7
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Rule.php
@@ -0,0 +1,492 @@
+= 0; $n-- ) {
+ if ( empty( $a[$n] ) )
+ array_splice( $a, $n, 1 );
+ }
+ }
+
+ /**
+ * Returns nginx rules path
+ *
+ * @return string
+ */
+ static public function get_nginx_rules_path() {
+ $config = Dispatcher::config();
+
+ $path = $config->get_string( 'config.path' );
+
+ if ( !$path ) {
+ $path = Util_Environment::site_path() . 'nginx.conf';
+ }
+
+ return $path;
+ }
+
+ /**
+ * Returns litespeed rules path
+ *
+ * @return string
+ */
+ static public function get_litespeed_rules_path() {
+ $config = Dispatcher::config();
+
+ $path = $config->get_string( 'config.path' );
+
+ if ( !$path ) {
+ $path = Util_Environment::site_path() . 'litespeed.conf';
+ }
+
+ return $path;
+ }
+
+ /**
+ * Returns path of apache's primary rules file
+ *
+ * @return string
+ */
+ static public function get_apache_rules_path() {
+ return Util_Environment::site_path() . '.htaccess';
+ }
+
+ /**
+ * Returns path of pagecache core rules file
+ *
+ * @return string
+ */
+ static public function get_pgcache_rules_core_path() {
+ switch ( true ) {
+ case Util_Environment::is_apache():
+ case Util_Environment::is_litespeed():
+ return Util_Rule::get_apache_rules_path();
+
+ case Util_Environment::is_nginx():
+ return Util_Rule::get_nginx_rules_path();
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns path of browsercache cache rules file
+ *
+ * @return string
+ */
+ static public function get_browsercache_rules_cache_path() {
+ if ( Util_Environment::is_litespeed() ) {
+ return Util_Rule::get_litespeed_rules_path();
+ }
+
+ return Util_Rule::get_pgcache_rules_core_path();
+ }
+
+ /**
+ * Returns path of minify rules file
+ *
+ * @return string
+ */
+ static public function get_minify_rules_core_path() {
+ switch ( true ) {
+ case Util_Environment::is_apache():
+ case Util_Environment::is_litespeed():
+ return W3TC_CACHE_MINIFY_DIR . DIRECTORY_SEPARATOR . '.htaccess';
+
+ case Util_Environment::is_nginx():
+ return Util_Rule::get_nginx_rules_path();
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns path of minify rules file
+ *
+ * @return string
+ */
+ static public function get_minify_rules_cache_path() {
+ switch ( true ) {
+ case Util_Environment::is_apache():
+ case Util_Environment::is_litespeed():
+ return W3TC_CACHE_MINIFY_DIR . DIRECTORY_SEPARATOR . '.htaccess';
+
+ case Util_Environment::is_nginx():
+ return Util_Rule::get_nginx_rules_path();
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns path of CDN rules file
+ *
+ * @return string
+ */
+ static public function get_cdn_rules_path() {
+ switch ( true ) {
+ case Util_Environment::is_apache():
+ case Util_Environment::is_litespeed():
+ return '.htaccess';
+
+ case Util_Environment::is_nginx():
+ return 'nginx.conf';
+ }
+
+ return false;
+ }
+
+ static public function get_new_relic_rules_core_path() {
+ return Util_Rule::get_pgcache_rules_core_path();
+ }
+
+ /**
+ * Returns true if we can modify rules
+ *
+ * @param string $path
+ * @return boolean
+ */
+ static public function can_modify_rules( $path ) {
+ if ( Util_Environment::is_wpmu() ) {
+ if ( Util_Environment::is_apache() || Util_Environment::is_litespeed() || Util_Environment::is_nginx() ) {
+ switch ( $path ) {
+ case Util_Rule::get_pgcache_rules_cache_path():
+ case Util_Rule::get_minify_rules_core_path():
+ case Util_Rule::get_minify_rules_cache_path():
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Trim rules
+ *
+ * @param string $rules
+ * @return string
+ */
+ static public function trim_rules( $rules ) {
+ $rules = trim( $rules );
+
+ if ( $rules != '' ) {
+ $rules .= "\n";
+ }
+
+ return $rules;
+ }
+
+ /**
+ * Cleanup rewrite rules
+ *
+ * @param string $rules
+ * @return string
+ */
+ static public function clean_rules( $rules ) {
+ $rules = preg_replace( '~[\r\n]+~', "\n", $rules );
+ $rules = preg_replace( '~^\s+~m', '', $rules );
+ $rules = Util_Rule::trim_rules( $rules );
+
+ return $rules;
+ }
+
+ /**
+ * Erases text from start to end
+ *
+ * @param string $rules
+ * @param string $start
+ * @param string $end
+ * @return string
+ */
+ static public function erase_rules( $rules, $start, $end ) {
+ $r = '~' . Util_Environment::preg_quote( $start ) . "\n.*?" . Util_Environment::preg_quote( $end ) . "\n*~s";
+
+ $rules = preg_replace( $r, '', $rules );
+ $rules = Util_Rule::trim_rules( $rules );
+
+ return $rules;
+ }
+
+ /**
+ * Check if rules exist
+ *
+ * @param string $rules
+ * @param string $start
+ * @param string $end
+ * @return int
+ */
+ static public function has_rules( $rules, $start, $end ) {
+ return preg_match( '~' . Util_Environment::preg_quote( $start ) . "\n.*?" . Util_Environment::preg_quote( $end ) . "\n*~s", $rules );
+ }
+
+ /**
+ *
+ *
+ * @param Util_Environment_Exceptions $exs exceptions to fill on error
+ * @param string $path filename of rules file to modify
+ * @param string $rules rules to add
+ * @param string $start start marker
+ * @param string $end end marker
+ * @param array $order order where to place if some marker exists
+ * @param boolean $remove_wpsc if WPSC rules should be removed to avoid
+ * inconsistent rules generation
+ */
+ static public function add_rules( $exs, $path, $rules, $start, $end, $order,
+ $remove_wpsc = false ) {
+ if ( empty( $path ) ) {
+ return;
+ }
+
+ $data = @file_get_contents( $path );
+ if ( empty( $data ) ) {
+ $data = '';
+ }
+
+ $modified = false;
+ if ( $remove_wpsc ) {
+ if ( Util_Rule::has_rules(
+ $data,
+ W3TC_MARKER_BEGIN_PGCACHE_WPSC,
+ W3TC_MARKER_END_PGCACHE_WPSC ) ) {
+ $data = Util_Rule::erase_rules(
+ $data,
+ W3TC_MARKER_BEGIN_PGCACHE_WPSC,
+ W3TC_MARKER_END_PGCACHE_WPSC );
+ $modified = true;
+ }
+ }
+
+ if ( empty( $rules ) ) {
+ // rules removal mode
+ $rules_present = ( strpos( $data, $start ) !== false );
+ if ( !$modified && !$rules_present ) {
+ return;
+ }
+ } else {
+ // rules creation mode
+ $rules_missing = ( strstr( Util_Rule::clean_rules( $data ), Util_Rule::clean_rules( $rules ) ) === false );
+ if ( !$modified && !$rules_missing ) {
+ return;
+ }
+ }
+
+ $replace_start = strpos( $data, $start );
+ $replace_end = strpos( $data, $end );
+
+ if ( $replace_start !== false && $replace_end !== false && $replace_start < $replace_end ) {
+ // old rules exists, replace mode
+ $replace_length = $replace_end - $replace_start + strlen( $end ) + 1;
+ } else {
+ $replace_start = false;
+ $replace_length = 0;
+
+ $search = $order;
+
+ foreach ( $search as $string => $length ) {
+ $replace_start = strpos( $data, $string );
+
+ if ( $replace_start !== false ) {
+ $replace_start += $length;
+ break;
+ }
+ }
+ }
+
+ if ( $replace_start !== false ) {
+ $data = Util_Rule::trim_rules( substr_replace( $data, $rules, $replace_start, $replace_length ) );
+ } else {
+ $data = Util_Rule::trim_rules( rtrim( $data ) . "\n" . $rules );
+ }
+
+ if ( strpos( $path, W3TC_CACHE_DIR ) === false || Util_Environment::is_nginx() ) {
+ // writing to system rules file, may be potentially write-protected
+ try {
+ Util_WpFile::write_to_file( $path, $data );
+ } catch ( Util_WpFile_FilesystemOperationException $ex ) {
+ if ( $replace_start !== false ) {
+ $message = sprintf( __( 'Edit file %s and replace all lines between and including %s and %s markers with:',
+ 'w3-total-cache' ), $path, $start, $end );
+ } else {
+ $message = sprintf( __( 'Edit file %s and add the following rules above the WordPress directives:',
+ 'w3-total-cache' ), $path );
+ }
+
+ $ex = new Util_WpFile_FilesystemModifyException(
+ $ex->getMessage(), $ex->credentials_form(),
+ $message, $path, $rules );
+
+ $exs->push( $ex );
+ return;
+ }
+ } else {
+ // writing to own rules file in cache folder
+ if ( !@file_exists( dirname( $path ) ) ) {
+ Util_File::mkdir_from( dirname( $path ), W3TC_CACHE_DIR );
+ }
+
+ if ( !@file_put_contents( $path, $data ) ) {
+ try {
+ Util_WpFile::delete_folder(
+ dirname( $path ),
+ '',
+ isset( $_SERVER['REQUEST_URI'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : ''
+ );
+ } catch ( Util_WpFile_FilesystemOperationException $ex ) {
+ $exs->push( $ex );
+ return;
+ }
+ }
+ }
+
+ Util_Rule::after_rules_modified();
+ }
+
+
+
+ /**
+ * Called when rules are modified, sets notification
+ */
+ static public function after_rules_modified() {
+ if ( Util_Environment::is_nginx() ) {
+ $state = Dispatcher::config_state_master();
+ $state->set( 'common.show_note.nginx_restart_required', true );
+ $state->save();
+ }
+ }
+
+
+
+ /**
+ * Remove rules
+ */
+ static public function remove_rules( $exs, $path, $start, $end ) {
+ if ( !file_exists( $path ) )
+ return;
+
+ $data = @file_get_contents( $path );
+ if ( $data === false )
+ return;
+ if ( strstr( $data, $start ) === false )
+ return;
+
+ $data = Util_Rule::erase_rules( $data, $start,
+ $end );
+
+ try {
+ Util_WpFile::write_to_file( $path, $data );
+ } catch ( Util_WpFile_FilesystemOperationException $ex ) {
+ $exs->push( new Util_WpFile_FilesystemModifyException(
+ $ex->getMessage(), $ex->credentials_form(),
+ sprintf( __( 'Edit file %s and remove all lines between and including %s
+ and %s markers.', 'w3-total-cache' ), $path, $start, $end ), $path ) );
+ }
+ }
+
+ /**
+ * Returns path of pgcache cache rules file
+ * Moved to separate file to not load rule.php for each disk enhanced request
+ *
+ * @return string
+ */
+ static public function get_pgcache_rules_cache_path() {
+ switch ( true ) {
+ case Util_Environment::is_apache():
+ case Util_Environment::is_litespeed():
+ if ( Util_Environment::is_wpmu() ) {
+ $url = get_home_url();
+ $match = null;
+ if ( preg_match( '~http(s)?://(.+?)(/)?$~', $url, $match ) ) {
+ $home_path = $match[2];
+
+ return W3TC_CACHE_PAGE_ENHANCED_DIR . DIRECTORY_SEPARATOR .
+ $home_path . DIRECTORY_SEPARATOR . '.htaccess';
+ }
+ }
+
+ return W3TC_CACHE_PAGE_ENHANCED_DIR . DIRECTORY_SEPARATOR . '.htaccess';
+
+ case Util_Environment::is_nginx():
+ return Util_Rule::get_nginx_rules_path();
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns true if we can check rules
+ *
+ * @return bool
+ */
+ static public function can_check_rules() {
+ return Util_Environment::is_apache() ||
+ Util_Environment::is_litespeed() ||
+ Util_Environment::is_nginx() ||
+ Util_Environment::is_iis();
+ }
+
+ /**
+ * Support for GoDaddy servers configuration which uses.
+ * SUBDOMAIN_DOCUMENT_ROOT variable.
+ */
+ public static function apache_docroot_variable() {
+ $document_root = isset( $_SERVER['DOCUMENT_ROOT'] ) ? esc_url_raw( wp_unslash( $_SERVER['DOCUMENT_ROOT'] ) ) : '';
+ $subdomain_document_root = isset( $_SERVER['SUBDOMAIN_DOCUMENT_ROOT'] ) ? esc_url_raw( wp_unslash( $_SERVER['SUBDOMAIN_DOCUMENT_ROOT'] ) ) : '';
+ $php_document_root = isset( $_SERVER['PHP_DOCUMENT_ROOT'] ) ? esc_url_raw( wp_unslash( $_SERVER['PHP_DOCUMENT_ROOT'] ) ) : '';
+ if ( ! empty( $subdomain_document_root ) && $subdomain_document_root !== $document_root ) {
+ return '%{ENV:SUBDOMAIN_DOCUMENT_ROOT}';
+ } elseif ( ! empty( $php_document_root ) && $php_document_root !== $document_root ) {
+ return '%{ENV:PHP_DOCUMENT_ROOT}';
+ } else {
+ return '%{DOCUMENT_ROOT}';
+ }
+ }
+
+
+
+ /**
+ * Takes an array of extensions single per row and/or extensions delimited by |
+ *
+ * @param unknown $extensions
+ * @param unknown $ext
+ * @return array
+ */
+ static public function remove_extension_from_list( $extensions, $ext ) {
+ for ( $i = 0; $i < sizeof( $extensions ); $i++ ) {
+ if ( $extensions[$i] == $ext ) {
+ unset( $extensions[$i] );
+ return $extensions;
+ } elseif ( strpos( $extensions[$i], $ext ) !== false &&
+ strpos( $extensions[$i], '|' ) !== false ) {
+ $exts = explode( '|', $extensions[$i] );
+ $key = array_search( $ext, $exts );
+ unset( $exts[$key] );
+ $extensions[$i] = implode( '|', $exts );
+ return $extensions;
+ }
+ }
+ return $extensions;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Theme.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Theme.php
new file mode 100644
index 00000000..4753329c
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Theme.php
@@ -0,0 +1,161 @@
+get( 'Name' );
+ }
+
+ static public function get_current_theme() {
+ return wp_get_theme();
+ }
+
+ static public function get_themes() {
+ global $wp_themes;
+ if ( isset( $wp_themes ) )
+ return $wp_themes;
+
+ $themes = wp_get_themes();
+ $wp_themes = array();
+
+ foreach ( $themes as $theme ) {
+ $name = $theme->get( 'Name' );
+ if ( isset( $wp_themes[$name] ) )
+ $wp_themes[$name . '/' . $theme->get_stylesheet()] = $theme;
+ else
+ $wp_themes[$name] = $theme;
+ }
+
+ return $wp_themes;
+ }
+
+ /**
+ * Returns theme key
+ *
+ * @param string $theme_root
+ * @param string $template
+ * @param string $stylesheet
+ * @return string
+ */
+ static public function get_theme_key( $theme_root, $template, $stylesheet ) {
+ $theme_path = ltrim( str_replace( WP_CONTENT_DIR, '',
+ Util_Environment::normalize_path( $theme_root ) ), '/' );
+
+ return substr( md5( $theme_path . $template . $stylesheet ), 0, 5 );
+ }
+
+ /**
+ * Returns themes array
+ *
+ * @return array
+ */
+ static public function get_themes_by_key() {
+ $themes = array();
+ $wp_themes = Util_Theme::get_themes();
+
+ foreach ( $wp_themes as $wp_theme ) {
+ $theme_key = Util_Theme::get_theme_key( $wp_theme['Theme Root'], $wp_theme['Template'], $wp_theme['Stylesheet'] );
+ $themes[$theme_key] = $wp_theme['Name'];
+ }
+
+ return $themes;
+ }
+
+ /**
+ * Returns minify groups
+ *
+ * @param string $theme_name
+ * @return array
+ */
+ static public function get_theme_templates( $theme_name ) {
+ $groups = array(
+ 'default' => __( 'All Templates', 'w3-total-cache' )
+ );
+
+ $templates = Util_Theme::get_theme_files( $theme_name );
+
+ foreach ( $templates as $template ) {
+ $basename = basename( $template, '.php' );
+
+ $groups[$basename] = ucfirst( $basename );
+ }
+
+ return $groups;
+ }
+
+
+ /**
+ * Returns array of theme groups
+ *
+ * @param string $theme_name
+ * @return array
+ */
+ static public function get_theme_files( $theme_name ) {
+ $patterns = array(
+ '404',
+ 'search',
+ 'taxonomy((-|_).*)?',
+ 'front-page',
+ 'home',
+ 'index',
+ '(image|video|text|audio|application).*',
+ 'attachment',
+ 'single((-|_).*)?',
+ 'page((-|_).*)?',
+ 'category((-|_).*)?',
+ 'tag((-|_).*)?',
+ 'author((-|_).*)?',
+ 'date',
+ 'archive',
+ 'comments-popup',
+ 'paged'
+ );
+
+ $templates = array();
+ $theme = Util_Theme::get( $theme_name );
+
+ if ( $theme && isset( $theme['Template Files'] ) ) {
+ $template_files = (array) $theme['Template Files'];
+
+ foreach ( $template_files as $template_file ) {
+ /**
+ * Check file name
+ */
+ $template = basename( $template_file, '.php' );
+
+ foreach ( $patterns as $pattern ) {
+ $regexp = '~^' . $pattern . '$~';
+
+ if ( preg_match( $regexp, $template ) ) {
+ $templates[] = $template_file;
+ continue 2;
+ }
+ }
+
+ /**
+ * Check get_header function call
+ */
+ $template_content = @file_get_contents( $template_file );
+
+ if ( $template_content && preg_match( '~\s*get_header[0-9_]*\s*\(~', $template_content ) ) {
+ $templates[] = $template_file;
+ }
+ }
+
+ sort( $templates );
+ reset( $templates );
+ }
+
+ return $templates;
+ }
+
+
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Ui.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Ui.php
new file mode 100644
index 00000000..824bde19
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Ui.php
@@ -0,0 +1,1992 @@
+';
+ }
+
+ /**
+ * Returns button link html.
+ *
+ * @param string $text Text.
+ * @param string $url URL.
+ * @param bool $new_window Open link in a new window.
+ * @param string $class Class.
+ * @param string $name Name.
+ * @return string
+ */
+ public static function button_link( $text, $url, $new_window = false, $class = 'button', $name = '' ) {
+ $url = str_replace( '&', '&', $url );
+
+ if ( $new_window ) {
+ $onclick = sprintf( 'window.open(\'%s\');', addslashes( $url ) );
+ } else {
+ $onclick = '';
+
+ if ( strpos( $class, 'w3tc-button-ignore-change' ) >= 0 ) {
+ $onclick .= 'w3tc_beforeupload_unbind(); ';
+ }
+
+ $onclick .= sprintf( 'document.location.href=\'%s\';', addslashes( $url ) );
+ }
+
+ return self::button( $text, $onclick, $class, $name );
+ }
+
+ public static function url( $addon ) {
+ if ( ! isset( $addon['page'] ) ) {
+ $addon['page'] = Util_Request::get_string( 'page', 'w3tc_dashboard' );
+ }
+
+ $url = 'admin.php';
+ $amp = '?';
+ foreach ( $addon as $key => $value ) {
+ $url .= $amp . rawurlencode( $key ) . '=' . rawurlencode( $value );
+ $amp = '&';
+ }
+
+ $url = wp_nonce_url( $url, 'w3tc' );
+
+ return $url;
+ }
+
+ /**
+ * Returns hide note button html
+ *
+ * @param string $text
+ * @param string $note
+ * @param string $redirect
+ * @param boolean $admin if to use config admin.
+ * @param string $page
+ * @param string $custom_method
+ * @return string
+ */
+ public static function button_hide_note( $text, $note, $redirect = '',
+ $admin = false, $page = '',
+ $custom_method = 'w3tc_default_hide_note' ) {
+ if ( '' === $page ) {
+ $page = Util_Request::get_string( 'page', 'w3tc_dashboard' );
+ }
+
+ $url = sprintf( 'admin.php?page=%s&%s¬e=%s', $page, $custom_method, $note );
+
+ if ( $admin ) {
+ $url .= '&admin=1';
+ }
+
+ if ( '' !== $redirect ) {
+ $url .= '&redirect=' . rawurlencode( $redirect );
+ }
+
+ $url = wp_nonce_url( $url, 'w3tc' );
+
+ return self::button_link( $text, $url, false, 'button', 'w3tc_hide_' . $custom_method );
+ }
+
+ public static function button_hide_note2( $parameters ) {
+ return self::button_link(
+ __( 'Hide this message', 'w3-total-cache' ),
+ self::url( $parameters ),
+ false,
+ 'button',
+ 'w3tc_hide_' . self::config_key_to_http_name( $parameters['key'] )
+ );
+ }
+
+ public static function action_button( $action, $url, $class = '',
+ $new_window = false ) {
+ return self::button_link( $action, $url, $new_window, $class );
+ }
+ /**
+ * Returns popup button html
+ *
+ * @param string $text
+ * @param string $action
+ * @param string $params
+ * @param integer $width
+ * @param integer $height
+ * @return string
+ */
+ public static function button_popup( $text, $action, $params = '', $width = 800, $height = 600 ) {
+ $url = wp_nonce_url( sprintf( 'admin.php?page=w3tc_dashboard&w3tc_%s%s', $action, ( '' !== $params ? '&' . $params : '' ) ), 'w3tc' );
+ $url = str_replace( '&', '&', $url );
+
+ $onclick = sprintf( 'window.open(\'%s\', \'%s\', \'width=%d,height=%d,status=no,toolbar=no,menubar=no,scrollbars=yes\');', $url, $action, $width, $height );
+
+ return self::button( $text, $onclick );
+ }
+
+ /**
+ * Returns label string for a config key.
+ *
+ * @param string $config_key
+ * @param string $area
+ */
+ public static function config_label( $config_key ) {
+ static $config_labels = null;
+ if ( is_null( $config_labels ) ) {
+ $config_labels = apply_filters( 'w3tc_config_labels', array() );
+ }
+
+ if ( isset( $config_labels[ $config_key ] ) ) {
+ return $config_labels[ $config_key ];
+ }
+
+ return '';
+ }
+
+ /**
+ * Prints the label string for a config key.
+ *
+ * @param string $config_key
+ * @param string $area
+ */
+ public static function e_config_label( $config_key ) {
+ $config_label = self::config_label( $config_key );
+ echo wp_kses(
+ $config_label,
+ self::get_allowed_html_for_wp_kses_from_content( $config_label )
+ );
+ }
+
+ /**
+ * Returns postbox header
+ *
+ * WordPress 5.5 introduced .postbox-header, which broke the styles of our postboxes. This was
+ * resolved by adding additional css to /pub/css/options.css and pub/css/widget.css tagged with
+ * a "WP 5.5" comment.
+ *
+ * @todo Add .postbox-header to our postboxes and cleanup css.
+ * @link https://github.com/BoldGrid/w3-total-cache/issues/237
+ *
+ * @param string $title
+ * @param string $class
+ * @param string $id
+ * @return void
+ */
+ public static function postbox_header( $title, $class = '', $id = '' ) {
+ $id = ( ! empty( $id ) ) ? ' id="' . esc_attr( $id ) . '"' : '';
+ echo '
+
' . wp_kses( $title, self::get_allowed_html_for_wp_kses_from_content( $title ) ) . '
+
';
+ }
+
+ /**
+ * Returns postbox header with tabs and links (used on the General settings page exclusively)
+ *
+ * WordPress 5.5 introduced .postbox-header, which broke the styles of our postboxes. This was
+ * resolved by adding additional css to /pub/css/options.css and pub/css/widget.css tagged with
+ * a "WP 5.5" comment.
+ *
+ * @todo Add .postbox-header to our postboxes and cleanup css.
+ * @link https://github.com/BoldGrid/w3-total-cache/issues/237
+ *
+ * @param string $title
+ * @param string $description
+ * @param string $class
+ * @param string $id
+ * @param string $adv_link
+ * @param array $extra_links
+ * @return void
+ */
+ public static function postbox_header_tabs( $title, $description = '', $class = '', $id = '', $adv_link = '', $extra_links = array() ) {
+ $display_id = ( ! empty( $id ) ) ? ' id="' . esc_attr( $id ) . '"' : '';
+ $description = ( ! empty( $description ) ) ? '
' . wp_kses( $description, self::get_allowed_html_for_wp_kses_from_content( $description ) ) . '
' : '';
+ $basic_settings_tab = ( ! empty( $adv_link ) ) ? '
' . esc_html__( 'Basic Settings', 'w3-total-cache' ) . ' ' : '';
+ $adv_settings_tab = ( ! empty( $adv_link ) ) ? '
' . esc_html__( 'Advanced Settings', 'w3-total-cache' ) . ' ' : '';
+
+ $extra_link_tabs = '';
+ foreach ( $extra_links as $extra_link_text => $extra_link ) {
+ $extra_link_tabs .= '
' . esc_html( $extra_link_text ) . ' ';
+ }
+
+ echo '
+
' . wp_kses( $title, self::get_allowed_html_for_wp_kses_from_content( $title ) ) . '
+ ' . $description . '
+
' . $basic_settings_tab . $adv_settings_tab . $extra_link_tabs . '
+
';
+ }
+
+ /**
+ * Returns postbox footer
+ *
+ * @return void
+ */
+ public static function postbox_footer() {
+ echo '
';
+ }
+
+ public static function button_config_save( $id = '', $extra = '' ) {
+ $b1_id = 'w3tc_save_options_' . $id;
+ $b2_id = 'w3tc_default_save_and_flush_' . $id;
+
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Toggle Dropdown
+
+
+
+
+
+
+
+
+
+
+ Toggle Dropdown
+
+
+
+
+
+
+
+ is_sealed( $key ) ) {
+ echo 'disabled="disabled" ';
+ }
+ }
+
+ /**
+ * Returns nonce field HTML
+ *
+ * @param string $action
+ * @param string $name
+ * @param bool $referer
+ * @internal param bool $echo
+ * @return string
+ */
+ public static function nonce_field( $action = -1, $name = '_wpnonce', $referer = true ) {
+ $return = '
';
+
+ if ( $referer ) {
+ $return .= wp_referer_field( false );
+ }
+
+ return $return;
+ }
+
+ /**
+ * Returns an notification box
+ *
+ * @param string $message
+ * @param string $id adds an id to the notification box.
+ * @return string
+ */
+ public static function get_notification_box( $message, $id = '' ) {
+ $page_val = Util_Request::get_string( 'page' );
+
+ if ( empty( $page_val ) || ( ! empty( $page_val ) && 'w3tc_' !== substr( $page_val, 0, 5 ) ) ) {
+ $logo = sprintf(
+ '
"',
+ esc_url( plugins_url( '/pub/img/W3TC_dashboard_logo_title.png', W3TC_FILE ) ) . ''
+ );
+ } else {
+ $logo = '';
+ }
+ return sprintf(
+ '
%s
',
+ $id ? 'id="' . esc_attr( $id ) . '"' : '',
+ $logo . wp_kses( $message, self::get_allowed_html_for_wp_kses_from_content( $message ) )
+ );
+ }
+
+ /**
+ * Echos an notification box
+ *
+ * @param string $message
+ * @param string $id adds an id to the notification box.
+ */
+ public static function e_notification_box( $message, $id = '' ) {
+ $notification_box = self::get_notification_box( $message, $id );
+ echo wp_kses(
+ $notification_box,
+ self::get_allowed_html_for_wp_kses_from_content( $notification_box )
+ );
+ }
+
+ /**
+ * Echos an error box.
+ *
+ * @param string $message Message.
+ * @param string $id Id.
+ */
+ public static function error_box( $message, $id = '' ) {
+ $page_val = Util_Request::get_string( 'page' );
+
+ if ( empty( $page_val ) || ( ! empty( $page_val ) && 'w3tc_' !== substr( $page_val, 0, 5 ) ) ) {
+ $logo = sprintf(
+ '
',
+ esc_url( plugins_url( '/pub/img/W3TC_dashboard_logo_title.png', W3TC_FILE ) . '' )
+ );
+ } else {
+ $logo = '';
+ }
+
+ $v = sprintf(
+ '
%s
',
+ $id ? 'id="' . esc_attr( $id ) . '"' : '',
+ $logo . wp_kses( $message, self::get_allowed_html_for_wp_kses_from_content( $message ) )
+ );
+
+ echo wp_kses(
+ $v,
+ self::get_allowed_html_for_wp_kses_from_content( $v )
+ );
+ }
+
+ /**
+ * Format bytes into B, KB, MB, GB and TB
+ *
+ * @param unknown $bytes
+ * @param int $precision
+ * @return string
+ */
+ public static function format_bytes( $bytes, $precision = 2 ) {
+ $units = array( 'B', 'KB', 'MB', 'GB', 'TB' );
+
+ $bytes = max( $bytes, 0 );
+ $pow = floor( ( $bytes ? log( $bytes ) : 0 ) / log( 1024 ) );
+ $pow = min( $pow, count( $units ) - 1 );
+
+ // Uncomment one of the following alternatives.
+ $bytes /= pow( 1024, $pow );
+ // $bytes /= ( 1 << ( 10 * $pow ) );
+
+ return round( $bytes, $precision ) . ' ' . $units[ $pow ];
+ }
+
+ public static function format_mbytes( $bytes, $precision = 2 ) {
+ $units = array( 'B', 'KB', 'MB', 'GB', 'TB' );
+
+ $bytes = max( $bytes, 0 );
+ $pow = floor( ( $bytes ? log( $bytes ) : 0 ) / log( 1024 ) );
+ $pow = min( $pow, count( $units ) - 1 );
+
+ // Uncomment one of the following alternatives.
+ $bytes /= pow( 1024, $pow );
+ // $bytes /= ( 1 << ( 10 * $pow ) );
+
+ return round( $bytes, $precision ) . ' ' . $units[ $pow + 2 ];
+ }
+
+ /**
+ * Returns an input text element
+ *
+ * @param string $id
+ * @param string $name
+ * @param string $value
+ * @param bool $disabled
+ * @param int $size
+ */
+ public static function r_hidden( $id, $name, $value ) {
+ return '
';
+ }
+
+ /**
+ * Echos an input text element
+ *
+ * @param string $id
+ * @param string $name
+ * @param string $value
+ * @param bool $disabled
+ * @param int $size
+ */
+ public static function hidden( $id, $name, $value ) {
+ $hidden = self::r_hidden( $id, $name, $value );
+ echo wp_kses(
+ $hidden,
+ self::get_allowed_html_for_wp_kses_from_content( $hidden )
+ );
+ }
+
+ /**
+ * Echos an label element
+ *
+ * @param string $id
+ * @param string $text
+ */
+ public static function label( $id, $text ) {
+ $label = '
' . $text . ' ';
+ echo wp_kses(
+ $label,
+ self::get_allowed_html_for_wp_kses_from_content( $label )
+ );
+ }
+
+ /**
+ * Echos an input text element
+ *
+ * @param string $id
+ * @param string $name
+ * @param string $value
+ * @param bool $disabled
+ * @param int $size
+ */
+ public static function textbox( $id, $name, $value, $disabled = false,
+ $size = 40, $type = 'text', $placeholder = '' ) {
+ echo '
';
+ }
+
+ /**
+ * Echos an input password element
+ *
+ * @param string $id
+ * @param string $name
+ * @param string $value
+ * @param bool $disabled
+ * @param int $size
+ */
+ public static function passwordbox( $id, $name, $value, $disabled = false, $size = 40 ) {
+ echo '
';
+ }
+
+ /**
+ * Echos an select element
+ *
+ * @param string $id
+ * @param string $name
+ * @param bool $state whether checked or not.
+ * @param bool $disabled
+ * @param array $optgroups
+ */
+ public static function selectbox( $id, $name, $value, $values,
+ $disabled = false, $optgroups = null ) {
+ echo '
\n";
+
+ if ( ! is_array( $optgroups ) ) {
+ // simle control.
+ foreach ( $values as $key => $descriptor ) {
+ self::option( $key, $value, $descriptor );
+ }
+ } else {
+ // with optgroups.
+ $current_optgroup = -1;
+ foreach ( $values as $key => $descriptor ) {
+ $optgroup = ( isset( $descriptor['optgroup'] ) ? $descriptor['optgroup'] : -1 );
+ if ( $optgroup !== $current_optgroup ) {
+ if ( -1 !== $current_optgroup ) {
+ echo '';
+ }
+ echo '' . "\n";
+ $current_optgroup = $optgroup;
+ }
+
+ self::option( $key, $value, $descriptor );
+ }
+
+ if ( -1 !== $current_optgroup ) {
+ echo ' ';
+ }
+ }
+
+ echo ' ';
+ }
+
+ private static function option( $key, $selected_value, $descriptor ) {
+ if ( ! is_array( $descriptor ) ) {
+ $label = $descriptor;
+ $disabled = false;
+ } else {
+ $label = $descriptor['label'];
+ $disabled = ! empty( $descriptor['disabled'] );
+ }
+
+ echo '
' . wp_kses( $label, self::get_allowed_html_for_wp_kses_from_content( $label ) ) . ' ' . "\n";
+ }
+
+ /**
+ * Echos a group of radio elements
+ * values: value => label pair or
+ * value => array(label, disabled, postfix).
+ */
+ public static function radiogroup( $name, $value, $values,
+ $disabled = false, $separator = '' ) {
+ $first = true;
+ foreach ( $values as $key => $label_or_array ) {
+ if ( $first ) {
+ $first = false;
+ } else {
+ echo wp_kses(
+ $separator,
+ self::get_allowed_html_for_wp_kses_from_content( $separator )
+ );
+ }
+
+ $label = '';
+ $item_disabled = false;
+ $postfix = '';
+ $pro_feature = false;
+
+ if ( ! is_array( $label_or_array ) ) {
+ $label = $label_or_array;
+ } else {
+ $label = $label_or_array['label'];
+ $item_disabled = $label_or_array['disabled'];
+ $postfix = isset( $label_or_array['postfix'] ) ? $label_or_array['postfix'] : '';
+ $pro_feature = isset( $label_or_array['pro_feature'] ) ? $label_or_array['pro_feature'] : false;
+ }
+
+ if ( $pro_feature ) {
+ self::pro_wrap_maybe_start();
+ }
+ echo '
' . wp_kses( $label, self::get_allowed_html_for_wp_kses_from_content( $label ) ) . '' . wp_kses( $postfix, self::get_allowed_html_for_wp_kses_from_content( $postfix ) ) . "\n";
+ if ( $pro_feature ) {
+ self::pro_wrap_description(
+ $label_or_array['pro_excerpt'],
+ $label_or_array['pro_description'],
+ $name . '__' . $key
+ );
+
+ self::pro_wrap_maybe_end( $name . '__' . $key );
+ }
+ }
+ }
+
+ /**
+ * Echos an input text element
+ *
+ * @param string $id
+ * @param string $name
+ * @param string $value
+ * @param bool $disabled
+ */
+ public static function textarea( $id, $name, $value, $disabled = false ) {
+ ?>
+
+ ';
+ }
+
+ echo '
' . "\n";
+ echo '
';
+
+ if ( ! is_null( $label ) ) {
+ echo wp_kses( $label, self::get_allowed_html_for_wp_kses_from_content( $label ) ) . '';
+ }
+ }
+
+ /**
+ * Echos an element
+ *
+ * @param string $type
+ * @param string $id
+ * @param string $name
+ * @param mixed $value
+ * @param bool $disabled
+ */
+ public static function element( $type, $id, $name, $value, $disabled = false ) {
+ switch ( $type ) {
+ case 'textbox':
+ self::textbox( $id, $name, $value, $disabled );
+ break;
+ case 'password':
+ self::passwordbox( $id, $name, $value, $disabled );
+ break;
+ case 'textarea':
+ self::textarea( $id, $name, $value, $disabled );
+ break;
+ case 'checkbox':
+ default:
+ self::checkbox( $id, $name, $value, $disabled );
+ break;
+ }
+ }
+
+ public static function checkbox2( $e ) {
+ self::checkbox(
+ $e['name'],
+ $e['name'],
+ $e['value'],
+ ( isset( $e['disabled'] ) ? $e['disabled'] : false ),
+ ( isset( $e['label'] ) ? $e['label'] : null )
+ );
+ }
+
+ public static function radiogroup2( $e ) {
+ self::radiogroup(
+ $e['name'],
+ $e['value'],
+ $e['values'],
+ $e['disabled'],
+ $e['separator']
+ );
+ }
+
+ public static function selectbox2( $e ) {
+ self::selectbox(
+ $e['name'],
+ $e['name'],
+ $e['value'],
+ $e['values'],
+ ( isset( $e['disabled'] ) ? $e['disabled'] : false ),
+ ( isset( $e['optgroups'] ) ? $e['optgroups'] : null )
+ );
+ }
+
+ public static function textbox2( $e ) {
+ self::textbox(
+ $e['name'],
+ $e['name'],
+ $e['value'],
+ ( isset( $e['disabled'] ) ? $e['disabled'] : false ),
+ ( ! empty( $e['size'] ) ? $e['size'] : 20 ),
+ ( ! empty( $e['type'] ) ? $e['type'] : 'text' ),
+ ( ! empty( $e['placeholder'] ) ? $e['placeholder'] : '' )
+ );
+ }
+
+ public static function textarea2( $e ) {
+ self::textarea(
+ $e['name'],
+ $e['name'],
+ $e['value'],
+ ( isset( $e['disabled'] ) ? $e['disabled'] : false )
+ );
+ }
+
+ public static function control2( $a ) {
+ if ( 'checkbox' === $a['control'] ) {
+ self::checkbox2(
+ array(
+ 'name' => $a['control_name'],
+ 'value' => $a['value'],
+ 'disabled' => $a['disabled'],
+ 'label' => $a['checkbox_label'],
+ )
+ );
+ } elseif ( 'radiogroup' === $a['control'] ) {
+ self::radiogroup2(
+ array(
+ 'name' => $a['control_name'],
+ 'value' => $a['value'],
+ 'disabled' => $a['disabled'],
+ 'values' => $a['radiogroup_values'],
+ 'separator' => isset( $a['radiogroup_separator'] ) ? $a['radiogroup_separator'] : '',
+ )
+ );
+ } elseif ( 'selectbox' === $a['control'] ) {
+ self::selectbox2(
+ array(
+ 'name' => $a['control_name'],
+ 'value' => $a['value'],
+ 'disabled' => $a['disabled'],
+ 'values' => $a['selectbox_values'],
+ 'optgroups' => isset( $a['selectbox_optgroups'] ) ? $a['selectbox_optgroups'] : null,
+ )
+ );
+ } elseif ( 'textbox' === $a['control'] ) {
+ self::textbox2(
+ array(
+ 'name' => $a['control_name'],
+ 'value' => $a['value'],
+ 'disabled' => $a['disabled'],
+ 'type' => isset( $a['textbox_type'] ) ? $a['textbox_type'] : null,
+ 'size' => isset( $a['textbox_size'] ) ? $a['textbox_size'] : null,
+ 'placeholder' => isset( $a['textbox_placeholder'] ) ? $a['textbox_placeholder'] : null,
+ )
+ );
+ } elseif ( 'textarea' === $a['control'] ) {
+ self::textarea2(
+ array(
+ 'name' => $a['control_name'],
+ 'value' => $a['value'],
+ 'disabled' => $a['disabled'],
+ )
+ );
+ } elseif ( 'none' === $a['control'] ) {
+ echo wp_kses( $a['none_label'], self::get_allowed_html_for_wp_kses_from_content( $a['none_label'] ) );
+ } elseif ( 'button' === $a['control'] ) {
+ echo '
' . wp_kses( $a['none_label'], self::get_allowed_html_for_wp_kses_from_content( $a['none_label'] ) ) . ' ';
+ }
+ }
+
+ /**
+ * Get table classes for tables including pro features.
+ *
+ * When on the free version, tables with pro features have additional classes added to help highlight
+ * the premium feature. If the user is on pro, this class is omitted.
+ *
+ * @since 0.14.3
+ *
+ * @return string
+ */
+ public static function table_class() {
+ $table_class[] = 'form-table';
+
+ if ( ! Util_Environment::is_w3tc_pro( Dispatcher::config() ) ) {
+ $table_class[] = 'w3tc-pro-feature';
+ }
+
+ return implode( ' ', $table_class );
+ }
+
+ /**
+ * Renders
element with controls
+ * id =>
+ * label =>
+ * label_class =>
+ * => details
+ * style - default is label,controls view,
+ * alternative is one-column view
+ */
+ public static function table_tr( $a ) {
+ $id = isset( $a['id'] ) ? $a['id'] : '';
+ $a = apply_filters( 'w3tc_ui_settings_item', $a );
+
+ echo '';
+ if ( isset( $a['label'] ) ) {
+ self::label( $id, $a['label'] );
+ }
+
+ echo " \n\n";
+
+ foreach ( $a as $key => $e ) {
+ if ( 'checkbox' === $key ) {
+ self::checkbox(
+ $id,
+ isset( $e['name'] ) ? $e['name'] : null,
+ $e['value'],
+ ( isset( $e['disabled'] ) ? $e['disabled'] : false ),
+ ( isset( $e['label'] ) ? $e['label'] : null )
+ );
+ } elseif ( 'description' === $key ) {
+ echo '' . wp_kses( $e, self::get_allowed_html_for_wp_kses_from_content( $e ) ) . '
';
+ } elseif ( 'hidden' === $key ) {
+ self::hidden( '', $e['name'], $e['value'] );
+ } elseif ( 'html' === $key ) {
+ echo wp_kses( $e, self::get_allowed_html_for_wp_kses_from_content( $e ) );
+ } elseif ( 'radiogroup' === $key ) {
+ self::radiogroup(
+ $e['name'],
+ $e['value'],
+ $e['values'],
+ $e['disabled'],
+ $e['separator']
+ );
+ } elseif ( 'selectbox' === $key ) {
+ self::selectbox(
+ $id,
+ $e['name'],
+ $e['value'],
+ $e['values'],
+ ( isset( $e['disabled'] ) ? $e['disabled'] : false ),
+ ( isset( $e['optgroups'] ) ? $e['optgroups'] : null )
+ );
+ } elseif ( 'textbox' === $key ) {
+ self::textbox(
+ $id,
+ $e['name'],
+ $e['value'],
+ ( isset( $e['disabled'] ) ? $e['disabled'] : false ),
+ ( ! empty( $e['size'] ) ? $e['size'] : 20 ),
+ ( ! empty( $e['type'] ) ? $e['type'] : 'text' ),
+ ( ! empty( $e['placeholder'] ) ? $e['placeholder'] : '' )
+ );
+ } elseif ( 'textarea' === $key ) {
+ self::textarea(
+ $id,
+ $e['name'],
+ $e['value'],
+ ( isset( $e['disabled'] ) ? $e['disabled'] : false )
+ );
+ }
+ }
+
+ echo " \n";
+ }
+
+ /**
+ * Prints configuration item UI based on description
+ * key => configuration key
+ * label => configuration key's as its introduced to the user
+ * value => it's value
+ * disabled => if disabled
+ *
+ * control => checkbox | radiogroup | selectbox | textbox
+ * checkbox_label => text shown after the textbox
+ * radiogroup_values => array of possible values for radiogroup
+ * selectbox_values => array of possible values for dropdown
+ * selectbox_optgroups =>
+ * textbox_size =>
+ *
+ * control_after => something after control to add
+ * description => description shown to the user below
+ */
+ public static function config_item( $a ) {
+ /*
+ * Some items we do not want shown in the free edition.
+ *
+ * By default, they will show in free, unless 'show_in_free' is specifically passed in as false.
+ */
+ $is_w3tc_free = ! Util_Environment::is_w3tc_pro( Dispatcher::config() );
+ $show_in_free = ! isset( $a['show_in_free'] ) || (bool) $a['show_in_free'];
+ if ( ! $show_in_free && $is_w3tc_free ) {
+ return;
+ }
+
+ $a = self::config_item_preprocess( $a );
+
+ if ( 'w3tc_single_column' === $a['label_class'] ) {
+ echo '';
+ } else {
+ echo ' ';
+
+ if ( ! empty( $a['label'] ) ) {
+ self::label( $a['control_name'], $a['label'] );
+ }
+
+ echo " \n\n";
+ }
+
+ self::control2( $a );
+
+ if ( isset( $a['control_after'] ) ) {
+ echo wp_kses(
+ $a['control_after'],
+ self::get_allowed_html_for_wp_kses_from_content( $a['control_after'] )
+ );
+ }
+ if ( isset( $a['description'] ) ) {
+ echo wp_kses(
+ sprintf(
+ '%1$s%2$s%3$s',
+ '',
+ $a['description'],
+ '
'
+ ),
+ array(
+ 'p' => array(
+ 'class' => array(),
+ ),
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ }
+
+ echo ( isset( $a['style'] ) ? '' : ' ' );
+ echo " \n";
+ }
+
+ public static function config_item_extension_enabled( $a ) {
+ if ( 'w3tc_single_column' === $a['label_class'] ) {
+ echo '';
+ } else {
+ echo ' ';
+
+ if ( ! empty( $a['label'] ) ) {
+ self::label( $a['control_name'], $a['label'] );
+ }
+
+ echo " \n\n";
+ }
+
+ if ( isset( $a['pro'] ) ) {
+ self::pro_wrap_maybe_start();
+ }
+
+ $c = Dispatcher::config();
+ self::checkbox2(
+ array(
+ 'name' => 'extension__' . self::config_key_to_http_name( $a['extension_id'] ),
+ 'value' => $c->is_extension_active_frontend( $a['extension_id'] ),
+ 'label' => $a['checkbox_label'],
+ 'disabled' => isset( $a['disabled'] ) ? $a['disabled'] : false,
+ )
+ );
+
+ if ( isset( $a['description'] ) ) {
+ echo '' . wp_kses( $a['description'], self::get_allowed_html_for_wp_kses_from_content( $a['description'] ) ) . '
';
+ }
+
+ if ( isset( $a['pro'] ) ) {
+ self::pro_wrap_maybe_end( 'extension__' . self::config_key_to_http_name( $a['extension_id'] ) );
+ }
+
+ echo ( isset( $a['style'] ) ? '' : ' ' );
+ echo " \n";
+ }
+
+ public static function config_item_pro( $a ) {
+ $a = self::config_item_preprocess( $a );
+
+ if ( 'w3tc_single_column' === $a['label_class'] ) {
+ echo '';
+ } elseif ( 'w3tc_no_trtd' !== $a['label_class'] ) {
+ echo ' ';
+
+ if ( ! empty( $a['label'] ) ) {
+ self::label( $a['control_name'], $a['label'] );
+ }
+
+ echo " \n\n";
+ }
+
+ // If wrap_separate is not set we wrap everything.
+ if ( ! isset( $a['wrap_separate'] ) ) {
+ self::pro_wrap_maybe_start();
+ }
+
+ self::control2( $a );
+
+ if ( isset( $a['control_after'] ) ) {
+ echo wp_kses( $a['control_after'], self::get_allowed_html_for_wp_kses_from_content( $a['control_after'] ) );
+ }
+
+ // If wrap_separate is set we wrap only the description.
+ if ( isset( $a['wrap_separate'] ) ) {
+ // If not pro we add a spacer for better separation of control element and wrapper.
+ if ( ! Util_Environment::is_w3tc_pro( Dispatcher::config() ) ) {
+ echo ' ';
+ }
+ self::pro_wrap_maybe_start();
+ }
+
+ if ( isset( $a['description'] ) ) {
+ self::pro_wrap_description( $a['excerpt'], $a['description'], $a['control_name'] );
+ }
+
+ self::pro_wrap_maybe_end( $a['control_name'] );
+
+ if ( 'w3tc_no_trtd' !== $a['label_class'] ) {
+ echo ( isset( $a['style'] ) ? '' : ' ' );
+ echo " \n";
+ }
+ }
+
+ public static function config_item_preprocess( $a ) {
+ $c = Dispatcher::config();
+
+ if ( ! isset( $a['value'] ) || is_null( $a['value'] ) ) {
+ $a['value'] = $c->get( $a['key'] );
+ if ( is_array( $a['value'] ) ) {
+ $a['value'] = implode( "\n", $a['value'] );
+ }
+ }
+
+ if ( ! isset( $a['disabled'] ) || is_null( $a['disabled'] ) ) {
+ $a['disabled'] = $c->is_sealed( $a['key'] );
+ }
+
+ if ( empty( $a['label'] ) ) {
+ $a['label'] = self::config_label( $a['key'] );
+ }
+
+ $a['control_name'] = self::config_key_to_http_name( $a['key'] );
+ $a['label_class'] = empty( $a['label_class'] ) ? '' : $a['label_class'];
+ if ( empty( $a['label_class'] ) && 'checkbox' === $a['control'] ) {
+ $a['label_class'] = 'w3tc_config_checkbox';
+ }
+
+ $action_key = $a['key'];
+ if ( is_array( $action_key ) ) {
+ $action_key = 'extension.' . $action_key[0] . '.' . $action_key[1];
+ }
+
+ return apply_filters( 'w3tc_ui_config_item_' . $action_key, $a );
+ }
+
+ /**
+ * Displays config item - caching engine selectbox
+ */
+ public static function config_item_engine( $a ) {
+ if ( isset( $a['empty_value'] ) && $a['empty_value'] ) {
+ $values[''] = array(
+ 'label' => 'Please select a method',
+ );
+ }
+
+ $values['file'] = array(
+ 'label' => __( 'Disk', 'w3-total-cache' ),
+ 'optgroup' => 0,
+ );
+ $values['apc'] = array(
+ 'disabled' => ! Util_Installed::apc(),
+ 'label' => __( 'Opcode: Alternative PHP Cache (APC / APCu)', 'w3-total-cache' ),
+ 'optgroup' => 1,
+ );
+ $values['eaccelerator'] = array(
+ 'disabled' => ! Util_Installed::eaccelerator(),
+ 'label' => __( 'Opcode: eAccelerator', 'w3-total-cache' ),
+ 'optgroup' => 1,
+ );
+ $values['xcache'] = array(
+ 'disabled' => ! Util_Installed::xcache(),
+ 'label' => __( 'Opcode: XCache', 'w3-total-cache' ),
+ 'optgroup' => 1,
+ );
+ $values['wincache'] = array(
+ 'disabled' => ! Util_Installed::wincache(),
+ 'label' => __( 'Opcode: WinCache', 'w3-total-cache' ),
+ 'optgroup' => 1,
+ );
+ $values['memcached'] = array(
+ 'disabled' => ! Util_Installed::memcached(),
+ 'label' => __( 'Memcached', 'w3-total-cache' ),
+ 'optgroup' => 2,
+ );
+ $values['redis'] = array(
+ 'disabled' => ! Util_Installed::redis(),
+ 'label' => __( 'Redis', 'w3-total-cache' ),
+ 'optgroup' => 2,
+ );
+
+ $item_engine_config = array(
+ 'key' => $a['key'],
+ 'label' => ( isset( $a['label'] ) ? $a['label'] : null ),
+ 'disabled' => ( isset( $a['disabled'] ) ? $a['disabled'] : null ),
+ 'control' => 'selectbox',
+ 'selectbox_values' => $values,
+ 'selectbox_optgroups' => array(
+ __( 'Shared Server:', 'w3-total-cache' ),
+ __( 'Dedicated / Virtual Server:', 'w3-total-cache' ),
+ __( 'Multiple Servers:', 'w3-total-cache' ),
+ ),
+ 'control_after' => isset( $a['control_after'] ) ? $a['control_after'] : null,
+ );
+
+ if ( isset( $a['pro'] ) ) {
+ self::config_item_pro( $item_engine_config );
+ } else {
+ self::config_item( $item_engine_config );
+ }
+ }
+
+ public static function pro_wrap_maybe_start() {
+ if ( Util_Environment::is_w3tc_pro( Dispatcher::config() ) ) {
+ return;
+ }
+
+ ?>
+
+
★ PRO
+
+ ' . wp_kses( $excerpt_clean, self::get_allowed_html_for_wp_kses_from_content( $excerpt_clean ) ) . '';
+
+ if ( ! empty( $description ) ) {
+ $d = array_map(
+ function( $e ) {
+ return '
' . wp_kses( $e, self::get_allowed_html_for_wp_kses_from_content( $e ) ) . '
';
+ },
+ $description
+ );
+
+ $descriptions = implode( "\n", $d );
+
+ echo '
' . wp_kses( $descriptions, self::get_allowed_html_for_wp_kses_from_content( $descriptions ) ) . '
';
+ echo '
' . esc_html( __( 'Show More', 'w3-total-cache' ) ) . ' ';
+ }
+ }
+
+ public static function pro_wrap_maybe_end( $button_data_src ) {
+ if ( Util_Environment::is_w3tc_pro( Dispatcher::config() ) ) {
+ return;
+ }
+
+ ?>
+
+
+
+ Learn more about Pro
+
+
+
+
+
+
+
+
+
+
+ Unlock Feature
+
+
+
+ is_master() ) {
+ return;
+ }
+
+ if ( $c->get_boolean( $a['key'] ) ) {
+ $name = 'w3tc_config_overloaded_disable~' . self::config_key_to_http_name( $a['key'] );
+ $value = __( 'Use common settings', 'w3-total-cache' );
+ } else {
+ $name = 'w3tc_config_overloaded_enable~' . self::config_key_to_http_name( $a['key'] );
+ $value = __( 'Use specific settings', 'w3-total-cache' );
+ }
+
+ echo '';
+ echo ' ';
+ echo '
';
+ }
+
+ /**
+ * Get the admin URL based on the path and the interface (network or site).
+ *
+ * @param string $path Admin path/URI.
+ * @return string
+ */
+ public static function admin_url( $path ) {
+ return is_network_admin() ? network_admin_url( $path ) : admin_url( $path );
+ }
+
+ /**
+ * Returns a preview link with current state
+ *
+ * @return string
+ */
+ public static function preview_link() {
+ return self::button_link(
+ __( 'Preview', 'w3-total-cache' ),
+ self::url( array( 'w3tc_default_previewing' => 'y' ) ),
+ true
+ );
+ }
+
+ /**
+ * Takes seconds and converts to array('Nh ','Nm ', 'Ns ', 'Nms ') or "Nh Nm Ns Nms"
+ *
+ * @param unknown $input
+ * @param bool $string
+ * @return array|string
+ */
+ public static function secs_to_time( $input, $string = true ) {
+ $input = (float) $input;
+ $time = array();
+ $msecs = floor( $input * 1000 % 1000 );
+ $seconds = $input % 60;
+
+ $minutes = floor( $input / 60 ) % 60;
+ $hours = floor( $input / 60 / 60 ) % 60;
+
+ if ( $hours ) {
+ $time[] = $hours;
+ }
+ if ( $minutes ) {
+ $time[] = sprintf( '%dm', $minutes );
+ }
+ if ( $seconds ) {
+ $time[] = sprintf( '%ds', $seconds );
+ }
+ if ( $msecs ) {
+ $time[] = sprintf( '%dms', $msecs );
+ }
+
+ if ( empty( $time ) ) {
+ $time[] = sprintf( '%dms', 0 );
+ }
+ if ( $string ) {
+ return implode( ' ', $time );
+ }
+ return $time;
+ }
+
+ /**
+ * Returns option name accepted by W3TC as http paramter from its id (full name from config file).
+ *
+ * @param mixed $id ID key string/array.
+ *
+ * @return string
+ */
+ public static function config_key_to_http_name( $id ) {
+ $id = isset( $id ) ? $id : '';
+
+ if ( is_array( $id ) ) {
+ $id = $id[0] . '___' . $id[1];
+ }
+
+ return str_replace( '.', '__', $id );
+ }
+
+ /*
+ * Converts configuration key returned in http _GET/_POST
+ * to configuration key
+ */
+ public static function config_key_from_http_name( $http_key ) {
+ $a = explode( '___', $http_key );
+ if ( count( $a ) === 2 ) {
+ $a[0] = self::config_key_from_http_name( $a[0] );
+ $a[1] = self::config_key_from_http_name( $a[1] );
+ return $a;
+ }
+
+ return str_replace( '__', '.', $http_key );
+ }
+
+ public static function get_allowed_html_for_wp_kses_from_content( $content ) {
+ $allowed_html = array();
+
+ if ( empty( $content ) ) {
+ return $allowed_html;
+ }
+
+ $dom = new DOMDocument();
+ @$dom->loadHTML( $content );
+ foreach ( $dom->getElementsByTagName( '*' ) as $tag ) {
+ $tagname = $tag->tagName;
+ foreach ( $tag->attributes as $attribute_name => $attribute_val ) {
+ $allowed_html[ $tagname ][ $attribute_name ] = array();
+ }
+ $allowed_html[ $tagname ] = empty( $allowed_html[ $tagname ] ) ? array() : $allowed_html[ $tagname ];
+ }
+ return $allowed_html;
+ }
+
+ /**
+ * Prints breadcrumb
+ *
+ * @return void
+ */
+ public static function print_breadcrumb() {
+ $page = ! empty( Util_Admin::get_current_extension() ) ? Util_Admin::get_current_extension() : Util_Admin::get_current_page();
+ $page_mapping = Util_PageUrls::get_page_mapping( $page );
+ $parent = isset( $page_mapping['parent_name'] ) ?
+ '' . esc_html( $page_mapping['parent_name'] ) . ' ' : '';
+ $current = isset( $page_mapping['page_name'] ) ?
+ '' . esc_html( $page_mapping['page_name'] ) . ' ' : '';
+ ?>
+
+
+ W3 Total Cache
+
+
+
+ get_string( 'cdn.engine' ) || 'bunnycdn' === $config->get_string( 'cdnfsd.engine' );
+ $licensing_visible = (
+ ( ! Util_Environment::is_wpmu() || is_network_admin() ) &&
+ ! ini_get( 'w3tc.license_key' ) &&
+ 'host_valid' !== $state->get_string( 'license.status' )
+ );
+
+ switch ( $page ) {
+ case 'w3tc_general':
+ if ( ! empty( $_REQUEST['view'] ) ) {
+ break;
+ }
+
+ $message_bus_link = array();
+ if ( Util_Environment::is_w3tc_pro( $config ) ) {
+ $message_bus_link = array(
+ array(
+ 'id' => 'amazon_sns',
+ 'text' => esc_html__( 'Message Bus', 'w3-total-cache' ),
+ ),
+ );
+ }
+
+ $licensing_link = array();
+ if ( $licensing_visible ) {
+ $licensing_link = array(
+ array(
+ 'id' => 'licensing',
+ 'text' => esc_html__( 'Licensing', 'w3-total-cache' ),
+ ),
+ );
+ }
+
+ $links = array_merge(
+ array(
+ array(
+ 'id' => 'general',
+ 'text' => esc_html__( 'General', 'w3-total-cache' ),
+ ),
+ array(
+ 'id' => 'page_cache',
+ 'text' => esc_html__( 'Page Cache', 'w3-total-cache' ),
+ ),
+ array(
+ 'id' => 'minify',
+ 'text' => esc_html__( 'Minify', 'w3-total-cache' ),
+ ),
+ array(
+ 'id' => 'system_opcache',
+ 'text' => esc_html__( 'Opcode Cache', 'w3-total-cache' ),
+ ),
+ array(
+ 'id' => 'database_cache',
+ 'text' => esc_html__( 'Database Cache', 'w3-total-cache' ),
+ ),
+ array(
+ 'id' => 'object_cache',
+ 'text' => esc_html__( 'Object Cache', 'w3-total-cache' ),
+ ),
+ array(
+ 'id' => 'browser_cache',
+ 'text' => esc_html__( 'Browser Cache', 'w3-total-cache' ),
+ ),
+ array(
+ 'id' => 'cdn',
+ 'text' => wp_kses(
+ sprintf(
+ // translators: 1 opening HTML abbr tag, 2 closing HTML abbr tag.
+ __(
+ '%1$sCDN%2$s',
+ 'w3-total-cache'
+ ),
+ '',
+ ' '
+ ),
+ array(
+ 'abbr' => array(
+ 'title' => array(),
+ ),
+ )
+ ),
+ ),
+ array(
+ 'id' => 'reverse_proxy',
+ 'text' => esc_html__( 'Reverse Proxy', 'w3-total-cache' ),
+ ),
+ ),
+ $message_bus_link,
+ $custom_areas,
+ $licensing_link,
+ array(
+ array(
+ 'id' => 'miscellaneous',
+ 'text' => esc_html__( 'Miscellaneous', 'w3-total-cache' ),
+ ),
+ array(
+ 'id' => 'debug',
+ 'text' => esc_html__( 'Debug', 'w3-total-cache' ),
+ ),
+ array(
+ 'id' => 'image_service',
+ 'text' => esc_html__( 'WebP Converter', 'w3-total-cache' ),
+ ),
+ array(
+ 'id' => 'google_pagespeed',
+ 'text' => __( 'Google PageSpeed', 'w3-total-cache' ),
+ ),
+ array(
+ 'id' => 'settings',
+ 'text' => esc_html__( 'Import / Export Settings', 'w3-total-cache' ),
+ ),
+ )
+ );
+
+ $links_buff = array();
+ foreach ( $links as $link ) {
+ $links_buff[] = "{$link['text']} ";
+ }
+
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 500000000 )
+ return sprintf( '%.1f GB', $v / 1024 /*KB*/ / 1024 /*MB*/ / 1024/*GB*/ );
+ if ( $v > 500000 )
+ return sprintf( '%.1f MB', $v / 1024 /*KB*/ / 1024 /*MB*/ );
+ else
+ return sprintf( '%.1f KB', $v / 1024 /*KB*/ );
+ }
+
+
+
+ static public function bytes_to_size2( $a, $p1, $p2 = null, $p3 = null ) {
+ $v = self::v( $a, $p1, $p2, $p3 );
+ if ( is_null( $v ) )
+ return 'n/a';
+
+ return self::bytes_to_size( $v );
+ }
+
+
+
+ static public function percent( $v1, $v2 ) {
+ if ( $v2 == 0 ) {
+ return '0 %';
+ } elseif ($v1 > $v2 ) {
+ return '100 %';
+ } else {
+ return sprintf( '%d', $v1 / $v2 * 100 ) . ' %';
+ }
+ }
+
+
+
+ static public function percent2( $a, $property1, $property2 ) {
+ if ( !isset( $a[$property1] ) || !isset( $a[$property2] ) )
+ return 'n/a';
+ else if ( $a[$property2] == 0 )
+ return '0 %';
+ else
+ return sprintf( '%d', $a[$property1] / $a[$property2] * 100 ) . ' %';
+ }
+
+
+
+ static public function sum( $history, $property ) {
+ $v = 0;
+ foreach ( $history as $i ) {
+ $item_value = self::v3( $i, $property );
+ if ( !empty( $item_value ) ) {
+ $v += $item_value;
+ }
+ }
+ return $v;
+ }
+
+
+
+ static public function avg( $history, $property ) {
+ $v = 0;
+ $count = 0;
+ foreach ( $history as $i ) {
+ $item_value = self::v3( $i, $property );
+ if ( !empty( $item_value ) ) {
+ $v += $item_value;
+ $count++;
+ }
+ }
+ return ( $count <= 0 ? 0 : $v / $count );
+ }
+
+
+
+ /**
+ * Sum up all positive metric values which names start with specified prefix
+ **/
+ static public function sum_by_prefix_positive( &$output, $history, $property_prefix ) {
+ $property_prefix_len = strlen( $property_prefix );
+
+ foreach ( $history as $i ) {
+ foreach ( $i as $key => $value ) {
+ if ( substr( $key, 0, $property_prefix_len ) == $property_prefix &&
+ $value > 0 ) {
+ if ( !isset( $output[$key] ) ) {
+ $output[$key] = 0;
+ }
+
+ $output[$key] += $value;
+ }
+ }
+ }
+ }
+
+
+
+ static public function time_mins( $timestamp ) {
+ return date( 'm/d/Y H:i', $timestamp );
+ }
+
+
+
+ static public function integer( $v ) {
+ return number_format( $v );
+ }
+
+
+
+ static public function integer_divideby( $v, $divide_by ) {
+ if ( $divide_by == 0 ) {
+ return 'n/a';
+ }
+
+ return self::integer( $v / $divide_by );
+ }
+
+
+
+ static public function integer2( $a, $p1, $p2 = null, $p3 = null ) {
+ $v = self::v( $a, $p1, $p2, $p3 );
+ if ( is_null( $v ) )
+ return 'n/a';
+ else
+ return number_format( $v );
+ }
+
+
+
+ static public function v( $a, $p1, $p2 = null, $p3 = null ) {
+ if ( !isset( $a[$p1] ) )
+ return null;
+
+ $v = $a[$p1];
+ if ( is_null( $p2 ) )
+ return $v;
+ if ( !isset( $v[$p2] ) )
+ return null;
+
+ $v = $v[$p2];
+ if ( is_null( $p3 ) )
+ return $v;
+ if ( !isset( $v[$p3] ) )
+ return null;
+
+ return $v[$p3];
+ }
+
+
+
+ static public function v3( $a, $p ) {
+ if ( !is_array( $p ) ) {
+ $p = array( $p );
+ }
+
+ $actual = &$a;
+ for ( $i = 0; $i < count( $p ); $i++) {
+ $property = $p[$i];
+
+ if ( !isset( $actual[$property] ) ) {
+ return null;
+ }
+
+ $actual = &$actual[$property];
+ }
+
+ return $actual;
+ }
+
+
+
+ static public function value_per_second( $a, $property1, $property2 ) {
+ if ( !isset( $a[$property1] ) || !isset( $a[$property2] ) )
+ return 'n/a';
+ else if ( $a[$property2] == 0 )
+ return '0';
+ else
+ return sprintf( '%.1f', $a[$property1] / $a[$property2] * 100 );
+ }
+
+
+
+ static public function value_per_period_seconds( $total, $summary ) {
+ if ( empty( $summary['period']['seconds'] ) )
+ return 'n/a';
+
+ $period_seconds = $summary['period']['seconds'];
+
+ return sprintf( '%.1f', $total / $period_seconds );
+ }
+
+
+
+ /**
+ * Special shared code for cache size counting
+ */
+ static public function get_or_init_size_transient( $transient, $summary ) {
+ $should_count = false;
+
+ $v = get_transient( $transient );
+ if ( is_array( $v ) && isset( $v['timestamp_end'] ) &&
+ $v['timestamp_end'] == $summary['period']['timestamp_end'] ) {
+ return array( $v, false );
+ }
+
+ // limit number of processing counting it at the same time
+ $v = array(
+ 'timestamp_end' => $summary['period']['timestamp_end'],
+ 'size_used' => '...counting',
+ 'items' => '...counting'
+ );
+ set_transient( $transient, $v, 120 );
+ return array( $v, true );
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Widget.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Widget.php
new file mode 100644
index 00000000..320e8b04
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_Widget.php
@@ -0,0 +1,269 @@
+" . __( 'View all', 'w3-total-cache' ) . '';
+ self::add( $widget_id, $name, $w3tc_registered_widgets[ $widget_id ]['callback'], $w3tc_registered_widget_controls[ $widget_id ]['callback'] );
+ }
+
+ if ( 'POST' === isset( $_SERVER['REQUEST_METHOD'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_METHOD'] ) ) : '' && ! empty( Util_Request::get_string( 'widget_id' ) ) ) {
+ check_admin_referer( 'edit-dashboard-widget_' . Util_Request::get_string( 'widget_id' ), 'dashboard-widget-nonce' );
+ ob_start(); // The same hack "wp-admin/widgets.php" uses.
+ self::trigger_widget_control( Util_Request::get_string( 'widget_id' ) );
+ ob_end_clean();
+ }
+
+ if ( $update ) {
+ update_option( 'w3tc_dashboard_widget_options', $widget_options );
+ }
+
+ do_action( 'do_meta_boxes', $screen->id, 'normal', '' );
+ do_action( 'do_meta_boxes', $screen->id, 'side', '' );
+ }
+
+ /**
+ * Add 2.
+ *
+ * @static
+ *
+ * @param string $widget_id Widget id.
+ * @param int $priority Prioroty.
+ * @param string $widget_name Widget name.
+ * @param callable $callback Callback.
+ * @param callable $control_callback Control callback.
+ * @param string $location Location.
+ * @param string $header_text Header text.
+ * @param string $header_class Header class.
+ */
+ public static function add2( $widget_id, $priority, $widget_name, $callback,
+ $control_callback = null, $location = 'normal', $header_text = null,
+ $header_class = '' ) {
+ $o = new _Util_Widget_Postponed(
+ array(
+ 'widget_id' => $widget_id,
+ 'widget_name' => $widget_name,
+ 'callback' => $callback,
+ 'control_callback' => $control_callback,
+ 'location' => $location,
+ 'header_text' => $header_text,
+ 'header_class' => $header_class,
+ )
+ );
+
+ add_action(
+ 'w3tc_widget_setup',
+ array( $o, 'wp_dashboard_setup' ),
+ $priority
+ );
+
+ add_action(
+ 'w3tc_network_dashboard_setup',
+ array( $o, 'wp_dashboard_setup' ),
+ $priority
+ );
+
+ self::$w3tc_dashboard_widgets[ $widget_id ] = '*';
+ }
+
+ /**
+ * Registers widget.
+ *
+ * @static
+ *
+ * @param string $widget_id Widget id.
+ * @param string $widget_name Widget name.
+ * @param callable $callback Callback.
+ * @param callable $control_callback Control callback.
+ * @param string $location Location.
+ * @param string $header_text Header text.
+ * @param string $header_class Header class.
+ */
+ public static function add( $widget_id, $widget_name, $callback,
+ $control_callback = null, $location = 'normal', $header_text = null,
+ $header_class = '' ) {
+ $screen = get_current_screen();
+
+ global $w3tc_dashboard_control_callbacks;
+
+ if ( substr( $widget_name, 0, 1 ) !== '<' ) {
+ $widget_name = '' . $widget_name . '
';
+ }
+
+ // Link.
+ if ( $control_callback && current_user_can( 'edit_dashboard' ) && is_string( $control_callback ) ) {
+ if ( ! $header_text ) {
+ $header_text = __( 'Configure' );
+ }
+
+ $widget_name .= ' ' .
+ ' ';
+ }
+
+ // Ajax callback.
+ if ( $control_callback && current_user_can( 'edit_dashboard' ) && is_callable( $control_callback ) ) {
+ $w3tc_dashboard_control_callbacks[ $widget_id ] = $control_callback;
+ $edit_val = Util_Request::get_string( 'edit' );
+
+ if ( ! empty( $edit_val ) && $widget_id === $edit_val ) {
+ list( $url ) = explode( '#', add_query_arg( 'edit', false ), 2 );
+ $widget_name .= ' ' . __( 'Cancel', 'w3-total-cache' ) . ' ';
+
+ $callback = array(
+ '\W3TC\Util_Widget',
+ '_dashboard_control_callback',
+ );
+ } else {
+ list( $url ) = explode( '#', add_query_arg( 'edit', $widget_id ), 2 );
+ $widget_name .= ' ' . __( 'Configure' ) . ' ';
+ }
+ }
+
+ $side_widgets = array();
+
+ $priority = 'core';
+
+ add_meta_box( $widget_id, $widget_name, $callback, $screen, $location, $priority );
+ }
+
+ /**
+ * Dashboard Widgets Controls.
+ *
+ * @static
+ *
+ * @param string $dashboard Dashboard id.
+ * @param array $meta_box Meta box info.
+ */
+ public static function _dashboard_control_callback( $dashboard, $meta_box ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
+ echo '';
+ }
+
+ /**
+ * List widgets.
+ *
+ * @static
+ *
+ * @return string
+ */
+ public static function list_widgets() {
+ return implode( ',', array_keys( self::$w3tc_dashboard_widgets ) );
+ }
+
+ /**
+ * Calls widget control callback.
+ *
+ * @since 0.9.2.6
+ * @static
+ *
+ * @param int|bool $widget_control_id Registered widget id.
+ */
+ public static function trigger_widget_control( $widget_control_id = false ) {
+ global $w3tc_dashboard_control_callbacks;
+
+ if ( is_scalar( $widget_control_id ) && $widget_control_id &&
+ isset( $w3tc_dashboard_control_callbacks[ $widget_control_id ] ) &&
+ is_callable( $w3tc_dashboard_control_callbacks[ $widget_control_id ] ) ) {
+ call_user_func(
+ $w3tc_dashboard_control_callbacks[ $widget_control_id ],
+ '',
+ array(
+ 'id' => $widget_control_id,
+ 'callback' => $w3tc_dashboard_control_callbacks[ $widget_control_id ],
+ )
+ );
+ }
+ }
+}
+
+/**
+ * Class: Util_Widget_Postponed
+ */
+class _Util_Widget_Postponed { // phpcs:ignore
+ /**
+ * Data.
+ *
+ * @var array
+ * @access private
+ */
+ private $data = array();
+
+ /**
+ * Constructor.
+ *
+ * @param array $data Data.
+ */
+ public function __construct( $data ) {
+ $this->data = $data;
+ }
+
+ /**
+ * Dashboard setup.
+ */
+ public function wp_dashboard_setup() {
+ Util_Widget::add(
+ $this->data['widget_id'],
+ $this->data['widget_name'],
+ $this->data['callback'],
+ $this->data['control_callback'],
+ $this->data['location'],
+ $this->data['header_text'],
+ $this->data['header_class']
+ );
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile.php
new file mode 100644
index 00000000..c71e0c79
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile.php
@@ -0,0 +1,356 @@
+errors ) &&
+ $wp_filesystem->errors->has_errors() ) {
+ $status['error'] = esc_html( $wp_filesystem->errors->get_error_message() );
+ }
+
+ wp_send_json_error( $status );
+ }
+ }
+
+ /**
+ * Tries to write file content
+ *
+ * @param string $filename path to file
+ * @param string $content data to write
+ * @param string $method Which method to use when creating
+ * @param string $url Where to redirect after creation
+ * @param bool|string $context folder in which to write file
+ * @throws Util_WpFile_FilesystemWriteException
+ * @return void
+ */
+ static public function write_to_file( $filename, $content ) {
+ if ( @file_put_contents( $filename, $content ) )
+ return;
+
+ try {
+ self::request_filesystem_credentials();
+ } catch ( Util_WpFile_FilesystemOperationException $ex ) {
+ throw new Util_WpFile_FilesystemWriteException( $ex->getMessage(),
+ $ex->credentials_form(), $filename, $content );
+ }
+
+ global $wp_filesystem;
+ if ( !$wp_filesystem->put_contents( $filename, $content ) ) {
+ throw new Util_WpFile_FilesystemWriteException(
+ 'FTP credentials don\'t allow to write to file ' .
+ $filename . ' ', self::get_filesystem_credentials_form(),
+ $filename, $content );
+ }
+ }
+
+ /**
+ * Copy file using WordPress filesystem functions.
+ *
+ * @param unknown $source_filename
+ * @param unknown $destination_filename
+ * @param string $method Which method to use when creating
+ * @param string $url Where to redirect after creation
+ * @param bool|string $context folder to copy files too
+ * @throws Util_WpFile_FilesystemCopyException
+ */
+ static public function copy_file( $source_filename, $destination_filename ) {
+ $contents = @file_get_contents( $source_filename );
+ if ( $contents ) {
+ @file_put_contents( $destination_filename, $contents );
+ }
+ if ( @file_exists( $destination_filename ) ) {
+ if ( @file_get_contents( $destination_filename ) == $contents )
+ return;
+ }
+
+ try {
+ self::request_filesystem_credentials();
+ } catch ( Util_WpFile_FilesystemOperationException $ex ) {
+ throw new Util_WpFile_FilesystemCopyException( $ex->getMessage(),
+ $ex->credentials_form(),
+ $source_filename, $destination_filename );
+ }
+
+ global $wp_filesystem;
+ if ( !$wp_filesystem->put_contents( $destination_filename, $contents,
+ FS_CHMOD_FILE ) ) {
+ throw new Util_WpFile_FilesystemCopyException(
+ 'FTP credentials don\'t allow to copy to file ' .
+ $destination_filename . ' ',
+ self::get_filesystem_credentials_form(),
+ $source_filename, $destination_filename );
+ }
+ }
+
+ /**
+ *
+ *
+ * @param unknown $folder
+ * @param string $method Which method to use when creating
+ * @param string $url Where to redirect after creation
+ * @param bool|string $context folder to create folder in
+ * @throws Util_WpFile_FilesystemMkdirException
+ */
+ static private function create_folder( $folder, $from_folder ) {
+ if ( @is_dir( $folder ) )
+ return;
+
+ if ( Util_File::mkdir_from_safe( $folder, $from_folder ) )
+ return;
+
+ try {
+ self::request_filesystem_credentials();
+ } catch ( Util_WpFile_FilesystemOperationException $ex ) {
+ throw new Util_WpFile_FilesystemMkdirException( $ex->getMessage(),
+ $ex->credentials_form(), $folder );
+ }
+
+ global $wp_filesystem;
+ if ( !$wp_filesystem->mkdir( $folder, FS_CHMOD_DIR ) ) {
+ throw new Util_WpFile_FilesystemMkdirException(
+ 'FTP credentials don\'t allow to create folder ' .
+ $folder . ' ',
+ self::get_filesystem_credentials_form(),
+ $folder );
+ }
+ }
+
+ /**
+ *
+ *
+ * @param unknown $folder
+ * @param string $method Which method to use when creating
+ * @param string $url Where to redirect after creation
+ * @param bool|string $context folder to create folder in
+ * @throws Util_WpFile_FilesystemOperationException with S/FTP form if it can't get the required filesystem credentials
+ * @throws FileOperationException
+ */
+ static public function create_writeable_folder( $folder, $from_folder ) {
+ self::create_folder( $folder, $from_folder );
+
+ $permissions = array( 0755, 0775, 0777 );
+
+ for ( $set_index = 0; $set_index < count( $permissions ); $set_index++ ) {
+ if ( is_writable( $folder ) )
+ break;
+
+ self::chmod( $folder, $permissions[$set_index] );
+ }
+ }
+
+ /**
+ *
+ *
+ * @param unknown $folder
+ * @param string $method Which method to use when creating
+ * @param string $url Where to redirect after creation
+ * @param bool|string $context path folder where delete folders resides
+ * @throws Util_WpFile_FilesystemRmdirException
+ */
+ static public function delete_folder( $folder ) {
+ if ( !@is_dir( $folder ) )
+ return;
+
+ Util_File::rmdir( $folder );
+ if ( !@is_dir( $folder ) )
+ return;
+
+ try {
+ self::request_filesystem_credentials();
+ } catch ( Util_WpFile_FilesystemOperationException $ex ) {
+ throw new Util_WpFile_FilesystemRmdirException( $ex->getMessage(),
+ $ex->credentials_form(), $folder );
+ }
+
+ global $wp_filesystem;
+ if ( !$wp_filesystem->rmdir( $folder ) ) {
+ throw new Util_WpFile_FilesystemRmdirException(
+ __( 'FTP credentials don\'t allow to delete folder ', 'w3-total-cache' ) .
+ '' . $folder . ' ',
+ self::get_filesystem_credentials_form(),
+ $folder );
+ }
+ }
+
+ /**
+ *
+ *
+ * @param string $filename
+ * @param int $permission
+ * @return void
+ * @throws Util_WpFile_FilesystemChmodException
+ */
+ static private function chmod( $filename, $permission ) {
+ if ( @chmod( $filename, $permission ) )
+ return;
+
+
+ try {
+ self::request_filesystem_credentials();
+ } catch ( Util_WpFile_FilesystemOperationException $ex ) {
+ throw new Util_WpFile_FilesystemChmodException( $ex->getMessage(),
+ $ex->credentials_form(), $filename, $permission );
+ }
+
+ global $wp_filesystem;
+ if ( !$wp_filesystem->chmod( $filename, $permission, true ) ) {
+ throw new Util_WpFile_FilesystemChmodException(
+ __( 'FTP credentials don\'t allow to chmod ', 'w3-total-cache' ) .
+ '' . $filename . ' ',
+ self::get_filesystem_credentials_form(),
+ $filename, $permission );
+ }
+
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param unknown $file
+ * @param string $method
+ * @param string $url
+ * @param bool|string $context folder where file to be deleted resides
+ * @throws Util_WpFile_FilesystemOperationException with S/FTP form if it can't get the required filesystem credentials
+ */
+ static public function delete_file( $filename ) {
+ if ( !@file_exists( $filename ) )
+ return;
+ if ( @unlink( $filename ) )
+ return;
+
+ try {
+ self::request_filesystem_credentials();
+ } catch ( Util_WpFile_FilesystemOperationException $ex ) {
+ throw new Util_WpFile_FilesystemRmException( $ex->getMessage(),
+ $ex->credentials_form(), $filename );
+ }
+
+ global $wp_filesystem;
+ if ( !$wp_filesystem->delete( $filename ) ) {
+ throw new Util_WpFile_FilesystemRmException(
+ __( 'FTP credentials don\'t allow to delete ', 'w3-total-cache' ) .
+ '' . $filename . ' ',
+ self::get_filesystem_credentials_form(),
+ $filename );
+ }
+ }
+
+ /**
+ * Get WordPress filesystems credentials. Required for WP filesystem usage.
+ *
+ * @param string $method Which method to use when creating
+ * @param string $url Where to redirect after creation
+ * @param bool|string $context path to folder that should be have filesystem credentials.
+ * If false WP_CONTENT_DIR is assumed
+ * @throws Util_WpFile_FilesystemOperationException with S/FTP form if it can't get the required filesystem credentials
+ */
+ private static function request_filesystem_credentials( $method = '', $url = '', $context = false ) {
+ if ( strlen( $url ) <= 0 ) {
+ $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
+ }
+
+ $url = preg_replace( '/&w3tc_note=([^&]+)/', '', $url );
+
+ // Ensure request_filesystem_credentials() is available.
+ require_once ABSPATH . 'wp-admin/includes/file.php';
+ require_once ABSPATH . 'wp-admin/includes/template.php';
+
+ $success = true;
+ ob_start();
+ if ( false === ( $creds = request_filesystem_credentials( $url, $method, false, $context, array() ) ) ) {
+ $success = false;
+ }
+ $form = ob_get_contents();
+ ob_end_clean();
+
+ ob_start();
+ // If first check failed try again and show error message
+ if ( !WP_Filesystem( $creds ) && $success ) {
+ request_filesystem_credentials( $url, $method, true, false, array() );
+ $success = false;
+ $form = ob_get_contents();
+ }
+ ob_end_clean();
+
+ $error = '';
+ if ( preg_match( "/(.+)<\/div>/", $form, $matches ) ) {
+ $error = $matches[2];
+ $form = str_replace( $matches[0], '', $form );
+ }
+
+ if ( !$success ) {
+ throw new Util_WpFile_FilesystemOperationException( $error, $form );
+ }
+ }
+
+ /**
+ *
+ *
+ * @param string $method
+ * @param string $url
+ * @param bool|string $context
+ * @return Util_WpFile_FilesystemOperationException with S/FTP form
+ */
+ static private function get_filesystem_credentials_form( $method = '', $url = '',
+ $context = false ) {
+ // Ensure request_filesystem_credentials() is available.
+ require_once ABSPATH . 'wp-admin/includes/file.php';
+ require_once ABSPATH . 'wp-admin/includes/template.php';
+
+ ob_start();
+ // If first check failed try again and show error message
+ request_filesystem_credentials( $url, $method, true, false, array() );
+ $success = false;
+ $form = ob_get_contents();
+
+ ob_end_clean();
+
+ $error = '';
+ if ( preg_match( "/
(.+)<\/div>/", $form, $matches ) ) {
+ $form = str_replace( $matches[0], '', $form );
+ }
+
+ $form = str_replace( '
filename = $filename;
+ $this->permission = $permission;
+ }
+
+ public function filename() {
+ return $this->filename;
+ }
+
+ public function permission() {
+ return $this->permission;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemCopyException.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemCopyException.php
new file mode 100644
index 00000000..3ebd9816
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemCopyException.php
@@ -0,0 +1,23 @@
+source_filename = $source_filename;
+ $this->destination_filename = $destination_filename;
+ }
+
+ public function source_filename() {
+ return $this->source_filename;
+ }
+
+ public function destination_filename() {
+ return $this->destination_filename;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemMkdirException.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemMkdirException.php
new file mode 100644
index 00000000..4b33cd3b
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemMkdirException.php
@@ -0,0 +1,16 @@
+folder = $folder;
+ }
+
+ public function folder() {
+ return $this->folder;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemModifyException.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemModifyException.php
new file mode 100644
index 00000000..154eb4ed
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemModifyException.php
@@ -0,0 +1,29 @@
+modification_description = $modification_description;
+ $this->filename = $filename;
+ $this->file_contents = $file_contents;
+ }
+
+ function modification_description() {
+ return $this->modification_description;
+ }
+
+ public function filename() {
+ return $this->filename;
+ }
+
+ public function file_contents() {
+ return $this->file_contents;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemOperationException.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemOperationException.php
new file mode 100644
index 00000000..ccd495eb
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemOperationException.php
@@ -0,0 +1,19 @@
+credentials_form = $credentials_form;
+ }
+
+ public function credentials_form() {
+ return $this->credentials_form;
+
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemRmException.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemRmException.php
new file mode 100644
index 00000000..c98cb124
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemRmException.php
@@ -0,0 +1,16 @@
+filename = $filename;
+ }
+
+ public function filename() {
+ return $this->filename;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemRmdirException.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemRmdirException.php
new file mode 100644
index 00000000..764228fd
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemRmdirException.php
@@ -0,0 +1,16 @@
+folder = $folder;
+ }
+
+ public function folder() {
+ return $this->folder;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemWriteException.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemWriteException.php
new file mode 100644
index 00000000..c89337aa
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpFile_FilesystemWriteException.php
@@ -0,0 +1,23 @@
+filename = $filename;
+ $this->file_contents = $file_contents;
+ }
+
+ public function filename() {
+ return $this->filename;
+ }
+
+ public function file_contents() {
+ return $this->file_contents;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpmuBlogmap.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpmuBlogmap.php
new file mode 100644
index 00000000..48c370b5
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Util_WpmuBlogmap.php
@@ -0,0 +1,157 @@
+blog mapfile
+ */
+ static public function register_new_item( $config ) {
+ if ( !isset( $GLOBALS['current_blog'] ) ) {
+ return false;
+ }
+
+
+ // find blog_home_url
+ if ( Util_Environment::is_wpmu_subdomain() ) {
+ $blog_home_url = $GLOBALS['w3tc_blogmap_register_new_item'];
+ } else {
+ $home_url = rtrim( get_home_url(), '/' );
+ if ( substr( $home_url, 0, 7 ) == 'http://' ) {
+ $home_url = substr( $home_url, 7 );
+ } else if ( substr( $home_url, 0, 8 ) == 'https://' ) {
+ $home_url = substr( $home_url, 8 );
+ }
+
+ if ( substr( $GLOBALS['w3tc_blogmap_register_new_item'], 0,
+ strlen( $home_url ) ) == $home_url ) {
+ $blog_home_url = $home_url;
+ } else {
+ $blog_home_url = $GLOBALS['w3tc_blogmap_register_new_item'];
+ }
+ }
+
+
+ // write contents
+ $filename = Util_WpmuBlogmap::blogmap_filename_by_home_url( $blog_home_url );
+
+ if ( !@file_exists( $filename ) ) {
+ $blog_ids = array();
+ } else {
+ $data = @file_get_contents( $filename );
+ $blog_ids = @json_decode( $data, true );
+ if ( !is_array( $blog_ids ) ) {
+ $blog_ids = array();
+ }
+ }
+
+ if ( isset( $blog_ids[$blog_home_url] ) ) {
+ return false;
+ }
+
+ $data = $config->get_boolean( 'common.force_master' ) ? 'm' : 'c';
+ $blog_home_url = preg_replace( '/[^a-zA-Z0-9\+\.%~!:()\/\-\_]/', '', $blog_home_url );
+ $blog_ids[$blog_home_url] = $data . $GLOBALS['current_blog']->blog_id;
+
+ $data = json_encode( $blog_ids );
+
+ try {
+ Util_File::file_put_contents_atomic( $filename, $data );
+ } catch ( \Exception $ex ) {
+ return false;
+ }
+
+ unset( self::$content_by_filename[$filename] );
+ unset( $GLOBALS['w3tc_blogmap_register_new_item'] );
+
+ return true;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Varnish_Flush.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Varnish_Flush.php
new file mode 100644
index 00000000..6660d759
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Varnish_Flush.php
@@ -0,0 +1,430 @@
+_config = Dispatcher::config();
+
+ $this->_debug = $this->_config->get_boolean( 'varnish.debug' );
+ $this->_servers = $this->_config->get_array( 'varnish.servers' );
+ $this->_timeout = $this->_config->get_integer( 'timelimit.varnish_purge' );
+ }
+
+ /**
+ * Purge URI
+ *
+ * @param string $url
+ * @return boolean
+ */
+ protected function _purge( $url ) {
+ @set_time_limit( $this->_timeout );
+ $return = true;
+
+ foreach ( (array) $this->_servers as $server ) {
+ $response = $this->_request( $server, $url );
+
+ if ( is_wp_error( $response ) ) {
+ $this->_log( $url, sprintf( 'Unable to send request: %s.', implode( '; ', $response->get_error_messages() ) ) );
+ $return = false;
+ } elseif ( $response['response']['code'] !== 200 ) {
+ $this->_log( $url, 'Bad response: ' . $response['response']['status'] );
+ $return = false;
+ } else {
+ $this->_log( $url, 'PURGE OK' );
+ }
+ }
+
+ return $return;
+ }
+
+ /*
+ * Sends purge request. Cannt use default wp HTTP implementation
+ * if we send request to different host than specified in $url
+ *
+ * @param $url string
+ */
+ function _request( $varnish_server, $url ) {
+ $parse_url = @parse_url( $url );
+
+ if ( !$parse_url || !isset( $parse_url['host'] ) )
+ return new \WP_Error( 'http_request_failed', 'Unrecognized URL format ' . $url );
+
+ $host = $parse_url['host'];
+ $port = ( isset( $parse_url['port'] ) ? (int) $parse_url['port'] : 80 );
+ $path = ( !empty( $parse_url['path'] ) ? $parse_url['path'] : '/' );
+ $query = ( isset( $parse_url['query'] ) ? $parse_url['query'] : '' );
+ $request_uri = $path . ( $query != '' ? '?' . $query : '' );
+
+ list( $varnish_host, $varnish_port ) =
+ Util_Content::endpoint_to_host_port( $varnish_server, 80 );
+
+ // if url host is the same as varnish server - we can use regular
+ // wordpress http infrastructure, otherwise custom request should be
+ // sent using fsockopen, since we send request to other server than
+ // specified by $url
+ if ( $host == $varnish_host && $port == $varnish_port )
+ return Util_Http::request( $url, array( 'method' => 'PURGE' ) );
+
+ $request_headers_array = array(
+ sprintf( 'PURGE %s HTTP/1.1', $request_uri ),
+ sprintf( 'Host: %s', $host ),
+ sprintf( 'User-Agent: %s', W3TC_POWERED_BY ),
+ 'Connection: close'
+ );
+
+ $request_headers = implode( "\r\n", $request_headers_array );
+ $request = $request_headers . "\r\n\r\n";
+
+ // log what we are about to do
+ $this->_log( $url, sprintf( 'Connecting to %s ...', $varnish_host ) );
+ $this->_log( $url, sprintf( 'PURGE %s HTTP/1.1', $request_uri ) );
+ $this->_log( $url, sprintf( 'Host: %s', $host ) );
+
+ $errno = null;
+ $errstr = null;
+ $fp = @fsockopen( $varnish_host, $varnish_port, $errno, $errstr, 10 );
+ if ( !$fp )
+ return new \WP_Error( 'http_request_failed', $errno . ': ' . $errstr );
+
+ @stream_set_timeout( $fp, 60 );
+
+ @fputs( $fp, $request );
+
+ $response = '';
+ while ( !@feof( $fp ) )
+ $response .= @fgets( $fp, 4096 );
+
+ @fclose( $fp );
+
+ list( $response_headers, $contents ) = explode( "\r\n\r\n", $response, 2 );
+ $matches = null;
+ if ( preg_match( '~^HTTP/1.[01] (\d+)~', $response_headers, $matches ) ) {
+ $code = (int)$matches[1];
+ $a = explode( "\n", $response_headers );
+ $status = ( count( $a ) >= 1 ? $a[0] : '' );
+ $return = array(
+ 'response' => array(
+ 'code' => $code,
+ 'status' => $status
+ )
+ );
+ return $return;
+ }
+
+ return new \WP_Error( 'http_request_failed',
+ 'Unrecognized response header' . $response_headers );
+ }
+
+ /**
+ * Write log entry
+ *
+ * @param string $url
+ * @param string $msg
+ * @return bool|int
+ */
+ function _log( $url, $msg ) {
+ if ( $this->_debug ) {
+ $data = sprintf( "[%s] [%s] %s\n", date( 'r' ), $url, $msg );
+ $data = strtr( $data, '<>', '' );
+
+ $filename = Util_Debug::log_filename( 'varnish' );
+
+ return @file_put_contents( $filename, $data, FILE_APPEND );
+ }
+
+ return true;
+ }
+
+
+
+ /**
+ * Flush varnish cache
+ */
+ function flush() {
+ $this->flush_operation_requested = true;
+ return true;
+ }
+
+ private function do_flush() {
+ if ( !is_network_admin() ) {
+ $full_urls = array( get_home_url() . '/.*' );
+ $full_urls = Util_PageUrls::complement_with_mirror_urls(
+ $full_urls );
+
+ foreach ( $full_urls as $url )
+ $this->_purge( $url );
+ } else {
+ // todo: remove. doesnt work for all caches.
+ // replace with tool to flush network
+ global $wpdb;
+ $protocall = Util_Environment::is_https() ? 'https://' : 'http://';
+
+ // If WPMU Domain Mapping plugin is installed and active
+ if ( defined( 'SUNRISE_LOADED' ) && SUNRISE_LOADED && isset( $wpdb->dmtable ) && !empty( $wpdb->dmtable ) ) {
+ $blogs = $wpdb->get_results( "
+ SELECT {$wpdb->blogs}.domain, {$wpdb->blogs}.path, {$wpdb->dmtable}.domain AS mapped_domain
+ FROM {$wpdb->dmtable}
+ RIGHT JOIN {$wpdb->blogs} ON {$wpdb->dmtable}.blog_id = {$wpdb->blogs}.blog_id
+ WHERE site_id = {$wpdb->siteid}
+ AND spam = 0
+ AND deleted = 0
+ AND archived = '0'" );
+ foreach ( $blogs as $blog ) {
+ if ( !isset( $blog->mapped_domain ) )
+ $url = $protocall . $blog->domain . ( strlen( $blog->path )>1? '/' . trim( $blog->path, '/' ) : '' ) . '/.*';
+ else
+ $url = $protocall . $blog->mapped_domain . '/.*';
+ $this->_purge( $url );
+ }
+
+ }else {
+ if ( !Util_Environment::is_wpmu_subdomain() ) {
+ $this->_purge( get_home_url().'/.*' );
+ } else {
+ $blogs = $wpdb->get_results( "
+ SELECT domain, path
+ FROM {$wpdb->blogs}
+ WHERE site_id = '{$wpdb->siteid}'
+ AND spam = 0
+ AND deleted = 0
+ AND archived = '0'" );
+
+ foreach ( $blogs as $blog ) {
+ $url = $protocall . $blog->domain . ( strlen( $blog->path )>1? '/' . trim( $blog->path, '/' ) : '' ) . '/.*';
+ $this->_purge( $url );
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Flushes varnish post cache
+ *
+ * @param integer $post_id Post ID.
+ * @param boolean $force Force flag (optional).
+ *
+ * @return boolean
+ */
+ function flush_post( $post_id, $force ) {
+ if ( !$post_id ) {
+ $post_id = Util_Environment::detect_post_id();
+ }
+
+ if ( $post_id ) {
+ $full_urls = array();
+
+ $post = null;
+ $terms = array();
+
+ $feeds = $this->_config->get_array( 'pgcache.purge.feed.types' );
+ $limit_post_pages = $this->_config->get_integer( 'pgcache.purge.postpages_limit' );
+
+ if ( $this->_config->get_boolean( 'pgcache.purge.terms' ) || $this->_config->get_boolean( 'varnish.pgcache.feed.terms' ) ) {
+ $taxonomies = get_post_taxonomies( $post_id );
+ $terms = wp_get_post_terms( $post_id, $taxonomies );
+ }
+
+ switch ( true ) {
+ case $this->_config->get_boolean( 'pgcache.purge.author' ):
+ case $this->_config->get_boolean( 'pgcache.purge.archive.daily' ):
+ case $this->_config->get_boolean( 'pgcache.purge.archive.monthly' ):
+ case $this->_config->get_boolean( 'pgcache.purge.archive.yearly' ):
+ case $this->_config->get_boolean( 'pgcache.purge.feed.author' ):
+ $post = get_post( $post_id );
+ }
+
+ $front_page = get_option( 'show_on_front' );
+
+ /**
+ * Home (Frontpage) URL
+ */
+ if ( ( $this->_config->get_boolean( 'pgcache.purge.home' ) && $front_page == 'posts' )||
+ $this->_config->get_boolean( 'pgcache.purge.front_page' ) ) {
+ $full_urls = array_merge( $full_urls,
+ Util_PageUrls::get_frontpage_urls( $limit_post_pages ) );
+ }
+
+ /**
+ * Home (Post page) URL
+ */
+ if ( $this->_config->get_boolean( 'pgcache.purge.home' ) && $front_page != 'posts' ) {
+ $full_urls = array_merge( $full_urls,
+ Util_PageUrls::get_postpage_urls( $limit_post_pages ) );
+ }
+
+ /**
+ * Post URL
+ */
+ if ( $this->_config->get_boolean( 'pgcache.purge.post' ) || $force ) {
+ $full_urls = array_merge( $full_urls, Util_PageUrls::get_post_urls( $post_id ) );
+ }
+
+ /**
+ * Post comments URLs
+ */
+ if ( $this->_config->get_boolean( 'pgcache.purge.comments' ) && function_exists( 'get_comments_pagenum_link' ) ) {
+ $full_urls = array_merge( $full_urls, Util_PageUrls::get_post_comments_urls( $post_id ) );
+ }
+
+ /**
+ * Post author URLs
+ */
+ if ( $this->_config->get_boolean( 'pgcache.purge.author' ) && $post ) {
+ $full_urls = array_merge( $full_urls, Util_PageUrls::get_post_author_urls( $post->post_author, $limit_post_pages ) );
+ }
+
+ /**
+ * Post terms URLs
+ */
+ if ( $this->_config->get_boolean( 'pgcache.purge.terms' ) ) {
+ $full_urls = array_merge( $full_urls, Util_PageUrls::get_post_terms_urls( $terms, $limit_post_pages ) );
+ }
+
+ /**
+ * Daily archive URLs
+ */
+ if ( $this->_config->get_boolean( 'pgcache.purge.archive.daily' ) && $post ) {
+ $full_urls = array_merge( $full_urls, Util_PageUrls::get_daily_archive_urls( $post, $limit_post_pages ) );
+ }
+
+ /**
+ * Monthly archive URLs
+ */
+ if ( $this->_config->get_boolean( 'pgcache.purge.archive.monthly' ) && $post ) {
+ $full_urls = array_merge( $full_urls, Util_PageUrls::get_monthly_archive_urls( $post, $limit_post_pages ) );
+ }
+
+ /**
+ * Yearly archive URLs
+ */
+ if ( $this->_config->get_boolean( 'pgcache.purge.archive.yearly' ) && $post ) {
+ $full_urls = array_merge( $full_urls, Util_PageUrls::get_yearly_archive_urls( $post, $limit_post_pages ) );
+ }
+
+ /**
+ * Feed URLs
+ */
+ if ( $this->_config->get_boolean( 'pgcache.purge.feed.blog' ) ) {
+ $full_urls = array_merge( $full_urls,
+ Util_PageUrls::get_feed_urls( $feeds ) );
+ }
+
+ if ( $this->_config->get_boolean( 'pgcache.purge.feed.comments' ) ) {
+ $full_urls = array_merge( $full_urls, Util_PageUrls::get_feed_comments_urls( $post_id, $feeds ) );
+ }
+
+ if ( $this->_config->get_boolean( 'pgcache.purge.feed.author' ) && $post ) {
+ $full_urls = array_merge( $full_urls, Util_PageUrls::get_feed_author_urls( $post->post_author, $feeds ) );
+ }
+
+ if ( $this->_config->get_boolean( 'pgcache.purge.feed.terms' ) ) {
+ $full_urls = array_merge( $full_urls, Util_PageUrls::get_feed_terms_urls( $terms, $feeds ) );
+ }
+
+ /**
+ * Purge selected pages
+ */
+ if ( $this->_config->get_array( 'pgcache.purge.pages' ) ) {
+ $pages = $this->_config->get_array( 'pgcache.purge.pages' );
+ $full_urls = array_merge( $full_urls, Util_PageUrls::get_pages_urls( $pages ) );
+ }
+
+ if ( $this->_config->get_string( 'pgcache.purge.sitemap_regex' ) ) {
+ $sitemap_regex = $this->_config->get_string( 'pgcache.purge.sitemap_regex' );
+ $full_urls[] = Util_Environment::home_domain_root_url() . '/' . trim( $sitemap_regex, "^$" );
+ }
+
+ // add mirror urls
+ $full_urls = Util_PageUrls::complement_with_mirror_urls(
+ $full_urls );
+
+ $full_urls = apply_filters( 'varnish_flush_post_queued_urls',
+ $full_urls );
+
+ /**
+ * Queue flush
+ */
+ if ( count( $full_urls ) ) {
+ foreach ( $full_urls as $url )
+ $this->queued_urls[$url] = '*';
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Flush a single url
+ *
+ * @param unknown $url
+ */
+ function flush_url( $url ) {
+ $this->_purge( $url );
+ }
+
+ /**
+ * Flushes global and repeated urls
+ */
+ function flush_post_cleanup() {
+ if ( $this->flush_operation_requested ) {
+ $this->do_flush();
+ $count = 999;
+
+ $this->flush_operation_requested = false;
+ $this->queued_urls = array();
+ } else {
+ $count = count( $this->queued_urls );
+ if ( $count > 0 ) {
+ foreach ( $this->queued_urls as $url => $nothing )
+ $this->flush_url( $url );
+
+ $this->queued_urls = array();
+ }
+ }
+
+ return $count;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Varnish_Plugin.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Varnish_Plugin.php
new file mode 100644
index 00000000..cea5e159
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/Varnish_Plugin.php
@@ -0,0 +1,89 @@
+flush();
+
+ return $v;
+ }
+
+ /**
+ * Purges post from varnish
+ *
+ * @param integer $post_id Post ID.
+ * @param boolean $force Force flag (optional).
+ *
+ * @return mixed
+ */
+ public function varnish_flush_post( $post_id, $force = false ) {
+ $varnishflush = Dispatcher::component( 'Varnish_Flush' );
+ $v = $varnishflush->flush_post( $post_id, $force );
+
+ return $v;
+ }
+
+ /**
+ * Purges post from varnish
+ *
+ * @param string $url
+ * @return mixed
+ */
+ public function varnish_flush_url( $url ) {
+ $varnishflush = Dispatcher::component( 'Varnish_Flush' );
+ $v = $varnishflush->flush_url( $url );
+
+ return $v;
+ }
+
+ public function w3tc_admin_bar_menu( $menu_items ) {
+ $menu_items['20610.varnish'] = array(
+ 'id' => 'w3tc_flush_varnish',
+ 'parent' => 'w3tc_flush',
+ 'title' => __( 'Varnish Cache', 'w3-total-cache' ),
+ 'href' => wp_nonce_url( admin_url(
+ 'admin.php?page=w3tc_dashboard&w3tc_flush_varnish' ),
+ 'w3tc' )
+ );
+
+ return $menu_items;
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example.php
new file mode 100644
index 00000000..3b0b4c31
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example.php
@@ -0,0 +1,51 @@
+config = w3tc_config();
+
+ // get value of config option and use it
+ if ( $this->config->get_boolean( array( 'example' , 'is_title_postfix' ) ) )
+ add_filter( 'the_title', array( $this, 'the_title' ), 10, 2 );
+ }
+
+
+
+ /**
+ * the_title filter handler.
+ * This extension adds specified postfix to each post title if extensions
+ * is configured so on its settings page
+ */
+ public function the_title( $title, $id ) {
+ return $title .
+ $this->config->get_string( array( 'example' , 'title_postfix' ) );
+ }
+}
+
+
+
+/*
+This file is simply loaded by W3 Total Cache in a case if extension is active.
+Its up to extension what will it do or which way will it do.
+*/
+$p = new Extension_Example();
+$p->run();
+
+if ( is_admin() ) {
+ $p = new Extension_Example_Admin();
+ $p->run();
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example_Admin.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example_Admin.php
new file mode 100644
index 00000000..562ddcbf
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example_Admin.php
@@ -0,0 +1,120 @@
+ 'Example Extension',
+ 'author' => 'W3 EDGE',
+ 'description' => __( 'Example extension' ),
+ 'author_uri' => 'https://www.w3-edge.com/',
+ 'extension_uri' => 'https://www.w3-edge.com/',
+ 'extension_id' => 'example',
+ 'settings_exists' => true,
+ 'version' => '1.0',
+ 'enabled' => true,
+ 'requirements' => '',
+ 'path' => 'w3-total-cache-example/Extension_Example.php'
+ );
+
+ return $extensions;
+ }
+
+
+
+ /**
+ * Entry point of extension for wp-admin/ requests
+ * Called from Extension_Example.php
+ */
+ public function run() {
+ // handle settings page of this extension
+ add_action( 'w3tc_extension_page_example', array(
+ $this,
+ 'w3tc_extension_page'
+ ) );
+
+ // get control when configuration is changed by user
+ add_action( 'w3tc_config_ui_save', array(
+ $this,
+ 'w3tc_config_ui_save'
+ ), 10, 2 );
+
+ // Register widget on W3 Total Cache Dashboard page
+ add_action( 'w3tc_widget_setup', array(
+ $this,
+ 'w3tc_widget_setup'
+ ) );
+
+ // get control when extension is deactivated
+ add_action( 'w3tc_deactivate_extension_example', array(
+ $this, 'w3tc_deactivate_extension' ) );
+
+ }
+
+
+
+ /**
+ * Show settings page
+ */
+ public function w3tc_extension_page() {
+ include dirname( __FILE__ ) . '/Extension_Example_Page_View.php';
+ }
+
+
+
+ /**
+ * Get control when configuration is changed by user
+ */
+ public function w3tc_config_ui_save( $config, $old_config ) {
+ if ( $config->get( array( 'example', 'is_title_postfix' ) ) !=
+ $old_config->get( array( 'example', 'is_title_postfix' ) ) ||
+ $config->get( array( 'example', 'title_postfix' ) ) !=
+ $old_config->get( array( 'example', 'title_postfix' ) ) ) {
+ // flush all content caches, since our extension will now alter
+ // content
+ w3tc_flush_posts();
+ }
+ }
+
+
+
+ /**
+ * Registers widget on W3 Total Cache Dashboard page
+ */
+ public function w3tc_widget_setup() {
+ $screen = get_current_screen();
+ add_meta_box( 'example', 'example', array( $this, 'widget_content' ),
+ $screen, 'normal', 'core' );
+ }
+
+
+
+ /**
+ * Renders content of widget
+ */
+ public function widget_content() {
+ echo "Example extension's widget";
+ }
+
+
+
+ /**
+ * Called when extension is deactivated.
+ * Perform a cleanup here
+ */
+ public function w3tc_deactivate_extension() {
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example_Page_View.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example_Page_View.php
new file mode 100644
index 00000000..cd8059a9
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/Extension_Example_Page_View.php
@@ -0,0 +1,46 @@
+
+
+ |
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/w3-total-cache-example.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/w3-total-cache-example.php
new file mode 100644
index 00000000..4fdc6600
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/extension-example/w3-total-cache-example.php
@@ -0,0 +1,59 @@
+
+
+ W3 Total Cache is distributed under the GNU General Public License, Version 2,
+ June 1991. Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin
+ St, Fifth Floor, Boston, MA 02110, USA
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+if ( !defined( 'ABSPATH' ) ) {
+ die();
+}
+
+/**
+ * Class autoloader
+ *
+ * @param string $class Classname
+ */
+function w3tc_example_class_autoload( $class ) {
+ if ( substr( $class, 0, 12 ) == 'W3TCExample\\' ) {
+ $filename = dirname( __FILE__ ) . DIRECTORY_SEPARATOR .
+ substr( $class, 12 ) . '.php';
+
+ if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
+ if ( !file_exists( $filename ) ) {
+ debug_print_backtrace();
+ }
+ }
+
+ require $filename;
+ }
+}
+
+spl_autoload_register( 'w3tc_example_class_autoload' );
+
+add_action( 'w3tc_extensions', array(
+ '\W3TCExample\Extension_Example_Admin',
+ 'w3tc_extensions'
+ ), 10, 2 );
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/define.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/define.php
new file mode 100644
index 00000000..24557bcc
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/define.php
@@ -0,0 +1,25 @@
+
+
+
+
Unfortunately, an error occurred while creating the minify cache. Please check your settings to ensure your site is working as intended.
+
Thanks for using W3 Total Cache.
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/email/minify_error_notification.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/email/minify_error_notification.php
new file mode 100644
index 00000000..5afe70bf
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/email/minify_error_notification.php
@@ -0,0 +1,7 @@
+
+
+
+
Unfortunately, an error occurred while creating the minify cache. Please check your settings to ensure your site is working as intended.
+
Thanks for using W3 Total Cache.
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/email/support_request.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/email/support_request.php
new file mode 100644
index 00000000..a8e8f5e3
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/email/support_request.php
@@ -0,0 +1,50 @@
+
+
+
+
+
+ ';
+ echo esc_html__( 'Version: ', 'w3-total-cache' ) . esc_html( W3TC_VERSION ) . ' ';
+ echo esc_html__( 'URL: ', 'w3-total-cache' ) . '' . esc_html( $url ) . ' ';
+ echo esc_html__( 'Name: ', 'w3-total-cache' ) . esc_html( $name ) . ' ';
+ echo esc_html__( 'E-Mail: ', 'w3-total-cache' ) . '' . esc_html( $email ) . ' ';
+
+ if ( $twitter ) {
+ echo esc_html__( 'Twitter: ', 'w3-total-cache' ) . '' . esc_html( $twitter ) . ' ';
+ }
+
+ if ( $phone ) {
+ echo esc_html__( 'Phone: ', 'w3-total-cache' ) . esc_html( $phone ) . ' ';
+ }
+
+ if ( $forum_url ) {
+ echo esc_html__( 'Forum Topic URL: ', 'w3-total-cache' ) . '' . esc_url( $forum_url ) . ' ';
+ }
+
+ if ( $request_data_url ) {
+ echo esc_html__( 'Request data: ', 'w3-total-cache' ) . '' . esc_url( $request_data_url ) . ' ';
+ }
+
+ echo esc_html__( 'Subject: ', 'w3-total-cache' ) . esc_html( $subject );
+ ?>
+
+
+
+
+
+
+
+
+
+ ';
+ echo esc_html__( 'User Agent: ', 'w3-total-cache' ) . esc_html( $_SERVER['HTTP_USER_AGENT'] );
+ ?>
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/error.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/error.php
new file mode 100644
index 00000000..94d057c5
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/error.php
@@ -0,0 +1,14 @@
+
+
+ >
+
+
+
Error
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/index.html b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/index.html
new file mode 100644
index 00000000..e69de29b
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/index.html b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/index.html
new file mode 100644
index 00000000..e69de29b
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/minify_recommendations.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/minify_recommendations.php
new file mode 100644
index 00000000..d3022825
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/minify_recommendations.php
@@ -0,0 +1,160 @@
+
+
Minify: Help Wizard
+
+
+
+
+ $_theme_name ) : ?>
+ >
+
+
+
+
+
+
+
JavaScript:
+
+
+ $js_files ) :
+ foreach ( $js_files as $js_file ) :
+ $index++;
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $css_files ) :
+ foreach ( $css_files as $css_file ) :
+ $index++;
+ ?>
+
+
+
+
+
+
+
+
+
+
+
No files found.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/purchase.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/purchase.php
new file mode 100644
index 00000000..51be2db6
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/purchase.php
@@ -0,0 +1,4 @@
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/self_test.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/self_test.php
new file mode 100644
index 00000000..01090709
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/self_test.php
@@ -0,0 +1,520 @@
+
+
+
+
+
+
+
+ ',
+ '',
+ ' '
+ ),
+ array(
+ 'span' => array(
+ 'style' => array(),
+ ),
+ 'br' => array(),
+ )
+ );
+ echo wp_kses(
+ sprintf(
+ // translators: 1 opening HTML span with background, 2 closing HTML span tag, 3 HTML line break tag.
+ __(
+ '%1$sNot detected/Not available/Off%2$s: May be installed, but cannot be automatically confirmed. Functionality may be limited.%3$s',
+ 'w3-total-cache'
+ ),
+ '',
+ ' ',
+ ' '
+ ),
+ array(
+ 'span' => array(
+ 'style' => array(),
+ ),
+ 'br' => array(),
+ )
+ );
+ echo wp_kses(
+ sprintf(
+ // translators: 1 opening HTML span with background, 2 closing HTML span tag, 3 HTML line break tag.
+ __(
+ '%1$sNot installed/Error/No/False%2$s: Plugin or some functions may not work.%3$s',
+ 'w3-total-cache'
+ ),
+ '',
+ ' ',
+ ' '
+ ),
+ array(
+ 'span' => array(
+ 'style' => array(),
+ ),
+ 'br' => array(),
+ )
+ );
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
;
+
+
+
+ Web Server:
+
+ Apache
+
+ Lite Speed
+
+ nginx
+
+ lighttpd
+
+ Microsoft IIS
+
+ Not detected
+
+
+
+
+ FTP functions:
+
+ Installed
+
+ Not detected
+
+
+ ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ zlib extension:
+
+
+
+
+
+
+
+
+
+ brotli extension:
+
+
+
+
+
+
+
+
+
+ Opcode cache:
+
+
+
+
+
+
+
+
+ = 6 ) : ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ SSH2 extension:
+
+
+
+
+
+
+ ',
+ '',
+ '',
+ ' ',
+ '',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+
+ :
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ' . wp_kses( $check, Util_Ui::get_allowed_html_for_wp_kses_from_content( $check ) ) . '';
+ endforeach;
+ ?>
+
+
+
+
+
+
+
+
+
+ :
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ :
+
+
+
+
+
+
+
+
+
+ :
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ()
+
+
+
+
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/support_us.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/support_us.php
new file mode 100644
index 00000000..101f208b
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/support_us.php
@@ -0,0 +1,152 @@
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/upgrade.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/upgrade.php
new file mode 100644
index 00000000..c6f3c4a5
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/lightbox/upgrade.php
@@ -0,0 +1,35 @@
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/all.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/all.php
new file mode 100644
index 00000000..a2bd34e6
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/all.php
@@ -0,0 +1,630 @@
+ 'application/vnd.lotus-1-2-3',
+ '3dml' => 'text/vnd.in3d.3dml',
+ '3g2' => 'video/3gpp2',
+ '3gp' => 'video/3gpp',
+ 'aab|x32|u32|vox' => 'application/x-authorware-bin',
+ 'aac' => 'audio/x-aac',
+ 'aam' => 'application/x-authorware-map',
+ 'aas' => 'application/x-authorware-seg',
+ 'abw' => 'application/x-abiword',
+ 'acc' => 'application/vnd.americandynamics.acc',
+ 'ace' => 'application/x-ace-compressed',
+ 'acu' => 'application/vnd.acucobol',
+ 'adp' => 'audio/adpcm',
+ 'aep' => 'application/vnd.audiograph',
+ 'afp|listafp|list3820' => 'application/vnd.ibm.modcap',
+ 'aif|aiff|aifc' => 'audio/x-aiff',
+ 'air' => 'application/vnd.adobe.air-application-installer-package+zip',
+ 'ai|eps|ps' => 'application/postscript',
+ 'ami' => 'application/vnd.amiga.ami',
+ 'apk' => 'application/vnd.android.package-archive',
+ 'application' => 'application/x-ms-application',
+ 'apr' => 'application/vnd.lotus-approach',
+ 'asc|sig' => 'application/pgp-signature',
+ 'asf|asx' => 'video/x-ms-asf',
+ 'aso' => 'application/vnd.accpac.simply.aso',
+ 'atc|acutc' => 'application/vnd.acucorp',
+ 'atom' => 'application/atom+xml',
+ 'atomcat' => 'application/atomcat+xml',
+ 'atomsvc' => 'application/atomsvc+xml',
+ 'atx' => 'application/vnd.antix.game-component',
+ 'au|snd' => 'audio/basic',
+ 'avi' => 'video/x-msvideo',
+ 'avif' => 'image/avif',
+ 'avifs' => 'image/avif-sequence',
+ 'aw' => 'application/applixware',
+ 'azf' => 'application/vnd.airzip.filesecure.azf',
+ 'azs' => 'application/vnd.airzip.filesecure.azs',
+ 'azw' => 'application/vnd.amazon.ebook',
+ 'bcpio' => 'application/x-bcpio',
+ 'bdf' => 'application/x-font-bdf',
+ 'bdm' => 'application/vnd.syncml.dm+wbxml',
+ 'bh2' => 'application/vnd.fujitsu.oasysprs',
+ 'bin|dms|lha|lrf|lzh|so|iso|dmg|dist|distz|pkg|bpk|dump|elc|deploy' => 'application/octet-stream',
+ 'bmi' => 'application/vnd.bmi',
+ 'bmp' => 'image/bmp',
+ 'box' => 'application/vnd.previewsystems.box',
+ 'btif' => 'image/prs.btif',
+ 'bz' => 'application/x-bzip',
+ 'bz2|boz' => 'application/x-bzip2',
+ 'c4g|c4d|c4f|c4p|c4u' => 'application/vnd.clonk.c4group',
+ 'cab' => 'application/vnd.ms-cab-compressed',
+ 'car' => 'application/vnd.curl.car',
+ 'cat' => 'application/vnd.ms-pki.seccat',
+ 'ccxml' => 'application/ccxml+xml',
+ 'cdbcmsg' => 'application/vnd.contact.cmsg',
+ 'cdkey' => 'application/vnd.mediastation.cdkey',
+ 'cdx' => 'chemical/x-cdx',
+ 'cdxml' => 'application/vnd.chemdraw+xml',
+ 'cdy' => 'application/vnd.cinderella',
+ 'cer' => 'application/pkix-cert',
+ 'cgm' => 'image/cgm',
+ 'chat' => 'application/x-chat',
+ 'chm' => 'application/vnd.ms-htmlhelp',
+ 'chrt' => 'application/vnd.kde.kchart',
+ 'cif' => 'chemical/x-cif',
+ 'cii' => 'application/vnd.anser-web-certificate-issue-initiation',
+ 'cil' => 'application/vnd.ms-artgalry',
+ 'cla' => 'application/vnd.claymore',
+ 'class' => 'application/java-vm',
+ 'clkk' => 'application/vnd.crick.clicker.keyboard',
+ 'clkp' => 'application/vnd.crick.clicker.palette',
+ 'clkt' => 'application/vnd.crick.clicker.template',
+ 'clkw' => 'application/vnd.crick.clicker.wordbank',
+ 'clkx' => 'application/vnd.crick.clicker',
+ 'clp' => 'application/x-msclip',
+ 'cmc' => 'application/vnd.cosmocaller',
+ 'cmdf' => 'chemical/x-cmdf',
+ 'cml' => 'chemical/x-cml',
+ 'cmp' => 'application/vnd.yellowriver-custom-menu',
+ 'cmx' => 'image/x-cmx',
+ 'cod' => 'application/vnd.rim.cod',
+ 'cpio' => 'application/x-cpio',
+ 'cpt' => 'application/mac-compactpro',
+ 'crd' => 'application/x-mscardfile',
+ 'crl' => 'application/pkix-crl',
+ 'csh' => 'application/x-csh',
+ 'csml' => 'chemical/x-csml',
+ 'csp' => 'application/vnd.commonspace',
+ 'css' => 'text/css',
+ 'csv' => 'text/csv',
+ 'cu' => 'application/cu-seeme',
+ 'curl' => 'text/vnd.curl',
+ 'cww' => 'application/prs.cww',
+ 'c|cc|cxx|cpp|h|hh|dic' => 'text/x-c',
+ 'daf' => 'application/vnd.mobius.daf',
+ 'davmount' => 'application/davmount+xml',
+ 'dcurl' => 'text/vnd.curl.dcurl',
+ 'dd2' => 'application/vnd.oma.dd2+xml',
+ 'ddd' => 'application/vnd.fujixerox.ddd',
+ 'deb|udeb' => 'application/x-debian-package',
+ 'der|crt' => 'application/x-x509-ca-cert',
+ 'df' => 'application/x-deflate',
+ 'dfac' => 'application/vnd.dreamfactory',
+ 'dir|dcr|dxr|cst|cct|cxt|w3d|fgd|swa' => 'application/x-director',
+ 'dis' => 'application/vnd.mobius.dis',
+ 'djvu|djv' => 'image/vnd.djvu',
+ 'dna' => 'application/vnd.dna',
+ 'docm' => 'application/vnd.ms-word.document.macroenabled.12',
+ 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
+ 'doc|dot' => 'application/msword',
+ 'dotm' => 'application/vnd.ms-word.template.macroenabled.12',
+ 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
+ 'dp' => 'application/vnd.osgi.dp',
+ 'dpg' => 'application/vnd.dpgraph',
+ 'dsc' => 'text/prs.lines.tag',
+ 'dtb' => 'application/x-dtbook+xml',
+ 'dtd' => 'application/xml-dtd',
+ 'dts' => 'audio/vnd.dts',
+ 'dtshd' => 'audio/vnd.dts.hd',
+ 'dvi' => 'application/x-dvi',
+ 'dwf' => 'model/vnd.dwf',
+ 'dwg' => 'image/vnd.dwg',
+ 'dxf' => 'image/vnd.dxf',
+ 'dxp' => 'application/vnd.spotfire.dxp',
+ 'ecelp4800' => 'audio/vnd.nuera.ecelp4800',
+ 'ecelp7470' => 'audio/vnd.nuera.ecelp7470',
+ 'ecelp9600' => 'audio/vnd.nuera.ecelp9600',
+ 'ecma' => 'application/ecmascript',
+ 'edm' => 'application/vnd.novadigm.edm',
+ 'edx' => 'application/vnd.novadigm.edx',
+ 'efif' => 'application/vnd.picsel',
+ 'ei6' => 'application/vnd.pg.osasli',
+ 'eml|all' => 'message/rfc822',
+ 'emma' => 'application/emma+xml',
+ 'eol' => 'audio/vnd.digital-winds',
+ 'eot' => 'application/vnd.ms-fontobject',
+ 'epub' => 'application/epub+zip',
+ 'es3|et3' => 'application/vnd.eszigno3+xml',
+ 'esf' => 'application/vnd.epson.esf',
+ 'etx' => 'text/x-setext',
+ 'exe|dll|com|bat|msi' => 'application/x-msdownload',
+ 'ext' => 'application/vnd.novadigm.ext',
+ 'ez' => 'application/andrew-inset',
+ 'ez2' => 'application/vnd.ezpix-album',
+ 'ez3' => 'application/vnd.ezpix-package',
+ 'f4v' => 'video/x-f4v',
+ 'fbs' => 'image/vnd.fastbidsheet',
+ 'fdf' => 'application/vnd.fdf',
+ 'fe_launch' => 'application/vnd.denovo.fcselayout-link',
+ 'fg5' => 'application/vnd.fujitsu.oasysgp',
+ 'fh|fhc|fh4|fh5|fh7' => 'image/x-freehand',
+ 'fig' => 'application/x-xfig',
+ 'fli' => 'video/x-fli',
+ 'flo' => 'application/vnd.micrografx.flo',
+ 'flv' => 'video/x-flv',
+ 'flw' => 'application/vnd.kde.kivio',
+ 'flx' => 'text/vnd.fmi.flexstor',
+ 'fly' => 'text/vnd.fly',
+ 'fm|frame|maker|book' => 'application/vnd.framemaker',
+ 'fnc' => 'application/vnd.frogans.fnc',
+ 'fpx' => 'image/vnd.fpx',
+ 'fsc' => 'application/vnd.fsc.weblaunch',
+ 'fst' => 'image/vnd.fst',
+ 'ftc' => 'application/vnd.fluxtime.clip',
+ 'fti' => 'application/vnd.anser-web-funds-transfer-initiation',
+ 'fvt' => 'video/vnd.fvt',
+ 'fzs' => 'application/vnd.fuzzysheet',
+ 'f|for|f77|f90' => 'text/x-fortran',
+ 'g3' => 'image/g3fax',
+ 'gac' => 'application/vnd.groove-account',
+ 'gdl' => 'model/vnd.gdl',
+ 'geo' => 'application/vnd.dynageo',
+ 'gex|gre' => 'application/vnd.geometry-explorer',
+ 'ggb' => 'application/vnd.geogebra.file',
+ 'ggt' => 'application/vnd.geogebra.tool',
+ 'ghf' => 'application/vnd.groove-help',
+ 'gif' => 'image/gif',
+ 'gim' => 'application/vnd.groove-identity-message',
+ 'gmx' => 'application/vnd.gmx',
+ 'gnumeric' => 'application/x-gnumeric',
+ 'gph' => 'application/vnd.flographit',
+ 'gqf|gqs' => 'application/vnd.grafeq',
+ 'gram' => 'application/srgs',
+ 'grv' => 'application/vnd.groove-injector',
+ 'grxml' => 'application/srgs+xml',
+ 'gsf' => 'application/x-font-ghostscript',
+ 'gtar' => 'application/x-gtar',
+ 'gtm' => 'application/vnd.groove-tool-message',
+ 'gtw' => 'model/vnd.gtw',
+ 'gv' => 'text/vnd.graphviz',
+ 'gz' => 'application/x-gzip',
+ 'h261' => 'video/h261',
+ 'h263' => 'video/h263',
+ 'h264' => 'video/h264',
+ 'hbci' => 'application/vnd.hbci',
+ 'hdf' => 'application/x-hdf',
+ 'hlp' => 'application/winhlp',
+ 'hpgl' => 'application/vnd.hp-hpgl',
+ 'hpid' => 'application/vnd.hp-hpid',
+ 'hps' => 'application/vnd.hp-hps',
+ 'hqx' => 'application/mac-binhex40',
+ 'htc' => 'text/x-component',
+ 'htke' => 'application/vnd.kenameaapp',
+ 'html|htm' => 'text/html',
+ 'hvd' => 'application/vnd.yamaha.hv-dic',
+ 'hvp' => 'application/vnd.yamaha.hv-voice',
+ 'hvs' => 'application/vnd.yamaha.hv-script',
+ 'icc|icm' => 'application/vnd.iccprofile',
+ 'ice' => 'x-conference/x-cooltalk',
+ 'ico' => 'image/x-icon',
+ 'ics|ifb' => 'text/calendar',
+ 'ief' => 'image/ief',
+ 'ifm' => 'application/vnd.shana.informed.formdata',
+ 'igl' => 'application/vnd.igloader',
+ 'igs|iges' => 'model/iges',
+ 'igx' => 'application/vnd.micrografx.igx',
+ 'iif' => 'application/vnd.shana.informed.interchange',
+ 'imp' => 'application/vnd.accpac.simply.imp',
+ 'ims' => 'application/vnd.ms-ims',
+ 'ipk' => 'application/vnd.shana.informed.package',
+ 'irm' => 'application/vnd.ibm.rights-management',
+ 'irp' => 'application/vnd.irepository.package+xml',
+ 'itp' => 'application/vnd.shana.informed.formtemplate',
+ 'ivp' => 'application/vnd.immervision-ivp',
+ 'ivu' => 'application/vnd.immervision-ivu',
+ 'jad' => 'text/vnd.sun.j2me.app-descriptor',
+ 'jam' => 'application/vnd.jam',
+ 'jar' => 'application/java-archive',
+ 'java' => 'text/x-java-source',
+ 'jisp' => 'application/vnd.jisp',
+ 'jlt' => 'application/vnd.hp-jlyt',
+ 'jnlp' => 'application/x-java-jnlp-file',
+ 'joda' => 'application/vnd.joost.joda-archive',
+ 'jpeg|jpg|jpe' => 'image/jpeg',
+ 'jpgv' => 'video/jpeg',
+ 'jpm|jpgm' => 'video/jpm',
+ 'js' => 'application/x-javascript',
+ 'json' => 'application/json',
+ 'karbon' => 'application/vnd.kde.karbon',
+ 'kfo' => 'application/vnd.kde.kformula',
+ 'kia' => 'application/vnd.kidspiration',
+ 'kml' => 'application/vnd.google-earth.kml+xml',
+ 'kmz' => 'application/vnd.google-earth.kmz',
+ 'kne|knp' => 'application/vnd.kinar',
+ 'kon' => 'application/vnd.kde.kontour',
+ 'kpr|kpt' => 'application/vnd.kde.kpresenter',
+ 'ksp' => 'application/vnd.kde.kspread',
+ 'ktz|ktr' => 'application/vnd.kahootz',
+ 'kwd|kwt' => 'application/vnd.kde.kword',
+ 'latex' => 'application/x-latex',
+ 'lbd' => 'application/vnd.llamagraphics.life-balance.desktop',
+ 'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml',
+ 'les' => 'application/vnd.hhe.lesson-player',
+ 'less' => 'text/less',
+ 'link66' => 'application/vnd.route66.link66+xml',
+ 'lostxml' => 'application/lost+xml',
+ 'lrm' => 'application/vnd.ms-lrm',
+ 'ltf' => 'application/vnd.frogans.ltf',
+ 'lvp' => 'audio/vnd.lucent.voice',
+ 'lwp' => 'application/vnd.lotus-wordpro',
+ 'm3u' => 'audio/x-mpegurl',
+ 'm4v' => 'video/x-m4v',
+ 'mag' => 'application/vnd.ecowin.chart',
+ 'mathml' => 'application/mathml+xml',
+ 'ma|nb|mb' => 'application/mathematica',
+ 'mbk' => 'application/vnd.mobius.mbk',
+ 'mbox' => 'application/mbox',
+ 'mc1' => 'application/vnd.medcalcdata',
+ 'mcd' => 'application/vnd.mcd',
+ 'mcurl' => 'text/vnd.curl.mcurl',
+ 'mdb' => 'application/x-msaccess',
+ 'mdi' => 'image/vnd.ms-modi',
+ 'mfm' => 'application/vnd.mfmp',
+ 'mgz' => 'application/vnd.proteus.magazine',
+ 'mid|midi|kar|rmi' => 'audio/midi',
+ 'mif' => 'application/vnd.mif',
+ 'mj2|mjp2' => 'video/mj2',
+ 'mlp' => 'application/vnd.dolby.mlp',
+ 'mmd' => 'application/vnd.chipnuts.karaoke-mmd',
+ 'mmf' => 'application/vnd.smaf',
+ 'mmr' => 'image/vnd.fujixerox.edmics-mmr',
+ 'mny' => 'application/x-msmoney',
+ 'movie' => 'video/x-sgi-movie',
+ 'mp4a' => 'audio/mp4',
+ 'mp4s' => 'application/mp4',
+ 'mp4|mp4v|mpg4' => 'video/mp4',
+ 'mpc' => 'application/vnd.mophun.certificate',
+ 'mpeg|mpg|mpe|m1v|m2v' => 'video/mpeg',
+ 'mpga|mp2|mp2a|mp3|m2a|m3a' => 'audio/mpeg',
+ 'mpkg' => 'application/vnd.apple.installer+xml',
+ 'mpm' => 'application/vnd.blueice.multipass',
+ 'mpn' => 'application/vnd.mophun.application',
+ 'mpp|mpt' => 'application/vnd.ms-project',
+ 'mpy' => 'application/vnd.ibm.minipay',
+ 'mqy' => 'application/vnd.mobius.mqy',
+ 'mrc' => 'application/marc',
+ 'mscml' => 'application/mediaservercontrol+xml',
+ 'mseed' => 'application/vnd.fdsn.mseed',
+ 'mseq' => 'application/vnd.mseq',
+ 'msf' => 'application/vnd.epson.msf',
+ 'msh|mesh|silo' => 'model/mesh',
+ 'msl' => 'application/vnd.mobius.msl',
+ 'msty' => 'application/vnd.muvee.style',
+ 'mts' => 'model/vnd.mts',
+ 'mus' => 'application/vnd.musician',
+ 'musicxml' => 'application/vnd.recordare.musicxml+xml',
+ 'mvb|m13|m14' => 'application/x-msmediaview',
+ 'mwf' => 'application/vnd.mfer',
+ 'mxf' => 'application/mxf',
+ 'mxl' => 'application/vnd.recordare.musicxml',
+ 'mxml|xhvml|xvml|xvm' => 'application/xv+xml',
+ 'mxs' => 'application/vnd.triscape.mxs',
+ 'mxu|m4u' => 'video/vnd.mpegurl',
+ 'n-gage' => 'application/vnd.nokia.n-gage.symbian.install',
+ 'ncx' => 'application/x-dtbncx+xml',
+ 'nc|cdf' => 'application/x-netcdf',
+ 'ngdat' => 'application/vnd.nokia.n-gage.data',
+ 'nlu' => 'application/vnd.neurolanguage.nlu',
+ 'nml' => 'application/vnd.enliven',
+ 'nnd' => 'application/vnd.noblenet-directory',
+ 'nns' => 'application/vnd.noblenet-sealer',
+ 'nnw' => 'application/vnd.noblenet-web',
+ 'npx' => 'image/vnd.net-fpx',
+ 'nsf' => 'application/vnd.lotus-notes',
+ 'oa2' => 'application/vnd.fujitsu.oasys2',
+ 'oa3' => 'application/vnd.fujitsu.oasys3',
+ 'oas' => 'application/vnd.fujitsu.oasys',
+ 'obd' => 'application/x-msbinder',
+ 'oda' => 'application/oda',
+ 'odb' => 'application/vnd.oasis.opendocument.database',
+ 'odc' => 'application/vnd.oasis.opendocument.chart',
+ 'odf' => 'application/vnd.oasis.opendocument.formula',
+ 'odft' => 'application/vnd.oasis.opendocument.formula-template',
+ 'odg' => 'application/vnd.oasis.opendocument.graphics',
+ 'odi' => 'application/vnd.oasis.opendocument.image',
+ 'odp' => 'application/vnd.oasis.opendocument.presentation',
+ 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
+ 'odt' => 'application/vnd.oasis.opendocument.text',
+ 'oga|ogg|spx' => 'audio/ogg',
+ 'ogv' => 'video/ogg',
+ 'ogx' => 'application/ogg',
+ 'onetoc|onetoc2|onetmp|onepkg' => 'application/onenote',
+ 'opf' => 'application/oebps-package+xml',
+ 'org' => 'application/vnd.lotus-organizer',
+ 'osf' => 'application/vnd.yamaha.openscoreformat',
+ 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml',
+ 'otc' => 'application/vnd.oasis.opendocument.chart-template',
+ 'otf' => array( 'application/x-font-otf', 'application/vnd.ms-opentype' ),
+ 'otg' => 'application/vnd.oasis.opendocument.graphics-template',
+ 'oth' => 'application/vnd.oasis.opendocument.text-web',
+ 'oti' => 'application/vnd.oasis.opendocument.image-template',
+ 'otm' => 'application/vnd.oasis.opendocument.text-master',
+ 'otp' => 'application/vnd.oasis.opendocument.presentation-template',
+ 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
+ 'ott' => 'application/vnd.oasis.opendocument.text-template',
+ 'oxt' => 'application/vnd.openofficeorg.extension',
+ 'p10' => 'application/pkcs10',
+ 'p12|pfx' => 'application/x-pkcs12',
+ 'p7b|spc' => 'application/x-pkcs7-certificates',
+ 'p7m|p7c' => 'application/pkcs7-all',
+ 'p7r' => 'application/x-pkcs7-certreqresp',
+ 'p7s' => 'application/pkcs7-signature',
+ 'pbd' => 'application/vnd.powerbuilder6',
+ 'pbm' => 'image/x-portable-bitmap',
+ 'pcf' => 'application/x-font-pcf',
+ 'pcl' => 'application/vnd.hp-pcl',
+ 'pclxl' => 'application/vnd.hp-pclxl',
+ 'pcurl' => 'application/vnd.curl.pcurl',
+ 'pcx' => 'image/x-pcx',
+ 'pdb|pqa|oprc' => 'application/vnd.palm',
+ 'pdf' => 'application/pdf',
+ 'pfa|pfb|pfm|afm' => 'application/x-font-type1',
+ 'pfr' => 'application/font-tdpfr',
+ 'pgm' => 'image/x-portable-graymap',
+ 'pgn' => 'application/x-chess-pgn',
+ 'pgp' => 'application/pgp-encrypted',
+ 'pic|pct' => 'image/x-pict',
+ 'pki' => 'application/pkixcmp',
+ 'pkipath' => 'application/pkix-pkipath',
+ 'plb' => 'application/vnd.3gpp.pic-bw-large',
+ 'plc' => 'application/vnd.mobius.plc',
+ 'plf' => 'application/vnd.pocketlearn',
+ 'pls' => 'application/pls+xml',
+ 'pml' => 'application/vnd.ctc-posml',
+ 'png' => 'image/png',
+ 'pnm' => 'image/x-portable-anymap',
+ 'portpkg' => 'application/vnd.macports.portpkg',
+ 'potm' => 'application/vnd.ms-powerpoint.template.macroenabled.12',
+ 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
+ 'ppam' => 'application/vnd.ms-powerpoint.addin.macroenabled.12',
+ 'ppd' => 'application/vnd.cups-ppd',
+ 'ppm' => 'image/x-portable-pixmap',
+ 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroenabled.12',
+ 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
+ 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroenabled.12',
+ 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
+ 'ppt|pps|pot' => 'application/vnd.ms-powerpoint',
+ 'prc|mobi' => 'application/x-mobipocket-ebook',
+ 'pre' => 'application/vnd.lotus-freelance',
+ 'prf' => 'application/pics-rules',
+ 'psb' => 'application/vnd.3gpp.pic-bw-small',
+ 'psd' => 'image/vnd.adobe.photoshop',
+ 'psf' => 'application/x-font-linux-psf',
+ 'ptid' => 'application/vnd.pvi.ptid1',
+ 'pub' => 'application/x-mspublisher',
+ 'pvb' => 'application/vnd.3gpp.pic-bw-var',
+ 'pwn' => 'application/vnd.3m.post-it-notes',
+ 'pya' => 'audio/vnd.ms-playready.media.pya',
+ 'pyv' => 'video/vnd.ms-playready.media.pyv',
+ 'p|pas' => 'text/x-pascal',
+ 'qam' => 'application/vnd.epson.quickanime',
+ 'qbo' => 'application/vnd.intu.qbo',
+ 'qfx' => 'application/vnd.intu.qfx',
+ 'qps' => 'application/vnd.publishare-delta-tree',
+ 'qt|mov' => 'video/quicktime',
+ 'qxd|qxt|qwd|qwt|qxl|qxb' => 'application/vnd.quark.quarkxpress',
+ 'ram|ra' => 'audio/x-pn-realaudio',
+ 'rar' => 'application/x-rar-compressed',
+ 'ras' => 'image/x-cmu-raster',
+ 'rcprofile' => 'application/vnd.ipunplugged.rcprofile',
+ 'rdf' => 'application/rdf+xml',
+ 'rdz' => 'application/vnd.data-vision.rdz',
+ 'rep' => 'application/vnd.businessobjects',
+ 'res' => 'application/x-dtbresource+xml',
+ 'rgb' => 'image/x-rgb',
+ 'rif' => 'application/reginfo+xml',
+ 'rl' => 'application/resource-lists+xml',
+ 'rlc' => 'image/vnd.fujixerox.edmics-rlc',
+ 'rld' => 'application/resource-lists-diff+xml',
+ 'rm' => 'application/vnd.rn-realmedia',
+ 'rmp' => 'audio/x-pn-realaudio-plugin',
+ 'rms' => 'application/vnd.jcp.javame.midlet-rms',
+ 'rnc' => 'application/relax-ng-compact-syntax',
+ 'rpss' => 'application/vnd.nokia.radio-presets',
+ 'rpst' => 'application/vnd.nokia.radio-preset',
+ 'rq' => 'application/sparql-query',
+ 'rs' => 'application/rls-services+xml',
+ 'rsd' => 'application/rsd+xml',
+ 'rss' => 'application/rss+xml',
+ 'rtf' => 'application/rtf',
+ 'rtx' => 'text/richtext',
+ 'saf' => 'application/vnd.yamaha.smaf-audio',
+ 'sbml' => 'application/sbml+xml',
+ 'sc' => 'application/vnd.ibm.secure-container',
+ 'scd' => 'application/x-msschedule',
+ 'scm' => 'application/vnd.lotus-screencam',
+ 'scq' => 'application/scvp-cv-request',
+ 'scs' => 'application/scvp-cv-response',
+ 'scurl' => 'text/vnd.curl.scurl',
+ 'sda' => 'application/vnd.stardivision.draw',
+ 'sdc' => 'application/vnd.stardivision.calc',
+ 'sdd' => 'application/vnd.stardivision.impress',
+ 'sdkm|sdkd' => 'application/vnd.solent.sdkm+xml',
+ 'sdp' => 'application/sdp',
+ 'sdw' => 'application/vnd.stardivision.writer',
+ 'see' => 'application/vnd.seemail',
+ 'seed|dataless' => 'application/vnd.fdsn.seed',
+ 'sema' => 'application/vnd.sema',
+ 'semd' => 'application/vnd.semd',
+ 'semf' => 'application/vnd.semf',
+ 'ser' => 'application/java-serialized-object',
+ 'setpay' => 'application/set-payment-initiation',
+ 'setreg' => 'application/set-registration-initiation',
+ 'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data',
+ 'sfs' => 'application/vnd.spotfire.sfs',
+ 'sgl' => 'application/vnd.stardivision.writer-global',
+ 'sgml|sgm' => 'text/sgml',
+ 'sh' => 'application/x-sh',
+ 'shar' => 'application/x-shar',
+ 'shf' => 'application/shf+xml',
+ 'sis|sisx' => 'application/vnd.symbian.install',
+ 'sit' => 'application/x-stuffit',
+ 'sitx' => 'application/x-stuffitx',
+ 'skp|skd|skt|skm' => 'application/vnd.koan',
+ 'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12',
+ 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
+ 'slt' => 'application/vnd.epson.salt',
+ 'smf' => 'application/vnd.stardivision.math',
+ 'smi|smil' => 'application/smil+xml',
+ 'snf' => 'application/x-font-snf',
+ 'spf' => 'application/vnd.yamaha.smaf-phrase',
+ 'spl' => 'application/x-futuresplash',
+ 'spot' => 'text/vnd.in3d.spot',
+ 'spp' => 'application/scvp-vp-response',
+ 'spq' => 'application/scvp-vp-request',
+ 'src' => 'application/x-wais-source',
+ 'srx' => 'application/sparql-results+xml',
+ 'sse' => 'application/vnd.kodak-descriptor',
+ 'ssf' => 'application/vnd.epson.ssf',
+ 'ssml' => 'application/ssml+xml',
+ 'stc' => 'application/vnd.sun.xml.calc.template',
+ 'std' => 'application/vnd.sun.xml.draw.template',
+ 'stf' => 'application/vnd.wt.stf',
+ 'sti' => 'application/vnd.sun.xml.impress.template',
+ 'stk' => 'application/hyperstudio',
+ 'stl' => 'application/vnd.ms-pki.stl',
+ 'str' => 'application/vnd.pg.format',
+ 'stw' => 'application/vnd.sun.xml.writer.template',
+ 'sus|susp' => 'application/vnd.sus-calendar',
+ 'sv4cpio' => 'application/x-sv4cpio',
+ 'sv4crc' => 'application/x-sv4crc',
+ 'svd' => 'application/vnd.svd',
+ 'svg|svgz' => 'image/svg+xml',
+ 'swf' => 'application/x-shockwave-flash',
+ 'swi' => 'application/vnd.arastra.swi',
+ 'sxc' => 'application/vnd.sun.xml.calc',
+ 'sxd' => 'application/vnd.sun.xml.draw',
+ 'sxg' => 'application/vnd.sun.xml.writer.global',
+ 'sxi' => 'application/vnd.sun.xml.impress',
+ 'sxm' => 'application/vnd.sun.xml.math',
+ 'sxw' => 'application/vnd.sun.xml.writer',
+ 's|asm' => 'text/x-asm',
+ 'tao' => 'application/vnd.tao.intent-module-archive',
+ 'tar' => 'application/x-tar',
+ 'tcap' => 'application/vnd.3gpp2.tcap',
+ 'tcl' => 'application/x-tcl',
+ 'teacher' => 'application/vnd.smart.teacher',
+ 'tex' => 'application/x-tex',
+ 'texinfo|texi' => 'application/x-texinfo',
+ 'tfm' => 'application/x-tex-tfm',
+ 'tiff|tif' => 'image/tiff',
+ 'tmo' => 'application/vnd.tmobile-livetv',
+ 'torrent' => 'application/x-bittorrent',
+ 'tpl' => 'application/vnd.groove-tool-template',
+ 'tpt' => 'application/vnd.trid.tpt',
+ 'tra' => 'application/vnd.trueapp',
+ 'trm' => 'application/x-msterminal',
+ 'tsv' => 'text/tab-separated-values',
+ 'ttf|ttc' => array( 'application/x-font-ttf', 'application/vnd.ms-opentype' ),
+ 'twd|twds' => 'application/vnd.simtech-mindmapper',
+ 'txd' => 'application/vnd.genomatix.tuxedo',
+ 'txf' => 'application/vnd.mobius.txf',
+ 'txt|text|conf|def|list|log|in' => 'text/plain',
+ 't|tr|roff|man|me|ms' => 'text/troff',
+ 'ufd|ufdl' => 'application/vnd.ufdl',
+ 'umj' => 'application/vnd.umajin',
+ 'unityweb' => 'application/vnd.unity',
+ 'uoml' => 'application/vnd.uoml+xml',
+ 'uri|uris|urls' => 'text/uri-list',
+ 'ustar' => 'application/x-ustar',
+ 'utz' => 'application/vnd.uiq.theme',
+ 'uu' => 'text/x-uuencode',
+ 'vcd' => 'application/x-cdlink',
+ 'vcf' => 'text/x-vcard',
+ 'vcg' => 'application/vnd.groove-vcard',
+ 'vcs' => 'text/x-vcalendar',
+ 'vcx' => 'application/vnd.vcx',
+ 'vis' => 'application/vnd.visionary',
+ 'viv' => 'video/vnd.vivo',
+ 'vor' => 'application/vnd.stardivision.writer',
+ 'vsd|vst|vss|vsw' => 'application/vnd.visio',
+ 'vsf' => 'application/vnd.vsf',
+ 'vtu' => 'model/vnd.vtu',
+ 'vxml' => 'application/voicexml+xml',
+ 'wad' => 'application/x-doom',
+ 'wav' => 'audio/x-wav',
+ 'wax' => 'audio/x-ms-wax',
+ 'wbmp' => 'image/vnd.wap.wbmp',
+ 'wbs' => 'application/vnd.criticaltools.wbs+xml',
+ 'wbxml' => 'application/vnd.wap.wbxml',
+ 'webm' => 'video/webm',
+ 'webp' => 'image/webp',
+ 'wm' => 'video/x-ms-wm',
+ 'wma' => 'audio/x-ms-wma',
+ 'wmd' => 'application/x-ms-wmd',
+ 'wmf' => 'application/x-msmetafile',
+ 'wml' => 'text/vnd.wap.wml',
+ 'wmlc' => 'application/vnd.wap.wmlc',
+ 'wmls' => 'text/vnd.wap.wmlscript',
+ 'wmlsc' => 'application/vnd.wap.wmlscriptc',
+ 'wmv' => 'video/x-ms-wmv',
+ 'wmx' => 'video/x-ms-wmx',
+ 'wmz' => 'application/x-ms-wmz',
+ 'wpd' => 'application/vnd.wordperfect',
+ 'wpl' => 'application/vnd.ms-wpl',
+ 'wps|wks|wcm|wdb' => 'application/vnd.ms-works',
+ 'wqd' => 'application/vnd.wqd',
+ 'wri' => 'application/x-mswrite',
+ 'wrl|vrml' => 'model/vrml',
+ 'wsdl' => 'application/wsdl+xml',
+ 'wspolicy' => 'application/wspolicy+xml',
+ 'wtb' => 'application/vnd.webturbo',
+ 'wvx' => 'video/x-ms-wvx',
+ 'x3d' => 'application/vnd.hzn-3d-crossword',
+ 'xap' => 'application/x-silverlight-app',
+ 'xar' => 'application/vnd.xara',
+ 'xbap' => 'application/x-ms-xbap',
+ 'xbd' => 'application/vnd.fujixerox.docuworks.binder',
+ 'xbm' => 'image/x-xbitmap',
+ 'xdm' => 'application/vnd.syncml.dm+xml',
+ 'xdp' => 'application/vnd.adobe.xdp+xml',
+ 'xdw' => 'application/vnd.fujixerox.docuworks',
+ 'xenc' => 'application/xenc+xml',
+ 'xer' => 'application/patch-ops-error+xml',
+ 'xfdf' => 'application/vnd.adobe.xfdf',
+ 'xfdl' => 'application/vnd.xfdl',
+ 'xhtml|xht' => 'application/xhtml+xml',
+ 'xif' => 'image/vnd.xiff',
+ 'xlam' => 'application/vnd.ms-excel.addin.macroenabled.12',
+ 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroenabled.12',
+ 'xlsm' => 'application/vnd.ms-excel.sheet.macroenabled.12',
+ 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+ 'xls|xlm|xla|xlc|xlt|xlw' => 'application/vnd.ms-excel',
+ 'xltm' => 'application/vnd.ms-excel.template.macroenabled.12',
+ 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
+ 'xml|xsl' => 'application/xml',
+ 'xo' => 'application/vnd.olpc-sugar',
+ 'xop' => 'application/xop+xml',
+ 'xpi' => 'application/x-xpinstall',
+ 'xpm' => 'image/x-xpixmap',
+ 'xpr' => 'application/vnd.is-xpr',
+ 'xps' => 'application/vnd.ms-xpsdocument',
+ 'xpw|xpx' => 'application/vnd.intercon.formnet',
+ 'xslt' => 'application/xslt+xml',
+ 'xsm' => 'application/vnd.syncml+xml',
+ 'xspf' => 'application/xspf+xml',
+ 'xul' => 'application/vnd.mozilla.xul+xml',
+ 'xwd' => 'image/x-xwindowdump',
+ 'xyz' => 'chemical/x-xyz',
+ 'zaz' => 'application/vnd.zzazz.deck+xml',
+ 'zip' => 'application/zip',
+ 'zir|zirz' => 'application/vnd.zul',
+ 'zmm' => 'application/vnd.handheld-entertainment+xml'
+);
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/cssjs.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/cssjs.php
new file mode 100644
index 00000000..5a3bb414
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/cssjs.php
@@ -0,0 +1,15 @@
+ 'text/css',
+ 'htc' => 'text/x-component',
+ 'less' => 'text/css',
+ //JS - varieties
+ 'js' => 'application/x-javascript',
+ 'js2' => 'application/javascript',
+ 'js3' => 'text/javascript',
+ 'js4' => 'text/x-js',
+);
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/html.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/html.php
new file mode 100644
index 00000000..191d59c5
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/html.php
@@ -0,0 +1,13 @@
+ 'text/html',
+ 'rtf|rtx' => 'text/richtext',
+ 'txt' => 'text/plain',
+ 'xsd' => 'text/xsd',
+ 'xsl' => 'text/xsl',
+ 'xml' => 'text/xml'
+);
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/index.html b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/index.html
new file mode 100644
index 00000000..e69de29b
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/other.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/other.php
new file mode 100644
index 00000000..f254c337
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/mime/other.php
@@ -0,0 +1,59 @@
+ 'video/asf',
+ 'avi' => 'video/avi',
+ 'avif' => 'image/avif',
+ 'avifs' => 'image/avif-sequence',
+ 'bmp' => 'image/bmp',
+ 'class' => 'application/java',
+ 'divx' => 'video/divx',
+ 'doc|docx' => 'application/msword',
+ 'eot' => 'application/vnd.ms-fontobject',
+ 'exe' => 'application/x-msdownload',
+ 'gif' => 'image/gif',
+ 'gz|gzip' => 'application/x-gzip',
+ 'ico' => 'image/x-icon',
+ 'jpg|jpeg|jpe' => 'image/jpeg',
+ 'webp' => 'image/webp',
+ 'json' => 'application/json',
+ 'mdb' => 'application/vnd.ms-access',
+ 'mid|midi' => 'audio/midi',
+ 'mov|qt' => 'video/quicktime',
+ 'mp3|m4a' => 'audio/mpeg',
+ 'mp4|m4v' => 'video/mp4',
+ 'mpeg|mpg|mpe' => 'video/mpeg',
+ 'webm' => 'video/webm',
+ 'mpp' => 'application/vnd.ms-project',
+ 'otf' => 'application/x-font-otf',
+ '_otf' => 'application/vnd.ms-opentype',
+ 'odb' => 'application/vnd.oasis.opendocument.database',
+ 'odc' => 'application/vnd.oasis.opendocument.chart',
+ 'odf' => 'application/vnd.oasis.opendocument.formula',
+ 'odg' => 'application/vnd.oasis.opendocument.graphics',
+ 'odp' => 'application/vnd.oasis.opendocument.presentation',
+ 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
+ 'odt' => 'application/vnd.oasis.opendocument.text',
+ 'ogg' => 'audio/ogg',
+ 'ogv' => 'video/ogg',
+ 'pdf' => 'application/pdf',
+ 'png' => 'image/png',
+ 'pot|pps|ppt|pptx' => 'application/vnd.ms-powerpoint',
+ 'ra|ram' => 'audio/x-realaudio',
+ 'svg|svgz' => 'image/svg+xml',
+ 'swf' => 'application/x-shockwave-flash',
+ 'tar' => 'application/x-tar',
+ 'tif|tiff' => 'image/tiff',
+ 'ttf|ttc' => 'application/x-font-ttf',
+ '_ttf' => 'application/vnd.ms-opentype',
+ 'wav' => 'audio/wav',
+ 'wma' => 'audio/wma',
+ 'wri' => 'application/vnd.ms-write',
+ 'woff' => 'application/font-woff',
+ 'woff2' => 'application/font-woff2',
+ 'xla|xls|xlsx|xlt|xlw' => 'application/vnd.ms-excel',
+ 'zip' => 'application/zip'
+);
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/about.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/about.php
new file mode 100644
index 00000000..1e1a6ac7
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/about.php
@@ -0,0 +1,261 @@
+
+
+
+
+
+ memcached',
+ '',
+ ' '
+ ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ 'target' => array(),
+ ),
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+ ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+ ',
+ '',
+ '',
+ ' ',
+ '',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ )
+ ?>
+
+
+ ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+ ',
+ ''
+ ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/browsercache.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/browsercache.php
new file mode 100644
index 00000000..04986ff6
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/browsercache.php
@@ -0,0 +1,788 @@
+ 'Default',
+ 'on' => 'Enable',
+ 'off' => 'Disable',
+);
+
+?>
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn.php
new file mode 100644
index 00000000..89841470
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn.php
@@ -0,0 +1,984 @@
+
+
+ ' . Cache::engine_name( $this->_config->get_string( 'cdn.engine' ) ) . '',
+ '' . esc_html__( 'enabled', 'w3-total-cache' ) : 'disabled">' . esc_html__( 'disabled', 'w3-total-cache' ) ) . ' ',
+ '' . esc_html__( 'authorized', 'w3-total-cache' ) : 'not-authorized">' . esc_html__( 'not authorized', 'w3-total-cache' ) ) . ' '
+ ),
+ array(
+ 'strong' => array(),
+ 'span' => array(
+ 'class' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+ ' . Cache::engine_name( $this->_config->get_string( 'cdnfsd.engine' ) ) . '',
+ '' . esc_html__( 'enabled', 'w3-total-cache' ) : 'disabled">' . esc_html__( 'disabled', 'w3-total-cache' ) ) . ' ',
+ '' . esc_html__( 'authorized', 'w3-total-cache' ) : 'not-authorized">' . esc_html__( 'not authorized', 'w3-total-cache' ) ) . ' '
+ ),
+ array(
+ 'strong' => array(),
+ 'span' => array(
+ 'class' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+ ',
+ '',
+ ' ',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ 'input' => array(
+ 'class' => array(),
+ 'id' => array(),
+ 'type' => array(),
+ 'value' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+ objects from the CDN ' :
+ '';
+ $cdn_mirror_purge_button = $cdn_mirror_purge_all ?
+ ( $can_purge ? ' or ' : '' ) . ' ' :
+ '';
+
+ echo wp_kses(
+ $cdn_purge_button . $cdn_mirror_purge_button,
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ 'input' => array(
+ 'class' => array(),
+ 'id' => array(),
+ 'name' => array(),
+ 'type' => array(),
+ 'value' => array(),
+ ),
+ )
+ );
+ ?>
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+ .
+ Check
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+ array(
+ 'type' => array(),
+ 'name' => array(),
+ 'value' => array(),
+ ),
+ )
+ );
+ ?>
+ class="button" />
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/akamai.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/akamai.php
new file mode 100644
index 00000000..0f98972c
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/akamai.php
@@ -0,0 +1,138 @@
+
+
+
+
+ name="cdn__akamai__username" value="_config->get_string( 'cdn.akamai.username' ) ); ?>" size="60" />
+
+
+
+
+
+ type="password" name="cdn__akamai__password" value="_config->get_string( 'cdn.akamai.password' ) ); ?>" size="60" />
+
+
+
+
+
+ cols="40" rows="5">_config->get_array( 'cdn.akamai.email_notification' ) ) ); ?>
+
+
+
+
+
+
+
+ _config->get_string( 'cdn.akamai.zone' ), 'production' ); ?>>Production
+ _config->get_string( 'cdn.akamai.zone' ), 'staging' ); ?>>Staging
+
+
+
+
+
+
+
+ _config->get_string( 'cdn.akamai.action' ), 'invalidate' ); ?>>Invalidate
+ _config->get_string( 'cdn.akamai.action' ), 'remove' ); ?>>Remove
+
+
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+ >
+ _config->get_string( 'cdn.akamai.ssl' ), 'auto' ); ?>>
+ _config->get_string( 'cdn.akamai.ssl' ), 'enabled' ); ?>>
+ _config->get_string( 'cdn.akamai.ssl' ), 'disabled' ); ?>>
+
+
+ ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+ _config->get_array( 'cdn.akamai.domain' );
+ require W3TC_INC_DIR . '/options/cdn/common/cnames.php';
+ ?>
+
+ ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/att.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/att.php
new file mode 100644
index 00000000..8ab59997
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/att.php
@@ -0,0 +1,112 @@
+
+
+
+
+ name="cdn__att__account" value="_config->get_string( 'cdn.att.account' ) ); ?>" size="60" />
+
+
+
+
+
+ name="cdn__att__token" value="_config->get_string( 'cdn.att.token' ) ); ?>" size="60" />
+
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+ >
+ _config->get_string( 'cdn.att.ssl' ), 'auto' ); ?>>
+ _config->get_string( 'cdn.att.ssl' ), 'enabled' ); ?>>
+ _config->get_string( 'cdn.att.ssl' ), 'disabled' ); ?>>
+
+
+ ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+ _config->get_array( 'cdn.att.domain' );
+ require W3TC_INC_DIR . '/options/cdn/common/cnames.php';
+ ?>
+
+ ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/azure.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/azure.php
new file mode 100644
index 00000000..4fef3299
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/azure.php
@@ -0,0 +1,122 @@
+
+
+
+
+ name="cdn__azure__user" value="_config->get_string( 'cdn.azure.user' ) ); ?>" size="30" />
+
+
+
+
+
+ type="password" name="cdn__azure__key" value="_config->get_string( 'cdn.azure.key' ) ); ?>" size="60" />
+
+
+
+
+
+ name="cdn__azure__container" value="_config->get_string( 'cdn.azure.container' ) ); ?>" size="30" />
+ class="button {type: 'azure', nonce: ''}" type="button" value="" />
+
+
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+ >
+ _config->get_string( 'cdn.azure.ssl' ), 'auto' ); ?>>
+ _config->get_string( 'cdn.azure.ssl' ), 'enabled' ); ?>>
+ _config->get_string( 'cdn.azure.ssl' ), 'disabled' ); ?>>
+
+
+ ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+ _config->get_string( 'cdn.azure.user' );
+ if ( '' !== $cdn_azure_user ) {
+ echo esc_attr( $cdn_azure_user ) . '.blob.core.windows.net';
+ } else {
+ echo '<account name>.blob.core.windows.net';
+ }
+
+ echo wp_kses(
+ sprintf(
+ // translators: 1 opening HTML acronym tag, 2 closing HTML acronym tag.
+ __(
+ ' or %1$sCNAME%2$s:',
+ 'w3-total-cache'
+ ),
+ '',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+
+ $cnames = $this->_config->get_array( 'cdn.azure.cname' );
+ require W3TC_INC_DIR . '/options/cdn/common/cnames.php';
+ ?>
+
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/cf.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/cf.php
new file mode 100644
index 00000000..8bdc6da1
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/cf.php
@@ -0,0 +1,187 @@
+
+
+
+
+ ',
+ '',
+ ' ',
+ '',
+ '',
+ ' ',
+ '',
+ '',
+ ' ',
+ ' '
+ ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ 'target' => array(),
+ ),
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+ name="cdn__cf__key" value="_config->get_string( 'cdn.cf.key' ) ); ?>" size="30" />
+
+
+
+
+
+ name="cdn__cf__secret" value="_config->get_string( 'cdn.cf.secret' ) ); ?>" size="60" />
+
+
+
+
+
+ value="_config->get_string( 'cdn.cf.bucket' ) ) ); ?>" size="30" />
+ _config->get_string( 'cdn.cf.bucket.location' ),
+ CdnEngine_S3::regions_list()
+ );
+ ?>
+ or
+
+
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+ >
+ _config->get_string( 'cdn.cf.ssl' ), 'auto' ); ?>>
+ _config->get_string( 'cdn.cf.ssl' ), 'enabled' ); ?>>
+ _config->get_string( 'cdn.cf.ssl' ), 'disabled' ); ?>>
+
+
+ ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+ value="_config->get_string( 'cdn.cf.id' ) ); ?>" size="18" style="text-align: right;" />.cloudfront.net or CNAME :
+ _config->get_array( 'cdn.cf.cname' );
+ require W3TC_INC_DIR . '/options/cdn/common/cnames.php';
+ ?>
+
+ ',
+ '',
+ ' ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ 'target' => array(),
+ ),
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+ >
+ _config->get_string( 'cdn.cf.public_objects' ), 'enabled' ); ?>>
+ _config->get_string( 'cdn.cf.public_objects' ), 'disabled' ); ?>>
+
+
+
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/cf2.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/cf2.php
new file mode 100644
index 00000000..03f5ae94
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/cf2.php
@@ -0,0 +1,169 @@
+
+
+
+
+ ',
+ '',
+ ' ',
+ '',
+ '',
+ ' ',
+ '',
+ '',
+ ' ',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ 'a' => array(
+ 'href' => array(),
+ 'target' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+ name="cdn__cf2__key" value="_config->get_string( 'cdn.cf2.key' ) ); ?>" size="30" />
+
+
+
+
+
+ type="password" name="cdn__cf2__secret" value="_config->get_string( 'cdn.cf2.secret' ) ); ?>" size="60" />
+
+
+
+
+
+
+ class="button {type: 'cf2', nonce: ''}" type="button" value="" />
+
+
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+ >
+ _config->get_string( 'cdn.cf2.ssl' ), 'auto' ); ?>>
+ _config->get_string( 'cdn.cf2.ssl' ), 'enabled' ); ?>>
+ _config->get_string( 'cdn.cf2.ssl' ), 'disabled' ); ?>>
+
+
+ ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+ value="_config->get_string( 'cdn.cf2.id' ) ); ?>" size="18" style="text-align: right;" />.cloudfront.net or CNAME :
+ _config->get_array( 'cdn.cf2.cname' );
+ require W3TC_INC_DIR . '/options/cdn/common/cnames.php';
+ ?>
+
+ ',
+ '',
+ ' ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ 'a' => array(
+ 'href' => array(),
+ 'target' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/common/cnames-readonly.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/common/cnames-readonly.php
new file mode 100644
index 00000000..b89ed9ec
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/common/cnames-readonly.php
@@ -0,0 +1,35 @@
+' . esc_html( $cnames[0] ) . '
';
+} else {
+ echo '
';
+
+ foreach ( $cnames as $index => $cname ) {
+ $label = '';
+
+ if ( 0 === $index ) {
+ $label = __( '(reserved for CSS)', 'w3-total-cache' );
+ } elseif ( 1 === $index ) {
+ $label = __( '(reserved for JS in )', 'w3-total-cache' );
+ } elseif ( 2 === $index ) {
+ $label = __( '(reserved for JS after )', 'w3-total-cache' );
+ } elseif ( 3 === $index ) {
+ $label = __( '(reserved for JS before )', 'w3-total-cache' );
+ } else {
+ $label = '';
+ }
+
+ echo '' . esc_html( $cname ) . ' ';
+ }
+
+ echo ' ';
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/common/cnames.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/common/cnames.php
new file mode 100644
index 00000000..93be855b
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/common/cnames.php
@@ -0,0 +1,67 @@
+
+
+ $cname ) :
+ if ( 'http_default' === $index || 'https_default' === $index ) {
+ continue;
+ }
+
+ $label = '';
+
+ if ( $count > 1 ) :
+ switch ( $real_index ) :
+ case 0:
+ $label = __( '(reserved for CSS)', 'w3-total-cache' );
+ break;
+
+ case 1:
+ $label = __( '(reserved for JS in )', 'w3-total-cache' );
+ break;
+
+ case 2:
+ $label = __( '(reserved for JS after )', 'w3-total-cache' );
+ break;
+
+ case 3:
+ $label = __( '(reserved for JS before )', 'w3-total-cache' );
+ break;
+
+ default:
+ $label = '';
+ break;
+ endswitch;
+ endif;
+ ?>
+
+ value="" size="60" />
+ value="" />
+
+
+
+
+
/>
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/common/index.html b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/common/index.html
new file mode 100644
index 00000000..e69de29b
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/cotendo.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/cotendo.php
new file mode 100644
index 00000000..7bf18960
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/cotendo.php
@@ -0,0 +1,119 @@
+
+
+
+
+ name="cdn__cotendo__username" value="_config->get_string( 'cdn.cotendo.username' ) ); ?>" size="60" />
+
+
+
+
+
+ type="password" name="cdn__cotendo__password" value="_config->get_string( 'cdn.cotendo.password' ) ); ?>" size="60" />
+
+
+
+
+
+ cols="40" rows="5">_config->get_array( 'cdn.cotendo.zones' ) ) ); ?>
+
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+ >
+ _config->get_string( 'cdn.cotendo.ssl' ), 'auto' ); ?>>
+ _config->get_string( 'cdn.cotendo.ssl' ), 'enabled' ); ?>>
+ _config->get_string( 'cdn.cotendo.ssl' ), 'disabled' ); ?>>
+
+
+ ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+ _config->get_array( 'cdn.cotendo.domain' );
+ require W3TC_INC_DIR . '/options/cdn/common/cnames.php';
+ ?>
+
+ ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/edgecast.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/edgecast.php
new file mode 100644
index 00000000..188695c9
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/edgecast.php
@@ -0,0 +1,112 @@
+
+
+
+
+ name="cdn__edgecast__account" value="_config->get_string( 'cdn.edgecast.account' ) ); ?>" size="60" />
+
+
+
+
+
+ name="cdn__edgecast__token" value="_config->get_string( 'cdn.edgecast.token' ) ); ?>" size="60" />
+
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+ >
+ _config->get_string( 'cdn.edgecast.ssl' ), 'auto' ); ?>>
+ _config->get_string( 'cdn.edgecast.ssl' ), 'enabled' ); ?>>
+ _config->get_string( 'cdn.edgecast.ssl' ), 'disabled' ); ?>>
+
+
+ ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+ _config->get_array( 'cdn.edgecast.domain' );
+ require W3TC_INC_DIR . '/options/cdn/common/cnames.php';
+ ?>
+
+ ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/ftp.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/ftp.php
new file mode 100644
index 00000000..473309ac
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/ftp.php
@@ -0,0 +1,348 @@
+
+
+
+ checkbox( 'cdn.ftp.pasv' ); ?>
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+ value="_config->get_string( 'cdn.ftp.host' ) ); ?>" size="30" />
+
+
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+ >
+ _config->get_string( 'cdn.ftp.type' ), '' ); ?>>
+ _config->get_string( 'cdn.ftp.type' ), 'ftps' ); ?>>
+ _config->get_string( 'cdn.ftp.type' ), 'sftp' ); ?>>
+
+
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+ name="cdn__ftp__user" value="_config->get_string( 'cdn.ftp.user' ) ); ?>" size="30" />
+
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+ type="password" name="cdn__ftp__pass" value="_config->get_string( 'cdn.ftp.pass' ) ); ?>" size="30" />
+
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+ value="_config->get_string( 'cdn.ftp.path' ) ); ?>" size="30" />
+
+
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+ >
+ _config->get_string( 'cdn.ftp.ssl' ), 'auto' ); ?>>
+ _config->get_string( 'cdn.ftp.ssl' ), 'enabled' ); ?>>
+ _config->get_string( 'cdn.ftp.ssl' ), 'disabled' ); ?>>
+
+
+ ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+ checkbox( 'cdn.ftp.default_keys', ! function_exists( 'ssh2_connect' ) ); ?>
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+ name="cdn__ftp__pubkey" value="_config->get_string( 'cdn.ftp.pubkey' ) ); ?>" size="30" />
+
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+ name="cdn__ftp__privkey" value="_config->get_string( 'cdn.ftp.privkey' ) ); ?>" size="30" />
+
+
+
+
+
+ _config->get_array( 'cdn.ftp.domain' );
+ require W3TC_INC_DIR . '/options/cdn/common/cnames.php';
+ ?>
+
+ ',
+ '',
+ '',
+ ' ',
+ '',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/index.html b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/index.html
new file mode 100644
index 00000000..e69de29b
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/mirror.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/mirror.php
new file mode 100644
index 00000000..bef35987
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/mirror.php
@@ -0,0 +1,98 @@
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+ >
+ _config->get_string( 'cdn.mirror.ssl' ), 'auto' ); ?>>
+ _config->get_string( 'cdn.mirror.ssl' ), 'enabled' ); ?>>
+ _config->get_string( 'cdn.mirror.ssl' ), 'disabled' ); ?>>
+
+
+ ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+ _config->get_array( 'cdn.mirror.domain' );
+ require W3TC_INC_DIR . '/options/cdn/common/cnames.php';
+ ?>
+
+ ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/rscf.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/rscf.php
new file mode 100644
index 00000000..4255f064
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/rscf.php
@@ -0,0 +1,152 @@
+
+
+
+
+ name="cdn__rscf__user" value="_config->get_string( 'cdn.rscf.user' ) ); ?>" size="30" />
+
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+ name="cdn__rscf__key" value="_config->get_string( 'cdn.rscf.key' ) ); ?>" size="60" />
+
+
+ 'cdn.rscf.location',
+ 'control' => 'selectbox',
+ 'selectbox_values' => array(
+ 'us' => 'US',
+ 'uk' => 'uk',
+ ),
+ )
+);
+?>
+
+
+
+ value="_config->get_string( 'cdn.rscf.container' ) ); ?>" size="30" />
+ class="button {type: 'rscf', nonce: ''}" type="button" value="" />
+
+
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+ >
+ _config->get_string( 'cdn.rscf.ssl' ), 'auto' ); ?>>
+ _config->get_string( 'cdn.rscf.ssl' ), 'enabled' ); ?>>
+ _config->get_string( 'cdn.rscf.ssl' ), 'disabled' ); ?>>
+
+
+ ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+ _config->get_array( 'cdn.rscf.cname' );
+ require W3TC_INC_DIR . '/options/cdn/common/cnames.php';
+ ?>
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/s3.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/s3.php
new file mode 100644
index 00000000..894c53ce
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/s3.php
@@ -0,0 +1,196 @@
+
+
+
+
+ ',
+ '',
+ ' ',
+ '',
+ '',
+ ' ',
+ '',
+ '',
+ ' ',
+ ' '
+ ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ 'target' => array(),
+ ),
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+ name="cdn__s3__key" value="_config->get_string( 'cdn.s3.key' ) ); ?>" size="30" />
+
+
+
+
+
+ type="password" name="cdn__s3__secret" value="_config->get_string( 'cdn.s3.secret' ) ); ?>" size="60" />
+
+
+
+
+
+ value="_config->get_string( 'cdn.s3.bucket' ) ) ); ?>" size="30" />
+ _config->get_string( 'cdn.s3.bucket.location' ),
+ CdnEngine_S3::regions_list()
+ );
+ ?>
+ or
+
+
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+ >
+ _config->get_string( 'cdn.s3.ssl' ), 'auto' ); ?>>
+ _config->get_string( 'cdn.s3.ssl' ), 'enabled' ); ?>>
+ _config->get_string( 'cdn.s3.ssl' ), 'disabled' ); ?>>
+
+
+ ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+ _config->get_string( 'cdn.s3.bucket' );
+ if ( '' !== $cdn_s3_bucket ) {
+ echo esc_html( $cdn_s3_bucket ) . '.s3.amazonaws.com ';
+ } else {
+ echo '<bucket>.s3.amazonaws.com ';
+ }
+
+ esc_html_e( 'or CNAME:', 'w3-total-cache' );
+
+ $cnames = $this->_config->get_array( 'cdn.s3.cname' );
+ require W3TC_INC_DIR . '/options/cdn/common/cnames.php';
+ ?>
+
+ ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ 'target' => array(),
+ ),
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+ >
+ _config->get_string( 'cdn.s3.public_objects' ), 'enabled' ); ?>>
+ _config->get_string( 'cdn.s3.public_objects' ), 'disabled' ); ?>>
+
+
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/s3_compatible.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/s3_compatible.php
new file mode 100644
index 00000000..48925757
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/cdn/s3_compatible.php
@@ -0,0 +1,154 @@
+ 'cdn.s3_compatible.api_host',
+ 'label' => esc_html__( 'API host:', 'w3-total-cache' ),
+ 'control' => 'textbox',
+ 'textbox_size' => 30,
+ 'description' => esc_html__( 'Host of API endpoint, comptabile with Amazon S3 API', 'w3-total-cache' ),
+ )
+);
+Util_Ui::config_item(
+ array(
+ 'key' => 'cdn.s3.key',
+ 'label' => esc_html__( 'Access key ID:', 'w3-total-cache' ),
+ 'control' => 'textbox',
+ 'textbox_size' => 30,
+ 'description' => wp_kses(
+ sprintf(
+ // translators: 1 opening HTML acronym tag, 2 closing HTML acronym tag,
+ // translators: 3 opening HTML acronym tag, 4 closing HTML acronym tag.
+ __(
+ 'Theme files, media library attachments, %1$sCSS%2$s, %3$sJS%4$s files etc will appear to load instantly for site visitors.',
+ 'w3-total-cache'
+ ),
+ '
',
+ ' ',
+ '
',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ ),
+ )
+);
+
+?>
+
+
+
+ type="password" name="cdn__s3__secret" value="_config->get_string( 'cdn.s3.secret' ) ); ?>" size="60" />
+
+
+
+
+
+ value="_config->get_string( 'cdn.s3.bucket' ) ); ?>" size="30" />
+
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+ >
+ _config->get_string( 'cdn.s3.ssl' ), 'auto' ); ?>>
+ _config->get_string( 'cdn.s3.ssl' ), 'enabled' ); ?>>
+ _config->get_string( 'cdn.s3.ssl' ), 'disabled' ); ?>>
+
+
+ ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+ _config->get_array( 'cdn.s3.cname' );
+ require W3TC_INC_DIR . '/options/cdn/common/cnames.php';
+ ?>
+
+ ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ 'target' => array(),
+ ),
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/common/footer.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/common/footer.php
new file mode 100644
index 00000000..c68b5926
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/common/footer.php
@@ -0,0 +1,117 @@
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/common/header.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/common/header.php
new file mode 100644
index 00000000..6572d8e0
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/common/header.php
@@ -0,0 +1,10 @@
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/common/index.html b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/common/index.html
new file mode 100644
index 00000000..e69de29b
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/common/top_nav_bar.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/common/top_nav_bar.php
new file mode 100644
index 00000000..923f2088
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/common/top_nav_bar.php
@@ -0,0 +1,218 @@
+ array(
+ array(
+ 'url' => Util_Ui::admin_url( 'admin.php?page=w3tc_general' ),
+ 'text' => __( 'General Settings', 'w3-total-cache' ),
+ ),
+ array(
+ 'url' => Util_Ui::admin_url( 'admin.php?page=w3tc_pgcache' ),
+ 'text' => __( 'Page Cache', 'w3-total-cache' ),
+ ),
+ array(
+ 'url' => Util_Ui::admin_url( 'admin.php?page=w3tc_minify' ),
+ 'text' => __( 'Minify', 'w3-total-cache' ),
+ ),
+ array(
+ 'url' => Util_Ui::admin_url( 'admin.php?page=w3tc_dbcache' ),
+ 'text' => __( 'Database Cache', 'w3-total-cache' ),
+ ),
+ array(
+ 'url' => Util_Ui::admin_url( 'admin.php?page=w3tc_objectcache' ),
+ 'text' => __( 'Object Cache', 'w3-total-cache' ),
+ ),
+ array(
+ 'url' => Util_Ui::admin_url( 'admin.php?page=w3tc_browsercache' ),
+ 'text' => __( 'Browser Cache', 'w3-total-cache' ),
+ ),
+ array(
+ 'url' => Util_Ui::admin_url( 'admin.php?page=w3tc_cachegroups' ),
+ 'text' => __( 'Cache Groups', 'w3-total-cache' ),
+ ),
+ array(
+ 'url' => Util_Ui::admin_url( 'admin.php?page=w3tc_cdn' ),
+ 'text' => 'CDN',
+ ),
+ array(
+ 'url' => Util_Ui::admin_url( 'admin.php?page=w3tc_fragmentcache' ),
+ 'text' => __( 'Fragment Cache', 'w3-total-cache' ),
+ ),
+ array(
+ 'url' => Util_Ui::admin_url( 'admin.php?page=w3tc_userexperience' ),
+ 'text' => __( 'User Experience', 'w3-total-cache' ),
+ ),
+ ),
+ 'tools' => array(
+ array(
+ 'url' => Util_Ui::admin_url( 'admin.php?page=w3tc_extensions' ),
+ 'text' => __( 'Extensions', 'w3-total-cache' ),
+ ),
+ array(
+ 'url' => Util_Ui::admin_url( 'admin.php?page=w3tc_stats' ),
+ 'text' => __( 'Statistics', 'w3-total-cache' ),
+ ),
+ array(
+ 'url' => $config->is_extension_active( 'imageservice' )
+ ? Util_Ui::admin_url( 'upload.php?page=w3tc_extension_page_imageservice' )
+ : Util_Ui::admin_url( 'admin.php?page=w3tc_general#image_service' ),
+ 'text' => __( 'WebP Converter', 'w3-total-cache' ),
+ ),
+ array(
+ 'url' => Util_Ui::admin_url( 'admin.php?page=w3tc_pagespeed' ),
+ 'text' => __( 'Google PageSpeed', 'w3-total-cache' ),
+ ),
+ array(
+ 'url' => Util_Ui::admin_url( 'admin.php?page=w3tc_setup_guide' ),
+ 'text' => __( 'Setup Guide', 'w3-total-cache' ),
+ ),
+ ),
+ 'info' => array(
+ array(
+ 'url' => Util_UI::admin_url( 'admin.php?page=w3tc_about' ),
+ 'text' => __( 'About', 'w3-total-cache' ),
+ ),
+ array(
+ 'url' => Util_Ui::admin_url( 'admin.php?page=w3tc_feature_showcase' ),
+ 'text' => __( 'Feature Showcase', 'w3-total-cache' ),
+ ),
+ array(
+ 'url' => Util_Ui::admin_url( 'admin.php?page=w3tc_install' ),
+ 'text' => __( 'Install', 'w3-total-cache' ),
+ ),
+ array(
+ 'url' => '#',
+ 'text' => __( 'Compatibility Test', 'w3-total-cache' ),
+ 'class' => 'compatiblity-test button-self-test',
+ ),
+ array(
+ 'url' => 'https://api.w3-edge.com/v1/redirects/faq',
+ 'text' => 'FAQ',
+ 'target' => '_blank',
+ 'dashicon' => '
',
+ ),
+ ),
+);
+
+do_action( 'w3tc_dashboard_top_nav_bar' );
+?>
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/dashboard.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/dashboard.php
new file mode 100644
index 00000000..e0e46631
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/dashboard.php
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+ array(
+ 'type' => array(),
+ 'name' => array(),
+ 'value' => array(),
+ ),
+ )
+ );
+ ?>
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/dbcache.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/dbcache.php
new file mode 100644
index 00000000..334407cc
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/dbcache.php
@@ -0,0 +1,135 @@
+
+
+
+
+ _config->get_string( 'dbcache.engine' ) ) ),
+ '' . esc_html__( 'enabled', 'w3-total-cache' ) : 'disabled">' . esc_html__( 'disabled', 'w3-total-cache' ) ) . ' '
+ ),
+ array(
+ 'span' => array(
+ 'class' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/edd/buy.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/edd/buy.php
new file mode 100644
index 00000000..49541234
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/edd/buy.php
@@ -0,0 +1,57 @@
+
+
+ '
+ ),
+ array(
+ 'input' => array(
+ 'type' => array(),
+ 'class' => array(),
+ 'data-src' => array(),
+ 'value' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+ ' . esc_html( __( 'here', 'w3-total-cache' ) ) . ''
+ ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/enterprise/dbcluster-config.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/enterprise/dbcluster-config.php
new file mode 100644
index 00000000..5e898c05
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/enterprise/dbcluster-config.php
@@ -0,0 +1,58 @@
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/enterprise/dbcluster_general_section.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/enterprise/dbcluster_general_section.php
new file mode 100644
index 00000000..d62e5568
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/enterprise/dbcluster_general_section.php
@@ -0,0 +1,15 @@
+
+
+ Database cluster:
+
+
+ Create db-cluster-config.php file with your database cluster configuration to enable it.
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/extensions.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/extensions.php
new file mode 100644
index 00000000..6b0cc5cc
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/extensions.php
@@ -0,0 +1,14 @@
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/extensions/list.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/extensions/list.php
new file mode 100644
index 00000000..c299a1a7
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/extensions/list.php
@@ -0,0 +1,265 @@
+
+
+
+
+
+ _config->is_sealed( 'extensions.active' ) ) : ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ default_meta( $meta );
+ if ( ! $meta['public'] ) {
+ continue;
+ }
+
+ $cb_id++;
+
+ do_action( "w3tc_extension_before_row-{$extension}" );
+
+ ?>
+
+
+
+ >
+
+
+
+
+ _config->is_extension_active( $extension ) ) :
+ $extra_links = array();
+
+ if ( isset( $meta['settings_exists'] ) && $meta['settings_exists'] ) {
+ $extra_links[] = '
' .
+ esc_html__( 'Settings', 'w3-total-cache' ) . ' ';
+ }
+
+ if ( isset( $meta['extra_links'] ) && is_Array( $meta['extra_links'] ) ) {
+ $extra_links = array_merge( $extra_links, $meta['extra_links'] );
+ }
+
+ $extra_links = apply_filters( "w3tc_extension_plugin_links_{$extension}", $extra_links );
+ $links = implode( ' | ', $extra_links );
+
+ if ( $links ) {
+ echo wp_kses(
+ $links,
+ array(
+ 'a' => array(
+ 'href' => array(),
+ 'class' => array(),
+ 'target' => array(),
+ ),
+ )
+ );
+ }
+ ?>
+
+
+
+ _config->is_sealed( 'extensions.active' ) ) : ?>
+
+
+
+
+
+
+
+
+
+
+ _config->is_sealed( 'extensions.active' ) ) : ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+ ' . esc_html( $meta['author'] ) . ''
+ ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ 'target' => array(),
+ ),
+ )
+ );
+ ?>
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+ _config->is_sealed( 'extensions.active' ) ) : ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/extensions/settings.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/extensions/settings.php
new file mode 100644
index 00000000..4efda4e3
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/extensions/settings.php
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+ 'pgcache.configuration_overloaded' ) );
+ ?>
+
+
+
+
+
+ 'minify.configuration_overloaded' ) );
+ ?>
+
+
+
+
+
+
+
+
+ 'dbcache.configuration_overloaded' ) );
+ ?>
+
+
+
+
+
+ 'objectcache.configuration_overloaded' ) );
+ echo ( ! $this->_config->getf_boolean( 'objectcache.enabled' ) && has_filter( 'w3tc_config_item_objectcache.enabled' ) ? '
' . esc_html__( 'Object Cache is disabled via filter.', 'w3-total-cache' ) . '
' : '' );
+ ?>
+
+
+
+
+
+ 'browsercache.configuration_overloaded' ) );
+ ?>
+
+
+
+
+
+
+
+ 'varnish.configuration_overloaded' ) );
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ ),
+ '',
+ 'debug'
+ );
+ ?>
+
+
+
+
+
+
+ _config->is_extension_active( 'imageservice' )
+ ? Util_UI::admin_url( 'upload.php?page=w3tc_extension_page_imageservice' )
+ : ''
+ );
+ ?>
+
+
+
+
+ Util_UI::admin_url( 'admin.php?page=w3tc_pagespeed' ) )
+ );
+ ?>
+ _config->get_string( 'widget.pagespeed.access_token' ) ) ? $this->_config->get_string( 'widget.pagespeed.access_token' ) : '' );
+ $w3_pagespeed = new PageSpeed_Api( $access_token_json );
+
+ $site_id = Util_Http::generate_site_id();
+ $return_url = Util_Ui::admin_url( 'admin.php?page=w3tc_general' );
+ $w3tc_pagespeed_key = ! empty( $this->_config->get_string( 'widget.pagespeed.w3tc_pagespeed_key' ) ) ? $this->_config->get_string( 'widget.pagespeed.w3tc_pagespeed_key' ) : '';
+ $auth_url = $w3_pagespeed->client->createAuthUrl();
+
+ $new_gacode = Util_Request::get( 'w3tc_new_gacode' );
+ $new_w3tc_pagespeed_key = Util_Request::get( 'w3tc_new_w3tc_pagespeed_key' );
+ $authorize_error = Util_Request::get( 'w3tc_authorize_error' );
+ $deauthorize = Util_Request::get( 'w3tc_deauthorize' );
+
+ if ( ! empty( $new_gacode ) && ! empty( $new_w3tc_pagespeed_key ) ) {
+ $response = json_decode( $w3_pagespeed->process_authorization_response( $new_gacode, $new_w3tc_pagespeed_key ), true );
+
+ if ( isset( $response['error']['code'] ) && 200 !== $response['error']['code'] ) {
+ $response_error = sprintf(
+ // translators: 1 Request response code, 2 Error message.
+ __(
+ 'Response Code: %1$s
Response Message: %2$s',
+ 'w3-total-cache'
+ ),
+ ! empty( $response['error']['code'] ) ? $response['error']['code'] : 'N/A',
+ ! empty( $response['error']['message'] ) ? $response['error']['message'] : 'N/A'
+ );
+
+ update_option(
+ 'w3tcps_authorize_fail',
+ __( 'Google PageSpeed Insights API authorization failed.', 'w3-total-cache' )
+ );
+ update_option(
+ 'w3tcps_authorize_fail_message',
+ $response_error
+ );
+ } elseif ( ! empty( $response['refresh_token'] ) ) {
+ update_option(
+ 'w3tcps_authorize_success',
+ __( 'Google PageSpeed Insights API authorization successful.', 'w3-total-cache' )
+ );
+ } else {
+ update_option(
+ 'w3tcps_authorize_fail',
+ __( 'Google PageSpeed Insights API authorization failed.', 'w3-total-cache' )
+ );
+ update_option(
+ 'w3tcps_authorize_fail_message',
+ __( 'Missing refresh token.', 'w3-total-cache' )
+ );
+ }
+
+ wp_safe_redirect( $return_url );
+ exit;
+ } elseif ( $deauthorize ) {
+ $w3_pagespeed->reset();
+ update_option(
+ 'w3tcps_authorize_success',
+ __( 'Google PageSpeed Insights API authorization successfully reset.', 'w3-total-cache' )
+ );
+ wp_safe_redirect( $return_url );
+ exit;
+ } elseif ( ! empty( $authorize_error ) ) {
+ $authorize_error = json_decode( $authorize_error );
+
+ if ( 'authorize-in-missing-site-id' === $authorize_error->error->id ) {
+ $message = __( 'Unique site ID missing for authorize request!', 'w3-total-cache' );
+ } elseif ( 'authorize-in-missing-auth-url' === $authorize_error->error->id ) {
+ $message = __( 'Authorize URL missing for authorize request!', 'w3-total-cache' );
+ } elseif ( 'authorize-in-missing-return-url' === $authorize_error->error->id ) {
+ $message = __( 'Return URL missing for authorize request!', 'w3-total-cache' );
+ } elseif ( 'authorize-in-failed' === $authorize_error->error->id ) {
+ $message = __( 'Failed to process authorize request!', 'w3-total-cache' );
+ }
+
+ if ( 'authorize-out-code-missing' === $authorize_error->error->id ) {
+ $message = __( 'No authorize code returned to W3-API from Google!', 'w3-total-cache' );
+ } elseif ( 'authorize-out-w3tc-pagespeed-key-missing' === $authorize_error->error->id ) {
+ $message = __( 'No W3Key return to W3-API from Google!', 'w3-total-cache' );
+ } elseif ( 'authorize-out-not-found' === $authorize_error->error->id ) {
+ $message = __( 'No W3-API matching record found during Google authorization return processing!', 'w3-total-cache' );
+ }
+
+ update_option(
+ 'w3tcps_authorize_fail',
+ __( 'Google PageSpeed Insights API authorization failed.', 'w3-total-cache' )
+ );
+ update_option(
+ 'w3tcps_authorize_fail_message',
+ $message
+ );
+
+ wp_safe_redirect( $return_url );
+ exit;
+ }
+ ?>
+
+
+
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/index.html b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/index.html
new file mode 100644
index 00000000..e69de29b
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/install.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/install.php
new file mode 100644
index 00000000..fd848340
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/install.php
@@ -0,0 +1,420 @@
+
+
+
+
+
+
+
+
+ # chmod 755 /var/www/vhosts/domain.com/httpdocs/wp-content/
+
+
+ ',
+ ''
+ ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+ ',
+ ''
+ ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+ ',
+ '',
+ '',
+ ' ',
+ '',
+ ' ',
+ '',
+ ' ',
+ '',
+ ' ',
+ '',
+ '',
+ ' ',
+ ' '
+ ),
+ array(
+ 'em' => array(),
+ 'a' => array(
+ 'href' => array(),
+ ),
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+ ',
+ '',
+ '',
+ ' ',
+ '',
+ ' '
+ ),
+ array(
+ 'em' => array(),
+ 'a' => array(
+ 'href' => array(),
+ ),
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+ ',
+ '',
+ '',
+ ' ',
+ '',
+ ' ',
+ '',
+ ' ',
+ '',
+ ' ',
+ '',
+ ' ',
+ '',
+ ' '
+ ),
+ array(
+ 'a' => array(
+ 'herf' => array(),
+ ),
+ 'em' => array(),
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+ ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'em' => array(),
+ 'a' => array(
+ 'href' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+ ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'em' => array(),
+ 'a' => array(
+ 'href' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+ ',
+ '',
+ '',
+ ' '
+ ),
+ array(
+ 'em' => array(),
+ 'a' => array(
+ 'href' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+ .',
+ 'w3-total-cache'
+ ),
+ '',
+ ' ',
+ '',
+ ' '
+ ),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ ),
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+
:
+
+
+
+
+
+
+ $descriptors ) : ?>
+
+
:
+
+
+
+
+
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify.php
new file mode 100644
index 00000000..bc320bb1
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify.php
@@ -0,0 +1,1047 @@
+
+
+
+
+
+
+
+ _config->get_string( 'minify.engine' ) ),
+ '' . esc_html__( 'enabled', 'w3-total-cache' ) : 'disabled">' . esc_html__( 'disabled', 'w3-total-cache' ) ) . ' '
+ ),
+ array(
+ 'span' => array(
+ 'class' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+
+ '
+ ),
+ array(
+ 'input' => array(
+ 'type' => array(),
+ 'name' => array(),
+ 'value' => array(),
+ 'disabled' => array(),
+ 'class' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/ccjs.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/ccjs.php
new file mode 100644
index 00000000..b4bb7849
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/ccjs.php
@@ -0,0 +1,15 @@
+
+
+
+ _config->get_string( 'minify.ccjs.options.formatting' ), 'pretty_print' ); ?>
+ />
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/ccjs2.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/ccjs2.php
new file mode 100644
index 00000000..945e3d47
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/ccjs2.php
@@ -0,0 +1,73 @@
+ __( 'Whitespace only', 'w3-total-cache' ),
+ 'SIMPLE_OPTIMIZATIONS' => __( 'Simple optimizations', 'w3-total-cache' ),
+ 'ADVANCED_OPTIMIZATIONS' => __( 'Advanced optimizations', 'w3-total-cache' ),
+);
+
+$c = $this->_config;
+$compilation_level = $c->get_string( 'minify.ccjs.options.compilation_level' );
+
+?>
+
+
+
+
+
+
+
+
+ name="minify__ccjs__path__java"
+ value="get_string( 'minify.ccjs.path.java' ), 'w3-total-cache' ); ?>"
+ size="60" />
+
+
+
+
+
+
+
+
+
+
+ name="minify__ccjs__path__jar"
+ value="get_string( 'minify.ccjs.path.jar' ), 'w3-total-cache' ); ?>"
+ size="60" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ $compilation_level_name ): ?>
+ >
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/css.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/css.php
new file mode 100644
index 00000000..ebe66008
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/css.php
@@ -0,0 +1,36 @@
+_config );
+
+?>
+checkbox( 'minify.css.strip.comments', false, 'css_' ) ?>
+checkbox( 'minify.css.strip.crlf', false, 'css_' ) ?>
+
+ 'minify.css.embed',
+ 'control' => 'checkbox',
+ 'checkbox_label' => __( 'Eliminate render-blocking
CSS by moving it to
HTTP body', 'w3-total-cache' ),
+ 'disabled' => ( $is_pro ? null : true ),
+ 'label_class' => 'w3tc_no_trtd',
+ 'excerpt' => __( 'Website visitors cannot navigate your website until a given page is ready - reduce the wait time with this feature.', 'w3-total-cache' ),
+ 'description' => array(
+ __( 'Faster paint time is a key last step in lowering bounce rates even for repeat page views. Enable this feature to significantly enhance your website’s user experience by reducing wait times and ensuring that users can interact with your website as quickly as possible.', 'w3-total-cache' ),
+ wp_kses(
+ sprintf(
+ // translators: 1 The opening anchor tag linking to our support page, 2 its closing tag.
+ __( 'Need help? Take a look at our %1$spremium support, customization and audit services%2$s.', 'w3-total-cache' ),
+ '
',
+ ' '
+ ),
+ array( 'a' => array( 'href' => array() ) )
+ ),
+ ),
+ ) );
+?>
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/csstidy.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/csstidy.php
new file mode 100644
index 00000000..62ed69fb
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/csstidy.php
@@ -0,0 +1,36 @@
+_config->get_string( 'minify.csstidy.options.css_level' );
+?>
+checkbox( 'minify.csstidy.options.remove_bslash', false, 'css_' ); ?>
+checkbox( 'minify.csstidy.options.compress_colors', false, 'css_' ); ?>
+checkbox( 'minify.csstidy.options.compress_font-weight', false, 'css_' ); ?>
+checkbox( 'minify.csstidy.options.lowercase_s', false, 'css_' ); ?>
+checkbox( 'minify.csstidy.options.remove_last_;', false, 'css_' ); ?>
+checkbox( 'minify.csstidy.options.remove_space_before_important', false, 'css_' ); ?>
+checkbox( 'minify.csstidy.options.sort_properties', false, 'css_' ); ?>
+checkbox( 'minify.csstidy.options.sort_selectors', false, 'css_' ); ?>
+checkbox( 'minify.csstidy.options.discard_invalid_selectors', false, 'css_' ); ?>
+checkbox( 'minify.csstidy.options.discard_invalid_properties', false, 'css_' ); ?>
+
>
+
+ >
+
+
+
+
+checkbox( 'minify.csstidy.options.preserve_css', false, 'css_' ); ?>
+checkbox( 'minify.csstidy.options.timestamp', false, 'css_' ); ?>
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/csstidy2.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/csstidy2.php
new file mode 100644
index 00000000..c81e6d48
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/csstidy2.php
@@ -0,0 +1,89 @@
+ __( 'Highest (no readability, smallest size)', 'w3-total-cache' ),
+ 'high_compression' => __( 'High (moderate readability, smaller size)', 'w3-total-cache' ),
+ 'default' => __( 'Standard (balance between readability and size)', 'w3-total-cache' ),
+ 'low_compression' => __( 'Low (higher readability)', 'w3-total-cache' ),
+);
+
+$optimise_shorthands_values = array(
+ 0 => __( 'Don\'t optimise', 'w3-total-cache' ),
+ 1 => __( 'Safe optimisations', 'w3-total-cache' ),
+ 2 => __( 'Level II optimisations', 'w3-total-cache' ),
+ 3 => __( 'All optimisations', 'w3-total-cache' ),
+);
+
+$case_properties_values = array(
+ 0 => __( 'None', 'w3-total-cache' ),
+ 1 => __( 'Lowercase', 'w3-total-cache' ),
+ 2 => __( 'Uppercase', 'w3-total-cache' ),
+);
+
+$merge_selectors_values = array(
+ 0 => __( 'Do not change anything', 'w3-total-cache' ),
+ 1 => __( 'Only seperate selectors (split at ,)', 'w3-total-cache' ),
+ 2 => __( 'Merge selectors with the same properties (fast)', 'w3-total-cache' ),
+);
+
+$csstidy_template = $this->_config->get_string( 'minify.csstidy.options.template' );
+$optimise_shorthands = $this->_config->get_integer( 'minify.csstidy.options.optimise_shorthands' );
+$case_properties = $this->_config->get_integer( 'minify.csstidy.options.case_properties' );
+$merge_selectors = $this->_config->get_integer( 'minify.csstidy.options.merge_selectors' );
+?>
+
+
+
+ >
+ $csstidy_template_name ) : ?>
+ >
+
+
+
+
+
+
+
+
+
+ name="minify__csstidy__options__optimise_shorthands">
+ $optimise_shorthands_name ) : ?>
+ >
+
+
+
+
+
+
+
+
+
+ name="minify__csstidy__options__case_properties">
+ $case_properties_name ) : ?>
+ >
+
+
+
+
+
+
+
+
+ name="minify__csstidy__options__merge_selectors">
+ $merge_selectors_name ) : ?>
+ >
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/googleccjs2.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/googleccjs2.php
new file mode 100644
index 00000000..efe68630
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/googleccjs2.php
@@ -0,0 +1,48 @@
+ __( 'Whitespace only', 'w3-total-cache' ),
+ 'SIMPLE_OPTIMIZATIONS' => __( 'Simple optimizations', 'w3-total-cache' ),
+ 'ADVANCED_OPTIMIZATIONS' => __( 'Advanced optimizations', 'w3-total-cache' ),
+);
+
+$compilation_level = $this->_config->get_string( 'minify.ccjs.options.compilation_level' );
+?>
+
+
+
+
+
+
+
+
+
+
+ >
+ $compilation_level_name ) : ?>
+ >
+
+
+
+
+
+
+
+
+
+
+
+ _config->get_string( 'minify.ccjs.options.formatting' ), 'pretty_print' ); ?>
+ />
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/html.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/html.php
new file mode 100644
index 00000000..050ff8e3
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/html.php
@@ -0,0 +1,8 @@
+
+checkbox( 'minify.html.strip.crlf', false, 'html_' ) ?>
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/htmltidy.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/htmltidy.php
new file mode 100644
index 00000000..7a696ad1
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/htmltidy.php
@@ -0,0 +1,9 @@
+
+checkbox( 'minify.htmltidy.options.clean', false, 'html_' ) ?>
+checkbox( 'minify.htmltidy.options.hide-comments', false, 'html_' ) ?>
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/htmltidy2.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/htmltidy2.php
new file mode 100644
index 00000000..7257461c
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/htmltidy2.php
@@ -0,0 +1,14 @@
+
+
+
+
+ name="minify__htmltidy__options__wrap" value="_config->get_integer( 'minify.htmltidy.options.wrap' ) ); ?>" size="8" style="text-align: right;" /> _e('symbols (set to 0 to disable)', 'w3-total-cache'); ?>
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/index.html b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/index.html
new file mode 100644
index 00000000..e69de29b
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/js.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/js.php
new file mode 100644
index 00000000..bd896299
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/js.php
@@ -0,0 +1,9 @@
+
+checkbox( 'minify.js.strip.comments', false, 'js_' ) ?>
+checkbox( 'minify.js.strip.crlf', false, 'js_' ) ?>
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/yuicss2.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/yuicss2.php
new file mode 100644
index 00000000..9c93693b
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/yuicss2.php
@@ -0,0 +1,55 @@
+_config;
+
+?>
+
+
+
+
+
+
+
+
+ name="minify__yuicss__path__java" value="get_string( 'minify.yuicss.path.java' ) ); ?>"
+ size="100" />
+
+
+
+
+
+
+ name="minify__yuicss__path__jar"
+ value="get_string( 'minify.yuicss.path.jar' ) ); ?>"
+ size="100" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ type="text" name="minify__yuicss__options__line-break"
+ value="get_integer( 'minify.yuicss.options.line-break' ) ); ?>"
+ size="8" style="text-align: right" /> symbols (set to 0 to disable)
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/yuijs.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/yuijs.php
new file mode 100644
index 00000000..7b87312d
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/yuijs.php
@@ -0,0 +1,10 @@
+
+checkbox( 'minify.yuijs.options.nomunge', false, 'js_' ) ?>
+checkbox( 'minify.yuijs.options.preserve-semi', false, 'js_' ) ?>
+checkbox( 'minify.yuijs.options.disable-optimizations', false, 'js_' ) ?>
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/yuijs2.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/yuijs2.php
new file mode 100644
index 00000000..76e91ace
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/minify/yuijs2.php
@@ -0,0 +1,42 @@
+
+
+
+
+ name="minify__yuijs__path__java"
+ value="_config->get_string( 'minify.yuijs.path.java' ) ); ?>"
+ size="100" />
+
+
+
+
+
+ name="minify__yuijs__path__jar"
+ value="_config->get_string( 'minify.yuijs.path.jar' ) ); ?>"
+ size="100" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+ name="minify__yuijs__options__line-break" value="_config->get_integer( 'minify.yuijs.options.line-break' ) ); ?>"
+ size="8" style="text-align: right;" />
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/objectcache.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/objectcache.php
new file mode 100644
index 00000000..18d11af4
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/objectcache.php
@@ -0,0 +1,120 @@
+
+
+
+
+ ' . Cache::engine_name( $this->_config->get_string( 'objectcache.engine' ) ) . '',
+ '' . esc_html__( 'enabled', 'w3-total-cache' ) : 'disabled">' . esc_html__( 'disabled', 'w3-total-cache' ) ) . ( ! $this->_config->getf_boolean( 'objectcache.enabled' ) && has_filter( 'w3tc_config_item_objectcache.enabled' ) ? esc_html__( ' via filter', 'w3-total-cache' ) : '' ) . ' '
+ ),
+ array(
+ 'strong' => array(),
+ 'span' => array(
+ 'class' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/parts/dashboard_banner.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/parts/dashboard_banner.php
new file mode 100644
index 00000000..640c6515
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/parts/dashboard_banner.php
@@ -0,0 +1,61 @@
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/parts/memcached.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/parts/memcached.php
new file mode 100644
index 00000000..00e7dd2d
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/parts/memcached.php
@@ -0,0 +1,146 @@
+
+
+ array( 'title' => array() ) ) ); ?>
+
+ rows="10" cols="50">_config->get_array( $module . '.memcached.servers' ) ) ); ?>
+
+ type="button" value="" />
+
+
+
+
+
+
+
+ checkbox( $module . '.memcached.persistent' ); ?> array( 'title' => array() ) ) ); ?>
+
+
+
+
+
+
+
+ checkbox( $module . '.memcached.aws_autodiscovery', ! Util_Installed::memcached_aws() ); ?>
+ Amazon Node Auto Discovery
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ } else {
+ esc_html_e( 'When Amazon ElastiCache used, specify configuration endpoint as Memcached host', 'w3-total-cache' );
+ }
+ ?>
+
+
+
+
+
+
+ checkbox( $module . '.memcached.binary_protocol' ); ?> array( 'title' => array() ) ) ); ?>
+
+
+
+
+
+ array( 'title' => array() ) )); ?>
+
+
+ value_with_disabled( $module . '.memcached.username', ! Util_Installed::memcached_auth(), '' ); ?> />
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ if ( ! Util_Installed::memcached_auth() ) {
+ echo wp_kses(
+ sprintf(
+ // translators: 1 HTML line break, 2 opening HTML acronym tag, 3 closing HTML acronym tag.
+ __(
+ '%1$sAvailable when memcached extension installed, built with %2$sSASL%3$s',
+ 'w3-total-cache'
+ ),
+ ' br>',
+ '',
+ ' '
+ ),
+ array(
+ 'br' => array(),
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ }
+ ?>
+
+
+
+
+ array( 'title' => array() ) ) ); ?>
+
+
+ value_with_disabled( $module . '.memcached.password', ! Util_Installed::memcached_auth(), '' ); ?> />
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/parts/memcached_extension.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/parts/memcached_extension.php
new file mode 100644
index 00000000..8c3c53bd
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/parts/memcached_extension.php
@@ -0,0 +1,76 @@
+
+
+ array( 'title' => array() ) ) ); ?>
+
+ rows="10" cols="50">get_array( array( $module, 'memcached.servers' ) ) ) ); ?>
+
+ type="button" value="" />
+
+
+
+
+ array( $module, 'memcached.persistent' ),
+ 'label' => __( 'Use persistent connection:', 'w3-total-cache' ),
+ 'control' => 'checkbox',
+ 'checkbox_label' => Util_ConfigLabel::get( 'memcached.persistent' ),
+ 'description' => __( 'Using persistent connection doesn\'t reinitialize memcached driver on each request', 'w3-total-cache' ),
+ )
+);
+
+Util_Ui::config_item(
+ array(
+ 'key' => array( $module, 'memcached.aws_autodiscovery' ),
+ 'label' => __( 'Node Auto Discovery:', 'w3-total-cache' ),
+ 'control' => 'checkbox',
+ 'checkbox_label' => 'Amazon Node Auto Discovery',
+ 'disabled' => ( Util_Installed::memcached_aws() ? null : true ),
+ 'description' =>
+ ( ! Util_Installed::memcached_aws() ?
+ __( 'ElastiCache
PHP module not found', 'w3-total-cache' ) :
+ __( 'When Amazon ElastiCache used, specify configuration endpoint as Memecached host', 'w3-total-cache' )
+ ),
+ )
+);
+
+Util_Ui::config_item(
+ array(
+ 'key' => array( $module, 'memcached.username' ),
+ 'label' => Util_ConfigLabel::get( 'memcached.username' ),
+ 'control' => 'textbox',
+ 'disabled' => ( Util_Installed::memcache_auth() ? null : true ),
+ 'description' =>
+ __( 'Specify memcached username, when
SASL authentication used', 'w3-total-cache' ) .
+ ( Util_Installed::memcache_auth() ? '' :
+ __( '
Available when memcached extension installed, built with
SASL ', 'w3-total-cache' )
+ ),
+ )
+);
+
+Util_Ui::config_item(
+ array(
+ 'key' => array( $module, 'memcached.password' ),
+ 'label' => Util_ConfigLabel::get( 'memcached.password' ),
+ 'control' => 'textbox',
+ 'disabled' => ( Util_Installed::memcache_auth() ? null : true ),
+ 'description' => __( 'Specify memcached password, when
SASL authentication used', 'w3-total-cache' ),
+ )
+);
+
+?>
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/parts/redis.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/parts/redis.php
new file mode 100644
index 00000000..6bc831e1
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/parts/redis.php
@@ -0,0 +1,124 @@
+
+
+ array( 'title' => array() ) ) ); ?>
+
+ rows="10" cols="50">_config->get_array( $module . '.redis.servers' ) ) ); ?>
+
+ type="button" value="" />
+
+
+
+
+=' ) ) {
+ ?>
+
+
+
+ checkbox( $module . '.redis.verify_tls_certificates' ); ?> array( 'title' => array() ) ) ); ?>
+
+
+
+
+
+
+
+ checkbox( $module . '.redis.persistent' ); ?> array( 'title' => array() ) ) ); ?>
+
+
+
+
+ array( 'title' => array() ) ) ); ?>
+
+
+ value="_config->get_integer( $module . '.redis.timeout' ) ); ?>"
+ size="8" step="1" min="0" />
+
+
+
+
+ array( 'title' => array() ) ) ); ?>
+
+
+ value="_config->get_integer( $module . '.redis.retry_interval' ) ); ?>"
+ size="8" step="100" min="0" />
+
+
+
+=' ) ) {
+ ?>
+
+ array( 'title' => array() ) ) ); ?>
+
+
+ value="_config->get_integer( $module . '.redis.read_timeout' ) ); ?>"
+ size="8" step="1" min="0" />
+
+
+
+
+
+ array( 'title' => array() ) ) ); ?>
+
+
+ value="_config->get_integer( $module . '.redis.dbid' ) ); ?>"
+ size="8" />
+
+
+
+
+ array( 'title' => array() ) ) ); ?>
+
+
+ value_with_disabled( $module . '.redis.password', false, '' ); ?> />
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/parts/redis_extension.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/parts/redis_extension.php
new file mode 100644
index 00000000..47c30775
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/parts/redis_extension.php
@@ -0,0 +1,102 @@
+
+
+ array( 'title' => array() ) ) ); ?>
+
+ rows="10" cols="50">get_array( array( $module, 'redis.servers' ) ) ) ); ?>
+
+ type="button" value="" />
+
+
+
+
+ array( $module, 'redis.verify_tls_certificates' ),
+ 'label' => Util_ConfigLabel::get( 'redis.verify_tls_certificates' ),
+ 'control' => 'checkbox',
+ 'checkbox_label' => Util_ConfigLabel::get( 'redis.verify_tls_certificates' ),
+ 'description' => __( 'Verify the server\'s certificate when connecting via TLS.', 'w3-total-cache' ),
+ )
+);
+
+Util_Ui::config_item(
+ array(
+ 'key' => array( $module, 'redis.persistent' ),
+ 'label' => __( 'Use persistent connection:', 'w3-total-cache' ),
+ 'control' => 'checkbox',
+ 'checkbox_label' => Util_ConfigLabel::get( 'redis.persistent' ),
+ 'description' => __( 'Using persistent connection doesn\'t reinitialize memcached driver on each request', 'w3-total-cache' ),
+ )
+);
+
+Util_Ui::config_item(
+ array(
+ 'key' => array( $module, 'redis.timeout' ),
+ 'label' => Util_ConfigLabel::get( 'redis.timeout' ),
+ 'control' => 'textbox',
+ 'textbox_type' => 'number',
+ 'description' => __( 'In seconds', 'w3-total-cache' ),
+ )
+);
+
+Util_Ui::config_item(
+ array(
+ 'key' => array( $module, 'redis.retry_interval' ),
+ 'label' => Util_ConfigLabel::get( 'redis.retry_interval' ),
+ 'control' => 'textbox',
+ 'textbox_type' => 'number',
+ 'description' => __( 'In miliseconds', 'w3-total-cache' ),
+ )
+);
+
+if ( version_compare( phpversion( 'redis' ), '5', '>=' ) ) {
+ // PHP Redis 5 supports the read_timeout setting.
+ Util_Ui::config_item(
+ array(
+ 'key' => array( $module, 'redis.read_timeout' ),
+ 'label' => Util_ConfigLabel::get( 'redis.read_timeout' ),
+ 'control' => 'textbox',
+ 'textbox_type' => 'number',
+ 'description' => __( 'In seconds', 'w3-total-cache' ),
+ )
+ );
+}
+
+Util_Ui::config_item(
+ array(
+ 'key' => array( $module, 'redis.dbid' ),
+ 'label' => Util_ConfigLabel::get( 'redis.dbid' ),
+ 'control' => 'textbox',
+ 'description' => __( 'Database ID to use', 'w3-total-cache' ),
+ )
+);
+
+Util_Ui::config_item(
+ array(
+ 'key' => array( $module, 'redis.password' ),
+ 'label' => Util_ConfigLabel::get( 'redis.password' ),
+ 'control' => 'textbox',
+ 'description' => __( 'Specify redis password', 'w3-total-cache' ),
+ )
+);
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/pgcache.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/pgcache.php
new file mode 100644
index 00000000..86e25869
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/pgcache.php
@@ -0,0 +1,857 @@
+
+
+
+
+ ' . esc_html( Cache::engine_name( $this->_config->get_string( 'pgcache.engine' ) ) ) . '',
+ '' . esc_html__( 'enabled', 'w3-total-cache' ) : 'disabled">' . esc_html__( 'disabled', 'w3-total-cache' ) ) . ' .'
+ ),
+ array(
+ 'strong' => array(),
+ 'span' => array(
+ 'class' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/support.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/support.php
new file mode 100644
index 00000000..def5c5f1
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/options/support.php
@@ -0,0 +1,30 @@
+
+
+
+
+
To complete your support request fill out the form below!
+
+
+
+
+
+
+
+ _request_types[ $request_type ] ) ) {
+ $this->w3tc_support_select();
+ } else {
+ if ( isset( $this->_request_prices[ $request_type ] ) && ! $payment ) {
+ $this->w3tc_support_payment();
+ } else {
+ $this->w3tc_support_form();
+ }
+ }
+ ?>
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/cdn_export_file.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/cdn_export_file.php
new file mode 100644
index 00000000..15ee620d
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/cdn_export_file.php
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+ -
+
+
+
+ -
+
+
+
+ -
+
+
+
+
+ />
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/cdn_export_library.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/cdn_export_library.php
new file mode 100644
index 00000000..3d229b27
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/cdn_export_library.php
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+ -
+
+
+
+ -
+
+
+
+ -
+
+
+
+
+ />
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/cdn_import_library.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/cdn_import_library.php
new file mode 100644
index 00000000..0772e978
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/cdn_import_library.php
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+
+
+
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/cdn_purge.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/cdn_purge.php
new file mode 100644
index 00000000..f44ea048
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/cdn_purge.php
@@ -0,0 +1,86 @@
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+ _config->get_string( 'cdn.engine' ) ) :
+ case 'cotendo':
+ ?>
+
+ /images/headers/ —
+ /images/headers/*. —
+ /images/headers/*.jpg —
+ /images/headers/path —
+ /images/headers/path.jpg —
+ /images/headers/path.jpg?* —
+ /images/headers/path.jpg?key=value —
+
+
+
/images/headers/path.jpg
+
+
+
+
+
+
+
+
+
+
+ array(
+ 'type' => array(),
+ 'name' => array(),
+ 'value' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/cdn_queue.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/cdn_queue.php
new file mode 100644
index 00000000..0e10eec4
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/cdn_queue.php
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+ local_path ); ?>
+ remote_path ); ?>
+ last_error ); ?>
+ date ); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+ local_path ); ?>
+ remote_path ); ?>
+ last_error ); ?>
+ date ); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
>
+
+
+
+
+
+
+
+
+
+
+
+ local_path ); ?>
+ remote_path ); ?>
+ last_error ); ?>
+ date ); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/cdn_rename_domain.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/cdn_rename_domain.php
new file mode 100644
index 00000000..79b9bd7f
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/cdn_rename_domain.php
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+ ',
+ ''
+ ),
+ array(
+ 'acronym' => array(
+ 'title' => array(),
+ ),
+ )
+ );
+ ?>
+
+
+
+
+
+
+
+
+ 0
+
+
+
+ -
+
+
+
+ -
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+ />
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/common/footer.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/common/footer.php
new file mode 100644
index 00000000..faf65ca4
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/common/footer.php
@@ -0,0 +1,3 @@
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/common/header.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/common/header.php
new file mode 100644
index 00000000..52f3c150
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/common/header.php
@@ -0,0 +1,48 @@
+
+
+ >
+
+
+
+
+
+ - W3 Total Cache
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/common/index.html b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/common/index.html
new file mode 100644
index 00000000..e69de29b
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/index.html b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/popup/index.html
new file mode 100644
index 00000000..e69de29b
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/widget/index.html b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/widget/index.html
new file mode 100644
index 00000000..e69de29b
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/widget/latest.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/widget/latest.php
new file mode 100644
index 00000000..5a4ad906
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/widget/latest.php
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/widget/latest_ajax.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/widget/latest_ajax.php
new file mode 100644
index 00000000..0ce40955
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/widget/latest_ajax.php
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ View Feed
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/widget/latest_control.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/widget/latest_control.php
new file mode 100644
index 00000000..af8646c0
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/widget/latest_control.php
@@ -0,0 +1,13 @@
+
+
+
+ How many items would you like to display?
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/widget/latest_news.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/widget/latest_news.php
new file mode 100644
index 00000000..0a724dd6
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/widget/latest_news.php
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/widget/latest_news_ajax.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/widget/latest_news_ajax.php
new file mode 100644
index 00000000..7215fd01
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/widget/latest_news_ajax.php
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ View Feed
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/widget/latest_news_control.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/widget/latest_news_control.php
new file mode 100644
index 00000000..5df15092
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/widget/latest_news_control.php
@@ -0,0 +1,13 @@
+
+
+
+ How many items would you like to display?
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/wizard/template.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/wizard/template.php
new file mode 100644
index 00000000..9a58205c
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/inc/wizard/template.php
@@ -0,0 +1,304 @@
+config = $config;
+
+ $this->add_hooks();
+ }
+
+ /**
+ * Render the wizard.
+ *
+ * @since 2.0.0
+ */
+ public function render() {
+ $allowed_html = array(
+ 'a' => array(
+ 'href' => array(),
+ 'id' => array(),
+ 'target' => array(),
+ ),
+ 'br' => array(),
+ 'div' => array(
+ 'class' => array(),
+ 'id' => array(),
+ ),
+ 'em' => array(),
+ 'h3' => array(),
+ 'input' => array(
+ 'checked' => array(),
+ 'class' => array(),
+ 'data-choice' => array(),
+ 'id' => array(),
+ 'name' => array(),
+ 'type' => array(),
+ 'value' => array(),
+ ),
+ 'label' => array(
+ 'for' => array(),
+ ),
+ 'p' => array(
+ 'class' => array(),
+ 'id' => array(),
+ ),
+ 'span' => array(
+ 'class' => array(),
+ 'id' => array(),
+ ),
+ 'strong' => array(),
+ 'table' => array(
+ 'class' => array(),
+ 'id' => array(),
+ ),
+ 'tbody' => array(),
+ 'td' => array(),
+ 'th' => array(),
+ 'thead' => array(),
+ 'tr' => array(),
+ );
+
+ do_action( 'w3tc-dashboard-head' );
+ ?>
+
+
+
+
+
+
+
+
+
+
+ config['slides'] as $number => $slide ) {
+ $number++;
+ $element_id = 'w3tc-wizard-slide-' . ( isset( $slide['id'] ) ? $slide['id'] : $number );
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ config['actions'] ) && is_array( $this->config['actions'] ) ) {
+ foreach ( $this->config['actions'] as $action ) {
+ add_action(
+ $action['tag'],
+ $action['function'],
+ empty( $action['priority'] ) ? 10 : $action['priority'],
+ empty( $action['accepted_args'] ) ? 1 : $action['accepted_args']
+ );
+ }
+ }
+
+ if ( isset( $this->config['filters'] ) && is_array( $this->config['filters'] ) ) {
+ foreach ( $this->config['filters'] as $filter ) {
+ add_filter(
+ $filter['tag'],
+ $filter['function'],
+ empty( $filter['priority'] ) ? 10 : $filter['priority'],
+ empty( $filter['accepted_args'] ) ? 1 : $filter['accepted_args']
+ );
+ }
+ }
+ }
+
+ /**
+ * Rnqueue scripts.
+ *
+ * @since 2.0.0
+ */
+ public function enqueue_scripts() {
+ wp_enqueue_script(
+ 'w3tc_wizard',
+ esc_url( plugin_dir_url( dirname( dirname( __FILE__ ) ) ) . 'pub/js/wizard.js' ),
+ array( 'jquery' ),
+ W3TC_VERSION,
+ false
+ );
+
+ wp_localize_script(
+ 'w3tc_wizard',
+ 'W3TC_Wizard',
+ array(
+ 'beforeunloadText' => __( 'Are you sure that you want to leave this page?', 'w3-total-cache' ),
+ )
+ );
+
+ wp_enqueue_script( 'w3tc_wizard' );
+
+ if ( isset( $this->config['scripts'] ) && is_array( $this->config['scripts'] ) ) {
+ foreach ( $this->config['scripts'] as $script ) {
+ wp_register_script(
+ $script['handle'],
+ $script['src'],
+ is_array( $script['deps'] ) ? $script['deps'] : array(),
+ empty( $script['version'] ) ? gmdate( 'YmdHm' ) : $script['version'],
+ ! empty( $script['in_footer'] )
+ );
+
+ if ( isset( $script['localize'] ) && is_array( $script['localize'] ) ) {
+ wp_localize_script(
+ $script['handle'],
+ $script['localize']['object_name'],
+ (array) $script['localize']['data']
+ );
+ }
+
+ wp_enqueue_script( $script['handle'] );
+ }
+ }
+ }
+
+ /**
+ * Enqueue styles.
+ *
+ * @since 2.0.0
+ */
+ public function enqueue_styles() {
+ wp_enqueue_style(
+ 'w3tc_wizard',
+ esc_url( plugin_dir_url( dirname( dirname( __FILE__ ) ) ) . 'pub/css/wizard.css' ),
+ array(),
+ W3TC_VERSION
+ );
+
+ if ( isset( $this->config['styles'] ) && is_array( $this->config['styles'] ) ) {
+ foreach ( $this->config['styles'] as $style ) {
+ wp_enqueue_style(
+ $style['handle'],
+ $style['src'],
+ isset( $style['deps'] ) && is_array( $style['deps'] ) ?
+ $style['deps'] : array(),
+ ! empty( $style['version'] ) ? $style['version'] : gmdate( 'YmdHm' ),
+ ! empty( $style['media'] ) ? $style['media'] : 'all'
+ );
+ }
+ }
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/index.html b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/index.html
new file mode 100644
index 00000000..e69de29b
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/apache_conf/mod_deflate.conf b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/apache_conf/mod_deflate.conf
new file mode 100644
index 00000000..851ea901
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/apache_conf/mod_deflate.conf
@@ -0,0 +1,48 @@
+# ----------------------------------------------------------------------
+# Gzip compression
+# Compress content before it is delivered to the client
+# http://httpd.apache.org/docs/2.0/mod/mod_deflate.html
+# ----------------------------------------------------------------------
+
+
+# Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
+
+
+SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
+ RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
+
+
+
+
+ # HTML, TXT, CSS, JavaScript, JSON, XML, HTC:
+ FilterDeclare COMPRESS
+ FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$text/html'"
+ FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$text/css'"
+ FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$text/plain'"
+ FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$text/xml'"
+ FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$text/x-component'"
+ FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$application/javascript'"
+ FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$application/json'"
+ FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$application/xml'"
+ FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$application/xhtml+xml'"
+ FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$application/rss+xml'"
+ FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$application/atom+xml'"
+ FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$application/vnd.ms-fontobject'"
+ FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$image/svg+xml'"
+ FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$image/x-icon'"
+ FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$application/x-font-ttf'"
+ FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$font/opentype'"
+ FilterChain COMPRESS
+ FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no
+
+
+
+ # Legacy versions of Apache
+ AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
+ AddOutputFilterByType DEFLATE application/javascript
+ AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
+ AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
+ AddOutputFilterByType DEFLATE image/x-icon image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
+
+
+
\ No newline at end of file
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/apache_conf/mod_expires.conf b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/apache_conf/mod_expires.conf
new file mode 100644
index 00000000..ea81baea
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/apache_conf/mod_expires.conf
@@ -0,0 +1,96 @@
+# ----------------------------------------------------------------------
+# Cache Control via HTTP Headers + Expires
+# Generation of Expires and Cache-Control HTTP headers according to user-specified criteria
+# http://httpd.apache.org/docs/2.0/mod/mod_headers.html
+# ----------------------------------------------------------------------
+
+# Expires Defaults
+
+ExpiresActive On
+# Set default expires to 2 days
+ExpiresDefault A172800
+ExpiresByType text/css A31536000
+ExpiresByType application/x-javascript A31536000
+ExpiresByType text/x-component A31536000
+ExpiresByType text/html A3600
+ExpiresByType text/richtext A3600
+ExpiresByType image/svg+xml A3600
+ExpiresByType text/plain A3600
+ExpiresByType text/xsd A3600
+ExpiresByType text/xsl A3600
+ExpiresByType text/xml A3600
+ExpiresByType video/asf A31536000
+ExpiresByType video/avi A31536000
+ExpiresByType image/bmp A31536000
+ExpiresByType application/java A31536000
+ExpiresByType video/divx A31536000
+ExpiresByType application/msword A31536000
+ExpiresByType application/vnd.ms-fontobject A31536000
+ExpiresByType application/x-msdownload A31536000
+ExpiresByType image/gif A31536000
+ExpiresByType application/x-gzip A31536000
+ExpiresByType image/x-icon A31536000
+ExpiresByType image/jpeg A31536000
+ExpiresByType application/vnd.ms-access A31536000
+ExpiresByType audio/midi A31536000
+ExpiresByType video/quicktime A31536000
+ExpiresByType audio/mpeg A31536000
+ExpiresByType video/mp4 A31536000
+ExpiresByType video/ogg A31536000
+ExpiresByType video/mpeg A31536000
+ExpiresByType application/vnd.ms-project A31536000
+ExpiresByType application/x-font-otf A31536000
+ExpiresByType application/vnd.oasis.opendocument.database A31536000
+ExpiresByType application/vnd.oasis.opendocument.chart A31536000
+ExpiresByType application/vnd.oasis.opendocument.formula A31536000
+ExpiresByType application/vnd.oasis.opendocument.graphics A31536000
+ExpiresByType application/vnd.oasis.opendocument.presentation A31536000
+ExpiresByType application/vnd.oasis.opendocument.spreadsheet A31536000
+ExpiresByType application/vnd.oasis.opendocument.text A31536000
+ExpiresByType audio/ogg A31536000
+ExpiresByType application/pdf A31536000
+ExpiresByType image/png A31536000
+ExpiresByType application/vnd.ms-powerpoint A31536000
+ExpiresByType audio/x-realaudio A31536000
+ExpiresByType image/svg+xml A31536000
+ExpiresByType application/x-shockwave-flash A31536000
+ExpiresByType application/x-tar A31536000
+ExpiresByType image/tiff A31536000
+ExpiresByType application/x-font-ttf A31536000
+ExpiresByType audio/wav A31536000
+ExpiresByType audio/wma A31536000
+ExpiresByType application/vnd.ms-write A31536000
+ExpiresByType application/vnd.ms-excel A31536000
+ExpiresByType application/zip A31536000
+
+
+# No caching for dynamic files
+
+ExpiresDefault A0
+Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0"
+Header set Pragma "no-cache"
+
+
+# 1 MIN
+
+ExpiresDefault A60
+Header set Cache-Control "max-age=60, must-revalidate"
+
+
+# 2 DAYS
+
+ExpiresDefault A172800
+Header set Cache-Control "max-age=172800, must-revalidate"
+
+
+# 1 WEEK
+
+ExpiresDefault A604800
+Header set Cache-Control "max-age=604800, must-revalidate"
+
+
+# 1 MONTH
+
+ExpiresDefault A2419200
+Header set Cache-Control "max-age=2419200, must-revalidate"
+
\ No newline at end of file
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/apache_conf/mod_mime.conf b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/apache_conf/mod_mime.conf
new file mode 100644
index 00000000..a2e8d76d
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/apache_conf/mod_mime.conf
@@ -0,0 +1,60 @@
+# ----------------------------------------------------------------------
+# Mime Types
+# Mime Associates the requested filename's extensions with the file's behavior and content
+# http://httpd.apache.org/docs/2.0/mod/mod_mime.html
+# ----------------------------------------------------------------------
+
+
+ AddType text/css .css
+ AddType application/x-javascript .js
+ AddType text/x-component .htc
+ AddType text/html .html .htm
+ AddType text/richtext .rtf .rtx
+ AddType image/svg+xml .svg .svgz
+ AddType text/plain .txt
+ AddType text/xsd .xsd
+ AddType text/xsl .xsl
+ AddType text/xml .xml
+ AddType video/asf .asf .asx .wax .wmv .wmx
+ AddType video/avi .avi
+ AddType image/bmp .bmp
+ AddType application/java .class
+ AddType video/divx .divx
+ AddType application/msword .doc .docx
+ AddType application/vnd.ms-fontobject .eot
+ AddType application/x-msdownload .exe
+ AddType image/gif .gif
+ AddType application/x-gzip .gz .gzip
+ AddType image/x-icon .ico
+ AddType image/jpeg .jpg .jpeg .jpe
+ AddType application/vnd.ms-access .mdb
+ AddType audio/midi .mid .midi
+ AddType video/quicktime .mov .qt
+ AddType audio/mpeg .mp3 .m4a
+ AddType video/mp4 .mp4 .m4v
+ AddType video/ogg .ogv
+ AddType video/mpeg .mpeg .mpg .mpe
+ AddType application/vnd.ms-project .mpp
+ AddType application/x-font-otf .otf
+ AddType application/vnd.oasis.opendocument.database .odb
+ AddType application/vnd.oasis.opendocument.chart .odc
+ AddType application/vnd.oasis.opendocument.formula .odf
+ AddType application/vnd.oasis.opendocument.graphics .odg
+ AddType application/vnd.oasis.opendocument.presentation .odp
+ AddType application/vnd.oasis.opendocument.spreadsheet .ods
+ AddType application/vnd.oasis.opendocument.text .odt
+ AddType audio/ogg .ogg
+ AddType application/pdf .pdf
+ AddType image/png .png
+ AddType application/vnd.ms-powerpoint .pot .pps .ppt .pptx
+ AddType audio/x-realaudio .ra .ram
+ AddType application/x-shockwave-flash .swf
+ AddType application/x-tar .tar
+ AddType image/tiff .tif .tiff
+ AddType application/x-font-ttf .ttf .ttc
+ AddType audio/wav .wav
+ AddType audio/wma .wma
+ AddType application/vnd.ms-write .wri
+ AddType application/vnd.ms-excel .xla .xls .xlsx .xlt .xlw
+ AddType application/zip .zip
+
\ No newline at end of file
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/apache_conf/mod_rewrite.conf b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/apache_conf/mod_rewrite.conf
new file mode 100644
index 00000000..3f681d5b
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/apache_conf/mod_rewrite.conf
@@ -0,0 +1,18 @@
+# ----------------------------------------------------------------------
+# Start rewrite engine
+# Provides a rule-based rewriting engine to rewrite requested URLs on the fly
+# http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
+# ----------------------------------------------------------------------
+
+# FollowSymLinks must be enabled for this to work
+
+ Options +FollowSymlinks
+ RewriteEngine On
+
+
+# Block access to "hidden" directories whose names begin with a period
+
+ RewriteCond %{SCRIPT_FILENAME} -d
+ RewriteCond %{SCRIPT_FILENAME} -f
+ RewriteRule "(^|/)\." - [F]
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/apc.ini b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/apc.ini
new file mode 100644
index 00000000..35a5af31
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/apc.ini
@@ -0,0 +1,31 @@
+; /etc/php.d/apc.ini
+
+extension = apc.so
+
+apc.enabled = 1
+apc.shm_segments = 1
+apc.shm_size = 32M
+apc.optimization = 0
+apc.num_files_hint = 4096
+apc.ttl = 7200
+apc.user_ttl = 7200
+apc.gc_ttl = 0
+apc.cache_by_default = 1
+apc.filters = ""
+apc.mmap_file_mask = "/tmp/apc.XXXXXX"
+apc.slam_defense = 0
+apc.file_update_protection = 2
+apc.enable_cli = 0
+apc.max_file_size = 10M
+apc.stat = 0
+apc.write_lock = 1
+apc.report_autofilter = 0
+apc.include_once_override = 0
+;apc.rfc1867 = 0
+;apc.rfc1867_prefix = "upload_"
+;apc.rfc1867_name = "APC_UPLOAD_PROGRESS"
+;apc.rfc1867_freq = 0
+apc.localcache = 0
+apc.localcache.size = 2048
+apc.coredump_unmap = 0
+apc.stat_ctime = 0
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/config-db-sample.php b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/config-db-sample.php
new file mode 100644
index 00000000..c2720232
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/config-db-sample.php
@@ -0,0 +1,39 @@
+ false,
+
+ /**
+ * check_tcp_responsiveness
+ *
+ * Enables checking TCP responsiveness by fsockopen prior to mysql_connect or
+ * mysql_pconnect. This was added because PHP's mysql functions do not provide
+ * a variable timeout setting. Disabling it may improve average performance by
+ * a very tiny margin but lose protection against connections failing slowly.
+ * Default: true
+ */
+ 'check_tcp_responsiveness' => true,
+
+ /**
+ * Default is to always (reads & writes) use the master db when user is in administration backend.
+ * Set use_master_in_backend to false to disable this behavior.
+ *
+ * WARNING: if your cluster has any replication delays then when this is enabled, you may not see
+ * any admin changes until the replication catches up with the change written to your master
+ * server and will see old content/configuration until that point in time - You should test this
+ * in your environment fully.
+ */
+ 'use_master_in_backend' => true,
+
+ /**
+ * This set the charset that the db connection should use.
+ * If DB_CHARSET is set there is no need to set $wpdb_cluster->charset.
+ */
+ 'charset' => DB_CHARSET,
+
+ /**
+ * This set the charset that the db connection should use.
+ * If DB_COLLATE is set there is no need to set $wpdb_cluster->collate.
+ */
+ 'collate' => DB_COLLATE,
+ /** Configuration Functions **/
+
+ /**
+ * database is an associative array with these parameters:
+ * host (required) Hostname with optional :port. Default port is 3306.
+ * user (required) MySQL user name.
+ * password (required) MySQL user password.
+ * name (required) MySQL database name.
+ * read (optional) Whether server is readable. Default is 1 (readable).
+ * Also used to assign preference.
+ * write (optional) Whether server is writable. Default is 1 (writable).
+ * Also used to assign preference in multi-master mode.
+ * dataset (optional) Name of dataset. Default is 'global'.
+ * timeout (optional) Seconds to wait for TCP responsiveness. Default is 0.2
+ * connect_function (optional) connection function to use
+ * zone (optional) name of zone where server is located.
+ * Used for web applications hosted on cluster
+ *
+ * Read & write
+ * A database definition can include 'read' and 'write' parameters. These
+ * operate as boolean switches but they are typically specified as integers.
+ * They allow or disallow use of the database for reading or writing.
+ *
+ * A master database might be configured to allow reading and writing:
+ * 'write' => true,
+ * 'read' => true,
+ * while a slave would be allowed only to read:
+ * 'write' => false,
+ * 'read' => true,
+ *
+ * It might be advantageous to disallow reading from the master, such as when
+ * there are many slaves available and the master is very busy with writes.
+ * 'write' => true,
+ * 'read' => false,
+ *
+ */
+ 'databases' => array(
+ 'master' => array(
+ 'host' => DB_HOST, // If port is other than 3306, use host:port.
+ 'user' => DB_USER,
+ 'password' => DB_PASSWORD,
+ 'name' => DB_NAME
+ )
+ ),
+
+ /**
+ * Zones (for web applications hosted on cluster)
+ *
+ * When your databases are located in separate physical locations there is
+ * typically an advantage to connecting to a nearby server instead of a more
+ * distant one. This can be configured by defining zones.
+ *
+ * Add 'zone' parameter to add_server call:
+ * 'zone' => 'A'
+ *
+ * Plugin determines where application is running by checking
+ * $_SERVER['SERVER_NAME'] system variable against defined in zone definition
+ * and then connects to servers following defined order:
+ * Value '*' can be used as 'server_names' item to indicate any server.
+ *
+ * 'zones' => array(
+ * 'zone_name' => array(
+ * 'server_names' => array('host1', 'host1.1'),
+ * 'zone_priorities' => array('A', 'B')
+ * )
+ * )
+ *
+ * As a result it will try to connect to servers in zone A first, then servers
+ * in zone B.
+ */
+ 'zones' => array(
+ ),
+
+ /**
+ * Filters
+ *
+ * Filters are executed on
event in the order in which they are
+ * registered until one of them returns something other than null.
+ *
+ * Tags:
+ * 'dataset' - fitler will be called with two arguments and expected to
+ * return a dataset to connect to
+ * $dataset = $callback($table, &$wpdb);
+ * 'blog_dataset' - fitler will be called with argument $blog_id and
+ * expected to return a dataset to connect to.
+ * Used when data are partitioned at blog level
+ * $dataset = $callback($blog_id);
+ *
+ * 'filters' => array(
+ * array(
+ * 'tag' => 'tag_to_add',
+ * 'function_to_add' => 'function_name'
+
+ * );
+ */
+ 'filters' => array(
+ )
+);
+
+
+
+/**
+ * This adds the same server again, only this time it is configured as a slave.
+ * The last three parameters are set to the defaults but are shown for clarity.
+ */
+/*
+$w3tc_dbcluster_config = array(
+ 'databases' => array(
+ 'master' => array(
+ 'host' => DB_HOST,
+ 'user' => DB_USER,
+ 'password' => DB_PASSWORD,
+ 'name' => DB_NAME
+ ),
+ 'slave' => array(
+ 'host' => DB_HOST,
+ 'user' => DB_USER,
+ 'password' => DB_PASSWORD,
+ 'name' => DB_NAME,
+ 'write' => false,
+ 'read' => true,
+ 'timeout' => 0.2,
+));
+*/
+
+/** Sample Configuration 2: Partitioning **/
+
+/**
+ * This example shows a setup where the multisite blog tables have been
+ * separated from the global dataset.
+ */
+/*
+$w3tc_dbcluster_config = array(
+ 'databases' => array(
+ 'master' => array(
+ 'host' => 'global.db.example.com',
+ 'user' => 'globaluser',
+ 'password' => 'globalpassword',
+ 'name' => 'globaldb',
+ ),
+ 'partition2' => array(
+ 'host' => 'blog.db.example.com',
+ 'user' => 'bloguser',
+ 'password' => 'blogpassword',
+ 'name' => 'blogdb',
+ 'dataset' => 'blog2',
+ ),
+ )
+ 'filters' => array(
+ array(
+ 'tag' => 'blog_dataset',
+ 'function_to_add' => 'my_db_callback'
+ )
+ )
+);
+
+function my_db_callback($blog_id, $wpdb_cluster) {
+ if ($blog_id > 5))
+ return 'blog2';
+}
+*/
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/eaccelerator.ini b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/eaccelerator.ini
new file mode 100644
index 00000000..a24b09c2
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/eaccelerator.ini
@@ -0,0 +1,26 @@
+; /etc/php.d/eaccelerator.ini
+
+;extension = eaccelerator.so
+zend_extension = "/usr/lib/php/modules/eaccelerator.so"
+zend_extension_ts = "/usr/lib/php/modules/eaccelerator.so"
+
+eaccelerator.shm_size = 32
+;eaccelerator.cache_dir = "/tmp/eaccelerator"
+eaccelerator.enable = 1
+eaccelerator.optimizer = 0
+eaccelerator.debug = 0
+eaccelerator.log_file = "/var/log/httpd/eaccelerator_log"
+eaccelerator.name_space = ""
+eaccelerator.check_mtime = 1
+eaccelerator.filter = ""
+eaccelerator.shm_max = 0
+eaccelerator.shm_ttl = 7200
+eaccelerator.shm_prune_period = 7200
+eaccelerator.shm_only = 1
+eaccelerator.compress = 0
+eaccelerator.compress_level = 9
+eaccelerator.keys = shm
+eaccelerator.sessions = shm
+eaccelerator.content = shm
+; Insert path to document root below, then uncomment the line
+;eaccelerator.allowed_admin_path = "/var/www/domain.com/"
\ No newline at end of file
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/index.html b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/index.html
new file mode 100644
index 00000000..e69de29b
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/memcache.ini b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/memcache.ini
new file mode 100644
index 00000000..ea4a410b
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/memcache.ini
@@ -0,0 +1,10 @@
+; /etc/php.d/memcache.ini
+
+extension = memcache.so
+
+memcache.allow_failover = 1
+memcache.max_failover_attempts = 20
+memcache.chunk_size = 32768
+memcache.default_port = 11211
+memcache.hash_strategy = standard
+memcache.hash_function = crc32
\ No newline at end of file
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/nginx-network-sample-config.conf b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/nginx-network-sample-config.conf
new file mode 100644
index 00000000..fc2e7d26
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/nginx-network-sample-config.conf
@@ -0,0 +1,31 @@
+server {
+ listen 80;
+ server_name yoursite.com;
+ access_log /var/log/nginx/yoursite.com_access.log;
+ error_log /var/log/nginx/yoursite.com_error.log debug;
+
+ root /var/www/vhosts/yoursite.com;
+ index index.php;
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+ }
+
+ if (!-e $request_filename) {
+ rewrite ^/(blog1|blog2)/(wp-(content|admin|includes).*) /$2;
+ rewrite ^/(blog1|blog2)/(.*.php)$ /$2;
+ }
+
+ include /var/www/vhosts/yoursite.com/nginx.conf;
+
+ if (!-e $request_filename) {
+ rewrite (.*) /index.php last;
+ }
+
+ location ~ .php$ {
+ fastcgi_index index.php;
+ fastcgi_pass 127.0.0.1:9000;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include fastcgi_params;
+ }
+}
\ No newline at end of file
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/nginx-standalone-sample-config.conf b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/nginx-standalone-sample-config.conf
new file mode 100644
index 00000000..348ced04
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/nginx-standalone-sample-config.conf
@@ -0,0 +1,22 @@
+server {
+ listen 80;
+ server_name yoursite.com;
+ access_log /var/log/nginx/yoursite.com_access.log;
+ error_log /var/log/nginx/yoursite.com_error.log debug;
+
+ root /var/www/vhosts/yoursite.com;
+ index index.php;
+
+ include /var/www/vhosts/yoursite.com/nginx.conf;
+
+ if (!-e $request_filename) {
+ rewrite (.*) /index.php last;
+ }
+
+ location ~ .php$ {
+ fastcgi_index index.php;
+ fastcgi_pass 127.0.0.1:9000;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include fastcgi_params;
+ }
+}
\ No newline at end of file
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/opcache.ini b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/opcache.ini
new file mode 100644
index 00000000..2fb0ed25
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/opcache.ini
@@ -0,0 +1,9 @@
+; /etc/php.d/apc.ini
+
+zend_extension=opcache.so
+
+opcache.enable = 1
+opcache.fast_shutdown = 1
+opcache.enable_file_override = 1
+opcache.validate_timestamps = 0
+opcache.max_file_size = 10000000
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/php.append.ini b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/php.append.ini
new file mode 100644
index 00000000..ca1cfe29
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/php.append.ini
@@ -0,0 +1,4 @@
+; Use memcache as a session handler
+session.save_handler = memcache
+; Use a comma separated list of server urls to use for storage:
+session.save_path = "tcp://localhost:11211?persistent=1&weight=1&timeout=1&retry_interval=15"
\ No newline at end of file
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/s3-sample-policy.txt b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/s3-sample-policy.txt
new file mode 100644
index 00000000..18ff0515
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/s3-sample-policy.txt
@@ -0,0 +1,23 @@
+{
+ "Statement": [
+ {
+ "Sid": "Stmt1339423675421",
+ "Action": [
+ "s3:DeleteObject",
+ "s3:Get*",
+ "s3:Put*",
+ "s3:Set*"
+ ],
+ "Effect": "Allow",
+ "Resource": [
+ "arn:aws:s3:::bucketnamehere/*"
+ ]
+ },
+ {
+ "Sid": "Stmt1339423675422",
+ "Action":s3:List*?,
+ "Effect":"Allow",
+ "Resource":"*"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/varnish-sample-config.vcl b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/varnish-sample-config.vcl
new file mode 100644
index 00000000..66e5196f
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/varnish-sample-config.vcl
@@ -0,0 +1,79 @@
+backend default {
+ .host = "127.0.0.1";
+ .port = "8080";
+}
+
+acl purge {
+ # Web server with plugin which will issue PURGE requests
+ "localhost";
+}
+
+sub vcl_recv {
+ if (req.request == "PURGE") {
+ if (!client.ip ~ purge) {
+ error 405 "Not allowed.";
+ }
+ ban("req.url ~ ^" + req.url + "$ && req.http.host == " + req.http.host);
+ }
+
+ # Normalize content-encoding
+ if (req.http.Accept-Encoding) {
+ if (req.url ~ "\.(jpg|png|gif|gz|tgz|bz2|lzma|tbz)(\?.*|)$") {
+ remove req.http.Accept-Encoding;
+ } elsif (req.http.Accept-Encoding ~ "gzip") {
+ set req.http.Accept-Encoding = "gzip";
+ } elsif (req.http.Accept-Encoding ~ "deflate") {
+ set req.http.Accept-Encoding = "deflate";
+ } else {
+ remove req.http.Accept-Encoding;
+ }
+ }
+
+ # Remove cookies and query string for real static files
+ if (req.url ~ "\.(bz2|css|flv|gif|gz|ico|jpeg|jpg|js|lzma|mp3|mp4|pdf|png|swf|tbz|tgz|txt|zip)(\?.*|)$") {
+ unset req.http.cookie;
+ set req.url = regsub(req.url, "\?.*$", "");
+ }
+
+ if (req.url ~ "wp-(login|admin|comments-post.php|cron.php)" ||
+ req.url ~ "preview=true" ||
+ req.url ~ "xmlrpc.php") {
+ return (pass);
+ }
+
+ return (lookup);
+}
+
+sub vcl_fetch {
+ # Don't cache backend
+ if (req.url ~ "wp-(login|admin|comments-post.php|cron.php)" ||
+ req.url ~ "preview=true" ||
+ req.url ~ "xmlrpc.php") {
+ # Dont modify anything, it's (pass) object
+ } else {
+ unset beresp.http.set-cookie;
+
+ if (beresp.status == 307) {
+ # Don't cache temporary redirects like ?repeat=w3tc
+ set beresp.ttl = 0h;
+ } else if (req.url ~ "\.(bz2|css|flv|gif|gz|ico|jpeg|jpg|js|lzma|mp3|mp4|pdf|png|swf|tbz|tgz|txt|zip)$") {
+ set beresp.ttl = 30d;
+ } else {
+ set beresp.ttl = 4h;
+ }
+ }
+}
+
+sub vcl_hit {
+ if (req.request == "PURGE") {
+ purge;
+ error 200 "Purged.";
+ }
+}
+
+sub vcl_miss {
+ if (req.request == "PURGE") {
+ purge;
+ error 200 "Purged.";
+ }
+}
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/web.config b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/web.config
new file mode 100644
index 00000000..826dd9d8
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/web.config
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/xcache.ini b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/xcache.ini
new file mode 100644
index 00000000..63b20345
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/ini/xcache.ini
@@ -0,0 +1,35 @@
+; /etc/php.d/xcache.ini
+
+;extension = xcache.so
+zend_extension = "/usr/lib/php/modules/xcache.so"
+zend_extension_ts = "/usr/lib/php/modules/xcache.so"
+
+xcache.admin.user = ""
+xcache.admin.pass = ""
+xcache.admin.enable_auth = Off
+xcache.test = Off
+xcache.coredump_directory = ""
+
+xcache.shm_scheme = mmap
+
+xcache.cacher = On
+xcache.size = 32M
+xcache.count = 8
+xcache.slots = 8K
+xcache.ttl = 0
+xcache.gc_interval = 0
+xcache.var_size = 32M
+xcache.var_count = 1
+xcache.var_slots = 8K
+xcache.var_ttl = 0
+xcache.var_maxttl = 0
+xcache.var_gc_interval = 300
+xcache.mmap_path = "/dev/zero"
+
+xcache.optimizer = Off
+
+xcache.coverager = Off
+xcache.coveragedump_directory = ""
+
+xcache.stat = Off
+xcache.readonly_protection = Off
diff --git a/wp-content/upgrade-temp-backup/plugins/w3-total-cache/languages/w3-total-cache.pot b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/languages/w3-total-cache.pot
new file mode 100644
index 00000000..e1021cdb
--- /dev/null
+++ b/wp-content/upgrade-temp-backup/plugins/w3-total-cache/languages/w3-total-cache.pot
@@ -0,0 +1,12334 @@
+# Copyright (C) 2023 BoldGrid
+# This file is distributed under the GPL v2 or later.
+msgid ""
+msgstr ""
+"Project-Id-Version: W3 Total Cache 2.4.1\n"
+"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/w3-total-cache\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: LANGUAGE \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"POT-Creation-Date: 2023-08-09T13:31:59+00:00\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"X-Generator: WP-CLI 2.5.0\n"
+"X-Domain: w3-total-cache\n"
+
+#. Plugin Name of the plugin
+#: Generic_Plugin_Admin.php:1095
+#: SetupGuide_Plugin_Admin.php:1161
+#: SetupGuide_Plugin_Admin.php:1207
+#: SetupGuide_Plugin_Admin.php:1279
+#: SetupGuide_Plugin_Admin.php:1308
+msgid "W3 Total Cache"
+msgstr ""
+
+#. Plugin URI of the plugin
+msgid "https://www.boldgrid.com/totalcache/"
+msgstr ""
+
+#. Description of the plugin
+msgid "The highest rated and most complete WordPress performance plugin. Dramatically improve the speed and user experience of your site. Add browser, page, object and database caching as well as minify and content delivery network (CDN) to WordPress."
+msgstr ""
+
+#. Author of the plugin
+#: inc/options/common/footer.php:100
+#: inc/options/common/footer.php:101
+#: inc/options/common/footer.php:103
+#: inc/options/common/footer.php:104
+msgid "BoldGrid"
+msgstr ""
+
+#. Author URI of the plugin
+msgid "https://www.boldgrid.com/"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:7
+msgid "Browser Cache:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:8
+msgid "Prevent caching exception list:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:9
+msgid "Do not process 404 errors for static objects with WordPress"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:10
+msgid "404 error exception list:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:11
+#: BrowserCache_ConfigLabels.php:22
+#: BrowserCache_ConfigLabels.php:31
+#: inc/options/browsercache.php:89
+msgid "Set Last-Modified header"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:12
+#: BrowserCache_ConfigLabels.php:23
+#: BrowserCache_ConfigLabels.php:32
+#: inc/options/browsercache.php:99
+msgid "Set expires header"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:13
+#: BrowserCache_ConfigLabels.php:24
+#: BrowserCache_ConfigLabels.php:33
+msgid "Expires header lifetime:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:14
+#: BrowserCache_ConfigLabels.php:25
+#: BrowserCache_ConfigLabels.php:34
+#: inc/options/browsercache.php:106
+msgid "Set cache control header"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:15
+#: BrowserCache_ConfigLabels.php:26
+#: BrowserCache_ConfigLabels.php:35
+msgid "Cache Control policy:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:16
+msgid "Set entity tag (eTag)"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:17
+#: BrowserCache_ConfigLabels.php:28
+#: BrowserCache_ConfigLabels.php:37
+#: inc/options/browsercache.php:121
+msgid "Set W3 Total Cache header"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:18
+#: BrowserCache_ConfigLabels.php:29
+msgid "Enable HTTP (gzip) compression"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:19
+#: BrowserCache_ConfigLabels.php:30
+msgid "Enable HTTP (brotli) compression"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:20
+#: BrowserCache_ConfigLabels.php:40
+#: inc/options/browsercache.php:184
+msgid "Prevent caching of objects after settings change"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:21
+#: BrowserCache_ConfigLabels.php:41
+msgid "Disable cookies for static files"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:27
+#: BrowserCache_ConfigLabels.php:36
+#: inc/options/browsercache.php:114
+msgid "Set entity tag (ETag)"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:38
+msgid "Enable HTTP (gzip) compression"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:39
+msgid "Enable HTTP (brotli) compression"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:42
+msgid "Access session cookies through the HTTP only:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:43
+msgid "Send session cookies only to secure connections:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:44
+msgid "Use cookies to store session IDs:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:45
+msgid "HTTP Strict Transport Security policy"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:46
+#: BrowserCache_ConfigLabels.php:48
+#: BrowserCache_ConfigLabels.php:50
+#: BrowserCache_ConfigLabels.php:59
+msgid "Directive:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:47
+msgid "X-Frame-Options"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:49
+msgid "X-XSS -Protection"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:51
+msgid "X-Content-Type-Options"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:52
+msgid "HTTP Public Key Pinning"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:53
+msgid "Public Key:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:54
+msgid "Public Key (Backup):"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:55
+msgid "Extra Parameters:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:56
+msgid "Report URL :"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:57
+msgid "Report Mode Only:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:58
+msgid "Referrer Policy"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:60
+#: BrowserCache_Page_View_SectionSecurity.php:570
+msgid "Content Security Policy"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:61
+#: BrowserCache_ConfigLabels.php:85
+msgid "report-uri:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:62
+#: BrowserCache_ConfigLabels.php:86
+msgid "report-to:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:63
+#: BrowserCache_ConfigLabels.php:87
+msgid "base-uri:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:64
+#: BrowserCache_ConfigLabels.php:88
+msgid "frame-src:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:65
+#: BrowserCache_ConfigLabels.php:89
+msgid "connect-src:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:66
+#: BrowserCache_ConfigLabels.php:90
+msgid "font-src:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:67
+#: BrowserCache_ConfigLabels.php:91
+msgid "script-src:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:68
+#: BrowserCache_ConfigLabels.php:92
+msgid "style-src:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:69
+#: BrowserCache_ConfigLabels.php:93
+msgid "img-src:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:70
+#: BrowserCache_ConfigLabels.php:94
+msgid "media-src:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:71
+#: BrowserCache_ConfigLabels.php:95
+msgid "object-src:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:72
+#: BrowserCache_ConfigLabels.php:96
+msgid "plugin-types:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:73
+#: BrowserCache_ConfigLabels.php:97
+msgid "form-action:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:74
+#: BrowserCache_ConfigLabels.php:98
+msgid "frame-ancestors:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:75
+#: BrowserCache_ConfigLabels.php:99
+msgid "sandbox:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:76
+#: BrowserCache_ConfigLabels.php:100
+msgid "child-src:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:77
+#: BrowserCache_ConfigLabels.php:101
+msgid "manifest-src:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:78
+#: BrowserCache_ConfigLabels.php:102
+msgid "script-src-elem:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:79
+#: BrowserCache_ConfigLabels.php:103
+msgid "script-src-attr:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:80
+#: BrowserCache_ConfigLabels.php:104
+msgid "style-src-elem:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:81
+#: BrowserCache_ConfigLabels.php:105
+msgid "style-src-attr:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:82
+#: BrowserCache_ConfigLabels.php:106
+msgid "worker-src:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:83
+#: BrowserCache_ConfigLabels.php:107
+msgid "default-src:"
+msgstr ""
+
+#: BrowserCache_ConfigLabels.php:84
+#: BrowserCache_Page_View_SectionSecurity.php:894
+msgid "Content Security Policy Report Only"
+msgstr ""
+
+#: BrowserCache_Page_View_QuickReference.php:9
+msgid "Security Headers: Quick Reference"
+msgstr ""
+
+#: BrowserCache_Page_View_QuickReference.php:12
+#: inc/lightbox/self_test.php:11
+#: PageSpeed_Page_View_FromAPI.php:66
+msgid "Legend"
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:22
+msgid "Controls whether the current document is allowed to gather information about the acceleration of the device through the Accelerometer interface."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:26
+msgid "Controls whether the current document is allowed to gather information about the amount of light in the environment around the device through the AmbientLightSensor interface."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:30
+msgid "Controls whether the current document is allowed to autoplay media requested through the HTMLMediaElement interface."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:34
+msgid "Controls whether the use of the Battery Status API is allowed. When this policy is disabled, the Promise returned by Navigator.getBattery() will reject with a NotAllowedError DOMException."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:38
+msgid "Controls whether the current document is allowed to use video input devices."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:42
+msgid "Controls whether or not the document is permitted to use Screen Capture API."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:46
+msgid "Controls whether the current document is allowed to set document.domain."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:50
+msgid "Controls whether the current document is allowed to use the Encrypted Media Extensions API (EME)."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:54
+msgid "Controls whether tasks should execute in frames while they're not being rendered (e.g. if an iframe is hidden or display: none)."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:58
+msgid "Controls whether tasks should execute in frames while they're outside of the visible viewport."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:62
+msgid "Controls whether the current document is allowed to use Element.requestFullScreen()."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:66
+msgid "Controls whether the current document is allowed to use the Gamepad API. When this policy is disabled, calls to Navigator.getGamepads() will throw a SecurityError DOMException, and the gamepadconnected and gamepaddisconnected events will not fire."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:70
+msgid "Controls whether the current document is allowed to use the Geolocation Interface."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:74
+msgid "Controls whether the current document is allowed to gather information about the orientation of the device through the Gyroscope interface."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:78
+msgid "Controls whether the current document is allowed to show layout animations."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:82
+msgid "Controls whether the current document is allowed to display images in legacy formats."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:86
+msgid "Controls whether the current document is allowed to gather information about the orientation of the device through the Magnetometer interface."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:90
+msgid "Controls whether the current document is allowed to use audio input devices."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:94
+msgid "Controls whether the current document is allowed to use the Web MIDI API."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:98
+msgid "Controls the availability of mechanisms that enables the page author to take control over the behavior of spatial navigation, or to cancel it outright."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:102
+msgid "Controls whether the current document is allowed to download and display large images."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:106
+msgid "Controls whether the current document is allowed to use the Payment Request API."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:110
+msgid "Controls whether the current document is allowed to play a video in a Picture-in-Picture mode via the corresponding API."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:114
+msgid "Controls whether the current document is allowed to use the Web Authentication API to retrieve already stored public-key credentials, i.e. via navigator.credentials.get({publicKey: ..., ...})."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:118
+msgid "Controls whether the current document is allowed to use Screen Wake Lock API to indicate that device should not turn off or dim the screen."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:122
+msgid "Controls whether the current document is allowed to play audio via any methods."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:126
+msgid "Controls whether the current document is allowed to make synchronous XMLHttpRequest requests."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:130
+msgid "Controls whether the current document is allowed to download and display unoptimized images."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:134
+msgid "Controls whether the current document is allowed to change the size of media elements after the initial layout is complete."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:138
+msgid "Controls whether the current document is allowed to use the WebUSB API."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:142
+msgid "Controls whether the current document is allowed to trigger device vibrations via Navigator.vibrate() method of Vibration API."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:146
+msgid "Controls whether the current document is allowed to use the WebVR API. When this policy is disabled, the Promise returned by Navigator.getVRDisplays() will reject with a DOMException. Keep in mind that the WebVR standard is in the process of being replaced with WebXR."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:150
+msgid "Controls whether the current document is allowed to use Wake Lock API to indicate that device should not enter power-saving mode."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:154
+msgid "Controls whether or not the current document is allowed to use the Navigator.share() of Web Share API to share text, links, images, and other content to arbitrary destinations of user's choice, e.g. mobile apps."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:158
+msgid "Controls whether the current document is allowed to use the WebXR Device API."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:164
+#: Util_Ui.php:1786
+msgid "Security Headers"
+msgstr ""
+
+#. translators: 1 opening HTML acronym tag, 2 closing HTML acronym tag.
+#: BrowserCache_Page_View_SectionSecurity.php:170
+msgid "%1$sHTTP%2$s security headers provide another layer of protection for your website by helping to mitigate attacks and security vulnerabilities."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:174
+#: BrowserCache_Page_View_SectionSecurity.php:250
+#: BrowserCache_Page_View_SectionSecurity.php:254
+#: BrowserCache_Page_View_SectionSecurity.php:379
+#: BrowserCache_Page_View_SectionSecurity.php:383
+#: inc/options/about.php:50
+#: inc/options/about.php:74
+#: inc/options/browsercache.php:138
+#: inc/options/browsercache.php:166
+#: inc/options/cdn.php:339
+#: inc/options/cdn.php:876
+#: inc/options/general.php:448
+#: inc/options/install.php:114
+#: inc/options/minify.php:549
+#: inc/options/minify.php:823
+#: inc/options/minify.php:999
+#: inc/options/pgcache.php:802
+msgid "Hypertext Transfer Protocol"
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:185
+msgid "Quick Reference Chart"
+msgstr ""
+
+#. translators: 1 opening HTML acronym tag, 2 closing HTML acronym tag.
+#: BrowserCache_Page_View_SectionSecurity.php:197
+msgid "This setting prevents attacks that are caused by passing session IDs in %1$sURL%2$ss."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:201
+#: BrowserCache_Page_View_SectionSecurity.php:498
+#: BrowserCache_Page_View_SectionSecurity.php:626
+#: BrowserCache_Page_View_SectionSecurity.php:758
+#: BrowserCache_Page_View_SectionSecurity.php:948
+#: BrowserCache_Page_View_SectionSecurity.php:1080
+#: Generic_Plugin_Admin.php:902
+#: inc/options/browsercache.php:202
+#: inc/options/browsercache.php:473
+#: inc/options/browsercache.php:700
+#: inc/options/pgcache.php:152
+#: inc/options/pgcache.php:517
+#: inc/options/pgcache.php:596
+msgid "Uniform Resource Locator"
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:219
+msgid "This tells the user's browser not to make the session cookie accessible to client side scripting such as JavaScript. This makes it harder for an attacker to hijack the session ID and masquerade as the effected user."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:229
+msgid "This will prevent the user's session ID from being transmitted in plain text, making it much harder to hijack the user's session."
+msgstr ""
+
+#. translators: 11 opening HTML acronym tag, 12 closing HTML acornym tag.
+#: BrowserCache_Page_View_SectionSecurity.php:246
+msgid "%1$sHTTP%2$s Strict-Transport-Security (%3$sHSTS%4$s) enforces secure (%5$sHTTP%6$s over %7$sSSL%8$s/%9$sTLS%10$s) connections to the server. This can help mitigate adverse effects caused by bugs and session leaks through cookies and links. It also helps defend against man-in-the-middle attacks. If there are %11$sSSL%12$s negotiation warnings then users will not be permitted to ignore them."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:252
+msgid "HTTP Strict Transport Security"
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:256
+#: BrowserCache_Page_View_SectionSecurity.php:260
+#: Cdn_Highwinds_Page_View.php:64
+#: Cdn_Highwinds_Page_View.php:94
+#: Cdn_LimeLight_Page_View.php:35
+#: Cdn_LimeLight_Page_View.php:65
+#: Cdn_RackSpaceCloudFiles_Page_View.php:82
+#: Cdn_RackSpaceCloudFiles_Page_View.php:112
+#: Cdn_StackPath2_Page_View.php:204
+#: Cdn_StackPath2_Page_View.php:230
+#: Cdn_StackPath2_Page_View.php:274
+#: Cdn_StackPath_Page_View.php:131
+#: Cdn_StackPath_Page_View.php:157
+#: Cdn_StackPath_Page_View.php:201
+#: Extension_CloudFlare_Page_View.php:690
+#: Extension_CloudFlare_Page_View.php:737
+#: Extension_CloudFlare_Page_View.php:759
+#: Extension_CloudFlare_Page_View.php:775
+#: inc/options/cdn.php:464
+#: inc/options/cdn/akamai.php:59
+#: inc/options/cdn/akamai.php:89
+#: inc/options/cdn/att.php:33
+#: inc/options/cdn/att.php:63
+#: inc/options/cdn/azure.php:42
+#: inc/options/cdn/azure.php:72
+#: inc/options/cdn/cf.php:89
+#: inc/options/cdn/cf.php:119
+#: inc/options/cdn/cf2.php:81
+#: inc/options/cdn/cf2.php:111
+#: inc/options/cdn/cotendo.php:70
+#: inc/options/cdn/edgecast.php:33
+#: inc/options/cdn/edgecast.php:63
+#: inc/options/cdn/ftp.php:186
+#: inc/options/cdn/ftp.php:216
+#: inc/options/cdn/mirror.php:19
+#: inc/options/cdn/mirror.php:49
+#: inc/options/cdn/rscf.php:76
+#: inc/options/cdn/rscf.php:106
+#: inc/options/cdn/s3.php:95
+#: inc/options/cdn/s3.php:125
+#: inc/options/cdn/s3_compatible.php:71
+#: inc/options/cdn/s3_compatible.php:101
+msgid "Secure Sockets Layer"
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:258
+#: Extension_CloudFlare_Page_View.php:797
+#: Extension_CloudFlare_Page_View.php:813
+#: Extension_CloudFlare_Page_View.php:836
+msgid "Transport Layer Security"
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:294
+msgid "This tells the browser if it is permitted to render a page within a frame-like tag (i.e., <frame>, <iframe> or <object>). This is useful for preventing clickjacking attacks."
+msgstr ""
+
+#. translators: 1 opening HTML acronym tag, 2 closing HTML acornym tag.
+#: BrowserCache_Page_View_SectionSecurity.php:324
+msgid "This header enables the %1$sXSS%2$s filter. It helps to stop malicious scripts from being injected into your website. Although this is already built into and enabled by default in most browsers today it is made available here to enforce its reactivation if it was disabled within the user's browser."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:328
+#: BrowserCache_Page_View_SectionSecurity.php:572
+msgid "Cross-Site Scripting"
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:361
+msgid "This instructs the browser to not MIME-sniff a response outside its declared content-type. It helps to reduce drive-by download attacks and stops sites from serving malevolent content that could masquerade as an executable or dynamic HTML file."
+msgstr ""
+
+#. translators: 5 opening HTML acronym tag, 6 closing HTML acornym tag.
+#: BrowserCache_Page_View_SectionSecurity.php:375
+msgid "%1$sHTTP%2$s Public Key Pinning (%3$sHPKP%4$s) is a security feature for %5$sHTTP%6$sS websites that can prevent fraudulently issued certificates from being used to impersonate existing secure websites."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:381
+msgid "HTTP Public Key Pinning"
+msgstr ""
+
+#. translators: 1 opening HTML acronym tag, 2 closing HTML acornym tag.
+#: BrowserCache_Page_View_SectionSecurity.php:410
+msgid "This field is %1$srequired%2$s and represents a %3$sSPKI%4$s fingerprint. This pin is any public key within your current certificate chain."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:416
+#: BrowserCache_Page_View_SectionSecurity.php:451
+msgid "Subject Public Key Information"
+msgstr ""
+
+#. translators: 3 opening HTML acronym tag, 4 closing HTML acronym tag.
+#: BrowserCache_Page_View_SectionSecurity.php:445
+msgid "This field is %1$salso required%2$s and represents your backup %3$sSPKI%4$s fingerprint. This pin is any public key not in your current certificate chain and serves as a backup in case your certificate expires or has to be revoked."
+msgstr ""
+
+#. translators: 1 opening HTML acronym tag, 2 closing HTML acronym tag.
+#: BrowserCache_Page_View_SectionSecurity.php:494
+msgid "This optional field can be used to specify a %1$sURL%2$s that clients will send reports to if pin validation failures occur. The report is sent as a POST request with a JSON body."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:521
+msgid "No = Enforce HPKP"
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:522
+msgid "Yes = Don't Enforce HPKP"
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:531
+msgid "This header restricts the values of the referer header in outbound links."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:544
+msgid "Not Set"
+msgstr ""
+
+#. translators: 3 opening HTML acronym tag, 4 closing HTML acronym tag.
+#: BrowserCache_Page_View_SectionSecurity.php:566
+msgid "The Content Security Policy (%1$sCSP%2$s) header reduces the risk of %3$sXSS%4$s attacks by allowing you to define where resources can be retrieved from, preventing browsers from loading data from any other locations. This makes it harder for an attacker to inject malicious code into your site."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:592
+#: BrowserCache_Page_View_SectionSecurity.php:914
+msgid "Instructs the user agent to report attempts to violate the Content Security Policy. These violation reports consist of JSON documents sent via an HTTP POST request to the specified URI."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:603
+#: BrowserCache_Page_View_SectionSecurity.php:925
+msgid "Defines a reporting endpoint \"group\" to which violation reports should to be sent."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:605
+#: BrowserCache_Page_View_SectionSecurity.php:927
+msgid "The referenced \"group\" should be defined in either the Report-To or Reporting-Endpoints HTTP headers. These will need to be manually defined either via htaccess or another method of modifying HTTP headers."
+msgstr ""
+
+#. translators: 1 opening HTML acronym tag, 2 closing HTML acronym tag.
+#: BrowserCache_Page_View_SectionSecurity.php:622
+#: BrowserCache_Page_View_SectionSecurity.php:944
+msgid "Restricts the %1$sURL%2$ss which can be used in a document's <base> element."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:647
+#: BrowserCache_Page_View_SectionSecurity.php:969
+msgid "Limits the origins to which you can connect via XMLHttpRequest, WebSockets, and EventSource."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:657
+#: BrowserCache_Page_View_SectionSecurity.php:979
+msgid "Specifies the origins that can serve web fonts."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:667
+#: BrowserCache_Page_View_SectionSecurity.php:989
+msgid "Restricts from where the protected resource can embed frames."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:677
+#: BrowserCache_Page_View_SectionSecurity.php:999
+msgid "Specifies valid sources for images and favicons."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:687
+#: BrowserCache_Page_View_SectionSecurity.php:1009
+msgid "Specifies valid sources for loading media using the <audio> and <video> elements."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:697
+#: BrowserCache_Page_View_SectionSecurity.php:1019
+msgid "Allows control over the <object>, <embed>, and <applet> elements used by Flash and other plugins."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:707
+#: BrowserCache_Page_View_SectionSecurity.php:1029
+msgid "Specifies valid sources for JavaScript."
+msgstr ""
+
+#. translators: 1 opening HTML acronym tag, 2 closing HTML acronym tag.
+#: BrowserCache_Page_View_SectionSecurity.php:723
+#: BrowserCache_Page_View_SectionSecurity.php:1045
+msgid "Specifies valid sources for %1$sCSS%2$s stylesheets."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:727
+#: BrowserCache_Page_View_SectionSecurity.php:1049
+#: Cdn_GeneralPage_View.php:95
+#: Extension_CloudFlare_Page_View.php:388
+#: inc/options/about.php:78
+#: inc/options/about.php:139
+#: inc/options/about.php:185
+#: inc/options/browsercache.php:361
+#: inc/options/cdn.php:261
+#: inc/options/cdn/s3_compatible.php:31
+#: inc/options/general.php:219
+#: inc/options/install.php:76
+#: inc/options/minify.php:97
+#: inc/options/minify.php:591
+#: inc/options/minify.php:610
+#: inc/options/minify.php:703
+#: inc/options/minify.php:794
+#: inc/options/minify.php:942
+#: Minify_HelpPopup_View.php:54
+#: Minify_HelpPopup_View.php:82
+#: Minify_HelpPopup_View.php:110
+#: PageSpeed_Instructions.php:68
+#: PageSpeed_Instructions.php:85
+#: PageSpeed_Instructions.php:357
+#: Util_Ui.php:1701
+#: Util_Ui.php:1749
+msgid "Cascading Style Sheet"
+msgstr ""
+
+#. translators: 1 opening HTML acronym tag, 2 closing HTML acronym tag.
+#: BrowserCache_Page_View_SectionSecurity.php:754
+#: BrowserCache_Page_View_SectionSecurity.php:1076
+msgid "Restricts the %1$sURL%2$ss which can be used as the target of form submissions from a given context."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:779
+#: BrowserCache_Page_View_SectionSecurity.php:1101
+msgid "Specifies valid parents that may embed a page using <frame>, <iframe>, <object>, <embed>, or <applet>."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:789
+#: BrowserCache_Page_View_SectionSecurity.php:1111
+msgid "Restricts the set of plugins that can be embedded into a document by limiting the types of resources which can be loaded."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:799
+#: BrowserCache_Page_View_SectionSecurity.php:1121
+msgid "This directive operates similarly to the <iframe> sandbox attribute by applying restrictions to a page's actions, including preventing popups, preventing the execution of plugins and scripts, and enforcing a same-origin policy."
+msgstr ""
+
+#: BrowserCache_Page_View_SectionSecurity.php:809
+#: BrowserCache_Page_View_SectionSecurity.php:1131
+msgid "Defines the valid sources for web workers and nested browsing contexts loaded using elements such as and