diff --git a/.wordpress-org/screenshot-2.jpg b/.wordpress-org/screenshot-2.jpg index 95a8147..bac4bc0 100644 Binary files a/.wordpress-org/screenshot-2.jpg and b/.wordpress-org/screenshot-2.jpg differ diff --git a/.wordpress-org/screenshot-3.jpg b/.wordpress-org/screenshot-3.jpg index 3564f5f..42ab01c 100644 Binary files a/.wordpress-org/screenshot-3.jpg and b/.wordpress-org/screenshot-3.jpg differ diff --git a/.wordpress-org/screenshot-4.jpg b/.wordpress-org/screenshot-4.jpg index 6b895ea..858da5d 100644 Binary files a/.wordpress-org/screenshot-4.jpg and b/.wordpress-org/screenshot-4.jpg differ diff --git a/.wordpress-org/screenshot-5.jpg b/.wordpress-org/screenshot-5.jpg index ec559b4..c5b0ed0 100644 Binary files a/.wordpress-org/screenshot-5.jpg and b/.wordpress-org/screenshot-5.jpg differ diff --git a/.wordpress-org/screenshot-6.jpg b/.wordpress-org/screenshot-6.jpg index a44493a..8812134 100644 Binary files a/.wordpress-org/screenshot-6.jpg and b/.wordpress-org/screenshot-6.jpg differ diff --git a/.wordpress-org/screenshot-7.jpg b/.wordpress-org/screenshot-7.jpg index acae7b8..3a5cca1 100644 Binary files a/.wordpress-org/screenshot-7.jpg and b/.wordpress-org/screenshot-7.jpg differ diff --git a/.wordpress-org/screenshot-8.jpg b/.wordpress-org/screenshot-8.jpg index 263d7bb..471c906 100644 Binary files a/.wordpress-org/screenshot-8.jpg and b/.wordpress-org/screenshot-8.jpg differ diff --git a/CHANGELOG.md b/CHANGELOG.md index 1423318..c2fec05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,35 @@ All notable changes to this project will be documented in this file, per [the Ke ## [Unreleased] - TBD +## [2.0.0] - 2025-08-11 + +### Added + +- Form templates to the Mailchimp List Subscribe Form block, allowing users to quickly insert and publish specific forms (props [@iamdharmesh](https://github.com/iamdharmesh), [Romain Deville](https://www.linkedin.com/in/devilleromain/), [@vikrampm1](https://github.com/vikrampm1), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter), [@qasumitbagthariya](https://github.com/qasumitbagthariya) via [#171](https://github.com/mailchimp/wordpress/pull/171)). + +### Changed + +- Improved navigation and UX enhancements to the plugin settings page (props [@iamdharmesh](https://github.com/iamdharmesh), [Romain Deville](https://www.linkedin.com/in/devilleromain/), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter), [@qasumitbagthariya](https://github.com/qasumitbagthariya) via [#169](https://github.com/mailchimp/wordpress/pull/169)). +- Allowed multiple Mailchimp forms on a single page (props [@iamdharmesh](https://github.com/iamdharmesh), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter), [@qasumitbagthariya](https://github.com/qasumitbagthariya) via [#173](https://github.com/mailchimp/wordpress/pull/173)). +- Update the form ID attribute and form field ID attributes (if you're using ID selectors for custom styling, please update the selectors accordingly) (props [@iamdharmesh](https://github.com/iamdharmesh), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter), [@qasumitbagthariya](https://github.com/qasumitbagthariya) via [#173](https://github.com/mailchimp/wordpress/pull/173)). + +### Fixed + +- Phone number and required field validations (props [@iamdharmesh](https://github.com/iamdharmesh), [@MaxwellGarceau](https://github.com/MaxwellGarceau), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter), [@qasumitbagthariya](https://github.com/qasumitbagthariya) via [#159](https://github.com/mailchimp/wordpress/pull/159)). + +### Security + +- Bump `tar-fs` from 2.1.1 to 3.1.0 (props [@dependabot](https://github.com/apps/dependabot), [@iamdharmesh](https://github.com/iamdharmesh) via [#175](https://github.com/mailchimp/wordpress/pull/175)). +- Bump `form-data` from 2.3.3 to 2.5.5 and `@cypress/request` from 3.0.1 to 3.0.9 (props [@dependabot](https://github.com/apps/dependabot), [@iamdharmesh](https://github.com/iamdharmesh) via [#176](https://github.com/mailchimp/wordpress/pull/176)). +- Bump `@babel/runtime` from 7.24.6 to 7.28.2 (props [@dependabot](https://github.com/apps/dependabot), [@iamdharmesh](https://github.com/iamdharmesh) via [#177](https://github.com/mailchimp/wordpress/pull/177)). +- Bump `on-headers` from 1.0.2 to 1.1.0 and `compression` from 1.7.4 to 1.8.1 (props [@dependabot](https://github.com/apps/dependabot), [@iamdharmesh](https://github.com/iamdharmesh) via [#178](https://github.com/mailchimp/wordpress/pull/178)). +- Bump `serialize-javascript` from 6.0.0 to 6.0.2 and `mocha` from 10.4.0 to 11.7.1 (props [@dependabot](https://github.com/apps/dependabot), [@iamdharmesh](https://github.com/iamdharmesh) via [#179](https://github.com/mailchimp/wordpress/pull/179)). +- Bump `http-proxy-middleware` from 2.0.6 to 2.0.9 (props [@dependabot](https://github.com/apps/dependabot), [@iamdharmesh](https://github.com/iamdharmesh) via [#180](https://github.com/mailchimp/wordpress/pull/180)). + +### Developer + +- Update 10up-toolkit from 6.2.0 to 6.5.0 (props [@iamdharmesh](https://github.com/iamdharmesh), [@dkotter](https://github.com/dkotter) via [#174](https://github.com/mailchimp/wordpress/pull/174)). + ## [1.9.0] - 2025-06-04 ### Added @@ -323,6 +352,7 @@ All notable changes to this project will be documented in this file, per [the Ke - Security and various other improvements [Unreleased]: https://github.com/mailchimp/wordpress/compare/main...develop +[2.0.0]: https://github.com/mailchimp/wordpress/compare/1.9.0...2.0.0 [1.9.0]: https://github.com/mailchimp/wordpress/compare/1.8.0...1.9.0 [1.8.0]: https://github.com/mailchimp/wordpress/compare/1.7.0...1.8.0 [1.7.0]: https://github.com/mailchimp/wordpress/compare/1.6.3...1.7.0 diff --git a/CREDITS.md b/CREDITS.md index 4e7da9b..1f7f488 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -12,7 +12,7 @@ The following individuals are responsible for curating the list of issues, respo Thank you to all the people who have already contributed to this repository via bug reports, code, design, ideas, project management, translation, testing, etc. -[Mailchimp (@mailchimp)](https://github.com/mailchimp), [Crowd Favorite (@crowdfavorite)](https://github.com/crowdfavorite), [Matthew Richmond (@bigdawggi)](https://github.com/bigdawggi), [Devin Reams (@devinreams)](https://github.com/devinreams), [Alex King (@alexkingorg)](https://github.com/alexkingorg), [Jesse (@jessedp)](https://github.com/jessedp), [Andrew Ellis](awellis@me.com), [Evan Anderson (@ejdanderson)](https://github.com/ejdanderson), [Webb Henderson (@emerywebster)](https://github.com/emerywebster), [Steven Mathias (@ssmathias)](https://github.com/ssmathias), [Jonathan D. Johnson (@jondavidjohn)](https://github.com/jondavidjohn), [Ross Tweedie (@digitales)](https://github.com/digitales), [(@mcwill)](https://github.com/mcwill), [Andrew Austin (@andrewjaustin)](https://github.com/andrewjaustin), [Marc Queralt i Bassa (@MarcQueralt)](https://github.com/MarcQueralt), [Chris Mospaw (@mospaw)](https://github.com/mospaw), [Jonas Stensved (@jstensved)](https://github.com/jstensved), [netboy](netboy@netboy.pl), [Lenin](lenin@tasawr.com), [Bauke Zwaan (@baukezwaan)](https://github.com/baukezwaan), [Jascha Ehrenreich (@jaeh)](https://github.com/jaeh), [Chris Wilcoxson (@slushman)](https://github.com/slushman), [Luke Watts (@thisislawatts)](https://github.com/thisislawatts), [Glenn Ansley (@glennansley)](https://github.com/glennansley), [SiteGround](http://www.siteground.com/wordpress-hosting.htm), [Peter Kahoun](http://kahi.cz/), [Jan Lund](), [Michael Jaekel](), [Ιωάννης Δημοφέρλιας (John Dimoferlias)](), [Tomás Nader](), [Claudia Mansilla](http://cricava.com/), [Helen Urbanik](http://www.motomaania.ee/), [Maxime Toulliou](http://www.maximetoulliou.com/), [שגיב בית](http://www.sagive.co.il), [Okostobi](), [Stefan Des](http://www.stefandes.com), [백선기 (SK Baek)](), [Alexander Roterud aka Defrag](http://www.tigerpews.com), [Filip Stas](http://suddenelfilio.net/), [Maria Manoela Porto](), [Tiago Faria](http://xroot.org), [Alexandru Armin Roșu](), [Илья](http://fatcow.com), [Sebastian Johnsson](http://www.agiley.se/), [Hakan E.](http://kazancexpert.com/), [Josh Grosser (@jgrosser-intuit)](https://github.com/jgrosser-intuit), [10up (@10up)](https://github.com/10up), [Nate Conley (@nateconley)](https://github.com/nateconley), [Darin Kotter (@dkotter)](https://github.com/dkotter), [Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul), [Eddie Shrake (@eddieshrake)](https://github.com/eddieshrake), [Sumit Bagthariya (@qasumitbagthariya)](https://github.com/qasumitbagthariya), [Vikram Moparthy (@vikrampm1)](https://github.com/vikrampm1), [Dharmesh Patel (@iamdharmesh)](https://github.com/iamdharmesh), [GitHub Dependabot (@dependabot)](https://github.com/apps/dependabot), [Jer Clarke (@jerclarke)](https://github.com/jerclarke), [Max Garceau (@MaxwellGarceau)](https://github.com/MaxwellGarceau), [Nathan Tetzlaff](). +[Mailchimp (@mailchimp)](https://github.com/mailchimp), [Crowd Favorite (@crowdfavorite)](https://github.com/crowdfavorite), [Matthew Richmond (@bigdawggi)](https://github.com/bigdawggi), [Devin Reams (@devinreams)](https://github.com/devinreams), [Alex King (@alexkingorg)](https://github.com/alexkingorg), [Jesse (@jessedp)](https://github.com/jessedp), [Andrew Ellis](awellis@me.com), [Evan Anderson (@ejdanderson)](https://github.com/ejdanderson), [Webb Henderson (@emerywebster)](https://github.com/emerywebster), [Steven Mathias (@ssmathias)](https://github.com/ssmathias), [Jonathan D. Johnson (@jondavidjohn)](https://github.com/jondavidjohn), [Ross Tweedie (@digitales)](https://github.com/digitales), [(@mcwill)](https://github.com/mcwill), [Andrew Austin (@andrewjaustin)](https://github.com/andrewjaustin), [Marc Queralt i Bassa (@MarcQueralt)](https://github.com/MarcQueralt), [Chris Mospaw (@mospaw)](https://github.com/mospaw), [Jonas Stensved (@jstensved)](https://github.com/jstensved), [netboy](netboy@netboy.pl), [Lenin](lenin@tasawr.com), [Bauke Zwaan (@baukezwaan)](https://github.com/baukezwaan), [Jascha Ehrenreich (@jaeh)](https://github.com/jaeh), [Chris Wilcoxson (@slushman)](https://github.com/slushman), [Luke Watts (@thisislawatts)](https://github.com/thisislawatts), [Glenn Ansley (@glennansley)](https://github.com/glennansley), [SiteGround](http://www.siteground.com/wordpress-hosting.htm), [Peter Kahoun](http://kahi.cz/), [Jan Lund](), [Michael Jaekel](), [Ιωάννης Δημοφέρλιας (John Dimoferlias)](), [Tomás Nader](), [Claudia Mansilla](http://cricava.com/), [Helen Urbanik](http://www.motomaania.ee/), [Maxime Toulliou](http://www.maximetoulliou.com/), [שגיב בית](http://www.sagive.co.il), [Okostobi](), [Stefan Des](http://www.stefandes.com), [백선기 (SK Baek)](), [Alexander Roterud aka Defrag](http://www.tigerpews.com), [Filip Stas](http://suddenelfilio.net/), [Maria Manoela Porto](), [Tiago Faria](http://xroot.org), [Alexandru Armin Roșu](), [Илья](http://fatcow.com), [Sebastian Johnsson](http://www.agiley.se/), [Hakan E.](http://kazancexpert.com/), [Josh Grosser (@jgrosser-intuit)](https://github.com/jgrosser-intuit), [10up (@10up)](https://github.com/10up), [Nate Conley (@nateconley)](https://github.com/nateconley), [Darin Kotter (@dkotter)](https://github.com/dkotter), [Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul), [Eddie Shrake (@eddieshrake)](https://github.com/eddieshrake), [Sumit Bagthariya (@qasumitbagthariya)](https://github.com/qasumitbagthariya), [Vikram Moparthy (@vikrampm1)](https://github.com/vikrampm1), [Dharmesh Patel (@iamdharmesh)](https://github.com/iamdharmesh), [GitHub Dependabot (@dependabot)](https://github.com/apps/dependabot), [Jer Clarke (@jerclarke)](https://github.com/jerclarke), [Max Garceau (@MaxwellGarceau)](https://github.com/MaxwellGarceau), [Nathan Tetzlaff](), [Romain Deville](https://www.linkedin.com/in/devilleromain/). ## Libraries diff --git a/assets/css/admin.css b/assets/css/admin.css index 81b99b0..9014abd 100644 --- a/assets/css/admin.css +++ b/assets/css/admin.css @@ -1333,7 +1333,8 @@ table.widefat.mailchimp-sf-settings-table ul { outline: 2px solid var(--mailchimp-color-link); } -#mailchimp-sf-settings-page input[type="text"] { +#mailchimp-sf-settings-page input[type="text"], +#mailchimp-sf-settings-page input[type="tel"] { font-size: 16px; padding: 10px 12px; height: 40px; @@ -1347,13 +1348,15 @@ table.widefat.mailchimp-sf-settings-table ul { transition: all 0.2s; } -#mailchimp-sf-settings-page input[type="text"]:hover { +#mailchimp-sf-settings-page input[type="text"]:hover, +#mailchimp-sf-settings-page input[type="tel"]:hover { background-color: #f8fafb; border-color: #3c4348; outline: none; } -#mailchimp-sf-settings-page input[type="text"]:focus { +#mailchimp-sf-settings-page input[type="text"]:focus, +#mailchimp-sf-settings-page input[type="tel"]:focus { outline-offset: -2px; outline: 2px solid var(--mailchimp-color-link); } diff --git a/includes/mailchimp-deprecated-functions.php b/includes/mailchimp-deprecated-functions.php index f3885cd..73af8bc 100644 --- a/includes/mailchimp-deprecated-functions.php +++ b/includes/mailchimp-deprecated-functions.php @@ -118,14 +118,14 @@ function mailchimp_sf_merge_remove_empty( $merge ) { /** * Validate phone * - * @deprecated x.x.x + * @deprecated 2.0.0 * * @param array $opt_val Option value. * @param array $data Data. * @return string|WP_Error Option value or error. */ -function mailchimp_sf_merge_validate_phone( $opt_val, $data ): string|WP_Error { - _deprecated_function( __FUNCTION__, 'x.x.x', 'Mailchimp_Form_Submission::validate_phone()' ); +function mailchimp_sf_merge_validate_phone( $opt_val, $data ) { + _deprecated_function( __FUNCTION__, '2.0.0', 'Mailchimp_Form_Submission::validate_phone()' ); if ( is_array( $opt_val ) ) { $opt_val = implode( '-', $opt_val ); @@ -137,14 +137,14 @@ function mailchimp_sf_merge_validate_phone( $opt_val, $data ): string|WP_Error { /** * Validate address * - * @deprecated x.x.x + * @deprecated 2.0.0 * * @param array $opt_val Option value. * @param array $data Data. * @return mixed */ function mailchimp_sf_merge_validate_address( $opt_val, $data ) { - _deprecated_function( __FUNCTION__, 'x.x.x', 'Mailchimp_Form_Submission::validate_address()' ); + _deprecated_function( __FUNCTION__, '2.0.0', 'Mailchimp_Form_Submission::validate_address()' ); $form_submission = new Mailchimp_Form_Submission(); return $form_submission->validate_address( $opt_val, $data ); diff --git a/mailchimp.php b/mailchimp.php index f291827..83b5ac5 100644 --- a/mailchimp.php +++ b/mailchimp.php @@ -4,7 +4,7 @@ * Plugin URI: https://mailchimp.com/help/connect-or-disconnect-list-subscribe-for-wordpress/ * Description: Add a Mailchimp signup form block, widget or shortcode to your WordPress site. * Text Domain: mailchimp - * Version: 1.9.0 + * Version: 2.0.0 * Requires at least: 6.4 * Requires PHP: 7.0 * PHP tested up to: 8.3 @@ -67,7 +67,7 @@ function () { use function Mailchimp\WordPress\Includes\Admin\{admin_notice_error, admin_notice_success}; // Version constant for easy CSS refreshes -define( 'MCSF_VER', '1.9.0' ); +define( 'MCSF_VER', '2.0.0' ); // What's our permission (capability) threshold define( 'MCSF_CAP_THRESHOLD', 'manage_options' ); diff --git a/package-lock.json b/package-lock.json index b4d035d..a428cd7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@mailchimp/wordpress", - "version": "1.9.0", + "version": "2.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@mailchimp/wordpress", - "version": "1.9.0", + "version": "2.0.0", "license": "GPL-2.0-or-later", "dependencies": { "@wordpress/block-editor": "^13.2.0", diff --git a/package.json b/package.json index dcb1b63..2940b88 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mailchimp/wordpress", - "version": "1.9.0", + "version": "2.0.0", "description": "Add a Mailchimp signup form widget to your WordPress site.", "homepage": "https://github.com/mailchimp/wordpress", "bugs": { diff --git a/readme.txt b/readme.txt index 7e9907e..0c9d24d 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ Contributors: Mailchimp Tags: mailchimp, email, newsletter, signup, marketing Tested up to: 6.8 -Stable tag: 1.9.0 +Stable tag: 2.0.0 License: GPL-2.0-or-later License URI: https://spdx.org/licenses/GPL-2.0-or-later.html @@ -76,6 +76,19 @@ If you are upgrading to version 1.2.1 and you used the widget in your sidebar pr == Changelog == += 2.0.0 - 2025-08-11 = +* **Added:** Form templates to the Mailchimp List Subscribe Form block, allowing users to quickly insert and publish specific forms (props [@iamdharmesh](https://github.com/iamdharmesh), [Romain Deville](https://www.linkedin.com/in/devilleromain/), [@vikrampm1](https://github.com/vikrampm1), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter), [@qasumitbagthariya](https://github.com/qasumitbagthariya) via [#171](https://github.com/mailchimp/wordpress/pull/171)). +* **Changed:** Improved navigation and UX enhancements to the plugin settings page (props [@iamdharmesh](https://github.com/iamdharmesh), [Romain Deville](https://www.linkedin.com/in/devilleromain/), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter), [@qasumitbagthariya](https://github.com/qasumitbagthariya) via [#169](https://github.com/mailchimp/wordpress/pull/169)). +* **Changed:** Allowed multiple Mailchimp forms on a single page (props [@iamdharmesh](https://github.com/iamdharmesh), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter), [@qasumitbagthariya](https://github.com/qasumitbagthariya) via [#173](https://github.com/mailchimp/wordpress/pull/173)). +* **Changed:** Update the form ID attribute and form field ID attributes (if you're using ID selectors for custom styling, please update the selectors accordingly) (props [@iamdharmesh](https://github.com/iamdharmesh), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter), [@qasumitbagthariya](https://github.com/qasumitbagthariya) via [#173](https://github.com/mailchimp/wordpress/pull/173)). +* **Fixed:** Phone number and required field validations (props [@iamdharmesh](https://github.com/iamdharmesh), [@MaxwellGarceau](https://github.com/MaxwellGarceau), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter), [@qasumitbagthariya](https://github.com/qasumitbagthariya) via [#159](https://github.com/mailchimp/wordpress/pull/159)). +* **Security:** Bump `tar-fs` from 2.1.1 to 3.1.0 (props [@dependabot](https://github.com/apps/dependabot), [@iamdharmesh](https://github.com/iamdharmesh) via [#175](https://github.com/mailchimp/wordpress/pull/175)). +* **Security:** Bump `form-data` from 2.3.3 to 2.5.5 and `@cypress/request` from 3.0.1 to 3.0.9 (props [@dependabot](https://github.com/apps/dependabot), [@iamdharmesh](https://github.com/iamdharmesh) via [#176](https://github.com/mailchimp/wordpress/pull/176)). +* **Security:** Bump `@babel/runtime` from 7.24.6 to 7.28.2 (props [@dependabot](https://github.com/apps/dependabot), [@iamdharmesh](https://github.com/iamdharmesh) via [#177](https://github.com/mailchimp/wordpress/pull/177)). +* **Security:** Bump `on-headers` from 1.0.2 to 1.1.0 and `compression` from 1.7.4 to 1.8.1 (props [@dependabot](https://github.com/apps/dependabot), [@iamdharmesh](https://github.com/iamdharmesh) via [#178](https://github.com/mailchimp/wordpress/pull/178)). +* **Security:** Bump `serialize-javascript` from 6.0.0 to 6.0.2 and `mocha` from 10.4.0 to 11.7.1 (props [@dependabot](https://github.com/apps/dependabot), [@iamdharmesh](https://github.com/iamdharmesh) via [#179](https://github.com/mailchimp/wordpress/pull/179)). +* **Security:** Bump `http-proxy-middleware` from 2.0.6 to 2.0.9 (props [@dependabot](https://github.com/apps/dependabot), [@iamdharmesh](https://github.com/iamdharmesh) via [#180](https://github.com/mailchimp/wordpress/pull/180)). + = 1.9.0 - 2025-06-04 = * **Added:** New user synchronization feature that allows syncing WordPress users to Mailchimp (props [@iamdharmesh](https://github.com/iamdharmesh), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter), [@qasumitbagthariya](https://github.com/qasumitbagthariya) via [#156](https://github.com/mailchimp/wordpress/pull/156)). * **Changed:** Improved the enqueueing of JavaScript scripts and styles (props [@iamdharmesh](https://github.com/iamdharmesh), [@dkotter](https://github.com/dkotter), [@qasumitbagthariya](https://github.com/qasumitbagthariya) via [#161](https://github.com/mailchimp/wordpress/pull/161)). @@ -164,6 +177,9 @@ If you are upgrading to version 1.2.1 and you used the widget in your sidebar pr == Upgrade Notice == += 2.0.0 = +This release updates the form ID attribute and form field ID attributes. If you're using ID selectors for custom styling, please update the selectors accordingly. + = 1.8.0 = This release bumps the WordPress minimum version from 6.3 to 6.4. diff --git a/tests/cypress/e2e/form-templates.test.js b/tests/cypress/e2e/form-templates.test.js index 589d7ac..d439547 100644 --- a/tests/cypress/e2e/form-templates.test.js +++ b/tests/cypress/e2e/form-templates.test.js @@ -8,7 +8,8 @@ describe('Form Templates Tests', () => { // Hide all interest groups cy.visit('/wp-admin/admin.php?page=mailchimp_sf_options'); cy.get('input[id^="mc_show_interest_groups_"]').uncheck(); - cy.get('input[value="Update Subscribe Form Settings"]').first().click(); + cy.get('input[id^="mc_show_interest_groups_"]').trigger('change'); + cy.get('input[value="Save Changes"]:visible').first().click(); }); it('Admin should see the form templates in the block', () => { @@ -67,11 +68,11 @@ describe('Form Templates Tests', () => { (postBlock) => { if (postBlock) { cy.visit(`/?p=${postBlock.id}`); - cy.get('#mc_mv_EMAIL').should('exist'); - cy.get('#mc_signup_submit').should('exist'); - cy.get('#mc_mv_FNAME').should('not.exist'); - cy.get('#mc_mv_LNAME').should('not.exist'); - cy.get('#mc_mv_PHONE').should('not.exist'); + cy.get('input[id^="mc_mv_EMAIL"]').should('exist'); + cy.get('.mc_signup_submit_button').should('exist'); + cy.get('input[id^="mc_mv_FNAME"]').should('not.exist'); + cy.get('input[id^="mc_mv_LNAME"]').should('not.exist'); + cy.get('input[id^="mc_mv_PHONE"]').should('not.exist'); } }, ); @@ -83,10 +84,10 @@ describe('Form Templates Tests', () => { (postBlock2) => { if (postBlock2) { cy.visit(`/?p=${postBlock2.id}`); - cy.get('#mc_mv_EMAIL').should('exist'); - cy.get('#mc_signup_submit').should('exist'); - cy.get('#mc_mv_FNAME').should('exist'); - cy.get('#mc_mv_LNAME').should('exist'); + cy.get('input[id^="mc_mv_EMAIL"]').should('exist'); + cy.get('.mc_signup_submit_button').should('exist'); + cy.get('input[id^="mc_mv_FNAME"]').should('exist'); + cy.get('input[id^="mc_mv_LNAME"]').should('exist'); cy.get('input[id^="mc_mv_PHONE"]').should('not.exist'); } }, @@ -99,14 +100,14 @@ describe('Form Templates Tests', () => { (postBlock3) => { if (postBlock3) { cy.visit(`/?p=${postBlock3.id}`); - cy.get('#mc_mv_EMAIL').should('exist'); - cy.get('#mc_signup_submit').should('exist'); - cy.get('#mc_mv_FNAME').should('exist'); - cy.get('#mc_mv_LNAME').should('exist'); + cy.get('input[id^="mc_mv_EMAIL"]').should('exist'); + cy.get('.mc_signup_submit_button').should('exist'); + cy.get('input[id^="mc_mv_FNAME"]').should('exist'); + cy.get('input[id^="mc_mv_LNAME"]').should('exist'); cy.get('input[id^="mc_mv_PHONE"]').should('exist'); - cy.get('#mc_mv_ADDRESS-addr1').should('exist'); - cy.get('#mc_mv_ADDRESS-addr2').should('exist'); - cy.get('#mc_mv_ADDRESS-city').should('exist'); + cy.get('input[name="mc_mv_ADDRESS[addr1]"]').should('exist'); + cy.get('input[name="mc_mv_ADDRESS[addr2]"]').should('exist'); + cy.get('input[name="mc_mv_ADDRESS[city]"]').should('exist'); } }, ); @@ -118,14 +119,14 @@ describe('Form Templates Tests', () => { (postBlock4) => { if (postBlock4) { cy.visit(`/?p=${postBlock4.id}`); - cy.get('#mc_mv_EMAIL').should('exist'); - cy.get('#mc_signup_submit').should('exist'); - cy.get('#mc_mv_FNAME').should('exist'); - cy.get('#mc_mv_LNAME').should('exist'); + cy.get('input[id^="mc_mv_EMAIL"]').should('exist'); + cy.get('.mc_signup_submit_button').should('exist'); + cy.get('input[id^="mc_mv_FNAME"]').should('exist'); + cy.get('input[id^="mc_mv_LNAME"]').should('exist'); cy.get('input[id^="mc_mv_PHONE"]').should('exist'); - cy.get('#mc_mv_COMPANY').should('exist'); - cy.get('#mc_mv_ADDRESS-addr1').should('exist'); - cy.get('#mc_mv_ADDRESS-addr2').should('exist'); + cy.get('input[id^="mc_mv_COMPANY"]').should('exist'); + cy.get('input[name="mc_mv_ADDRESS[addr1]"]').should('exist'); + cy.get('input[name="mc_mv_ADDRESS[addr2]"]').should('exist'); } }, ); diff --git a/tests/cypress/e2e/settings/settings.test.js b/tests/cypress/e2e/settings/settings.test.js index cfaaf6e..61e08c9 100644 --- a/tests/cypress/e2e/settings/settings.test.js +++ b/tests/cypress/e2e/settings/settings.test.js @@ -185,6 +185,8 @@ describe('Admin can update plugin settings', () => { // TODO: Add case for separate account login and settings get reset. it('Ensure settings persist between logging out and logging back in of Mailchimp account', () => { + cy.mailchimpLoginIfNotAlreadyLoggedIn(); + // Step 1: Visit Mailchimp settings page cy.visit('/wp-admin/admin.php?page=mailchimp_sf_options'); cy.get('#mailchimp_sf_oauth_connect').should('not.exist'); @@ -215,6 +217,7 @@ describe('Admin can update plugin settings', () => { }); it('Spam protection should work as expected', () => { + cy.mailchimpLoginIfNotAlreadyLoggedIn(); // Show error message to spam bots. [shortcodePostURL, blockPostPostURL].forEach((url) => { cy.visit(url); @@ -312,37 +315,37 @@ describe('Admin can update plugin settings', () => { cy.get('#mc_subheader_content').clear().type('My Custom Subheader'); cy.wait(1000); - cy.get('.mailchimp-sf-form-preview #mc_subheader').contains('My Custom Subheader'); + cy.get('.mailchimp-sf-form-preview .mc_subheader').contains('My Custom Subheader'); cy.get('#mc_submit_text').clear().type('My Custom Button'); cy.wait(1000); - cy.get('.mailchimp-sf-form-preview #mc_signup_submit').contains('My Custom Button'); + cy.get('.mailchimp-sf-form-preview .mc_signup_submit_button').contains('My Custom Button'); // Field options cy.get('#mc_mv_FNAME').uncheck(); cy.wait(1000); - cy.get('.mailchimp-sf-form-preview input#mc_mv_FNAME').should('not.exist'); + cy.get('.mailchimp-sf-form-preview input[id^="mc_mv_FNAME"]').should('not.exist'); cy.get('#mc_mv_LNAME').uncheck(); cy.wait(1000); - cy.get('.mailchimp-sf-form-preview input#mc_mv_LNAME').should('not.exist'); + cy.get('.mailchimp-sf-form-preview input[id^="mc_mv_LNAME"]').should('not.exist'); cy.get('#mc_mv_FNAME').check(); cy.wait(1000); - cy.get('.mailchimp-sf-form-preview input#mc_mv_FNAME').should('exist'); + cy.get('.mailchimp-sf-form-preview input[id^="mc_mv_FNAME"]').should('exist'); cy.get('#mc_mv_LNAME').check(); cy.wait(1000); - cy.get('.mailchimp-sf-form-preview input#mc_mv_LNAME').should('exist'); + cy.get('.mailchimp-sf-form-preview input[id^="mc_mv_LNAME"]').should('exist'); // Unsubscribe link cy.get('#mc_use_unsub_link').check(); cy.wait(1000); - cy.get('.mailchimp-sf-form-preview #mc_unsub_link').should('exist'); + cy.get('.mailchimp-sf-form-preview .mc_unsub_link').should('exist'); cy.get('#mc_use_unsub_link').uncheck(); cy.wait(1000); - cy.get('.mailchimp-sf-form-preview #mc_unsub_link').should('not.exist'); + cy.get('.mailchimp-sf-form-preview .mc_unsub_link').should('not.exist'); // Groups cy.get('input[id^="mc_show_interest_groups_"]').check(); diff --git a/tests/cypress/e2e/validation/us-phone.test.js b/tests/cypress/e2e/validation/us-phone.test.js index a73b44e..9cb85d5 100644 --- a/tests/cypress/e2e/validation/us-phone.test.js +++ b/tests/cypress/e2e/validation/us-phone.test.js @@ -23,7 +23,7 @@ describe('Phone Number Validation', () => { required: true, options: { phone_format: 'US' }, }).then(() => { - cy.selectList('10up'); + cy.selectList('10up', true); }); }); }); @@ -34,13 +34,13 @@ describe('Phone Number Validation', () => { required: false, options: { phone_format: 'none' }, }).then(() => { - cy.selectList('10up'); + cy.selectList('10up', true); }); }); }); function fillPhoneInputs(phone) { - cy.get('#mc_mv_PHONE').clear().type(phone); + cy.get('input[id^="mc_mv_PHONE"]').clear().type(phone); } it('Valid phone numbers', () => {