From 6d053d53dc6de0a1726681ffe2bfa648019dc7fa Mon Sep 17 00:00:00 2001
From: Raam Dev
Date: Tue, 13 Dec 2016 20:07:34 -0500
Subject: [PATCH] Phing release of v161214-RC.
---
.gitchange | 4 +-
CHANGELOG.md | 26 +-
comet-cache.php | 2 +-
composer.lock | 983 +++++++++++++++++-
readme.txt | 6 +-
src/includes/classes/Actions.php | 75 +-
src/includes/classes/ApiBase.php | 2 +
src/includes/classes/MenuPageOptions.php | 80 +-
src/includes/classes/Plugin.php | 44 +-
src/includes/classes/VsUpgrades.php | 2 +-
src/includes/stub.php | 2 +-
src/includes/templates/advanced-cache.x-php | 4 +
src/includes/traits/Ac/ObUtils.php | 65 +-
src/includes/traits/Plugin/InstallUtils.php | 122 +--
src/includes/traits/Plugin/WcpAuthorUtils.php | 108 +-
src/includes/traits/Plugin/WcpFeedUtils.php | 17 +-
src/includes/traits/Shared/BlogUtils.php | 34 +-
src/includes/traits/Shared/CacheDirUtils.php | 19 +-
src/includes/traits/Shared/CachePathUtils.php | 25 +-
.../traits/Shared/ConditionalUtils.php | 15 +-
src/includes/traits/Shared/FsUtils.php | 5 +-
21 files changed, 1391 insertions(+), 249 deletions(-)
diff --git a/.gitchange b/.gitchange
index 34e1f6d..cc2d6f7 100644
--- a/.gitchange
+++ b/.gitchange
@@ -1,4 +1,4 @@
1460135613
49dd4154d8f5d3b70691c8e3f52a063a49137fb7:57be33556df067.43016776
-853d9120b42cf4f2eabe2f35ea18a6ace7170ea6:5824430b1d7e09.47123954
-d0e05c36184f81b133761b71ca6ee0136be67409:5830d0b4af5435.34387109
+853d9120b42cf4f2eabe2f35ea18a6ace7170ea6:5849aaa17584a2.95309978
+d0e05c36184f81b133761b71ca6ee0136be67409:58509b56682b37.29646922
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0132a1e..09146bb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,28 @@
-= v161119 =
+= [coming soon] =
+
+- **New Pro Feature (Mobile-Adaptive Mode):** This release adds a new feature that is designed to improve compatibility with Adaptive themes for mobile devices. To learn more, please see: **Dashboard → Comet Cache Pro → Plugin Options → Mobile-Adaptive Mode**. See also: [Issue #471](https://github.com/websharks/comet-cache/issues/471) and the screenshots [here](https://github.com/websharks/comet-cache-pro/pull/303#issuecomment-266230409).
+
+- **Static CDN Filters (`srcset`):** This release enhances Static CDN Filters in Comet Cache Pro. Static CDN Filters are now smart enough to filter all image sources included in an `srcset=""` attribute that is generated by WordPress. See [Issue #660](https://github.com/websharks/comet-cache/issues/660). If you'd like to learn more about `srcset=""`, see [this article at WordPress.org](https://make.wordpress.org/core/2015/11/10/responsive-images-in-wordpress-4-4/).
+
+- **Compatibility:** Avoid deprecated `wp_get_sites()` and use `get_sites()` instead. See [Issue #848](https://github.com/websharks/comet-cache/issues/848).
+
+- **Auto-Clearing:** This release makes Comet Cache smart enough to detect when a user is deleted (or removed from a child blog in a Network). At which time the Author page for that user will be cleared from the cache so it can be regenerated automatically. See [Issue #304](https://github.com/websharks/comet-cache/issues/304).
+
+- **Watered-Down Regex Documentation:** Adding notes to the inline documentation (in the software) about the use of `^` and `$` in some places where these special characters are not fully supported. Also adding the same notes to the [Watered-Down Regex KB Article](https://cometcache.com/kb-article/watered-down-regex-syntax/). See also: [Issue #611](https://github.com/websharks/comet-cache/issues/611).
+
+- **Multibyte Compatibility:** This release improves support for WordPress Permalinks that contain UTF-8 symbols (or emojis) in them. More specifically, this release adds the `/u` flag to all `preg_*()` calls in cache clearing routines that generate cache paths from Watered-Down Regex patterns entered by a site owner. See: [Issue #611](https://github.com/websharks/comet-cache/issues/611).
+
+- **Widget Change Detection:** Comet Cache can now detect when **Appearance → Widgets** are added/edited/removed, and Comet Cache will automatically clear the cache so that your site remains up-to-date. See [Issue #411](https://github.com/websharks/comet-cache/issues/411).
+
+- **Automatic Background Updates:** It is now possible (in Comet Cache Pro) to enable automatic background updates that occur quietly in the background whenever new features, bug fixes, or security issues are addressed by our developers. See: **Dashboard → Comet Cache Pro → Config. Options → Update Credentials**. See also: [Issue #827](https://github.com/websharks/comet-cache/issues/827).
+
+- **HTML Compressor:** Updated to the latest available release of the HTML Compressor (v161208) with improved support for [Accelerated Mobile Pages](https://www.ampproject.org/). See: [Issue #733](https://github.com/websharks/comet-cache/issues/733). See also: [HTML Compressor v161208 changelog](https://github.com/websharks/html-compressor/releases/tag/161208).
+
+- **HTML Compressor / AMP Compatibility:** Improved compatibility with [Accelerated Mobile Pages](https://www.ampproject.org/). There is a new HTML Compressor option that is enabled by default and it makes Comet Cache smart enough to auto-detect and selectively disable portions of the HTML Compressor that are incompatible with the AMP spec; i.e., routines that are not necessary when serving APMd pages. In short, if the URI being compressed ends with `/amp/`, or the document contains a top-level `` tag (`` is accepted as well), then features which are incompatible with [Accelerated Mobile Pages](https://www.ampproject.org/) will be disabled accordingly.
+
+- **Bug Fix:** Improving OPcache detection. Now considering INI option `opcache.restrict_api`. Comet Cache is now smart enough to avoid the error: _PHP Warning: Zend OPcache API is restricted by "restrict_api" configuration directive_. See [Issue #733](https://github.com/websharks/comet-cache/issues/733).
+
+= v161119 =
- **Bug Fix:** Avoid browser autocomplete in configuration fields by adding `autocomplete="off"` to all form tags in Comet Cache menu pages. See [Issue #832](https://github.com/websharks/comet-cache/issues/832).
- **Bug Fix:** Fixed a broken link to the [Static CDN Filters tutorial for MaxCDN integration](http://cometcache.com/r/static-cdn-filters-maxcdn/). Props @kristineds. See [Issue #842](https://github.com/websharks/comet-cache/issues/842).
diff --git a/comet-cache.php b/comet-cache.php
index 361bebd..724e1bc 100644
--- a/comet-cache.php
+++ b/comet-cache.php
@@ -1,6 +1,6 @@
=5.5"
+ },
+ "require-dev": {
+ "ext-curl": "*",
+ "phpunit/phpunit": "^4.0",
+ "psr/log": "^1.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "6.2-dev"
+ }
+ },
+ "autoload": {
+ "files": [
+ "src/functions_include.php"
+ ],
+ "psr-4": {
+ "GuzzleHttp\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ }
+ ],
+ "description": "Guzzle is a PHP HTTP client library",
+ "homepage": "http://guzzlephp.org/",
+ "keywords": [
+ "client",
+ "curl",
+ "framework",
+ "http",
+ "http client",
+ "rest",
+ "web service"
+ ],
+ "time": "2016-10-08 15:01:37"
+ },
+ {
+ "name": "guzzlehttp/promises",
+ "version": "1.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/guzzle/promises.git",
+ "reference": "2693c101803ca78b27972d84081d027fca790a1e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/guzzle/promises/zipball/2693c101803ca78b27972d84081d027fca790a1e",
+ "reference": "2693c101803ca78b27972d84081d027fca790a1e",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "GuzzleHttp\\Promise\\": "src/"
+ },
+ "files": [
+ "src/functions_include.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ }
+ ],
+ "description": "Guzzle promises library",
+ "keywords": [
+ "promise"
+ ],
+ "time": "2016-11-18 17:47:58"
+ },
+ {
+ "name": "guzzlehttp/psr7",
+ "version": "1.3.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/guzzle/psr7.git",
+ "reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/guzzle/psr7/zipball/5c6447c9df362e8f8093bda8f5d8873fe5c7f65b",
+ "reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.4.0",
+ "psr/http-message": "~1.0"
+ },
+ "provide": {
+ "psr/http-message-implementation": "1.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.4-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "GuzzleHttp\\Psr7\\": "src/"
+ },
+ "files": [
+ "src/functions_include.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ }
+ ],
+ "description": "PSR-7 message implementation",
+ "keywords": [
+ "http",
+ "message",
+ "stream",
+ "uri"
+ ],
+ "time": "2016-06-24 23:00:38"
+ },
+ {
+ "name": "mimmi20/wurfl-constants",
+ "version": "1.7.1.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/mimmi20/wurfl-constants.git",
+ "reference": "d0bd0154120cb833dbdf8a8075d5f14bcc521e42"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/mimmi20/wurfl-constants/zipball/d0bd0154120cb833dbdf8a8075d5f14bcc521e42",
+ "reference": "d0bd0154120cb833dbdf8a8075d5f14bcc521e42",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "fabpot/php-cs-fixer": "^1.11",
+ "phpunit/phpunit": "^4.8|^5.0",
+ "squizlabs/php_codesniffer": "^2.5"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Wurfl\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-2.1"
+ ],
+ "description": "the Constants extracted from Wurfl for PHP 5.3",
+ "homepage": "https://github.com/mimmi20/wurfl-constants",
+ "keywords": [
+ "Wurfl",
+ "browser",
+ "http",
+ "parser",
+ "user agent",
+ "user-agent"
+ ],
+ "time": "2016-04-23 18:18:10"
+ },
+ {
+ "name": "mimmi20/wurflcache",
+ "version": "1.7.1.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/mimmi20/WurflCache.git",
+ "reference": "9fc307df74f782a879f4604ab99bf61ecfc165d4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/mimmi20/WurflCache/zipball/9fc307df74f782a879f4604ab99bf61ecfc165d4",
+ "reference": "9fc307df74f782a879f4604ab99bf61ecfc165d4",
+ "shasum": ""
+ },
+ "require": {
+ "mimmi20/wurfl-constants": "^1.7",
+ "php": ">=5.3.3",
+ "symfony/filesystem": "^2.8|^3.0"
+ },
+ "require-dev": {
+ "desarrolla2/cache": "^1.8",
+ "doctrine/cache": "^1.5",
+ "fabpot/php-cs-fixer": "^1.11",
+ "mikey179/vfsstream": "^1.3",
+ "phpunit/phpunit": "^4.8 || ^5.0",
+ "squizlabs/php_codesniffer": "^2.0",
+ "zendframework/zend-cache": "^2.5",
+ "zetacomponents/cache": "dev-master"
+ },
+ "suggest": {
+ "desarrolla2/cache": "to use other caches handled by desarrolla",
+ "doctrine/cache": "to use other caches handled by doctrine",
+ "zendframework/zend-cache": "to use other caches handled by zend",
+ "zetacomponents/cache": "to use other caches handled by zeta"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "WurflCache\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Thomas Müller",
+ "homepage": "https://github.com/mimmi20",
+ "role": "Developer"
+ },
+ {
+ "name": "Contributors",
+ "homepage": "https://github.com/mimmi20/WurflCache/graphs/contributors"
+ }
+ ],
+ "description": "the Cache Classes for the Wurfl PHP Library for PHP 5.3",
+ "homepage": "https://github.com/mimmi20/WurflCache",
+ "keywords": [
+ "Wurfl",
+ "cache"
+ ],
+ "time": "2016-08-06 11:25:21"
+ },
+ {
+ "name": "monolog/monolog",
+ "version": "1.22.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Seldaek/monolog.git",
+ "reference": "bad29cb8d18ab0315e6c477751418a82c850d558"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bad29cb8d18ab0315e6c477751418a82c850d558",
+ "reference": "bad29cb8d18ab0315e6c477751418a82c850d558",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0",
+ "psr/log": "~1.0"
+ },
+ "provide": {
+ "psr/log-implementation": "1.0.0"
+ },
+ "require-dev": {
+ "aws/aws-sdk-php": "^2.4.9 || ^3.0",
+ "doctrine/couchdb": "~1.0@dev",
+ "graylog2/gelf-php": "~1.0",
+ "jakub-onderka/php-parallel-lint": "0.9",
+ "php-amqplib/php-amqplib": "~2.4",
+ "php-console/php-console": "^3.1.3",
+ "phpunit/phpunit": "~4.5",
+ "phpunit/phpunit-mock-objects": "2.3.0",
+ "ruflin/elastica": ">=0.90 <3.0",
+ "sentry/sentry": "^0.13",
+ "swiftmailer/swiftmailer": "~5.3"
+ },
+ "suggest": {
+ "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
+ "doctrine/couchdb": "Allow sending log messages to a CouchDB server",
+ "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
+ "ext-mongo": "Allow sending log messages to a MongoDB server",
+ "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
+ "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver",
+ "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib",
+ "php-console/php-console": "Allow sending log messages to Google Chrome",
+ "rollbar/rollbar": "Allow sending log messages to Rollbar",
+ "ruflin/elastica": "Allow sending log messages to an Elastic Search server",
+ "sentry/sentry": "Allow sending log messages to a Sentry server"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Monolog\\": "src/Monolog"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "http://seld.be"
+ }
+ ],
+ "description": "Sends your logs to files, sockets, inboxes, databases and various web services",
+ "homepage": "http://github.com/Seldaek/monolog",
+ "keywords": [
+ "log",
+ "logging",
+ "psr-3"
+ ],
+ "time": "2016-11-26 00:15:39"
+ },
+ {
+ "name": "psr/http-message",
+ "version": "1.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/http-message.git",
+ "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
+ "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Http\\Message\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for HTTP messages",
+ "homepage": "https://github.com/php-fig/http-message",
+ "keywords": [
+ "http",
+ "http-message",
+ "psr",
+ "psr-7",
+ "request",
+ "response"
+ ],
+ "time": "2016-08-06 14:39:51"
+ },
+ {
+ "name": "psr/log",
+ "version": "1.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/log.git",
+ "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
+ "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Log\\": "Psr/Log/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for logging libraries",
+ "homepage": "https://github.com/php-fig/log",
+ "keywords": [
+ "log",
+ "psr",
+ "psr-3"
+ ],
+ "time": "2016-10-10 12:19:37"
+ },
+ {
+ "name": "symfony/console",
+ "version": "v3.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/console.git",
+ "reference": "09d0fd33560e3573185a2ea17614e37ba38716c5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/console/zipball/09d0fd33560e3573185a2ea17614e37ba38716c5",
+ "reference": "09d0fd33560e3573185a2ea17614e37ba38716c5",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9",
+ "symfony/debug": "~2.8|~3.0",
+ "symfony/polyfill-mbstring": "~1.0"
+ },
+ "require-dev": {
+ "psr/log": "~1.0",
+ "symfony/event-dispatcher": "~2.8|~3.0",
+ "symfony/filesystem": "~2.8|~3.0",
+ "symfony/process": "~2.8|~3.0"
+ },
+ "suggest": {
+ "psr/log": "For using the console logger",
+ "symfony/event-dispatcher": "",
+ "symfony/filesystem": "",
+ "symfony/process": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.2-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Console\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Console Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-11-16 22:18:16"
+ },
+ {
+ "name": "symfony/debug",
+ "version": "v3.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/debug.git",
+ "reference": "9f923e68d524a3095c5a2ae5fc7220c7cbc12231"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/9f923e68d524a3095c5a2ae5fc7220c7cbc12231",
+ "reference": "9f923e68d524a3095c5a2ae5fc7220c7cbc12231",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9",
+ "psr/log": "~1.0"
+ },
+ "conflict": {
+ "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
+ },
+ "require-dev": {
+ "symfony/class-loader": "~2.8|~3.0",
+ "symfony/http-kernel": "~2.8|~3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.2-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Debug\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Debug Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-11-16 22:18:16"
+ },
+ {
+ "name": "symfony/filesystem",
+ "version": "v3.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/filesystem.git",
+ "reference": "8d4cf7561a5b17e5eb7a02b80d0b8f014a3796d4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/8d4cf7561a5b17e5eb7a02b80d0b8f014a3796d4",
+ "reference": "8d4cf7561a5b17e5eb7a02b80d0b8f014a3796d4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.2-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Filesystem\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Filesystem Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-11-24 00:46:43"
+ },
+ {
+ "name": "symfony/finder",
+ "version": "v3.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/finder.git",
+ "reference": "4263e35a1e342a0f195c9349c0dee38148f8a14f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/4263e35a1e342a0f195c9349c0dee38148f8a14f",
+ "reference": "4263e35a1e342a0f195c9349c0dee38148f8a14f",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.2-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Finder\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Finder Component",
+ "homepage": "https://symfony.com",
+ "time": "2016-11-03 08:11:03"
+ },
+ {
+ "name": "symfony/polyfill-mbstring",
+ "version": "v1.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-mbstring.git",
+ "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4",
+ "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "suggest": {
+ "ext-mbstring": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Mbstring\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for the Mbstring extension",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "mbstring",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "time": "2016-11-14 01:06:16"
+ },
+ {
+ "name": "thadafinser/package-info",
+ "version": "v1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/ThaDafinser/PackageInfo.git",
+ "reference": "3cc580385cf694ba83eda3bbf7ea716a2253ea5a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/ThaDafinser/PackageInfo/zipball/3cc580385cf694ba83eda3bbf7ea716a2253ea5a",
+ "reference": "3cc580385cf694ba83eda3bbf7ea716a2253ea5a",
+ "shasum": ""
+ },
+ "require": {
+ "composer-plugin-api": "^1.0",
+ "php": "~5.6|~7.0"
+ },
+ "require-dev": {
+ "composer/composer": "^1.2.0",
+ "phpunit/phpunit": "^5.4.7"
+ },
+ "type": "composer-plugin",
+ "extra": {
+ "class": "PackageInfo\\Installer"
+ },
+ "autoload": {
+ "psr-4": {
+ "PackageInfo\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "ThaDafinser",
+ "email": "martin.keckeis1@gmail.com"
+ }
+ ],
+ "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)",
+ "time": "2016-08-09 11:14:48"
+ },
+ {
+ "name": "thadafinser/user-agent-parser",
+ "version": "v1.5.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/ThaDafinser/UserAgentParser.git",
+ "reference": "d400dbcf9fe229ad431e2b1a6f01c2b3dfb9f791"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/ThaDafinser/UserAgentParser/zipball/d400dbcf9fe229ad431e2b1a6f01c2b3dfb9f791",
+ "reference": "d400dbcf9fe229ad431e2b1a6f01c2b3dfb9f791",
+ "shasum": ""
+ },
+ "require": {
+ "guzzlehttp/guzzle": "^6.1",
+ "php": "~5.6|~7.0",
+ "thadafinser/package-info": "^1.0"
+ },
+ "conflict": {
+ "browscap/browscap-php": "<3,>=4",
+ "donatj/phpuseragentparser": "<0.5,>=1",
+ "jenssegers/agent": "<2.3,>=3",
+ "mimmi20/wurfl": "<1.6.4,>=2",
+ "mobiledetect/mobiledetectlib": "<2.7.5,>=3",
+ "piwik/device-detector": "<3.6,>=4",
+ "sinergi/browser-detector": "<6,>=7",
+ "ua-parser/uap-php": "<3.4.3,>=4",
+ "whichbrowser/parser": "<2.0.10,>=3",
+ "woothee/woothee": "<1.2,>=2",
+ "zsxsoft/php-useragent": "<1.2,>=2"
+ },
+ "require-dev": {
+ "browscap/browscap-php": "^3.0",
+ "donatj/phpuseragentparser": "^0.5.0",
+ "endorphin-studio/browser-detector": "^3.0",
+ "friendsofphp/php-cs-fixer": "^1.11",
+ "handsetdetection/php-apikit": "^4.1.1",
+ "jenssegers/agent": "^2.3",
+ "mimmi20/wurfl": "^1.7.1.1",
+ "mobiledetect/mobiledetectlib": "^2.7.5",
+ "phpunit/phpunit": "^5.4",
+ "piwik/device-detector": "^3.6",
+ "sinergi/browser-detector": "^6.0",
+ "ua-parser/uap-php": "^3.4.3",
+ "whichbrowser/parser": "^2.0.10",
+ "woothee/woothee": "^1.2",
+ "zsxsoft/php-useragent": ">=1.2,<1.4"
+ },
+ "suggest": {
+ "browscap/browscap-php": "Needed to use Provider\\BrowscapPhp",
+ "donatj/phpuseragentparser": "Needed to use Provider\\DonatjUAParser",
+ "endorphin-studio/browser-detector": "Needed to use Provider\\Endorphin",
+ "handsetdetection/php-apikit": "Needed to use Provider\\HandsetDetection",
+ "jenssegers/agent": "Needed to use Provider\\JenssegersAgent",
+ "mimmi20/wurfl": "Needed to use Provider\\Wurfl",
+ "piwik/device-detector": "Needed to use Provider\\PiwikDeviceDetector",
+ "sinergi/browser-detector": "Needed to use Provider\\SinergiBrowserDetector",
+ "ua-parser/uap-php": "Needed to use Provider\\UAParser",
+ "whichbrowser/parser": "Needed to use Provider\\WhichBrowser",
+ "woothee/woothee": "Needed to use Provider\\Woothee",
+ "zsxsoft/php-useragent": "Needed to use Provider\\Zsxsoft"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "UserAgentParser\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "ThaDafinser",
+ "email": "martin.keckeis1@gmail.com"
+ }
+ ],
+ "description": "UserAgentParser abstraction for different parse providers",
+ "keywords": [
+ "Browscap",
+ "Device detection",
+ "DeviceAtlas",
+ "NeutrinoApiCom",
+ "Rendering engine",
+ "UA parser",
+ "UdgerCom",
+ "User agent detection",
+ "User agent parser",
+ "UserAgentApiCom",
+ "UserAgentParser",
+ "UserAgentStringCom",
+ "WhatIsMyBrowserCom",
+ "Wurfl",
+ "bot detection",
+ "browser",
+ "detection",
+ "device",
+ "donatj",
+ "engine",
+ "get_browser",
+ "jenssegers",
+ "mobile detection",
+ "mobile detector",
+ "mobile device detection",
+ "operating system",
+ "os",
+ "parser",
+ "piwik",
+ "sinergi",
+ "sniffing",
+ "ua",
+ "ua-parser",
+ "uaparser",
+ "user agent",
+ "useragent",
+ "whichbrowser",
+ "woothee"
+ ],
+ "time": "2016-08-12 05:51:14"
+ },
{
"name": "websharks/css-minifier",
"version": "dev-master",
@@ -63,23 +1030,23 @@
},
{
"name": "websharks/html-compressor",
- "version": "161108",
+ "version": "161208",
"source": {
"type": "git",
"url": "https://github.com/websharks/html-compressor.git",
- "reference": "73a047734ab585cfaaa3e54526a484b788d768f5"
+ "reference": "3725ba080783c6e33337ed833ed939734af43fb2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/websharks/html-compressor/zipball/73a047734ab585cfaaa3e54526a484b788d768f5",
- "reference": "73a047734ab585cfaaa3e54526a484b788d768f5",
+ "url": "https://api.github.com/repos/websharks/html-compressor/zipball/3725ba080783c6e33337ed833ed939734af43fb2",
+ "reference": "3725ba080783c6e33337ed833ed939734af43fb2",
"shasum": ""
},
"require": {
"ext-curl": "*",
"ext-mbstring": "*",
"ext-openssl": "*",
- "php": ">=5.3",
+ "php": ">=5.4",
"websharks/css-minifier": "dev-master",
"websharks/js-minifier": "dev-master"
},
@@ -117,7 +1084,7 @@
"html",
"websharks"
],
- "time": "2016-11-08 20:56:04"
+ "time": "2016-12-08 12:22:10"
},
{
"name": "websharks/js-minifier",
diff --git a/readme.txt b/readme.txt
index 4c72fb2..6c91048 100644
--- a/readme.txt
+++ b/readme.txt
@@ -1,8 +1,8 @@
=== Comet Cache ===
-Stable tag: 161119
+Stable tag: 161214-RC
Requires at least: 4.2
-Tested up to: 4.7-alpha
+Tested up to: 4.8-alpha
Text Domain: comet-cache
License: GPLv2 or later
@@ -415,4 +415,4 @@ Requires WordPress v4.2+.
- **Bug Fix**: Fixed a "PHP Fatal error: Undefined class constant 'CACHE_PATH_NO_SCHEME'" introduced by the previous release (v160416). This issue only affected sites where Feed Caching was enabled (_Comet Cache → Plugin Options → RSS, RDF, and Atom Feeds_). Props to MassimoD and @emanwebdev for reporting. See [Issue #739](https://github.com/websharks/comet-cache/issues/739).
-For older changelog history going back to 7+ years, please see [CHANGELOG.md](https://github.com/websharks/comet-cache/blob/master/CHANGELOG.md).
+For older changelog history going back more than 7 years, please see [CHANGELOG.md](https://github.com/websharks/comet-cache/blob/master/CHANGELOG.md).
diff --git a/src/includes/classes/Actions.php b/src/includes/classes/Actions.php
index 1588e81..161a1dc 100644
--- a/src/includes/classes/Actions.php
+++ b/src/includes/classes/Actions.php
@@ -71,8 +71,7 @@ protected function wipeCache($args)
{
if (!is_multisite() || !$this->plugin->currentUserCanWipeCache()) {
return; // Nothing to do.
- }
- if (empty($_REQUEST['_wpnonce']) || !wp_verify_nonce($_REQUEST['_wpnonce'])) {
+ } elseif (empty($_REQUEST['_wpnonce']) || !wp_verify_nonce($_REQUEST['_wpnonce'])) {
return; // Unauthenticated POST data.
}
$counter = $this->plugin->wipeCache(true);
@@ -97,8 +96,7 @@ protected function clearCache($args)
{
if (!$this->plugin->currentUserCanClearCache()) {
return; // Not allowed to clear.
- }
- if (empty($_REQUEST['_wpnonce']) || !wp_verify_nonce($_REQUEST['_wpnonce'])) {
+ } elseif (empty($_REQUEST['_wpnonce']) || !wp_verify_nonce($_REQUEST['_wpnonce'])) {
return; // Unauthenticated POST data.
}
$counter = $this->plugin->clearCache(true);
@@ -112,7 +110,6 @@ protected function clearCache($args)
wp_redirect($redirect_to).exit();
}
-
/**
* Action handler.
*
@@ -124,8 +121,7 @@ protected function ajaxWipeCache($args)
{
if (!is_multisite() || !$this->plugin->currentUserCanWipeCache()) {
return; // Nothing to do.
- }
- if (empty($_REQUEST['_wpnonce']) || !wp_verify_nonce($_REQUEST['_wpnonce'])) {
+ } elseif (empty($_REQUEST['_wpnonce']) || !wp_verify_nonce($_REQUEST['_wpnonce'])) {
return; // Unauthenticated POST data.
}
$counter = $this->plugin->wipeCache(true);
@@ -138,8 +134,6 @@ protected function ajaxWipeCache($args)
exit($response); // JavaScript will take it from here.
}
-
-
/**
* Action handler.
*
@@ -151,8 +145,7 @@ protected function ajaxClearCache($args)
{
if (!$this->plugin->currentUserCanClearCache()) {
return; // Not allowed to clear.
- }
- if (empty($_REQUEST['_wpnonce']) || !wp_verify_nonce($_REQUEST['_wpnonce'])) {
+ } elseif (empty($_REQUEST['_wpnonce']) || !wp_verify_nonce($_REQUEST['_wpnonce'])) {
return; // Unauthenticated POST data.
}
$counter = $this->plugin->clearCache(true);
@@ -168,7 +161,6 @@ protected function ajaxClearCache($args)
exit($response); // JavaScript will take it from here.
}
-
@@ -196,10 +188,11 @@ protected function ajaxClearCache($args)
*/
protected function saveOptions($args)
{
+ global $is_apache, $is_nginx;
+
if (!current_user_can($this->plugin->cap)) {
return; // Nothing to do.
- }
- if (empty($_REQUEST['_wpnonce']) || !wp_verify_nonce($_REQUEST['_wpnonce'])) {
+ } elseif (empty($_REQUEST['_wpnonce']) || !wp_verify_nonce($_REQUEST['_wpnonce'])) {
return; // Unauthenticated POST data.
}
if (!empty($_FILES[GLOBAL_NS]['tmp_name']['import_options'])) {
@@ -213,10 +206,11 @@ protected function saveOptions($args)
unset($args['last_pro_stats_log']); // CANNOT be imported!
}
+
$args = $this->plugin->trimDeep(stripslashes_deep((array) $args));
$this->plugin->updateOptions($args); // Save/update options.
- // Ensures `autoCacheMaybeClearPrimaryXmlSitemapError()` always validates the XML Sitemap when saving options (when applicable)
+ // Ensures `autoCacheMaybeClearPrimaryXmlSitemapError()` always validates the XML Sitemap when saving options (when applicable).
delete_transient(GLOBAL_NS.'-'.md5($this->plugin->options['auto_cache_sitemap_url']));
$redirect_to = self_admin_url('/admin.php'); // Redirect preparations.
@@ -224,8 +218,6 @@ protected function saveOptions($args)
$this->plugin->autoWipeCache(); // May produce a notice.
- global $is_apache, $is_nginx;
-
if ($this->plugin->options['enable']) {
if (!($add_wp_cache_to_wp_config = $this->plugin->addWpCacheToWpConfig())) {
$query_args[GLOBAL_NS.'_wp_config_wp_cache_add_failure'] = '1';
@@ -233,17 +225,21 @@ protected function saveOptions($args)
if ($is_apache && !($add_wp_htaccess = $this->plugin->addWpHtaccess())) {
$query_args[GLOBAL_NS.'_wp_htaccess_add_failure'] = '1';
}
- if ($is_nginx && $this->plugin->applyWpFilters(GLOBAL_NS.'_wp_htaccess_nginx_notice', true) && (!isset($_SERVER['WP_NGINX_CONFIG']) || $_SERVER['WP_NGINX_CONFIG'] !== 'done')) {
+ if ($is_nginx && $this->plugin->applyWpFilters(GLOBAL_NS.'_wp_htaccess_nginx_notice', true)
+ && (!isset($_SERVER['WP_NGINX_CONFIG']) || $_SERVER['WP_NGINX_CONFIG'] !== 'done')) {
$query_args[GLOBAL_NS.'_wp_htaccess_nginx_notice'] = '1';
}
if (!($add_advanced_cache = $this->plugin->addAdvancedCache())) {
$query_args[GLOBAL_NS.'_advanced_cache_add_failure'] = $add_advanced_cache === null ? 'advanced-cache' : '1';
}
+
if (!$this->plugin->options['auto_cache_enable']) {
- $this->plugin->dismissMainNotice('auto_cache_engine_minimum_requirements'); // Dismiss and check again on `admin_init` via `autoCacheMaybeClearPhpReqsError()`
+ // Dismiss and check again on `admin_init` via `autoCacheMaybeClearPhpReqsError()`.
+ $this->plugin->dismissMainNotice('auto_cache_engine_minimum_requirements');
}
if (!$this->plugin->options['auto_cache_enable'] || !$this->plugin->options['auto_cache_sitemap_url']) {
- $this->plugin->dismissMainNotice('xml_sitemap_missing'); // Dismiss and check again on `admin_init` via `autoCacheMaybeClearPrimaryXmlSitemapError()`
+ // Dismiss and check again on `admin_init` via `autoCacheMaybeClearPrimaryXmlSitemapError()`.
+ $this->plugin->dismissMainNotice('xml_sitemap_missing');
}
$this->plugin->updateBlogPaths(); // Multisite networks only.
} else {
@@ -256,8 +252,11 @@ protected function saveOptions($args)
if (!($remove_advanced_cache = $this->plugin->removeAdvancedCache())) {
$query_args[GLOBAL_NS.'_advanced_cache_remove_failure'] = '1';
}
- $this->plugin->dismissMainNotice('xml_sitemap_missing'); // Dismiss notice when disabling plugin
- $this->plugin->dismissMainNotice('auto_cache_engine_minimum_requirements'); // Dismiss notice when disabling plugin
+ // Dismiss notice when disabling plugin.
+ $this->plugin->dismissMainNotice('xml_sitemap_missing');
+
+ // Dismiss notice when disabling plugin.
+ $this->plugin->dismissMainNotice('auto_cache_engine_minimum_requirements');
}
$redirect_to = add_query_arg(urlencode_deep($query_args), $redirect_to);
@@ -273,24 +272,22 @@ protected function saveOptions($args)
*/
protected function restoreDefaultOptions($args)
{
+ global $is_apache, $is_nginx;
+
if (!current_user_can($this->plugin->cap)) {
return; // Nothing to do.
- }
- if (is_multisite() && !current_user_can($this->plugin->network_cap)) {
+ } elseif (is_multisite() && !current_user_can($this->plugin->network_cap)) {
return; // Nothing to do.
- }
- if (empty($_REQUEST['_wpnonce']) || !wp_verify_nonce($_REQUEST['_wpnonce'])) {
+ } elseif (empty($_REQUEST['_wpnonce']) || !wp_verify_nonce($_REQUEST['_wpnonce'])) {
return; // Unauthenticated POST data.
}
$this->plugin->restoreDefaultOptions(); // Restore defaults.
- $redirect_to = self_admin_url('/admin.php'); // Redirect preparations.
+ $redirect_to = self_admin_url('/admin.php'); // Redirect prep.
$query_args = ['page' => GLOBAL_NS, GLOBAL_NS.'_restored' => '1'];
$this->plugin->autoWipeCache(); // May produce a notice.
- global $is_apache, $is_nginx;
-
if ($this->plugin->options['enable']) {
if (!($add_wp_cache_to_wp_config = $this->plugin->addWpCacheToWpConfig())) {
$query_args[GLOBAL_NS.'_wp_config_wp_cache_add_failure'] = '1';
@@ -298,12 +295,22 @@ protected function restoreDefaultOptions($args)
if ($is_apache && !($add_wp_htaccess = $this->plugin->addWpHtaccess())) {
$query_args[GLOBAL_NS.'_wp_htaccess_add_failure'] = '1';
}
- if ($is_nginx && $this->plugin->applyWpFilters(GLOBAL_NS.'_wp_htaccess_nginx_notice', true) && (!isset($_SERVER['WP_NGINX_CONFIG']) || $_SERVER['WP_NGINX_CONFIG'] !== 'done')) {
+ if ($is_nginx && $this->plugin->applyWpFilters(GLOBAL_NS.'_wp_htaccess_nginx_notice', true)
+ && (!isset($_SERVER['WP_NGINX_CONFIG']) || $_SERVER['WP_NGINX_CONFIG'] !== 'done')) {
$query_args[GLOBAL_NS.'_wp_htaccess_nginx_notice'] = '1';
}
if (!($add_advanced_cache = $this->plugin->addAdvancedCache())) {
$query_args[GLOBAL_NS.'_advanced_cache_add_failure'] = $add_advanced_cache === null ? 'advanced-cache' : '1';
}
+
+ if (!$this->plugin->options['auto_cache_enable']) {
+ // Dismiss and check again on `admin_init` via `autoCacheMaybeClearPhpReqsError()`.
+ $this->plugin->dismissMainNotice('auto_cache_engine_minimum_requirements');
+ }
+ if (!$this->plugin->options['auto_cache_enable'] || !$this->plugin->options['auto_cache_sitemap_url']) {
+ // Dismiss and check again on `admin_init` via `autoCacheMaybeClearPrimaryXmlSitemapError()`.
+ $this->plugin->dismissMainNotice('xml_sitemap_missing');
+ }
$this->plugin->updateBlogPaths(); // Multisite networks only.
} else {
if (!($remove_wp_cache_from_wp_config = $this->plugin->removeWpCacheFromWpConfig())) {
@@ -315,6 +322,11 @@ protected function restoreDefaultOptions($args)
if (!($remove_advanced_cache = $this->plugin->removeAdvancedCache())) {
$query_args[GLOBAL_NS.'_advanced_cache_remove_failure'] = '1';
}
+ // Dismiss notice when disabling plugin.
+ $this->plugin->dismissMainNotice('xml_sitemap_missing');
+
+ // Dismiss notice when disabling plugin.
+ $this->plugin->dismissMainNotice('auto_cache_engine_minimum_requirements');
}
$redirect_to = add_query_arg(urlencode_deep($query_args), $redirect_to);
@@ -334,8 +346,7 @@ protected function dismissNotice($args)
{
if (!current_user_can($this->plugin->cap)) {
return; // Nothing to do.
- }
- if (empty($_REQUEST['_wpnonce']) || !wp_verify_nonce($_REQUEST['_wpnonce'])) {
+ } elseif (empty($_REQUEST['_wpnonce']) || !wp_verify_nonce($_REQUEST['_wpnonce'])) {
return; // Unauthenticated POST data.
}
$args = $this->plugin->trimDeep(stripslashes_deep((array) $args));
diff --git a/src/includes/classes/ApiBase.php b/src/includes/classes/ApiBase.php
index db09b87..e8ee8f8 100644
--- a/src/includes/classes/ApiBase.php
+++ b/src/includes/classes/ApiBase.php
@@ -44,6 +44,8 @@ public static function options()
return $GLOBALS[GLOBAL_NS]->options;
}
+
+
/**
* Purges expired cache files, leaving all others intact.
*
diff --git a/src/includes/classes/MenuPageOptions.php b/src/includes/classes/MenuPageOptions.php
index ecc5a8c..cb944e6 100644
--- a/src/includes/classes/MenuPageOptions.php
+++ b/src/includes/classes/MenuPageOptions.php
@@ -163,6 +163,11 @@ public function __construct()
echo ' '.__('Failed to remove your /wp-content/advanced-cache.php file. Most likely a permissions error. Please delete (or empty the contents of) this file: /wp-content/advanced-cache.php.', 'comet-cache')."\n";
echo ''."\n";
}
+ if (!empty($_REQUEST[GLOBAL_NS.'_ua_info_dir_population_failure'])) {
+ echo '
'."\n";
+ echo ' '.sprintf(__('Failed to populate User-Agent detection files for Mobile-Adaptive Mode. User-Agent detection files are pulled from a remote location so you\'ll always have the most up-to-date information needed for accurate detection. However, it appears the remote source of this information is currently unvailable. Please wait 15 minutes, then try saving your %1$s options again.', 'comet-cache'), esc_html(NAME))."\n";
+ echo '
'."\n";
+ }
if (!IS_PRO && $this->plugin->isProPreview()) {
echo '
'.sprintf(__('Enable this if you\'d like %1$s to download and install bug fixes and security updates automatically in the background. Requires a valid license key in the field above.', 'comet-cache'), esc_html(NAME)).'
'.sprintf(__('If you would like to participate in our beta program and receive new features and bug fixes before they are released to the public, %1$s can include Release Candidates when checking for automatic updates. Release Candidates are almost-ready-for-production and have already been through many internal test runs. Our team runs the latest Release Candidate on all of our production sites, but that doesn\'t mean you\'ll want to do the same. :-) Please report any issues with Release Candidates on GitHub.', 'comet-cache'), esc_html(NAME)).'
'."\n";
-
echo ' '."\n";
echo '
'."\n";
} else {
echo '
'."\n";
@@ -314,7 +327,6 @@ public function __construct()
echo '
'.sprintf(__('If you want others to see the "Clear Cache" button in their WordPress Admin Bar, you can specify a comma-delimited list of Roles and/or Capabilities that are allowed. For example, if I want Editors to be capable of clearing the cache from their Admin Bar, I could enter editor here. If I also want to allow Authors, I can use a comma-delimited list: editor,author. Or, I could use a single Capability of: publish_posts; which covers both Editors & Authors at the same time.', 'comet-cache'), esc_html(NAME)).'
'."\n";
echo ' '."\n";
echo '
'.sprintf(__('Note: As a security measure, in addition to the Role(s) and/or Capabilities that you list here, each user must also have the ability to %1$s.', 'comet-cache'), esc_html(IS_PRO ? $this->plugin->clear_min_cap : 'edit_posts')).'
'."\n";
- echo ' '."\n";
echo '
'."\n";
}
if ($this->plugin->functionIsPossible('opcache_reset')) {
@@ -447,7 +459,7 @@ public function __construct()
echo ' '."\n";
echo '
'."\n";
echo '
'."\n";
- echo '
'.__('XML Sitemap Patterns... A default value of /sitemap**.xml covers all XML Sitemaps for most installations. However, you may customize this further if you deem necessary. Please list one pattern per line. These XML Sitemap Pattern searches are performed against the REQUEST_URI. A wildcard ** character can also be used when necessary; e.g., /sitemap**.xml (where ** = 0 or more characters of any kind, including / slashes). Other special characters include: * = 0 or more characters that are NOT a slash /; ^ = beginning of the string; $ = end of the string. To learn more about this syntax, please see this KB article.', 'comet-cache').'
'."\n";
+ echo '
'.__('XML Sitemap Patterns (one per line): A default value of /sitemap**.xml covers all XML Sitemaps for most installations. However, you may customize this further if you deem necessary. Please list one pattern per line. XML Sitemap Pattern searches are performed against the REQUEST_URI. A wildcard ** (double asterisk) can be used when necessary; e.g., /sitemap**.xml. Note that ** = 0 or more characters of any kind, including / slashes. * (a single asterisk) means 0 or more characters that are NOT a slash /. Your patterns must match from beginning to end; i.e., the special chars: ^ (beginning of string) and $ (end of the string) are always on for these patterns (i.e., applied internally). For that reason, if you want to match part of a URI, use ** to match anything before and/or after the fragment you\'re searching for. For example, **/sitemap**.xml will match any URI containing /sitemap (anywhere), so long as the URI also ends with .xml. On the other hand, /sitemap*.xml will only match URIs that begin with /sitemap, and it will only match URIs ending in .xml in that immediate directory — bypassing any inside nested sub-directories. To learn more about this syntax, please see this KB article.', 'comet-cache').'
'."\n";
echo ' '."\n";
if (is_multisite()) {
echo '
'.__('In a Multisite Network, each child blog (whether it be a sub-domain, a sub-directory, or a mapped domain); will automatically change the leading http://[sub.]domain/[sub-directory] used in pattern matching. In short, there is no need to add sub-domains or sub-directories for each child blog in these patterns. Please include only the REQUEST_URI (i.e., the path) which leads to the XML Sitemap on all child blogs in the network.', 'comet-cache').'
'."\n";
@@ -457,10 +469,10 @@ public function __construct()
if (IS_PRO || $this->plugin->isProPreview()) {
echo ' '."\n";
echo '
'.__('Misc. Auto-Clear Options', 'comet-cache').'
'."\n";
- echo '
'.__('Auto-Clear a List of Custom URLs Too?', 'comet-cache').'
'."\n";
- echo '
'.sprintf(__('When you update a Post/Page, approve a Comment, or make other changes where %1$s can detect that a Post/Page cache should be cleared to keep your site up-to-date; then %1$s will also clear a list of custom URLs that you list here. Please list one URL per line. A wildcard * character can also be used when necessary; e.g., https://example.com/category/abc-followed-by-*, (where * = 0 or more characters that are NOT a slash /). Other special characters include: ** = 0 or more characters of any kind, including / slashes; ^ = beginning of the string; $ = end of the string. To learn more about this syntax, please see this KB article.', 'comet-cache'), esc_html(NAME)).'
'.sprintf(__('Auto-Clear Custom URL Patterns (one per line): When you update a Post/Page, approve a Comment, etc., %1$s will detect that a Post/Page cache should be cleared to keep your site up-to-date. When this occurs, %1$s can also clear a list of custom URLs that you enter here. Please list one URL per line. A wildcard * character can be used when necessary; e.g., https://example.com/category/abc/**. Note that ** (double asterisk) means 0 or more characters of any kind, including / slashes. * (a single asterisk) means 0 or more characters that are NOT a slash /. Your patterns must match from beginning to end; i.e., the special chars: ^ (beginning of string) and $ (end of the string) are always on for these patterns (i.e., applied internally). For that reason, if you want to match part of a URL, use ** to match anything before and/or after the fragment you\'re searching for. For example, https://**/category/abc/** will find all URLs containing /category/abc/ (anywhere); whereas https://*/category/abc/* will match URLs on any domain, but the path must then begin with /category/abc/ and the pattern will only match paths in that immediate directory — bypassing any additional paths in sub-directories. To learn more about this syntax, please see this KB article.', 'comet-cache'), esc_html(NAME)).'
'."\n";
echo ' '."\n";
- echo '
'.__('Note: Relative URLs (e.g., /name-of-post) should NOT be used. Each entry above should start with http:// or https:// and include a fully qualified domain name.', 'comet-cache').'
'."\n";
+ echo '
'.__('Note: Relative URLs (e.g., /name-of-post) should NOT be used. Each entry above should start with http:// or https:// and include a fully qualified domain name (or wildcard characters in your pattern that will match the domain).', 'comet-cache').'
'."\n";
}
echo '
'."\n";
@@ -501,7 +513,6 @@ public function __construct()
echo '
'.sprintf(__('In a Multisite Network, each child site has stats of its own. If you want child sites to see cache-related stats in their WordPress Admin Bar, you can specify a comma-delimited list of Roles and/or Capabilities that are allowed to see stats. For example, if I want the Administrator to see stats in their Admin Bar, I could enter administrator here. If I also want to show stats to Editors, I can use a comma-delimited list: administrator,editor. Or, I could use a single Capability of: edit_others_posts; which covers both Administrators & Editors at the same time.', 'comet-cache'), esc_html(NAME)).'
'."\n";
echo ' '."\n";
echo '
'.sprintf(__('Note: As a security measure, in addition to the Role(s) and/or Capabilities that you list here, each child site owner must also have the ability to %1$s.', 'comet-cache'), esc_html(IS_PRO ? $this->plugin->stats_min_cap : 'edit_posts')).'
'."\n";
@@ -509,7 +520,6 @@ public function __construct()
echo '
'.sprintf(__('If you want others to see cache-related stats in their WordPress Admin Bar, you can specify a comma-delimited list of Roles and/or Capabilities that are allowed to see stats. For example, if I want Editors to see stats in their Admin Bar, I could enter editor here. If I also want to show stats to Authors, I can use a comma-delimited list: editor,author. Or, I could use a single Capability of: publish_posts; which covers both Editors & Authors at the same time.', 'comet-cache'), esc_html(NAME)).'
'."\n";
echo ' '."\n";
echo '
'.sprintf(__('Note: As a security measure, in addition to the Role(s) and/or Capabilities that you list here, each user must also have the ability to %1$s.', 'comet-cache'), esc_html(IS_PRO ? $this->plugin->stats_min_cap : 'edit_posts')).'
'.__('Sometimes there are special cases when a particular CSS file should NOT be consolidated or compressed in any way. This is where you will enter those if you need to (one per line). Searches are performed against the <link href=""> value, and also against the contents of any inline <style> tags (caSe insensitive). A wildcard * character can also be used when necessary; e.g., xy*-framework (where * = 0 or more characters that are NOT a slash /). Other special characters include: ** = 0 or more characters of any kind, including / slashes; ^ = beginning of the string; $ = end of the string. To learn more about this syntax, please see this KB article.', 'comet-cache').'
'."\n";
@@ -1102,7 +1116,6 @@ public function __construct()
echo ' '."\n";
echo '
'.sprintf(__('Enable the Pro Preview to see Leverage Browser Caching, Enforce Canonical URLs, and more!', 'comet-cache'), esc_attr(add_query_arg(urlencode_deep(['page' => GLOBAL_NS, GLOBAL_NS.'_pro_preview' => '1']), self_admin_url('/admin.php')))).'
'.__('Tip: Generally speaking, you should only enable this if your WordPress theme uses an \'Adaptive\' design, as opposed to a design that\'s \'Responsive\'—the way most WordPress themes are built.', 'comet-cache').'
'.sprintf(__('PHP Version: This feature requires PHP v5.6 (or higher). You\'re currently running PHP v%1$s. Please contact your web hosting company for assistance.', 'comet-cache'), esc_html(PHP_VERSION)).'
'."\n";
+ }
+
+ echo '
'.__('What\'s the Difference Between Responsive and Adaptive?', 'comet-cache').'
'."\n";
+ echo '
'.__('Responsive and Adaptive designs both attempt to optimize the user experience across different devices, adjusting for different viewport sizes, resolutions, usage contexts, control mechanisms, and so on. Responsive design (common for WordPress sites) works on the principle of flexibility — a single fluid website that can look good on any device. Responsive websites use media queries, flexible grids, and responsive images to create a user experience that flexes and changes based on a multitude of factors. If you have a Responsive theme, you probably do NOT need to enable Mobile-Adaptive Mode.', 'comet-cache').'
'."\n";
+ echo '
'.sprintf(__('Adaptive design detects the device and other features, and then it provides the appropriate feature and layout based on a predefined set of viewport sizes and other characteristics. Adaptive themes generally decide what to display based on a visitor\'s User-Agent (i.e., OS, device, browser, version). Since this design choice results in multiple versions of a page being served to visitors, based on the device they access the site with, it then becomes important to cache each of those variations separately. That way a visitor on an iPhone isn\'t accidentally shown the cached copy of a page that was originally viewed by another visitor who was on a desktop computer. If your theme uses an Adaptive design, you probably DO want to enable Mobile-Adaptive Mode in %1$s.', 'comet-cache'), esc_html(NAME)).'
'."\n";
+
+ echo '
'."\n";
+ echo '
'.__('Mobile-Adaptive Tokens', 'comet-cache').'
'."\n";
+ echo '
'.sprintf(__('When %1$s runs in Mobile-Adaptive Mode and it detects that a device is Mobile (e.g., a phone, tablet), it needs to know which factors you\'d like to consider. Mobile-Adaptive Tokens make this easy. In the field below, please configure a list of Mobile-Adaptive Tokens that establish the important factors on your site. Each token must be separated by a + sign. You can use just one, or use them all. However, it\'s IMPORTANT to note: With each new token, you add additional permutations that can fragment the cache and eat up a lot of disk space. Enable and monitor Cache Statistics so you can keep an eye on this. See: %1$s → Plugin Options → Cache-Related Statistics', 'comet-cache'), esc_html(NAME)).'
'."\n";
+ echo '
'.__('The available Tokens are as follows:', 'comet-cache').'
'.__('browser.version e.g., 55.0, 1.3, 9383242.2392, etc. — we suggest avoiding this token because there are many permutations.', 'comet-cache').'
'."\n";
+ echo '
'."\n";
+ echo ' '."\n";
+ echo '
'.sprintf(__('The suggested default value is: %2$s. However, just: os.name + device.type is better, if that will do.', 'comet-cache'), esc_html(NAME), esc_html($this->plugin->default_options['mobile_adaptive_salt'])).'
'."\n";
+ echo '
'.__('The special token: device.is_mobile (i.e., any mobile device, including tablets, excluding laptops) can be used by itself. For example, if you simply want to break the cache down into mobile vs. NOT mobile.', 'comet-cache').'
'."\n";
+ echo '
'.sprintf(__('Note: The underlying logic behind mobile detection is accomplished using a faster, precompiled version of Browscap Lite, and Browcap data is automatically updated (and recompiled) whenever you save %1$s options and/or when upgrading %1$s to a new version.', 'comet-cache'), esc_html(NAME)).'