LiteSpeed Cache - Version 1.5

Version Description

  • October 17 2017 =
  • [NEW FEATURE] Exclude JQuery (to fix inline JS error when using JS Combine).
  • [NEW FEATURE] Load JQuery Remotely.
  • [NEW FEATURE] JS Deferred Excludes.
  • [NEW FEATURE] Lazy Load Images Excludes.
  • [NEW FEATURE] Lazy Load Image Placeholder.
  • [IMPROVEMENT] Improved Lazy Load size attribute for w3c validator.
  • [UPDATE] Added basic caching info and LSCWP version to HTML comment.
  • [UPDATE] Added debug log to HTML detection.
  • [BUGFIX] Fixed potential font CORS issue when using CDN.
  • [GUI] Added API docs to setting description.
  • [REFACTOR] Relocated all classes under includes with backwards compatibility.
  • [REFACTOR] Relocated admin templates.
Download this release

Release Info

Developer LiteSpeedTech
Plugin Icon 128x128 LiteSpeed Cache
Version 1.5
Comparing to
See all releases

Code changes from version 1.4 to 1.5

Files changed (360) hide show
  1. admin/admin-api.class.php +201 -0
  2. admin/class-litespeed-cache-admin.php +0 -0
  3. admin/litespeed-cache-admin-display.class.php +45 -19
  4. admin/litespeed-cache-admin-error.class.php +0 -0
  5. admin/litespeed-cache-admin-optimize.class.php +0 -0
  6. admin/litespeed-cache-admin-report.class.php +0 -0
  7. admin/litespeed-cache-admin-rules.class.php +28 -0
  8. admin/litespeed-cache-admin-settings.class.php +21 -0
  9. admin/litespeed-cache-admin.class.php +0 -0
  10. admin/tpl/crawler.php +0 -0
  11. admin/tpl/debug_log.php +0 -0
  12. admin/tpl/edit_htaccess.php +2 -2
  13. admin/tpl/esi_widget_edit.php +0 -0
  14. admin/tpl/{admin_footer.php → inc/admin_footer.php} +0 -0
  15. admin/tpl/{banner_promo.php → inc/banner_promo.php} +0 -0
  16. admin/tpl/inc/check_cache_disabled.php +12 -0
  17. admin/tpl/{help_tabs.php → inc/help_tabs.php} +0 -0
  18. admin/tpl/{show_display_installed.php → inc/show_display_installed.php} +0 -0
  19. admin/tpl/{show_error_cookie.php → inc/show_error_cookie.php} +0 -0
  20. admin/tpl/{show_rule_conflict.php → inc/show_rule_conflict.php} +0 -0
  21. admin/tpl/info.php +1 -1
  22. admin/tpl/{info_admin_ip.php → info/info_admin_ip.php} +0 -0
  23. admin/tpl/{info_common_rewrite.php → info/info_common_rewrite.php} +0 -0
  24. admin/tpl/{info_compatibility.php → info/info_compatibility.php} +0 -0
  25. admin/tpl/{info_config.php → info/info_config.php} +0 -0
  26. admin/tpl/{info_crawler.php → info/info_crawler.php} +0 -0
  27. admin/tpl/{info_faqs.php → info/info_faqs.php} +0 -0
  28. admin/tpl/manage.php +3 -7
  29. admin/tpl/{manage_db.php → manage/manage_db.php} +0 -0
  30. admin/tpl/{manage_purge.php → manage/manage_purge.php} +0 -0
  31. admin/tpl/network_settings.php +2 -2
  32. admin/tpl/report.php +0 -0
  33. admin/tpl/{network_settings_cache.php → setting/network_settings_cache.php} +4 -4
  34. admin/tpl/{network_settings_excludes.php → setting/network_settings_excludes.php} +2 -2
  35. admin/tpl/{network_settings_general.php → setting/network_settings_general.php} +0 -0
  36. admin/tpl/{network_settings_purge.php → setting/network_settings_purge.php} +1 -1
  37. admin/tpl/{settings_advanced.php → setting/settings_advanced.php} +0 -0
  38. admin/tpl/{settings_cache.php → setting/settings_cache.php} +4 -4
  39. admin/tpl/{settings_cdn.php → setting/settings_cdn.php} +31 -3
  40. admin/tpl/{settings_compatibilities.php → setting/settings_compatibilities.php} +0 -0
  41. admin/tpl/{settings_crawler.php → setting/settings_crawler.php} +0 -0
  42. admin/tpl/{settings_debug.php → setting/settings_debug.php} +0 -0
  43. admin/tpl/{settings_esi.php → setting/settings_esi.php} +0 -0
  44. admin/tpl/{settings_excludes.php → setting/settings_excludes.php} +2 -2
  45. admin/tpl/{settings_general.php → setting/settings_general.php} +0 -0
  46. admin/tpl/{settings_inc.cache_browser.php → setting/settings_inc.cache_browser.php} +3 -3
  47. admin/tpl/{settings_inc.cache_favicon.php → setting/settings_inc.cache_favicon.php} +2 -2
  48. admin/tpl/{settings_inc.cache_mobile.php → setting/settings_inc.cache_mobile.php} +3 -4
  49. admin/tpl/{settings_inc.cache_resources.php → setting/settings_inc.cache_resources.php} +2 -2
  50. admin/tpl/{settings_inc.exclude_cookies.php → setting/settings_inc.exclude_cookies.php} +2 -2
  51. admin/tpl/{settings_inc.exclude_useragent.php → setting/settings_inc.exclude_useragent.php} +2 -2
  52. admin/tpl/{settings_inc.purge_on_upgrade.php → setting/settings_inc.purge_on_upgrade.php} +0 -0
  53. admin/tpl/setting/settings_media.php +62 -0
  54. admin/tpl/{settings_optimize.php → setting/settings_optimize.php} +46 -1
  55. admin/tpl/{settings_purge.php → setting/settings_purge.php} +1 -1
  56. admin/tpl/settings.php +2 -2
  57. admin/tpl/settings_media.php +0 -32
  58. cli/litespeed-cache-cli-admin.class.php +2 -0
  59. cli/litespeed-cache-cli-purge.class.php +0 -0
  60. css/litespeed.css +5 -0
  61. img/Litespeed.icon.svg +0 -0
  62. img/icons/purge-cssjs.svg +0 -0
  63. img/lscwp-logo_256x256.png +0 -0
  64. inc/activation.class.php +236 -0
  65. inc/api.class.php +5 -4
  66. inc/cdn.class.php +451 -0
  67. inc/config.class.php +851 -0
  68. inc/control.class.php +611 -0
  69. inc/crawler-sitemap.class.php +5 -4
  70. inc/crawler.class.php +451 -0
  71. inc/data.class.php +5 -4
  72. inc/esi.class.php +554 -0
  73. inc/gui.class.php +196 -0
  74. inc/litespeed-cache.class.php +632 -0
  75. inc/litespeed.autoload.php +78 -0
  76. inc/log.class.php +322 -0
  77. inc/media.class.php +28 -7
  78. inc/optimize.class.php +1112 -0
  79. inc/purge.class.php +754 -0
  80. inc/router.class.php +452 -0
  81. inc/tag.class.php +368 -0
  82. inc/task.class.php +129 -0
  83. inc/utility.class.php +279 -0
  84. inc/vary.class.php +466 -0
  85. includes/advanced-cache.php +0 -0
  86. includes/deprecated-litespeed-cache-tags.class.php +0 -0
  87. includes/litespeed-cache-activation.class.php +5 -4
  88. includes/litespeed-cache-api.class.php +450 -0
  89. includes/litespeed-cache-cdn.class.php +42 -4
  90. includes/litespeed-cache-config.class.php +14 -4
  91. includes/litespeed-cache-control.class.php +5 -4
  92. includes/litespeed-cache-crawler.class.php +5 -4
  93. includes/litespeed-cache-esi.class.php +5 -4
  94. includes/litespeed-cache-gui.class.php +5 -4
  95. includes/litespeed-cache-log.class.php +5 -4
  96. includes/litespeed-cache-optimize.class.php +129 -19
  97. includes/litespeed-cache-purge.class.php +5 -4
  98. includes/litespeed-cache-router.class.php +24 -5
  99. includes/litespeed-cache-tag.class.php +5 -4
  100. includes/litespeed-cache-task.class.php +5 -4
  101. includes/litespeed-cache-utility.class.php +5 -4
  102. includes/litespeed-cache-vary.class.php +5 -4
  103. includes/litespeed-cache.class.php +36 -22
  104. includes/litespeed.autoload.php +22 -20
  105. js/css_async.js +0 -0
  106. js/{lazyload.js → lazyload.init.js} +0 -0
  107. js/lazyload.lib.js +261 -0
  108. js/lazyload.min.js +1 -1
  109. languages/litespeed-cache.pot +928 -792
  110. lib/litespeed-php-compatibility.func.php +0 -0
  111. lib/litespeed/litespeed-crawler.class.php +0 -0
  112. lib/litespeed/litespeed-file.class.php +0 -0
  113. lib/litespeed/litespeed-string.class.php +0 -0
  114. lib/vendor/autoload.php +0 -0
  115. lib/vendor/composer/ClassLoader.php +0 -0
  116. lib/vendor/composer/LICENSE +0 -0
  117. lib/vendor/composer/autoload_classmap.php +0 -0
  118. lib/vendor/composer/autoload_namespaces.php +0 -0
  119. lib/vendor/composer/autoload_psr4.php +0 -0
  120. lib/vendor/composer/autoload_real.php +0 -0
  121. lib/vendor/composer/autoload_static.php +0 -0
  122. lib/vendor/container-interop/container-interop/LICENSE +0 -0
  123. lib/vendor/container-interop/container-interop/src/Interop/Container/ContainerInterface.php +0 -0
  124. lib/vendor/container-interop/container-interop/src/Interop/Container/Exception/ContainerException.php +0 -0
  125. lib/vendor/container-interop/container-interop/src/Interop/Container/Exception/NotFoundException.php +0 -0
  126. lib/vendor/intervention/httpauth/src/Intervention/Httpauth/HttpauthServiceProviderLaravel4.php +0 -0
  127. lib/vendor/intervention/httpauth/src/Intervention/Httpauth/HttpauthServiceProviderLaravel5.php +0 -0
  128. lib/vendor/monolog/monolog/.php_cs +0 -0
  129. lib/vendor/monolog/monolog/LICENSE +0 -0
  130. lib/vendor/monolog/monolog/src/Monolog/ErrorHandler.php +0 -0
  131. lib/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php +0 -0
  132. lib/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php +0 -0
  133. lib/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php +0 -0
  134. lib/vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php +0 -0
  135. lib/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php +0 -0
  136. lib/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php +0 -0
  137. lib/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php +0 -0
  138. lib/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php +0 -0
  139. lib/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php +0 -0
  140. lib/vendor/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php +0 -0
  141. lib/vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php +0 -0
  142. lib/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php +0 -0
  143. lib/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php +0 -0
  144. lib/vendor/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php +0 -0
  145. lib/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php +0 -0
  146. lib/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php +0 -0
  147. lib/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php +0 -0
  148. lib/vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php +0 -0
  149. lib/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php +0 -0
  150. lib/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php +0 -0
  151. lib/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php +0 -0
  152. lib/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php +0 -0
  153. lib/vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php +0 -0
  154. lib/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php +0 -0
  155. lib/vendor/monolog/monolog/src/Monolog/Handler/Curl/Util.php +0 -0
  156. lib/vendor/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php +0 -0
  157. lib/vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php +0 -0
  158. lib/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php +0 -0
  159. lib/vendor/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php +0 -0
  160. lib/vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php +0 -0
  161. lib/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php +0 -0
  162. lib/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php +0 -0
  163. lib/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php +0 -0
  164. lib/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php +0 -0
  165. lib/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php +0 -0
  166. lib/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php +0 -0
  167. lib/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php +0 -0
  168. lib/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php +0 -0
  169. lib/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php +0 -0
  170. lib/vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php +0 -0
  171. lib/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php +0 -0
  172. lib/vendor/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php +0 -0
  173. lib/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php +0 -0
  174. lib/vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php +0 -0
  175. lib/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php +0 -0
  176. lib/vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php +0 -0
  177. lib/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php +0 -0
  178. lib/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php +0 -0
  179. lib/vendor/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php +0 -0
  180. lib/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php +0 -0
  181. lib/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php +0 -0
  182. lib/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php +0 -0
  183. lib/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php +0 -0
  184. lib/vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php +0 -0
  185. lib/vendor/monolog/monolog/src/Monolog/Handler/PsrHandler.php +0 -0
  186. lib/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php +0 -0
  187. lib/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php +0 -0
  188. lib/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php +0 -0
  189. lib/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php +0 -0
  190. lib/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php +0 -0
  191. lib/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php +0 -0
  192. lib/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php +0 -0
  193. lib/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php +0 -0
  194. lib/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php +0 -0
  195. lib/vendor/monolog/monolog/src/Monolog/Handler/SlackbotHandler.php +0 -0
  196. lib/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php +0 -0
  197. lib/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php +0 -0
  198. lib/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php +0 -0
  199. lib/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php +0 -0
  200. lib/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php +0 -0
  201. lib/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php +0 -0
  202. lib/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php +0 -0
  203. lib/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php +0 -0
  204. lib/vendor/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php +0 -0
  205. lib/vendor/monolog/monolog/src/Monolog/Logger.php +0 -0
  206. lib/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php +0 -0
  207. lib/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php +0 -0
  208. lib/vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php +0 -0
  209. lib/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php +0 -0
  210. lib/vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php +0 -0
  211. lib/vendor/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php +0 -0
  212. lib/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php +0 -0
  213. lib/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php +0 -0
  214. lib/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php +0 -0
  215. lib/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php +0 -0
  216. lib/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php +0 -0
  217. lib/vendor/monolog/monolog/src/Monolog/Registry.php +0 -0
  218. lib/vendor/mrclay/jsmin-php/.editorconfig +0 -0
  219. lib/vendor/mrclay/jsmin-php/HISTORY.txt +0 -0
  220. lib/vendor/mrclay/jsmin-php/LICENSE.txt +0 -0
  221. lib/vendor/mrclay/jsmin-php/src/JSMin/JSMin.php +0 -0
  222. lib/vendor/mrclay/jsmin-php/src/JSMin/UnterminatedCommentException.php +0 -0
  223. lib/vendor/mrclay/jsmin-php/src/JSMin/UnterminatedRegExpException.php +0 -0
  224. lib/vendor/mrclay/jsmin-php/src/JSMin/UnterminatedStringException.php +0 -0
  225. lib/vendor/mrclay/minify/.htaccess +0 -0
  226. lib/vendor/mrclay/minify/.php_cs +0 -0
  227. lib/vendor/mrclay/minify/.travis.yml +0 -0
  228. lib/vendor/mrclay/minify/LICENSE.txt +0 -0
  229. lib/vendor/mrclay/minify/bootstrap.php +0 -0
  230. lib/vendor/mrclay/minify/config-test.php +0 -0
  231. lib/vendor/mrclay/minify/config.php +0 -0
  232. lib/vendor/mrclay/minify/groupsConfig.php +0 -0
  233. lib/vendor/mrclay/minify/lib/HTTP/ConditionalGet.php +0 -0
  234. lib/vendor/mrclay/minify/lib/HTTP/Encoder.php +0 -0
  235. lib/vendor/mrclay/minify/lib/Minify.php +0 -0
  236. lib/vendor/mrclay/minify/lib/Minify/App.php +0 -0
  237. lib/vendor/mrclay/minify/lib/Minify/Build.php +0 -0
  238. lib/vendor/mrclay/minify/lib/Minify/CSS.php +0 -0
  239. lib/vendor/mrclay/minify/lib/Minify/CSS/Compressor.php +0 -0
  240. lib/vendor/mrclay/minify/lib/Minify/CSS/UriRewriter.php +0 -0
  241. lib/vendor/mrclay/minify/lib/Minify/CSSmin.php +0 -0
  242. lib/vendor/mrclay/minify/lib/Minify/Cache/APC.php +0 -0
  243. lib/vendor/mrclay/minify/lib/Minify/Cache/File.php +0 -0
  244. lib/vendor/mrclay/minify/lib/Minify/Cache/Memcache.php +0 -0
  245. lib/vendor/mrclay/minify/lib/Minify/Cache/Null.php +0 -0
  246. lib/vendor/mrclay/minify/lib/Minify/Cache/WinCache.php +0 -0
  247. lib/vendor/mrclay/minify/lib/Minify/Cache/XCache.php +0 -0
  248. lib/vendor/mrclay/minify/lib/Minify/Cache/ZendPlatform.php +0 -0
  249. lib/vendor/mrclay/minify/lib/Minify/CacheInterface.php +0 -0
  250. lib/vendor/mrclay/minify/lib/Minify/ClosureCompiler.php +0 -0
  251. lib/vendor/mrclay/minify/lib/Minify/CommentPreserver.php +0 -0
  252. lib/vendor/mrclay/minify/lib/Minify/Config.php +0 -0
  253. lib/vendor/mrclay/minify/lib/Minify/Controller/Base.php +0 -0
  254. lib/vendor/mrclay/minify/lib/Minify/Controller/Files.php +0 -0
  255. lib/vendor/mrclay/minify/lib/Minify/Controller/Groups.php +0 -0
  256. lib/vendor/mrclay/minify/lib/Minify/Controller/MinApp.php +0 -0
  257. lib/vendor/mrclay/minify/lib/Minify/Controller/Page.php +0 -0
  258. lib/vendor/mrclay/minify/lib/Minify/ControllerInterface.php +0 -0
  259. lib/vendor/mrclay/minify/lib/Minify/DebugDetector.php +0 -0
  260. lib/vendor/mrclay/minify/lib/Minify/Env.php +0 -0
  261. lib/vendor/mrclay/minify/lib/Minify/HTML.php +0 -0
  262. lib/vendor/mrclay/minify/lib/Minify/HTML/Helper.php +0 -0
  263. lib/vendor/mrclay/minify/lib/Minify/ImportProcessor.php +0 -0
  264. lib/vendor/mrclay/minify/lib/Minify/JS/ClosureCompiler.php +0 -0
  265. lib/vendor/mrclay/minify/lib/Minify/JS/JShrink.php +0 -0
  266. lib/vendor/mrclay/minify/lib/Minify/LessCssSource.php +0 -0
  267. lib/vendor/mrclay/minify/lib/Minify/Lines.php +0 -0
  268. lib/vendor/mrclay/minify/lib/Minify/Logger/LegacyHandler.php +0 -0
  269. lib/vendor/mrclay/minify/lib/Minify/NailgunClosureCompiler.php +0 -0
  270. lib/vendor/mrclay/minify/lib/Minify/Packer.php +0 -0
  271. lib/vendor/mrclay/minify/lib/Minify/ScssCssSource.php +0 -0
  272. lib/vendor/mrclay/minify/lib/Minify/ServeConfiguration.php +0 -0
  273. lib/vendor/mrclay/minify/lib/Minify/Source.php +0 -0
  274. lib/vendor/mrclay/minify/lib/Minify/Source/Factory.php +0 -0
  275. lib/vendor/mrclay/minify/lib/Minify/Source/FactoryException.php +0 -0
  276. lib/vendor/mrclay/minify/lib/Minify/SourceInterface.php +0 -0
  277. lib/vendor/mrclay/minify/lib/Minify/SourceSet.php +0 -0
  278. lib/vendor/mrclay/minify/lib/Minify/YUICompressor.php +0 -0
  279. lib/vendor/mrclay/minify/lib/MrClay/Cli.php +0 -0
  280. lib/vendor/mrclay/minify/lib/MrClay/Cli/Arg.php +0 -0
  281. lib/vendor/mrclay/minify/static/.htaccess +0 -0
  282. lib/vendor/mrclay/minify/static/gen.php +0 -0
  283. lib/vendor/mrclay/minify/static/lib.php +0 -0
  284. lib/vendor/mrclay/minify/utils.php +0 -0
  285. lib/vendor/mrclay/props-dic/.travis.yml +0 -0
  286. lib/vendor/mrclay/props-dic/LICENSE +0 -0
  287. lib/vendor/mrclay/props-dic/src/Props/BadMethodCallException.php +0 -0
  288. lib/vendor/mrclay/props-dic/src/Props/Container.php +0 -0
  289. lib/vendor/mrclay/props-dic/src/Props/FactoryUncallableException.php +0 -0
  290. lib/vendor/mrclay/props-dic/src/Props/NotFoundException.php +0 -0
  291. lib/vendor/mrclay/props-dic/src/Props/Pimple.php +0 -0
  292. lib/vendor/mrclay/props-dic/src/Props/ValueUnresolvableException.php +0 -0
  293. lib/vendor/pimple/pimple/.travis.yml +0 -0
  294. lib/vendor/pimple/pimple/LICENSE +0 -0
  295. lib/vendor/pimple/pimple/ext/pimple/config.m4 +0 -0
  296. lib/vendor/pimple/pimple/ext/pimple/config.w32 +0 -0
  297. lib/vendor/pimple/pimple/ext/pimple/php_pimple.h +0 -0
  298. lib/vendor/pimple/pimple/ext/pimple/pimple.c +0 -0
  299. lib/vendor/pimple/pimple/ext/pimple/pimple_compat.h +0 -0
  300. lib/vendor/pimple/pimple/src/Pimple/Container.php +0 -0
  301. lib/vendor/pimple/pimple/src/Pimple/Exception/ExpectedInvokableException.php +0 -0
  302. lib/vendor/pimple/pimple/src/Pimple/Exception/FrozenServiceException.php +0 -0
  303. lib/vendor/pimple/pimple/src/Pimple/Exception/InvalidServiceIdentifierException.php +0 -0
  304. lib/vendor/pimple/pimple/src/Pimple/Exception/UnknownIdentifierException.php +0 -0
  305. lib/vendor/pimple/pimple/src/Pimple/Psr11/Container.php +0 -0
  306. lib/vendor/pimple/pimple/src/Pimple/Psr11/ServiceLocator.php +0 -0
  307. lib/vendor/pimple/pimple/src/Pimple/ServiceIterator.php +0 -0
  308. lib/vendor/pimple/pimple/src/Pimple/ServiceProviderInterface.php +0 -0
  309. lib/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/Invokable.php +0 -0
  310. lib/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/NonInvokable.php +0 -0
  311. lib/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/PimpleServiceProvider.php +0 -0
  312. lib/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/Service.php +0 -0
  313. lib/vendor/pimple/pimple/src/Pimple/Tests/PimpleServiceProviderInterfaceTest.php +0 -0
  314. lib/vendor/pimple/pimple/src/Pimple/Tests/PimpleTest.php +0 -0
  315. lib/vendor/pimple/pimple/src/Pimple/Tests/Psr11/ContainerTest.php +0 -0
  316. lib/vendor/pimple/pimple/src/Pimple/Tests/Psr11/ServiceLocatorTest.php +0 -0
  317. lib/vendor/pimple/pimple/src/Pimple/Tests/ServiceIteratorTest.php +0 -0
  318. lib/vendor/psr/container/LICENSE +0 -0
  319. lib/vendor/psr/container/src/ContainerExceptionInterface.php +0 -0
  320. lib/vendor/psr/container/src/ContainerInterface.php +0 -0
  321. lib/vendor/psr/container/src/NotFoundExceptionInterface.php +0 -0
  322. lib/vendor/psr/log/LICENSE +0 -0
  323. lib/vendor/psr/log/Psr/Log/AbstractLogger.php +0 -0
  324. lib/vendor/psr/log/Psr/Log/InvalidArgumentException.php +0 -0
  325. lib/vendor/psr/log/Psr/Log/LogLevel.php +0 -0
  326. lib/vendor/psr/log/Psr/Log/LoggerAwareInterface.php +0 -0
  327. lib/vendor/psr/log/Psr/Log/LoggerAwareTrait.php +0 -0
  328. lib/vendor/psr/log/Psr/Log/LoggerInterface.php +0 -0
  329. lib/vendor/psr/log/Psr/Log/LoggerTrait.php +0 -0
  330. lib/vendor/psr/log/Psr/Log/NullLogger.php +0 -0
  331. lib/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php +0 -0
  332. lib/vendor/tubalmartin/cssmin/gui/scripts.js +0 -0
  333. lib/vendor/tubalmartin/cssmin/gui/styles.css +0 -0
  334. lib/vendor/tubalmartin/cssmin/gui/third-party/bootstrap/css/bootstrap.min.css +0 -0
  335. lib/vendor/tubalmartin/cssmin/gui/third-party/bootstrap/js/bootstrap.min.js +0 -0
  336. lib/vendor/tubalmartin/cssmin/gui/third-party/jquery-1.12.4.min.js +0 -0
  337. lib/vendor/tubalmartin/cssmin/src/Colors.php +0 -0
  338. lib/vendor/tubalmartin/cssmin/src/Command.php +0 -0
  339. lib/vendor/tubalmartin/cssmin/src/Minifier.php +0 -0
  340. lib/vendor/tubalmartin/cssmin/src/Utils.php +0 -0
  341. litespeed-cache.php +2 -2
  342. readme.txt +26 -12
  343. thirdparty/lscwp-3rd-aelia-currencyswitcher.cls.php +0 -0
  344. thirdparty/lscwp-3rd-autoptimize.cls.php +0 -0
  345. thirdparty/lscwp-3rd-avada.cls.php +0 -0
  346. thirdparty/lscwp-3rd-bbpress.cls.php +0 -0
  347. thirdparty/lscwp-3rd-betterwp-minify.cls.php +0 -0
  348. thirdparty/lscwp-3rd-like-dislike-counter.cls.php +0 -0
  349. thirdparty/lscwp-3rd-nextgengallery.cls.php +0 -0
  350. thirdparty/lscwp-3rd-theme-my-login.cls.php +0 -0
  351. thirdparty/lscwp-3rd-woocommerce.cls.php +0 -0
  352. thirdparty/lscwp-3rd-wp-polls.cls.php +0 -0
  353. thirdparty/lscwp-3rd-wp-postratings.cls.php +0 -0
  354. thirdparty/lscwp-3rd-wpforo.cls.php +0 -0
  355. thirdparty/lscwp-3rd-wplister.cls.php +0 -0
  356. thirdparty/lscwp-3rd-wptouch.cls.php +0 -0
  357. thirdparty/lscwp-3rd-yith-wishlist.cls.php +0 -0
  358. thirdparty/lscwp-registry-3rd.php +0 -0
  359. tpl/dummy.tpl.php +0 -0
  360. tpl/esi.tpl.php +0 -0
