Skip to content

Commit f919a4f

Browse files
committed
Updated Coding Standards
1 parent 76867b5 commit f919a4f

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

includes/class-integrate-convertkit-wpforms.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ private function get_referrer_url( $form_data ) {
489489

490490
// If the request includes the page_url, return that URL.
491491
if ( array_key_exists( 'page_url', $_REQUEST ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
492-
return esc_url( $_REQUEST['page_url'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
492+
return esc_url( sanitize_text_field( wp_unslash( $_REQUEST['page_url'] ) ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
493493
}
494494

495495
// Return the AJAX URL.
@@ -715,7 +715,7 @@ public function maybe_display_notice() {
715715
sprintf(
716716
'%s %s',
717717
esc_html__( 'Kit: ', 'integrate-convertkit-wpforms' ),
718-
sanitize_text_field( $_REQUEST['error_description'] ) // phpcs:ignore WordPress.Security.NonceVerification
718+
sanitize_text_field( wp_unslash( $_REQUEST['error_description'] ) ) // phpcs:ignore WordPress.Security.NonceVerification
719719
)
720720
);
721721
}
@@ -733,7 +733,7 @@ public function maybe_get_and_store_access_token() {
733733
if ( ! array_key_exists( 'page', $_REQUEST ) ) { // phpcs:ignore WordPress.Security.NonceVerification
734734
return;
735735
}
736-
if ( $_REQUEST['page'] !== 'wpforms-settings' ) { // phpcs:ignore WordPress.Security.NonceVerification
736+
if ( sanitize_text_field( wp_unslash( $_REQUEST['page'] ) ) !== 'wpforms-settings' ) { // phpcs:ignore WordPress.Security.NonceVerification
737737
return;
738738
}
739739

@@ -750,7 +750,7 @@ public function maybe_get_and_store_access_token() {
750750
}
751751

752752
// Sanitize token.
753-
$authorization_code = sanitize_text_field( $_REQUEST['code'] ); // phpcs:ignore WordPress.Security.NonceVerification
753+
$authorization_code = sanitize_text_field( wp_unslash( $_REQUEST['code'] ) ); // phpcs:ignore WordPress.Security.NonceVerification
754754

755755
// Exchange the authorization code and verifier for an access token.
756756
$api = new Integrate_ConvertKit_WPForms_API(
@@ -843,7 +843,7 @@ public function delete_resource_cache() {
843843
}
844844

845845
// Sanitize data.
846-
$account_id = sanitize_text_field( $_POST['key'] );
846+
$account_id = sanitize_text_field( wp_unslash( $_POST['key'] ) );
847847

848848
// Get API instance.
849849
$api = $this->get_api_instance( $account_id );

phpcs.xml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<!-- Exclude minified Javascript files. -->
1111
<exclude-pattern>*.min.js</exclude-pattern>
1212

13-
<!-- Check that code meets WordPress-Extra standards. -->
14-
<rule ref="WordPress-Extra">
13+
<!-- Check that code meets WordPress standards - this includes core, docs and extra. -->
14+
<rule ref="WordPress">
1515
<!--
1616
We may want a middle ground though. The best way to do this is add the
1717
entire ruleset, then rule by rule, remove ones that don't suit a project.
@@ -29,13 +29,11 @@
2929
<exclude name="WordPress.Security.EscapeOutput"/>
3030
-->
3131
<exclude name="WordPress.PHP.YodaConditions" />
32+
<exclude name="WordPress.DB.SlowDBQuery.slow_db_query_meta_query" />
3233
<exclude name="PSR2.Methods.FunctionClosingBrace.SpacingBeforeClose" />
3334
<exclude name="PSR2.Classes.ClassDeclaration.CloseBraceAfterBody" />
3435
</rule>
3536

36-
<!-- Check that code is documented to WordPress Standards. -->
37-
<rule ref="WordPress-Docs"/>
38-
3937
<!-- Add in some extra rules from other standards. -->
4038
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
4139
<rule ref="Generic.Commenting.Todo"/>

0 commit comments

Comments
 (0)