This fixes an issue where pre-existing subscribedDate filters were
causing errors because they didn't have an `action` stored in their
serialized data.
It was never necessary to store the action redundantly in the serialized
filter data in the first place, so we're now fetching the action
directly from the filter data entity itself.
MAILPOET-5500
The subscribedDate filter used to be completely separate and it's now
been consolidated into SubscriberDateField. Since existing filters exist
in the wild that have the subscribedDate type, we're not able to
update the value to be consistent with the other types.
MAILPOET-4989
This commit refactors the React components SingleOrderValueFields and
TotalSpentFields to use the new DaysPeriodField component instead of
its own code to generate the days period selector.
[MAILPOET-4991]
This commit refactors the React components AverageSpentFields and
NumberOfOrdersFields to use the new DaysPeriodField component instead of
a its own code to generate the days period selector.
[MAILPOET-4991]
This commit simplifies the logic of the 'used shipping method' segment
by removing the shipping method IDs from the queries. After some
considering, we have come to the conclusion that using just the shipping
method instance ID is enough.
[MAILPOET-4992]
This commit changes the logic of the code that builds the queries for
the 'used shipping method' filter. The initial implementation relied
only on the shipping method name that is stored in
wp_woocommerce_order_items. This implementation did not work as the
name is not unique. The new implementation use the shipping method id
and the instance id that are stored in wp_woocommerce_order_itemmeta and
the combination of both fields is unique.
[MAILPOET-4992]
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]
This commits adds the sanitization right before the data is added to the
database (\MailPoet\Segments\SegmentsRepository::createOrUpdate()) and
removes the sanitization from
\MailPoet\Segments\DynamicSegments\SegmentSaveController::save() to
avoid sanitizing twice. save() calls createOrUpdate().
Before this commit, we were sanitizing the name and description of
dynamic segments but not regular segments.
[MAILPOET-5232]