diff --git a/plugins/faustwp/.phpcs.xml.dist b/plugins/faustwp/.phpcs.xml.dist
index 7d3ca92f1..d95fd23d7 100644
--- a/plugins/faustwp/.phpcs.xml.dist
+++ b/plugins/faustwp/.phpcs.xml.dist
@@ -57,4 +57,8 @@
+
+
+
+
diff --git a/plugins/faustwp/composer.json b/plugins/faustwp/composer.json
index 1f78b4e1a..acee272a8 100644
--- a/plugins/faustwp/composer.json
+++ b/plugins/faustwp/composer.json
@@ -25,8 +25,8 @@
"axepress/wp-graphql-stubs": "^1.16",
"szepeviktor/phpstan-wordpress": "^1.3",
"roave/security-advisories": "dev-master",
- "squizlabs/php_codesniffer": "^3.5.8",
- "wp-coding-standards/wpcs": "^2.2",
+ "squizlabs/php_codesniffer": "^3.10.1",
+ "wp-coding-standards/wpcs": "^3.1.0",
"yoast/phpunit-polyfills": "^1.0"
},
"scripts": {
@@ -66,4 +66,4 @@
"WPE\\FaustWP\\Tests\\Integration\\": "tests/integration/"
}
}
-}
+}
\ No newline at end of file
diff --git a/plugins/faustwp/composer.lock b/plugins/faustwp/composer.lock
index 24389b278..7ed478c27 100644
--- a/plugins/faustwp/composer.lock
+++ b/plugins/faustwp/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "b7f2eaed1e5bd3f3e94f076d73e18dae",
+ "content-hash": "414f21330605d63ed03819255d5d0e58",
"packages": [],
"packages-dev": [
{
@@ -3157,6 +3157,172 @@
},
"time": "2022-10-24T09:00:36+00:00"
},
+ {
+ "name": "phpcsstandards/phpcsextra",
+ "version": "1.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/PHPCSStandards/PHPCSExtra.git",
+ "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/11d387c6642b6e4acaf0bd9bf5203b8cca1ec489",
+ "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.4",
+ "phpcsstandards/phpcsutils": "^1.0.9",
+ "squizlabs/php_codesniffer": "^3.8.0"
+ },
+ "require-dev": {
+ "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": "Juliette Reinders Folmer",
+ "homepage": "https://github.com/jrfnl",
+ "role": "lead"
+ },
+ {
+ "name": "Contributors",
+ "homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors"
+ }
+ ],
+ "description": "A collection of sniffs and standards for use with PHP_CodeSniffer.",
+ "keywords": [
+ "PHP_CodeSniffer",
+ "phpcbf",
+ "phpcodesniffer-standard",
+ "phpcs",
+ "standards",
+ "static analysis"
+ ],
+ "support": {
+ "issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues",
+ "security": "https://github.com/PHPCSStandards/PHPCSExtra/security/policy",
+ "source": "https://github.com/PHPCSStandards/PHPCSExtra"
+ },
+ "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": "2023-12-08T16:49:07+00:00"
+ },
+ {
+ "name": "phpcsstandards/phpcsutils",
+ "version": "1.0.12",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/PHPCSStandards/PHPCSUtils.git",
+ "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/87b233b00daf83fb70f40c9a28692be017ea7c6c",
+ "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c",
+ "shasum": ""
+ },
+ "require": {
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0",
+ "php": ">=5.4",
+ "squizlabs/php_codesniffer": "^3.10.0 || 4.0.x-dev@dev"
+ },
+ "require-dev": {
+ "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": "Juliette Reinders Folmer",
+ "homepage": "https://github.com/jrfnl",
+ "role": "lead"
+ },
+ {
+ "name": "Contributors",
+ "homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors"
+ }
+ ],
+ "description": "A suite of utility functions for use with PHP_CodeSniffer",
+ "homepage": "https://phpcsutils.com/",
+ "keywords": [
+ "PHP_CodeSniffer",
+ "phpcbf",
+ "phpcodesniffer-standard",
+ "phpcs",
+ "phpcs3",
+ "standards",
+ "static analysis",
+ "tokens",
+ "utility"
+ ],
+ "support": {
+ "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"
+ },
+ "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-05-20T13:34:27+00:00"
+ },
{
"name": "phpstan/extension-installer",
"version": "1.3.1",
@@ -5850,16 +6016,16 @@
},
{
"name": "squizlabs/php_codesniffer",
- "version": "3.8.1",
+ "version": "3.10.1",
"source": {
"type": "git",
"url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
- "reference": "14f5fff1e64118595db5408e946f3a22c75807f7"
+ "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/14f5fff1e64118595db5408e946f3a22c75807f7",
- "reference": "14f5fff1e64118595db5408e946f3a22c75807f7",
+ "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/8f90f7a53ce271935282967f53d0894f8f1ff877",
+ "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877",
"shasum": ""
},
"require": {
@@ -5926,7 +6092,7 @@
"type": "open_collective"
}
],
- "time": "2024-01-11T20:47:48+00:00"
+ "time": "2024-05-22T21:24:41+00:00"
},
{
"name": "symfony/browser-kit",
@@ -7913,30 +8079,38 @@
},
{
"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/",
@@ -7953,6 +8127,7 @@
"keywords": [
"phpcs",
"standards",
+ "static analysis",
"wordpress"
],
"support": {
@@ -7960,7 +8135,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"
},
{
"name": "yoast/phpunit-polyfills",
diff --git a/plugins/faustwp/faustwp.php b/plugins/faustwp/faustwp.php
index aa682b40b..5bee41161 100644
--- a/plugins/faustwp/faustwp.php
+++ b/plugins/faustwp/faustwp.php
@@ -23,7 +23,7 @@
}
define( 'FAUSTWP_FILE', __FILE__ );
-define( 'FAUSTWP_DIR', dirname( __FILE__ ) );
+define( 'FAUSTWP_DIR', __DIR__ );
define( 'FAUSTWP_URL', plugin_dir_url( __FILE__ ) );
define( 'FAUSTWP_PATH', plugin_basename( FAUSTWP_FILE ) );
define( 'FAUSTWP_SLUG', dirname( plugin_basename( FAUSTWP_FILE ) ) );
diff --git a/plugins/faustwp/includes/replacement/functions.php b/plugins/faustwp/includes/replacement/functions.php
index 056a932b7..da5f69382 100644
--- a/plugins/faustwp/includes/replacement/functions.php
+++ b/plugins/faustwp/includes/replacement/functions.php
@@ -97,13 +97,13 @@ function normalize_sitemap_entry( $sitemap_entry ) {
/**
* Check if a string has a file extension.
*
- * @param string $string The string to check.
+ * @param string $file The string to check.
* @return boolean
*/
-function has_file_extension( $string ) {
+function has_file_extension( $file ) {
$file_extension_pattern = '/\.[a-zA-Z0-9]+$/';
- if ( preg_match( $file_extension_pattern, $string ) ) {
+ if ( preg_match( $file_extension_pattern, $file ) ) {
return true;
} else {
return false; // String does not have a file extension.
diff --git a/plugins/faustwp/includes/settings/functions.php b/plugins/faustwp/includes/settings/functions.php
index dda231956..fb8f0b900 100644
--- a/plugins/faustwp/includes/settings/functions.php
+++ b/plugins/faustwp/includes/settings/functions.php
@@ -89,13 +89,13 @@ function get_secret_key() {
/**
* Get a Faust setting by name.
*
- * @param string $name The setting name.
- * @param mixed $default Optional setting value. Default false.
+ * @param string $name The setting name.
+ * @param mixed $default_value Optional setting value. Default false.
*
* @return mixed The setting value.
*/
-function faustwp_get_setting( $name, $default = false ) {
- $value = $default;
+function faustwp_get_setting( $name, $default_value = false ) {
+ $value = $default_value;
$settings = faustwp_get_settings();
if ( isset( $settings[ $name ] ) ) {
@@ -107,9 +107,9 @@ function faustwp_get_setting( $name, $default = false ) {
*
* @param mixed $value The setting value.
* @param string $name The setting name.
- * @param mixed $default Optional setting value.
+ * @param mixed $default_value Optional setting value.
*/
- return apply_filters( 'faustwp_get_setting', $value, $name, $default );
+ return apply_filters( 'faustwp_get_setting', $value, $name, $default_value );
}
/**