From 6fea79a6c9d7c8e780e4a000383ef1945aac6429 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Tue, 9 Jan 2024 15:15:26 +0000 Subject: [PATCH 1/3] Remove jQuery dependency injection for Landing Pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ConvertKit 2.4.2 and higher no longer uses jQuery on the frontend site, so `convertkit.js` doesn’t require jQuery be loaded on a landing page. --- src/class-convertkit-api.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/class-convertkit-api.php b/src/class-convertkit-api.php index 2fb971a..e704557 100644 --- a/src/class-convertkit-api.php +++ b/src/class-convertkit-api.php @@ -1498,7 +1498,6 @@ public function get_landing_page_html( $url ) { // wp_enqueue_script() isn't called when we load a Landing Page, so we can't use it. // phpcs:disable WordPress.WP.EnqueuedResources $scripts = new WP_Scripts(); - $script = ""; $script .= ""; $script .= "'; // phpcs:enable From 1f705f3ea8b2d3aa59c183e1118623b6cbc4e6e2 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Tue, 9 Jan 2024 15:17:08 +0000 Subject: [PATCH 2/3] Fix undefined variable; remove unused `WP_Scripts` class --- src/class-convertkit-api.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/class-convertkit-api.php b/src/class-convertkit-api.php index e704557..75c1a32 100644 --- a/src/class-convertkit-api.php +++ b/src/class-convertkit-api.php @@ -1497,8 +1497,7 @@ public function get_landing_page_html( $url ) { // Inject JS for subscriber forms to work. // wp_enqueue_script() isn't called when we load a Landing Page, so we can't use it. // phpcs:disable WordPress.WP.EnqueuedResources - $scripts = new WP_Scripts(); - $script .= ""; + $script = ""; $script .= "'; // phpcs:enable From 85327cfa453bd79e34a5fd81c5e061ae1dc1a736 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Tue, 9 Jan 2024 15:30:12 +0000 Subject: [PATCH 3/3] Coding standards --- src/class-convertkit-api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/class-convertkit-api.php b/src/class-convertkit-api.php index 75c1a32..ae2082b 100644 --- a/src/class-convertkit-api.php +++ b/src/class-convertkit-api.php @@ -1497,7 +1497,7 @@ public function get_landing_page_html( $url ) { // Inject JS for subscriber forms to work. // wp_enqueue_script() isn't called when we load a Landing Page, so we can't use it. // phpcs:disable WordPress.WP.EnqueuedResources - $script = ""; + $script = ""; $script .= "'; // phpcs:enable