Commit Graph

3543 Commits

Author SHA1 Message Date
Rostislav Wolny
d42752fa99 Add test for dynamic segments listing response builder
[MAILPOET-3177]
2021-03-10 15:20:32 +01:00
Pavel Dohnal
8608bc7875 Use newsletter sent at in dates shortcode
[MAILPOET-3375]
2021-03-10 14:38:05 +01:00
wxa
e71e063ef0 Use same query logic for counting and exporting subs w/o lists
[MAILPOET-3462]
2021-03-10 13:16:48 +01:00
wxa
19dd9180bd Rename 'not in a list' option
[MAILPOET-3462]
2021-03-10 13:16:48 +01:00
Rostislav Wolny
6f42222abc Fix subscriber consent data in export
[MAILPOET-3472]
2021-03-09 13:13:55 +01:00
Jan Lysý
62bf43ad3f Add consent evidence columns to import tests
[MAILPOET-3389]
2021-03-08 11:39:44 +01:00
Jan Lysý
a3224e9286 Remove old unused class for read subscribers
[MAILPOET-3376]
2021-03-08 09:09:00 +01:00
Jan Lysý
8450beaf10 Add tests for get subscribers in ImportExportRepository
[MAILPOET-3376]
2021-03-08 09:09:00 +01:00
Jan Lysý
4a2af719db Remove use old model from ExportTest
[MAILPOET-3376]
2021-03-08 09:09:00 +01:00
wxa
13da0d77fe Update select2 [MAILPOET-3386]
The latest version has deprecated jQuery features removed.
It also has some breaking changes in HTML layout, so I had to fix styles to keep its design look.
2021-03-03 14:59:54 +01:00
wxa
c54f078cd1 Replace deprecated event shorthands [MAILPOET-3386] 2021-03-03 14:59:54 +01:00
Rodrigo Primo
844ea3f6d8 Truncate first and last names before adding to wp_mailpoet_subscribers
MailPoet syncs users from wp_users to wp_mailpoet_subscribers. The
problem is that WP stores first and last names in a longtext field and
MP uses a varchar(255) field. This was causing a fatal error when
synchronizing names over 255 characters. This commit fixes this problem
by using SUBSTRING() to make sure that the 255 characters limit is
enforced when adding values to the columns first_name and last_name of
the wp_mailpoet_subscribers table. This should get rid of the fatal
error and it shouldn't be a problem to most users as it is unlikely that
a real user has a first or last name that is longer than 255 characters.

[MAILPOET-3246]
2021-03-02 16:09:47 +01:00
Jan Lysý
cbea75927a Add ignoring improper subscribers from MailChimp
[MAILPOET-3404]
2021-03-02 14:29:27 +01:00
Jan Lysý
878e3eb28f Simplify newsletter body data repair
[MAILPOET-3430]
2021-03-02 13:48:07 +01:00
Jan Lysý
78717509c8 Add tests for newsletter data fixers
[MAILPOET-3430]
2021-03-02 13:48:07 +01:00
Rodrigo Primo
a50c20637a Create an empty WC_Emails stub instead of using stdClass in a test
This commit simply improves an integration test that I modified while
working on [MAILPOET-3421] to use an empty WC_Emails stub instead of
using stdClass.
2021-03-01 14:14:19 +01:00
Rodrigo Primo
edbb69a239 Use the woocommerce_email action to customize WC emails
This commit changes the WC action that MailPoet uses to hook into WC and
customize the footer and the header of WC e-mails. Before, MailPoet was
using the woommerce_init action. The problem with using this action to customize
the e-mails is that it runs on every request. Furthermore, since we were calling
WC->mailer() inside the callback, we were instantiating WC_Emails on
every single request (WooCommerce instantiate this class only when
needed).

Replacing woocommerce_init with woocommerce_email means that our code
will run only when needed (right after WooCommerce adds callbacks to the
actions woocommerce_email_header and woocommerce_email_footer) and that
we won't be unnecessarily instantiating WC_Emails ourselves. We get the
singleton instance of this class as a parameter.

