Based on a suggestion during the review of the PR, it was decided that
it makes more sense for the code that was created as
SendingQueueEntity::toArray() tp be moved to
SendingQueuesResponseBuilder::build(). It is used only to build the
format that is send in the API response.
[MAILPOET-4368]
Since SendingQueue::add() still uses Paris, it was running into some
problems caught by our integration tests since some Sending methods
where refactored to Doctrine. The issue was that we started loading some
Doctrine entities earlier, then Paris code inside SendingQueue::add()
would change the same rows, causing the Doctrine entities to contain
stale data. To workaround this problem, in this commit, we are making
sure that the Doctrine entities are refreshed after they are changed by
Paris.
I considered refactoring SendingQueue::add() to use Doctrine but I
wasn't sure what to do with SendingTask::create() and
SendingTask::createFromQueue() so I decided to take a different
approach.
[MAILPOET-4368]
This was the easiest way to fix failing integration tests related to
updating some Sending methods to use Doctrine instead of Paris. Using
Paris in SendingQueue to update the database was creating a state where
Doctrine had stale data and this was causing the tests to fail.
[MAILPOET-4368]
This is only tangentially related to this ticket. I noticed during
testing that the filter segment tag was not showing up in listings for
standard newsletters that were drafts or scheduled. This is because
options weren't included in the response for standard newsletters.
MAILPOET-5512
Because I haven't found an easy way how to use WP or WC API,
I decided to create a MailPoet endpoint for getting coupons that
allows me loading them via Ajax.
[MAILPOET-5123]
In the previous commit, we removed the global count for our output. This commit removes
the logic as the only places where it was used was in recalculating the cache and since
the last commit, we do not use this value anymore
[MAILPOET-4487]
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]
Bridge is a low level service that processes requests and responses to/from Bridge API.
This change is needed so that we can remove dependency on MailPoet\Util\License\Features\Subscribers
service from the Bridge. The dependecy is a higher level service and may easily cause a circular dependency issue.
The SettingsChangeHandler is service for handling side effects
when saving settings. This feels as a better place to put the functionality.
[MAILPOET-5191]
In MAILPOET-4464 we introduced the new state "valid_underprivileged".
During implementation we introduced the state for MSS key validation,
but we forgot about the premium key.
This commit adds support for the state also for premium key validation.
When the key is underprivileged we don't display any error.
We will add specific error for underprivileged keys with specific
access restrictions in follow-up commits.
[MAILPOET-5103]
Per WP security best practices, sanitization should be handled as early
as possible. So this commit move updates the calls to sanitize the
segment name and description to the part of the code where the user
input is first processed, instead of when the data is saved to the
database.
[MAILPOET-5232]