W3 Total Cache - Version 0.9.5.3

Version Description

  • Fixed handling of HTTP compressed documents in PHP v5.3 (via amiga-500)
  • Fixed a bug with accelerated mobile pages (via nigrosimone)
  • Improved reliability of minify in manual mode
  • Improved JavaScript interoperability with CDATA use cases
  • Improved file name generation on Windows for IIS servers
  • Improved handling of # in URLs
  • Improved handling of exclusions for e-commerce in Genesis Framework
  • Improved handling of headers for Microsoft Azure
  • Improved functionality with existing Cloudfront Distributions when configuring Full Site Delivery
  • Improved minify debug logging
  • Improved handling of URLs that omit the protocol
  • Improved handling of custom files with CDN (via amiga-500)
  • Updated CSSTidy library (via nigrosimone and amiga-500)
  • Added Swarmify Video Optimization Extension [Hat tip the Swarmify Team]
  • Added flushing of AMP pages
Download this release

Release Info

Developer fredericktownes
Plugin Icon 128x128 W3 Total Cache
Version 0.9.5.3
Comparing to
See all releases

Code changes from version 0.9.5.2 to 0.9.5.3

Files changed (859) hide show
  1. Base_Page_Settings.php +0 -0
  2. BrowserCache_ConfigLabels.php +0 -0
  3. BrowserCache_Core.php +38 -0
  4. BrowserCache_Environment.php +1 -0
  5. BrowserCache_Page.php +1 -0
  6. BrowserCache_Plugin.php +56 -31
  7. BrowserCache_Plugin_Admin.php +0 -0
  8. Cache.php +0 -0
  9. CacheFlush.php +0 -0
  10. CacheFlush_Locally.php +0 -0
  11. Cache_Apc.php +1 -1
  12. Cache_Apcu.php +1 -1
  13. Cache_Base.php +0 -0
  14. Cache_Eaccelerator.php +1 -1
  15. Cache_File.php +1 -1
  16. Cache_File_Cleaner.php +0 -0
  17. Cache_File_Cleaner_Generic.php +3 -3
  18. Cache_File_Generic.php +5 -5
  19. Cache_Memcache.php +1 -1
  20. Cache_Memcached.php +1 -1
  21. Cache_Memcached_Stats.php +0 -0
  22. Cache_Redis.php +1 -1
  23. Cache_Wincache.php +1 -1
  24. Cache_Xcache.php +1 -1
  25. CdnEngine.php +0 -0
  26. CdnEngine_Azure.php +18 -34
  27. CdnEngine_Base.php +0 -0
  28. CdnEngine_Ftp.php +0 -0
  29. CdnEngine_GoogleDrive.php +0 -0
  30. CdnEngine_Mirror.php +0 -0
  31. CdnEngine_Mirror_Akamai.php +0 -0
  32. CdnEngine_Mirror_Att.php +0 -0
  33. CdnEngine_Mirror_Cotendo.php +0 -0
  34. CdnEngine_Mirror_Edgecast.php +0 -0
  35. CdnEngine_Mirror_Highwinds.php +0 -0
  36. CdnEngine_Mirror_MaxCdn.php +0 -0
  37. CdnEngine_Mirror_Netdna.php +0 -0
  38. CdnEngine_Mirror_RackSpaceCdn.php +0 -0
  39. CdnEngine_RackSpaceCloudFiles.php +0 -0
  40. CdnEngine_S3.php +0 -0
  41. CdnEngine_S3_Cf.php +0 -0
  42. CdnEngine_S3_Cf_Custom.php +0 -0
  43. CdnEngine_S3_Cf_S3.php +0 -0
  44. CdnEngine_S3_Compatible.php +0 -0
  45. Cdn_AdminActions.php +0 -0
  46. Cdn_AdminNotes.php +0 -0
  47. Cdn_CacheFlush.php +0 -0
  48. Cdn_CloudFrontFsd_Api.php +0 -0
  49. Cdn_CloudFrontFsd_Engine.php +0 -0
  50. Cdn_CloudFrontFsd_Page.php +0 -0
  51. Cdn_CloudFrontFsd_Page_View.js +16 -0
  52. Cdn_CloudFrontFsd_Page_View.php +0 -0
  53. Cdn_CloudFrontFsd_Popup.php +43 -0
  54. Cdn_CloudFrontFsd_Popup_View_Distribution.php +9 -6
  55. Cdn_CloudFrontFsd_Popup_View_Distributions.php +0 -0
  56. Cdn_CloudFrontFsd_Popup_View_Intro.php +0 -0
  57. Cdn_CloudFrontFsd_Popup_View_Success.php +3 -3
  58. Cdn_ConfigLabels.php +0 -0
  59. Cdn_Core.php +5 -1
  60. Cdn_Core_Admin.php +1 -1
  61. Cdn_Environment.php +0 -0
  62. Cdn_Fsd_CacheFlush.php +0 -0
  63. Cdn_Fsd_Core.php +0 -0
  64. Cdn_Fsd_Util.php +0 -0
  65. Cdn_GeneralPage_View.php +1 -1
  66. Cdn_GoogleDrive_AdminActions.php +0 -0
  67. Cdn_GoogleDrive_Page.php +0 -0
  68. Cdn_GoogleDrive_Page_View.js +0 -0
  69. Cdn_GoogleDrive_Page_View.php +0 -0
  70. Cdn_GoogleDrive_Popup_AuthReturn.php +0 -0
  71. Cdn_GoogleDrive_Popup_AuthReturn_View.php +0 -0
  72. Cdn_Highwinds_Api.php +0 -0
  73. Cdn_Highwinds_Page.php +0 -0
  74. Cdn_Highwinds_Page_View.js +0 -0
  75. Cdn_Highwinds_Page_View.php +0 -0
  76. Cdn_Highwinds_Popup.php +0 -0
  77. Cdn_Highwinds_Popup_View_ConfigureCnamesForm.php +0 -0
  78. Cdn_Highwinds_Popup_View_Intro.php +0 -0
  79. Cdn_Highwinds_Popup_View_SelectHost.php +0 -0
  80. Cdn_Highwinds_Widget.php +0 -0
  81. Cdn_Highwinds_Widget_View.css +0 -0
  82. Cdn_Highwinds_Widget_View.js +0 -0
  83. Cdn_Highwinds_Widget_View.php +0 -0
  84. Cdn_Highwinds_Widget_View_NotConfigured.php +0 -0
  85. Cdn_MaxCdnFsd_Engine.php +0 -0
  86. Cdn_MaxCdnFsd_Page.php +0 -0
  87. Cdn_MaxCdnFsd_Page_View.js +0 -0
  88. Cdn_MaxCdnFsd_Page_View.php +0 -0
  89. Cdn_MaxCdnFsd_Popup.php +0 -0
  90. Cdn_MaxCdnFsd_Popup_View_Intro.php +0 -0
  91. Cdn_MaxCdnFsd_Popup_View_Success.php +3 -3
  92. Cdn_MaxCdnFsd_Popup_View_Zone.php +0 -0
  93. Cdn_MaxCdnFsd_Popup_View_Zones.php +0 -0
  94. Cdn_Page.php +0 -0
  95. Cdn_Page_View_Fsd_HeaderActions.php +1 -1
  96. Cdn_Page_View_Header.php +0 -0
  97. Cdn_Plugin.php +23 -11
  98. Cdn_Plugin_Admin.php +0 -0
  99. Cdn_Plugin_WidgetMaxCdn.php +2 -2
  100. Cdn_Plugin_WidgetNetDna.php +0 -0
  101. Cdn_RackSpaceCdn_AdminActions.php +0 -0
  102. Cdn_RackSpaceCdn_Page.php +0 -0
  103. Cdn_RackSpaceCdn_Page_View.js +0 -0
  104. Cdn_RackSpaceCdn_Page_View.php +0 -0
  105. Cdn_RackSpaceCdn_Popup.php +0 -0
  106. Cdn_RackSpaceCdn_Popup_View_ConfigureDomains.php +0 -0
  107. Cdn_RackSpaceCdn_Popup_View_Intro.php +0 -0
  108. Cdn_RackSpaceCdn_Popup_View_Regions.php +0 -0
  109. Cdn_RackSpaceCdn_Popup_View_Service_Actualize.php +0 -0
  110. Cdn_RackSpaceCdn_Popup_View_Service_Create.php +0 -0
  111. Cdn_RackSpaceCdn_Popup_View_Service_Created.php +4 -4
  112. Cdn_RackSpaceCdn_Popup_View_Services.php +0 -0
  113. Cdn_RackSpaceCloudFiles_Page.php +0 -0
  114. Cdn_RackSpaceCloudFiles_Page_View.js +0 -0
  115. Cdn_RackSpaceCloudFiles_Page_View.php +0 -0
  116. Cdn_RackSpaceCloudFiles_Popup.php +0 -0
  117. Cdn_RackSpaceCloudFiles_Popup_View_Containers.php +0 -0
  118. Cdn_RackSpaceCloudFiles_Popup_View_Intro.php +0 -0
  119. Cdn_RackSpaceCloudFiles_Popup_View_Regions.php +0 -0
  120. Cdn_RackSpace_Api_CaCert-example.pem +0 -0
  121. Cdn_RackSpace_Api_Cdn.php +0 -0
  122. Cdn_RackSpace_Api_CloudFiles.php +0 -0
  123. Cdn_RackSpace_Api_CloudFilesCdn.php +0 -0
  124. Cdn_RackSpace_Api_Tokens.php +0 -0
  125. Cdn_Util.php +1 -1
  126. Cli.php +0 -0
  127. Config.php +0 -0
  128. ConfigCompiler.php +20 -0
  129. ConfigKeys.php +26 -9
  130. ConfigState.php +0 -0
  131. ConfigStateNote.php +0 -0
  132. DbCache_ConfigLabels.php +0 -0
  133. DbCache_Core.php +0 -0
  134. DbCache_Environment.php +0 -0
  135. DbCache_Page.php +0 -0
  136. DbCache_Plugin.php +0 -0
  137. DbCache_Plugin_Admin.php +0 -0
  138. DbCache_Wpdb.php +0 -0
  139. DbCache_WpdbBase.php +0 -0
  140. DbCache_WpdbInjection.php +0 -0
  141. DbCache_WpdbInjection_QueryCaching.php +2 -2
  142. Dispatcher.php +0 -0
  143. Enterprise_CacheFlush_MakeSnsEvent.php +0 -0
  144. Enterprise_Dbcache_WpdbInjection_Cluster.php +0 -0
  145. Enterprise_SnsBase.php +0 -0
  146. Enterprise_SnsServer.php +0 -0
  147. Extension_Amp_Plugin.php +40 -5
  148. Extension_Amp_Plugin_Admin.php +0 -0
  149. Extension_CloudFlare_AdminActions.php +0 -0
  150. Extension_CloudFlare_Api.php +0 -0
  151. Extension_CloudFlare_GeneralPage_View.php +0 -0
  152. Extension_CloudFlare_Page.php +0 -0
  153. Extension_CloudFlare_Page_View.js +0 -0
  154. Extension_CloudFlare_Page_View.php +0 -0
  155. Extension_CloudFlare_Plugin.php +0 -0
  156. Extension_CloudFlare_Plugin_Admin.php +0 -0
  157. Extension_CloudFlare_Popup.php +0 -0
  158. Extension_CloudFlare_Popup_View_Intro.php +0 -0
  159. Extension_CloudFlare_Popup_View_Zones.php +0 -0
  160. Extension_CloudFlare_SettingsForUi.php +0 -0
  161. Extension_CloudFlare_View_Comments.css +0 -0
  162. Extension_CloudFlare_View_Comments.js +0 -0
  163. Extension_CloudFlare_View_Dashboard.js +0 -0
  164. Extension_CloudFlare_Widget.php +0 -0
  165. Extension_CloudFlare_Widget_Logo.png +0 -0
  166. Extension_CloudFlare_Widget_View.css +0 -0
  167. Extension_CloudFlare_Widget_View.php +0 -0
  168. Extension_FeedBurner_Environment.php +0 -0
  169. Extension_FeedBurner_Page.php +0 -0
  170. Extension_FeedBurner_Page_View.php +0 -0
  171. Extension_FeedBurner_Plugin.php +0 -0
  172. Extension_FeedBurner_Plugin_Admin.php +0 -0
  173. Extension_FragmentCache_Api.php +0 -0
  174. Extension_FragmentCache_Core.php +0 -0
  175. Extension_FragmentCache_Environment.php +0 -0
  176. Extension_FragmentCache_GeneralPage.php +0 -0
  177. Extension_FragmentCache_GeneralPage_View.php +0 -0
  178. Extension_FragmentCache_Page.php +0 -0
  179. Extension_FragmentCache_Page_View.php +0 -0
  180. Extension_FragmentCache_Plugin.php +0 -0
  181. Extension_FragmentCache_Plugin_Admin.php +0 -0
  182. Extension_FragmentCache_WpObjectCache.php +0 -0
  183. Extension_Genesis_Page.php +0 -0
  184. Extension_Genesis_Page_View.php +6 -0
  185. Extension_Genesis_Plugin.php +0 -0
  186. Extension_Genesis_Plugin_Admin.php +0 -0
  187. Extension_NewRelic_AdminActions.php +0 -0
  188. Extension_NewRelic_AdminNotes.php +0 -0
  189. Extension_NewRelic_Api.php +0 -0
  190. Extension_NewRelic_Core.php +0 -0
  191. Extension_NewRelic_GeneralPage.php +0 -0
  192. Extension_NewRelic_GeneralPage_View.php +0 -0
  193. Extension_NewRelic_Page.php +0 -0
  194. Extension_NewRelic_Page_View_Apm.php +0 -0
  195. Extension_NewRelic_Plugin.php +9 -1
  196. Extension_NewRelic_Plugin_Admin.php +0 -0
  197. Extension_NewRelic_Popup.php +0 -0
  198. Extension_NewRelic_Popup_View.js +0 -0
  199. Extension_NewRelic_Popup_View_Intro.php +0 -0
  200. Extension_NewRelic_Popup_View_ListApplications.php +0 -0
  201. Extension_NewRelic_Service.php +0 -0
  202. Extension_NewRelic_Widget.php +2 -2
  203. Extension_NewRelic_Widget_View.css +0 -0
  204. Extension_NewRelic_Widget_View.js +0 -0
  205. Extension_NewRelic_Widget_View_Apm.php +0 -0
  206. Extension_NewRelic_Widget_View_Browser.php +0 -0
  207. Extension_NewRelic_Widget_View_NotConfigured.php +0 -0
  208. Extension_Swarmify_AdminActions.php +18 -0
  209. Extension_Swarmify_Core.php +21 -0
  210. Extension_Swarmify_Page.php +30 -0
  211. Extension_Swarmify_Page_View.php +83 -0
  212. Extension_Swarmify_Plugin.php +146 -0
  213. Extension_Swarmify_Plugin_Admin.php +94 -0
  214. Extension_Swarmify_Widget.php +236 -0
  215. Extension_Swarmify_Widget_View.css +33 -0
  216. Extension_Swarmify_Widget_View_NotConfigured.php +17 -0
  217. Extension_WordPressSeo_Plugin.php +0 -0
  218. Extension_WordPressSeo_Plugin_Admin.php +0 -0
  219. Extension_Wpml_Plugin.php +0 -0
  220. Extension_Wpml_Plugin_Admin.php +0 -0
  221. Extensions_AdminActions.php +0 -0
  222. Extensions_Page.php +0 -0
  223. Extensions_Plugin_Admin.php +4 -0
  224. Extensions_Util.php +0 -0
  225. Generic_AdminActions_Config.php +0 -0
  226. Generic_AdminActions_Default.php +0 -0
  227. Generic_AdminActions_EdgeMode.php +0 -0
  228. Generic_AdminActions_Flush.php +18 -0
  229. Generic_AdminActions_Test.php +0 -0
  230. Generic_AdminLinks.php +0 -0
  231. Generic_AdminNotes.php +0 -0
  232. Generic_ConfigLabels.php +0 -0
  233. Generic_Environment.php +0 -0
  234. Generic_Faq.php +0 -0
  235. Generic_GeneralPage_View_ShowEdge.js +0 -0
  236. Generic_GeneralPage_View_ShowSupportUs.js +0 -0
  237. Generic_Page_About.php +0 -0
  238. Generic_Page_Dashboard.php +0 -0
  239. Generic_Page_Dashboard_View.css +0 -0
  240. Generic_Page_Faq.php +0 -0
  241. Generic_Page_General.php +0 -0
  242. Generic_Page_Install.php +0 -0
  243. Generic_Plugin.php +12 -3
  244. Generic_Plugin_Admin.php +4 -4
  245. Generic_Plugin_AdminCompatibility.php +0 -0
  246. Generic_Plugin_AdminNotifications.php +0 -0
  247. Generic_Plugin_AdminRowActions.php +0 -0
  248. Generic_Plugin_WidgetForum.php +0 -0
  249. Generic_Plugin_WidgetNews.php +0 -0
  250. Generic_WidgetServices.php +0 -0
  251. Generic_WidgetServices_View.php +0 -0
  252. Generic_WidgetSpreadTheWord.js +0 -0
  253. Generic_WidgetSpreadTheWord_Plugin.php +0 -0
  254. Generic_WidgetSpreadTheWord_View.php +0 -0
  255. Licensing_AdminActions.php +0 -0
  256. Licensing_Core.php +0 -0
  257. Licensing_Plugin_Admin.php +11 -0
  258. Minify_ConfigLabels.php +2 -0
  259. Minify_ContentMinifier.php +2 -0
  260. Minify_Core.php +0 -0
  261. Minify_Environment.php +21 -21
  262. Minify_Extract.php +0 -0
  263. Minify_GeneralPage_View_ShowHelp.js +0 -0
  264. Minify_GeneralPage_View_ShowHelpForce.js +0 -0
  265. Minify_HelpPopup_View.php +0 -0
  266. Minify_MinifiedFileRequestHandler.php +5 -3
  267. Minify_Page.php +0 -0
  268. Minify_Plugin.php +37 -26
  269. Minify_Plugin_Admin.php +1 -1
  270. Mobile_Base.php +0 -0
  271. Mobile_Page_ReferrerGroups.php +0 -0
  272. Mobile_Page_UserAgentGroups.php +0 -0
  273. Mobile_Redirect.php +0 -0
  274. Mobile_Referrer.php +0 -0
  275. Mobile_UserAgent.php +0 -0
  276. ModuleStatus.php +0 -0
  277. ObjectCache_ConfigLabels.php +0 -0
  278. ObjectCache_Environment.php +0 -0
  279. ObjectCache_Page.php +0 -0
  280. ObjectCache_Plugin.php +0 -0
  281. ObjectCache_Plugin_Admin.php +0 -0
  282. ObjectCache_WpObjectCache.php +0 -0
  283. ObjectCache_WpObjectCache_Regular.php +0 -0
  284. PageSpeed_Api.php +0 -0
  285. PageSpeed_Plugin_Widget.php +3 -2
  286. PageSpeed_Widget_View.css +0 -0
  287. PageSpeed_Widget_View.js +0 -0
  288. PageSpeed_Widget_View.php +0 -0
  289. PageSpeed_Widget_View_NotConfigured.php +0 -0
  290. PgCache_ConfigLabels.php +0 -0
  291. PgCache_ContentGrabber.php +4 -2
  292. PgCache_Environment.php +4 -0
  293. PgCache_Flush.php +5 -4
  294. PgCache_Page.php +0 -0
  295. PgCache_Plugin.php +0 -0
  296. PgCache_Plugin_Admin.php +0 -0
  297. Root_AdminActions.php +0 -0
  298. Root_AdminActivation.php +1 -2
  299. Root_AdminMenu.php +0 -0
  300. Root_Environment.php +8 -9
  301. Root_Loader.php +0 -0
  302. Support_AdminActions.php +0 -0
  303. Support_Page.php +0 -0
  304. Support_Page_View_DoneContent.php +0 -0
  305. Support_Page_View_PageContent.php +0 -0
  306. SystemOpCache_AdminActions.php +0 -0
  307. SystemOpCache_Core.php +0 -0
  308. SystemOpCache_GeneralPage_View.php +0 -0
  309. SystemOpCache_Plugin_Admin.php +0 -0
  310. UsageStatistics_Core.php +0 -0
  311. UsageStatistics_Plugin.php +0 -0
  312. UsageStatistics_Plugin_Admin.php +0 -0
  313. UsageStatistics_StorageReader.php +0 -0
  314. UsageStatistics_StorageWriter.php +0 -0
  315. UsageStatistics_View_General.php +0 -0
  316. UsageStatistics_Widget.php +3 -3
  317. UsageStatistics_Widget_View.css +0 -0
  318. UsageStatistics_Widget_View.js +0 -0
  319. UsageStatistics_Widget_View.php +0 -0
  320. UsageStatistics_Widget_View_Disabled.php +0 -0
  321. Util_Activation.php +0 -0
  322. Util_Admin.php +2 -0
  323. Util_AttachToActions.php +0 -0
  324. Util_Bus.php +0 -0
  325. Util_ConfigLabel.php +0 -0
  326. Util_Content.php +0 -0
  327. Util_Debug.php +0 -0
  328. Util_Environment.php +17 -0
  329. Util_Environment_Exception.php +0 -0
  330. Util_Environment_Exceptions.php +0 -0
  331. Util_File.php +0 -0
  332. Util_Http.php +0 -0
  333. Util_Installed.php +0 -0
  334. Util_Mime.php +0 -0
  335. Util_PageUrls.php +5 -5
  336. Util_Request.php +0 -0
  337. Util_Rule.php +4 -1
  338. Util_RuleSnippet.php +0 -0
  339. Util_Theme.php +0 -0
  340. Util_Ui.php +4 -0
  341. Util_UsageStatistics.php +0 -0
  342. Util_Widget.php +0 -0
  343. Util_WpFile.php +0 -0
  344. Util_WpFile_FilesystemChmodException.php +0 -0
  345. Util_WpFile_FilesystemCopyException.php +0 -0
  346. Util_WpFile_FilesystemMkdirException.php +0 -0
  347. Util_WpFile_FilesystemModifyException.php +0 -0
  348. Util_WpFile_FilesystemOperationException.php +0 -0
  349. Util_WpFile_FilesystemRmException.php +0 -0
  350. Util_WpFile_FilesystemRmdirException.php +0 -0
  351. Util_WpFile_FilesystemWriteException.php +0 -0
  352. Util_WpmuBlogmap.php +0 -0
  353. Varnish_Flush.php +11 -10
  354. Varnish_Plugin.php +0 -0
  355. changelog.txt +0 -0
  356. extension-example/Extension_Example.php +0 -0
  357. extension-example/Extension_Example_Admin.php +0 -0
  358. extension-example/Extension_Example_Page_View.php +0 -0
  359. extension-example/w3-total-cache-example.php +0 -0
  360. inc/define.php +0 -0
  361. inc/email/index.html +0 -0
  362. inc/email/minify_error_notification.html +0 -0
  363. inc/email/minify_error_notification.php +0 -0
  364. inc/email/support_request.php +0 -0
  365. inc/error.php +0 -0
  366. inc/index.html +0 -0
  367. inc/lightbox/cdn_s3_bucket_location.php +0 -0
  368. inc/lightbox/create_netdna_maxcdn_pull_zone.php +0 -0
  369. inc/lightbox/edge.php +0 -0
  370. inc/lightbox/index.html +0 -0
  371. inc/lightbox/minify_recommendations.php +0 -0
  372. inc/lightbox/purchase.php +0 -0
  373. inc/lightbox/self_test.php +1 -1
  374. inc/lightbox/support_us.php +0 -0
  375. inc/lightbox/upgrade.php +0 -0
  376. inc/mime/all.php +0 -0
  377. inc/mime/cssjs.php +0 -0
  378. inc/mime/html.php +0 -0
  379. inc/mime/index.html +0 -0
  380. inc/mime/other.php +0 -0
  381. inc/options/about.php +0 -0
  382. inc/options/browsercache.php +20 -0
  383. inc/options/cdn.php +0 -0
  384. inc/options/cdn/akamai.php +0 -0
  385. inc/options/cdn/att.php +0 -0
  386. inc/options/cdn/azure.php +0 -0
  387. inc/options/cdn/cf.php +0 -0
  388. inc/options/cdn/cf2.php +0 -0
  389. inc/options/cdn/common/cnames-readonly.php +0 -0
  390. inc/options/cdn/common/cnames.php +0 -0
  391. inc/options/cdn/common/index.html +0 -0
  392. inc/options/cdn/cotendo.php +0 -0
  393. inc/options/cdn/edgecast.php +0 -0
  394. inc/options/cdn/ftp.php +0 -0
  395. inc/options/cdn/index.html +0 -0
  396. inc/options/cdn/maxcdn.php +0 -0
  397. inc/options/cdn/mirror.php +0 -0
  398. inc/options/cdn/netdna.php +0 -0
  399. inc/options/cdn/rscf.php +0 -0
  400. inc/options/cdn/s3.php +0 -0
  401. inc/options/cdn/s3_compatible.php +0 -0
  402. inc/options/common/footer.php +0 -0
  403. inc/options/common/header.php +0 -0
  404. inc/options/common/help.php +0 -0
  405. inc/options/common/index.html +0 -0
  406. inc/options/dashboard.php +0 -0
  407. inc/options/dbcache.php +0 -0
  408. inc/options/edd/buy.php +0 -0
  409. inc/options/enterprise/dbcluster-config.php +0 -0
  410. inc/options/enterprise/dbcluster_general_section.php +0 -0
  411. inc/options/extensions.php +0 -0
  412. inc/options/extensions/list.php +0 -0
  413. inc/options/extensions/settings.php +0 -0
  414. inc/options/faq.php +0 -0
  415. inc/options/general.php +2 -2
  416. inc/options/index.html +0 -0
  417. inc/options/install.php +0 -0
  418. inc/options/minify.php +6 -6
  419. inc/options/minify/ccjs.php +0 -0
  420. inc/options/minify/ccjs2.php +0 -0
  421. inc/options/minify/css.php +1 -1
  422. inc/options/minify/csstidy.php +7 -4
  423. inc/options/minify/csstidy2.php +38 -37
  424. inc/options/minify/googleccjs2.php +0 -0
  425. inc/options/minify/html.php +0 -0
  426. inc/options/minify/htmltidy.php +0 -0
  427. inc/options/minify/htmltidy2.php +0 -0
  428. inc/options/minify/index.html +0 -0
  429. inc/options/minify/js.php +0 -0
  430. inc/options/minify/yuicss2.php +0 -0
  431. inc/options/minify/yuijs.php +0 -0
  432. inc/options/minify/yuijs2.php +0 -0
  433. inc/options/mobile.php +0 -0
  434. inc/options/objectcache.php +0 -0
  435. inc/options/parts/memcached.php +1 -1
  436. inc/options/parts/memcached_extension.php +1 -1
  437. inc/options/parts/redis.php +0 -0
  438. inc/options/parts/redis_extension.php +0 -0
  439. inc/options/pgcache.php +1 -1
  440. inc/options/referrer.php +0 -0
  441. inc/options/support.php +0 -0
  442. inc/popup/cdn_export_file.php +0 -0
  443. inc/popup/cdn_export_library.php +0 -0
  444. inc/popup/cdn_import_library.php +0 -0
  445. inc/popup/cdn_purge.php +0 -0
  446. inc/popup/cdn_queue.php +0 -0
  447. inc/popup/cdn_rename_domain.php +0 -0
  448. inc/popup/common/footer.php +0 -0
  449. inc/popup/common/header.php +0 -0
  450. inc/popup/common/index.html +0 -0
  451. inc/popup/index.html +0 -0
  452. inc/popup/pagespeed_results.php +0 -0
  453. inc/widget/index.html +0 -0
  454. inc/widget/latest.php +0 -0
  455. inc/widget/latest_ajax.php +0 -0
  456. inc/widget/latest_control.php +0 -0
  457. inc/widget/latest_news.php +0 -0
  458. inc/widget/latest_news_ajax.php +0 -0
  459. inc/widget/latest_news_control.php +0 -0
  460. inc/widget/maxcdn.php +0 -0
  461. inc/widget/maxcdn_signup.php +0 -0
  462. inc/widget/netdna.php +0 -0
  463. inc/widget/netdna_signup.php +0 -0
  464. index.html +0 -0
  465. ini/apc.ini +0 -0
  466. ini/dbcluster-config-sample.php +0 -0
  467. ini/eaccelerator.ini +0 -0
  468. ini/index.html +0 -0
  469. ini/memcache.ini +0 -0
  470. ini/nginx-network-sample-config.conf +0 -0
  471. ini/nginx-standalone-sample-config.conf +0 -0
  472. ini/opcache.ini +0 -0
  473. ini/php.append.ini +0 -0
  474. ini/s3-sample-policy.txt +0 -0
  475. ini/varnish-sample-config.vcl +0 -0
  476. ini/web.config +36 -0
  477. ini/xcache.ini +0 -0
  478. languages/ar.mo +0 -0
  479. languages/faq-en_US.xml +1 -1
  480. languages/faq-enterprise-en_US.xml +0 -0
  481. languages/faq-pro-en_US.xml +0 -0
  482. languages/w3-total-cache-ar_AR.po +1 -1
  483. languages/w3-total-cache-nl_NL.mo +0 -0
  484. languages/w3-total-cache-nl_NL.po +1 -1
  485. languages/w3-total-cache-pl_PL.po +1 -1
  486. languages/w3-total-cache-sr_RS.mo +0 -0
  487. languages/w3-total-cache-sr_RS.po +1 -1
  488. languages/w3-total-cache.pot +1 -1
  489. lib/Azure/GuzzleHttp/Client.php +0 -0
  490. lib/Azure/GuzzleHttp/ClientInterface.php +0 -0
  491. lib/Azure/GuzzleHttp/Cookie/CookieJar.php +0 -0
  492. lib/Azure/GuzzleHttp/Cookie/CookieJarInterface.php +0 -0
  493. lib/Azure/GuzzleHttp/Cookie/FileCookieJar.php +0 -0
  494. lib/Azure/GuzzleHttp/Cookie/SessionCookieJar.php +0 -0
  495. lib/Azure/GuzzleHttp/Cookie/SetCookie.php +0 -0
  496. lib/Azure/GuzzleHttp/Exception/BadResponseException.php +0 -0
  497. lib/Azure/GuzzleHttp/Exception/ClientException.php +0 -0
  498. lib/Azure/GuzzleHttp/Exception/ConnectException.php +0 -0
  499. lib/Azure/GuzzleHttp/Exception/GuzzleException.php +0 -0
  500. lib/Azure/GuzzleHttp/Exception/RequestException.php +0 -0
  501. lib/Azure/GuzzleHttp/Exception/SeekException.php +0 -0
  502. lib/Azure/GuzzleHttp/Exception/ServerException.php +0 -0
  503. lib/Azure/GuzzleHttp/Exception/TooManyRedirectsException.php +0 -0
  504. lib/Azure/GuzzleHttp/Exception/TransferException.php +0 -0
  505. lib/Azure/GuzzleHttp/Handler/CurlFactory.php +0 -0
  506. lib/Azure/GuzzleHttp/Handler/CurlFactoryInterface.php +0 -0
  507. lib/Azure/GuzzleHttp/Handler/CurlHandler.php +0 -0
  508. lib/Azure/GuzzleHttp/Handler/CurlMultiHandler.php +0 -0
  509. lib/Azure/GuzzleHttp/Handler/EasyHandle.php +0 -0
  510. lib/Azure/GuzzleHttp/Handler/MockHandler.php +0 -0
  511. lib/Azure/GuzzleHttp/Handler/Proxy.php +0 -0
  512. lib/Azure/GuzzleHttp/Handler/StreamHandler.php +0 -0
  513. lib/Azure/GuzzleHttp/HandlerStack.php +0 -0
  514. lib/Azure/GuzzleHttp/MessageFormatter.php +0 -0
  515. lib/Azure/GuzzleHttp/Middleware.php +0 -0
  516. lib/Azure/GuzzleHttp/Pool.php +0 -0
  517. lib/Azure/GuzzleHttp/PrepareBodyMiddleware.php +0 -0
  518. lib/Azure/GuzzleHttp/Promise/AggregateException.php +0 -0
  519. lib/Azure/GuzzleHttp/Promise/CancellationException.php +0 -0
  520. lib/Azure/GuzzleHttp/Promise/Coroutine.php +0 -0
  521. lib/Azure/GuzzleHttp/Promise/EachPromise.php +0 -0
  522. lib/Azure/GuzzleHttp/Promise/FulfilledPromise.php +0 -0
  523. lib/Azure/GuzzleHttp/Promise/Promise.php +0 -0
  524. lib/Azure/GuzzleHttp/Promise/PromiseInterface.php +0 -0
  525. lib/Azure/GuzzleHttp/Promise/PromisorInterface.php +0 -0
  526. lib/Azure/GuzzleHttp/Promise/RejectedPromise.php +0 -0
  527. lib/Azure/GuzzleHttp/Promise/RejectionException.php +0 -0
  528. lib/Azure/GuzzleHttp/Promise/TaskQueue.php +0 -0
  529. lib/Azure/GuzzleHttp/Promise/TaskQueueInterface.php +0 -0
  530. lib/Azure/GuzzleHttp/Promise/functions.php +0 -0
  531. lib/Azure/GuzzleHttp/Promise/functions_include.php +0 -0
  532. lib/Azure/GuzzleHttp/Psr7/AppendStream.php +0 -0
  533. lib/Azure/GuzzleHttp/Psr7/BufferStream.php +0 -0
  534. lib/Azure/GuzzleHttp/Psr7/CachingStream.php +0 -0
  535. lib/Azure/GuzzleHttp/Psr7/DroppingStream.php +0 -0
  536. lib/Azure/GuzzleHttp/Psr7/FnStream.php +0 -0
  537. lib/Azure/GuzzleHttp/Psr7/InflateStream.php +0 -0
  538. lib/Azure/GuzzleHttp/Psr7/LazyOpenStream.php +0 -0
  539. lib/Azure/GuzzleHttp/Psr7/LimitStream.php +0 -0
  540. lib/Azure/GuzzleHttp/Psr7/MessageTrait.php +0 -0
  541. lib/Azure/GuzzleHttp/Psr7/MultipartStream.php +0 -0
  542. lib/Azure/GuzzleHttp/Psr7/NoSeekStream.php +0 -0
  543. lib/Azure/GuzzleHttp/Psr7/PumpStream.php +0 -0
  544. lib/Azure/GuzzleHttp/Psr7/Request.php +0 -0
  545. lib/Azure/GuzzleHttp/Psr7/Response.php +0 -0
  546. lib/Azure/GuzzleHttp/Psr7/ServerRequest.php +0 -0
  547. lib/Azure/GuzzleHttp/Psr7/Stream.php +0 -0
  548. lib/Azure/GuzzleHttp/Psr7/StreamDecoratorTrait.php +0 -0
  549. lib/Azure/GuzzleHttp/Psr7/StreamWrapper.php +0 -0
  550. lib/Azure/GuzzleHttp/Psr7/UploadedFile.php +0 -0
  551. lib/Azure/GuzzleHttp/Psr7/Uri.php +0 -0
  552. lib/Azure/GuzzleHttp/Psr7/functions.php +0 -0
  553. lib/Azure/GuzzleHttp/Psr7/functions_include.php +0 -0
  554. lib/Azure/GuzzleHttp/RedirectMiddleware.php +0 -0
  555. lib/Azure/GuzzleHttp/RequestOptions.php +0 -0
  556. lib/Azure/GuzzleHttp/RetryMiddleware.php +0 -0
  557. lib/Azure/GuzzleHttp/TransferStats.php +0 -0
  558. lib/Azure/GuzzleHttp/UriTemplate.php +0 -0
  559. lib/Azure/GuzzleHttp/functions.php +0 -0
  560. lib/Azure/GuzzleHttp/functions_include.php +0 -0
  561. lib/Azure/MicrosoftAzureStorage/Blob/BlobRestProxy.php +0 -0
  562. lib/Azure/MicrosoftAzureStorage/Blob/Internal/IBlob.php +0 -0
  563. lib/Azure/MicrosoftAzureStorage/Blob/Models/AccessCondition.php +0 -0
  564. lib/Azure/MicrosoftAzureStorage/Blob/Models/AccessPolicy.php +0 -0
  565. lib/Azure/MicrosoftAzureStorage/Blob/Models/AcquireLeaseOptions.php +0 -0
  566. lib/Azure/MicrosoftAzureStorage/Blob/Models/AcquireLeaseResult.php +0 -0
  567. lib/Azure/MicrosoftAzureStorage/Blob/Models/Blob.php +0 -0
  568. lib/Azure/MicrosoftAzureStorage/Blob/Models/BlobBlockType.php +0 -0
  569. lib/Azure/MicrosoftAzureStorage/Blob/Models/BlobPrefix.php +0 -0
  570. lib/Azure/MicrosoftAzureStorage/Blob/Models/BlobProperties.php +0 -0
  571. lib/Azure/MicrosoftAzureStorage/Blob/Models/BlobServiceOptions.php +0 -0
  572. lib/Azure/MicrosoftAzureStorage/Blob/Models/BlobType.php +0 -0
  573. lib/Azure/MicrosoftAzureStorage/Blob/Models/Block.php +0 -0
  574. lib/Azure/MicrosoftAzureStorage/Blob/Models/BlockList.php +0 -0
  575. lib/Azure/MicrosoftAzureStorage/Blob/Models/BreakLeaseResult.php +0 -0
  576. lib/Azure/MicrosoftAzureStorage/Blob/Models/CommitBlobBlocksOptions.php +0 -0
  577. lib/Azure/MicrosoftAzureStorage/Blob/Models/Container.php +0 -0
  578. lib/Azure/MicrosoftAzureStorage/Blob/Models/ContainerACL.php +0 -0
  579. lib/Azure/MicrosoftAzureStorage/Blob/Models/ContainerProperties.php +0 -0
  580. lib/Azure/MicrosoftAzureStorage/Blob/Models/CopyBlobOptions.php +0 -0
  581. lib/Azure/MicrosoftAzureStorage/Blob/Models/CopyBlobResult.php +0 -0
  582. lib/Azure/MicrosoftAzureStorage/Blob/Models/CreateBlobBlockOptions.php +0 -0
  583. lib/Azure/MicrosoftAzureStorage/Blob/Models/CreateBlobOptions.php +0 -0
  584. lib/Azure/MicrosoftAzureStorage/Blob/Models/CreateBlobPagesOptions.php +0 -0
  585. lib/Azure/MicrosoftAzureStorage/Blob/Models/CreateBlobPagesResult.php +0 -0
  586. lib/Azure/MicrosoftAzureStorage/Blob/Models/CreateBlobSnapshotOptions.php +0 -0
  587. lib/Azure/MicrosoftAzureStorage/Blob/Models/CreateBlobSnapshotResult.php +0 -0
  588. lib/Azure/MicrosoftAzureStorage/Blob/Models/CreateContainerOptions.php +0 -0
  589. lib/Azure/MicrosoftAzureStorage/Blob/Models/DeleteBlobOptions.php +0 -0
  590. lib/Azure/MicrosoftAzureStorage/Blob/Models/DeleteContainerOptions.php +0 -0
  591. lib/Azure/MicrosoftAzureStorage/Blob/Models/GetBlobMetadataOptions.php +0 -0
  592. lib/Azure/MicrosoftAzureStorage/Blob/Models/GetBlobMetadataResult.php +0 -0
  593. lib/Azure/MicrosoftAzureStorage/Blob/Models/GetBlobOptions.php +0 -0
  594. lib/Azure/MicrosoftAzureStorage/Blob/Models/GetBlobPropertiesOptions.php +0 -0
  595. lib/Azure/MicrosoftAzureStorage/Blob/Models/GetBlobPropertiesResult.php +0 -0
  596. lib/Azure/MicrosoftAzureStorage/Blob/Models/GetBlobResult.php +0 -0
  597. lib/Azure/MicrosoftAzureStorage/Blob/Models/GetContainerACLResult.php +0 -0
  598. lib/Azure/MicrosoftAzureStorage/Blob/Models/GetContainerPropertiesResult.php +0 -0
  599. lib/Azure/MicrosoftAzureStorage/Blob/Models/LeaseMode.php +0 -0
  600. lib/Azure/MicrosoftAzureStorage/Blob/Models/ListBlobBlocksOptions.php +0 -0
  601. lib/Azure/MicrosoftAzureStorage/Blob/Models/ListBlobBlocksResult.php +0 -0
  602. lib/Azure/MicrosoftAzureStorage/Blob/Models/ListBlobsOptions.php +0 -0
  603. lib/Azure/MicrosoftAzureStorage/Blob/Models/ListBlobsResult.php +0 -0
  604. lib/Azure/MicrosoftAzureStorage/Blob/Models/ListContainersOptions.php +0 -0
  605. lib/Azure/MicrosoftAzureStorage/Blob/Models/ListContainersResult.php +0 -0
  606. lib/Azure/MicrosoftAzureStorage/Blob/Models/ListPageBlobRangesOptions.php +0 -0
  607. lib/Azure/MicrosoftAzureStorage/Blob/Models/ListPageBlobRangesResult.php +0 -0
  608. lib/Azure/MicrosoftAzureStorage/Blob/Models/PageRange.php +0 -0
  609. lib/Azure/MicrosoftAzureStorage/Blob/Models/PageWriteOption.php +0 -0
  610. lib/Azure/MicrosoftAzureStorage/Blob/Models/PublicAccessType.php +0 -0
  611. lib/Azure/MicrosoftAzureStorage/Blob/Models/SetBlobMetadataOptions.php +0 -0
  612. lib/Azure/MicrosoftAzureStorage/Blob/Models/SetBlobMetadataResult.php +0 -0
  613. lib/Azure/MicrosoftAzureStorage/Blob/Models/SetBlobPropertiesOptions.php +0 -0
  614. lib/Azure/MicrosoftAzureStorage/Blob/Models/SetBlobPropertiesResult.php +0 -0
  615. lib/Azure/MicrosoftAzureStorage/Blob/Models/SetContainerMetadataOptions.php +0 -0
  616. lib/Azure/MicrosoftAzureStorage/Blob/Models/SignedIdentifier.php +0 -0
  617. lib/Azure/MicrosoftAzureStorage/Common/CloudConfigurationManager.php +0 -0
  618. lib/Azure/MicrosoftAzureStorage/Common/Internal/Authentication/IAuthScheme.php +0 -0
  619. lib/Azure/MicrosoftAzureStorage/Common/Internal/Authentication/SharedKeyAuthScheme.php +0 -0
  620. lib/Azure/MicrosoftAzureStorage/Common/Internal/Authentication/StorageAuthScheme.php +0 -0
  621. lib/Azure/MicrosoftAzureStorage/Common/Internal/Authentication/TableSharedKeyLiteAuthScheme.php +0 -0
  622. lib/Azure/MicrosoftAzureStorage/Common/Internal/ConnectionStringParser.php +0 -0
  623. lib/Azure/MicrosoftAzureStorage/Common/Internal/ConnectionStringSource.php +0 -0
  624. lib/Azure/MicrosoftAzureStorage/Common/Internal/FilterableService.php +0 -0
  625. lib/Azure/MicrosoftAzureStorage/Common/Internal/Filters/AuthenticationFilter.php +0 -0
  626. lib/Azure/MicrosoftAzureStorage/Common/Internal/Filters/DateFilter.php +0 -0
  627. lib/Azure/MicrosoftAzureStorage/Common/Internal/Filters/ExponentialRetryPolicy.php +0 -0
  628. lib/Azure/MicrosoftAzureStorage/Common/Internal/Filters/HeadersFilter.php +0 -0
  629. lib/Azure/MicrosoftAzureStorage/Common/Internal/Filters/RetryPolicy.php +0 -0
  630. lib/Azure/MicrosoftAzureStorage/Common/Internal/Filters/RetryPolicyFilter.php +0 -0
  631. lib/Azure/MicrosoftAzureStorage/Common/Internal/Http/HttpCallContext.php +0 -0
  632. lib/Azure/MicrosoftAzureStorage/Common/Internal/HttpFormatter.php +0 -0
  633. lib/Azure/MicrosoftAzureStorage/Common/Internal/IServiceFilter.php +0 -0
  634. lib/Azure/MicrosoftAzureStorage/Common/Internal/InvalidArgumentTypeException.php +0 -0
  635. lib/Azure/MicrosoftAzureStorage/Common/Internal/Logger.php +0 -0
  636. lib/Azure/MicrosoftAzureStorage/Common/Internal/Resources.php +0 -0
  637. lib/Azure/MicrosoftAzureStorage/Common/Internal/RestProxy.php +0 -0
  638. lib/Azure/MicrosoftAzureStorage/Common/Internal/RetryMiddlewareFactory.php +0 -0
  639. lib/Azure/MicrosoftAzureStorage/Common/Internal/Serialization/ISerializer.php +0 -0
  640. lib/Azure/MicrosoftAzureStorage/Common/Internal/Serialization/JsonSerializer.php +0 -0
  641. lib/Azure/MicrosoftAzureStorage/Common/Internal/Serialization/XmlSerializer.php +0 -0
  642. lib/Azure/MicrosoftAzureStorage/Common/Internal/ServiceRestProxy.php +0 -0
  643. lib/Azure/MicrosoftAzureStorage/Common/Internal/ServiceSettings.php +0 -0
  644. lib/Azure/MicrosoftAzureStorage/Common/Internal/StorageServiceSettings.php +0 -0
  645. lib/Azure/MicrosoftAzureStorage/Common/Internal/Utilities.php +0 -0
  646. lib/Azure/MicrosoftAzureStorage/Common/Internal/Validate.php +0 -0
  647. lib/Azure/MicrosoftAzureStorage/Common/Models/GetServicePropertiesResult.php +0 -0
  648. lib/Azure/MicrosoftAzureStorage/Common/Models/Logging.php +0 -0
  649. lib/Azure/MicrosoftAzureStorage/Common/Models/Metrics.php +0 -0
  650. lib/Azure/MicrosoftAzureStorage/Common/Models/RetentionPolicy.php +0 -0
  651. lib/Azure/MicrosoftAzureStorage/Common/Models/ServiceProperties.php +0 -0
  652. lib/Azure/MicrosoftAzureStorage/Common/ServiceException.php +0 -0
  653. lib/Azure/MicrosoftAzureStorage/Common/ServicesBuilder.php +0 -0
  654. lib/Azure/PsrHttpMessage/MessageInterface.php +0 -0
  655. lib/Azure/PsrHttpMessage/RequestInterface.php +0 -0
  656. lib/Azure/PsrHttpMessage/ResponseInterface.php +0 -0
  657. lib/Azure/PsrHttpMessage/ServerRequestInterface.php +0 -0
  658. lib/Azure/PsrHttpMessage/StreamInterface.php +0 -0
  659. lib/Azure/PsrHttpMessage/UploadedFileInterface.php +0 -0
  660. lib/Azure/PsrHttpMessage/UriInterface.php +0 -0
  661. lib/Azure/loader.php +0 -0
  662. lib/CSSTidy/class.csstidy.php +1192 -894
  663. lib/CSSTidy/class.csstidy_optimise.php +937 -782
  664. lib/CSSTidy/class.csstidy_print.php +421 -323
  665. lib/CSSTidy/data.inc.php +541 -366
  666. lib/CSSTidy/index.html +0 -0
  667. lib/Db/mssql.php +0 -0
  668. lib/Google/Auth/Abstract.php +0 -0
  669. lib/Google/Auth/AppIdentity.php +0 -0
  670. lib/Google/Auth/AssertionCredentials.php +0 -0
  671. lib/Google/Auth/Exception.php +0 -0
  672. lib/Google/Auth/LoginTicket.php +0 -0
  673. lib/Google/Auth/OAuth2.php +0 -0
  674. lib/Google/Auth/Simple.php +0 -0
  675. lib/Google/Cache/Abstract.php +0 -0
  676. lib/Google/Cache/Apc.php +0 -0
  677. lib/Google/Cache/Exception.php +0 -0
  678. lib/Google/Cache/File.php +0 -0
  679. lib/Google/Cache/Memcache.php +0 -0
  680. lib/Google/Cache/Null.php +0 -0
  681. lib/Google/Client.php +0 -0
  682. lib/Google/Collection.php +0 -0
  683. lib/Google/Config.php +0 -0
  684. lib/Google/Exception.php +0 -0
  685. lib/Google/Http/Batch.php +0 -0
  686. lib/Google/Http/CacheParser.php +0 -0
  687. lib/Google/Http/MediaFileUpload.php +0 -0
  688. lib/Google/Http/REST.php +0 -0
  689. lib/Google/Http/Request.php +0 -0
  690. lib/Google/IO/Abstract.php +0 -0
  691. lib/Google/IO/Curl.php +0 -0
  692. lib/Google/IO/Exception.php +0 -0
  693. lib/Google/IO/Stream.php +0 -0
  694. lib/Google/IO/cacerts.pem +0 -0
  695. lib/Google/Model.php +0 -0
  696. lib/Google/Service.php +0 -0
  697. lib/Google/Service/Drive.php +0 -0
  698. lib/Google/Service/Exception.php +0 -0
  699. lib/Google/Service/Oauth2.php +0 -0
  700. lib/Google/Service/Resource.php +0 -0
  701. lib/Google/Signer/Abstract.php +0 -0
  702. lib/Google/Signer/P12.php +0 -0
  703. lib/Google/Utils.php +0 -0
  704. lib/Google/Utils/URITemplate.php +0 -0
  705. lib/Google/Verifier/Abstract.php +0 -0
  706. lib/Google/Verifier/Pem.php +0 -0
  707. lib/Minify/CSSmin.php +0 -0
  708. lib/Minify/DooDigestAuth.php +0 -0
  709. lib/Minify/HTTP/ConditionalGet.php +0 -0
  710. lib/Minify/HTTP/Encoder.php +0 -0
  711. lib/Minify/HTTP/index.html +0 -0
  712. lib/Minify/JSMin.php +0 -0
  713. lib/Minify/JSMinPlus.php +0 -0
  714. lib/Minify/Minify.php +75 -75
  715. lib/Minify/Minify/Build.php +0 -0
  716. lib/Minify/Minify/CSS.php +0 -0
  717. lib/Minify/Minify/CSS/Compressor.php +0 -0
  718. lib/Minify/Minify/CSS/UriRewriter.php +0 -0
  719. lib/Minify/Minify/CSS/index.html +0 -0
  720. lib/Minify/Minify/CSSTidy.php +7 -5
  721. lib/Minify/Minify/Cache/File.php +290 -291
  722. lib/Minify/Minify/Cache/W3TCDerived.php +0 -0
  723. lib/Minify/Minify/Cache/ZendPlatform.php +0 -0
  724. lib/Minify/Minify/Cache/index.html +0 -0
  725. lib/Minify/Minify/ClosureCompiler.php +0 -0
  726. lib/Minify/Minify/CombineOnly.php +0 -0
  727. lib/Minify/Minify/CommentPreserver.php +0 -0
  728. lib/Minify/Minify/Controller/Base.php +0 -0
  729. lib/Minify/Minify/Controller/Files.php +0 -0
  730. lib/Minify/Minify/Controller/Groups.php +0 -0
  731. lib/Minify/Minify/Controller/MinApp.php +0 -0
  732. lib/Minify/Minify/Controller/Page.php +0 -0
  733. lib/Minify/Minify/Controller/Version1.php +0 -0
  734. lib/Minify/Minify/Controller/index.html +0 -0
  735. lib/Minify/Minify/DebugDetector.php +0 -0
  736. lib/Minify/Minify/HTML.php +34 -32
  737. lib/Minify/Minify/HTML/Helper.php +0 -0
  738. lib/Minify/Minify/HTMLTidy.php +0 -0
  739. lib/Minify/Minify/IgnoredCommentPreserver.php +0 -0
  740. lib/Minify/Minify/ImportProcessor.php +0 -0
  741. lib/Minify/Minify/Inline.php +0 -0
  742. lib/Minify/Minify/Inline/CSS.php +0 -0
  743. lib/Minify/Minify/Inline/JavaScript.php +0 -0
  744. lib/Minify/Minify/Inline/index.html +0 -0
  745. lib/Minify/Minify/JS/ClosureCompiler.php +0 -0
  746. lib/Minify/Minify/Lines.php +0 -0
  747. lib/Minify/Minify/Loader.php +0 -0
  748. lib/Minify/Minify/Logger.php +0 -0
  749. lib/Minify/Minify/Packer.php +0 -0
  750. lib/Minify/Minify/Source.php +0 -0
  751. lib/Minify/Minify/YUI/CssCompressor.java +0 -0
  752. lib/Minify/Minify/YUI/CssCompressor.php +0 -0
  753. lib/Minify/Minify/YUICompressor.php +0 -0
  754. lib/Minify/Minify/index.html +0 -0
  755. lib/Minify/index.html +0 -0
  756. lib/NetDNA/NetDNA.php +0 -0
  757. lib/NetDNA/NetDNAPresentation.php +0 -0
  758. lib/NetDNA/W3tcWpHttpException.php +0 -0
  759. lib/NewRelic/NewRelicAPI.php +0 -0
  760. lib/NewRelic/NewRelicWrapper.php +0 -0
  761. lib/Nusoap/class.nusoap_base.php +0 -0
  762. lib/Nusoap/class.soap_fault.php +0 -0
  763. lib/Nusoap/class.soap_parser.php +0 -0
  764. lib/Nusoap/class.soap_transport_http.php +0 -0
  765. lib/Nusoap/class.soap_val.php +0 -0
  766. lib/Nusoap/class.soapclient.php +0 -0
  767. lib/Nusoap/class.wsdl.php +0 -0
  768. lib/Nusoap/class.wsdlcache.php +0 -0
  769. lib/Nusoap/class.xmlschema.php +0 -0
  770. lib/Nusoap/index.html +0 -0
  771. lib/Nusoap/nusoap.php +0 -0
  772. lib/OAuth/W3tcOAuth.php +0 -0
  773. lib/S3.php +0 -0
  774. lib/SNS/README.md +0 -0
  775. lib/SNS/lib/requestcore/LICENSE +0 -0
  776. lib/SNS/lib/requestcore/README.md +0 -0
  777. lib/SNS/lib/requestcore/cacert.pem +0 -0
  778. lib/SNS/lib/requestcore/requestcore.class.php +0 -0
  779. lib/SNS/sdk.class.php +0 -0
  780. lib/SNS/services/MessageValidator/Message.php +0 -0
  781. lib/SNS/services/MessageValidator/MessageValidator.php +0 -0
  782. lib/SNS/services/MessageValidator/sns-exceptions.php +0 -0
  783. lib/SNS/services/sns.class.php +0 -0
  784. lib/SNS/utilities/request.class.php +0 -0
  785. lib/SNS/utilities/response.class.php +0 -0
  786. lib/SNS/utilities/simplexml.class.php +0 -0
  787. lib/SNS/utilities/utilities.class.php +0 -0
  788. lib/index.html +0 -0
  789. press.txt +485 -0
  790. pub/css/error.css +0 -0
  791. pub/css/index.html +0 -0
  792. pub/css/lightbox.css +0 -0
  793. pub/css/options.css +0 -0
  794. pub/css/popup.css +0 -0
  795. pub/css/widget.css +0 -0
  796. pub/img/W3TC_dashboard_logo_title-retina.png +0 -0
  797. pub/img/W3TC_dashboard_logo_title.png +0 -0
  798. pub/img/button-grad-active.png +0 -0
  799. pub/img/button-grad.png +0 -0
  800. pub/img/cdn-highwinds-logo.png +0 -0
  801. pub/img/close.png +0 -0
  802. pub/img/google-logo.png +0 -0
  803. pub/img/index.html +0 -0
  804. pub/img/open.png +0 -0
  805. pub/img/overlay/ceo.png +0 -0
  806. pub/img/overlay/gray-check.png +0 -0
  807. pub/img/overlay/list-check.png +0 -0
  808. pub/img/overlay/lite-gray-check.png +0 -0
  809. pub/img/overlay/lock.png +0 -0
  810. pub/img/overlay/overlay-close.png +0 -0
  811. pub/img/overlay/overlay-down-arrow.png +0 -0
  812. pub/img/overlay/overlay-logo.png +0 -0
  813. pub/img/overlay/save-close.png +0 -0
  814. pub/img/overlay/select-arrow.png +0 -0
  815. pub/img/overlay/twitter-bird-dark-bgs.png +0 -0
  816. pub/img/overlay/w3-meteor.png +0 -0
  817. pub/img/overlay/wordpress-logo-simplified-rgb.png +0 -0
  818. pub/img/ps_bar.gif +0 -0
  819. pub/img/ps_grad.gif +0 -0
  820. pub/img/ps_scores.png +0 -0
  821. pub/img/sidebar-background.png +0 -0
  822. pub/img/w3tc-sprite-admin-bar.png +0 -0
  823. pub/img/w3tc-sprite-retina.png +0 -0
  824. pub/img/w3tc-sprite.png +0 -0
  825. pub/img/w3tc_google-logo-retina.png +0 -0
  826. pub/img/w3tc_google-logo.png +0 -0
  827. pub/img/w3tc_maxcdn-logo-retina.png +0 -0
  828. pub/img/w3tc_maxcdn-logo.png +0 -0
  829. pub/img/w3tc_netdna-logo-retina.png +0 -0
  830. pub/img/w3tc_netdna-logo.png +0 -0
  831. pub/img/w3tc_newrelic-logo-retina.png +0 -0
  832. pub/img/w3tc_newrelic-logo.png +0 -0
  833. pub/img/w3tc_swarmify-logo-retina.png +0 -0
  834. pub/img/w3tc_swarmify-logo.png +0 -0
  835. pub/img/w3tc_w3edge-logo-retina.png +0 -0
  836. pub/img/w3tc_w3edge-logo.png +0 -0
  837. pub/img/w3tc_w3tc-logo-retina.png +0 -0
  838. pub/img/w3tc_w3tc-logo.png +0 -0
  839. pub/img/white-grad-active.png +0 -0
  840. pub/img/white-grad.png +0 -0
  841. pub/img/wpspin_light.gif +0 -0
  842. pub/index.html +0 -0
  843. pub/js/index.html +0 -0
  844. pub/js/jquery.masonry.min.js +0 -0
  845. pub/js/lightbox.js +0 -0
  846. pub/js/metadata.js +0 -0
  847. pub/js/options.js +4 -0
  848. pub/js/popup.js +0 -0
  849. pub/js/widget.js +0 -0
  850. pub/opcache.php +0 -0
  851. pub/sns.php +0 -0
  852. readme.txt +25 -491
  853. w3-total-cache-api.php +1 -1
  854. w3-total-cache-old-php.php +0 -0
  855. w3-total-cache.php +1 -1
  856. wp-content/advanced-cache.php +0 -0
  857. wp-content/db.php +0 -0
  858. wp-content/index.html +0 -0
  859. wp-content/object-cache.php +0 -0
Base_Page_Settings.php CHANGED
File without changes
BrowserCache_ConfigLabels.php CHANGED
File without changes
BrowserCache_Core.php CHANGED
@@ -35,6 +35,44 @@ class BrowserCache_Core {
35
 
36
 
37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  /**
39
  * Returns CSS/JS mime types
40
  *
35
 
36
 
37
 
38
+ /**
39
+ * Returns replace extensions
40
+ *
41
+ * @return array
42
+ */
43
+ public function get_replace_querystring_extensions( $config ) {
44
+ $extensions = array();
45
+
46
+ if ( $config->get_boolean( 'browsercache.cssjs.replace' ) )
47
+ $this->_fill_extensions( $extensions, $this->_get_cssjs_types(), 'replace' );
48
+ if ( $config->get_boolean( 'browsercache.html.replace' ) )
49
+ $this->_fill_extensions( $extensions, $this->_get_html_types(), 'replace' );
50
+ if ( $config->get_boolean( 'browsercache.other.replace' ) )
51
+ $this->_fill_extensions( $extensions, $this->_get_other_types(), 'replace' );
52
+
53
+ if ( $config->get_boolean( 'browsercache.cssjs.querystring' ) )
54
+ $this->_fill_extensions( $extensions, $this->_get_cssjs_types(), 'querystring' );
55
+ if ( $config->get_boolean( 'browsercache.html.querystring' ) )
56
+ $this->_fill_extensions( $extensions, $this->_get_html_types(), 'querystring' );
57
+ if ( $config->get_boolean( 'browsercache.other.querystring' ) )
58
+ $this->_fill_extensions( $extensions, $this->_get_other_types(), 'querystring' );
59
+
60
+ return $extensions;
61
+ }
62
+
63
+
64
+
65
+ private function _fill_extensions( &$extensions, $types, $operation ) {
66
+ foreach ( array_keys( $types ) as $type ) {
67
+ $type_extensions = explode( '|', $type );
68
+ foreach ( $type_extensions as $ext ) {
69
+ if ( !isset( $extensions[$ext] ) )
70
+ $extensions[$ext] = array();
71
+ $extensions[$ext][$operation] = true;
72
+ }
73
+ }
74
+ }
75
+
76
  /**
77
  * Returns CSS/JS mime types
78
  *
BrowserCache_Environment.php CHANGED
@@ -258,6 +258,7 @@ class BrowserCache_Environment {
258
 
259
  $rules .= "</IfModule>\n";
260
 
 
261
  $rules .= "<IfModule mod_expires.c>\n";
262
  $rules .= " ExpiresActive On\n";
263
 
258
 
259
  $rules .= "</IfModule>\n";
260
 
261
+
262
  $rules .= "<IfModule mod_expires.c>\n";
263
  $rules .= " ExpiresActive On\n";
264
 
BrowserCache_Page.php CHANGED
@@ -26,6 +26,7 @@ class BrowserCache_Page extends Base_Page_Settings {
26
  $browsercache_w3tc = ( $this->_config->get_boolean( 'browsercache.cssjs.w3tc' ) && $this->_config->get_boolean( 'browsercache.html.w3tc' ) && $this->_config->get_boolean( 'browsercache.other.w3tc' ) );
27
  $browsercache_compression = ( $this->_config->get_boolean( 'browsercache.cssjs.compression' ) && $this->_config->get_boolean( 'browsercache.html.compression' ) && $this->_config->get_boolean( 'browsercache.other.compression' ) );
28
  $browsercache_replace = ( $this->_config->get_boolean( 'browsercache.cssjs.replace' ) && $this->_config->get_boolean( 'browsercache.other.replace' ) );
 
29
  $browsercache_update_media_qs = ( $this->_config->get_boolean( 'browsercache.cssjs.replace' ) || $this->_config->get_boolean( 'browsercache.other.replace' ) );
30
  $browsercache_nocookies =
31
  ( $this->_config->get_boolean( 'browsercache.cssjs.nocookies' ) &&
26
  $browsercache_w3tc = ( $this->_config->get_boolean( 'browsercache.cssjs.w3tc' ) && $this->_config->get_boolean( 'browsercache.html.w3tc' ) && $this->_config->get_boolean( 'browsercache.other.w3tc' ) );
27
  $browsercache_compression = ( $this->_config->get_boolean( 'browsercache.cssjs.compression' ) && $this->_config->get_boolean( 'browsercache.html.compression' ) && $this->_config->get_boolean( 'browsercache.other.compression' ) );
28
  $browsercache_replace = ( $this->_config->get_boolean( 'browsercache.cssjs.replace' ) && $this->_config->get_boolean( 'browsercache.other.replace' ) );
29
+ $browsercache_querystring = ( $this->_config->get_boolean( 'browsercache.cssjs.querystring' ) && $this->_config->get_boolean( 'browsercache.other.querystring' ) );
30
  $browsercache_update_media_qs = ( $this->_config->get_boolean( 'browsercache.cssjs.replace' ) || $this->_config->get_boolean( 'browsercache.other.replace' ) );
31
  $browsercache_nocookies =
32
  ( $this->_config->get_boolean( 'browsercache.cssjs.nocookies' ) &&
BrowserCache_Plugin.php CHANGED
@@ -51,7 +51,12 @@ class BrowserCache_Plugin {
51
  /**
52
  * Replace feature should be enabled
53
  */
54
- if ( !$this->_config->get_boolean( 'browsercache.cssjs.replace' ) && !$this->_config->get_boolean( 'browsercache.html.replace' ) && !$this->_config->get_boolean( 'browsercache.other.replace' ) ) {
 
 
 
 
 
55
  return false;
56
  }
57
 
@@ -121,7 +126,7 @@ class BrowserCache_Plugin {
121
  $buffer = preg_replace_callback(
122
  '~(href|src|action|extsrc|asyncsrc|w3tc_load_js\()=?([\'"])((' .
123
  $domain_url_regexp .
124
- ')?(/[^\'"]*\.([a-z-_]+)(\?[^\'"]*)?))[\'"]~Ui', array(
125
  $this,
126
  'link_replace_callback'
127
  ), $buffer );
@@ -139,10 +144,11 @@ class BrowserCache_Plugin {
139
  function link_replace_callback( $matches ) {
140
  list ( $match, $attr, $quote, $url, , , , , $extension ) = $matches;
141
 
142
- if ( !$this->_url_has_to_be_replaced( $url, $extension ) )
 
143
  return $match;
144
 
145
- $url = $this->mutate_url( $url, !$this->browsercache_rewrite );
146
 
147
  if ( $attr != 'w3tc_load_js(' )
148
  return $attr . '=' . $quote . $url . $quote;
@@ -162,64 +168,83 @@ class BrowserCache_Plugin {
162
  return $url;
163
  $extension = $matches[1];
164
 
165
- if ( !$this->_url_has_to_be_replaced( $original_url, $extension ) )
 
166
  return $url;
167
 
168
  // for push cdns each flush would require manual reupload of files
169
  $mutate_by_querystring = !$this->browsercache_rewrite || !$is_cdn_mirror;
170
 
171
- $url = $this->mutate_url( $url, $mutate_by_querystring );
172
  return $url;
173
  }
174
 
175
- private function mutate_url( $url, $mutate_by_querystring ) {
176
- $id = $this->get_filename_uniqualizator();
177
-
178
- $url = Util_Environment::remove_query( $url );
179
  $query_pos = strpos( $url, '?' );
 
 
 
 
180
 
181
- if ( $mutate_by_querystring ) {
182
- $url .= ( $query_pos !== false ? '&amp;' : '?' ) . $id;
183
- } else {
184
- // add $id to url before extension
185
-
186
- $url_query = '';
187
- if ( $query_pos !== false ) {
188
- $url_query = substr( $url, $query_pos );
189
- $url = substr( $url, 0, $query_pos );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
  }
191
-
192
- $ext_pos = strrpos( $url, '.' );
193
- $extension = substr( $url, $ext_pos );
194
-
195
- $url = substr( $url, 0, strlen( $url ) - strlen( $extension ) ) . '.' .
196
- $id . $extension . $url_query;
197
  }
 
198
  return $url;
199
  }
200
 
201
- function _url_has_to_be_replaced( $url, $extension ) {
202
  static $extensions = null;
203
  if ( $extensions === null ) {
204
  $core = Dispatcher::component( 'BrowserCache_Core' );
205
- $extensions = $core->get_replace_extensions( $this->_config );
206
  }
207
 
208
  static $exceptions = null;
209
  if ( $exceptions === null )
210
  $exceptions = $this->_config->get_array( 'browsercache.replace.exceptions' );
211
 
212
- if ( !in_array( $extension, $extensions ) )
213
- return false;
214
 
215
  $test_url = Util_Environment::remove_query( $url );
216
  foreach ( $exceptions as $exception ) {
217
  $escaped = str_replace( '~', '\~', $exception );
218
  if ( trim( $exception ) && preg_match( '~' . $escaped . '~', $test_url ) )
219
- return false;
220
  }
221
 
222
- return true;
223
  }
224
 
225
  /**
51
  /**
52
  * Replace feature should be enabled
53
  */
54
+ if ( !$this->_config->get_boolean( 'browsercache.cssjs.replace' ) &&
55
+ !$this->_config->get_boolean( 'browsercache.html.replace' ) &&
56
+ !$this->_config->get_boolean( 'browsercache.other.replace' ) &&
57
+ !$this->_config->get_boolean( 'browsercache.cssjs.querystring' ) &&
58
+ !$this->_config->get_boolean( 'browsercache.html.querystring' ) &&
59
+ !$this->_config->get_boolean( 'browsercache.other.querystring' )) {
60
  return false;
61
  }
62
 
126
  $buffer = preg_replace_callback(
127
  '~(href|src|action|extsrc|asyncsrc|w3tc_load_js\()=?([\'"])((' .
128
  $domain_url_regexp .
129
+ ')?(/[^\'"/][^\'"]*\.([a-z-_]+)([\?#][^\'"]*)?))[\'"]~Ui', array(
130
  $this,
131
  'link_replace_callback'
132
  ), $buffer );
144
  function link_replace_callback( $matches ) {
145
  list ( $match, $attr, $quote, $url, , , , , $extension ) = $matches;
146
 
147
+ $ops = $this->_get_url_mutation_operations( $url, $extension );
148
+ if ( is_null( $ops ) )
149
  return $match;
150
 
151
+ $url = $this->mutate_url( $url, $ops, !$this->browsercache_rewrite );
152
 
153
  if ( $attr != 'w3tc_load_js(' )
154
  return $attr . '=' . $quote . $url . $quote;
168
  return $url;
169
  $extension = $matches[1];
170
 
171
+ $ops = $this->_get_url_mutation_operations( $original_url, $extension );
172
+ if ( is_null( $ops ) )
173
  return $url;
174
 
175
  // for push cdns each flush would require manual reupload of files
176
  $mutate_by_querystring = !$this->browsercache_rewrite || !$is_cdn_mirror;
177
 
178
+ $url = $this->mutate_url( $url, $ops, $mutate_by_querystring );
179
  return $url;
180
  }
181
 
182
+ private function mutate_url( $url, $ops, $mutate_by_querystring ) {
 
 
 
183
  $query_pos = strpos( $url, '?' );
184
+ if ( isset( $ops['querystring'] ) && $query_pos !== false ) {
185
+ $url = substr( $url, 0, $query_pos );
186
+ $query_pos == false;
187
+ }
188
 
189
+ if ( isset( $ops['replace'] ) ) {
190
+ $id = $this->get_filename_uniqualizator();
191
+
192
+ if ( $mutate_by_querystring ) {
193
+ if ( $query_pos !== false ) {
194
+ $url = substr( $url, 0, $query_pos + 1 ) . $id . '&amp;' .
195
+ substr( $url, $query_pos + 1 );
196
+ } else {
197
+ $tag_pos = strpos( $url, '#' );
198
+ if ( $tag_pos === false ) {
199
+ $url .= '?' . $id;
200
+ } else {
201
+ $url = substr( $url, 0, $tag_pos ) . '?' . $id .
202
+ substr( $url, $tag_pos );
203
+ }
204
+ }
205
+
206
+ } else {
207
+ // add $id to url before extension
208
+
209
+ $url_query = '';
210
+ if ( $query_pos !== false ) {
211
+ $url_query = substr( $url, $query_pos );
212
+ $url = substr( $url, 0, $query_pos );
213
+ }
214
+
215
+ $ext_pos = strrpos( $url, '.' );
216
+ $extension = substr( $url, $ext_pos );
217
+
218
+ $url = substr( $url, 0, strlen( $url ) - strlen( $extension ) ) .
219
+ '.' . $id . $extension . $url_query;
220
  }
 
 
 
 
 
 
221
  }
222
+
223
  return $url;
224
  }
225
 
226
+ function _get_url_mutation_operations( $url, $extension ) {
227
  static $extensions = null;
228
  if ( $extensions === null ) {
229
  $core = Dispatcher::component( 'BrowserCache_Core' );
230
+ $extensions = $core->get_replace_querystring_extensions( $this->_config );
231
  }
232
 
233
  static $exceptions = null;
234
  if ( $exceptions === null )
235
  $exceptions = $this->_config->get_array( 'browsercache.replace.exceptions' );
236
 
237
+ if ( !isset( $extensions[$extension] ) )
238
+ return null;
239
 
240
  $test_url = Util_Environment::remove_query( $url );
241
  foreach ( $exceptions as $exception ) {
242
  $escaped = str_replace( '~', '\~', $exception );
243
  if ( trim( $exception ) && preg_match( '~' . $escaped . '~', $test_url ) )
244
+ return null;
245
  }
246
 
247
+ return $extensions[$extension];
248
  }
249
 
250
  /**
BrowserCache_Plugin_Admin.php CHANGED
File without changes
Cache.php CHANGED
File without changes
CacheFlush.php CHANGED
File without changes
CacheFlush_Locally.php CHANGED
File without changes
Cache_Apc.php CHANGED
@@ -130,7 +130,7 @@ class Cache_Apc extends Cache_Base {
130
  }
131
 
132
  /**
133
- * Key to delete, deletes .old and primary if exists.
134
  *
135
  * @param unknown $key
136
  * @return bool
130
  }
131
 
132
  /**
133
+ * Deletes _old and primary if exists.
134
  *
135
  * @param unknown $key
136
  * @return bool
Cache_Apcu.php CHANGED
@@ -129,7 +129,7 @@ class Cache_Apcu extends Cache_Base {
129
  }
130
 
131
  /**
132
- * Key to delete, deletes .old and primary if exists.
133
  *
134
  * @param unknown $key
135
  * @return bool
129
  }
130
 
131
  /**
132
+ * Deletes _old and primary if exists.
133
  *
134
  * @param unknown $key
135
  * @return bool
Cache_Base.php CHANGED
File without changes
Cache_Eaccelerator.php CHANGED
@@ -130,7 +130,7 @@ class Cache_Eaccelerator extends Cache_Base {
130
 
131
 
132
  /**
133
- * Key to delete, deletes .old and primary if exists.
134
  *
135
  * @param unknown $key
136
  * @return bool
130
 
131
 
132
  /**
133
+ * Deletes _old and primary if exists.
134
  *
135
  * @param unknown $key
136
  * @return bool
Cache_File.php CHANGED
@@ -253,7 +253,7 @@ class Cache_File extends Cache_Base {
253
  }
254
 
255
  /**
256
- * Key to delete, deletes .old and primary if exists.
257
  *
258
  * @param string $key
259
  *
253
  }
254
 
255
  /**
256
+ * Deletes _old and primary if exists.
257
  *
258
  * @param string $key
259
  *
Cache_File_Cleaner.php CHANGED
File without changes
Cache_File_Cleaner_Generic.php CHANGED
@@ -47,7 +47,7 @@ class Cache_File_Cleaner_Generic extends Cache_File_Cleaner {
47
 
48
  $full_path = $path . DIRECTORY_SEPARATOR . $entry;
49
 
50
- if ( substr( $entry, -4 ) === '.old' && !$this->is_old_file_expired( $full_path ) ) {
51
  continue;
52
  }
53
 
@@ -60,11 +60,11 @@ class Cache_File_Cleaner_Generic extends Cache_File_Cleaner {
60
 
61
  if ( @is_dir( $full_path ) ) {
62
  $this->_clean( $full_path );
63
- } elseif ( substr( $entry, -4 ) === '.old' ) {
64
  $this->processed_count++;
65
  @unlink( $full_path );
66
  } elseif ( !$this->is_valid( $full_path ) ) {
67
- $old_entry_path = $full_path . '.old';
68
  $this->processed_count++;
69
  if ( !@rename( $full_path, $old_entry_path ) ) {
70
  // if we can delete old entry - do second attempt to store in old-entry file
47
 
48
  $full_path = $path . DIRECTORY_SEPARATOR . $entry;
49
 
50
+ if ( substr( $entry, -4 ) === '_old' && !$this->is_old_file_expired( $full_path ) ) {
51
  continue;
52
  }
53
 
60
 
61
  if ( @is_dir( $full_path ) ) {
62
  $this->_clean( $full_path );
63
+ } elseif ( substr( $entry, -4 ) === '_old' ) {
64
  $this->processed_count++;
65
  @unlink( $full_path );
66
  } elseif ( !$this->is_valid( $full_path ) ) {
67
+ $old_entry_path = $full_path . '_old';
68
  $this->processed_count++;
69
  if ( !@rename( $full_path, $old_entry_path ) ) {
70
  // if we can delete old entry - do second attempt to store in old-entry file
Cache_File_Generic.php CHANGED
@@ -80,7 +80,7 @@ class Cache_File_Generic extends Cache_File {
80
 
81
  @unlink( $tmppath );
82
 
83
- $old_entry_path = $path . '.old';
84
  @unlink( $old_entry_path );
85
 
86
  if ( Util_Environment::is_apache() && isset( $var['headers'] ) &&
@@ -115,7 +115,7 @@ class Cache_File_Generic extends Cache_File {
115
  return array( $data, $has_old_data );
116
 
117
 
118
- $path_old = $path . '.old';
119
  $too_old_time = time() - 30;
120
 
121
  if ( $exists = file_exists( $path_old ) ) {
@@ -186,7 +186,7 @@ class Cache_File_Generic extends Cache_File {
186
  if ( !file_exists( $path ) )
187
  return true;
188
 
189
- $old_entry_path = $path . '.old';
190
  if ( ! @rename( $path, $old_entry_path ) ) {
191
  // if we can delete old entry - do second attempt to store in old-entry file
192
  if ( ! @unlink( $old_entry_path ) || ! @rename( $path, $old_entry_path ) ) {
@@ -199,7 +199,7 @@ class Cache_File_Generic extends Cache_File {
199
  }
200
 
201
  /**
202
- * Key to delete, deletes .old and primary if exists.
203
  *
204
  * @param unknown $key
205
  * @return bool
@@ -207,7 +207,7 @@ class Cache_File_Generic extends Cache_File {
207
  function hard_delete( $key ) {
208
  $key = $this->get_item_key( $key );
209
  $path = $this->_cache_dir . DIRECTORY_SEPARATOR . $this->_get_path( $key );
210
- $old_entry_path = $path . '.old';
211
  @unlink( $old_entry_path );
212
 
213
  if ( !file_exists( $path ) )
80
 
81
  @unlink( $tmppath );
82
 
83
+ $old_entry_path = $path . '_old';
84
  @unlink( $old_entry_path );
85
 
86
  if ( Util_Environment::is_apache() && isset( $var['headers'] ) &&
115
  return array( $data, $has_old_data );
116
 
117
 
118
+ $path_old = $path . '_old';
119
  $too_old_time = time() - 30;
120
 
121
  if ( $exists = file_exists( $path_old ) ) {
186
  if ( !file_exists( $path ) )
187
  return true;
188
 
189
+ $old_entry_path = $path . '_old';
190
  if ( ! @rename( $path, $old_entry_path ) ) {
191
  // if we can delete old entry - do second attempt to store in old-entry file
192
  if ( ! @unlink( $old_entry_path ) || ! @rename( $path, $old_entry_path ) ) {
199
  }
200
 
201
  /**
202
+ * Key to delete, deletes _old and primary if exists.
203
  *
204
  * @param unknown $key
205
  * @return bool
207
  function hard_delete( $key ) {
208
  $key = $this->get_item_key( $key );
209
  $path = $this->_cache_dir . DIRECTORY_SEPARATOR . $this->_get_path( $key );
210
+ $old_entry_path = $path . '_old';
211
  @unlink( $old_entry_path );
212
 
213
  if ( !file_exists( $path ) )
Cache_Memcache.php CHANGED
@@ -155,7 +155,7 @@ class Cache_Memcache extends Cache_Base {
155
  }
156
 
157
  /**
158
- * Key to delete, deletes .old and primary if exists.
159
  *
160
  * @param unknown $key
161
  * @return bool
155
  }
156
 
157
  /**
158
+ * Key to delete, deletes _old and primary if exists.
159
  *
160
  * @param unknown $key
161
  * @return bool
Cache_Memcached.php CHANGED
@@ -193,7 +193,7 @@ class Cache_Memcached extends Cache_Base {
193
  }
194
 
195
  /**
196
- * Key to delete, deletes .old and primary if exists.
197
  *
198
  * @param unknown $key
199
  * @return bool
193
  }
194
 
195
  /**
196
+ * Key to delete, deletes _old and primary if exists.
197
  *
198
  * @param unknown $key
199
  * @return bool
Cache_Memcached_Stats.php CHANGED
File without changes
Cache_Redis.php CHANGED
@@ -148,7 +148,7 @@ class Cache_Redis extends Cache_Base {
148
  }
149
 
150
  /**
151
- * Key to delete, deletes .old and primary if exists.
152
  *
153
  * @param unknown $key
154
  * @return bool
148
  }
149
 
150
  /**
151
+ * Key to delete, deletes _old and primary if exists.
152
  *
153
  * @param unknown $key
154
  * @return bool
Cache_Wincache.php CHANGED
@@ -126,7 +126,7 @@ class Cache_Wincache extends Cache_Base {
126
  }
127
 
128
  /**
129
- * Key to delete, deletes .old and primary if exists.
130
  *
131
  * @param unknown $key
132
  * @return bool
126
  }
127
 
128
  /**
129
+ * Key to delete, deletes _old and primary if exists.
130
  *
131
  * @param unknown $key
132
  * @return bool
Cache_Xcache.php CHANGED
@@ -130,7 +130,7 @@ class Cache_Xcache extends Cache_Base {
130
  }
131
 
132
  /**
133
- * Key to delete, deletes .old and primary if exists.
134
  *
135
  * @param unknown $key
136
  * @return bool
130
  }
131
 
132
  /**
133
+ * Key to delete, deletes _old and primary if exists.
134
  *
135
  * @param unknown $key
136
  * @return bool
CdnEngine.php CHANGED
File without changes
CdnEngine_Azure.php CHANGED
@@ -27,7 +27,7 @@ class CdnEngine_Azure extends CdnEngine_Base {
27
 
28
  parent::__construct( $config );
29
 
30
- require_once W3TC_LIB_DIR . DIRECTORY_SEPARATOR . 'Azure' .
31
  DIRECTORY_SEPARATOR . 'loader.php';
32
  }
33
 
@@ -66,7 +66,7 @@ class CdnEngine_Azure extends CdnEngine_Base {
66
  $error = $ex->getMessage();
67
  return false;
68
  }
69
-
70
 
71
  return true;
72
  }
@@ -138,13 +138,24 @@ class CdnEngine_Azure extends CdnEngine_Base {
138
  }
139
 
140
  $headers = $this->_get_headers( $file );
141
- $headers = array_merge( $headers, array(
142
- 'Content-MD5' => $content_md5
143
- ) );
144
 
145
  try {
146
  // $headers
147
- $this->_client->createBlockBlob( $this->_config['container'], $remote_path, $contents );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  } catch ( \Exception $exception ) {
149
  return $this->_get_result( $local_path, $remote_path,
150
  W3TC_CDN_RESULT_ERROR,
@@ -177,7 +188,7 @@ class CdnEngine_Azure extends CdnEngine_Base {
177
  $remote_path = $file['remote_path'];
178
 
179
  try {
180
- $this->_client->deleteBlob( $this->_config['container'], $remote_path );
181
  $results[] = $this->_get_result( $local_path, $remote_path,
182
  W3TC_CDN_RESULT_OK, 'OK', $file );
183
  } catch ( \Exception $exception ) {
@@ -387,33 +398,6 @@ class CdnEngine_Azure extends CdnEngine_Base {
387
  return false;
388
  }
389
 
390
- /**
391
- * Returns array of headers
392
- *
393
- * @param array $file CDN file array
394
- * @return array
395
- */
396
- function _get_headers( $file, $block_expires = false ) {
397
- $allowed_headers = array(
398
- 'Content-Length',
399
- 'Content-Type',
400
- 'Content-Encoding',
401
- 'Content-Language',
402
- 'Content-MD5',
403
- 'Cache-Control',
404
- );
405
-
406
- $headers = parent::_get_headers( $file, true );
407
-
408
- foreach ( $headers as $header => $value ) {
409
- if ( !in_array( $header, $allowed_headers ) ) {
410
- unset( $headers[$header] );
411
- }
412
- }
413
-
414
- return $headers;
415
- }
416
-
417
  /**
418
  * How and if headers should be set
419
  *
27
 
28
  parent::__construct( $config );
29
 
30
+ require_once W3TC_LIB_DIR . DIRECTORY_SEPARATOR . 'Azure' .
31
  DIRECTORY_SEPARATOR . 'loader.php';
32
  }
33
 
66
  $error = $ex->getMessage();
67
  return false;
68
  }
69
+
70
 
71
  return true;
72
  }
138
  }
139
 
140
  $headers = $this->_get_headers( $file );
 
 
 
141
 
142
  try {
143
  // $headers
144
+ $options = new \MicrosoftAzure\Storage\Blob\Models\CreateBlobOptions();
145
+ $options->setBlobContentMD5( $content_md5 );
146
+ if ( isset( $headers['Content-Length'] ) )
147
+ $options->setBlobContentLength( $headers['Content-Length'] );
148
+ if ( isset( $headers['Content-Type'] ) )
149
+ $options->setBlobContentType( $headers['Content-Type'] );
150
+ if ( isset( $headers['Content-Encoding'] ) )
151
+ $options->setBlobContentEncoding( $headers['Content-Encoding'] );
152
+ if ( isset( $headers['Content-Language'] ) )
153
+ $options->setBlobContentLanguage( $headers['Content-Language'] );
154
+ if ( isset( $headers['Cache-Control'] ) )
155
+ $options->setBlobCacheControl( $headers['Cache-Control'] );
156
+
157
+ $this->_client->createBlockBlob( $this->_config['container'],
158
+ $remote_path, $contents, $options );
159
  } catch ( \Exception $exception ) {
160
  return $this->_get_result( $local_path, $remote_path,
161
  W3TC_CDN_RESULT_ERROR,
188
  $remote_path = $file['remote_path'];
189
 
190
  try {
191
+ $r = $this->_client->deleteBlob( $this->_config['container'], $remote_path );
192
  $results[] = $this->_get_result( $local_path, $remote_path,
193
  W3TC_CDN_RESULT_OK, 'OK', $file );
194
  } catch ( \Exception $exception ) {
398
  return false;
399
  }
400
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
401
  /**
402
  * How and if headers should be set
403
  *
CdnEngine_Base.php CHANGED
File without changes
CdnEngine_Ftp.php CHANGED
File without changes
CdnEngine_GoogleDrive.php CHANGED
File without changes
CdnEngine_Mirror.php CHANGED
File without changes
CdnEngine_Mirror_Akamai.php CHANGED
File without changes
CdnEngine_Mirror_Att.php CHANGED
File without changes
CdnEngine_Mirror_Cotendo.php CHANGED
File without changes
CdnEngine_Mirror_Edgecast.php CHANGED
File without changes
CdnEngine_Mirror_Highwinds.php CHANGED
File without changes
CdnEngine_Mirror_MaxCdn.php CHANGED
File without changes
CdnEngine_Mirror_Netdna.php CHANGED
File without changes
CdnEngine_Mirror_RackSpaceCdn.php CHANGED
File without changes
CdnEngine_RackSpaceCloudFiles.php CHANGED
File without changes
CdnEngine_S3.php CHANGED
File without changes
CdnEngine_S3_Cf.php CHANGED
File without changes
CdnEngine_S3_Cf_Custom.php CHANGED
File without changes
CdnEngine_S3_Cf_S3.php CHANGED
File without changes
CdnEngine_S3_Compatible.php CHANGED
File without changes
Cdn_AdminActions.php CHANGED
File without changes
Cdn_AdminNotes.php CHANGED
File without changes
Cdn_CacheFlush.php CHANGED
File without changes
Cdn_CloudFrontFsd_Api.php CHANGED
File without changes
Cdn_CloudFrontFsd_Engine.php CHANGED
File without changes
Cdn_CloudFrontFsd_Page.php CHANGED
File without changes
Cdn_CloudFrontFsd_Page_View.js CHANGED
@@ -73,6 +73,22 @@ jQuery(function($) {
73
 
74
 
75
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  .on('click', '.w3tc_cdn_maxcdn_fsd_done', function() {
77
  // refresh page
78
  window.location = window.location + '&';
73
 
74
 
75
 
76
+ .on('click', '.w3tc_cdn_cloudfront_fsd_configure_distribution_skip', function() {
77
+ var url = ajaxurl + '?action=w3tc_ajax&_wpnonce=' + w3tc_nonce +
78
+ '&w3tc_action=cdn_cloudfront_fsd_configure_distribution_skip';
79
+
80
+ var v = $('.w3tc_popup_form').find('input').each(function(i) {
81
+ var name = $(this).attr('name');
82
+ if (name)
83
+ url += '&' + encodeURIComponent(name) + '=' +
84
+ encodeURIComponent($(this).val());
85
+ });
86
+
87
+ W3tc_Lightbox.load(url, w3tc_popup_resize);
88
+ })
89
+
90
+
91
+
92
  .on('click', '.w3tc_cdn_maxcdn_fsd_done', function() {
93
  // refresh page
94
  window.location = window.location + '&';
Cdn_CloudFrontFsd_Page_View.php CHANGED
File without changes
Cdn_CloudFrontFsd_Popup.php CHANGED
@@ -15,6 +15,8 @@ class Cdn_CloudFrontFsd_Popup {
15
  array( $o, 'w3tc_ajax_cdn_cloudfront_fsd_view_distribution' ) );
16
  add_action( 'w3tc_ajax_cdn_cloudfront_fsd_configure_distribution',
17
  array( $o, 'w3tc_ajax_cdn_cloudfront_fsd_configure_distribution' ) );
 
 
18
  }
19
 
20
 
@@ -342,4 +344,45 @@ class Cdn_CloudFrontFsd_Popup {
342
  include W3TC_DIR . '/Cdn_CloudFrontFsd_Popup_View_Success.php';
343
  exit();
344
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
345
  }
15
  array( $o, 'w3tc_ajax_cdn_cloudfront_fsd_view_distribution' ) );
16
  add_action( 'w3tc_ajax_cdn_cloudfront_fsd_configure_distribution',
17
  array( $o, 'w3tc_ajax_cdn_cloudfront_fsd_configure_distribution' ) );
18
+ add_action( 'w3tc_ajax_cdn_cloudfront_fsd_configure_distribution_skip',
19
+ array( $o, 'w3tc_ajax_cdn_cloudfront_fsd_configure_distribution_skip' ) );
20
  }
21
 
22
 
344
  include W3TC_DIR . '/Cdn_CloudFrontFsd_Popup_View_Success.php';
345
  exit();
346
  }
347
+
348
+
349
+
350
+ public function w3tc_ajax_cdn_cloudfront_fsd_configure_distribution_skip() {
351
+ $access_key = $_REQUEST['access_key'];
352
+ $secret_key = $_REQUEST['secret_key'];
353
+ $distribution_id = Util_Request::get( 'distribution_id', '' );
354
+
355
+ $origin_id = rand();
356
+
357
+ try {
358
+ $api = new Cdn_CloudFrontFsd_Api( $access_key, $secret_key );
359
+ $distribution = $api->distribution_get( $distribution_id );
360
+ } catch ( \Exception $ex ) {
361
+ $this->render_intro( array(
362
+ 'error_message' => 'Failed to configure distribution: ' . $ex->getMessage()
363
+ ) );
364
+ exit();
365
+ }
366
+
367
+ if ( isset( $distribution['DomainName'] ) )
368
+ $distribution_domain = $distribution['DomainName'];
369
+ else
370
+ $distribution_domain = 'n/a';
371
+
372
+ $c = Dispatcher::config();
373
+ $c->set( 'cdn.cloudfront_fsd.access_key', $access_key );
374
+ $c->set( 'cdn.cloudfront_fsd.secret_key', $secret_key );
375
+ $c->set( 'cdn.cloudfront_fsd.distribution_id', $distribution_id );
376
+ $c->set( 'cdn.cloudfront_fsd.distribution_domain', $distribution_domain );
377
+ $c->save();
378
+
379
+ $details = array(
380
+ 'name' => $distribution['Comment'],
381
+ 'home_domain' => Util_Environment::home_url_host(),
382
+ 'dns_cname_target' => $distribution_domain,
383
+ );
384
+
385
+ include W3TC_DIR . '/Cdn_CloudFrontFsd_Popup_View_Success.php';
386
+ exit();
387
+ }
388
  }
Cdn_CloudFrontFsd_Popup_View_Distribution.php CHANGED
@@ -23,12 +23,12 @@ Util_Ui::hidden( '', 'distribution_comment', $details['distribution_comment'] );
23
  <th>Origin:</th>
24
  <td><?php $this->render_zone_ip_change( $details, 'origin' ) ?><br />
25
  <span class="description">
26
- Create DNS record pointing to your WordPress host IP.
27
- CloudFront will use this host to grab your content.
28
- It can not be your real domain name, since you will
29
- point it to CloudFront's IP. For example for myblog.com
30
- create origin.myblog.com and point it to the same IP
31
- as myblog.com
32
  </span>
33
  </td>
34
  </tr>
@@ -54,6 +54,9 @@ Util_Ui::hidden( '', 'distribution_comment', $details['distribution_comment'] );
54
  <input type="button"
55
  class="w3tc_cdn_cloudfront_fsd_configure_distribution w3tc-button-save button-primary"
56
  value="<?php _e( 'Apply', 'w3-total-cache' ); ?>" />
 
 
 
57
  </p>
58
  <?php Util_Ui::postbox_footer(); ?>
59
  </div>
23
  <th>Origin:</th>
24
  <td><?php $this->render_zone_ip_change( $details, 'origin' ) ?><br />
25
  <span class="description">
26
+ Create an apex <acronym title="Domain Name System">DNS</acronym> record pointing to your WordPress host <acronym title="Internet Protocol">IP</acronym>.
27
+ CloudFront will use this host to mirror your site.
28
+
29
+ Tip: If you real domain name is domain.com, then the host
30
+ for the apex record should be origin.domain.com with the host
31
+ <acronym title="Internet Protocol">IP</acronym> of domain.com, e.g.:
32
  </span>
33
  </td>
34
  </tr>
54
  <input type="button"
55
  class="w3tc_cdn_cloudfront_fsd_configure_distribution w3tc-button-save button-primary"
56
  value="<?php _e( 'Apply', 'w3-total-cache' ); ?>" />
57
+ <input type="button"
58
+ class="w3tc_cdn_cloudfront_fsd_configure_distribution_skip w3tc-button-save button"
59
+ value="<?php _e( 'Don\'t reconfigure, I know what I\'m doing', 'w3-total-cache' ); ?>" />
60
  </p>
61
  <?php Util_Ui::postbox_footer(); ?>
62
  </div>
Cdn_CloudFrontFsd_Popup_View_Distributions.php CHANGED
File without changes
Cdn_CloudFrontFsd_Popup_View_Intro.php CHANGED
File without changes
Cdn_CloudFrontFsd_Popup_View_Success.php CHANGED
@@ -11,9 +11,9 @@ if ( !defined( 'W3TC' ) )
11
 
12
  <div style="text-align: center">
13
  Pull Zone <?php echo $details['name'] ?> was successfully configured.<br />
14
- Now you need to change DNS records of your domain
15
- <strong><?php echo $details['home_domain'] ?></strong> and CNAME it to
16
- <strong><?php echo $details['dns_cname_target'] ?></strong> to make caching work.
17
 
18
  <p class="submit">
19
  <input type="button"
11
 
12
  <div style="text-align: center">
13
  Pull Zone <?php echo $details['name'] ?> was successfully configured.<br />
14
+ Next, update the domain DNS records
15
+ <strong><?php echo $details['home_domain'] ?></strong> and add <acronym title="Canonical Name">CNAME</acronym> alias to
16
+ <strong><?php echo $details['dns_cname_target'] ?></strong> to enable caching.
17
 
18
  <p class="submit">
19
  <input type="button"
Cdn_ConfigLabels.php CHANGED
File without changes
Cdn_Core.php CHANGED
@@ -622,7 +622,11 @@ class Cdn_Core {
622
  if ( is_file( $file ) )
623
  return $file;
624
 
625
- return rtrim( Util_Environment::document_root(), "/" ) . '/' . ltrim( $file, "/" );
 
 
 
 
626
  }
627
 
628
  /**
622
  if ( is_file( $file ) )
623
  return $file;
624
 
625
+ if ( DIRECTORY_SEPARATOR != '/' )
626
+ $file = str_replace( '/', DIRECTORY_SEPARATOR, $file );
627
+
628
+ return rtrim( Util_Environment::document_root(), '/\\' ) .
629
+ DIRECTORY_SEPARATOR . ltrim( $file, '/\\' );
630
  }
631
 
632
  /**
Cdn_Core_Admin.php CHANGED
@@ -442,7 +442,7 @@ class Cdn_Core_Admin {
442
  $guid = ltrim( $upload_info['baseurlpath'] . $title, ',' );
443
  $mime_type = Util_Mime::get_mime_type( $dst );
444
 
445
- $GLOBALS['wp_rewrite'] = new WP_Rewrite();
446
 
447
  /**
448
  * Insert attachment
442
  $guid = ltrim( $upload_info['baseurlpath'] . $title, ',' );
443
  $mime_type = Util_Mime::get_mime_type( $dst );
444
 
445
+ $GLOBALS['wp_rewrite'] = new \WP_Rewrite();
446
 
447
  /**
448
  * Insert attachment
Cdn_Environment.php CHANGED
File without changes
Cdn_Fsd_CacheFlush.php CHANGED
File without changes
Cdn_Fsd_Core.php CHANGED
File without changes
Cdn_Fsd_Util.php CHANGED
File without changes
Cdn_GeneralPage_View.php CHANGED
@@ -11,7 +11,7 @@ Util_Ui::config_overloading_button( array(
11
  ?>
12
  <p><?php _e( 'Host static files with your content delivery network provider to reduce page load time.', 'w3-total-cache' ); ?>
13
  <?php if ( !$cdn_enabled ): ?>
14
- <?php printf( __( 'If you do not have a <acronym title="Content Delivery Network">CDN</acronym> provider try MaxCDN. <a href="%s" target="_blank">Sign up and save 25&#37;</a>.', 'w3-total-cache' ), wp_nonce_url( Util_Ui::admin_url( 'admin.php?page=w3tc_dashboard&w3tc_cdn_maxcdn_signup' ), 'w3tc' ) ); ?>
15
  <?php endif ?>
16
  </p>
17
  <table class="form-table">
11
  ?>
12
  <p><?php _e( 'Host static files with your content delivery network provider to reduce page load time.', 'w3-total-cache' ); ?>
13
  <?php if ( !$cdn_enabled ): ?>
14
+ <?php printf( __( ' If you do not have a <acronym title="Content Delivery Network">CDN</acronym> provider try MaxCDN. <a href="%s" target="_blank">Sign up and save 25&#37;</a>.', 'w3-total-cache' ), wp_nonce_url( Util_Ui::admin_url( 'admin.php?page=w3tc_dashboard&w3tc_cdn_maxcdn_signup' ), 'w3tc' ) ); ?>
15
  <?php endif ?>
16
  </p>
17
  <table class="form-table">
Cdn_GoogleDrive_AdminActions.php CHANGED
File without changes
Cdn_GoogleDrive_Page.php CHANGED
File without changes
Cdn_GoogleDrive_Page_View.js CHANGED
File without changes
Cdn_GoogleDrive_Page_View.php CHANGED
File without changes
Cdn_GoogleDrive_Popup_AuthReturn.php CHANGED
File without changes
Cdn_GoogleDrive_Popup_AuthReturn_View.php CHANGED
File without changes
Cdn_Highwinds_Api.php CHANGED
File without changes
Cdn_Highwinds_Page.php CHANGED
File without changes
Cdn_Highwinds_Page_View.js CHANGED
File without changes
Cdn_Highwinds_Page_View.php CHANGED
File without changes
Cdn_Highwinds_Popup.php CHANGED
File without changes
Cdn_Highwinds_Popup_View_ConfigureCnamesForm.php CHANGED
File without changes
Cdn_Highwinds_Popup_View_Intro.php CHANGED
File without changes
Cdn_Highwinds_Popup_View_SelectHost.php CHANGED
File without changes
Cdn_Highwinds_Widget.php CHANGED
File without changes
Cdn_Highwinds_Widget_View.css CHANGED
File without changes
Cdn_Highwinds_Widget_View.js CHANGED
File without changes
Cdn_Highwinds_Widget_View.php CHANGED
File without changes
Cdn_Highwinds_Widget_View_NotConfigured.php CHANGED
File without changes
Cdn_MaxCdnFsd_Engine.php CHANGED
File without changes
Cdn_MaxCdnFsd_Page.php CHANGED
File without changes
Cdn_MaxCdnFsd_Page_View.js CHANGED
File without changes
Cdn_MaxCdnFsd_Page_View.php CHANGED
File without changes
Cdn_MaxCdnFsd_Popup.php CHANGED
File without changes
Cdn_MaxCdnFsd_Popup_View_Intro.php CHANGED
File without changes
Cdn_MaxCdnFsd_Popup_View_Success.php CHANGED
@@ -11,9 +11,9 @@ if ( !defined( 'W3TC' ) )
11
 
12
  <div style="text-align: center">
13
  Pull Zone <?php echo $details['name'] ?> was successfully configured.<br />
14
- Now you need to change DNS records of your domain
15
- <strong><?php echo $details['home_domain'] ?></strong> and CNAME it to
16
- <strong><?php echo $details['dns_cname_target'] ?></strong> to make caching work.
17
  </div>
18
 
19
  <p class="submit">
11
 
12
  <div style="text-align: center">
13
  Pull Zone <?php echo $details['name'] ?> was successfully configured.<br />
14
+ Next, update the domain <acronym title="Domain Name System">DNS</acronym> records
15
+ <strong><?php echo $details['home_domain'] ?></strong> and add <acronym title="Canonical Name">CNAME</acronym> alias to
16
+ <strong><?php echo $details['dns_cname_target'] ?></strong> to enable caching.
17
  </div>
18
 
19
  <p class="submit">
Cdn_MaxCdnFsd_Popup_View_Zone.php CHANGED
File without changes
Cdn_MaxCdnFsd_Popup_View_Zones.php CHANGED
File without changes
Cdn_Page.php CHANGED
File without changes
Cdn_Page_View_Fsd_HeaderActions.php CHANGED
@@ -8,7 +8,7 @@ if ( !defined( 'W3TC' ) )
8
  <p>
9
  <?php
10
  echo Util_Ui::button_link(
11
- __( 'purge CDN completely', 'w3-total-cache' ),
12
  Util_Ui::url( array( 'w3tc_cdn_flush' => 'y' ) ) );
13
  ?>
14
  </p>
8
  <p>
9
  <?php
10
  echo Util_Ui::button_link(
11
+ __( 'Purge CDN completely', 'w3-total-cache' ),
12
  Util_Ui::url( array( 'w3tc_cdn_flush' => 'y' ) ) );
13
  ?>
14
  </p>
Cdn_Page_View_Header.php CHANGED
File without changes
Cdn_Plugin.php CHANGED
@@ -338,7 +338,7 @@ class Cdn_Plugin {
338
  */
339
  function get_files_includes() {
340
  $includes_root = Util_Environment::normalize_path( ABSPATH . WPINC );
341
- $doc_root = Util_Environment::document_root();
342
  $includes_path = ltrim( str_replace( $doc_root, '', $includes_root ), '/' );
343
 
344
  $files = Cdn_Util::search_files(
@@ -367,7 +367,7 @@ class Cdn_Plugin {
367
 
368
  $themes_root = Util_Environment::normalize_path( $themes_root );
369
  $themes_path = ltrim( str_replace(
370
- Util_Environment::document_root(), '', $themes_root ), '/' );
371
  $files = Cdn_Util::search_files(
372
  $themes_root, $themes_path, $this->_config->get_string( 'cdn.theme.files' )
373
  );
@@ -391,8 +391,10 @@ class Cdn_Plugin {
391
 
392
  $minify = Dispatcher::component( 'Minify_Plugin' );
393
 
394
- $document_root = Util_Environment::document_root();
395
- $minify_root = Util_Environment::cache_blog_dir( 'minify' );
 
 
396
  $minify_path = ltrim( str_replace( $document_root, '', $minify_root ), '/' );
397
  $urls = $minify->get_urls();
398
 
@@ -442,14 +444,15 @@ class Cdn_Plugin {
442
  */
443
  function get_files_custom() {
444
  $files = array();
445
- $document_root = Util_Environment::document_root();
 
446
  $custom_files = $this->_config->get_array( 'cdn.custom.files' );
447
  $custom_files = array_map( array( '\W3TC\Util_Environment', 'parse_path' ), $custom_files );
448
- $site_root = Util_Environment::site_root();
449
  $path = Util_Environment::site_url_uri();
450
  $site_root_dir = str_replace( $document_root, '', $site_root );
451
  if ( strstr( WP_CONTENT_DIR, Util_Environment::site_root() ) === false ) {
452
- $site_root = Util_Environment::document_root();
453
  $path = '';
454
  }
455
 
@@ -1007,7 +1010,14 @@ class _Cdn_Plugin_ContentFilter {
1007
  foreach ( $masks as $mask ) {
1008
  if ( !empty( $mask ) ) {
1009
  if ( Util_Environment::is_url( $mask ) ) {
1010
- $custom_regexps_urls[] = Cdn_Util::get_regexp_by_mask( $mask );
 
 
 
 
 
 
 
1011
  } elseif ( substr( $mask, 0, 1 ) == '/' ) { // uri
1012
  $custom_regexps_uris[] = Cdn_Util::get_regexp_by_mask( $mask );
1013
  } else {
@@ -1021,15 +1031,17 @@ class _Cdn_Plugin_ContentFilter {
1021
  }
1022
 
1023
  if ( count( $custom_regexps_urls ) > 0 ) {
1024
- foreach ( $custom_regexps_urls as $regexp )
1025
- $regexps[] = '~(["\'(=])\s*((' . $regexp . ')?(()([^"\'() >]*)))~i';
 
 
1026
  }
1027
  if ( count( $custom_regexps_uris ) > 0 ) {
1028
  $regexps[] = '~(["\'(=])\s*((' . $domain_url_regexp .
1029
  ')?((' . implode( '|', $custom_regexps_uris ) . ')([^"\'() >]*)))~i';
1030
  }
1031
 
1032
- if ( count( $custom_regexps_docroot_related ) > 0) {
1033
  $regexps[] = '~(["\'(=])\s*((' . $domain_url_regexp .
1034
  ')?(' . Util_Environment::preg_quote( $site_path ) .
1035
  '(' . implode( '|', $custom_regexps_docroot_related ) . ')([^"\'() >]*)))~i';
338
  */
339
  function get_files_includes() {
340
  $includes_root = Util_Environment::normalize_path( ABSPATH . WPINC );
341
+ $doc_root = Util_Environment::normalize_path( Util_Environment::document_root() );
342
  $includes_path = ltrim( str_replace( $doc_root, '', $includes_root ), '/' );
343
 
344
  $files = Cdn_Util::search_files(
367
 
368
  $themes_root = Util_Environment::normalize_path( $themes_root );
369
  $themes_path = ltrim( str_replace(
370
+ Util_Environment::normalize_path( Util_Environment::document_root() ), '', $themes_root ), '/' );
371
  $files = Cdn_Util::search_files(
372
  $themes_root, $themes_path, $this->_config->get_string( 'cdn.theme.files' )
373
  );
391
 
392
  $minify = Dispatcher::component( 'Minify_Plugin' );
393
 
394
+ $document_root = Util_Environment::normalize_path(
395
+ Util_Environment::document_root() );
396
+ $minify_root = Util_Environment::normalize_path(
397
+ Util_Environment::cache_blog_dir( 'minify' ) );
398
  $minify_path = ltrim( str_replace( $document_root, '', $minify_root ), '/' );
399
  $urls = $minify->get_urls();
400
 
444
  */
445
  function get_files_custom() {
446
  $files = array();
447
+ $document_root = Util_Environment::normalize_path(
448
+ Util_Environment::document_root() );
449
  $custom_files = $this->_config->get_array( 'cdn.custom.files' );
450
  $custom_files = array_map( array( '\W3TC\Util_Environment', 'parse_path' ), $custom_files );
451
+ $site_root = Util_Environment::normalize_path( Util_Environment::site_root() );
452
  $path = Util_Environment::site_url_uri();
453
  $site_root_dir = str_replace( $document_root, '', $site_root );
454
  if ( strstr( WP_CONTENT_DIR, Util_Environment::site_root() ) === false ) {
455
+ $site_root = Util_Environment::normalize_path( Util_Environment::document_root() );
456
  $path = '';
457
  }
458
 
1010
  foreach ( $masks as $mask ) {
1011
  if ( !empty( $mask ) ) {
1012
  if ( Util_Environment::is_url( $mask ) ) {
1013
+ $url_match = array();
1014
+ if ( preg_match( '~^((https?:)?//([^/]*))(.*)~', $mask, $url_match ) ) {
1015
+ $custom_regexps_urls[] = array(
1016
+ 'domain_url' => Util_Environment::get_url_regexp(
1017
+ $url_match[1] ),
1018
+ 'uri' => Cdn_Util::get_regexp_by_mask( $url_match[4] )
1019
+ );
1020
+ }
1021
  } elseif ( substr( $mask, 0, 1 ) == '/' ) { // uri
1022
  $custom_regexps_uris[] = Cdn_Util::get_regexp_by_mask( $mask );
1023
  } else {
1031
  }
1032
 
1033
  if ( count( $custom_regexps_urls ) > 0 ) {
1034
+ foreach ( $custom_regexps_urls as $regexp ) {
1035
+ $regexps[] = '~(["\'(=])\s*((' . $regexp['domain_url'] .
1036
+ ')?((' . $regexp['uri'] . ')([^"\'() >]*)))~i';
1037
+ }
1038
  }
1039
  if ( count( $custom_regexps_uris ) > 0 ) {
1040
  $regexps[] = '~(["\'(=])\s*((' . $domain_url_regexp .
1041
  ')?((' . implode( '|', $custom_regexps_uris ) . ')([^"\'() >]*)))~i';
1042
  }
1043
 
1044
+ if ( count( $custom_regexps_docroot_related ) > 0 ) {
1045
  $regexps[] = '~(["\'(=])\s*((' . $domain_url_regexp .
1046
  ')?(' . Util_Environment::preg_quote( $site_path ) .
1047
  '(' . implode( '|', $custom_regexps_docroot_related ) . ')([^"\'() >]*)))~i';
Cdn_Plugin_Admin.php CHANGED
File without changes
Cdn_Plugin_WidgetMaxCdn.php CHANGED
@@ -35,11 +35,11 @@ class Cdn_Plugin_WidgetMaxCdn {
35
  add_action( 'w3tc_widget_setup', array(
36
  $this,
37
  'wp_dashboard_setup'
38
- ) );
39
  add_action( 'w3tc_network_dashboard_setup', array(
40
  $this,
41
  'wp_dashboard_setup'
42
- ) );
43
 
44
  // Configure authorize and have_zone
45
  $this->_setup( $this->_config );
35
  add_action( 'w3tc_widget_setup', array(
36
  $this,
37
  'wp_dashboard_setup'
38
+ ), 100 );
39
  add_action( 'w3tc_network_dashboard_setup', array(
40
  $this,
41
  'wp_dashboard_setup'
42
+ ), 100 );
43
 
44
  // Configure authorize and have_zone
45
  $this->_setup( $this->_config );
Cdn_Plugin_WidgetNetDna.php CHANGED
File without changes
Cdn_RackSpaceCdn_AdminActions.php CHANGED
File without changes
Cdn_RackSpaceCdn_Page.php CHANGED
File without changes
Cdn_RackSpaceCdn_Page_View.js CHANGED
File without changes
Cdn_RackSpaceCdn_Page_View.php CHANGED
File without changes
Cdn_RackSpaceCdn_Popup.php CHANGED
File without changes
Cdn_RackSpaceCdn_Popup_View_ConfigureDomains.php CHANGED
File without changes
Cdn_RackSpaceCdn_Popup_View_Intro.php CHANGED
File without changes
Cdn_RackSpaceCdn_Popup_View_Regions.php CHANGED
File without changes
Cdn_RackSpaceCdn_Popup_View_Service_Actualize.php CHANGED
File without changes
Cdn_RackSpaceCdn_Popup_View_Service_Create.php CHANGED
File without changes
Cdn_RackSpaceCdn_Popup_View_Service_Created.php CHANGED
@@ -25,7 +25,7 @@ echo Util_Ui::nonce_field( 'w3tc' );
25
  <div class="spinner" style="float: right; display: block"></div>
26
  <div style="text-align: left">
27
  Service <?php echo $details['name'] ?> was successfully created.<br />
28
- Waiting for RackSpace to finish publishing process.<br />
29
  <br />
30
 
31
  Actual state is:
@@ -39,9 +39,9 @@ echo Util_Ui::nonce_field( 'w3tc' );
39
  Service <?php echo $details['name'] ?> was successfully configured.<br />
40
  <?php if ( !$is_https ): ?>
41
  <br />
42
- Now you need to change DNS records of your domain
43
- <strong><?php echo $details['cname'] ?></strong> and CNAME it to<br />
44
- <strong class="w3tc_rackspace_access_url"></strong> to make caching work.
45
  <?php endif; ?>
46
  </div>
47
  </div>
25
  <div class="spinner" style="float: right; display: block"></div>
26
  <div style="text-align: left">
27
  Service <?php echo $details['name'] ?> was successfully created.<br />
28
+ Waiting for RackSpace to finish the provisioning process.<br />
29
  <br />
30
 
31
  Actual state is:
39
  Service <?php echo $details['name'] ?> was successfully configured.<br />
40
  <?php if ( !$is_https ): ?>
41
  <br />
42
+ Next, update the domain's <acronym title="Domain Name System">DNS</acronym> records
43
+ <strong><?php echo $details['cname'] ?></strong> and add <acronym title="Canonical Name">CNAME</acronym> alias to<br />
44
+ <strong class="w3tc_rackspace_access_url"></strong> to enable caching.
45
  <?php endif; ?>
46
  </div>
47
  </div>
Cdn_RackSpaceCdn_Popup_View_Services.php CHANGED
File without changes
Cdn_RackSpaceCloudFiles_Page.php CHANGED
File without changes
Cdn_RackSpaceCloudFiles_Page_View.js CHANGED
File without changes
Cdn_RackSpaceCloudFiles_Page_View.php CHANGED
File without changes
Cdn_RackSpaceCloudFiles_Popup.php CHANGED
File without changes
Cdn_RackSpaceCloudFiles_Popup_View_Containers.php CHANGED
File without changes
Cdn_RackSpaceCloudFiles_Popup_View_Intro.php CHANGED
File without changes
Cdn_RackSpaceCloudFiles_Popup_View_Regions.php CHANGED
File without changes
Cdn_RackSpace_Api_CaCert-example.pem CHANGED
File without changes
Cdn_RackSpace_Api_Cdn.php CHANGED
File without changes
Cdn_RackSpace_Api_CloudFiles.php CHANGED
File without changes
Cdn_RackSpace_Api_CloudFilesCdn.php CHANGED
File without changes
Cdn_RackSpace_Api_Tokens.php CHANGED
File without changes
Cdn_Util.php CHANGED
@@ -230,7 +230,7 @@ class Cdn_Util {
230
 
231
  $upload_dir = Util_Environment::wp_upload_dir();
232
  if ( isset( $upload_dir['baseurl'] ) )
233
- $uploads_uri = $upload_dir['baseurl'];
234
  else
235
  $uploads_uri = '';
236
  }
230
 
231
  $upload_dir = Util_Environment::wp_upload_dir();
232
  if ( isset( $upload_dir['baseurl'] ) )
233
+ $uploads_uri = Util_Environment::url_to_uri( $upload_dir['baseurl'] );
234
  else
235
  $uploads_uri = '';
236
  }
Cli.php CHANGED
File without changes
Config.php CHANGED
File without changes
ConfigCompiler.php CHANGED
@@ -405,6 +405,26 @@ class ConfigCompiler {
405
  $this->_set_if_exists( $file_data, 'fragmentcache.lifetime',
406
  'fragmentcache', 'lifetime' );
407
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
408
  $file_data['version'] = W3TC_VERSION;
409
 
410
  return $file_data;
405
  $this->_set_if_exists( $file_data, 'fragmentcache.lifetime',
406
  'fragmentcache', 'lifetime' );
407
 
408
+
409
+ // new options, separated old one. implemented in 0.9.5.3
410
+ if ( isset( $file_data['browsercache.cssjs.replace'] ) &&
411
+ !isset( $file_data['browsercache.cssjs.querystring'] ) ) {
412
+ $file_data['browsercache.cssjs.querystring'] = $file_data['browsercache.cssjs.replace'];
413
+ }
414
+ if ( isset( $file_data['browsercache.other.replace'] ) &&
415
+ !isset( $file_data['browsercache.other.querystring'] ) ) {
416
+ $file_data['browsercache.other.querystring'] = $file_data['browsercache.other.replace'];
417
+ }
418
+
419
+ //
420
+ // changes in 0.9.5.3
421
+ //
422
+ if ( version_compare( $file_data['version'], '0.9.5.3', '<' ) ) {
423
+ if ( !isset( $file_data['extensions.active']['swarmify'] ) ) {
424
+ $file_data['extensions.active']['swarmify'] = 'w3-total-cache/Extension_Swarmify_Plugin.php';
425
+ }
426
+ }
427
+
428
  $file_data['version'] = W3TC_VERSION;
429
 
430
  return $file_data;
ConfigKeys.php CHANGED
@@ -331,7 +331,7 @@ $keys = array(
331
  ),
332
  'pgcache.cache.query' => array(
333
  'type' => 'boolean',
334
- 'default' => true
335
  ),
336
  'pgcache.cache.home' => array(
337
  'type' => 'boolean',
@@ -347,7 +347,7 @@ $keys = array(
347
  ),
348
  'pgcache.cache.ssl' => array(
349
  'type' => 'boolean',
350
- 'default' => false
351
  ),
352
  'pgcache.cache.404' => array(
353
  'type' => 'boolean',
@@ -807,11 +807,11 @@ $keys = array(
807
  ),
808
  'minify.csstidy.options.compress_colors' => array(
809
  'type' => 'boolean',
810
- 'default' => true
811
  ),
812
  'minify.csstidy.options.compress_font-weight' => array(
813
  'type' => 'boolean',
814
- 'default' => true
815
  ),
816
  'minify.csstidy.options.lowercase_s' => array(
817
  'type' => 'boolean',
@@ -819,12 +819,16 @@ $keys = array(
819
  ),
820
  'minify.csstidy.options.optimise_shorthands' => array(
821
  'type' => 'integer',
822
- 'default' => 1
823
  ),
824
  'minify.csstidy.options.remove_last_;' => array(
825
  'type' => 'boolean',
826
  'default' => false
827
  ),
 
 
 
 
828
  'minify.csstidy.options.case_properties' => array(
829
  'type' => 'integer',
830
  'default' => 1
@@ -839,7 +843,11 @@ $keys = array(
839
  ),
840
  'minify.csstidy.options.merge_selectors' => array(
841
  'type' => 'integer',
842
- 'default' => 2
 
 
 
 
843
  ),
844
  'minify.csstidy.options.discard_invalid_properties' => array(
845
  'type' => 'boolean',
@@ -847,7 +855,7 @@ $keys = array(
847
  ),
848
  'minify.csstidy.options.css_level' => array(
849
  'type' => 'string',
850
- 'default' => 'CSS2.1'
851
  ),
852
  'minify.csstidy.options.preserve_css' => array(
853
  'type' => 'boolean',
@@ -859,7 +867,7 @@ $keys = array(
859
  ),
860
  'minify.csstidy.options.template' => array(
861
  'type' => 'string',
862
- 'default' => 'default'
863
  ),
864
  'minify.htmltidy.options.clean' => array(
865
  'type' => 'boolean',
@@ -1460,6 +1468,10 @@ $keys = array(
1460
  'type' => 'boolean',
1461
  'default' => false
1462
  ),
 
 
 
 
1463
  'browsercache.html.compression' => array(
1464
  'type' => 'boolean',
1465
  'default' => true
@@ -1536,6 +1548,10 @@ $keys = array(
1536
  'type' => 'boolean',
1537
  'default' => false
1538
  ),
 
 
 
 
1539
  'browsercache.replace.exceptions' => array (
1540
  'type' => 'array',
1541
  'default' => array()
@@ -1825,7 +1841,8 @@ $keys = array(
1825
  'type' => 'array',
1826
  'default' => array(
1827
  'newrelic' => 'w3-total-cache/Extension_NewRelic_Plugin.php',
1828
- 'fragmentcache' => 'w3-total-cache/Extension_FragmentCache_Plugin.php'
 
1829
  )
1830
  ),
1831
  'extensions.active_frontend' => array(
331
  ),
332
  'pgcache.cache.query' => array(
333
  'type' => 'boolean',
334
+ 'default' => false
335
  ),
336
  'pgcache.cache.home' => array(
337
  'type' => 'boolean',
347
  ),
348
  'pgcache.cache.ssl' => array(
349
  'type' => 'boolean',
350
+ 'default' => true
351
  ),
352
  'pgcache.cache.404' => array(
353
  'type' => 'boolean',
807
  ),
808
  'minify.csstidy.options.compress_colors' => array(
809
  'type' => 'boolean',
810
+ 'default' => false
811
  ),
812
  'minify.csstidy.options.compress_font-weight' => array(
813
  'type' => 'boolean',
814
+ 'default' => false
815
  ),
816
  'minify.csstidy.options.lowercase_s' => array(
817
  'type' => 'boolean',
819
  ),
820
  'minify.csstidy.options.optimise_shorthands' => array(
821
  'type' => 'integer',
822
+ 'default' => 0
823
  ),
824
  'minify.csstidy.options.remove_last_;' => array(
825
  'type' => 'boolean',
826
  'default' => false
827
  ),
828
+ 'minify.csstidy.options.remove_space_before_important' => array(
829
+ 'type' => 'boolean',
830
+ 'default' => false
831
+ ),
832
  'minify.csstidy.options.case_properties' => array(
833
  'type' => 'integer',
834
  'default' => 1
843
  ),
844
  'minify.csstidy.options.merge_selectors' => array(
845
  'type' => 'integer',
846
+ 'default' => 0
847
+ ),
848
+ 'minify.csstidy.options.discard_invalid_selectors' => array(
849
+ 'type' => 'boolean',
850
+ 'default' => false
851
  ),
852
  'minify.csstidy.options.discard_invalid_properties' => array(
853
  'type' => 'boolean',
855
  ),
856
  'minify.csstidy.options.css_level' => array(
857
  'type' => 'string',
858
+ 'default' => 'CSS3.0'
859
  ),
860
  'minify.csstidy.options.preserve_css' => array(
861
  'type' => 'boolean',
867
  ),
868
  'minify.csstidy.options.template' => array(
869
  'type' => 'string',
870
+ 'default' => 'highest_compression'
871
  ),
872
  'minify.htmltidy.options.clean' => array(
873
  'type' => 'boolean',
1468
  'type' => 'boolean',
1469
  'default' => false
1470
  ),
1471
+ 'browsercache.cssjs.querystring' => array(
1472
+ 'type' => 'boolean',
1473
+ 'default' => false
1474
+ ),
1475
  'browsercache.html.compression' => array(
1476
  'type' => 'boolean',
1477
  'default' => true
1548
  'type' => 'boolean',
1549
  'default' => false
1550
  ),
1551
+ 'browsercache.other.querystring' => array(
1552
+ 'type' => 'boolean',
1553
+ 'default' => false
1554
+ ),
1555
  'browsercache.replace.exceptions' => array (
1556
  'type' => 'array',
1557
  'default' => array()
1841
  'type' => 'array',
1842
  'default' => array(
1843
  'newrelic' => 'w3-total-cache/Extension_NewRelic_Plugin.php',
1844
+ 'fragmentcache' => 'w3-total-cache/Extension_FragmentCache_Plugin.php',
1845
+ 'swarmify' => 'w3-total-cache/Extension_Swarmify_Plugin.php'
1846
  )
1847
  ),
1848
  'extensions.active_frontend' => array(
ConfigState.php CHANGED
File without changes
ConfigStateNote.php CHANGED
File without changes
DbCache_ConfigLabels.php CHANGED
File without changes
DbCache_Core.php CHANGED
File without changes
DbCache_Environment.php CHANGED
File without changes
DbCache_Page.php CHANGED
File without changes
DbCache_Plugin.php CHANGED
File without changes
DbCache_Plugin_Admin.php CHANGED
File without changes
DbCache_Wpdb.php CHANGED
File without changes
DbCache_WpdbBase.php CHANGED
File without changes
DbCache_WpdbInjection.php CHANGED
File without changes
DbCache_WpdbInjection_QueryCaching.php CHANGED
@@ -116,7 +116,7 @@ class DbCache_WpdbInjection_QueryCaching extends DbCache_WpdbInjection {
116
  $caching = false;
117
  }
118
 
119
- if ( preg_match( '~^\s*insert\b|^\s*delete\b|^\s*update\b|^\s*replace\b|^\s*commit\b|^\s*truncate\b~is', $query ) ) {
120
  if ( $caching ) {
121
  $this->cache_reject_reason = 'modification query';
122
  $caching = false;
@@ -363,7 +363,7 @@ class DbCache_WpdbInjection_QueryCaching extends DbCache_WpdbInjection {
363
  $ajax_skip = false;
364
  if ( defined( 'DOING_AJAX' ) ) {
365
  // wp_admin is always defined for ajax requests, check by referrer
366
- if ( isset( $_SERVER['HTTP_REFERER'] ) &&
367
  strpos( $_SERVER['HTTP_REFERER'], '/wp-admin/' ) === false )
368
  $ajax_skip = true;
369
  }
116
  $caching = false;
117
  }
118
 
119
+ if ( preg_match( '~^\s*insert\b|^\s*delete\b|^\s*update\b|^\s*replace\b|^\s*commit\b|^\s*truncate\b|^\s*drop\b|^\s*create\b~is', $query ) ) {
120
  if ( $caching ) {
121
  $this->cache_reject_reason = 'modification query';
122
  $caching = false;
363
  $ajax_skip = false;
364
  if ( defined( 'DOING_AJAX' ) ) {
365
  // wp_admin is always defined for ajax requests, check by referrer
366
+ if ( isset( $_SERVER['HTTP_REFERER'] ) &&
367
  strpos( $_SERVER['HTTP_REFERER'], '/wp-admin/' ) === false )
368
  $ajax_skip = true;
369
  }
Dispatcher.php CHANGED
File without changes
Enterprise_CacheFlush_MakeSnsEvent.php CHANGED
File without changes
Enterprise_Dbcache_WpdbInjection_Cluster.php CHANGED
File without changes
Enterprise_SnsBase.php CHANGED
File without changes
Enterprise_SnsServer.php CHANGED
File without changes
Extension_Amp_Plugin.php CHANGED
@@ -11,19 +11,25 @@ class Extension_Amp_Plugin {
11
  array( $this, 'w3tc_minify_jscss_enable' ) );
12
  add_filter( 'w3tc_minify_css_enable',
13
  array( $this, 'w3tc_minify_jscss_enable' ) );
14
- add_filter( 'w3tc_footer_comment',
15
  array( $this, 'w3tc_footer_comment' ) );
 
 
 
 
 
 
16
 
17
  }
18
 
19
 
20
 
21
  private function is_amp_endpoint() {
22
- if ( is_null( $is_amp_endpoint ) && function_exists('is_amp_endpoint') ) {
23
- $is_amp_endpoint = is_amp_endpoint();
24
  }
25
 
26
- return $is_amp_endpoint;
27
  }
28
 
29
 
@@ -41,13 +47,42 @@ class Extension_Amp_Plugin {
41
 
42
 
43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  public function w3tc_footer_comment( $strings ) {
45
  $is_amp_endpoint = $this->is_amp_endpoint();
46
 
47
  if ( !is_null( $is_amp_endpoint ) && $is_amp_endpoint ) {
48
  $strings[] = 'AMP page, minification is limited';
49
  }
50
-
51
  return $strings;
52
  }
53
  }
11
  array( $this, 'w3tc_minify_jscss_enable' ) );
12
  add_filter( 'w3tc_minify_css_enable',
13
  array( $this, 'w3tc_minify_jscss_enable' ) );
14
+ add_filter( 'w3tc_footer_comment',
15
  array( $this, 'w3tc_footer_comment' ) );
16
+ add_filter( 'w3tc_newrelic_should_disable_auto_rum',
17
+ array( $this, 'w3tc_newrelic_should_disable_auto_rum' ) );
18
+ add_filter( 'pgcache_flush_post_queued_urls',
19
+ array( $this, 'x_flush_post_queued_urls' ) );
20
+ add_filter( 'varnish_flush_post_queued_urls',
21
+ array( $this, 'x_flush_post_queued_urls' ) );
22
 
23
  }
24
 
25
 
26
 
27
  private function is_amp_endpoint() {
28
+ if ( is_null( $this->is_amp_endpoint ) && function_exists('is_amp_endpoint') ) {
29
+ $this->is_amp_endpoint = is_amp_endpoint();
30
  }
31
 
32
+ return $this->is_amp_endpoint;
33
  }
34
 
35
 
47
 
48
 
49
 
50
+ public function w3tc_newrelic_should_disable_auto_rum( $reject_reason ) {
51
+ $is_amp_endpoint = $this->is_amp_endpoint();
52
+
53
+ if ( !is_null( $is_amp_endpoint ) && $is_amp_endpoint ) {
54
+ return 'AMP endpoint';
55
+ }
56
+
57
+ return $reject_reason;
58
+ }
59
+
60
+
61
+
62
+ public function x_flush_post_queued_urls( $queued_urls ) {
63
+ $amp_urls = array();
64
+
65
+ foreach ( $queued_urls as $url ) {
66
+ $amp_urls[] = trailingslashit( $url ) . 'amp';
67
+ }
68
+
69
+ $queued_urls = array_merge( $queued_urls, $amp_urls );
70
+
71
+ $filename = Util_Debug::log_filename( 'pagecache' );
72
+ file_put_contents( $filename, "\nstart\n" . implode("\n", $queued_urls), FILE_APPEND );
73
+
74
+ return $queued_urls;
75
+ }
76
+
77
+
78
+
79
  public function w3tc_footer_comment( $strings ) {
80
  $is_amp_endpoint = $this->is_amp_endpoint();
81
 
82
  if ( !is_null( $is_amp_endpoint ) && $is_amp_endpoint ) {
83
  $strings[] = 'AMP page, minification is limited';
84
  }
85
+
86
  return $strings;
87
  }
88
  }
Extension_Amp_Plugin_Admin.php CHANGED
File without changes
Extension_CloudFlare_AdminActions.php CHANGED
File without changes
Extension_CloudFlare_Api.php CHANGED
File without changes
Extension_CloudFlare_GeneralPage_View.php CHANGED
File without changes
Extension_CloudFlare_Page.php CHANGED
File without changes
Extension_CloudFlare_Page_View.js CHANGED
File without changes
Extension_CloudFlare_Page_View.php CHANGED
File without changes
Extension_CloudFlare_Plugin.php CHANGED
File without changes
Extension_CloudFlare_Plugin_Admin.php CHANGED
File without changes
Extension_CloudFlare_Popup.php CHANGED
File without changes
Extension_CloudFlare_Popup_View_Intro.php CHANGED
File without changes
Extension_CloudFlare_Popup_View_Zones.php CHANGED
File without changes
Extension_CloudFlare_SettingsForUi.php CHANGED
File without changes
Extension_CloudFlare_View_Comments.css CHANGED
File without changes
Extension_CloudFlare_View_Comments.js CHANGED
File without changes
Extension_CloudFlare_View_Dashboard.js CHANGED
File without changes
Extension_CloudFlare_Widget.php CHANGED
File without changes
Extension_CloudFlare_Widget_Logo.png CHANGED
File without changes
Extension_CloudFlare_Widget_View.css CHANGED
File without changes
Extension_CloudFlare_Widget_View.php CHANGED
File without changes
Extension_FeedBurner_Environment.php CHANGED
File without changes
Extension_FeedBurner_Page.php CHANGED
File without changes
Extension_FeedBurner_Page_View.php CHANGED
File without changes
Extension_FeedBurner_Plugin.php CHANGED
File without changes
Extension_FeedBurner_Plugin_Admin.php CHANGED
File without changes
Extension_FragmentCache_Api.php CHANGED
File without changes
Extension_FragmentCache_Core.php CHANGED
File without changes
Extension_FragmentCache_Environment.php CHANGED
File without changes
Extension_FragmentCache_GeneralPage.php CHANGED
File without changes
Extension_FragmentCache_GeneralPage_View.php CHANGED
File without changes
Extension_FragmentCache_Page.php CHANGED
File without changes
Extension_FragmentCache_Page_View.php CHANGED
File without changes
Extension_FragmentCache_Plugin.php CHANGED
File without changes
Extension_FragmentCache_Plugin_Admin.php CHANGED
File without changes
Extension_FragmentCache_WpObjectCache.php CHANGED
File without changes
Extension_Genesis_Page.php CHANGED
File without changes
Extension_Genesis_Page_View.php CHANGED
@@ -80,6 +80,12 @@ Util_Ui::config_item( array(
80
  'label' => __( 'Cache author/tag/categories/term post loop:', 'w3-total-cache' ),
81
  'description' => __( 'Caches the posts listed on tag, categories, author and other term pages, pagination is supported.', 'w3-total-cache' )
82
  ) );
 
 
 
 
 
 
83
  Util_Ui::config_item( array(
84
  'key' => array( 'genesis.theme', 'flush_terms' ),
85
  'control' => 'checkbox',
80
  'label' => __( 'Cache author/tag/categories/term post loop:', 'w3-total-cache' ),
81
  'description' => __( 'Caches the posts listed on tag, categories, author and other term pages, pagination is supported.', 'w3-total-cache' )
82
  ) );
83
+ Util_Ui::config_item( array(
84
+ 'key' => array( 'genesis.theme', 'loop_terms_excluded' ),
85
+ 'control' => 'textarea',
86
+ 'label' => __( 'Excluded terms pages / posts:', 'w3-total-cache' ),
87
+ 'description' => __( 'List of pages / posts that should not have the terms loop cached. Specify one page / post per line. This area supports regular expressions.', 'w3-total-cache' )
88
+ ) );
89
  Util_Ui::config_item( array(
90
  'key' => array( 'genesis.theme', 'flush_terms' ),
91
  'control' => 'checkbox',
Extension_Genesis_Plugin.php CHANGED
File without changes
Extension_Genesis_Plugin_Admin.php CHANGED
File without changes
Extension_NewRelic_AdminActions.php CHANGED
File without changes
Extension_NewRelic_AdminNotes.php CHANGED
File without changes
Extension_NewRelic_Api.php CHANGED
File without changes
Extension_NewRelic_Core.php CHANGED
File without changes
Extension_NewRelic_GeneralPage.php CHANGED
File without changes
Extension_NewRelic_GeneralPage_View.php CHANGED
File without changes
Extension_NewRelic_Page.php CHANGED
File without changes
Extension_NewRelic_Page_View_Apm.php CHANGED
File without changes
Extension_NewRelic_Plugin.php CHANGED
@@ -70,7 +70,7 @@ class Extension_NewRelic_Plugin {
70
  function ob_callback_browser( $buffer ) {
71
  $core = Dispatcher::component( 'Extension_NewRelic_Core' );
72
  $app = $core->get_effective_browser_application();
73
- if ( isset( $app['loader_script'] ) ) {
74
  $buffer = preg_replace( '~<head(\s+[^>]*)*>~Ui',
75
  '\\0' . $app['loader_script'], $buffer, 1 );
76
  }
@@ -104,6 +104,14 @@ class Extension_NewRelic_Plugin {
104
  }
105
 
106
  function _should_disable_auto_rum() {
 
 
 
 
 
 
 
 
107
  /**
108
  * Disable for AJAX so its not messed up
109
  */
70
  function ob_callback_browser( $buffer ) {
71
  $core = Dispatcher::component( 'Extension_NewRelic_Core' );
72
  $app = $core->get_effective_browser_application();
73
+ if ( isset( $app['loader_script'] ) && !$this->_should_disable_auto_rum() ) {
74
  $buffer = preg_replace( '~<head(\s+[^>]*)*>~Ui',
75
  '\\0' . $app['loader_script'], $buffer, 1 );
76
  }
104
  }
105
 
106
  function _should_disable_auto_rum() {
107
+ $reject_reason = apply_filters( 'w3tc_newrelic_should_disable_auto_rum', null );
108
+ if ( !empty( $reject_reason ) ) {
109
+ $this->newrelic_reject_reason =
110
+ __( 'rejected by filter: ', 'w3-total-cache' ) . $reject_reason;
111
+ return true;
112
+ }
113
+
114
+
115
  /**
116
  * Disable for AJAX so its not messed up
117
  */
Extension_NewRelic_Plugin_Admin.php CHANGED
File without changes
Extension_NewRelic_Popup.php CHANGED
File without changes
Extension_NewRelic_Popup_View.js CHANGED
File without changes
Extension_NewRelic_Popup_View_Intro.php CHANGED
File without changes
Extension_NewRelic_Popup_View_ListApplications.php CHANGED
File without changes
Extension_NewRelic_Service.php CHANGED
File without changes
Extension_NewRelic_Widget.php CHANGED
@@ -27,9 +27,9 @@ class Extension_NewRelic_Widget {
27
  $o = new Extension_NewRelic_Widget();
28
  $o->_config = Dispatcher::config();
29
 
30
- add_action( 'w3tc_widget_setup', array( $o, 'wp_dashboard_setup' ) );
31
  add_action( 'w3tc_network_dashboard_setup',
32
- array( $o, 'wp_dashboard_setup' ) );
33
 
34
  $nerser = Dispatcher::component( 'Extension_NewRelic_Service' );
35
  $view_application = $nerser->get_effective_application_id();
27
  $o = new Extension_NewRelic_Widget();
28
  $o->_config = Dispatcher::config();
29
 
30
+ add_action( 'w3tc_widget_setup', array( $o, 'wp_dashboard_setup' ), 350 );
31
  add_action( 'w3tc_network_dashboard_setup',
32
+ array( $o, 'wp_dashboard_setup' ), 350 );
33
 
34
  $nerser = Dispatcher::component( 'Extension_NewRelic_Service' );
35
  $view_application = $nerser->get_effective_application_id();
Extension_NewRelic_Widget_View.css CHANGED
File without changes
Extension_NewRelic_Widget_View.js CHANGED
File without changes
Extension_NewRelic_Widget_View_Apm.php CHANGED
File without changes
Extension_NewRelic_Widget_View_Browser.php CHANGED
File without changes
Extension_NewRelic_Widget_View_NotConfigured.php CHANGED
File without changes
Extension_Swarmify_AdminActions.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace W3TC;
3
+
4
+
5
+
6
+ class Extension_Swarmify_AdminActions {
7
+ public function w3tc_swarmify_set_key() {
8
+ if ( isset( $_REQUEST['status'] ) && isset( $_REQUEST['swarmcdnkey'] ) && $_REQUEST['status'] == '1' ) {
9
+ $config = Dispatcher::config();
10
+ $config->set( array( 'swarmify', 'api_key' ), $_REQUEST['swarmcdnkey'] );
11
+ $config->save();
12
+ }
13
+
14
+ Util_Environment::redirect( Util_Ui::admin_url(
15
+ 'admin.php?page=w3tc_extensions&extension=swarmify&action=view' ) );
16
+ exit();
17
+ }
18
+ }
Extension_Swarmify_Core.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace W3TC;
3
+
4
+
5
+
6
+ class Extension_Swarmify_Core {
7
+ static public function signup_url() {
8
+ $email = get_bloginfo( 'admin_email' );
9
+ $u = wp_get_current_user();
10
+ $name = $u->first_name .
11
+ ( empty( $u->first_name ) ? '' : ' ' ) .
12
+ $u->last_name;
13
+
14
+ return 'https://www.swarmify.com/landing/w3tc?' .
15
+ 'email=' . urlencode( $email ) .
16
+ '&name=' . urlencode( $name ) .
17
+ '&return=' .
18
+ urlencode( wp_nonce_url( Util_Ui::admin_url( 'admin.php' ), 'w3tc' ) .
19
+ '&page=w3tc_extensions&w3tc_swarmify_set_key=set' );
20
+ }
21
+ }
Extension_Swarmify_Page.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace W3TC;
3
+
4
+
5
+
6
+ class Extension_Swarmify_Page extends Base_Page_Settings {
7
+ /**
8
+ * Current page
9
+ */
10
+ protected $_page = 'w3tc_swarmify';
11
+
12
+
13
+
14
+ public function render_content() {
15
+ $config = Dispatcher::config();
16
+
17
+ $api_key = $config->get_string( array( 'swarmify', 'api_key' ) );
18
+ $authorized = !empty( $api_key );
19
+
20
+ $email = get_bloginfo( 'admin_email' );
21
+ $u = wp_get_current_user();
22
+ $name = $u->first_name .
23
+ ( empty( $u->first_name ) ? '' : ' ' ) .
24
+ $u->last_name;
25
+
26
+ $swarmify_signup_url = Extension_Swarmify_Core::signup_url();
27
+
28
+ include W3TC_DIR . '/Extension_Swarmify_Page_View.php';
29
+ }
30
+ }
Extension_Swarmify_Page_View.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace W3TC;
3
+
4
+ if ( !defined( 'W3TC' ) )
5
+ die();
6
+
7
+ ?>
8
+ <p>
9
+ Jump to:
10
+ <a href="admin.php?page=w3tc_general"><?php _e( 'Main Menu', 'w3-total-cache' ); ?></a> |
11
+ <a href="admin.php?page=w3tc_extensions"><?php _e( 'Extensions', 'w3-total-cache' ); ?></a>
12
+ </p>
13
+ <p>
14
+ Swarmify extension is currently <?php
15
+ if ( $config->is_extension_active_frontend( 'swarmify' ) )
16
+ echo '<span class="w3tc-enabled">enabled</span>';
17
+ else
18
+ echo '<span class="w3tc-disabled">disabled</span>';
19
+ ?>.
20
+ <p>
21
+
22
+ <form action="admin.php?page=w3tc_extensions&amp;extension=swarmify&amp;action=view" method="post">
23
+ <div class="metabox-holder">
24
+ <?php Util_Ui::postbox_header( __( 'Configuration', 'w3-total-cache' ),
25
+ '', 'configuration' ); ?>
26
+ <table class="form-table">
27
+ <?php
28
+ Util_Ui::config_item( array(
29
+ 'key' => array( 'swarmify', 'api_key' ),
30
+ 'label' => __( 'API Key:', 'w3-total-cache' ),
31
+ 'control' => 'textbox',
32
+ 'control_after' => Util_Ui::button_link( 'Obtain one', $swarmify_signup_url ),
33
+ 'description' =>
34
+ 'Swarmify API Key required in order to start optimizing your videos experience'
35
+ )
36
+ );
37
+ ?>
38
+ </table>
39
+ <?php Util_Ui::button_config_save( 'extension_swarmify_configuration' ); ?>
40
+ <?php Util_Ui::postbox_footer(); ?>
41
+
42
+
43
+
44
+ <?php Util_Ui::postbox_header( __( 'Behavior Settings', 'w3-total-cache' ), '', 'behavior' ); ?>
45
+ <table class="form-table">
46
+ <?php
47
+ Util_Ui::config_item( array(
48
+ 'key' => array( 'swarmify', 'handle.htmlvideo' ),
49
+ 'label' => __( '&lt;video&gt;:', 'w3-total-cache' ),
50
+ 'control' => 'checkbox',
51
+ 'checkbox_label' => "Optimize &lt;video&gt; HTML tags",
52
+ 'description' =>
53
+ 'Optimize videos delivered using &lt;video&gt; HTML tag.'
54
+ )
55
+ );
56
+ ?>
57
+ <?php
58
+ Util_Ui::config_item( array(
59
+ 'key' => array( 'swarmify', 'handle.jwplayer' ),
60
+ 'label' => __( 'JWPlayer:', 'w3-total-cache' ),
61
+ 'control' => 'checkbox',
62
+ 'checkbox_label' => "Optimize JWPlayer",
63
+ 'description' =>
64
+ 'Optimize videos delivered using JWPlayer script.'
65
+ )
66
+ );
67
+ ?>
68
+ <?php
69
+ Util_Ui::config_item( array(
70
+ 'key' => array( 'swarmify', 'reject.logged' ),
71
+ 'label' => __( 'Logged In:', 'w3-total-cache' ),
72
+ 'control' => 'checkbox',
73
+ 'checkbox_label' => "Don't optimize videos for logged in users",
74
+ 'description' =>
75
+ 'Only unauthenticated users will view optimized version of a given page.'
76
+ )
77
+ );
78
+ ?>
79
+ </table>
80
+ <?php Util_Ui::button_config_save( 'extension_swarmify_behaviour' ); ?>
81
+ <?php Util_Ui::postbox_footer(); ?>
82
+ </form>
83
+ </div>
Extension_Swarmify_Plugin.php ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace W3TC;
3
+
4
+
5
+
6
+ class Extension_Swarmify_Plugin {
7
+ private $reject_reason = '';
8
+ private $_config = null;
9
+
10
+ function __construct() {
11
+ $this->_config = Dispatcher::config();
12
+ }
13
+
14
+ /**
15
+ * Runs plugin
16
+ */
17
+ function run() {
18
+ add_filter( 'w3tc_config_default_values', array(
19
+ $this, 'w3tc_config_default_values' ) );
20
+
21
+ $config = Dispatcher::config();
22
+ // remainder only when extension is frontend-active
23
+ if ( !$config->is_extension_active_frontend( 'swarmify' ) )
24
+ return;
25
+
26
+ if ($this->_active()) {
27
+ Util_Bus::add_ob_callback( 'swarmify', array(
28
+ $this,
29
+ 'ob_callback'
30
+ ) );
31
+ }
32
+
33
+ add_filter( 'w3tc_footer_comment', array(
34
+ $this,
35
+ 'w3tc_footer_comment'
36
+ ) );
37
+ }
38
+
39
+ public function w3tc_config_default_values( $default_values ) {
40
+ $default_values['swarmify'] = array(
41
+ 'reject.logged' => false,
42
+ 'api_key' => '',
43
+ 'handle.htmlvideo' => true,
44
+ 'handle.jwplayer' => true
45
+ );
46
+
47
+ return $default_values;
48
+ }
49
+
50
+ function ob_callback( $buffer ) {
51
+ $c = $this->_config;
52
+ $api_key = $c->get_string( array( 'swarmify', 'api_key' ) );
53
+ $api_key = preg_replace( '~[^0-9a-zA-Z-]~', '', $api_key ); // make safe
54
+
55
+ $bootstrap_required = false;
56
+
57
+ if ( $c->get_boolean( array( 'swarmify', 'handle.htmlvideo' ) ) ) {
58
+ $count = 0;
59
+ $buffer = preg_replace( '~<video([^<>]+)>~i', '<swarmvideo\\1>',
60
+ $buffer, -1, $count );
61
+
62
+ if ( $count ) {
63
+ $buffer = preg_replace( '~<\\/video>~', '</swarmvideo>', $buffer );
64
+ $bootstrap_required = true;
65
+ }
66
+ }
67
+
68
+ if ( $c->get_boolean( array( 'swarmify', 'handle.jwplayer' ) ) ) {
69
+ $count = 0;
70
+ $buffer = preg_replace( '~jwplayer\s*\\(([^)]+)\\)\s*\\.setup\\(~', 'swarmify.jwPlayerEmbed(\\1, ',
71
+ $buffer, -1, $count );
72
+
73
+ if ( $count )
74
+ $bootstrap_required = true;
75
+ }
76
+
77
+ // add bootstrap swarmify script if there are really any videos on page
78
+ if ( $bootstrap_required ) {
79
+ $loader_script = '<script type="text/javascript">' .
80
+ 'var swarmoptions = {swarmcdnkey: "' . $api_key . '"};</script>' .
81
+ '<script type="text/javascript" src="//assets.swarmcdn.com/cross/swarmcdn.js"></script>';
82
+
83
+ $buffer = preg_replace( '~<head(\s+[^>]*)*>~Ui',
84
+ '\\0' . $loader_script, $buffer, 1 );
85
+ }
86
+
87
+ return $buffer;
88
+ }
89
+
90
+
91
+ function _active() {
92
+ $reject_reason = apply_filters( 'w3tc_swarmify_active', null );
93
+ if ( !empty( $reject_reason ) ) {
94
+ $this->reject_reason =
95
+ __( 'rejected by filter: ', 'w3-total-cache' ) . $reject_reason;
96
+ return false;
97
+ }
98
+
99
+
100
+ /**
101
+ * Disable for AJAX so its not messed up
102
+ */
103
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
104
+ $this->reject_reason = __( 'DOING_AJAX constant is defined', 'w3-total-cache' );
105
+ return false;
106
+ }
107
+
108
+ if ( defined( 'WP_ADMIN' ) ) {
109
+ $this->reject_reason = __( 'WP_ADMIN page', 'w3-total-cache' );
110
+ return false;
111
+ }
112
+
113
+ /**
114
+ * Check logged users
115
+ */
116
+ if ( $this->_config->get_boolean( array( 'swarmify', 'reject.logged' ) ) &&
117
+ is_user_logged_in() ) {
118
+ $this->reject_reason = __( 'logged in user rejected',
119
+ 'w3-total-cache' );
120
+
121
+ return false;
122
+ }
123
+
124
+ return true;
125
+ }
126
+
127
+ public function w3tc_footer_comment( $strings ) {
128
+ $append = ( $this->reject_reason != '' ) ?
129
+ sprintf( ' (%s)', $this->reject_reason ) : ' active';
130
+ $strings[] = sprintf(
131
+ __( "Swarmify%s", 'w3-total-cache' ),
132
+ $append );
133
+
134
+ return $strings;
135
+ }
136
+ }
137
+
138
+
139
+
140
+ $p = new Extension_Swarmify_Plugin();
141
+ $p->run();
142
+
143
+ if ( is_admin() ) {
144
+ $p = new Extension_Swarmify_Plugin_Admin();
145
+ $p->run();
146
+ }
Extension_Swarmify_Plugin_Admin.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace W3TC;
3
+
4
+
5
+
6
+ class Extension_Swarmify_Plugin_Admin {
7
+ /**
8
+ * @param unknown $extensions
9
+ * @param Config $config
10
+ * @return mixed
11
+ */
12
+ static public function w3tc_extensions( $extensions, $config ) {
13
+ $extensions['swarmify'] = array (
14
+ 'name' => 'Swarmify',
15
+ 'author' => 'W3 EDGE',
16
+ 'description' => __( 'Optimize your video performance by enabling the Swarmify SmartVideo™ solution.', 'w3-total-cache' ),
17
+ 'author_uri' => 'https://www.w3-edge.com/',
18
+ 'extension_uri' => 'https://www.w3-edge.com/',
19
+ 'extension_id' => 'swarmify',
20
+ 'settings_exists' => true,
21
+ 'version' => '1.0',
22
+ 'enabled' => true,
23
+ 'requirements' => '',
24
+ 'active_frontend_own_control' => true,
25
+ 'path' => 'w3-total-cache/Extension_Swarmify_Plugin.php'
26
+ );
27
+
28
+ return $extensions;
29
+ }
30
+
31
+
32
+
33
+ function run() {
34
+ add_action( 'w3tc_config_save', array( $this, 'w3tc_config_save' ), 10, 1 );
35
+
36
+ add_action( 'admin_init_w3tc_dashboard', array(
37
+ '\W3TC\Extension_Swarmify_Widget',
38
+ 'admin_init_w3tc_dashboard' ) );
39
+
40
+ add_action( 'w3tc_extension_page_swarmify',
41
+ array( $this, 'w3tc_extension_page_swarmify' ) );
42
+
43
+ add_filter( 'w3tc_admin_actions', array( $this, 'w3tc_admin_actions' ) );
44
+
45
+ add_filter( 'w3tc_notes', array( $this, 'w3tc_notes' ) );
46
+ }
47
+
48
+
49
+
50
+ public function w3tc_extension_page_swarmify() {
51
+ $v = new Extension_Swarmify_Page();
52
+ $v->render_content();
53
+ }
54
+
55
+
56
+
57
+ public function w3tc_admin_actions( $handlers ) {
58
+ $handlers['swarmify'] = 'Extension_Swarmify_AdminActions';
59
+ return $handlers;
60
+ }
61
+
62
+
63
+
64
+ public function w3tc_notes( $notes ) {
65
+ $config = Dispatcher::config();
66
+ $state = Dispatcher::config_state();
67
+
68
+ $api_key = $config->get_string( array( 'swarmify', 'api_key' ) );
69
+ $is_filled = !empty( $api_key );
70
+
71
+ if ( !$is_filled && !$state->get_boolean( 'extension.swarmify.hide_note_activate_suggestion' ) ) {
72
+ $notes['swarmify_activate_suggestion'] = sprintf(
73
+ __( 'Just as the load time and overall performance of your website impacts user satisfaction, so does the performance of your online videos. Optimize your video performance by enabling the <a href="%s">Swarmify SmartVideo™ solution</a>. %s',
74
+ 'w3-total-cache' ),
75
+ esc_attr( Extension_Swarmify_Core::signup_url() ),
76
+ Util_Ui::button_hide_note2( array(
77
+ 'w3tc_default_config_state' => 'y',
78
+ 'key' => 'extension.swarmify.hide_note_activate_suggestion',
79
+ 'value' => 'true' ) ) );
80
+ }
81
+
82
+ return $notes;
83
+ }
84
+
85
+
86
+
87
+ public function w3tc_config_save( $config ) {
88
+ // frontend activity
89
+ $api_key = $config->get_string( array( 'swarmify', 'api_key' ) );
90
+ $is_filled = !empty( $api_key );
91
+
92
+ $config->set_extension_active_frontend( 'swarmify', $is_filled );
93
+ }
94
+ }
Extension_Swarmify_Widget.php ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace W3TC;
3
+
4
+
5
+
6
+ class Extension_Swarmify_Widget {
7
+ private $_config;
8
+
9
+ static public function admin_init_w3tc_dashboard() {
10
+ $o = new Extension_Swarmify_Widget();
11
+ $o->_config = Dispatcher::config();
12
+
13
+ add_action( 'w3tc_widget_setup', array( $o, 'wp_dashboard_setup' ), 150 );
14
+ add_action( 'w3tc_network_dashboard_setup',
15
+ array( $o, 'wp_dashboard_setup' ), 150 );
16
+
17
+ wp_enqueue_style( 'w3tc-widget-swarmify',
18
+ plugins_url( 'Extension_Swarmify_Widget_View.css', W3TC_FILE ),
19
+ array(), W3TC_VERSION );
20
+ }
21
+
22
+ /**
23
+ * Dashboard setup action
24
+ */
25
+ function wp_dashboard_setup() {
26
+ Util_Widget::add( 'w3tc_swarmify',
27
+ '<div class="w3tc-widget-swarmify-logo"></div>',
28
+ array( $this, 'widget_swarmify' ),
29
+ Util_Ui::admin_url( 'admin.php?page=w3tc_extensions&extension=swarmify&action=view' ),
30
+ 'normal' );
31
+ }
32
+
33
+
34
+
35
+ /**
36
+ * Loads and configured New Relic widget to be used in WP Dashboards.
37
+ *
38
+ * @param unknown $widget_id
39
+ * @param array $form_inputs
40
+ */
41
+ function widget_swarmify( $widget_id, $form_inputs = array() ) {
42
+ $api_key = $this->_config->get_string( array( 'swarmify', 'api_key' ) );
43
+ $configured = !empty( $api_key );
44
+
45
+ $swarmify_signup_url = 'https://www.swarmify.com/landing/w3tc?return=' .
46
+ urlencode( wp_nonce_url( Util_Ui::admin_url( 'admin.php' ), 'w3tc' ) .
47
+ '&page=w3tc_extensions&w3tc_swarmify_set_key=set' );
48
+
49
+ if ( $configured ) {
50
+ include W3TC_DIR . '/Extension_Swarmify_Widget_View_NotConfigured.php';
51
+ return;
52
+ } else {
53
+ include W3TC_DIR . '/Extension_Swarmify_Widget_View_NotConfigured.php';
54
+ }
55
+ }
56
+
57
+
58
+
59
+ /**
60
+ * Gives data for widget content
61
+ */
62
+ public function w3tc_ajax_newrelic_widgetdata_basic() {
63
+ // cache status for some small time
64
+ $response = get_transient( 'w3tc_nr_widgetdata_basic' );
65
+ $response = @json_decode( $response, true );
66
+ if ( is_array( $response ) && isset( $response['time'] ) &&
67
+ $response['time'] >= time() - 60 ) {
68
+ echo json_encode( $response );
69
+ return;
70
+ }
71
+
72
+ $service = Dispatcher::component( 'Extension_NewRelic_Service' );
73
+ $verify_running = $service->verify_running();
74
+
75
+ $response = array(
76
+ 'time' => time()
77
+ );
78
+
79
+ if ( !is_array( $verify_running ) )
80
+ $response['php_agent'] = '<span class="w3tc-enabled">enabled</span>';
81
+ else
82
+ $response['php_agent'] = '<span class="w3tc-disabled">disabled</span>';
83
+
84
+ try {
85
+ $subscription = $service->get_subscription();
86
+ $response['subscription_level'] = $subscription['product-name'];
87
+
88
+ $summary = $service->get_application_summary();
89
+ $this->_fill( $response, 'apdex', $summary, 'Apdex' );
90
+ $this->_fill( $response, 'application_busy', $summary,
91
+ 'Application Busy' );
92
+ $this->_fill( $response, 'error_rate', $summary, 'Error Rate' );
93
+ $this->_fill( $response, 'throughput', $summary, 'Throughput' );
94
+ $this->_fill( $response, 'errors', $summary, 'Errors' );
95
+ $this->_fill( $response, 'response_time', $summary, 'Response Time' );
96
+ $this->_fill( $response, 'db', $summary, 'DB' );
97
+ $this->_fill( $response, 'cpu', $summary, 'CPU' );
98
+ $this->_fill( $response, 'memory', $summary, 'Memory' );
99
+
100
+ $can_use_metrics = $service->can_get_metrics();
101
+ if ( $can_use_metrics ) {
102
+ $dashboard_metrics = $service->get_dashboard_metrics();
103
+ $this->_fill_avg( $response, 'enduser', $dashboard_metrics,
104
+ 'EndUser' );
105
+ $this->_fill_avg( $response, 'webtransaction', $dashboard_metrics,
106
+ 'WebTransaction' );
107
+ $this->_fill_avg( $response, 'database', $dashboard_metrics,
108
+ 'Database' );
109
+ }
110
+
111
+ // load data for notification here too
112
+ $pl = $service->get_frontend_response_time();
113
+ update_option( 'w3tc_nr_frontend_response_time', $pl );
114
+ } catch ( \Exception $ex ) {
115
+ }
116
+
117
+ set_transient( 'w3tc_nr_widgetdata_basic', json_encode( $response ), 60 );
118
+ echo json_encode( $response );
119
+ }
120
+
121
+
122
+
123
+ public function w3tc_ajax_newrelic_widgetdata_pageloads() {
124
+ $response = array(
125
+ 'content' => '<div class="w3tcnr_topfive_message">No data available</div>'
126
+ );
127
+
128
+ try {
129
+ $service = Dispatcher::component( 'Extension_NewRelic_Service' );
130
+ $can_use_metrics = $service->can_get_metrics();
131
+ if ( $can_use_metrics ) {
132
+ $metric_slow_pages = $service->get_slowest_page_load();
133
+ if ( count( $metric_slow_pages ) > 0 ) {
134
+ $s = '<table class="w3tcnr_slowest">';
135
+
136
+ foreach ( $metric_slow_pages as $transaction => $time ) {
137
+ $s .= '<tr><td><span>' . $transaction .
138
+ '</span></td><td>' . Util_Ui::secs_to_time( $time ) .
139
+ '</td></tr>';
140
+ }
141
+
142
+ $s .= '</table>';
143
+ $response['content'] = $s;
144
+ }
145
+ }
146
+ } catch ( \Exception $e ) {
147
+ $response['content'] = '<div class="w3tcnr_topfive_message">Error occurred</div>';
148
+ }
149
+
150
+ echo json_encode( $response );
151
+ }
152
+
153
+
154
+
155
+ public function w3tc_ajax_newrelic_widgetdata_webtransactions() {
156
+ $response = array(
157
+ 'content' => '<div class="w3tcnr_topfive_message">No data available</div>'
158
+ );
159
+
160
+ try {
161
+ $service = Dispatcher::component( 'Extension_NewRelic_Service' );
162
+ $can_use_metrics = $service->can_get_metrics();
163
+ if ( $can_use_metrics ) {
164
+ $metric_slow = $service->get_slowest_webtransactions();
165
+ if ( count( $metric_slow ) > 0 ) {
166
+ $s = '<table class="w3tcnr_slowest">';
167
+
168
+ foreach ( $metric_slow as $transaction => $time ) {
169
+ $s .= '<tr><td><span>' . $transaction .
170
+ '</span></td><td>' . Util_Ui::secs_to_time( $time ) .
171
+ '</td></tr>';
172
+ }
173
+
174
+ $s .= '</table>';
175
+ $response['content'] = $s;
176
+ }
177
+ }
178
+ } catch ( \Exception $e ) {
179
+ $response['content'] = '<div class="w3tcnr_topfive_message">Error occurred</div>';
180
+ }
181
+
182
+ echo json_encode( $response );
183
+ }
184
+
185
+
186
+
187
+
188
+ public function w3tc_ajax_newrelic_widgetdata_dbtimes() {
189
+ $response = array(
190
+ 'content' => '<div class="w3tcnr_topfive_message">No data available</div>'
191
+ );
192
+
193
+ try {
194
+ $service = Dispatcher::component( 'Extension_NewRelic_Service' );
195
+ $can_use_metrics = $service->can_get_metrics();
196
+ if ( $can_use_metrics ) {
197
+ $metric_slow = $service->get_slowest_database();
198
+ if ( count( $metric_slow ) > 0 ) {
199
+ $s = '<table class="w3tcnr_slowest">';
200
+
201
+ foreach ( $metric_slow as $transaction => $time ) {
202
+ $s .= '<tr><td><span>' . $transaction .
203
+ '</span></td><td>' . Util_Ui::secs_to_time( $time ) .
204
+ '</td></tr>';
205
+ }
206
+
207
+ $s .= '</table>';
208
+ $response['content'] = $s;
209
+ }
210
+ }
211
+ } catch ( \Exception $e ) {
212
+ $response['content'] = '<div class="w3tcnr_topfive_message">Error occurred</div>';
213
+ }
214
+
215
+ echo json_encode( $response );
216
+ }
217
+
218
+
219
+
220
+ private function _fill( &$response, $response_key, $summary, $summary_key ) {
221
+ if ( isset( $summary[$summary_key] ) )
222
+ $response[$response_key] = $summary[$summary_key];
223
+ }
224
+
225
+
226
+
227
+ private function _fill_avg( &$response, $response_key, $metrics, $metric_key ) {
228
+ if ( !isset( $metrics[$metric_key] ) )
229
+ return;
230
+
231
+ $data = $metrics[$metric_key];
232
+ $response[$response_key] = Util_Ui::secs_to_time(
233
+ array_shift( $data[0] )->average_response_time
234
+ );
235
+ }
236
+ }
Extension_Swarmify_Widget_View.css ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .w3tc-widget-swarmify-base.sign-up h4 {
2
+ text-align: left;
3
+ margin-bottom: 0;
4
+ padding-bottom: 0;
5
+ }
6
+ .w3tc-widget-swarmify-base.sign-up p {
7
+ margin-top: 4px;
8
+ padding-top: 0;
9
+ }
10
+ .w3tc-widget-swarmify-base.sign-up p span.desc {
11
+ color:#8F8F8F;
12
+ }
13
+
14
+ .w3tc-widget-swarmify-logo {
15
+ width: 170px;
16
+ height: 35px;
17
+ background: url("pub/img/w3tc_swarmify-logo.png") 0 5px no-repeat;
18
+ float: left;
19
+ }
20
+
21
+ /*
22
+ @media
23
+ (-webkit-min-device-pixel-ratio: 2),
24
+ (min-resolution: 192dpi) {
25
+ .w3tc-widget-swarmify-logo{
26
+ float: left;
27
+ width: 180px;
28
+ height: 90px;
29
+ background-image: url("pub/img/w3tc_swarmify-logo-retina.png");
30
+ background-size: 589px 90px;
31
+ }
32
+ }
33
+ */
Extension_Swarmify_Widget_View_NotConfigured.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace W3TC;
3
+
4
+ if ( !defined( 'W3TC' ) )
5
+ die();
6
+
7
+ ?>
8
+ <div class="sign-up w3tc-widget-swarmify-base">
9
+ <p><?php _e( 'Just as the load time and overall performance of your website impacts user satisfaction, so does the performance of your online videos. Optimize your video performance by enabling the Swarmify SmartVideo&#8482 solution.', 'w3-total-cache' )?></p>
10
+ <h4><?php _e( 'New customers', 'w3-total-cache' )?></h4>
11
+ <p><?php _e( 'Swarmify is a service that lets you speed up your site even more with W3 Total Cache.', 'w3-total-cache' )?></p>
12
+ <a class="button-primary" href="<?php echo $swarmify_signup_url ?>" target="_blank"><?php _e( 'Sign Up Now and Save 25%', 'w3-total-cache' )?></a>
13
+ <p><span class="desc"><?php _e( 'Free 14 day limited trial', 'w3-total-cache' )?></span></p>
14
+ <h4><?php _e( 'Current customers', 'w3-total-cache' )?></h4>
15
+ <p><?php _e( 'If you already have a Swarmify configuration key, or need to update your existing key, click here:', 'w3-total-cache' )?></p>
16
+ <a class="button-primary" href="admin.php?page=w3tc_extensions&amp;extension=swarmify&amp;action=view"><?php _e( 'Configure', 'w3-total-cache' )?></a>
17
+ </div>
Extension_WordPressSeo_Plugin.php CHANGED
File without changes
Extension_WordPressSeo_Plugin_Admin.php CHANGED
File without changes
Extension_Wpml_Plugin.php CHANGED
File without changes
Extension_Wpml_Plugin_Admin.php CHANGED
File without changes
Extensions_AdminActions.php CHANGED
File without changes
Extensions_Page.php CHANGED
File without changes
Extensions_Plugin_Admin.php CHANGED
@@ -45,6 +45,10 @@ class Extensions_Plugin_Admin {
45
  '\W3TC\Extension_NewRelic_Plugin_Admin',
46
  'w3tc_extensions' ),
47
  10, 2 );
 
 
 
 
48
  add_filter( 'w3tc_extensions', array(
49
  '\W3TC\Extension_WordPressSeo_Plugin_Admin',
50
  'w3tc_extensions' ),
45
  '\W3TC\Extension_NewRelic_Plugin_Admin',
46
  'w3tc_extensions' ),
47
  10, 2 );
48
+ add_filter( 'w3tc_extensions', array(
49
+ '\W3TC\Extension_Swarmify_Plugin_Admin',
50
+ 'w3tc_extensions' ),
51
+ 10, 2 );
52
  add_filter( 'w3tc_extensions', array(
53
  '\W3TC\Extension_WordPressSeo_Plugin_Admin',
54
  'w3tc_extensions' ),
Extensions_Util.php CHANGED
File without changes
Generic_AdminActions_Config.php CHANGED
File without changes
Generic_AdminActions_Default.php CHANGED
File without changes
Generic_AdminActions_EdgeMode.php CHANGED
File without changes
Generic_AdminActions_Flush.php CHANGED
@@ -20,6 +20,24 @@ class Generic_AdminActions_Flush {
20
  $this->_redirect_after_flush( 'flush_all' );
21
  }
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  /**
24
  * Flush memcache cache action
25
  *
20
  $this->_redirect_after_flush( 'flush_all' );
21
  }
22
 
23
+ function w3tc_flush_current_page() {
24
+ $url = $_SERVER['HTTP_REFERER'];
25
+ w3tc_flush_url( $url );
26
+
27
+ ?>
28
+ <div style="text-align: center; margin-top: 30px">
29
+ <h3>Page has been flushed successfully</h3>
30
+ <a id="w3tc_return" href="<?php echo esc_attr( $url ) ?>">Return</a>
31
+ </div>
32
+ <script>
33
+ setTimeout(function() {
34
+ window.location = document.getElementById('w3tc_return').href;
35
+ }, 2000);
36
+ </script>
37
+ <?php
38
+ exit();
39
+ }
40
+
41
  /**
42
  * Flush memcache cache action
43
  *
Generic_AdminActions_Test.php CHANGED
File without changes
Generic_AdminLinks.php CHANGED
File without changes
Generic_AdminNotes.php CHANGED
File without changes
Generic_ConfigLabels.php CHANGED
File without changes
Generic_Environment.php CHANGED
File without changes
Generic_Faq.php CHANGED
File without changes
Generic_GeneralPage_View_ShowEdge.js CHANGED
File without changes
Generic_GeneralPage_View_ShowSupportUs.js CHANGED
File without changes
Generic_Page_About.php CHANGED
File without changes
Generic_Page_Dashboard.php CHANGED
File without changes
Generic_Page_Dashboard_View.css CHANGED
File without changes
Generic_Page_Faq.php CHANGED
File without changes
Generic_Page_General.php CHANGED
File without changes
Generic_Page_Install.php CHANGED
File without changes
Generic_Plugin.php CHANGED
@@ -261,7 +261,7 @@ class Generic_Plugin {
261
  'id' => 'w3tc',
262
  'title' =>
263
  '<img src="' .
264
- plugins_url( 'w3-total-cache/pub/img/w3tc-sprite-admin-bar.png' ) .
265
  '" style="vertical-align:middle; margin-right:5px; width: 29px; height: 29px" />' .
266
  __( 'Performance', 'w3-total-cache' ) .
267
  $menu_postfix,
@@ -277,6 +277,15 @@ class Generic_Plugin {
277
  'admin.php?page=w3tc_dashboard&amp;w3tc_flush_all' ),
278
  'w3tc' )
279
  );
 
 
 
 
 
 
 
 
 
280
 
281
  $menu_items['20010.generic'] = array(
282
  'id' => 'w3tc_flush',
@@ -511,9 +520,9 @@ class Generic_Plugin {
511
 
512
  $buffer = apply_filters( 'w3tc_process_content', $buffer );
513
  }
514
-
515
  $buffer = Util_Bus::do_ob_callbacks(
516
- array( 'minify', 'newrelic', 'cdn', 'browsercache', 'pagecache' ),
517
  $buffer );
518
  }
519
 
261
  'id' => 'w3tc',
262
  'title' =>
263
  '<img src="' .
264
+ plugins_url( 'pub/img/w3tc-sprite-admin-bar.png', W3TC_FILE ) .
265
  '" style="vertical-align:middle; margin-right:5px; width: 29px; height: 29px" />' .
266
  __( 'Performance', 'w3-total-cache' ) .
267
  $menu_postfix,
277
  'admin.php?page=w3tc_dashboard&amp;w3tc_flush_all' ),
278
  'w3tc' )
279
  );
280
+ if ( !is_admin() )
281
+ $menu_items['10020.generic'] = array(
282
+ 'id' => 'w3tc_flush_current_page',
283
+ 'parent' => 'w3tc',
284
+ 'title' => __( 'Purge Current Page', 'w3-total-cache' ),
285
+ 'href' => wp_nonce_url( admin_url(
286
+ 'admin.php?page=w3tc_dashboard&amp;w3tc_flush_current_page' ),
287
+ 'w3tc' )
288
+ );
289
 
290
  $menu_items['20010.generic'] = array(
291
  'id' => 'w3tc_flush',
520
 
521
  $buffer = apply_filters( 'w3tc_process_content', $buffer );
522
  }
523
+
524
  $buffer = Util_Bus::do_ob_callbacks(
525
+ array( 'swarmify', 'minify', 'newrelic', 'cdn', 'browsercache', 'pagecache' ),
526
  $buffer );
527
  }
528
 
Generic_Plugin_Admin.php CHANGED
@@ -295,14 +295,14 @@ class Generic_Plugin_Admin {
295
  ?>
296
  <style type="text/css" media="screen">
297
  #toplevel_page_w3tc_dashboard .wp-menu-image {
298
- background: url(<?php echo plugins_url( 'w3-total-cache/pub/img/w3tc-sprite.png' )?>) no-repeat 0 -32px !important;
299
  }
300
  #toplevel_page_w3tc_dashboard:hover .wp-menu-image,
301
  #toplevel_page_w3tc_dashboard.wp-has-current-submenu .wp-menu-image {
302
  background-position:0 0 !important;
303
  }
304
  #icon-edit.icon32-posts-casestudy {
305
- background: url(<?php echo plugins_url( 'w3-total-cache/pub/img/w3tc-sprite.png' ) ?>) no-repeat;
306
  }
307
  /**
308
  * HiDPI Displays
@@ -313,7 +313,7 @@ class Generic_Plugin_Admin {
313
  (min-resolution: 120dpi) {
314
 
315
  #toplevel_page_w3tc_dashboard .wp-menu-image {
316
- background-image: url(<?php echo plugins_url( 'w3-total-cache/pub/img/w3tc-sprite-retina.png' )?>) !important;
317
  background-size: 30px 64px !important;
318
  }
319
  #toplevel_page_w3tc_dashboard:hover .wp-menu-image,
@@ -321,7 +321,7 @@ class Generic_Plugin_Admin {
321
  background-position:0 0 !important;
322
  }
323
  #icon-edit.icon32-posts-casestudy {
324
- background-image: url(<?php echo plugins_url( 'w3-total-cache/pub/img/w3tc-sprite-retina.png' ) ?>) !important;
325
  background-size: 30px 64px !important;
326
  }
327
  }
295
  ?>
296
  <style type="text/css" media="screen">
297
  #toplevel_page_w3tc_dashboard .wp-menu-image {
298
+ background: url(<?php echo plugins_url( 'pub/img/w3tc-sprite.png', W3TC_FILE )?>) no-repeat 0 -32px !important;
299
  }
300
  #toplevel_page_w3tc_dashboard:hover .wp-menu-image,
301
  #toplevel_page_w3tc_dashboard.wp-has-current-submenu .wp-menu-image {
302
  background-position:0 0 !important;
303
  }
304
  #icon-edit.icon32-posts-casestudy {
305
+ background: url(<?php echo plugins_url( 'pub/img/w3tc-sprite.png', W3TC_FILE ) ?>) no-repeat;
306
  }
307
  /**
308
  * HiDPI Displays
313
  (min-resolution: 120dpi) {
314
 
315
  #toplevel_page_w3tc_dashboard .wp-menu-image {
316
+ background-image: url(<?php echo plugins_url( 'pub/img/w3tc-sprite-retina.png', W3TC_FILE )?>) !important;
317
  background-size: 30px 64px !important;
318
  }
319
  #toplevel_page_w3tc_dashboard:hover .wp-menu-image,
321
  background-position:0 0 !important;
322
  }
323
  #icon-edit.icon32-posts-casestudy {
324
+ background-image: url(<?php echo plugins_url( 'pub/img/w3tc-sprite-retina.png', W3TC_FILE ) ?>) !important;
325
  background-size: 30px 64px !important;
326
  }
327
  }
Generic_Plugin_AdminCompatibility.php CHANGED
File without changes
Generic_Plugin_AdminNotifications.php CHANGED
File without changes
Generic_Plugin_AdminRowActions.php CHANGED
File without changes
Generic_Plugin_WidgetForum.php CHANGED
File without changes
Generic_Plugin_WidgetNews.php CHANGED
File without changes
Generic_WidgetServices.php CHANGED
File without changes
Generic_WidgetServices_View.php CHANGED
File without changes
Generic_WidgetSpreadTheWord.js CHANGED
File without changes
Generic_WidgetSpreadTheWord_Plugin.php CHANGED
File without changes
Generic_WidgetSpreadTheWord_View.php CHANGED
File without changes
Licensing_AdminActions.php CHANGED
File without changes
Licensing_Core.php CHANGED
File without changes
Licensing_Plugin_Admin.php CHANGED
@@ -43,6 +43,17 @@ class Licensing_Plugin_Admin {
43
  'w3tc_message_action=licensing_upgrade' ), 'w3tc' )
44
  );
45
 
 
 
 
 
 
 
 
 
 
 
 
46
  return $menu_items;
47
  }
48
 
43
  'w3tc_message_action=licensing_upgrade' ), 'w3tc' )
44
  );
45
 
46
+ if ( defined( 'W3TC_DEBUG' ) && W3TC_DEBUG ) {
47
+ $menu_items['90040.licensing'] = array(
48
+ 'id' => 'w3tc_overlay_upgrade',
49
+ 'parent' => 'w3tc_debug_overlays',
50
+ 'title' => __( 'Upgrade', 'w3-total-cache' ),
51
+ 'href' => wp_nonce_url( network_admin_url(
52
+ 'admin.php?page=w3tc_dashboard&amp;' .
53
+ 'w3tc_message_action=licensing_upgrade' ), 'w3tc' )
54
+ );
55
+ }
56
+
57
  return $menu_items;
58
  }
59
 
Minify_ConfigLabels.php CHANGED
@@ -51,8 +51,10 @@ class Minify_ConfigLabels {
51
  'minify.csstidy.options.compress_font-weight' => __( 'Compress font-weight', 'w3-total-cache' ),
52
  'minify.csstidy.options.lowercase_s' => __( 'Lowercase selectors', 'w3-total-cache' ),
53
  'minify.csstidy.options.remove_last_;' => __( 'Remove last ;', 'w3-total-cache' ),
 
54
  'minify.csstidy.options.sort_properties' => __( 'Sort Properties', 'w3-total-cache' ),
55
  'minify.csstidy.options.sort_selectors' => __( 'Sort Selectors (caution)', 'w3-total-cache' ),
 
56
  'minify.csstidy.options.discard_invalid_properties' => __( 'Discard invalid properties', 'w3-total-cache' ),
57
  'minify.csstidy.options.preserve_css' => __( 'Preserve CSS', 'w3-total-cache' ),
58
  'minify.csstidy.options.timestamp' => __( 'Add timestamp', 'w3-total-cache' ),
51
  'minify.csstidy.options.compress_font-weight' => __( 'Compress font-weight', 'w3-total-cache' ),
52
  'minify.csstidy.options.lowercase_s' => __( 'Lowercase selectors', 'w3-total-cache' ),
53
  'minify.csstidy.options.remove_last_;' => __( 'Remove last ;', 'w3-total-cache' ),
54
+ 'minify.csstidy.options.remove_space_before_important' => __( 'Remove space before !important', 'w3-total-cache' ),
55
  'minify.csstidy.options.sort_properties' => __( 'Sort Properties', 'w3-total-cache' ),
56
  'minify.csstidy.options.sort_selectors' => __( 'Sort Selectors (caution)', 'w3-total-cache' ),
57
+ 'minify.csstidy.options.discard_invalid_selectors' => __( 'Discard invalid selectors', 'w3-total-cache' ),
58
  'minify.csstidy.options.discard_invalid_properties' => __( 'Discard invalid properties', 'w3-total-cache' ),
59
  'minify.csstidy.options.preserve_css' => __( 'Preserve CSS', 'w3-total-cache' ),
60
  'minify.csstidy.options.timestamp' => __( 'Add timestamp', 'w3-total-cache' ),
Minify_ContentMinifier.php CHANGED
@@ -203,10 +203,12 @@ class Minify_ContentMinifier {
203
  'lowercase_s' => $this->_config->get_boolean( 'minify.csstidy.options.lowercase_s' ),
204
  'optimise_shorthands' => $this->_config->get_integer( 'minify.csstidy.options.optimise_shorthands' ),
205
  'remove_last_;' => $this->_config->get_boolean( 'minify.csstidy.options.remove_last_;' ),
 
206
  'case_properties' => $this->_config->get_integer( 'minify.csstidy.options.case_properties' ),
207
  'sort_properties' => $this->_config->get_boolean( 'minify.csstidy.options.sort_properties' ),
208
  'sort_selectors' => $this->_config->get_boolean( 'minify.csstidy.options.sort_selectors' ),
209
  'merge_selectors' => $this->_config->get_integer( 'minify.csstidy.options.merge_selectors' ),
 
210
  'discard_invalid_properties' => $this->_config->get_boolean( 'minify.csstidy.options.discard_invalid_properties' ),
211
  'css_level' => $this->_config->get_string( 'minify.csstidy.options.css_level' ),
212
  'preserve_css' => $this->_config->get_boolean( 'minify.csstidy.options.preserve_css' ),
203
  'lowercase_s' => $this->_config->get_boolean( 'minify.csstidy.options.lowercase_s' ),
204
  'optimise_shorthands' => $this->_config->get_integer( 'minify.csstidy.options.optimise_shorthands' ),
205
  'remove_last_;' => $this->_config->get_boolean( 'minify.csstidy.options.remove_last_;' ),
206
+ 'space_before_important' => !$this->_config->get_boolean( 'minify.csstidy.options.remove_space_before_important' ),
207
  'case_properties' => $this->_config->get_integer( 'minify.csstidy.options.case_properties' ),
208
  'sort_properties' => $this->_config->get_boolean( 'minify.csstidy.options.sort_properties' ),
209
  'sort_selectors' => $this->_config->get_boolean( 'minify.csstidy.options.sort_selectors' ),
210
  'merge_selectors' => $this->_config->get_integer( 'minify.csstidy.options.merge_selectors' ),
211
+ 'discard_invalid_selectors' => $this->_config->get_boolean( 'minify.csstidy.options.discard_invalid_selectors' ),
212
  'discard_invalid_properties' => $this->_config->get_boolean( 'minify.csstidy.options.discard_invalid_properties' ),
213
  'css_level' => $this->_config->get_string( 'minify.csstidy.options.css_level' ),
214
  'preserve_css' => $this->_config->get_boolean( 'minify.csstidy.options.preserve_css' ),
Minify_Core.php CHANGED
File without changes
Minify_Environment.php CHANGED
@@ -273,10 +273,15 @@ class Minify_Environment {
273
 
274
  if ( $is_ok )
275
  $result = 'ok';
276
- else
277
- $result = is_wp_error( $response ) ?
278
- $response->get_error_message() :
279
- implode( ' ', $response['body'] );
 
 
 
 
 
280
 
281
  set_site_transient( $key, $result, 30 );
282
  }
@@ -385,7 +390,7 @@ class Minify_Environment {
385
  if ( $engine == 'file' ) {
386
  if ( $compression ) {
387
  $rules .= " RewriteCond %{HTTP:Accept-Encoding} gzip\n";
388
- $rules .= " RewriteRule .* - [E=APPEND_EXT:.gzip]\n";
389
  $rules .= " RewriteCond %{REQUEST_FILENAME}%{ENV:APPEND_EXT} -" . ( $config->get_boolean( 'minify.file.nfs' ) ? 'F' : 'f' ) . "\n";
390
  $rules .= " RewriteRule (.*) $1%{ENV:APPEND_EXT} [L]\n";
391
  } else {
@@ -440,7 +445,7 @@ class Minify_Environment {
440
 
441
  if ( $compression ) {
442
  $rules .= "if (\$http_accept_encoding ~ gzip) {\n";
443
- $rules .= " set \$w3tc_enc .gzip;\n";
444
  $rules .= "}\n";
445
  }
446
 
@@ -540,13 +545,10 @@ class Minify_Environment {
540
 
541
  $rules = '';
542
  $rules .= W3TC_MARKER_BEGIN_MINIFY_CACHE . "\n";
543
- /* workaround for .gzip
544
  if ( $compatibility ) {
545
  $rules .= "Options -MultiViews\n";
546
- }*/
547
- $rules .= "<IfModule mod_negotiation.c>\n";
548
- $rules .= " Options -MultiViews\n";
549
- $rules .= "</IfModule>\n";
550
 
551
  if ( $etag ) {
552
  $rules .= "FileETag MTime Size\n";
@@ -554,17 +556,15 @@ class Minify_Environment {
554
 
555
  if ( $compression ) {
556
  $rules .= "<IfModule mod_mime.c>\n";
557
- $rules .= " AddEncoding gzip .gzip\n";
558
- $rules .= " <Files *.css.gzip>\n";
559
- $rules .= " ForceType text/css\n";
560
- $rules .= " </Files>\n";
561
- $rules .= " <Files *.js.gzip>\n";
562
- $rules .= " ForceType application/x-javascript\n";
563
- $rules .= " </Files>\n";
564
  $rules .= "</IfModule>\n";
565
  $rules .= "<IfModule mod_deflate.c>\n";
566
  $rules .= " <IfModule mod_setenvif.c>\n";
567
- $rules .= " SetEnvIfNoCase Request_URI \\.gzip$ no-gzip\n";
 
568
  $rules .= " </IfModule>\n";
569
  $rules .= "</IfModule>\n";
570
  }
@@ -727,7 +727,7 @@ class Minify_Environment {
727
  $rules .= "}\n";
728
 
729
  if ( $compression ) {
730
- $rules .= "location ~ " . $cache_uri . ".*js\\.gzip$ {\n";
731
  $rules .= " gzip off;\n";
732
  $rules .= " types {}\n";
733
  $rules .= " default_type application/x-javascript;\n";
@@ -735,7 +735,7 @@ class Minify_Environment {
735
  $rules .= " add_header Content-Encoding gzip;\n";
736
  $rules .= "}\n";
737
 
738
- $rules .= "location ~ " . $cache_uri . ".*css\\.gzip$ {\n";
739
  $rules .= " gzip off;\n";
740
  $rules .= " types {}\n";
741
  $rules .= " default_type text/css;\n";
273
 
274
  if ( $is_ok )
275
  $result = 'ok';
276
+ else {
277
+ if ( is_wp_error( $response ) )
278
+ $result = $response->get_error_message();
279
+ else {
280
+ $result = '<pre>' .
281
+ print_r( $response['response'], true ) .
282
+ '</pre>';
283
+ }
284
+ }
285
 
286
  set_site_transient( $key, $result, 30 );
287
  }
390
  if ( $engine == 'file' ) {
391
  if ( $compression ) {
392
  $rules .= " RewriteCond %{HTTP:Accept-Encoding} gzip\n";
393
+ $rules .= " RewriteRule .* - [E=APPEND_EXT:_gzip]\n";
394
  $rules .= " RewriteCond %{REQUEST_FILENAME}%{ENV:APPEND_EXT} -" . ( $config->get_boolean( 'minify.file.nfs' ) ? 'F' : 'f' ) . "\n";
395
  $rules .= " RewriteRule (.*) $1%{ENV:APPEND_EXT} [L]\n";
396
  } else {
445
 
446
  if ( $compression ) {
447
  $rules .= "if (\$http_accept_encoding ~ gzip) {\n";
448
+ $rules .= " set \$w3tc_enc _gzip;\n";
449
  $rules .= "}\n";
450
  }
451
 
545
 
546
  $rules = '';
547
  $rules .= W3TC_MARKER_BEGIN_MINIFY_CACHE . "\n";
548
+ // workaround for .gzip
549
  if ( $compatibility ) {
550
  $rules .= "Options -MultiViews\n";
551
+ }
 
 
 
552
 
553
  if ( $etag ) {
554
  $rules .= "FileETag MTime Size\n";
556
 
557
  if ( $compression ) {
558
  $rules .= "<IfModule mod_mime.c>\n";
559
+ $rules .= " AddType text/css .css_gzip\n";
560
+ $rules .= " AddEncoding gzip .css_gzip\n";
561
+ $rules .= " AddType application/x-javascript .js_gzip\n";
562
+ $rules .= " AddEncoding gzip .js_gzip\n";
 
 
 
563
  $rules .= "</IfModule>\n";
564
  $rules .= "<IfModule mod_deflate.c>\n";
565
  $rules .= " <IfModule mod_setenvif.c>\n";
566
+ $rules .= " SetEnvIfNoCase Request_URI \\.css_gzip$ no-gzip\n";
567
+ $rules .= " SetEnvIfNoCase Request_URI \\.js_gzip$ no-gzip\n";
568
  $rules .= " </IfModule>\n";
569
  $rules .= "</IfModule>\n";
570
  }
727
  $rules .= "}\n";
728
 
729
  if ( $compression ) {
730
+ $rules .= "location ~ " . $cache_uri . ".*js_gzip$ {\n";
731
  $rules .= " gzip off;\n";
732
  $rules .= " types {}\n";
733
  $rules .= " default_type application/x-javascript;\n";
735
  $rules .= " add_header Content-Encoding gzip;\n";
736
  $rules .= "}\n";
737
 
738
+ $rules .= "location ~ " . $cache_uri . ".*css_gzip$ {\n";
739
  $rules .= " gzip off;\n";
740
  $rules .= " types {}\n";
741
  $rules .= " default_type text/css;\n";
Minify_Extract.php CHANGED
File without changes
Minify_GeneralPage_View_ShowHelp.js CHANGED
File without changes
Minify_GeneralPage_View_ShowHelpForce.js CHANGED
File without changes
Minify_HelpPopup_View.php CHANGED
File without changes
Minify_MinifiedFileRequestHandler.php CHANGED
@@ -57,7 +57,7 @@ class Minify_MinifiedFileRequestHandler {
57
  if ( ( function_exists( 'gzencode' ) &&
58
  $this->_config->get_boolean( 'browsercache.enabled' ) &&
59
  $this->_config->get_boolean( 'browsercache.cssjs.compression' ) ) )
60
- if ( !$cache->store( basename( $file ) . '.gzip',
61
  array( 'content' => gzencode( 'content ok' ) ) ) ) {
62
  echo 'error storing';
63
  exit();
@@ -712,8 +712,8 @@ class Minify_MinifiedFileRequestHandler {
712
  Util_Environment::cache_blog_minify_dir(),
713
  array(
714
  '.htaccess',
715
- 'index.php',
716
- '*.old'
717
  ),
718
  $this->_config->get_boolean( 'minify.file.locking' ),
719
  $this->_config->get_integer( 'timelimit.cache_flush' ),
@@ -893,10 +893,12 @@ class Minify_MinifiedFileRequestHandler {
893
  'minify.csstidy.options.lowercase_s',
894
  'minify.csstidy.options.optimise_shorthands',
895
  'minify.csstidy.options.remove_last_;',
 
896
  'minify.csstidy.options.case_properties',
897
  'minify.csstidy.options.sort_properties',
898
  'minify.csstidy.options.sort_selectors',
899
  'minify.csstidy.options.merge_selectors',
 
900
  'minify.csstidy.options.discard_invalid_properties',
901
  'minify.csstidy.options.css_level',
902
  'minify.csstidy.options.preserve_css',
57
  if ( ( function_exists( 'gzencode' ) &&
58
  $this->_config->get_boolean( 'browsercache.enabled' ) &&
59
  $this->_config->get_boolean( 'browsercache.cssjs.compression' ) ) )
60
+ if ( !$cache->store( basename( $file ) . '_gzip',
61
  array( 'content' => gzencode( 'content ok' ) ) ) ) {
62
  echo 'error storing';
63
  exit();
712
  Util_Environment::cache_blog_minify_dir(),
713
  array(
714
  '.htaccess',
715
+ 'index.html',
716
+ '*_old'
717
  ),
718
  $this->_config->get_boolean( 'minify.file.locking' ),
719
  $this->_config->get_integer( 'timelimit.cache_flush' ),
893
  'minify.csstidy.options.lowercase_s',
894
  'minify.csstidy.options.optimise_shorthands',
895
  'minify.csstidy.options.remove_last_;',
896
+ 'minify.csstidy.options.remove_space_before_important',
897
  'minify.csstidy.options.case_properties',
898
  'minify.csstidy.options.sort_properties',
899
  'minify.csstidy.options.sort_selectors',
900
  'minify.csstidy.options.merge_selectors',
901
+ 'minify.csstidy.options.discard_invalid_selectors',
902
  'minify.csstidy.options.discard_invalid_properties',
903
  'minify.csstidy.options.css_level',
904
  'minify.csstidy.options.preserve_css',
Minify_Page.php CHANGED
File without changes
Minify_Plugin.php CHANGED
@@ -773,12 +773,26 @@ class Minify_Plugin {
773
  );
774
 
775
  if ( !empty( $groups[$theme][$template][$location]['files'] ) ) {
776
- $return['url'] = $this->format_url_group( $theme, $template, $location, $type );
 
 
 
 
 
 
 
 
 
 
 
 
 
777
 
778
- if ( $return['url'] ) {
779
- $import = ( isset( $groups[$theme][$template][$location]['import'] ) ? (boolean) $groups[$theme][$template][$location]['import'] : false );
780
 
781
- $return['body'] = $this->get_style( $return['url'], $import );
 
782
  }
783
  }
784
 
@@ -809,7 +823,7 @@ class Minify_Plugin {
809
  );
810
 
811
  if ( !empty( $groups[$theme][$template][$location]['files'] ) ) {
812
- $return['url'] = $this->format_url_group( $theme, $template, $location, $fileType );
813
 
814
  if ( $return['url'] ) {
815
  $return['body'] = $this->minify_helpers->generate_script_tag(
@@ -850,27 +864,24 @@ class Minify_Plugin {
850
  }
851
 
852
  /**
853
- * Formats URL
854
- *
855
- * @param string $theme
856
- * @param string $template
857
- * @param string $location
858
- * @param string $type
859
- * @return string
860
  */
861
- function format_url_group( $theme, $template, $location, $type ) {
862
- $w3_minify = Dispatcher::component( 'Minify_MinifiedFileRequestHandler' );
863
-
864
- $url = false;
865
- $id = $w3_minify->get_id_group( $theme, $template, $location, $type );
866
 
867
- if ( $id ) {
868
- $minify_filename = $theme . '.' . $template . '.' . $location .
869
- '.'. $id . '.' . $type;
870
- $url = Minify_Core::minified_url( $minify_filename );
871
- }
872
 
873
- return $url;
 
 
 
 
 
874
  }
875
 
876
  /**
@@ -888,7 +899,7 @@ class Minify_Plugin {
888
  foreach ( $js_templates as $js_template => $js_locations ) {
889
  foreach ( (array) $js_locations as $js_location => $js_config ) {
890
  if ( !empty( $js_config['files'] ) ) {
891
- $files[] = $this->format_url_group( $js_theme, $js_template, $js_location, 'js' );
892
  }
893
  }
894
  }
@@ -898,7 +909,7 @@ class Minify_Plugin {
898
  foreach ( $css_templates as $css_template => $css_locations ) {
899
  foreach ( (array) $css_locations as $css_location => $css_config ) {
900
  if ( !empty( $css_config['files'] ) ) {
901
- $files[] = $this->format_url_group( $css_theme, $css_template, $css_location, 'css' );
902
  }
903
  }
904
  }
@@ -1277,7 +1288,7 @@ class _W3_MinifyHelpers {
1277
  if ( Util_Environment::is_url( $file_normalized ) ) {
1278
  if ( $this->debug ) {
1279
  Minify_Core::log(
1280
- 'is_file_for_minification: its url ' . $file );
1281
  }
1282
 
1283
  return '';
773
  );
774
 
775
  if ( !empty( $groups[$theme][$template][$location]['files'] ) ) {
776
+ if ( $this->_config->get_boolean( 'minify.css.embed' ) ) {
777
+ $minify = Dispatcher::component( 'Minify_MinifiedFileRequestHandler' );
778
+ $minify_filename = $this->get_minify_manual_filename(
779
+ $theme, $template, $location, $type );
780
+
781
+ $m = $minify->process( $minify_filename, true );
782
+ if ( isset( $m['content'] ) )
783
+ $style = $m['content'];
784
+ else
785
+ $style = 'not set';
786
+
787
+ $return['body'] = "<style type=\"text/css\" media=\"all\">$style</style>\r\n";
788
+ } else {
789
+ $return['url'] = $this->get_minify_manual_url( $theme, $template, $location, $type );
790
 
791
+ if ( $return['url'] ) {
792
+ $import = ( isset( $groups[$theme][$template][$location]['import'] ) ? (boolean) $groups[$theme][$template][$location]['import'] : false );
793
 
794
+ $return['body'] = $this->get_style( $return['url'], $import );
795
+ }
796
  }
797
  }
798
 
823
  );
824
 
825
  if ( !empty( $groups[$theme][$template][$location]['files'] ) ) {
826
+ $return['url'] = $this->get_minify_manual_url( $theme, $template, $location, $fileType );
827
 
828
  if ( $return['url'] ) {
829
  $return['body'] = $this->minify_helpers->generate_script_tag(
864
  }
865
 
866
  /**
867
+ * Generates filename for minify manual resource
 
 
 
 
 
 
868
  */
869
+ function get_minify_manual_filename( $theme, $template, $location, $type ) {
870
+ $minify = Dispatcher::component( 'Minify_MinifiedFileRequestHandler' );
871
+ $id = $minify->get_id_group( $theme, $template, $location, $type );
872
+ if ( !$id )
873
+ return false;
874
 
875
+ return $theme . '.' . $template . '.' . $location . '.'. $id .
876
+ '.' . $type;
877
+ }
 
 
878
 
879
+ /**
880
+ * Generates URL for minify manual resource
881
+ */
882
+ function get_minify_manual_url( $theme, $template, $location, $type ) {
883
+ return Minify_Core::minified_url( $this->get_minify_manual_filename(
884
+ $theme, $template, $location, $type ) );
885
  }
886
 
887
  /**
899
  foreach ( $js_templates as $js_template => $js_locations ) {
900
  foreach ( (array) $js_locations as $js_location => $js_config ) {
901
  if ( !empty( $js_config['files'] ) ) {
902
+ $files[] = $this->get_minify_manual_url( $js_theme, $js_template, $js_location, 'js' );
903
  }
904
  }
905
  }
909
  foreach ( $css_templates as $css_template => $css_locations ) {
910
  foreach ( (array) $css_locations as $css_location => $css_config ) {
911
  if ( !empty( $css_config['files'] ) ) {
912
+ $files[] = $this->get_minify_manual_url( $css_theme, $css_template, $css_location, 'css' );
913
  }
914
  }
915
  }
1288
  if ( Util_Environment::is_url( $file_normalized ) ) {
1289
  if ( $this->debug ) {
1290
  Minify_Core::log(
1291
+ 'is_file_for_minification: its url ' . $file . ' for url ' . $url );
1292
  }
1293
 
1294
  return '';
Minify_Plugin_Admin.php CHANGED
@@ -111,7 +111,7 @@ class Minify_Plugin_Admin {
111
  'exclude' => array(
112
  '*.files',
113
  '.htaccess',
114
- 'index.php'
115
  ),
116
  'cache_dir' => Util_Environment::cache_blog_dir( 'minify' ),
117
  'expire' => $this->_config->get_integer( 'minify.file.gc' ),
111
  'exclude' => array(
112
  '*.files',
113
  '.htaccess',
114
+ 'index.html'
115
  ),
116
  'cache_dir' => Util_Environment::cache_blog_dir( 'minify' ),
117
  'expire' => $this->_config->get_integer( 'minify.file.gc' ),
Mobile_Base.php CHANGED
File without changes
Mobile_Page_ReferrerGroups.php CHANGED
File without changes
Mobile_Page_UserAgentGroups.php CHANGED
File without changes
Mobile_Redirect.php CHANGED
File without changes
Mobile_Referrer.php CHANGED
File without changes
Mobile_UserAgent.php CHANGED
File without changes
ModuleStatus.php CHANGED
File without changes
ObjectCache_ConfigLabels.php CHANGED
File without changes
ObjectCache_Environment.php CHANGED
File without changes
ObjectCache_Page.php CHANGED
File without changes
ObjectCache_Plugin.php CHANGED
File without changes
ObjectCache_Plugin_Admin.php CHANGED
File without changes
ObjectCache_WpObjectCache.php CHANGED
File without changes
ObjectCache_WpObjectCache_Regular.php CHANGED
File without changes
PageSpeed_Api.php CHANGED
File without changes
PageSpeed_Plugin_Widget.php CHANGED
@@ -28,9 +28,10 @@ class PageSpeed_Plugin_Widget {
28
 
29
 
30
  public function admin_init_w3tc_dashboard() {
31
- add_action( 'w3tc_widget_setup', array( $this, 'wp_dashboard_setup' ) );
 
32
  add_action( 'w3tc_network_dashboard_setup',
33
- array( $this, 'wp_dashboard_setup' ) );
34
 
35
  wp_enqueue_script( 'w3tc-widget-pagespeed',
36
  plugins_url( 'PageSpeed_Widget_View.js', W3TC_FILE ),
28
 
29
 
30
  public function admin_init_w3tc_dashboard() {
31
+ add_action( 'w3tc_widget_setup',
32
+ array( $this, 'wp_dashboard_setup' ), 500 );
33
  add_action( 'w3tc_network_dashboard_setup',
34
+ array( $this, 'wp_dashboard_setup' ), 500 );
35
 
36
  wp_enqueue_script( 'w3tc-widget-pagespeed',
37
  plugins_url( 'PageSpeed_Widget_View.js', W3TC_FILE ),
PageSpeed_Widget_View.css CHANGED
File without changes
PageSpeed_Widget_View.js CHANGED
File without changes
PageSpeed_Widget_View.php CHANGED
File without changes
PageSpeed_Widget_View_NotConfigured.php CHANGED
File without changes
PgCache_ConfigLabels.php CHANGED
File without changes
PgCache_ContentGrabber.php CHANGED
@@ -279,7 +279,9 @@ class PgCache_ContentGrabber {
279
  if ( $with_filter ) {
280
  // return empty value if caching should not happen
281
  $this->_page_key = apply_filters( 'w3tc_page_extract_key',
282
- $this->_page_key );
 
 
283
  }
284
 
285
  if ( !empty( $this->_page_key ) )
@@ -1241,7 +1243,7 @@ class PgCache_ContentGrabber {
1241
  // headers are sent as name->value and array(n=>, v=>)
1242
  // to support repeating headers
1243
  foreach ( $headers as $name0 => $value0 ) {
1244
- if ( isset( $value0['n'] ) ) {
1245
  $name = $value0['n'];
1246
  $value = $value0['v'];
1247
  } else {
279
  if ( $with_filter ) {
280
  // return empty value if caching should not happen
281
  $this->_page_key = apply_filters( 'w3tc_page_extract_key',
282
+ $this->_page_key, $mobile_group, $referrer_group,
283
+ $encryption, $compression, $content_type,
284
+ $this->_request_host . $this->_request_uri );
285
  }
286
 
287
  if ( !empty( $this->_page_key ) )
1243
  // headers are sent as name->value and array(n=>, v=>)
1244
  // to support repeating headers
1245
  foreach ( $headers as $name0 => $value0 ) {
1246
+ if ( is_array( $value0 ) && isset( $value0['n'] ) ) {
1247
  $name = $value0['n'];
1248
  $value = $value0['v'];
1249
  } else {
PgCache_Environment.php CHANGED
@@ -323,6 +323,10 @@ class PgCache_Environment {
323
  $this->wp_config_addon() );
324
  }
325
  }
 
 
 
 
326
  }
327
 
328
  /**
323
  $this->wp_config_addon() );
324
  }
325
  }
326
+ // that file was in opcache for sure and it may take time to
327
+ // start execution of new modified now version
328
+ $o = Dispatcher::component( 'SystemOpCache_Core' );
329
+ $o->flush();
330
  }
331
 
332
  /**
PgCache_Flush.php CHANGED
@@ -172,6 +172,11 @@ class PgCache_Flush extends PgCache_ContentGrabber {
172
  Util_PageUrls::get_pages_urls( $pages ) );
173
  }
174
 
 
 
 
 
 
175
  /**
176
  * Queue flush
177
  */
@@ -180,10 +185,6 @@ class PgCache_Flush extends PgCache_ContentGrabber {
180
  $this->queued_urls[$url] = '*';
181
  }
182
 
183
- // add mirror urls
184
- $this->queued_urls = Util_PageUrls::complement_with_mirror_urls(
185
- $this->queued_urls );
186
-
187
  return true;
188
  }
189
 
172
  Util_PageUrls::get_pages_urls( $pages ) );
173
  }
174
 
175
+ // add mirror urls
176
+ $full_urls = Util_PageUrls::complement_with_mirror_urls( $full_urls );
177
+ $full_urls = apply_filters( 'pgcache_flush_post_queued_urls',
178
+ $full_urls );
179
+
180
  /**
181
  * Queue flush
182
  */
185
  $this->queued_urls[$url] = '*';
186
  }
187
 
 
 
 
 
188
  return true;
189
  }
190
 
PgCache_Page.php CHANGED
File without changes
PgCache_Plugin.php CHANGED
File without changes
PgCache_Plugin_Admin.php CHANGED
File without changes
Root_AdminActions.php CHANGED
File without changes
Root_AdminActivation.php CHANGED
@@ -73,8 +73,7 @@ class Root_AdminActivation {
73
 
74
  try {
75
  $e = Dispatcher::component( 'Root_Environment' );
76
- $config = Dispatcher::config();
77
- $e->fix_after_deactivation( $config );
78
 
79
  Generic_AdminLinks::link_delete();
80
  } catch ( Util_Environment_Exceptions $exs ) {
73
 
74
  try {
75
  $e = Dispatcher::component( 'Root_Environment' );
76
+ $e->fix_after_deactivation();
 
77
 
78
  Generic_AdminLinks::link_delete();
79
  } catch ( Util_Environment_Exceptions $exs ) {
Root_AdminMenu.php CHANGED
File without changes
Root_Environment.php CHANGED
@@ -23,7 +23,7 @@ class Root_Environment {
23
  }
24
  }
25
  // call plugin-related handlers
26
- foreach ( $this->get_handlers( $config ) as $h ) {
27
  try {
28
  $h->fix_on_wpadmin_request( $config, $force_all_checks );
29
  if ( $fix_on_event ) {
@@ -54,7 +54,7 @@ class Root_Environment {
54
  $exs = new Util_Environment_Exceptions();
55
 
56
  // call plugin-related handlers
57
- foreach ( $this->get_handlers( $config ) as $h ) {
58
  try {
59
  $h->fix_on_event( $config, $event );
60
  } catch ( Util_Environment_Exceptions $ex ) {
@@ -79,11 +79,11 @@ class Root_Environment {
79
  * @param Config $config
80
  * @throws Util_Environment_Exceptions
81
  */
82
- public function fix_after_deactivation( $config ) {
83
  $exs = new Util_Environment_Exceptions();
84
 
85
  // call plugin-related handlers
86
- foreach ( $this->get_handlers( $config ) as $h ) {
87
  try {
88
  $h->fix_after_deactivation();
89
  } catch ( Util_Environment_Exceptions $ex ) {
@@ -92,8 +92,7 @@ class Root_Environment {
92
  }
93
 
94
  try {
95
- do_action( 'w3tc_environment_fix_after_deactivation',
96
- $config );
97
  } catch ( Util_Environment_Exceptions $ex ) {
98
  $exs->push( $ex );
99
  }
@@ -110,7 +109,7 @@ class Root_Environment {
110
  */
111
  public function get_required_rules( $config ) {
112
  $required_rules = array();
113
- foreach ( $this->get_handlers( $config ) as $h ) {
114
  $required_rules_current = $h->get_required_rules( $config );
115
 
116
  if ( !is_null( $required_rules_current ) )
@@ -165,7 +164,7 @@ class Root_Environment {
165
  * @param Config $config
166
  * @return array
167
  */
168
- private function get_handlers( $config ) {
169
  $a = array(
170
  new Generic_Environment(),
171
  new Minify_Environment(),
@@ -182,7 +181,7 @@ class Root_Environment {
182
  public function get_other_instructions( $config ) {
183
  $instructions_descriptors = array();
184
 
185
- foreach ( $this->get_handlers( $config ) as $h ) {
186
  if ( method_exists( $h, 'get_instructions' ) ) {
187
  $instructions = $h->get_instructions( $config );
188
  if ( !is_null( $instructions ) ) {
23
  }
24
  }
25
  // call plugin-related handlers
26
+ foreach ( $this->get_handlers() as $h ) {
27
  try {
28
  $h->fix_on_wpadmin_request( $config, $force_all_checks );
29
  if ( $fix_on_event ) {
54
  $exs = new Util_Environment_Exceptions();
55
 
56
  // call plugin-related handlers
57
+ foreach ( $this->get_handlers() as $h ) {
58
  try {
59
  $h->fix_on_event( $config, $event );
60
  } catch ( Util_Environment_Exceptions $ex ) {
79
  * @param Config $config
80
  * @throws Util_Environment_Exceptions
81
  */
82
+ public function fix_after_deactivation() {
83
  $exs = new Util_Environment_Exceptions();
84
 
85
  // call plugin-related handlers
86
+ foreach ( $this->get_handlers() as $h ) {
87
  try {
88
  $h->fix_after_deactivation();
89
  } catch ( Util_Environment_Exceptions $ex ) {
92
  }
93
 
94
  try {
95
+ do_action( 'w3tc_environment_fix_after_deactivation' );
 
96
  } catch ( Util_Environment_Exceptions $ex ) {
97
  $exs->push( $ex );
98
  }
109
  */
110
  public function get_required_rules( $config ) {
111
  $required_rules = array();
112
+ foreach ( $this->get_handlers() as $h ) {
113
  $required_rules_current = $h->get_required_rules( $config );
114
 
115
  if ( !is_null( $required_rules_current ) )
164
  * @param Config $config
165
  * @return array
166
  */
167
+ private function get_handlers() {
168
  $a = array(
169
  new Generic_Environment(),
170
  new Minify_Environment(),
181
  public function get_other_instructions( $config ) {
182
  $instructions_descriptors = array();
183
 
184
+ foreach ( $this->get_handlers() as $h ) {
185
  if ( method_exists( $h, 'get_instructions' ) ) {
186
  $instructions = $h->get_instructions( $config );
187
  if ( !is_null( $instructions ) ) {
Root_Loader.php CHANGED
File without changes
Support_AdminActions.php CHANGED
File without changes
Support_Page.php CHANGED
File without changes
Support_Page_View_DoneContent.php CHANGED
File without changes
Support_Page_View_PageContent.php CHANGED
File without changes
SystemOpCache_AdminActions.php CHANGED
File without changes
SystemOpCache_Core.php CHANGED
File without changes
SystemOpCache_GeneralPage_View.php CHANGED
File without changes
SystemOpCache_Plugin_Admin.php CHANGED
File without changes
UsageStatistics_Core.php CHANGED
File without changes
UsageStatistics_Plugin.php CHANGED
File without changes
UsageStatistics_Plugin_Admin.php CHANGED
File without changes
UsageStatistics_StorageReader.php CHANGED
File without changes
UsageStatistics_StorageWriter.php CHANGED
File without changes
UsageStatistics_View_General.php CHANGED
File without changes
UsageStatistics_Widget.php CHANGED
@@ -9,7 +9,7 @@ class UsageStatistics_Widget {
9
 
10
  public function init() {
11
  $c = Dispatcher::config();
12
- $this->enabled = ( $c->get_boolean( 'stats.enabled' ) &&
13
  Util_Environment::is_w3tc_pro( $c ) );
14
 
15
  add_action( 'admin_print_styles-toplevel_page_w3tc_dashboard',
@@ -22,7 +22,7 @@ class UsageStatistics_Widget {
22
  add_action( 'w3tc_widget_setup', array(
23
  $this,
24
  'w3tc_widget_setup'
25
- ) );
26
  add_action( 'w3tc_ajax_ustats_get', array( $this, 'w3tc_ajax_ustats_get' ) );
27
  }
28
 
@@ -33,7 +33,7 @@ class UsageStatistics_Widget {
33
  '<div class="w3tc-widget-w3tc-logo"></div>' .
34
  '<div class="w3tc-widget-text">' .
35
  __( 'Caching Statistics', 'w3-total-cache' ) .
36
- '</div>',
37
  array( $this, 'widget_form' ),
38
  Util_Ui::admin_url( 'admin.php?page=w3tc_general#miscellaneous' ),
39
  'normal' );
9
 
10
  public function init() {
11
  $c = Dispatcher::config();
12
+ $this->enabled = ( $c->get_boolean( 'stats.enabled' ) &&
13
  Util_Environment::is_w3tc_pro( $c ) );
14
 
15
  add_action( 'admin_print_styles-toplevel_page_w3tc_dashboard',
22
  add_action( 'w3tc_widget_setup', array(
23
  $this,
24
  'w3tc_widget_setup'
25
+ ), 300 );
26
  add_action( 'w3tc_ajax_ustats_get', array( $this, 'w3tc_ajax_ustats_get' ) );
27
  }
28
 
33
  '<div class="w3tc-widget-w3tc-logo"></div>' .
34
  '<div class="w3tc-widget-text">' .
35
  __( 'Caching Statistics', 'w3-total-cache' ) .
36
+ '</div>',
37
  array( $this, 'widget_form' ),
38
  Util_Ui::admin_url( 'admin.php?page=w3tc_general#miscellaneous' ),
39
  'normal' );
UsageStatistics_Widget_View.css CHANGED
File without changes
UsageStatistics_Widget_View.js CHANGED
File without changes
UsageStatistics_Widget_View.php CHANGED
File without changes
UsageStatistics_Widget_View_Disabled.php CHANGED
File without changes
Util_Activation.php CHANGED
File without changes
Util_Admin.php CHANGED
@@ -396,10 +396,12 @@ class Util_Admin {
396
  'minify.csstidy.options.lowercase_s',
397
  'minify.csstidy.options.optimise_shorthands',
398
  'minify.csstidy.options.remove_last_;',
 
399
  'minify.csstidy.options.case_properties',
400
  'minify.csstidy.options.sort_properties',
401
  'minify.csstidy.options.sort_selectors',
402
  'minify.csstidy.options.merge_selectors',
 
403
  'minify.csstidy.options.discard_invalid_properties',
404
  'minify.csstidy.options.css_level',
405
  'minify.csstidy.options.preserve_css',
396
  'minify.csstidy.options.lowercase_s',
397
  'minify.csstidy.options.optimise_shorthands',
398
  'minify.csstidy.options.remove_last_;',
399
+ 'minify.csstidy.options.remove_space_before_important',
400
  'minify.csstidy.options.case_properties',
401
  'minify.csstidy.options.sort_properties',
402
  'minify.csstidy.options.sort_selectors',
403
  'minify.csstidy.options.merge_selectors',
404
+ 'minify.csstidy.options.discard_invalid_selectors',
405
  'minify.csstidy.options.discard_invalid_properties',
406
  'minify.csstidy.options.css_level',
407
  'minify.csstidy.options.preserve_css',
Util_AttachToActions.php CHANGED
File without changes
Util_Bus.php CHANGED
File without changes
Util_ConfigLabel.php CHANGED
File without changes
Util_Content.php CHANGED
File without changes
Util_Debug.php CHANGED
File without changes
Util_Environment.php CHANGED
@@ -273,6 +273,15 @@ class Util_Environment {
273
  return isset( $_SERVER['SERVER_SOFTWARE'] ) && stristr( $_SERVER['SERVER_SOFTWARE'], 'nginx' ) !== false;
274
  }
275
 
 
 
 
 
 
 
 
 
 
276
  /**
277
  * Returns domain from host
278
  *
@@ -920,6 +929,14 @@ class Util_Environment {
920
  static public function url_relative_to_full( $relative_url ) {
921
  $relative_url = Util_Environment::path_remove_dots( $relative_url );
922
 
 
 
 
 
 
 
 
 
923
  $rel = parse_url( $relative_url );
924
  // it's full url already
925
  if ( isset( $rel['scheme'] ) || isset( $rel['host'] ) )
273
  return isset( $_SERVER['SERVER_SOFTWARE'] ) && stristr( $_SERVER['SERVER_SOFTWARE'], 'nginx' ) !== false;
274
  }
275
 
276
+ /**
277
+ * Returns true if server is nginx
278
+ *
279
+ * @return boolean
280
+ */
281
+ static public function is_iis() {
282
+ return isset( $_SERVER['SERVER_SOFTWARE'] ) && stristr( $_SERVER['SERVER_SOFTWARE'], 'IIS' ) !== false;
283
+ }
284
+
285
  /**
286
  * Returns domain from host
287
  *
929
  static public function url_relative_to_full( $relative_url ) {
930
  $relative_url = Util_Environment::path_remove_dots( $relative_url );
931
 
932
+ if (version_compare(PHP_VERSION, '5.4.7') < 0) {
933
+ if ( substr( $relative_url, 0, 2) == '//' ) {
934
+ $relative_url =
935
+ ( Util_Environment::is_https() ? 'https' : 'http' ) .
936
+ ':' . $relative_url;
937
+ }
938
+ }
939
+
940
  $rel = parse_url( $relative_url );
941
  // it's full url already
942
  if ( isset( $rel['scheme'] ) || isset( $rel['host'] ) )
Util_Environment_Exception.php CHANGED
File without changes
Util_Environment_Exceptions.php CHANGED
File without changes
Util_File.php CHANGED
File without changes
Util_Http.php CHANGED
File without changes
Util_Installed.php CHANGED
File without changes
Util_Mime.php CHANGED
File without changes
Util_PageUrls.php CHANGED
@@ -740,21 +740,21 @@ class Util_PageUrls {
740
  $home_urls = $config->get_array( 'pgcache.mirrors.home_urls' );
741
 
742
  $url_prefix = trailingslashit( get_home_url() );
743
- $urls = array_keys( $queued_urls );
744
 
745
- foreach ( $urls as $url ) {
746
  if ( substr( $url, 0, strlen( $url_prefix ) ) != $url_prefix )
747
  continue;
748
 
749
  foreach ( $home_urls as $home ) {
750
  if ( !empty( $home ) ) {
751
- $mirror_url = $home . substr( $url, strlen( $url_prefix ) );
752
- $queued_urls[$mirror_url] = '*';
753
  }
754
  }
755
  }
756
 
757
- return $queued_urls;
758
  }
759
 
760
  static private function _term_hash( $terms ) {
740
  $home_urls = $config->get_array( 'pgcache.mirrors.home_urls' );
741
 
742
  $url_prefix = trailingslashit( get_home_url() );
743
+ $mirror_urls = array();
744
 
745
+ foreach ( $queued_urls as $url ) {
746
  if ( substr( $url, 0, strlen( $url_prefix ) ) != $url_prefix )
747
  continue;
748
 
749
  foreach ( $home_urls as $home ) {
750
  if ( !empty( $home ) ) {
751
+ $mirror_urls[] = trailingslashit( $home ) .
752
+ substr( $url, strlen( $url_prefix ) );
753
  }
754
  }
755
  }
756
 
757
+ return array_merge( $queued_urls, $mirror_urls );
758
  }
759
 
760
  static private function _term_hash( $terms ) {
Util_Request.php CHANGED
File without changes
Util_Rule.php CHANGED
@@ -385,7 +385,10 @@ class Util_Rule {
385
  * @return bool
386
  */
387
  static public function can_check_rules() {
388
- return Util_Environment::is_apache() || Util_Environment::is_litespeed() || Util_Environment::is_nginx();
 
 
 
389
  }
390
 
391
  /**
385
  * @return bool
386
  */
387
  static public function can_check_rules() {
388
+ return Util_Environment::is_apache() ||
389
+ Util_Environment::is_litespeed() ||
390
+ Util_Environment::is_nginx() ||
391
+ Util_Environment::is_iis();
392
  }
393
 
394
  /**
Util_RuleSnippet.php CHANGED
File without changes
Util_Theme.php CHANGED
File without changes
Util_Ui.php CHANGED
@@ -594,6 +594,7 @@ class Util_Ui {
594
  * selectbox_optgroups =>
595
  * textbox_size =>
596
  *
 
597
  * description => description shown to the user below
598
  */
599
  static public function config_item( $a ) {
@@ -667,6 +668,9 @@ class Util_Ui {
667
  );
668
  }
669
 
 
 
 
670
  if ( isset( $a['description'] ) )
671
  $table_tr['description'] = $a['description'];
672
 
594
  * selectbox_optgroups =>
595
  * textbox_size =>
596
  *
597
+ * control_after => something after control to add
598
  * description => description shown to the user below
599
  */
600
  static public function config_item( $a ) {
668
  );
669
  }
670
 
671
+ if ( isset( $a['control_after'] ) )
672
+ $table_tr['html'] = $a['control_after'];
673
+
674
  if ( isset( $a['description'] ) )
675
  $table_tr['description'] = $a['description'];
676
 
Util_UsageStatistics.php CHANGED
File without changes
Util_Widget.php CHANGED
File without changes
Util_WpFile.php CHANGED
File without changes
Util_WpFile_FilesystemChmodException.php CHANGED
File without changes
Util_WpFile_FilesystemCopyException.php CHANGED
File without changes
Util_WpFile_FilesystemMkdirException.php CHANGED
File without changes
Util_WpFile_FilesystemModifyException.php CHANGED
File without changes
Util_WpFile_FilesystemOperationException.php CHANGED
File without changes
Util_WpFile_FilesystemRmException.php CHANGED
File without changes
Util_WpFile_FilesystemRmdirException.php CHANGED
File without changes
Util_WpFile_FilesystemWriteException.php CHANGED
File without changes
Util_WpmuBlogmap.php CHANGED
File without changes
Varnish_Flush.php CHANGED
@@ -191,13 +191,11 @@ class Varnish_Flush {
191
 
192
  private function do_flush() {
193
  if ( !is_network_admin() ) {
194
- $queued_urls[ get_home_url() . '/.*' ] = '*';
 
 
195
 
196
- // add mirror urls
197
- $queued_urls = Util_PageUrls::complement_with_mirror_urls(
198
- $queued_urls );
199
-
200
- foreach ( $queued_urls as $url => $nothing )
201
  $this->_purge( $url );
202
  } else {
203
  // todo: remove. doesnt work for all caches.
@@ -380,16 +378,19 @@ class Varnish_Flush {
380
  $full_urls[] = Util_Environment::home_domain_root_url() . '/' . trim( $sitemap_regex, "^$" );
381
  }
382
 
 
 
 
 
 
 
 
383
  /**
384
  * Queue flush
385
  */
386
  if ( count( $full_urls ) ) {
387
  foreach ( $full_urls as $url )
388
  $this->queued_urls[$url] = '*';
389
-
390
- // add mirror urls
391
- $this->queued_urls = Util_PageUrls::complement_with_mirror_urls(
392
- $this->queued_urls );
393
  }
394
 
395
  return true;
191
 
192
  private function do_flush() {
193
  if ( !is_network_admin() ) {
194
+ $full_urls = array( get_home_url() . '/.*' );
195
+ $full_urls = Util_PageUrls::complement_with_mirror_urls(
196
+ $full_urls );
197
 
198
+ foreach ( $full_urls as $url )
 
 
 
 
199
  $this->_purge( $url );
200
  } else {
201
  // todo: remove. doesnt work for all caches.
378
  $full_urls[] = Util_Environment::home_domain_root_url() . '/' . trim( $sitemap_regex, "^$" );
379
  }
380
 
381
+ // add mirror urls
382
+ $full_urls = Util_PageUrls::complement_with_mirror_urls(
383
+ $full_urls );
384
+
385
+ $full_urls = apply_filters( 'varnish_flush_post_queued_urls',
386
+ $full_urls );
387
+
388
  /**
389
  * Queue flush
390
  */
391
  if ( count( $full_urls ) ) {
392
  foreach ( $full_urls as $url )
393
  $this->queued_urls[$url] = '*';
 
 
 
 
394
  }
395
 
396
  return true;
Varnish_Plugin.php CHANGED
File without changes
changelog.txt CHANGED
File without changes
extension-example/Extension_Example.php CHANGED
File without changes
extension-example/Extension_Example_Admin.php CHANGED
File without changes
extension-example/Extension_Example_Page_View.php CHANGED
File without changes
extension-example/w3-total-cache-example.php CHANGED
File without changes
inc/define.php CHANGED
File without changes
inc/email/index.html CHANGED
File without changes
inc/email/minify_error_notification.html CHANGED
File without changes
inc/email/minify_error_notification.php CHANGED
File without changes
inc/email/support_request.php CHANGED
File without changes
inc/error.php CHANGED
File without changes
inc/index.html CHANGED
File without changes
inc/lightbox/cdn_s3_bucket_location.php CHANGED
File without changes
inc/lightbox/create_netdna_maxcdn_pull_zone.php CHANGED
File without changes
inc/lightbox/edge.php CHANGED
File without changes
inc/lightbox/index.html CHANGED
File without changes
inc/lightbox/minify_recommendations.php CHANGED
File without changes
inc/lightbox/purchase.php CHANGED
File without changes
inc/lightbox/self_test.php CHANGED
@@ -139,7 +139,7 @@ if ( !defined( 'W3TC' ) )
139
  <?php else: ?>
140
  <code><?php _e( 'Not installed', 'w3-total-cache' ); ?></code>
141
  <?php endif; ?>
142
- <span class="w3tc-self-test-hint"><?php _e( '(required for HTML Tidy minifier suppport)', 'w3-total-cache' ); ?></span>
143
  </li>
144
 
145
  <li>
139
  <?php else: ?>
140
  <code><?php _e( 'Not installed', 'w3-total-cache' ); ?></code>
141
  <?php endif; ?>
142
+ <span class="w3tc-self-test-hint"><?php _e( '(required for HTML Tidy minifier support)', 'w3-total-cache' ); ?></span>
143
  </li>
144
 
145
  <li>
inc/lightbox/support_us.php CHANGED
File without changes
inc/lightbox/upgrade.php CHANGED
File without changes
inc/mime/all.php CHANGED
File without changes
inc/mime/cssjs.php CHANGED
File without changes
inc/mime/html.php CHANGED
File without changes
inc/mime/index.html CHANGED
File without changes
inc/mime/other.php CHANGED
File without changes
inc/options/about.php CHANGED
File without changes
inc/options/browsercache.php CHANGED
@@ -84,6 +84,14 @@ if ( !defined( 'W3TC' ) )
84
  <br /><span class="description"><?php _e( 'Whenever settings are changed, a new query string will be generated and appended to objects allowing the new policy to be applied.', 'w3-total-cache' ); ?></span>
85
  </th>
86
  </tr>
 
 
 
 
 
 
 
 
87
  <tr>
88
  <th><label for="browsercache_replace_exceptions"><?php Util_Ui::e_config_label( 'browsercache.replace.exceptions' ) ?></label></th>
89
  <td>
@@ -216,6 +224,12 @@ Util_Ui::config_item( array(
216
  <br /><span class="description"><?php _e( 'Whenever settings are changed, a new query string will be generated and appended to objects allowing the new policy to be applied.', 'w3-total-cache' ); ?></span>
217
  </th>
218
  </tr>
 
 
 
 
 
 
219
  <tr>
220
  <th colspan="2">
221
  <?php $this->checkbox( 'browsercache.cssjs.nocookies' ) ?> <?php Util_Ui::e_config_label( 'browsercache.cssjs.nocookies' ) ?></label>
@@ -376,6 +390,12 @@ Util_Ui::config_item( array(
376
  <br /><span class="description"><?php _e( 'Whenever settings are changed, a new query string will be generated and appended to objects allowing the new policy to be applied.', 'w3-total-cache' ); ?></span>
377
  </th>
378
  </tr>
 
 
 
 
 
 
379
  <tr>
380
  <th colspan="2">
381
  <?php $this->checkbox( 'browsercache.other.nocookies' ) ?> <?php Util_Ui::e_config_label( 'browsercache.other.nocookies' ) ?></label>
84
  <br /><span class="description"><?php _e( 'Whenever settings are changed, a new query string will be generated and appended to objects allowing the new policy to be applied.', 'w3-total-cache' ); ?></span>
85
  </th>
86
  </tr>
87
+ <tr>
88
+ <th colspan="2">
89
+ <label><input id="browsercache_querystring" type="checkbox"
90
+ <?php Util_Ui::sealing_disabled( 'browsercache.' ) ?>
91
+ name="querystring" value="1"<?php checked( $browsercache_querystring, true ); ?> /> <?php _e( 'Remove query strings from static resources', 'w3-total-cache' ); ?></label>
92
+ <br /><span class="description"><?php _e( 'Resources with a "?" in the URL are not cached by some proxy caching servers.', 'w3-total-cache' ); ?></span>
93
+ </th>
94
+ </tr>
95
  <tr>
96
  <th><label for="browsercache_replace_exceptions"><?php Util_Ui::e_config_label( 'browsercache.replace.exceptions' ) ?></label></th>
97
  <td>
224
  <br /><span class="description"><?php _e( 'Whenever settings are changed, a new query string will be generated and appended to objects allowing the new policy to be applied.', 'w3-total-cache' ); ?></span>
225
  </th>
226
  </tr>
227
+ <tr>
228
+ <th colspan="2">
229
+ <?php $this->checkbox( 'browsercache.cssjs.querystring' ) ?> <?php _e( 'Remove query strings from static resources', 'w3-total-cache' ); ?></label>
230
+ <br /><span class="description"><?php _e( 'Resources with a "?" in the URL are not cached by some proxy caching servers.', 'w3-total-cache' ); ?></span>
231
+ </th>
232
+ </tr>
233
  <tr>
234
  <th colspan="2">
235
  <?php $this->checkbox( 'browsercache.cssjs.nocookies' ) ?> <?php Util_Ui::e_config_label( 'browsercache.cssjs.nocookies' ) ?></label>
390
  <br /><span class="description"><?php _e( 'Whenever settings are changed, a new query string will be generated and appended to objects allowing the new policy to be applied.', 'w3-total-cache' ); ?></span>
391
  </th>
392
  </tr>
393
+ <tr>
394
+ <th colspan="2">
395
+ <?php $this->checkbox( 'browsercache.other.querystring' ) ?> <?php _e( 'Remove query strings from static resources', 'w3-total-cache' ); ?></label>
396
+ <br /><span class="description"><?php _e( 'Resources with a "?" in the URL are not cached by some proxy caching servers.', 'w3-total-cache' ); ?></span>
397
+ </th>
398
+ </tr>
399
  <tr>
400
  <th colspan="2">
401
  <?php $this->checkbox( 'browsercache.other.nocookies' ) ?> <?php Util_Ui::e_config_label( 'browsercache.other.nocookies' ) ?></label>
inc/options/cdn.php CHANGED
File without changes
inc/options/cdn/akamai.php CHANGED
File without changes
inc/options/cdn/att.php CHANGED
File without changes
inc/options/cdn/azure.php CHANGED
File without changes
inc/options/cdn/cf.php CHANGED
File without changes
inc/options/cdn/cf2.php CHANGED
File without changes
inc/options/cdn/common/cnames-readonly.php CHANGED
File without changes
inc/options/cdn/common/cnames.php CHANGED
File without changes
inc/options/cdn/common/index.html CHANGED
File without changes
inc/options/cdn/cotendo.php CHANGED
File without changes
inc/options/cdn/edgecast.php CHANGED
File without changes
inc/options/cdn/ftp.php CHANGED
File without changes
inc/options/cdn/index.html CHANGED
File without changes
inc/options/cdn/maxcdn.php CHANGED
File without changes
inc/options/cdn/mirror.php CHANGED
File without changes
inc/options/cdn/netdna.php CHANGED
File without changes
inc/options/cdn/rscf.php CHANGED
File without changes
inc/options/cdn/s3.php CHANGED
File without changes
inc/options/cdn/s3_compatible.php CHANGED
File without changes
inc/options/common/footer.php CHANGED
File without changes
inc/options/common/header.php CHANGED
File without changes
inc/options/common/help.php CHANGED
File without changes
inc/options/common/index.html CHANGED
File without changes
inc/options/dashboard.php CHANGED
File without changes
inc/options/dbcache.php CHANGED
File without changes
inc/options/edd/buy.php CHANGED
File without changes
inc/options/enterprise/dbcluster-config.php CHANGED
File without changes
inc/options/enterprise/dbcluster_general_section.php CHANGED
File without changes
inc/options/extensions.php CHANGED
File without changes
inc/options/extensions/list.php CHANGED
File without changes
inc/options/extensions/settings.php CHANGED
File without changes
inc/options/faq.php CHANGED
File without changes
inc/options/general.php CHANGED
@@ -170,7 +170,7 @@ Util_Ui::config_item( array(
170
  'googleccjs' => __( 'Google Closure Compiler (Web Service)', 'w3-total-cache' ),
171
  'ccjs' => __( 'Google Closure Compiler (Local Java)', 'w3-total-cache' ),
172
  'jsminplus' => __( 'Narcissus', 'w3-total-cache' ),
173
- 'yuijs' => __( 'YUI Compressor', 'w3-total-cache' )
174
  )
175
  ) );
176
  Util_Ui::config_item( array(
@@ -178,7 +178,7 @@ Util_Ui::config_item( array(
178
  'control' => 'selectbox',
179
  'selectbox_values' => array(
180
  'css' => __( 'Minify (default)', 'w3-total-cache' ),
181
- 'csstidy' => __( 'CSS Tidy', 'w3-total-cache' ),
182
  'cssmin' => __( 'YUI Compressor (PHP)', 'w3-total-cache' ),
183
  'yuicss' => __( 'YUI Compressor', 'w3-total-cache' )
184
  )
170
  'googleccjs' => __( 'Google Closure Compiler (Web Service)', 'w3-total-cache' ),
171
  'ccjs' => __( 'Google Closure Compiler (Local Java)', 'w3-total-cache' ),
172
  'jsminplus' => __( 'Narcissus', 'w3-total-cache' ),
173
+ 'yuijs' => __( 'YUI Compressor', 'w3-total-cache' )
174
  )
175
  ) );
176
  Util_Ui::config_item( array(
178
  'control' => 'selectbox',
179
  'selectbox_values' => array(
180
  'css' => __( 'Minify (default)', 'w3-total-cache' ),
181
+ 'csstidy' => array( 'label' => __( 'CSS Tidy', 'w3-total-cache' ), 'disabled' => ( version_compare( PHP_VERSION, '5.4.0', '<') ? true : false ) ),
182
  'cssmin' => __( 'YUI Compressor (PHP)', 'w3-total-cache' ),
183
  'yuicss' => __( 'YUI Compressor', 'w3-total-cache' )
184
  )
inc/options/index.html CHANGED
File without changes
inc/options/install.php CHANGED
File without changes
inc/options/minify.php CHANGED
@@ -314,10 +314,10 @@ if ( file_exists( $js_engine_file2 ) ) {
314
  <?php
315
  Util_Ui::config_item( array(
316
  'key' => 'minify.js.http2push',
317
- 'label' => 'HTTP/2 push',
318
  'control' => 'checkbox',
319
  'checkbox_label' => __( 'Enable', 'w3-total-cache' ),
320
- 'description' => __( 'For better performance, send files to browser before they are requested when using the HTTP/2 protocol.',
321
  'w3-total-cache' ) .
322
  ( $this->_config->get_string( 'pgcache.engine' ) != 'file_generic' ? '' :
323
  __( ' <br /><b>Not supported by "Disk: Enhanced" page cache engine</b>', 'w3-total-cache' ) )
@@ -439,10 +439,10 @@ if ( file_exists( $css_engine_file2 ) ) {
439
  <?php
440
  Util_Ui::config_item( array(
441
  'key' => 'minify.css.http2push',
442
- 'label' => 'HTTP/2 push',
443
  'control' => 'checkbox',
444
  'checkbox_label' => __( 'Enable', 'w3-total-cache' ),
445
- 'description' => __( 'For better performance, send files to browser before they are requested when using the HTTP/2 protocol.',
446
  'w3-total-cache' ) .
447
  ( $this->_config->get_string( 'pgcache.engine' ) != 'file_generic' ? '' :
448
  __( ' <br /><b>Not supported by "Disk: Enhanced" page cache engine</b>', 'w3-total-cache' ) )
@@ -527,8 +527,8 @@ if ( $this->_config->get_string( 'minify.engine' ) == 'memcached' ) {
527
  <tr>
528
  <th colspan="2">
529
  <?php $this->checkbox( 'minify.cache.files_regexp', false, '', true, null ); ?>
530
- <?php _e( 'Use Regular Expression for matching', 'w3-total-cache' ) ?><br />
531
- <span class="description"><?php _e( '', 'w3-total-cache' ); ?></span>
532
  </th>
533
  </tr>
534
  <?php endif; ?>
314
  <?php
315
  Util_Ui::config_item( array(
316
  'key' => 'minify.js.http2push',
317
+ 'label' => '<acronym title="Hypertext Markup Language">HTTP</acronym>/2 push',
318
  'control' => 'checkbox',
319
  'checkbox_label' => __( 'Enable', 'w3-total-cache' ),
320
+ 'description' => __( 'For better performance, send files to browser before they are requested when using the <acronym title="Hypertext Markup Language">HTTP</acronym>/2 protocol.',
321
  'w3-total-cache' ) .
322
  ( $this->_config->get_string( 'pgcache.engine' ) != 'file_generic' ? '' :
323
  __( ' <br /><b>Not supported by "Disk: Enhanced" page cache engine</b>', 'w3-total-cache' ) )
439
  <?php
440
  Util_Ui::config_item( array(
441
  'key' => 'minify.css.http2push',
442
+ 'label' => '<acronym title="Hypertext Markup Language">HTTP</acronym>/2 push',
443
  'control' => 'checkbox',
444
  'checkbox_label' => __( 'Enable', 'w3-total-cache' ),
445
+ 'description' => __( 'For better performance, send files to browser before they are requested when using the <acronym title="Hypertext Markup Language">HTTP</acronym>/2 protocol.',
446
  'w3-total-cache' ) .
447
  ( $this->_config->get_string( 'pgcache.engine' ) != 'file_generic' ? '' :
448
  __( ' <br /><b>Not supported by "Disk: Enhanced" page cache engine</b>', 'w3-total-cache' ) )
527
  <tr>
528
  <th colspan="2">
529
  <?php $this->checkbox( 'minify.cache.files_regexp', false, '', true, null ); ?>
530
+ <?php _e( 'Use Regular Expressions for file name matching', 'w3-total-cache' ) ?><br />
531
+ <span class="description"><?php _e( 'If external script file names vary, use regular expressions in the "Include external files/libraries" field to simplify matching.', 'w3-total-cache' ); ?></span>
532
  </th>
533
  </tr>
534
  <?php endif; ?>
inc/options/minify/ccjs.php CHANGED
File without changes
inc/options/minify/ccjs2.php CHANGED
File without changes
inc/options/minify/css.php CHANGED
@@ -9,7 +9,7 @@ $is_pro = Util_Environment::is_w3tc_pro( $this->_config );
9
  ?>
10
  <?php $this->checkbox( 'minify.css.strip.comments', false, 'css_' ) ?> <?php Util_Ui::e_config_label( 'minify.css.strip.comments' ) ?></label><br />
11
  <?php $this->checkbox( 'minify.css.strip.crlf', false, 'css_' ) ?> <?php Util_Ui::e_config_label( 'minify.css.strip.crlf' ) ?></label><br />
12
- <?php $this->checkbox( 'minify.css.embed', !$is_pro, 'csse_', true, ( $is_pro ? null : false ) ) ?> Eliminate render-blocking CSS by moving it to HTML body</label>
13
  <?php
14
  if ( !$is_pro )
15
  echo ' (Available after <a href="#" class="button-buy-plugin">upgrade</a>)';
9
  ?>
10
  <?php $this->checkbox( 'minify.css.strip.comments', false, 'css_' ) ?> <?php Util_Ui::e_config_label( 'minify.css.strip.comments' ) ?></label><br />
11
  <?php $this->checkbox( 'minify.css.strip.crlf', false, 'css_' ) ?> <?php Util_Ui::e_config_label( 'minify.css.strip.crlf' ) ?></label><br />
12
+ <?php $this->checkbox( 'minify.css.embed', !$is_pro, 'csse_', true, ( $is_pro ? null : false ) ) ?> Eliminate render-blocking <acronym title="Cascading Style Sheet">CSS</acronym> by moving it to <acronym title="Hypertext Markup Language">HTTP</acronym> body</label>
13
  <?php
14
  if ( !$is_pro )
15
  echo ' (Available after <a href="#" class="button-buy-plugin">upgrade</a>)';
inc/options/minify/csstidy.php CHANGED
@@ -5,6 +5,7 @@ if ( !defined( 'W3TC' ) )
5
  die();
6
 
7
  $css_levels = array(
 
8
  'CSS2.1',
9
  'CSS2.0',
10
  'CSS1.0'
@@ -17,14 +18,16 @@ $css_level = $this->_config->get_string( 'minify.csstidy.options.css_level' );
17
  <?php $this->checkbox( 'minify.csstidy.options.compress_font-weight', false, 'css_' ) ?> <?php Util_Ui::e_config_label( 'minify.csstidy.options.compress_font-weight' ) ?></label><br />
18
  <?php $this->checkbox( 'minify.csstidy.options.lowercase_s', false, 'css_' ) ?> <?php Util_Ui::e_config_label( 'minify.csstidy.options.lowercase_s' ) ?></label><br />
19
  <?php $this->checkbox( 'minify.csstidy.options.remove_last_;', false, 'css_' ) ?> <?php Util_Ui::e_config_label( 'minify.csstidy.options.remove_last_;' ) ?></label><br />
 
20
  <?php $this->checkbox( 'minify.csstidy.options.sort_properties', false, 'css_' ) ?> <?php Util_Ui::e_config_label( 'minify.csstidy.options.sort_properties' ) ?></label><br />
21
  <?php $this->checkbox( 'minify.csstidy.options.sort_selectors', false, 'css_' ) ?> <?php Util_Ui::e_config_label( 'minify.csstidy.options.sort_selectors' ) ?></label><br />
 
22
  <?php $this->checkbox( 'minify.csstidy.options.discard_invalid_properties', false, 'css_' ) ?> <?php Util_Ui::e_config_label( 'minify.csstidy.options.discard_invalid_properties' ) ?></label>
23
  <select class="css_enabled" name="minify__csstidy__options__css_level"
24
- <?php Util_Ui::sealing_disabled( 'minify.' ) ?>>
25
- <?php foreach ( $css_levels as $_css_level ): ?>
26
- <option value="<?php echo esc_attr( $_css_level ); ?>" <?php selected( $css_level, $_css_level ); ?>><?php echo $_css_level; ?></option>
27
- <?php endforeach; ?>
28
  </select><br />
29
  <?php $this->checkbox( 'minify.csstidy.options.preserve_css', false, 'css_' ) ?> <?php Util_Ui::e_config_label( 'minify.csstidy.options.preserve_css' ) ?></label><br />
30
  <?php $this->checkbox( 'minify.csstidy.options.timestamp', false, 'css_' ) ?> <?php Util_Ui::e_config_label( 'minify.csstidy.options.timestamp' ) ?></label><br />
5
  die();
6
 
7
  $css_levels = array(
8
+ 'CSS3.0',
9
  'CSS2.1',
10
  'CSS2.0',
11
  'CSS1.0'
18
  <?php $this->checkbox( 'minify.csstidy.options.compress_font-weight', false, 'css_' ) ?> <?php Util_Ui::e_config_label( 'minify.csstidy.options.compress_font-weight' ) ?></label><br />
19
  <?php $this->checkbox( 'minify.csstidy.options.lowercase_s', false, 'css_' ) ?> <?php Util_Ui::e_config_label( 'minify.csstidy.options.lowercase_s' ) ?></label><br />
20
  <?php $this->checkbox( 'minify.csstidy.options.remove_last_;', false, 'css_' ) ?> <?php Util_Ui::e_config_label( 'minify.csstidy.options.remove_last_;' ) ?></label><br />
21
+ <?php $this->checkbox( 'minify.csstidy.options.remove_space_before_important', false, 'css_') ?> <?php Util_Ui::e_config_label( 'minify.csstidy.options.remove_space_before_important' ) ?></label><br />
22
  <?php $this->checkbox( 'minify.csstidy.options.sort_properties', false, 'css_' ) ?> <?php Util_Ui::e_config_label( 'minify.csstidy.options.sort_properties' ) ?></label><br />
23
  <?php $this->checkbox( 'minify.csstidy.options.sort_selectors', false, 'css_' ) ?> <?php Util_Ui::e_config_label( 'minify.csstidy.options.sort_selectors' ) ?></label><br />
24
+ <?php $this->checkbox( 'minify.csstidy.options.discard_invalid_selectors', false, 'css_') ?> <?php Util_Ui::e_config_label( 'minify.csstidy.options.discard_invalid_selectors' ) ?></label><br />
25
  <?php $this->checkbox( 'minify.csstidy.options.discard_invalid_properties', false, 'css_' ) ?> <?php Util_Ui::e_config_label( 'minify.csstidy.options.discard_invalid_properties' ) ?></label>
26
  <select class="css_enabled" name="minify__csstidy__options__css_level"
27
+ <?php Util_Ui::sealing_disabled( 'minify.' ) ?>>
28
+ <?php foreach ( $css_levels as $_css_level ): ?>
29
+ <option value="<?php echo esc_attr( $_css_level ); ?>" <?php selected( $css_level, $_css_level ); ?>><?php echo $_css_level; ?></option>
30
+ <?php endforeach; ?>
31
  </select><br />
32
  <?php $this->checkbox( 'minify.csstidy.options.preserve_css', false, 'css_' ) ?> <?php Util_Ui::e_config_label( 'minify.csstidy.options.preserve_css' ) ?></label><br />
33
  <?php $this->checkbox( 'minify.csstidy.options.timestamp', false, 'css_' ) ?> <?php Util_Ui::e_config_label( 'minify.csstidy.options.timestamp' ) ?></label><br />
inc/options/minify/csstidy2.php CHANGED
@@ -14,7 +14,8 @@ $csstidy_templates = array(
14
  $optimise_shorthands_values = array(
15
  0 => __( 'Don\'t optimise', 'w3-total-cache' ),
16
  1 => __( 'Safe optimisations', 'w3-total-cache' ),
17
- 2 => __( 'All optimisations', 'w3-total-cache' )
 
18
  );
19
 
20
  $case_properties_values = array(
@@ -35,46 +36,46 @@ $case_properties = $this->_config->get_integer( 'minify.csstidy.options.case_pro
35
  $merge_selectors = $this->_config->get_integer( 'minify.csstidy.options.merge_selectors' );
36
  ?>
37
  <tr>
38
- <th><label for="minify_csstidy_options_template"><?php Util_Ui::e_config_label( 'minify.csstidy.options.template' ) ?></label></th>
39
- <td>
40
- <select id="minify_csstidy_options_template" class="css_enabled" name="minify__csstidy__options__template"
41
- <?php Util_Ui::sealing_disabled( 'minify.' ) ?>>
42
- <?php foreach ( $csstidy_templates as $csstidy_template_key => $csstidy_template_name ): ?>
43
- <option value="<?php echo esc_attr( $csstidy_template_key ); ?>" <?php selected( $csstidy_template, $csstidy_template_key ); ?>><?php echo $csstidy_template_name; ?></option>
44
- <?php endforeach; ?>
45
- </select>
46
- </td>
47
  </tr>
48
  <tr>
49
- <th><label for="minify_csstidy_options_optimise_shorthands"><?php Util_Ui::e_config_label( 'minify.csstidy.options.optimise_shorthands' ) ?></label></th>
50
- <td>
51
- <select id="minify_csstidy_options_optimise_shorthands" class="css_enabled"
52
- <?php Util_Ui::sealing_disabled( 'minify.' ) ?> name="minify__csstidy__options__optimise_shorthands">
53
- <?php foreach ( $optimise_shorthands_values as $optimise_shorthands_key => $optimise_shorthands_name ): ?>
54
- <option value="<?php echo esc_attr( $optimise_shorthands_key ); ?>" <?php selected( $optimise_shorthands, $optimise_shorthands_key ); ?>><?php echo $optimise_shorthands_name; ?></option>
55
- <?php endforeach; ?>
56
- </select>
57
- </td>
58
  </tr>
59
  <tr>
60
- <th><label for="minify_csstidy_options_case_properties"><?php Util_Ui::e_config_label( 'minify.csstidy.options.case_properties' ) ?></label></th>
61
- <td>
62
- <select id="minify_csstidy_options_case_properties" class="css_enabled"
63
- <?php Util_Ui::sealing_disabled( 'minify.' ) ?> name="minify__csstidy__options__case_properties">
64
- <?php foreach ( $case_properties_values as $case_properties_key => $case_properties_name ): ?>
65
- <option value="<?php echo esc_attr( $case_properties_key ); ?>" <?php selected( $case_properties, $case_properties_key ); ?>><?php echo $case_properties_name; ?></option>
66
- <?php endforeach; ?>
67
- </select>
68
- </td>
69
  </tr>
70
  <tr>
71
- <th><label for="minify_csstidy_options_merge_selectors"><?php Util_Ui::e_config_label( 'minify.csstidy.options.merge_selectors' ) ?></label></th>
72
- <td>
73
- <select id="minify_csstidy_options_merge_selectors" class="css_enabled"
74
- <?php Util_Ui::sealing_disabled( 'minify.' ) ?> name="minify__csstidy__options__merge_selectors">
75
- <?php foreach ( $merge_selectors_values as $merge_selectors_key => $merge_selectors_name ): ?>
76
- <option value="<?php echo esc_attr( $merge_selectors_key ); ?>" <?php selected( $merge_selectors, $merge_selectors_key ); ?>><?php echo $merge_selectors_name; ?></option>
77
- <?php endforeach; ?>
78
- </select>
79
- </td>
80
  </tr>
14
  $optimise_shorthands_values = array(
15
  0 => __( 'Don\'t optimise', 'w3-total-cache' ),
16
  1 => __( 'Safe optimisations', 'w3-total-cache' ),
17
+ 2 => __( 'Level II optimisations', 'w3-total-cache' ),
18
+ 3 => __( 'All optimisations', 'w3-total-cache' )
19
  );
20
 
21
  $case_properties_values = array(
36
  $merge_selectors = $this->_config->get_integer( 'minify.csstidy.options.merge_selectors' );
37
  ?>
38
  <tr>
39
+ <th><label for="minify_csstidy_options_template"><?php Util_Ui::e_config_label( 'minify.csstidy.options.template' ) ?></label></th>
40
+ <td>
41
+ <select id="minify_csstidy_options_template" class="css_enabled" name="minify__csstidy__options__template"
42
+ <?php Util_Ui::sealing_disabled( 'minify.' ) ?>>
43
+ <?php foreach ( $csstidy_templates as $csstidy_template_key => $csstidy_template_name ): ?>
44
+ <option value="<?php echo esc_attr( $csstidy_template_key ); ?>" <?php selected( $csstidy_template, $csstidy_template_key ); ?>><?php echo $csstidy_template_name; ?></option>
45
+ <?php endforeach; ?>
46
+ </select>
47
+ </td>
48
  </tr>
49
  <tr>
50
+ <th><label for="minify_csstidy_options_optimise_shorthands"><?php Util_Ui::e_config_label( 'minify.csstidy.options.optimise_shorthands' ) ?></label></th>
51
+ <td>
52
+ <select id="minify_csstidy_options_optimise_shorthands" class="css_enabled"
53
+ <?php Util_Ui::sealing_disabled( 'minify.' ) ?> name="minify__csstidy__options__optimise_shorthands">
54
+ <?php foreach ( $optimise_shorthands_values as $optimise_shorthands_key => $optimise_shorthands_name ): ?>
55
+ <option value="<?php echo esc_attr( $optimise_shorthands_key ); ?>" <?php selected( $optimise_shorthands, $optimise_shorthands_key ); ?>><?php echo $optimise_shorthands_name; ?></option>
56
+ <?php endforeach; ?>
57
+ </select>
58
+ </td>
59
  </tr>
60
  <tr>
61
+ <th><label for="minify_csstidy_options_case_properties"><?php Util_Ui::e_config_label( 'minify.csstidy.options.case_properties' ) ?></label></th>
62
+ <td>
63
+ <select id="minify_csstidy_options_case_properties" class="css_enabled"
64
+ <?php Util_Ui::sealing_disabled( 'minify.' ) ?> name="minify__csstidy__options__case_properties">
65
+ <?php foreach ( $case_properties_values as $case_properties_key => $case_properties_name ): ?>
66
+ <option value="<?php echo esc_attr( $case_properties_key ); ?>" <?php selected( $case_properties, $case_properties_key ); ?>><?php echo $case_properties_name; ?></option>
67
+ <?php endforeach; ?>
68
+ </select>
69
+ </td>
70
  </tr>
71
  <tr>
72
+ <th><label for="minify_csstidy_options_merge_selectors"><?php Util_Ui::e_config_label( 'minify.csstidy.options.merge_selectors' ) ?></label></th>
73
+ <td>
74
+ <select id="minify_csstidy_options_merge_selectors" class="css_enabled"
75
+ <?php Util_Ui::sealing_disabled( 'minify.' ) ?> name="minify__csstidy__options__merge_selectors">
76
+ <?php foreach ( $merge_selectors_values as $merge_selectors_key => $merge_selectors_name ): ?>
77
+ <option value="<?php echo esc_attr( $merge_selectors_key ); ?>" <?php selected( $merge_selectors, $merge_selectors_key ); ?>><?php echo $merge_selectors_name; ?></option>
78
+ <?php endforeach; ?>
79
+ </select>
80
+ </td>
81
  </tr>
inc/options/minify/googleccjs2.php CHANGED
File without changes
inc/options/minify/html.php CHANGED
File without changes
inc/options/minify/htmltidy.php CHANGED
File without changes
inc/options/minify/htmltidy2.php CHANGED
File without changes
inc/options/minify/index.html CHANGED
File without changes
inc/options/minify/js.php CHANGED
File without changes
inc/options/minify/yuicss2.php CHANGED
File without changes
inc/options/minify/yuijs.php CHANGED
File without changes
inc/options/minify/yuijs2.php CHANGED
File without changes
inc/options/mobile.php CHANGED
File without changes
inc/options/objectcache.php CHANGED
File without changes
inc/options/parts/memcached.php CHANGED
@@ -38,7 +38,7 @@ if ( !defined( 'W3TC' ) )
38
  <span class="description">
39
  <?php
40
  if ( !Util_Installed::memcached_aws() )
41
- _e( 'ElastiCache PHP module not found', 'w3-total-cache' );
42
  else
43
  _e( 'When Amazon ElastiCache used, specify configuration endpoint as Memcached host', 'w3-total-cache' );
44
  ?>
38
  <span class="description">
39
  <?php
40
  if ( !Util_Installed::memcached_aws() )
41
+ _e( 'ElastiCache <acronym title="Hypertext Preprocessor">PHP</acronym> module not found', 'w3-total-cache' );
42
  else
43
  _e( 'When Amazon ElastiCache used, specify configuration endpoint as Memcached host', 'w3-total-cache' );
44
  ?>
inc/options/parts/memcached_extension.php CHANGED
@@ -42,7 +42,7 @@ Util_Ui::config_item( array(
42
  'disabled' => ( Util_Installed::memcached_aws() ? null : true ),
43
  'description' =>
44
  ( !Util_Installed::memcached_aws() ?
45
- __( 'ElastiCache PHP module not found', 'w3-total-cache' ) :
46
  __( 'When Amazon ElastiCache used, specify configuration endpoint as Memecached host', 'w3-total-cache' )
47
  )
48
  ) );
42
  'disabled' => ( Util_Installed::memcached_aws() ? null : true ),
43
  'description' =>
44
  ( !Util_Installed::memcached_aws() ?
45
+ __( 'ElastiCache <acronym title="Hypertext Preprocessor">PHP</acronym> module not found', 'w3-total-cache' ) :
46
  __( 'When Amazon ElastiCache used, specify configuration endpoint as Memecached host', 'w3-total-cache' )
47
  )
48
  ) );
inc/options/parts/redis.php CHANGED
File without changes
inc/options/parts/redis_extension.php CHANGED
File without changes
inc/options/pgcache.php CHANGED
@@ -262,7 +262,7 @@ Util_Ui::postbox_header( __( 'Purge Policy: ', 'w3-total-cache' ) . implode( ',
262
  <td>
263
  <input type="hidden" name="pgcache__late_caching" value="0" />
264
  <label><input id="pgcache_late_caching" type="checkbox" name="pgcache__late_caching" value="1"<?php checked( $this->_config->get_string( 'pgcache.engine' ) != 'file_generic' && $this->_config->get_boolean( 'pgcache.late_caching' ) ); ?> <?php disabled( $this->_config->get_string( 'pgcache.engine' ), 'file_generic' ) ?> /> <?php _e( 'Enable', 'w3-total-cache' ); ?></label>
265
- <br /><span class="description"><?php _e( 'Allows overwriting of page caching key via custom filters by postponing entry extraction in the init action.', 'w3-total-cache' )?></span>
266
  </td>
267
  </tr>
268
  <?php
262
  <td>
263
  <input type="hidden" name="pgcache__late_caching" value="0" />
264
  <label><input id="pgcache_late_caching" type="checkbox" name="pgcache__late_caching" value="1"<?php checked( $this->_config->get_string( 'pgcache.engine' ) != 'file_generic' && $this->_config->get_boolean( 'pgcache.late_caching' ) ); ?> <?php disabled( $this->_config->get_string( 'pgcache.engine' ), 'file_generic' ) ?> /> <?php _e( 'Enable', 'w3-total-cache' ); ?></label>
265
+ <br /><span class="description"><?php _e( 'Overwrites key of page caching via custom filters by postponing entry extraction during the init action.', 'w3-total-cache' )?></span>
266
  </td>
267
  </tr>
268
  <?php
inc/options/referrer.php CHANGED
File without changes
inc/options/support.php CHANGED
File without changes
inc/popup/cdn_export_file.php CHANGED
File without changes
inc/popup/cdn_export_library.php CHANGED
File without changes
inc/popup/cdn_import_library.php CHANGED
File without changes
inc/popup/cdn_purge.php CHANGED
File without changes
inc/popup/cdn_queue.php CHANGED
File without changes
inc/popup/cdn_rename_domain.php CHANGED
File without changes
inc/popup/common/footer.php CHANGED
File without changes
inc/popup/common/header.php CHANGED
File without changes
inc/popup/common/index.html CHANGED
File without changes
inc/popup/index.html CHANGED
File without changes
inc/popup/pagespeed_results.php CHANGED
File without changes
inc/widget/index.html CHANGED
File without changes
inc/widget/latest.php CHANGED
File without changes
inc/widget/latest_ajax.php CHANGED
File without changes
inc/widget/latest_control.php CHANGED
File without changes
inc/widget/latest_news.php CHANGED
File without changes
inc/widget/latest_news_ajax.php CHANGED
File without changes
inc/widget/latest_news_control.php CHANGED
File without changes
inc/widget/maxcdn.php CHANGED
File without changes
inc/widget/maxcdn_signup.php CHANGED
File without changes
inc/widget/netdna.php CHANGED
File without changes
inc/widget/netdna_signup.php CHANGED
File without changes
index.html CHANGED
File without changes
ini/apc.ini CHANGED
File without changes
ini/dbcluster-config-sample.php CHANGED
File without changes
ini/eaccelerator.ini CHANGED
File without changes
ini/index.html CHANGED
File without changes
ini/memcache.ini CHANGED
File without changes
ini/nginx-network-sample-config.conf CHANGED
File without changes
ini/nginx-standalone-sample-config.conf CHANGED
File without changes
ini/opcache.ini CHANGED
File without changes
ini/php.append.ini CHANGED
File without changes
ini/s3-sample-policy.txt CHANGED
File without changes
ini/varnish-sample-config.vcl CHANGED
File without changes
ini/web.config ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <configuration>
3
+ <system.webServer>
4
+ <rewrite>
5
+ <rules>
6
+ <rule name="w3tc_rewrite_test" stopProcessing="true">
7
+ <match url="wp-content/cache/minify/w3tc_rewrite_test" />
8
+ <conditions>
9
+ <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
10
+ <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
11
+ </conditions>
12
+ <action type="Rewrite" url="index.php" />
13
+ </rule>
14
+ <rule name="w3tc-minify-file" stopProcessing="true">
15
+ <match url="wp-content/cache/minify/(.+\.(css|js))$" />
16
+ <conditions>
17
+ <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
18
+ <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
19
+ </conditions>
20
+ <action type="Rewrite" url="index.php" />
21
+ </rule>
22
+ <rule name="WordPress" patternSyntax="Wildcard">
23
+ <match url="*"/>
24
+ <conditions>
25
+ <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
26
+ <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
27
+ </conditions>
28
+ <action type="Rewrite" url="index.php"/>
29
+ </rule>
30
+ </rules>
31
+ </rewrite>
32
+ <staticContent>
33
+ <clientCache cacheControlMaxAge="30.00:00:00" cacheControlMode="UseMaxAge"/>
34
+ </staticContent>
35
+ </system.webServer>
36
+ </configuration>
ini/xcache.ini CHANGED
File without changes
languages/ar.mo CHANGED
File without changes
languages/faq-en_US.xml CHANGED
@@ -370,7 +370,7 @@ Note: To disable page caching of specific theme templates or plugin files you ne
370
  <p>When using Minify and JS/CSS placement, custom placement, the following tags are available:</p>
371
  <ul>
372
  <li>&lt;!-- W3TC-include-css --&gt;<br / >Used with "Auto" and "Manual". Inserts the minified/combined <acronym title="Cascading Style Sheet">CSS</acronym> files at the location you choose.</li>
373
- <li>&lt;!-- W3TC-include-js-head --&gt;<br / >Used with "Auto" and "Manual". Inserts the minified/combined <acronym title="JavaScript">JS</acronym> files. Embed location "in &lt;head&gt;" in "Manual" mode.</li>
374
  <li>&lt;!-- W3TC-include-js-body-start --&gt;<br / >Used with "Manual". Inserts the minified/combined <acronym title="JavaScript">JS</acronym> files. Embed location "after &lt;body&gt;" in "Manual" mode.</li>
375
  <li>&lt;!-- W3TC-include-js-body-end --&gt;<br / >Used with "Manual". Inserts the minified/combined <acronym title="JavaScript">JS</acronym> files. Embed location "before &lt;/body&gt;" in "Manual" mode.</li>
376
  </ul>
370
  <p>When using Minify and JS/CSS placement, custom placement, the following tags are available:</p>
371
  <ul>
372
  <li>&lt;!-- W3TC-include-css --&gt;<br / >Used with "Auto" and "Manual". Inserts the minified/combined <acronym title="Cascading Style Sheet">CSS</acronym> files at the location you choose.</li>
373
+ <li>&lt;!-- W3TC-include-js-head --&gt;<br / >Used with "Manual". Inserts the minified/combined <acronym title="JavaScript">JS</acronym> files. Embed location "in &lt;head&gt;" in "Manual" mode.</li>
374
  <li>&lt;!-- W3TC-include-js-body-start --&gt;<br / >Used with "Manual". Inserts the minified/combined <acronym title="JavaScript">JS</acronym> files. Embed location "after &lt;body&gt;" in "Manual" mode.</li>
375
  <li>&lt;!-- W3TC-include-js-body-end --&gt;<br / >Used with "Manual". Inserts the minified/combined <acronym title="JavaScript">JS</acronym> files. Embed location "before &lt;/body&gt;" in "Manual" mode.</li>
376
  </ul>
languages/faq-enterprise-en_US.xml CHANGED
File without changes
languages/faq-pro-en_US.xml CHANGED
File without changes
languages/w3-total-cache-ar_AR.po CHANGED
@@ -425,7 +425,7 @@ msgid "HTML Tidy extension:"
425
  msgstr ""
426
 
427
  #: inc/lightbox/self_test.php:124
428
- msgid "(required for HTML Tidy minifier suppport)"
429
  msgstr ""
430
 
431
  #: inc/lightbox/self_test.php:128
425
  msgstr ""
426
 
427
  #: inc/lightbox/self_test.php:124
428
+ msgid "(required for HTML Tidy minifier support)"
429
  msgstr ""
430
 
431
  #: inc/lightbox/self_test.php:128
languages/w3-total-cache-nl_NL.mo CHANGED
File without changes
languages/w3-total-cache-nl_NL.po CHANGED
@@ -422,7 +422,7 @@ msgid "HTML Tidy extension:"
422
  msgstr ""
423
 
424
  #: ../inc/lightbox/self_test.php:124
425
- msgid "(required for HTML Tidy minifier suppport)"
426
  msgstr ""
427
 
428
  #: ../inc/lightbox/self_test.php:128
422
  msgstr ""
423
 
424
  #: ../inc/lightbox/self_test.php:124
425
+ msgid "(required for HTML Tidy minifier support)"
426
  msgstr ""
427
 
428
  #: ../inc/lightbox/self_test.php:128
languages/w3-total-cache-pl_PL.po CHANGED
@@ -421,7 +421,7 @@ msgid "HTML Tidy extension:"
421
  msgstr ""
422
 
423
  #: inc/lightbox/self_test.php:124
424
- msgid "(required for HTML Tidy minifier suppport)"
425
  msgstr ""
426
 
427
  #: inc/lightbox/self_test.php:128
421
  msgstr ""
422
 
423
  #: inc/lightbox/self_test.php:124
424
+ msgid "(required for HTML Tidy minifier support)"
425
  msgstr ""
426
 
427
  #: inc/lightbox/self_test.php:128
languages/w3-total-cache-sr_RS.mo CHANGED
File without changes
languages/w3-total-cache-sr_RS.po CHANGED
@@ -486,7 +486,7 @@ msgid "HTML Tidy extension:"
486
  msgstr "HTML Tidy ekstenzija:"
487
 
488
  #: ../inc/lightbox/self_test.php:124
489
- msgid "(required for HTML Tidy minifier suppport)"
490
  msgstr "(potrebno za podršku za HTML Tidy umanjivač)"
491
 
492
  #: ../inc/lightbox/self_test.php:128
486
  msgstr "HTML Tidy ekstenzija:"
487
 
488
  #: ../inc/lightbox/self_test.php:124
489
+ msgid "(required for HTML Tidy minifier support)"
490
  msgstr "(potrebno za podršku za HTML Tidy umanjivač)"
491
 
492
  #: ../inc/lightbox/self_test.php:128
languages/w3-total-cache.pot CHANGED
@@ -861,7 +861,7 @@ msgid "HTML Tidy extension:"
861
  msgstr ""
862
 
863
  #: inc/lightbox/self_test.php:124
864
- msgid "(required for HTML Tidy minifier suppport)"
865
  msgstr ""
866
 
867
  #: inc/lightbox/self_test.php:128
861
  msgstr ""
862
 
863
  #: inc/lightbox/self_test.php:124
864
+ msgid "(required for HTML Tidy minifier support)"
865
  msgstr ""
866
 
867
  #: inc/lightbox/self_test.php:128
lib/Azure/GuzzleHttp/Client.php CHANGED
File without changes
lib/Azure/GuzzleHttp/ClientInterface.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Cookie/CookieJar.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Cookie/CookieJarInterface.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Cookie/FileCookieJar.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Cookie/SessionCookieJar.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Cookie/SetCookie.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Exception/BadResponseException.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Exception/ClientException.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Exception/ConnectException.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Exception/GuzzleException.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Exception/RequestException.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Exception/SeekException.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Exception/ServerException.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Exception/TooManyRedirectsException.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Exception/TransferException.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Handler/CurlFactory.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Handler/CurlFactoryInterface.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Handler/CurlHandler.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Handler/CurlMultiHandler.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Handler/EasyHandle.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Handler/MockHandler.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Handler/Proxy.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Handler/StreamHandler.php CHANGED
File without changes
lib/Azure/GuzzleHttp/HandlerStack.php CHANGED
File without changes
lib/Azure/GuzzleHttp/MessageFormatter.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Middleware.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Pool.php CHANGED
File without changes
lib/Azure/GuzzleHttp/PrepareBodyMiddleware.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Promise/AggregateException.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Promise/CancellationException.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Promise/Coroutine.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Promise/EachPromise.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Promise/FulfilledPromise.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Promise/Promise.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Promise/PromiseInterface.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Promise/PromisorInterface.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Promise/RejectedPromise.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Promise/RejectionException.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Promise/TaskQueue.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Promise/TaskQueueInterface.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Promise/functions.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Promise/functions_include.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Psr7/AppendStream.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Psr7/BufferStream.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Psr7/CachingStream.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Psr7/DroppingStream.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Psr7/FnStream.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Psr7/InflateStream.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Psr7/LazyOpenStream.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Psr7/LimitStream.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Psr7/MessageTrait.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Psr7/MultipartStream.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Psr7/NoSeekStream.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Psr7/PumpStream.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Psr7/Request.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Psr7/Response.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Psr7/ServerRequest.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Psr7/Stream.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Psr7/StreamDecoratorTrait.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Psr7/StreamWrapper.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Psr7/UploadedFile.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Psr7/Uri.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Psr7/functions.php CHANGED
File without changes
lib/Azure/GuzzleHttp/Psr7/functions_include.php CHANGED
File without changes
lib/Azure/GuzzleHttp/RedirectMiddleware.php CHANGED
File without changes
lib/Azure/GuzzleHttp/RequestOptions.php CHANGED
File without changes
lib/Azure/GuzzleHttp/RetryMiddleware.php CHANGED
File without changes
lib/Azure/GuzzleHttp/TransferStats.php CHANGED
File without changes
lib/Azure/GuzzleHttp/UriTemplate.php CHANGED
File without changes
lib/Azure/GuzzleHttp/functions.php CHANGED
File without changes
lib/Azure/GuzzleHttp/functions_include.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/BlobRestProxy.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Internal/IBlob.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/AccessCondition.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/AccessPolicy.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/AcquireLeaseOptions.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/AcquireLeaseResult.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/Blob.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/BlobBlockType.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/BlobPrefix.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/BlobProperties.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/BlobServiceOptions.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/BlobType.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/Block.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/BlockList.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/BreakLeaseResult.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/CommitBlobBlocksOptions.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/Container.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/ContainerACL.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/ContainerProperties.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/CopyBlobOptions.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/CopyBlobResult.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/CreateBlobBlockOptions.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/CreateBlobOptions.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/CreateBlobPagesOptions.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/CreateBlobPagesResult.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/CreateBlobSnapshotOptions.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/CreateBlobSnapshotResult.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/CreateContainerOptions.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/DeleteBlobOptions.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/DeleteContainerOptions.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/GetBlobMetadataOptions.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/GetBlobMetadataResult.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/GetBlobOptions.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/GetBlobPropertiesOptions.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/GetBlobPropertiesResult.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/GetBlobResult.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/GetContainerACLResult.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/GetContainerPropertiesResult.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/LeaseMode.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/ListBlobBlocksOptions.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/ListBlobBlocksResult.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/ListBlobsOptions.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/ListBlobsResult.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/ListContainersOptions.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/ListContainersResult.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/ListPageBlobRangesOptions.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/ListPageBlobRangesResult.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/PageRange.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/PageWriteOption.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/PublicAccessType.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/SetBlobMetadataOptions.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/SetBlobMetadataResult.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/SetBlobPropertiesOptions.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/SetBlobPropertiesResult.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/SetContainerMetadataOptions.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Blob/Models/SignedIdentifier.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/CloudConfigurationManager.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/Authentication/IAuthScheme.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/Authentication/SharedKeyAuthScheme.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/Authentication/StorageAuthScheme.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/Authentication/TableSharedKeyLiteAuthScheme.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/ConnectionStringParser.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/ConnectionStringSource.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/FilterableService.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/Filters/AuthenticationFilter.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/Filters/DateFilter.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/Filters/ExponentialRetryPolicy.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/Filters/HeadersFilter.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/Filters/RetryPolicy.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/Filters/RetryPolicyFilter.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/Http/HttpCallContext.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/HttpFormatter.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/IServiceFilter.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/InvalidArgumentTypeException.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/Logger.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/Resources.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/RestProxy.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/RetryMiddlewareFactory.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/Serialization/ISerializer.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/Serialization/JsonSerializer.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/Serialization/XmlSerializer.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/ServiceRestProxy.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/ServiceSettings.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/StorageServiceSettings.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/Utilities.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Internal/Validate.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Models/GetServicePropertiesResult.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Models/Logging.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Models/Metrics.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Models/RetentionPolicy.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/Models/ServiceProperties.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/ServiceException.php CHANGED
File without changes
lib/Azure/MicrosoftAzureStorage/Common/ServicesBuilder.php CHANGED
File without changes
lib/Azure/PsrHttpMessage/MessageInterface.php CHANGED
File without changes
lib/Azure/PsrHttpMessage/RequestInterface.php CHANGED
File without changes
lib/Azure/PsrHttpMessage/ResponseInterface.php CHANGED
File without changes
lib/Azure/PsrHttpMessage/ServerRequestInterface.php CHANGED
File without changes
lib/Azure/PsrHttpMessage/StreamInterface.php CHANGED
File without changes
lib/Azure/PsrHttpMessage/UploadedFileInterface.php CHANGED
File without changes
lib/Azure/PsrHttpMessage/UriInterface.php CHANGED
File without changes
lib/Azure/loader.php CHANGED
File without changes
lib/CSSTidy/class.csstidy.php CHANGED
@@ -1,36 +1,74 @@
1
  <?php
 
2
  /**
3
  * CSSTidy - CSS Parser and Optimiser
4
  *
5
  * CSS Parser class
6
  *
 
 
7
  * This file is part of CSSTidy.
8
  *
9
- * CSSTidy is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation; either version 2 of the License, or
12
- * (at your option) any later version.
13
  *
14
- * CSSTidy is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
18
  *
19
- * You should have received a copy of the GNU General Public License
20
- * along with CSSTidy; if not, write to the Free Software
21
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
  *
23
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
24
  * @package csstidy
25
- * @author Florian Schmitz (floele at gmail dot com) 2005-2006
 
 
 
 
 
26
  */
27
 
28
  /**
29
- * Various CSS data needed for correct optimisations etc.
30
  *
31
- * @version 1.3
 
32
  */
33
- require('data.inc.php');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
  /**
36
  * Contains a class for printing CSS code
@@ -56,943 +94,1203 @@ require('class.csstidy_optimise.php');
56
  * An online version should be available here: http://cdburnerxp.se/cssparse/css_optimiser.php
57
  * @package csstidy
58
  * @author Florian Schmitz (floele at gmail dot com) 2005-2006
59
- * @version 1.3
60
  */
61
  class csstidy {
62
 
63
- /**
64
- * Saves the parsed CSS
65
- * @var array
66
- * @access public
67
- */
68
- var $css = array();
69
-
70
- /**
71
- * Saves the parsed CSS (raw)
72
- * @var array
73
- * @access private
74
- */
75
- var $tokens = array();
76
-
77
- /**
78
- * Printer class
79
- * @see csstidy_print
80
- * @var object
81
- * @access public
82
- */
83
- var $print;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
 
85
- /**
86
- * Optimiser class
87
- * @see csstidy_optimise
88
- * @var object
89
- * @access private
90
- */
91
- var $optimise;
 
 
 
 
 
 
92
 
93
- /**
94
- * Saves the CSS charset (@charset)
95
- * @var string
96
- * @access private
97
- */
98
- var $charset = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
 
100
- /**
101
- * Saves all @import URLs
102
- * @var array
103
- * @access private
104
- */
105
- var $import = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
 
107
- /**
108
- * Saves the namespace
109
- * @var string
110
- * @access private
111
- */
112
- var $namespace = '';
 
 
 
 
 
 
 
113
 
114
- /**
115
- * Contains the version of csstidy
116
- * @var string
117
- * @access private
118
- */
119
- var $version = '1.3';
 
 
 
 
 
 
 
 
 
 
 
 
120
 
121
- /**
122
- * Stores the settings
123
- * @var array
124
- * @access private
125
- */
126
- var $settings = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
 
128
- /**
129
- * Saves the parser-status.
130
- *
131
- * Possible values:
132
- * - is = in selector
133
- * - ip = in property
134
- * - iv = in value
135
- * - instr = in string (started at " or ' or ( )
136
- * - ic = in comment (ignore everything)
137
- * - at = in @-block
138
- *
139
- * @var string
140
- * @access private
141
- */
142
- var $status = 'is';
143
 
 
 
 
 
144
 
145
- /**
146
- * Saves the current at rule (@media)
147
- * @var string
148
- * @access private
149
- */
150
- var $at = '';
151
 
152
- /**
153
- * Saves the current selector
154
- * @var string
155
- * @access private
156
- */
157
- var $selector = '';
158
 
159
- /**
160
- * Saves the current property
161
- * @var string
162
- * @access private
163
- */
164
- var $property = '';
 
 
 
 
 
 
 
165
 
166
- /**
167
- * Saves the position of , in selectors
168
- * @var array
169
- * @access private
170
- */
171
- var $sel_separate = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
 
173
- /**
174
- * Saves the current value
175
- * @var string
176
- * @access private
177
- */
178
- var $value = '';
 
 
 
 
 
 
 
 
179
 
180
- /**
181
- * Saves the current sub-value
182
- *
183
- * Example for a subvalue:
184
- * background:url(foo.png) red no-repeat;
185
- * "url(foo.png)", "red", and "no-repeat" are subvalues,
186
- * seperated by whitespace
187
- * @var string
188
- * @access private
189
- */
190
- var $sub_value = '';
191
 
192
- /**
193
- * Array which saves all subvalues for a property.
194
- * @var array
195
- * @see sub_value
196
- * @access private
197
- */
198
- var $sub_value_arr = array();
199
 
200
- /**
201
- * Saves the char which opened the last string
202
- * @var string
203
- * @access private
204
- */
205
- var $str_char = '';
206
- var $cur_string = '';
207
 
208
- /**
209
- * Status from which the parser switched to ic or instr
210
- * @var string
211
- * @access private
212
- */
213
- var $from = '';
 
 
 
214
 
215
- /**
216
- * Variable needed to manage string-in-strings, for example url("foo.png")
217
- * @var string
218
- * @access private
219
- */
220
- var $str_in_str = false;
 
 
 
 
221
 
222
- /**
223
- * =true if in invalid at-rule
224
- * @var bool
225
- * @access private
226
- */
227
- var $invalid_at = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
 
229
- /**
230
- * =true if something has been added to the current selector
231
- * @var bool
232
- * @access private
233
- */
234
- var $added = false;
235
 
236
- /**
237
- * Array which saves the message log
238
- * @var array
239
- * @access private
240
- */
241
- var $log = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
 
243
- /**
244
- * Saves the line number
245
- * @var integer
246
- * @access private
247
- */
248
- var $line = 1;
249
 
250
- /**
251
- * Loads standard template and sets default settings
252
- * @access private
253
- * @version 1.3
254
- */
255
- function __construct()
256
- {
257
- $this->settings['remove_bslash'] = true;
258
- $this->settings['compress_colors'] = true;
259
- $this->settings['compress_font-weight'] = true;
260
- $this->settings['lowercase_s'] = false;
261
- $this->settings['optimise_shorthands'] = 1;
262
- $this->settings['remove_last_;'] = false;
263
- $this->settings['case_properties'] = 1;
264
- $this->settings['sort_properties'] = false;
265
- $this->settings['sort_selectors'] = false;
266
- $this->settings['merge_selectors'] = 2;
267
- $this->settings['discard_invalid_properties'] = false;
268
- $this->settings['css_level'] = 'CSS2.1';
269
- $this->settings['preserve_css'] = false;
270
- $this->settings['timestamp'] = false;
271
-
272
- $this->load_template('default');
273
- $this->print = new csstidy_print($this);
274
- $this->optimise = new csstidy_optimise($this);
275
- }
276
 
277
- /**
278
- * Get the value of a setting.
279
- * @param string $setting
280
- * @access public
281
- * @return mixed
282
- * @version 1.0
283
- */
284
- function get_cfg($setting)
285
- {
286
- if(isset($this->settings[$setting]))
287
- {
288
- return $this->settings[$setting];
289
- }
290
- return false;
291
- }
292
 
293
- /**
294
- * Set the value of a setting.
295
- * @param string $setting
296
- * @param mixed $value
297
- * @access public
298
- * @return bool
299
- * @version 1.0
300
- */
301
- function set_cfg($setting,$value)
302
- {
303
- if(isset($this->settings[$setting]) && $value !== '')
304
- {
305
- $this->settings[$setting] = $value;
306
- return true;
307
  }
308
- return false;
309
- }
310
 
311
- /**
312
- * Adds a token to $this->tokens
313
- * @param mixed $type
314
- * @param string $data
315
- * @param bool $do add a token even if preserve_css is off
316
- * @access private
317
- * @version 1.0
318
- */
319
- function _add_token($type, $data, $do = false) {
320
- if($this->get_cfg('preserve_css') || $do) {
321
- $this->tokens[] = array($type, ($type == COMMENT) ? $data : trim($data));
322
- }
323
- }
324
 
325
- /**
326
- * Add a message to the message log
327
- * @param string $message
328
- * @param string $type
329
- * @param integer $line
330
- * @access private
331
- * @version 1.0
332
- */
333
- function log($message,$type,$line = -1)
334
- {
335
- if($line === -1)
336
- {
337
- $line = $this->line;
338
- }
339
- $line = intval($line);
340
- $add = array('m' => $message, 't' => $type);
341
- if(!isset($this->log[$line]) || !in_array($add,$this->log[$line]))
342
- {
343
- $this->log[$line][] = $add;
 
 
 
 
 
344
  }
345
- }
346
-
347
- /**
348
- * Parse unicode notations and find a replacement character
349
- * @param string $string
350
- * @param integer $i
351
- * @access private
352
- * @return string
353
- * @version 1.2
354
- */
355
- function _unicode(&$string, &$i)
356
- {
357
- ++$i;
358
- $add = '';
359
- $tokens =& $GLOBALS['csstidy']['tokens'];
360
- $replaced = false;
361
 
362
- while($i < strlen($string) && (ctype_xdigit($string{$i}) || ctype_space($string{$i})) && strlen($add) < 6)
363
- {
364
- $add .= $string{$i};
365
-
366
- if(ctype_space($string{$i})) {
367
- break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
368
  }
369
- $i++;
370
  }
371
 
372
- if(hexdec($add) > 47 && hexdec($add) < 58 || hexdec($add) > 64 && hexdec($add) < 91 || hexdec($add) > 96 && hexdec($add) < 123)
373
- {
374
- $this->log('Replaced unicode notation: Changed \\'. $add .' to ' . chr(hexdec($add)),'Information');
375
- $add = chr(hexdec($add));
376
- $replaced = true;
377
- }
378
- else {
379
- $add = trim('\\'.$add);
 
 
380
  }
381
 
382
- if(@ctype_xdigit($string{$i+1}) && ctype_space($string{$i})
383
- && !$replaced || !ctype_space($string{$i})) {
384
- $i--;
385
- }
 
 
 
 
 
 
 
 
 
386
 
387
- if($add != '\\' || !$this->get_cfg('remove_bslash') || strpos($tokens, $string{$i+1}) !== false) {
388
- return $add;
 
 
 
 
 
 
389
  }
390
 
391
- if($add == '\\') {
392
- $this->log('Removed unnecessary backslash','Information');
393
- }
394
- return '';
395
- }
 
 
 
 
 
 
 
 
396
 
397
- /**
398
- * Loads a new template
399
- * @param string $content either filename (if $from_file == true), content of a template file, "high_compression", "highest_compression", "low_compression", or "default"
400
- * @param bool $from_file uses $content as filename if true
401
- * @access public
402
- * @version 1.1
403
- * @see http://csstidy.sourceforge.net/templates.php
404
- */
405
- function load_template($content, $from_file=true)
406
- {
407
- $predefined_templates =& $GLOBALS['csstidy']['predefined_templates'];
408
- if($content == 'high_compression' || $content == 'default' || $content == 'highest_compression' || $content == 'low_compression')
409
- {
410
- $this->template = $predefined_templates[$content];
411
- return;
 
412
  }
413
 
414
- if($from_file)
415
- {
416
- $content = strip_tags(file_get_contents($content),'<span>');
417
- }
418
- $content = str_replace("\r\n","\n",$content); // Unify newlines (because the output also only uses \n)
419
- $template = explode('|',$content);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
420
 
421
- for ($i = 0; $i < count($template); $i++ )
422
- {
423
- $this->template[$i] = $template[$i];
424
  }
425
- }
426
-
427
- /**
428
- * Starts parsing from URL
429
- * @param string $url
430
- * @access public
431
- * @version 1.0
432
- */
433
- function parse_from_url($url)
434
- {
435
- return $this->parse(@file_get_contents($url));
436
- }
437
-
438
- /**
439
- * Checks if there is a token at the current position
440
- * @param string $string
441
- * @param integer $i
442
- * @access public
443
- * @version 1.11
444
- */
445
- function is_token(&$string, $i)
446
- {
447
- $tokens =& $GLOBALS['csstidy']['tokens'];
448
- return (strpos($tokens, $string{$i}) !== false && !csstidy::escaped($string,$i));
449
- }
450
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
451
 
452
- /**
453
- * Parses CSS in $string. The code is saved as array in $this->css
454
- * @param string $string the CSS code
455
- * @access public
456
- * @return bool
457
- * @version 1.1
458
- */
459
- function parse($string) {
460
- // PHP bug? Settings need to be refreshed in PHP4
461
- $this->print = new csstidy_print($this);
462
- $this->optimise = new csstidy_optimise($this);
463
-
464
- $all_properties =& $GLOBALS['csstidy']['all_properties'];
465
- $at_rules =& $GLOBALS['csstidy']['at_rules'];
466
-
467
- $this->css = array();
468
- $this->print->input_css = $string;
469
- $string = str_replace("\r\n","\n",$string) . ' ';
470
- $cur_comment = '';
471
-
472
- for ($i = 0, $size = strlen($string); $i < $size; $i++ )
473
- {
474
- if($string{$i} == "\n" || $string{$i} == "\r")
475
- {
476
- ++$this->line;
477
- }
478
-
479
- switch($this->status)
480
- {
481
- /* Case in at-block */
482
- case 'at':
483
- if(csstidy::is_token($string,$i))
484
- {
485
- if($string{$i} == '/' && @$string{$i+1} == '*')
486
- {
487
- $this->status = 'ic'; ++$i;
488
- $this->from = 'at';
489
- }
490
- elseif($string{$i} == '{')
491
- {
492
- $this->status = 'is';
493
- $this->_add_token(AT_START, $this->at);
494
- }
495
- elseif($string{$i} == ',')
496
- {
497
- $this->at = trim($this->at).',';
498
- }
499
- elseif($string{$i} == '\\')
500
- {
501
- $this->at .= $this->_unicode($string,$i);
502
- }
503
- }
504
- else
505
- {
506
- $lastpos = strlen($this->at)-1;
507
- if(!( (ctype_space($this->at{$lastpos}) || csstidy::is_token($this->at,$lastpos) && $this->at{$lastpos} == ',') && ctype_space($string{$i})))
508
- {
509
- $this->at .= $string{$i};
510
- }
511
- }
512
- break;
513
-
514
- /* Case in-selector */
515
- case 'is':
516
- if(csstidy::is_token($string,$i))
517
- {
518
- if($string{$i} == '/' && @$string{$i+1} == '*' && trim($this->selector) == '')
519
- {
520
- $this->status = 'ic'; ++$i;
521
- $this->from = 'is';
522
- }
523
- elseif($string{$i} == '@' && trim($this->selector) == '')
524
- {
525
- // Check for at-rule
526
- $this->invalid_at = true;
527
- foreach($at_rules as $name => $type)
528
- {
529
- if(!strcasecmp(substr($string,$i+1,strlen($name)),$name))
530
- {
531
- ($type == 'at') ? $this->at = '@'.$name : $this->selector = '@'.$name;
532
- $this->status = $type;
533
- $i += strlen($name);
534
- $this->invalid_at = false;
535
- }
536
- }
537
-
538
- if($this->invalid_at)
539
- {
540
- $this->selector = '@';
541
- $invalid_at_name = '';
542
- for($j = $i+1; $j < $size; ++$j)
543
- {
544
- if(!ctype_alpha($string{$j}))
545
- {
546
- break;
547
- }
548
- $invalid_at_name .= $string{$j};
549
- }
550
- $this->log('Invalid @-rule: '.$invalid_at_name.' (removed)','Warning');
551
- }
552
- }
553
- elseif(($string{$i} == '"' || $string{$i} == "'"))
554
- {
555
- $this->cur_string = $string{$i};
556
- $this->status = 'instr';
557
- $this->str_char = $string{$i};
558
- $this->from = 'is';
559
- }
560
- elseif($this->invalid_at && $string{$i} == ';')
561
- {
562
- $this->invalid_at = false;
563
- $this->status = 'is';
564
- }
565
- elseif($string{$i} == '{')
566
- {
567
- $this->status = 'ip';
568
- $this->_add_token(SEL_START, $this->selector);
569
- $this->added = false;
570
- }
571
- elseif($string{$i} == '}')
572
- {
573
- $this->_add_token(AT_END, $this->at);
574
- $this->at = '';
575
- $this->selector = '';
576
- $this->sel_separate = array();
577
- }
578
- elseif($string{$i} == ',')
579
- {
580
- $this->selector = trim($this->selector).',';
581
- $this->sel_separate[] = strlen($this->selector);
582
- }
583
- elseif($string{$i} == '\\')
584
- {
585
- $this->selector .= $this->_unicode($string,$i);
586
- }
587
- // remove unnecessary universal selector, FS#147
588
- else if(!($string{$i} == '*' && @in_array($string{$i+1}, array('.', '#', '[', ':')))) {
589
- $this->selector .= $string{$i};
590
- }
591
- }
592
- else
593
- {
594
- $lastpos = strlen($this->selector)-1;
595
- if($lastpos == -1 || !( (ctype_space($this->selector{$lastpos}) || csstidy::is_token($this->selector,$lastpos) && $this->selector{$lastpos} == ',') && ctype_space($string{$i})))
596
- {
597
- $this->selector .= $string{$i};
598
- }
599
- }
600
- break;
601
-
602
- /* Case in-property */
603
- case 'ip':
604
- if(csstidy::is_token($string,$i))
605
- {
606
- if(($string{$i} == ':' || $string{$i} == '=') && $this->property != '')
607
- {
608
- $this->status = 'iv';
609
- if(!$this->get_cfg('discard_invalid_properties') || csstidy::property_is_valid($this->property)) {
610
- $this->_add_token(PROPERTY, $this->property);
611
- }
612
- }
613
- elseif($string{$i} == '/' && @$string{$i+1} == '*' && $this->property == '')
614
- {
615
- $this->status = 'ic'; ++$i;
616
- $this->from = 'ip';
617
- }
618
- elseif($string{$i} == '}')
619
- {
620
- $this->explode_selectors();
621
- $this->status = 'is';
622
- $this->invalid_at = false;
623
- $this->_add_token(SEL_END, $this->selector);
624
- $this->selector = '';
625
- $this->property = '';
626
- }
627
- elseif($string{$i} == ';')
628
- {
629
- $this->property = '';
630
- }
631
- elseif($string{$i} == '\\')
632
- {
633
- $this->property .= $this->_unicode($string,$i);
634
- }
635
- }
636
- elseif(!ctype_space($string{$i}))
637
- {
638
- $this->property .= $string{$i};
639
- }
640
- break;
641
-
642
- /* Case in-value */
643
- case 'iv':
644
- $pn = (($string{$i} == "\n" || $string{$i} == "\r") && $this->property_is_next($string,$i+1) || $i == strlen($string)-1);
645
- if(csstidy::is_token($string,$i) || $pn)
646
- {
647
- if($string{$i} == '/' && @$string{$i+1} == '*')
648
- {
649
- $this->status = 'ic'; ++$i;
650
- $this->from = 'iv';
651
- }
652
- elseif(($string{$i} == '"' || $string{$i} == "'" || $string{$i} == '('))
653
- {
654
- $this->cur_string = $string{$i};
655
- $this->str_char = ($string{$i} == '(') ? ')' : $string{$i};
656
- $this->status = 'instr';
657
- $this->from = 'iv';
658
- }
659
- elseif($string{$i} == ',')
660
- {
661
- $this->sub_value = trim($this->sub_value).',';
662
- }
663
- elseif($string{$i} == '\\')
664
- {
665
- $this->sub_value .= $this->_unicode($string,$i);
666
- }
667
- elseif($string{$i} == ';' || $pn)
668
- {
669
- if($this->selector{0} == '@' && isset($at_rules[substr($this->selector,1)]) && $at_rules[substr($this->selector,1)] == 'iv')
670
- {
671
- $this->sub_value_arr[] = trim($this->sub_value);
672
-
673
- $this->status = 'is';
674
-
675
- switch($this->selector)
676
- {
677
- case '@charset': $this->charset = $this->sub_value_arr[0]; break;
678
- case '@namespace': $this->namespace = implode(' ',$this->sub_value_arr); break;
679
- case '@import': $this->import[] = implode(' ',$this->sub_value_arr); break;
680
- }
681
-
682
- $this->sub_value_arr = array();
683
- $this->sub_value = '';
684
- $this->selector = '';
685
- $this->sel_separate = array();
686
- }
687
- else
688
- {
689
- $this->status = 'ip';
690
- }
691
- }
692
- elseif($string{$i} != '}')
693
- {
694
- $this->sub_value .= $string{$i};
695
- }
696
- if(($string{$i} == '}' || $string{$i} == ';' || $pn) && !empty($this->selector))
697
- {
698
- if($this->at == '')
699
- {
700
- $this->at = DEFAULT_AT;
701
- }
702
-
703
- // case settings
704
- if($this->get_cfg('lowercase_s'))
705
- {
706
- $this->selector = strtolower($this->selector);
707
- }
708
- $this->property = strtolower($this->property);
709
-
710
- $this->optimise->subvalue();
711
- if($this->sub_value != '') {
712
- $this->sub_value_arr[] = $this->sub_value;
713
- $this->sub_value = '';
714
- }
715
-
716
- $this->value = implode(' ',$this->sub_value_arr);
717
-
718
- $this->selector = trim($this->selector);
719
-
720
- $this->optimise->value();
721
-
722
- $valid = csstidy::property_is_valid($this->property);
723
- if((!$this->invalid_at || $this->get_cfg('preserve_css')) && (!$this->get_cfg('discard_invalid_properties') || $valid))
724
- {
725
- $this->css_add_property($this->at,$this->selector,$this->property,$this->value);
726
- $this->_add_token(VALUE, $this->value);
727
- $this->optimise->shorthands();
728
- }
729
- if(!$valid)
730
- {
731
- if($this->get_cfg('discard_invalid_properties'))
732
- {
733
- $this->log('Removed invalid property: '.$this->property,'Warning');
734
- }
735
- else
736
- {
737
- $this->log('Invalid property in '.strtoupper($this->get_cfg('css_level')).': '.$this->property,'Warning');
738
- }
739
- }
740
-
741
- $this->property = '';
742
- $this->sub_value_arr = array();
743
- $this->value = '';
744
- }
745
- if($string{$i} == '}')
746
- {
747
- $this->explode_selectors();
748
- $this->_add_token(SEL_END, $this->selector);
749
- $this->status = 'is';
750
- $this->invalid_at = false;
751
- $this->selector = '';
752
- }
753
- }
754
- elseif(!$pn)
755
- {
756
- $this->sub_value .= $string{$i};
757
-
758
- if(ctype_space($string{$i}))
759
- {
760
- $this->optimise->subvalue();
761
- if($this->sub_value != '') {
762
- $this->sub_value_arr[] = $this->sub_value;
763
- $this->sub_value = '';
764
- }
765
- }
766
- }
767
- break;
768
-
769
- /* Case in string */
770
- case 'instr':
771
- if($this->str_char == ')' && ($string{$i} == '"' || $string{$i} == '\'') && !$this->str_in_str && !csstidy::escaped($string,$i))
772
- {
773
- $this->str_in_str = true;
774
- }
775
- elseif($this->str_char == ')' && ($string{$i} == '"' || $string{$i} == '\'') && $this->str_in_str && !csstidy::escaped($string,$i))
776
- {
777
- $this->str_in_str = false;
778
- }
779
- $temp_add = $string{$i}; // ...and no not-escaped backslash at the previous position
780
- if( ($string{$i} == "\n" || $string{$i} == "\r") && !($string{$i-1} == '\\' && !csstidy::escaped($string,$i-1)) )
781
- {
782
- $temp_add = "\\A ";
783
- $this->log('Fixed incorrect newline in string','Warning');
784
- }
785
- if (!($this->str_char == ')' && in_array($string{$i}, $GLOBALS['csstidy']['whitespace']) && !$this->str_in_str)) {
786
- $this->cur_string .= $temp_add;
787
- }
788
- if($string{$i} == $this->str_char && !csstidy::escaped($string,$i) && !$this->str_in_str)
789
- {
790
- $this->status = $this->from;
791
- if (!preg_match('|[' . implode('', $GLOBALS['csstidy']['whitespace']) . ']|uis', $this->cur_string) && $this->property != 'content') {
792
- if ($this->str_char == '"' || $this->str_char == '\'') {
793
- $this->cur_string = substr($this->cur_string, 1, -1);
794
- } else if (strlen($this->cur_string) > 3 && ($this->cur_string[1] == '"' || $this->cur_string[1] == '\'')) /* () */ {
795
- $this->cur_string = $this->cur_string[0] . substr($this->cur_string, 2, -2) . substr($this->cur_string, -1);
796
- }
797
- }
798
- if($this->from == 'iv')
799
- {
800
- $this->sub_value .= $this->cur_string;
801
- }
802
- elseif($this->from == 'is')
803
- {
804
- $this->selector .= $this->cur_string;
805
- }
806
- }
807
- break;
808
-
809
- /* Case in-comment */
810
- case 'ic':
811
- if($string{$i} == '*' && $string{$i+1} == '/')
812
- {
813
- $this->status = $this->from;
814
- $i++;
815
- $this->_add_token(COMMENT, $cur_comment);
816
- $cur_comment = '';
817
- }
818
- else
819
- {
820
- $cur_comment .= $string{$i};
821
- }
822
- break;
823
- }
824
- }
825
-
826
- $this->optimise->postparse();
827
-
828
- $this->print->_reset();
829
-
830
- return !(empty($this->css) && empty($this->import) && empty($this->charset) && empty($this->tokens) && empty($this->namespace));
831
- }
832
-
833
- /**
834
- * Explodes selectors
835
- * @access private
836
- * @version 1.0
837
- */
838
- function explode_selectors()
839
- {
840
- // Explode multiple selectors
841
- if($this->get_cfg('merge_selectors') == 1)
842
- {
843
- $new_sels = array();
844
- $lastpos = 0;
845
- $this->sel_separate[] = strlen($this->selector);
846
- foreach($this->sel_separate as $num => $pos)
847
- {
848
- if($num == count($this->sel_separate)-1) {
849
- $pos += 1;
850
- }
851
-
852
- $new_sels[] = substr($this->selector,$lastpos,$pos-$lastpos-1);
853
- $lastpos = $pos;
854
- }
855
-
856
- if(count($new_sels) > 1)
857
- {
858
- foreach($new_sels as $selector)
859
- {
860
- $this->merge_css_blocks($this->at,$selector,$this->css[$this->at][$this->selector]);
861
- }
862
- unset($this->css[$this->at][$this->selector]);
863
- }
864
- }
865
- $this->sel_separate = array();
866
- }
867
-
868
- /**
869
- * Checks if a character is escaped (and returns true if it is)
870
- * @param string $string
871
- * @param integer $pos
872
- * @access public
873
- * @return bool
874
- * @version 1.02
875
- */
876
- static function escaped(&$string,$pos)
877
- {
878
- return !(@($string{$pos-1} != '\\') || csstidy::escaped($string,$pos-1));
879
- }
880
 
881
- /**
882
- * Adds a property with value to the existing CSS code
883
- * @param string $media
884
- * @param string $selector
885
- * @param string $property
886
- * @param string $new_val
887
- * @access private
888
- * @version 1.2
889
- */
890
- function css_add_property($media,$selector,$property,$new_val)
891
- {
892
- if($this->get_cfg('preserve_css') || trim($new_val) == '') {
893
- return;
894
- }
895
-
896
- $this->added = true;
897
- if(isset($this->css[$media][$selector][$property]))
898
- {
899
- if((csstidy::is_important($this->css[$media][$selector][$property]) && csstidy::is_important($new_val)) || !csstidy::is_important($this->css[$media][$selector][$property]))
900
- {
901
- unset($this->css[$media][$selector][$property]);
902
- $this->css[$media][$selector][$property] = trim($new_val);
903
- }
904
- }
905
- else
906
- {
907
- $this->css[$media][$selector][$property] = trim($new_val);
908
- }
909
- }
910
 
911
- /**
912
- * Adds CSS to an existing media/selector
913
- * @param string $media
914
- * @param string $selector
915
- * @param array $css_add
916
- * @access private
917
- * @version 1.1
918
- */
919
- function merge_css_blocks($media,$selector,$css_add)
920
- {
921
- foreach($css_add as $property => $value)
922
- {
923
- $this->css_add_property($media,$selector,$property,$value,false);
924
  }
925
- }
926
 
927
- /**
928
- * Checks if $value is !important.
929
- * @param string $value
930
- * @return bool
931
- * @access public
932
- * @version 1.0
933
- */
934
- static function is_important(&$value)
935
- {
936
- return (!strcasecmp(substr(str_replace($GLOBALS['csstidy']['whitespace'],'',$value),-10,10),'!important'));
937
- }
 
938
 
939
- /**
940
- * Returns a value without !important
941
- * @param string $value
942
- * @return string
943
- * @access public
944
- * @version 1.0
945
- */
946
- static function gvw_important($value)
947
- {
948
- if(csstidy::is_important($value))
949
- {
950
- $value = trim($value);
951
- $value = substr($value,0,-9);
952
- $value = trim($value);
953
- $value = substr($value,0,-1);
954
- $value = trim($value);
955
  return $value;
956
  }
957
- return $value;
958
- }
959
 
960
- /**
961
- * Checks if the next word in a string from pos is a CSS property
962
- * @param string $istring
963
- * @param integer $pos
964
- * @return bool
965
- * @access private
966
- * @version 1.2
967
- */
968
- function property_is_next($istring, $pos)
969
- {
970
- $all_properties =& $GLOBALS['csstidy']['all_properties'];
971
- $istring = substr($istring,$pos,strlen($istring)-$pos);
972
- $pos = strpos($istring,':');
973
- if($pos === false)
974
- {
 
 
 
 
 
975
  return false;
976
  }
977
- $istring = strtolower(trim(substr($istring,0,$pos)));
978
- if(isset($all_properties[$istring]))
979
- {
980
- $this->log('Added semicolon to the end of declaration','Warning');
981
- return true;
 
 
 
 
 
 
 
982
  }
983
- return false;
984
- }
985
 
986
- /**
987
- * Checks if a property is valid
988
- * @param string $property
989
- * @return bool;
990
- * @access public
991
- * @version 1.0
992
- */
993
- function property_is_valid($property) {
994
- $all_properties =& $GLOBALS['csstidy']['all_properties'];
995
- return (isset($all_properties[$property]) && strpos($all_properties[$property],strtoupper($this->get_cfg('css_level'))) !== false );
996
- }
 
 
 
 
 
 
997
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
998
  }
1
  <?php
2
+
3
  /**
4
  * CSSTidy - CSS Parser and Optimiser
5
  *
6
  * CSS Parser class
7
  *
8
+ * Copyright 2005, 2006, 2007 Florian Schmitz
9
+ *
10
  * This file is part of CSSTidy.
11
  *
12
+ * CSSTidy is free software; you can redistribute it and/or modify
13
+ * it under the terms of the GNU Lesser General Public License as published by
14
+ * the Free Software Foundation; either version 2.1 of the License, or
15
+ * (at your option) any later version.
16
  *
17
+ * CSSTidy is distributed in the hope that it will be useful,
18
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
+ * GNU Lesser General Public License for more details.
21
  *
22
+ * You should have received a copy of the GNU Lesser General Public License
23
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
 
24
  *
25
+ * @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License
26
  * @package csstidy
27
+ * @author Florian Schmitz (floele at gmail dot com) 2005-2007
28
+ * @author Brett Zamir (brettz9 at yahoo dot com) 2007
29
+ * @author Nikolay Matsievsky (speed at webo dot name) 2009-2010
30
+ * @author Cedric Morin (cedric at yterium dot com) 2010-2012
31
+ * @author Christopher Finke (cfinke at gmail.com) 2012
32
+ * @author Mark Scherer (remove $GLOBALS once and for all + PHP5.4 comp) 2012
33
  */
34
 
35
  /**
36
+ * Defines ctype functions if required.
37
  *
38
+ * @TODO: Make these methods of CSSTidy.
39
+ * @since 1.0.0
40
  */
41
+ if (!function_exists('ctype_space')){
42
+ /* ctype_space Check for whitespace character(s) */
43
+ function ctype_space($text){
44
+ return (1===preg_match("/^[ \r\n\t\f]+$/", $text));
45
+ }
46
+ }
47
+ if (!function_exists('ctype_alpha')){
48
+ /* ctype_alpha Check for alphabetic character(s) */
49
+ function ctype_alpha($text){
50
+ return (1===preg_match('/^[a-zA-Z]+$/', $text));
51
+ }
52
+ }
53
+ if (!function_exists('ctype_xdigit')){
54
+ /* ctype_xdigit Check for HEX character(s) */
55
+ function ctype_xdigit($text){
56
+ return (1===preg_match('/^[a-fA-F0-9]+$/', $text));
57
+ }
58
+ }
59
+
60
+ /**
61
+ * Defines constants
62
+ * @todo //TODO: make them class constants of csstidy
63
+ */
64
+ define('AT_START', 1);
65
+ define('AT_END', 2);
66
+ define('SEL_START', 3);
67
+ define('SEL_END', 4);
68
+ define('PROPERTY', 5);
69
+ define('VALUE', 6);
70
+ define('COMMENT', 7);
71
+ define('DEFAULT_AT', 41);
72
 
73
  /**
74
  * Contains a class for printing CSS code
94
  * An online version should be available here: http://cdburnerxp.se/cssparse/css_optimiser.php
95
  * @package csstidy
96
  * @author Florian Schmitz (floele at gmail dot com) 2005-2006
97
+ * @version 1.5.5
98
  */
99
  class csstidy {
100
 
101
+ /**
102
+ * Saves the parsed CSS. This array is empty if preserve_css is on.
103
+ * @var array
104
+ * @access public
105
+ */
106
+ public $css = array();
107
+ /**
108
+ * Saves the parsed CSS (raw)
109
+ * @var array
110
+ * @access private
111
+ */
112
+ public $tokens = array();
113
+ /**
114
+ * Printer class
115
+ * @see csstidy_print
116
+ * @var object
117
+ * @access public
118
+ */
119
+ public $print;
120
+ /**
121
+ * Optimiser class
122
+ * @see csstidy_optimise
123
+ * @var object
124
+ * @access private
125
+ */
126
+ public $optimise;
127
+ /**
128
+ * Saves the CSS charset (@charset)
129
+ * @var string
130
+ * @access private
131
+ */
132
+ public $charset = '';
133
+ /**
134
+ * Saves all @import URLs
135
+ * @var array
136
+ * @access private
137
+ */
138
+ public $import = array();
139
+ /**
140
+ * Saves the namespace
141
+ * @var string
142
+ * @access private
143
+ */
144
+ public $namespace = '';
145
+ /**
146
+ * Contains the version of csstidy
147
+ * @var string
148
+ * @access private
149
+ */
150
+ public $version = '1.5.5';
151
+ /**
152
+ * Stores the settings
153
+ * @var array
154
+ * @access private
155
+ */
156
+ public $settings = array();
157
+ /**
158
+ * Saves the parser-status.
159
+ *
160
+ * Possible values:
161
+ * - is = in selector
162
+ * - ip = in property
163
+ * - iv = in value
164
+ * - instr = in string (started at " or ' or ( )
165
+ * - ic = in comment (ignore everything)
166
+ * - at = in @-block
167
+ *
168
+ * @var string
169
+ * @access private
170
+ */
171
+ public $status = 'is';
172
+ /**
173
+ * Saves the current at rule (@media)
174
+ * @var string
175
+ * @access private
176
+ */
177
+ public $at = '';
178
+ /**
179
+ * Saves the at rule for next selector (during @font-face or other @)
180
+ * @var string
181
+ * @access private
182
+ */
183
+ public $next_selector_at = '';
184
+
185
+ /**
186
+ * Saves the current selector
187
+ * @var string
188
+ * @access private
189
+ */
190
+ public $selector = '';
191
+ /**
192
+ * Saves the current property
193
+ * @var string
194
+ * @access private
195
+ */
196
+ public $property = '';
197
+ /**
198
+ * Saves the position of , in selectors
199
+ * @var array
200
+ * @access private
201
+ */
202
+ public $sel_separate = array();
203
+ /**
204
+ * Saves the current value
205
+ * @var string
206
+ * @access private
207
+ */
208
+ public $value = '';
209
+ /**
210
+ * Saves the current sub-value
211
+ *
212
+ * Example for a subvalue:
213
+ * background:url(foo.png) red no-repeat;
214
+ * "url(foo.png)", "red", and "no-repeat" are subvalues,
215
+ * seperated by whitespace
216
+ * @var string
217
+ * @access private
218
+ */
219
+ public $sub_value = '';
220
+ /**
221
+ * Array which saves all subvalues for a property.
222
+ * @var array
223
+ * @see sub_value
224
+ * @access private
225
+ */
226
+ public $sub_value_arr = array();
227
+ /**
228
+ * Saves the stack of characters that opened the current strings
229
+ * @var array
230
+ * @access private
231
+ */
232
+ public $str_char = array();
233
+ public $cur_string = array();
234
+ /**
235
+ * Status from which the parser switched to ic or instr
236
+ * @var array
237
+ * @access private
238
+ */
239
+ public $from = array();
240
+ /**
241
+ /**
242
+ * =true if in invalid at-rule
243
+ * @var bool
244
+ * @access private
245
+ */
246
+ public $invalid_at = false;
247
+ /**
248
+ * =true if something has been added to the current selector
249
+ * @var bool
250
+ * @access private
251
+ */
252
+ public $added = false;
253
+ /**
254
+ * Array which saves the message log
255
+ * @var array
256
+ * @access private
257
+ */
258
+ public $log = array();
259
+ /**
260
+ * Saves the line number
261
+ * @var integer
262
+ * @access private
263
+ */
264
+ public $line = 1;
265
+ /**
266
+ * Marks if we need to leave quotes for a string
267
+ * @var array
268
+ * @access private
269
+ */
270
+ public $quoted_string = array();
271
+
272
+ /**
273
+ * List of tokens
274
+ * @var string
275
+ */
276
+ public $tokens_list = "";
277
+
278
+ /**
279
+ * Various CSS Data for CSSTidy
280
+ * @var array
281
+ */
282
+ public $data = array();
283
+
284
+ /**
285
+ * Loads standard template and sets default settings
286
+ * @access private
287
+ * @version 1.3
288
+ */
289
+ public function __construct() {
290
+ $data = array();
291
+ include('data.inc.php');
292
+ $this->data = $data;
293
+
294
+ $this->settings['remove_bslash'] = true;
295
+ $this->settings['compress_colors'] = true;
296
+ $this->settings['compress_font-weight'] = true;
297
+ $this->settings['lowercase_s'] = false;
298
+ /*
299
+ 1 common shorthands optimization
300
+ 2 + font property optimization
301
+ 3 + background property optimization
302
+ */
303
+ $this->settings['optimise_shorthands'] = 1;
304
+ $this->settings['remove_last_;'] = true;
305
+ $this->settings['space_before_important'] = false;
306
+ /* rewrite all properties with low case, better for later gzip OK, safe*/
307
+ $this->settings['case_properties'] = 1;
308
+ /* sort properties in alpabetic order, better for later gzip
309
+ * but can cause trouble in case of overiding same propertie or using hack
310
+ */
311
+ $this->settings['sort_properties'] = false;
312
+ /*
313
+ 1, 3, 5, etc -- enable sorting selectors inside @media: a{}b{}c{}
314
+ 2, 5, 8, etc -- enable sorting selectors inside one CSS declaration: a,b,c{}
315
+ preserve order by default cause it can break functionnality
316
+ */
317
+ $this->settings['sort_selectors'] = false;
318
+ /* is dangeroues to be used: CSS is broken sometimes */
319
+ $this->settings['merge_selectors'] = 0;
320
+ /* preserve or not browser hacks */
321
+ $this->settings['discard_invalid_selectors'] = false;
322
+ $this->settings['discard_invalid_properties'] = false;
323
+ $this->settings['css_level'] = 'CSS3.0';
324
+ $this->settings['preserve_css'] = false;
325
+ $this->settings['timestamp'] = false;
326
+ $this->settings['template'] = ''; // say that propertie exist
327
+ $this->set_cfg('template','default'); // call load_template
328
+ $this->optimise = new csstidy_optimise($this);
329
+
330
+ $this->tokens_list = & $this->data['csstidy']['tokens'];
331
+ }
332
 
333
+ /**
334
+ * Get the value of a setting.
335
+ * @param string $setting
336
+ * @access public
337
+ * @return mixed
338
+ * @version 1.0
339
+ */
340
+ public function get_cfg($setting) {
341
+ if (isset($this->settings[$setting])) {
342
+ return $this->settings[$setting];
343
+ }
344
+ return false;
345
+ }
346
 
347
+ /**
348
+ * Load a template
349
+ * @param string $template used by set_cfg to load a template via a configuration setting
350
+ * @access private
351
+ * @version 1.4
352
+ */
353
+ public function _load_template($template) {
354
+ switch ($template) {
355
+ case 'default':
356
+ $this->load_template('default');
357
+ break;
358
+
359
+ case 'highest':
360
+ $this->load_template('highest_compression');
361
+ break;
362
+
363
+ case 'high':
364
+ $this->load_template('high_compression');
365
+ break;
366
+
367
+ case 'low':
368
+ $this->load_template('low_compression');
369
+ break;
370
+
371
+ default:
372
+ $this->load_template($template);
373
+ break;
374
+ }
375
+ }
376
 
377
+ /**
378
+ * Set the value of a setting.
379
+ * @param string $setting
380
+ * @param mixed $value
381
+ * @access public
382
+ * @return bool
383
+ * @version 1.0
384
+ */
385
+ public function set_cfg($setting, $value=null) {
386
+ if (is_array($setting) && $value === null) {
387
+ foreach ($setting as $setprop => $setval) {
388
+ $this->settings[$setprop] = $setval;
389
+ }
390
+ if (array_key_exists('template', $setting)) {
391
+ $this->_load_template($this->settings['template']);
392
+ }
393
+ return true;
394
+ } elseif (isset($this->settings[$setting]) && $value !== '') {
395
+ $this->settings[$setting] = $value;
396
+ if ($setting === 'template') {
397
+ $this->_load_template($this->settings['template']);
398
+ }
399
+ return true;
400
+ }
401
+ return false;
402
+ }
403
 
404
+ /**
405
+ * Adds a token to $this->tokens
406
+ * @param mixed $type
407
+ * @param string $data
408
+ * @param bool $do add a token even if preserve_css is off
409
+ * @access private
410
+ * @version 1.0
411
+ */
412
+ public function _add_token($type, $data, $do = false) {
413
+ if ($this->get_cfg('preserve_css') || $do) {
414
+ $this->tokens[] = array($type, ($type == COMMENT) ? $data : trim($data));
415
+ }
416
+ }
417
 
418
+ /**
419
+ * Add a message to the message log
420
+ * @param string $message
421
+ * @param string $type
422
+ * @param integer $line
423
+ * @access private
424
+ * @version 1.0
425
+ */
426
+ public function log($message, $type, $line = -1) {
427
+ if ($line === -1) {
428
+ $line = $this->line;
429
+ }
430
+ $line = intval($line);
431
+ $add = array('m' => $message, 't' => $type);
432
+ if (!isset($this->log[$line]) || !in_array($add, $this->log[$line])) {
433
+ $this->log[$line][] = $add;
434
+ }
435
+ }
436
 
437
+ /**
438
+ * Parse unicode notations and find a replacement character
439
+ * @param string $string
440
+ * @param integer $i
441
+ * @access private
442
+ * @return string
443
+ * @version 1.2
444
+ */
445
+ public function _unicode(&$string, &$i) {
446
+ ++$i;
447
+ $add = '';
448
+ $replaced = false;
449
+
450
+ while ($i < strlen($string) && (ctype_xdigit($string{$i}) || ctype_space($string{$i})) && strlen($add) < 6) {
451
+ $add .= $string{$i};
452
+
453
+ if (ctype_space($string{$i})) {
454
+ break;
455
+ }
456
+ $i++;
457
+ }
458
 
459
+ if (hexdec($add) > 47 && hexdec($add) < 58 || hexdec($add) > 64 && hexdec($add) < 91 || hexdec($add) > 96 && hexdec($add) < 123) {
460
+ $this->log('Replaced unicode notation: Changed \\' . $add . ' to ' . chr(hexdec($add)), 'Information');
461
+ $add = chr(hexdec($add));
462
+ $replaced = true;
463
+ } else {
464
+ $add = trim('\\' . $add);
465
+ }
 
 
 
 
 
 
 
 
466
 
467
+ if (@ctype_xdigit($string{$i + 1}) && ctype_space($string{$i})
468
+ && !$replaced || !ctype_space($string{$i})) {
469
+ $i--;
470
+ }
471
 
472
+ if ($add !== '\\' || !$this->get_cfg('remove_bslash') || strpos($this->tokens_list, $string{$i + 1}) !== false) {
473
+ return $add;
474
+ }
 
 
 
475
 
476
+ if ($add === '\\') {
477
+ $this->log('Removed unnecessary backslash', 'Information');
478
+ }
479
+ return '';
480
+ }
 
481
 
482
+ /**
483
+ * Write formatted output to a file
484
+ * @param string $filename
485
+ * @param string $doctype when printing formatted, is a shorthand for the document type
486
+ * @param bool $externalcss when printing formatted, indicates whether styles to be attached internally or as an external stylesheet
487
+ * @param string $title when printing formatted, is the title to be added in the head of the document
488
+ * @param string $lang when printing formatted, gives a two-letter language code to be added to the output
489
+ * @access public
490
+ * @version 1.4
491
+ */
492
+ public function write_page($filename, $doctype='xhtml1.1', $externalcss=true, $title='', $lang='en') {
493
+ $this->write($filename, true);
494
+ }
495
 
496
+ /**
497
+ * Write plain output to a file
498
+ * @param string $filename
499
+ * @param bool $formatted whether to print formatted or not
500
+ * @param string $doctype when printing formatted, is a shorthand for the document type
501
+ * @param bool $externalcss when printing formatted, indicates whether styles to be attached internally or as an external stylesheet
502
+ * @param string $title when printing formatted, is the title to be added in the head of the document
503
+ * @param string $lang when printing formatted, gives a two-letter language code to be added to the output
504
+ * @param bool $pre_code whether to add pre and code tags around the code (for light HTML formatted templates)
505
+ * @access public
506
+ * @version 1.4
507
+ */
508
+ public function write($filename, $formatted=false, $doctype='xhtml1.1', $externalcss=true, $title='', $lang='en', $pre_code=true) {
509
+ $filename .= ( $formatted) ? '.xhtml' : '.css';
510
+
511
+ if (!is_dir('temp')) {
512
+ $madedir = mkdir('temp');
513
+ if (!$madedir) {
514
+ print 'Could not make directory "temp" in ' . dirname(__FILE__);
515
+ exit;
516
+ }
517
+ }
518
+ $handle = fopen('temp/' . $filename, 'w');
519
+ if ($handle) {
520
+ if (!$formatted) {
521
+ fwrite($handle, $this->print->plain());
522
+ } else {
523
+ fwrite($handle, $this->print->formatted_page($doctype, $externalcss, $title, $lang, $pre_code));
524
+ }
525
+ }
526
+ fclose($handle);
527
+ }
528
 
529
+ /**
530
+ * Loads a new template
531
+ * @param string $content either filename (if $from_file == true), content of a template file, "high_compression", "highest_compression", "low_compression", or "default"
532
+ * @param bool $from_file uses $content as filename if true
533
+ * @access public
534
+ * @version 1.1
535
+ * @see http://csstidy.sourceforge.net/templates.php
536
+ */
537
+ public function load_template($content, $from_file=true) {
538
+ $predefined_templates = & $this->data['csstidy']['predefined_templates'];
539
+ if ($content === 'high_compression' || $content === 'default' || $content === 'highest_compression' || $content === 'low_compression') {
540
+ $this->template = $predefined_templates[$content];
541
+ return;
542
+ }
543
 
 
 
 
 
 
 
 
 
 
 
 
544
 
545
+ if ($from_file) {
546
+ $content = strip_tags(file_get_contents($content), '<span>');
547
+ }
548
+ $content = str_replace("\r\n", "\n", $content); // Unify newlines (because the output also only uses \n)
549
+ $template = explode('|', $content);
 
 
550
 
551
+ for ($i = 0; $i < count($template); $i++) {
552
+ $this->template[$i] = $template[$i];
553
+ }
554
+ }
 
 
 
555
 
556
+ /**
557
+ * Starts parsing from URL
558
+ * @param string $url
559
+ * @access public
560
+ * @version 1.0
561
+ */
562
+ public function parse_from_url($url) {
563
+ return $this->parse(@file_get_contents($url));
564
+ }
565
 
566
+ /**
567
+ * Checks if there is a token at the current position
568
+ * @param string $string
569
+ * @param integer $i
570
+ * @access public
571
+ * @version 1.11
572
+ */
573
+ public function is_token(&$string, $i) {
574
+ return (strpos($this->tokens_list, $string{$i}) !== false && !$this->escaped($string, $i));
575
+ }
576
 
577
+ /**
578
+ * Parses CSS in $string. The code is saved as array in $this->css
579
+ * @param string $string the CSS code
580
+ * @access public
581
+ * @return bool
582
+ * @version 1.1
583
+ */
584
+ public function parse($string) {
585
+ // Temporarily set locale to en_US in order to handle floats properly
586
+ $old = @setlocale(LC_ALL, 0);
587
+ @setlocale(LC_ALL, 'C');
588
+
589
+ // PHP bug? Settings need to be refreshed in PHP4
590
+ $this->print = new csstidy_print($this);
591
+ $this->optimise = new csstidy_optimise($this);
592
+
593
+ $all_properties = & $this->data['csstidy']['all_properties'];
594
+ $at_rules = & $this->data['csstidy']['at_rules'];
595
+ $quoted_string_properties = & $this->data['csstidy']['quoted_string_properties'];
596
+
597
+ $this->css = array();
598
+ $this->print->input_css = $string;
599
+ $string = str_replace("\r\n", "\n", $string) . ' ';
600
+ $cur_comment = '';
601
+
602
+ for ($i = 0, $size = strlen($string); $i < $size; $i++) {
603
+ if ($string{$i} === "\n" || $string{$i} === "\r") {
604
+ ++$this->line;
605
+ }
606
+
607
+ switch ($this->status) {
608
+ /* Case in at-block */
609
+ case 'at':
610
+ if ($this->is_token($string, $i)) {
611
+ if ($string{$i} === '/' && @$string{$i + 1} === '*') {
612
+ $this->status = 'ic';
613
+ ++$i;
614
+ $this->from[] = 'at';
615
+ } elseif ($string{$i} === '{') {
616
+ $this->status = 'is';
617
+ $this->at = $this->css_new_media_section($this->at);
618
+ $this->_add_token(AT_START, $this->at);
619
+ } elseif ($string{$i} === ',') {
620
+ $this->at = trim($this->at) . ',';
621
+ } elseif ($string{$i} === '\\') {
622
+ $this->at .= $this->_unicode($string, $i);
623
+ }
624
+ // fix for complicated media, i.e @media screen and (-webkit-min-device-pixel-ratio:1.5)
625
+ elseif (in_array($string{$i}, array('(', ')', ':', '.', '/'))) {
626
+ $this->at .= $string{$i};
627
+ }
628
+ } else {
629
+ $lastpos = strlen($this->at) - 1;
630
+ if (!( (ctype_space($this->at{$lastpos}) || $this->is_token($this->at, $lastpos) && $this->at{$lastpos} === ',') && ctype_space($string{$i}))) {
631
+ $this->at .= $string{$i};
632
+ }
633
+ }
634
+ break;
635
+
636
+ /* Case in-selector */
637
+ case 'is':
638
+ if ($this->is_token($string, $i)) {
639
+ if ($string{$i} === '/' && @$string{$i + 1} === '*' && trim($this->selector) == '') {
640
+ $this->status = 'ic';
641
+ ++$i;
642
+ $this->from[] = 'is';
643
+ } elseif ($string{$i} === '@' && trim($this->selector) == '') {
644
+ // Check for at-rule
645
+ $this->invalid_at = true;
646
+ foreach ($at_rules as $name => $type) {
647
+ if (!strcasecmp(substr($string, $i + 1, strlen($name)), $name)) {
648
+ ($type === 'at') ? $this->at = '@' . $name : $this->selector = '@' . $name;
649
+ if ($type === 'atis') {
650
+ $this->next_selector_at = ($this->next_selector_at?$this->next_selector_at:($this->at?$this->at:DEFAULT_AT));
651
+ $this->at = $this->css_new_media_section(' ');
652
+ $type = 'is';
653
+ }
654
+ $this->status = $type;
655
+ $i += strlen($name);
656
+ $this->invalid_at = false;
657
+ }
658
+ }
659
+
660
+ if ($this->invalid_at) {
661
+ $this->selector = '@';
662
+ $invalid_at_name = '';
663
+ for ($j = $i + 1; $j < $size; ++$j) {
664
+ if (!ctype_alpha($string{$j})) {
665
+ break;
666
+ }
667
+ $invalid_at_name .= $string{$j};
668
+ }
669
+ $this->log('Invalid @-rule: ' . $invalid_at_name . ' (removed)', 'Warning');
670
+ }
671
+ } elseif (($string{$i} === '"' || $string{$i} === "'")) {
672
+ $this->cur_string[] = $string{$i};
673
+ $this->status = 'instr';
674
+ $this->str_char[] = $string{$i};
675
+ $this->from[] = 'is';
676
+ /* fixing CSS3 attribute selectors, i.e. a[href$=".mp3" */
677
+ $this->quoted_string[] = ($string{$i - 1} === '=' );
678
+ } elseif ($this->invalid_at && $string{$i} === ';') {
679
+ $this->invalid_at = false;
680
+ $this->status = 'is';
681
+ if ($this->next_selector_at) {
682
+ $this->at = $this->css_new_media_section($this->next_selector_at);
683
+ $this->next_selector_at = '';
684
+ }
685
+ } elseif ($string{$i} === '{') {
686
+ $this->status = 'ip';
687
+ if ($this->at == '') {
688
+ $this->at = $this->css_new_media_section(DEFAULT_AT);
689
+ }
690
+ $this->selector = $this->css_new_selector($this->at,$this->selector);
691
+ $this->_add_token(SEL_START, $this->selector);
692
+ $this->added = false;
693
+ } elseif ($string{$i} === '}') {
694
+ $this->_add_token(AT_END, $this->at);
695
+ $this->at = '';
696
+ $this->selector = '';
697
+ $this->sel_separate = array();
698
+ } elseif ($string{$i} === ',') {
699
+ $this->selector = trim($this->selector) . ',';
700
+ $this->sel_separate[] = strlen($this->selector);
701
+ } elseif ($string{$i} === '\\') {
702
+ $this->selector .= $this->_unicode($string, $i);
703
+ } elseif ($string{$i} === '*' && @in_array($string{$i + 1}, array('.', '#', '[', ':')) && ($i==0 OR $string{$i - 1}!=='/')) {
704
+ // remove unnecessary universal selector, FS#147, but not comment in selector
705
+ } else {
706
+ $this->selector .= $string{$i};
707
+ }
708
+ } else {
709
+ $lastpos = strlen($this->selector) - 1;
710
+ if ($lastpos == -1 || !( (ctype_space($this->selector{$lastpos}) || $this->is_token($this->selector, $lastpos) && $this->selector{$lastpos} === ',') && ctype_space($string{$i}))) {
711
+ $this->selector .= $string{$i};
712
+ }
713
+ }
714
+ break;
715
+
716
+ /* Case in-property */
717
+ case 'ip':
718
+ if ($this->is_token($string, $i)) {
719
+ if (($string{$i} === ':' || $string{$i} === '=') && $this->property != '') {
720
+ $this->status = 'iv';
721
+ if (!$this->get_cfg('discard_invalid_properties') || $this->property_is_valid($this->property)) {
722
+ $this->property = $this->css_new_property($this->at,$this->selector,$this->property);
723
+ $this->_add_token(PROPERTY, $this->property);
724
+ }
725
+ } elseif ($string{$i} === '/' && @$string{$i + 1} === '*' && $this->property == '') {
726
+ $this->status = 'ic';
727
+ ++$i;
728
+ $this->from[] = 'ip';
729
+ } elseif ($string{$i} === '}') {
730
+ $this->explode_selectors();
731
+ $this->status = 'is';
732
+ $this->invalid_at = false;
733
+ $this->_add_token(SEL_END, $this->selector);
734
+ $this->selector = '';
735
+ $this->property = '';
736
+ if ($this->next_selector_at) {
737
+ $this->at = $this->css_new_media_section($this->next_selector_at);
738
+ $this->next_selector_at = '';
739
+ }
740
+ } elseif ($string{$i} === ';') {
741
+ $this->property = '';
742
+ } elseif ($string{$i} === '\\') {
743
+ $this->property .= $this->_unicode($string, $i);
744
+ }
745
+ // else this is dumb IE a hack, keep it
746
+ // including //
747
+ elseif (($this->property === '' && !ctype_space($string{$i}))
748
+ || ($this->property === '/' || $string{$i} === '/')) {
749
+ $this->property .= $string{$i};
750
+ }
751
+ } elseif (!ctype_space($string{$i})) {
752
+ $this->property .= $string{$i};
753
+ }
754
+ break;
755
+
756
+ /* Case in-value */
757
+ case 'iv':
758
+ $pn = (($string{$i} === "\n" || $string{$i} === "\r") && $this->property_is_next($string, $i + 1) || $i == strlen($string) - 1);
759
+ if ($this->is_token($string, $i) || $pn) {
760
+ if ($string{$i} === '/' && @$string{$i + 1} === '*') {
761
+ $this->status = 'ic';
762
+ ++$i;
763
+ $this->from[] = 'iv';
764
+ } elseif (($string{$i} === '"' || $string{$i} === "'" || $string{$i} === '(')) {
765
+ $this->cur_string[] = $string{$i};
766
+ $this->str_char[] = ($string{$i} === '(') ? ')' : $string{$i};
767
+ $this->status = 'instr';
768
+ $this->from[] = 'iv';
769
+ $this->quoted_string[] = in_array(strtolower($this->property), $quoted_string_properties);
770
+ } elseif ($string{$i} === ',') {
771
+ $this->sub_value = trim($this->sub_value) . ',';
772
+ } elseif ($string{$i} === '\\') {
773
+ $this->sub_value .= $this->_unicode($string, $i);
774
+ } elseif ($string{$i} === ';' || $pn) {
775
+ if ($this->selector{0} === '@' && isset($at_rules[substr($this->selector, 1)]) && $at_rules[substr($this->selector, 1)] === 'iv') {
776
+ /* Add quotes to charset, import, namespace */
777
+ $this->sub_value_arr[] = trim($this->sub_value);
778
+
779
+ $this->status = 'is';
780
+
781
+ switch ($this->selector) {
782
+ case '@charset': $this->charset = '"'.$this->sub_value_arr[0].'"';
783
+ break;
784
+ case '@namespace': $this->namespace = implode(' ', $this->sub_value_arr);
785
+ break;
786
+ case '@import': $this->import[] = implode(' ', $this->sub_value_arr);
787
+ break;
788
+ }
789
+
790
+ $this->sub_value_arr = array();
791
+ $this->sub_value = '';
792
+ $this->selector = '';
793
+ $this->sel_separate = array();
794
+ } else {
795
+ $this->status = 'ip';
796
+ }
797
+ } elseif ($string{$i} !== '}') {
798
+ $this->sub_value .= $string{$i};
799
+ }
800
+ if (($string{$i} === '}' || $string{$i} === ';' || $pn) && !empty($this->selector)) {
801
+ if ($this->at == '') {
802
+ $this->at = $this->css_new_media_section(DEFAULT_AT);
803
+ }
804
+
805
+ // case settings
806
+ if ($this->get_cfg('lowercase_s')) {
807
+ $this->selector = strtolower($this->selector);
808
+ }
809
+ $this->property = strtolower($this->property);
810
+
811
+ $this->optimise->subvalue();
812
+ if ($this->sub_value != '') {
813
+ $this->sub_value_arr[] = $this->sub_value;
814
+ $this->sub_value = '';
815
+ }
816
+
817
+ $this->value = '';
818
+ while (count($this->sub_value_arr)) {
819
+ $sub = array_shift($this->sub_value_arr);
820
+ if (strstr($this->selector, 'font-face')) {
821
+ $sub = $this->quote_font_format($sub);
822
+ }
823
+
824
+ if ($sub != '')
825
+ $this->value .= ((!strlen($this->value) || substr($this->value,-1,1) === ',')?'':' ').$sub;
826
+ }
827
+
828
+ $this->optimise->value();
829
+
830
+ $valid = $this->property_is_valid($this->property);
831
+ if ((!$this->invalid_at || $this->get_cfg('preserve_css')) && (!$this->get_cfg('discard_invalid_properties') || $valid)) {
832
+ $this->css_add_property($this->at, $this->selector, $this->property, $this->value);
833
+ $this->_add_token(VALUE, $this->value);
834
+ $this->optimise->shorthands();
835
+ }
836
+ if (!$valid) {
837
+ if ($this->get_cfg('discard_invalid_properties')) {
838
+ $this->log('Removed invalid property: ' . $this->property, 'Warning');
839
+ } else {
840
+ $this->log('Invalid property in ' . strtoupper($this->get_cfg('css_level')) . ': ' . $this->property, 'Warning');
841
+ }
842
+ }
843
+
844
+ $this->property = '';
845
+ $this->sub_value_arr = array();
846
+ $this->value = '';
847
+ }
848
+ if ($string{$i} === '}') {
849
+ $this->explode_selectors();
850
+ $this->_add_token(SEL_END, $this->selector);
851
+ $this->status = 'is';
852
+ $this->invalid_at = false;
853
+ $this->selector = '';
854
+ if ($this->next_selector_at) {
855
+ $this->at = $this->css_new_media_section($this->next_selector_at);
856
+ $this->next_selector_at = '';
857
+ }
858
+ }
859
+ } elseif (!$pn) {
860
+ $this->sub_value .= $string{$i};
861
+
862
+ if (ctype_space($string{$i})) {
863
+ $this->optimise->subvalue();
864
+ if ($this->sub_value != '') {
865
+ $this->sub_value_arr[] = $this->sub_value;
866
+ $this->sub_value = '';
867
+ }
868
+ }
869
+ }
870
+ break;
871
+
872
+ /* Case in string */
873
+ case 'instr':
874
+ $_str_char = $this->str_char[count($this->str_char)-1];
875
+ $_cur_string = $this->cur_string[count($this->cur_string)-1];
876
+ $_quoted_string = $this->quoted_string[count($this->quoted_string)-1];
877
+ $temp_add = $string{$i};
878
+
879
+ // Add another string to the stack. Strings can't be nested inside of quotes, only parentheses, but
880
+ // parentheticals can be nested more than once.
881
+ if ($_str_char === ")" && ($string{$i} === "(" || $string{$i} === '"' || $string{$i} === '\'') && !$this->escaped($string, $i)) {
882
+ $this->cur_string[] = $string{$i};
883
+ $this->str_char[] = $string{$i} === '(' ? ')' : $string{$i};
884
+ $this->from[] = 'instr';
885
+ $this->quoted_string[] = ($_str_char === ')' && $string{$i} !== '(' && trim($_cur_string)==='(')?$_quoted_string:!($string{$i} === '(');
886
+ continue;
887
+ }
888
 
889
+ if ($_str_char !== ")" && ($string{$i} === "\n" || $string{$i} === "\r") && !($string{$i - 1} === '\\' && !$this->escaped($string, $i - 1))) {
890
+ $temp_add = "\\A";
891
+ $this->log('Fixed incorrect newline in string', 'Warning');
892
+ }
 
 
893
 
894
+ $_cur_string .= $temp_add;
895
+
896
+ if ($string{$i} === $_str_char && !$this->escaped($string, $i)) {
897
+ $this->status = array_pop($this->from);
898
+
899
+ if (!preg_match('|[' . implode('', $this->data['csstidy']['whitespace']) . ']|uis', $_cur_string) && $this->property !== 'content') {
900
+ if (!$_quoted_string) {
901
+ if ($_str_char !== ')') {
902
+ // Convert properties like
903
+ // font-family: 'Arial';
904
+ // to
905
+ // font-family: Arial;
906
+ // or
907
+ // url("abc")
908
+ // to
909
+ // url(abc)
910
+ $_cur_string = substr($_cur_string, 1, -1);
911
+ }
912
+ } else {
913
+ $_quoted_string = false;
914
+ }
915
+ }
916
+
917
+ array_pop($this->cur_string);
918
+ array_pop($this->quoted_string);
919
+ array_pop($this->str_char);
920
+
921
+ if ($_str_char === ')') {
922
+ $_cur_string = '(' . trim(substr($_cur_string, 1, -1)) . ')';
923
+ }
924
+
925
+ if ($this->status === 'iv') {
926
+ if (!$_quoted_string) {
927
+ if (strpos($_cur_string,',') !== false)
928
+ // we can on only remove space next to ','
929
+ $_cur_string = implode(',', array_map('trim', explode(',',$_cur_string)));
930
+ // and multiple spaces (too expensive)
931
+ if (strpos($_cur_string, ' ') !== false)
932
+ $_cur_string = preg_replace(",\s+,", ' ', $_cur_string);
933
+ }
934
+ $this->sub_value .= $_cur_string;
935
+ } elseif ($this->status === 'is') {
936
+ $this->selector .= $_cur_string;
937
+ } elseif ($this->status === 'instr') {
938
+ $this->cur_string[count($this->cur_string)-1] .= $_cur_string;
939
+ }
940
+ } else {
941
+ $this->cur_string[count($this->cur_string)-1] = $_cur_string;
942
+ }
943
+ break;
944
+
945
+ /* Case in-comment */
946
+ case 'ic':
947
+ if ($string{$i} === '*' && $string{$i + 1} === '/') {
948
+ $this->status = array_pop($this->from);
949
+ $i++;
950
+ $this->_add_token(COMMENT, $cur_comment);
951
+ $cur_comment = '';
952
+ } else {
953
+ $cur_comment .= $string{$i};
954
+ }
955
+ break;
956
+ }
957
+ }
958
 
959
+ $this->optimise->postparse();
 
 
 
 
 
960
 
961
+ $this->print->_reset();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
962
 
963
+ @setlocale(LC_ALL, $old); // Set locale back to original setting
 
 
 
 
 
 
 
 
 
 
 
 
 
 
964
 
965
+ return!(empty($this->css) && empty($this->import) && empty($this->charset) && empty($this->tokens) && empty($this->namespace));
 
 
 
 
 
 
 
 
 
 
 
 
 
966
  }
 
 
967
 
 
 
 
 
 
 
 
 
 
 
 
 
 
968
 
969
+ /**
970
+ * format() in font-face needs quoted values for somes browser (FF at least)
971
+ *
972
+ * @param $value
973
+ * @return string
974
+ */
975
+ public function quote_font_format($value) {
976
+ if (strncmp($value,'format',6) == 0) {
977
+ $p = strpos($value,')',7);
978
+ $end = substr($value,$p);
979
+ $format_strings = $this->parse_string_list(substr($value, 7, $p-7));
980
+ if (!$format_strings) {
981
+ $value = '';
982
+ } else {
983
+ $value = 'format(';
984
+
985
+ foreach ($format_strings as $format_string) {
986
+ $value .= '"' . str_replace('"', '\\"', $format_string) . '",';
987
+ }
988
+
989
+ $value = substr($value, 0, -1) . $end;
990
+ }
991
+ }
992
+ return $value;
993
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
994
 
995
+ /**
996
+ * Explodes selectors
997
+ * @access private
998
+ * @version 1.0
999
+ */
1000
+ public function explode_selectors() {
1001
+ // Explode multiple selectors
1002
+ if ($this->get_cfg('merge_selectors') === 1) {
1003
+ $new_sels = array();
1004
+ $lastpos = 0;
1005
+ $this->sel_separate[] = strlen($this->selector);
1006
+ foreach ($this->sel_separate as $num => $pos) {
1007
+ if ($num == count($this->sel_separate) - 1) {
1008
+ $pos += 1;
1009
+ }
1010
+
1011
+ $new_sels[] = substr($this->selector, $lastpos, $pos - $lastpos - 1);
1012
+ $lastpos = $pos;
1013
+ }
1014
+
1015
+ if (count($new_sels) > 1) {
1016
+ foreach ($new_sels as $selector) {
1017
+ if (isset($this->css[$this->at][$this->selector])) {
1018
+ $this->merge_css_blocks($this->at, $selector, $this->css[$this->at][$this->selector]);
1019
+ }
1020
+ }
1021
+ unset($this->css[$this->at][$this->selector]);
1022
+ }
1023
  }
1024
+ $this->sel_separate = array();
1025
  }
1026
 
1027
+ /**
1028
+ * Checks if a character is escaped (and returns true if it is)
1029
+ * @param string $string
1030
+ * @param integer $pos
1031
+ * @access public
1032
+ * @return bool
1033
+ * @version 1.02
1034
+ */
1035
+ static function escaped(&$string, $pos) {
1036
+ return!(@($string{$pos - 1} !== '\\') || csstidy::escaped($string, $pos - 1));
1037
  }
1038
 
1039
+ /**
1040
+ * Adds a property with value to the existing CSS code
1041
+ * @param string $media
1042
+ * @param string $selector
1043
+ * @param string $property
1044
+ * @param string $new_val
1045
+ * @access private
1046
+ * @version 1.2
1047
+ */
1048
+ public function css_add_property($media, $selector, $property, $new_val) {
1049
+ if ($this->get_cfg('preserve_css') || trim($new_val) == '') {
1050
+ return;
1051
+ }
1052
 
1053
+ $this->added = true;
1054
+ if (isset($this->css[$media][$selector][$property])) {
1055
+ if (($this->is_important($this->css[$media][$selector][$property]) && $this->is_important($new_val)) || !$this->is_important($this->css[$media][$selector][$property])) {
1056
+ $this->css[$media][$selector][$property] = trim($new_val);
1057
+ }
1058
+ } else {
1059
+ $this->css[$media][$selector][$property] = trim($new_val);
1060
+ }
1061
  }
1062
 
1063
+ /**
1064
+ * Start a new media section.
1065
+ * Check if the media is not already known,
1066
+ * else rename it with extra spaces
1067
+ * to avoid merging
1068
+ *
1069
+ * @param string $media
1070
+ * @return string
1071
+ */
1072
+ public function css_new_media_section($media) {
1073
+ if ($this->get_cfg('preserve_css')) {
1074
+ return $media;
1075
+ }
1076
 
1077
+ // if the last @media is the same as this
1078
+ // keep it
1079
+ if (!$this->css || !is_array($this->css) || empty($this->css)) {
1080
+ return $media;
1081
+ }
1082
+ end($this->css);
1083
+ list($at,) = each($this->css);
1084
+ if ($at == $media) {
1085
+ return $media;
1086
+ }
1087
+ while (isset($this->css[$media]))
1088
+ if (is_numeric($media))
1089
+ $media++;
1090
+ else
1091
+ $media .= ' ';
1092
+ return $media;
1093
  }
1094
 
1095
+ /**
1096
+ * Start a new selector.
1097
+ * If already referenced in this media section,
1098
+ * rename it with extra space to avoid merging
1099
+ * except if merging is required,
1100
+ * or last selector is the same (merge siblings)
1101
+ *
1102
+ * never merge @font-face
1103
+ *
1104
+ * @param string $media
1105
+ * @param string $selector
1106
+ * @return string
1107
+ */
1108
+ public function css_new_selector($media,$selector) {
1109
+ if ($this->get_cfg('preserve_css')) {
1110
+ return $selector;
1111
+ }
1112
+ $selector = trim($selector);
1113
+ if (strncmp($selector,'@font-face',10)!=0) {
1114
+ if ($this->settings['merge_selectors'] != false)
1115
+ return $selector;
1116
+
1117
+ if (!$this->css || !isset($this->css[$media]) || !$this->css[$media])
1118
+ return $selector;
1119
+
1120
+ // if last is the same, keep it
1121
+ end($this->css[$media]);
1122
+ list($sel,) = each($this->css[$media]);
1123
+ if ($sel == $selector) {
1124
+ return $selector;
1125
+ }
1126
+ }
1127
 
1128
+ while (isset($this->css[$media][$selector]))
1129
+ $selector .= ' ';
1130
+ return $selector;
1131
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1132
 
1133
+ /**
1134
+ * Start a new propertie.
1135
+ * If already references in this selector,
1136
+ * rename it with extra space to avoid override
1137
+ *
1138
+ * @param string $media
1139
+ * @param string $selector
1140
+ * @param string $property
1141
+ * @return string
1142
+ */
1143
+ public function css_new_property($media, $selector, $property) {
1144
+ if ($this->get_cfg('preserve_css')) {
1145
+ return $property;
1146
+ }
1147
+ if (!$this->css || !isset($this->css[$media][$selector]) || !$this->css[$media][$selector])
1148
+ return $property;
1149
 
1150
+ while (isset($this->css[$media][$selector][$property]))
1151
+ $property .= ' ';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1152
 
1153
+ return $property;
1154
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1155
 
1156
+ /**
1157
+ * Adds CSS to an existing media/selector
1158
+ * @param string $media
1159
+ * @param string $selector
1160
+ * @param array $css_add
1161
+ * @access private
1162
+ * @version 1.1
1163
+ */
1164
+ public function merge_css_blocks($media, $selector, $css_add) {
1165
+ foreach ($css_add as $property => $value) {
1166
+ $this->css_add_property($media, $selector, $property, $value, false);
1167
+ }
 
1168
  }
 
1169
 
1170
+ /**
1171
+ * Checks if $value is !important.
1172
+ * @param string $value
1173
+ * @return bool
1174
+ * @access public
1175
+ * @version 1.0
1176
+ */
1177
+ public function is_important(&$value) {
1178
+ return (
1179
+ strpos($value, '!') !== false // quick test
1180
+ AND !strcasecmp(substr(str_replace($this->data['csstidy']['whitespace'], '', $value), -10, 10), '!important'));
1181
+ }
1182
 
1183
+ /**
1184
+ * Returns a value without !important
1185
+ * @param string $value
1186
+ * @return string
1187
+ * @access public
1188
+ * @version 1.0
1189
+ */
1190
+ public function gvw_important($value) {
1191
+ if ($this->is_important($value)) {
1192
+ $value = trim($value);
1193
+ $value = substr($value, 0, -9);
1194
+ $value = trim($value);
1195
+ $value = substr($value, 0, -1);
1196
+ $value = trim($value);
1197
+ return $value;
1198
+ }
1199
  return $value;
1200
  }
 
 
1201
 
1202
+ /**
1203
+ * Checks if the next word in a string from pos is a CSS property
1204
+ * @param string $istring
1205
+ * @param integer $pos
1206
+ * @return bool
1207
+ * @access private
1208
+ * @version 1.2
1209
+ */
1210
+ public function property_is_next($istring, $pos) {
1211
+ $all_properties = & $this->data['csstidy']['all_properties'];
1212
+ $istring = substr($istring, $pos, strlen($istring) - $pos);
1213
+ $pos = strpos($istring, ':');
1214
+ if ($pos === false) {
1215
+ return false;
1216
+ }
1217
+ $istring = strtolower(trim(substr($istring, 0, $pos)));
1218
+ if (isset($all_properties[$istring])) {
1219
+ $this->log('Added semicolon to the end of declaration', 'Warning');
1220
+ return true;
1221
+ }
1222
  return false;
1223
  }
1224
+
1225
+ /**
1226
+ * Checks if a property is valid
1227
+ * @param string $property
1228
+ * @return bool;
1229
+ * @access public
1230
+ * @version 1.0
1231
+ */
1232
+ public function property_is_valid($property) {
1233
+ if (in_array(trim($property), $this->data['csstidy']['multiple_properties'])) $property = trim($property);
1234
+ $all_properties = & $this->data['csstidy']['all_properties'];
1235
+ return (isset($all_properties[$property]) && strpos($all_properties[$property], strtoupper($this->get_cfg('css_level'))) !== false );
1236
  }
 
 
1237
 
1238
+ /**
1239
+ * Accepts a list of strings (e.g., the argument to format() in a @font-face src property)
1240
+ * and returns a list of the strings. Converts things like:
1241
+ *
1242
+ * format(abc) => format("abc")
1243
+ * format(abc def) => format("abc","def")
1244
+ * format(abc "def") => format("abc","def")
1245
+ * format(abc, def, ghi) => format("abc","def","ghi")
1246
+ * format("abc",'def') => format("abc","def")
1247
+ * format("abc, def, ghi") => format("abc, def, ghi")
1248
+ *
1249
+ * @param string
1250
+ * @return array
1251
+ */
1252
+
1253
+ public function parse_string_list($value) {
1254
+ $value = trim($value);
1255
 
1256
+ // Case: empty
1257
+ if (!$value) return array();
1258
+
1259
+ $strings = array();
1260
+
1261
+ $in_str = false;
1262
+ $current_string = '';
1263
+
1264
+ for ($i = 0, $_len = strlen($value); $i < $_len; $i++) {
1265
+ if (($value{$i} === ',' || $value{$i} === ' ') && $in_str === true) {
1266
+ $in_str = false;
1267
+ $strings[] = $current_string;
1268
+ $current_string = '';
1269
+ } elseif ($value{$i} === '"' || $value{$i} === "'") {
1270
+ if ($in_str === $value{$i}) {
1271
+ $strings[] = $current_string;
1272
+ $in_str = false;
1273
+ $current_string = '';
1274
+ continue;
1275
+ } elseif (!$in_str) {
1276
+ $in_str = $value{$i};
1277
+ }
1278
+ } else {
1279
+ if ($in_str) {
1280
+ $current_string .= $value{$i};
1281
+ } else {
1282
+ if (!preg_match("/[\s,]/", $value{$i})) {
1283
+ $in_str = true;
1284
+ $current_string = $value{$i};
1285
+ }
1286
+ }
1287
+ }
1288
+ }
1289
+
1290
+ if ($current_string) {
1291
+ $strings[] = $current_string;
1292
+ }
1293
+
1294
+ return $strings;
1295
+ }
1296
  }
lib/CSSTidy/class.csstidy_optimise.php CHANGED
@@ -1,29 +1,34 @@
1
  <?php
 
2
  /**
3
  * CSSTidy - CSS Parser and Optimiser
4
  *
5
  * CSS Optimising Class
6
  * This class optimises CSS data generated by csstidy.
7
  *
 
 
8
  * This file is part of CSSTidy.
9
  *
10
- * CSSTidy is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License as published by
12
- * the Free Software Foundation; either version 2 of the License, or
13
- * (at your option) any later version.
14
  *
15
- * CSSTidy is distributed in the hope that it will be useful,
16
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
- * GNU General Public License for more details.
19
  *
20
- * You should have received a copy of the GNU General Public License
21
- * along with CSSTidy; if not, write to the Free Software
22
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23
  *
24
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
25
  * @package csstidy
26
- * @author Florian Schmitz (floele at gmail dot com) 2005-2006
 
 
 
27
  */
28
 
29
  /**
@@ -35,774 +40,924 @@
35
  * @author Florian Schmitz (floele at gmail dot com) 2005-2006
36
  * @version 1.0
37
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
- class csstidy_optimise
40
- {
41
- /**
42
- * Constructor
43
- * @param array $css contains the class csstidy
44
- * @access private
45
- * @version 1.0
46
- */
47
- function __construct(&$css)
48
- {
49
- $this->parser =& $css;
50
- $this->css =& $css->css;
51
- $this->sub_value =& $css->sub_value;
52
- $this->at =& $css->at;
53
- $this->selector =& $css->selector;
54
- $this->property =& $css->property;
55
- $this->value =& $css->value;
56
- }
57
-
58
- /**
59
- * Optimises $css after parsing
60
- * @access public
61
- * @version 1.0
62
- */
63
- function postparse()
64
- {
65
- if ($this->parser->get_cfg('preserve_css')) {
66
- return;
67
- }
68
-
69
- if ($this->parser->get_cfg('merge_selectors') == 2)
70
- {
71
- foreach ($this->css as $medium => $value)
72
- {
73
- $this->merge_selectors($this->css[$medium]);
74
- }
75
- }
76
-
77
- if ($this->parser->get_cfg('optimise_shorthands') > 0)
78
- {
79
- foreach ($this->css as $medium => $value)
80
- {
81
- foreach ($value as $selector => $value1)
82
- {
83
- $this->css[$medium][$selector] = csstidy_optimise::merge_4value_shorthands($this->css[$medium][$selector]);
84
-
85
- if ($this->parser->get_cfg('optimise_shorthands') < 2) {
86
- continue;
87
- }
88
-
89
- $this->css[$medium][$selector] = csstidy_optimise::merge_bg($this->css[$medium][$selector]);
90
- if (empty($this->css[$medium][$selector])) {
91
- unset($this->css[$medium][$selector]);
92
- }
93
- }
94
- }
95
- }
96
- }
97
-
98
- /**
99
- * Optimises values
100
- * @access public
101
- * @version 1.0
102
- */
103
- function value()
104
- {
105
- $shorthands =& $GLOBALS['csstidy']['shorthands'];
106
-
107
- // optimise shorthand properties
108
- if(isset($shorthands[$this->property]))
109
- {
110
- $temp = csstidy_optimise::shorthand($this->value); // FIXME - move
111
- if($temp != $this->value)
112
- {
113
- $this->parser->log('Optimised shorthand notation ('.$this->property.'): Changed "'.$this->value.'" to "'.$temp.'"','Information');
114
- }
115
- $this->value = $temp;
116
- }
117
-
118
- // Remove whitespace at ! important
119
- if($this->value != $this->compress_important($this->value))
120
- {
121
- $this->parser->log('Optimised !important','Information');
122
- }
123
- }
124
-
125
- /**
126
- * Optimises shorthands
127
- * @access public
128
- * @version 1.0
129
- */
130
- function shorthands()
131
- {
132
- $shorthands =& $GLOBALS['csstidy']['shorthands'];
133
-
134
- if(!$this->parser->get_cfg('optimise_shorthands') || $this->parser->get_cfg('preserve_css')) {
135
- return;
136
- }
137
-
138
- if($this->property == 'background' && $this->parser->get_cfg('optimise_shorthands') > 1)
139
- {
140
- unset($this->css[$this->at][$this->selector]['background']);
141
- $this->parser->merge_css_blocks($this->at,$this->selector,csstidy_optimise::dissolve_short_bg($this->value));
142
- }
143
- if(isset($shorthands[$this->property]))
144
- {
145
- $this->parser->merge_css_blocks($this->at,$this->selector,csstidy_optimise::dissolve_4value_shorthands($this->property,$this->value));
146
- if(is_array($shorthands[$this->property]))
147
- {
148
- unset($this->css[$this->at][$this->selector][$this->property]);
149
- }
150
- }
151
- }
152
-
153
- /**
154
- * Optimises a sub-value
155
- * @access public
156
- * @version 1.0
157
- */
158
- function subvalue()
159
- {
160
- $replace_colors =& $GLOBALS['csstidy']['replace_colors'];
161
-
162
- $this->sub_value = trim($this->sub_value);
163
- if($this->sub_value == '') // caution : '0'
164
- {
165
- return;
166
- }
167
-
168
- $important = '';
169
- if(csstidy::is_important($this->sub_value))
170
- {
171
- $important = '!important';
172
- }
173
- $this->sub_value = csstidy::gvw_important($this->sub_value);
174
-
175
- // Compress font-weight
176
- if($this->property == 'font-weight' && $this->parser->get_cfg('compress_font-weight'))
177
- {
178
- if($this->sub_value == 'bold')
179
- {
180
- $this->sub_value = '700';
181
- $this->parser->log('Optimised font-weight: Changed "bold" to "700"','Information');
182
- }
183
- else if($this->sub_value == 'normal')
184
- {
185
- $this->sub_value = '400';
186
- $this->parser->log('Optimised font-weight: Changed "normal" to "400"','Information');
187
- }
188
- }
189
-
190
- $temp = $this->compress_numbers($this->sub_value);
191
- if($temp != $this->sub_value)
192
- {
193
- if(strlen($temp) > strlen($this->sub_value)) {
194
- $this->parser->log('Fixed invalid number: Changed "'.$this->sub_value.'" to "'.$temp.'"','Warning');
195
- } else {
196
- $this->parser->log('Optimised number: Changed "'.$this->sub_value.'" to "'.$temp.'"','Information');
197
- }
198
- $this->sub_value = $temp;
199
- }
200
- if($this->parser->get_cfg('compress_colors'))
201
- {
202
- $temp = $this->cut_color($this->sub_value);
203
- if($temp !== $this->sub_value)
204
- {
205
- if(isset($replace_colors[$this->sub_value])) {
206
- $this->parser->log('Fixed invalid color name: Changed "'.$this->sub_value.'" to "'.$temp.'"','Warning');
207
- } else {
208
- $this->parser->log('Optimised color: Changed "'.$this->sub_value.'" to "'.$temp.'"','Information');
209
- }
210
- $this->sub_value = $temp;
211
- }
212
- }
213
- $this->sub_value .= $important;
214
- }
215
-
216
- /**
217
- * Compresses shorthand values. Example: margin:1px 1px 1px 1px -> margin:1px
218
- * @param string $value
219
- * @access public
220
- * @return string
221
- * @version 1.0
222
- */
223
- function shorthand($value)
224
- {
225
- $important = '';
226
- if(csstidy::is_important($value))
227
- {
228
- $values = csstidy::gvw_important($value);
229
- $important = '!important';
230
- }
231
- else $values = $value;
232
-
233
- $values = explode(' ',$values);
234
- switch(count($values))
235
- {
236
- case 4:
237
- if($values[0] == $values[1] && $values[0] == $values[2] && $values[0] == $values[3])
238
- {
239
- return $values[0].$important;
240
- }
241
- elseif($values[1] == $values[3] && $values[0] == $values[2])
242
- {
243
- return $values[0].' '.$values[1].$important;
244
- }
245
- elseif($values[1] == $values[3])
246
- {
247
- return $values[0].' '.$values[1].' '.$values[2].$important;
248
- }
249
- break;
250
-
251
- case 3:
252
- if($values[0] == $values[1] && $values[0] == $values[2])
253
- {
254
- return $values[0].$important;
255
- }
256
- elseif($values[0] == $values[2])
257
- {
258
- return $values[0].' '.$values[1].$important;
259
- }
260
- break;
261
-
262
- case 2:
263
- if($values[0] == $values[1])
264
- {
265
- return $values[0].$important;
266
- }
267
- break;
268
- }
269
-
270
- return $value;
271
- }
272
-
273
- /**
274
- * Removes unnecessary whitespace in ! important
275
- * @param string $string
276
- * @return string
277
- * @access public
278
- * @version 1.1
279
- */
280
- function compress_important(&$string)
281
- {
282
- if(csstidy::is_important($string))
283
- {
284
- $string = csstidy::gvw_important($string) . '!important';
285
- }
286
- return $string;
287
- }
288
-
289
- /**
290
- * Color compression function. Converts all rgb() values to #-values and uses the short-form if possible. Also replaces 4 color names by #-values.
291
- * @param string $color
292
- * @return string
293
- * @version 1.1
294
- */
295
- function cut_color($color)
296
- {
297
- $replace_colors =& $GLOBALS['csstidy']['replace_colors'];
298
-
299
- // rgb(0,0,0) -> #000000 (or #000 in this case later)
300
- if(strtolower(substr($color,0,4)) == 'rgb(')
301
- {
302
- $color_tmp = substr($color,4,strlen($color)-5);
303
- $color_tmp = explode(',',$color_tmp);
304
- for ( $i = 0; $i < count($color_tmp); $i++ )
305
- {
306
- $color_tmp[$i] = trim ($color_tmp[$i]);
307
- if(substr($color_tmp[$i],-1) == '%')
308
- {
309
- $color_tmp[$i] = round((255*$color_tmp[$i])/100);
310
- }
311
- if($color_tmp[$i]>255) $color_tmp[$i] = 255;
312
- }
313
- $color = '#';
314
- for ($i = 0; $i < 3; $i++ )
315
- {
316
- if($color_tmp[$i]<16) {
317
- $color .= '0' . dechex($color_tmp[$i]);
318
- } else {
319
- $color .= dechex($color_tmp[$i]);
320
- }
321
- }
322
- }
323
-
324
- // Fix bad color names
325
- if(isset($replace_colors[strtolower($color)]))
326
- {
327
- $color = $replace_colors[strtolower($color)];
328
- }
329
-
330
- // #aabbcc -> #abc
331
- if(strlen($color) == 7)
332
- {
333
- $color_temp = strtolower($color);
334
- if($color_temp{0} == '#' && $color_temp{1} == $color_temp{2} && $color_temp{3} == $color_temp{4} && $color_temp{5} == $color_temp{6})
335
- {
336
- $color = '#'.$color{1}.$color{3}.$color{5};
337
- }
338
- }
339
-
340
- switch(strtolower($color))
341
- {
342
- /* color name -> hex code */
343
- case 'black': return '#000';
344
- case 'fuchsia': return '#F0F';
345
- case 'white': return '#FFF';
346
- case 'yellow': return '#FF0';
347
-
348
- /* hex code -> color name */
349
- case '#800000': return 'maroon';
350
- case '#ffa500': return 'orange';
351
- case '#808000': return 'olive';
352
- case '#800080': return 'purple';
353
- case '#008000': return 'green';
354
- case '#000080': return 'navy';
355
- case '#008080': return 'teal';
356
- case '#c0c0c0': return 'silver';
357
- case '#808080': return 'gray';
358
- case '#f00': return 'red';
359
- }
360
-
361
- return $color;
362
- }
363
-
364
- /**
365
- * Compresses numbers (ie. 1.0 becomes 1 or 1.100 becomes 1.1 )
366
- * @param string $subvalue
367
- * @return string
368
- * @version 1.2
369
- */
370
- function compress_numbers($subvalue)
371
- {
372
- $units =& $GLOBALS['csstidy']['units'];
373
- $unit_values =& $GLOBALS['csstidy']['unit_values'];
374
- $color_values =& $GLOBALS['csstidy']['color_values'];
375
-
376
- // for font:1em/1em sans-serif...;
377
- if($this->property == 'font')
378
- {
379
- $temp = explode('/',$subvalue);
380
- }
381
- else
382
- {
383
- $temp = array($subvalue);
384
- }
385
- for ($l = 0; $l < count($temp); $l++)
386
- {
387
- // continue if no numeric value
388
- if (!(strlen($temp[$l]) > 0 && ( is_numeric($temp[$l]{0}) || $temp[$l]{0} == '+' || $temp[$l]{0} == '-' ) ))
389
- {
390
- continue;
391
- }
392
-
393
- // Fix bad colors
394
- if (in_array($this->property, $color_values))
395
- {
396
- $temp[$l] = '#'.$temp[$l];
397
- }
398
-
399
- if (floatval($temp[$l]) == 0)
400
- {
401
- $temp[$l] = '0';
402
- }
403
- else
404
- {
405
- $unit_found = FALSE;
406
- for ($m = 0, $size_4 = count($units); $m < $size_4; $m++)
407
- {
408
- if (strpos(strtolower($temp[$l]),$units[$m]) !== FALSE)
409
- {
410
- $temp[$l] = floatval($temp[$l]).$units[$m];
411
- $unit_found = TRUE;
412
- break;
413
- }
414
- }
415
- if (!$unit_found && in_array($this->property,$unit_values,TRUE))
416
- {
417
- $temp[$l] = floatval($temp[$l]).'px';
418
- }
419
- else if (!$unit_found)
420
- {
421
- $temp[$l] = floatval($temp[$l]);
422
- }
423
- // Remove leading zero
424
- if (abs(floatval($temp[$l])) < 1) {
425
- if (floatval($temp[$l]) < 0) {
426
- $temp[$l] = '-' . substr($temp[$l], 2);
427
- } else {
428
- $temp[$l] = substr($temp[$l], 1);
429
- }
430
- }
431
- }
432
- }
433
-
434
- return ((count($temp) > 1) ? $temp[0].'/'.$temp[1] : $temp[0]);
435
- }
436
-
437
- /**
438
- * Merges selectors with same properties. Example: a{color:red} b{color:red} -> a,b{color:red}
439
- * Very basic and has at least one bug. Hopefully there is a replacement soon.
440
- * @param array $array
441
- * @return array
442
- * @access public
443
- * @version 1.2
444
- */
445
- function merge_selectors(&$array)
446
- {
447
- $css = $array;
448
- foreach($css as $key => $value)
449
- {
450
- if(!isset($css[$key]))
451
- {
452
- continue;
453
- }
454
- $newsel = '';
455
-
456
- // Check if properties also exist in another selector
457
- $keys = array();
458
- // PHP bug (?) without $css = $array; here
459
- foreach($css as $selector => $vali)
460
- {
461
- if($selector == $key)
462
- {
463
- continue;
464
- }
465
-
466
- if($css[$key] === $vali)
467
- {
468
- $keys[] = $selector;
469
- }
470
- }
471
-
472
- if(!empty($keys))
473
- {
474
- $newsel = $key;
475
- unset($css[$key]);
476
- foreach($keys as $selector)
477
- {
478
- unset($css[$selector]);
479
- $newsel .= ','.$selector;
480
- }
481
- $css[$newsel] = $value;
482
- }
483
- }
484
- $array = $css;
485
- }
486
-
487
- /**
488
- * Dissolves properties like padding:10px 10px 10px to padding-top:10px;padding-bottom:10px;...
489
- * @param string $property
490
- * @param string $value
491
- * @return array
492
- * @version 1.0
493
- * @see merge_4value_shorthands()
494
- */
495
- function dissolve_4value_shorthands($property,$value)
496
- {
497
- $shorthands =& $GLOBALS['csstidy']['shorthands'];
498
- if(!is_array($shorthands[$property]))
499
- {
500
- $return[$property] = $value;
501
- return $return;
502
- }
503
-
504
- $important = '';
505
- if(csstidy::is_important($value))
506
- {
507
- $value = csstidy::gvw_important($value);
508
- $important = '!important';
509
- }
510
- $values = explode(' ',$value);
511
-
512
-
513
- $return = array();
514
- if(count($values) == 4)
515
- {
516
- for($i=0;$i<4;$i++)
517
- {
518
- $return[$shorthands[$property][$i]] = $values[$i].$important;
519
- }
520
- }
521
- elseif(count($values) == 3)
522
- {
523
- $return[$shorthands[$property][0]] = $values[0].$important;
524
- $return[$shorthands[$property][1]] = $values[1].$important;
525
- $return[$shorthands[$property][3]] = $values[1].$important;
526
- $return[$shorthands[$property][2]] = $values[2].$important;
527
- }
528
- elseif(count($values) == 2)
529
- {
530
- for($i=0;$i<4;$i++)
531
- {
532
- $return[$shorthands[$property][$i]] = (($i % 2 != 0)) ? $values[1].$important : $values[0].$important;
533
- }
534
- }
535
- else
536
- {
537
- for($i=0;$i<4;$i++)
538
- {
539
- $return[$shorthands[$property][$i]] = $values[0].$important;
540
- }
541
- }
542
-
543
- return $return;
544
- }
545
-
546
- /**
547
- * Explodes a string as explode() does, however, not if $sep is escaped or within a string.
548
- * @param string $sep seperator
549
- * @param string $string
550
- * @return array
551
- * @version 1.0
552
- */
553
- function explode_ws($sep,$string)
554
- {
555
- $status = 'st';
556
- $to = '';
557
-
558
- $output = array();
559
- $num = 0;
560
- for($i = 0, $len = strlen($string);$i < $len; $i++)
561
- {
562
- switch($status)
563
- {
564
- case 'st':
565
- if($string{$i} == $sep && !csstidy::escaped($string,$i))
566
- {
567
- ++$num;
568
- }
569
- elseif($string{$i} == '"' || $string{$i} == '\'' || $string{$i} == '(' && !csstidy::escaped($string,$i))
570
- {
571
- $status = 'str';
572
- $to = ($string{$i} == '(') ? ')' : $string{$i};
573
- (isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i};
574
- }
575
- else
576
- {
577
- (isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i};
578
- }
579
- break;
580
-
581
- case 'str':
582
- if($string{$i} == $to && !csstidy::escaped($string,$i))
583
- {
584
- $status = 'st';
585
- }
586
- (isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i};
587
- break;
588
- }
589
- }
590
-
591
- if(isset($output[0]))
592
- {
593
- return $output;
594
- }
595
- else
596
- {
597
- return array($output);
598
- }
599
- }
600
-
601
- /**
602
- * Merges Shorthand properties again, the opposite of dissolve_4value_shorthands()
603
- * @param array $array
604
- * @return array
605
- * @version 1.2
606
- * @see dissolve_4value_shorthands()
607
- */
608
- function merge_4value_shorthands($array)
609
- {
610
- $return = $array;
611
- $shorthands =& $GLOBALS['csstidy']['shorthands'];
612
-
613
- foreach($shorthands as $key => $value)
614
- {
615
- if(isset($array[$value[0]]) && isset($array[$value[1]])
616
- && isset($array[$value[2]]) && isset($array[$value[3]]) && $value !== 0)
617
- {
618
- $return[$key] = '';
619
-
620
- $important = '';
621
- for($i = 0; $i < 4; $i++)
622
- {
623
- $val = $array[$value[$i]];
624
- if(csstidy::is_important($val))
625
- {
626
- $important = '!important';
627
- $return[$key] .= csstidy::gvw_important($val).' ';
628
- }
629
- else
630
- {
631
- $return[$key] .= $val.' ';
632
- }
633
- unset($return[$value[$i]]);
634
- }
635
- $return[$key] = csstidy_optimise::shorthand(trim($return[$key].$important));
636
- }
637
- }
638
- return $return;
639
- }
640
-
641
- /**
642
- * Dissolve background property
643
- * @param string $str_value
644
- * @return array
645
- * @version 1.0
646
- * @see merge_bg()
647
- * @todo full CSS 3 compliance
648
- */
649
- function dissolve_short_bg($str_value)
650
- {
651
- $background_prop_default =& $GLOBALS['csstidy']['background_prop_default'];
652
- $repeat = array('repeat','repeat-x','repeat-y','no-repeat','space');
653
- $attachment = array('scroll','fixed','local');
654
- $clip = array('border','padding');
655
- $origin = array('border','padding','content');
656
- $pos = array('top','center','bottom','left','right');
657
- $important = '';
658
- $return = array('background-image' => NULL,'background-size' => NULL,'background-repeat' => NULL,'background-position' => NULL,'background-attachment'=>NULL,'background-clip' => NULL,'background-origin' => NULL,'background-color' => NULL);
659
-
660
- if(csstidy::is_important($str_value))
661
- {
662
- $important = ' !important';
663
- $str_value = csstidy::gvw_important($str_value);
664
- }
665
-
666
- $str_value = csstidy_optimise::explode_ws(',',$str_value);
667
- for($i = 0; $i < count($str_value); $i++)
668
- {
669
- $have['clip'] = FALSE; $have['pos'] = FALSE;
670
- $have['color'] = FALSE; $have['bg'] = FALSE;
671
-
672
- $str_value[$i] = csstidy_optimise::explode_ws(' ',trim($str_value[$i]));
673
-
674
- for($j = 0; $j < count($str_value[$i]); $j++)
675
- {
676
- if($have['bg'] === FALSE && (substr($str_value[$i][$j],0,4) == 'url(' || $str_value[$i][$j] === 'none'))
677
- {
678
- $return['background-image'] .= $str_value[$i][$j].',';
679
- $have['bg'] = TRUE;
680
- }
681
- elseif(in_array($str_value[$i][$j],$repeat,TRUE))
682
- {
683
- $return['background-repeat'] .= $str_value[$i][$j].',';
684
- }
685
- elseif(in_array($str_value[$i][$j],$attachment,TRUE))
686
- {
687
- $return['background-attachment'] .= $str_value[$i][$j].',';
688
- }
689
- elseif(in_array($str_value[$i][$j],$clip,TRUE) && !$have['clip'])
690
- {
691
- $return['background-clip'] .= $str_value[$i][$j].',';
692
- $have['clip'] = TRUE;
693
- }
694
- elseif(in_array($str_value[$i][$j],$origin,TRUE))
695
- {
696
- $return['background-origin'] .= $str_value[$i][$j].',';
697
- }
698
- elseif($str_value[$i][$j]{0} == '(')
699
- {
700
- $return['background-size'] .= substr($str_value[$i][$j],1,-1).',';
701
- }
702
- elseif(in_array($str_value[$i][$j],$pos,TRUE) || is_numeric($str_value[$i][$j]{0}) || $str_value[$i][$j]{0} === NULL)
703
- {
704
- $return['background-position'] .= $str_value[$i][$j];
705
- if(!$have['pos']) $return['background-position'] .= ' '; else $return['background-position'].= ',';
706
- $have['pos'] = TRUE;
707
- }
708
- elseif(!$have['color'])
709
- {
710
- $return['background-color'] .= $str_value[$i][$j].',';
711
- $have['color'] = TRUE;
712
- }
713
- }
714
- }
715
-
716
- foreach($background_prop_default as $bg_prop => $default_value)
717
- {
718
- if($return[$bg_prop] !== NULL)
719
- {
720
- $return[$bg_prop] = substr($return[$bg_prop],0,-1).$important;
721
- }
722
- else $return[$bg_prop] = $default_value.$important;
723
- }
724
- return $return;
725
- }
726
-
727
- /**
728
- * Merges all background properties
729
- * @param array $input_css
730
- * @return array
731
- * @version 1.0
732
- * @see dissolve_short_bg()
733
- * @todo full CSS 3 compliance
734
- */
735
- function merge_bg($input_css)
736
- {
737
- $background_prop_default =& $GLOBALS['csstidy']['background_prop_default'];
738
- // Max number of background images. CSS3 not yet fully implemented
739
- $number_of_values = @max(count(csstidy_optimise::explode_ws(',',$input_css['background-image'])),count(csstidy_optimise::explode_ws(',',$input_css['background-color'])),1);
740
- // Array with background images to check if BG image exists
741
- $bg_img_array = @csstidy_optimise::explode_ws(',',csstidy::gvw_important($input_css['background-image']));
742
- $new_bg_value = '';
743
- $important = '';
744
-
745
- for($i = 0; $i < $number_of_values; $i++)
746
- {
747
- foreach($background_prop_default as $bg_property => $default_value)
748
- {
749
- // Skip if property does not exist
750
- if(!isset($input_css[$bg_property]))
751
- {
752
- continue;
753
- }
754
-
755
- $cur_value = $input_css[$bg_property];
756
-
757
- // Skip some properties if there is no background image
758
- if((!isset($bg_img_array[$i]) || $bg_img_array[$i] === 'none')
759
- && ($bg_property === 'background-size' || $bg_property === 'background-position'
760
- || $bg_property === 'background-attachment' || $bg_property === 'background-repeat'))
761
- {
762
- continue;
763
- }
764
-
765
- // Remove !important
766
- if(csstidy::is_important($cur_value))
767
- {
768
- $important = ' !important';
769
- $cur_value = csstidy::gvw_important($cur_value);
770
- }
771
-
772
- // Do not add default values
773
- if($cur_value === $default_value)
774
- {
775
- continue;
776
- }
777
-
778
- $temp = csstidy_optimise::explode_ws(',',$cur_value);
779
-
780
- if(isset($temp[$i]))
781
- {
782
- if($bg_property == 'background-size')
783
- {
784
- $new_bg_value .= '('.$temp[$i].') ';
785
- }
786
- else
787
- {
788
- $new_bg_value .= $temp[$i].' ';
789
- }
790
- }
791
- }
792
-
793
- $new_bg_value = trim($new_bg_value);
794
- if($i != $number_of_values-1) $new_bg_value .= ',';
795
- }
796
-
797
- // Delete all background-properties
798
- foreach($background_prop_default as $bg_property => $default_value)
799
- {
800
- unset($input_css[$bg_property]);
801
- }
802
-
803
- // Add new background property
804
- if($new_bg_value !== '') $input_css['background'] = $new_bg_value.$important;
805
-
806
- return $input_css;
807
- }
808
  }
1
  <?php
2
+
3
  /**
4
  * CSSTidy - CSS Parser and Optimiser
5
  *
6
  * CSS Optimising Class
7
  * This class optimises CSS data generated by csstidy.
8
  *
9
+ * Copyright 2005, 2006, 2007 Florian Schmitz
10
+ *
11
  * This file is part of CSSTidy.
12
  *
13
+ * CSSTidy is free software; you can redistribute it and/or modify
14
+ * it under the terms of the GNU Lesser General Public License as published by
15
+ * the Free Software Foundation; either version 2.1 of the License, or
16
+ * (at your option) any later version.
17
  *
18
+ * CSSTidy is distributed in the hope that it will be useful,
19
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
+ * GNU Lesser General Public License for more details.
22
  *
23
+ * You should have received a copy of the GNU Lesser General Public License
24
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
 
25
  *
26
+ * @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License
27
  * @package csstidy
28
+ * @author Florian Schmitz (floele at gmail dot com) 2005-2007
29
+ * @author Brett Zamir (brettz9 at yahoo dot com) 2007
30
+ * @author Nikolay Matsievsky (speed at webo dot name) 2009-2010
31
+ * @author Cedric Morin (cedric at yterium dot com) 2010-2012
32
  */
33
 
34
  /**
40
  * @author Florian Schmitz (floele at gmail dot com) 2005-2006
41
  * @version 1.0
42
  */
43
+ class csstidy_optimise {
44
+
45
+ /**
46
+ * csstidy object
47
+ * @var object
48
+ */
49
+ public $parser;
50
+
51
+ /**
52
+ * Constructor
53
+ * @param array $css contains the class csstidy
54
+ * @access private
55
+ * @version 1.0
56
+ */
57
+ public function __construct($css) {
58
+ $this->parser = $css;
59
+ $this->css = & $css->css;
60
+ $this->sub_value = & $css->sub_value;
61
+ $this->at = & $css->at;
62
+ $this->selector = & $css->selector;
63
+ $this->property = & $css->property;
64
+ $this->value = & $css->value;
65
+ }
66
+
67
+ /**
68
+ * Optimises $css after parsing
69
+ * @access public
70
+ * @version 1.0
71
+ */
72
+ public function postparse() {
73
+ if ($this->parser->get_cfg('preserve_css')) {
74
+ return;
75
+ }
76
+
77
+ if ((int)$this->parser->get_cfg('merge_selectors') === 2) {
78
+ foreach ($this->css as $medium => $value) {
79
+ $this->merge_selectors($this->css[$medium]);
80
+ }
81
+ }
82
+
83
+ if ($this->parser->get_cfg('discard_invalid_selectors')) {
84
+ foreach ($this->css as $medium => $value) {
85
+ $this->discard_invalid_selectors($this->css[$medium]);
86
+ }
87
+ }
88
+
89
+ if ($this->parser->get_cfg('optimise_shorthands') > 0) {
90
+ foreach ($this->css as $medium => $value) {
91
+ foreach ($value as $selector => $value1) {
92
+ $this->css[$medium][$selector] = $this->merge_4value_shorthands($this->css[$medium][$selector]);
93
+
94
+ if ($this->parser->get_cfg('optimise_shorthands') < 2) {
95
+ continue;
96
+ }
97
+
98
+ $this->css[$medium][$selector] = $this->merge_font($this->css[$medium][$selector]);
99
+
100
+ if ($this->parser->get_cfg('optimise_shorthands') < 3) {
101
+ continue;
102
+ }
103
+
104
+ $this->css[$medium][$selector] = $this->merge_bg($this->css[$medium][$selector]);
105
+ if (empty($this->css[$medium][$selector])) {
106
+ unset($this->css[$medium][$selector]);
107
+ }
108
+ }
109
+ }
110
+ }
111
+ }
112
+
113
+ /**
114
+ * Optimises values
115
+ * @access public
116
+ * @version 1.0
117
+ */
118
+ public function value() {
119
+ $shorthands = & $this->parser->data['csstidy']['shorthands'];
120
+
121
+ // optimise shorthand properties
122
+ if (isset($shorthands[$this->property])) {
123
+ $temp = $this->shorthand($this->value); // FIXME - move
124
+ if ($temp != $this->value) {
125
+ $this->parser->log('Optimised shorthand notation (' . $this->property . '): Changed "' . $this->value . '" to "' . $temp . '"', 'Information');
126
+ }
127
+ $this->value = $temp;
128
+ }
129
+
130
+ // Remove whitespace at ! important
131
+ if ($this->value != $this->compress_important($this->value)) {
132
+ $this->parser->log('Optimised !important', 'Information');
133
+ }
134
+ }
135
+
136
+ /**
137
+ * Optimises shorthands
138
+ * @access public
139
+ * @version 1.0
140
+ */
141
+ public function shorthands() {
142
+ $shorthands = & $this->parser->data['csstidy']['shorthands'];
143
+
144
+ if (!$this->parser->get_cfg('optimise_shorthands') || $this->parser->get_cfg('preserve_css')) {
145
+ return;
146
+ }
147
+
148
+ if ($this->property === 'font' && $this->parser->get_cfg('optimise_shorthands') > 1) {
149
+ $this->css[$this->at][$this->selector]['font']='';
150
+ $this->parser->merge_css_blocks($this->at, $this->selector, $this->dissolve_short_font($this->value));
151
+ }
152
+ if ($this->property === 'background' && $this->parser->get_cfg('optimise_shorthands') > 2) {
153
+ $this->css[$this->at][$this->selector]['background']='';
154
+ $this->parser->merge_css_blocks($this->at, $this->selector, $this->dissolve_short_bg($this->value));
155
+ }
156
+ if (isset($shorthands[$this->property])) {
157
+ $this->parser->merge_css_blocks($this->at, $this->selector, $this->dissolve_4value_shorthands($this->property, $this->value));
158
+ if (is_array($shorthands[$this->property])) {
159
+ $this->css[$this->at][$this->selector][$this->property] = '';
160
+ }
161
+ }
162
+ }
163
+
164
+ /**
165
+ * Optimises a sub-value
166
+ * @access public
167
+ * @version 1.0
168
+ */
169
+ public function subvalue() {
170
+ $replace_colors = & $this->parser->data['csstidy']['replace_colors'];
171
+
172
+ $this->sub_value = trim($this->sub_value);
173
+ if ($this->sub_value == '') { // caution : '0'
174
+ return;
175
+ }
176
+
177
+ $important = '';
178
+ if ($this->parser->is_important($this->sub_value)) {
179
+ $important = '!important';
180
+ }
181
+ $this->sub_value = $this->parser->gvw_important($this->sub_value);
182
+
183
+ // Compress font-weight
184
+ if ($this->property === 'font-weight' && $this->parser->get_cfg('compress_font-weight')) {
185
+ if ($this->sub_value === 'bold') {
186
+ $this->sub_value = '700';
187
+ $this->parser->log('Optimised font-weight: Changed "bold" to "700"', 'Information');
188
+ } elseif ($this->sub_value === 'normal') {
189
+ $this->sub_value = '400';
190
+ $this->parser->log('Optimised font-weight: Changed "normal" to "400"', 'Information');
191
+ }
192
+ }
193
+
194
+ $temp = $this->compress_numbers($this->sub_value);
195
+ if (strcasecmp($temp, $this->sub_value) !== 0) {
196
+ if (strlen($temp) > strlen($this->sub_value)) {
197
+ $this->parser->log('Fixed invalid number: Changed "' . $this->sub_value . '" to "' . $temp . '"', 'Warning');
198
+ } else {
199
+ $this->parser->log('Optimised number: Changed "' . $this->sub_value . '" to "' . $temp . '"', 'Information');
200
+ }
201
+ $this->sub_value = $temp;
202
+ }
203
+ if ($this->parser->get_cfg('compress_colors')) {
204
+ $temp = $this->cut_color($this->sub_value);
205
+ if ($temp !== $this->sub_value) {
206
+ if (isset($replace_colors[$this->sub_value])) {
207
+ $this->parser->log('Fixed invalid color name: Changed "' . $this->sub_value . '" to "' . $temp . '"', 'Warning');
208
+ } else {
209
+ $this->parser->log('Optimised color: Changed "' . $this->sub_value . '" to "' . $temp . '"', 'Information');
210
+ }
211
+ $this->sub_value = $temp;
212
+ }
213
+ }
214
+ $this->sub_value .= $important;
215
+ }
216
+
217
+ /**
218
+ * Compresses shorthand values. Example: margin:1px 1px 1px 1px -> margin:1px
219
+ * @param string $value
220
+ * @access public
221
+ * @return string
222
+ * @version 1.0
223
+ */
224
+ public function shorthand($value) {
225
+ $important = '';
226
+ if ($this->parser->is_important($value)) {
227
+ $values = $this->parser->gvw_important($value);
228
+ $important = '!important';
229
+ }
230
+ else
231
+ $values = $value;
232
+
233
+ $values = explode(' ', $values);
234
+ switch (count($values)) {
235
+ case 4:
236
+ if ($values[0] == $values[1] && $values[0] == $values[2] && $values[0] == $values[3]) {
237
+ return $values[0] . $important;
238
+ } elseif ($values[1] == $values[3] && $values[0] == $values[2]) {
239
+ return $values[0] . ' ' . $values[1] . $important;
240
+ } elseif ($values[1] == $values[3]) {
241
+ return $values[0] . ' ' . $values[1] . ' ' . $values[2] . $important;
242
+ }
243
+ break;
244
+
245
+ case 3:
246
+ if ($values[0] == $values[1] && $values[0] == $values[2]) {
247
+ return $values[0] . $important;
248
+ } elseif ($values[0] == $values[2]) {
249
+ return $values[0] . ' ' . $values[1] . $important;
250
+ }
251
+ break;
252
+
253
+ case 2:
254
+ if ($values[0] == $values[1]) {
255
+ return $values[0] . $important;
256
+ }
257
+ break;
258
+ }
259
+
260
+ return $value;
261
+ }
262
+
263
+ /**
264
+ * Removes unnecessary whitespace in ! important
265
+ * @param string $string
266
+ * @return string
267
+ * @access public
268
+ * @version 1.1
269
+ */
270
+ public function compress_important(&$string) {
271
+ if ($this->parser->is_important($string)) {
272
+ $important = $this->parser->get_cfg('space_before_important') ? ' !important' : '!important';
273
+ $string = $this->parser->gvw_important($string) . $important;
274
+ }
275
+ return $string;
276
+ }
277
+
278
+ /**
279
+ * Color compression function. Converts all rgb() values to #-values and uses the short-form if possible. Also replaces 4 color names by #-values.
280
+ * @param string $color
281
+ * @return string
282
+ * @version 1.1
283
+ */
284
+ public function cut_color($color) {
285
+ $replace_colors = & $this->parser->data['csstidy']['replace_colors'];
286
+
287
+ // if it's a string, don't touch !
288
+ if (strncmp($color, "'", 1) == 0 || strncmp($color, '"', 1) == 0)
289
+ return $color;
290
+
291
+ /* expressions complexes de type gradient */
292
+ if (strpos($color, '(') !== false && strncmp($color, 'rgb(' ,4) != 0) {
293
+ // on ne touche pas aux couleurs dans les expression ms, c'est trop sensible
294
+ if (stripos($color, 'progid:') !== false)
295
+ return $color;
296
+ preg_match_all(",rgb\([^)]+\),i", $color, $matches, PREG_SET_ORDER);
297
+ if (count($matches)) {
298
+ foreach ($matches as $m) {
299
+ $color = str_replace($m[0], $this->cut_color($m[0]), $color);
300
+ }
301
+ }
302
+ preg_match_all(",#[0-9a-f]{6}(?=[^0-9a-f]),i", $color, $matches, PREG_SET_ORDER);
303
+ if (count($matches)) {
304
+ foreach ($matches as $m) {
305
+ $color = str_replace($m[0],$this->cut_color($m[0]), $color);
306
+ }
307
+ }
308
+ return $color;
309
+ }
310
+
311
+ // rgb(0,0,0) -> #000000 (or #000 in this case later)
312
+ if (strncasecmp($color, 'rgb(', 4)==0) {
313
+ $color_tmp = substr($color, 4, strlen($color) - 5);
314
+ $color_tmp = explode(',', $color_tmp);
315
+ for ($i = 0; $i < count($color_tmp); $i++) {
316
+ $color_tmp[$i] = trim($color_tmp[$i]);
317
+ if (substr($color_tmp[$i], -1) === '%') {
318
+ $color_tmp[$i] = round((255 * $color_tmp[$i]) / 100);
319
+ }
320
+ if ($color_tmp[$i] > 255)
321
+ $color_tmp[$i] = 255;
322
+ }
323
+ $color = '#';
324
+ for ($i = 0; $i < 3; $i++) {
325
+ if ($color_tmp[$i] < 16) {
326
+ $color .= '0' . dechex($color_tmp[$i]);
327
+ } else {
328
+ $color .= dechex($color_tmp[$i]);
329
+ }
330
+ }
331
+ }
332
+
333
+ // Fix bad color names
334
+ if (isset($replace_colors[strtolower($color)])) {
335
+ $color = $replace_colors[strtolower($color)];
336
+ }
337
+
338
+ // #aabbcc -> #abc
339
+ if (strlen($color) == 7) {
340
+ $color_temp = strtolower($color);
341
+ if ($color_temp{0} === '#' && $color_temp{1} == $color_temp{2} && $color_temp{3} == $color_temp{4} && $color_temp{5} == $color_temp{6}) {
342
+ $color = '#' . $color{1} . $color{3} . $color{5};
343
+ }
344
+ }
345
+
346
+ switch (strtolower($color)) {
347
+ /* color name -> hex code */
348
+ case 'black': return '#000';
349
+ case 'fuchsia': return '#f0f';
350
+ case 'white': return '#fff';
351
+ case 'yellow': return '#ff0';
352
+
353
+ /* hex code -> color name */
354
+ case '#800000': return 'maroon';
355
+ case '#ffa500': return 'orange';
356
+ case '#808000': return 'olive';
357
+ case '#800080': return 'purple';
358
+ case '#008000': return 'green';
359
+ case '#000080': return 'navy';
360
+ case '#008080': return 'teal';
361
+ case '#c0c0c0': return 'silver';
362
+ case '#808080': return 'gray';
363
+ case '#f00': return 'red';
364
+ }
365
+
366
+ return $color;
367
+ }
368
+
369
+ /**
370
+ * Compresses numbers (ie. 1.0 becomes 1 or 1.100 becomes 1.1 )
371
+ * @param string $subvalue
372
+ * @return string
373
+ * @version 1.2
374
+ */
375
+ public function compress_numbers($subvalue) {
376
+ $unit_values = & $this->parser->data['csstidy']['unit_values'];
377
+ $color_values = & $this->parser->data['csstidy']['color_values'];
378
+
379
+ // for font:1em/1em sans-serif...;
380
+ if ($this->property === 'font') {
381
+ $temp = explode('/', $subvalue);
382
+ } else {
383
+ $temp = array($subvalue);
384
+ }
385
+
386
+ for ($l = 0; $l < count($temp); $l++) {
387
+ // if we are not dealing with a number at this point, do not optimise anything
388
+ $number = $this->AnalyseCssNumber($temp[$l]);
389
+ if ($number === false) {
390
+ return $subvalue;
391
+ }
392
+
393
+ // Fix bad colors
394
+ if (in_array($this->property, $color_values)) {
395
+ $temp[$l] = '#' . $temp[$l];
396
+ continue;
397
+ }
398
+
399
+ if (abs($number[0]) > 0) {
400
+ if ($number[1] == '' && in_array($this->property, $unit_values, true)) {
401
+ $number[1] = 'px';
402
+ }
403
+ } elseif ($number[1] != 's' && $number[1] != 'ms') {
404
+ $number[1] = '';
405
+ }
406
+
407
+ $temp[$l] = $number[0] . $number[1];
408
+ }
409
+
410
+ return ((count($temp) > 1) ? $temp[0] . '/' . $temp[1] : $temp[0]);
411
+ }
412
+
413
+ /**
414
+ * Checks if a given string is a CSS valid number. If it is,
415
+ * an array containing the value and unit is returned
416
+ * @param string $string
417
+ * @return array ('unit' if unit is found or '' if no unit exists, number value) or false if no number
418
+ */
419
+ public function AnalyseCssNumber($string) {
420
+ // most simple checks first
421
+ if (strlen($string) == 0 || ctype_alpha($string{0})) {
422
+ return false;
423
+ }
424
+
425
+ $units = & $this->parser->data['csstidy']['units'];
426
+ $return = array(0, '');
427
+
428
+ $return[0] = floatval($string);
429
+ if (abs($return[0]) > 0 && abs($return[0]) < 1) {
430
+ if ($return[0] < 0) {
431
+ $return[0] = '-' . ltrim(substr($return[0], 1), '0');
432
+ } else {
433
+ $return[0] = ltrim($return[0], '0');
434
+ }
435
+ }
436
+
437
+ // Look for unit and split from value if exists
438
+ foreach ($units as $unit) {
439
+ $expectUnitAt = strlen($string) - strlen($unit);
440
+ if (!($unitInString = stristr($string, $unit))) { // mb_strpos() fails with "false"
441
+ continue;
442
+ }
443
+ $actualPosition = strpos($string, $unitInString);
444
+ if ($expectUnitAt === $actualPosition) {
445
+ $return[1] = $unit;
446
+ $string = substr($string, 0, - strlen($unit));
447
+ break;
448
+ }
449
+ }
450
+ if (!is_numeric($string)) {
451
+ return false;
452
+ }
453
+ return $return;
454
+ }
455
+
456
+ /**
457
+ * Merges selectors with same properties. Example: a{color:red} b{color:red} -> a,b{color:red}
458
+ * Very basic and has at least one bug. Hopefully there is a replacement soon.
459
+ * @param array $array
460
+ * @return array
461
+ * @access public
462
+ * @version 1.2
463
+ */
464
+ public function merge_selectors(&$array) {
465
+ $css = $array;
466
+ foreach ($css as $key => $value) {
467
+ if (!isset($css[$key])) {
468
+ continue;
469
+ }
470
+ $newsel = '';
471
+
472
+ // Check if properties also exist in another selector
473
+ $keys = array();
474
+ // PHP bug (?) without $css = $array; here
475
+ foreach ($css as $selector => $vali) {
476
+ if ($selector == $key) {
477
+ continue;
478
+ }
479
+
480
+ if ($css[$key] === $vali) {
481
+ $keys[] = $selector;
482
+ }
483
+ }
484
+
485
+ if (!empty($keys)) {
486
+ $newsel = $key;
487
+ unset($css[$key]);
488
+ foreach ($keys as $selector) {
489
+ unset($css[$selector]);
490
+ $newsel .= ',' . $selector;
491
+ }
492
+ $css[$newsel] = $value;
493
+ }
494
+ }
495
+ $array = $css;
496
+ }
497
+
498
+ /**
499
+ * Removes invalid selectors and their corresponding rule-sets as
500
+ * defined by 4.1.7 in REC-CSS2. This is a very rudimentary check
501
+ * and should be replaced by a full-blown parsing algorithm or
502
+ * regular expression
503
+ * @version 1.4
504
+ */
505
+ public function discard_invalid_selectors(&$array) {
506
+ $invalid = array('+' => true, '~' => true, ',' => true, '>' => true);
507
+ foreach ($array as $selector => $decls) {
508
+ $ok = true;
509
+ $selectors = array_map('trim', explode(',', $selector));
510
+ foreach ($selectors as $s) {
511
+ $simple_selectors = preg_split('/\s*[+>~\s]\s*/', $s);
512
+ foreach ($simple_selectors as $ss) {
513
+ if ($ss === '')
514
+ $ok = false;
515
+ // could also check $ss for internal structure,
516
+ // but that probably would be too slow
517
+ }
518
+ }
519
+ if (!$ok)
520
+ unset($array[$selector]);
521
+ }
522
+ }
523
+
524
+ /**
525
+ * Dissolves properties like padding:10px 10px 10px to padding-top:10px;padding-bottom:10px;...
526
+ * @param string $property
527
+ * @param string $value
528
+ * @return array
529
+ * @version 1.0
530
+ * @see merge_4value_shorthands()
531
+ */
532
+ public function dissolve_4value_shorthands($property, $value) {
533
+ $shorthands = & $this->parser->data['csstidy']['shorthands'];
534
+ if (!is_array($shorthands[$property])) {
535
+ $return[$property] = $value;
536
+ return $return;
537
+ }
538
+
539
+ $important = '';
540
+ if ($this->parser->is_important($value)) {
541
+ $value = $this->parser->gvw_important($value);
542
+ $important = '!important';
543
+ }
544
+ $values = explode(' ', $value);
545
+
546
+
547
+ $return = array();
548
+ if (count($values) == 4) {
549
+ for ($i = 0; $i < 4; $i++) {
550
+ $return[$shorthands[$property][$i]] = $values[$i] . $important;
551
+ }
552
+ } elseif (count($values) == 3) {
553
+ $return[$shorthands[$property][0]] = $values[0] . $important;
554
+ $return[$shorthands[$property][1]] = $values[1] . $important;
555
+ $return[$shorthands[$property][3]] = $values[1] . $important;
556
+ $return[$shorthands[$property][2]] = $values[2] . $important;
557
+ } elseif (count($values) == 2) {
558
+ for ($i = 0; $i < 4; $i++) {
559
+ $return[$shorthands[$property][$i]] = (($i % 2 != 0)) ? $values[1] . $important : $values[0] . $important;
560
+ }
561
+ } else {
562
+ for ($i = 0; $i < 4; $i++) {
563
+ $return[$shorthands[$property][$i]] = $values[0] . $important;
564
+ }
565
+ }
566
+
567
+ return $return;
568
+ }
569
+
570
+ /**
571
+ * Explodes a string as explode() does, however, not if $sep is escaped or within a string.
572
+ * @param string $sep seperator
573
+ * @param string $string
574
+ * @return array
575
+ * @version 1.0
576
+ */
577
+ public function explode_ws($sep, $string) {
578
+ $status = 'st';
579
+ $to = '';
580
+
581
+ $output = array();
582
+ $num = 0;
583
+ for ($i = 0, $len = strlen($string); $i < $len; $i++) {
584
+ switch ($status) {
585
+ case 'st':
586
+ if ($string{$i} == $sep && !$this->parser->escaped($string, $i)) {
587
+ ++$num;
588
+ } elseif ($string{$i} === '"' || $string{$i} === '\'' || $string{$i} === '(' && !$this->parser->escaped($string, $i)) {
589
+ $status = 'str';
590
+ $to = ($string{$i} === '(') ? ')' : $string{$i};
591
+ (isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i};
592
+ } else {
593
+ (isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i};
594
+ }
595
+ break;
596
+
597
+ case 'str':
598
+ if ($string{$i} == $to && !$this->parser->escaped($string, $i)) {
599
+ $status = 'st';
600
+ }
601
+ (isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i};
602
+ break;
603
+ }
604
+ }
605
+
606
+ if (isset($output[0])) {
607
+ return $output;
608
+ } else {
609
+ return array($output);
610
+ }
611
+ }
612
+
613
+ /**
614
+ * Merges Shorthand properties again, the opposite of dissolve_4value_shorthands()
615
+ * @param array $array
616
+ * @return array
617
+ * @version 1.2
618
+ * @see dissolve_4value_shorthands()
619
+ */
620
+ public function merge_4value_shorthands($array) {
621
+ $return = $array;
622
+ $shorthands = & $this->parser->data['csstidy']['shorthands'];
623
+
624
+ foreach ($shorthands as $key => $value) {
625
+ if (isset($array[$value[0]]) && isset($array[$value[1]])
626
+ && isset($array[$value[2]]) && isset($array[$value[3]]) && $value !== 0) {
627
+ $return[$key] = '';
628
+
629
+ $important = '';
630
+ for ($i = 0; $i < 4; $i++) {
631
+ $val = $array[$value[$i]];
632
+ if ($this->parser->is_important($val)) {
633
+ $important = '!important';
634
+ $return[$key] .= $this->parser->gvw_important($val) . ' ';
635
+ } else {
636
+ $return[$key] .= $val . ' ';
637
+ }
638
+ unset($return[$value[$i]]);
639
+ }
640
+ $return[$key] = $this->shorthand(trim($return[$key] . $important));
641
+ }
642
+ }
643
+ return $return;
644
+ }
645
+
646
+ /**
647
+ * Dissolve background property
648
+ * @param string $str_value
649
+ * @return array
650
+ * @version 1.0
651
+ * @see merge_bg()
652
+ * @todo full CSS 3 compliance
653
+ */
654
+ public function dissolve_short_bg($str_value) {
655
+ // don't try to explose background gradient !
656
+ if (stripos($str_value, 'gradient(')!== false)
657
+ return array('background'=>$str_value);
658
+
659
+ $background_prop_default = & $this->parser->data['csstidy']['background_prop_default'];
660
+ $repeat = array('repeat', 'repeat-x', 'repeat-y', 'no-repeat', 'space');
661
+ $attachment = array('scroll', 'fixed', 'local');
662
+ $clip = array('border', 'padding');
663
+ $origin = array('border', 'padding', 'content');
664
+ $pos = array('top', 'center', 'bottom', 'left', 'right');
665
+ $important = '';
666
+ $return = array('background-image' => null, 'background-size' => null, 'background-repeat' => null, 'background-position' => null, 'background-attachment' => null, 'background-clip' => null, 'background-origin' => null, 'background-color' => null);
667
+
668
+ if ($this->parser->is_important($str_value)) {
669
+ $important = ' !important';
670
+ $str_value = $this->parser->gvw_important($str_value);
671
+ }
672
+
673
+ $str_value = $this->explode_ws(',', $str_value);
674
+ for ($i = 0; $i < count($str_value); $i++) {
675
+ $have['clip'] = false;
676
+ $have['pos'] = false;
677
+ $have['color'] = false;
678
+ $have['bg'] = false;
679
+
680
+ if (is_array($str_value[$i])) {
681
+ $str_value[$i] = $str_value[$i][0];
682
+ }
683
+ $str_value[$i] = $this->explode_ws(' ', trim($str_value[$i]));
684
+
685
+ for ($j = 0; $j < count($str_value[$i]); $j++) {
686
+ if ($have['bg'] === false && (substr($str_value[$i][$j], 0, 4) === 'url(' || $str_value[$i][$j] === 'none')) {
687
+ $return['background-image'] .= $str_value[$i][$j] . ',';
688
+ $have['bg'] = true;
689
+ } elseif (in_array($str_value[$i][$j], $repeat, true)) {
690
+ $return['background-repeat'] .= $str_value[$i][$j] . ',';
691
+ } elseif (in_array($str_value[$i][$j], $attachment, true)) {
692
+ $return['background-attachment'] .= $str_value[$i][$j] . ',';
693
+ } elseif (in_array($str_value[$i][$j], $clip, true) && !$have['clip']) {
694
+ $return['background-clip'] .= $str_value[$i][$j] . ',';
695
+ $have['clip'] = true;
696
+ } elseif (in_array($str_value[$i][$j], $origin, true)) {
697
+ $return['background-origin'] .= $str_value[$i][$j] . ',';
698
+ } elseif ($str_value[$i][$j]{0} === '(') {
699
+ $return['background-size'] .= substr($str_value[$i][$j], 1, -1) . ',';
700
+ } elseif (in_array($str_value[$i][$j], $pos, true) || is_numeric($str_value[$i][$j]{0}) || $str_value[$i][$j]{0} === null || $str_value[$i][$j]{0} === '-' || $str_value[$i][$j]{0} === '.') {
701
+ $return['background-position'] .= $str_value[$i][$j];
702
+ if (!$have['pos'])
703
+ $return['background-position'] .= ' '; else
704
+ $return['background-position'].= ',';
705
+ $have['pos'] = true;
706
+ } elseif (!$have['color']) {
707
+ $return['background-color'] .= $str_value[$i][$j] . ',';
708
+ $have['color'] = true;
709
+ }
710
+ }
711
+ }
712
+
713
+ foreach ($background_prop_default as $bg_prop => $default_value) {
714
+ if ($return[$bg_prop] !== null) {
715
+ $return[$bg_prop] = substr($return[$bg_prop], 0, -1) . $important;
716
+ }
717
+ else
718
+ $return[$bg_prop] = $default_value . $important;
719
+ }
720
+ return $return;
721
+ }
722
+
723
+ /**
724
+ * Merges all background properties
725
+ * @param array $input_css
726
+ * @return array
727
+ * @version 1.0
728
+ * @see dissolve_short_bg()
729
+ * @todo full CSS 3 compliance
730
+ */
731
+ public function merge_bg($input_css) {
732
+ $background_prop_default = & $this->parser->data['csstidy']['background_prop_default'];
733
+ // Max number of background images. CSS3 not yet fully implemented
734
+ $number_of_values = @max(count($this->explode_ws(',', $input_css['background-image'])), count($this->explode_ws(',', $input_css['background-color'])), 1);
735
+ // Array with background images to check if BG image exists
736
+ $bg_img_array = @$this->explode_ws(',', $this->parser->gvw_important($input_css['background-image']));
737
+ $new_bg_value = '';
738
+ $important = '';
739
+
740
+ // if background properties is here and not empty, don't try anything
741
+ if (isset($input_css['background']) && $input_css['background'])
742
+ return $input_css;
743
+
744
+ for ($i = 0; $i < $number_of_values; $i++) {
745
+ foreach ($background_prop_default as $bg_property => $default_value) {
746
+ // Skip if property does not exist
747
+ if (!isset($input_css[$bg_property])) {
748
+ continue;
749
+ }
750
+
751
+ $cur_value = $input_css[$bg_property];
752
+ // skip all optimisation if gradient() somewhere
753
+ if (stripos($cur_value, 'gradient(') !== false)
754
+ return $input_css;
755
+
756
+ // Skip some properties if there is no background image
757
+ if ((!isset($bg_img_array[$i]) || $bg_img_array[$i] === 'none')
758
+ && ($bg_property === 'background-size' || $bg_property === 'background-position'
759
+ || $bg_property === 'background-attachment' || $bg_property === 'background-repeat')) {
760
+ continue;
761
+ }
762
+
763
+ // Remove !important
764
+ if ($this->parser->is_important($cur_value)) {
765
+ $important = ' !important';
766
+ $cur_value = $this->parser->gvw_important($cur_value);
767
+ }
768
+
769
+ // Do not add default values
770
+ if ($cur_value === $default_value) {
771
+ continue;
772
+ }
773
+
774
+ $temp = $this->explode_ws(',', $cur_value);
775
+
776
+ if (isset($temp[$i])) {
777
+ if ($bg_property === 'background-size') {
778
+ $new_bg_value .= '(' . $temp[$i] . ') ';
779
+ } else {
780
+ $new_bg_value .= $temp[$i] . ' ';
781
+ }
782
+ }
783
+ }
784
+
785
+ $new_bg_value = trim($new_bg_value);
786
+ if ($i != $number_of_values - 1)
787
+ $new_bg_value .= ',';
788
+ }
789
+
790
+ // Delete all background-properties
791
+ foreach ($background_prop_default as $bg_property => $default_value) {
792
+ unset($input_css[$bg_property]);
793
+ }
794
+
795
+ // Add new background property
796
+ if ($new_bg_value !== '')
797
+ $input_css['background'] = $new_bg_value . $important;
798
+ elseif(isset ($input_css['background']))
799
+ $input_css['background'] = 'none';
800
+
801
+ return $input_css;
802
+ }
803
+
804
+ /**
805
+ * Dissolve font property
806
+ * @param string $str_value
807
+ * @return array
808
+ * @version 1.3
809
+ * @see merge_font()
810
+ */
811
+ public function dissolve_short_font($str_value) {
812
+ $font_prop_default = & $this->parser->data['csstidy']['font_prop_default'];
813
+ $font_weight = array('normal', 'bold', 'bolder', 'lighter', 100, 200, 300, 400, 500, 600, 700, 800, 900);
814
+ $font_variant = array('normal', 'small-caps');
815
+ $font_style = array('normal', 'italic', 'oblique');
816
+ $important = '';
817
+ $return = array('font-style' => null, 'font-variant' => null, 'font-weight' => null, 'font-size' => null, 'line-height' => null, 'font-family' => null);
818
+
819
+ if ($this->parser->is_important($str_value)) {
820
+ $important = '!important';
821
+ $str_value = $this->parser->gvw_important($str_value);
822
+ }
823
+
824
+ $have['style'] = false;
825
+ $have['variant'] = false;
826
+ $have['weight'] = false;
827
+ $have['size'] = false;
828
+ // Detects if font-family consists of several words w/o quotes
829
+ $multiwords = false;
830
+
831
+ // Workaround with multiple font-family
832
+ $str_value = $this->explode_ws(',', trim($str_value));
833
+
834
+ $str_value[0] = $this->explode_ws(' ', trim($str_value[0]));
835
+
836
+ for ($j = 0; $j < count($str_value[0]); $j++) {
837
+ if ($have['weight'] === false && in_array($str_value[0][$j], $font_weight)) {
838
+ $return['font-weight'] = $str_value[0][$j];
839
+ $have['weight'] = true;
840
+ } elseif ($have['variant'] === false && in_array($str_value[0][$j], $font_variant)) {
841
+ $return['font-variant'] = $str_value[0][$j];
842
+ $have['variant'] = true;
843
+ } elseif ($have['style'] === false && in_array($str_value[0][$j], $font_style)) {
844
+ $return['font-style'] = $str_value[0][$j];
845
+ $have['style'] = true;
846
+ } elseif ($have['size'] === false && (is_numeric($str_value[0][$j]{0}) || $str_value[0][$j]{0} === null || $str_value[0][$j]{0} === '.')) {
847
+ $size = $this->explode_ws('/', trim($str_value[0][$j]));
848
+ $return['font-size'] = $size[0];
849
+ if (isset($size[1])) {
850
+ $return['line-height'] = $size[1];
851
+ } else {
852
+ $return['line-height'] = ''; // don't add 'normal' !
853
+ }
854
+ $have['size'] = true;
855
+ } else {
856
+ if (isset($return['font-family'])) {
857
+ $return['font-family'] .= ' ' . $str_value[0][$j];
858
+ $multiwords = true;
859
+ } else {
860
+ $return['font-family'] = $str_value[0][$j];
861
+ }
862
+ }
863
+ }
864
+ // add quotes if we have several qords in font-family
865
+ if ($multiwords !== false) {
866
+ $return['font-family'] = '"' . $return['font-family'] . '"';
867
+ }
868
+ $i = 1;
869
+ while (isset($str_value[$i])) {
870
+ $return['font-family'] .= ',' . trim($str_value[$i]);
871
+ $i++;
872
+ }
873
+
874
+ // Fix for 100 and more font-size
875
+ if ($have['size'] === false && isset($return['font-weight']) &&
876
+ is_numeric($return['font-weight']{0})) {
877
+ $return['font-size'] = $return['font-weight'];
878
+ unset($return['font-weight']);
879
+ }
880
+
881
+ foreach ($font_prop_default as $font_prop => $default_value) {
882
+ if ($return[$font_prop] !== null) {
883
+ $return[$font_prop] = $return[$font_prop] . $important;
884
+ }
885
+ else
886
+ $return[$font_prop] = $default_value . $important;
887
+ }
888
+ return $return;
889
+ }
890
+
891
+ /**
892
+ * Merges all fonts properties
893
+ * @param array $input_css
894
+ * @return array
895
+ * @version 1.3
896
+ * @see dissolve_short_font()
897
+ */
898
+ public function merge_font($input_css) {
899
+ $font_prop_default = & $this->parser->data['csstidy']['font_prop_default'];
900
+ $new_font_value = '';
901
+ $important = '';
902
+ // Skip if not font-family and font-size set
903
+ if (isset($input_css['font-family']) && isset($input_css['font-size']) && $input_css['font-family'] != 'inherit') {
904
+ // fix several words in font-family - add quotes
905
+ if (isset($input_css['font-family'])) {
906
+ $families = explode(',', $input_css['font-family']);
907
+ $result_families = array();
908
+ foreach ($families as $family) {
909
+ $family = trim($family);
910
+ $len = strlen($family);
911
+ if (strpos($family, ' ') &&
912
+ !(($family{0} === '"' && $family{$len - 1} === '"') ||
913
+ ($family{0} === "'" && $family{$len - 1} === "'"))) {
914
+ $family = '"' . $family . '"';
915
+ }
916
+ $result_families[] = $family;
917
+ }
918
+ $input_css['font-family'] = implode(',', $result_families);
919
+ }
920
+ foreach ($font_prop_default as $font_property => $default_value) {
921
+
922
+ // Skip if property does not exist
923
+ if (!isset($input_css[$font_property])) {
924
+ continue;
925
+ }
926
+
927
+ $cur_value = $input_css[$font_property];
928
+
929
+ // Skip if default value is used
930
+ if ($cur_value === $default_value) {
931
+ continue;
932
+ }
933
+
934
+ // Remove !important
935
+ if ($this->parser->is_important($cur_value)) {
936
+ $important = '!important';
937
+ $cur_value = $this->parser->gvw_important($cur_value);
938
+ }
939
+
940
+ $new_font_value .= $cur_value;
941
+ // Add delimiter
942
+ $new_font_value .= ( $font_property === 'font-size' &&
943
+ isset($input_css['line-height'])) ? '/' : ' ';
944
+ }
945
+
946
+ $new_font_value = trim($new_font_value);
947
+
948
+ // Delete all font-properties
949
+ foreach ($font_prop_default as $font_property => $default_value) {
950
+ if ($font_property !== 'font' || !$new_font_value)
951
+ unset($input_css[$font_property]);
952
+ }
953
+
954
+ // Add new font property
955
+ if ($new_font_value !== '') {
956
+ $input_css['font'] = $new_font_value . $important;
957
+ }
958
+ }
959
+
960
+ return $input_css;
961
+ }
962
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
963
  }
lib/CSSTidy/class.csstidy_print.php CHANGED
@@ -1,29 +1,33 @@
1
  <?php
 
2
  /**
3
  * CSSTidy - CSS Parser and Optimiser
4
  *
5
  * CSS Printing class
6
  * This class prints CSS data generated by csstidy.
7
  *
 
 
8
  * This file is part of CSSTidy.
9
  *
10
- * CSSTidy is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License as published by
12
- * the Free Software Foundation; either version 2 of the License, or
13
- * (at your option) any later version.
14
  *
15
- * CSSTidy is distributed in the hope that it will be useful,
16
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
- * GNU General Public License for more details.
19
  *
20
- * You should have received a copy of the GNU General Public License
21
- * along with CSSTidy; if not, write to the Free Software
22
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23
  *
24
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
25
  * @package csstidy
26
- * @author Florian Schmitz (floele at gmail dot com) 2005-2006
 
 
27
  */
28
 
29
  /**
@@ -33,316 +37,410 @@
33
  *
34
  * @package csstidy
35
  * @author Florian Schmitz (floele at gmail dot com) 2005-2006
36
- * @version 1.0
37
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
- class csstidy_print
40
- {
41
- /**
42
- * Saves the input CSS string
43
- * @var string
44
- * @access private
45
- */
46
- var $input_css = '';
47
-
48
- /**
49
- * Saves the formatted CSS string
50
- * @var string
51
- * @access public
52
- */
53
- var $output_css = '';
54
-
55
- /**
56
- * Saves the formatted CSS string (plain text)
57
- * @var string
58
- * @access public
59
- */
60
- var $output_css_plain = '';
61
-
62
- /**
63
- * Constructor
64
- * @param array $css contains the class csstidy
65
- * @access private
66
- * @version 1.0
67
- */
68
- function __construct(&$css)
69
- {
70
- $this->parser =& $css;
71
- $this->css =& $css->css;
72
- $this->template =& $css->template;
73
- $this->tokens =& $css->tokens;
74
- $this->charset =& $css->charset;
75
- $this->import =& $css->import;
76
- $this->namespace =& $css->namespace;
77
- }
78
-
79
- /**
80
- * Resets output_css and output_css_plain (new css code)
81
- * @access private
82
- * @version 1.0
83
- */
84
- function _reset()
85
- {
86
- $this->output_css = '';
87
- $this->output_css_plain = '';
88
- }
89
-
90
- /**
91
- * Returns the CSS code as plain text
92
- * @return string
93
- * @access public
94
- * @version 1.0
95
- */
96
- function plain()
97
- {
98
- $this->_print(true);
99
- return $this->output_css_plain;
100
- }
101
-
102
- /**
103
- * Returns the formatted CSS code
104
- * @return string
105
- * @access public
106
- * @version 1.0
107
- */
108
- function formatted()
109
- {
110
- $this->_print(false);
111
- return $this->output_css;
112
- }
113
-
114
- /**
115
- * Returns the formatted CSS Code and saves it into $this->output_css and $this->output_css_plain
116
- * @param bool $plain plain text or not
117
- * @access private
118
- * @version 2.0
119
- */
120
- function _print($plain = false)
121
- {
122
- if ($this->output_css && $this->output_css_plain) {
123
- return;
124
- }
125
-
126
- $output = '';
127
- if (!$this->parser->get_cfg('preserve_css')) {
128
- $this->_convert_raw_css();
129
- }
130
-
131
- $template =& $this->template;
132
-
133
- if ($plain) {
134
- $template = array_map('strip_tags', $template);
135
- }
136
-
137
- if ($this->parser->get_cfg('timestamp')) {
138
- array_unshift($this->tokens, array(COMMENT, ' CSSTidy ' . $this->parser->version . ': ' . date('r') . ' '));
139
- }
140
-
141
- if (!empty($this->charset)) {
142
- $output .= $template[0].'@charset '.$template[5].$this->charset.$template[6];
143
- }
144
-
145
- if (!empty($this->import)) {
146
- for ($i = 0, $size = count($this->import); $i < $size; $i ++) {
147
- $output .= $template[0].'@import '.$template[5].$this->import[$i].$template[6];
148
- }
149
- }
150
-
151
- if (!empty($this->namespace)) {
152
- $output .= $template[0].'@namespace '.$template[5].$this->namespace.$template[6];
153
- }
154
-
155
- $output .= $template[13];
156
- $in_at_out = '';
157
- $out =& $output;
158
-
159
- foreach ($this->tokens as $key => $token)
160
- {
161
- switch ($token[0])
162
- {
163
- case AT_START:
164
- $out .= $template[0].$this->_htmlsp($token[1], $plain).$template[1];
165
- $out =& $in_at_out;
166
- break;
167
-
168
- case SEL_START:
169
- if($this->parser->get_cfg('lowercase_s')) $token[1] = strtolower($token[1]);
170
- $out .= ($token[1]{0} !== '@') ? $template[2].$this->_htmlsp($token[1], $plain) : $template[0].$this->_htmlsp($token[1], $plain);
171
- $out .= $template[3];
172
- break;
173
-
174
- case PROPERTY:
175
- if($this->parser->get_cfg('case_properties') == 2) $token[1] = strtoupper($token[1]);
176
- if($this->parser->get_cfg('case_properties') == 1) $token[1] = strtolower($token[1]);
177
- $out .= $template[4] . $this->_htmlsp($token[1], $plain) . ':' . $template[5];
178
- break;
179
-
180
- case VALUE:
181
- $out .= $this->_htmlsp($token[1], $plain);
182
- if($this->_seeknocomment($key, 1) == SEL_END && $this->parser->get_cfg('remove_last_;')) {
183
- $out .= str_replace(';', '', $template[6]);
184
- } else {
185
- $out .= $template[6];
186
- }
187
- break;
188
-
189
- case SEL_END:
190
- $out .= $template[7];
191
- if($this->_seeknocomment($key, 1) != AT_END) $out .= $template[8];
192
- break;
193
-
194
- case AT_END:
195
- $out =& $output;
196
- $out .= $template[10] . str_replace("\n", "\n" . $template[10], $in_at_out);
197
- $in_at_out = '';
198
- $out .= $template[9];
199
- break;
200
-
201
- case COMMENT:
202
- $out .= $template[11] . '/*' . $this->_htmlsp($token[1], $plain) . '*/' . $template[12];
203
- break;
204
- }
205
- }
206
-
207
- $output = trim($output);
208
-
209
- if (!$plain) {
210
- $this->output_css = $output;
211
- $this->_print(true);
212
- } else {
213
- $this->output_css_plain = $output;
214
- }
215
- }
216
-
217
- /**
218
- * Gets the next token type which is $move away from $key, excluding comments
219
- * @param integer $key current position
220
- * @param integer $move move this far
221
- * @return mixed a token type
222
- * @access private
223
- * @version 1.0
224
- */
225
- function _seeknocomment($key, $move) {
226
- $go = ($move > 0) ? 1 : -1;
227
- for ($i = $key + 1; abs($key-$i)-1 < abs($move); $i += $go) {
228
- if (!isset($this->tokens[$i])) {
229
- return;
230
- }
231
- if ($this->tokens[$i][0] == COMMENT) {
232
- $move += 1;
233
- continue;
234
- }
235
- return $this->tokens[$i][0];
236
- }
237
- }
238
-
239
- /**
240
- * Converts $this->css array to a raw array ($this->tokens)
241
- * @access private
242
- * @version 1.0
243
- */
244
- function _convert_raw_css()
245
- {
246
- $this->tokens = array();
247
-
248
- foreach ($this->css as $medium => $val)
249
- {
250
- if ($this->parser->get_cfg('sort_selectors')) ksort($val);
251
- if ($medium != DEFAULT_AT) {
252
- $this->parser->_add_token(AT_START, $medium, true);
253
- }
254
-
255
- foreach ($val as $selector => $vali)
256
- {
257
- if ($this->parser->get_cfg('sort_properties')) ksort($vali);
258
- $this->parser->_add_token(SEL_START, $selector, true);
259
-
260
- foreach ($vali as $property => $valj)
261
- {
262
- $this->parser->_add_token(PROPERTY, $property, true);
263
- $this->parser->_add_token(VALUE, $valj, true);
264
- }
265
-
266
- $this->parser->_add_token(SEL_END, $selector, true);
267
- }
268
-
269
- if ($medium != DEFAULT_AT) {
270
- $this->parser->_add_token(AT_END, $medium, true);
271
- }
272
- }
273
- }
274
-
275
- /**
276
- * Same as htmlspecialchars, only that chars are not replaced if $plain !== true. This makes print_code() cleaner.
277
- * @param string $string
278
- * @param bool $plain
279
- * @return string
280
- * @see csstidy_print::_print()
281
- * @access private
282
- * @version 1.0
283
- */
284
- function _htmlsp($string, $plain)
285
- {
286
- if (!$plain) {
287
- return htmlspecialchars($string);
288
- }
289
- return $string;
290
- }
291
-
292
- /**
293
- * Get compression ratio
294
- * @access public
295
- * @return float
296
- * @version 1.2
297
- */
298
- function get_ratio()
299
- {
300
- if (!$this->output_css_plain) {
301
- $this->formatted();
302
- }
303
- return round((strlen($this->input_css) - strlen($this->output_css_plain)) / strlen($this->input_css), 3) * 100;
304
- }
305
-
306
- /**
307
- * Get difference between the old and new code in bytes and prints the code if necessary.
308
- * @access public
309
- * @return string
310
- * @version 1.1
311
- */
312
- function get_diff()
313
- {
314
- if (!$this->output_css_plain) {
315
- $this->formatted();
316
- }
317
-
318
- $diff = strlen($this->output_css_plain) - strlen($this->input_css);
319
-
320
- if ($diff > 0) {
321
- return '+' . $diff;
322
- } elseif ($diff == 0) {
323
- return '+-' . $diff;
324
- }
325
-
326
- return $diff;
327
- }
328
-
329
- /**
330
- * Get the size of either input or output CSS in KB
331
- * @param string $loc default is "output"
332
- * @access public
333
- * @return integer
334
- * @version 1.0
335
- */
336
- function size($loc = 'output')
337
- {
338
- if ($loc == 'output' && !$this->output_css) {
339
- $this->formatted();
340
- }
341
-
342
- if ($loc == 'input') {
343
- return (strlen($this->input_css) / 1000);
344
- } else {
345
- return (strlen($this->output_css_plain) / 1000);
346
- }
347
- }
348
  }
1
  <?php
2
+
3
  /**
4
  * CSSTidy - CSS Parser and Optimiser
5
  *
6
  * CSS Printing class
7
  * This class prints CSS data generated by csstidy.
8
  *
9
+ * Copyright 2005, 2006, 2007 Florian Schmitz
10
+ *
11
  * This file is part of CSSTidy.
12
  *
13
+ * CSSTidy is free software; you can redistribute it and/or modify
14
+ * it under the terms of the GNU Lesser General Public License as published by
15
+ * the Free Software Foundation; either version 2.1 of the License, or
16
+ * (at your option) any later version.
17
  *
18
+ * CSSTidy is distributed in the hope that it will be useful,
19
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
+ * GNU Lesser General Public License for more details.
22
  *
23
+ * You should have received a copy of the GNU Lesser General Public License
24
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
 
25
  *
26
+ * @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License
27
  * @package csstidy
28
+ * @author Florian Schmitz (floele at gmail dot com) 2005-2007
29
+ * @author Brett Zamir (brettz9 at yahoo dot com) 2007
30
+ * @author Cedric Morin (cedric at yterium dot com) 2010-2012
31
  */
32
 
33
  /**
37
  *
38
  * @package csstidy
39
  * @author Florian Schmitz (floele at gmail dot com) 2005-2006
40
+ * @version 1.1.0
41
  */
42
+ class csstidy_print {
43
+
44
+ /**
45
+ * csstidy object
46
+ * @var object
47
+ */
48
+ public $parser;
49
+
50
+ /**
51
+ * Saves the input CSS string
52
+ * @var string
53
+ * @access private
54
+ */
55
+ public $input_css = '';
56
+ /**
57
+ * Saves the formatted CSS string
58
+ * @var string
59
+ * @access public
60
+ */
61
+ public $output_css = '';
62
+ /**
63
+ * Saves the formatted CSS string (plain text)
64
+ * @var string
65
+ * @access public
66
+ */
67
+ public $output_css_plain = '';
68
+
69
+ /**
70
+ * Constructor
71
+ * @param array $css contains the class csstidy
72
+ * @access private
73
+ * @version 1.0
74
+ */
75
+ public function __construct($css) {
76
+ $this->parser = $css;
77
+ $this->css = & $css->css;
78
+ $this->template = & $css->template;
79
+ $this->tokens = & $css->tokens;
80
+ $this->charset = & $css->charset;
81
+ $this->import = & $css->import;
82
+ $this->namespace = & $css->namespace;
83
+ }
84
+
85
+ /**
86
+ * Resets output_css and output_css_plain (new css code)
87
+ * @access private
88
+ * @version 1.0
89
+ */
90
+ public function _reset() {
91
+ $this->output_css = '';
92
+ $this->output_css_plain = '';
93
+ }
94
+
95
+ /**
96
+ * Returns the CSS code as plain text
97
+ * @param string $default_media default @media to add to selectors without any @media
98
+ * @return string
99
+ * @access public
100
+ * @version 1.0
101
+ */
102
+ public function plain($default_media='') {
103
+ $this->_print(true, $default_media);
104
+ return $this->output_css_plain;
105
+ }
106
+
107
+ /**
108
+ * Returns the formatted CSS code
109
+ * @param string $default_media default @media to add to selectors without any @media
110
+ * @return string
111
+ * @access public
112
+ * @version 1.0
113
+ */
114
+ public function formatted($default_media='') {
115
+ $this->_print(false, $default_media);
116
+ return $this->output_css;
117
+ }
118
+
119
+ /**
120
+ * Returns the formatted CSS code to make a complete webpage
121
+ * @param string $doctype shorthand for the document type
122
+ * @param bool $externalcss indicates whether styles to be attached internally or as an external stylesheet
123
+ * @param string $title title to be added in the head of the document
124
+ * @param string $lang two-letter language code to be added to the output
125
+ * @return string
126
+ * @access public
127
+ * @version 1.4
128
+ */
129
+ public function formatted_page($doctype='html5', $externalcss=true, $title='', $lang='en') {
130
+ switch ($doctype) {
131
+ case 'html5':
132
+ $doctype_output = '<!DOCTYPE html>';
133
+ break;
134
+ case 'xhtml1.0strict':
135
+ $doctype_output = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
136
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
137
+ break;
138
+ case 'xhtml1.1':
139
+ default:
140
+ $doctype_output = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
141
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">';
142
+ break;
143
+ }
144
+
145
+ $output = $cssparsed = '';
146
+ $this->output_css_plain = & $output;
147
+
148
+ $output .= $doctype_output . "\n" . '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . $lang . '"';
149
+ $output .= ( $doctype === 'xhtml1.1') ? '>' : ' lang="' . $lang . '">';
150
+ $output .= "\n<head>\n <title>$title</title>";
151
+
152
+ if ($externalcss) {
153
+ $output .= "\n <style type=\"text/css\">\n";
154
+ $cssparsed = file_get_contents('cssparsed.css');
155
+ $output .= $cssparsed; // Adds an invisible BOM or something, but not in css_optimised.php
156
+ $output .= "\n</style>";
157
+ } else {
158
+ $output .= "\n" . ' <link rel="stylesheet" type="text/css" href="cssparsed.css" />';
159
+ }
160
+ $output .= "\n</head>\n<body><code id=\"copytext\">";
161
+ $output .= $this->formatted();
162
+ $output .= '</code>' . "\n" . '</body></html>';
163
+ return $this->output_css_plain;
164
+ }
165
+
166
+ /**
167
+ * Returns the formatted CSS Code and saves it into $this->output_css and $this->output_css_plain
168
+ * @param bool $plain plain text or not
169
+ * @param string $default_media default @media to add to selectors without any @media
170
+ * @access private
171
+ * @version 2.0
172
+ */
173
+ public function _print($plain = false, $default_media='') {
174
+ if ($this->output_css && $this->output_css_plain) {
175
+ return;
176
+ }
177
+
178
+ $output = '';
179
+ if (!$this->parser->get_cfg('preserve_css')) {
180
+ $this->_convert_raw_css($default_media);
181
+ }
182
+
183
+ $template = & $this->template;
184
+
185
+ if ($plain) {
186
+ $template = array_map('strip_tags', $template);
187
+ }
188
+
189
+ if ($this->parser->get_cfg('timestamp')) {
190
+ array_unshift($this->tokens, array(COMMENT, ' CSSTidy ' . $this->parser->version . ': ' . date('r') . ' '));
191
+ }
192
+
193
+ if (!empty($this->charset)) {
194
+ $output .= $template[0] . '@charset ' . $template[5] . $this->charset . $template[6] . $template[13];
195
+ }
196
+
197
+ if (!empty($this->import)) {
198
+ for ($i = 0, $size = count($this->import); $i < $size; $i++) {
199
+ if (substr($this->import[$i], 0, 4) === 'url(' && substr($this->import[$i], -1, 1) === ')') {
200
+ $this->import[$i] = '"' . substr($this->import[$i], 4, -1) . '"';
201
+ $this->parser->log('Optimised @import : Removed "url("', 'Information');
202
+ }
203
+ else if (!preg_match('/^".+"$/',$this->import[$i])) {
204
+ // fixes a bug for @import ".." instead of the expected @import url("..")
205
+ // If it comes in due to @import ".." the "" will be missing and the output will become @import .. (which is an error)
206
+ $this->import[$i] = '"' . $this->import[$i] . '"';
207
+ }
208
+
209
+ $output .= $template[0] . '@import ' . $template[5] . $this->import[$i] . $template[6] . $template[13];
210
+ }
211
+ }
212
+
213
+ if (!empty($this->namespace)) {
214
+ if (($p=strpos($this->namespace,"url("))!==false && substr($this->namespace, -1, 1) === ')') {
215
+ $this->namespace = substr_replace($this->namespace,'"',$p,4);
216
+ $this->namespace = substr($this->namespace, 0, -1) . '"';
217
+ $this->parser->log('Optimised @namespace : Removed "url("', 'Information');
218
+ }
219
+ $output .= $template[0] . '@namespace ' . $template[5] . $this->namespace . $template[6] . $template[13];
220
+ }
221
+
222
+ $in_at_out = '';
223
+ $out = & $output;
224
+
225
+ foreach ($this->tokens as $key => $token) {
226
+ switch ($token[0]) {
227
+ case AT_START:
228
+ $out .= $template[0] . $this->_htmlsp($token[1], $plain) . $template[1];
229
+ $out = & $in_at_out;
230
+ break;
231
+
232
+ case SEL_START:
233
+ if ($this->parser->get_cfg('lowercase_s'))
234
+ $token[1] = strtolower($token[1]);
235
+ $out .= ( $token[1]{0} !== '@') ? $template[2] . $this->_htmlsp($token[1], $plain) : $template[0] . $this->_htmlsp($token[1], $plain);
236
+ $out .= $template[3];
237
+ break;
238
+
239
+ case PROPERTY:
240
+ if ($this->parser->get_cfg('case_properties') === 2) {
241
+ $token[1] = strtoupper($token[1]);
242
+ } elseif ($this->parser->get_cfg('case_properties') === 1) {
243
+ $token[1] = strtolower($token[1]);
244
+ }
245
+ $out .= $template[4] . $this->_htmlsp($token[1], $plain) . ':' . $template[5];
246
+ break;
247
+
248
+ case VALUE:
249
+ $out .= $this->_htmlsp($token[1], $plain);
250
+ if ($this->_seeknocomment($key, 1) == SEL_END && $this->parser->get_cfg('remove_last_;')) {
251
+ $out .= str_replace(';', '', $template[6]);
252
+ } else {
253
+ $out .= $template[6];
254
+ }
255
+ break;
256
+
257
+ case SEL_END:
258
+ $out .= $template[7];
259
+ if ($this->_seeknocomment($key, 1) != AT_END)
260
+ $out .= $template[8];
261
+ break;
262
+
263
+ case AT_END:
264
+ $out = & $output;
265
+ $in_at_out = str_replace("\n\n", "\r\n", $in_at_out); // don't fill empty lines
266
+ $in_at_out = str_replace("\n", "\n" . $template[10], $in_at_out);
267
+ $in_at_out = str_replace("\r\n", "\n\n", $in_at_out);
268
+ $out .= $template[10] . $in_at_out . $template[9];
269
+ $in_at_out = '';
270
+ break;
271
+
272
+ case COMMENT:
273
+ $out .= $template[11] . '/*' . $this->_htmlsp($token[1], $plain) . '*/' . $template[12];
274
+ break;
275
+ }
276
+ }
277
+
278
+ $output = trim($output);
279
+
280
+ if (!$plain) {
281
+ $this->output_css = $output;
282
+ $this->_print(true);
283
+ } else {
284
+ // If using spaces in the template, don't want these to appear in the plain output
285
+ $this->output_css_plain = str_replace('&#160;', '', $output);
286
+ }
287
+ }
288
+
289
+ /**
290
+ * Gets the next token type which is $move away from $key, excluding comments
291
+ * @param integer $key current position
292
+ * @param integer $move move this far
293
+ * @return mixed a token type
294
+ * @access private
295
+ * @version 1.0
296
+ */
297
+ public function _seeknocomment($key, $move) {
298
+ $go = ($move > 0) ? 1 : -1;
299
+ for ($i = $key + 1; abs($key - $i) - 1 < abs($move); $i += $go) {
300
+ if (!isset($this->tokens[$i])) {
301
+ return;
302
+ }
303
+ if ($this->tokens[$i][0] == COMMENT) {
304
+ $move += 1;
305
+ continue;
306
+ }
307
+ return $this->tokens[$i][0];
308
+ }
309
+ }
310
+
311
+ /**
312
+ * Converts $this->css array to a raw array ($this->tokens)
313
+ * @param string $default_media default @media to add to selectors without any @media
314
+ * @access private
315
+ * @version 1.0
316
+ */
317
+ public function _convert_raw_css($default_media='') {
318
+ $this->tokens = array();
319
+ $sort_selectors = $this->parser->get_cfg('sort_selectors');
320
+ $sort_properties = $this->parser->get_cfg('sort_properties');
321
+
322
+ foreach ($this->css as $medium => $val) {
323
+ if ($sort_selectors)
324
+ ksort($val);
325
+ if (intval($medium) < DEFAULT_AT) {
326
+ // un medium vide (contenant @font-face ou autre @) ne produit aucun conteneur
327
+ if (strlen(trim($medium))) {
328
+ $this->parser->_add_token(AT_START, $medium, true);
329
+ }
330
+ } elseif ($default_media) {
331
+ $this->parser->_add_token(AT_START, $default_media, true);
332
+ }
333
+
334
+ foreach ($val as $selector => $vali) {
335
+ if ($sort_properties)
336
+ ksort($vali);
337
+ $this->parser->_add_token(SEL_START, $selector, true);
338
+
339
+ $invalid = array(
340
+ '*' => array(), // IE7 hacks first
341
+ '_' => array(), // IE6 hacks
342
+ '/' => array(), // IE6 hacks
343
+ '-' => array() // IE6 hacks
344
+ );
345
+ foreach ($vali as $property => $valj) {
346
+ if (strncmp($property,"//",2)!==0) {
347
+ $matches = array();
348
+ if ($sort_properties && preg_match('/^(\*|_|\/|-)(?!(ms|moz|o\b|xv|atsc|wap|khtml|webkit|ah|hp|ro|rim|tc)-)/', $property, $matches)) {
349
+ $invalid[$matches[1]][$property] = $valj;
350
+ } else {
351
+ $this->parser->_add_token(PROPERTY, $property, true);
352
+ $this->parser->_add_token(VALUE, $valj, true);
353
+ }
354
+ }
355
+ }
356
+ foreach ($invalid as $prefix => $props) {
357
+ foreach ($props as $property => $valj) {
358
+ $this->parser->_add_token(PROPERTY, $property, true);
359
+ $this->parser->_add_token(VALUE, $valj, true);
360
+ }
361
+ }
362
+ $this->parser->_add_token(SEL_END, $selector, true);
363
+ }
364
+
365
+ if (intval($medium) < DEFAULT_AT) {
366
+ // un medium vide (contenant @font-face ou autre @) ne produit aucun conteneur
367
+ if (strlen(trim($medium))) {
368
+ $this->parser->_add_token(AT_END, $medium, true);
369
+ }
370
+ } elseif ($default_media) {
371
+ $this->parser->_add_token(AT_END, $default_media, true);
372
+ }
373
+ }
374
+ }
375
+
376
+ /**
377
+ * Same as htmlspecialchars, only that chars are not replaced if $plain !== true. This makes print_code() cleaner.
378
+ * @param string $string
379
+ * @param bool $plain
380
+ * @return string
381
+ * @see csstidy_print::_print()
382
+ * @access private
383
+ * @version 1.0
384
+ */
385
+ public function _htmlsp($string, $plain) {
386
+ if (!$plain) {
387
+ return htmlspecialchars($string, ENT_QUOTES, 'utf-8');
388
+ }
389
+ return $string;
390
+ }
391
+
392
+ /**
393
+ * Get compression ratio
394
+ * @access public
395
+ * @return float
396
+ * @version 1.2
397
+ */
398
+ public function get_ratio() {
399
+ if (!$this->output_css_plain) {
400
+ $this->formatted();
401
+ }
402
+ return round((strlen($this->input_css) - strlen($this->output_css_plain)) / strlen($this->input_css), 3) * 100;
403
+ }
404
+
405
+ /**
406
+ * Get difference between the old and new code in bytes and prints the code if necessary.
407
+ * @access public
408
+ * @return string
409
+ * @version 1.1
410
+ */
411
+ public function get_diff() {
412
+ if (!$this->output_css_plain) {
413
+ $this->formatted();
414
+ }
415
+
416
+ $diff = strlen($this->output_css_plain) - strlen($this->input_css);
417
+
418
+ if ($diff > 0) {
419
+ return '+' . $diff;
420
+ } elseif ($diff == 0) {
421
+ return '+-' . $diff;
422
+ }
423
+
424
+ return $diff;
425
+ }
426
+
427
+ /**
428
+ * Get the size of either input or output CSS in KB
429
+ * @param string $loc default is "output"
430
+ * @access public
431
+ * @return integer
432
+ * @version 1.0
433
+ */
434
+ public function size($loc = 'output') {
435
+ if ($loc === 'output' && !$this->output_css) {
436
+ $this->formatted();
437
+ }
438
+
439
+ if ($loc === 'input') {
440
+ return (strlen($this->input_css) / 1000);
441
+ } else {
442
+ return (strlen($this->output_css_plain) / 1000);
443
+ }
444
+ }
445
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
446
  }
lib/CSSTidy/data.inc.php CHANGED
@@ -21,451 +21,626 @@
21
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
22
  * @package csstidy
23
  * @author Florian Schmitz (floele at gmail dot com) 2005
 
24
  */
25
 
26
- define('AT_START', 1);
27
- define('AT_END', 2);
28
- define('SEL_START', 3);
29
- define('SEL_END', 4);
30
- define('PROPERTY', 5);
31
- define('VALUE', 6);
32
- define('COMMENT', 7);
33
- define('DEFAULT_AT', 41);
34
-
35
  /**
36
  * All whitespace allowed in CSS
37
  *
38
- * @global array $GLOBALS['csstidy']['whitespace']
39
  * @version 1.0
40
  */
41
- $GLOBALS['csstidy']['whitespace'] = array(' ',"\n","\t","\r","\x0B");
42
 
43
  /**
44
  * All CSS tokens used by csstidy
45
  *
46
- * @global string $GLOBALS['csstidy']['tokens']
47
  * @version 1.0
48
  */
49
- $GLOBALS['csstidy']['tokens'] = '/@}{;:=\'"(,\\!$%&)*+.<>?[]^`|~';
50
 
51
  /**
52
  * All CSS units (CSS 3 units included)
53
  *
54
  * @see compress_numbers()
55
- * @global array $GLOBALS['csstidy']['units']
56
  * @version 1.0
57
  */
58
- $GLOBALS['csstidy']['units'] = array('in','cm','mm','pt','pc','px','rem','em','%','ex','gd','vw','vh','vm','deg','grad','rad','ms','s','khz','hz');
59
 
60
  /**
61
  * Available at-rules
62
  *
63
- * @global array $GLOBALS['csstidy']['at_rules']
64
- * @version 1.0
65
  */
66
- $GLOBALS['csstidy']['at_rules'] = array('page' => 'is','font-face' => 'is','charset' => 'iv', 'import' => 'iv','namespace' => 'iv','media' => 'at');
67
 
68
  /**
69
  * Properties that need a value with unit
70
  *
71
  * @todo CSS3 properties
72
  * @see compress_numbers();
73
- * @global array $GLOBALS['csstidy']['unit_values']
74
  * @version 1.2
75
  */
76
- $GLOBALS['csstidy']['unit_values'] = array ('background', 'background-position', 'border', 'border-top', 'border-right', 'border-bottom', 'border-left', 'border-width',
77
- 'border-top-width', 'border-right-width', 'border-left-width', 'border-bottom-width', 'bottom', 'border-spacing', 'font-size',
78
- 'height', 'left', 'margin', 'margin-top', 'margin-right', 'margin-bottom', 'margin-left', 'max-height', 'max-width',
79
- 'min-height', 'min-width', 'outline-width', 'padding', 'padding-top', 'padding-right', 'padding-bottom', 'padding-left',
80
- 'position', 'right', 'top', 'text-indent', 'letter-spacing', 'word-spacing', 'width');
81
 
82
  /**
83
  * Properties that allow <color> as value
84
  *
85
  * @todo CSS3 properties
86
  * @see compress_numbers();
87
- * @global array $GLOBALS['csstidy']['color_values']
88
  * @version 1.0
89
  */
90
- $GLOBALS['csstidy']['color_values'] = array();
91
- $GLOBALS['csstidy']['color_values'][] = 'background-color';
92
- $GLOBALS['csstidy']['color_values'][] = 'border-color';
93
- $GLOBALS['csstidy']['color_values'][] = 'border-top-color';
94
- $GLOBALS['csstidy']['color_values'][] = 'border-right-color';
95
- $GLOBALS['csstidy']['color_values'][] = 'border-bottom-color';
96
- $GLOBALS['csstidy']['color_values'][] = 'border-left-color';
97
- $GLOBALS['csstidy']['color_values'][] = 'color';
98
- $GLOBALS['csstidy']['color_values'][] = 'outline-color';
99
-
100
 
101
  /**
102
  * Default values for the background properties
103
  *
104
  * @todo Possibly property names will change during CSS3 development
105
- * @global array $GLOBALS['csstidy']['background_prop_default']
106
  * @see dissolve_short_bg()
107
  * @see merge_bg()
108
  * @version 1.0
109
  */
110
- $GLOBALS['csstidy']['background_prop_default'] = array();
111
- $GLOBALS['csstidy']['background_prop_default']['background-image'] = 'none';
112
- $GLOBALS['csstidy']['background_prop_default']['background-size'] = 'auto';
113
- $GLOBALS['csstidy']['background_prop_default']['background-repeat'] = 'repeat';
114
- $GLOBALS['csstidy']['background_prop_default']['background-position'] = '0 0';
115
- $GLOBALS['csstidy']['background_prop_default']['background-attachment'] = 'scroll';
116
- $GLOBALS['csstidy']['background_prop_default']['background-clip'] = 'border';
117
- $GLOBALS['csstidy']['background_prop_default']['background-origin'] = 'padding';
118
- $GLOBALS['csstidy']['background_prop_default']['background-color'] = 'transparent';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
 
120
  /**
121
  * A list of non-W3C color names which get replaced by their hex-codes
122
  *
123
- * @global array $GLOBALS['csstidy']['replace_colors']
124
  * @see cut_color()
125
  * @version 1.0
126
  */
127
- $GLOBALS['csstidy']['replace_colors'] = array();
128
- $GLOBALS['csstidy']['replace_colors']['aliceblue'] = '#F0F8FF';
129
- $GLOBALS['csstidy']['replace_colors']['antiquewhite'] = '#FAEBD7';
130
- $GLOBALS['csstidy']['replace_colors']['aquamarine'] = '#7FFFD4';
131
- $GLOBALS['csstidy']['replace_colors']['azure'] = '#F0FFFF';
132
- $GLOBALS['csstidy']['replace_colors']['beige'] = '#F5F5DC';
133
- $GLOBALS['csstidy']['replace_colors']['bisque'] = '#FFE4C4';
134
- $GLOBALS['csstidy']['replace_colors']['blanchedalmond'] = '#FFEBCD';
135
- $GLOBALS['csstidy']['replace_colors']['blueviolet'] = '#8A2BE2';
136
- $GLOBALS['csstidy']['replace_colors']['brown'] = '#A52A2A';
137
- $GLOBALS['csstidy']['replace_colors']['burlywood'] = '#DEB887';
138
- $GLOBALS['csstidy']['replace_colors']['cadetblue'] = '#5F9EA0';
139
- $GLOBALS['csstidy']['replace_colors']['chartreuse'] = '#7FFF00';
140
- $GLOBALS['csstidy']['replace_colors']['chocolate'] = '#D2691E';
141
- $GLOBALS['csstidy']['replace_colors']['coral'] = '#FF7F50';
142
- $GLOBALS['csstidy']['replace_colors']['cornflowerblue'] = '#6495ED';
143
- $GLOBALS['csstidy']['replace_colors']['cornsilk'] = '#FFF8DC';
144
- $GLOBALS['csstidy']['replace_colors']['crimson'] = '#DC143C';
145
- $GLOBALS['csstidy']['replace_colors']['cyan'] = '#00FFFF';
146
- $GLOBALS['csstidy']['replace_colors']['darkblue'] = '#00008B';
147
- $GLOBALS['csstidy']['replace_colors']['darkcyan'] = '#008B8B';
148
- $GLOBALS['csstidy']['replace_colors']['darkgoldenrod'] = '#B8860B';
149
- $GLOBALS['csstidy']['replace_colors']['darkgray'] = '#A9A9A9';
150
- $GLOBALS['csstidy']['replace_colors']['darkgreen'] = '#006400';
151
- $GLOBALS['csstidy']['replace_colors']['darkkhaki'] = '#BDB76B';
152
- $GLOBALS['csstidy']['replace_colors']['darkmagenta'] = '#8B008B';
153
- $GLOBALS['csstidy']['replace_colors']['darkolivegreen'] = '#556B2F';
154
- $GLOBALS['csstidy']['replace_colors']['darkorange'] = '#FF8C00';
155
- $GLOBALS['csstidy']['replace_colors']['darkorchid'] = '#9932CC';
156
- $GLOBALS['csstidy']['replace_colors']['darkred'] = '#8B0000';
157
- $GLOBALS['csstidy']['replace_colors']['darksalmon'] = '#E9967A';
158
- $GLOBALS['csstidy']['replace_colors']['darkseagreen'] = '#8FBC8F';
159
- $GLOBALS['csstidy']['replace_colors']['darkslateblue'] = '#483D8B';
160
- $GLOBALS['csstidy']['replace_colors']['darkslategray'] = '#2F4F4F';
161
- $GLOBALS['csstidy']['replace_colors']['darkturquoise'] = '#00CED1';
162
- $GLOBALS['csstidy']['replace_colors']['darkviolet'] = '#9400D3';
163
- $GLOBALS['csstidy']['replace_colors']['deeppink'] = '#FF1493';
164
- $GLOBALS['csstidy']['replace_colors']['deepskyblue'] = '#00BFFF';
165
- $GLOBALS['csstidy']['replace_colors']['dimgray'] = '#696969';
166
- $GLOBALS['csstidy']['replace_colors']['dodgerblue'] = '#1E90FF';
167
- $GLOBALS['csstidy']['replace_colors']['feldspar'] = '#D19275';
168
- $GLOBALS['csstidy']['replace_colors']['firebrick'] = '#B22222';
169
- $GLOBALS['csstidy']['replace_colors']['floralwhite'] = '#FFFAF0';
170
- $GLOBALS['csstidy']['replace_colors']['forestgreen'] = '#228B22';
171
- $GLOBALS['csstidy']['replace_colors']['gainsboro'] = '#DCDCDC';
172
- $GLOBALS['csstidy']['replace_colors']['ghostwhite'] = '#F8F8FF';
173
- $GLOBALS['csstidy']['replace_colors']['gold'] = '#FFD700';
174
- $GLOBALS['csstidy']['replace_colors']['goldenrod'] = '#DAA520';
175
- $GLOBALS['csstidy']['replace_colors']['greenyellow'] = '#ADFF2F';
176
- $GLOBALS['csstidy']['replace_colors']['honeydew'] = '#F0FFF0';
177
- $GLOBALS['csstidy']['replace_colors']['hotpink'] = '#FF69B4';
178
- $GLOBALS['csstidy']['replace_colors']['indianred'] = '#CD5C5C';
179
- $GLOBALS['csstidy']['replace_colors']['indigo'] = '#4B0082';
180
- $GLOBALS['csstidy']['replace_colors']['ivory'] = '#FFFFF0';
181
- $GLOBALS['csstidy']['replace_colors']['khaki'] = '#F0E68C';
182
- $GLOBALS['csstidy']['replace_colors']['lavender'] = '#E6E6FA';
183
- $GLOBALS['csstidy']['replace_colors']['lavenderblush'] = '#FFF0F5';
184
- $GLOBALS['csstidy']['replace_colors']['lawngreen'] = '#7CFC00';
185
- $GLOBALS['csstidy']['replace_colors']['lemonchiffon'] = '#FFFACD';
186
- $GLOBALS['csstidy']['replace_colors']['lightblue'] = '#ADD8E6';
187
- $GLOBALS['csstidy']['replace_colors']['lightcoral'] = '#F08080';
188
- $GLOBALS['csstidy']['replace_colors']['lightcyan'] = '#E0FFFF';
189
- $GLOBALS['csstidy']['replace_colors']['lightgoldenrodyellow'] = '#FAFAD2';
190
- $GLOBALS['csstidy']['replace_colors']['lightgrey'] = '#D3D3D3';
191
- $GLOBALS['csstidy']['replace_colors']['lightgreen'] = '#90EE90';
192
- $GLOBALS['csstidy']['replace_colors']['lightpink'] = '#FFB6C1';
193
- $GLOBALS['csstidy']['replace_colors']['lightsalmon'] = '#FFA07A';
194
- $GLOBALS['csstidy']['replace_colors']['lightseagreen'] = '#20B2AA';
195
- $GLOBALS['csstidy']['replace_colors']['lightskyblue'] = '#87CEFA';
196
- $GLOBALS['csstidy']['replace_colors']['lightslateblue'] = '#8470FF';
197
- $GLOBALS['csstidy']['replace_colors']['lightslategray'] = '#778899';
198
- $GLOBALS['csstidy']['replace_colors']['lightsteelblue'] = '#B0C4DE';
199
- $GLOBALS['csstidy']['replace_colors']['lightyellow'] = '#FFFFE0';
200
- $GLOBALS['csstidy']['replace_colors']['limegreen'] = '#32CD32';
201
- $GLOBALS['csstidy']['replace_colors']['linen'] = '#FAF0E6';
202
- $GLOBALS['csstidy']['replace_colors']['magenta'] = '#FF00FF';
203
- $GLOBALS['csstidy']['replace_colors']['mediumaquamarine'] = '#66CDAA';
204
- $GLOBALS['csstidy']['replace_colors']['mediumblue'] = '#0000CD';
205
- $GLOBALS['csstidy']['replace_colors']['mediumorchid'] = '#BA55D3';
206
- $GLOBALS['csstidy']['replace_colors']['mediumpurple'] = '#9370D8';
207
- $GLOBALS['csstidy']['replace_colors']['mediumseagreen'] = '#3CB371';
208
- $GLOBALS['csstidy']['replace_colors']['mediumslateblue'] = '#7B68EE';
209
- $GLOBALS['csstidy']['replace_colors']['mediumspringgreen'] = '#00FA9A';
210
- $GLOBALS['csstidy']['replace_colors']['mediumturquoise'] = '#48D1CC';
211
- $GLOBALS['csstidy']['replace_colors']['mediumvioletred'] = '#C71585';
212
- $GLOBALS['csstidy']['replace_colors']['midnightblue'] = '#191970';
213
- $GLOBALS['csstidy']['replace_colors']['mintcream'] = '#F5FFFA';
214
- $GLOBALS['csstidy']['replace_colors']['mistyrose'] = '#FFE4E1';
215
- $GLOBALS['csstidy']['replace_colors']['moccasin'] = '#FFE4B5';
216
- $GLOBALS['csstidy']['replace_colors']['navajowhite'] = '#FFDEAD';
217
- $GLOBALS['csstidy']['replace_colors']['oldlace'] = '#FDF5E6';
218
- $GLOBALS['csstidy']['replace_colors']['olivedrab'] = '#6B8E23';
219
- $GLOBALS['csstidy']['replace_colors']['orangered'] = '#FF4500';
220
- $GLOBALS['csstidy']['replace_colors']['orchid'] = '#DA70D6';
221
- $GLOBALS['csstidy']['replace_colors']['palegoldenrod'] = '#EEE8AA';
222
- $GLOBALS['csstidy']['replace_colors']['palegreen'] = '#98FB98';
223
- $GLOBALS['csstidy']['replace_colors']['paleturquoise'] = '#AFEEEE';
224
- $GLOBALS['csstidy']['replace_colors']['palevioletred'] = '#D87093';
225
- $GLOBALS['csstidy']['replace_colors']['papayawhip'] = '#FFEFD5';
226
- $GLOBALS['csstidy']['replace_colors']['peachpuff'] = '#FFDAB9';
227
- $GLOBALS['csstidy']['replace_colors']['peru'] = '#CD853F';
228
- $GLOBALS['csstidy']['replace_colors']['pink'] = '#FFC0CB';
229
- $GLOBALS['csstidy']['replace_colors']['plum'] = '#DDA0DD';
230
- $GLOBALS['csstidy']['replace_colors']['powderblue'] = '#B0E0E6';
231
- $GLOBALS['csstidy']['replace_colors']['rosybrown'] = '#BC8F8F';
232
- $GLOBALS['csstidy']['replace_colors']['royalblue'] = '#4169E1';
233
- $GLOBALS['csstidy']['replace_colors']['saddlebrown'] = '#8B4513';
234
- $GLOBALS['csstidy']['replace_colors']['salmon'] = '#FA8072';
235
- $GLOBALS['csstidy']['replace_colors']['sandybrown'] = '#F4A460';
236
- $GLOBALS['csstidy']['replace_colors']['seagreen'] = '#2E8B57';
237
- $GLOBALS['csstidy']['replace_colors']['seashell'] = '#FFF5EE';
238
- $GLOBALS['csstidy']['replace_colors']['sienna'] = '#A0522D';
239
- $GLOBALS['csstidy']['replace_colors']['skyblue'] = '#87CEEB';
240
- $GLOBALS['csstidy']['replace_colors']['slateblue'] = '#6A5ACD';
241
- $GLOBALS['csstidy']['replace_colors']['slategray'] = '#708090';
242
- $GLOBALS['csstidy']['replace_colors']['snow'] = '#FFFAFA';
243
- $GLOBALS['csstidy']['replace_colors']['springgreen'] = '#00FF7F';
244
- $GLOBALS['csstidy']['replace_colors']['steelblue'] = '#4682B4';
245
- $GLOBALS['csstidy']['replace_colors']['tan'] = '#D2B48C';
246
- $GLOBALS['csstidy']['replace_colors']['thistle'] = '#D8BFD8';
247
- $GLOBALS['csstidy']['replace_colors']['tomato'] = '#FF6347';
248
- $GLOBALS['csstidy']['replace_colors']['turquoise'] = '#40E0D0';
249
- $GLOBALS['csstidy']['replace_colors']['violet'] = '#EE82EE';
250
- $GLOBALS['csstidy']['replace_colors']['violetred'] = '#D02090';
251
- $GLOBALS['csstidy']['replace_colors']['wheat'] = '#F5DEB3';
252
- $GLOBALS['csstidy']['replace_colors']['whitesmoke'] = '#F5F5F5';
253
- $GLOBALS['csstidy']['replace_colors']['yellowgreen'] = '#9ACD32';
254
-
255
 
256
  /**
257
  * A list of all shorthand properties that are devided into four properties and/or have four subvalues
258
  *
259
- * @global array $GLOBALS['csstidy']['shorthands']
260
  * @todo Are there new ones in CSS3?
261
  * @see dissolve_4value_shorthands()
262
  * @see merge_4value_shorthands()
263
  * @version 1.0
264
  */
265
- $GLOBALS['csstidy']['shorthands'] = array();
266
- $GLOBALS['csstidy']['shorthands']['border-color'] = array('border-top-color','border-right-color','border-bottom-color','border-left-color');
267
- $GLOBALS['csstidy']['shorthands']['border-style'] = array('border-top-style','border-right-style','border-bottom-style','border-left-style');
268
- $GLOBALS['csstidy']['shorthands']['border-width'] = array('border-top-width','border-right-width','border-bottom-width','border-left-width');
269
- $GLOBALS['csstidy']['shorthands']['margin'] = array('margin-top','margin-right','margin-bottom','margin-left');
270
- $GLOBALS['csstidy']['shorthands']['padding'] = array('padding-top','padding-right','padding-bottom','padding-left');
271
- $GLOBALS['csstidy']['shorthands']['-moz-border-radius'] = 0;
272
 
273
  /**
274
  * All CSS Properties. Needed for csstidy::property_is_next()
275
  *
276
- * @global array $GLOBALS['csstidy']['all_properties']
277
- * @todo Add CSS3 properties
278
- * @version 1.0
279
  * @see csstidy::property_is_next()
280
  */
281
- $GLOBALS['csstidy']['all_properties'] = array();
282
- $GLOBALS['csstidy']['all_properties']['background'] = 'CSS1.0,CSS2.0,CSS2.1';
283
- $GLOBALS['csstidy']['all_properties']['background-color'] = 'CSS1.0,CSS2.0,CSS2.1';
284
- $GLOBALS['csstidy']['all_properties']['background-image'] = 'CSS1.0,CSS2.0,CSS2.1';
285
- $GLOBALS['csstidy']['all_properties']['background-repeat'] = 'CSS1.0,CSS2.0,CSS2.1';
286
- $GLOBALS['csstidy']['all_properties']['background-attachment'] = 'CSS1.0,CSS2.0,CSS2.1';
287
- $GLOBALS['csstidy']['all_properties']['background-position'] = 'CSS1.0,CSS2.0,CSS2.1';
288
- $GLOBALS['csstidy']['all_properties']['border'] = 'CSS1.0,CSS2.0,CSS2.1';
289
- $GLOBALS['csstidy']['all_properties']['border-top'] = 'CSS1.0,CSS2.0,CSS2.1';
290
- $GLOBALS['csstidy']['all_properties']['border-right'] = 'CSS1.0,CSS2.0,CSS2.1';
291
- $GLOBALS['csstidy']['all_properties']['border-bottom'] = 'CSS1.0,CSS2.0,CSS2.1';
292
- $GLOBALS['csstidy']['all_properties']['border-left'] = 'CSS1.0,CSS2.0,CSS2.1';
293
- $GLOBALS['csstidy']['all_properties']['border-color'] = 'CSS1.0,CSS2.0,CSS2.1';
294
- $GLOBALS['csstidy']['all_properties']['border-top-color'] = 'CSS2.0,CSS2.1';
295
- $GLOBALS['csstidy']['all_properties']['border-bottom-color'] = 'CSS2.0,CSS2.1';
296
- $GLOBALS['csstidy']['all_properties']['border-left-color'] = 'CSS2.0,CSS2.1';
297
- $GLOBALS['csstidy']['all_properties']['border-right-color'] = 'CSS2.0,CSS2.1';
298
- $GLOBALS['csstidy']['all_properties']['border-style'] = 'CSS1.0,CSS2.0,CSS2.1';
299
- $GLOBALS['csstidy']['all_properties']['border-top-style'] = 'CSS2.0,CSS2.1';
300
- $GLOBALS['csstidy']['all_properties']['border-right-style'] = 'CSS2.0,CSS2.1';
301
- $GLOBALS['csstidy']['all_properties']['border-left-style'] = 'CSS2.0,CSS2.1';
302
- $GLOBALS['csstidy']['all_properties']['border-bottom-style'] = 'CSS2.0,CSS2.1';
303
- $GLOBALS['csstidy']['all_properties']['border-width'] = 'CSS1.0,CSS2.0,CSS2.1';
304
- $GLOBALS['csstidy']['all_properties']['border-top-width'] = 'CSS1.0,CSS2.0,CSS2.1';
305
- $GLOBALS['csstidy']['all_properties']['border-right-width'] = 'CSS1.0,CSS2.0,CSS2.1';
306
- $GLOBALS['csstidy']['all_properties']['border-left-width'] = 'CSS1.0,CSS2.0,CSS2.1';
307
- $GLOBALS['csstidy']['all_properties']['border-bottom-width'] = 'CSS1.0,CSS2.0,CSS2.1';
308
- $GLOBALS['csstidy']['all_properties']['border-collapse'] = 'CSS2.0,CSS2.1';
309
- $GLOBALS['csstidy']['all_properties']['border-spacing'] = 'CSS2.0,CSS2.1';
310
- $GLOBALS['csstidy']['all_properties']['bottom'] = 'CSS2.0,CSS2.1';
311
- $GLOBALS['csstidy']['all_properties']['caption-side'] = 'CSS2.0,CSS2.1';
312
- $GLOBALS['csstidy']['all_properties']['content'] = 'CSS2.0,CSS2.1';
313
- $GLOBALS['csstidy']['all_properties']['clear'] = 'CSS1.0,CSS2.0,CSS2.1';
314
- $GLOBALS['csstidy']['all_properties']['clip'] = 'CSS1.0,CSS2.0,CSS2.1';
315
- $GLOBALS['csstidy']['all_properties']['color'] = 'CSS1.0,CSS2.0,CSS2.1';
316
- $GLOBALS['csstidy']['all_properties']['counter-reset'] = 'CSS2.0,CSS2.1';
317
- $GLOBALS['csstidy']['all_properties']['counter-increment'] = 'CSS2.0,CSS2.1';
318
- $GLOBALS['csstidy']['all_properties']['cursor'] = 'CSS2.0,CSS2.1';
319
- $GLOBALS['csstidy']['all_properties']['empty-cells'] = 'CSS2.0,CSS2.1';
320
- $GLOBALS['csstidy']['all_properties']['display'] = 'CSS1.0,CSS2.0,CSS2.1';
321
- $GLOBALS['csstidy']['all_properties']['direction'] = 'CSS2.0,CSS2.1';
322
- $GLOBALS['csstidy']['all_properties']['float'] = 'CSS1.0,CSS2.0,CSS2.1';
323
- $GLOBALS['csstidy']['all_properties']['font'] = 'CSS1.0,CSS2.0,CSS2.1';
324
- $GLOBALS['csstidy']['all_properties']['font-family'] = 'CSS1.0,CSS2.0,CSS2.1';
325
- $GLOBALS['csstidy']['all_properties']['font-style'] = 'CSS1.0,CSS2.0,CSS2.1';
326
- $GLOBALS['csstidy']['all_properties']['font-variant'] = 'CSS1.0,CSS2.0,CSS2.1';
327
- $GLOBALS['csstidy']['all_properties']['font-weight'] = 'CSS1.0,CSS2.0,CSS2.1';
328
- $GLOBALS['csstidy']['all_properties']['font-stretch'] = 'CSS2.0';
329
- $GLOBALS['csstidy']['all_properties']['font-size-adjust'] = 'CSS2.0';
330
- $GLOBALS['csstidy']['all_properties']['font-size'] = 'CSS1.0,CSS2.0,CSS2.1';
331
- $GLOBALS['csstidy']['all_properties']['height'] = 'CSS1.0,CSS2.0,CSS2.1';
332
- $GLOBALS['csstidy']['all_properties']['left'] = 'CSS1.0,CSS2.0,CSS2.1';
333
- $GLOBALS['csstidy']['all_properties']['line-height'] = 'CSS1.0,CSS2.0,CSS2.1';
334
- $GLOBALS['csstidy']['all_properties']['list-style'] = 'CSS1.0,CSS2.0,CSS2.1';
335
- $GLOBALS['csstidy']['all_properties']['list-style-type'] = 'CSS1.0,CSS2.0,CSS2.1';
336
- $GLOBALS['csstidy']['all_properties']['list-style-image'] = 'CSS1.0,CSS2.0,CSS2.1';
337
- $GLOBALS['csstidy']['all_properties']['list-style-position'] = 'CSS1.0,CSS2.0,CSS2.1';
338
- $GLOBALS['csstidy']['all_properties']['margin'] = 'CSS1.0,CSS2.0,CSS2.1';
339
- $GLOBALS['csstidy']['all_properties']['margin-top'] = 'CSS1.0,CSS2.0,CSS2.1';
340
- $GLOBALS['csstidy']['all_properties']['margin-right'] = 'CSS1.0,CSS2.0,CSS2.1';
341
- $GLOBALS['csstidy']['all_properties']['margin-bottom'] = 'CSS1.0,CSS2.0,CSS2.1';
342
- $GLOBALS['csstidy']['all_properties']['margin-left'] = 'CSS1.0,CSS2.0,CSS2.1';
343
- $GLOBALS['csstidy']['all_properties']['marks'] = 'CSS1.0,CSS2.0';
344
- $GLOBALS['csstidy']['all_properties']['marker-offset'] = 'CSS2.0';
345
- $GLOBALS['csstidy']['all_properties']['max-height'] = 'CSS2.0,CSS2.1';
346
- $GLOBALS['csstidy']['all_properties']['max-width'] = 'CSS2.0,CSS2.1';
347
- $GLOBALS['csstidy']['all_properties']['min-height'] = 'CSS2.0,CSS2.1';
348
- $GLOBALS['csstidy']['all_properties']['min-width'] = 'CSS2.0,CSS2.1';
349
- $GLOBALS['csstidy']['all_properties']['overflow'] = 'CSS1.0,CSS2.0,CSS2.1';
350
- $GLOBALS['csstidy']['all_properties']['orphans'] = 'CSS2.0,CSS2.1';
351
- $GLOBALS['csstidy']['all_properties']['outline'] = 'CSS2.0,CSS2.1';
352
- $GLOBALS['csstidy']['all_properties']['outline-width'] = 'CSS2.0,CSS2.1';
353
- $GLOBALS['csstidy']['all_properties']['outline-style'] = 'CSS2.0,CSS2.1';
354
- $GLOBALS['csstidy']['all_properties']['outline-color'] = 'CSS2.0,CSS2.1';
355
- $GLOBALS['csstidy']['all_properties']['padding'] = 'CSS1.0,CSS2.0,CSS2.1';
356
- $GLOBALS['csstidy']['all_properties']['padding-top'] = 'CSS1.0,CSS2.0,CSS2.1';
357
- $GLOBALS['csstidy']['all_properties']['padding-right'] = 'CSS1.0,CSS2.0,CSS2.1';
358
- $GLOBALS['csstidy']['all_properties']['padding-bottom'] = 'CSS1.0,CSS2.0,CSS2.1';
359
- $GLOBALS['csstidy']['all_properties']['padding-left'] = 'CSS1.0,CSS2.0,CSS2.1';
360
- $GLOBALS['csstidy']['all_properties']['page-break-before'] = 'CSS1.0,CSS2.0,CSS2.1';
361
- $GLOBALS['csstidy']['all_properties']['page-break-after'] = 'CSS1.0,CSS2.0,CSS2.1';
362
- $GLOBALS['csstidy']['all_properties']['page-break-inside'] = 'CSS2.0,CSS2.1';
363
- $GLOBALS['csstidy']['all_properties']['page'] = 'CSS2.0';
364
- $GLOBALS['csstidy']['all_properties']['position'] = 'CSS1.0,CSS2.0,CSS2.1';
365
- $GLOBALS['csstidy']['all_properties']['quotes'] = 'CSS2.0,CSS2.1';
366
- $GLOBALS['csstidy']['all_properties']['right'] = 'CSS2.0,CSS2.1';
367
- $GLOBALS['csstidy']['all_properties']['size'] = 'CSS1.0,CSS2.0';
368
- $GLOBALS['csstidy']['all_properties']['speak-header'] = 'CSS2.0,CSS2.1';
369
- $GLOBALS['csstidy']['all_properties']['table-layout'] = 'CSS2.0,CSS2.1';
370
- $GLOBALS['csstidy']['all_properties']['top'] = 'CSS1.0,CSS2.0,CSS2.1';
371
- $GLOBALS['csstidy']['all_properties']['text-indent'] = 'CSS1.0,CSS2.0,CSS2.1';
372
- $GLOBALS['csstidy']['all_properties']['text-align'] = 'CSS1.0,CSS2.0,CSS2.1';
373
- $GLOBALS['csstidy']['all_properties']['text-decoration'] = 'CSS1.0,CSS2.0,CSS2.1';
374
- $GLOBALS['csstidy']['all_properties']['text-shadow'] = 'CSS2.0';
375
- $GLOBALS['csstidy']['all_properties']['letter-spacing'] = 'CSS1.0,CSS2.0,CSS2.1';
376
- $GLOBALS['csstidy']['all_properties']['word-spacing'] = 'CSS1.0,CSS2.0,CSS2.1';
377
- $GLOBALS['csstidy']['all_properties']['text-transform'] = 'CSS1.0,CSS2.0,CSS2.1';
378
- $GLOBALS['csstidy']['all_properties']['white-space'] = 'CSS1.0,CSS2.0,CSS2.1';
379
- $GLOBALS['csstidy']['all_properties']['unicode-bidi'] = 'CSS2.0,CSS2.1';
380
- $GLOBALS['csstidy']['all_properties']['vertical-align'] = 'CSS1.0,CSS2.0,CSS2.1';
381
- $GLOBALS['csstidy']['all_properties']['visibility'] = 'CSS1.0,CSS2.0,CSS2.1';
382
- $GLOBALS['csstidy']['all_properties']['width'] = 'CSS1.0,CSS2.0,CSS2.1';
383
- $GLOBALS['csstidy']['all_properties']['widows'] = 'CSS2.0,CSS2.1';
384
- $GLOBALS['csstidy']['all_properties']['z-index'] = 'CSS1.0,CSS2.0,CSS2.1';
385
- /* Speech */
386
- $GLOBALS['csstidy']['all_properties']['volume'] = 'CSS2.0,CSS2.1';
387
- $GLOBALS['csstidy']['all_properties']['speak'] = 'CSS2.0,CSS2.1';
388
- $GLOBALS['csstidy']['all_properties']['pause'] = 'CSS2.0,CSS2.1';
389
- $GLOBALS['csstidy']['all_properties']['pause-before'] = 'CSS2.0,CSS2.1';
390
- $GLOBALS['csstidy']['all_properties']['pause-after'] = 'CSS2.0,CSS2.1';
391
- $GLOBALS['csstidy']['all_properties']['cue'] = 'CSS2.0,CSS2.1';
392
- $GLOBALS['csstidy']['all_properties']['cue-before'] = 'CSS2.0,CSS2.1';
393
- $GLOBALS['csstidy']['all_properties']['cue-after'] = 'CSS2.0,CSS2.1';
394
- $GLOBALS['csstidy']['all_properties']['play-during'] = 'CSS2.0,CSS2.1';
395
- $GLOBALS['csstidy']['all_properties']['azimuth'] = 'CSS2.0,CSS2.1';
396
- $GLOBALS['csstidy']['all_properties']['elevation'] = 'CSS2.0,CSS2.1';
397
- $GLOBALS['csstidy']['all_properties']['speech-rate'] = 'CSS2.0,CSS2.1';
398
- $GLOBALS['csstidy']['all_properties']['voice-family'] = 'CSS2.0,CSS2.1';
399
- $GLOBALS['csstidy']['all_properties']['pitch'] = 'CSS2.0,CSS2.1';
400
- $GLOBALS['csstidy']['all_properties']['pitch-range'] = 'CSS2.0,CSS2.1';
401
- $GLOBALS['csstidy']['all_properties']['stress'] = 'CSS2.0,CSS2.1';
402
- $GLOBALS['csstidy']['all_properties']['richness'] = 'CSS2.0,CSS2.1';
403
- $GLOBALS['csstidy']['all_properties']['speak-punctuation'] = 'CSS2.0,CSS2.1';
404
- $GLOBALS['csstidy']['all_properties']['speak-numeral'] = 'CSS2.0,CSS2.1';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
405
 
406
  /**
407
  * An array containing all predefined templates.
408
  *
409
- * @global array $GLOBALS['csstidy']['predefined_templates']
410
  * @version 1.0
411
  * @see csstidy::load_template()
412
  */
413
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '<span class="at">'; //string before @rule
414
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '</span> <span class="format">{</span>'."\n"; //bracket after @-rule
415
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '<span class="selector">'; //string before selector
416
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '</span> <span class="format">{</span>'."\n"; //bracket after selector
417
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '<span class="property">'; //string before property
418
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '</span><span class="value">'; //string after property+before value
419
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '</span><span class="format">;</span>'."\n"; //string after value
420
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '<span class="format">}</span>'; //closing bracket - selector
421
- $GLOBALS['csstidy']['predefined_templates']['default'][] = "\n\n"; //space between blocks {...}
422
- $GLOBALS['csstidy']['predefined_templates']['default'][] = "\n".'<span class="format">}</span>'. "\n\n"; //closing bracket @-rule
423
- $GLOBALS['csstidy']['predefined_templates']['default'][] = ''; //indent in @-rule
424
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '<span class="comment">'; // before comment
425
- $GLOBALS['csstidy']['predefined_templates']['default'][] = '</span>'."\n"; // after comment
426
- $GLOBALS['csstidy']['predefined_templates']['default'][] = "\n"; // after last line @-rule
427
 
428
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '<span class="at">';
429
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '</span> <span class="format">{</span>'."\n";
430
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '<span class="selector">';
431
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '</span><span class="format">{</span>';
432
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '<span class="property">';
433
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '</span><span class="value">';
434
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '</span><span class="format">;</span>';
435
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '<span class="format">}</span>';
436
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = "\n";
437
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = "\n". '<span class="format">}'."\n".'</span>';
438
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '';
439
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '<span class="comment">'; // before comment
440
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '</span>'; // after comment
441
- $GLOBALS['csstidy']['predefined_templates']['high_compression'][] = "\n";
442
 
443
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="at">';
444
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="format">{</span>';
445
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="selector">';
446
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="format">{</span>';
447
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="property">';
448
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="value">';
449
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="format">;</span>';
450
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="format">}</span>';
451
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '';
452
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="format">}</span>';
453
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '';
454
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="comment">'; // before comment
455
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '</span>'; // after comment
456
- $GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '';
457
 
458
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '<span class="at">';
459
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '</span> <span class="format">{</span>'."\n";
460
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '<span class="selector">';
461
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '</span>'."\n".'<span class="format">{</span>'."\n";
462
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = ' <span class="property">';
463
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '</span><span class="value">';
464
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '</span><span class="format">;</span>'."\n";
465
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '<span class="format">}</span>';
466
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = "\n\n";
467
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = "\n".'<span class="format">}</span>'."\n\n";
468
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = ' ';
469
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '<span class="comment">'; // before comment
470
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '</span>'."\n"; // after comment
471
- $GLOBALS['csstidy']['predefined_templates']['low_compression'][] = "\n";
21
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
22
  * @package csstidy
23
  * @author Florian Schmitz (floele at gmail dot com) 2005
24
+ * @author Nikolay Matsievsky (speed at webo dot name) 2010
25
  */
26
 
 
 
 
 
 
 
 
 
 
27
  /**
28
  * All whitespace allowed in CSS
29
  *
30
+ * @global array $data['csstidy']['whitespace']
31
  * @version 1.0
32
  */
33
+ $data['csstidy']['whitespace'] = array(' ',"\n","\t","\r","\x0B");
34
 
35
  /**
36
  * All CSS tokens used by csstidy
37
  *
38
+ * @global string $data['csstidy']['tokens']
39
  * @version 1.0
40
  */
41
+ $data['csstidy']['tokens'] = '/@}{;:=\'"(,\\!$%&)*+.<>?[]^`|~';
42
 
43
  /**
44
  * All CSS units (CSS 3 units included)
45
  *
46
  * @see compress_numbers()
47
+ * @global array $data['csstidy']['units']
48
  * @version 1.0
49
  */
50
+ $data['csstidy']['units'] = array('in','cm','mm','pt','pc','px','rem','em','%','ex','gd','vw','vh','vm','deg','grad','rad','turn','ms','s','khz','hz','ch','vmin','vmax','dpi','dpcm','dppx');
51
 
52
  /**
53
  * Available at-rules
54
  *
55
+ * @global array $data['csstidy']['at_rules']
56
+ * @version 1.1
57
  */
58
+ $data['csstidy']['at_rules'] = array('page' => 'is','font-face' => 'atis','charset' => 'iv', 'import' => 'iv','namespace' => 'iv','media' => 'at','keyframes' => 'at','-moz-keyframes' => 'at','-o-keyframes' => 'at','-webkit-keyframes' => 'at','-ms-keyframes' => 'at');
59
 
60
  /**
61
  * Properties that need a value with unit
62
  *
63
  * @todo CSS3 properties
64
  * @see compress_numbers();
65
+ * @global array $data['csstidy']['unit_values']
66
  * @version 1.2
67
  */
68
+ $data['csstidy']['unit_values'] = array ('background', 'background-position', 'background-size', 'border', 'border-top', 'border-right', 'border-bottom', 'border-left', 'border-width',
69
+ 'border-top-width', 'border-right-width', 'border-left-width', 'border-bottom-width', 'bottom', 'border-spacing', 'column-gap', 'column-width',
70
+ 'font-size', 'height', 'left', 'margin', 'margin-top', 'margin-right', 'margin-bottom', 'margin-left', 'max-height',
71
+ 'max-width', 'min-height', 'min-width', 'outline', 'outline-width', 'padding', 'padding-top', 'padding-right',
72
+ 'padding-bottom', 'padding-left', 'perspective', 'right', 'top', 'text-indent', 'letter-spacing', 'word-spacing', 'width');
73
 
74
  /**
75
  * Properties that allow <color> as value
76
  *
77
  * @todo CSS3 properties
78
  * @see compress_numbers();
79
+ * @global array $data['csstidy']['color_values']
80
  * @version 1.0
81
  */
82
+ $data['csstidy']['color_values'] = array();
83
+ $data['csstidy']['color_values'][] = 'background-color';
84
+ $data['csstidy']['color_values'][] = 'border-color';
85
+ $data['csstidy']['color_values'][] = 'border-top-color';
86
+ $data['csstidy']['color_values'][] = 'border-right-color';
87
+ $data['csstidy']['color_values'][] = 'border-bottom-color';
88
+ $data['csstidy']['color_values'][] = 'border-left-color';
89
+ $data['csstidy']['color_values'][] = 'color';
90
+ $data['csstidy']['color_values'][] = 'outline-color';
91
+ $data['csstidy']['color_values'][] = 'column-rule-color';
92
 
93
  /**
94
  * Default values for the background properties
95
  *
96
  * @todo Possibly property names will change during CSS3 development
97
+ * @global array $data['csstidy']['background_prop_default']
98
  * @see dissolve_short_bg()
99
  * @see merge_bg()
100
  * @version 1.0
101
  */
102
+ $data['csstidy']['background_prop_default'] = array();
103
+ $data['csstidy']['background_prop_default']['background-image'] = 'none';
104
+ $data['csstidy']['background_prop_default']['background-size'] = 'auto';
105
+ $data['csstidy']['background_prop_default']['background-repeat'] = 'repeat';
106
+ $data['csstidy']['background_prop_default']['background-position'] = '0 0';
107
+ $data['csstidy']['background_prop_default']['background-attachment'] = 'scroll';
108
+ $data['csstidy']['background_prop_default']['background-clip'] = 'border';
109
+ $data['csstidy']['background_prop_default']['background-origin'] = 'padding';
110
+ $data['csstidy']['background_prop_default']['background-color'] = 'transparent';
111
+
112
+ /**
113
+ * Default values for the font properties
114
+ *
115
+ * @global array $data['csstidy']['font_prop_default']
116
+ * @see merge_fonts()
117
+ * @version 1.3
118
+ */
119
+ $data['csstidy']['font_prop_default'] = array();
120
+ $data['csstidy']['font_prop_default']['font-style'] = 'normal';
121
+ $data['csstidy']['font_prop_default']['font-variant'] = 'normal';
122
+ $data['csstidy']['font_prop_default']['font-weight'] = 'normal';
123
+ $data['csstidy']['font_prop_default']['font-size'] = '';
124
+ $data['csstidy']['font_prop_default']['line-height'] = '';
125
+ $data['csstidy']['font_prop_default']['font-family'] = '';
126
 
127
  /**
128
  * A list of non-W3C color names which get replaced by their hex-codes
129
  *
130
+ * @global array $data['csstidy']['replace_colors']
131
  * @see cut_color()
132
  * @version 1.0
133
  */
134
+ $data['csstidy']['replace_colors'] = array();
135
+ $data['csstidy']['replace_colors']['aliceblue'] = '#f0f8ff';
136
+ $data['csstidy']['replace_colors']['antiquewhite'] = '#faebd7';
137
+ $data['csstidy']['replace_colors']['aquamarine'] = '#7fffd4';
138
+ $data['csstidy']['replace_colors']['azure'] = '#f0ffff';
139
+ $data['csstidy']['replace_colors']['beige'] = '#f5f5dc';
140
+ $data['csstidy']['replace_colors']['bisque'] = '#ffe4c4';
141
+ $data['csstidy']['replace_colors']['blanchedalmond'] = '#ffebcd';
142
+ $data['csstidy']['replace_colors']['blueviolet'] = '#8a2be2';
143
+ $data['csstidy']['replace_colors']['brown'] = '#a52a2a';
144
+ $data['csstidy']['replace_colors']['burlywood'] = '#deb887';
145
+ $data['csstidy']['replace_colors']['cadetblue'] = '#5f9ea0';
146
+ $data['csstidy']['replace_colors']['chartreuse'] = '#7fff00';
147
+ $data['csstidy']['replace_colors']['chocolate'] = '#d2691e';
148
+ $data['csstidy']['replace_colors']['coral'] = '#ff7f50';
149
+ $data['csstidy']['replace_colors']['cornflowerblue'] = '#6495ed';
150
+ $data['csstidy']['replace_colors']['cornsilk'] = '#fff8dc';
151
+ $data['csstidy']['replace_colors']['crimson'] = '#dc143c';
152
+ $data['csstidy']['replace_colors']['cyan'] = '#00ffff';
153
+ $data['csstidy']['replace_colors']['darkblue'] = '#00008b';
154
+ $data['csstidy']['replace_colors']['darkcyan'] = '#008b8b';
155
+ $data['csstidy']['replace_colors']['darkgoldenrod'] = '#b8860b';
156
+ $data['csstidy']['replace_colors']['darkgray'] = '#a9a9a9';
157
+ $data['csstidy']['replace_colors']['darkgreen'] = '#006400';
158
+ $data['csstidy']['replace_colors']['darkkhaki'] = '#bdb76b';
159
+ $data['csstidy']['replace_colors']['darkmagenta'] = '#8b008b';
160
+ $data['csstidy']['replace_colors']['darkolivegreen'] = '#556b2f';
161
+ $data['csstidy']['replace_colors']['darkorange'] = '#ff8c00';
162
+ $data['csstidy']['replace_colors']['darkorchid'] = '#9932cc';
163
+ $data['csstidy']['replace_colors']['darkred'] = '#8b0000';
164
+ $data['csstidy']['replace_colors']['darksalmon'] = '#e9967a';
165
+ $data['csstidy']['replace_colors']['darkseagreen'] = '#8fbc8f';
166
+ $data['csstidy']['replace_colors']['darkslateblue'] = '#483d8b';
167
+ $data['csstidy']['replace_colors']['darkslategray'] = '#2f4f4f';
168
+ $data['csstidy']['replace_colors']['darkturquoise'] = '#00ced1';
169
+ $data['csstidy']['replace_colors']['darkviolet'] = '#9400d3';
170
+ $data['csstidy']['replace_colors']['deeppink'] = '#ff1493';
171
+ $data['csstidy']['replace_colors']['deepskyblue'] = '#00bfff';
172
+ $data['csstidy']['replace_colors']['dimgray'] = '#696969';
173
+ $data['csstidy']['replace_colors']['dodgerblue'] = '#1e90ff';
174
+ $data['csstidy']['replace_colors']['feldspar'] = '#d19275';
175
+ $data['csstidy']['replace_colors']['firebrick'] = '#b22222';
176
+ $data['csstidy']['replace_colors']['floralwhite'] = '#fffaf0';
177
+ $data['csstidy']['replace_colors']['forestgreen'] = '#228b22';
178
+ $data['csstidy']['replace_colors']['gainsboro'] = '#dcdcdc';
179
+ $data['csstidy']['replace_colors']['ghostwhite'] = '#f8f8ff';
180
+ $data['csstidy']['replace_colors']['gold'] = '#ffd700';
181
+ $data['csstidy']['replace_colors']['goldenrod'] = '#daa520';
182
+ $data['csstidy']['replace_colors']['greenyellow'] = '#adff2f';
183
+ $data['csstidy']['replace_colors']['honeydew'] = '#f0fff0';
184
+ $data['csstidy']['replace_colors']['hotpink'] = '#ff69b4';
185
+ $data['csstidy']['replace_colors']['indianred'] = '#cd5c5c';
186
+ $data['csstidy']['replace_colors']['indigo'] = '#4b0082';
187
+ $data['csstidy']['replace_colors']['ivory'] = '#fffff0';
188
+ $data['csstidy']['replace_colors']['khaki'] = '#f0e68c';
189
+ $data['csstidy']['replace_colors']['lavender'] = '#e6e6fa';
190
+ $data['csstidy']['replace_colors']['lavenderblush'] = '#fff0f5';
191
+ $data['csstidy']['replace_colors']['lawngreen'] = '#7cfc00';
192
+ $data['csstidy']['replace_colors']['lemonchiffon'] = '#fffacd';
193
+ $data['csstidy']['replace_colors']['lightblue'] = '#add8e6';
194
+ $data['csstidy']['replace_colors']['lightcoral'] = '#f08080';
195
+ $data['csstidy']['replace_colors']['lightcyan'] = '#e0ffff';
196
+ $data['csstidy']['replace_colors']['lightgoldenrodyellow'] = '#fafad2';
197
+ $data['csstidy']['replace_colors']['lightgrey'] = '#d3d3d3';
198
+ $data['csstidy']['replace_colors']['lightgreen'] = '#90ee90';
199
+ $data['csstidy']['replace_colors']['lightpink'] = '#ffb6c1';
200
+ $data['csstidy']['replace_colors']['lightsalmon'] = '#ffa07a';
201
+ $data['csstidy']['replace_colors']['lightseagreen'] = '#20b2aa';
202
+ $data['csstidy']['replace_colors']['lightskyblue'] = '#87cefa';
203
+ $data['csstidy']['replace_colors']['lightslateblue'] = '#8470ff';
204
+ $data['csstidy']['replace_colors']['lightslategray'] = '#778899';
205
+ $data['csstidy']['replace_colors']['lightsteelblue'] = '#b0c4de';
206
+ $data['csstidy']['replace_colors']['lightyellow'] = '#ffffe0';
207
+ $data['csstidy']['replace_colors']['limegreen'] = '#32cd32';
208
+ $data['csstidy']['replace_colors']['linen'] = '#faf0e6';
209
+ $data['csstidy']['replace_colors']['magenta'] = '#ff00ff';
210
+ $data['csstidy']['replace_colors']['mediumaquamarine'] = '#66cdaa';
211
+ $data['csstidy']['replace_colors']['mediumblue'] = '#0000cd';
212
+ $data['csstidy']['replace_colors']['mediumorchid'] = '#ba55d3';
213
+ $data['csstidy']['replace_colors']['mediumpurple'] = '#9370d8';
214
+ $data['csstidy']['replace_colors']['mediumseagreen'] = '#3cb371';
215
+ $data['csstidy']['replace_colors']['mediumslateblue'] = '#7b68ee';
216
+ $data['csstidy']['replace_colors']['mediumspringgreen'] = '#00fa9a';
217
+ $data['csstidy']['replace_colors']['mediumturquoise'] = '#48d1cc';
218
+ $data['csstidy']['replace_colors']['mediumvioletred'] = '#c71585';
219
+ $data['csstidy']['replace_colors']['midnightblue'] = '#191970';
220
+ $data['csstidy']['replace_colors']['mintcream'] = '#f5fffa';
221
+ $data['csstidy']['replace_colors']['mistyrose'] = '#ffe4e1';
222
+ $data['csstidy']['replace_colors']['moccasin'] = '#ffe4b5';
223
+ $data['csstidy']['replace_colors']['navajowhite'] = '#ffdead';
224
+ $data['csstidy']['replace_colors']['oldlace'] = '#fdf5e6';
225
+ $data['csstidy']['replace_colors']['olivedrab'] = '#6b8e23';
226
+ $data['csstidy']['replace_colors']['orangered'] = '#ff4500';
227
+ $data['csstidy']['replace_colors']['orchid'] = '#da70d6';
228
+ $data['csstidy']['replace_colors']['palegoldenrod'] = '#eee8aa';
229
+ $data['csstidy']['replace_colors']['palegreen'] = '#98fb98';
230
+ $data['csstidy']['replace_colors']['paleturquoise'] = '#afeeee';
231
+ $data['csstidy']['replace_colors']['palevioletred'] = '#d87093';
232
+ $data['csstidy']['replace_colors']['papayawhip'] = '#ffefd5';
233
+ $data['csstidy']['replace_colors']['peachpuff'] = '#ffdab9';
234
+ $data['csstidy']['replace_colors']['peru'] = '#cd853f';
235
+ $data['csstidy']['replace_colors']['pink'] = '#ffc0cb';
236
+ $data['csstidy']['replace_colors']['plum'] = '#dda0dd';
237
+ $data['csstidy']['replace_colors']['powderblue'] = '#b0e0e6';
238
+ $data['csstidy']['replace_colors']['rosybrown'] = '#bc8f8f';
239
+ $data['csstidy']['replace_colors']['royalblue'] = '#4169e1';
240
+ $data['csstidy']['replace_colors']['saddlebrown'] = '#8b4513';
241
+ $data['csstidy']['replace_colors']['salmon'] = '#fa8072';
242
+ $data['csstidy']['replace_colors']['sandybrown'] = '#f4a460';
243
+ $data['csstidy']['replace_colors']['seagreen'] = '#2e8b57';
244
+ $data['csstidy']['replace_colors']['seashell'] = '#fff5ee';
245
+ $data['csstidy']['replace_colors']['sienna'] = '#a0522d';
246
+ $data['csstidy']['replace_colors']['skyblue'] = '#87ceeb';
247
+ $data['csstidy']['replace_colors']['slateblue'] = '#6a5acd';
248
+ $data['csstidy']['replace_colors']['slategray'] = '#708090';
249
+ $data['csstidy']['replace_colors']['snow'] = '#fffafa';
250
+ $data['csstidy']['replace_colors']['springgreen'] = '#00ff7f';
251
+ $data['csstidy']['replace_colors']['steelblue'] = '#4682b4';
252
+ $data['csstidy']['replace_colors']['tan'] = '#d2b48c';
253
+ $data['csstidy']['replace_colors']['thistle'] = '#d8bfd8';
254
+ $data['csstidy']['replace_colors']['tomato'] = '#ff6347';
255
+ $data['csstidy']['replace_colors']['turquoise'] = '#40e0d0';
256
+ $data['csstidy']['replace_colors']['violet'] = '#ee82ee';
257
+ $data['csstidy']['replace_colors']['violetred'] = '#d02090';
258
+ $data['csstidy']['replace_colors']['wheat'] = '#f5deb3';
259
+ $data['csstidy']['replace_colors']['whitesmoke'] = '#f5f5f5';
260
+ $data['csstidy']['replace_colors']['yellowgreen'] = '#9acd32';
 
261
 
262
  /**
263
  * A list of all shorthand properties that are devided into four properties and/or have four subvalues
264
  *
265
+ * @global array $data['csstidy']['shorthands']
266
  * @todo Are there new ones in CSS3?
267
  * @see dissolve_4value_shorthands()
268
  * @see merge_4value_shorthands()
269
  * @version 1.0
270
  */
271
+ $data['csstidy']['shorthands'] = array();
272
+ $data['csstidy']['shorthands']['border-color'] = array('border-top-color','border-right-color','border-bottom-color','border-left-color');
273
+ $data['csstidy']['shorthands']['border-style'] = array('border-top-style','border-right-style','border-bottom-style','border-left-style');
274
+ $data['csstidy']['shorthands']['border-width'] = array('border-top-width','border-right-width','border-bottom-width','border-left-width');
275
+ $data['csstidy']['shorthands']['margin'] = array('margin-top','margin-right','margin-bottom','margin-left');
276
+ $data['csstidy']['shorthands']['padding'] = array('padding-top','padding-right','padding-bottom','padding-left');
277
+ $data['csstidy']['shorthands']['-moz-border-radius'] = 0;
278
 
279
  /**
280
  * All CSS Properties. Needed for csstidy::property_is_next()
281
  *
282
+ * @global array $data['csstidy']['all_properties']
283
+ * @version 1.1
 
284
  * @see csstidy::property_is_next()
285
  */
286
+ $data['csstidy']['all_properties']['alignment-adjust'] = 'CSS3.0';
287
+ $data['csstidy']['all_properties']['alignment-baseline'] = 'CSS3.0';
288
+ $data['csstidy']['all_properties']['animation'] = 'CSS3.0';
289
+ $data['csstidy']['all_properties']['animation-delay'] = 'CSS3.0';
290
+ $data['csstidy']['all_properties']['animation-direction'] = 'CSS3.0';
291
+ $data['csstidy']['all_properties']['animation-duration'] = 'CSS3.0';
292
+ $data['csstidy']['all_properties']['animation-iteration-count'] = 'CSS3.0';
293
+ $data['csstidy']['all_properties']['animation-name'] = 'CSS3.0';
294
+ $data['csstidy']['all_properties']['animation-play-state'] = 'CSS3.0';
295
+ $data['csstidy']['all_properties']['animation-timing-function'] = 'CSS3.0';
296
+ $data['csstidy']['all_properties']['appearance'] = 'CSS3.0';
297
+ $data['csstidy']['all_properties']['azimuth'] = 'CSS2.0,CSS2.1,CSS3.0';
298
+ $data['csstidy']['all_properties']['backface-visibility'] = 'CSS3.0';
299
+ $data['csstidy']['all_properties']['background'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
300
+ $data['csstidy']['all_properties']['background-attachment'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
301
+ $data['csstidy']['all_properties']['background-clip'] = 'CSS3.0';
302
+ $data['csstidy']['all_properties']['background-color'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
303
+ $data['csstidy']['all_properties']['background-image'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
304
+ $data['csstidy']['all_properties']['background-origin'] = 'CSS3.0';
305
+ $data['csstidy']['all_properties']['background-position'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
306
+ $data['csstidy']['all_properties']['background-repeat'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
307
+ $data['csstidy']['all_properties']['background-size'] = 'CSS3.0';
308
+ $data['csstidy']['all_properties']['baseline-shift'] = 'CSS3.0';
309
+ $data['csstidy']['all_properties']['binding'] = 'CSS3.0';
310
+ $data['csstidy']['all_properties']['bleed'] = 'CSS3.0';
311
+ $data['csstidy']['all_properties']['bookmark-label'] = 'CSS3.0';
312
+ $data['csstidy']['all_properties']['bookmark-level'] = 'CSS3.0';
313
+ $data['csstidy']['all_properties']['bookmark-state'] = 'CSS3.0';
314
+ $data['csstidy']['all_properties']['bookmark-target'] = 'CSS3.0';
315
+ $data['csstidy']['all_properties']['border'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
316
+ $data['csstidy']['all_properties']['border-bottom'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
317
+ $data['csstidy']['all_properties']['border-bottom-color'] = 'CSS2.0,CSS2.1,CSS3.0';
318
+ $data['csstidy']['all_properties']['border-bottom-left-radius'] = 'CSS3.0';
319
+ $data['csstidy']['all_properties']['border-bottom-right-radius'] = 'CSS3.0';
320
+ $data['csstidy']['all_properties']['border-bottom-style'] = 'CSS2.0,CSS2.1,CSS3.0';
321
+ $data['csstidy']['all_properties']['border-bottom-width'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
322
+ $data['csstidy']['all_properties']['border-collapse'] = 'CSS2.0,CSS2.1,CSS3.0';
323
+ $data['csstidy']['all_properties']['border-color'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
324
+ $data['csstidy']['all_properties']['border-image'] = 'CSS3.0';
325
+ $data['csstidy']['all_properties']['border-image-outset'] = 'CSS3.0';
326
+ $data['csstidy']['all_properties']['border-image-repeat'] = 'CSS3.0';
327
+ $data['csstidy']['all_properties']['border-image-slice'] = 'CSS3.0';
328
+ $data['csstidy']['all_properties']['border-image-source'] = 'CSS3.0';
329
+ $data['csstidy']['all_properties']['border-image-width'] = 'CSS3.0';
330
+ $data['csstidy']['all_properties']['border-left'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
331
+ $data['csstidy']['all_properties']['border-left-color'] = 'CSS2.0,CSS2.1,CSS3.0';
332
+ $data['csstidy']['all_properties']['border-left-style'] = 'CSS2.0,CSS2.1,CSS3.0';
333
+ $data['csstidy']['all_properties']['border-left-width'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
334
+ $data['csstidy']['all_properties']['border-radius'] = 'CSS3.0';
335
+ $data['csstidy']['all_properties']['border-right'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
336
+ $data['csstidy']['all_properties']['border-right-color'] = 'CSS2.0,CSS2.1,CSS3.0';
337
+ $data['csstidy']['all_properties']['border-right-style'] = 'CSS2.0,CSS2.1,CSS3.0';
338
+ $data['csstidy']['all_properties']['border-right-width'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
339
+ $data['csstidy']['all_properties']['border-spacing'] = 'CSS2.0,CSS2.1,CSS3.0';
340
+ $data['csstidy']['all_properties']['border-style'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
341
+ $data['csstidy']['all_properties']['border-top'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
342
+ $data['csstidy']['all_properties']['border-top-color'] = 'CSS2.0,CSS2.1,CSS3.0';
343
+ $data['csstidy']['all_properties']['border-top-left-radius'] = 'CSS3.0';
344
+ $data['csstidy']['all_properties']['border-top-right-radius'] = 'CSS3.0';
345
+ $data['csstidy']['all_properties']['border-top-style'] = 'CSS2.0,CSS2.1,CSS3.0';
346
+ $data['csstidy']['all_properties']['border-top-width'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
347
+ $data['csstidy']['all_properties']['border-width'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
348
+ $data['csstidy']['all_properties']['bottom'] = 'CSS2.0,CSS2.1,CSS3.0';
349
+ $data['csstidy']['all_properties']['box-decoration-break'] = 'CSS3.0';
350
+ $data['csstidy']['all_properties']['box-shadow'] = 'CSS3.0';
351
+ $data['csstidy']['all_properties']['box-sizing'] = 'CSS3.0';
352
+ $data['csstidy']['all_properties']['break-after'] = 'CSS3.0';
353
+ $data['csstidy']['all_properties']['break-before'] = 'CSS3.0';
354
+ $data['csstidy']['all_properties']['break-inside'] = 'CSS3.0';
355
+ $data['csstidy']['all_properties']['caption-side'] = 'CSS2.0,CSS2.1,CSS3.0';
356
+ $data['csstidy']['all_properties']['clear'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
357
+ $data['csstidy']['all_properties']['clip'] = 'CSS2.0,CSS2.1,CSS3.0';
358
+ $data['csstidy']['all_properties']['color'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
359
+ $data['csstidy']['all_properties']['color-profile'] = 'CSS3.0';
360
+ $data['csstidy']['all_properties']['column-count'] = 'CSS3.0';
361
+ $data['csstidy']['all_properties']['column-fill'] = 'CSS3.0';
362
+ $data['csstidy']['all_properties']['column-gap'] = 'CSS3.0';
363
+ $data['csstidy']['all_properties']['column-rule'] = 'CSS3.0';
364
+ $data['csstidy']['all_properties']['column-rule-color'] = 'CSS3.0';
365
+ $data['csstidy']['all_properties']['column-rule-style'] = 'CSS3.0';
366
+ $data['csstidy']['all_properties']['column-rule-width'] = 'CSS3.0';
367
+ $data['csstidy']['all_properties']['column-span'] = 'CSS3.0';
368
+ $data['csstidy']['all_properties']['column-width'] = 'CSS3.0';
369
+ $data['csstidy']['all_properties']['columns'] = 'CSS3.0';
370
+ $data['csstidy']['all_properties']['content'] = 'CSS2.0,CSS2.1,CSS3.0';
371
+ $data['csstidy']['all_properties']['counter-increment'] = 'CSS2.0,CSS2.1,CSS3.0';
372
+ $data['csstidy']['all_properties']['counter-reset'] = 'CSS2.0,CSS2.1,CSS3.0';
373
+ $data['csstidy']['all_properties']['crop'] = 'CSS3.0';
374
+ $data['csstidy']['all_properties']['cue'] = 'CSS2.0,CSS2.1,CSS3.0';
375
+ $data['csstidy']['all_properties']['cue-after'] = 'CSS2.0,CSS2.1,CSS3.0';
376
+ $data['csstidy']['all_properties']['cue-before'] = 'CSS2.0,CSS2.1,CSS3.0';
377
+ $data['csstidy']['all_properties']['cursor'] = 'CSS2.0,CSS2.1,CSS3.0';
378
+ $data['csstidy']['all_properties']['direction'] = 'CSS2.0,CSS2.1,CSS3.0';
379
+ $data['csstidy']['all_properties']['display'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
380
+ $data['csstidy']['all_properties']['dominant-baseline'] = 'CSS3.0';
381
+ $data['csstidy']['all_properties']['drop-initial-after-adjust'] = 'CSS3.0';
382
+ $data['csstidy']['all_properties']['drop-initial-after-align'] = 'CSS3.0';
383
+ $data['csstidy']['all_properties']['drop-initial-before-adjust'] = 'CSS3.0';
384
+ $data['csstidy']['all_properties']['drop-initial-before-align'] = 'CSS3.0';
385
+ $data['csstidy']['all_properties']['drop-initial-size'] = 'CSS3.0';
386
+ $data['csstidy']['all_properties']['drop-initial-value'] = 'CSS3.0';
387
+ $data['csstidy']['all_properties']['elevation'] = 'CSS2.0,CSS2.1,CSS3.0';
388
+ $data['csstidy']['all_properties']['empty-cells'] = 'CSS2.0,CSS2.1,CSS3.0';
389
+ $data['csstidy']['all_properties']['fit'] = 'CSS3.0';
390
+ $data['csstidy']['all_properties']['fit-position'] = 'CSS3.0';
391
+ $data['csstidy']['all_properties']['flex-align'] = 'CSS3.0';
392
+ $data['csstidy']['all_properties']['flex-flow'] = 'CSS3.0';
393
+ $data['csstidy']['all_properties']['flex-line-pack'] = 'CSS3.0';
394
+ $data['csstidy']['all_properties']['flex-order'] = 'CSS3.0';
395
+ $data['csstidy']['all_properties']['flex-pack'] = 'CSS3.0';
396
+ $data['csstidy']['all_properties']['float'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
397
+ $data['csstidy']['all_properties']['float-offset'] = 'CSS3.0';
398
+ $data['csstidy']['all_properties']['font'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
399
+ $data['csstidy']['all_properties']['font-family'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
400
+ $data['csstidy']['all_properties']['font-size'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
401
+ $data['csstidy']['all_properties']['font-size-adjust'] = 'CSS2.0,CSS3.0';
402
+ $data['csstidy']['all_properties']['font-stretch'] = 'CSS2.0,CSS3.0';
403
+ $data['csstidy']['all_properties']['font-style'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
404
+ $data['csstidy']['all_properties']['font-variant'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
405
+ $data['csstidy']['all_properties']['font-weight'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
406
+ $data['csstidy']['all_properties']['grid-columns'] = 'CSS3.0';
407
+ $data['csstidy']['all_properties']['grid-rows'] = 'CSS3.0';
408
+ $data['csstidy']['all_properties']['hanging-punctuation'] = 'CSS3.0';
409
+ $data['csstidy']['all_properties']['height'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
410
+ $data['csstidy']['all_properties']['hyphenate-after'] = 'CSS3.0';
411
+ $data['csstidy']['all_properties']['hyphenate-before'] = 'CSS3.0';
412
+ $data['csstidy']['all_properties']['hyphenate-character'] = 'CSS3.0';
413
+ $data['csstidy']['all_properties']['hyphenate-lines'] = 'CSS3.0';
414
+ $data['csstidy']['all_properties']['hyphenate-resource'] = 'CSS3.0';
415
+ $data['csstidy']['all_properties']['hyphens'] = 'CSS3.0';
416
+ $data['csstidy']['all_properties']['icon'] = 'CSS3.0';
417
+ $data['csstidy']['all_properties']['image-orientation'] = 'CSS3.0';
418
+ $data['csstidy']['all_properties']['image-rendering'] = 'CSS3.0';
419
+ $data['csstidy']['all_properties']['image-resolution'] = 'CSS3.0';
420
+ $data['csstidy']['all_properties']['inline-box-align'] = 'CSS3.0';
421
+ $data['csstidy']['all_properties']['left'] = 'CSS2.0,CSS2.1,CSS3.0';
422
+ $data['csstidy']['all_properties']['letter-spacing'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
423
+ $data['csstidy']['all_properties']['line-break'] = 'CSS3.0';
424
+ $data['csstidy']['all_properties']['line-height'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
425
+ $data['csstidy']['all_properties']['line-stacking'] = 'CSS3.0';
426
+ $data['csstidy']['all_properties']['line-stacking-ruby'] = 'CSS3.0';
427
+ $data['csstidy']['all_properties']['line-stacking-shift'] = 'CSS3.0';
428
+ $data['csstidy']['all_properties']['line-stacking-strategy'] = 'CSS3.0';
429
+ $data['csstidy']['all_properties']['list-style'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
430
+ $data['csstidy']['all_properties']['list-style-image'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
431
+ $data['csstidy']['all_properties']['list-style-position'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
432
+ $data['csstidy']['all_properties']['list-style-type'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
433
+ $data['csstidy']['all_properties']['margin'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
434
+ $data['csstidy']['all_properties']['margin-bottom'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
435
+ $data['csstidy']['all_properties']['margin-left'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
436
+ $data['csstidy']['all_properties']['margin-right'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
437
+ $data['csstidy']['all_properties']['margin-top'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
438
+ $data['csstidy']['all_properties']['marker-offset'] = 'CSS2.0,CSS3.0';
439
+ $data['csstidy']['all_properties']['marks'] = 'CSS2.0,CSS3.0';
440
+ $data['csstidy']['all_properties']['marquee-direction'] = 'CSS3.0';
441
+ $data['csstidy']['all_properties']['marquee-loop'] = 'CSS3.0';
442
+ $data['csstidy']['all_properties']['marquee-play-count'] = 'CSS3.0';
443
+ $data['csstidy']['all_properties']['marquee-speed'] = 'CSS3.0';
444
+ $data['csstidy']['all_properties']['marquee-style'] = 'CSS3.0';
445
+ $data['csstidy']['all_properties']['max-height'] = 'CSS2.0,CSS2.1,CSS3.0';
446
+ $data['csstidy']['all_properties']['max-width'] = 'CSS2.0,CSS2.1,CSS3.0';
447
+ $data['csstidy']['all_properties']['min-height'] = 'CSS2.0,CSS2.1,CSS3.0';
448
+ $data['csstidy']['all_properties']['min-width'] = 'CSS2.0,CSS2.1,CSS3.0';
449
+ $data['csstidy']['all_properties']['move-to'] = 'CSS3.0';
450
+ $data['csstidy']['all_properties']['nav-down'] = 'CSS3.0';
451
+ $data['csstidy']['all_properties']['nav-index'] = 'CSS3.0';
452
+ $data['csstidy']['all_properties']['nav-left'] = 'CSS3.0';
453
+ $data['csstidy']['all_properties']['nav-right'] = 'CSS3.0';
454
+ $data['csstidy']['all_properties']['nav-up'] = 'CSS3.0';
455
+ $data['csstidy']['all_properties']['opacity'] = 'CSS3.0';
456
+ $data['csstidy']['all_properties']['orphans'] = 'CSS2.0,CSS2.1,CSS3.0';
457
+ $data['csstidy']['all_properties']['outline'] = 'CSS2.0,CSS2.1,CSS3.0';
458
+ $data['csstidy']['all_properties']['outline-color'] = 'CSS2.0,CSS2.1,CSS3.0';
459
+ $data['csstidy']['all_properties']['outline-offset'] = 'CSS3.0';
460
+ $data['csstidy']['all_properties']['outline-style'] = 'CSS2.0,CSS2.1,CSS3.0';
461
+ $data['csstidy']['all_properties']['outline-width'] = 'CSS2.0,CSS2.1,CSS3.0';
462
+ $data['csstidy']['all_properties']['overflow'] = 'CSS2.0,CSS2.1,CSS3.0';
463
+ $data['csstidy']['all_properties']['overflow-style'] = 'CSS3.0';
464
+ $data['csstidy']['all_properties']['overflow-wrap'] = 'CSS3.0';
465
+ $data['csstidy']['all_properties']['overflow-x'] = 'CSS3.0';
466
+ $data['csstidy']['all_properties']['overflow-y'] = 'CSS3.0';
467
+ $data['csstidy']['all_properties']['padding'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
468
+ $data['csstidy']['all_properties']['padding-bottom'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
469
+ $data['csstidy']['all_properties']['padding-left'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
470
+ $data['csstidy']['all_properties']['padding-right'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
471
+ $data['csstidy']['all_properties']['padding-top'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
472
+ $data['csstidy']['all_properties']['page'] = 'CSS2.0,CSS3.0';
473
+ $data['csstidy']['all_properties']['page-break-after'] = 'CSS2.0,CSS2.1,CSS3.0';
474
+ $data['csstidy']['all_properties']['page-break-before'] = 'CSS2.0,CSS2.1,CSS3.0';
475
+ $data['csstidy']['all_properties']['page-break-inside'] = 'CSS2.0,CSS2.1,CSS3.0';
476
+ $data['csstidy']['all_properties']['page-policy'] = 'CSS3.0';
477
+ $data['csstidy']['all_properties']['pause'] = 'CSS2.0,CSS2.1,CSS3.0';
478
+ $data['csstidy']['all_properties']['pause-after'] = 'CSS2.0,CSS2.1,CSS3.0';
479
+ $data['csstidy']['all_properties']['pause-before'] = 'CSS2.0,CSS2.1,CSS3.0';
480
+ $data['csstidy']['all_properties']['perspective'] = 'CSS3.0';
481
+ $data['csstidy']['all_properties']['perspective-origin'] = 'CSS3.0';
482
+ $data['csstidy']['all_properties']['phonemes'] = 'CSS3.0';
483
+ $data['csstidy']['all_properties']['pitch'] = 'CSS2.0,CSS2.1,CSS3.0';
484
+ $data['csstidy']['all_properties']['pitch-range'] = 'CSS2.0,CSS2.1,CSS3.0';
485
+ $data['csstidy']['all_properties']['play-during'] = 'CSS2.0,CSS2.1,CSS3.0';
486
+ $data['csstidy']['all_properties']['position'] = 'CSS2.0,CSS2.1,CSS3.0';
487
+ $data['csstidy']['all_properties']['presentation-level'] = 'CSS3.0';
488
+ $data['csstidy']['all_properties']['punctuation-trim'] = 'CSS3.0';
489
+ $data['csstidy']['all_properties']['quotes'] = 'CSS2.0,CSS2.1,CSS3.0';
490
+ $data['csstidy']['all_properties']['rendering-intent'] = 'CSS3.0';
491
+ $data['csstidy']['all_properties']['resize'] = 'CSS3.0';
492
+ $data['csstidy']['all_properties']['rest'] = 'CSS3.0';
493
+ $data['csstidy']['all_properties']['rest-after'] = 'CSS3.0';
494
+ $data['csstidy']['all_properties']['rest-before'] = 'CSS3.0';
495
+ $data['csstidy']['all_properties']['richness'] = 'CSS2.0,CSS2.1,CSS3.0';
496
+ $data['csstidy']['all_properties']['right'] = 'CSS2.0,CSS2.1,CSS3.0';
497
+ $data['csstidy']['all_properties']['rotation'] = 'CSS3.0';
498
+ $data['csstidy']['all_properties']['rotation-point'] = 'CSS3.0';
499
+ $data['csstidy']['all_properties']['ruby-align'] = 'CSS3.0';
500
+ $data['csstidy']['all_properties']['ruby-overhang'] = 'CSS3.0';
501
+ $data['csstidy']['all_properties']['ruby-position'] = 'CSS3.0';
502
+ $data['csstidy']['all_properties']['ruby-span'] = 'CSS3.0';
503
+ $data['csstidy']['all_properties']['size'] = 'CSS2.0,CSS3.0';
504
+ $data['csstidy']['all_properties']['speak'] = 'CSS2.0,CSS2.1,CSS3.0';
505
+ $data['csstidy']['all_properties']['speak-header'] = 'CSS2.0,CSS2.1,CSS3.0';
506
+ $data['csstidy']['all_properties']['speak-numeral'] = 'CSS2.0,CSS2.1,CSS3.0';
507
+ $data['csstidy']['all_properties']['speak-punctuation'] = 'CSS2.0,CSS2.1,CSS3.0';
508
+ $data['csstidy']['all_properties']['speech-rate'] = 'CSS2.0,CSS2.1,CSS3.0';
509
+ $data['csstidy']['all_properties']['src'] = 'CSS3.0';
510
+ $data['csstidy']['all_properties']['stress'] = 'CSS2.0,CSS2.1,CSS3.0';
511
+ $data['csstidy']['all_properties']['string-set'] = 'CSS3.0';
512
+ $data['csstidy']['all_properties']['tab-size'] = 'CSS3.0';
513
+ $data['csstidy']['all_properties']['table-layout'] = 'CSS2.0,CSS2.1,CSS3.0';
514
+ $data['csstidy']['all_properties']['target'] = 'CSS3.0';
515
+ $data['csstidy']['all_properties']['target-name'] = 'CSS3.0';
516
+ $data['csstidy']['all_properties']['target-new'] = 'CSS3.0';
517
+ $data['csstidy']['all_properties']['target-position'] = 'CSS3.0';
518
+ $data['csstidy']['all_properties']['text-align'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
519
+ $data['csstidy']['all_properties']['text-align-last'] = 'CSS3.0';
520
+ $data['csstidy']['all_properties']['text-decoration'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
521
+ $data['csstidy']['all_properties']['text-decoration-color'] = 'CSS3.0';
522
+ $data['csstidy']['all_properties']['text-decoration-line'] = 'CSS3.0';
523
+ $data['csstidy']['all_properties']['text-decoration-skip'] = 'CSS3.0';
524
+ $data['csstidy']['all_properties']['text-decoration-style'] = 'CSS3.0';
525
+ $data['csstidy']['all_properties']['text-emphasis'] = 'CSS3.0';
526
+ $data['csstidy']['all_properties']['text-emphasis-color'] = 'CSS3.0';
527
+ $data['csstidy']['all_properties']['text-emphasis-position'] = 'CSS3.0';
528
+ $data['csstidy']['all_properties']['text-emphasis-style'] = 'CSS3.0';
529
+ $data['csstidy']['all_properties']['text-height'] = 'CSS3.0';
530
+ $data['csstidy']['all_properties']['text-indent'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
531
+ $data['csstidy']['all_properties']['text-justify'] = 'CSS3.0';
532
+ $data['csstidy']['all_properties']['text-outline'] = 'CSS3.0';
533
+ $data['csstidy']['all_properties']['text-shadow'] = 'CSS2.0,CSS3.0';
534
+ $data['csstidy']['all_properties']['text-space-collapse'] = 'CSS3.0';
535
+ $data['csstidy']['all_properties']['text-transform'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
536
+ $data['csstidy']['all_properties']['text-underline-position'] = 'CSS3.0';
537
+ $data['csstidy']['all_properties']['text-wrap'] = 'CSS3.0';
538
+ $data['csstidy']['all_properties']['top'] = 'CSS2.0,CSS2.1,CSS3.0';
539
+ $data['csstidy']['all_properties']['transform'] = 'CSS3.0';
540
+ $data['csstidy']['all_properties']['transform-origin'] = 'CSS3.0';
541
+ $data['csstidy']['all_properties']['transform-style'] = 'CSS3.0';
542
+ $data['csstidy']['all_properties']['transition'] = 'CSS3.0';
543
+ $data['csstidy']['all_properties']['transition-delay'] = 'CSS3.0';
544
+ $data['csstidy']['all_properties']['transition-duration'] = 'CSS3.0';
545
+ $data['csstidy']['all_properties']['transition-property'] = 'CSS3.0';
546
+ $data['csstidy']['all_properties']['transition-timing-function'] = 'CSS3.0';
547
+ $data['csstidy']['all_properties']['unicode-bidi'] = 'CSS2.0,CSS2.1,CSS3.0';
548
+ $data['csstidy']['all_properties']['vertical-align'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
549
+ $data['csstidy']['all_properties']['visibility'] = 'CSS2.0,CSS2.1,CSS3.0';
550
+ $data['csstidy']['all_properties']['voice-balance'] = 'CSS3.0';
551
+ $data['csstidy']['all_properties']['voice-duration'] = 'CSS3.0';
552
+ $data['csstidy']['all_properties']['voice-family'] = 'CSS2.0,CSS2.1,CSS3.0';
553
+ $data['csstidy']['all_properties']['voice-pitch'] = 'CSS3.0';
554
+ $data['csstidy']['all_properties']['voice-pitch-range'] = 'CSS3.0';
555
+ $data['csstidy']['all_properties']['voice-rate'] = 'CSS3.0';
556
+ $data['csstidy']['all_properties']['voice-stress'] = 'CSS3.0';
557
+ $data['csstidy']['all_properties']['voice-volume'] = 'CSS3.0';
558
+ $data['csstidy']['all_properties']['volume'] = 'CSS2.0,CSS2.1,CSS3.0';
559
+ $data['csstidy']['all_properties']['white-space'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
560
+ $data['csstidy']['all_properties']['widows'] = 'CSS2.0,CSS2.1,CSS3.0';
561
+ $data['csstidy']['all_properties']['width'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
562
+ $data['csstidy']['all_properties']['word-break'] = 'CSS3.0';
563
+ $data['csstidy']['all_properties']['word-spacing'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
564
+ $data['csstidy']['all_properties']['word-wrap'] = 'CSS3.0';
565
+ $data['csstidy']['all_properties']['z-index'] = 'CSS2.0,CSS2.1,CSS3.0';
566
+
567
+ /**
568
+ * An array containing all properties that can accept a quoted string as a value.
569
+ *
570
+ * @global array $data['csstidy']['quoted_string_properties']
571
+ */
572
+ $data['csstidy']['quoted_string_properties'] = array('content', 'font-family', 'quotes');
573
+
574
+ /**
575
+ * An array containing all properties that can be defined multiple times without being overwritten.
576
+ *
577
+ * @global array $data['csstidy']['quoted_string_properties']
578
+ */
579
+ $data['csstidy']['multiple_properties'] = array('background', 'background-image');
580
 
581
  /**
582
  * An array containing all predefined templates.
583
  *
584
+ * @global array $data['csstidy']['predefined_templates']
585
  * @version 1.0
586
  * @see csstidy::load_template()
587
  */
588
+ $data['csstidy']['predefined_templates']['default'][] = '<span class="at">'; //string before @rule
589
+ $data['csstidy']['predefined_templates']['default'][] = '</span> <span class="format">{</span>'."\n"; //bracket after @-rule
590
+ $data['csstidy']['predefined_templates']['default'][] = '<span class="selector">'; //string before selector
591
+ $data['csstidy']['predefined_templates']['default'][] = '</span> <span class="format">{</span>'."\n"; //bracket after selector
592
+ $data['csstidy']['predefined_templates']['default'][] = '<span class="property">'; //string before property
593
+ $data['csstidy']['predefined_templates']['default'][] = '</span><span class="value">'; //string after property+before value
594
+ $data['csstidy']['predefined_templates']['default'][] = '</span><span class="format">;</span>'."\n"; //string after value
595
+ $data['csstidy']['predefined_templates']['default'][] = '<span class="format">}</span>'; //closing bracket - selector
596
+ $data['csstidy']['predefined_templates']['default'][] = "\n\n"; //space between blocks {...}
597
+ $data['csstidy']['predefined_templates']['default'][] = "\n".'<span class="format">}</span>'. "\n\n"; //closing bracket @-rule
598
+ $data['csstidy']['predefined_templates']['default'][] = ''; //indent in @-rule
599
+ $data['csstidy']['predefined_templates']['default'][] = '<span class="comment">'; // before comment
600
+ $data['csstidy']['predefined_templates']['default'][] = '</span>'."\n"; // after comment
601
+ $data['csstidy']['predefined_templates']['default'][] = "\n"; // after each line @-rule
602
 
603
+ $data['csstidy']['predefined_templates']['high_compression'][] = '<span class="at">';
604
+ $data['csstidy']['predefined_templates']['high_compression'][] = '</span> <span class="format">{</span>'."\n";
605
+ $data['csstidy']['predefined_templates']['high_compression'][] = '<span class="selector">';
606
+ $data['csstidy']['predefined_templates']['high_compression'][] = '</span><span class="format">{</span>';
607
+ $data['csstidy']['predefined_templates']['high_compression'][] = '<span class="property">';
608
+ $data['csstidy']['predefined_templates']['high_compression'][] = '</span><span class="value">';
609
+ $data['csstidy']['predefined_templates']['high_compression'][] = '</span><span class="format">;</span>';
610
+ $data['csstidy']['predefined_templates']['high_compression'][] = '<span class="format">}</span>';
611
+ $data['csstidy']['predefined_templates']['high_compression'][] = "\n";
612
+ $data['csstidy']['predefined_templates']['high_compression'][] = "\n". '<span class="format">}'."\n".'</span>';
613
+ $data['csstidy']['predefined_templates']['high_compression'][] = '';
614
+ $data['csstidy']['predefined_templates']['high_compression'][] = '<span class="comment">'; // before comment
615
+ $data['csstidy']['predefined_templates']['high_compression'][] = '</span>'; // after comment
616
+ $data['csstidy']['predefined_templates']['high_compression'][] = "\n";
617
 
618
+ $data['csstidy']['predefined_templates']['highest_compression'][] = '<span class="at">';
619
+ $data['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="format">{</span>';
620
+ $data['csstidy']['predefined_templates']['highest_compression'][] = '<span class="selector">';
621
+ $data['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="format">{</span>';
622
+ $data['csstidy']['predefined_templates']['highest_compression'][] = '<span class="property">';
623
+ $data['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="value">';
624
+ $data['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="format">;</span>';
625
+ $data['csstidy']['predefined_templates']['highest_compression'][] = '<span class="format">}</span>';
626
+ $data['csstidy']['predefined_templates']['highest_compression'][] = '';
627
+ $data['csstidy']['predefined_templates']['highest_compression'][] = '<span class="format">}</span>';
628
+ $data['csstidy']['predefined_templates']['highest_compression'][] = '';
629
+ $data['csstidy']['predefined_templates']['highest_compression'][] = '<span class="comment">'; // before comment
630
+ $data['csstidy']['predefined_templates']['highest_compression'][] = '</span>'; // after comment
631
+ $data['csstidy']['predefined_templates']['highest_compression'][] = '';
632
 
633
+ $data['csstidy']['predefined_templates']['low_compression'][] = '<span class="at">';
634
+ $data['csstidy']['predefined_templates']['low_compression'][] = '</span> <span class="format">{</span>'."\n";
635
+ $data['csstidy']['predefined_templates']['low_compression'][] = '<span class="selector">';
636
+ $data['csstidy']['predefined_templates']['low_compression'][] = '</span>'."\n".'<span class="format">{</span>'."\n";
637
+ $data['csstidy']['predefined_templates']['low_compression'][] = ' <span class="property">';
638
+ $data['csstidy']['predefined_templates']['low_compression'][] = '</span><span class="value">';
639
+ $data['csstidy']['predefined_templates']['low_compression'][] = '</span><span class="format">;</span>'."\n";
640
+ $data['csstidy']['predefined_templates']['low_compression'][] = '<span class="format">}</span>';
641
+ $data['csstidy']['predefined_templates']['low_compression'][] = "\n\n";
642
+ $data['csstidy']['predefined_templates']['low_compression'][] = "\n".'<span class="format">}</span>'."\n\n";
643
+ $data['csstidy']['predefined_templates']['low_compression'][] = ' ';
644
+ $data['csstidy']['predefined_templates']['low_compression'][] = '<span class="comment">'; // before comment
645
+ $data['csstidy']['predefined_templates']['low_compression'][] = '</span>'."\n"; // after comment
646
+ $data['csstidy']['predefined_templates']['low_compression'][] = "\n";
lib/CSSTidy/index.html CHANGED
File without changes
lib/Db/mssql.php CHANGED
File without changes
lib/Google/Auth/Abstract.php CHANGED
File without changes
lib/Google/Auth/AppIdentity.php CHANGED
File without changes
lib/Google/Auth/AssertionCredentials.php CHANGED
File without changes
lib/Google/Auth/Exception.php CHANGED
File without changes
lib/Google/Auth/LoginTicket.php CHANGED
File without changes
lib/Google/Auth/OAuth2.php CHANGED
File without changes
lib/Google/Auth/Simple.php CHANGED
File without changes
lib/Google/Cache/Abstract.php CHANGED
File without changes
lib/Google/Cache/Apc.php CHANGED
File without changes
lib/Google/Cache/Exception.php CHANGED
File without changes
lib/Google/Cache/File.php CHANGED
File without changes
lib/Google/Cache/Memcache.php CHANGED
File without changes
lib/Google/Cache/Null.php CHANGED
File without changes
lib/Google/Client.php CHANGED
File without changes
lib/Google/Collection.php CHANGED
File without changes
lib/Google/Config.php CHANGED
File without changes
lib/Google/Exception.php CHANGED
File without changes
lib/Google/Http/Batch.php CHANGED
File without changes
lib/Google/Http/CacheParser.php CHANGED
File without changes
lib/Google/Http/MediaFileUpload.php CHANGED
File without changes
lib/Google/Http/REST.php CHANGED
File without changes
lib/Google/Http/Request.php CHANGED
File without changes
lib/Google/IO/Abstract.php CHANGED
File without changes
lib/Google/IO/Curl.php CHANGED
File without changes
lib/Google/IO/Exception.php CHANGED
File without changes
lib/Google/IO/Stream.php CHANGED
File without changes
lib/Google/IO/cacerts.pem CHANGED
File without changes
lib/Google/Model.php CHANGED
File without changes
lib/Google/Service.php CHANGED
File without changes
lib/Google/Service/Drive.php CHANGED
File without changes
lib/Google/Service/Exception.php CHANGED
File without changes
lib/Google/Service/Oauth2.php CHANGED
File without changes
lib/Google/Service/Resource.php CHANGED
File without changes
lib/Google/Signer/Abstract.php CHANGED
File without changes
lib/Google/Signer/P12.php CHANGED
File without changes
lib/Google/Utils.php CHANGED
File without changes
lib/Google/Utils/URITemplate.php CHANGED
File without changes
lib/Google/Verifier/Abstract.php CHANGED
File without changes
lib/Google/Verifier/Pem.php CHANGED
File without changes
lib/Minify/CSSmin.php CHANGED
File without changes
lib/Minify/DooDigestAuth.php CHANGED
File without changes
lib/Minify/HTTP/ConditionalGet.php CHANGED
File without changes
lib/Minify/HTTP/Encoder.php CHANGED
File without changes
lib/Minify/HTTP/index.html CHANGED
File without changes
lib/Minify/JSMin.php CHANGED
File without changes
lib/Minify/JSMinPlus.php CHANGED
File without changes
lib/Minify/Minify.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /**
3
- * Class Minify
4
  * @package Minify
5
  */
6
-
7
  /**
8
  * Minify - Combines, minifies, and caches JavaScript and CSS files on demand.
9
  *
@@ -23,7 +23,7 @@
23
  * @link http://code.google.com/p/minify/
24
  */
25
  class Minify0_Minify {
26
-
27
  const VERSION = '2.1.7';
28
  const TYPE_CSS = 'text/css';
29
  const TYPE_HTML = 'text/html';
@@ -31,20 +31,20 @@ class Minify0_Minify {
31
  // Apache default and what Yahoo! uses..
32
  const TYPE_JS = 'application/x-javascript';
33
  const URL_DEBUG = 'http://code.google.com/p/minify/wiki/Debugging';
34
-
35
  /**
36
  * How many hours behind are the file modification times of uploaded files?
37
- *
38
  * If you upload files from Windows to a non-Windows server, Windows may report
39
- * incorrect mtimes for the files. Immediately after modifying and uploading a
40
- * file, use the touch command to update the mtime on the server. If the mtime
41
- * jumps ahead by a number of hours, set this variable to that number. If the mtime
42
  * moves back, this should not be needed.
43
  *
44
  * @var int $uploaderHoursBehind
45
  */
46
  public static $uploaderHoursBehind = 0;
47
-
48
  /**
49
  * If this string is not empty AND the serve() option 'bubbleCssImports' is
50
  * NOT set, then serve() will check CSS files for @import declarations that
@@ -57,7 +57,7 @@ class Minify0_Minify {
57
 
58
  /**
59
  * Has the DOCUMENT_ROOT been set in user code?
60
- *
61
  * @var bool
62
  */
63
  public static $isDocRootSet = false;
@@ -71,13 +71,13 @@ class Minify0_Minify {
71
  /**
72
  * Specify a cache object (with identical interface as Minify_Cache_File) or
73
  * a path to use with Minify_Cache_File.
74
- *
75
- * If not called, Minify will not use a cache and, for each 200 response, will
76
  * need to recombine files, minify and encode the output.
77
  *
78
  * @param mixed $cache object with identical interface as Minify_Cache_File or
79
  * a directory path, or null to disable caching. (default = '')
80
- *
81
  * @param bool $fileLocking (default = true) This only applies if the first
82
  * parameter is a string.
83
  *
@@ -91,76 +91,76 @@ class Minify0_Minify {
91
  self::$_cache = $cache;
92
  }
93
  }
94
-
95
  /**
96
- * Serve a request for a minified file.
97
- *
98
  * Here are the available options and defaults in the base controller:
99
- *
100
- * 'isPublic' : send "public" instead of "private" in Cache-Control
101
  * headers, allowing shared caches to cache the output. (default true)
102
- *
103
  * 'quiet' : set to true to have serve() return an array rather than sending
104
  * any headers/output (default false)
105
- *
106
  * 'encodeOutput' : set to false to disable content encoding, and not send
107
  * the Vary header (default true)
108
- *
109
- * 'encodeMethod' : generally you should let this be determined by
110
  * HTTP_Encoder (leave null), but you can force a particular encoding
111
  * to be returned, by setting this to 'gzip' or '' (no encoding)
112
- *
113
  * 'encodeLevel' : level of encoding compression (0 to 9, default 9)
114
- *
115
  * 'contentTypeCharset' : appended to the Content-Type header sent. Set to a falsey
116
- * value to remove. (default 'utf-8')
117
- *
118
  * 'maxAge' : set this to the number of seconds the client should use its cache
119
  * before revalidating with the server. This sets Cache-Control: max-age and the
120
  * Expires header. Unlike the old 'setExpires' setting, this setting will NOT
121
  * prevent conditional GETs. Note this has nothing to do with server-side caching.
122
- *
123
  * 'rewriteCssUris' : If true, serve() will automatically set the 'currentDir'
124
  * minifier option to enable URI rewriting in CSS files (default true)
125
- *
126
  * 'bubbleCssImports' : If true, all @import declarations in combined CSS
127
  * files will be move to the top. Note this may alter effective CSS values
128
  * due to a change in order. (default false)
129
- *
130
  * 'debug' : set to true to minify all sources with the 'Lines' controller, which
131
  * eases the debugging of combined files. This also prevents 304 responses.
132
  * @see Minify_Lines::minify()
133
- *
134
- * 'minifiers' : to override Minify's default choice of minifier function for
135
- * a particular content-type, specify your callback under the key of the
136
  * content-type:
137
  * <code>
138
  * // call customCssMinifier($css) for all CSS minification
139
  * $options['minifiers'][Minify::TYPE_CSS] = 'customCssMinifier';
140
- *
141
  * // don't minify Javascript at all
142
  * $options['minifiers'][Minify::TYPE_JS] = '';
143
  * </code>
144
- *
145
  * 'minifierOptions' : to send options to the minifier function, specify your options
146
- * under the key of the content-type. E.g. To send the CSS minifier an option:
147
  * <code>
148
- * // give CSS minifier array('optionName' => 'optionValue') as 2nd argument
149
  * $options['minifierOptions'][Minify::TYPE_CSS]['optionName'] = 'optionValue';
150
  * </code>
151
- *
152
- * 'contentType' : (optional) this is only needed if your file extension is not
153
  * js/css/html. The given content-type will be sent regardless of source file
154
  * extension, so this should not be used in a Groups config with other
155
  * Javascript/CSS files.
156
- *
157
  * Any controller options are documented in that controller's setupSources() method.
158
- *
159
  * @param mixed $controller instance of subclass of Minify_Controller_Base or string
160
  * name of controller. E.g. 'Files'
161
- *
162
  * @param array $options controller/serve options
163
- *
164
  * @return null|array if the 'quiet' option is set to true, an array
165
  * with keys "success" (bool), "statusCode" (int), "content" (string), and
166
  * "headers" (array).
@@ -179,13 +179,13 @@ class Minify0_Minify {
179
  $controller = new $class();
180
  /* @var Minify_Controller_Base $controller */
181
  }
182
-
183
  // set up controller sources and mix remaining options with
184
  // controller defaults
185
  $options = $controller->setupSources($options);
186
  $options = $controller->analyzeSources($options);
187
  self::$_options = $controller->mixInDefaultOptions($options);
188
-
189
  // check request validity
190
  if (! $controller->sources) {
191
  // invalid request!
@@ -201,14 +201,14 @@ class Minify0_Minify {
201
  );
202
  }
203
  }
204
-
205
  self::$_controller = $controller;
206
-
207
  if (self::$_options['debug']) {
208
  self::_setupDebug($controller->sources);
209
  self::$_options['maxAge'] = 0;
210
  }
211
-
212
  // determine encoding
213
  if (self::$_options['encodeOutput']) {
214
  $sendVary = true;
@@ -226,7 +226,7 @@ class Minify0_Minify {
226
  } else {
227
  self::$_options['encodeMethod'] = ''; // identity (no encoding)
228
  }
229
-
230
  // check client cache
231
  $cgOptions = array(
232
  'lastModifiedTime' => self::$_options['lastModifiedTime']
@@ -245,7 +245,7 @@ class Minify0_Minify {
245
  // client's cache is valid
246
  if (! self::$_options['quiet']) {
247
  self::$lastServed = array(
248
- 'fullCacheId' =>self::_getCacheId() .
249
  (self::$_options['encodeMethod']
250
  ? '.' . self::$_options['encodeMethod']
251
  : '')
@@ -270,7 +270,7 @@ class Minify0_Minify {
270
  && self::$_options['rewriteCssUris']) {
271
  foreach($controller->sources as $key => $source) {
272
  if (self::$_options['rewriteCssUris']
273
- && $source->filepath
274
  && !isset($source->minifyOptions['currentDir'])
275
  && !isset($source->minifyOptions['prependRelativePath'])
276
  ) {
@@ -280,12 +280,12 @@ class Minify0_Minify {
280
  $source->minifyOptions['processCssImports'] = self::$_options['processCssImports'];
281
  }
282
  }
283
-
284
  // check server cache
285
  $content = array();
286
  if (null !== self::$_cache && ! self::$_options['debug']) {
287
  // using cache
288
- // the goal is to use only the cache methods to sniff the length and
289
  // output the content, as they do not require ever loading the file into
290
  // memory.
291
  $cacheId = self::_getCacheId();
@@ -293,7 +293,7 @@ class Minify0_Minify {
293
  ? $cacheId . '.' . self::$_options['encodeMethod']
294
  : $cacheId;
295
  // check cache for valid entry
296
- $cacheIsReady = self::$_cache->isValid($fullCacheId, self::$_options['lastModifiedTime']);
297
  if ($cacheIsReady) {
298
  $cacheContentLength = self::$_cache->getSize($fullCacheId);
299
  } else {
@@ -310,10 +310,10 @@ class Minify0_Minify {
310
  self::$_cache->store($cacheId, $content);
311
  if (function_exists('gzencode') && self::$_options['encodeMethod'] && self::$_options['encodeOutput']) {
312
  $compressed = $content;
313
- $compressed['content'] = gzencode($content['content'],
314
  self::$_options['encodeLevel']);
315
 
316
- self::$_cache->store($cacheId . '.' . self::$_options['encodeMethod'],
317
  $compressed);
318
  }
319
  }
@@ -342,7 +342,7 @@ class Minify0_Minify {
342
  }
343
  // still need to encode
344
  }
345
-
346
  // add headers
347
  if ( !defined( 'W3TC_MINIFY_CONTENT_LENGTH_OFF' ) ) {
348
  $headers['Content-Length'] = $cacheIsReady
@@ -352,7 +352,7 @@ class Minify0_Minify {
352
  : strlen($content['content'])
353
  );
354
  }
355
-
356
  $headers['Content-Type'] = self::$_options['contentTypeCharset']
357
  ? self::$_options['contentType'] . '; charset=' . self::$_options['contentTypeCharset']
358
  : self::$_options['contentType'];
@@ -379,7 +379,7 @@ class Minify0_Minify {
379
  } else {
380
  if ($cacheIsReady)
381
  $content = self::$_cache->fetch($fullCacheId);
382
-
383
  return array(
384
  'success' => true
385
  ,'statusCode' => 200
@@ -388,14 +388,14 @@ class Minify0_Minify {
388
  );
389
  }
390
  }
391
-
392
  private static $lastServed = array();
393
 
394
  public static function getUsageStatistics() {
395
  if (isset(self::$lastServed['fullCacheId']))
396
  self::$lastServed = self::$_cache->fetch(self::$lastServed['fullCacheId']);
397
 
398
- if (isset(self::$lastServed['content']) &&
399
  isset(self::$lastServed['originalLength'])) {
400
  return array(
401
  'content_type' => self::$_options['contentType'],
@@ -411,12 +411,12 @@ class Minify0_Minify {
411
  * Return combined minified content for a set of sources
412
  *
413
  * No internal caching will be used and the content will not be HTTP encoded.
414
- *
415
  * @param array $sources array of filepaths and/or Minify_Source objects
416
- *
417
  * @param array $options (optional) array of options for serve. By default
418
  * these are already set: quiet = true, encodeMethod = '', lastModifiedTime = 0.
419
- *
420
  * @return string
421
  */
422
  public static function combine($sources, $options = array())
@@ -433,10 +433,10 @@ class Minify0_Minify {
433
  self::$_cache = $cache;
434
  return $out['content'];
435
  }
436
-
437
  /**
438
  * Set $_SERVER['DOCUMENT_ROOT']. On IIS, the value is created from SCRIPT_FILENAME and SCRIPT_NAME.
439
- *
440
  * @param string $docRoot value to use for DOCUMENT_ROOT
441
  */
442
  public static function setDocRoot($docRoot = '')
@@ -462,14 +462,14 @@ class Minify0_Minify {
462
  * @var Minify_Cache_File
463
  */
464
  private static $_cache = null;
465
-
466
  /**
467
  * Active controller for current request
468
  *
469
  * @var Minify_Controller_Base
470
  */
471
  protected static $_controller = null;
472
-
473
  /**
474
  * Options for current request
475
  *
@@ -511,7 +511,7 @@ class Minify0_Minify {
511
  );
512
  }
513
  }
514
-
515
  /**
516
  * Combines sources and minifies the result.
517
  *
@@ -522,7 +522,7 @@ class Minify0_Minify {
522
  protected static function _combineMinify()
523
  {
524
  $type = self::$_options['contentType']; // ease readability
525
-
526
  // when combining scripts, make sure all statements separated and
527
  // trailing single line comment is terminated
528
  $implodeSeparator = ($type === self::TYPE_JS)
@@ -597,11 +597,11 @@ class Minify0_Minify {
597
  } while ($source);
598
 
599
  $content = implode($implodeSeparator, $content);
600
-
601
  if ($type === self::TYPE_CSS && false !== strpos($content, '@import')) {
602
  $content = self::_handleCssImports($content);
603
  }
604
-
605
  // do any post-processing (esp. for editing build URIs)
606
  if (self::$_options['postprocessorRequire']) {
607
  require_once self::$_options['postprocessorRequire'];
@@ -614,7 +614,7 @@ class Minify0_Minify {
614
  'content' => $content
615
  );
616
  }
617
-
618
  /**
619
  * Sets cache ID
620
  * @param string $cacheId
@@ -634,8 +634,8 @@ class Minify0_Minify {
634
 
635
  /**
636
  * Make a unique cache id for for this request.
637
- *
638
- * Any settings that could affect output are taken into consideration
639
  *
640
  * @param string $prefix
641
  *
@@ -652,7 +652,7 @@ class Minify0_Minify {
652
  ,self::$_options['processCssImports']
653
  ))));
654
  }
655
-
656
  /**
657
  * Bubble CSS @imports to the top or prepend a warning if an import is detected not at the top.
658
  *
1
  <?php
2
  /**
3
+ * Class Minify
4
  * @package Minify
5
  */
6
+
7
  /**
8
  * Minify - Combines, minifies, and caches JavaScript and CSS files on demand.
9
  *
23
  * @link http://code.google.com/p/minify/
24
  */
25
  class Minify0_Minify {
26
+
27
  const VERSION = '2.1.7';
28
  const TYPE_CSS = 'text/css';
29
  const TYPE_HTML = 'text/html';
31
  // Apache default and what Yahoo! uses..
32
  const TYPE_JS = 'application/x-javascript';
33
  const URL_DEBUG = 'http://code.google.com/p/minify/wiki/Debugging';
34
+
35
  /**
36
  * How many hours behind are the file modification times of uploaded files?
37
+ *
38
  * If you upload files from Windows to a non-Windows server, Windows may report
39
+ * incorrect mtimes for the files. Immediately after modifying and uploading a
40
+ * file, use the touch command to update the mtime on the server. If the mtime
41
+ * jumps ahead by a number of hours, set this variable to that number. If the mtime
42
  * moves back, this should not be needed.
43
  *
44
  * @var int $uploaderHoursBehind
45
  */
46
  public static $uploaderHoursBehind = 0;
47
+
48
  /**
49
  * If this string is not empty AND the serve() option 'bubbleCssImports' is
50
  * NOT set, then serve() will check CSS files for @import declarations that
57
 
58
  /**
59
  * Has the DOCUMENT_ROOT been set in user code?
60
+ *
61
  * @var bool
62
  */
63
  public static $isDocRootSet = false;
71
  /**
72
  * Specify a cache object (with identical interface as Minify_Cache_File) or
73
  * a path to use with Minify_Cache_File.
74
+ *
75
+ * If not called, Minify will not use a cache and, for each 200 response, will
76
  * need to recombine files, minify and encode the output.
77
  *
78
  * @param mixed $cache object with identical interface as Minify_Cache_File or
79
  * a directory path, or null to disable caching. (default = '')
80
+ *
81
  * @param bool $fileLocking (default = true) This only applies if the first
82
  * parameter is a string.
83
  *
91
  self::$_cache = $cache;
92
  }
93
  }
94
+
95
  /**
96
+ * Serve a request for a minified file.
97
+ *
98
  * Here are the available options and defaults in the base controller:
99
+ *
100
+ * 'isPublic' : send "public" instead of "private" in Cache-Control
101
  * headers, allowing shared caches to cache the output. (default true)
102
+ *
103
  * 'quiet' : set to true to have serve() return an array rather than sending
104
  * any headers/output (default false)
105
+ *
106
  * 'encodeOutput' : set to false to disable content encoding, and not send
107
  * the Vary header (default true)
108
+ *
109
+ * 'encodeMethod' : generally you should let this be determined by
110
  * HTTP_Encoder (leave null), but you can force a particular encoding
111
  * to be returned, by setting this to 'gzip' or '' (no encoding)
112
+ *
113
  * 'encodeLevel' : level of encoding compression (0 to 9, default 9)
114
+ *
115
  * 'contentTypeCharset' : appended to the Content-Type header sent. Set to a falsey
116
+ * value to remove. (default 'utf-8')
117
+ *
118
  * 'maxAge' : set this to the number of seconds the client should use its cache
119
  * before revalidating with the server. This sets Cache-Control: max-age and the
120
  * Expires header. Unlike the old 'setExpires' setting, this setting will NOT
121
  * prevent conditional GETs. Note this has nothing to do with server-side caching.
122
+ *
123
  * 'rewriteCssUris' : If true, serve() will automatically set the 'currentDir'
124
  * minifier option to enable URI rewriting in CSS files (default true)
125
+ *
126
  * 'bubbleCssImports' : If true, all @import declarations in combined CSS
127
  * files will be move to the top. Note this may alter effective CSS values
128
  * due to a change in order. (default false)
129
+ *
130
  * 'debug' : set to true to minify all sources with the 'Lines' controller, which
131
  * eases the debugging of combined files. This also prevents 304 responses.
132
  * @see Minify_Lines::minify()
133
+ *
134
+ * 'minifiers' : to override Minify's default choice of minifier function for
135
+ * a particular content-type, specify your callback under the key of the
136
  * content-type:
137
  * <code>
138
  * // call customCssMinifier($css) for all CSS minification
139
  * $options['minifiers'][Minify::TYPE_CSS] = 'customCssMinifier';
140
+ *
141
  * // don't minify Javascript at all
142
  * $options['minifiers'][Minify::TYPE_JS] = '';
143
  * </code>
144
+ *
145
  * 'minifierOptions' : to send options to the minifier function, specify your options
146
+ * under the key of the content-type. E.g. To send the CSS minifier an option:
147
  * <code>
148
+ * // give CSS minifier array('optionName' => 'optionValue') as 2nd argument
149
  * $options['minifierOptions'][Minify::TYPE_CSS]['optionName'] = 'optionValue';
150
  * </code>
151
+ *
152
+ * 'contentType' : (optional) this is only needed if your file extension is not
153
  * js/css/html. The given content-type will be sent regardless of source file
154
  * extension, so this should not be used in a Groups config with other
155
  * Javascript/CSS files.
156
+ *
157
  * Any controller options are documented in that controller's setupSources() method.
158
+ *
159
  * @param mixed $controller instance of subclass of Minify_Controller_Base or string
160
  * name of controller. E.g. 'Files'
161
+ *
162
  * @param array $options controller/serve options
163
+ *
164
  * @return null|array if the 'quiet' option is set to true, an array
165
  * with keys "success" (bool), "statusCode" (int), "content" (string), and
166
  * "headers" (array).
179
  $controller = new $class();
180
  /* @var Minify_Controller_Base $controller */
181
  }
182
+
183
  // set up controller sources and mix remaining options with
184
  // controller defaults
185
  $options = $controller->setupSources($options);
186
  $options = $controller->analyzeSources($options);
187
  self::$_options = $controller->mixInDefaultOptions($options);
188
+
189
  // check request validity
190
  if (! $controller->sources) {
191
  // invalid request!
201
  );
202
  }
203
  }
204
+
205
  self::$_controller = $controller;
206
+
207
  if (self::$_options['debug']) {
208
  self::_setupDebug($controller->sources);
209
  self::$_options['maxAge'] = 0;
210
  }
211
+
212
  // determine encoding
213
  if (self::$_options['encodeOutput']) {
214
  $sendVary = true;
226
  } else {
227
  self::$_options['encodeMethod'] = ''; // identity (no encoding)
228
  }
229
+
230
  // check client cache
231
  $cgOptions = array(
232
  'lastModifiedTime' => self::$_options['lastModifiedTime']
245
  // client's cache is valid
246
  if (! self::$_options['quiet']) {
247
  self::$lastServed = array(
248
+ 'fullCacheId' =>self::_getCacheId() .
249
  (self::$_options['encodeMethod']
250
  ? '.' . self::$_options['encodeMethod']
251
  : '')
270
  && self::$_options['rewriteCssUris']) {
271
  foreach($controller->sources as $key => $source) {
272
  if (self::$_options['rewriteCssUris']
273
+ && $source->filepath
274
  && !isset($source->minifyOptions['currentDir'])
275
  && !isset($source->minifyOptions['prependRelativePath'])
276
  ) {
280
  $source->minifyOptions['processCssImports'] = self::$_options['processCssImports'];
281
  }
282
  }
283
+
284
  // check server cache
285
  $content = array();
286
  if (null !== self::$_cache && ! self::$_options['debug']) {
287
  // using cache
288
+ // the goal is to use only the cache methods to sniff the length and
289
  // output the content, as they do not require ever loading the file into
290
  // memory.
291
  $cacheId = self::_getCacheId();
293
  ? $cacheId . '.' . self::$_options['encodeMethod']
294
  : $cacheId;
295
  // check cache for valid entry
296
+ $cacheIsReady = self::$_cache->isValid($fullCacheId, self::$_options['lastModifiedTime']);
297
  if ($cacheIsReady) {
298
  $cacheContentLength = self::$_cache->getSize($fullCacheId);
299
  } else {
310
  self::$_cache->store($cacheId, $content);
311
  if (function_exists('gzencode') && self::$_options['encodeMethod'] && self::$_options['encodeOutput']) {
312
  $compressed = $content;
313
+ $compressed['content'] = gzencode($content['content'],
314
  self::$_options['encodeLevel']);
315
 
316
+ self::$_cache->store($cacheId . '_' . self::$_options['encodeMethod'],
317
  $compressed);
318
  }
319
  }
342
  }
343
  // still need to encode
344
  }
345
+
346
  // add headers
347
  if ( !defined( 'W3TC_MINIFY_CONTENT_LENGTH_OFF' ) ) {
348
  $headers['Content-Length'] = $cacheIsReady
352
  : strlen($content['content'])
353
  );
354
  }
355
+
356
  $headers['Content-Type'] = self::$_options['contentTypeCharset']
357
  ? self::$_options['contentType'] . '; charset=' . self::$_options['contentTypeCharset']
358
  : self::$_options['contentType'];
379
  } else {
380
  if ($cacheIsReady)
381
  $content = self::$_cache->fetch($fullCacheId);
382
+
383
  return array(
384
  'success' => true
385
  ,'statusCode' => 200
388
  );
389
  }
390
  }
391
+
392
  private static $lastServed = array();
393
 
394
  public static function getUsageStatistics() {
395
  if (isset(self::$lastServed['fullCacheId']))
396
  self::$lastServed = self::$_cache->fetch(self::$lastServed['fullCacheId']);
397
 
398
+ if (isset(self::$lastServed['content']) &&
399
  isset(self::$lastServed['originalLength'])) {
400
  return array(
401
  'content_type' => self::$_options['contentType'],
411
  * Return combined minified content for a set of sources
412
  *
413
  * No internal caching will be used and the content will not be HTTP encoded.
414
+ *
415
  * @param array $sources array of filepaths and/or Minify_Source objects
416
+ *
417
  * @param array $options (optional) array of options for serve. By default
418
  * these are already set: quiet = true, encodeMethod = '', lastModifiedTime = 0.
419
+ *
420
  * @return string
421
  */
422
  public static function combine($sources, $options = array())
433
  self::$_cache = $cache;
434
  return $out['content'];
435
  }
436
+
437
  /**
438
  * Set $_SERVER['DOCUMENT_ROOT']. On IIS, the value is created from SCRIPT_FILENAME and SCRIPT_NAME.
439
+ *
440
  * @param string $docRoot value to use for DOCUMENT_ROOT
441
  */
442
  public static function setDocRoot($docRoot = '')
462
  * @var Minify_Cache_File
463
  */
464
  private static $_cache = null;
465
+
466
  /**
467
  * Active controller for current request
468
  *
469
  * @var Minify_Controller_Base
470
  */
471
  protected static $_controller = null;
472
+
473
  /**
474
  * Options for current request
475
  *
511
  );
512
  }
513
  }
514
+
515
  /**
516
  * Combines sources and minifies the result.
517
  *
522
  protected static function _combineMinify()
523
  {
524
  $type = self::$_options['contentType']; // ease readability
525
+
526
  // when combining scripts, make sure all statements separated and
527
  // trailing single line comment is terminated
528
  $implodeSeparator = ($type === self::TYPE_JS)
597
  } while ($source);
598
 
599
  $content = implode($implodeSeparator, $content);
600
+
601
  if ($type === self::TYPE_CSS && false !== strpos($content, '@import')) {
602
  $content = self::_handleCssImports($content);
603
  }
604
+
605
  // do any post-processing (esp. for editing build URIs)
606
  if (self::$_options['postprocessorRequire']) {
607
  require_once self::$_options['postprocessorRequire'];
614
  'content' => $content
615
  );
616
  }
617
+
618
  /**
619
  * Sets cache ID
620
  * @param string $cacheId
634
 
635
  /**
636
  * Make a unique cache id for for this request.
637
+ *
638
+ * Any settings that could affect output are taken into consideration
639
  *
640
  * @param string $prefix
641
  *
652
  ,self::$_options['processCssImports']
653
  ))));
654
  }
655
+
656
  /**
657
  * Bubble CSS @imports to the top or prepend a warning if an import is detected not at the top.
658
  *
lib/Minify/Minify/Build.php CHANGED
File without changes
lib/Minify/Minify/CSS.php CHANGED
File without changes
lib/Minify/Minify/CSS/Compressor.php CHANGED
File without changes
lib/Minify/Minify/CSS/UriRewriter.php CHANGED
File without changes
lib/Minify/Minify/CSS/index.html CHANGED
File without changes
lib/Minify/Minify/CSSTidy.php CHANGED
@@ -4,17 +4,19 @@ class Minify_CSSTidy {
4
  public static function minify($css, $options = array()) {
5
  $options = array_merge(array(
6
  'remove_bslash' => true,
7
- 'compress_colors' => true,
8
- 'compress_font-weight' => true,
9
  'lowercase_s' => false,
10
- 'optimise_shorthands' => 1,
11
  'remove_last_;' => false,
 
12
  'case_properties' => 1,
13
  'sort_properties' => false,
14
  'sort_selectors' => false,
15
- 'merge_selectors' => 2,
 
16
  'discard_invalid_properties' => false,
17
- 'css_level' => 'CSS2.1',
18
  'preserve_css' => false,
19
  'timestamp' => false,
20
  'template' => 'default'
4
  public static function minify($css, $options = array()) {
5
  $options = array_merge(array(
6
  'remove_bslash' => true,
7
+ 'compress_colors' => false,
8
+ 'compress_font-weight' => false,
9
  'lowercase_s' => false,
10
+ 'optimise_shorthands' => 0,
11
  'remove_last_;' => false,
12
+ 'space_before_important' => false,
13
  'case_properties' => 1,
14
  'sort_properties' => false,
15
  'sort_selectors' => false,
16
+ 'merge_selectors' => 0,
17
+ 'discard_invalid_selectors' => false,
18
  'discard_invalid_properties' => false,
19
+ 'css_level' => 'CSS3.0',
20
  'preserve_css' => false,
21
  'timestamp' => false,
22
  'template' => 'default'
lib/Minify/Minify/Cache/File.php CHANGED
@@ -6,296 +6,295 @@
6
  */
7
 
8
  class Minify_Cache_File {
9
-
10
- public function __construct($path = '', $exclude = array(), $locking = false, $flushTimeLimit = 0, $flush_path = null) {
11
- if (! $path) {
12
- $path = self::tmp();
13
- }
14
-
15
- $this->_path = $path;
16
- $this->_exclude = $exclude;
17
- $this->_locking = $locking;
18
- $this->_flushTimeLimit = $flushTimeLimit;
19
-
20
- $this->_flush_path = (is_null($flush_path) ? $path : $flush_path);
21
-
22
- if (!file_exists($this->_path .'/index.html')) {
23
- if (!is_dir($this->_path))
24
- \W3TC\Util_File::mkdir_from_safe($this->_path, W3TC_CACHE_DIR);
25
- @file_put_contents($this->_path .'/index.html', '');
26
- }
27
- }
28
-
29
- /**
30
- * Write data to cache.
31
- *
32
- * @param string $id cache id (e.g. a filename)
33
- *
34
- * @param string $data
35
- *
36
- * @return bool success
37
- */
38
- public function store($id, $data)
39
- {
40
- $path = $this->_path . '/' . $id;
41
- $flag = $this->_locking ? LOCK_EX : null;
42
-
43
- if (is_file($path)) {
44
- @unlink($path);
45
- }
46
-
47
- if (!@file_put_contents($path, $data['content'], $flag)) {
48
- // retry with make dir
49
- \W3TC\Util_File::mkdir_from_safe(dirname($path), W3TC_CACHE_DIR);
50
-
51
- if (!@file_put_contents($path, $data, $flag))
52
- return false;
53
- if (is_file($path . '.old')) {
54
- @unlink($path . '.old');
55
- }
56
- @file_put_contents($path . '.old', $data, $flag);
57
- }
58
-
59
- $content = $data['content'];
60
- unset($data['content']);
61
- if (count($data) > 0)
62
- @file_put_contents($path . '.meta', serialize($data), $flag);
63
-
64
- // write control
65
- $read = $this->fetch($id);
66
- if (!isset($read['content']) || $content != $read['content']) {
67
- @unlink($path);
68
-
69
- return false;
70
- }
71
- return true;
72
- }
73
-
74
- /**
75
- * Get the size of a cache entry
76
- *
77
- * @param string $id cache id (e.g. a filename)
78
- *
79
- * @return int size in bytes
80
- */
81
- public function getSize($id)
82
- {
83
- return filesize($this->_path . '/' . $id);
84
- }
85
-
86
- /**
87
- * Does a valid cache entry exist?
88
- *
89
- * @param string $id cache id (e.g. a filename)
90
- *
91
- * @param int $srcMtime mtime of the original source file(s)
92
- *
93
- * @return bool exists
94
- */
95
- public function isValid($id, $srcMtime)
96
- {
97
- $file = $this->_path . '/' . $id;
98
- return (is_file($file) && (filemtime($file) >= $srcMtime));
99
- }
100
-
101
- /**
102
- * Send the cached content to output
103
- *
104
- * @param string $id cache id (e.g. a filename)
105
- */
106
- public function display($id)
107
- {
108
- $path = $this->_path . '/' . $id;
109
-
110
- $fp = @fopen($path, 'rb');
111
-
112
- if ($fp) {
113
- if ($this->_locking)
114
- @flock($fp, LOCK_SH);
115
- @fpassthru($fp);
116
- if ($this->_locking)
117
- @flock($fp, LOCK_UN);
118
- @fclose($fp);
119
-
120
- return true;
121
- }
122
-
123
- return false;
124
- }
125
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  /**
127
- * Fetch the cached content
128
- *
129
- * @param string $id cache id (e.g. a filename)
130
- *
131
- * @return string
132
- */
133
- public function fetch($id)
134
- {
135
- $path = $this->_path . '/' . $id;
136
-
137
- $data = @file_get_contents($path . '.meta');
138
- if ($data) {
139
- $data = @unserialize($data);
140
- if (!is_array($data))
141
- $data = array();
142
- }
143
-
144
- if (is_readable($path)) {
145
- if ($this->_locking) {
146
- $fp = @fopen($path, 'rb');
147
-
148
- if ($fp) {
149
- @flock($fp, LOCK_SH);
150
-
151
- $ret = @stream_get_contents($fp);
152
-
153
- @flock($fp, LOCK_UN);
154
- @fclose($fp);
155
-
156
- return $ret;
157
- }
158
- } else {
159
- $data['content'] = @file_get_contents($path);
160
- return $data;
161
- }
162
- } else {
163
- $path_old = $path . '.old';
164
- $too_old_time = time() - 30;
165
-
166
- $file_time = @filemtime($path_old);
167
- if ($file_time) {
168
- if ($file_time > $too_old_time) {
169
- // return old data
170
- $data['content'] = @file_get_contents($path_old);
171
- return $data;
172
- }
173
-
174
- @touch($path_old);
175
- }
176
- }
177
-
178
- return false;
179
- }
180
-
181
- /**
182
- * Returns the OS-specific directory for temporary files
183
- *
184
- * @author Paul M. Jones <pmjones@solarphp.com>
185
- * @license http://opensource.org/licenses/bsd-license.php BSD
186
- * @link http://solarphp.com/trac/core/browser/trunk/Solar/Dir.php
187
- *
188
- * @return string
189
- */
190
- protected static function _tmp()
191
- {
192
- // non-Windows system?
193
- if (strtolower(substr(PHP_OS, 0, 3)) != 'win') {
194
- $tmp = empty($_ENV['TMPDIR']) ? getenv('TMPDIR') : $_ENV['TMPDIR'];
195
- if ($tmp) {
196
- return $tmp;
197
- } else {
198
- return '/tmp';
199
- }
200
- }
201
- // Windows 'TEMP'
202
- $tmp = empty($_ENV['TEMP']) ? getenv('TEMP') : $_ENV['TEMP'];
203
- if ($tmp) {
204
- return $tmp;
205
- }
206
- // Windows 'TMP'
207
- $tmp = empty($_ENV['TMP']) ? getenv('TMP') : $_ENV['TMP'];
208
- if ($tmp) {
209
- return $tmp;
210
- }
211
- // Windows 'windir'
212
- $tmp = empty($_ENV['windir']) ? getenv('windir') : $_ENV['windir'];
213
- if ($tmp) {
214
- return $tmp;
215
- }
216
- // final fallback for Windows
217
- return getenv('SystemRoot') . '\\temp';
218
- }
219
-
220
- /**
221
- * Flush cache
222
- *
223
- * @return bool
224
- */
225
- public function flush() {
226
- @set_time_limit($this->_flushTimeLimit);
227
-
228
- return \W3TC\Util_File::emptydir($this->_flush_path, $this->_exclude);
229
- }
230
-
231
- /**
232
- * Fetch the cache path used
233
- *
234
- * @return string
235
- */
236
- public function getPath() {
237
- return $this->_path;
238
- }
239
-
240
- private $_path = null;
241
- private $_exclude = null;
242
- private $_locking = null;
243
- private $_flushTimeLimit = null;
244
-
245
- /**
246
- * Returns size statistics about cache files
247
- */
248
- public function get_stats_size($timeout_time)
249
- {
250
- $dir = @opendir($this->_path);
251
-
252
- $stats = array(
253
- 'css' => array(
254
- 'items' => 0,
255
- 'original_length' => 0,
256
- 'output_length' => 0
257
- ),
258
- 'js' => array(
259
- 'items' => 0,
260
- 'original_length' => 0,
261
- 'output_length' => 0
262
- ),
263
- 'timeout_occurred' => false
264
- );
265
-
266
- if (!$dir)
267
- return $stats;
268
-
269
- $n = 0;
270
- while (!$stats['timeout_occurred'] &&
271
- ($entry = @readdir($dir)) !== false) {
272
- $n++;
273
- if ($n % 1000 == 0)
274
- $stats['timeout_occurred'] |= (time() > $timeout_time);
275
-
276
- if (substr($entry, -8) == '.js.meta' || substr($entry, -13) == '.js.gzip.meta')
277
- $type = 'js';
278
- else if (substr($entry, -9) == '.css.meta' || substr($entry, -14) == '.css.gzip.meta')
279
- $type = 'css';
280
- else
281
- continue;
282
-
283
- $full_path = $this->_path . DIRECTORY_SEPARATOR . $entry;
284
- $data = @file_get_contents($full_path);
285
- if (!$data)
286
- continue;
287
-
288
- $data = @unserialize($data);
289
- if (!is_array($data) || !isset($data['originalLength']))
290
- continue;
291
-
292
- $stats[$type]['items']++;
293
- $stats[$type]['original_length'] += (int)$data['originalLength'];
294
- $stats[$type]['output_length'] +=
295
- @filesize(substr($full_path, 0, strlen($full_path) - 5));
296
- }
297
-
298
- @closedir($dir);
299
- return $stats;
300
- }
301
  }
6
  */
7
 
8
  class Minify_Cache_File {
9
+
10
+ public function __construct($path = '', $exclude = array(), $locking = false, $flushTimeLimit = 0, $flush_path = null) {
11
+ if (! $path) {
12
+ $path = self::tmp();
13
+ }
14
+
15
+ $this->_path = $path;
16
+ $this->_exclude = $exclude;
17
+ $this->_locking = $locking;
18
+ $this->_flushTimeLimit = $flushTimeLimit;
19
+
20
+ $this->_flush_path = (is_null($flush_path) ? $path : $flush_path);
21
+
22
+ if (!file_exists($this->_path .'/index.html')) {
23
+ if (!is_dir($this->_path))
24
+ \W3TC\Util_File::mkdir_from_safe($this->_path, W3TC_CACHE_DIR);
25
+ @file_put_contents($this->_path .'/index.html', '');
26
+ }
27
+ }
28
+
29
+ /**
30
+ * Write data to cache.
31
+ *
32
+ * @param string $id cache id (e.g. a filename)
33
+ *
34
+ * @param string $data
35
+ *
36
+ * @return bool success
37
+ */
38
+ public function store($id, $data)
39
+ {
40
+ $path = $this->_path . '/' . $id;
41
+ $flag = $this->_locking ? LOCK_EX : null;
42
+
43
+ if (is_file($path)) {
44
+ @unlink($path);
45
+ }
46
+
47
+ if (!@file_put_contents($path, $data['content'], $flag)) {
48
+ // retry with make dir
49
+ \W3TC\Util_File::mkdir_from_safe(dirname($path), W3TC_CACHE_DIR);
50
+
51
+ if (!@file_put_contents($path, $data, $flag))
52
+ return false;
53
+ }
54
+
55
+ @unlink($path . '_old');
56
+ @unlink($path . '_meta_old');
57
+
58
+ $content = $data['content'];
59
+ unset($data['content']);
60
+ if (count($data) > 0)
61
+ @file_put_contents($path . '_meta', serialize($data), $flag);
62
+
63
+ // write control
64
+ $read = $this->fetch($id);
65
+ if (!isset($read['content']) || $content != $read['content']) {
66
+ @unlink($path);
67
+
68
+ return false;
69
+ }
70
+ return true;
71
+ }
72
+
73
+ /**
74
+ * Get the size of a cache entry
75
+ *
76
+ * @param string $id cache id (e.g. a filename)
77
+ *
78
+ * @return int size in bytes
79
+ */
80
+ public function getSize($id)
81
+ {
82
+ return filesize($this->_path . '/' . $id);
83
+ }
84
+
85
+ /**
86
+ * Does a valid cache entry exist?
87
+ *
88
+ * @param string $id cache id (e.g. a filename)
89
+ *
90
+ * @param int $srcMtime mtime of the original source file(s)
91
+ *
92
+ * @return bool exists
93
+ */
94
+ public function isValid($id, $srcMtime)
95
+ {
96
+ $file = $this->_path . '/' . $id;
97
+ return (is_file($file) && (filemtime($file) >= $srcMtime));
98
+ }
99
+
100
+ /**
101
+ * Send the cached content to output
102
+ *
103
+ * @param string $id cache id (e.g. a filename)
104
+ */
105
+ public function display($id)
106
+ {
107
+ $path = $this->_path . '/' . $id;
108
+
109
+ $fp = @fopen($path, 'rb');
110
+
111
+ if ($fp) {
112
+ if ($this->_locking)
113
+ @flock($fp, LOCK_SH);
114
+ @fpassthru($fp);
115
+ if ($this->_locking)
116
+ @flock($fp, LOCK_UN);
117
+ @fclose($fp);
118
+
119
+ return true;
120
+ }
121
+
122
+ return false;
123
+ }
124
+
125
+ /**
126
+ * Fetch the cached content
127
+ *
128
+ * @param string $id cache id (e.g. a filename)
129
+ *
130
+ * @return string
131
+ */
132
+ public function fetch($id)
133
+ {
134
+ $path = $this->_path . '/' . $id;
135
+
136
+ $data = @file_get_contents($path . '_meta');
137
+ if ($data) {
138
+ $data = @unserialize($data);
139
+ if (!is_array($data))
140
+ $data = array();
141
+ }
142
+
143
+ if (is_readable($path)) {
144
+ if ($this->_locking) {
145
+ $fp = @fopen($path, 'rb');
146
+
147
+ if ($fp) {
148
+ @flock($fp, LOCK_SH);
149
+
150
+ $ret = @stream_get_contents($fp);
151
+
152
+ @flock($fp, LOCK_UN);
153
+ @fclose($fp);
154
+
155
+ return $ret;
156
+ }
157
+ } else {
158
+ $data['content'] = @file_get_contents($path);
159
+ return $data;
160
+ }
161
+ } else {
162
+ $path_old = $path . '_old';
163
+ $too_old_time = time() - 30;
164
+
165
+ $file_time = @filemtime($path_old);
166
+ if ($file_time) {
167
+ if ($file_time > $too_old_time) {
168
+ // return old data
169
+ $data['content'] = @file_get_contents($path_old);
170
+ return $data;
171
+ }
172
+
173
+ @touch($path_old);
174
+ }
175
+ }
176
+
177
+ return false;
178
+ }
179
+
180
+ /**
181
+ * Returns the OS-specific directory for temporary files
182
+ *
183
+ * @author Paul M. Jones <pmjones@solarphp.com>
184
+ * @license http://opensource.org/licenses/bsd-license.php BSD
185
+ * @link http://solarphp.com/trac/core/browser/trunk/Solar/Dir.php
186
+ *
187
+ * @return string
188
+ */
189
+ protected static function _tmp()
190
+ {
191
+ // non-Windows system?
192
+ if (strtolower(substr(PHP_OS, 0, 3)) != 'win') {
193
+ $tmp = empty($_ENV['TMPDIR']) ? getenv('TMPDIR') : $_ENV['TMPDIR'];
194
+ if ($tmp) {
195
+ return $tmp;
196
+ } else {
197
+ return '/tmp';
198
+ }
199
+ }
200
+ // Windows 'TEMP'
201
+ $tmp = empty($_ENV['TEMP']) ? getenv('TEMP') : $_ENV['TEMP'];
202
+ if ($tmp) {
203
+ return $tmp;
204
+ }
205
+ // Windows 'TMP'
206
+ $tmp = empty($_ENV['TMP']) ? getenv('TMP') : $_ENV['TMP'];
207
+ if ($tmp) {
208
+ return $tmp;
209
+ }
210
+ // Windows 'windir'
211
+ $tmp = empty($_ENV['windir']) ? getenv('windir') : $_ENV['windir'];
212
+ if ($tmp) {
213
+ return $tmp;
214
+ }
215
+ // final fallback for Windows
216
+ return getenv('SystemRoot') . '\\temp';
217
+ }
218
+
219
+ /**
220
+ * Flush cache
221
+ *
222
+ * @return bool
223
+ */
224
+ public function flush() {
225
+ @set_time_limit($this->_flushTimeLimit);
226
+
227
+ return \W3TC\Util_File::emptydir($this->_flush_path, $this->_exclude);
228
+ }
229
+
230
+ /**
231
+ * Fetch the cache path used
232
+ *
233
+ * @return string
234
+ */
235
+ public function getPath() {
236
+ return $this->_path;
237
+ }
238
+
239
+ private $_path = null;
240
+ private $_exclude = null;
241
+ private $_locking = null;
242
+ private $_flushTimeLimit = null;
243
+
244
  /**
245
+ * Returns size statistics about cache files
246
+ */
247
+ public function get_stats_size($timeout_time)
248
+ {
249
+ $dir = @opendir($this->_path);
250
+
251
+ $stats = array(
252
+ 'css' => array(
253
+ 'items' => 0,
254
+ 'original_length' => 0,
255
+ 'output_length' => 0
256
+ ),
257
+ 'js' => array(
258
+ 'items' => 0,
259
+ 'original_length' => 0,
260
+ 'output_length' => 0
261
+ ),
262
+ 'timeout_occurred' => false
263
+ );
264
+
265
+ if (!$dir)
266
+ return $stats;
267
+
268
+ $n = 0;
269
+ while (!$stats['timeout_occurred'] &&
270
+ ($entry = @readdir($dir)) !== false) {
271
+ $n++;
272
+ if ($n % 1000 == 0)
273
+ $stats['timeout_occurred'] |= (time() > $timeout_time);
274
+
275
+ if (substr($entry, -8) == '.js_meta' || substr($entry, -13) == '.js_gzip_meta')
276
+ $type = 'js';
277
+ else if (substr($entry, -9) == '.css_meta' || substr($entry, -14) == '.css_gzip_meta')
278
+ $type = 'css';
279
+ else
280
+ continue;
281
+
282
+ $full_path = $this->_path . DIRECTORY_SEPARATOR . $entry;
283
+ $data = @file_get_contents($full_path);
284
+ if (!$data)
285
+ continue;
286
+
287
+ $data = @unserialize($data);
288
+ if (!is_array($data) || !isset($data['originalLength']))
289
+ continue;
290
+
291
+ $stats[$type]['items']++;
292
+ $stats[$type]['original_length'] += (int)$data['originalLength'];
293
+ $stats[$type]['output_length'] +=
294
+ @filesize(substr($full_path, 0, strlen($full_path) - 5));
295
+ }
296
+
297
+ @closedir($dir);
298
+ return $stats;
299
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
300
  }
lib/Minify/Minify/Cache/W3TCDerived.php CHANGED
File without changes
lib/Minify/Minify/Cache/ZendPlatform.php CHANGED
File without changes
lib/Minify/Minify/Cache/index.html CHANGED
File without changes
lib/Minify/Minify/ClosureCompiler.php CHANGED
File without changes
lib/Minify/Minify/CombineOnly.php CHANGED
File without changes
lib/Minify/Minify/CommentPreserver.php CHANGED
File without changes
lib/Minify/Minify/Controller/Base.php CHANGED
File without changes
lib/Minify/Minify/Controller/Files.php CHANGED
File without changes
lib/Minify/Minify/Controller/Groups.php CHANGED
File without changes
lib/Minify/Minify/Controller/MinApp.php CHANGED
File without changes
lib/Minify/Minify/Controller/Page.php CHANGED
File without changes
lib/Minify/Minify/Controller/Version1.php CHANGED
File without changes
lib/Minify/Minify/Controller/index.html CHANGED
File without changes
lib/Minify/Minify/DebugDetector.php CHANGED
File without changes
lib/Minify/Minify/HTML.php CHANGED
@@ -86,7 +86,7 @@ class Minify_HTML {
86
 
87
  /**
88
  * Minify the markeup given in the constructor
89
- *
90
  * @return string
91
  */
92
  public function process()
@@ -94,7 +94,7 @@ class Minify_HTML {
94
  if ($this->_isXhtml === null) {
95
  $this->_isXhtml = (false !== strpos($this->_html, '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML'));
96
  }
97
-
98
  $this->_replacementHash = 'MINIFYHTML' . md5($_SERVER['REQUEST_TIME']);
99
  $this->_placeholders = array();
100
 
@@ -109,47 +109,47 @@ class Minify_HTML {
109
  '/(\\s*)<script(\\b[^>]*?>)([\\s\\S]*?)<\\/script>(\\s*)/i'
110
  ,array($this, '_removeScriptCB')
111
  ,$this->_html);
112
-
113
  // replace STYLEs (and minify) with placeholders
114
  $this->_html = preg_replace_callback(
115
  '/\\s*<style(\\b[^>]*>)([\\s\\S]*?)<\\/style>\\s*/i'
116
  ,array($this, '_removeStyleCB')
117
  ,$this->_html);
118
-
119
  // remove HTML comments (not containing IE conditional comments).
120
  $this->_html = preg_replace_callback(
121
  '/<!--([\\s\\S]*?)-->/'
122
  ,array($this, '_commentCB')
123
  ,$this->_html);
124
-
125
  // replace PREs with placeholders
126
  $this->_html = preg_replace_callback('/\\s*<pre(\\b[^>]*?>[\\s\\S]*?<\\/pre>)\\s*/i'
127
  ,array($this, '_removePreCB')
128
  ,$this->_html);
129
-
130
  // replace TEXTAREAs with placeholders
131
  $this->_html = preg_replace_callback(
132
  '/\\s*<textarea(\\b[^>]*?>[\\s\\S]*?<\\/textarea>)\\s*/i'
133
  ,array($this, '_removeTextareaCB')
134
  ,$this->_html);
135
-
136
  // trim each line.
137
  // @todo take into account attribute values that span multiple lines.
138
  $this->_html = preg_replace('/^\\s+|\\s+$/m', '', $this->_html);
139
-
140
  // remove ws around block/undisplayed elements
141
  $this->_html = preg_replace('/\\s+(<\\/?(?:area|base(?:font)?|blockquote|body'
142
  .'|caption|center|col(?:group)?|dd|dir|div|dl|dt|fieldset|form'
143
  .'|frame(?:set)?|h[1-6]|head|hr|html|legend|li|link|map|menu|meta'
144
  .'|ol|opt(?:group|ion)|p|param|t(?:able|body|head|d|h||r|foot|itle)'
145
  .'|ul)\\b[^>]*>)/i', '$1', $this->_html);
146
-
147
  // remove ws outside of all elements
148
  $this->_html = preg_replace(
149
  '/>(\\s(?:\\s*))?([^<]+)(\\s(?:\s*))?</'
150
  ,'>$1$2$3<'
151
  ,$this->_html);
152
-
153
  // use newlines before 1st attribute in open tags (to limit line lengths)
154
  $this->_html = preg_replace('/(<[a-z\\-]+)\\s+([^>]+>)/i', "$1\n$2", $this->_html);
155
 
@@ -173,7 +173,7 @@ class Minify_HTML {
173
  );
174
  return $this->_html;
175
  }
176
-
177
  protected function _commentCB($m)
178
  {
179
  return (0 === strpos($m[1], '[') || false !== strpos($m[1], '<![') || $this->_ignoredComment($m[1]))
@@ -191,7 +191,7 @@ class Minify_HTML {
191
 
192
  return false;
193
  }
194
-
195
  protected function _reservePlace($content)
196
  {
197
  $placeholder = '%' . $this->_replacementHash . count($this->_placeholders) . '%';
@@ -211,7 +211,7 @@ class Minify_HTML {
211
  {
212
  return $this->_reservePlace("<pre{$m[1]}");
213
  }
214
-
215
  protected function _removeTextareaCB($m)
216
  {
217
  return $this->_reservePlace("<textarea{$m[1]}");
@@ -223,16 +223,16 @@ class Minify_HTML {
223
  $css = $m[2];
224
  // remove HTML comments
225
  $css = preg_replace('/(?:^\\s*<!--|-->\\s*$)/', '', $css);
226
-
227
  // remove CDATA section markers
228
  $css = $this->_removeCdata($css);
229
-
230
  // minify
231
  $minifier = $this->_cssMinifier
232
  ? $this->_cssMinifier
233
  : 'trim';
234
  $css = call_user_func($minifier, $css);
235
-
236
  return $this->_reservePlace($this->_needsCdata($css)
237
  ? "{$openStyle}/*<![CDATA[*/{$css}/*]]>*/</style>"
238
  : "{$openStyle}{$css}</style>"
@@ -243,7 +243,7 @@ class Minify_HTML {
243
  {
244
  $openScript = "<script{$m[2]}";
245
  $js = $m[3];
246
-
247
  // whitespace surrounding? preserve at least one space
248
  $ws1 = ($m[1] === '') ? '' : ' ';
249
  $ws2 = ($m[4] === '') ? '' : ' ';
@@ -253,20 +253,22 @@ class Minify_HTML {
253
  $js = preg_replace('/(?:^\\s*<!--\\s*|\\s*(?:\\/\\/)?\\s*-->\\s*$)/', '', $js);
254
  }
255
 
256
- // remove CDATA section markers
257
- $js = $this->_removeCdata($js);
258
-
259
- // minify
260
- $minifier = $this->_jsMinifier
261
- ? $this->_jsMinifier
262
- : 'trim';
263
- $js = call_user_func($minifier, $js);
264
-
265
- return $this->_reservePlace($this->_needsCdata($js)
266
- ? "{$ws1}{$openScript}/*<![CDATA[*/{$js}/*]]>*/</script>{$ws2}"
267
- : "{$ws1}{$openScript}{$js}</script>{$ws2}"
268
- );
269
- }
 
 
270
 
271
  protected function _removeCdata($str)
272
  {
@@ -287,7 +289,7 @@ class Minify_HTML {
287
  {
288
  return $this->_reservePlace($m[1]);
289
  }
290
-
291
  protected function _needsCdata($str)
292
  {
293
  return ($this->_isXhtml && preg_match('/(?:[<&]|\\-\\-|\\]\\]>)/', $str));
86
 
87
  /**
88
  * Minify the markeup given in the constructor
89
+ *
90
  * @return string
91
  */
92
  public function process()
94
  if ($this->_isXhtml === null) {
95
  $this->_isXhtml = (false !== strpos($this->_html, '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML'));
96
  }
97
+
98
  $this->_replacementHash = 'MINIFYHTML' . md5($_SERVER['REQUEST_TIME']);
99
  $this->_placeholders = array();
100
 
109
  '/(\\s*)<script(\\b[^>]*?>)([\\s\\S]*?)<\\/script>(\\s*)/i'
110
  ,array($this, '_removeScriptCB')
111
  ,$this->_html);
112
+
113
  // replace STYLEs (and minify) with placeholders
114
  $this->_html = preg_replace_callback(
115
  '/\\s*<style(\\b[^>]*>)([\\s\\S]*?)<\\/style>\\s*/i'
116
  ,array($this, '_removeStyleCB')
117
  ,$this->_html);
118
+
119
  // remove HTML comments (not containing IE conditional comments).
120
  $this->_html = preg_replace_callback(
121
  '/<!--([\\s\\S]*?)-->/'
122
  ,array($this, '_commentCB')
123
  ,$this->_html);
124
+
125
  // replace PREs with placeholders
126
  $this->_html = preg_replace_callback('/\\s*<pre(\\b[^>]*?>[\\s\\S]*?<\\/pre>)\\s*/i'
127
  ,array($this, '_removePreCB')
128
  ,$this->_html);
129
+
130
  // replace TEXTAREAs with placeholders
131
  $this->_html = preg_replace_callback(
132
  '/\\s*<textarea(\\b[^>]*?>[\\s\\S]*?<\\/textarea>)\\s*/i'
133
  ,array($this, '_removeTextareaCB')
134
  ,$this->_html);
135
+
136
  // trim each line.
137
  // @todo take into account attribute values that span multiple lines.
138
  $this->_html = preg_replace('/^\\s+|\\s+$/m', '', $this->_html);
139
+
140
  // remove ws around block/undisplayed elements
141
  $this->_html = preg_replace('/\\s+(<\\/?(?:area|base(?:font)?|blockquote|body'
142
  .'|caption|center|col(?:group)?|dd|dir|div|dl|dt|fieldset|form'
143
  .'|frame(?:set)?|h[1-6]|head|hr|html|legend|li|link|map|menu|meta'
144
  .'|ol|opt(?:group|ion)|p|param|t(?:able|body|head|d|h||r|foot|itle)'
145
  .'|ul)\\b[^>]*>)/i', '$1', $this->_html);
146
+
147
  // remove ws outside of all elements
148
  $this->_html = preg_replace(
149
  '/>(\\s(?:\\s*))?([^<]+)(\\s(?:\s*))?</'
150
  ,'>$1$2$3<'
151
  ,$this->_html);
152
+
153
  // use newlines before 1st attribute in open tags (to limit line lengths)
154
  $this->_html = preg_replace('/(<[a-z\\-]+)\\s+([^>]+>)/i', "$1\n$2", $this->_html);
155
 
173
  );
174
  return $this->_html;
175
  }
176
+
177
  protected function _commentCB($m)
178
  {
179
  return (0 === strpos($m[1], '[') || false !== strpos($m[1], '<![') || $this->_ignoredComment($m[1]))
191
 
192
  return false;
193
  }
194
+
195
  protected function _reservePlace($content)
196
  {
197
  $placeholder = '%' . $this->_replacementHash . count($this->_placeholders) . '%';
211
  {
212
  return $this->_reservePlace("<pre{$m[1]}");
213
  }
214
+
215
  protected function _removeTextareaCB($m)
216
  {
217
  return $this->_reservePlace("<textarea{$m[1]}");
223
  $css = $m[2];
224
  // remove HTML comments
225
  $css = preg_replace('/(?:^\\s*<!--|-->\\s*$)/', '', $css);
226
+
227
  // remove CDATA section markers
228
  $css = $this->_removeCdata($css);
229
+
230
  // minify
231
  $minifier = $this->_cssMinifier
232
  ? $this->_cssMinifier
233
  : 'trim';
234
  $css = call_user_func($minifier, $css);
235
+
236
  return $this->_reservePlace($this->_needsCdata($css)
237
  ? "{$openStyle}/*<![CDATA[*/{$css}/*]]>*/</style>"
238
  : "{$openStyle}{$css}</style>"
243
  {
244
  $openScript = "<script{$m[2]}";
245
  $js = $m[3];
246
+
247
  // whitespace surrounding? preserve at least one space
248
  $ws1 = ($m[1] === '') ? '' : ' ';
249
  $ws2 = ($m[4] === '') ? '' : ' ';
253
  $js = preg_replace('/(?:^\\s*<!--\\s*|\\s*(?:\\/\\/)?\\s*-->\\s*$)/', '', $js);
254
  }
255
 
256
+ // remove CDATA section markers
257
+ $js_old = $js;
258
+ $js = $this->_removeCdata($js);
259
+ $needsCdata = ( $js_old != $js );
260
+
261
+ // minify
262
+ $minifier = $this->_jsMinifier
263
+ ? $this->_jsMinifier
264
+ : 'trim';
265
+ $js = call_user_func($minifier, $js);
266
+
267
+ return $this->_reservePlace($needsCdata && $this->_needsCdata($js)
268
+ ? "{$ws1}{$openScript}/*<![CDATA[*/{$js}/*]]>*/</script>{$ws2}"
269
+ : "{$ws1}{$openScript}{$js}</script>{$ws2}"
270
+ );
271
+ }
272
 
273
  protected function _removeCdata($str)
274
  {
289
  {
290
  return $this->_reservePlace($m[1]);
291
  }
292
+
293
  protected function _needsCdata($str)
294
  {
295
  return ($this->_isXhtml && preg_match('/(?:[<&]|\\-\\-|\\]\\]>)/', $str));
lib/Minify/Minify/HTML/Helper.php CHANGED
File without changes
lib/Minify/Minify/HTMLTidy.php CHANGED
File without changes
lib/Minify/Minify/IgnoredCommentPreserver.php CHANGED
File without changes
lib/Minify/Minify/ImportProcessor.php CHANGED
File without changes
lib/Minify/Minify/Inline.php CHANGED
File without changes
lib/Minify/Minify/Inline/CSS.php CHANGED
File without changes
lib/Minify/Minify/Inline/JavaScript.php CHANGED
File without changes
lib/Minify/Minify/Inline/index.html CHANGED
File without changes
lib/Minify/Minify/JS/ClosureCompiler.php CHANGED
File without changes
lib/Minify/Minify/Lines.php CHANGED
File without changes
lib/Minify/Minify/Loader.php CHANGED
File without changes
lib/Minify/Minify/Logger.php CHANGED
File without changes
lib/Minify/Minify/Packer.php CHANGED
File without changes
lib/Minify/Minify/Source.php CHANGED
File without changes
lib/Minify/Minify/YUI/CssCompressor.java CHANGED
File without changes
lib/Minify/Minify/YUI/CssCompressor.php CHANGED
File without changes
lib/Minify/Minify/YUICompressor.php CHANGED
File without changes
lib/Minify/Minify/index.html CHANGED
File without changes
lib/Minify/index.html CHANGED
File without changes
lib/NetDNA/NetDNA.php CHANGED
File without changes
lib/NetDNA/NetDNAPresentation.php CHANGED
File without changes
lib/NetDNA/W3tcWpHttpException.php CHANGED
File without changes
lib/NewRelic/NewRelicAPI.php CHANGED
File without changes
lib/NewRelic/NewRelicWrapper.php CHANGED
File without changes
lib/Nusoap/class.nusoap_base.php CHANGED
File without changes
lib/Nusoap/class.soap_fault.php CHANGED
File without changes
lib/Nusoap/class.soap_parser.php CHANGED
File without changes
lib/Nusoap/class.soap_transport_http.php CHANGED
File without changes
lib/Nusoap/class.soap_val.php CHANGED
File without changes
lib/Nusoap/class.soapclient.php CHANGED
File without changes
lib/Nusoap/class.wsdl.php CHANGED
File without changes
lib/Nusoap/class.wsdlcache.php CHANGED
File without changes
lib/Nusoap/class.xmlschema.php CHANGED
File without changes
lib/Nusoap/index.html CHANGED
File without changes
lib/Nusoap/nusoap.php CHANGED
File without changes
lib/OAuth/W3tcOAuth.php CHANGED
File without changes
lib/S3.php CHANGED
File without changes
lib/SNS/README.md CHANGED
File without changes
lib/SNS/lib/requestcore/LICENSE CHANGED
File without changes
lib/SNS/lib/requestcore/README.md CHANGED
File without changes
lib/SNS/lib/requestcore/cacert.pem CHANGED
File without changes
lib/SNS/lib/requestcore/requestcore.class.php CHANGED
File without changes
lib/SNS/sdk.class.php CHANGED
File without changes
lib/SNS/services/MessageValidator/Message.php CHANGED
File without changes
lib/SNS/services/MessageValidator/MessageValidator.php CHANGED
File without changes
lib/SNS/services/MessageValidator/sns-exceptions.php CHANGED
File without changes
lib/SNS/services/sns.class.php CHANGED
File without changes
lib/SNS/utilities/request.class.php CHANGED
File without changes
lib/SNS/utilities/response.class.php CHANGED
File without changes
lib/SNS/utilities/simplexml.class.php CHANGED
File without changes
lib/SNS/utilities/utilities.class.php CHANGED
File without changes
lib/index.html CHANGED
File without changes
press.txt ADDED
@@ -0,0 +1,485 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ == Press: Mentions, Tutorials &amp; Reviews ==
2
+
3
+ **March 2015**
4
+
5
+ * [Make WordPress 10x Faster By W3 Total Cache + CloudFlare](http://www.bloggingspell.com/w3-total-cache-cloudflare/), Abrar Mohi Shafee
6
+
7
+ **February 2015**
8
+
9
+ * [WordPress 4.1 vs WordPress 4.0 Performance Comparison](https://www.conetix.com.au/blog/wordpress-41-vs-wordpress-40-performance), Tim Butler
10
+
11
+ **December 2014**
12
+
13
+ * [Don’t Blog Unless You Use These 11 Tools](http://www.quicksprout.com/2014/12/29/dont-blog-unless-you-are-using-these-11-tools/), Neil Patel
14
+
15
+ **November 2014:**
16
+
17
+ * [10 Must Have WordPress Plugins – 2014 Edition](http://www.sitepoint.com/10-must-wordpress-plugins-2014/), James George
18
+
19
+ **October 2014:**
20
+
21
+ * [The best WordPress plugins revealed by 39 WordPress enthusiasts](https://psdtowp.net/wordpress-plugins.html), PSD to WordPress
22
+
23
+ **September 2014:**
24
+
25
+ * [Using New Relic to Monitor WordPress Performance](http://code.tutsplus.com/tutorials/using-new-relic-to-monitor-wordpress-performance--cms-22002), Jeff Reifman
26
+
27
+ **July 2014:**
28
+
29
+ * [40+ Essential Tips, Tools and Resources to Start a WordPress Blog](https://zapier.com/blog/wordpress-blog-tips-tools-resources/), Kristi Hines
30
+
31
+ **April 2014:**
32
+
33
+ * [Configuring W3 Total Cache: An Introduction](http://code.tutsplus.com/tutorials/perfect-configurations-of-w3-total-cache-plugin-for-beginners--wp-35364), Ahmad Awais
34
+ * [25+ Must-Have WordPress Plugins for 2014](http://premium.wpmudev.org/blog/25-must-have-wordpress-plugins-for-2014/), Raelene Wilson
35
+
36
+ **February 2014:**
37
+
38
+ * [Best WordPress Plugins: 40 Experts Share Their Favorite WordPress Plugins](http://www.wpkube.com/best-wordpress-plugins/), Devesh Sharma
39
+
40
+ **August 2013:**
41
+
42
+ * [12 Free WordPress Plugins That Could Make You A Better Blogger](http://www.wpkube.com/12-free-wordpress-plugins-that-could-make-you-a-better-blogger/), Reginald
43
+
44
+ **June 2013:**
45
+
46
+ * [Test of WordPress Caching Plugins – W3 Total Cache vs WP Super Cache vs Quick Cache](http://www.dashboardjunkie.com/test-of-wp-caching-plugins-w3-total-cache-vs-wp-super-cache-vs-quick-cache), Kim Tetzlaff
47
+
48
+ **March 2013:**
49
+
50
+ * [Top 25 Most Downloaded WordPress Plugins](http://wpforce.com/top-25-most-downloaded-wordpress-plugins/), Jonathan Dingman
51
+
52
+ **January 2013:**
53
+
54
+ * [Making WordPress Faster with Apache, Varnish and W3 Total Cache on Amazon AWS EC2 with CloudFront](http://jeffreifman.com/2013/01/26/making-wordpress-faster-with-apache-varnish-and-w3-total-cache-on-amazon-aws-ec2-with-cloudfront-cdn/), Jeff Reifman
55
+ * [How to Speed Up Your WordPress Site (Quickly and Easily)](http://www.wpexplorer.com/how-to-speed-up-wordpress), Tom Ewer
56
+ * [The Periodic Table of WordPress Plugins](http://www.wpexplorer.com/the-periodic-table-of-wordpress-plugins-and-my-top-5/), Tom Ewer
57
+ * [WordPress Optimization Guide](http://gtmetrix.com/wordpress-optimization-guide.html)
58
+
59
+ **December 2012:**
60
+
61
+ * [5 of My Favorite WordPress Plugins in 2012](http://torquemag.io/fav-plugins-2012/), Jay Hoffmann
62
+ * [The 25 Best WordPress Plugins Ever](http://www.websitemagazine.com/content/blogs/posts/archive/2012/12/05/the-25-best-wordpress-plugins-ever.aspx), Michael Garrity
63
+
64
+ **November 2012:**
65
+
66
+ * [What You Should Know About Using a CDN With WordPress](http://themefuse.com/blog/what-you-should-know-about-using-a-cdn-with-wordpress/), Karol Krol
67
+
68
+ **October 2012:**
69
+
70
+ * [The ManageWP Guide to Speeding Up Your WordPress Site with Plugins](http://managewp.com/how-to-speed-up-your-wordpress-website), Tom Ewer
71
+
72
+
73
+ **September 2012:**
74
+
75
+ * [Secrets Of High-Traffic WordPress Blogs](http://wp.smashingmagazine.com/2012/09/12/secrets-high-traffic-wordpress-blogs/), Siobhan McKeown
76
+ * [10 essential WordPress plugins](http://www.computerworld.com/s/article/9230638/10_essential_WordPress_plugins), Ken Gagne
77
+
78
+ **August 2012:**
79
+
80
+ * [#114: Let’s Do Simple Stuff to Make Our Websites Faster](http://css-tricks.com/video-screencasts/114-lets-do-simple-stuff-to-make-our-websites-faster/), Chris Coyier
81
+ * [The Plugins I Run](http://pippinsplugins.com/the-plugins-i-run/), Pippin Williamson
82
+ * [WordPress Cache: WP Super Cache vs W3 Total Cache](http://www.wpbrix.com/wordpress-seo/wordpress-cache-wp-super-cache-vs-w3-total-cache/)
83
+ * [15 Tips to Speed Up Your Website](http://www.seomoz.org/blog/15-tips-to-speed-up-your-website), Armin Jalili
84
+
85
+ **July 2012:**
86
+
87
+ * [Using Liquid Web's CDN with WordPress via W3 Total Cache](http://lw.rrfaae.com/2012/07/using-liquid-webs-cdn-with-wordpress-via-w3-total-cache/), Jason Gillman Jr.
88
+ * [Tips for Server Admins &amp; Website Owners](http://www.tharunpkarun.com/2012/07/tips-for-server-admins-website-owners/), Tharun Karun
89
+ * [Step-by-Step guide to WordPress Optimization using W3 Total Cache](http://pthakkar.com/category/website-optimization/w3-total-cache/),Pankaj Thakkar
90
+ * [Top 10 Most Essential WordPress Plugins, Must Install](http://omgtoptens.com/web/wordpress/top-10-most-essential-wordpress-plugins-must-install/)
91
+ * [W3 Total Cache Vs WP Super Cache: Best Caching Plugin?](http://bloggerspassion.com/w3-total-cache-vs-wp-super-cache/), Anil Agarwal
92
+ * [How to Install and Configure W3 Total Cache](http://www.techlila.com/wordpress-plugins/how-to-install-configure-w3-total-cache-worpress/)
93
+
94
+ **June 2012:**
95
+
96
+ * [The Meaning of Plugins and The Best WordPress Plugins](http://www.bloggersdeck.com/the-meaning-of-plugins-and-the-best-wordpress-plugins/), Reginald Chan
97
+ * [6 Essential Plugins for New WordPress Sites](http://blog.presstrends.io/2012/06/6-essential-plugins-for-new-wordpress-sites/), Mitch Monsen
98
+
99
+ **May 2012:**
100
+
101
+ * [W3 Total Cache Settings](http://techod.com/w3-total-cache-settings/), Jason Graham
102
+ * [Leverage Browser Caching with W3 Total Cache](http://www.mvestormedia.com/leverage-browser-caching-w3-total-cache/), Ian Rogers
103
+
104
+ **April 2012:**
105
+
106
+ * [Apache Traffic Server as a Reverse Proxy](http://kpayne.me/2012/04/10/apache-traffic-server-as-a-reverse-proxy/), Kurt Payne
107
+ * [Essential WordPress Plugins For Every WordPress Blog](http://www.softlovers.com/essential-wordpress-plugins-for-every-wordpress-blog/), Shashank Johri
108
+ * [First Steps On A Fresh WordPress Install](http://wpshout.com/first-steps-on-a-fresh-install/), Alex Denning
109
+ * [Essential WordPress Plugins](http://the-hate-project.blogspot.com/2012/04/essential-wordpress-plugins.html)
110
+ * [15 Ridiculously Useful WordPress Plugins for Travel Bloggers](http://travelbloggeracademy.com/wordpress-travel-bloggers/), Adam Costa
111
+ * [10 plugins every new WordPress blog should have](http://kcclaveria.com/2012/04/10-wordpress-plugins/)
112
+ * [Caching and Synthesis Managed WordPress Hosting](http://websynthesis.com/caching-and-synthesis-managed-wordpress-hosting/)
113
+ * [How to: Boost WordPress performance with W3 Total Cache and APC](http://www.neilturner.me.uk/2012/04/30/how-to-boost-wordpress-performance-with-w3-total-cache-and-apc.html), Neil Turner
114
+ * [Supercharge WordPress Blog With Cloudflare, MaxCDN and W3 Total Cache](http://hellboundbloggers.com/2012/04/24/supercharge-wordpress-cloudflare-maxcdn-w3-total-cache/)
115
+ * [W3 Total Cache Setup for Rackspace Cloud Sites with Cloud Files](http://thecustomizewindows.com/2012/04/w3-total-cache-setup-for-rackspace-cloud-sites-with-cloud-files/), Abhishek Ghosh
116
+ * [11 Steps To Speed Up Your WordPress Site](http://www.paulund.co.uk/11-steps-to-speed-up-your-wordpress-site)
117
+ * [Speeding Up WordPress With The W3 Total Cache Plugin](http://invenioblog.com/2012/04/speeding-up-wordpress-with-the-w3-total-cache-plugin/)
118
+ * [11 of Our Favorite Wordpress Plugins](http://www.putontheglasses.com/blog/11-of-our-favorite-wordpress-plugins)
119
+ * [Leverage Browser Caching with W3 Total Cache](http://www.mvestormedia.com/leverage-browser-caching-w3-total-cache/), Ian Rogers
120
+ * [Speeding Up WordPress Websites](http://designershq.net/wordpress-plugins/speeding-up-wordpress-websites/), Craig Butcher
121
+ * [How I Increased My Blog Loading Speed by 500%](http://www.asiogroups.com/how-i-increased-my-blog-loading-speed/)
122
+ * [5 WordPress Plugins I Can’t Live Without – 2012 Edition](http://bit51.com/5-wordpress-plugins-i-cant-live-without-2012-edition/), Chris Wiegman
123
+ * [Setting Up and Optimizing W3 Total Cache - Up to v0.9.2.4](http://tentblogger.com/w3-total-cache/)
124
+ * [W3 Total Cache hilft bei WordPress Optimierung](http://blog.stenki.eu/2012/04/wordpress-optimierung-mit-w3-total-cache/)
125
+
126
+ **March 2012:**
127
+
128
+ * [The Plugins and Code Behind WPForce 2.0](http://wpforce.com/plugins-and-code-behind-wpforce/), Jonathan Dingman
129
+ * [5 Must Have Plugins for WordPress Bloggers](http://igaret.com/wordpress/5-must-have-plugins-for-wordpress-bloggers), Garet McKinley
130
+ * [10 Million hits a day with WordPress using a $15 server](http://www.ewanleith.com/blog/900/10-million-hits-a-day-with-wordpress-using-a-15-server), Ewan Leith via [Hacker News](http://news.ycombinator.com/item?id=3775715)
131
+ * [High-Performance WordPress with W3 Total Cache and Nginx](http://elivz.com/blog/single/wordpress_with_w3tc_on_nginx/), Eli Van Zoeren
132
+ * [How To Speed Up Your WordPress Blog](http://managewp.com/how-to-speed-up-your-wordpress-blog), Vladimir Prelovac
133
+ * [The Lab + W3 Total Cache](http://www.purpleturtleproductions.ca/the-lab/new-category-the-lab-w3-total-cache/), Simon
134
+ * [5 Powerful WordPress Plugins To Increase Sharing Of Your Articles](http://blog.kissmetrics.com/5-powerful-wordpress-plugins/)
135
+ * [How I increased Websitez.com’s performance by an additional 20%](http://websitez.com/how-i-increased-websitez-coms-performance-by-an-additional-20/), Eric Stolz
136
+ * [WordPress with W3 Total Cache on Nginx with APC ](http://chrisgilligan.com/wordpress/wordpress-with-w3-total-cache-on-nginx-with-apc-virtualmin/), Chris Gilligan
137
+ * [Screencast Tuesday: Using W3 Total Cache Part 1](http://headwaythemes.com/screencast-tuesday-using-w3-total-cache-part-1/), AJ Morris
138
+ * [Screencast Tuesday: Using W3 Total Cache Part 2 – Implementing a CDN](http://headwaythemes.com/screencast-tuesday-using-w3-total-cache-part-2-implementing-a-cdn/), AJ Morris
139
+ * [A Quick Bit About WordPress Caching](http://blog.ryantoohil.com/2012/03/a-quick-bit-about-wordpress-caching.php), Ryan Toohil
140
+ * [How To Find Out Which WordPress Plugins Are Making Your Site Slow](http://www.business2community.com/blogging/how-to-find-out-which-wordpress-plugins-are-making-your-site-slow-0138577), Kim Castleberry
141
+ * [Top 20 Plugins Used Across 30,000+ WordPress Sites](http://www.presstrends.io/top-20-plugins-used-across-30000-wordpress-sites/), George Ortiz
142
+ * [10 Plugins That Will Speed Up Your WordPress Site](http://blog.brainhost.com/10-plugins-that-will-speed-up-your-wordpress-site/)
143
+ * [Using nRelate to Engage Readers & Make Money](http://imstash.com/using-nrelate-engage-readers-make-money/)
144
+ * [Our Top 10 Favorite WordPress Plugins](http://sitefox.com/blog/top-10-favorite-wordpress-plugins/), Samir Balwani
145
+ * [Screencast Tuesday: Using W3 Total Cache Part 1](http://headwaythemes.com/screencast-tuesday-using-w3-total-cache-part-1/), AJ Morris
146
+ * [Build the WordPress wholly stations CDN utilize the caching plugin W3TC filmed cloud](http://www.84tt.com/web/2012/03/608.html)
147
+ * [3 Tutorials For Speeding Up Your WordPress Site](http://blog.asmallorange.com/3-tutorials-for-speeding-up-your-wordpress-site/), McKinney Brown
148
+ * [WordPress SEO & Security](http://www.albertawebsitemarketing.com/wordpress-seo-and-security/)
149
+ * [CDN – WTF?](http://talkingwordpress.com/cdn-wtf/)
150
+ * [Supercharge WordPress, Part 3](http://linuxaria.com/article/supercharge-wordpress-part-3?lang=en)
151
+ * [7 Effective Ways To Make Your WordPress Blog Load Faster](http://www.uniquetipsonline.com/7-effective-ways-to-make-your-wordpress-blog-load-faster/)
152
+ * [WordPress Plugins to Speed Up Your Website](http://blog.templatemonster.com/2012/03/01/wordpress-plugins-speed-up-blog-website/), Edward Korcheg
153
+ * [CloudFlare and W3TC (Part I)](http://elimcmakin.com/cloudflare-and-w3tc-not-just-another-cdn-part-i/)
154
+ * [CloudFlare and W3TC (Part II)](http://elimcmakin.com/cloudflare-and-w3tc-part-ii/)
155
+ * [How to speed up WordPress – my experience with slow WordPress](http://bachutha.com/how-to-speed-up-wordpress-my-experience-with-slow-wordpress/)
156
+ * [Make Your WordPress Site Lightning Fast](http://www.helpeverybodyeveryday.com/websocial-media/848-make-your-wordpress-site-lightning-fast), Matt Handal
157
+ * [Speed Up WordPress Websites](http://wordpress-tips.info/speed-up-wordpress-websites/2012/03/27/)
158
+ * [W3 Total Cache, caché y compresión para optimizar WordPress](http://www.gamblingprofesional.com/noticias/otros1/w3-total-cache-optimizando-wordpress-de-forma-sencilla/)
159
+ * [Velocizzare WordPress](http://www.evemilano.com/2012/03/velocizzare-wordpress/), Giovanni Sacheli
160
+ * [21 Wicked WordPress Plugins](http://garinkilpatrick.com/21-wicked-wordpress-plugins/), Garin Kilpatrick
161
+ * [How to fix high-CPU load in WordPress](http://support.ecenica.com/wordpress/fix-high-cpu-load-wordpress/)
162
+ * [How much (cache) is too much?](http://blog.gingerlime.com/2012/how-much-cache-is-too-much/), Yoav Aner
163
+ * [10 Must Have WordPress Plugins Of 2012 Every Blogger Should Know About](http://www.jeffbullas.com/2012/03/13/10-must-have-wordpress-plugins-of-2012-every-blogger-should-know-about/), Leo Widrich
164
+ * [Speed up your WordPress Blog: 5 Easy Steps](http://techwalls.com/blogging/speed-up-wordpress-blog-easy-steps/), Sanjib Saha
165
+ * [7 Tips to Test Website Speed and Decrease WordPress Load Time](http://natedevore.com/7-tips-to-test-website-speed-and-decrease-wordpress-load-time/), Nate Devore
166
+ * [How I increased Websitez.com’s performance by an additional 20%](http://websitez.com/how-i-increased-websitez-coms-performance-by-an-additional-20/), Eric Stolz
167
+ * [WordPress with W3 Total Cache on Nginx with APC](http://chrisgilligan.com/wordpress/wordpress-with-w3-total-cache-on-nginx-with-apc-virtualmin/), Chris Gilligan
168
+ * [Speed Up Your Website With The "W3 Total Cache" Wordpress Plugin](http://www.youtube.com/watch?v=Luf2Y_F23l0)
169
+ * [WordPress W3 Total Cache Eklentisi Ayarları](http://www.55dakika.com/wordpress-w3-total-cache-eklentisi-ayarlari-34124.html)
170
+ * [9 Essential WordPress Plugins](http://www.ostraining.com/blog/wordpress/9-essential-wordpress-plugins/), Ed Andrea
171
+ * [15 Must Have WordPress Plugins for the New Blogger](http://avgjoegeek.net/15must-have-wordpress-plugins/), Jason Mathes
172
+ * [10 Must Have WordPress Plugins For Your Blog](http://www.tricksmachine.com/2012/03/10-must-have-wordpress-plugins.html)
173
+ * [How To Speed Up Your WordPress Blog](https://managewp.com/how-to-speed-up-your-wordpress-blog), Tom Ewer
174
+ * [5 Best Plug-ins for WordPress Blog](http://www.thegeeksclub.com/5-plugins-wordpress-blog/), Jonathan Acabo
175
+ * [Easy W3 Total Cache WordPress Plugin Configuration](http://www.mvestormedia.com/easy-w3-total-cache-configuration/), Ian Rogers
176
+ * [Ideal W3 Total Cache Settings For Shared Hosting](http://www.kidnapcustomers.com/how-to-make-a-website/w3-total-cache-settings-wordpress-speed/)
177
+
178
+ **February 2012:**
179
+
180
+ * [Get Google Page Speed Report Via W3 Total Cache](http://www.myh3r3.com/code/get-google-page-speed-report-via-w3-total-cache/), Aayush Nagar
181
+ * [3 WordPress Plugins To Speed Up Your Blog](http://www.wordpressninja.com/2012/02/speed-up-your-wordpress-blog/), Missy Diaz
182
+ * [Top 5 Plugins for WordPress](http://creativetech.me/2012/02/top-5-plugins-wordpress/), Phill Fernandes
183
+ * [Geeking out with WordPress, CDNs, and Amazon CloudFront](http://polizeros.com/2012/02/17/geeking-out-with-wordpress-cdns-and-amazon-cloudfront/), Bob Morris
184
+ * [Top 10 Essential WordPress Plugins that Your Website Needs](http://impressthemes.com/2012/02/top-10-essential-wordpress-plugins-that-your-website-needs/)
185
+ * [How to start your own blog using WordPress](http://blog.kualo.com/how-to-start-your-own-blog-using-wordpress/)
186
+ * [Top 10 Must Have WordPress Plugins In Your Blog](http://www.learnblogtips.com/top-10-must-have-wordpress-plugins-in-your-blog/), Rahul Kuntala
187
+ * [Improve WordPress Speed with W3 Total Cache](http://www.webcitz.org/wordpress-tips/improve-wordpress-speed-with-w3-total-cache.html)
188
+ * [WordPress Plugins for 2012](http://proudlypowered.com/wordpress-plugins-2012/)
189
+ * [How to Install Memcached and Use It with Your WordPress via W3 Total Cache on CentOS](http://www.bleuken.com/how-to-install-memcached-and-use-it-with-your-wordpress-via-w3-total-cache-on-centos-20120220/)
190
+ * [How to reduce WordPress CPU usage using Cache and P3 plugin](http://wpmarketing.org/2012/02/how-to-reduce-wordpress-cpu-usage-using-cache-and-p3-plugin/)
191
+ * [Speeding up your WordPress site with MaxCDN (Advanced users)](http://wpverse.com/2012/02/speeding-up-your-wordpress-site-with-maxcdn-advanced-users/), Noel Saw
192
+ * [Cache WordPress With W3 Total Cache](http://wphostingreviews.com/plugins/cache-wordpress-with-w3-total-cache-1768/), David Blane
193
+ * [Cache Plugin For Improving Wordpress Speed](http://www.youtube.com/watch?v=70TqVjmtXYU), Mark Washburn
194
+ * [De snelheid van je website verbeteren](http://www.webtaurus.nl/amersfoort-webdesign/tag/w3-total-cache)
195
+ * [WordPress Plugins that Power Digital Inspiration](http://www.labnol.org/software/must-have-wordpress-plugins/14034/)
196
+ * [9 Essential WordPress Plugins To Install On Your Site](http://www.haikarela.com/9-wordpress-plugins-to-install/)
197
+ * [Some Other Tricks For A Speedy WordPress](http://wp.tutsplus.com/tutorials/some-other-tricks-for-a-speedy-wordpress/), Ariff Shah
198
+ * [5 Essential WordPress Plug-ins You Should Be Using](http://thinktraffic.net/5-essential-wordpress-plug-ins-you-should-be-using), Caleb Wojcik
199
+ * [14 Free WordPress Plugins I Installed, Before Doing Anything Else](http://www.kidnapcustomers.com/how-to-make-a-website/wordpress-plugins-must-have/)
200
+ * [Install Memcached to speed up your WordPress site](http://www.wpinsite.com/articles/install-memcached-speed-wordpress-site)
201
+ * [Cara Membuat CDN dengan W3 Total Cache pada Subdomain](http://www.youtube.com/watch?v=XB1sry9ns4Y), Hadie Danker
202
+ * [Top 10 WordPress Plugins To Improve a WordPress Blog](http://www.bloggingtips.com/2012/02/05/top-10-wordpress-plugins-to-improve-a-wordpress-blog/), Zac Johnson
203
+ * [The 10 Best Plugins for Online Entreprenuers](http://www.webdesigndev.com/make-money-online/the-10-best-wordpress-plugins-for-online-entrepreneurs)
204
+ * [Time to Smarten up Your WordPress Blog – 15 Must Have Plugins](http://www.multyshades.com/2012/02/time-to-smarten-up-your-wordpress-blog-15-must-have-plugins/), Muhammad Haroon
205
+ * [Best WordPress SEO Plugins For Boost Your Traffic](http://www.redfoxmagazine.com/best-wordpress-seo-plugins-for-boost-your-traffic/)
206
+ * [Speed Up WordPress Load Times and Grab More Visitors](http://www.matthewhooper.com/speed-up-wordpress/)Matthew Hooper
207
+ * [Use a windows azure blob storage account with your wordpress blog](http://www.gep13.co.uk/blog/use-a-windows-azure-blob-storage-account-with-your-wordpress-blog/), Gary Ewan Park
208
+ * [How To Find Out Which WordPress Plugins Are Making Your Site Slow](http://just-ask-kim.com/wordpress-plugins-site-slow/#.URBVYVpdec8)
209
+ * [How to Install and Configure W3 Total Cache Plugin](http://www.youtube.com/watch?v=Lbs3pRL4XQg)
210
+ * [Day 8: Speed Up your WordPress Site with W3 Total Cache](http://wplifeguard.com/day-8-speed-up-your-wordpress-site-with-w3-total-cache/)
211
+ * [10 Ways to Improve WordPress Performance on Windows](http://jesscoburn.com/archives/2012/02/25/10-ways-to-improve-wordpress-performance-on-windows/), Jess Coburn
212
+ * [W3 Total Cache - Accélérer votre site Wordpress](http://www.youtube.com/watch?v=Hx-_e8wTUEw)
213
+ * [WordPress on Nginx, Part 1: Preparing VPS the Debian Way](http://www.linuxforu.com/2012/02/wordpress-nginx-part-1-preparing-vps-debian-linux/), Atanu Datta
214
+ * [WordPress on Nginx, Part 2: vhost, MySQL & APC Configurations](http://www.linuxforu.com/2012/02/wordpress-nginx-part-2-domain-vhost-config-migrating-files-fine-tuning-mysql-apc/), Atanu Datta
215
+
216
+ **January 2012:**
217
+
218
+ * [Speed up WordPress with W3 Total Cache and Amazon CloudFront (CDN)](http://richwp.com/wordpress-cdn-total-cache-amazon-cloudfront/), Dustin
219
+ * [The Ultimate Quickstart Guide to Speeding Up Your WordPress Site](http://wp.tutsplus.com/tutorials/the-ultimate-quickstart-guide-to-speeding-up-your-wordpress-site/), Matt Pilott
220
+ * [Speed Up WordPress with W3 Total Cache](http://www.doitwithwp.com/speed-up-wordpress-with-w3-total-cache/), Dave Clements
221
+ * [Speed Up your WordPress Site with W3 Total Cache](http://wplifeguard.com/day-8-speed-up-your-wordpress-site-with-w3-total-cache/)
222
+ * [How to Speed Up Your WordPress Site and Reduce Your Hosting Costs](http://www.washingtonsblog.com/2012/01/how-to-speed-up-your-wordpress-site-and-reduce-your-hosting-costs.html)
223
+ * [Why I Switched From Drupal to WordPress](http://eagereyes.org/blog/2012/why-i-switched-drupal-wordpress), Robert Kosara
224
+ * [Top 10 Best WordPress Plugins](http://ebusinessmatters.com/top10-best-wordpress-plugins/), Brian Duffy
225
+ * [WordPress Plug-ins](http://www.crazyxhtml.com/blog/wordpress-plug-ins/)
226
+ * [Los mejores plugins para WordPress](http://zonawordpress.com/los-mejores-plugins-para-wordpress/)
227
+ * [10 Essential Plugins for Your WordPress Blog](http://sproutsocial.com/insights/2012/01/wordpress-plugins/), Jennifer Beese
228
+ * [10 Must-Have WordPress Plugins on Your Site](http://realityco.com/blog/?p=23&option=com_wordpress&Itemid=168)
229
+ * [3 Must Have Free Smashing WordPress SEO Plugins For Your Blog](http://techtipsportal.com/wordpress-seo-plugins-for-blog/), Kushal Biswas
230
+ * [Best WordPress SEO Plugins For 2012](http://www.iblogzone.com/2012/01/the-best-wordpress-seo-plugins-for-2012-part-1-html.html)
231
+ * [5 Simple Tips for Making WordPress Run Faster](http://headway101.com/5-simple-tips-for-making-wordpress-run-faster/)
232
+ * [Tips on speeding up your WordPress site](http://www.edwardxwu.com/2012/01/tips-on-speeding-up-your-wordpress-site/), Edward Xwu
233
+ * [W3 Total Cache Kurulumu](http://kenancanol.com/2012/w3-total-cache-kurulumu/)
234
+ * [Speed Up WordPress with W3 Total Cache](http://www.doitwithwp.com/speed-up-wordpress-with-w3-total-cache/), Dave Clements
235
+ * [The Ultimate Quickstart Guide to Speeding Up Your WordPress Site](http://wp.tutsplus.com/tutorials/the-ultimate-quickstart-guide-to-speeding-up-your-wordpress-site/), Matt Pilott
236
+ * [Speed up WordPress with W3 Total Cache and Amazon CloudFront (CDN)](http://richwp.com/wordpress-cdn-total-cache-amazon-cloudfront/)
237
+ * [Configure/Install MaxCDN with W3 Total Cache WordPress Plugin](http://www.youtube.com/watch?v=OYqOG7_TIk8), Mrinmay Bhattacharjee
238
+ * [How to Install and Configure W3 Total Cache Plugin](http://www.dailymotion.com/video/xnx1cl_how-to-install-and-configure-w3-total-cache-plugin_tech#.UQ_ujlpdec8)
239
+ * [How to setup a CDN in WordPress using W3 Total Cache & Amazon CloudFront](http://pedrodasilva.co.uk/how-to-setup-content-delivery-network-wordpress-using-w3tc-amazon-cloudfront/), Pedro Da Silva
240
+ * [WordPress plugin – W3 Total Cache](http://www.naschenweng.info/2012/01/16/wordpress-plugin-w3-total-cache/)
241
+ * [Using YUI Compressor with the W3 Total Cache plugin](http://secure.delishost.com/knowledgebase/11/Using-YUI-Compressor-with-the-W3-Total-Cache-plugin.html)
242
+ * [(mt):Install APC for use with W3 Total Cache](http://wiki.mediatemple.net/w/(mt):Install_APC_for_use_with_W3_Total_Cache)
243
+ * [The Perfect APC Configuration](http://gregrickaby.com/2012/01/the-perfect-apc-configuration.html), Greg Rickaby
244
+ * [CloudFlare – A Review](http://complete-concrete-concise.com/web-tools/cloudflare-a-review)
245
+ * [W3 Total Cache Kurulumu ve Ayarları](http://bcakir.com/w3-total-cache-kurulumu-ve-ayarlari.html)
246
+
247
+ **December 2011:**
248
+
249
+ * [A shout-out to my tech partners of 2011!](http://www.jimcarroll.com/2011/12/a-shout-out-to-my-tech-partners-of-2011/), Jim Carroll
250
+ * [15 Top WordPress Plugins Of 2011](http://smashinghub.com/15-top-wordpress-plugins-of-2011.htm), Ali Qayyum
251
+ * [Google Speed Online API widget integration with W3 Total Cache in WordPress](http://shivasoft.in/blog/webtech/seo/google-speed-online-api-widget-integration-with-w3-total-cache-in-wordpress/), Jitendra Zaa
252
+ * [Modern WordPress Development for 2012](http://sachagreif.com/modern-wordpress-development-in-2012/), Sacha Greif
253
+ * [Set up W3 Total Cache with Amazon CloudFront CDN](http://www.doitwithwp.com/set-up-w3-total-cache-with-amazon-cloudfront-cdn/), Dave Clements
254
+ * [Installing & Configuring XCache for W3 Total Cache on a cPanel Server](http://www.thewebhostinghero.com/tutorials/xcache-w3tc-on-a-cpanel-server.html)
255
+ * [How-To Install W3 Total Cache: Part One -- What is Page Caching?](http://www.youtube.com/watch?v=HvQ5aVPdHX8), Dorie Scarlet
256
+ * [Must Use: W3 Total Cache WordPress Plugin](http://www.dailyblogtips.com/must-use-w3-total-cache-wordpress-plugin/), Daniel Scocco
257
+ * [10 Best WordPress Plugins](http://www.anhosting.com/blog/2011/12/10-best-wordpress-plugins/), AN Hosting
258
+ * [How to Install & Configure W3 Total Cache Plugin](http://marketgurus.org/how-to-install-configure-w3-total-cache-plugin/)
259
+ * [Website Speed Part 3 – Caching WordPress](http://speckyboy.com/2011/12/14/website-speed-part-3-caching-wordpress/), Andy Killen
260
+ * [WP Super Cache 1.0 Released](http://www.wptavern.com/wp-super-cache-1-0-released), Jeffro
261
+ * [5 Must Have WordPress Plugins](http://www.stormcode.net/marketing/5-must-have-wordpress-plugins/), Brendan
262
+ * [12 Essential WordPress Plugins](https://docs.google.com/a/placester.com/viewer?a=v&q=cache:GGcWVwJTMOUJ:myathleticlife.com/wp-content/uploads/2011/12/12-Essential-Wordpress-Plugins.pdf+&hl=en&gl=us&pid=bl&srcid=ADGEEShOSbWoVFwJiNrmfGCe_rqA48eDO7pjwfdqzzK3CUJevx39BA9vdTm4OzMNSNLlyvBDgJoYIypFnVm3oHF6scJJJB2a-DCgZERkyI9ExrSpSMmI_1AqxmcMOf2FZY0Z6njFouX9&sig=AHIEtbQT-oErlhUCsEOh56YNJVlhLu1AxA)
263
+ * [Measuring impact of plugins on WordPress loading](http://wpdojo.net/tag/woocommerce/page/7/), MillaN
264
+ * [Recommended WordPress Plugins](http://www.cinntech.com/recommended-wordpress-plugins/)
265
+ * [Recommended WordPress Plugins For Any Serious Blogger](http://getbusylivingblog.com/recommended-wordpress-plugins-for-any-serious-blogger/), Benny Hsu
266
+ * [Top 10 WordPress Plugins for 2011](http://y2kemo.com/2011/12/top-10-wordpress-plugins-for-2011/)
267
+ * [Measuring impact of plugins on WordPress loading](http://www.dev4press.com/2011/blog/benchmark/measuring-impact-of-plugins-on-wordpress-loading/)
268
+
269
+ **November 2011:**
270
+
271
+ * [10+ Best WordPress Plugins You must have to start a Blog/Website](http://www.wokay.com/technology/10-best-wordpress-plugins-to-use-in-2011-must-have-awesome-blog-website-start-56197.html), Barnabas Reilly
272
+ * [5 Must Have WordPress Plugins](http://sayfsolutions.com/2011/5-must-have-wordpress-plugin/), Abdullah Hashim
273
+ * [Plug 'em in: WordPress plugins I've completely fallen for…](http://bookbagsandcatnaps.com/2011/11/plug-em-in-wordpress-plugins-ive-completely-fallen-for/), Donna Brown
274
+ * [8 WordPress Plugins you have to Install](http://www.123-reg.co.uk/blog/tips-tutorials/8-wordpress-plugins-you-have-to-install/), Alex Moss
275
+ * [Installing and Configuring the W3 Total Cache Plugin on WordPress](http://help.godaddy.com/article/7299?isc=u&locale=en)
276
+ * [Installing CSS Tidy For WordPress W3 Total Cache Plugin](http://hungred.com/how-to/installing-css-tidy-wordpress-w3-total-cache-plugin/), Clay Lua
277
+
278
+ **October 2011:**
279
+
280
+ * [10 WordPress Plugins Your Small Business Website Needs](http://searchenginewatch.com/article/2115338/10-WordPress-Plugins-Your-Small-Business-Website-Needs), October 7, 2011
281
+
282
+ **September 2011:**
283
+
284
+ * [Boost WordPress Blog Performance: Minify & CDN with W3TC](http://sangatpedas.com/20110901/boosting-increase-wordpress-performance-w3tc-minify-cdn/), Remco
285
+ * [How to Reduce Bandwidth Usage and Optimize Website Performance with W3 Total Cache and Amazon CloudFront](http://helgeklein.com/blog/2011/09/how-to-reduce-bandwidth-usage-and-optimize-website-performance-with-w3-total-cache-and-amazon-cloudfront/), Helge Klein
286
+ * [Speeding Up WordPress, Part 1: Basic W3 Total Cache Configuration and Content Delivery Network](http://www.mattstratton.com/tech-tips/speed-up-wordpress), Matt Stratton
287
+ * [Boost WordPress Blog Performance: Minify & CDN with W3TC](http://sangatpedas.com/boosting-increase-wordpress-performance-w3tc-minify-cdn/)
288
+ * [W3 TOTAL CACHE VS QUICK CACHE FOR WORDPRESS](http://thinkpaid.com/2011/09/reviews/w3-total-cache-vs-quick-cache), Andrew Summers
289
+ * [10 Free WordPress Plugins you must have](http://www.webprocyon.com/2011/09/10-free-wordpress-plugins-you-must-have.html)
290
+
291
+ **August 2011:**
292
+
293
+ * [Matt Mullenweg: State of the Word 2011 (4:49)](http://wordpress.tv/2011/08/14/matt-mullenweg-state-of-the-word-2011/), Matt Mullenweg
294
+ * [http://freenuts.com/increase-your-page-speed-to-a-new-level/](Increase Your Page Speed To A New Level)
295
+ * [7 Plugins That Every WordPress Blog Must Have](http://coderbay.com/7-wordpress-plugins-that-every-wordpress-blog-must-have/), Karim Pattoki
296
+ * [Speeding Up Your WordPress Site With W3 Total Cache](http://www.sohailtech.com/2011/08/10/speeding-wordpress-site-w3-total-cache/)
297
+ * [W3 Total Cache Setup with CloudFlare and CDN : Complete Tutorial Guide](http://thecustomizewindows.com/2011/08/w3-total-cache-setup-with-cloudflare-and-cdn-complete-tutorial-guide/), Abhishek Ghosh
298
+
299
+ **July 2011:**
300
+
301
+ * [Speeding Up Your Blog - Part II: WordPress & Cloudflare Integration](http://www.thewebhostinghero.com/tutorials/wordpress-cloudflare.html)
302
+ * [How Your Website Loses 7% of Potential Conversions](http://www.clickz.com/clickz/column/2097323/website-loses-potential-conversions), Bryan Eisenberg
303
+ * [How to Integrate Google Page Speed with W3 Total Cache](http://geekscalling.com/google/how-to-integrate-google-page-speed-with-w3-total-cache), Anish
304
+ * [22 WordPress Plugins for Content Marketers](http://www.business2community.com/content-marketing/22-wordpress-plugins-for-content-marketers-040787), Brody Dorland
305
+
306
+ **June 2011:**
307
+
308
+ * [5 Types of WordPress Plugins for Real Estate Sites](http://www.mytechopinion.com/2011/06/5-types-of-wordpress-plugins-for-your-real-estate-site.html), Nicole Nicolay
309
+ * [WordPress Optimization Results: Varnish/Nginx/APC + W3 Total Cache + Amazon S3 + CloudFlare](http://danielmiessler.com/blog/wordpress-optimization-results-varnishnginxapc-w3-total-cache-amazon-s3-cloudflare), Daniel Miessler
310
+ * [Case Study: WordPress, MaxCDN, CloudFlare and W3 Total Cache Integration](http://www.thewebhostinghero.com/articles/case-study-wp-maxcdn-cloudflare.html), Ritesh Sanap
311
+
312
+ **May 2011:**
313
+
314
+ * [HOW TO: Get Google Page Speed Report Via W3 Total Cache](http://hellboundbloggers.com/2011/05/10/get-google-page-speed-report-in-w3-total-cache/), S.Pradeep Kumar
315
+ * [Optimizing WordPress with Nginx, Varnish, APC, W3 Total Cache, and Amazon S3 (With Benchmarks)](http://danielmiessler.com/blog/optimizing-wordpress-with-nginx-varnish-w3-total-cache-amazon-s3-and-memcached), Daniel Miessler
316
+ * [Poll: Best Caching Plugin for WordPress?](http://digwp.com/2011/05/best-caching-plugin-wordpress/), Jeff Starr
317
+ * [Page Speed Online has a shiny new API](http://googlecode.blogspot.com/2011/05/page-speed-online-has-shiny-new-api.html), Andrew Oates and Richard Rabbat
318
+ * [Use W3 Total Cache to Speed Up Your WordPress Site](http://www.ostraining.com/blog/wordpress/w3-total-cache/), Steve Burge
319
+
320
+ **April 2011:**
321
+
322
+ * [Setting Up and Optimizing W3 Total Cache](http://tentblogger.com/w3-total-cache/), John Saddington
323
+ * [How To Configure The Various W3TC Plugin Settings For Your WordPress Blog](http://www.makeuseof.com/tag/configure-w3tc-plugin-wordpress/), James Bruce
324
+ * [Speeding Up Your WordPress Website: 11 Ways to Improve Your Load Time](http://wpmu.org/speeding-up-your-wordpress-website-11-ways-to-improve-your-load-time/), Siobhan Ambrose
325
+ * [Recipe for Baked WordPress](http://carpeaqua.com/2011/04/05/recipe-for-baked-wordpress/), Justin Williams
326
+ * [WordPress + W3 Total Cache + CDN story](http://translate.google.com/translate?hl=en&sl=auto&tl=en&u=http%3A%2F%2Fblog.gaspanik.com%2Factivate-cdn-option-on-w3totalcache), Mori Masako
327
+ * [SETTING UP W3 TOTAL CACHE PART 2](http://www.geekforhim.com/setting-up-w3-total-cache-part-2/), Matthew Snider
328
+ * [SETTING UP W3 TOTAL CACHE PART 1](http://www.geekforhim.com/setting-up-w3-total-cache-part-1/), Matthew Snider
329
+
330
+ **March 2011:**
331
+
332
+ * [WPML with W3TC for Fast and Efficient Multilingual Websites](http://wpml.org/2011/03/wpml-with-w3tc/), Amir
333
+
334
+ **February 2011:**
335
+
336
+ * [Optimizing WordPress with Nginx, Varnish, W3 Total Cache, Amazon S3, and Memcached (With Benchmarks)](http://danielmiessler.com/blog/optimizing-wordpress-with-nginx-varnish-w3-total-cache-amazon-s3-and-memcached), Daniel Miessler
337
+ * [My WordPress site loads in 2 seconds... does yours?](http://labsecrets.com/blog/2011/02/14/my-wordpress-site-loads-in-two-seconds-does-yours/)
338
+
339
+ **January 2011:**
340
+
341
+ * [Caching a Dynamic Website. Does it Make a Difference for Loading Speed?](http://bacsoftwareconsulting.com/blog/index.php/web-programming/caching-a-dynamic-website-does-it-make-a-difference-for-loading-speed/)
342
+ * [11 Important Steps to Optimize WordPress and Increase Performance](http://www.bernskiold.com/2011/01/10/11-important-steps-to-optimize-wordpress-and-increase-performance/), Erik Bernskiold
343
+ * [Speed up WordPress with the W3 Total Cache Plugin](http://wplift.com/speed-up-wordpress-with-the-w3-total-cache-plugin), Oliver Dale
344
+ * [How to Make Your Blog Load Faster than ProBlogger](http://www.problogger.net/archives/2011/01/04/how-to-make-your-blog-load-faster-than-problogger/), Pro Blogger
345
+ * [WP Honors Winner, Free Plugin Category](http://wpcandy.com/reports/the-2010-wphonors-award-winners), WPCandy.com
346
+
347
+ **December 2010:**
348
+
349
+ * [Best blog plugins](http://www.blog.web6.org/best-blog-plugins/)
350
+ * [How To Make Your WordPress Blog Load Faster](http://www.johnchow.com/how-to-make-your-wordpress-blog-load-faster/), John Chow
351
+ * [Unleash the Power of WordPress Using Plugin Combos](http://freelancefolder.com/unleash-the-power-of-wordpress-using-plugin-combos/), Paul de Wouters
352
+ * [Rackspace Cloud Files for WordPress](http://sporkmarketing.com/blog/1095/rackspace-cloud-files-wordpress/), Jason Lancaster
353
+
354
+ **November 2010:**
355
+
356
+ * [Make your blog super fast with W3 Total Cache plugin](http://laspas.gr/2010/11/26/make-blog-super-fast-w3-total-cache-plugin/), Stratos Laspas
357
+ * [10 WordPress Plugins I'm Thankful For (And Cannot Live Without)](http://wpmu.org/10-wordpress-plugins-im-thankful-for-and-cannot-live-without/), Sarah Gooding
358
+ * [Subjective Results of Installing W3 Total Cache Plugin](http://www.codyhatch.com/administriva/subjective-results-of-installing-w3-total-cache-plugin/), Cody Hatch
359
+ * [13 Plugins Your WordPress Site Might Need](http://www.jonbishop.com/2010/11/13-plugins-your-wordpress-site-might-need/), Jon Bishop
360
+ * [Best WordPress Plugins that Marketers Use](http://www.nicoleonthenet.com/6390/best-wordpress-plugins-marketers-use/), Nicole Dean
361
+ * [WordPress Fat-Loss Diet to Speed Up & Ease Load](http://superbeachbody.com/12528/wordpress-fat-loss-diet-to-speed-up-ease-load/), Erhald Bergman
362
+ * [10 WordPress Plugins I'm Thankful For (And Cannot Live Without)](http://wpmu.org/10-wordpress-plugins-im-thankful-for-and-cannot-live-without/), Sarah Gooding
363
+ * [Subjective Results of Installing W3 Total Cache Plugin](http://www.codyhatch.com/administriva/subjective-results-of-installing-w3-total-cache-plugin/), Cody Hatch
364
+ * [W3 Total Cache Plugin](http://www.xenritech.com/w3-total-cache-plugin.html/)
365
+
366
+ **October 2010:**
367
+
368
+ * [20 Wordpress Plugins for Successful Internet Marketers](http://www.incomediary.com/20-wordpress-plugins-for-successful-internet-marketers/), Michael Dunlop
369
+ * [Failure Under Load](http://blog.hybridindie.com/2010/10/20/failure-load/), John Brien
370
+ * [W3 Total Cache and site response time (as measured by Pingdom)](http://www.pauldavidolson.com/blog/2010/w3-total-cache-and-site-response-time-as-measured-by-pingdom/), Paul David Olson
371
+ * [Overhauling WordPress Performance](http://brianegan.com/overhauling-wordpress-performance/), Brian Egan
372
+ * [How to Make WordPress Run Faster](http://www.stevecoursen.com/498/how-to-make-wordpress-run-faster/), Stephen Coursen
373
+ * [Give Your Wordpress Blog Lightning Fast Speeds With W3 Total Cache](http://www.makeuseof.com/tag/give-wordpress-blog-lightning-fast-speeds-w3-total-cache/), Steven Campbell
374
+ * [W3 Total Cache and site response time (as measured by Pingdom)](http://www.pauldavidolson.com/blog/2010/w3-total-cache-and-site-response-time-as-measured-by-pingdom/), Paul David Olson
375
+ * [11 Ways to Make Your WordPress Site Faster and Leaner](http://wpmu.org/11-ways-to-make-your-wordpress-site-faster-and-leaner/), Sarah Gooding
376
+ * [The Top 10 of Your Top 5 Plugins](http://weblogtoolscollection.com/archives/2010/10/04/the-top-10-of-your-top-5-plugins/), James Huff
377
+ * [Integrating memcached to wordpress](http://www.ruchirablog.com/intergrating-memcached-to-wordpress/), Ruchira Sahan
378
+ * [Make WordPress Faster (on the Rackspace Cloud)](http://www.mattytemple.com/2010/10/make-wordpress-faster-on-the-rackspace-cloud/), Matt Temple
379
+
380
+ **September 2010:**
381
+
382
+ * [Review: W3 Total Cache [WordPress Plugin]](http://sokkz.com/2010/09/29/review-w3-total-cache-wordpress-plugin/)
383
+ * [Plugins to Power-Up Your WordPress Installation](http://www.afiffattouh.com/web-design/plugins-to-power-up-your-wordpress-installation), Afif Fattouh
384
+ * [Reduce Page Loading Time by 300% With W3 Total Cache](http://c3mdigital.com/2010/09/reduce-page-loading-time-w3-total-cache/), Chris Olbekson
385
+ * [Performance Unleashed: How To Optimize Websites For Speed](http://diythemes.com/thesis/improve-website-pagespeed/), Willie Jackson
386
+ * [5 Best WordPress Plugins To Improve The Loading Speed Of a Blog](http://www.gadgetcage.com/2010/09/5-best-wordpress-plugins-to-improve-the-loading-speed-of-a-blog.html/)
387
+ * [WordPress Fat-Loss Diet to Speed Up & Ease Load](http://www.daljinskapodrska.com/wordpress-fat-loss-diet-to-speed-up-ease-load/)
388
+
389
+ **August 2010:**
390
+
391
+ * [WordPress Speed and Optimization Guide](http://thesocialmediaguide.com.au/2010/08/30/wordpress-speed-and-optimization-guide/), Matthew Tommasi
392
+ * [How to configure WordPress Blogs Search Engine Friendly](http://solvater.com/2010/09/how-to-configure-wordpress-blog-search-engine-friendly-complete-beginners-guide-for-wordpress-seo/), Arafath Hashmi
393
+ * [How to Install and Setup W3 Total Cache for Beginners](http://www.wpbeginner.com/plugins/how-to-install-and-setup-w3-total-cache-for-beginners/)
394
+ * [20 Most Useful WordPress Plugins](http://zemalf.posterous.com/20-most-useful-wordpress-plugins), Antti Kokkonen
395
+ * [Speed up, compress and optimise WordPress using W3 Total Cache](http://thisishelpful.com/speed-compress-optimise-wordpress-w3-total-cache.html)
396
+ * [W3 Total Cache - Further optimization of the blog](http://www.bhoffmeier.de/2010/08/21/w3-total-cache-weitere-optimierung-des-blogs/), Bernd Hoffmeier
397
+ * [W3 Total Cache Fixes Bugs, Adds Features with Update](http://www.whoishostingthis.com/blog/2010/08/04/first-draft-w3-total-cache-fixes-bugs-adds-features-with-update/), Jonathan
398
+ * [The Quickest Way To Make Your Blog Load Faster](http://www.peterleehc.com/blog/work-from-home/the-quickest-way-to-make-your-blog-load-faster), Peter Lee
399
+
400
+ **July 2010:**
401
+
402
+ * [Getting W3 Total Cache and a mobile plugin to work in WordPress](http://blog.trasatti.it/2010/07/getting-w3-total-cache-and-a-mobile-plugin-to-work-in-wordpress.html), Andrea Trasatti
403
+ * [Improve Your WordPress Performance With W3 Total Cache](http://maketecheasier.com/improve-wordpress-performance-with-w3-total-cache/2010/07/21), Damien Oh
404
+ * [Four Simple Steps For Big Gains In Page Speed](http://www.dailyblogtips.com/four-simple-steps-for-big-gains-in-page-speed/), Greg Hayes
405
+ * [How to use Content Delivery Network on Shared Hosting for WordPress](http://solvater.com/2010/07/content-delivery-network-shared-hosting-wordpress-configuration-with-w3-total-cache-in-wordpress/), Arafath Hashmi
406
+ * [How to Use Google Webmaster Tools to Diagnose and Improve WordPress Page Speed](http://wpmu.org/how-to-use-google-webmaster-tools-to-diagnose-and-improve-wordpress-page-speed/), Sarah Gooding
407
+ * [Caching Wordpress - Preparing Your Blog For The Mainstream](http://bradblogging.com/how-to/caching-wordpress-preparing-your-blog-for-the-mainstream/), Brad Ney
408
+ * [11 Ways to Speed Up WordPress](http://mashable.com/2010/07/19/speed-up-wordpress/), Cyrus Patten
409
+ * [How To Decrease Page Loading Time Of Your WordPress Blog By 75%](http://bloggingwithsuccess.net/decrease-loading-times), Ishan Sharma
410
+ * [Top 10 Wordpress Plugins which I use on DailyBlogging](http://www.dailyblogging.org/wordpress/top-10-wordpress-plugins-which-i-use-on-dailyblogging/), Mani Viswanathan
411
+ * [Install and Configure W3 Total Cache in 7 Easy Steps](http://zemalf.com/1443/w3-total-cache/), Antti Kokkonen
412
+ * [How to Reduce the Loading Time of Your Blog](http://www.admixweb.com/2010/07/09/how-to-reduce-the-loading-time-of-your-blog/), Rishabh Agarwal
413
+ * [5 Wordpress Plugins You Need To Know About](http://thenextweb.com/apps/2010/07/06/5-wordpress-plugins-you-need-to-know-about/), James Hicks
414
+
415
+ **June 2010:**
416
+
417
+ * [Speed Up Your Wedding Photography Website in less than 5 minutes](https://www.zippykid.com/2010/06/07/speed-up-your-wedding-photography-website/), Vid Luther
418
+ * [12 Ways to Improve Wordpress Page Load Time](http://myblog2day.com/12-ways-to-improve-wordpress-page-load-time.php), Lee Ka Hoong
419
+ * [Significantly Speed Up Your WordPress Blog in 9 Easy Steps](http://www.bloggingpro.com/archives/2010/06/21/significantly-speed-up-your-wordpress-blog-in-9-easy-steps/), Robyn-Dale Samuda
420
+ * [Speed 'Em Up: Wordpress &amp; W3 Total Cache](http://translate.google.com/translate?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&u=http://www.andilicious.com/blog/1473/20100610/wordpress-beschleunigen-grundlagen-w3-total-cache-page-speed&sl=auto&tl=en), Andi Licious
421
+
422
+ **May 2010:**
423
+
424
+ * [Make Your Blog 10x Faster With W3 Total Cache Plug-in](http://www.strictlyonlinebiz.com/blog/speed-up-wordpress-with-w3-total-cache/1231/), Udegbunam Chukwudi
425
+ * [xCache v1.3.0 Now Available](http://webcache.googleusercontent.com/search?q=cache%3Ahttp%3A%2F%2Fresellr.net%2Fxcache-now-available%2F&rls=com.microsoft:en-us&ie=UTF-8&oe=UTF-8&startIndex=&startPage=1&rlz=1I7GGIE_en&redir_esc=&ei=NO49TNaAFIH60wS2zuXLDg), Michael
426
+ * [Maximize WordPress and BuddyPress Performance With W3 Total Cache](http://wpmu.org/maximize-wordpress-and-buddypress-performance-with-w3-total-cache/), Sarah Gooding
427
+ * [Is Your Wordpress Blog Slow to Load?](http://homenotion.com/blog/blogs/is-your-wordpress-blog-slow-to-load/), Elizabeth McGee
428
+
429
+ **April 2010:**
430
+
431
+ * [WordPress Optimization: How I Reduced Page Load Time by 75%](http://www.kadavy.net/blog/posts/wordpress-optimization-dreamhost-rackspace/), David Kadavy
432
+ * [Top 10 Wordpress Plugins Your Blog Should Have (Video)](http://www.blogsuccessjournal.com/blog-tips-and-advice/wordpress-tips-advice/top-10-wordpress-plugins-your-blog-should-have-video/), Dan &amp; Jennifer
433
+ * [Super or Total? Money Talks But Cache Rules](http://website-in-a-weekend.net/website-maintenance/super-total-money-talks-cache-rules/), Dave Thackeray
434
+ * [W3 Total Cache, the most comprehensive cache plugin in WordPress](http://blogandweb.com/wordpress/w3-total-cache-plugin-cache-wordpress/), Francisco Oliveros
435
+ * [10 OF THE BEST WORDPRESS PLUGINS IN 2010](http://www.sitesketch101.com/best-wordpress-plugins), Nicholas Cardot
436
+
437
+ **March 2010:**
438
+
439
+ * [Howto: Speed up WordPress sites by using Amazon Cloudfront](http://www.jitscale.com/howto-speed-up-wordpress-sites-by-using-amazon-cloudfront/), Niek Waarbroek
440
+ * [Wordpress Cache Plugin Benchmarks](http://cd34.com/blog/scalability/wordpress-cache-plugin-benchmarks/), Chris Davies
441
+ * [Wordpress + W3 Total Cache + MaxCDN How-To](http://rackerhacker.com/2010/02/13/wordpress-w3-total-cache-maxcdn/), Major Hayden
442
+
443
+ **February 2010:**
444
+
445
+ * [Blog Building: How To Dramatically Speed Up Your WordPress Site with W3 Total Cache](http://nimopress.com/pressed/blog-building-how-to-dramatically-speed-up-your-wordpress-site-with-w3-total-cache/), Nicholas Ong
446
+ * [Wordpress + W3 Total Cache + MaxCDN How-To](http://rackerhacker.com/2010/02/13/wordpress-w3-total-cache-maxcdn/), Major Hayden
447
+ * [Utilizing W3 Total Cache](http://www.reviewkin.com/utilizing-w3-total-cache/), Anangga Pratama
448
+ * [Shared Hosting vs. Cloud Hosting](http://gregrickaby.com/2010/02/shared-hosting-vs-cloud-hosting.html), Greg Rickaby
449
+ * [My Thoughts on Premium Plugins](http://weblogtoolscollection.com/archives/2010/02/04/my-thoughts-on-premium-plugins/), Ronald Huereca
450
+ * [W3 Total Cache Plugin for Wordpress Eats WP Super Cache's Lunch!](http://human3rror.com/w3-total-cache-plugin-for-wordpress-eats-wp-super-caches-lunch/), John Saddington
451
+
452
+ **January 2010:**
453
+
454
+ * [WordPress Cacheing with W3 Total Cache](http://blog.whoishostingthis.com/2010/01/19/wordpress-cacheing-w3-total-cache/), Jonathan
455
+ * [Configuring W3 Total Cache for WordPress](http://translate.google.com/translate?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&u=http://da.clausheinrich.com/w3-total-cache-wordpress/&sl=auto&tl=en)
456
+ * [Wordpress load test part 2 - amendment](http://loadimpact.com/blog/wordpress-load-test-part-2-amendment), Erik Torsner
457
+ * [Wordpress - Accelerate your site with W3 Total Cache](http://translate.google.com/translate?hl=en&sl=auto&tl=en&u=http://www.egonomik.com/2010/01/wordpress-w3-total-cache-ile-sitenizi-hizlandirin-sunucunuzu-rahatlatin/), Caner Phenix
458
+
459
+ **December 2009:**
460
+
461
+ * [WordPress Plugin &mdash; Best of 4 Caching Plugins](http://nimopress.com/pressed/wordpress-plugin-best-of-4-caching-plugins/), Nicholas Ong
462
+ * [Speed Up Your Blog With W3 Total Cache &amp; Amazon](http://www.freedomtarget.com/w3-total-cache-with-amazon-s3-and-cloudfront), Kevin McKillop
463
+ * [W3 Total Cache with Amazon S3 and CloudFront](http://kovshenin.com/archives/w3-total-cache-with-amazon-s3-and-cloudfront/), Konstantin Kovshenin
464
+
465
+ **November 2009:**
466
+
467
+ * [How to Boost Ad Revenue: Speed is Your Secret Weapon](http://blog.buysellads.com/2009/11/how-to-boost-ad-revenue-speed-is-your-secret-weapon/), Todd Garland
468
+
469
+ **October 2009:**
470
+
471
+ * [Plugin: WordPress Caching with CDN Integration](http://www.blogperfume.com/plugin-wordpress-caching-with-cdn-integration/)
472
+ * [8 Powerful Wordpress Plugins You Probably Don't Use But Should](http://www.smashingapps.com/2009/10/19/8-powerful-wordpress-plugins-you-probably-dont-use-but-should.html), AN Jay
473
+ * [Beyond Super Cache: W3 Total Cache](http://www.webmaster-source.com/2009/10/15/beyond-super-cache-w3-total-cache/), Matt Harzewski
474
+
475
+ **September 2009:**
476
+
477
+ * [Why Noupe.com is Loading So Much Faster?](http://209.85.129.132/search?q=cache:PgY8haU_0I4J:www.noupe.com/spotlight/why-noupe-com-is-loading-pretty-fast.html+http://www.noupe.com/spotlight/why-noupe-com-is-loading-pretty-fast.html&cd=1&hl=en&ct=clnk&gl=it), Noura Yehia
478
+
479
+ **August 2009:**
480
+
481
+ * [W3 Total Cache Plugin](http://dougal.gunters.org/blog/2009/08/26/w3-total-cache-plugin), Dougal Campbell
482
+
483
+ **July 2009:**
484
+
485
+ * [W3 Total Cache](http://weblogtoolscollection.com/pluginblog/2009/07/27/w3-total-cache/)
pub/css/error.css CHANGED
File without changes
pub/css/index.html CHANGED
File without changes
pub/css/lightbox.css CHANGED
File without changes
pub/css/options.css CHANGED
File without changes
pub/css/popup.css CHANGED
File without changes
pub/css/widget.css CHANGED
File without changes
pub/img/W3TC_dashboard_logo_title-retina.png CHANGED
Binary file
pub/img/W3TC_dashboard_logo_title.png CHANGED
Binary file
pub/img/button-grad-active.png CHANGED
File without changes
pub/img/button-grad.png CHANGED
File without changes
pub/img/cdn-highwinds-logo.png CHANGED
Binary file
pub/img/close.png CHANGED
File without changes
pub/img/google-logo.png CHANGED
Binary file
pub/img/index.html CHANGED
File without changes
pub/img/open.png CHANGED
File without changes
pub/img/overlay/ceo.png CHANGED
Binary file
pub/img/overlay/gray-check.png CHANGED
Binary file
pub/img/overlay/list-check.png CHANGED
Binary file
pub/img/overlay/lite-gray-check.png CHANGED
Binary file
pub/img/overlay/lock.png CHANGED
Binary file
pub/img/overlay/overlay-close.png CHANGED
Binary file
pub/img/overlay/overlay-down-arrow.png CHANGED
Binary file
pub/img/overlay/overlay-logo.png CHANGED
Binary file
pub/img/overlay/save-close.png CHANGED
Binary file
pub/img/overlay/select-arrow.png CHANGED
Binary file
pub/img/overlay/twitter-bird-dark-bgs.png CHANGED
Binary file
pub/img/overlay/w3-meteor.png CHANGED
Binary file
pub/img/overlay/wordpress-logo-simplified-rgb.png CHANGED
Binary file
pub/img/ps_bar.gif CHANGED
File without changes
pub/img/ps_grad.gif CHANGED
File without changes
pub/img/ps_scores.png CHANGED
File without changes
pub/img/sidebar-background.png CHANGED
File without changes
pub/img/w3tc-sprite-admin-bar.png CHANGED
File without changes
pub/img/w3tc-sprite-retina.png CHANGED
Binary file
pub/img/w3tc-sprite.png CHANGED
File without changes
pub/img/w3tc_google-logo-retina.png CHANGED
Binary file
pub/img/w3tc_google-logo.png CHANGED
Binary file
pub/img/w3tc_maxcdn-logo-retina.png CHANGED
Binary file
pub/img/w3tc_maxcdn-logo.png CHANGED
Binary file
pub/img/w3tc_netdna-logo-retina.png CHANGED
Binary file
pub/img/w3tc_netdna-logo.png CHANGED
Binary file
pub/img/w3tc_newrelic-logo-retina.png CHANGED
Binary file
pub/img/w3tc_newrelic-logo.png CHANGED
Binary file
pub/img/w3tc_swarmify-logo-retina.png ADDED
Binary file
pub/img/w3tc_swarmify-logo.png ADDED
Binary file
pub/img/w3tc_w3edge-logo-retina.png CHANGED
Binary file
pub/img/w3tc_w3edge-logo.png CHANGED
Binary file
pub/img/w3tc_w3tc-logo-retina.png CHANGED
Binary file
pub/img/w3tc_w3tc-logo.png CHANGED
File without changes
pub/img/white-grad-active.png CHANGED
File without changes
pub/img/white-grad.png CHANGED
File without changes
pub/img/wpspin_light.gif CHANGED
File without changes
pub/index.html CHANGED
File without changes
pub/js/index.html CHANGED
File without changes
pub/js/jquery.masonry.min.js CHANGED
File without changes
pub/js/lightbox.js CHANGED
File without changes
pub/js/metadata.js CHANGED
File without changes
pub/js/options.js CHANGED
@@ -388,6 +388,8 @@ function w3tc_use_poll_zone(type, nonce) {
388
  }
389
 
390
  function w3tc_starts_with(s, starts_with) {
 
 
391
  return s.substr(0, starts_with.length) == starts_with;
392
  }
393
 
@@ -467,6 +469,8 @@ jQuery(function() {
467
  'browsercache__other__compression']);
468
  w3tc_toggle2('browsercache_replace',
469
  ['browsercache__cssjs__replace', 'browsercache__other__replace']);
 
 
470
  w3tc_toggle2('browsercache_nocookies',
471
  ['browsercache__cssjs__nocookies', 'browsercache__other__nocookies']);
472
 
388
  }
389
 
390
  function w3tc_starts_with(s, starts_with) {
391
+ s = s.replace(/\n/g, '');
392
+ s = s.replace(/\s/g, '');
393
  return s.substr(0, starts_with.length) == starts_with;
394
  }
395
 
469
  'browsercache__other__compression']);
470
  w3tc_toggle2('browsercache_replace',
471
  ['browsercache__cssjs__replace', 'browsercache__other__replace']);
472
+ w3tc_toggle2('browsercache_querystring',
473
+ ['browsercache__cssjs__querystring', 'browsercache__other__querystring']);
474
  w3tc_toggle2('browsercache_nocookies',
475
  ['browsercache__cssjs__nocookies', 'browsercache__other__nocookies']);
476
 
pub/js/popup.js CHANGED
File without changes
pub/js/widget.js CHANGED
File without changes
pub/opcache.php CHANGED
File without changes
pub/sns.php CHANGED
File without changes
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Plugin Name ===
2
  Contributors: fredericktownes
3
- Tags: seo, w3totalcache, w3 totalcache, w3total cache, wpo, web performance optimization, performance, availability, scaling, scalability, user experience, cache, caching, page cache, css cache, js cache, db cache, disk cache, disk caching, database cache, http compression, gzip, deflate, minify, cdn, content delivery network, media library, performance, speed, multiple hosts, css, merge, combine, unobtrusive javascript, compress, optimize, optimizer, javascript, js, cascading style sheet, plugin, yui, yui compressor, zend, opcache, apcu, google drive, highwinds, full site delivery, full site acceleration, google, google rank, google page speed, mod_pagespeed, new relic, newrelic, aws, s3, cloudfront, sns, elasticache, rds, flash media server, amazon web services, cloud files, rackspace, akamai, max cdn, limelight, cloudflare, mod_cloudflare, microsoft, microsoft azure, iis, nginx, litespeed, apache, varnish, xcache, apc, eacclerator, wincache, redis, narcissus, wpmml, mysql, w3 total cache, batcache, wp cache, wp super cache, quick cache, wp minify, bwp-minify, buddypress
4
  Requires at least: 3.2
5
  Tested up to: 4.7.1
6
- Stable tag: 0.9.5.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -262,492 +262,6 @@ Install the plugin to read the full FAQ on the plugins FAQ tab.
262
 
263
  * Read [testimonials](https://twitter.com/w3edge/favorites) from W3TC users.
264
 
265
- == Press: Mentions, Tutorials &amp; Reviews ==
266
-
267
- **March 2015**
268
-
269
- * [Make WordPress 10x Faster By W3 Total Cache + CloudFlare](http://www.bloggingspell.com/w3-total-cache-cloudflare/), Abrar Mohi Shafee
270
-
271
- **February 2015**
272
-
273
- * [WordPress 4.1 vs WordPress 4.0 Performance Comparison](https://www.conetix.com.au/blog/wordpress-41-vs-wordpress-40-performance), Tim Butler
274
-
275
- **December 2014**
276
-
277
- * [Don’t Blog Unless You Use These 11 Tools](http://www.quicksprout.com/2014/12/29/dont-blog-unless-you-are-using-these-11-tools/), Neil Patel
278
-
279
- **November 2014:**
280
-
281
- * [10 Must Have WordPress Plugins – 2014 Edition](http://www.sitepoint.com/10-must-wordpress-plugins-2014/), James George
282
-
283
- **October 2014:**
284
-
285
- * [The best WordPress plugins revealed by 39 WordPress enthusiasts](https://psdtowp.net/wordpress-plugins.html), PSD to WordPress
286
-
287
- **September 2014:**
288
-
289
- * [Using New Relic to Monitor WordPress Performance](http://code.tutsplus.com/tutorials/using-new-relic-to-monitor-wordpress-performance--cms-22002), Jeff Reifman
290
-
291
- **July 2014:**
292
-
293
- * [40+ Essential Tips, Tools and Resources to Start a WordPress Blog](https://zapier.com/blog/wordpress-blog-tips-tools-resources/), Kristi Hines
294
-
295
- **April 2014:**
296
-
297
- * [Configuring W3 Total Cache: An Introduction](http://code.tutsplus.com/tutorials/perfect-configurations-of-w3-total-cache-plugin-for-beginners--wp-35364), Ahmad Awais
298
- * [25+ Must-Have WordPress Plugins for 2014](http://premium.wpmudev.org/blog/25-must-have-wordpress-plugins-for-2014/), Raelene Wilson
299
-
300
- **February 2014:**
301
-
302
- * [Best WordPress Plugins: 40 Experts Share Their Favorite WordPress Plugins](http://www.wpkube.com/best-wordpress-plugins/), Devesh Sharma
303
-
304
- **August 2013:**
305
-
306
- * [12 Free WordPress Plugins That Could Make You A Better Blogger](http://www.wpkube.com/12-free-wordpress-plugins-that-could-make-you-a-better-blogger/), Reginald
307
-
308
- **June 2013:**
309
-
310
- * [Test of WordPress Caching Plugins – W3 Total Cache vs WP Super Cache vs Quick Cache](http://www.dashboardjunkie.com/test-of-wp-caching-plugins-w3-total-cache-vs-wp-super-cache-vs-quick-cache), Kim Tetzlaff
311
-
312
- **March 2013:**
313
-
314
- * [Top 25 Most Downloaded WordPress Plugins](http://wpforce.com/top-25-most-downloaded-wordpress-plugins/), Jonathan Dingman
315
-
316
- **January 2013:**
317
-
318
- * [Making WordPress Faster with Apache, Varnish and W3 Total Cache on Amazon AWS EC2 with CloudFront](http://jeffreifman.com/2013/01/26/making-wordpress-faster-with-apache-varnish-and-w3-total-cache-on-amazon-aws-ec2-with-cloudfront-cdn/), Jeff Reifman
319
- * [How to Speed Up Your WordPress Site (Quickly and Easily)](http://www.wpexplorer.com/how-to-speed-up-wordpress), Tom Ewer
320
- * [The Periodic Table of WordPress Plugins](http://www.wpexplorer.com/the-periodic-table-of-wordpress-plugins-and-my-top-5/), Tom Ewer
321
- * [WordPress Optimization Guide](http://gtmetrix.com/wordpress-optimization-guide.html)
322
-
323
- **December 2012:**
324
-
325
- * [5 of My Favorite WordPress Plugins in 2012](http://torquemag.io/fav-plugins-2012/), Jay Hoffmann
326
- * [The 25 Best WordPress Plugins Ever](http://www.websitemagazine.com/content/blogs/posts/archive/2012/12/05/the-25-best-wordpress-plugins-ever.aspx), Michael Garrity
327
-
328
- **November 2012:**
329
-
330
- * [What You Should Know About Using a CDN With WordPress](http://themefuse.com/blog/what-you-should-know-about-using-a-cdn-with-wordpress/), Karol Krol
331
-
332
- **October 2012:**
333
-
334
- * [The ManageWP Guide to Speeding Up Your WordPress Site with Plugins](http://managewp.com/how-to-speed-up-your-wordpress-website), Tom Ewer
335
-
336
-
337
- **September 2012:**
338
-
339
- * [Secrets Of High-Traffic WordPress Blogs](http://wp.smashingmagazine.com/2012/09/12/secrets-high-traffic-wordpress-blogs/), Siobhan McKeown
340
- * [10 essential WordPress plugins](http://www.computerworld.com/s/article/9230638/10_essential_WordPress_plugins), Ken Gagne
341
-
342
- **August 2012:**
343
-
344
- * [#114: Let’s Do Simple Stuff to Make Our Websites Faster](http://css-tricks.com/video-screencasts/114-lets-do-simple-stuff-to-make-our-websites-faster/), Chris Coyier
345
- * [The Plugins I Run](http://pippinsplugins.com/the-plugins-i-run/), Pippin Williamson
346
- * [WordPress Cache: WP Super Cache vs W3 Total Cache](http://www.wpbrix.com/wordpress-seo/wordpress-cache-wp-super-cache-vs-w3-total-cache/)
347
- * [15 Tips to Speed Up Your Website](http://www.seomoz.org/blog/15-tips-to-speed-up-your-website), Armin Jalili
348
-
349
- **July 2012:**
350
-
351
- * [Using Liquid Web's CDN with WordPress via W3 Total Cache](http://lw.rrfaae.com/2012/07/using-liquid-webs-cdn-with-wordpress-via-w3-total-cache/), Jason Gillman Jr.
352
- * [Tips for Server Admins &amp; Website Owners](http://www.tharunpkarun.com/2012/07/tips-for-server-admins-website-owners/), Tharun Karun
353
- * [Step-by-Step guide to WordPress Optimization using W3 Total Cache](http://pthakkar.com/category/website-optimization/w3-total-cache/),Pankaj Thakkar
354
- * [Top 10 Most Essential WordPress Plugins, Must Install](http://omgtoptens.com/web/wordpress/top-10-most-essential-wordpress-plugins-must-install/)
355
- * [W3 Total Cache Vs WP Super Cache: Best Caching Plugin?](http://bloggerspassion.com/w3-total-cache-vs-wp-super-cache/), Anil Agarwal
356
- * [How to Install and Configure W3 Total Cache](http://www.techlila.com/wordpress-plugins/how-to-install-configure-w3-total-cache-worpress/)
357
-
358
- **June 2012:**
359
-
360
- * [The Meaning of Plugins and The Best WordPress Plugins](http://www.bloggersdeck.com/the-meaning-of-plugins-and-the-best-wordpress-plugins/), Reginald Chan
361
- * [6 Essential Plugins for New WordPress Sites](http://blog.presstrends.io/2012/06/6-essential-plugins-for-new-wordpress-sites/), Mitch Monsen
362
-
363
- **May 2012:**
364
-
365
- * [W3 Total Cache Settings](http://techod.com/w3-total-cache-settings/), Jason Graham
366
- * [Leverage Browser Caching with W3 Total Cache](http://www.mvestormedia.com/leverage-browser-caching-w3-total-cache/), Ian Rogers
367
-
368
- **April 2012:**
369
-
370
- * [Apache Traffic Server as a Reverse Proxy](http://kpayne.me/2012/04/10/apache-traffic-server-as-a-reverse-proxy/), Kurt Payne
371
- * [Essential WordPress Plugins For Every WordPress Blog](http://www.softlovers.com/essential-wordpress-plugins-for-every-wordpress-blog/), Shashank Johri
372
- * [First Steps On A Fresh WordPress Install](http://wpshout.com/first-steps-on-a-fresh-install/), Alex Denning
373
- * [Essential WordPress Plugins](http://the-hate-project.blogspot.com/2012/04/essential-wordpress-plugins.html)
374
- * [15 Ridiculously Useful WordPress Plugins for Travel Bloggers](http://travelbloggeracademy.com/wordpress-travel-bloggers/), Adam Costa
375
- * [10 plugins every new WordPress blog should have](http://kcclaveria.com/2012/04/10-wordpress-plugins/)
376
- * [Caching and Synthesis Managed WordPress Hosting](http://websynthesis.com/caching-and-synthesis-managed-wordpress-hosting/)
377
- * [How to: Boost WordPress performance with W3 Total Cache and APC](http://www.neilturner.me.uk/2012/04/30/how-to-boost-wordpress-performance-with-w3-total-cache-and-apc.html), Neil Turner
378
- * [Supercharge WordPress Blog With Cloudflare, MaxCDN and W3 Total Cache](http://hellboundbloggers.com/2012/04/24/supercharge-wordpress-cloudflare-maxcdn-w3-total-cache/)
379
- * [W3 Total Cache Setup for Rackspace Cloud Sites with Cloud Files](http://thecustomizewindows.com/2012/04/w3-total-cache-setup-for-rackspace-cloud-sites-with-cloud-files/), Abhishek Ghosh
380
- * [11 Steps To Speed Up Your WordPress Site](http://www.paulund.co.uk/11-steps-to-speed-up-your-wordpress-site)
381
- * [Speeding Up WordPress With The W3 Total Cache Plugin](http://invenioblog.com/2012/04/speeding-up-wordpress-with-the-w3-total-cache-plugin/)
382
- * [11 of Our Favorite Wordpress Plugins](http://www.putontheglasses.com/blog/11-of-our-favorite-wordpress-plugins)
383
- * [Leverage Browser Caching with W3 Total Cache](http://www.mvestormedia.com/leverage-browser-caching-w3-total-cache/), Ian Rogers
384
- * [Speeding Up WordPress Websites](http://designershq.net/wordpress-plugins/speeding-up-wordpress-websites/), Craig Butcher
385
- * [How I Increased My Blog Loading Speed by 500%](http://www.asiogroups.com/how-i-increased-my-blog-loading-speed/)
386
- * [5 WordPress Plugins I Can’t Live Without – 2012 Edition](http://bit51.com/5-wordpress-plugins-i-cant-live-without-2012-edition/), Chris Wiegman
387
- * [Setting Up and Optimizing W3 Total Cache - Up to v0.9.2.4](http://tentblogger.com/w3-total-cache/)
388
- * [W3 Total Cache hilft bei WordPress Optimierung](http://blog.stenki.eu/2012/04/wordpress-optimierung-mit-w3-total-cache/)
389
-
390
- **March 2012:**
391
-
392
- * [The Plugins and Code Behind WPForce 2.0](http://wpforce.com/plugins-and-code-behind-wpforce/), Jonathan Dingman
393
- * [5 Must Have Plugins for WordPress Bloggers](http://igaret.com/wordpress/5-must-have-plugins-for-wordpress-bloggers), Garet McKinley
394
- * [10 Million hits a day with WordPress using a $15 server](http://www.ewanleith.com/blog/900/10-million-hits-a-day-with-wordpress-using-a-15-server), Ewan Leith via [Hacker News](http://news.ycombinator.com/item?id=3775715)
395
- * [High-Performance WordPress with W3 Total Cache and Nginx](http://elivz.com/blog/single/wordpress_with_w3tc_on_nginx/), Eli Van Zoeren
396
- * [How To Speed Up Your WordPress Blog](http://managewp.com/how-to-speed-up-your-wordpress-blog), Vladimir Prelovac
397
- * [The Lab + W3 Total Cache](http://www.purpleturtleproductions.ca/the-lab/new-category-the-lab-w3-total-cache/), Simon
398
- * [5 Powerful WordPress Plugins To Increase Sharing Of Your Articles](http://blog.kissmetrics.com/5-powerful-wordpress-plugins/)
399
- * [How I increased Websitez.com’s performance by an additional 20%](http://websitez.com/how-i-increased-websitez-coms-performance-by-an-additional-20/), Eric Stolz
400
- * [WordPress with W3 Total Cache on Nginx with APC ](http://chrisgilligan.com/wordpress/wordpress-with-w3-total-cache-on-nginx-with-apc-virtualmin/), Chris Gilligan
401
- * [Screencast Tuesday: Using W3 Total Cache Part 1](http://headwaythemes.com/screencast-tuesday-using-w3-total-cache-part-1/), AJ Morris
402
- * [Screencast Tuesday: Using W3 Total Cache Part 2 – Implementing a CDN](http://headwaythemes.com/screencast-tuesday-using-w3-total-cache-part-2-implementing-a-cdn/), AJ Morris
403
- * [A Quick Bit About WordPress Caching](http://blog.ryantoohil.com/2012/03/a-quick-bit-about-wordpress-caching.php), Ryan Toohil
404
- * [How To Find Out Which WordPress Plugins Are Making Your Site Slow](http://www.business2community.com/blogging/how-to-find-out-which-wordpress-plugins-are-making-your-site-slow-0138577), Kim Castleberry
405
- * [Top 20 Plugins Used Across 30,000+ WordPress Sites](http://www.presstrends.io/top-20-plugins-used-across-30000-wordpress-sites/), George Ortiz
406
- * [10 Plugins That Will Speed Up Your WordPress Site](http://blog.brainhost.com/10-plugins-that-will-speed-up-your-wordpress-site/)
407
- * [Using nRelate to Engage Readers & Make Money](http://imstash.com/using-nrelate-engage-readers-make-money/)
408
- * [Our Top 10 Favorite WordPress Plugins](http://sitefox.com/blog/top-10-favorite-wordpress-plugins/), Samir Balwani
409
- * [Screencast Tuesday: Using W3 Total Cache Part 1](http://headwaythemes.com/screencast-tuesday-using-w3-total-cache-part-1/), AJ Morris
410
- * [Build the WordPress wholly stations CDN utilize the caching plugin W3TC filmed cloud](http://www.84tt.com/web/2012/03/608.html)
411
- * [3 Tutorials For Speeding Up Your WordPress Site](http://blog.asmallorange.com/3-tutorials-for-speeding-up-your-wordpress-site/), McKinney Brown
412
- * [WordPress SEO & Security](http://www.albertawebsitemarketing.com/wordpress-seo-and-security/)
413
- * [CDN – WTF?](http://talkingwordpress.com/cdn-wtf/)
414
- * [Supercharge WordPress, Part 3](http://linuxaria.com/article/supercharge-wordpress-part-3?lang=en)
415
- * [7 Effective Ways To Make Your WordPress Blog Load Faster](http://www.uniquetipsonline.com/7-effective-ways-to-make-your-wordpress-blog-load-faster/)
416
- * [WordPress Plugins to Speed Up Your Website](http://blog.templatemonster.com/2012/03/01/wordpress-plugins-speed-up-blog-website/), Edward Korcheg
417
- * [CloudFlare and W3TC (Part I)](http://elimcmakin.com/cloudflare-and-w3tc-not-just-another-cdn-part-i/)
418
- * [CloudFlare and W3TC (Part II)](http://elimcmakin.com/cloudflare-and-w3tc-part-ii/)
419
- * [How to speed up WordPress – my experience with slow WordPress](http://bachutha.com/how-to-speed-up-wordpress-my-experience-with-slow-wordpress/)
420
- * [Make Your WordPress Site Lightning Fast](http://www.helpeverybodyeveryday.com/websocial-media/848-make-your-wordpress-site-lightning-fast), Matt Handal
421
- * [Speed Up WordPress Websites](http://wordpress-tips.info/speed-up-wordpress-websites/2012/03/27/)
422
- * [W3 Total Cache, caché y compresión para optimizar WordPress](http://www.gamblingprofesional.com/noticias/otros1/w3-total-cache-optimizando-wordpress-de-forma-sencilla/)
423
- * [Velocizzare WordPress](http://www.evemilano.com/2012/03/velocizzare-wordpress/), Giovanni Sacheli
424
- * [21 Wicked WordPress Plugins](http://garinkilpatrick.com/21-wicked-wordpress-plugins/), Garin Kilpatrick
425
- * [How to fix high-CPU load in WordPress](http://support.ecenica.com/wordpress/fix-high-cpu-load-wordpress/)
426
- * [How much (cache) is too much?](http://blog.gingerlime.com/2012/how-much-cache-is-too-much/), Yoav Aner
427
- * [10 Must Have WordPress Plugins Of 2012 Every Blogger Should Know About](http://www.jeffbullas.com/2012/03/13/10-must-have-wordpress-plugins-of-2012-every-blogger-should-know-about/), Leo Widrich
428
- * [Speed up your WordPress Blog: 5 Easy Steps](http://techwalls.com/blogging/speed-up-wordpress-blog-easy-steps/), Sanjib Saha
429
- * [7 Tips to Test Website Speed and Decrease WordPress Load Time](http://natedevore.com/7-tips-to-test-website-speed-and-decrease-wordpress-load-time/), Nate Devore
430
- * [How I increased Websitez.com’s performance by an additional 20%](http://websitez.com/how-i-increased-websitez-coms-performance-by-an-additional-20/), Eric Stolz
431
- * [WordPress with W3 Total Cache on Nginx with APC](http://chrisgilligan.com/wordpress/wordpress-with-w3-total-cache-on-nginx-with-apc-virtualmin/), Chris Gilligan
432
- * [Speed Up Your Website With The "W3 Total Cache" Wordpress Plugin](http://www.youtube.com/watch?v=Luf2Y_F23l0)
433
- * [WordPress W3 Total Cache Eklentisi Ayarları](http://www.55dakika.com/wordpress-w3-total-cache-eklentisi-ayarlari-34124.html)
434
- * [9 Essential WordPress Plugins](http://www.ostraining.com/blog/wordpress/9-essential-wordpress-plugins/), Ed Andrea
435
- * [15 Must Have WordPress Plugins for the New Blogger](http://avgjoegeek.net/15must-have-wordpress-plugins/), Jason Mathes
436
- * [10 Must Have WordPress Plugins For Your Blog](http://www.tricksmachine.com/2012/03/10-must-have-wordpress-plugins.html)
437
- * [How To Speed Up Your WordPress Blog](https://managewp.com/how-to-speed-up-your-wordpress-blog), Tom Ewer
438
- * [5 Best Plug-ins for WordPress Blog](http://www.thegeeksclub.com/5-plugins-wordpress-blog/), Jonathan Acabo
439
- * [Easy W3 Total Cache WordPress Plugin Configuration](http://www.mvestormedia.com/easy-w3-total-cache-configuration/), Ian Rogers
440
- * [Ideal W3 Total Cache Settings For Shared Hosting](http://www.kidnapcustomers.com/how-to-make-a-website/w3-total-cache-settings-wordpress-speed/)
441
-
442
- **February 2012:**
443
-
444
- * [Get Google Page Speed Report Via W3 Total Cache](http://www.myh3r3.com/code/get-google-page-speed-report-via-w3-total-cache/), Aayush Nagar
445
- * [3 WordPress Plugins To Speed Up Your Blog](http://www.wordpressninja.com/2012/02/speed-up-your-wordpress-blog/), Missy Diaz
446
- * [Top 5 Plugins for WordPress](http://creativetech.me/2012/02/top-5-plugins-wordpress/), Phill Fernandes
447
- * [Geeking out with WordPress, CDNs, and Amazon CloudFront](http://polizeros.com/2012/02/17/geeking-out-with-wordpress-cdns-and-amazon-cloudfront/), Bob Morris
448
- * [Top 10 Essential WordPress Plugins that Your Website Needs](http://impressthemes.com/2012/02/top-10-essential-wordpress-plugins-that-your-website-needs/)
449
- * [How to start your own blog using WordPress](http://blog.kualo.com/how-to-start-your-own-blog-using-wordpress/)
450
- * [Top 10 Must Have WordPress Plugins In Your Blog](http://www.learnblogtips.com/top-10-must-have-wordpress-plugins-in-your-blog/), Rahul Kuntala
451
- * [Improve WordPress Speed with W3 Total Cache](http://www.webcitz.org/wordpress-tips/improve-wordpress-speed-with-w3-total-cache.html)
452
- * [WordPress Plugins for 2012](http://proudlypowered.com/wordpress-plugins-2012/)
453
- * [How to Install Memcached and Use It with Your WordPress via W3 Total Cache on CentOS](http://www.bleuken.com/how-to-install-memcached-and-use-it-with-your-wordpress-via-w3-total-cache-on-centos-20120220/)
454
- * [How to reduce WordPress CPU usage using Cache and P3 plugin](http://wpmarketing.org/2012/02/how-to-reduce-wordpress-cpu-usage-using-cache-and-p3-plugin/)
455
- * [Speeding up your WordPress site with MaxCDN (Advanced users)](http://wpverse.com/2012/02/speeding-up-your-wordpress-site-with-maxcdn-advanced-users/), Noel Saw
456
- * [Cache WordPress With W3 Total Cache](http://wphostingreviews.com/plugins/cache-wordpress-with-w3-total-cache-1768/), David Blane
457
- * [Cache Plugin For Improving Wordpress Speed](http://www.youtube.com/watch?v=70TqVjmtXYU), Mark Washburn
458
- * [De snelheid van je website verbeteren](http://www.webtaurus.nl/amersfoort-webdesign/tag/w3-total-cache)
459
- * [WordPress Plugins that Power Digital Inspiration](http://www.labnol.org/software/must-have-wordpress-plugins/14034/)
460
- * [9 Essential WordPress Plugins To Install On Your Site](http://www.haikarela.com/9-wordpress-plugins-to-install/)
461
- * [Some Other Tricks For A Speedy WordPress](http://wp.tutsplus.com/tutorials/some-other-tricks-for-a-speedy-wordpress/), Ariff Shah
462
- * [5 Essential WordPress Plug-ins You Should Be Using](http://thinktraffic.net/5-essential-wordpress-plug-ins-you-should-be-using), Caleb Wojcik
463
- * [14 Free WordPress Plugins I Installed, Before Doing Anything Else](http://www.kidnapcustomers.com/how-to-make-a-website/wordpress-plugins-must-have/)
464
- * [Install Memcached to speed up your WordPress site](http://www.wpinsite.com/articles/install-memcached-speed-wordpress-site)
465
- * [Cara Membuat CDN dengan W3 Total Cache pada Subdomain](http://www.youtube.com/watch?v=XB1sry9ns4Y), Hadie Danker
466
- * [Top 10 WordPress Plugins To Improve a WordPress Blog](http://www.bloggingtips.com/2012/02/05/top-10-wordpress-plugins-to-improve-a-wordpress-blog/), Zac Johnson
467
- * [The 10 Best Plugins for Online Entreprenuers](http://www.webdesigndev.com/make-money-online/the-10-best-wordpress-plugins-for-online-entrepreneurs)
468
- * [Time to Smarten up Your WordPress Blog – 15 Must Have Plugins](http://www.multyshades.com/2012/02/time-to-smarten-up-your-wordpress-blog-15-must-have-plugins/), Muhammad Haroon
469
- * [Best WordPress SEO Plugins For Boost Your Traffic](http://www.redfoxmagazine.com/best-wordpress-seo-plugins-for-boost-your-traffic/)
470
- * [Speed Up WordPress Load Times and Grab More Visitors](http://www.matthewhooper.com/speed-up-wordpress/)Matthew Hooper
471
- * [Use a windows azure blob storage account with your wordpress blog](http://www.gep13.co.uk/blog/use-a-windows-azure-blob-storage-account-with-your-wordpress-blog/), Gary Ewan Park
472
- * [How To Find Out Which WordPress Plugins Are Making Your Site Slow](http://just-ask-kim.com/wordpress-plugins-site-slow/#.URBVYVpdec8)
473
- * [How to Install and Configure W3 Total Cache Plugin](http://www.youtube.com/watch?v=Lbs3pRL4XQg)
474
- * [Day 8: Speed Up your WordPress Site with W3 Total Cache](http://wplifeguard.com/day-8-speed-up-your-wordpress-site-with-w3-total-cache/)
475
- * [10 Ways to Improve WordPress Performance on Windows](http://jesscoburn.com/archives/2012/02/25/10-ways-to-improve-wordpress-performance-on-windows/), Jess Coburn
476
- * [W3 Total Cache - Accélérer votre site Wordpress](http://www.youtube.com/watch?v=Hx-_e8wTUEw)
477
- * [WordPress on Nginx, Part 1: Preparing VPS the Debian Way](http://www.linuxforu.com/2012/02/wordpress-nginx-part-1-preparing-vps-debian-linux/), Atanu Datta
478
- * [WordPress on Nginx, Part 2: vhost, MySQL & APC Configurations](http://www.linuxforu.com/2012/02/wordpress-nginx-part-2-domain-vhost-config-migrating-files-fine-tuning-mysql-apc/), Atanu Datta
479
-
480
- **January 2012:**
481
-
482
- * [Speed up WordPress with W3 Total Cache and Amazon CloudFront (CDN)](http://richwp.com/wordpress-cdn-total-cache-amazon-cloudfront/), Dustin
483
- * [The Ultimate Quickstart Guide to Speeding Up Your WordPress Site](http://wp.tutsplus.com/tutorials/the-ultimate-quickstart-guide-to-speeding-up-your-wordpress-site/), Matt Pilott
484
- * [Speed Up WordPress with W3 Total Cache](http://www.doitwithwp.com/speed-up-wordpress-with-w3-total-cache/), Dave Clements
485
- * [Speed Up your WordPress Site with W3 Total Cache](http://wplifeguard.com/day-8-speed-up-your-wordpress-site-with-w3-total-cache/)
486
- * [How to Speed Up Your WordPress Site and Reduce Your Hosting Costs](http://www.washingtonsblog.com/2012/01/how-to-speed-up-your-wordpress-site-and-reduce-your-hosting-costs.html)
487
- * [Why I Switched From Drupal to WordPress](http://eagereyes.org/blog/2012/why-i-switched-drupal-wordpress), Robert Kosara
488
- * [Top 10 Best WordPress Plugins](http://ebusinessmatters.com/top10-best-wordpress-plugins/), Brian Duffy
489
- * [WordPress Plug-ins](http://www.crazyxhtml.com/blog/wordpress-plug-ins/)
490
- * [Los mejores plugins para WordPress](http://zonawordpress.com/los-mejores-plugins-para-wordpress/)
491
- * [10 Essential Plugins for Your WordPress Blog](http://sproutsocial.com/insights/2012/01/wordpress-plugins/), Jennifer Beese
492
- * [10 Must-Have WordPress Plugins on Your Site](http://realityco.com/blog/?p=23&option=com_wordpress&Itemid=168)
493
- * [3 Must Have Free Smashing WordPress SEO Plugins For Your Blog](http://techtipsportal.com/wordpress-seo-plugins-for-blog/), Kushal Biswas
494
- * [Best WordPress SEO Plugins For 2012](http://www.iblogzone.com/2012/01/the-best-wordpress-seo-plugins-for-2012-part-1-html.html)
495
- * [5 Simple Tips for Making WordPress Run Faster](http://headway101.com/5-simple-tips-for-making-wordpress-run-faster/)
496
- * [Tips on speeding up your WordPress site](http://www.edwardxwu.com/2012/01/tips-on-speeding-up-your-wordpress-site/), Edward Xwu
497
- * [W3 Total Cache Kurulumu](http://kenancanol.com/2012/w3-total-cache-kurulumu/)
498
- * [Speed Up WordPress with W3 Total Cache](http://www.doitwithwp.com/speed-up-wordpress-with-w3-total-cache/), Dave Clements
499
- * [The Ultimate Quickstart Guide to Speeding Up Your WordPress Site](http://wp.tutsplus.com/tutorials/the-ultimate-quickstart-guide-to-speeding-up-your-wordpress-site/), Matt Pilott
500
- * [Speed up WordPress with W3 Total Cache and Amazon CloudFront (CDN)](http://richwp.com/wordpress-cdn-total-cache-amazon-cloudfront/)
501
- * [Configure/Install MaxCDN with W3 Total Cache WordPress Plugin](http://www.youtube.com/watch?v=OYqOG7_TIk8), Mrinmay Bhattacharjee
502
- * [How to Install and Configure W3 Total Cache Plugin](http://www.dailymotion.com/video/xnx1cl_how-to-install-and-configure-w3-total-cache-plugin_tech#.UQ_ujlpdec8)
503
- * [How to setup a CDN in WordPress using W3 Total Cache & Amazon CloudFront](http://pedrodasilva.co.uk/how-to-setup-content-delivery-network-wordpress-using-w3tc-amazon-cloudfront/), Pedro Da Silva
504
- * [WordPress plugin – W3 Total Cache](http://www.naschenweng.info/2012/01/16/wordpress-plugin-w3-total-cache/)
505
- * [Using YUI Compressor with the W3 Total Cache plugin](http://secure.delishost.com/knowledgebase/11/Using-YUI-Compressor-with-the-W3-Total-Cache-plugin.html)
506
- * [(mt):Install APC for use with W3 Total Cache](http://wiki.mediatemple.net/w/(mt):Install_APC_for_use_with_W3_Total_Cache)
507
- * [The Perfect APC Configuration](http://gregrickaby.com/2012/01/the-perfect-apc-configuration.html), Greg Rickaby
508
- * [CloudFlare – A Review](http://complete-concrete-concise.com/web-tools/cloudflare-a-review)
509
- * [W3 Total Cache Kurulumu ve Ayarları](http://bcakir.com/w3-total-cache-kurulumu-ve-ayarlari.html)
510
-
511
- **December 2011:**
512
-
513
- * [A shout-out to my tech partners of 2011!](http://www.jimcarroll.com/2011/12/a-shout-out-to-my-tech-partners-of-2011/), Jim Carroll
514
- * [15 Top WordPress Plugins Of 2011](http://smashinghub.com/15-top-wordpress-plugins-of-2011.htm), Ali Qayyum
515
- * [Google Speed Online API widget integration with W3 Total Cache in WordPress](http://shivasoft.in/blog/webtech/seo/google-speed-online-api-widget-integration-with-w3-total-cache-in-wordpress/), Jitendra Zaa
516
- * [Modern WordPress Development for 2012](http://sachagreif.com/modern-wordpress-development-in-2012/), Sacha Greif
517
- * [Set up W3 Total Cache with Amazon CloudFront CDN](http://www.doitwithwp.com/set-up-w3-total-cache-with-amazon-cloudfront-cdn/), Dave Clements
518
- * [Installing & Configuring XCache for W3 Total Cache on a cPanel Server](http://www.thewebhostinghero.com/tutorials/xcache-w3tc-on-a-cpanel-server.html)
519
- * [How-To Install W3 Total Cache: Part One -- What is Page Caching?](http://www.youtube.com/watch?v=HvQ5aVPdHX8), Dorie Scarlet
520
- * [Must Use: W3 Total Cache WordPress Plugin](http://www.dailyblogtips.com/must-use-w3-total-cache-wordpress-plugin/), Daniel Scocco
521
- * [10 Best WordPress Plugins](http://www.anhosting.com/blog/2011/12/10-best-wordpress-plugins/), AN Hosting
522
- * [How to Install & Configure W3 Total Cache Plugin](http://marketgurus.org/how-to-install-configure-w3-total-cache-plugin/)
523
- * [Website Speed Part 3 – Caching WordPress](http://speckyboy.com/2011/12/14/website-speed-part-3-caching-wordpress/), Andy Killen
524
- * [WP Super Cache 1.0 Released](http://www.wptavern.com/wp-super-cache-1-0-released), Jeffro
525
- * [5 Must Have WordPress Plugins](http://www.stormcode.net/marketing/5-must-have-wordpress-plugins/), Brendan
526
- * [12 Essential WordPress Plugins](https://docs.google.com/a/placester.com/viewer?a=v&q=cache:GGcWVwJTMOUJ:myathleticlife.com/wp-content/uploads/2011/12/12-Essential-Wordpress-Plugins.pdf+&hl=en&gl=us&pid=bl&srcid=ADGEEShOSbWoVFwJiNrmfGCe_rqA48eDO7pjwfdqzzK3CUJevx39BA9vdTm4OzMNSNLlyvBDgJoYIypFnVm3oHF6scJJJB2a-DCgZERkyI9ExrSpSMmI_1AqxmcMOf2FZY0Z6njFouX9&sig=AHIEtbQT-oErlhUCsEOh56YNJVlhLu1AxA)
527
- * [Measuring impact of plugins on WordPress loading](http://wpdojo.net/tag/woocommerce/page/7/), MillaN
528
- * [Recommended WordPress Plugins](http://www.cinntech.com/recommended-wordpress-plugins/)
529
- * [Recommended WordPress Plugins For Any Serious Blogger](http://getbusylivingblog.com/recommended-wordpress-plugins-for-any-serious-blogger/), Benny Hsu
530
- * [Top 10 WordPress Plugins for 2011](http://y2kemo.com/2011/12/top-10-wordpress-plugins-for-2011/)
531
- * [Measuring impact of plugins on WordPress loading](http://www.dev4press.com/2011/blog/benchmark/measuring-impact-of-plugins-on-wordpress-loading/)
532
-
533
- **November 2011:**
534
-
535
- * [10+ Best WordPress Plugins You must have to start a Blog/Website](http://www.wokay.com/technology/10-best-wordpress-plugins-to-use-in-2011-must-have-awesome-blog-website-start-56197.html), Barnabas Reilly
536
- * [5 Must Have WordPress Plugins](http://sayfsolutions.com/2011/5-must-have-wordpress-plugin/), Abdullah Hashim
537
- * [Plug 'em in: WordPress plugins I've completely fallen for…](http://bookbagsandcatnaps.com/2011/11/plug-em-in-wordpress-plugins-ive-completely-fallen-for/), Donna Brown
538
- * [8 WordPress Plugins you have to Install](http://www.123-reg.co.uk/blog/tips-tutorials/8-wordpress-plugins-you-have-to-install/), Alex Moss
539
- * [Installing and Configuring the W3 Total Cache Plugin on WordPress](http://help.godaddy.com/article/7299?isc=u&locale=en)
540
- * [Installing CSS Tidy For WordPress W3 Total Cache Plugin](http://hungred.com/how-to/installing-css-tidy-wordpress-w3-total-cache-plugin/), Clay Lua
541
-
542
- **October 2011:**
543
-
544
- * [10 WordPress Plugins Your Small Business Website Needs](http://searchenginewatch.com/article/2115338/10-WordPress-Plugins-Your-Small-Business-Website-Needs), October 7, 2011
545
-
546
- **September 2011:**
547
-
548
- * [Boost WordPress Blog Performance: Minify & CDN with W3TC](http://sangatpedas.com/20110901/boosting-increase-wordpress-performance-w3tc-minify-cdn/), Remco
549
- * [How to Reduce Bandwidth Usage and Optimize Website Performance with W3 Total Cache and Amazon CloudFront](http://helgeklein.com/blog/2011/09/how-to-reduce-bandwidth-usage-and-optimize-website-performance-with-w3-total-cache-and-amazon-cloudfront/), Helge Klein
550
- * [Speeding Up WordPress, Part 1: Basic W3 Total Cache Configuration and Content Delivery Network](http://www.mattstratton.com/tech-tips/speed-up-wordpress), Matt Stratton
551
- * [Boost WordPress Blog Performance: Minify & CDN with W3TC](http://sangatpedas.com/boosting-increase-wordpress-performance-w3tc-minify-cdn/)
552
- * [W3 TOTAL CACHE VS QUICK CACHE FOR WORDPRESS](http://thinkpaid.com/2011/09/reviews/w3-total-cache-vs-quick-cache), Andrew Summers
553
- * [10 Free WordPress Plugins you must have](http://www.webprocyon.com/2011/09/10-free-wordpress-plugins-you-must-have.html)
554
-
555
- **August 2011:**
556
-
557
- * [Matt Mullenweg: State of the Word 2011 (4:49)](http://wordpress.tv/2011/08/14/matt-mullenweg-state-of-the-word-2011/), Matt Mullenweg
558
- * [http://freenuts.com/increase-your-page-speed-to-a-new-level/](Increase Your Page Speed To A New Level)
559
- * [7 Plugins That Every WordPress Blog Must Have](http://coderbay.com/7-wordpress-plugins-that-every-wordpress-blog-must-have/), Karim Pattoki
560
- * [Speeding Up Your WordPress Site With W3 Total Cache](http://www.sohailtech.com/2011/08/10/speeding-wordpress-site-w3-total-cache/)
561
- * [W3 Total Cache Setup with CloudFlare and CDN : Complete Tutorial Guide](http://thecustomizewindows.com/2011/08/w3-total-cache-setup-with-cloudflare-and-cdn-complete-tutorial-guide/), Abhishek Ghosh
562
-
563
- **July 2011:**
564
-
565
- * [Speeding Up Your Blog - Part II: WordPress & Cloudflare Integration](http://www.thewebhostinghero.com/tutorials/wordpress-cloudflare.html)
566
- * [How Your Website Loses 7% of Potential Conversions](http://www.clickz.com/clickz/column/2097323/website-loses-potential-conversions), Bryan Eisenberg
567
- * [How to Integrate Google Page Speed with W3 Total Cache](http://geekscalling.com/google/how-to-integrate-google-page-speed-with-w3-total-cache), Anish
568
- * [22 WordPress Plugins for Content Marketers](http://www.business2community.com/content-marketing/22-wordpress-plugins-for-content-marketers-040787), Brody Dorland
569
-
570
- **June 2011:**
571
-
572
- * [5 Types of WordPress Plugins for Real Estate Sites](http://www.mytechopinion.com/2011/06/5-types-of-wordpress-plugins-for-your-real-estate-site.html), Nicole Nicolay
573
- * [WordPress Optimization Results: Varnish/Nginx/APC + W3 Total Cache + Amazon S3 + CloudFlare](http://danielmiessler.com/blog/wordpress-optimization-results-varnishnginxapc-w3-total-cache-amazon-s3-cloudflare), Daniel Miessler
574
- * [Case Study: WordPress, MaxCDN, CloudFlare and W3 Total Cache Integration](http://www.thewebhostinghero.com/articles/case-study-wp-maxcdn-cloudflare.html), Ritesh Sanap
575
-
576
- **May 2011:**
577
-
578
- * [HOW TO: Get Google Page Speed Report Via W3 Total Cache](http://hellboundbloggers.com/2011/05/10/get-google-page-speed-report-in-w3-total-cache/), S.Pradeep Kumar
579
- * [Optimizing WordPress with Nginx, Varnish, APC, W3 Total Cache, and Amazon S3 (With Benchmarks)](http://danielmiessler.com/blog/optimizing-wordpress-with-nginx-varnish-w3-total-cache-amazon-s3-and-memcached), Daniel Miessler
580
- * [Poll: Best Caching Plugin for WordPress?](http://digwp.com/2011/05/best-caching-plugin-wordpress/), Jeff Starr
581
- * [Page Speed Online has a shiny new API](http://googlecode.blogspot.com/2011/05/page-speed-online-has-shiny-new-api.html), Andrew Oates and Richard Rabbat
582
- * [Use W3 Total Cache to Speed Up Your WordPress Site](http://www.ostraining.com/blog/wordpress/w3-total-cache/), Steve Burge
583
-
584
- **April 2011:**
585
-
586
- * [Setting Up and Optimizing W3 Total Cache](http://tentblogger.com/w3-total-cache/), John Saddington
587
- * [How To Configure The Various W3TC Plugin Settings For Your WordPress Blog](http://www.makeuseof.com/tag/configure-w3tc-plugin-wordpress/), James Bruce
588
- * [Speeding Up Your WordPress Website: 11 Ways to Improve Your Load Time](http://wpmu.org/speeding-up-your-wordpress-website-11-ways-to-improve-your-load-time/), Siobhan Ambrose
589
- * [Recipe for Baked WordPress](http://carpeaqua.com/2011/04/05/recipe-for-baked-wordpress/), Justin Williams
590
- * [WordPress + W3 Total Cache + CDN story](http://translate.google.com/translate?hl=en&sl=auto&tl=en&u=http%3A%2F%2Fblog.gaspanik.com%2Factivate-cdn-option-on-w3totalcache), Mori Masako
591
- * [SETTING UP W3 TOTAL CACHE PART 2](http://www.geekforhim.com/setting-up-w3-total-cache-part-2/), Matthew Snider
592
- * [SETTING UP W3 TOTAL CACHE PART 1](http://www.geekforhim.com/setting-up-w3-total-cache-part-1/), Matthew Snider
593
-
594
- **March 2011:**
595
-
596
- * [WPML with W3TC for Fast and Efficient Multilingual Websites](http://wpml.org/2011/03/wpml-with-w3tc/), Amir
597
-
598
- **February 2011:**
599
-
600
- * [Optimizing WordPress with Nginx, Varnish, W3 Total Cache, Amazon S3, and Memcached (With Benchmarks)](http://danielmiessler.com/blog/optimizing-wordpress-with-nginx-varnish-w3-total-cache-amazon-s3-and-memcached), Daniel Miessler
601
- * [My WordPress site loads in 2 seconds... does yours?](http://labsecrets.com/blog/2011/02/14/my-wordpress-site-loads-in-two-seconds-does-yours/)
602
-
603
- **January 2011:**
604
-
605
- * [Caching a Dynamic Website. Does it Make a Difference for Loading Speed?](http://bacsoftwareconsulting.com/blog/index.php/web-programming/caching-a-dynamic-website-does-it-make-a-difference-for-loading-speed/)
606
- * [11 Important Steps to Optimize WordPress and Increase Performance](http://www.bernskiold.com/2011/01/10/11-important-steps-to-optimize-wordpress-and-increase-performance/), Erik Bernskiold
607
- * [Speed up WordPress with the W3 Total Cache Plugin](http://wplift.com/speed-up-wordpress-with-the-w3-total-cache-plugin), Oliver Dale
608
- * [How to Make Your Blog Load Faster than ProBlogger](http://www.problogger.net/archives/2011/01/04/how-to-make-your-blog-load-faster-than-problogger/), Pro Blogger
609
- * [WP Honors Winner, Free Plugin Category](http://wpcandy.com/reports/the-2010-wphonors-award-winners), WPCandy.com
610
-
611
- **December 2010:**
612
-
613
- * [Best blog plugins](http://www.blog.web6.org/best-blog-plugins/)
614
- * [How To Make Your WordPress Blog Load Faster](http://www.johnchow.com/how-to-make-your-wordpress-blog-load-faster/), John Chow
615
- * [Unleash the Power of WordPress Using Plugin Combos](http://freelancefolder.com/unleash-the-power-of-wordpress-using-plugin-combos/), Paul de Wouters
616
- * [Rackspace Cloud Files for WordPress](http://sporkmarketing.com/blog/1095/rackspace-cloud-files-wordpress/), Jason Lancaster
617
-
618
- **November 2010:**
619
-
620
- * [Make your blog super fast with W3 Total Cache plugin](http://laspas.gr/2010/11/26/make-blog-super-fast-w3-total-cache-plugin/), Stratos Laspas
621
- * [10 WordPress Plugins I'm Thankful For (And Cannot Live Without)](http://wpmu.org/10-wordpress-plugins-im-thankful-for-and-cannot-live-without/), Sarah Gooding
622
- * [Subjective Results of Installing W3 Total Cache Plugin](http://www.codyhatch.com/administriva/subjective-results-of-installing-w3-total-cache-plugin/), Cody Hatch
623
- * [13 Plugins Your WordPress Site Might Need](http://www.jonbishop.com/2010/11/13-plugins-your-wordpress-site-might-need/), Jon Bishop
624
- * [Best WordPress Plugins that Marketers Use](http://www.nicoleonthenet.com/6390/best-wordpress-plugins-marketers-use/), Nicole Dean
625
- * [WordPress Fat-Loss Diet to Speed Up & Ease Load](http://superbeachbody.com/12528/wordpress-fat-loss-diet-to-speed-up-ease-load/), Erhald Bergman
626
- * [10 WordPress Plugins I'm Thankful For (And Cannot Live Without)](http://wpmu.org/10-wordpress-plugins-im-thankful-for-and-cannot-live-without/), Sarah Gooding
627
- * [Subjective Results of Installing W3 Total Cache Plugin](http://www.codyhatch.com/administriva/subjective-results-of-installing-w3-total-cache-plugin/), Cody Hatch
628
- * [W3 Total Cache Plugin](http://www.xenritech.com/w3-total-cache-plugin.html/)
629
-
630
- **October 2010:**
631
-
632
- * [20 Wordpress Plugins for Successful Internet Marketers](http://www.incomediary.com/20-wordpress-plugins-for-successful-internet-marketers/), Michael Dunlop
633
- * [Failure Under Load](http://blog.hybridindie.com/2010/10/20/failure-load/), John Brien
634
- * [W3 Total Cache and site response time (as measured by Pingdom)](http://www.pauldavidolson.com/blog/2010/w3-total-cache-and-site-response-time-as-measured-by-pingdom/), Paul David Olson
635
- * [Overhauling WordPress Performance](http://brianegan.com/overhauling-wordpress-performance/), Brian Egan
636
- * [How to Make WordPress Run Faster](http://www.stevecoursen.com/498/how-to-make-wordpress-run-faster/), Stephen Coursen
637
- * [Give Your Wordpress Blog Lightning Fast Speeds With W3 Total Cache](http://www.makeuseof.com/tag/give-wordpress-blog-lightning-fast-speeds-w3-total-cache/), Steven Campbell
638
- * [W3 Total Cache and site response time (as measured by Pingdom)](http://www.pauldavidolson.com/blog/2010/w3-total-cache-and-site-response-time-as-measured-by-pingdom/), Paul David Olson
639
- * [11 Ways to Make Your WordPress Site Faster and Leaner](http://wpmu.org/11-ways-to-make-your-wordpress-site-faster-and-leaner/), Sarah Gooding
640
- * [The Top 10 of Your Top 5 Plugins](http://weblogtoolscollection.com/archives/2010/10/04/the-top-10-of-your-top-5-plugins/), James Huff
641
- * [Integrating memcached to wordpress](http://www.ruchirablog.com/intergrating-memcached-to-wordpress/), Ruchira Sahan
642
- * [Make WordPress Faster (on the Rackspace Cloud)](http://www.mattytemple.com/2010/10/make-wordpress-faster-on-the-rackspace-cloud/), Matt Temple
643
-
644
- **September 2010:**
645
-
646
- * [Review: W3 Total Cache [WordPress Plugin]](http://sokkz.com/2010/09/29/review-w3-total-cache-wordpress-plugin/)
647
- * [Plugins to Power-Up Your WordPress Installation](http://www.afiffattouh.com/web-design/plugins-to-power-up-your-wordpress-installation), Afif Fattouh
648
- * [Reduce Page Loading Time by 300% With W3 Total Cache](http://c3mdigital.com/2010/09/reduce-page-loading-time-w3-total-cache/), Chris Olbekson
649
- * [Performance Unleashed: How To Optimize Websites For Speed](http://diythemes.com/thesis/improve-website-pagespeed/), Willie Jackson
650
- * [5 Best WordPress Plugins To Improve The Loading Speed Of a Blog](http://www.gadgetcage.com/2010/09/5-best-wordpress-plugins-to-improve-the-loading-speed-of-a-blog.html/)
651
- * [WordPress Fat-Loss Diet to Speed Up & Ease Load](http://www.daljinskapodrska.com/wordpress-fat-loss-diet-to-speed-up-ease-load/)
652
-
653
- **August 2010:**
654
-
655
- * [WordPress Speed and Optimization Guide](http://thesocialmediaguide.com.au/2010/08/30/wordpress-speed-and-optimization-guide/), Matthew Tommasi
656
- * [How to configure WordPress Blogs Search Engine Friendly](http://solvater.com/2010/09/how-to-configure-wordpress-blog-search-engine-friendly-complete-beginners-guide-for-wordpress-seo/), Arafath Hashmi
657
- * [How to Install and Setup W3 Total Cache for Beginners](http://www.wpbeginner.com/plugins/how-to-install-and-setup-w3-total-cache-for-beginners/)
658
- * [20 Most Useful WordPress Plugins](http://zemalf.posterous.com/20-most-useful-wordpress-plugins), Antti Kokkonen
659
- * [Speed up, compress and optimise WordPress using W3 Total Cache](http://thisishelpful.com/speed-compress-optimise-wordpress-w3-total-cache.html)
660
- * [W3 Total Cache - Further optimization of the blog](http://www.bhoffmeier.de/2010/08/21/w3-total-cache-weitere-optimierung-des-blogs/), Bernd Hoffmeier
661
- * [W3 Total Cache Fixes Bugs, Adds Features with Update](http://www.whoishostingthis.com/blog/2010/08/04/first-draft-w3-total-cache-fixes-bugs-adds-features-with-update/), Jonathan
662
- * [The Quickest Way To Make Your Blog Load Faster](http://www.peterleehc.com/blog/work-from-home/the-quickest-way-to-make-your-blog-load-faster), Peter Lee
663
-
664
- **July 2010:**
665
-
666
- * [Getting W3 Total Cache and a mobile plugin to work in WordPress](http://blog.trasatti.it/2010/07/getting-w3-total-cache-and-a-mobile-plugin-to-work-in-wordpress.html), Andrea Trasatti
667
- * [Improve Your WordPress Performance With W3 Total Cache](http://maketecheasier.com/improve-wordpress-performance-with-w3-total-cache/2010/07/21), Damien Oh
668
- * [Four Simple Steps For Big Gains In Page Speed](http://www.dailyblogtips.com/four-simple-steps-for-big-gains-in-page-speed/), Greg Hayes
669
- * [How to use Content Delivery Network on Shared Hosting for WordPress](http://solvater.com/2010/07/content-delivery-network-shared-hosting-wordpress-configuration-with-w3-total-cache-in-wordpress/), Arafath Hashmi
670
- * [How to Use Google Webmaster Tools to Diagnose and Improve WordPress Page Speed](http://wpmu.org/how-to-use-google-webmaster-tools-to-diagnose-and-improve-wordpress-page-speed/), Sarah Gooding
671
- * [Caching Wordpress - Preparing Your Blog For The Mainstream](http://bradblogging.com/how-to/caching-wordpress-preparing-your-blog-for-the-mainstream/), Brad Ney
672
- * [11 Ways to Speed Up WordPress](http://mashable.com/2010/07/19/speed-up-wordpress/), Cyrus Patten
673
- * [How To Decrease Page Loading Time Of Your WordPress Blog By 75%](http://bloggingwithsuccess.net/decrease-loading-times), Ishan Sharma
674
- * [Top 10 Wordpress Plugins which I use on DailyBlogging](http://www.dailyblogging.org/wordpress/top-10-wordpress-plugins-which-i-use-on-dailyblogging/), Mani Viswanathan
675
- * [Install and Configure W3 Total Cache in 7 Easy Steps](http://zemalf.com/1443/w3-total-cache/), Antti Kokkonen
676
- * [How to Reduce the Loading Time of Your Blog](http://www.admixweb.com/2010/07/09/how-to-reduce-the-loading-time-of-your-blog/), Rishabh Agarwal
677
- * [5 Wordpress Plugins You Need To Know About](http://thenextweb.com/apps/2010/07/06/5-wordpress-plugins-you-need-to-know-about/), James Hicks
678
-
679
- **June 2010:**
680
-
681
- * [Speed Up Your Wedding Photography Website in less than 5 minutes](https://www.zippykid.com/2010/06/07/speed-up-your-wedding-photography-website/), Vid Luther
682
- * [12 Ways to Improve Wordpress Page Load Time](http://myblog2day.com/12-ways-to-improve-wordpress-page-load-time.php), Lee Ka Hoong
683
- * [Significantly Speed Up Your WordPress Blog in 9 Easy Steps](http://www.bloggingpro.com/archives/2010/06/21/significantly-speed-up-your-wordpress-blog-in-9-easy-steps/), Robyn-Dale Samuda
684
- * [Speed 'Em Up: Wordpress &amp; W3 Total Cache](http://translate.google.com/translate?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&u=http://www.andilicious.com/blog/1473/20100610/wordpress-beschleunigen-grundlagen-w3-total-cache-page-speed&sl=auto&tl=en), Andi Licious
685
-
686
- **May 2010:**
687
-
688
- * [Make Your Blog 10x Faster With W3 Total Cache Plug-in](http://www.strictlyonlinebiz.com/blog/speed-up-wordpress-with-w3-total-cache/1231/), Udegbunam Chukwudi
689
- * [xCache v1.3.0 Now Available](http://webcache.googleusercontent.com/search?q=cache%3Ahttp%3A%2F%2Fresellr.net%2Fxcache-now-available%2F&rls=com.microsoft:en-us&ie=UTF-8&oe=UTF-8&startIndex=&startPage=1&rlz=1I7GGIE_en&redir_esc=&ei=NO49TNaAFIH60wS2zuXLDg), Michael
690
- * [Maximize WordPress and BuddyPress Performance With W3 Total Cache](http://wpmu.org/maximize-wordpress-and-buddypress-performance-with-w3-total-cache/), Sarah Gooding
691
- * [Is Your Wordpress Blog Slow to Load?](http://homenotion.com/blog/blogs/is-your-wordpress-blog-slow-to-load/), Elizabeth McGee
692
-
693
- **April 2010:**
694
-
695
- * [WordPress Optimization: How I Reduced Page Load Time by 75%](http://www.kadavy.net/blog/posts/wordpress-optimization-dreamhost-rackspace/), David Kadavy
696
- * [Top 10 Wordpress Plugins Your Blog Should Have (Video)](http://www.blogsuccessjournal.com/blog-tips-and-advice/wordpress-tips-advice/top-10-wordpress-plugins-your-blog-should-have-video/), Dan &amp; Jennifer
697
- * [Super or Total? Money Talks But Cache Rules](http://website-in-a-weekend.net/website-maintenance/super-total-money-talks-cache-rules/), Dave Thackeray
698
- * [W3 Total Cache, the most comprehensive cache plugin in WordPress](http://blogandweb.com/wordpress/w3-total-cache-plugin-cache-wordpress/), Francisco Oliveros
699
- * [10 OF THE BEST WORDPRESS PLUGINS IN 2010](http://www.sitesketch101.com/best-wordpress-plugins), Nicholas Cardot
700
-
701
- **March 2010:**
702
-
703
- * [Howto: Speed up WordPress sites by using Amazon Cloudfront](http://www.jitscale.com/howto-speed-up-wordpress-sites-by-using-amazon-cloudfront/), Niek Waarbroek
704
- * [Wordpress Cache Plugin Benchmarks](http://cd34.com/blog/scalability/wordpress-cache-plugin-benchmarks/), Chris Davies
705
- * [Wordpress + W3 Total Cache + MaxCDN How-To](http://rackerhacker.com/2010/02/13/wordpress-w3-total-cache-maxcdn/), Major Hayden
706
-
707
- **February 2010:**
708
-
709
- * [Blog Building: How To Dramatically Speed Up Your WordPress Site with W3 Total Cache](http://nimopress.com/pressed/blog-building-how-to-dramatically-speed-up-your-wordpress-site-with-w3-total-cache/), Nicholas Ong
710
- * [Wordpress + W3 Total Cache + MaxCDN How-To](http://rackerhacker.com/2010/02/13/wordpress-w3-total-cache-maxcdn/), Major Hayden
711
- * [Utilizing W3 Total Cache](http://www.reviewkin.com/utilizing-w3-total-cache/), Anangga Pratama
712
- * [Shared Hosting vs. Cloud Hosting](http://gregrickaby.com/2010/02/shared-hosting-vs-cloud-hosting.html), Greg Rickaby
713
- * [My Thoughts on Premium Plugins](http://weblogtoolscollection.com/archives/2010/02/04/my-thoughts-on-premium-plugins/), Ronald Huereca
714
- * [W3 Total Cache Plugin for Wordpress Eats WP Super Cache's Lunch!](http://human3rror.com/w3-total-cache-plugin-for-wordpress-eats-wp-super-caches-lunch/), John Saddington
715
-
716
- **January 2010:**
717
-
718
- * [WordPress Cacheing with W3 Total Cache](http://blog.whoishostingthis.com/2010/01/19/wordpress-cacheing-w3-total-cache/), Jonathan
719
- * [Configuring W3 Total Cache for WordPress](http://translate.google.com/translate?js=y&prev=_t&hl=en&ie=UTF-8&layout=1&eotf=1&u=http://da.clausheinrich.com/w3-total-cache-wordpress/&sl=auto&tl=en)
720
- * [Wordpress load test part 2 - amendment](http://loadimpact.com/blog/wordpress-load-test-part-2-amendment), Erik Torsner
721
- * [Wordpress - Accelerate your site with W3 Total Cache](http://translate.google.com/translate?hl=en&sl=auto&tl=en&u=http://www.egonomik.com/2010/01/wordpress-w3-total-cache-ile-sitenizi-hizlandirin-sunucunuzu-rahatlatin/), Caner Phenix
722
-
723
- **December 2009:**
724
-
725
- * [WordPress Plugin &mdash; Best of 4 Caching Plugins](http://nimopress.com/pressed/wordpress-plugin-best-of-4-caching-plugins/), Nicholas Ong
726
- * [Speed Up Your Blog With W3 Total Cache &amp; Amazon](http://www.freedomtarget.com/w3-total-cache-with-amazon-s3-and-cloudfront), Kevin McKillop
727
- * [W3 Total Cache with Amazon S3 and CloudFront](http://kovshenin.com/archives/w3-total-cache-with-amazon-s3-and-cloudfront/), Konstantin Kovshenin
728
-
729
- **November 2009:**
730
-
731
- * [How to Boost Ad Revenue: Speed is Your Secret Weapon](http://blog.buysellads.com/2009/11/how-to-boost-ad-revenue-speed-is-your-secret-weapon/), Todd Garland
732
-
733
- **October 2009:**
734
-
735
- * [Plugin: WordPress Caching with CDN Integration](http://www.blogperfume.com/plugin-wordpress-caching-with-cdn-integration/)
736
- * [8 Powerful Wordpress Plugins You Probably Don't Use But Should](http://www.smashingapps.com/2009/10/19/8-powerful-wordpress-plugins-you-probably-dont-use-but-should.html), AN Jay
737
- * [Beyond Super Cache: W3 Total Cache](http://www.webmaster-source.com/2009/10/15/beyond-super-cache-w3-total-cache/), Matt Harzewski
738
-
739
- **September 2009:**
740
-
741
- * [Why Noupe.com is Loading So Much Faster?](http://209.85.129.132/search?q=cache:PgY8haU_0I4J:www.noupe.com/spotlight/why-noupe-com-is-loading-pretty-fast.html+http://www.noupe.com/spotlight/why-noupe-com-is-loading-pretty-fast.html&cd=1&hl=en&ct=clnk&gl=it), Noura Yehia
742
-
743
- **August 2009:**
744
-
745
- * [W3 Total Cache Plugin](http://dougal.gunters.org/blog/2009/08/26/w3-total-cache-plugin), Dougal Campbell
746
-
747
- **July 2009:**
748
-
749
- * [W3 Total Cache](http://weblogtoolscollection.com/pluginblog/2009/07/27/w3-total-cache/)
750
-
751
  == Who do I thank for all of this? ==
752
 
753
  It's quite difficult to recall all of the innovators that have shared their thoughts, code and experiences in the blogosphere over the years, but here are some names to get you started:
@@ -769,6 +283,23 @@ Please reach out to all of these people and support their projects if you're so
769
 
770
  == Changelog ==
771
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
772
  = 0.9.5.2 =
773
  * Fixed security issue by protecting configuration data by adding .php to relevant files
774
  * Fixed security issue with the creation of dot folders that could be abused
@@ -933,14 +464,17 @@ Please reach out to all of these people and support their projects if you're so
933
 
934
  == Upgrade Notice ==
935
 
 
 
 
936
  = 0.9.5.2 =
937
- Thanks for using W3 Total Cache! This release includes security fixes that have been reported. In addition, numerous improvements are now yours.
938
 
939
  = 0.9.5.1 =
940
- Thanks for using W3 Total Cache! This release includes security fixes that have been reported. In addition, numerous improvements are now yours.
941
 
942
  = 0.9.5 =
943
- Thanks for using W3 Total Cache! This release includes fixes for recent XSS security issues that have been reported. In addition, hundreds of other improvements are now yours.
944
 
945
  = 0.9.4 =
946
  Thanks for using W3 Total Cache! This release introduces hundreds of well-tested stability fixes since the last release as well as a new mode called "edge mode," which allows us to make releases more often containing new features that are still undergoing testing or active iteration.
1
  === Plugin Name ===
2
  Contributors: fredericktownes
3
+ Tags: seo, cache, caching, compression, maxcdn, nginx, varnish, redis, new relic, aws, amazon web services, s3, cloudfront, rackspace, cloudflare, azure, apache
4
  Requires at least: 3.2
5
  Tested up to: 4.7.1
6
+ Stable tag: 0.9.5.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
262
 
263
  * Read [testimonials](https://twitter.com/w3edge/favorites) from W3TC users.
264
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
265
  == Who do I thank for all of this? ==
266
 
267
  It's quite difficult to recall all of the innovators that have shared their thoughts, code and experiences in the blogosphere over the years, but here are some names to get you started:
283
 
284
  == Changelog ==
285
 
286
+ = 0.9.5.3 =
287
+ * Fixed handling of HTTP compressed documents in PHP v5.3 (via amiga-500)
288
+ * Fixed a bug with accelerated mobile pages (via nigrosimone)
289
+ * Improved reliability of minify in manual mode
290
+ * Improved JavaScript interoperability with CDATA use cases
291
+ * Improved file name generation on Windows for IIS servers
292
+ * Improved handling of # in URLs
293
+ * Improved handling of exclusions for e-commerce in Genesis Framework
294
+ * Improved handling of headers for Microsoft Azure
295
+ * Improved functionality with existing Cloudfront Distributions when configuring Full Site Delivery
296
+ * Improved minify debug logging
297
+ * Improved handling of URLs that omit the protocol
298
+ * Improved handling of custom files with CDN (via amiga-500)
299
+ * Updated CSSTidy library (via nigrosimone and amiga-500)
300
+ * Added Swarmify Video Optimization Extension [Hat tip the Swarmify Team]
301
+ * Added flushing of AMP pages
302
+
303
  = 0.9.5.2 =
304
  * Fixed security issue by protecting configuration data by adding .php to relevant files
305
  * Fixed security issue with the creation of dot folders that could be abused
464
 
465
  == Upgrade Notice ==
466
 
467
+ = 0.9.5.3 =
468
+ Thanks for using W3 Total Cache! This release includes compatibility fixes that have been reported. In addition, numerous other improvements are now yours!
469
+
470
  = 0.9.5.2 =
471
+ Thanks for using W3 Total Cache! This release includes security fixes that have been reported. In addition, numerous other improvements are now yours!
472
 
473
  = 0.9.5.1 =
474
+ Thanks for using W3 Total Cache! This release includes security fixes that have been reported. In addition, numerous other improvements are now yours!
475
 
476
  = 0.9.5 =
477
+ Thanks for using W3 Total Cache! This release includes fixes for recent XSS security issues that have been reported. In addition, hundreds of other improvements are now yours!
478
 
479
  = 0.9.4 =
480
  Thanks for using W3 Total Cache! This release introduces hundreds of well-tested stability fixes since the last release as well as a new mode called "edge mode," which allows us to make releases more often containing new features that are still undergoing testing or active iteration.
w3-total-cache-api.php CHANGED
@@ -5,7 +5,7 @@ if ( !defined( 'ABSPATH' ) ) {
5
  }
6
 
7
  define( 'W3TC', true );
8
- define( 'W3TC_VERSION', '0.9.5.2' );
9
  define( 'W3TC_POWERED_BY', 'W3 Total Cache' );
10
  define( 'W3TC_EMAIL', 'w3tc@w3-edge.com' );
11
  define( 'W3TC_TEXT_DOMAIN', 'w3-total-cache' );
5
  }
6
 
7
  define( 'W3TC', true );
8
+ define( 'W3TC_VERSION', '0.9.5.3' );
9
  define( 'W3TC_POWERED_BY', 'W3 Total Cache' );
10
  define( 'W3TC_EMAIL', 'w3tc@w3-edge.com' );
11
  define( 'W3TC_TEXT_DOMAIN', 'w3-total-cache' );
w3-total-cache-old-php.php CHANGED
File without changes
w3-total-cache.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: W3 Total Cache
4
  Description: 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.
5
- Version: 0.9.5.2
6
  Plugin URI: https://www.w3-edge.com/wordpress-plugins/w3-total-cache/
7
  Author: Frederick Townes
8
  Author URI: http://www.linkedin.com/in/fredericktownes
2
  /*
3
  Plugin Name: W3 Total Cache
4
  Description: 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.
5
+ Version: 0.9.5.3
6
  Plugin URI: https://www.w3-edge.com/wordpress-plugins/w3-total-cache/
7
  Author: Frederick Townes
8
  Author URI: http://www.linkedin.com/in/fredericktownes
wp-content/advanced-cache.php CHANGED
File without changes
wp-content/db.php CHANGED
File without changes
wp-content/index.html CHANGED
File without changes
wp-content/object-cache.php CHANGED
File without changes