updated plugin W3 Total Cache version 2.7.0

This commit is contained in:
2024-03-28 09:40:06 +00:00
committed by Gitium
parent 60de585044
commit 218272bbcb
140 changed files with 3054 additions and 3013 deletions
wp-content/plugins/w3-total-cache
BrowserCache_ConfigLabels.phpBrowserCache_Environment_Nginx.phpCacheFlush_Locally.phpCacheGroups_Plugin_Admin.phpCache_Memcached.phpCdn_BunnyCdn_Page_View.jsCdn_BunnyCdn_Widget.phpCdn_GoogleDrive_Page_View.jsCdn_Highwinds_Page_View.jsCdn_Highwinds_Widget.phpCdn_Highwinds_Widget_View.cssCdn_Highwinds_Widget_View.jsCdn_Highwinds_Widget_View.phpCdn_Highwinds_Widget_View_NotConfigured.phpCdn_LimeLight_Page_View.jsCdn_LimeLight_Popup.phpCdn_Plugin_Admin.phpCdn_RackSpaceCdn_Page_View.jsCdn_RackSpaceCloudFiles_Page_View.jsCdn_StackPath2_Page_View.jsCdn_StackPath2_Widget.phpCdn_StackPath2_Widget_View.cssCdn_StackPath2_Widget_View.jsCdn_StackPath2_Widget_View_Authorized.phpCdn_StackPath2_Widget_View_Unauthorized.phpCdn_StackPath_Page_View.jsCdn_StackPath_Widget.phpCdn_StackPath_Widget_View.cssCdn_StackPath_Widget_View.jsCdn_StackPath_Widget_View_Authorized.phpCdn_StackPath_Widget_View_Unauthorized.phpCdnfsd_BunnyCdn_Page_View.jsCdnfsd_CloudFront_Page_View.jsCdnfsd_Core.phpCdnfsd_LimeLight_Page_View.jsCdnfsd_StackPath2_Page_View.jsCdnfsd_StackPath_Page_View.jsConfigKeys.phpExtension_CloudFlare_Page_View.jsExtension_CloudFlare_Widget.phpExtension_ImageService_Widget.jsExtension_ImageService_Widget.phpExtension_ImageService_Widget_View.phpExtension_NewRelic_Popup_View.jsExtension_NewRelic_Widget.phpExtension_Swarmify_Plugin_Admin.phpExtension_Swarmify_Widget.phpExtension_Swarmify_Widget_View.cssExtension_Swarmify_Widget_View_NotConfigured.phpExtensions_Page.phpFeatureShowcase_Plugin_Admin.phpFeatureShowcase_Plugin_Admin_View.phpGeneric_GeneralPage_View_ShowEdge.jsGeneric_GeneralPage_View_ShowSupportUs.jsGeneric_Page_Dashboard_View.cssGeneric_Page_Install.phpGeneric_Plugin.phpGeneric_Plugin_Admin.phpGeneric_Plugin_WidgetForum.phpGeneric_Plugin_WidgetNews.phpGeneric_WidgetAccount.phpGeneric_WidgetAccount_View.phpGeneric_WidgetBoldGrid.phpGeneric_WidgetCommunity.phpGeneric_WidgetCommunity_View.phpGeneric_WidgetPartners.phpGeneric_WidgetPartners_View.phpGeneric_WidgetServices.phpGeneric_WidgetSettings.phpGeneric_WidgetSettings_View.phpGeneric_WidgetSpreadTheWord_Plugin.phpGeneric_WidgetStats.jsGeneric_WidgetStats.phpMinify_Core.phpMinify_GeneralPage_View_ShowHelp.jsMinify_MinifiedFileRequestHandler.phpMinify_Plugin_Admin.phpPageSpeed_Data.phpPageSpeed_Instructions.phpPageSpeed_Page.phpPageSpeed_Widget.phpPageSpeed_Widget_View.cssPageSpeed_Widget_View.jsPageSpeed_Widget_View_FromApi.phpRoot_Loader.phpUsageStatistics_Page.phpUsageStatistics_Plugin_Admin.phpUsageStatistics_Widget.phpUsageStatistics_Widget_View.jsUsageStatistics_Widget_View.phpUsageStatistics_Widget_View_Disabled.phpUserExperience_DeferScripts_Extension.phpUserExperience_DeferScripts_Page_View.phpUserExperience_GeneralPage_View.phpUserExperience_LazyLoad_Mutator.phpUserExperience_LazyLoad_Mutator_Unmutable.phpUserExperience_Plugin_Admin.phpUserExperience_Preload_Requests_Extension.phpUserExperience_Preload_Requests_Page_View.phpUserExperience_Remove_CssJs_Extension.phpUserExperience_Remove_CssJs_Mutator.phpUserExperience_Remove_CssJs_Page_View.jsUserExperience_Remove_CssJs_Page_View.phpUtil_Installed.phpUtil_PageSpeed.phpUtil_PageUrls.phpUtil_Ui.php
inc
lib
Minify
pub
readme.txt
vendor
w3-total-cache-api.phpw3-total-cache.php

