Version Description
- April 20 2017 =
- [NEW] Added Purge Pages and Purge Recent Posts Widget pages options.
- [NEW] Added wp-cli command for setting and getting options.
- [NEW] Added an import/export options cli command.
- [NEW] Added wpForo integration.
- [NEW] Added Theme My Login integration.
- [UPDATE] Purge adjacent posts when publish a new post.
- [UPDATE] Change environment report file to .php and increase security.
- [UPDATE] Added new purgeby option to wp-cli.
- [UPDATE] Remove nag for multiple sites.
- [UPDATE] Only inject LiteSpeed javascripts in LiteSpeed pages.
- [REFACTOR] Properly check for zero in ttl settings.
- [BUGFIX] Fixed the 404 issue that can be caused by some certain plugins when save the settings.
- [BUGFIX] Fixed mu-plugin compatibility.
- [BUGFIX] Fixed problem with creating zip backup.
- [BUGFIX] Fixed conflict with jetpack.
Download this release
Release Info
Developer | LiteSpeedTech |
Plugin | ![]() |
Version | 1.0.15 |
Comparing to | |
See all releases |
Code changes from version 1.3.1.1 to 1.0.15
- admin/class-litespeed-cache-admin-display.php +2974 -0
- admin/class-litespeed-cache-admin-error.php +368 -0
- admin/class-litespeed-cache-admin-rules.php +1520 -0
- admin/class-litespeed-cache-admin.php +1213 -2
- admin/css/litespeed-cache-admin.css +394 -0
- admin/js/litespeed-cache-admin.js +190 -0
- admin/litespeed-cache-admin-display.class.php +0 -826
- admin/litespeed-cache-admin-error.class.php +0 -262
- admin/litespeed-cache-admin-optimize.class.php +0 -188
- admin/litespeed-cache-admin-report.class.php +0 -197
- admin/litespeed-cache-admin-rules.class.php +0 -854
- admin/litespeed-cache-admin-settings.class.php +0 -975
- admin/litespeed-cache-admin.class.php +0 -276
- admin/tpl/admin_footer.php +0 -19
- admin/tpl/crawler.php +0 -228
- admin/tpl/debug_log.php +0 -27
- admin/tpl/edit_htaccess.php +0 -75
- admin/tpl/esi_widget_edit.php +0 -80
- admin/tpl/help_tabs.php +0 -26
- admin/tpl/info.php +0 -42
- admin/tpl/info_admin_ip.php +0 -33
- admin/tpl/info_common_rewrite.php +0 -58
- admin/tpl/info_compatibility.php +0 -57
- admin/tpl/info_config.php +0 -68
- admin/tpl/info_crawler.php +0 -67
- admin/tpl/info_faqs.php +0 -110
- admin/tpl/manage.php +0 -58
- admin/tpl/manage_db.php +0 -85
- admin/tpl/manage_purge.php +0 -187
- admin/tpl/network_settings.php +0 -59
- admin/tpl/network_settings_cache.php +0 -19
- admin/tpl/network_settings_excludes.php +0 -15
- admin/tpl/network_settings_general.php +0 -34
- admin/tpl/network_settings_purge.php +0 -10
- admin/tpl/report.php +0 -46
- admin/tpl/settings.php +0 -148
- admin/tpl/settings_advanced.php +0 -80
- admin/tpl/settings_cache.php +0 -78
- admin/tpl/settings_cdn.php +0 -104
- admin/tpl/settings_compatibilities.php +0 -38
- admin/tpl/settings_crawler.php +0 -196
- admin/tpl/settings_debug.php +0 -146
- admin/tpl/settings_esi.php +0 -90
- admin/tpl/settings_excludes.php +0 -116
- admin/tpl/settings_general.php +0 -144
- admin/tpl/settings_inc.cache_browser.php +0 -19
- admin/tpl/settings_inc.cache_favicon.php +0 -19
- admin/tpl/settings_inc.cache_mobile.php +0 -70
- admin/tpl/settings_inc.cache_resources.php +0 -20
- admin/tpl/settings_inc.exclude_cookies.php +0 -27
- admin/tpl/settings_inc.exclude_useragent.php +0 -26
- admin/tpl/settings_inc.purge_on_upgrade.php +0 -14
- admin/tpl/settings_optimize.php +0 -182
- admin/tpl/settings_purge.php +0 -95
- admin/tpl/show_display_installed.php +0 -21
- admin/tpl/show_error_cookie.php +0 -13
- admin/tpl/show_rule_conflict.php +0 -13
- cli/class-litespeed-cache-cli-admin.php +328 -0
- cli/class-litespeed-cache-cli-purge.php +316 -0
- cli/litespeed-cache-cli-admin.class.php +0 -363
- cli/litespeed-cache-cli-purge.class.php +0 -302
- css/fonts/litespeedfont.eot +0 -0
- css/fonts/litespeedfont.svg +0 -11
- css/fonts/litespeedfont.ttf +0 -0
- css/fonts/litespeedfont.woff +0 -0
- css/litespeed.css +0 -1180
- img/Litespeed.icon.svg +0 -30
- img/icons/all.svg +0 -65
- img/icons/all_transients.svg +0 -33
- img/icons/auto_draft.svg +0 -54
- img/icons/cross_icon.svg +0 -41
- img/icons/db.svg +0 -21
- img/icons/empty-cache.svg +0 -60
- img/icons/expired_transient.svg +0 -38
- img/icons/optimize_tables.svg +0 -30
- img/icons/purge-403.svg +0 -47
- img/icons/purge-404.svg +0 -41
- img/icons/purge-500.svg +0 -46
- img/icons/purge-all.svg +0 -46
- img/icons/purge-cssjs.svg +0 -50
- img/icons/purge-front.svg +0 -31
- img/icons/purge-pages.svg +0 -41
- img/icons/revision.svg +0 -64
- img/icons/spam_comment.svg +0 -38
- img/icons/success_icon.svg +0 -42
- img/icons/trackback-pingback.svg +0 -30
- img/icons/trash_comment.svg +0 -64
- img/icons/trash_post.svg +0 -48
- inc/data.class.php +0 -177
- includes/class-litespeed-cache-config.php +677 -0
- includes/class-litespeed-cache-tags.php +237 -0
- includes/class-litespeed-cache.php +2630 -0
- includes/deprecated-litespeed-cache-tags.class.php +0 -12
- includes/litespeed-cache-activation.class.php +0 -235
- includes/litespeed-cache-api.class.php +0 -427
- includes/litespeed-cache-cdn.class.php +0 -400
- includes/litespeed-cache-config.class.php +0 -819
- includes/litespeed-cache-control.class.php +0 -610
- includes/litespeed-cache-crawler-sitemap.class.php +0 -155
- includes/litespeed-cache-crawler.class.php +0 -450
- includes/litespeed-cache-esi-dummy.tpl.php +0 -9
- includes/litespeed-cache-esi.class.php +0 -569
- includes/litespeed-cache-esi.tpl.php +0 -9
- includes/litespeed-cache-gui.class.php +0 -116
- includes/litespeed-cache-log.class.php +0 -321
- includes/litespeed-cache-optimize.class.php +0 -1002
- includes/litespeed-cache-purge.class.php +0 -753
- includes/litespeed-cache-router.class.php +0 -397
- includes/litespeed-cache-tag.class.php +0 -367
- includes/litespeed-cache-task.class.php +0 -128
- includes/litespeed-cache-utility.class.php +0 -254
- includes/litespeed-cache-vary.class.php +0 -465
- includes/litespeed-cache.class.php +0 -594
- includes/litespeed.autoload.php +0 -75
- js/css_async.js +0 -4
- js/litespeed-cache-admin.js +0 -385
- languages/litespeed-cache.pot +1176 -2265
- lib/litespeed-php-compatibility.func.php +0 -123
- lib/litespeed/crawler/abstract/sitemap.php +27 -0
- lib/litespeed/crawler/config.php +69 -0
- lib/litespeed/crawler/crawler.php +12 -0
- lib/litespeed/crawler/metadata.php +164 -0
- lib/litespeed/litespeed-crawler.class.php +0 -573
- lib/litespeed/litespeed-file.class.php +0 -402
- lib/litespeed/litespeed-string.class.php +0 -70
- lib/vendor/autoload.php +0 -7
- lib/vendor/bin/cssmin +0 -37
- lib/vendor/composer/ClassLoader.php +0 -445
- lib/vendor/composer/LICENSE +0 -21
- lib/vendor/composer/autoload_classmap.php +0 -59
- lib/vendor/composer/autoload_namespaces.php +0 -12
- lib/vendor/composer/autoload_psr4.php +0 -15
- lib/vendor/composer/autoload_real.php +0 -52
- lib/vendor/composer/autoload_static.php +0 -142
- lib/vendor/container-interop/container-interop/LICENSE +0 -20
- lib/vendor/container-interop/container-interop/src/Interop/Container/ContainerInterface.php +0 -15
- lib/vendor/container-interop/container-interop/src/Interop/Container/Exception/ContainerException.php +0 -15
- lib/vendor/container-interop/container-interop/src/Interop/Container/Exception/NotFoundException.php +0 -15
- lib/vendor/intervention/httpauth/.travis.yml +0 -11
- lib/vendor/intervention/httpauth/LICENSE +0 -9
- lib/vendor/intervention/httpauth/src/Intervention/Httpauth/BasicUser.php +0 -63
- lib/vendor/intervention/httpauth/src/Intervention/Httpauth/DigestUser.php +0 -134
- lib/vendor/intervention/httpauth/src/Intervention/Httpauth/Facades/Httpauth.php +0 -13
- lib/vendor/intervention/httpauth/src/Intervention/Httpauth/Httpauth.php +0 -159
- lib/vendor/intervention/httpauth/src/Intervention/Httpauth/HttpauthServiceProvider.php +0 -82
- lib/vendor/intervention/httpauth/src/Intervention/Httpauth/HttpauthServiceProviderLaravel4.php +0 -30
- lib/vendor/intervention/httpauth/src/Intervention/Httpauth/HttpauthServiceProviderLaravel5.php +0 -37
- lib/vendor/intervention/httpauth/src/Intervention/Httpauth/UserInterface.php +0 -22
- lib/vendor/intervention/httpauth/src/config/config.php +0 -49
- lib/vendor/monolog/monolog/.php_cs +0 -59
- lib/vendor/monolog/monolog/LICENSE +0 -19
- lib/vendor/monolog/monolog/src/Monolog/ErrorHandler.php +0 -230
- lib/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php +0 -78
- lib/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php +0 -89
- lib/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php +0 -116
- lib/vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php +0 -85
- lib/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php +0 -36
- lib/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php +0 -138
- lib/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php +0 -141
- lib/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php +0 -208
- lib/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php +0 -179
- lib/vendor/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php +0 -47
- lib/vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php +0 -166
- lib/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php +0 -105
- lib/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php +0 -297
- lib/vendor/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php +0 -48
- lib/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php +0 -113
- lib/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php +0 -186
- lib/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php +0 -66
- lib/vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php +0 -101
- lib/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php +0 -148
- lib/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php +0 -230
- lib/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php +0 -117
- lib/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php +0 -211
- lib/vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php +0 -72
- lib/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php +0 -151
- lib/vendor/monolog/monolog/src/Monolog/Handler/Curl/Util.php +0 -57
- lib/vendor/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php +0 -169
- lib/vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php +0 -45
- lib/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php +0 -107
- lib/vendor/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php +0 -128
- lib/vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php +0 -82
- lib/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php +0 -140
- lib/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php +0 -28
- lib/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php +0 -59
- lib/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php +0 -34
- lib/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php +0 -163
- lib/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php +0 -195
- lib/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php +0 -126
- lib/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php +0 -127
- lib/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php +0 -73
- lib/vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php +0 -104
- lib/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php +0 -90
- lib/vendor/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php +0 -108
- lib/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php +0 -350
- lib/vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php +0 -69
- lib/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php +0 -55
- lib/vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php +0 -102
- lib/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php +0 -67
- lib/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php +0 -68
- lib/vendor/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php +0 -21
- lib/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php +0 -59
- lib/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php +0 -185
- lib/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php +0 -202
- lib/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php +0 -45
- lib/vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php +0 -242
- lib/vendor/monolog/monolog/src/Monolog/Handler/PsrHandler.php +0 -56
- lib/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php +0 -185
- lib/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php +0 -232
- lib/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php +0 -97
- lib/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php +0 -132
- lib/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php +0 -178
- lib/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php +0 -82
- lib/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php +0 -294
- lib/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php +0 -215
- lib/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php +0 -115
- lib/vendor/monolog/monolog/src/Monolog/Handler/SlackbotHandler.php +0 -80
- lib/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php +0 -346
- lib/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php +0 -176
- lib/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php +0 -99
- lib/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php +0 -67
- lib/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php +0 -56
- lib/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php +0 -103
- lib/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php +0 -154
- lib/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php +0 -61
- lib/vendor/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php +0 -95
- lib/vendor/monolog/monolog/src/Monolog/Logger.php +0 -700
- lib/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php +0 -64
- lib/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php +0 -112
- lib/vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php +0 -35
- lib/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php +0 -63
- lib/vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php +0 -35
- lib/vendor/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php +0 -63
- lib/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php +0 -31
- lib/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php +0 -48
- lib/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php +0 -44
- lib/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php +0 -46
- lib/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php +0 -113
- lib/vendor/monolog/monolog/src/Monolog/Registry.php +0 -134
- lib/vendor/mrclay/jsmin-php/.editorconfig +0 -19
- lib/vendor/mrclay/jsmin-php/HISTORY.txt +0 -24
- lib/vendor/mrclay/jsmin-php/LICENSE.txt +0 -26
- lib/vendor/mrclay/jsmin-php/src/JSMin/JSMin.php +0 -454
- lib/vendor/mrclay/jsmin-php/src/JSMin/UnterminatedCommentException.php +0 -6
- lib/vendor/mrclay/jsmin-php/src/JSMin/UnterminatedRegExpException.php +0 -6
- lib/vendor/mrclay/jsmin-php/src/JSMin/UnterminatedStringException.php +0 -6
- lib/vendor/mrclay/minify/.htaccess +0 -13
- lib/vendor/mrclay/minify/.php_cs +0 -27
- lib/vendor/mrclay/minify/.travis.yml +0 -37
- lib/vendor/mrclay/minify/LICENSE.txt +0 -26
- lib/vendor/mrclay/minify/bootstrap.php +0 -25
- lib/vendor/mrclay/minify/config-test.php +0 -10
- lib/vendor/mrclay/minify/config.php +0 -201
- lib/vendor/mrclay/minify/groupsConfig.php +0 -19
- lib/vendor/mrclay/minify/lib/HTTP/ConditionalGet.php +0 -376
- lib/vendor/mrclay/minify/lib/HTTP/Encoder.php +0 -335
- lib/vendor/mrclay/minify/lib/Minify.php +0 -761
- lib/vendor/mrclay/minify/lib/Minify/App.php +0 -282
- lib/vendor/mrclay/minify/lib/Minify/Build.php +0 -102
- lib/vendor/mrclay/minify/lib/Minify/CSS.php +0 -98
- lib/vendor/mrclay/minify/lib/Minify/CSS/Compressor.php +0 -275
- lib/vendor/mrclay/minify/lib/Minify/CSS/UriRewriter.php +0 -358
- lib/vendor/mrclay/minify/lib/Minify/CSSmin.php +0 -88
- lib/vendor/mrclay/minify/lib/Minify/Cache/APC.php +0 -136
- lib/vendor/mrclay/minify/lib/Minify/Cache/File.php +0 -183
- lib/vendor/mrclay/minify/lib/Minify/Cache/Memcache.php +0 -141
- lib/vendor/mrclay/minify/lib/Minify/Cache/Null.php +0 -67
- lib/vendor/mrclay/minify/lib/Minify/Cache/WinCache.php +0 -139
- lib/vendor/mrclay/minify/lib/Minify/Cache/XCache.php +0 -130
- lib/vendor/mrclay/minify/lib/Minify/Cache/ZendPlatform.php +0 -129
- lib/vendor/mrclay/minify/lib/Minify/CacheInterface.php +0 -58
- lib/vendor/mrclay/minify/lib/Minify/ClosureCompiler.php +0 -240
- lib/vendor/mrclay/minify/lib/Minify/CommentPreserver.php +0 -87
- lib/vendor/mrclay/minify/lib/Minify/Config.php +0 -78
- lib/vendor/mrclay/minify/lib/Minify/Controller/Base.php +0 -81
- lib/vendor/mrclay/minify/lib/Minify/Controller/Files.php +0 -71
- lib/vendor/mrclay/minify/lib/Minify/Controller/Groups.php +0 -76
- lib/vendor/mrclay/minify/lib/Minify/Controller/MinApp.php +0 -196
- lib/vendor/mrclay/minify/lib/Minify/Controller/Page.php +0 -69
- lib/vendor/mrclay/minify/lib/Minify/ControllerInterface.php +0 -22
- lib/vendor/mrclay/minify/lib/Minify/DebugDetector.php +0 -30
- lib/vendor/mrclay/minify/lib/Minify/Env.php +0 -127
- lib/vendor/mrclay/minify/lib/Minify/HTML.php +0 -258
- lib/vendor/mrclay/minify/lib/Minify/HTML/Helper.php +0 -250
- lib/vendor/mrclay/minify/lib/Minify/ImportProcessor.php +0 -217
- lib/vendor/mrclay/minify/lib/Minify/JS/ClosureCompiler.php +0 -234
- lib/vendor/mrclay/minify/lib/Minify/JS/JShrink.php +0 -48
- lib/vendor/mrclay/minify/lib/Minify/LessCssSource.php +0 -128
- lib/vendor/mrclay/minify/lib/Minify/Lines.php +0 -209
- lib/vendor/mrclay/minify/lib/Minify/Logger/LegacyHandler.php +0 -24
- lib/vendor/mrclay/minify/lib/Minify/NailgunClosureCompiler.php +0 -113
- lib/vendor/mrclay/minify/lib/Minify/Packer.php +0 -31
- lib/vendor/mrclay/minify/lib/Minify/ScssCssSource.php +0 -176
- lib/vendor/mrclay/minify/lib/Minify/ServeConfiguration.php +0 -71
- lib/vendor/mrclay/minify/lib/Minify/Source.php +0 -214
- lib/vendor/mrclay/minify/lib/Minify/Source/Factory.php +0 -197
- lib/vendor/mrclay/minify/lib/Minify/Source/FactoryException.php +0 -5
- lib/vendor/mrclay/minify/lib/Minify/SourceInterface.php +0 -82
- lib/vendor/mrclay/minify/lib/Minify/SourceSet.php +0 -31
- lib/vendor/mrclay/minify/lib/Minify/YUICompressor.php +0 -157
- lib/vendor/mrclay/minify/lib/MrClay/Cli.php +0 -393
- lib/vendor/mrclay/minify/lib/MrClay/Cli/Arg.php +0 -189
- lib/vendor/mrclay/minify/static/.htaccess +0 -40
- lib/vendor/mrclay/minify/static/gen.php +0 -127
- lib/vendor/mrclay/minify/static/lib.php +0 -68
- lib/vendor/mrclay/minify/utils.php +0 -78
- lib/vendor/mrclay/props-dic/.travis.yml +0 -30
- lib/vendor/mrclay/props-dic/LICENSE +0 -19
- lib/vendor/mrclay/props-dic/src/Props/BadMethodCallException.php +0 -9
- lib/vendor/mrclay/props-dic/src/Props/Container.php +0 -249
- lib/vendor/mrclay/props-dic/src/Props/FactoryUncallableException.php +0 -9
- lib/vendor/mrclay/props-dic/src/Props/NotFoundException.php +0 -9
- lib/vendor/mrclay/props-dic/src/Props/Pimple.php +0 -56
- lib/vendor/mrclay/props-dic/src/Props/ValueUnresolvableException.php +0 -9
- lib/vendor/pimple/pimple/.travis.yml +0 -40
- lib/vendor/pimple/pimple/LICENSE +0 -19
- lib/vendor/pimple/pimple/ext/pimple/config.m4 +0 -63
- lib/vendor/pimple/pimple/ext/pimple/config.w32 +0 -13
- lib/vendor/pimple/pimple/ext/pimple/php_pimple.h +0 -137
- lib/vendor/pimple/pimple/ext/pimple/pimple.c +0 -1114
- lib/vendor/pimple/pimple/ext/pimple/pimple_compat.h +0 -81
- lib/vendor/pimple/pimple/src/Pimple/Container.php +0 -298
- lib/vendor/pimple/pimple/src/Pimple/Exception/ExpectedInvokableException.php +0 -38
- lib/vendor/pimple/pimple/src/Pimple/Exception/FrozenServiceException.php +0 -45
- lib/vendor/pimple/pimple/src/Pimple/Exception/InvalidServiceIdentifierException.php +0 -45
- lib/vendor/pimple/pimple/src/Pimple/Exception/UnknownIdentifierException.php +0 -45
- lib/vendor/pimple/pimple/src/Pimple/Psr11/Container.php +0 -55
- lib/vendor/pimple/pimple/src/Pimple/Psr11/ServiceLocator.php +0 -75
- lib/vendor/pimple/pimple/src/Pimple/ServiceIterator.php +0 -69
- lib/vendor/pimple/pimple/src/Pimple/ServiceProviderInterface.php +0 -46
- lib/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/Invokable.php +0 -38
- lib/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/NonInvokable.php +0 -34
- lib/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/PimpleServiceProvider.php +0 -54
- lib/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/Service.php +0 -35
- lib/vendor/pimple/pimple/src/Pimple/Tests/PimpleServiceProviderInterfaceTest.php +0 -76
- lib/vendor/pimple/pimple/src/Pimple/Tests/PimpleTest.php +0 -589
- lib/vendor/pimple/pimple/src/Pimple/Tests/Psr11/ContainerTest.php +0 -77
- lib/vendor/pimple/pimple/src/Pimple/Tests/Psr11/ServiceLocatorTest.php +0 -134
- lib/vendor/pimple/pimple/src/Pimple/Tests/ServiceIteratorTest.php +0 -52
- lib/vendor/psr/container/LICENSE +0 -21
- lib/vendor/psr/container/src/ContainerExceptionInterface.php +0 -13
- lib/vendor/psr/container/src/ContainerInterface.php +0 -37
- lib/vendor/psr/container/src/NotFoundExceptionInterface.php +0 -13
- lib/vendor/psr/log/LICENSE +0 -19
- lib/vendor/psr/log/Psr/Log/AbstractLogger.php +0 -128
- lib/vendor/psr/log/Psr/Log/InvalidArgumentException.php +0 -7
- lib/vendor/psr/log/Psr/Log/LogLevel.php +0 -18
- lib/vendor/psr/log/Psr/Log/LoggerAwareInterface.php +0 -18
- lib/vendor/psr/log/Psr/Log/LoggerAwareTrait.php +0 -26
- lib/vendor/psr/log/Psr/Log/LoggerInterface.php +0 -123
- lib/vendor/psr/log/Psr/Log/LoggerTrait.php +0 -140
- lib/vendor/psr/log/Psr/Log/NullLogger.php +0 -28
- lib/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php +0 -140
- lib/vendor/tubalmartin/cssmin/cssmin +0 -37
- lib/vendor/tubalmartin/cssmin/gui/scripts.js +0 -104
- lib/vendor/tubalmartin/cssmin/gui/styles.css +0 -68
- lib/vendor/tubalmartin/cssmin/gui/third-party/bootstrap/css/bootstrap.min.css +0 -339
- lib/vendor/tubalmartin/cssmin/gui/third-party/bootstrap/js/bootstrap.min.js +0 -7
- lib/vendor/tubalmartin/cssmin/gui/third-party/jquery-1.12.4.min.js +0 -5
- lib/vendor/tubalmartin/cssmin/gui/third-party/less-1.7.5.min.js +0 -16
- lib/vendor/tubalmartin/cssmin/src/Colors.php +0 -155
- lib/vendor/tubalmartin/cssmin/src/Command.php +0 -223
- lib/vendor/tubalmartin/cssmin/src/Minifier.php +0 -862
- lib/vendor/tubalmartin/cssmin/src/Utils.php +0 -149
- litespeed-cache.php +59 -81
- readme.txt +200 -306
- thirdparty/README.html +230 -0
- thirdparty/README.md +232 -0
- thirdparty/class-litespeed-cache-thirdparty-aelia-currencyswitcher.php +108 -0
- thirdparty/{lscwp-3rd-autoptimize.cls.php → class-litespeed-cache-thirdparty-autoptimize.php} +13 -8
- thirdparty/class-litespeed-cache-thirdparty-bbpress.php +56 -0
- thirdparty/{lscwp-3rd-betterwp-minify.cls.php → class-litespeed-cache-thirdparty-betterwp-minify.php} +24 -12
- thirdparty/{lscwp-3rd-like-dislike-counter.cls.php → class-litespeed-cache-thirdparty-like-dislike-counter.php} +21 -18
- thirdparty/{lscwp-3rd-nextgengallery.cls.php → class-litespeed-cache-thirdparty-nextgengallery.php} +57 -60
- thirdparty/class-litespeed-cache-thirdparty-plugin.php-template +122 -0
- thirdparty/class-litespeed-cache-thirdparty-theme-my-login.php +56 -0
- thirdparty/class-litespeed-cache-thirdparty-woocommerce.php +470 -0
- thirdparty/class-litespeed-cache-thirdparty-wp-polls.php +30 -0
- thirdparty/class-litespeed-cache-thirdparty-wpforo.php +151 -0
- thirdparty/class-litespeed-cache-thirdparty-wptouch.php +53 -0
- thirdparty/litespeed-cache-thirdparty-registry.php +34 -0
- thirdparty/lscwp-3rd-aelia-currencyswitcher.cls.php +0 -89
- thirdparty/lscwp-3rd-avada.cls.php +0 -46
- thirdparty/lscwp-3rd-bbpress.cls.php +0 -87
- thirdparty/lscwp-3rd-theme-my-login.cls.php +0 -50
- thirdparty/lscwp-3rd-woocommerce.cls.php +0 -732
- thirdparty/lscwp-3rd-wp-polls.cls.php +0 -24
- thirdparty/lscwp-3rd-wp-postratings.cls.php +0 -43
- thirdparty/lscwp-3rd-wpforo.cls.php +0 -157
- thirdparty/lscwp-3rd-wplister.cls.php +0 -34
- thirdparty/lscwp-3rd-wptouch.cls.php +0 -47
- thirdparty/lscwp-3rd-yith-wishlist.cls.php +0 -113
- thirdparty/lscwp-registry-3rd.php +0 -37
admin/class-litespeed-cache-admin-display.php
ADDED
@@ -0,0 +1,2974 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
4 |
+
* The admin-panel specific functionality of the plugin.
|
5 |
+
*
|
6 |
+
*
|
7 |
+
* @since 1.0.0
|
8 |
+
* @package LiteSpeed_Cache
|
9 |
+
* @subpackage LiteSpeed_Cache/admin
|
10 |
+
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
11 |
+
*/
|
12 |
+
class LiteSpeed_Cache_Admin_Display
|
13 |
+
{
|
14 |
+
private static $instance;
|
15 |
+
|
16 |
+
const NOTICE_BLUE = 'notice notice-info';
|
17 |
+
const NOTICE_GREEN = 'notice notice-success';
|
18 |
+
const NOTICE_RED = 'notice notice-error';
|
19 |
+
const NOTICE_YELLOW = 'notice notice-warning';
|
20 |
+
|
21 |
+
const PURGEBY_CAT = '0';
|
22 |
+
const PURGEBY_PID = '1';
|
23 |
+
const PURGEBY_TAG = '2';
|
24 |
+
const PURGEBY_URL = '3';
|
25 |
+
|
26 |
+
const PURGEBYOPT_SELECT = 'purgeby';
|
27 |
+
const PURGEBYOPT_LIST = 'purgebylist';
|
28 |
+
|
29 |
+
private $notices = array();
|
30 |
+
private $disable_all = false;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Initialize the class and set its properties.
|
34 |
+
*
|
35 |
+
* @since 1.0.7
|
36 |
+
* @access private
|
37 |
+
*/
|
38 |
+
private function __construct()
|
39 |
+
{
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Get the LiteSpeed_Cache_Admin_Display object.
|
44 |
+
*
|
45 |
+
* @since 1.0.7
|
46 |
+
* @access public
|
47 |
+
* @return LiteSpeed_Cache_Admin_Display Static instance of the
|
48 |
+
* LiteSpeed_Cache_Admin_Display class.
|
49 |
+
*/
|
50 |
+
public static function get_instance()
|
51 |
+
{
|
52 |
+
if (!isset(self::$instance)) {
|
53 |
+
self::$instance = new LiteSpeed_Cache_Admin_Display();
|
54 |
+
}
|
55 |
+
|
56 |
+
return self::$instance;
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Change the admin footer text on LiteSpeed Cache admin pages.
|
61 |
+
*
|
62 |
+
* @since 1.0.13
|
63 |
+
* @param string $footer_text
|
64 |
+
* @return string
|
65 |
+
*/
|
66 |
+
public function admin_footer_text($footer_text)
|
67 |
+
{
|
68 |
+
$rate_us = sprintf(wp_kses(
|
69 |
+
__('Rate <strong>LiteSpeed Cache</strong> with %s on WordPress.org if you like us!', 'litespeed-cache'),
|
70 |
+
array('strong' => array())
|
71 |
+
),
|
72 |
+
'<a href="https://wordpress.org/support/plugin/litespeed-cache/reviews/?filter=5#new-post" '
|
73 |
+
. 'rel="noopener noreferer" target="_blank">✮✮✮✮✮</a>'
|
74 |
+
);
|
75 |
+
$questions = sprintf(wp_kses(
|
76 |
+
__('If there are any questions that are not answered in the <a href="%s">FAQs</a>, do not hesitate to ask them on the <a href="%s" rel="%s" target="%s">support forum</a>.',
|
77 |
+
'litespeed-cache'),
|
78 |
+
array(
|
79 |
+
'a' => array(
|
80 |
+
'href' => array(),
|
81 |
+
'rel' => array(),
|
82 |
+
'target' => array(),
|
83 |
+
),
|
84 |
+
)),
|
85 |
+
get_admin_url() . 'admin.php?page=lscache-info',
|
86 |
+
'https://wordpress.org/support/plugin/litespeed-cache',
|
87 |
+
'noopener noreferrer', '_blank'
|
88 |
+
);
|
89 |
+
// Change the footer text
|
90 |
+
if (!is_multisite() || is_network_admin()){
|
91 |
+
$footer_text = self::build_paragraph($rate_us, $questions);
|
92 |
+
}else{
|
93 |
+
$footer_text = self::build_paragraph($questions);
|
94 |
+
}
|
95 |
+
|
96 |
+
return $footer_text;
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Whether to disable all settings or not.
|
101 |
+
*
|
102 |
+
* Currently used for 'use primary subsite settings'
|
103 |
+
*
|
104 |
+
* @since 1.0.13
|
105 |
+
* @access public
|
106 |
+
* @return bool True to disable all settings, false otherwise.
|
107 |
+
*/
|
108 |
+
public function get_disable_all()
|
109 |
+
{
|
110 |
+
return $this->disable_all;
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Set to disable all settings.
|
115 |
+
*
|
116 |
+
* @since 1.0.13
|
117 |
+
* @access public
|
118 |
+
*/
|
119 |
+
public function set_disable_all()
|
120 |
+
{
|
121 |
+
$this->disable_all = true;
|
122 |
+
}
|
123 |
+
|
124 |
+
/**
|
125 |
+
* Displays the help tab in the admin pages.
|
126 |
+
*
|
127 |
+
* @since 1.0.0
|
128 |
+
* @access public
|
129 |
+
*/
|
130 |
+
public function add_help_tabs()
|
131 |
+
{
|
132 |
+
$content_para = self::build_paragraph(
|
133 |
+
__('LiteSpeed Cache is a page cache built into LiteSpeed Web Server.', 'litespeed-cache'),
|
134 |
+
__('This plugin communicates with LiteSpeed Web Server to let it know which pages are cache-able and when to purge them.', 'litespeed-cache')
|
135 |
+
);
|
136 |
+
|
137 |
+
$screen = get_current_screen();
|
138 |
+
$screen->add_help_tab(array(
|
139 |
+
'id' => 'lsc-overview',
|
140 |
+
'title' => __('Overview', 'litespeed-cache'),
|
141 |
+
'content' => '<p>' . $content_para . '</p><p>'
|
142 |
+
. __('A LiteSpeed server (OLS, LSWS, WebADC) and its LSCache module must be installed and enabled.', 'litespeed-cache')
|
143 |
+
. '</p>',
|
144 |
+
));
|
145 |
+
|
146 |
+
// $screen->add_help_tab(array(
|
147 |
+
// 'id' => 'lst-purgerules',
|
148 |
+
// 'title' => __('Auto Purge Rules', 'litespeed-cache'),
|
149 |
+
// 'content' => '<p>' . __('You can set what pages will be purged when a post is published or updated.', 'litespeed-cache') . '</p>',
|
150 |
+
// ));
|
151 |
+
|
152 |
+
$screen->set_help_sidebar(
|
153 |
+
'<p><strong>' . __('For more information:', 'litespeed-cache') . '</strong></p>' .
|
154 |
+
// '<p><a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache" rel="noopener noreferrer" target="_blank">' . __('LSCache Documentation', 'litespeed-cache') . '</a></p>' .
|
155 |
+
'<p><a href="https://wordpress.org/support/plugin/litespeed-cache" rel="noopener noreferrer" target="_blank">' . __('Support Forum', 'litespeed-cache') . '</a></p>'
|
156 |
+
);
|
157 |
+
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* Check to make sure that caching is enabled.
|
161 |
+
*
|
162 |
+
* @since 1.0.0
|
163 |
+
* @access public
|
164 |
+
* @param LiteSpeed_Cache_Config $config The current configurations object.
|
165 |
+
* @return mixed True if enabled, error message otherwise.
|
166 |
+
*/
|
167 |
+
public function check_license($config)
|
168 |
+
{
|
169 |
+
if ($config->is_caching_allowed() == false) {
|
170 |
+
$sentences = LiteSpeed_Cache_Admin_Error::get_error(
|
171 |
+
LiteSpeed_Cache_Admin_Error::E_SERVER
|
172 |
+
);
|
173 |
+
|
174 |
+
return $sentences;
|
175 |
+
}
|
176 |
+
|
177 |
+
return true;
|
178 |
+
}
|
179 |
+
|
180 |
+
/**
|
181 |
+
* Helper function to build paragraphs out of all the string sentences
|
182 |
+
* passed in.
|
183 |
+
*
|
184 |
+
* @since 1.0.11
|
185 |
+
* @access public
|
186 |
+
* @param string $args,... Variable number of strings to combine to a paragraph.
|
187 |
+
* @return string The built paragraph.
|
188 |
+
*/
|
189 |
+
public static function build_paragraph()
|
190 |
+
{
|
191 |
+
$args = func_get_args();
|
192 |
+
$para = implode(' ', $args);
|
193 |
+
return $para;
|
194 |
+
}
|
195 |
+
|
196 |
+
/**
|
197 |
+
* Helper function to build a list out of an array of strings.
|
198 |
+
*
|
199 |
+
* @since 1.0.14
|
200 |
+
* @access public
|
201 |
+
* @param array $items The list of strings to build into a list.
|
202 |
+
* @param bool $ordered Whether to make it an ordered or unordered list.
|
203 |
+
* @param string $style Any styling to apply to the list.
|
204 |
+
* @return string The built list.
|
205 |
+
*/
|
206 |
+
public static function build_list($items, $ordered = false, $style = '')
|
207 |
+
{
|
208 |
+
$buf = '<';
|
209 |
+
if ($ordered) {
|
210 |
+
$type = 'ol';
|
211 |
+
}
|
212 |
+
else {
|
213 |
+
$type = 'ul';
|
214 |
+
}
|
215 |
+
$buf .= $type;
|
216 |
+
if ($style) {
|
217 |
+
$buf .= ' style="' . $style . '"';
|
218 |
+
}
|
219 |
+
$buf .= '><li>';
|
220 |
+
$buf .= implode('</li><li>', $items);
|
221 |
+
$buf .= '</li></' . $type . '>';
|
222 |
+
return $buf;
|
223 |
+
}
|
224 |
+
|
225 |
+
/**
|
226 |
+
* Builds the html for a single notice.
|
227 |
+
*
|
228 |
+
* @since 1.0.7
|
229 |
+
* @access private
|
230 |
+
* @param string $color The color to use for the notice.
|
231 |
+
* @param string $str The notice message.
|
232 |
+
* @return string The built notice html.
|
233 |
+
*/
|
234 |
+
private static function build_notice($color, $str)
|
235 |
+
{
|
236 |
+
return '<div class="' . $color . ' is-dismissible"><p>'
|
237 |
+
. $str . '</p></div>';
|
238 |
+
}
|
239 |
+
|
240 |
+
/**
|
241 |
+
* Builds the html for a tooltip text.
|
242 |
+
*
|
243 |
+
* @since 1.0.14
|
244 |
+
* @access private
|
245 |
+
* @param string $msg Text that needs to be displayed in tooltip
|
246 |
+
* @param string $class_suffix Class name for the tooltip
|
247 |
+
* @param string $field_style Extra styles if required for outer span
|
248 |
+
* @param string $tip_style Extra styles if required for inner span
|
249 |
+
* @return string tooltip message.
|
250 |
+
*/
|
251 |
+
private static function build_tip($msg, $class_suffix = '',
|
252 |
+
$field_style = '', $tip_style = '')
|
253 |
+
{
|
254 |
+
$buf = '<span class="litespeed-cache-field-tip';
|
255 |
+
if (!empty($class_suffix)) {
|
256 |
+
$buf .= $class_suffix;
|
257 |
+
}
|
258 |
+
if (!empty($field_style)) {
|
259 |
+
$buf .= '" style="' . $field_style;
|
260 |
+
}
|
261 |
+
$buf .= '"><span class="litespeed-cache-tip-content';
|
262 |
+
if (!empty($class_suffix)) {
|
263 |
+
$buf .= $class_suffix;
|
264 |
+
}
|
265 |
+
if (!empty($tip_style)) {
|
266 |
+
$buf .= '" style="' . $tip_style;
|
267 |
+
}
|
268 |
+
|
269 |
+
$buf .= '">' . $msg . '</span></span>';
|
270 |
+
|
271 |
+
return $buf;
|
272 |
+
}
|
273 |
+
|
274 |
+
/**
|
275 |
+
* Builds the html for buttons that depend on rtl/ltr orientation.
|
276 |
+
*
|
277 |
+
* @since 1.0.14
|
278 |
+
* @access private
|
279 |
+
* @param string $class_suffix The class name used for the button
|
280 |
+
* @param string $button_text The text used for the button
|
281 |
+
* @param string $notice The notice message to be display after button
|
282 |
+
* click
|
283 |
+
* @param boolean $extra_br Optional if extra br is required to adjust the
|
284 |
+
* layout.
|
285 |
+
* @return string button text.
|
286 |
+
*/
|
287 |
+
private static function build_button($class_suffix, $button_text = '',
|
288 |
+
$notice = '', $extra_br = true)
|
289 |
+
{
|
290 |
+
$buf = '<span class="' . $class_suffix . '"';
|
291 |
+
|
292 |
+
if (!is_rtl()) {
|
293 |
+
$buf .= ' style="float:left;"';
|
294 |
+
}
|
295 |
+
|
296 |
+
$buf .= '>' . $button_text . '</span>';
|
297 |
+
|
298 |
+
if (!empty($notice)) {
|
299 |
+
$buf .= '<span class="copy-select-all-span" style="display:none; font-size:11px; font-style:italic;margin-left:10px; position:relative; top:3px; color: green;">'
|
300 |
+
. $notice . '</span>';
|
301 |
+
}
|
302 |
+
|
303 |
+
$buf .= '<br>';
|
304 |
+
|
305 |
+
if ($extra_br) {
|
306 |
+
$buf .= '<br>';
|
307 |
+
}
|
308 |
+
|
309 |
+
return $buf;
|
310 |
+
}
|
311 |
+
|
312 |
+
/**
|
313 |
+
* Builds the html for the expand/collapse all button.
|
314 |
+
*
|
315 |
+
* @since 1.0.14
|
316 |
+
* @access private
|
317 |
+
* @param boolean $br Whether to include an extra br tag at the end or not.
|
318 |
+
* @return string The built button html.
|
319 |
+
*/
|
320 |
+
private static function build_expand_collapse($extra_br = true)
|
321 |
+
{
|
322 |
+
$buf = self::build_button('litespeed-cache-jquery-button', '', '', $extra_br);
|
323 |
+
|
324 |
+
$buf .= self::get_instance()->input_field_hidden('litespeed-cache-jquery-button-expand-val', __("Expand All", "litespeed-cache"))
|
325 |
+
. self::get_instance()->input_field_hidden('litespeed-cache-jquery-button-collapse-val', __("Collapse All", "litespeed-cache"));
|
326 |
+
|
327 |
+
|
328 |
+
return $buf;
|
329 |
+
}
|
330 |
+
|
331 |
+
/**
|
332 |
+
* Adds a notice to display on the admin page. Multiple messages of the
|
333 |
+
* same color may be added in a single call. If the list is empty, this
|
334 |
+
* method will add the action to display notices.
|
335 |
+
*
|
336 |
+
* @since 1.0.7
|
337 |
+
* @access public
|
338 |
+
* @param string $color One of the available constants provided by this
|
339 |
+
* class.
|
340 |
+
* @param mixed $msg May be a string for a single message or an array for
|
341 |
+
* multiple.
|
342 |
+
*/
|
343 |
+
public function add_notice($color, $msg)
|
344 |
+
{
|
345 |
+
if (empty($this->notices)) {
|
346 |
+
add_action(
|
347 |
+
(is_network_admin() ? 'network_admin_notices' : 'admin_notices'),
|
348 |
+
array($this, 'display_notices'));
|
349 |
+
}
|
350 |
+
if (!is_array($msg)) {
|
351 |
+
$this->notices[] = self::build_notice($color, $msg);
|
352 |
+
|
353 |
+
return;
|
354 |
+
}
|
355 |
+
foreach ($msg as $str) {
|
356 |
+
$this->notices[] = self::build_notice($color, $str);
|
357 |
+
}
|
358 |
+
}
|
359 |
+
|
360 |
+
/**
|
361 |
+
* Callback function to display any notices from editing cache settings.
|
362 |
+
*
|
363 |
+
* @since 1.0.7
|
364 |
+
* @access public
|
365 |
+
*/
|
366 |
+
public function display_notices()
|
367 |
+
{
|
368 |
+
foreach ($this->notices as $msg) {
|
369 |
+
echo $msg;
|
370 |
+
}
|
371 |
+
}
|
372 |
+
|
373 |
+
/**
|
374 |
+
* add_submenu_page callback to determine which submenu page to display
|
375 |
+
* if the admin selected a LiteSpeed Cache dashboard page.
|
376 |
+
*
|
377 |
+
* @since 1.0.4
|
378 |
+
*/
|
379 |
+
public function show_menu_select()
|
380 |
+
{
|
381 |
+
$page = $_REQUEST['page'];
|
382 |
+
if (strncmp($page, 'lscache-', 8) != 0) {
|
383 |
+
// either I messed up writing the slug, or someone entered this function elsewhere.
|
384 |
+
die();
|
385 |
+
}
|
386 |
+
$selection = substr($page, 8);
|
387 |
+
$selection_len = strlen($selection);
|
388 |
+
add_filter('admin_footer_text', array($this, 'admin_footer_text'), 1);
|
389 |
+
|
390 |
+
//install, faqs
|
391 |
+
switch ($selection[0]) {
|
392 |
+
case 'd':
|
393 |
+
if (($selection_len == 4)
|
394 |
+
&& (strncmp($selection, 'dash', $selection_len) == 0)
|
395 |
+
) {
|
396 |
+
$this->show_menu_manage();
|
397 |
+
}
|
398 |
+
break;
|
399 |
+
case 'i':
|
400 |
+
if (($selection_len == 4)
|
401 |
+
&& (strncmp($selection, 'info', $selection_len) == 0)
|
402 |
+
) {
|
403 |
+
$this->show_menu_info();
|
404 |
+
}
|
405 |
+
break;
|
406 |
+
case 's':
|
407 |
+
if (($selection_len == 8)
|
408 |
+
&& (strncmp($selection, 'settings', $selection_len) == 0)
|
409 |
+
) {
|
410 |
+
if (is_network_admin()) {
|
411 |
+
$this->show_menu_network_settings();
|
412 |
+
}
|
413 |
+
else {
|
414 |
+
settings_errors();
|
415 |
+
$this->show_menu_settings();
|
416 |
+
}
|
417 |
+
}
|
418 |
+
break;
|
419 |
+
case 'e':
|
420 |
+
if (($selection_len == 13)
|
421 |
+
&& (strncmp($selection, 'edit-htaccess', $selection_len) == 0)
|
422 |
+
) {
|
423 |
+
$this->show_menu_edit_htaccess();
|
424 |
+
}
|
425 |
+
break;
|
426 |
+
case 'r':
|
427 |
+
if (($selection_len == 6)
|
428 |
+
&& (strncmp($selection, 'report', $selection_len) == 0)
|
429 |
+
) {
|
430 |
+
$this->show_menu_report();
|
431 |
+
}
|
432 |
+
break;
|
433 |
+
default:
|
434 |
+
break;
|
435 |
+
}
|
436 |
+
}
|
437 |
+
|
438 |
+
/**
|
439 |
+
* Displays the cache management page.
|
440 |
+
*
|
441 |
+
* @since 1.0.0
|
442 |
+
* @access public
|
443 |
+
*/
|
444 |
+
public function show_menu_manage()
|
445 |
+
{
|
446 |
+
$config = LiteSpeed_Cache::config();
|
447 |
+
$intro_sentences =
|
448 |
+
__('From this screen, one can inform the server to purge the selected cached pages or empty the entire cache.', 'litespeed-cache');
|
449 |
+
$purgeall_confirm_para = self::build_paragraph(
|
450 |
+
__('This will purge everything for all blogs.', 'litespeed-cache'),
|
451 |
+
__('Are you sure you want to purge all?', 'litespeed-cache')
|
452 |
+
);
|
453 |
+
$purgeby_desc_para = self::build_paragraph(
|
454 |
+
__('Select dropdown below for "Purge by" options.', 'litespeed-cache'),
|
455 |
+
__('Please enter one per line.', 'litespeed-cache')
|
456 |
+
);
|
457 |
+
$clearcache_confirm_para = self::build_paragraph(
|
458 |
+
__('This will clear EVERYTHING inside the cache.', 'litespeed-cache'),
|
459 |
+
__('This may cause heavy load on the server.', 'litespeed-cache'),
|
460 |
+
__('If only the WordPress site should be purged, use purge all.', 'litespeed-cache')
|
461 |
+
);
|
462 |
+
$clearcache_desc_para = self::build_paragraph(
|
463 |
+
wp_kses(__('Clears all cache entries related to this site, <i>including other web applications</i>.', 'litespeed-cache'),
|
464 |
+
array('i' => array())),
|
465 |
+
wp_kses(__('<b>This action should only be used if things are cached incorrectly.</b>', 'litespeed-cache'),
|
466 |
+
array('b' => array()))
|
467 |
+
);
|
468 |
+
|
469 |
+
$purgeby_cat_desc =
|
470 |
+
sprintf(__('Purge pages by category name - e.g. %2$s should be used for the URL %1$s.', "litespeed-cache"),
|
471 |
+
'http://example.com/category/category-name/', 'category-name');
|
472 |
+
|
473 |
+
$purgeby_url_desc = self::build_paragraph(
|
474 |
+
__('Purge pages by relative URL.', 'litespeed-cache'),
|
475 |
+
__('Must be exact match.', 'litespeed-cache'),
|
476 |
+
sprintf(__('e.g. Use %s for %s.', 'litespeed-cache'),
|
477 |
+
'<b><u>/2016/02/24/hello-world/</u></b>',
|
478 |
+
'http://www.myexamplesite.com<b><u>/2016/02/24/hello-world/</u></b>'
|
479 |
+
));
|
480 |
+
|
481 |
+
$purgeby_tag_desc =
|
482 |
+
sprintf(__('Purge pages by tag name - e.g. %2$s should be used for the URL %1$s.', "litespeed-cache"),
|
483 |
+
'http://example.com/tag/tag-name/', 'tag-name');
|
484 |
+
|
485 |
+
if (($error_msg = $this->check_license($config)) !== true) {
|
486 |
+
echo '<div class="error"><p>' . $error_msg . '</p></div>' . "\n";
|
487 |
+
}
|
488 |
+
|
489 |
+
$purgeby_options = array(
|
490 |
+
__('Category', 'litespeed-cache'),
|
491 |
+
__('Post ID', 'litespeed-cache'),
|
492 |
+
__('Tag', 'litespeed-cache'),
|
493 |
+
__('URL', 'litespeed-cache'),
|
494 |
+
);
|
495 |
+
|
496 |
+
// Page intro
|
497 |
+
$buf = '<div class="wrap"><h2>'
|
498 |
+
. __('LiteSpeed Cache Management', 'litespeed-cache') . '</h2>'
|
499 |
+
. '<div class="litespeed-cache-welcome-panel"><p>'
|
500 |
+
. $intro_sentences . '</p>';
|
501 |
+
|
502 |
+
// Begin form
|
503 |
+
$buf .= '<form method="post">'
|
504 |
+
. '<input type="hidden" name="lscwp_management" value="manage_lscwp" />'
|
505 |
+
. wp_nonce_field('lscwp_manage', 'management_run');
|
506 |
+
|
507 |
+
$purge_front = get_submit_button(
|
508 |
+
__('Purge Front Page', 'litespeed-cache'), 'primary', 'purgefront', false);
|
509 |
+
|
510 |
+
$purge_pages = get_submit_button(
|
511 |
+
__('Purge Pages', 'litespeed-cache'), 'primary', 'purgepages', false);
|
512 |
+
|
513 |
+
$atts = array();
|
514 |
+
$atts['id'] = 'litespeedcache-purgeall';
|
515 |
+
|
516 |
+
$purge_all = get_submit_button(
|
517 |
+
__('Purge All', 'litespeed-cache'), 'primary', 'purgeall', false,
|
518 |
+
$atts);
|
519 |
+
|
520 |
+
$atts['id'] = 'litespeedcache-purgeerrors';
|
521 |
+
|
522 |
+
$purge_errors = get_submit_button(
|
523 |
+
__('Purge Error Pages', 'litespeed-cache'), 'primary',
|
524 |
+
'purgeerrors', false, $atts);
|
525 |
+
|
526 |
+
$incl_403 = $this->input_field_checkbox('include_403', true, true,
|
527 |
+
__('Include 403', 'litespeed-cache'));
|
528 |
+
|
529 |
+
$incl_404 = $this->input_field_checkbox('include_404', true, false,
|
530 |
+
__('Include 404', 'litespeed-cache'));
|
531 |
+
|
532 |
+
$incl_500 = $this->input_field_checkbox('include_500', true, true,
|
533 |
+
__('Include 500s', 'litespeed-cache'));
|
534 |
+
|
535 |
+
// Form entries purge front, purge all
|
536 |
+
$buf .= '<div class="litespeed-cache-div-table>">';
|
537 |
+
$buf .= '<table class="form-table"><tbody>'
|
538 |
+
. '<tr><th>'
|
539 |
+
. __('Purge the Front Page.', 'litespeed-cache')
|
540 |
+
. '</th><td>'
|
541 |
+
. self::build_tip(
|
542 |
+
__('This will Purge Front Page only', 'litespeed-cache'))
|
543 |
+
. $purge_front
|
544 |
+
. '</td></tr>'
|
545 |
+
. '<tr><th>'
|
546 |
+
. __('Purge Pages.', 'litespeed-cache')
|
547 |
+
. '</th><td>'
|
548 |
+
. self::build_tip(
|
549 |
+
__('This will Purge Pages only', 'litespeed-cache'))
|
550 |
+
. $purge_pages
|
551 |
+
. '</td></tr>'
|
552 |
+
. '<tr><th>'
|
553 |
+
. __('Purge all WordPress pages.', 'litespeed-cache')
|
554 |
+
. '</th><td>'
|
555 |
+
. self::build_tip(
|
556 |
+
__('Purge the cache entries created by this plugin.', 'litespeed-cache'))
|
557 |
+
. $purge_all
|
558 |
+
. '</td></tr>'
|
559 |
+
. '<tr><th>'
|
560 |
+
. __('Purge the error pages.', 'litespeed-cache')
|
561 |
+
. '</th><td>'
|
562 |
+
. self::build_tip(
|
563 |
+
__('Purges the error page cache entries created by this plugin.', 'litespeed-cache'))
|
564 |
+
. $incl_403 . ' ' . $incl_404 . ' ' . $incl_500 . '<br>'
|
565 |
+
. $purge_errors . ' '
|
566 |
+
. '</td></tr>';
|
567 |
+
|
568 |
+
if ((!is_multisite()) || (is_network_admin())) {
|
569 |
+
$buf .=
|
570 |
+
'<tr><th>'
|
571 |
+
. __('Clear all cache entries.', 'litespeed-cache')
|
572 |
+
. '</th><td>'
|
573 |
+
. self::build_tip(__($clearcache_desc_para, 'litespeed-cache'))
|
574 |
+
. '<input type="submit" class="litespeedcache-button-danger" name="clearcache"'
|
575 |
+
. 'id="litespeedcache-clearcache" value="'
|
576 |
+
. __('Empty Entire Cache', 'litespeed-cache')
|
577 |
+
. '" />'
|
578 |
+
. $this->input_field_hidden('litespeedcache-clearcache-confirm',
|
579 |
+
$clearcache_confirm_para)
|
580 |
+
. '</td></tr>';
|
581 |
+
}
|
582 |
+
|
583 |
+
if ((is_multisite()) && (is_network_admin())) {
|
584 |
+
echo $buf
|
585 |
+
. $this->input_field_hidden('litespeedcache-purgeall-confirm',
|
586 |
+
$purgeall_confirm_para)
|
587 |
+
. "<br><br></tbody></table></form></div></div>\n";
|
588 |
+
|
589 |
+
return;
|
590 |
+
}
|
591 |
+
$buf .= '</tbody></table></div>';
|
592 |
+
|
593 |
+
$buf .= $this->input_field_hidden('litespeedcache-purgeall-confirm',
|
594 |
+
__('Are you sure you want to purge all?', 'litespeed-cache'));
|
595 |
+
|
596 |
+
|
597 |
+
// Purge by description.
|
598 |
+
$buf .= '<h3>' . __('Purge By...', 'litespeed-cache') . '</h3>';
|
599 |
+
$buf .= '<hr/>' . '<p>' . $purgeby_desc_para . '</p>';
|
600 |
+
|
601 |
+
|
602 |
+
if (($_POST) && (isset($_POST[LiteSpeed_Cache_Config::OPTION_NAME]))) {
|
603 |
+
$selected = $_POST[LiteSpeed_Cache_Config::OPTION_NAME][self::PURGEBYOPT_SELECT];
|
604 |
+
if ((intval($selected) < 0) || (intval($selected) > 3)) {
|
605 |
+
$selected = 0;
|
606 |
+
}
|
607 |
+
}
|
608 |
+
else {
|
609 |
+
$selected = 0;
|
610 |
+
}
|
611 |
+
|
612 |
+
$buf .= $this->input_field_select(self::PURGEBYOPT_SELECT,
|
613 |
+
$purgeby_options, $selected)
|
614 |
+
. ' <span class="litespeed-cache-purgeby-text" style="font-size: 11px;font-style: italic; "></span>'
|
615 |
+
. $this->input_field_hidden('purgeby-category', $purgeby_cat_desc)
|
616 |
+
. $this->input_field_hidden('purgeby-postid',
|
617 |
+
__("Purge pages by post ID.", "litespeed-cache"))
|
618 |
+
. $this->input_field_hidden('purgeby-tag', $purgeby_tag_desc)
|
619 |
+
. $this->input_field_hidden('purgeby-url', $purgeby_url_desc)
|
620 |
+
. '<br>'
|
621 |
+
. $this->input_field_textarea(self::PURGEBYOPT_LIST, '', '5', '', 'code')
|
622 |
+
. '<input type="submit" class="button button-primary" '
|
623 |
+
. 'name="purgelist" value="' . __('Purge List', 'litespeed-cache')
|
624 |
+
. '" />';
|
625 |
+
|
626 |
+
// End form
|
627 |
+
$buf .= "<br><br></form></div></div>";
|
628 |
+
|
629 |
+
echo $buf;
|
630 |
+
}
|
631 |
+
|
632 |
+
/**
|
633 |
+
* Outputs the LiteSpeed Cache settings page.
|
634 |
+
*
|
635 |
+
* @since 1.0.0
|
636 |
+
* @access public
|
637 |
+
*/
|
638 |
+
public function show_menu_settings()
|
639 |
+
{
|
640 |
+
$config = LiteSpeed_Cache::config();
|
641 |
+
|
642 |
+
if (($error_msg = $this->check_license($config)) !== true) {
|
643 |
+
echo '<div class="error"><p>' . $error_msg . '</p></div>' . "\n";
|
644 |
+
|
645 |
+
}
|
646 |
+
|
647 |
+
$options = $config->get_options();
|
648 |
+
|
649 |
+
/**
|
650 |
+
* This hook allows third party plugins to create litespeed cache
|
651 |
+
* specific configurations.
|
652 |
+
*
|
653 |
+
* Each config should append an array containing the following:
|
654 |
+
* 'title' (required) - The tab's title.
|
655 |
+
* 'slug' (required) - The slug used for the tab. [a-z][A-Z], [0-9], -, _ permitted.
|
656 |
+
* 'content' (required) - The tab's content.
|
657 |
+
*
|
658 |
+
* Upon saving, only the options with the option group in the input's
|
659 |
+
* name will be retrieved.
|
660 |
+
* For example, name="litespeed-cache-conf[my-opt]".
|
661 |
+
*
|
662 |
+
* @see TODO: add option save filter.
|
663 |
+
* @since 1.0.9
|