X7ROOT File Manager
Current Path:
/home/katmhsmi/public_html/wp-content/plugins/w3-total-cache
home
/
katmhsmi
/
public_html
/
wp-content
/
plugins
/
w3-total-cache
/
📁
..
📄
Base_Page_Settings.php
(6.82 KB)
📄
BrowserCache_ConfigLabels.php
(10.36 KB)
📄
BrowserCache_Core.php
(3.19 KB)
📄
BrowserCache_Environment.php
(31.64 KB)
📄
BrowserCache_Environment_Apache.php
(3.38 KB)
📄
BrowserCache_Environment_LiteSpeed.php
(8.41 KB)
📄
BrowserCache_Environment_Nginx.php
(22.25 KB)
📄
BrowserCache_Page.php
(3.28 KB)
📄
BrowserCache_Page_View_QuickReference.php
(2.58 KB)
📄
BrowserCache_Page_View_SectionSecurity.php
(61.6 KB)
📄
BrowserCache_Plugin.php
(15.11 KB)
📄
BrowserCache_Plugin_Admin.php
(1.33 KB)
📄
Cache.php
(4.52 KB)
📄
CacheFlush.php
(7.88 KB)
📄
CacheFlush_Locally.php
(12.6 KB)
📄
CacheGroups_Plugin_Admin.php
(7.98 KB)
📄
CacheGroups_Plugin_Admin_View.js
(17.23 KB)
📄
CacheGroups_Plugin_Admin_View.php
(15.17 KB)
📄
Cache_Apc.php
(7.75 KB)
📄
Cache_Apcu.php
(7.77 KB)
📄
Cache_Base.php
(6.49 KB)
📄
Cache_Eaccelerator.php
(7.58 KB)
📄
Cache_File.php
(21.25 KB)
📄
Cache_File_Cleaner.php
(2.69 KB)
📄
Cache_File_Cleaner_Generic.php
(4.05 KB)
📄
Cache_File_Cleaner_Generic_HardDelete.php
(1.05 KB)
📄
Cache_File_Generic.php
(12.54 KB)
📄
Cache_Memcache.php
(14.32 KB)
📄
Cache_Memcached.php
(18.13 KB)
📄
Cache_Memcached_Stats.php
(3.52 KB)
📄
Cache_Nginx_Memcached.php
(13.55 KB)
📄
Cache_Redis.php
(13.31 KB)
📄
Cache_Wincache.php
(12.72 KB)
📄
Cache_Xcache.php
(11.55 KB)
📄
CdnEngine.php
(2.54 KB)
📄
CdnEngine_Azure.php
(12.65 KB)
📄
CdnEngine_Azure_MI.php
(12.28 KB)
📄
CdnEngine_Azure_MI_Utility.php
(18.19 KB)
📄
CdnEngine_Base.php
(16.37 KB)
📄
CdnEngine_CloudFront.php
(12.38 KB)
📄
CdnEngine_Ftp.php
(21.08 KB)
📄
CdnEngine_GoogleDrive.php
(24.14 KB)
📄
CdnEngine_Mirror.php
(2.46 KB)
📄
CdnEngine_Mirror_Akamai.php
(3.52 KB)
📄
CdnEngine_Mirror_Att.php
(293 B)
📄
CdnEngine_Mirror_BunnyCdn.php
(4.3 KB)
📄
CdnEngine_Mirror_CloudFront.php
(10.48 KB)
📄
CdnEngine_Mirror_Cotendo.php
(3.72 KB)
📄
CdnEngine_Mirror_Edgecast.php
(4.46 KB)
📄
CdnEngine_Mirror_RackSpaceCdn.php
(6.57 KB)
📄
CdnEngine_RackSpaceCloudFiles.php
(12.01 KB)
📄
CdnEngine_S3.php
(17.55 KB)
📄
CdnEngine_S3_Compatible.php
(10.36 KB)
📄
Cdn_AdminActions.php
(16.81 KB)
📄
Cdn_AdminNotes.php
(13.71 KB)
📄
Cdn_BunnyCdn_Api.php
(15.67 KB)
📄
Cdn_BunnyCdn_Page.php
(7.4 KB)
📄
Cdn_BunnyCdn_Page_View.js
(7.36 KB)
📄
Cdn_BunnyCdn_Page_View.php
(3.6 KB)
📄
Cdn_BunnyCdn_Page_View_Purge_Urls.php
(2.06 KB)
📄
Cdn_BunnyCdn_Popup.php
(10.83 KB)
📄
Cdn_BunnyCdn_Popup_View_Configured.php
(864 B)
📄
Cdn_BunnyCdn_Popup_View_Deauthorize.php
(2.15 KB)
📄
Cdn_BunnyCdn_Popup_View_Deauthorized.php
(1.54 KB)
📄
Cdn_BunnyCdn_Popup_View_Intro.php
(1.83 KB)
📄
Cdn_BunnyCdn_Popup_View_Pull_Zones.php
(5.16 KB)
📄
Cdn_BunnyCdn_Widget.php
(2.25 KB)
📄
Cdn_BunnyCdn_Widget_View.css
(1.26 KB)
📄
Cdn_BunnyCdn_Widget_View_Authorized.php
(1.9 KB)
📄
Cdn_BunnyCdn_Widget_View_Unauthorized.php
(6.1 KB)
📄
Cdn_CacheFlush.php
(2.64 KB)
📄
Cdn_ConfigLabels.php
(5.43 KB)
📄
Cdn_Core.php
(32.83 KB)
📄
Cdn_Core_Admin.php
(27.08 KB)
📄
Cdn_Environment.php
(19.29 KB)
📄
Cdn_Environment_LiteSpeed.php
(5.19 KB)
📄
Cdn_Environment_Nginx.php
(3.92 KB)
📄
Cdn_GeneralPage_View.php
(4.05 KB)
📄
Cdn_GoogleDrive_AdminActions.php
(3.53 KB)
📄
Cdn_GoogleDrive_Page.php
(2.03 KB)
📄
Cdn_GoogleDrive_Page_View.js
(488 B)
📄
Cdn_GoogleDrive_Page_View.php
(1.36 KB)
📄
Cdn_GoogleDrive_Popup_AuthReturn.php
(1.61 KB)
📄
Cdn_GoogleDrive_Popup_AuthReturn_View.php
(1.66 KB)
📄
Cdn_Page.php
(3.5 KB)
📄
Cdn_Page_View_Fsd_HeaderActions.php
(760 B)
📄
Cdn_Plugin.php
(43.77 KB)
📄
Cdn_Plugin_Admin.php
(7.3 KB)
📄
Cdn_RackSpaceCdn_AdminActions.php
(1.28 KB)
📄
Cdn_RackSpaceCdn_Page.php
(2.05 KB)
📄
Cdn_RackSpaceCdn_Page_View.js
(4.28 KB)
📄
Cdn_RackSpaceCdn_Page_View.php
(5.22 KB)
📄
Cdn_RackSpaceCdn_Popup.php
(21.49 KB)
📄
Cdn_RackSpaceCdn_Popup_View_ConfigureDomains.php
(1.87 KB)
📄
Cdn_RackSpaceCdn_Popup_View_Intro.php
(1.71 KB)
📄
Cdn_RackSpaceCdn_Popup_View_Regions.php
(1.76 KB)
📄
Cdn_RackSpaceCdn_Popup_View_Service_Actualize.php
(2.04 KB)
📄
Cdn_RackSpaceCdn_Popup_View_Service_Create.php
(4.41 KB)
📄
Cdn_RackSpaceCdn_Popup_View_Service_Created.php
(2.48 KB)
📄
Cdn_RackSpaceCdn_Popup_View_Services.php
(1.99 KB)
📄
Cdn_RackSpaceCloudFiles_Page.php
(1.67 KB)
📄
Cdn_RackSpaceCloudFiles_Page_View.js
(681 B)
📄
Cdn_RackSpaceCloudFiles_Page_View.php
(4.91 KB)
📄
Cdn_RackSpaceCloudFiles_Popup.php
(7.62 KB)
📄
Cdn_RackSpaceCloudFiles_Popup_View_Containers.php
(2.06 KB)
📄
Cdn_RackSpaceCloudFiles_Popup_View_Intro.php
(1.71 KB)
📄
Cdn_RackSpaceCloudFiles_Popup_View_Regions.php
(1.78 KB)
📄
Cdn_RackSpace_Api_CaCert-example.pem
(195.74 KB)
📄
Cdn_RackSpace_Api_Cdn.php
(10.72 KB)
📄
Cdn_RackSpace_Api_CloudFiles.php
(8.37 KB)
📄
Cdn_RackSpace_Api_CloudFilesCdn.php
(8.48 KB)
📄
Cdn_RackSpace_Api_Tokens.php
(6.78 KB)
📄
Cdn_Util.php
(6.73 KB)
📄
Cdnfsd_BunnyCdn_Engine.php
(2.03 KB)
📄
Cdnfsd_BunnyCdn_Page.php
(683 B)
📄
Cdnfsd_BunnyCdn_Page_View.js
(3.92 KB)
📄
Cdnfsd_BunnyCdn_Page_View.php
(3.72 KB)
📄
Cdnfsd_BunnyCdn_Popup.php
(10.39 KB)
📄
Cdnfsd_BunnyCdn_Popup_View_Configured.php
(1.3 KB)
📄
Cdnfsd_BunnyCdn_Popup_View_Deauthorize.php
(2.17 KB)
📄
Cdnfsd_BunnyCdn_Popup_View_Deauthorized.php
(1.56 KB)
📄
Cdnfsd_BunnyCdn_Popup_View_Intro.php
(1.85 KB)
📄
Cdnfsd_BunnyCdn_Popup_View_Pull_Zones.php
(5.57 KB)
📄
Cdnfsd_CacheFlush.php
(8.25 KB)
📄
Cdnfsd_CloudFront_Engine.php
(3.38 KB)
📄
Cdnfsd_CloudFront_Page.php
(741 B)
📄
Cdnfsd_CloudFront_Page_View.js
(2.73 KB)
📄
Cdnfsd_CloudFront_Page_View.php
(2.04 KB)
📄
Cdnfsd_CloudFront_Popup.php
(15.46 KB)
📄
Cdnfsd_CloudFront_Popup_View_Distribution.php
(3.34 KB)
📄
Cdnfsd_CloudFront_Popup_View_Distributions.php
(1.72 KB)
📄
Cdnfsd_CloudFront_Popup_View_Intro.php
(1.65 KB)
📄
Cdnfsd_CloudFront_Popup_View_Success.php
(976 B)
📄
Cdnfsd_Core.php
(1.96 KB)
📄
Cdnfsd_GeneralPage_View.php
(4.02 KB)
📄
Cdnfsd_Plugin.php
(1.98 KB)
📄
Cdnfsd_Plugin_Admin.php
(2.63 KB)
📄
Cdnfsd_TransparentCDN_Engine.php
(7.97 KB)
📄
Cdnfsd_TransparentCDN_Page.php
(1.36 KB)
📄
Cdnfsd_TransparentCDN_Page_View.js
(1.36 KB)
📄
Cdnfsd_TransparentCDN_Page_View.php
(2.33 KB)
📄
Cdnfsd_Util.php
(834 B)
📄
Cli.php
(17.33 KB)
📄
Config.php
(16.8 KB)
📄
ConfigCache.php
(4.67 KB)
📄
ConfigCompiler.php
(17.87 KB)
📄
ConfigDbStorage.php
(15.87 KB)
📄
ConfigKeys.php
(69.92 KB)
📄
ConfigSettingsTabs.php
(1.18 KB)
📄
ConfigSettingsTabsKeys.php
(19.62 KB)
📄
ConfigState.php
(6.08 KB)
📄
ConfigStateNote.php
(1.94 KB)
📄
ConfigUtil.php
(3.45 KB)
📄
DbCache_ConfigLabels.php
(1.22 KB)
📄
DbCache_Core.php
(2.05 KB)
📄
DbCache_Environment.php
(6.41 KB)
📄
DbCache_Page.php
(1.1 KB)
📄
DbCache_Plugin.php
(9.62 KB)
📄
DbCache_Plugin_Admin.php
(5.08 KB)
📄
DbCache_Wpdb.php
(1.63 KB)
📄
DbCache_WpdbBase.php
(346 B)
📄
DbCache_WpdbInjection.php
(7.15 KB)
📄
DbCache_WpdbInjection_QueryCaching.php
(26.05 KB)
📄
DbCache_WpdbLegacy.php
(22.42 KB)
📄
DbCache_WpdbNew.php
(22.24 KB)
📄
Dispatcher.php
(8.21 KB)
📄
Enterprise_CacheFlush_MakeSnsEvent.php
(7.47 KB)
📄
Enterprise_Dbcache_WpdbInjection_Cluster.php
(30.32 KB)
📄
Enterprise_SnsBase.php
(3.07 KB)
📄
Enterprise_SnsServer.php
(5.17 KB)
📄
Extension_AlwaysCached_AdminActions.php
(2.36 KB)
📄
Extension_AlwaysCached_Environment.php
(2.87 KB)
📄
Extension_AlwaysCached_Page.php
(4 KB)
📄
Extension_AlwaysCached_Page_Queue_View.php
(3.14 KB)
📄
Extension_AlwaysCached_Page_View.js
(7.26 KB)
📄
Extension_AlwaysCached_Page_View.php
(2.51 KB)
📄
Extension_AlwaysCached_Page_View_BoxCron.php
(2.92 KB)
📄
Extension_AlwaysCached_Page_View_BoxFlushAll.php
(3.28 KB)
📄
Extension_AlwaysCached_Page_View_BoxQueue.php
(4.35 KB)
📄
Extension_AlwaysCached_Page_View_Exclusions.php
(1.11 KB)
📄
Extension_AlwaysCached_Plugin.php
(12.1 KB)
📄
Extension_AlwaysCached_Plugin_Admin.php
(3.06 KB)
📄
Extension_AlwaysCached_Queue.php
(10.22 KB)
📄
Extension_AlwaysCached_Worker.php
(2.93 KB)
📄
Extension_Amp_Page_View.php
(1.26 KB)
📄
Extension_Amp_Plugin.php
(11.1 KB)
📄
Extension_Amp_Plugin_Admin.php
(2.19 KB)
📄
Extension_CloudFlare_AdminActions.php
(1.57 KB)
📄
Extension_CloudFlare_Api.php
(12.19 KB)
📄
Extension_CloudFlare_Cdn_Page_View.php
(625 B)
📄
Extension_CloudFlare_GeneralPage_View.php
(3.05 KB)
📄
Extension_CloudFlare_Page.php
(4.32 KB)
📄
Extension_CloudFlare_Page_View.js
(1.15 KB)
📄
Extension_CloudFlare_Page_View.php
(27.38 KB)
📄
Extension_CloudFlare_Plugin.php
(15.19 KB)
📄
Extension_CloudFlare_Plugin_Admin.php
(14.13 KB)
📄
Extension_CloudFlare_Popup.php
(4.21 KB)
📄
Extension_CloudFlare_Popup_View_Intro.php
(1.75 KB)
📄
Extension_CloudFlare_Popup_View_Zones.php
(2.09 KB)
📄
Extension_CloudFlare_SettingsForUi.php
(4.84 KB)
📄
Extension_CloudFlare_View_Dashboard.js
(730 B)
📄
Extension_CloudFlare_Widget.php
(4.63 KB)
📄
Extension_CloudFlare_Widget_Logo.png
(6.96 KB)
📄
Extension_CloudFlare_Widget_View.css
(683 B)
📄
Extension_CloudFlare_Widget_View.php
(1.65 KB)
📄
Extension_FragmentCache_Api.php
(7.01 KB)
📄
Extension_FragmentCache_Core.php
(3.38 KB)
📄
Extension_FragmentCache_Environment.php
(1.41 KB)
📄
Extension_FragmentCache_GeneralPage.php
(1.27 KB)
📄
Extension_FragmentCache_GeneralPage_View.php
(2.47 KB)
📄
Extension_FragmentCache_Page.php
(697 B)
📄
Extension_FragmentCache_Page_View.php
(5.25 KB)
📄
Extension_FragmentCache_Plugin.php
(8.21 KB)
📄
Extension_FragmentCache_Plugin_Admin.php
(8.91 KB)
📄
Extension_FragmentCache_WpObjectCache.php
(16.92 KB)
📄
Extension_Genesis_Page.php
(409 B)
📄
Extension_Genesis_Page_View.php
(11.11 KB)
📄
Extension_Genesis_Plugin.php
(14.46 KB)
📄
Extension_Genesis_Plugin_Admin.php
(5.45 KB)
📄
Extension_ImageService_Api.php
(11.99 KB)
📄
Extension_ImageService_Cron.php
(6.49 KB)
📄
Extension_ImageService_Environment.php
(4.6 KB)
📄
Extension_ImageService_Page_View.php
(8.41 KB)
📄
Extension_ImageService_Plugin.php
(1.44 KB)
📄
Extension_ImageService_Plugin_Admin.css
(2.34 KB)
📄
Extension_ImageService_Plugin_Admin.js
(17.37 KB)
📄
Extension_ImageService_Plugin_Admin.php
(42.7 KB)
📄
Extension_ImageService_Widget.js
(6.17 KB)
📄
Extension_ImageService_Widget.php
(3.34 KB)
📄
Extension_ImageService_Widget_View.php
(1.59 KB)
📄
Extension_NewRelic_AdminActions.php
(1.11 KB)
📄
Extension_NewRelic_AdminNotes.php
(2.11 KB)
📄
Extension_NewRelic_Api.php
(4.03 KB)
📄
Extension_NewRelic_Core.php
(1.33 KB)
📄
Extension_NewRelic_GeneralPage.php
(1.53 KB)
📄
Extension_NewRelic_GeneralPage_View.php
(2.84 KB)
📄
Extension_NewRelic_Page.php
(1.35 KB)
📄
Extension_NewRelic_Page_View_Apm.php
(12.87 KB)
📄
Extension_NewRelic_Plugin.php
(7.09 KB)
📄
Extension_NewRelic_Plugin_Admin.php
(8.08 KB)
📄
Extension_NewRelic_Popup.php
(3.96 KB)
📄
Extension_NewRelic_Popup_View.js
(1.72 KB)
📄
Extension_NewRelic_Popup_View_Intro.php
(1.37 KB)
📄
Extension_NewRelic_Popup_View_ListApplications.php
(1.93 KB)
📄
Extension_NewRelic_Service.php
(21.65 KB)
📄
Extension_NewRelic_Widget.php
(10.48 KB)
📄
Extension_NewRelic_Widget_View.css
(1.37 KB)
📄
Extension_NewRelic_Widget_View.js
(2.42 KB)
📄
Extension_NewRelic_Widget_View_Apm.php
(2.91 KB)
📄
Extension_NewRelic_Widget_View_Browser.php
(436 B)
📄
Extension_NewRelic_Widget_View_NotConfigured.php
(233 B)
📄
Extension_Swarmify_AdminActions.php
(793 B)
📄
Extension_Swarmify_Core.php
(748 B)
📄
Extension_Swarmify_Page.php
(708 B)
📄
Extension_Swarmify_Page_View.php
(2.78 KB)
📄
Extension_Swarmify_Plugin.php
(4.63 KB)
📄
Extension_Swarmify_Plugin_Admin.php
(2.63 KB)
📄
Extension_WordPressSeo_Plugin.php
(1.39 KB)
📄
Extension_WordPressSeo_Plugin_Admin.php
(5.25 KB)
📄
Extension_Wpml_Plugin.php
(1.34 KB)
📄
Extension_Wpml_Plugin_Admin.php
(7.45 KB)
📄
Extensions_AdminActions.php
(943 B)
📄
Extensions_Page.php
(4.06 KB)
📄
Extensions_Plugin_Admin.php
(9.66 KB)
📄
Extensions_Util.php
(4.43 KB)
📄
FeatureShowcase_Plugin_Admin.php
(29.1 KB)
📄
FeatureShowcase_Plugin_Admin_View.php
(2.82 KB)
📄
Generic_AdminActions_Config.php
(6.61 KB)
📄
Generic_AdminActions_Default.php
(21.84 KB)
📄
Generic_AdminActions_Flush.php
(10.57 KB)
📄
Generic_AdminActions_Test.php
(6.15 KB)
📄
Generic_AdminNotes.php
(13.88 KB)
📄
Generic_ConfigLabels.php
(2.33 KB)
📄
Generic_Environment.php
(6.67 KB)
📄
Generic_Faq.php
(2.27 KB)
📄
Generic_GeneralPage_View_ShowEdge.js
(314 B)
📄
Generic_Page_About.php
(503 B)
📄
Generic_Page_Dashboard.php
(1.66 KB)
📄
Generic_Page_Dashboard_View.css
(6.34 KB)
📄
Generic_Page_General.php
(2.88 KB)
📄
Generic_Page_Install.php
(913 B)
📄
Generic_Page_PurgeLog.php
(2.81 KB)
📄
Generic_Page_PurgeLog_View.php
(2.97 KB)
📄
Generic_Plugin.php
(23.04 KB)
📄
Generic_Plugin_Admin.php
(48.87 KB)
📄
Generic_Plugin_AdminCompatibility.php
(3.98 KB)
📄
Generic_Plugin_AdminNotices.css
(188 B)
📄
Generic_Plugin_AdminNotices.js
(1.66 KB)
📄
Generic_Plugin_AdminNotices.php
(12.12 KB)
📄
Generic_Plugin_AdminRowActions.php
(2.43 KB)
📄
Generic_Plugin_Admin_View_Faq.php
(1007 B)
📄
Generic_Plugin_Survey.php
(4.8 KB)
📄
Generic_WidgetAccount.php
(1.05 KB)
📄
Generic_WidgetAccount_View.php
(2.1 KB)
📄
Generic_WidgetBoldGrid.php
(1.97 KB)
📄
Generic_WidgetBoldGrid_AdminActions.php
(912 B)
📄
Generic_WidgetBoldGrid_Logo.svg
(4.28 KB)
📄
Generic_WidgetBoldGrid_View.js
(625 B)
📄
Generic_WidgetBoldGrid_View.php
(872 B)
📄
Generic_WidgetPartners.php
(1.08 KB)
📄
Generic_WidgetPartners_View.php
(1.66 KB)
📄
Generic_WidgetServices.php
(1.66 KB)
📄
Generic_WidgetServices_View.php
(501 B)
📄
Generic_WidgetSettings.php
(1.05 KB)
📄
Generic_WidgetSettings_View.php
(3.37 KB)
📄
Generic_WidgetSpreadTheWord.js
(879 B)
📄
Generic_WidgetSpreadTheWord_Plugin.php
(2.03 KB)
📄
Generic_WidgetSpreadTheWord_View.php
(579 B)
📄
Generic_WidgetStats.js
(3.3 KB)
📄
Generic_WidgetStats.php
(4.84 KB)
📄
LICENSE
(17.67 KB)
📄
Licensing_AdminActions.php
(4.22 KB)
📄
Licensing_Core.php
(6.28 KB)
📄
Licensing_Plugin_Admin.php
(16.65 KB)
📄
Minify_AutoCss.php
(8.83 KB)
📄
Minify_AutoJs.php
(9.68 KB)
📄
Minify_ConfigLabels.php
(8.66 KB)
📄
Minify_ContentMinifier.php
(10.24 KB)
📄
Minify_Core.php
(7.42 KB)
📄
Minify_Environment.php
(26.91 KB)
📄
Minify_Environment_LiteSpeed.php
(977 B)
📄
Minify_Extract.php
(2.8 KB)
📄
Minify_GeneralPage_View_ShowHelp.js
(1.12 KB)
📄
Minify_GeneralPage_View_ShowHelpForce.js
(51 B)
📄
Minify_HelpPopup_View.php
(5.01 KB)
📄
Minify_MinifiedFileRequestHandler.php
(32.87 KB)
📄
Minify_Page.php
(18.45 KB)
📄
Minify_Plugin.php
(41.75 KB)
📄
Minify_Plugin_Admin.php
(11.97 KB)
📄
Mobile_Base.php
(6.85 KB)
📄
Mobile_Redirect.php
(1.85 KB)
📄
Mobile_Referrer.php
(2.4 KB)
📄
Mobile_UserAgent.php
(971 B)
📄
ModuleStatus.php
(4.37 KB)
📄
ObjectCache_ConfigLabels.php
(1.25 KB)
📄
ObjectCache_DiskPopup.js
(2.41 KB)
📄
ObjectCache_DiskPopup_View.php
(1.77 KB)
📄
ObjectCache_Environment.php
(6.79 KB)
📄
ObjectCache_Page.php
(560 B)
📄
ObjectCache_Page_View_PurgeLog.php
(1.01 KB)
📄
ObjectCache_Plugin.php
(6.54 KB)
📄
ObjectCache_Plugin_Admin.php
(6.97 KB)
📄
ObjectCache_WpObjectCache.php
(10.17 KB)
📄
ObjectCache_WpObjectCache_Regular.php
(34.11 KB)
📄
PageSpeed_Api.php
(12.16 KB)
📄
PageSpeed_Data.php
(37.19 KB)
📄
PageSpeed_Instructions.php
(43.29 KB)
📄
PageSpeed_Page.php
(8.76 KB)
📄
PageSpeed_Page_View.css
(6.21 KB)
📄
PageSpeed_Page_View.js
(9.48 KB)
📄
PageSpeed_Page_View.php
(2.08 KB)
📄
PageSpeed_Page_View_FromAPI.php
(7.65 KB)
📄
PageSpeed_Widget.php
(7.03 KB)
📄
PageSpeed_Widget_View.css
(2.62 KB)
📄
PageSpeed_Widget_View.js
(2.08 KB)
📄
PageSpeed_Widget_View.php
(1.09 KB)
📄
PageSpeed_Widget_View_FromApi.php
(3.71 KB)
📄
PgCache_ConfigLabels.php
(5.82 KB)
📄
PgCache_ContentGrabber.php
(70.95 KB)
📄
PgCache_Environment.php
(51.72 KB)
📄
PgCache_Flush.php
(16.32 KB)
📄
PgCache_Page.php
(1.6 KB)
📄
PgCache_Page_View.js
(553 B)
📄
PgCache_Plugin.php
(14.22 KB)
📄
PgCache_Plugin_Admin.php
(14.49 KB)
📄
PgCache_QsExempts.php
(1.88 KB)
📄
Root_AdminActions.php
(3.05 KB)
📄
Root_AdminActivation.php
(6.52 KB)
📄
Root_AdminMenu.php
(8.37 KB)
📄
Root_Environment.php
(7.81 KB)
📄
Root_Loader.php
(6.94 KB)
📄
SetupGuide_Plugin_Admin.php
(48.8 KB)
📄
Support_AdminActions.php
(6.14 KB)
📄
Support_Page.php
(3.08 KB)
📄
Support_Page_View_DoneContent.php
(353 B)
📄
Support_Page_View_PageContent.php
(1.39 KB)
📄
SystemOpCache_AdminActions.php
(1.18 KB)
📄
SystemOpCache_Core.php
(2.48 KB)
📄
SystemOpCache_GeneralPage_View.php
(2.27 KB)
📄
SystemOpCache_Plugin_Admin.php
(3.3 KB)
📄
UsageStatistics_AdminActions.php
(1.14 KB)
📄
UsageStatistics_Core.php
(3.39 KB)
📄
UsageStatistics_GeneralPage.php
(1.6 KB)
📄
UsageStatistics_GeneralPage_View.php
(6.18 KB)
📄
UsageStatistics_Page.php
(8.4 KB)
📄
UsageStatistics_Page_DbRequests_View.php
(1.79 KB)
📄
UsageStatistics_Page_ObjectCacheLog_View.php
(1.97 KB)
📄
UsageStatistics_Page_PageCacheRequests_View.php
(1.86 KB)
📄
UsageStatistics_Page_View.css
(1.68 KB)
📄
UsageStatistics_Page_View.js
(17.42 KB)
📄
UsageStatistics_Page_View.php
(17.13 KB)
📄
UsageStatistics_Page_View_Ad.php
(688 B)
📄
UsageStatistics_Page_View_Disabled.php
(610 B)
📄
UsageStatistics_Page_View_Free.php
(635 B)
📄
UsageStatistics_Page_View_NoDebugMode.php
(615 B)
📄
UsageStatistics_Plugin.php
(2.89 KB)
📄
UsageStatistics_Plugin_Admin.php
(5.65 KB)
📄
UsageStatistics_Source_AccessLog.php
(17.47 KB)
📄
UsageStatistics_Source_DbQueriesLog.php
(6.04 KB)
📄
UsageStatistics_Source_ObjectCacheLog.php
(5.57 KB)
📄
UsageStatistics_Source_PageCacheLog.php
(6.11 KB)
📄
UsageStatistics_Source_Wpdb.php
(3.49 KB)
📄
UsageStatistics_Sources.php
(5.41 KB)
📄
UsageStatistics_Sources_Apc.php
(3.39 KB)
📄
UsageStatistics_Sources_Memcached.php
(4.58 KB)
📄
UsageStatistics_Sources_Redis.php
(4.69 KB)
📄
UsageStatistics_StorageReader.php
(2.81 KB)
📄
UsageStatistics_StorageWriter.php
(14.38 KB)
📄
UserExperience_DeferScripts_Extension.php
(7.04 KB)
📄
UserExperience_DeferScripts_Mutator.php
(2.78 KB)
📄
UserExperience_DeferScripts_Page_View.php
(3.91 KB)
📄
UserExperience_DeferScripts_Script.js
(373 B)
📄
UserExperience_Emoji_Extension.php
(3.04 KB)
📄
UserExperience_GeneralPage.php
(1.72 KB)
📄
UserExperience_GeneralPage_View.php
(8.21 KB)
📄
UserExperience_LazyLoad_GoogleMaps_GoogleMapsEasy.php
(3.89 KB)
📄
UserExperience_LazyLoad_GoogleMaps_WPGoogleMapPlugin.php
(2.14 KB)
📄
UserExperience_LazyLoad_GoogleMaps_WPGoogleMaps.php
(3.94 KB)
📄
UserExperience_LazyLoad_Mutator.php
(9.18 KB)
📄
UserExperience_LazyLoad_Mutator_Picture.php
(2.52 KB)
📄
UserExperience_LazyLoad_Mutator_Unmutable.php
(2.88 KB)
📄
UserExperience_LazyLoad_Page_View.php
(6.46 KB)
📄
UserExperience_LazyLoad_Plugin.php
(9.17 KB)
📄
UserExperience_OEmbed_Extension.php
(795 B)
📄
UserExperience_Page.php
(527 B)
📄
UserExperience_Page_View.php
(695 B)
📄
UserExperience_Plugin_Admin.php
(3.49 KB)
📄
UserExperience_Plugin_Jquery.php
(1.4 KB)
📄
UserExperience_Preload_Requests_Extension.php
(6.15 KB)
📄
UserExperience_Preload_Requests_Page_View.php
(8.18 KB)
📄
UserExperience_Remove_CssJs_Extension.php
(6.79 KB)
📄
UserExperience_Remove_CssJs_Mutator.php
(4.45 KB)
📄
UserExperience_Remove_CssJs_Page_View.js
(10.2 KB)
📄
UserExperience_Remove_CssJs_Page_View.php
(14.59 KB)
📄
Util_Activation.php
(9.89 KB)
📄
Util_Admin.php
(25.03 KB)
📄
Util_AttachToActions.php
(7.65 KB)
📄
Util_Bus.php
(832 B)
📄
Util_ConfigLabel.php
(1.57 KB)
📄
Util_Content.php
(3.03 KB)
📄
Util_Debug.php
(6.38 KB)
📄
Util_DebugPurgeLog_Reader.php
(3.36 KB)
📄
Util_Environment.php
(42.46 KB)
📄
Util_Environment_Exception.php
(719 B)
📄
Util_Environment_Exceptions.php
(1.42 KB)
📄
Util_File.php
(13.11 KB)
📄
Util_Http.php
(5.87 KB)
📄
Util_Installed.php
(4.24 KB)
📄
Util_Mime.php
(2.9 KB)
📄
Util_PageSpeed.php
(33.92 KB)
📄
Util_PageUrls.php
(32.57 KB)
📄
Util_Request.php
(3.52 KB)
📄
Util_Rule.php
(13.83 KB)
📄
Util_Theme.php
(3.87 KB)
📄
Util_Ui.php
(83.11 KB)
📄
Util_UsageStatistics.php
(13.6 KB)
📄
Util_Widget.php
(7.88 KB)
📄
Util_WpFile.php
(16.48 KB)
📄
Util_WpFile_FilesystemChmodException.php
(1.66 KB)
📄
Util_WpFile_FilesystemCopyException.php
(1.79 KB)
📄
Util_WpFile_FilesystemMkdirException.php
(1.14 KB)
📄
Util_WpFile_FilesystemModifyException.php
(2.35 KB)
📄
Util_WpFile_FilesystemOperationException.php
(1.29 KB)
📄
Util_WpFile_FilesystemRmException.php
(1.14 KB)
📄
Util_WpFile_FilesystemRmdirException.php
(1.19 KB)
📄
Util_WpFile_FilesystemWriteException.php
(1.57 KB)
📄
Util_WpmuBlogmap.php
(8.06 KB)
📄
Varnish_Flush.php
(18.57 KB)
📄
Varnish_Plugin.php
(3.2 KB)
📁
extension-example
📁
inc
📄
index.html
(0 B)
📁
ini
📁
languages
📁
lib
📄
press.txt
(45.78 KB)
📁
pub
📄
readme.txt
(76.49 KB)
📁
vendor
📄
w3-total-cache-api.php
(22.29 KB)
📄
w3-total-cache-old-php.php
(1.25 KB)
📄
w3-total-cache.php
(2.83 KB)
📁
wp-content
Editing: Enterprise_Dbcache_WpdbInjection_Cluster.php
<?php /** * File: Enterprise_Dbcache_WpdbInjection_Cluster.php * * @package W3TC */ namespace W3TC; /** * Class Enterprise_Dbcache_WpdbInjection_Cluster * * Support of database cluster * * phpcs:disable PSR2.Classes.PropertyDeclaration.Underscore * phpcs:disable PSR2.Methods.MethodDeclaration.Underscore * phpcs:disable WordPress.PHP.NoSilencedErrors.Discouraged * phpcs:disable WordPress.WP.AlternativeFunctions * phpcs:disable WordPress.PHP.DontExtract.extract_extract * phpcs:disable WordPress.DB.RestrictedFunctions */ class Enterprise_Dbcache_WpdbInjection_Cluster extends DbCache_WpdbInjection { /** * Whether to check with fsockopen prior to mysqli_connect. * * @var bool */ public $check_tcp_responsiveness = true; /** * Minimum number of connections to try before bailing * * @var int */ public $min_tries = 3; /** * Whether to use mysqli_connect with persistence * * @var bool */ public $persistent = false; /** * Cache of tables-to-dataset mapping if blog_dataset callback defined * * @var array */ private $_blog_to_dataset = array(); /** * Optional directory of callbacks to determine datasets from queries * * @var array */ private $_callbacks = array(); /** * The multi-dimensional array of datasets and servers * * @var array */ private $_cluster_servers = array(); /** * Zone where application runs * * @var array */ private $_current_zone = array( 'name' => 'all', 'zone_priorities' => array( 'all' ), ); /** * Established connections * * @var array */ private $_connections; /** * After any SQL_CALC_FOUND_ROWS query, the query "SELECT FOUND_ROWS()" * is sent and the mysql result resource stored here. The next query * for FOUND_ROWS() will retrieve this. We do this to prevent any * intervening queries from making FOUND_ROWS() inaccessible. You may * prevent this by adding "NO_SELECT_FOUND_ROWS" in a comment. * * @var resource */ private $_last_found_rows_result; /** * The last table that was queried * * @var string */ private $_last_table; /** * Reject reason * * @var string|null */ private $_reject_reason = null; /** * Send Reads To Masters. This disables slave connections while true. * Otherwise it is an array of written tables. * * @var array */ private $_send_reads_to_master = false; /** * Send all request to master db if user is in administration. * * @var bool */ public $use_master_in_backend = true; /** * Which charset to use for connections * * @var string */ public $charset = null; /** * Which collate to use for connections * * @var string */ public $collate = null; /** * Initializes the database cluster. * * @return void */ public function initialize() { global $wpdb_cluster; $wpdb_cluster = $this; if ( ! isset( $GLOBALS['w3tc_dbcluster_config'] ) && file_exists( WP_CONTENT_DIR . '/db-cluster-config.php' ) ) { // The config file resides in WP_CONTENT_DIR. require WP_CONTENT_DIR . '/db-cluster-config.php'; } if ( isset( $GLOBALS['w3tc_dbcluster_config'] ) ) { $this->apply_configuration( $GLOBALS['w3tc_dbcluster_config'] ); } else { $this->_reject_reason = 'w3tc dbcluster configuration not found, using single-server configuration'; $this->next_injection->initialize(); return; } if ( WP_DEBUG ) { $this->wpdb_mixin->show_errors(); } $this->wpdb_mixin->dbh = null; $this->wpdb_mixin->ready = true; $this->init_charset(); } /** * Applies configuration to the database cluster. * * @param array $c { * Configuration array for the database cluster. * * @type bool $persistent Whether to enable persistent connections. * @type bool $check_tcp_responsiveness Whether to check TCP responsiveness. * @type bool $use_master_in_backend Whether to use the master database in the backend. * @type string $charset Database character set. * @type string $collate Database collation. * @type array $filters { * List of filter callbacks to add. * * @type string $function_to_add Function to add as a filter. * @type string $tag Tag for the filter. * } * @type array $databases { * List of databases to add. * * @type array $db Database configuration. * } * @type array $zones { * List of zones to add. * * @type array $zone Zone configuration, with 'name' assigned as the key. * } * } * * @return void */ public function apply_configuration( $c ) { if ( isset( $c['persistent'] ) ) { $this->persistent = $c['persistent']; } if ( isset( $c['check_tcp_responsiveness'] ) ) { $this->persistent = $c['check_tcp_responsiveness']; } if ( isset( $c['use_master_in_backend'] ) ) { $this->persistent = $c['use_master_in_backend']; } if ( isset( $c['charset'] ) ) { $this->persistent = $c['charset']; } if ( isset( $c['collate'] ) ) { $this->persistent = $c['collate']; } if ( isset( $c['filters'] ) && is_array( $c['filters'] ) ) { foreach ( $c['filters'] as $filter ) { $this->add_callback( $filter['function_to_add'], $filter['tag'] ); } } if ( isset( $c['databases'] ) && is_array( $c['databases'] ) ) { foreach ( $c['databases'] as $key => $db ) { $this->add_database( $db ); } } if ( isset( $c['zones'] ) && is_array( $c['zones'] ) ) { foreach ( $c['zones'] as $key => $zone ) { $zone['name'] = $key; $this->add_zone( $zone ); } } } /** * Initializes the charset and collation settings for the database connection. * * If DB_CHARSET not set uses utf8 * If DB_COLLATE not set uses utf8_general_ci if multisite. * * @return void */ public function init_charset() { if ( function_exists( 'is_multisite' ) && is_multisite() ) { if ( defined( 'DB_COLLATE' ) && DB_COLLATE ) { $this->wpdb_mixin->collate = DB_COLLATE; } else { $this->wpdb_mixin->collate = 'utf8_general_ci'; } } elseif ( defined( 'DB_COLLATE' ) ) { $this->wpdb_mixin->collate = DB_COLLATE; } if ( defined( 'DB_CHARSET' ) ) { $this->wpdb_mixin->charset = DB_CHARSET; } else { $this->wpdb_mixin->charset = 'utf8'; } } /** * Adds a zone to the database cluster configuration. * * @param array $zone { * Zone configuration data. * * @type array $zone_priorities Zone priority settings. Must be defined. * } * * @throws \Exception If the zone priorities key is not defined. * * @return void */ public function add_zone( $zone ) { if ( $this->_is_current_zone( $zone ) ) { if ( ! isset( $zone['zone_priorities'] ) || ! is_array( $zone['zone_priorities'] ) ) { die( 'zone_priorities key must be defined' ); } $this->_current_zone = $zone; $this->_run_callbacks( 'current_zone_set', $zone ); } } /** * Adds a database to the cluster configuration. * * @param array $db { * Database configuration data. * * @type string $dataset Dataset name. Defaults to 'global'. * @type bool $read Whether the database is for reading. Defaults to true. * @type bool $write Whether the database is for writing. Defaults to true. * @type string $zone Availability zone. Defaults to 'all'. * @type float $timeout Connection timeout. Defaults to 0.2 if not set. * @type string $name Database name. Defaults to the host if not set. * @type string $host Database host. * } * * @return void */ public function add_database( $db ) { $dataset = ( isset( $db['dataset'] ) ? $db['dataset'] : 'global' ); unset( $db['dataset'] ); $read = ( isset( $db['read'] ) ? $db['read'] : true ); unset( $db['read'] ); $write = ( isset( $db['write'] ) ? $db['write'] : true ); unset( $db['write'] ); $zone = ( isset( $db['zone'] ) ? $db['zone'] : 'all' ); unset( $db['zone'] ); if ( ! isset( $db['timeout'] ) ) { $db['timeout'] = 0.2; } if ( ! isset( $db['name'] ) ) { $db['name'] = $db['host']; } if ( $read ) { $this->_cluster_servers[ $dataset ]['read'][ $zone ][] = $db; } if ( $write ) { $this->_cluster_servers[ $dataset ]['write'][ $zone ][] = $db; } } /** * Adds a callback to a specified group. * * @param callable $callback The callback function to add. * @param string $group The group to associate with the callback. Defaults to 'dataset'. * * @return void */ public function add_callback( $callback, $group = 'dataset' ) { $this->_callbacks[ $group ][] = $callback; } /** * Sends all read operations to master servers. * * @return void */ public function send_reads_to_masters() { $this->_send_reads_to_master = true; } /** * Determines whether to send operations to master servers. * * @return bool True if operations should be sent to masters, otherwise false. */ public function send_to_masters() { return is_admin() && $this->use_master_in_backend; } /** * Establishes a database connection for a query. * * phpcs:disable Squiz.PHP.CommentedOutCode.Found * * @param string $query The SQL query for which the connection is needed. * @param bool $use_master Whether to use a master server. Defaults to null. * * @return mixed Database connection resource on success, or false on failure. * * @throws \Exception If unable to connect to the database. */ public function db_connect( $query = '', $use_master = null ) { if ( empty( $this->_cluster_servers ) ) { return $this->_db_connect_fallback(); } $this->wpdb_mixin->dbh = null; if ( empty( $query ) ) { return false; } $table_from_query = $this->_get_table_from_query( $query ); $this->_last_table = $table_from_query; $this->wpdb_mixin->table = $table_from_query; $this->callback_result = $this->_run_callbacks( 'dataset', $query ); if ( ! is_null( $this->callback_result ) ) { $dataset = $this->callback_result; } elseif ( isset( $this->_callbacks['blog_dataset'] ) ) { if ( preg_match( '/^' . $this->wpdb_mixin->base_prefix . '(\d+)_/i', $this->wpdb_mixin->table, $matches ) ) { $blog_id = $matches[1]; if ( isset( $this->_blog_to_dataset[ $blog_id ] ) ) { $dataset = $this->_blog_to_dataset[ $blog_id ]; } else { $this->callback_result = $this->_run_callbacks( 'blog_dataset', $blog_id ); if ( ! is_null( $this->callback_result ) ) { $dataset = $this->callback_result; $this->_blog_to_dataset[ $blog_id ] = $dataset; } } } } $dataset = ( isset( $dataset ) ? $dataset : 'global' ); $this->dataset = $dataset; // Determine whether the query must be sent to the master (a writable server). if ( is_null( $use_master ) ) { if ( $this->_send_reads_to_master || $this->send_to_masters() ) { $use_master = true; } elseif ( defined( 'DONOTBCLUSTER' ) && DONOTBCLUSTER ) { $use_master = true; } elseif ( $this->_is_write_query( $query ) ) { $use_master = true; } else { $use_master = false; } } if ( $use_master ) { $this->dbhname = $dataset . '__w'; $operation = 'write'; } else { $this->dbhname = $dataset . '__r'; $operation = 'read'; } // Try to reuse an existing connection. $dbh = $this->_db_connect_reuse_connection(); if ( is_object( $dbh ) ) { $this->wpdb_mixin->dbh = $dbh; return $dbh; } if ( empty( $this->_cluster_servers[ $dataset ][ $operation ] ) ) { return $this->wpdb_mixin->bail( "No databases available for dataset $dataset operation $operation" ); } // Make a list of at least $this->min_tries connections to try, repeating as necessary. $servers = array(); $server_count = 0; $retry_count = 0; do { foreach ( $this->_current_zone['zone_priorities'] as $zone ) { if ( isset( $this->_cluster_servers[ $dataset ][ $operation ][ $zone ] ) ) { $zone_servers = $this->_cluster_servers[ $dataset ][ $operation ][ $zone ]; if ( is_array( $zone_servers ) ) { $indexes = array_keys( $zone_servers ); shuffle( $indexes ); foreach ( $indexes as $index ) { $servers[] = compact( 'zone', 'index' ); } } } } $server_count = count( $servers ); // Increment the retry count and check if we've exceeded the maximum retries. ++$retry_count; } while ( $server_count < $this->min_tries && $retry_count < 3 ); // Connect to a database server. $success = false; $errno = 0; $dbhname = $this->dbhname; foreach ( $servers as $zone_index ) { // $zone, $index. extract( $zone_index, EXTR_OVERWRITE ); // $host, $user, $password, $name, $read, $write, $timeout extract( $this->_cluster_servers[ $dataset ][ $operation ][ $zone ][ $index ], EXTR_OVERWRITE ); // Split host:port into $host and $port. list( $host, $port ) = Util_Content::endpoint_to_host_port( $host, 3306 ); $this->wpdb_mixin->timer_start(); // Connect if necessary or possible. $tcp_responded = null; if ( $this->check_tcp_responsiveness ) { $tcp_responded = $this->_check_tcp_responsiveness( $host, $port, $timeout ); } $dbh = null; if ( is_null( $tcp_responded ) || $tcp_responded ) { $dbh = mysqli_init(); $socket = null; $client_flags = defined( 'MYSQL_CLIENT_FLAGS' ) ? MYSQL_CLIENT_FLAGS : 0; if ( WP_DEBUG ) { mysqli_real_connect( $dbh, $host, $user, $password, null, $port, $socket, $client_flags ); } else { @mysqli_real_connect( $dbh, $host, $user, $password, null, $port, $socket, $client_flags ); } } $elapsed = $this->wpdb_mixin->timer_stop(); if ( ! is_null( $dbh ) ) { if ( $dbh->connect_errno ) { $errno = $dbh->connect_errno; } elseif ( mysqli_select_db( $dbh, $name ) ) { $this->_connections[ $dbhname ] = array( 'dbh' => $dbh, 'database_name' => $name, ); $success = true; break; } } } if ( ! $success ) { if ( ! $use_master ) { return $this->db_connect( $query, true ); } return $this->wpdb_mixin->bail( "Unable to connect to $host:$port to $operation table '{$this->wpdb_mixin->table}' ($dataset) with $errno" ); } $dbh = $this->_connections[ $dbhname ]['dbh']; $this->wpdb_mixin->dbh = $dbh; // needed by $wpdb->_real_escape(). $this->set_charset( $dbh, $this->charset, $this->collate ); $this->set_sql_mode(); return $dbh; } /** * Checks if a given zone is the current zone. * * @param array $zone { * Zone configuration data. * * @type string $SERVER_NAME (Obsolete) Specific server name to match. * @type string[] $server_names List of server names to match. Supports wildcard '*'. * } * * @return bool True if the zone matches the current zone, otherwise false. */ public function _is_current_zone( $zone ) { $server_name = isset( $_SERVER['SERVER_NAME'] ) ? sanitize_text_field( wp_unslash( $_SERVER['SERVER_NAME'] ) ) : ''; // obsolete. if ( isset( $zone['SERVER_NAME'] ) ) { if ( $server_name === $zone['SERVER_NAME'] ) { return true; } } if ( isset( $zone['server_names'] ) ) { if ( ! is_array( $zone['server_names'] ) ) { die( 'server_names must be defined as array' ); } foreach ( $zone['server_names'] as $zone_server_name ) { if ( '*' === $zone_server_name ) { return true; } if ( $server_name === $zone_server_name ) { return true; } } } return false; } /** * Reuses an existing database connection if available. * * @return mixed Database connection resource on success, or null if no reusable connection is found. */ public function _db_connect_reuse_connection() { $dbhname = $this->dbhname; if ( ! isset( $this->_connections[ $dbhname ] ) ) { return null; } $connection = & $this->_connections[ $dbhname ]; $dbh = $connection['dbh']; if ( ! is_object( $dbh ) ) { return null; } if ( ! mysqli_ping( $dbh ) ) { // disconnect (ping failed). $this->_disconnect( $dbhname ); return null; } return $dbh; } /** * Sets the character set and collation for a database connection. * * @param mysqli $dbh The database connection handle. * @param string $charset Optional. The character set to use. Defaults to null. * @param string $collate Optional. The collation to use. Defaults to null. * * @return void */ public function set_charset( $dbh, $charset = null, $collate = null ) { if ( ! isset( $charset ) ) { $charset = $this->wpdb_mixin->charset; } if ( ! isset( $collate ) ) { $collate = $this->wpdb_mixin->collate; } if ( $this->has_cap( 'collation', $dbh ) && ! empty( $charset ) ) { if ( function_exists( 'mysqli_set_charset' ) && $this->has_cap( 'set_charset', $dbh ) ) { mysqli_set_charset( $dbh, $charset ); $this->wpdb_mixin->real_escape = true; } else { $query = $this->wpdb_mixin->prepare( 'SET NAMES %s', $charset ); if ( ! empty( $collate ) ) { $query .= $this->wpdb_mixin->prepare( ' COLLATE %s', $collate ); } mysqli_query( $dbh, $query ); } } } /** * Flushes the database cache and resets relevant properties. * * @return void */ public function flush() { $this->wpdb_mixin->last_error = ''; $this->num_rows = 0; $this->next_injection->flush(); } /** * Executes a database query and handles various query types. * * @param string $query The SQL query to execute. * * @return mixed Number of rows affected, number of rows selected, or false on failure. */ public function query( $query ) { // some queries are made before the plugins have been loaded, and thus cannot be filtered with this method. if ( function_exists( 'apply_filters' ) ) { $query = apply_filters( 'query', $query ); } $this->flush(); // Log how the function was called. $this->wpdb_mixin->func_call = "\$db->query(\"$query\")"; // Keep track of the last query for debug. $this->wpdb_mixin->last_query = $query; if ( preg_match( '/^\s*SELECT\s+FOUND_ROWS(\s*)/i', $query ) && is_object( $this->wpdb_mixin->_last_found_rows_result ) ) { $this->wpdb_mixin->result = $this->wpdb_mixin->_last_found_rows_result; $elapsed = 0; } else { $this->db_connect( $query ); if ( ! is_object( $this->wpdb_mixin->dbh ) ) { return false; } $this->wpdb_mixin->timer_start(); $this->wpdb_mixin->result = mysqli_query( $this->wpdb_mixin->dbh, $query ); $elapsed = $this->wpdb_mixin->timer_stop(); ++$this->wpdb_mixin->num_queries; if ( preg_match( '/^\s*SELECT\s+SQL_CALC_FOUND_ROWS\s/i', $query ) ) { if ( false === strpos( $query, 'NO_SELECT_FOUND_ROWS' ) ) { $this->wpdb_mixin->timer_start(); $this->wpdb_mixin->_last_found_rows_result = mysqli_query( $this->wpdb_mixin->dbh, 'SELECT FOUND_ROWS()' ); $elapsed += $this->wpdb_mixin->timer_stop(); ++$this->wpdb_mixin->num_queries; $query .= '; SELECT FOUND_ROWS()'; } } else { $this->wpdb_mixin->_last_found_rows_result = null; } } if ( function_exists( 'apply_filters' ) ) { apply_filters( 'after_query', $query ); } // If there is an error then take note of it. $this->wpdb_mixin->last_error = mysqli_error( $this->wpdb_mixin->dbh ); if ( $this->wpdb_mixin->last_error ) { $this->wpdb_mixin->print_error( $this->wpdb_mixin->last_error ); return false; } if ( preg_match( '/^\\s*(insert|delete|update|replace|alter) /i', $query ) ) { $this->wpdb_mixin->rows_affected = mysqli_affected_rows( $this->wpdb_mixin->dbh ); // Take note of the insert_id. if ( preg_match( '/^\\s*(insert|replace) /i', $query ) ) { $this->wpdb_mixin->insert_id = mysqli_insert_id( $this->wpdb_mixin->dbh ); } // Return number of rows affected. return $this->wpdb_mixin->rows_affected; } else { $i = 0; $this->wpdb_mixin->col_info = array(); $col_info = array(); if ( is_a( $this->wpdb_mixin->result, 'mysqli_result' ) ) { while ( $i < @mysqli_num_fields( $this->wpdb_mixin->result ) ) { $col_info[ $i ] = @mysqli_fetch_field( $this->wpdb_mixin->result ); ++$i; } } $this->wpdb_mixin->col_info = $col_info; $num_rows = 0; $this->wpdb_mixin->last_result = array(); do { $row = @mysqli_fetch_object( $this->wpdb_mixin->result ); if ( $row ) { $this->wpdb_mixin->last_result[ $num_rows ] = $row; ++$num_rows; } } while ( $row ); // Log number of rows the query returned. $this->num_rows = $num_rows; // Return number of rows selected. return $num_rows; } } /** * Escapes a string for safe insertion into the database. * * @param mixed $data The data to escape. * * @return string Escaped data. */ public function _escape( $data ) { if ( ! $this->wpdb_mixin->dbh ) { $this->db_connect( 'SELECT * FROM nothing' ); } return $this->wpdb_mixin->default__escape( $data ); } /** * Prepares a database query by replacing placeholders with provided arguments. * * @param string $query The SQL query with placeholders. * @param array $args The arguments to replace the placeholders. * * @return string Prepared query. */ public function prepare( $query, $args ) { if ( ! $this->wpdb_mixin->dbh ) { $this->db_connect( $query ); } return $this->wpdb_mixin->default_prepare( $query, $args ); } /** * Checks the database version and ensures compatibility with WordPress. * * @param mixed $dbh_or_table Optional. Database handle or table name to check. * * @return \WP_Error|void WP_Error if the database version is incompatible, void otherwise. */ public function check_database_version( $dbh_or_table = false ) { global $wp_version; // Make sure the server has MySQL 4.1.2. $mysqli_version = preg_replace( '|[^0-9\.]|', '', $this->wpdb_mixin->db_version( $dbh_or_table ) ); if ( version_compare( $mysqli_version, '4.1.2', '<' ) ) { return new \WP_Error( 'database_version', sprintf( // Translators: 1 WordPress version. __( '<strong>ERROR</strong>: WordPress %1$s requires MySQL 4.1.2 or higher' ), $wp_version ) ); } } /** * Determines if the database server supports collation. * * @param mixed $dbh_or_table Optional. Database handle or table name to check. * * @return bool True if collation is supported, false otherwise. */ public function supports_collation( $dbh_or_table = false ) { return $this->wpdb_mixin->has_cap( 'collation', $dbh_or_table ); } /** * Checks if the database server supports a given capability. * * @param string $db_cap The database capability to check. * @param mixed $dbh_or_table Optional. Database handle or table name to check. * * @return bool True if the capability is supported, false otherwise. */ public function has_cap( $db_cap, $dbh_or_table = false ) { $version = $this->wpdb_mixin->db_version( $dbh_or_table ); switch ( strtolower( $db_cap ) ) { case 'collation': case 'group_concat': case 'subqueries': return version_compare( $version, '4.1', '>=' ); case 'set_charset': return version_compare( $version, '5.0.7', '>=' ); } return false; } /** * Retrieves the database server version. * * @param mixed $dbh_or_table Optional. Database handle or table name to check. * * @return string|false Database version string or false on failure. */ public function db_version( $dbh_or_table = false ) { $dbh = null; if ( ! $dbh_or_table && $this->wpdb_mixin->dbh ) { $dbh = $this->wpdb_mixin->dbh; } elseif ( is_object( $dbh_or_table ) ) { $dbh = $dbh_or_table; } else { $dbh = $this->db_connect( "SELECT FROM $dbh_or_table $this->wpdb_mixin->users" ); } if ( ! is_null( $dbh ) ) { return preg_replace( '/[^0-9.].*/', '', mysqli_get_server_info( $dbh ) ); } return false; } /** * Disconnects a specific database connection. * * @param string $dbhname The name of the database connection to disconnect. * * @return void */ public function _disconnect( $dbhname ) { if ( isset( $this->_connections[ $dbhname ] ) ) { $dbh = $this->_connections[ $dbhname ]['dbh']; if ( is_object( $dbh ) ) { mysqli_close( $dbh ); } unset( $this->_connections[ $dbhname ] ); } } /** * Checks the TCP responsiveness of a given host and port. * * @param string $host The hostname to check. * @param int $port The port number to check. * @param float $float_timeout The timeout duration in seconds. * * @return string|true A message if unresponsive, true if responsive. */ public function _check_tcp_responsiveness( $host, $port, $float_timeout ) { $socket = @ fsockopen( $host, $port, $errno, $errstr, $float_timeout ); if ( false === $socket ) { return "[ > $float_timeout ] ($errno) '$errstr'"; } fclose( $socket ); return true; } /** * Extracts the table name from a SQL query. * * @param string $q The SQL query. * * @return string|null The table name or null if not found. */ public function _get_table_from_query( $q ) { // Remove characters that can legally trail the table name. $q = rtrim( $q, ';/-#' ); // allow (select...) union [...] style queries. Use the first queries table name. $q = ltrim( $q, "\t (" ); // Quickly match most common queries. if ( preg_match( '/^\s*(?:' . 'SELECT.*?\s+FROM' . '|INSERT(?:\s+IGNORE)?(?:\s+INTO)?' . '|REPLACE(?:\s+INTO)?' . '|UPDATE(?:\s+IGNORE)?' . '|DELETE(?:\s+IGNORE)?(?:\s+FROM)?' . ')\s+`?(\w+)`?/is', $q, $maybe ) ) { return $maybe[1]; } // Refer to the previous query. if ( preg_match( '/^\s*SELECT.*?\s+FOUND_ROWS\(\)/is', $q ) ) { return $this->_last_table; } // SHOW TABLE STATUS LIKE and SHOW TABLE STATUS WHERE Name =. if ( preg_match( '/^\s*SHOW\s+TABLE\s+STATUS.+(?:LIKE\s+|WHERE\s+Name\s*=\s*)\W(\w+)\W/is', $q, $maybe ) ) { return $maybe[1]; } // Big pattern for the rest of the table-related queries in MySQL 5.0. if ( preg_match( '/^\s*(?:' . '(?:EXPLAIN\s+(?:EXTENDED\s+)?)?SELECT.*?\s+FROM' . '|INSERT(?:\s+LOW_PRIORITY|\s+DELAYED|\s+HIGH_PRIORITY)?(?:\s+IGNORE)?(?:\s+INTO)?' . '|REPLACE(?:\s+LOW_PRIORITY|\s+DELAYED)?(?:\s+INTO)?' . '|UPDATE(?:\s+LOW_PRIORITY)?(?:\s+IGNORE)?' . '|DELETE(?:\s+LOW_PRIORITY|\s+QUICK|\s+IGNORE)*(?:\s+FROM)?' . '|DESCRIBE|DESC|EXPLAIN|HANDLER' . '|(?:LOCK|UNLOCK)\s+TABLE(?:S)?' . '|(?:RENAME|OPTIMIZE|BACKUP|RESTORE|CHECK|CHECKSUM|ANALYZE|OPTIMIZE|REPAIR).*\s+TABLE' . '|TRUNCATE(?:\s+TABLE)?' . '|CREATE(?:\s+TEMPORARY)?\s+TABLE(?:\s+IF\s+NOT\s+EXISTS)?' . '|ALTER(?:\s+IGNORE)?\s+TABLE' . '|DROP\s+TABLE(?:\s+IF\s+EXISTS)?' . '|CREATE(?:\s+\w+)?\s+INDEX.*\s+ON' . '|DROP\s+INDEX.*\s+ON' . '|LOAD\s+DATA.*INFILE.*INTO\s+TABLE' . '|(?:GRANT|REVOKE).*ON\s+TABLE' . '|SHOW\s+(?:.*FROM|.*TABLE)' . ')\s+`?(\w+)`?/is', $q, $maybe ) ) { return $maybe[1]; } } /** * Determines if a query modifies the database. * * @param string $q The SQL query. * * @return bool True if the query is a write operation, false otherwise. */ public function _is_write_query( $q ) { // Quick and dirty: only SELECT statements are considered read-only. $q = ltrim( $q, "\r\n\t (" ); return ! preg_match( '/^(?:SELECT|SHOW|DESCRIBE|EXPLAIN)\s/i', $q ); } /** * Runs callbacks registered for a specific group. * * @param string $group The callback group to run. * @param mixed $args Optional. Arguments to pass to the callbacks. * * @return mixed|null The result of the callback, or null if none. */ public function _run_callbacks( $group, $args = null ) { if ( ! isset( $this->_callbacks[ $group ] ) || ! is_array( $this->_callbacks[ $group ] ) ) { return null; } if ( ! isset( $args ) ) { $args = array( $this ); } elseif ( is_array( $args ) ) { $args[] = $this; } else { $args = array( $args, $this ); } foreach ( $this->_callbacks[ $group ] as $func ) { $result = call_user_func_array( $func, $args ); if ( isset( $result ) ) { return $result; } } } /** * Attempts a fallback database connection. * * @return mixed Database handle on success, or void on failure. */ public function _db_connect_fallback() { if ( is_object( $this->wpdb_mixin->dbh ) ) { return $this->wpdb_mixin->dbh; } if ( ! defined( 'DB_HOST' ) || ! defined( 'DB_USER' ) || ! defined( 'DB_PASSWORD' ) || ! defined( 'DB_NAME' ) ) { return $this->wpdb_mixin->bail( 'We were unable to query because there was no database defined.' ); } $this->wpdb_mixin->dbh = mysqli_init(); $port = null; $socket = null; $client_flags = defined( 'MYSQL_CLIENT_FLAGS' ) ? MYSQL_CLIENT_FLAGS : 0; if ( WP_DEBUG ) { mysqli_real_connect( $this->wpdb_mixin->dbh, DB_HOST, DB_USER, DB_PASSWORD, null, $port, $socket, $client_flags ); } else { @mysqli_real_connect( $this->wpdb_mixin->dbh, $host, $user, $password, null, $port, $socket, $client_flags ); } if ( ! is_object( $this->wpdb_mixin->dbh ) ) { return $this->wpdb_mixin->bail( 'We were unable to connect to the database. (DB_HOST)' ); } if ( ! mysqli_select_db( $this->wpdb_mixin->dbh, DB_NAME ) ) { return $this->wpdb_mixin->bail( 'We were unable to select the database.' ); } if ( ! empty( $this->wpdb_mixin->charset ) ) { $collation_query = "SET NAMES '{$this->wpdb_mixin->charset}'"; if ( ! empty( $this->wpdb_mixin->collate ) ) { $collation_query .= " COLLATE '{$this->wpdb_mixin->collate}'"; } mysqli_query( $this->wpdb_mixin->dbh, $collation_query ); } return $this->wpdb_mixin->dbh; } /** * Appends footer comments to indicate the use of database clustering. * * @param array $strings Existing footer comments. * * @return array Footer comments with added database cluster information. */ public function w3tc_footer_comment( $strings ) { $append = ''; if ( isset( $this->_current_zone['name'] ) && 'all' !== $this->_current_zone['name'] ) { $append .= ' with home zone ' . $this->_current_zone['name']; } if ( ! is_null( $this->_reject_reason ) ) { $append .= ' (' . $this->_reject_reason . ')'; } $strings[] = 'Database cluster enabled ' . $append; return $strings; } /** * Records usage statistics for the current request. * * @todo Implement usage statistics of requests * * @param mixed $storage Storage mechanism for the usage statistics. * * @return void */ public function w3tc_usage_statistics_of_request( $storage ) { } }
Upload File
Create Folder