We can't create mailer directly in DI container using the factory because it may fail in case
the plugin is not configured properly and prevent plugin from start.
The Mailer was previously injected because it contains lazy initialization.
The lazy initialization in the singleton Mailer service was dangerous,
because when used with some custom parameters it could cause that all services
that inject the Mailer from DI would use the custom config instead the default.
[MAILPOET-4115]
In this commit I copied and slightly modified functionality used
for creating Mailer instance based on config from the Mailer to an extra class.
The functionality still remains also in Mailer and will be removed later.
I also created test based on the original test for Mailer and added test case
testing it creates specific MailerMethods.
[MAILPOET-4115]
The only thing Security::generateToken was providing was a default value
for the $action, which created a pattern of using the same $action
everywhere, which may not be the best way to go.
Since it was essentially a wrapper for WP's built-in nonce functions,
it seemed clearer to use those functions directly to be more explicit
about how we're handling tokens.
[MAILPOET-2030]
This commit updates the versions of WooCommerce and WooCommerce Blocks
to make sure that when running the acceptance_oldest tests, we are
running versions of those two plugins that are compatible with WP 5.6
which is the minimum WP version that MailPoet requires.
[MAILPOET-4225]
This commit removes the method Posts::getTerms() as it existed to add a
compatibility layer for sites running WP < 4.5.0 and we don't support
this version anymore. The signature of the WP get_terms() function was
changed in version 4.5.0 and that is why this compatibility layer was
needed.
The integration test class for this method was also removed. The only
place where this method was used, AutomatedLatestContent::getTerms(),
now call WPFunctions->getTerms() directly. A very basic integration test
was added to cover the happy path of AutomatedLatestContent::getTerms().
[MAILPOET-4225]