Commit Graph

15684 Commits

Author SHA1 Message Date
Jan Jakes
9055bdeb11 Add prettier configuration
[MAILPOET-4075]
2022-04-12 15:38:27 +02:00
Jan Jakes
50c80b8a05 Avoid curcular symlink paths
[MAILPOET-4075]
2022-04-12 15:38:27 +02:00
Jan Jakes
b5530bad70 Install repo root dependencies in ./do install
[MAILPOET-4075]
2022-04-12 15:38:27 +02:00
Jan Jakes
636aca74b8 Install prettier to the monorepo root
[MAILPOET-4075]
2022-04-12 15:38:27 +02:00
Rodrigo Primo
6acab0dab9 Release 3.87.0 2022-04-12 10:14:18 -03:00
Rodrigo Primo
fdb4663ca1 Revert "Check post-types validity for requests"
This reverts commit b800cf189f.
2022-04-11 16:30:59 -03:00
Rodrigo Primo
fbcfa6db82 Revert "Fix failing tests because of un-registered product post type"
This reverts commit 7854645ea4.
2022-04-11 16:30:59 -03:00
Rodrigo Primo
6c00969e83 Revert "Correctly process sortBy argument when fetching posts"
This reverts commit 79530d1656.
2022-04-11 16:30:59 -03:00
Rodrigo Primo
62e393a76d Revert "Define BlockPostQuery for nicer args processing for quering"
This reverts commit 5b40a585e7.
2022-04-11 16:30:59 -03:00
Rodrigo Primo
79991ae462 Revert "Restrict dynamic blocks to public post status only"
This reverts commit 72b3172c1a.
2022-04-11 16:30:59 -03:00
Rodrigo Primo
2c5e1ab184 Revert "Add tests to check output of API methods querying posts"
This reverts commit be9e4ea9fd.
2022-04-11 16:30:59 -03:00
Rodrigo Primo
8aa2565e17 Revert "Fix a failing test with too much dependecy on db state"
This reverts commit 5f5a4d576f.
2022-04-11 16:30:59 -03:00
Sam Najian
5f5a4d576f Fix a failing test with too much dependecy on db state
[MAILPOET-4082]
2022-04-11 14:54:56 -03:00
Sam Najian
be9e4ea9fd Add tests to check output of API methods querying posts
[MAILPOET-4082]
2022-04-11 14:54:56 -03:00
Sam Najian
72b3172c1a Restrict dynamic blocks to public post status only
[MAILPOET-4082]
2022-04-11 14:54:56 -03:00
Sam Najian
5b40a585e7 Define BlockPostQuery for nicer args processing for quering
[MAILPOET-4082]
2022-04-11 14:54:56 -03:00
Sam Najian
79530d1656 Correctly process sortBy argument when fetching posts
[MAILPOET-4082]
2022-04-11 14:54:56 -03:00
Sam Najian
7854645ea4 Fix failing tests because of un-registered product post type
Post type `product` should be registered for the post type
related functions to work correctly

[MAILPOET-4082]
2022-04-11 14:54:56 -03:00
Sam Najian
b800cf189f Check post-types validity for requests
[MAILPOET-4082]
2022-04-11 14:54:56 -03:00
Rostislav Wolny
789385b0c4 Refactor mailerInstance property to mailerMethod
Naming mailerInstance was confusing since
it is not instance of Mailer class but instance of MailerMethod.
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
708333e68a Replace ternary operators with null coalescing operators in MailerAPI
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
bc6026ca77 Add typehints to MailerMethod interface
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
6240debc10 Declare strict types in newly added MailerRelated classes
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
8970f00bf3 Inject MailerMethod instance through constructor in Mailer
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
2440ed13d9 Remove factory functionality from Mailer
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
e253b8f09f Refactor MailerTest to use MailerFactory
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
6cd22a1abe Remove factory functionality test cases from MailerTest
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
36edab34e6 Move logic for return path fallback address from method classes to factory
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
b8bfa60634 Replace static Stub::xxx calls with test case methods in SendingQueueTest
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
d4a8315933 Use mailerFactory in SendingQueue Mailer task
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
6b758d90e6 Use MailerFactory in Mailer api
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
06fb13bd86 Use MailerFactory in sending queue API mailer config check
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
904b6dd34c Refactor WordPress mailer to use MailerFactory
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
455d22631e Add caching of default mailer instance in MailerFactory
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
68cb5c4f79 Inject MailerFactory instead of mailer
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]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
51e0426e81 Add MailerFactory service
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]
2022-04-11 16:54:38 +02:00
Rostislav Wolny
b10c30a7b1 Add basic interface for MailerMethod
[MAILPOET-4115]
2022-04-11 16:54:38 +02:00
Jan Lysý
eb07872d13 Disable segments validation when form ID is empty
[MAILPOET-4155]
2022-04-11 15:30:48 +02:00
Sam Najian
8f377d9308 Make default value for $linkTag of replaceLinkTags explicit
[MAILPOET-3992]
2022-04-11 15:30:29 +02:00
Sam Najian
9a34c16ea5 Add separate message for pending approval error message
[MAILPOET-3992]
2022-04-11 15:30:29 +02:00
Sam Najian
aed41ef00d Prepare code for more messages
[MAILPOET-3992]
2022-04-11 15:30:29 +02:00
Jan Lysý
4a0534ac2a Remove deprecated upgrade link
[MAILPOET-4183]
2022-04-11 15:26:39 +02:00
Rostislav Wolny
b45966ab44 Add logging of failed mss and premium key validations on API
[MAILPOET-4051]
2022-04-11 12:17:29 +02:00
John Oleksowicz
fc1f3e6dc2 Inline generateToken for clarity
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]
2022-04-11 10:29:35 +02:00
Jan Lysý
ed87d1cace Fix format for List-Unsubscribe header
[MAILPOET-4235]
2022-04-11 09:22:22 +02:00
Rodrigo Primo
d07b45c83b Fix minor coding style error
[MAILPOET-4225]
2022-04-11 09:20:21 +02:00
Rodrigo Primo
d9ffcd135a Use WC and WC-Blocks versions that are compatible with WP 5.6
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]
2022-04-11 09:20:21 +02:00
Rodrigo Primo
e00d71b781 Remove WP < 4.5.0 compatibility code
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]
2022-04-11 09:20:21 +02:00
Rodrigo Primo
f85910729e Bump WP version used in CircleCI acceptance tests to 5.6
[MAILPOET-4225]
2022-04-11 09:20:21 +02:00
Rodrigo Primo
673ce92e7f Bump WP minimum required version to 5.6
[MAILPOET-4225]
2022-04-11 09:20:21 +02:00