diff --git a/.github/workflows/deploy-to-wp-on-release.yml b/.github/workflows/deploy-to-wp-on-release.yml
new file mode 100644
index 0000000..c7e1340
--- /dev/null
+++ b/.github/workflows/deploy-to-wp-on-release.yml
@@ -0,0 +1,31 @@
+name: Deploy to WordPress.org
+
+on:
+ release:
+ types: [created]
+
+jobs:
+ deploy:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+
+ - name: Setup PHP
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: 7.4
+ extensions: mbstring, intl
+ tools: composer
+
+ - name: Install PHP dependencies
+ run: |
+ composer install --no-dev --optimize-autoloader
+
+ - name: WordPress Plugin Deploy
+ uses: 10up/action-wordpress-plugin-deploy@stable
+ env:
+ SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
+ SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
+ SLUG: on-demand-revalidation
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/on-demand-revalidation.php b/class-ondemandrevalidation.php
similarity index 86%
rename from on-demand-revalidation.php
rename to class-ondemandrevalidation.php
index 2a37ab5..158cf18 100644
--- a/on-demand-revalidation.php
+++ b/class-ondemandrevalidation.php
@@ -4,14 +4,16 @@
*
* Plugin Name: On-Demand Revalidation
* Plugin URI: https://wordpress.org/plugins/on-demand-revalidation
- * GitHub Plugin URI: https://github.com/gdidentity/on-demand-revalidation
- * Description: Next.js On-Demand Revalidation on the post update, revalidate specific paths on the post update.
- * Version: 1.1.3
- * Author: GD IDENTITY
- * Author URI: https://gdidentity.sk
+ * GitHub Plugin URI: https://github.com/dexerto/on-demand-revalidation
+ * Description: Next.js On-Demand Revalidation on the post update, revalidate specific paths, tags on the post update.
+ * Version: 1.2.0
+ * Author: Dexerto
+ * Author URI: https://dexerto.com
* Text Domain: on-demand-revalidation
* License: GPL-3
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
+ *
+ * @package OnDemandRevalidation
*/
use OnDemandRevalidation\Admin\Settings;
@@ -51,9 +53,9 @@ public static function instance(): self {
if ( self::$instance->includes() ) {
self::$instance->settings();
self::$instance->revalidation();
- self::$instance->pluginLinks();
+ self::$instance->plugin_links();
- \OnDemandRevalidation\Helpers::preventWrongApiUrl();
+ \OnDemandRevalidation\Helpers::prevent_wrong_api_url();
}
}
@@ -114,7 +116,7 @@ public function __wakeup() {
private function setup_constants(): void {
if ( ! function_exists( 'get_plugin_data' ) ) {
- require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
// Plugin version.
@@ -160,7 +162,7 @@ private function includes(): bool {
// Bail if installed incorrectly.
if ( ! class_exists( '\OnDemandRevalidation\Admin\Settings' ) ) {
- add_action( 'admin_notices', [ $this, 'missing_notice' ] );
+ add_action( 'admin_notices', array( $this, 'missing_notice' ) );
return false;
}
}
@@ -211,14 +213,17 @@ private function revalidation(): void {
*
* @since 0.0.1
*/
- private function pluginLinks(): void {
+ private function plugin_links(): void {
// Setup Settings link.
- add_filter('plugin_action_links_' . plugin_basename( __FILE__ ), function ( $links ) {
- $links[] = 'Settings';
+ add_filter(
+ 'plugin_action_links_' . plugin_basename( __FILE__ ),
+ function ( $links ) {
+ $links[] = 'Settings';
- return $links;
- });
+ return $links;
+ }
+ );
}
}
diff --git a/composer.json b/composer.json
index 46a480b..59aa8a5 100644
--- a/composer.json
+++ b/composer.json
@@ -19,9 +19,9 @@
}
},
"require-dev": {
- "automattic/vipwpcs": "^2.3",
- "dealerdirect/phpcodesniffer-composer-installer": "^0.7",
- "phpcompatibility/phpcompatibility-wp": "*"
+ "squizlabs/php_codesniffer": "^3.9",
+ "automattic/vipwpcs": "^3.0",
+ "dealerdirect/phpcodesniffer-composer-installer": "^1.0"
},
"scripts": {
"phpcs": [
diff --git a/composer.lock b/composer.lock
index 011656b..cbb058b 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,33 +4,34 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "73dd93049347a923592fffa3f95e8779",
+ "content-hash": "abe7fdb289c442ae5244023b8c11b676",
"packages": [],
"packages-dev": [
{
"name": "automattic/vipwpcs",
- "version": "2.3.3",
+ "version": "3.0.0",
"source": {
"type": "git",
"url": "https://github.com/Automattic/VIP-Coding-Standards.git",
- "reference": "6cd0a6a82bc0ac988dbf9d6a7c2e293dc8ac640b"
+ "reference": "1b8960ebff9ea3eb482258a906ece4d1ee1e25fd"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/6cd0a6a82bc0ac988dbf9d6a7c2e293dc8ac640b",
- "reference": "6cd0a6a82bc0ac988dbf9d6a7c2e293dc8ac640b",
+ "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/1b8960ebff9ea3eb482258a906ece4d1ee1e25fd",
+ "reference": "1b8960ebff9ea3eb482258a906ece4d1ee1e25fd",
"shasum": ""
},
"require": {
- "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7",
"php": ">=5.4",
- "sirbrillig/phpcs-variable-analysis": "^2.11.1",
- "squizlabs/php_codesniffer": "^3.5.5",
- "wp-coding-standards/wpcs": "^2.3"
+ "phpcsstandards/phpcsextra": "^1.1.0",
+ "phpcsstandards/phpcsutils": "^1.0.8",
+ "sirbrillig/phpcs-variable-analysis": "^2.11.17",
+ "squizlabs/php_codesniffer": "^3.7.2",
+ "wp-coding-standards/wpcs": "^3.0"
},
"require-dev": {
- "php-parallel-lint/php-console-highlighter": "^0.5",
- "php-parallel-lint/php-parallel-lint": "^1.0",
+ "php-parallel-lint/php-console-highlighter": "^1.0.0",
+ "php-parallel-lint/php-parallel-lint": "^1.3.2",
"phpcompatibility/php-compatibility": "^9",
"phpcsstandards/phpcsdevtools": "^1.0",
"phpunit/phpunit": "^4 || ^5 || ^6 || ^7"
@@ -50,6 +51,7 @@
"keywords": [
"phpcs",
"standards",
+ "static analysis",
"wordpress"
],
"support": {
@@ -57,39 +59,42 @@
"source": "https://github.com/Automattic/VIP-Coding-Standards",
"wiki": "https://github.com/Automattic/VIP-Coding-Standards/wiki"
},
- "time": "2021-09-29T16:20:23+00:00"
+ "time": "2023-09-05T11:01:05+00:00"
},
{
"name": "dealerdirect/phpcodesniffer-composer-installer",
- "version": "v0.7.2",
+ "version": "v1.0.0",
"source": {
"type": "git",
- "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git",
- "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db"
+ "url": "https://github.com/PHPCSStandards/composer-installer.git",
+ "reference": "4be43904336affa5c2f70744a348312336afd0da"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db",
- "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db",
+ "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da",
+ "reference": "4be43904336affa5c2f70744a348312336afd0da",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0 || ^2.0",
- "php": ">=5.3",
+ "php": ">=5.4",
"squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0"
},
"require-dev": {
"composer/composer": "*",
+ "ext-json": "*",
+ "ext-zip": "*",
"php-parallel-lint/php-parallel-lint": "^1.3.1",
- "phpcompatibility/php-compatibility": "^9.0"
+ "phpcompatibility/php-compatibility": "^9.0",
+ "yoast/phpunit-polyfills": "^1.0"
},
"type": "composer-plugin",
"extra": {
- "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin"
+ "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin"
},
"autoload": {
"psr-4": {
- "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/"
+ "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -105,7 +110,7 @@
},
{
"name": "Contributors",
- "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors"
+ "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors"
}
],
"description": "PHP_CodeSniffer Standards Composer Installer Plugin",
@@ -129,50 +134,49 @@
"tests"
],
"support": {
- "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues",
- "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer"
+ "issues": "https://github.com/PHPCSStandards/composer-installer/issues",
+ "source": "https://github.com/PHPCSStandards/composer-installer"
},
- "time": "2022-02-04T12:51:07+00:00"
+ "time": "2023-01-05T11:28:13+00:00"
},
{
- "name": "phpcompatibility/php-compatibility",
- "version": "9.3.5",
+ "name": "phpcsstandards/phpcsextra",
+ "version": "1.2.1",
"source": {
"type": "git",
- "url": "https://github.com/PHPCompatibility/PHPCompatibility.git",
- "reference": "9fb324479acf6f39452e0655d2429cc0d3914243"
+ "url": "https://github.com/PHPCSStandards/PHPCSExtra.git",
+ "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243",
- "reference": "9fb324479acf6f39452e0655d2429cc0d3914243",
+ "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/11d387c6642b6e4acaf0bd9bf5203b8cca1ec489",
+ "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489",
"shasum": ""
},
"require": {
- "php": ">=5.3",
- "squizlabs/php_codesniffer": "^2.3 || ^3.0.2"
- },
- "conflict": {
- "squizlabs/php_codesniffer": "2.6.2"
+ "php": ">=5.4",
+ "phpcsstandards/phpcsutils": "^1.0.9",
+ "squizlabs/php_codesniffer": "^3.8.0"
},
"require-dev": {
- "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0"
- },
- "suggest": {
- "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.",
- "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
+ "php-parallel-lint/php-console-highlighter": "^1.0",
+ "php-parallel-lint/php-parallel-lint": "^1.3.2",
+ "phpcsstandards/phpcsdevcs": "^1.1.6",
+ "phpcsstandards/phpcsdevtools": "^1.2.1",
+ "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0"
},
"type": "phpcodesniffer-standard",
+ "extra": {
+ "branch-alias": {
+ "dev-stable": "1.x-dev",
+ "dev-develop": "1.x-dev"
+ }
+ },
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0-or-later"
],
"authors": [
- {
- "name": "Wim Godden",
- "homepage": "https://github.com/wimg",
- "role": "lead"
- },
{
"name": "Juliette Reinders Folmer",
"homepage": "https://github.com/jrfnl",
@@ -180,156 +184,152 @@
},
{
"name": "Contributors",
- "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors"
+ "homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors"
}
],
- "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.",
- "homepage": "http://techblog.wimgodden.be/tag/codesniffer/",
+ "description": "A collection of sniffs and standards for use with PHP_CodeSniffer.",
"keywords": [
- "compatibility",
+ "PHP_CodeSniffer",
+ "phpcbf",
+ "phpcodesniffer-standard",
"phpcs",
- "standards"
+ "standards",
+ "static analysis"
],
"support": {
- "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues",
- "source": "https://github.com/PHPCompatibility/PHPCompatibility"
- },
- "time": "2019-12-27T09:44:58+00:00"
- },
- {
- "name": "phpcompatibility/phpcompatibility-paragonie",
- "version": "1.3.1",
- "source": {
- "type": "git",
- "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git",
- "reference": "ddabec839cc003651f2ce695c938686d1086cf43"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/ddabec839cc003651f2ce695c938686d1086cf43",
- "reference": "ddabec839cc003651f2ce695c938686d1086cf43",
- "shasum": ""
- },
- "require": {
- "phpcompatibility/php-compatibility": "^9.0"
- },
- "require-dev": {
- "dealerdirect/phpcodesniffer-composer-installer": "^0.7",
- "paragonie/random_compat": "dev-master",
- "paragonie/sodium_compat": "dev-master"
- },
- "suggest": {
- "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",
- "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
+ "issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues",
+ "security": "https://github.com/PHPCSStandards/PHPCSExtra/security/policy",
+ "source": "https://github.com/PHPCSStandards/PHPCSExtra"
},
- "type": "phpcodesniffer-standard",
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "LGPL-3.0-or-later"
- ],
- "authors": [
+ "funding": [
{
- "name": "Wim Godden",
- "role": "lead"
+ "url": "https://github.com/PHPCSStandards",
+ "type": "github"
},
{
- "name": "Juliette Reinders Folmer",
- "role": "lead"
+ "url": "https://github.com/jrfnl",
+ "type": "github"
+ },
+ {
+ "url": "https://opencollective.com/php_codesniffer",
+ "type": "open_collective"
}
],
- "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.",
- "homepage": "http://phpcompatibility.com/",
- "keywords": [
- "compatibility",
- "paragonie",
- "phpcs",
- "polyfill",
- "standards"
- ],
- "support": {
- "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues",
- "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie"
- },
- "time": "2021-02-15T10:24:51+00:00"
+ "time": "2023-12-08T16:49:07+00:00"
},
{
- "name": "phpcompatibility/phpcompatibility-wp",
- "version": "2.1.3",
+ "name": "phpcsstandards/phpcsutils",
+ "version": "1.0.10",
"source": {
"type": "git",
- "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git",
- "reference": "d55de55f88697b9cdb94bccf04f14eb3b11cf308"
+ "url": "https://github.com/PHPCSStandards/PHPCSUtils.git",
+ "reference": "51609a5b89f928e0c463d6df80eb38eff1eaf544"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/d55de55f88697b9cdb94bccf04f14eb3b11cf308",
- "reference": "d55de55f88697b9cdb94bccf04f14eb3b11cf308",
+ "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/51609a5b89f928e0c463d6df80eb38eff1eaf544",
+ "reference": "51609a5b89f928e0c463d6df80eb38eff1eaf544",
"shasum": ""
},
"require": {
- "phpcompatibility/php-compatibility": "^9.0",
- "phpcompatibility/phpcompatibility-paragonie": "^1.0"
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0",
+ "php": ">=5.4",
+ "squizlabs/php_codesniffer": "^3.9.0 || 4.0.x-dev@dev"
},
"require-dev": {
- "dealerdirect/phpcodesniffer-composer-installer": "^0.7"
- },
- "suggest": {
- "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",
- "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
+ "ext-filter": "*",
+ "php-parallel-lint/php-console-highlighter": "^1.0",
+ "php-parallel-lint/php-parallel-lint": "^1.3.2",
+ "phpcsstandards/phpcsdevcs": "^1.1.6",
+ "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0"
},
"type": "phpcodesniffer-standard",
+ "extra": {
+ "branch-alias": {
+ "dev-stable": "1.x-dev",
+ "dev-develop": "1.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "PHPCSUtils/"
+ ]
+ },
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0-or-later"
],
"authors": [
{
- "name": "Wim Godden",
+ "name": "Juliette Reinders Folmer",
+ "homepage": "https://github.com/jrfnl",
"role": "lead"
},
{
- "name": "Juliette Reinders Folmer",
- "role": "lead"
+ "name": "Contributors",
+ "homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors"
}
],
- "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.",
- "homepage": "http://phpcompatibility.com/",
+ "description": "A suite of utility functions for use with PHP_CodeSniffer",
+ "homepage": "https://phpcsutils.com/",
"keywords": [
- "compatibility",
+ "PHP_CodeSniffer",
+ "phpcbf",
+ "phpcodesniffer-standard",
"phpcs",
+ "phpcs3",
"standards",
- "wordpress"
+ "static analysis",
+ "tokens",
+ "utility"
],
"support": {
- "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues",
- "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP"
+ "docs": "https://phpcsutils.com/",
+ "issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues",
+ "security": "https://github.com/PHPCSStandards/PHPCSUtils/security/policy",
+ "source": "https://github.com/PHPCSStandards/PHPCSUtils"
},
- "time": "2021-12-30T16:37:40+00:00"
+ "funding": [
+ {
+ "url": "https://github.com/PHPCSStandards",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/jrfnl",
+ "type": "github"
+ },
+ {
+ "url": "https://opencollective.com/php_codesniffer",
+ "type": "open_collective"
+ }
+ ],
+ "time": "2024-03-17T23:44:50+00:00"
},
{
"name": "sirbrillig/phpcs-variable-analysis",
- "version": "v2.11.3",
+ "version": "v2.11.17",
"source": {
"type": "git",
"url": "https://github.com/sirbrillig/phpcs-variable-analysis.git",
- "reference": "c921498b474212fe4552928bbeb68d70250ce5e8"
+ "reference": "3b71162a6bf0cde2bff1752e40a1788d8273d049"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/c921498b474212fe4552928bbeb68d70250ce5e8",
- "reference": "c921498b474212fe4552928bbeb68d70250ce5e8",
+ "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/3b71162a6bf0cde2bff1752e40a1788d8273d049",
+ "reference": "3b71162a6bf0cde2bff1752e40a1788d8273d049",
"shasum": ""
},
"require": {
"php": ">=5.4.0",
- "squizlabs/php_codesniffer": "^3.5"
+ "squizlabs/php_codesniffer": "^3.5.6"
},
"require-dev": {
- "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
- "limedeck/phpunit-detailed-printer": "^3.1 || ^4.0 || ^5.0",
- "phpstan/phpstan": "^0.11.8",
- "phpunit/phpunit": "^5.0 || ^6.5 || ^7.0 || ^8.0",
- "sirbrillig/phpcs-import-detection": "^1.1"
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.0",
+ "phpcsstandards/phpcsdevcs": "^1.1",
+ "phpstan/phpstan": "^1.7",
+ "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0",
+ "sirbrillig/phpcs-import-detection": "^1.1",
+ "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0@beta"
},
"type": "phpcodesniffer-standard",
"autoload": {
@@ -352,25 +352,29 @@
}
],
"description": "A PHPCS sniff to detect problems with variables.",
+ "keywords": [
+ "phpcs",
+ "static analysis"
+ ],
"support": {
"issues": "https://github.com/sirbrillig/phpcs-variable-analysis/issues",
"source": "https://github.com/sirbrillig/phpcs-variable-analysis",
"wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki"
},
- "time": "2022-02-21T17:01:13+00:00"
+ "time": "2023-08-05T23:46:11+00:00"
},
{
"name": "squizlabs/php_codesniffer",
- "version": "3.7.0",
+ "version": "3.9.1",
"source": {
"type": "git",
- "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
- "reference": "a2cd51b45bcaef9c1f2a4bda48f2dd2fa2b95563"
+ "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
+ "reference": "267a4405fff1d9c847134db3a3c92f1ab7f77909"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/a2cd51b45bcaef9c1f2a4bda48f2dd2fa2b95563",
- "reference": "a2cd51b45bcaef9c1f2a4bda48f2dd2fa2b95563",
+ "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/267a4405fff1d9c847134db3a3c92f1ab7f77909",
+ "reference": "267a4405fff1d9c847134db3a3c92f1ab7f77909",
"shasum": ""
},
"require": {
@@ -380,11 +384,11 @@
"php": ">=5.4.0"
},
"require-dev": {
- "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
+ "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4"
},
"bin": [
- "bin/phpcs",
- "bin/phpcbf"
+ "bin/phpcbf",
+ "bin/phpcs"
],
"type": "library",
"extra": {
@@ -399,48 +403,80 @@
"authors": [
{
"name": "Greg Sherwood",
- "role": "lead"
+ "role": "Former lead"
+ },
+ {
+ "name": "Juliette Reinders Folmer",
+ "role": "Current lead"
+ },
+ {
+ "name": "Contributors",
+ "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors"
}
],
"description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
- "homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
+ "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer",
"keywords": [
"phpcs",
- "standards"
+ "standards",
+ "static analysis"
],
"support": {
- "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues",
- "source": "https://github.com/squizlabs/PHP_CodeSniffer",
- "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
+ "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues",
+ "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy",
+ "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer",
+ "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki"
},
- "time": "2022-06-13T06:31:38+00:00"
+ "funding": [
+ {
+ "url": "https://github.com/PHPCSStandards",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/jrfnl",
+ "type": "github"
+ },
+ {
+ "url": "https://opencollective.com/php_codesniffer",
+ "type": "open_collective"
+ }
+ ],
+ "time": "2024-03-31T21:03:09+00:00"
},
{
"name": "wp-coding-standards/wpcs",
- "version": "2.3.0",
+ "version": "3.1.0",
"source": {
"type": "git",
"url": "https://github.com/WordPress/WordPress-Coding-Standards.git",
- "reference": "7da1894633f168fe244afc6de00d141f27517b62"
+ "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62",
- "reference": "7da1894633f168fe244afc6de00d141f27517b62",
+ "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/9333efcbff231f10dfd9c56bb7b65818b4733ca7",
+ "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7",
"shasum": ""
},
"require": {
+ "ext-filter": "*",
+ "ext-libxml": "*",
+ "ext-tokenizer": "*",
+ "ext-xmlreader": "*",
"php": ">=5.4",
- "squizlabs/php_codesniffer": "^3.3.1"
+ "phpcsstandards/phpcsextra": "^1.2.1",
+ "phpcsstandards/phpcsutils": "^1.0.10",
+ "squizlabs/php_codesniffer": "^3.9.0"
},
"require-dev": {
- "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6",
+ "php-parallel-lint/php-console-highlighter": "^1.0.0",
+ "php-parallel-lint/php-parallel-lint": "^1.3.2",
"phpcompatibility/php-compatibility": "^9.0",
- "phpcsstandards/phpcsdevtools": "^1.0",
- "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
+ "phpcsstandards/phpcsdevtools": "^1.2.0",
+ "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0"
},
"suggest": {
- "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically."
+ "ext-iconv": "For improved results",
+ "ext-mbstring": "For improved results"
},
"type": "phpcodesniffer-standard",
"notification-url": "https://packagist.org/downloads/",
@@ -457,6 +493,7 @@
"keywords": [
"phpcs",
"standards",
+ "static analysis",
"wordpress"
],
"support": {
@@ -464,7 +501,13 @@
"source": "https://github.com/WordPress/WordPress-Coding-Standards",
"wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki"
},
- "time": "2020-05-13T23:57:56+00:00"
+ "funding": [
+ {
+ "url": "https://opencollective.com/php_codesniffer",
+ "type": "custom"
+ }
+ ],
+ "time": "2024-03-25T16:39:00+00:00"
}
],
"aliases": [],
@@ -474,5 +517,5 @@
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
- "plugin-api-version": "2.2.0"
+ "plugin-api-version": "2.6.0"
}
diff --git a/phpcs.xml.dist b/phpcs.xml.dist
index d8d8e04..e1cb527 100644
--- a/phpcs.xml.dist
+++ b/phpcs.xml.dist
@@ -1,71 +1,19 @@
-
Available current Post placeholders:%slug%
%author_nicename%
%author_username%
%category%
%post_tag%
%custom_taxonomy%
Note: Replace %custom_taxonomy%
with your custom taxonomy name.',
- 'placeholder' => '/category/%category%',
- 'type' => 'textarea',
- ],
- [
- 'name' => 'test-config',
- 'label' => __( 'Test your config:', 'on-demand-revalidation' ),
- 'desc' => 'Revalidate Latest Post',
- 'type' => 'html',
- ],
- ] );
-
- }
-
- /**
- * Initialize the settings admin page
- *
- * @return void
- */
- public function initialize_settings_page() {
- $this->settings_api->admin_init();
- }
-
- /**
- * Render the settings page in the admin
- *
- * @return void
- */
- public function render_settings_page() {
- if ( ! current_user_can( 'manage_options' ) ) {
- wp_die( esc_html__( 'You do not have sufficient permissions to access this page.' ) );
- }
-
- ?>
-
%slug%
%author_nicename%
%author_username%
%category%
%post_tag%
%custom_taxonomy%
%custom_taxonomy%
with your custom taxonomy name.',
+ 'placeholder' => '/category/%category%',
+ 'type' => 'textarea',
+ ),
+
+ array(
+ 'name' => 'revalidate_tags',
+ 'label' => __( 'Tags to revalidate on Post update', 'on-demand-revalidation' ),
+ 'desc' => 'Enter each tag on a new line, using placeholders like {databaseId}, {id}, {category}. Placeholders will be replaced with actual values from the post during revalidation.',
+ 'type' => 'textarea',
+ ),
+
+ array(
+ 'name' => 'test-config',
+ 'label' => __( 'Test your config:', 'on-demand-revalidation' ),
+ 'desc' => 'Revalidate Latest Post',
+ 'type' => 'html',
+ ),
+ )
+ );
+ }
+
+ /**
+ * Initialize the settings admin page
+ *
+ * @return void
+ */
+ public function initialize_settings_page() {
+ $this->settings_api->admin_init();
+ }
+
+ /**
+ * Render the settings page in the admin
+ *
+ * @return void
+ */
+ public function render_settings_page() {
+ if ( ! current_user_can( 'manage_options' ) ) {
+ wp_die( esc_html__( 'You do not have sufficient permissions to access this page.' ) );
+ }
+
+ ?>
+