There was a bug in the query that is used to get the subscribers that
opened emails that was preventing it from working when trying to get
subscribers that opened zero emails.
The problem was that we were adding the user_agent_type as a condition
on the WHERE part of the clause. Meaning that it was being used to
filter the overall results and thus excluding all subscribers that had
no entries in the wp_mailpoet_statistics_opens table. By moving this
condition to the ON clause in the LEFT JOIN, we use the user_agent_type
field to match rows between tables. The value of this field will still
be taken into consideration when counting the number of opens as we are
counting the number of entries in the wp_mailpoet_statistics_opens
table.
[MAILPOET-5347]
This commit changes the behavior of the country segment to include
subscribers that never placed an order (or placed orders that failed or
were canceled) as long as they have a country set in the WooCommerce
customer lookup table.
[MAILPOET-4188]
A unintentional side-effect in Woo core < 7.6 synched the customer
lookup table immediately after the creation of an order. This
unintentional behavior was removed in Woo 7.6 and now we need to call
\Automattic\WooCommerce\Admin\API\Reports\Customers\DataStore::sync_order_customer()
explicitly for Woo to add to the customer lookup table.
Without this change, a few tests in WooCommerceCountryTest were failing
when running with Woo 7.6. As far as I could check this change does not
affect anything else in MP other than the tests.
[MAILPOET-5148]
We need to temporarily turn off plugin compatibility check in Woo
because current Woo Subscriptions are still officially not marked as
HPOS compatible.
[MAILPOET-4568]
WooCommerce Subscriptions doesn't support WooCommerce Custom Orders
Tables, so we should skip the WooCommerce Subscriptions related tests
when Woo COT is enabled.
[MAILPOET-4695]
This fixes error on CI: Invalid datetime format: 1292 Incorrect datetime value: '0000-00-00 00:00:00' for column 'date_created' at row 1
Locally this error wasn't present but we use a different DB because of ARM architecture.
Also previously we created the lookup table using a custom SQL but now they are created by WooCommerce plugin itself.
[MAILPOET-4566]