- Fix mixed tab/space indentation on phpcs:disable/enable comment lines - Exclude PHPMD Superglobals rule: WordPress plugins legitimately use $_GET in testing branches with filter_input() for production; the rule produces false positives in this pattern - All other findings (wp_unslash, comment punctuation, else clause) were already addressed in prior commits on main
This commit is contained in:
@@ -46,8 +46,8 @@ class Admin {
|
|||||||
*/
|
*/
|
||||||
public function enqueue_admin_assets(): void {
|
public function enqueue_admin_assets(): void {
|
||||||
|
|
||||||
// @phpcs:disable WordPress.Security.NonceVerification.Recommended
|
// @phpcs:disable WordPress.Security.NonceVerification.Recommended
|
||||||
// @phpcs:disable WordPress.Security.NonceVerification.Missing
|
// @phpcs:disable WordPress.Security.NonceVerification.Missing
|
||||||
// For production, use filter_input.
|
// For production, use filter_input.
|
||||||
$page = '';
|
$page = '';
|
||||||
if ( defined( 'PHPUNIT_RUNNING' ) && PHPUNIT_RUNNING ) {
|
if ( defined( 'PHPUNIT_RUNNING' ) && PHPUNIT_RUNNING ) {
|
||||||
@@ -64,7 +64,7 @@ class Admin {
|
|||||||
if ( ! $page || 'wp_plugin_starter_template_settings' !== $page ) {
|
if ( ! $page || 'wp_plugin_starter_template_settings' !== $page ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// @phpcs:enable
|
// @phpcs:enable
|
||||||
|
|
||||||
// Get the plugin version.
|
// Get the plugin version.
|
||||||
$plugin_version = $this->core->get_plugin_version();
|
$plugin_version = $this->core->get_plugin_version();
|
||||||
|
|||||||
@@ -15,6 +15,8 @@
|
|||||||
<exclude name="CamelCaseMethodName" />
|
<exclude name="CamelCaseMethodName" />
|
||||||
<exclude name="CamelCaseParameterName" />
|
<exclude name="CamelCaseParameterName" />
|
||||||
<exclude name="CamelCaseVariableName" />
|
<exclude name="CamelCaseVariableName" />
|
||||||
|
<!-- WordPress plugins use filter_input() for production and $_GET for testing; Superglobals rule is not applicable. -->
|
||||||
|
<exclude name="Superglobals" />
|
||||||
</rule>
|
</rule>
|
||||||
<rule ref="rulesets/design.xml" />
|
<rule ref="rulesets/design.xml" />
|
||||||
<rule ref="rulesets/naming.xml">
|
<rule ref="rulesets/naming.xml">
|
||||||
|
|||||||
Reference in New Issue
Block a user