We want to remove/refactor the whole ModelValidator class as part of the
Doctrine refactor.
This commit moves the method ModelValidator::validateNonRoleEmail() to a
new Validator class as the method is not used by the validator system of
the Paris models. ModelValidator::validateEmail() was also moved as it
is called by ModelValidator::validateNonRoleEmail().
[MAILPOET-4343]
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
\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]
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]
This commit removes the main MP2 migration class and its test class. It
also removes two SQL files that were used in the test class. One of
those files executed the following query:
`SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"`
Removing this query made the tests inside SubscriberSegmentTest fail
when running the whole integration test suite. To work around this, I
added the above mentioned query to SubscriberSegmentTest. I'm not sure
why this test class fails without this query when running all the tests
but it doesn't when it is executed alone. Probably there is another test
class changing the SQL_MODE. Since SubscriberSegmentTest is a test class
for a Paris model that we will eventually remove, I decided it was not
necessary to investigate this further.
[MAILPOET-4376]
While removing some deprecated models in the commit
a525b96f16, I noticed that we maintain a
list of tables that needs to be truncated before running the integration
tests. To make it easier when removing future models and to make sure
the list of tables is always updated, in this commit, I'm removing the
manual list and changing the code to dynamically get the tables and
truncate them.
The code that I removed from _bootstrap.php, meant that PHPStan error
was not present anymore, so it was possible to update its baseline files
to remove the ignores for that error.
[MAILPOET-4325]