admin/admin-api.class.php ADDED
@@ -0,0 +1,201 @@
1
+ <?php
2
+ /**
3
+ * Admin API
4
+ *
5
+ * @since 1.5
6
+ * @package LiteSpeed_Cache
7
+ * @subpackage LiteSpeed_Cache/admin
8
+ * @author LiteSpeed Technologies <info@litespeedtech.com>
9
+ */
10
+ class LiteSpeed_Cache_Admin_API
11
+ {
12
+ private static $_instance ;
13
+
14
+ private $_sapi_key ;
15
+
16
+ const DB_SAPI_KEY = 'litespeed_sapi_key' ;
17
+ const DB_SAPI_SERVER = 'litespeed_sapi_server' ;
18
+ const DB_SAPI_KEY_HASH = 'litespeed_sapi_key_hash' ;
19
+
20
+ const ACTION_REQUEST_KEY = 'request_key' ;
21
+ const ACTION_REQUEST_KEY_CALLBACK = 'request_key_callback' ;
22
+
23
+ const SAPI_ACTION_REQUEST_KEY = 'request_key' ;
24
+
25
+ /**
26
+ * Init
27
+ *
28
+ * @since 1.5
29
+ * @access private
30
+ */
31
+ private function __construct()
32
+ {
33
+ $this->_sapi_key = get_option( self::DB_SAPI_KEY ) ;
34
+ }
35
+
36
+
37
+ /**
38
+ * Handle callback requests from LiteSpeed server
39
+ *
40
+ * @since 1.5
41
+ * @access public
42
+ */
43
+ public static function sapi_callback()
44
+ {
45
+ if ( empty( $_GET[ 'type' ] ) ) {
46
+ LiteSpeed_Cache_Log::debug( 'SAPI callback no type ' ) ;
47
+ return ;
48
+ }
49
+ LiteSpeed_Cache_Log::debug( 'SAPI callback type: ' . $_GET[ 'type' ] ) ;
50
+
51
+ $instance = self::get_instance() ;
52
+
53
+ switch ( $_GET[ 'type' ] ) {
54
+ case self::ACTION_REQUEST_KEY_CALLBACK :
55
+ $instance->_request_key_callback() ;
56
+ break ;
57
+
58
+ default:
59
+ break ;
60
+ }
61
+
62
+
63
+ }
64
+
65
+ /**
66
+ * Handle local request
67
+ *
68
+ * @since 1.5
69
+ * @access public
70
+ * @return string The msg shown in admin page
71
+ */
72
+ public static function sapi_proceed()
73
+ {
74
+ if ( empty( $_GET[ 'type' ] ) ) {
75
+ return ;
76
+ }
77
+
78
+ LiteSpeed_Cache_Log::debug( 'SAPI proceed type: ' . $_GET[ 'type' ] ) ;
79
+
80
+ $instance = self::get_instance() ;
81
+
82
+ switch ( $_GET[ 'type' ] ) {
83
+ case self::ACTION_REQUEST_KEY :
84
+ return $instance->_request_key() ;
85
+ break ;
86
+
87
+ default:
88
+ break ;
89
+ }
90
+
91
+ }
92
+
93
+ /**
94
+ * request key callback from LiteSpeed
95
+ *
96
+ * @since 1.5
97
+ * @access private
98
+ */
99
+ private function _request_key_callback()
100
+ {
101
+ $key_hash = get_transient( self::DB_SAPI_KEY_HASH ) ;
102
+ LiteSpeed_Cache_Log::debug( 'SAPI callback request key hash: ' . $key_hash ) ;
103
+ exit( $key_hash ) ;
104
+ }
105
+
106
+ /**
107
+ * request key from LiteSpeed
108
+ *
109
+ * @since 1.5
110
+ * @access private
111
+ */
112
+ private function _request_key()
113
+ {
114
+ $hash = Litespeed_String::rrand( 16 ) ;
115
+ // store hash
116
+ set_transient( self::DB_SAPI_KEY_HASH, $hash, 300 ) ;
117
+
118
+ // send the request
119
+ $url = 'https://wp.api.litespeedtech.com/' . self::SAPI_ACTION_REQUEST_KEY ;
120
+ $param = array(
121
+ 'hash' => $hash,
122
+ 'callback' => home_url(),
123
+ ) ;
124
+ $response = wp_remote_post( $url, array( 'body' => $param ) ) ;
125
+
126
+ if ( is_wp_error( $response ) ) {
127
+ $error_message = $response->get_error_message() ;
128
+ LiteSpeed_Cache_Log::debug( 'SAPI failed to send request' ) ;
129
+ return ;
130
+ }
131
+
132
+ // parse data from server
133
+ set_error_handler( 'litespeed_exception_handler' ) ;
134
+ try {
135
+ $json = json_decode( $response[ 'body' ], true ) ;
136
+ }
137
+ catch ( ErrorException $e ) {
138
+ LiteSpeed_Cache_Log::debug( 'SAPI failed to decode json: ' . $response[ 'body' ] ) ;
139
+ return ;
140
+ }
141
+ restore_error_handler() ;
142
+
143
+ if ( empty( $json[ 'auth_key' ] ) || empty( $json[ 'distribute_server' ] ) ) {
144
+ LiteSpeed_Cache_Log::debug( 'SAPI failed to get key and server: ' . $response[ 'body' ] ) ;
145
+ return ;
146
+ }
147
+
148
+ // store data into option locally
149
+ update_option( self::DB_SAPI_KEY, $json[ 'auth_key' ] ) ;
150
+ update_option( self::DB_SAPI_SERVER, $json[ 'distribute_server' ] ) ;
151
+ LiteSpeed_Cache_Log::debug( 'SAPI distribute server: ' . $json[ 'distribute_server' ] ) ;
152
+
153
+ return __( 'Generate the key from server successfully', 'litespeed-cache' ) ;
154
+ }
155
+
156
+ /**
157
+ * Check if the get token is correct with server api key
158
+ *
159
+ * @since 1.5
160
+ * @access public
161
+ * @return bool True if correct
162
+ */
163
+ public static function sapi_token_check()
164
+ {
165
+ if ( empty( $_GET[ 'token' ] ) ) {
166
+ LiteSpeed_Cache_Log::debug( 'SAPI bypassed token check' ) ;
167
+ return false ;
168
+ }
169
+ $instance = self::get_instance() ;
170
+
171
+ // don't have auth_key yet
172
+ if ( ! $instance->_sapi_key ) {
173
+ // use tmp hash to check
174
+ $key_hash = get_transient( self::DB_SAPI_KEY_HASH ) ;
175
+ $res = md5( $key_hash ) === $_GET[ 'token' ] ;
176
+
177
+ LiteSpeed_Cache_Log::debug( 'SAPI token init check ' . $key_hash . ': ' . ( $res ? 'passed' : 'failed' ) ) ;
178
+ return $res ;
179
+ }
180
+
181
+ $res = md5( $instance->_sapi_key ) === $_GET[ 'token' ] ;
182
+ LiteSpeed_Cache_Log::debug( 'SAPI token check: ' . ( $res ? 'passed' : 'failed' ) ) ;
183
+ return $res ;
184
+ }
185
+
186
+ /**
187
+ * Get the current instance object.
188
+ *
189
+ * @since 1.5
190
+ * @access public
191
+ * @return Current class instance.
192
+ */
193
+ public static function get_instance()
194
+ {
195
+ if ( ! isset( self::$_instance ) ) {
196
+ self::$_instance = new self() ;
197
+ }
198
+
199
+ return self::$_instance ;
200
+ }
201
+ }
admin/class-litespeed-cache-admin.php CHANGED
File without changes
admin/litespeed-cache-admin-display.class.php CHANGED
@@ -146,14 +146,16 @@ class LiteSpeed_Cache_Admin_Display
146
}
147
148
$this->add_submenu(__('Information', 'litespeed-cache'), 'lscache-info', 'show_info') ;
149
- if ( ! is_multisite() || is_network_admin() ) {
150
- $this->add_submenu(__('Environment Report', 'litespeed-cache'), 'lscache-report', 'show_report') ;
151
- }
152
153
if ( ! is_network_admin() ) {
154
$this->add_submenu(__('Crawler', 'litespeed-cache'), 'lscache-crawler', 'show_crawler') ;
155
}
156
157
if ( LiteSpeed_Cache_Log::get_enabled() ) {
158
$this->add_submenu(__('Debug Log', 'litespeed-cache'), 'lscache-debug', 'show_debug_log') ;
159
}
@@ -307,7 +309,7 @@ class LiteSpeed_Cache_Admin_Display
307
*/
308
public function admin_footer_text($footer_text)
309
{
310
- require_once LSWCP_DIR . 'admin/tpl/admin_footer.php' ;
311
312
return $footer_text ;
313
}
@@ -355,7 +357,7 @@ class LiteSpeed_Cache_Admin_Display
355
*/
356
public function add_help_tabs()
357
{
358
- require_once LSWCP_DIR . 'admin/tpl/help_tabs.php' ;
359
}
360
361
/**
@@ -578,6 +580,17 @@ class LiteSpeed_Cache_Admin_Display
578
require_once LSWCP_DIR . 'admin/tpl/crawler.php' ;
579
}
580
581
/**
582
* Outputs the debug log.
583
*
@@ -605,17 +618,6 @@ class LiteSpeed_Cache_Admin_Display
605
require_once LSWCP_DIR . 'admin/tpl/info.php' ;
606
}
607
608
- /**
609
- * Outputs a notice to the admin panel when ExpiresDefault is detected
610
- *
611
- * @since 1.1.5
612
- * @access public
613
- */
614
- public function show_rule_conflict()
615
- {
616
- require_once LSWCP_DIR . 'admin/tpl/show_rule_conflict.php' ;
617
- }
618
-
619
/**
620
* Outputs a notice to the admin panel when the plugin is installed
621
* via the WHM plugin.
@@ -625,7 +627,7 @@ class LiteSpeed_Cache_Admin_Display
625
*/
626
public function show_display_installed()
627
{
628
- require_once LSWCP_DIR . 'admin/tpl/show_display_installed.php' ;
629
}
630
631
/**
@@ -636,7 +638,7 @@ class LiteSpeed_Cache_Admin_Display
636
*/
637
public static function show_error_cookie()
638
{
639
- require_once LSWCP_DIR . 'admin/tpl/show_error_cookie.php' ;
640
}
641
642
/**
@@ -649,7 +651,7 @@ class LiteSpeed_Cache_Admin_Display
649
* @param boolean $disabled If this input is disabled or not
650
* @param int $cols The width of textarea
651
*/
652
- public function build_textarea($id, $val = null, $disabled = false, $cols = false)
653
{
654
if ( $val === null ) {
655
global $_options ;
@@ -664,6 +666,30 @@ class LiteSpeed_Cache_Admin_Display
664
echo "<textarea name='" . LiteSpeed_Cache_Config::OPTION_NAME . "[$id]' rows='5' cols='$cols' $disabled>" . esc_textarea($val) . "</textarea>" ;
665
}
666
667
/**
668
* Build a text input field
669
*
146
}
147
148
$this->add_submenu(__('Information', 'litespeed-cache'), 'lscache-info', 'show_info') ;
149
150
if ( ! is_network_admin() ) {
151
+ // $this->add_submenu(__('Image Optimization', 'litespeed-cache'), 'lscache-optimization', 'show_optimization') ;
152
$this->add_submenu(__('Crawler', 'litespeed-cache'), 'lscache-crawler', 'show_crawler') ;
153
}
154
155
+ if ( ! is_multisite() || is_network_admin() ) {
156
+ $this->add_submenu(__('Environment Report', 'litespeed-cache'), 'lscache-report', 'show_report') ;
157
+ }
158
+
159
if ( LiteSpeed_Cache_Log::get_enabled() ) {
160
$this->add_submenu(__('Debug Log', 'litespeed-cache'), 'lscache-debug', 'show_debug_log') ;
161
}
309
*/
310
public function admin_footer_text($footer_text)
311
{
312
+ require_once LSWCP_DIR . 'admin/tpl/inc/admin_footer.php' ;
313
314
return $footer_text ;
315
}
357
*/
358
public function add_help_tabs()
359
{
360
+ require_once LSWCP_DIR . 'admin/tpl/inc/help_tabs.php' ;
361
}
362
363
/**
580
require_once LSWCP_DIR . 'admin/tpl/crawler.php' ;
581
}
582
583
+ /**
584
+ * Outputs the optimization operation page.
585
+ *
586
+ * @since 1.6
587
+ * @access public
588
+ */
589
+ public function show_optimization()
590
+ {
591
+ require_once LSWCP_DIR . 'admin/tpl/image_optimization.php' ;
592
+ }
593
+
594
/**
595
* Outputs the debug log.
596
*
618
require_once LSWCP_DIR . 'admin/tpl/info.php' ;
619
}
620
621
/**
622
* Outputs a notice to the admin panel when the plugin is installed
623
* via the WHM plugin.
627
*/
628
public function show_display_installed()
629
{
630
+ require_once LSWCP_DIR . 'admin/tpl/inc/show_display_installed.php' ;
631
}
632
633
/**
638
*/
639
public static function show_error_cookie()
640
{
641
+ require_once LSWCP_DIR . 'admin/tpl/inc/show_error_cookie.php' ;
642
}
643
644
/**
651
* @param boolean $disabled If this input is disabled or not
652
* @param int $cols The width of textarea
653
*/
654
+ public function build_textarea( $id, $val = null, $disabled = false, $cols = false )
655
{
656
if ( $val === null ) {
657
global $_options ;
666
echo "<textarea name='" . LiteSpeed_Cache_Config::OPTION_NAME . "[$id]' rows='5' cols='$cols' $disabled>" . esc_textarea($val) . "</textarea>" ;
667
}
668
669
+ /**
670
+ * Build a textarea based on separate stored option data
671
+ *
672
+ * @since 1.5
673
+ * @access public
674
+ * @param string $id
675
+ * @param string $val Value of input
676
+ * @param boolean $disabled If this input is disabled or not
677
+ * @param int $cols The width of textarea
678
+ */
679
+ public function build_textarea2( $id, $val = null, $disabled = false, $cols = false, $default_val = null )
680
+ {
681
+ if ( $val === null ) {
682
+ $val = get_option( $id, $default_val ) ;
683
+ }
684
+ $disabled = $disabled ? ' disabled ' : '' ;
685
+
686
+ if ( $cols === false ) {
687
+ $cols = 80 ;
688
+ }
689
+
690
+ echo "<textarea name='" . LiteSpeed_Cache_Config::OPTION_NAME . "[$id]' rows='5' cols='$cols' $disabled>" . esc_textarea( $val ) . "</textarea>" ;
691
+ }
692
+
693
/**
694
* Build a text input field
695
*
admin/litespeed-cache-admin-error.class.php CHANGED
File without changes
admin/litespeed-cache-admin-optimize.class.php CHANGED
File without changes
admin/litespeed-cache-admin-report.class.php CHANGED
File without changes
admin/litespeed-cache-admin-rules.class.php CHANGED
@@ -42,6 +42,7 @@ class LiteSpeed_Cache_Admin_Rules
42
const MARKER_FAVICON = '### marker FAVICON' ;
43
const MARKER_BROWSER_CACHE = '### marker BROWSER CACHE' ;
44
const MARKER_MINIFY = '### marker MINIFY' ;
45
const MARKER_START = ' start ###' ;
46
const MARKER_END = ' end ###' ;
47
@@ -513,6 +514,24 @@ class LiteSpeed_Cache_Admin_Rules
513
return $rules ;
514
}
515
516
/**
517
* Generate rewrite rules based on settings
518
*
@@ -612,6 +631,15 @@ class LiteSpeed_Cache_Admin_Rules
612
$new_rules[] = '' ;
613
}
614
615
return array( $new_rules, $new_rules_backend ) ;
616
617
}
42
const MARKER_FAVICON = '### marker FAVICON' ;
43
const MARKER_BROWSER_CACHE = '### marker BROWSER CACHE' ;
44
const MARKER_MINIFY = '### marker MINIFY' ;
45
+ const MARKER_CORS = '### marker CORS' ;
46
const MARKER_START = ' start ###' ;
47
const MARKER_END = ' end ###' ;
48
514
return $rules ;
515
}
516
517
+ /**
518
+ * Generate CORS rules for fonts
519
+ *
520
+ * @since 1.5
521
+ * @access private
522
+ * @return array Rules set
523
+ */
524
+ private function _cors_rules()
525
+ {
526
+ return array(
527
+ '<FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font\.css)quot;>',
528
+ '<IfModule mod_headers.c>',
529
+ 'Header set Access-Control-Allow-Origin "*"',
530
+ '</IfModule>',
531
+ '</FilesMatch>',
532
+ ) ;
533
+ }
534
+
535
/**
536
* Generate rewrite rules based on settings
537
*
631
$new_rules[] = '' ;
632
}
633
634
+ // CORS font rules
635
+ $id = LiteSpeed_Cache_Config::OPID_CDN ;
636
+ if ( ! empty( $cfg[ $id ] ) ) {
637
+ $new_rules[] = self::MARKER_CORS . self::MARKER_START ;
638
+ $new_rules = array_merge( $new_rules, $this->_cors_rules() ) ;
639
+ $new_rules[] = self::MARKER_CORS . self::MARKER_END ;
640
+ $new_rules[] = '' ;
641
+ }
642
+
643
return array( $new_rules, $new_rules_backend ) ;
644
645
}
admin/litespeed-cache-admin-settings.class.php CHANGED
@@ -460,6 +460,14 @@ class LiteSpeed_Cache_Admin_Settings
460
foreach ( $ids as $id ) {
461
$this->_options[ $id ] = LiteSpeed_Cache_Utility::sanitize_lines( $this->_input[ $id ] ) ;
462
}
463
}
464
465
/**
@@ -477,6 +485,14 @@ class LiteSpeed_Cache_Admin_Settings
477
foreach ( $ids as $id ) {
478
$this->_options[ $id ] = self::parse_onoff( $this->_input, $id ) ;
479
}
480
}
481
482
/**
@@ -500,6 +516,7 @@ class LiteSpeed_Cache_Admin_Settings
500
LiteSpeed_Cache_Config::OPID_OPTM_CSS_ASYNC,
501
LiteSpeed_Cache_Config::OPID_OPTM_JS_DEFER,
502
LiteSpeed_Cache_Config::OPID_OPTM_EMOJI_RM,
503
) ;
504
foreach ( $ids as $id ) {
505
$this->_options[ $id ] = self::parse_onoff( $this->_input, $id ) ;
@@ -528,6 +545,10 @@ class LiteSpeed_Cache_Admin_Settings
528
$this->_options[ $id ] = LiteSpeed_Cache_Utility::sanitize_lines( $this->_input[ $id ], 'relative' ) ;
529
}
530
531
}
532
533
/**
460
foreach ( $ids as $id ) {
461
$this->_options[ $id ] = LiteSpeed_Cache_Utility::sanitize_lines( $this->_input[ $id ] ) ;
462
}
463
+
464
+ /**
465
+ * Load jQuery from cdn
466
+ * @since 1.5
467
+ */
468
+ $id = LiteSpeed_Cache_Config::OPID_CDN_REMOTE_JQUERY ;
469
+ $this->_options[ $id ] = self::is_checked_radio( $this->_input[ $id ] ) ;
470
+
471
}
472
473
/**
485
foreach ( $ids as $id ) {
486
$this->_options[ $id ] = self::parse_onoff( $this->_input, $id ) ;
487
}
488
+
489
+ $id = LiteSpeed_Cache_Config::OPID_MEDIA_IMG_LAZY_PLACEHOLDER ;
490
+ $this->_options[ $id ] = $this->_input[ $id ] ;
491
+
492
+ // Update lazyload image excludes
493
+ $id = LiteSpeed_Cache_Config::ITEM_MEDIA_LAZY_IMG_EXC ;
494
+ update_option( $id, LiteSpeed_Cache_Utility::sanitize_lines( $this->_input[ $id ], 'uri' ) ) ;
495
+
496
}
497
498
/**
516
LiteSpeed_Cache_Config::OPID_OPTM_CSS_ASYNC,
517
LiteSpeed_Cache_Config::OPID_OPTM_JS_DEFER,
518
LiteSpeed_Cache_Config::OPID_OPTM_EMOJI_RM,
519
+ LiteSpeed_Cache_Config::OPID_OPTM_EXC_JQUERY,
520
) ;
521
foreach ( $ids as $id ) {
522
$this->_options[ $id ] = self::parse_onoff( $this->_input, $id ) ;
545
$this->_options[ $id ] = LiteSpeed_Cache_Utility::sanitize_lines( $this->_input[ $id ], 'relative' ) ;
546
}
547
548
+ // Update js deferred excludes
549
+ $id = LiteSpeed_Cache_Config::ITEM_OPTM_JS_DEFER_EXC ;
550
+ update_option( $id, LiteSpeed_Cache_Utility::sanitize_lines( $this->_input[ $id ], 'uri' ) ) ;
551
+
552
}
553
554
/**
admin/litespeed-cache-admin.class.php CHANGED
File without changes
admin/tpl/crawler.php CHANGED
File without changes
admin/tpl/debug_log.php CHANGED
File without changes
admin/tpl/edit_htaccess.php CHANGED
@@ -14,7 +14,7 @@ if ( defined( 'LITESPEED_ON' ) ) {
14
if ( $is_dismissed !== self::RULECONFLICT_ON ) {
15
update_option( self::DISMISS_MSG, self::RULECONFLICT_ON ) ;
16
}
17
- $this->show_rule_conflict() ;
18
}
19
}
20
// don't dismiss the msg automatically
@@ -68,7 +68,7 @@ if ( defined( 'LITESPEED_ON' ) ) {
68
<button type="submit" class="litespeed-btn-primary"><?php echo __('Save', 'litespeed-cache'); ?></button>
69
</form>
70
71
- <?php require LSWCP_DIR . 'admin/tpl/info_common_rewrite.php'; ?>
72
73
<?php endif; ?>
74
</div>
14
if ( $is_dismissed !== self::RULECONFLICT_ON ) {
15
update_option( self::DISMISS_MSG, self::RULECONFLICT_ON ) ;
16
}
17
+ require_once LSWCP_DIR . 'admin/tpl/inc/show_rule_conflict.php' ;
18
}
19
}
20
// don't dismiss the msg automatically
68
<button type="submit" class="litespeed-btn-primary"><?php echo __('Save', 'litespeed-cache'); ?></button>
69
</form>
70
71
+ <?php require LSWCP_DIR . 'admin/tpl/info/info_common_rewrite.php'; ?>
72
73
<?php endif; ?>
74
</div>
admin/tpl/esi_widget_edit.php CHANGED
File without changes
admin/tpl/{admin_footer.php → inc/admin_footer.php} RENAMED
File without changes
admin/tpl/{banner_promo.php → inc/banner_promo.php} RENAMED
File without changes
admin/tpl/inc/check_cache_disabled.php ADDED
@@ -0,0 +1,12 @@
1
+ <?php
2
+ if ( ! defined( 'WPINC' ) ) die ;
3
+
4
+ if ( defined( 'LITESPEED_ON' ) ) {
5
+ return ;
6
+ }
7
+ ?>
8
+
9
+ <div class="litespeed-callout-warning">
10
+ <h4><?php echo __('WARNING: LiteSpeed cache is disabled. The functionalities here can not work.', 'litespeed-cache'); ?></h4>
11
+ </div>
12
+
admin/tpl/{help_tabs.php → inc/help_tabs.php} RENAMED
File without changes
admin/tpl/{show_display_installed.php → inc/show_display_installed.php} RENAMED
File without changes
admin/tpl/{show_error_cookie.php → inc/show_error_cookie.php} RENAMED
File without changes
admin/tpl/{show_rule_conflict.php → inc/show_rule_conflict.php} RENAMED
File without changes
admin/tpl/info.php CHANGED
@@ -33,7 +33,7 @@ $menuArr = array(
33
// include all tpl for faster UE
34
foreach ($menuArr as $tab => $val) {
35
echo "<div data-litespeed-layout='$tab'>";
36
- require LSWCP_DIR . "admin/tpl/info_$tab.php";
37
echo "</div>";
38
}
39
33
// include all tpl for faster UE
34
foreach ($menuArr as $tab => $val) {
35
echo "<div data-litespeed-layout='$tab'>";
36
+ require LSWCP_DIR . "admin/tpl/info/info_$tab.php";
37
echo "</div>";
38
}
39
admin/tpl/{info_admin_ip.php → info/info_admin_ip.php} RENAMED
File without changes
admin/tpl/{info_common_rewrite.php → info/info_common_rewrite.php} RENAMED
File without changes
admin/tpl/{info_compatibility.php → info/info_compatibility.php} RENAMED
File without changes
admin/tpl/{info_config.php → info/info_config.php} RENAMED
File without changes
admin/tpl/{info_crawler.php → info/info_crawler.php} RENAMED
File without changes
admin/tpl/{info_faqs.php → info/info_faqs.php} RENAMED
File without changes
admin/tpl/manage.php CHANGED
@@ -8,7 +8,7 @@ $menu_list = array(
8
'db' => __('DB Optimizer', 'litespeed-cache'),
9
) ;
10
11
- include_once LSWCP_DIR . "admin/tpl/banner_promo.php" ;
12
?>
13
14
<div class="wrap">
@@ -38,11 +38,7 @@ include_once LSWCP_DIR . "admin/tpl/banner_promo.php" ;
38
?>
39
</h2>
40
41
- <?php if ( ! defined( 'LITESPEED_ON' ) ) : ?>
42
- <div class="litespeed-callout-warning">
43
- <h4><?php echo __('WARNING: LiteSpeed cache is disabled. The functionalities here can not work.', 'litespeed-cache'); ?></h4>
44
- </div>
45
- <?php endif ; ?>
46
47
<div class="litespeed-body">
48
<?php
@@ -50,7 +46,7 @@ include_once LSWCP_DIR . "admin/tpl/banner_promo.php" ;
50
// include all tpl for faster UE
51
foreach ($menu_list as $tab => $val) {
52
echo "<div data-litespeed-layout='$tab'>" ;
53
- require LSWCP_DIR . "admin/tpl/manage_$tab.php" ;
54
echo "</div>" ;
55
}
56
8
'db' => __('DB Optimizer', 'litespeed-cache'),
9
) ;
10
11
+ include_once LSWCP_DIR . "admin/tpl/inc/banner_promo.php" ;
12
?>
13
14
<div class="wrap">
38
?>
39
</h2>
40
41
+ <?php include_once LSWCP_DIR . "admin/tpl/inc/check_cache_disabled.php" ; ?>
42
43
<div class="litespeed-body">
44
<?php
46
// include all tpl for faster UE
47
foreach ($menu_list as $tab => $val) {
48
echo "<div data-litespeed-layout='$tab'>" ;
49
+ require LSWCP_DIR . "admin/tpl/manage/manage_$tab.php" ;
50
echo "</div>" ;
51
}
52
admin/tpl/{manage_db.php → manage/manage_db.php} RENAMED
File without changes
admin/tpl/{manage_purge.php → manage/manage_purge.php} RENAMED
File without changes
admin/tpl/network_settings.php CHANGED
@@ -42,9 +42,9 @@ $_options = LiteSpeed_Cache_Config::get_instance()->get_site_options();
42
foreach ($menuArr as $tab => $val) {
43
echo "<div data-litespeed-layout='$tab'>";
44
if($tab == 'advanced') {
45
- require LSWCP_DIR . 'admin/tpl/settings_advanced.php';
46
}else{
47
- require LSWCP_DIR . "admin/tpl/network_settings_$tab.php";
48
}
49
echo "</div>";
50
}
42
foreach ($menuArr as $tab => $val) {
43
echo "<div data-litespeed-layout='$tab'>";
44
if($tab == 'advanced') {
45
+ require LSWCP_DIR . 'admin/tpl/setting/settings_advanced.php';
46
}else{
47
+ require LSWCP_DIR . "admin/tpl/setting/network_settings_$tab.php";
48
}
49
echo "</div>";
50
}
admin/tpl/report.php CHANGED
File without changes
admin/tpl/{network_settings_cache.php → setting/network_settings_cache.php} RENAMED
@@ -10,10 +10,10 @@ if ( ! defined( 'WPINC' ) ) die ;
10
11
<table><tbody>
12
13
- <?php require LSWCP_DIR . 'admin/tpl/settings_inc.cache_favicon.php' ; ?>
14
- <?php require LSWCP_DIR . 'admin/tpl/settings_inc.cache_resources.php' ; ?>
15
- <?php require LSWCP_DIR . 'admin/tpl/settings_inc.cache_mobile.php' ; ?>
16
- <?php require LSWCP_DIR . 'admin/tpl/settings_inc.cache_browser.php' ; ?>
17
18
</tbody></table>
19
10
11
<table><tbody>
12
13
+ <?php require LSWCP_DIR . 'admin/tpl/setting/settings_inc.cache_favicon.php' ; ?>
14
+ <?php require LSWCP_DIR . 'admin/tpl/setting/settings_inc.cache_resources.php' ; ?>
15
+ <?php require LSWCP_DIR . 'admin/tpl/setting/settings_inc.cache_mobile.php' ; ?>
16
+ <?php require LSWCP_DIR . 'admin/tpl/setting/settings_inc.cache_browser.php' ; ?>
17
18
</tbody></table>
19
admin/tpl/{network_settings_excludes.php → setting/network_settings_excludes.php} RENAMED
@@ -7,9 +7,9 @@ if (!defined('WPINC')) die;
7
<table><tbody>
8
9
<!-- User Agent List -->
10
- <?php require LSWCP_DIR . 'admin/tpl/settings_inc.exclude_useragent.php'; ?>
11
12
<!-- Cookie List -->
13
- <?php require LSWCP_DIR . 'admin/tpl/settings_inc.exclude_cookies.php'; ?>
14
15
</tbody></table>
7
<table><tbody>
8
9
<!-- User Agent List -->
10
+ <?php require LSWCP_DIR . 'admin/tpl/setting/settings_inc.exclude_useragent.php'; ?>
11
12
<!-- Cookie List -->
13
+ <?php require LSWCP_DIR . 'admin/tpl/setting/settings_inc.exclude_cookies.php'; ?>
14
15
</tbody></table>
admin/tpl/{network_settings_general.php → setting/network_settings_general.php} RENAMED
File without changes
admin/tpl/{network_settings_purge.php → setting/network_settings_purge.php} RENAMED
@@ -5,6 +5,6 @@ if ( ! defined( 'WPINC' ) ) die ;
5
6
<table><tbody>
7
8
- <?php require LSWCP_DIR . 'admin/tpl/settings_inc.purge_on_upgrade.php' ; ?>
9
10
</tbody></table>
5
6
<table><tbody>
7
8
+ <?php require LSWCP_DIR . 'admin/tpl/setting/settings_inc.purge_on_upgrade.php' ; ?>
9
10
</tbody></table>
admin/tpl/{settings_advanced.php → setting/settings_advanced.php} RENAMED
File without changes
admin/tpl/{settings_cache.php → setting/settings_cache.php} RENAMED
@@ -46,9 +46,9 @@ if ( ! defined( 'WPINC' ) ) die ;
46
47
<?php
48
if ( ! is_multisite() ) :
49
- require LSWCP_DIR . 'admin/tpl/settings_inc.cache_favicon.php' ;
50
- require LSWCP_DIR . 'admin/tpl/settings_inc.cache_resources.php' ;
51
- require LSWCP_DIR . 'admin/tpl/settings_inc.cache_mobile.php' ;
52
endif ;
53
?>
54
@@ -72,7 +72,7 @@ if ( ! defined( 'WPINC' ) ) die ;
72
73
<?php
74
if ( ! is_multisite() ) :
75
- require LSWCP_DIR . 'admin/tpl/settings_inc.cache_browser.php' ;
76
endif ;
77
?>
78
46
47
<?php
48
if ( ! is_multisite() ) :
49
+ require LSWCP_DIR . 'admin/tpl/setting/settings_inc.cache_favicon.php' ;
50
+ require LSWCP_DIR . 'admin/tpl/setting/settings_inc.cache_resources.php' ;
51
+ require LSWCP_DIR . 'admin/tpl/setting/settings_inc.cache_mobile.php' ;
52
endif ;
53
?>
54
72
73
<?php
74
if ( ! is_multisite() ) :
75
+ require LSWCP_DIR . 'admin/tpl/setting/settings_inc.cache_browser.php' ;
76
endif ;
77
?>
78
admin/tpl/{settings_cdn.php → setting/settings_cdn.php} RENAMED
@@ -37,7 +37,7 @@ $cdn_url = 'https://cdn.' . substr( $home_url, 2 ) ;
37
<?php $this->build_input( LiteSpeed_Cache_Config::OPID_CDN_ORI, 'litespeed-input-long' ) ; ?>
38
<div class="litespeed-desc">
39
<?php echo sprintf( __( 'Site URL to be served through the CDN. Beginning with %1$s. For example, %2$s.', 'litespeed-cache' ), '<code>//</code>', '<code>' . $home_url . '</code>' ) ; ?>
40
- <p><?php echo sprintf( __( 'Wildcard %1$s supported (match zero or more characters). For example, to match %2$s and %3$s, use %4$s.', 'litespeed-cache' ), '<code>*</code>', '<code>//www.aa.com</code>', '<code>//aa.com</code>', '<code>//*aa.com</code>' ) ; ?></p>
41
</div>
42
</td>
43
</tr>
@@ -79,8 +79,8 @@ $cdn_url = 'https://cdn.' . substr( $home_url, 2 ) ;
79
<?php $id = LiteSpeed_Cache_Config::OPID_CDN_FILETYPE ; ?>
80
<?php $this->build_textarea( $id, null, false, 30 ) ; ?>
81
<div class="litespeed-desc">
82
- <p><?php echo __( 'Static file type links to be replaced by CDN links. One per line.', 'litespeed-cache' ) ; ?></p>
83
- <p><?php echo sprintf( __( 'This will affect all tags containing attributes: %s %s %s.', 'litespeed-cache' ), '<code>src=""</code>', '<code>data-src=""</code>', '<code>href=""</code>' ) ; ?></p>
84
</div>
85
</div>
86
<div style="float:left; display:flex;">
@@ -103,4 +103,32 @@ $cdn_url = 'https://cdn.' . substr( $home_url, 2 ) ;
103
</td>
104
</tr>
105
106
</tbody></table>
37
<?php $this->build_input( LiteSpeed_Cache_Config::OPID_CDN_ORI, 'litespeed-input-long' ) ; ?>
38
<div class="litespeed-desc">
39
<?php echo sprintf( __( 'Site URL to be served through the CDN. Beginning with %1$s. For example, %2$s.', 'litespeed-cache' ), '<code>//</code>', '<code>' . $home_url . '</code>' ) ; ?>
40
+ <br /><?php echo sprintf( __( 'Wildcard %1$s supported (match zero or more characters). For example, to match %2$s and %3$s, use %4$s.', 'litespeed-cache' ), '<code>*</code>', '<code>//www.aa.com</code>', '<code>//aa.com</code>', '<code>//*aa.com</code>' ) ; ?>
41
</div>
42
</td>
43
</tr>
79
<?php $id = LiteSpeed_Cache_Config::OPID_CDN_FILETYPE ; ?>
80
<?php $this->build_textarea( $id, null, false, 30 ) ; ?>
81
<div class="litespeed-desc">
82
+ <?php echo __( 'Static file type links to be replaced by CDN links. One per line.', 'litespeed-cache' ) ; ?>
83
+ <br /><?php echo sprintf( __( 'This will affect all tags containing attributes: %s %s %s.', 'litespeed-cache' ), '<code>src=""</code>', '<code>data-src=""</code>', '<code>href=""</code>' ) ; ?>
84
</div>
85
</div>
86
<div style="float:left; display:flex;">
103
</td>
104
</tr>
105
106
+ <tr>
107
+ <th><?php echo __( 'Load JQuery Remotely', 'litespeed-cache' ) ; ?></th>
108
+ <td>
109
+ <div class="litespeed-switch">
110
+ <?php echo $this->build_radio(
111
+ LiteSpeed_Cache_Config::OPID_CDN_REMOTE_JQUERY,
112
+ LiteSpeed_Cache_Config::VAL_OFF,
113
+ __( 'Off', 'litespeed-cache' )
114
+ ) ; ?>
115
+
116
+ <?php echo $this->build_radio(
117
+ LiteSpeed_Cache_Config::OPID_CDN_REMOTE_JQUERY,
118
+ LiteSpeed_Cache_Config::VAL_ON,
119
+ __( 'Google', 'litespeed-cache' )
120
+ ) ; ?>
121
+
122
+ <?php echo $this->build_radio(
123
+ LiteSpeed_Cache_Config::OPID_CDN_REMOTE_JQUERY,
124
+ LiteSpeed_Cache_Config::VAL_ON2,
125
+ __( 'cdnjs', 'litespeed-cache' )
126
+ ) ; ?>
127
+ </div>
128
+ <div class="litespeed-desc">
129
+ <?php echo __( 'Improve page load time by loading jQuery from a remote CDN service instead of locally.', 'litespeed-cache' ) ; ?>
130
+ </div>
131
+ </td>
132
+ </tr>
133
+
134
</tbody></table>
admin/tpl/{settings_compatibilities.php → setting/settings_compatibilities.php} RENAMED
File without changes
admin/tpl/{settings_crawler.php → setting/settings_crawler.php} RENAMED
File without changes
admin/tpl/{settings_debug.php → setting/settings_debug.php} RENAMED
File without changes
admin/tpl/{settings_esi.php → setting/settings_esi.php} RENAMED
File without changes
admin/tpl/{settings_excludes.php → setting/settings_excludes.php} RENAMED
@@ -108,10 +108,10 @@ if ( ! defined( 'WPINC' ) ) die ;
108
<?php
109
if ( ! is_multisite() ) :
110
// Cookie
111
- require LSWCP_DIR . 'admin/tpl/settings_inc.exclude_cookies.php' ;
112
113
// User Agent
114
- require LSWCP_DIR . 'admin/tpl/settings_inc.exclude_useragent.php' ;
115
116
endif ;
117
?>
108
<?php
109
if ( ! is_multisite() ) :
110
// Cookie
111
+ require LSWCP_DIR . 'admin/tpl/setting/settings_inc.exclude_cookies.php' ;
112
113
// User Agent
114
+ require LSWCP_DIR . 'admin/tpl/setting/settings_inc.exclude_useragent.php' ;
115
116
endif ;
117
?>
admin/tpl/{settings_general.php → setting/settings_general.php} RENAMED
File without changes
admin/tpl/{settings_inc.cache_browser.php → setting/settings_inc.cache_browser.php} RENAMED
@@ -8,11 +8,11 @@ if ( ! defined( 'WPINC' ) ) die ;
8
<?php $this->build_switch( LiteSpeed_Cache_Config::OPID_CACHE_BROWSER ) ; ?>
9
<div class="litespeed-desc">
10
<?php echo __( 'Browser caching stores static files locally in the user\'s browser. Turn on this setting to reduce repeated requests for static files.', 'litespeed-cache' ) ; ?>
11
- <i class="litespeed-warning">
12
<?php echo __('NOTE:', 'litespeed-cache'); ?>
13
<?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?>
14
- </i>
15
- <p><?php echo sprintf( __( 'You can turn on browser caching in server admin too. <a %s>Learn more about LiteSpeed browser cache setting</a>.', 'litespeed-cache' ), 'href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:browser_cache" target="_blank"' ) ; ?></p>
16
</div>
17
</td>
18
</tr>
8
<?php $this->build_switch( LiteSpeed_Cache_Config::OPID_CACHE_BROWSER ) ; ?>
9
<div class="litespeed-desc">
10
<?php echo __( 'Browser caching stores static files locally in the user\'s browser. Turn on this setting to reduce repeated requests for static files.', 'litespeed-cache' ) ; ?>
11
+ <br /><font class="litespeed-warning">
12
<?php echo __('NOTE:', 'litespeed-cache'); ?>
13
<?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?>
14
+ </font>
15
+ <br /><?php echo sprintf( __( 'You can turn on browser caching in server admin too. <a %s>Learn more about LiteSpeed browser cache setting</a>.', 'litespeed-cache' ), 'href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:browser_cache" target="_blank"' ) ; ?>
16
</div>
17
</td>
18
</tr>
admin/tpl/{settings_inc.cache_favicon.php → setting/settings_inc.cache_favicon.php} RENAMED
@@ -10,10 +10,10 @@ $file_writable = LiteSpeed_Cache_Admin_Rules::writable();
10
<div class="litespeed-desc">
11
<?php echo __('favicon.ico is requested on most pages.', 'litespeed-cache'); ?>
12
<?php echo __('Caching this resource may improve server performance by avoiding unnecessary PHP calls.', 'litespeed-cache'); ?>
13
- <i class="litespeed-warning">
14
<?php echo __('NOTE:', 'litespeed-cache'); ?>
15
<?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?>
16
- </i>
17
</div>
18
</td>
19
</tr>
10
<div class="litespeed-desc">
11
<?php echo __('favicon.ico is requested on most pages.', 'litespeed-cache'); ?>
12
<?php echo __('Caching this resource may improve server performance by avoiding unnecessary PHP calls.', 'litespeed-cache'); ?>
13
+ <br /><font class="litespeed-warning">
14
<?php echo __('NOTE:', 'litespeed-cache'); ?>
15
<?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?>
16
+ </font>
17
</div>
18
</td>
19
</tr>
admin/tpl/{settings_inc.cache_mobile.php → setting/settings_inc.cache_mobile.php} RENAMED
@@ -14,10 +14,10 @@ if (!defined('WPINC')) die;
14
<div class="litespeed-desc">
15
<?php echo __('When enabled, mobile views will be cached separately.', 'litespeed-cache'); ?>
16
<?php echo __('A site built with responsive design does not need to check this.', 'litespeed-cache'); ?>
17
- <i class="litespeed-warning">
18
<?php echo __( 'NOTE:', 'litespeed-cache' ) ; ?>
19
<?php echo __( 'This setting will edit the .htaccess file.', 'litespeed-cache' ) ; ?>
20
- </i>
21
</div>
22
</td>
23
</tr>
@@ -61,9 +61,8 @@ if (!defined('WPINC')) die;
61
<?php echo sprintf( __( 'SYNTAX: Each entry should be separated with a bar, %s.', 'litespeed-cache'), "<code>|</code>" ) ; ?>
62
<?php echo sprintf( __( 'Any spaces should be escaped with a backslash before the space, %s.', 'litespeed-cache' ), "<code>\\</code>" ) ; ?>
63
</i>
64
- <p>
65
<?php echo sprintf( __( 'The default list WordPress uses is %s', 'litespeed-cache' ), "<code>$wp_default_mobile</code>" ) ; ?>
66
- </p>
67
</div>
68
</td>
69
</tr>
14
<div class="litespeed-desc">
15
<?php echo __('When enabled, mobile views will be cached separately.', 'litespeed-cache'); ?>
16
<?php echo __('A site built with responsive design does not need to check this.', 'litespeed-cache'); ?>
17
+ <br /><font class="litespeed-warning">
18
<?php echo __( 'NOTE:', 'litespeed-cache' ) ; ?>
19
<?php echo __( 'This setting will edit the .htaccess file.', 'litespeed-cache' ) ; ?>
20
+ </font>
21
</div>
22
</td>
23
</tr>
61
<?php echo sprintf( __( 'SYNTAX: Each entry should be separated with a bar, %s.', 'litespeed-cache'), "<code>|</code>" ) ; ?>
62
<?php echo sprintf( __( 'Any spaces should be escaped with a backslash before the space, %s.', 'litespeed-cache' ), "<code>\\</code>" ) ; ?>
63
</i>
64
+ <br />
65
<?php echo sprintf( __( 'The default list WordPress uses is %s', 'litespeed-cache' ), "<code>$wp_default_mobile</code>" ) ; ?>
66
</div>
67
</td>
68
</tr>
admin/tpl/{settings_inc.cache_resources.php → setting/settings_inc.cache_resources.php} RENAMED
@@ -11,10 +11,10 @@ $file_writable = LiteSpeed_Cache_Admin_Rules::writable();
11
<div class="litespeed-desc">
12
<?php echo __('Some themes and plugins add resources via a PHP request.', 'litespeed-cache'); ?>
13
<?php echo __('Caching these pages may improve server performance by avoiding unnecessary PHP calls.', 'litespeed-cache'); ?>
14
- <i class="litespeed-warning">
15
<?php echo __('NOTE:', 'litespeed-cache'); ?>
16
<?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?>
17
- </i>
18
</div>
19
</td>
20
</tr>
11
<div class="litespeed-desc">
12
<?php echo __('Some themes and plugins add resources via a PHP request.', 'litespeed-cache'); ?>
13
<?php echo __('Caching these pages may improve server performance by avoiding unnecessary PHP calls.', 'litespeed-cache'); ?>
14
+ <br /><font class="litespeed-warning">
15
<?php echo __('NOTE:', 'litespeed-cache'); ?>
16
<?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?>
17
+ </font>
18
</div>
19
</td>
20
</tr>
admin/tpl/{settings_inc.exclude_cookies.php → setting/settings_inc.exclude_cookies.php} RENAMED
@@ -18,10 +18,10 @@ if ( ! defined( 'WPINC' ) ) die ;
18
<?php echo sprintf(__('Spaces should have a backslash in front of them, %s.', 'litespeed-cache'), '<code>\ </code>'); ?>
19
<?php echo __('One per line.', 'litespeed-cache'); ?>
20
</i>
21
- <i class="litespeed-warning">
22
<?php echo __('NOTE:', 'litespeed-cache'); ?>
23
<?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?>
24
- </i>
25
</div>
26
</td>
27
</tr>
18
<?php echo sprintf(__('Spaces should have a backslash in front of them, %s.', 'litespeed-cache'), '<code>\ </code>'); ?>
19
<?php echo __('One per line.', 'litespeed-cache'); ?>
20
</i>
21
+ <br /><font class="litespeed-warning">
22
<?php echo __('NOTE:', 'litespeed-cache'); ?>
23
<?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?>
24
+ </font>
25
</div>
26
</td>
27
</tr>
admin/tpl/{settings_inc.exclude_useragent.php → setting/settings_inc.exclude_useragent.php} RENAMED
@@ -17,10 +17,10 @@ if (!defined('WPINC')) die;
17
<?php echo sprintf( __( 'SYNTAX: Separate each user agent with a bar, %s.', 'litespeed-cache' ), '<code>|</code>' ) ; ?>
18
<?php echo sprintf( __( 'Spaces should have a backslash in front of them, %s.', 'litespeed-cache' ), '<code>\</code>' ) ; ?>
19
</i>
20
- <i class="litespeed-warning">
21
<?php echo __('NOTE:', 'litespeed-cache'); ?>
22
<?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?>
23
- </i>
24
</div>
25
</td>
26
</tr>
17
<?php echo sprintf( __( 'SYNTAX: Separate each user agent with a bar, %s.', 'litespeed-cache' ), '<code>|</code>' ) ; ?>
18
<?php echo sprintf( __( 'Spaces should have a backslash in front of them, %s.', 'litespeed-cache' ), '<code>\</code>' ) ; ?>
19
</i>
20
+ <br /><font class="litespeed-warning">
21
<?php echo __('NOTE:', 'litespeed-cache'); ?>
22
<?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?>
23
+ </font>
24
</div>
25
</td>
26
</tr>
admin/tpl/{settings_inc.purge_on_upgrade.php → setting/settings_inc.purge_on_upgrade.php} RENAMED
File without changes
admin/tpl/setting/settings_media.php ADDED
@@ -0,0 +1,62 @@
1
+ <?php
2
+ if ( ! defined( 'WPINC' ) ) die ;
3
+
4
+ ?>
5
+
6
+ <h3 class="litespeed-title"><?php echo __( 'Media Settings', 'litespeed-cache' ) ; ?></h3>
7
+
8
+ <table><tbody>
9
+ <tr>
10
+ <th><?php echo __( 'Lazy Load Images', 'litespeed-cache' ) ; ?></th>
11
+ <td>
12
+ <?php $this->build_switch( LiteSpeed_Cache_Config::OPID_MEDIA_IMG_LAZY ) ; ?>
13
+ <div class="litespeed-desc">
14
+ <?php echo __( 'Load images only when they enter the viewport.', 'litespeed-cache' ) ; ?>
15
+ <?php echo __( 'This can improve page loading time by reducing initial HTTP requests.', 'litespeed-cache' ) ; ?>
16
+ </div>
17
+ </td>
18
+ </tr>
19
+
20
+ <tr>
21
+ <th><?php echo __( 'Lazy Load Image Excludes', 'litespeed-cache' ) ; ?></th>
22
+ <td>
23
+ <?php $this->build_textarea2( LiteSpeed_Cache_Config::ITEM_MEDIA_LAZY_IMG_EXC ) ; ?>
24
+ <div class="litespeed-desc">
25
+ <?php echo __( 'Listed images will not be lazy loaded.', 'litespeed-cache' ) ; ?>
26
+ <?php echo __( 'Both full URLs and partial strings can be used.', 'litespeed-cache' ) ; ?>
27
+ <?php echo __('One per line.', 'litespeed-cache'); ?>
28
+ <br /><font class="litespeed-success">
29
+ <?php echo __('API:', 'litespeed-cache'); ?>
30
+ <?php echo sprintf( __( 'Filter %s is supported.', 'litespeed-cache' ), '<code>litespeed_cache_media_lazy_img_excludes</code>' ) ; ?>
31
+ <?php echo sprintf( __( 'Elements with attribute %s in html code will be excluded.', 'litespeed-cache' ), '<code>data-no-lazy="1"</code>' ) ; ?>
32
+ </font>
33
+ </div>
34
+ </td>
35
+ </tr>
36
+
37
+ <tr>
38
+ <th><?php echo __( 'Lazy Load Image Placeholder', 'litespeed-cache' ) ; ?></th>
39
+ <td>
40
+ <?php $this->build_input( LiteSpeed_Cache_Config::OPID_MEDIA_IMG_LAZY_PLACEHOLDER, 'litespeed-input-long' ) ; ?>
41
+ <div class="litespeed-desc">
42
+ <?php echo __( 'Specify a base64 image to be used as a placeholder while other images finish loading.', 'litespeed-cache' ) ; ?>
43
+ <br /><?php echo sprintf( __( 'This can be predefined in %2$s as well using constant %1$s, with this setting taking priority.', 'litespeed-cache' ), '<code>LITESPEED_PLACEHOLDER</code>', '<code>wp-config.php</code>' ) ; ?>
44
+ <br /><?php echo sprintf( __( 'By default a gray image placeholder %s will be used.', 'litespeed-cache' ), '<code>data:image/gif;base64,R0lGODdhAQABAPAAAMPDwwAAACwAAAAAAQABAAACAkQBADs=</code>' ) ; ?>
45
+ <br /><?php echo sprintf( __( 'For example, %s can be used for a transparent placeholder.', 'litespeed-cache' ), '<code>data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7</code>' ) ; ?>
46
+ </div>
47
+ </td>
48
+ </tr>
49
+
50
+ <tr>
51
+ <th><?php echo __( 'Lazy Load Iframes', 'litespeed-cache' ) ; ?></th>
52
+ <td>
53
+ <?php $this->build_switch( LiteSpeed_Cache_Config::OPID_MEDIA_IFRAME_LAZY ) ; ?>
54
+ <div class="litespeed-desc">
55
+ <?php echo __( 'Load iframes only when they enter the viewport.', 'litespeed-cache' ) ; ?>
56
+ <?php echo __( 'This can improve page loading time by reducing initial HTTP requests.', 'litespeed-cache' ) ; ?>
57
+ </div>
58
+ </td>
59
+ </tr>
60
+
61
+
62
+ </tbody></table>
admin/tpl/{settings_optimize.php → setting/settings_optimize.php} RENAMED
@@ -56,6 +56,11 @@ if ( ! defined( 'WPINC' ) ) die ;
56
<?php echo __( 'Listed CSS files will not be minified/combined.', 'litespeed-cache' ) ; ?>
57
<?php echo __( 'Both full URLs and partial strings can be used.', 'litespeed-cache' ) ; ?>
58
<?php echo __('One per line.', 'litespeed-cache'); ?>
59
</div>
60
</td>
61
</tr>
@@ -98,6 +103,11 @@ if ( ! defined( 'WPINC' ) ) die ;
98
<?php echo __( 'Listed JS files will not be minified/combined.', 'litespeed-cache' ) ; ?>
99
<?php echo __( 'Both full URLs and partial strings can be used.', 'litespeed-cache' ) ; ?>
100
<?php echo __('One per line.', 'litespeed-cache'); ?>
101
</div>
102
</td>
103
</tr>
@@ -152,6 +162,10 @@ if ( ! defined( 'WPINC' ) ) die ;
152
<div class="litespeed-desc">
153
<?php echo __( 'Optimize CSS delivery. This will load Google Fonts asynchronously too.', 'litespeed-cache' ) ; ?>
154
<?php echo __( 'This can improve your speed score in services like Pingdom, GTmetrix and PageSpeed.', 'litespeed-cache' ) ; ?>
155
</div>
156
</td>
157
</tr>
@@ -159,7 +173,7 @@ if ( ! defined( 'WPINC' ) ) die ;
159
<tr>
160
<th><?php echo __( 'Critical CSS Rules', 'litespeed-cache' ) ; ?></th>
161
<td>
162
- <?php $this->build_textarea( LiteSpeed_Cache_Config::ITEM_OPTM_CSS, get_option( LiteSpeed_Cache_Config::ITEM_OPTM_CSS ) ) ; ?>
163
<div class="litespeed-desc">
164
<?php echo sprintf( __( 'Specify critical CSS rules for above-the-fold content when enabling %s.', 'litespeed-cache' ), __( 'Load CSS Asynchronously', 'litespeed-cache' ) ) ; ?>
165
</div>
@@ -177,6 +191,23 @@ if ( ! defined( 'WPINC' ) ) die ;
177
</td>
178
</tr>
179
180
<tr>
181
<th><?php echo __( 'Remove WordPress Emoji', 'litespeed-cache' ) ; ?></th>
182
<td>
@@ -201,4 +232,18 @@ if ( ! defined( 'WPINC' ) ) die ;
201
</td>
202
</tr>
203
204
</tbody></table>
56
<?php echo __( 'Listed CSS files will not be minified/combined.', 'litespeed-cache' ) ; ?>
57
<?php echo __( 'Both full URLs and partial strings can be used.', 'litespeed-cache' ) ; ?>
58
<?php echo __('One per line.', 'litespeed-cache'); ?>
59
+ <br /><font class="litespeed-success">
60
+ <?php echo __('API:', 'litespeed-cache'); ?>
61
+ <?php echo sprintf( __( 'Filter %s is supported.', 'litespeed-cache' ), '<code>litespeed_cache_optimize_css_excludes</code>' ) ; ?>
62
+ <?php echo sprintf( __( 'Elements with attribute %s in html code will be excluded.', 'litespeed-cache' ), '<code>data-no-optimize="1"</code>' ) ; ?>
63
+ </font>
64
</div>
65
</td>
66
</tr>
103
<?php echo __( 'Listed JS files will not be minified/combined.', 'litespeed-cache' ) ; ?>
104
<?php echo __( 'Both full URLs and partial strings can be used.', 'litespeed-cache' ) ; ?>
105
<?php echo __('One per line.', 'litespeed-cache'); ?>
106
+ <br /><font class="litespeed-success">
107
+ <?php echo __('API:', 'litespeed-cache'); ?>
108
+ <?php echo sprintf( __( 'Filter %s is supported.', 'litespeed-cache' ), '<code>litespeed_cache_optimize_js_excludes</code>' ) ; ?>
109
+ <?php echo sprintf( __( 'Elements with attribute %s in html code will be excluded.', 'litespeed-cache' ), '<code>data-no-optimize="1"</code>' ) ; ?>
110
+ </font>
111
</div>
112
</td>
113
</tr>
162
<div class="litespeed-desc">
163
<?php echo __( 'Optimize CSS delivery. This will load Google Fonts asynchronously too.', 'litespeed-cache' ) ; ?>
164
<?php echo __( 'This can improve your speed score in services like Pingdom, GTmetrix and PageSpeed.', 'litespeed-cache' ) ; ?>
165
+ <br /><font class="litespeed-success">
166
+ <?php echo __('API:', 'litespeed-cache'); ?>
167
+ <?php echo sprintf( __( 'Elements with attribute %s in html code will be excluded.', 'litespeed-cache' ), '<code>data-no-async="1"</code>' ) ; ?>
168
+ </font>
169
</div>
170
</td>
171
</tr>
173
<tr>
174
<th><?php echo __( 'Critical CSS Rules', 'litespeed-cache' ) ; ?></th>
175
<td>
176
+ <?php $this->build_textarea2( LiteSpeed_Cache_Config::ITEM_OPTM_CSS ) ; ?>
177
<div class="litespeed-desc">
178
<?php echo sprintf( __( 'Specify critical CSS rules for above-the-fold content when enabling %s.', 'litespeed-cache' ), __( 'Load CSS Asynchronously', 'litespeed-cache' ) ) ; ?>
179
</div>
191
</td>
192
</tr>
193
194
+ <tr>
195
+ <th><?php echo __( 'JS Deferred Excludes', 'litespeed-cache' ) ; ?></th>
196
+ <td>
197
+ <?php $this->build_textarea2( LiteSpeed_Cache_Config::ITEM_OPTM_JS_DEFER_EXC ) ; ?>
198
+ <div class="litespeed-desc">
199
+ <?php echo __( 'Listed JS files will not be deferred.', 'litespeed-cache' ) ; ?>
200
+ <?php echo __( 'Both full URLs and partial strings can be used.', 'litespeed-cache' ) ; ?>
201
+ <?php echo __('One per line.', 'litespeed-cache'); ?>
202
+ <br /><font class="litespeed-success">
203
+ <?php echo __('API:', 'litespeed-cache'); ?>
204
+ <?php echo sprintf( __( 'Filter %s is supported.', 'litespeed-cache' ), '<code>litespeed_optm_js_defer_exc</code>' ) ; ?>
205
+ <?php echo sprintf( __( 'Elements with attribute %s in html code will be excluded.', 'litespeed-cache' ), '<code>data-no-defer="1"</code>' ) ; ?>
206
+ </font>
207
+ </div>
208
+ </td>
209
+ </tr>
210
+
211
<tr>
212
<th><?php echo __( 'Remove WordPress Emoji', 'litespeed-cache' ) ; ?></th>
213
<td>
232
</td>
233
</tr>
234
235
+ <tr>
236
+ <th><?php echo __( 'Exclude JQuery', 'litespeed-cache' ) ; ?></th>
237
+ <td>
238
+ <?php $this->build_switch( LiteSpeed_Cache_Config::OPID_OPTM_EXC_JQUERY ) ; ?>
239
+ <div class="litespeed-desc">
240
+ <?php echo sprintf( __( 'Improve compatibility with inline JS by preventing jQuery optimization. (Recommended Setting: %s)', 'litespeed-cache' ), __( 'ON', 'litespeed-cache' ) ) ; ?>
241
+ <br /><font class="litespeed-warning">
242
+ <?php echo __('NOTE:', 'litespeed-cache'); ?>
243
+ <?php echo sprintf( __( 'If there is any JS error related to %1$s when enabled %2$s, please try this option.', 'litespeed-cache' ), 'jQuery', __( 'JS Combine', 'litespeed-cache' ) ) ; ?>
244
+ </font>
245
+ </div>
246
+ </td>
247
+ </tr>
248
+
249
</tbody></table>
admin/tpl/{settings_purge.php → setting/settings_purge.php} RENAMED
@@ -37,7 +37,7 @@ $breakArr = array(
37
<table><tbody>
38
39
<?php if (!is_multisite()): ?>
40
- <?php require LSWCP_DIR . 'admin/tpl/settings_inc.purge_on_upgrade.php'; ?>
41
<?php endif; ?>
42
43
<tr>
37
<table><tbody>
38
39
<?php if (!is_multisite()): ?>
40
+ <?php require LSWCP_DIR . 'admin/tpl/setting/settings_inc.purge_on_upgrade.php'; ?>
41
<?php endif; ?>
42
43
<tr>
admin/tpl/settings.php CHANGED
@@ -81,7 +81,7 @@ else {
81
}
82
83
84
- include_once LSWCP_DIR . "admin/tpl/banner_promo.php" ;
85
?>
86
87
<div class="wrap">
@@ -128,7 +128,7 @@ include_once LSWCP_DIR . "admin/tpl/banner_promo.php" ;
128
// include all tpl for faster UE
129
foreach ($menu_list as $tab => $val) {
130
echo "<div data-litespeed-layout='$tab'>" ;
131
- require LSWCP_DIR . "admin/tpl/settings_$tab.php" ;
132
echo "</div>" ;
133
}
134
81
}
82
83
84
+ include_once LSWCP_DIR . "admin/tpl/inc/banner_promo.php" ;
85
?>
86
87
<div class="wrap">
128
// include all tpl for faster UE
129
foreach ($menu_list as $tab => $val) {
130
echo "<div data-litespeed-layout='$tab'>" ;
131
+ require LSWCP_DIR . "admin/tpl/setting/settings_$tab.php" ;
132
echo "</div>" ;
133
}
134
admin/tpl/settings_media.php DELETED
@@ -1,32 +0,0 @@
1
- <?php
2
- if ( ! defined( 'WPINC' ) ) die ;
3
-
4
- ?>
5
-
6
- <h3 class="litespeed-title"><?php echo __( 'Media Settings', 'litespeed-cache' ) ; ?></h3>
7
-
8
- <table><tbody>
9
- <tr>
10
- <th><?php echo __( 'Lazyload Images', 'litespeed-cache' ) ; ?></th>
11
- <td>
12
- <?php $this->build_switch( LiteSpeed_Cache_Config::OPID_MEDIA_IMG_LAZY ) ; ?>
13
- <div class="litespeed-desc">
14
- <?php echo __( 'Load images only when they enter the viewport.', 'litespeed-cache' ) ; ?>
15
- <?php echo __( 'This can improve page loading time by reducing initial HTTP requests.', 'litespeed-cache' ) ; ?>
16
- </div>
17
- </td>
18
- </tr>
19
-
20
- <tr>
21
- <th><?php echo __( 'Lazyload Iframes', 'litespeed-cache' ) ; ?></th>
22
- <td>
23
- <?php $this->build_switch( LiteSpeed_Cache_Config::OPID_MEDIA_IFRAME_LAZY ) ; ?>
24
- <div class="litespeed-desc">
25
- <?php echo __( 'Load iframes only when they enter the viewport.', 'litespeed-cache' ) ; ?>
26
- <?php echo __( 'This can improve page loading time by reducing initial HTTP requests.', 'litespeed-cache' ) ; ?>
27
- </div>
28
- </td>
29
- </tr>
30
-
31
-
32
- </tbody></table>
cli/litespeed-cache-cli-admin.class.php CHANGED
@@ -47,6 +47,7 @@ class LiteSpeed_Cache_Cli_Admin
47
LiteSpeed_Cache_Config::OPID_OPTM_CSS_ASYNC,
48
LiteSpeed_Cache_Config::OPID_OPTM_JS_DEFER,
49
LiteSpeed_Cache_Config::OPID_OPTM_EMOJI_RM,
50
51
LiteSpeed_Cache_Config::OPID_CDN,
52
LiteSpeed_Cache_Config::OPID_CDN_INC_IMG,
@@ -144,6 +145,7 @@ class LiteSpeed_Cache_Cli_Admin
144
case LiteSpeed_Cache_Config::OPID_OPTM_CSS_ASYNC:
145
case LiteSpeed_Cache_Config::OPID_OPTM_JS_DEFER:
146
case LiteSpeed_Cache_Config::OPID_OPTM_EMOJI_RM:
147
148
case LiteSpeed_Cache_Config::OPID_CDN:
149
case LiteSpeed_Cache_Config::OPID_CDN_INC_IMG:
47
LiteSpeed_Cache_Config::OPID_OPTM_CSS_ASYNC,
48
LiteSpeed_Cache_Config::OPID_OPTM_JS_DEFER,
49
LiteSpeed_Cache_Config::OPID_OPTM_EMOJI_RM,
50
+ LiteSpeed_Cache_Config::OPID_OPTM_EXC_JQUERY,
51
52
LiteSpeed_Cache_Config::OPID_CDN,
53
LiteSpeed_Cache_Config::OPID_CDN_INC_IMG,
145
case LiteSpeed_Cache_Config::OPID_OPTM_CSS_ASYNC:
146
case LiteSpeed_Cache_Config::OPID_OPTM_JS_DEFER:
147
case LiteSpeed_Cache_Config::OPID_OPTM_EMOJI_RM:
148
+ case LiteSpeed_Cache_Config::OPID_OPTM_EXC_JQUERY:
149
150
case LiteSpeed_Cache_Config::OPID_CDN:
151
case LiteSpeed_Cache_Config::OPID_CDN_INC_IMG:
cli/litespeed-cache-cli-purge.class.php CHANGED
File without changes
css/litespeed.css CHANGED
@@ -17,6 +17,10 @@
17
display: inline-block;
18
}
19
20
.litespeed-warning {
21
color: #e59544!important;
22
}
@@ -43,6 +47,7 @@
43
color: #9e9e9e;
44
color: #7a919e;
45
margin: 10px 5px;
46
}
47
48
.litespeed-hide {
17
display: inline-block;
18
}
19
20
+ .litespeed-success {
21
+ color: #73b38d!important;
22
+ }
23
+
24
.litespeed-warning {
25
color: #e59544!important;
26
}
47
color: #9e9e9e;
48
color: #7a919e;
49
margin: 10px 5px;
50
+ line-height: 1.7;
51
}
52
53
.litespeed-hide {
img/Litespeed.icon.svg CHANGED
File without changes
img/icons/purge-cssjs.svg CHANGED
File without changes
img/lscwp-logo_256x256.png CHANGED
File without changes
inc/activation.class.php ADDED
@@ -0,0 +1,236 @@
1
+ <?php
2
+ /**
3
+ * The plugin activation class.
4
+ *
5
+ * @since 1.1.0
6
+ * @since 1.5 Moved into /inc
7
+ * @package LiteSpeed_Cache
8
+ * @subpackage LiteSpeed_Cache/inc
9
+ * @author LiteSpeed Technologies <info@litespeedtech.com>
10
+ */
11
+ class LiteSpeed_Cache_Activation
12
+ {
13
+ const NETWORK_TRANSIENT_COUNT = 'lscwp_network_count' ;
14
+
15
+ /**
16
+ * The activation hook callback.
17
+ *
18
+ * Attempts to set up the advanced cache file. If it fails for any reason,
19
+ * the plugin will not activate.
20
+ *
21
+ * @since 1.0.0
22
+ * @access public
23
+ */
24
+ public static function register_activation()
25
+ {
26
+ $count = 0 ;
27
+ ! defined( 'LSCWP_LOG_TAG' ) && define( 'LSCWP_LOG_TAG', 'Activate_' . get_current_blog_id() ) ;
28
+
29
+ self::try_copy_advanced_cache() ;
30
+ LiteSpeed_Cache_Config::wp_cache_var_setter( true ) ;
31
+
32
+ if ( is_multisite() ) {
33
+ $count = self::get_network_count() ;
34
+ if ( $count !== false ) {
35
+ $count = intval( $count ) + 1 ;
36
+ set_site_transient( self::NETWORK_TRANSIENT_COUNT, $count, DAY_IN_SECONDS ) ;
37
+ }
38
+ }
39
+ do_action( 'litespeed_cache_api_load_thirdparty' ) ;
40
+ LiteSpeed_Cache_Config::get_instance()->plugin_activation( $count ) ;
41
+ LiteSpeed_Cache_Admin_Report::get_instance()->generate_environment_report() ;
42
+
43
+ if ( defined( 'LSCWP_PLUGIN_NAME' ) ) {
44
+ set_transient( LiteSpeed_Cache::WHM_TRANSIENT, LiteSpeed_Cache::WHM_TRANSIENT_VAL ) ;
45
+ }
46
+
47
+ // Register crawler cron task
48
+ LiteSpeed_Cache_Task::update() ;
49
+ }
50
+
51
+ /**
52
+ * Uninstall plugin
53
+ * @since 1.1.0
54
+ */
55
+ public static function uninstall_litespeed_cache()
56
+ {
57
+ LiteSpeed_Cache_Task::clear() ;
58
+ LiteSpeed_Cache_Admin_Rules::get_instance()->clear_rules( true ) ;
59
+ delete_option( LiteSpeed_Cache_Config::OPTION_NAME ) ;
60
+ if ( is_multisite() ) {
61
+ delete_site_option( LiteSpeed_Cache_Config::OPTION_NAME ) ;
62
+ }
63
+ }
64
+
65
+ /**
66
+ * Get the blog ids for the network. Accepts function arguments.
67
+ *
68
+ * Will use wp_get_sites for WP versions less than 4.6
69
+ *
70
+ * @since 1.0.12
71
+ * @access public
72
+ * @param array $args Arguments to pass into get_sites/wp_get_sites.
73
+ * @return array The array of blog ids.
74
+ */
75
+ public static function get_network_ids( $args = array() )
76
+ {
77
+ global $wp_version ;
78
+ if ( version_compare( $wp_version, '4.6', '<' ) ) {
79
+ $blogs = wp_get_sites( $args ) ;
80
+ if ( ! empty( $blogs ) ) {
81
+ foreach ( $blogs as $key => $blog ) {
82
+ $blogs[ $key ] = $blog[ 'blog_id' ] ;
83
+ }
84
+ }
85
+ }
86
+ else {
87
+ $args[ 'fields' ] = 'ids' ;
88
+ $blogs = get_sites( $args ) ;
89
+ }
90
+ return $blogs ;
91
+ }
92
+
93
+ /**
94
+ * Gets the count of active litespeed cache plugins on multisite.
95
+ *
96
+ * @since 1.0.12
97
+ * @access private
98
+ * @return mixed The count on success, false on failure.
99
+ */
100
+ private static function get_network_count()
101
+ {
102
+ $count = get_site_transient( self::NETWORK_TRANSIENT_COUNT ) ;
103
+ if ( $count !== false ) {
104
+ return intval( $count ) ;
105
+ }
106
+ // need to update
107
+ $default = array() ;
108
+ $count = 0 ;
109
+
110
+ $sites = self::get_network_ids( array( 'deleted' => 0 ) ) ;
111
+ if ( empty( $sites ) ) {
112
+ return false ;
113
+ }
114
+
115
+ foreach ( $sites as $site ) {
116
+ $bid = is_object( $site ) && property_exists( $site, 'blog_id' ) ? $site->blog_id : $site ;
117
+ $plugins = get_blog_option( $bid , 'active_plugins', $default ) ;
118
+ if ( in_array( LSWCP_BASENAME, $plugins, true ) ) {
119
+ $count++ ;
120
+ }
121
+ }
122
+ if ( is_plugin_active_for_network( LSWCP_BASENAME ) ) {
123
+ $count++ ;
124
+ }
125
+ return $count ;
126
+ }
127
+
128
+ /**
129
+ * Is this deactivate call the last active installation on the multisite
130
+ * network?
131
+ *
132
+ * @since 1.0.12
133
+ * @access private
134
+ * @return bool True if yes, false otherwise.
135
+ */
136
+ private static function is_deactivate_last()
137
+ {
138
+ $count = self::get_network_count() ;
139
+ if ( $count === false ) {
140
+ return false ;
141
+ }
142
+ if ( $count !== 1 ) {
143
+ // Not deactivating the last one.
144
+ $count-- ;
145
+ set_site_transient( self::NETWORK_TRANSIENT_COUNT, $count, DAY_IN_SECONDS ) ;
146
+ return false ;
147
+ }
148
+
149
+ delete_site_transient( self::NETWORK_TRANSIENT_COUNT ) ;
150
+ return true ;
151
+ }
152
+
153
+ /**
154
+ * The deactivation hook callback.
155
+ *
156
+ * Initializes all clean up functionalities.
157
+ *
158
+ * @since 1.0.0
159
+ * @access public
160
+ */
161
+ public static function register_deactivation()
162
+ {
163
+ LiteSpeed_Cache_Task::clear() ;
164
+
165
+ ! defined( 'LSCWP_LOG_TAG' ) && define( 'LSCWP_LOG_TAG', 'Deactivate_' . get_current_blog_id() ) ;
166
+
167
+ LiteSpeed_Cache_Purge::purge_all() ;
168
+
169
+ if ( is_multisite() ) {
170
+
171
+ if ( ! self::is_deactivate_last() ) {
172
+ if ( is_network_admin() ) {
173
+ // Still other activated subsite left, set .htaccess with only CacheLookUp
174
+ LiteSpeed_Cache_Admin_Rules::get_instance()->insert_wrapper() ;
175
+ }
176
+ return ;
177
+ }
178
+ }
179
+
180
+ $adv_cache_path = LSWCP_CONTENT_DIR . '/advanced-cache.php' ;
181
+ // this file can be generated by other cache plugin like w3tc, we only delete our own file
182
+ if ( file_exists( $adv_cache_path ) && is_writable( $adv_cache_path ) ) {
183
+ if ( strpos( file_get_contents( $adv_cache_path ), 'LSCACHE_ADV_CACHE' ) !== false ) {
184
+ unlink( $adv_cache_path ) ;
185
+ }
186
+ else {
187
+ error_log(' Keep advanced-cache.php as it belongs to other plugins' ) ;
188
+ }
189
+ }
190
+ else {
191
+ error_log( 'Failed to remove advanced-cache.php, file does not exist or is not writable!' ) ;
192
+ }
193
+
194
+ if ( ! LiteSpeed_Cache_Config::wp_cache_var_setter( false ) ) {
195
+ error_log('In wp-config.php: WP_CACHE could not be set to false during deactivation!') ;
196
+ }
197
+
198
+ LiteSpeed_Cache_Admin_Rules::get_instance()->clear_rules( true ) ;
199
+
200
+ // delete in case it's not deleted prior to deactivation.
201
+ self::dismiss_whm() ;
202
+ }
203
+
204
+ /**
205
+ * Try to copy our advanced-cache.php file to the wordpress directory.
206
+ *
207
+ * @since 1.0.11
208
+ * @access public
209
+ * @return boolean True on success, false on failure.
210
+ */
211
+ public static function try_copy_advanced_cache()
212
+ {
213
+ $adv_cache_path = LSWCP_CONTENT_DIR . '/advanced-cache.php' ;
214
+ if ( file_exists( $adv_cache_path ) && ( filesize( $adv_cache_path ) !== 0 || ! is_writable( $adv_cache_path ) ) ) {
215
+ return false ;
216
+ }
217
+
218
+ copy( LSWCP_DIR . 'includes/advanced-cache.php', $adv_cache_path ) ;
219
+ include( $adv_cache_path ) ;
220
+ $ret = defined( 'LSCACHE_ADV_CACHE' ) ;
221
+ return $ret ;
222
+ }
223
+
224
+ /**
225
+ * Delete whm transient msg tag
226
+ *
227
+ * @since 1.1.1
228
+ * @access public
229
+ */
230
+ public static function dismiss_whm()
231
+ {
232
+ delete_transient( LiteSpeed_Cache::WHM_TRANSIENT ) ;
233
+ }
234
+
235
+
236
+ }
inc/api.class.php CHANGED
@@ -3,10 +3,11 @@
3
/**
4
* The plugin API class.
5
*
6
- * @since 1.1.3
7
- * @package LiteSpeed_Cache
8
- * @subpackage LiteSpeed_Cache/includes
9
- * @author LiteSpeed Technologies <info@litespeedtech.com>
10
*/
11
class LiteSpeed_Cache_API
12
{
3
/**
4
* The plugin API class.
5
*
6
+ * @since 1.1.3
7
+ * @since 1.4 Moved into /inc
8
+ * @package LiteSpeed_Cache
9
+ * @subpackage LiteSpeed_Cache/inc
10
+ * @author LiteSpeed Technologies <info@litespeedtech.com>
11
*/
12
class LiteSpeed_Cache_API
13
{
inc/cdn.class.php ADDED
@@ -0,0 +1,451 @@