@ -0,0 +1,170 @@
<?php
/**
* File: Generic_WidgetStats.php
*
* @since X.X.X
*
* @package W3TC
*/
namespace W3TC;
/**
* Class Generic_WidgetStats
*/
class Generic_WidgetStats {
/**
* Dashboard setup action
*
* @since X.X.X
*
* @return void
*/
public static function admin_init_w3tc_dashboard() {
$o = new Generic_WidgetStats();
add_action( 'w3tc_widget_setup', array( $o, 'wp_dashboard_setup' ), 700 );
add_action( 'w3tc_network_dashboard_setup', array( $o, 'wp_dashboard_setup' ), 700 );
wp_enqueue_script( 'w3tc-dashboard', plugins_url( 'pub/js/google-charts.js', W3TC_FILE ), array(), W3TC_VERSION, true );
wp_enqueue_script( 'w3tc-stats-widget', plugins_url( 'Generic_WidgetStats.js', W3TC_FILE ), array(), W3TC_VERSION, true );
}
/**
* W3TC dashboard Stats widgets.
*
* @since X.X.X
*
* @return void
*/
public function wp_dashboard_setup() {
Util_Widget::add(
'w3tc_page_cache',
'<div class="w3tc-widget-w3tc-logo"></div><div class="w3tc-widget-text">' . __( 'Page Cache: Hits', 'w3-total-cache' ) . '</div>',
array( $this, 'page_cache_widget_form' ),
null,
'normal'
);
Util_Widget::add(
'w3tc_object_cache',
'<div class="w3tc-widget-w3tc-logo"></div><div class="w3tc-widget-text">' . __( 'Object Cache: Hits', 'w3-total-cache' ) . '</div>',
array( $this, 'object_cache_widget_form' ),
null,
'normal'
);
Util_Widget::add(
'w3tc_database_cache',
'<div class="w3tc-widget-w3tc-logo"></div><div class="w3tc-widget-text">' . __( 'Database Cache: Hits', 'w3-total-cache' ) . '</div>',
array( $this, 'database_cache_widget_form' ),
null,
'normal'
);
}
/**
* Web Requests widget content.
*
* @since X.X.X
*
* @return void
*/
public function page_cache_widget_form() {
$chart = self::get_chart_content(
array(
'chart_id' => 'page_cache_chart',
'setting_key' => 'pgcache.enabled',
'cache_enable_label' => __( 'Enable PageCache', 'w3-total-cache' ),
'cache_enable_url' => Util_Ui::admin_url( 'admin.php?page=w3tc_general#page_cache' ),
)
);
echo wp_kses( $chart, self::get_allowed_tags() );
}
/**
* Object Cache widget content.
*
* @since X.X.X
*
* @return void
*/
public function object_cache_widget_form() {
$chart = self::get_chart_content(
array(
'chart_id' => 'object_cache_chart',
'setting_key' => 'objectcache.enabled',
'cache_enable_label' => __( 'Enable ObjectCache', 'w3-total-cache' ),
'cache_enable_url' => Util_Ui::admin_url( 'admin.php?page=w3tc_general#object_cache' ),
)
);
echo wp_kses( $chart, self::get_allowed_tags() );
}
/**
* Database widget content.
*
* @since X.X.X
*
* @return void
*/
public function database_cache_widget_form() {
$chart = self::get_chart_content(
array(
'chart_id' => 'database_cache_chart',
'setting_key' => 'dbcache.enabled',
'cache_enable_label' => __( 'Enable DBCache', 'w3-total-cache' ),
'cache_enable_url' => Util_Ui::admin_url( 'admin.php?page=w3tc_general#database_cache' ),
)
);
echo wp_kses( $chart, self::get_allowed_tags() );
}
/**
* Get button link allowed tags.
*
* @since X.X.X
*
* @param array $chart_config Chart configuration array.
*
* @return string
*/
public static function get_chart_content( $chart_config ) {
$config = Dispatcher::config();
$chart_id = $chart_config['chart_id'];
$chart_content = '';
if ( ! Util_Environment::is_w3tc_pro( $config ) ) {
$chart_id .= '_ad';
$chart_content = '<input type="button" class="button-primary button-buy-plugin {nonce: \'' . esc_attr( wp_create_nonce( 'w3tc' ) ) . '\'}" data-src="' . $chart_id . '_cache_chart" value="' . esc_html__( 'Unlock Feature', 'w3-total-cache' ) . '" />';
} elseif ( ! $config->get_boolean( 'stats.enabled' ) ) {
$chart_id .= '_enable';
$chart_content = Util_Ui::button_link( __( 'Enable Statistics', 'w3-total-cache' ), Util_Ui::admin_url( 'admin.php?page=w3tc_general#stats' ), false, 'button-primary' );
} elseif ( ! $config->get_boolean( $chart_config['setting_key'] ) ) {
$chart_id .= '_subenable';
$chart_content = Util_Ui::button_link( $chart_config['cache_enable_label'], $chart_config['cache_enable_url'], false, 'button-primary' );
}
return '<div id="' . $chart_id . '">' . $chart_content . '</div>';
}
/**
* Get button link allowed tags.
*
* @since X.X.X
*
* @return array
*/
public static function get_allowed_tags() {
return array(
'div' => array(
'id' => array(),
),
'input' => array(
'type' => array(),
'name' => array(),
'class' => array(),
'value' => array(),
'onclick' => array(),
'data-src' => array(),
),
);
}
}