Skip to content

Commit 69fc061

Browse files
authored
Merge pull request #76 from Kit/updated-coding-standards
Use `WordPress` Coding Standards ruleset
2 parents 76867b5 + 65beaa6 commit 69fc061

7 files changed

+667
-342
lines changed

LICENSE

+646-311
Large diffs are not rendered by default.

includes/class-integrate-convertkit-wpforms.php

+5-5
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 );

integrate-convertkit-wpforms.php

+8-16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php
22
/**
3+
* Kit (formerly ConvertKit) for WPForms Plugin.
4+
*
5+
* @package ConvertKit
6+
* @author ConvertKit
7+
*
8+
* @wordpress-plugin
39
* Plugin Name: Kit (formerly ConvertKit) for WPForms
410
* Plugin URI: https://kit.com
511
* Description: Create Kit signup forms using WPForms
@@ -8,22 +14,8 @@
814
* Author URI: https://kit.com
915
* Text Domain: integrate-convertkit-wpforms
1016
* Domain Path: /languages
11-
* License: GPLv2 or later
12-
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
13-
*
14-
* This program is free software; you can redistribute it and/or modify it under
15-
* the terms of the GNU General Public License version 2, as published by the
16-
* Free Software Foundation. You may NOT assume that you can use any other
17-
* version of the GPL.
18-
*
19-
* This program is distributed in the hope that it will be useful, but WITHOUT
20-
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
21-
* FOR A PARTICULAR PURPOSE.
22-
*
23-
* @package Integrate_ConvertKit_WPForms
24-
* @since 1.0.0
25-
* @copyright Copyright (c) 2017, Bill Erickson
26-
* @license GPL-2.0+
17+
* License: GPLv3 or later
18+
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
2719
*/
2820

2921
// Exit if accessed directly.

languages/integrate-convertkit-wpforms.pot

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copyright (C) 2025 Kit
2-
# This file is distributed under the GPLv2 or later.
2+
# This file is distributed under the GPLv3 or later.
33
msgid ""
44
msgstr ""
55
"Project-Id-Version: Kit (formerly ConvertKit) for WPForms 1.7.9\n"
@@ -9,7 +9,7 @@ msgstr ""
99
"MIME-Version: 1.0\n"
1010
"Content-Type: text/plain; charset=UTF-8\n"
1111
"Content-Transfer-Encoding: 8bit\n"
12-
"POT-Creation-Date: 2025-01-23T02:49:51+00:00\n"
12+
"POT-Creation-Date: 2025-02-25T02:11:41+00:00\n"
1313
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1414
"X-Generator: WP-CLI 2.10.0\n"
1515
"X-Domain: integrate-convertkit-wpforms\n"

phpcs.xml

+3-5
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"/>

readme.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Tags: form, wpforms, convertkit, email, marketing
55
Requires at least: 5.0
66
Tested up to: 6.7.1
77
Stable tag: 1.7.9
8-
License: GPLv2 or later
9-
License URI: http://www.gnu.org/licenses/gpl-2.0.html
8+
License: GPLv3 or later
9+
License URI: https://www.gnu.org/licenses/gpl-3.0.html
1010

1111
Create Kit signup forms using WPForms
1212

tests/acceptance/recommendations/RecommendationsCest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public function testCreatorNetworkRecommendationsWithAJAXEnabled(AcceptanceTeste
205205
// Wait for Creator Network Recommendations modal to display.
206206
$I->waitForElementVisible('.formkit-modal');
207207
$I->switchToIFrame('.formkit-modal iframe');
208-
$I->waitForElementVisible('div[data-component="Page"]');
208+
$I->waitForElementVisible('main[data-component="Page"]');
209209
$I->switchToIFrame();
210210

211211
// Close the modal.

0 commit comments

Comments
 (0)