Changeset 3728375
- Timestamp:
- 10/05/2026 08:16:33 AM (3 weeks ago)
- Location:
- integrate-convertkit-wpforms
- Files:
-
- 12 edited
- 1 copied
-
tags/2.0.0 (copied) (copied from integrate-convertkit-wpforms/trunk )
-
tags/2.0.0/includes/class-integrate-convertkit-wpforms.php (modified) (4 diffs)
-
tags/2.0.0/includes/functions.php (modified) (1 diff)
-
tags/2.0.0/integrate-convertkit-wpforms.php (modified) (2 diffs)
-
tags/2.0.0/languages/integrate-convertkit-wpforms.pot (modified) (3 diffs)
-
tags/2.0.0/readme.txt (modified) (2 diffs)
-
tags/2.0.0/views/backend/settings-integration.php (modified) (1 diff)
-
trunk/includes/class-integrate-convertkit-wpforms.php (modified) (4 diffs)
-
trunk/includes/functions.php (modified) (1 diff)
-
trunk/integrate-convertkit-wpforms.php (modified) (2 diffs)
-
trunk/languages/integrate-convertkit-wpforms.pot (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/views/backend/settings-integration.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
integrate-convertkit-wpforms/tags/2.0.0/includes/class-integrate-convertkit-wpforms.php
r3504867 r3728375 107 107 $reconnect_button = sprintf( 108 108 '<a href="%s" class="%s-reconnect">%s</a>', 109 esc_url( $api->get_oauth_url( admin_url( 'admin.php?page=wpforms-settings&view=integrations') ) ),109 esc_url( $api->get_oauth_url( integrate_convertkit_wpforms_get_oauth_return_url() ) ), 110 110 esc_attr( $this->slug ), 111 111 esc_html__( 'Reconnect', 'integrate-convertkit-wpforms' ) … … 657 657 return sprintf( 658 658 '<div class="wpforms-connection-block"><a href="%s" class="wpforms-btn wpforms-btn-md wpforms-btn-orange" data-provider="convertkit" target="_blank" rel="noopener noreferrer">%s</a></div>', 659 esc_url( $api->get_oauth_url( admin_url( 'admin.php?page=wpforms-settings&view=integrations&convertkit-modal=1') ) ),659 esc_url( $api->get_oauth_url( integrate_convertkit_wpforms_get_oauth_return_url( true ) ) ), 660 660 esc_html__( 'Connect to Kit', 'integrate-convertkit-wpforms' ) 661 661 ); … … 816 816 public function maybe_get_and_store_access_token() { 817 817 818 // phpcs:disable WordPress.Security.NonceVerification 819 818 820 // Bail if we're not on the integration screen. 819 if ( ! array_key_exists( 'page', $_REQUEST ) ) { // phpcs:ignore WordPress.Security.NonceVerification821 if ( ! array_key_exists( 'page', $_REQUEST ) ) { 820 822 return; 821 823 } 822 if ( sanitize_text_field( wp_unslash( $_REQUEST['page'] ) ) !== 'wpforms-settings' ) { // phpcs:ignore WordPress.Security.NonceVerification824 if ( sanitize_text_field( wp_unslash( $_REQUEST['page'] ) ) !== 'wpforms-settings' ) { 823 825 return; 824 826 } 825 826 if ( ! array_key_exists( 'view', $_REQUEST ) ) { // phpcs:ignore WordPress.Security.NonceVerification 827 if ( ! array_key_exists( 'view', $_REQUEST ) ) { 827 828 return; 828 829 } 829 if ( $_REQUEST['view'] !== 'integrations' ) { // phpcs:ignore WordPress.Security.NonceVerification830 if ( sanitize_text_field( wp_unslash( $_REQUEST['view'] ) ) !== 'integrations' ) { 830 831 return; 831 832 } 832 833 833 // Bail if no authorization code is included in the request .834 if ( ! array_key_exists( 'code', $_REQUEST ) ) { // phpcs:ignore WordPress.Security.NonceVerification834 // Bail if no authorization code is included in the request, as this isn't an OAuth callback. 835 if ( ! array_key_exists( 'code', $_REQUEST ) ) { 835 836 return; 836 837 } 837 838 839 // phpcs:enable 840 841 // Redirect to the integrations screen if the user isn't permitted to manage WPForms settings. 842 if ( ! wpforms_current_user_can() ) { 843 wp_safe_redirect( $this->get_integrations_url() ); 844 exit(); 845 } 846 847 // Redirect with an error if the nonce is missing or invalid. 848 if ( ! isset( $_REQUEST['nonce'] ) || ! wp_verify_nonce( sanitize_key( $_REQUEST['nonce'] ), INTEGRATE_CONVERTKIT_WPFORMS_NONCE_ACTION_OAUTH_CONNECT ) ) { 849 wp_safe_redirect( 850 $this->get_integrations_url( 851 array( 852 'error_description' => __( 'The authorization request could not be verified. Please click Connect to Kit again.', 'integrate-convertkit-wpforms' ), 853 ) 854 ) 855 ); 856 exit(); 857 } 858 838 859 // Sanitize token. 839 $authorization_code = sanitize_text_field( wp_unslash( $_REQUEST['code'] ) ); // phpcs:ignore WordPress.Security.NonceVerification860 $authorization_code = sanitize_text_field( wp_unslash( $_REQUEST['code'] ) ); 840 861 841 862 // Exchange the authorization code and verifier for an access token. … … 933 954 934 955 } 956 935 957 936 958 /** -
integrate-convertkit-wpforms/tags/2.0.0/includes/functions.php
r3422915 r3728375 149 149 } 150 150 151 /** 152 * Returns the URL Kit redirects to after the user authorizes the Plugin via OAuth, 153 * including a nonce that is verified before the authorization code is exchanged 154 * for an access token. 155 * 156 * @since 2.0.0 157 * 158 * @param bool $modal Whether the OAuth flow is served in the form builder's popup window. 159 * @return string OAuth Return URL 160 */ 161 function integrate_convertkit_wpforms_get_oauth_return_url( $modal = false ) { 162 163 $args = array( 164 'page' => 'wpforms-settings', 165 'view' => 'integrations', 166 'nonce' => wp_create_nonce( INTEGRATE_CONVERTKIT_WPFORMS_NONCE_ACTION_OAUTH_CONNECT ), 167 ); 168 169 // Close the popup window once connected, if the OAuth flow started in the form builder. 170 if ( $modal ) { 171 $args['convertkit-modal'] = '1'; 172 } 173 174 return add_query_arg( $args, admin_url( 'admin.php' ) ); 175 176 } 177 151 178 // Update Access Token when refreshed by the API class. 152 179 add_action( 'convertkit_api_refresh_token', 'integrate_convertkit_wpforms_maybe_update_credentials', 10, 3 ); -
integrate-convertkit-wpforms/tags/2.0.0/integrate-convertkit-wpforms.php
r3698141 r3728375 10 10 * Plugin URI: https://kit.com 11 11 * Description: Create Kit signup forms using WPForms 12 * Version: 1.9.912 * Version: 2.0.0 13 13 * Author: Kit 14 14 * Author URI: https://kit.com … … 29 29 define( 'INTEGRATE_CONVERTKIT_WPFORMS_URL', plugin_dir_url( __FILE__ ) ); 30 30 define( 'INTEGRATE_CONVERTKIT_WPFORMS_PATH', __DIR__ ); 31 define( 'INTEGRATE_CONVERTKIT_WPFORMS_VERSION', ' 1.9.9' );31 define( 'INTEGRATE_CONVERTKIT_WPFORMS_VERSION', '2.0.0' ); 32 32 define( 'INTEGRATE_CONVERTKIT_WPFORMS_OAUTH_CLIENT_ID', '147qqKJeENYp5MqgL6AOShDDcLK3UQeClmcIV1ij3gI' ); 33 33 define( 'INTEGRATE_CONVERTKIT_WPFORMS_OAUTH_REDIRECT_URI', 'https://app.kit.com/wordpress/redirect' ); 34 define( 'INTEGRATE_CONVERTKIT_WPFORMS_NONCE_ACTION_OAUTH_CONNECT', 'integrate-convertkit-wpforms-oauth-connect' ); 34 35 35 36 // Load shared classes, if they have not been included by another ConvertKit Plugin. -
integrate-convertkit-wpforms/tags/2.0.0/languages/integrate-convertkit-wpforms.pot
r3698141 r3728375 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Kit (formerly ConvertKit) for WPForms 1.9.9\n"5 "Project-Id-Version: Kit (formerly ConvertKit) for WPForms 2.0.0\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/convertkit-wpforms\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2026- 09-15T13:15:08+00:00\n"12 "POT-Creation-Date: 2026-10-05T02:23:48+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" … … 254 254 msgstr "" 255 255 256 #: includes/class-integrate-convertkit-wpforms.php:971 256 #: includes/class-integrate-convertkit-wpforms.php:852 257 msgid "The authorization request could not be verified. Please click Connect to Kit again." 258 msgstr "" 259 260 #: includes/class-integrate-convertkit-wpforms.php:993 257 261 msgid "The Kit WordPress Libraries is missing the `revoke_tokens` method. Please update all Kit WordPress Plugins to their latest versions, and click Disconnect again." 258 262 msgstr "" 259 263 260 #: includes/class-integrate-convertkit-wpforms.php:10 16264 #: includes/class-integrate-convertkit-wpforms.php:1038 261 265 msgid "Kit: Email" 262 266 msgstr "" 263 267 264 #: includes/class-integrate-convertkit-wpforms.php:10 22268 #: includes/class-integrate-convertkit-wpforms.php:1044 265 269 msgid "Kit: First Name" 266 270 msgstr "" 267 271 268 #: includes/class-integrate-convertkit-wpforms.php:10 27272 #: includes/class-integrate-convertkit-wpforms.php:1049 269 273 msgid "Kit: Tag" 270 274 msgstr "" 271 275 272 276 #. translators: ConvertKit Custom Field label 273 #: includes/class-integrate-convertkit-wpforms.php:10 60277 #: includes/class-integrate-convertkit-wpforms.php:1082 274 278 #, php-format 275 279 msgid "Kit: Custom Field: %s" 276 280 msgstr "" 277 281 278 #: includes/class-integrate-convertkit-wpforms.php:1 095282 #: includes/class-integrate-convertkit-wpforms.php:1117 279 283 msgid "No Kit connections exist." 280 284 msgstr "" 281 285 282 286 #. translators: WPForms ConvertKit Account ID 283 #: includes/class-integrate-convertkit-wpforms.php:11 03287 #: includes/class-integrate-convertkit-wpforms.php:1125 284 288 #, php-format 285 289 msgid "The Kit connection with ID %s was unregistered." -
integrate-convertkit-wpforms/tags/2.0.0/readme.txt
r3698141 r3728375 6 6 Tested up to: 7.1 7 7 Requires PHP: 7.1 8 Stable tag: 1.9.98 Stable tag: 2.0.0 9 9 License: GPLv3 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 45 45 46 46 == Changelog == 47 48 ### 2.0.0 2026-10-05 49 * Fix: OAuth: Connect: Check user has required permissions 50 * Fix: OAuth: Connect: Use nonce to prevent CSRF 47 51 48 52 ### 1.9.9 2026-09-15 -
integrate-convertkit-wpforms/tags/2.0.0/views/backend/settings-integration.php
r3186873 r3728375 9 9 ?> 10 10 11 <a href="<?php echo esc_url( $api->get_oauth_url( admin_url( 'admin.php?page=wpforms-settings&view=integrations'), get_site_url() ) ); ?>" class="wpforms-btn wpforms-btn-md wpforms-btn-orange">11 <a href="<?php echo esc_url( $api->get_oauth_url( integrate_convertkit_wpforms_get_oauth_return_url(), get_site_url() ) ); ?>" class="wpforms-btn wpforms-btn-md wpforms-btn-orange"> 12 12 <?php esc_html_e( 'Connect to Kit', 'integrate-convertkit-wpforms' ); ?> 13 13 </a> -
integrate-convertkit-wpforms/trunk/includes/class-integrate-convertkit-wpforms.php
r3504867 r3728375 107 107 $reconnect_button = sprintf( 108 108 '<a href="%s" class="%s-reconnect">%s</a>', 109 esc_url( $api->get_oauth_url( admin_url( 'admin.php?page=wpforms-settings&view=integrations') ) ),109 esc_url( $api->get_oauth_url( integrate_convertkit_wpforms_get_oauth_return_url() ) ), 110 110 esc_attr( $this->slug ), 111 111 esc_html__( 'Reconnect', 'integrate-convertkit-wpforms' ) … … 657 657 return sprintf( 658 658 '<div class="wpforms-connection-block"><a href="%s" class="wpforms-btn wpforms-btn-md wpforms-btn-orange" data-provider="convertkit" target="_blank" rel="noopener noreferrer">%s</a></div>', 659 esc_url( $api->get_oauth_url( admin_url( 'admin.php?page=wpforms-settings&view=integrations&convertkit-modal=1') ) ),659 esc_url( $api->get_oauth_url( integrate_convertkit_wpforms_get_oauth_return_url( true ) ) ), 660 660 esc_html__( 'Connect to Kit', 'integrate-convertkit-wpforms' ) 661 661 ); … … 816 816 public function maybe_get_and_store_access_token() { 817 817 818 // phpcs:disable WordPress.Security.NonceVerification 819 818 820 // Bail if we're not on the integration screen. 819 if ( ! array_key_exists( 'page', $_REQUEST ) ) { // phpcs:ignore WordPress.Security.NonceVerification821 if ( ! array_key_exists( 'page', $_REQUEST ) ) { 820 822 return; 821 823 } 822 if ( sanitize_text_field( wp_unslash( $_REQUEST['page'] ) ) !== 'wpforms-settings' ) { // phpcs:ignore WordPress.Security.NonceVerification824 if ( sanitize_text_field( wp_unslash( $_REQUEST['page'] ) ) !== 'wpforms-settings' ) { 823 825 return; 824 826 } 825 826 if ( ! array_key_exists( 'view', $_REQUEST ) ) { // phpcs:ignore WordPress.Security.NonceVerification 827 if ( ! array_key_exists( 'view', $_REQUEST ) ) { 827 828 return; 828 829 } 829 if ( $_REQUEST['view'] !== 'integrations' ) { // phpcs:ignore WordPress.Security.NonceVerification830 if ( sanitize_text_field( wp_unslash( $_REQUEST['view'] ) ) !== 'integrations' ) { 830 831 return; 831 832 } 832 833 833 // Bail if no authorization code is included in the request .834 if ( ! array_key_exists( 'code', $_REQUEST ) ) { // phpcs:ignore WordPress.Security.NonceVerification834 // Bail if no authorization code is included in the request, as this isn't an OAuth callback. 835 if ( ! array_key_exists( 'code', $_REQUEST ) ) { 835 836 return; 836 837 } 837 838 839 // phpcs:enable 840 841 // Redirect to the integrations screen if the user isn't permitted to manage WPForms settings. 842 if ( ! wpforms_current_user_can() ) { 843 wp_safe_redirect( $this->get_integrations_url() ); 844 exit(); 845 } 846 847 // Redirect with an error if the nonce is missing or invalid. 848 if ( ! isset( $_REQUEST['nonce'] ) || ! wp_verify_nonce( sanitize_key( $_REQUEST['nonce'] ), INTEGRATE_CONVERTKIT_WPFORMS_NONCE_ACTION_OAUTH_CONNECT ) ) { 849 wp_safe_redirect( 850 $this->get_integrations_url( 851 array( 852 'error_description' => __( 'The authorization request could not be verified. Please click Connect to Kit again.', 'integrate-convertkit-wpforms' ), 853 ) 854 ) 855 ); 856 exit(); 857 } 858 838 859 // Sanitize token. 839 $authorization_code = sanitize_text_field( wp_unslash( $_REQUEST['code'] ) ); // phpcs:ignore WordPress.Security.NonceVerification860 $authorization_code = sanitize_text_field( wp_unslash( $_REQUEST['code'] ) ); 840 861 841 862 // Exchange the authorization code and verifier for an access token. … … 933 954 934 955 } 956 935 957 936 958 /** -
integrate-convertkit-wpforms/trunk/includes/functions.php
r3422915 r3728375 149 149 } 150 150 151 /** 152 * Returns the URL Kit redirects to after the user authorizes the Plugin via OAuth, 153 * including a nonce that is verified before the authorization code is exchanged 154 * for an access token. 155 * 156 * @since 2.0.0 157 * 158 * @param bool $modal Whether the OAuth flow is served in the form builder's popup window. 159 * @return string OAuth Return URL 160 */ 161 function integrate_convertkit_wpforms_get_oauth_return_url( $modal = false ) { 162 163 $args = array( 164 'page' => 'wpforms-settings', 165 'view' => 'integrations', 166 'nonce' => wp_create_nonce( INTEGRATE_CONVERTKIT_WPFORMS_NONCE_ACTION_OAUTH_CONNECT ), 167 ); 168 169 // Close the popup window once connected, if the OAuth flow started in the form builder. 170 if ( $modal ) { 171 $args['convertkit-modal'] = '1'; 172 } 173 174 return add_query_arg( $args, admin_url( 'admin.php' ) ); 175 176 } 177 151 178 // Update Access Token when refreshed by the API class. 152 179 add_action( 'convertkit_api_refresh_token', 'integrate_convertkit_wpforms_maybe_update_credentials', 10, 3 ); -
integrate-convertkit-wpforms/trunk/integrate-convertkit-wpforms.php
r3698141 r3728375 10 10 * Plugin URI: https://kit.com 11 11 * Description: Create Kit signup forms using WPForms 12 * Version: 1.9.912 * Version: 2.0.0 13 13 * Author: Kit 14 14 * Author URI: https://kit.com … … 29 29 define( 'INTEGRATE_CONVERTKIT_WPFORMS_URL', plugin_dir_url( __FILE__ ) ); 30 30 define( 'INTEGRATE_CONVERTKIT_WPFORMS_PATH', __DIR__ ); 31 define( 'INTEGRATE_CONVERTKIT_WPFORMS_VERSION', ' 1.9.9' );31 define( 'INTEGRATE_CONVERTKIT_WPFORMS_VERSION', '2.0.0' ); 32 32 define( 'INTEGRATE_CONVERTKIT_WPFORMS_OAUTH_CLIENT_ID', '147qqKJeENYp5MqgL6AOShDDcLK3UQeClmcIV1ij3gI' ); 33 33 define( 'INTEGRATE_CONVERTKIT_WPFORMS_OAUTH_REDIRECT_URI', 'https://app.kit.com/wordpress/redirect' ); 34 define( 'INTEGRATE_CONVERTKIT_WPFORMS_NONCE_ACTION_OAUTH_CONNECT', 'integrate-convertkit-wpforms-oauth-connect' ); 34 35 35 36 // Load shared classes, if they have not been included by another ConvertKit Plugin. -
integrate-convertkit-wpforms/trunk/languages/integrate-convertkit-wpforms.pot
r3698141 r3728375 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Kit (formerly ConvertKit) for WPForms 1.9.9\n"5 "Project-Id-Version: Kit (formerly ConvertKit) for WPForms 2.0.0\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/convertkit-wpforms\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2026- 09-15T13:15:08+00:00\n"12 "POT-Creation-Date: 2026-10-05T02:23:48+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" … … 254 254 msgstr "" 255 255 256 #: includes/class-integrate-convertkit-wpforms.php:971 256 #: includes/class-integrate-convertkit-wpforms.php:852 257 msgid "The authorization request could not be verified. Please click Connect to Kit again." 258 msgstr "" 259 260 #: includes/class-integrate-convertkit-wpforms.php:993 257 261 msgid "The Kit WordPress Libraries is missing the `revoke_tokens` method. Please update all Kit WordPress Plugins to their latest versions, and click Disconnect again." 258 262 msgstr "" 259 263 260 #: includes/class-integrate-convertkit-wpforms.php:10 16264 #: includes/class-integrate-convertkit-wpforms.php:1038 261 265 msgid "Kit: Email" 262 266 msgstr "" 263 267 264 #: includes/class-integrate-convertkit-wpforms.php:10 22268 #: includes/class-integrate-convertkit-wpforms.php:1044 265 269 msgid "Kit: First Name" 266 270 msgstr "" 267 271 268 #: includes/class-integrate-convertkit-wpforms.php:10 27272 #: includes/class-integrate-convertkit-wpforms.php:1049 269 273 msgid "Kit: Tag" 270 274 msgstr "" 271 275 272 276 #. translators: ConvertKit Custom Field label 273 #: includes/class-integrate-convertkit-wpforms.php:10 60277 #: includes/class-integrate-convertkit-wpforms.php:1082 274 278 #, php-format 275 279 msgid "Kit: Custom Field: %s" 276 280 msgstr "" 277 281 278 #: includes/class-integrate-convertkit-wpforms.php:1 095282 #: includes/class-integrate-convertkit-wpforms.php:1117 279 283 msgid "No Kit connections exist." 280 284 msgstr "" 281 285 282 286 #. translators: WPForms ConvertKit Account ID 283 #: includes/class-integrate-convertkit-wpforms.php:11 03287 #: includes/class-integrate-convertkit-wpforms.php:1125 284 288 #, php-format 285 289 msgid "The Kit connection with ID %s was unregistered." -
integrate-convertkit-wpforms/trunk/readme.txt
r3698141 r3728375 6 6 Tested up to: 7.1 7 7 Requires PHP: 7.1 8 Stable tag: 1.9.98 Stable tag: 2.0.0 9 9 License: GPLv3 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 45 45 46 46 == Changelog == 47 48 ### 2.0.0 2026-10-05 49 * Fix: OAuth: Connect: Check user has required permissions 50 * Fix: OAuth: Connect: Use nonce to prevent CSRF 47 51 48 52 ### 1.9.9 2026-09-15 -
integrate-convertkit-wpforms/trunk/views/backend/settings-integration.php
r3186873 r3728375 9 9 ?> 10 10 11 <a href="<?php echo esc_url( $api->get_oauth_url( admin_url( 'admin.php?page=wpforms-settings&view=integrations'), get_site_url() ) ); ?>" class="wpforms-btn wpforms-btn-md wpforms-btn-orange">11 <a href="<?php echo esc_url( $api->get_oauth_url( integrate_convertkit_wpforms_get_oauth_return_url(), get_site_url() ) ); ?>" class="wpforms-btn wpforms-btn-md wpforms-btn-orange"> 12 12 <?php esc_html_e( 'Connect to Kit', 'integrate-convertkit-wpforms' ); ?> 13 13 </a>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)