[MAILPOET-3421]
2021-03-01 14:14:19 +01:00
Rodrigo Primo
575b34fc97 Fix "Purchased In This Category" email for product variations
The "Purchased In This Category" email was not working for variable
products. This was happening because MailPoet calls
WC_Product::get_category_ids() to get the list of WooCommerce
categories associated with a given product, but this method doesn't work
for product variations (see
https://github.com/woocommerce/woocommerce/issues/12942).

In this commit, I'm implementing a workaround. I changed the code to
check if the product is a product variation and, if so, get the
categories from the parent product instead of the product itself. But I
also plan to raise this issue with the WooCommerce team as, in my opinion,
it is odd that WC_Product::get_category_ids() doesn't work with product
variations and fails silently.

[MAILPOET-3416]
2021-03-01 13:32:52 +01:00
Pavel Dohnal
91386815a2 Use the latest woocommerce for the latest tests
[MAILPOET-3330]
2021-03-01 10:36:00 +01:00
Pavel Dohnal
1312139fb8 Use woocommerce 4.0.1 for the oldest tests
[MAILPOET-3330]
2021-03-01 10:36:00 +01:00
Pavel Dohnal
916aa847ca Use woocommerce 5.0.0 for the acceptance tests
[MAILPOET-3330]
2021-03-01 10:36:00 +01:00
Jan Lysý
c5a11b2bd8 Add acceptance test for the Gutenberg form block
[MAILPOET-3440]
2021-03-01 10:08:08 +01:00
Jan Lysý
76d79397c2 Add methods for name in a form to DataFactory
[MAILPOET-3440]
2021-03-01 10:08:08 +01:00
Rostislav Wolny
438c9a7469 Alter data validation regexp so that is not malformed by wptexturize
[MAILPOET-3440]
2021-03-01 10:08:08 +01:00
Rostislav Wolny
5c38069caa Add scheduled tasks cleanup to tests setup
[MAILPOET-3412]
2021-03-01 08:43:45 +01:00
Rostislav Wolny
ff284cb12f Fix flaky Import test
Comparing timestamps with delta parameter allow values that differs by 1 second.
[MAILPOET-3412]
2021-03-01 08:43:45 +01:00
Jan Lysý
2bf5e93125 Add integration test for ImportExportRepository
[MAILPOET-3378]
2021-02-18 10:13:44 +01:00
Jan Lysý
0347e44893 Use importExportRepository in import
[MAILPOET-3378]
2021-02-18 10:13:44 +01:00
Jan Lysý
d500f872d7 Refactor integration Import test
[MAILPOET-3378]
2021-02-18 10:13:44 +01:00
Jan Lysý
1deaef4321 Use Doctrine in integration test for Import
[MAILPOET-3378]
2021-02-18 10:13:44 +01:00
Jan Lysý
2f1899d810 Add new dependencies to ImportTest
[MAILPOET-3378]
2021-02-18 10:13:44 +01:00
Rostislav Wolny
dc4727117c Fix view in browser link shortcode and extend test
[MAILPOET-3434]
2021-02-17 16:11:59 +01:00
Rostislav Wolny
6bf62ee90a Fix links in form checkbox label
[MAILPOET-3433]
2021-02-17 11:00:15 +01:00
Rostislav Wolny
54cee207ea Remove forgotten test debug code
[MAILPOET-3415]
2021-02-15 13:30:08 +01:00
Rostislav Wolny
6a63ac26c7 Fix naming sanitiser > sanitizer
[MAILPOET-3415]
2021-02-15 13:30:08 +01:00
Rostislav Wolny
c1aef842d2 Fix rendering issues in form blocks
[MAILPOET-3415]
2021-02-15 13:30:08 +01:00
Rostislav Wolny
d00e667b96 Check Custom HTML in form on save
[MAILPOET-3415]
2021-02-15 13:30:08 +01:00
Rostislav Wolny
1fbed46411 Add service for fixing form API data
[MAILPOET-3415]
2021-02-15 13:30:08 +01:00
Rostislav Wolny
e13b2c62a9 Add servise for fixing html in form blocks
[MAILPOET-3415]
2021-02-15 13:30:08 +01:00
Jan Lysý
cd776fe0cf Add tries when CronHelpes ping ends with timeout
[MAILPOET-3413]
2021-02-15 09:34:38 +01:00
Pavel Dohnal
5b5e01465c [MAILPOET-3408] 2021-02-10 14:52:20 +01:00
Veljko
4d6564e757 Fixed flaky scenario of moving a list to trash 2021-02-03 11:02:13 +01:00
Jan Lysý
6337c37e45 Update tests for third party API
[MAILPOET-3307]
2021-02-03 11:01:38 +01:00
Jan Lysý
94ac7f0ef7 Update WP in acceptance test on 5.6
[MAILPOET-3339]
2021-01-28 09:38:10 +01:00
Jan Lysý
f5987359c7 Add integration test on SegmentSaveController
[MAILPOET-3170]
2021-01-26 17:03:48 +01:00
Jan Lysý
180a238b40 Use timestamp for DateTime compare in Segments WPTest
[MAILPOET-3367]
2021-01-25 11:52:25 +01:00
Rostislav Wolny
9868f5cc21 Remove dynamic segments services that are no longer needed
[MAILPOET-3164]
2021-01-25 09:17:17 +01:00
Rostislav Wolny
8456581695 Refactor segment lists fetching methods to separate repository
[MAILPOET-3164]
2021-01-25 09:17:17 +01:00
Rostislav Wolny
cd578e6475 Refactor fetching list of subscribers for export
[MAILPOET-3146]
2021-01-25 09:17:17 +01:00
Pavel Dohnal
4e3dda9872 Fix flakey integration test
[MAILPOET-3336]
2021-01-25 09:04:20 +01:00