This commit improves the check that a user has set a welcome email campaign (a task in product discovery task list)
by checking also for automation flows that are triggered by new subscriber or user and contain
send email action.
[MAILPOET-4827]
The current Captcha class has a lot of responsibilities. It renders the captcha
image, can check if a certain captcha type is a Google captcha, if a captcha is
required for a certain email. The SubscriberSubscribeController is not only in
charge of "controlling" the subscription process but also validates, whether a
captcha is correct or not. This architecture made it difficult to extend the
functionality and introduce the audio captcha feature.
Therefore this commit refactors the captcha architecture and tries to seperate
the different concerns into several classes and objects. Validation is now done
by validators.
The CaptchaPhrase now is in charge of keeping the captcha phrase consistent
between the image and the new audio, so that you can renew the captcha and both
captchas are in sync.
[MAILPOET-4514]
This commit changes the code to use $event->getTest()->getName() instead
of $event->getTest()->getMetadata()->getName() to get the name of the
current test. This was necessary because the latter was returning null
for integration tests while the former works both for acceptance and
integration tests. I did not investigate why Codeception behaves this
way due to lack of time, there is a chance that this is a bug in
Codeception.
Since $event->getTest() returns an instance of TestInterface and this
class does not define getName() (but the call works probably due to some
magic method), it was necessary to edit phpstan.neon to skip a PHPStan
error.
[MAILPOET-4765]
With the new unique parameter added in the action scheduler 3.5.0 the
as_schedule_single_action that schedules an immediate action
seems to be more convenient for the action scheduler.
We get better control over the scheduling of subsequent runs.
Note: We don't want to use the async action that is also executed immediately,
but it has the highest priority and we don't want to block actions scheduled by other plugins.
[MAILPOET-4684]
We had some cases of multiple triggers created most probably because of a race conditions.
The unique action functionality added in the action scheduled 3.5.0 should prevent it.
[MAILPOET-4684]
This commit changes the Codeception extension CheckSkippedTestsExtension
that we use to generate an error when tests are skipped in the `trunk` and
`release` branches. Now this extension accepts a list of tests that can
be skipped in those two branches. This will be necessary as part of the
project to support WooCommerce Custom Orders Tables as in some scenarios
we want to skip WooCommerce Subscriptions tests and in some we don't.
For now, WooCommerce Subscrptions doesn't support Woo COT, so we want to
run Woo Subscriptions tests when COT is disabled, but we want to skip
then when COT is enabled.
The main change is that now we are using the `TEST_SKIPPED` Codeception event
instead of the `SUITE_AFTER` event. This change was necessary as in the
latter event we don't have any information about the tests that were
skipped.
[MAILPOET-4695]
The latest version development build of WooCommerce contains a change
that modified the method that should be called to enable Woo Custom
Orders Tables (see this Woo PR for more information:
https://github.com/woocommerce/woocommerce/pull/34727. This commit
update the plugin that we use in the acceptance and integration tests to
reflect this change.
[MAILPOET-4691]
This commit changes
\MailPoet\Segments\WooCommerce::insertSubscriberFromOrder() to use
WooCommerce method instead of querying the database directly. This is
needed as WooCommerce is moving away from WP tables and creating its own
tables.
[MAILPOET-4570]
When plugin is active COT is enabled. The plugin also adds WP CLI command
for creating custom order tables so that we don't have to do it via admin UI.
[MAILPOET-4572]
Because some customers have a memory issue when we load all newsletters.
I used partial loading newsletters to prevent this error that was caused by json in the newsletter body.
[MAILPOET-4646]
Fixing the logic to load the PHPStan baseline in the previous commit,
uncovered some ignored errors in phpstan-8.1-baseline.neon that don't
exist anymore.
[MAILPOET-4626]
There was a bug in the code that is used to decide which version of
the PHPStan baseline file should be loaded depending on the PHP
version that is being used.
The if condition for PHP 8.1 was `$phpVersion == 80100` which means
that it matched only PHP 8.1.0 and not any of the 8.1 patch
versions (like 8.1.1 and 8.1.2).
This commit fixes this problem and it also changes the order of the
checks so that they follow the version numbers in ascending order.
Before the checks where unordered.
[MAILPOET-4626]