Commit Graph

56 Commits

Author SHA1 Message Date
Rodrigo Primo
6f98634b94 Replace Subscriber and SubscriberSegment models with Doctrine in \MailPoet\Segments\WP
[MAILPOET-5752]
2024-02-12 15:33:28 +01:00
Jan Lysý
525c80bac4 Fix PHPStan warnings in lib
[MAILPOET-5751]
2023-12-13 11:48:14 +01:00
John Oleksowicz
c809461322 Remove phpstan exception that no longer triggers
MAILPOET-5161
2023-10-23 17:40:54 +02:00
David Remer
30eafb9146 Extract purchase states to helper method
[MAILPOET-5485]
2023-09-11 12:14:33 +02:00
David Remer
6dd0c844ca Take also list specific status into account when counting subscribers
[MAILPOET-4487]
2023-08-18 13:35:13 +02:00
alex-mpoet
a5a7966663 Fix filterData reference in DynamicSegmentFilterData
[MAILPOET-5505]
2023-08-07 10:21:33 -05:00
John Oleksowicz
fe318f5a30 Add 'not contains' option for text custom fields
MAILPOET-4996
2023-08-07 12:03:49 +02:00
Jan Jakes
dd037c349c Use strings for template categories
[MAILPOET-5372]
2023-06-19 13:29:25 +02:00
David Remer
ed5e644834 Simplify fetching Automation
[MAILPOET-5088]
2023-06-15 12:25:12 +02:00
alex-mailpoet
9fc2c0eeb3 Update phpstan ignore files
[MAILPOET-5180]
2023-05-22 14:13:05 +02:00
Rodrigo Primo
00d021109c Move ModelValidator::validateNonRoleEmail() to a new Validator class
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]
2023-05-17 12:37:22 +02:00
Rodrigo Primo
854e8a7f07 Remove models that were deprecated over six months ago
The removal date of all these models passed a couple of months ago.

[MAILPOET-5252]
2023-04-28 17:23:03 +01:00
Rodrigo Primo
769a11048e Remove PHPStan ignored error as it is not happening anymore
[MAILPOET-5232]
2023-04-17 14:33:51 -03:00
John Oleksowicz
d505bffcfd Refactor to use shared date functionality
MAILPOET-4986
2023-04-03 10:20:02 +02:00
Rodrigo Primo
26bdf7e20c Fix PHPStan errors in the data factories classes
[MAILPOET-4037]
2023-02-23 14:13:17 +01:00
Rodrigo Primo
a9a3c53245 Fix PHPStan errors in the acceptance tests
[MAILPOET-4037]
2023-02-23 14:13:17 +01:00
Rodrigo Primo
678911a8bc Fix PHPStan baseline errors in a few integration test files
[MAILPOET-4037]
2023-02-23 14:13:17 +01:00
Rodrigo Primo
2bcd1ace70 Fix PHPStan errors in tests/integration/Segments/DynamicSegments/
[MAILPOET-4037]
2023-02-23 14:13:17 +01:00
Rodrigo Primo
6374ce9ad3 Remove unused parameter from getSubscribersCount() to fix a PHPStan error
[MAILPOET-4037]
2023-02-23 14:13:17 +01:00
Rodrigo Primo
775ab32037 Fix PHPStan baseline errors in a few test files
[MAILPOET-4037]
2023-02-23 14:13:17 +01:00
Rostislav Wolny
04307ca2a6 Compute change of global subscribed subscribers
[MAILPOET-4828]
2023-02-22 13:54:31 +01:00
Brezo Cordero
49b2f5528f Remove Migration class
Remove from container, test factory and PHPStan baselines.

[MAILPOET-4478]
2023-01-23 15:35:50 +01:00
David Remer
6ddfe2c605 Remove ignores no longer needed
[MAILPOET-4258]
2022-11-25 14:32:34 +01:00
David Remer
4832771185 Refactor the captcha system
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]
2022-11-24 09:20:39 +01:00
Jan Jakes
9d55d3f134 Use "automation" instead of "workflow"
[MAILPOET-4793]
2022-11-14 12:14:35 +02:00
Jan Jakes
9730fb9272 Move the old dbDelta-based migrator to a migration
This will ensure it runs once and from there, it will continue using the new migrations.

[MAILPOET-4466]
2022-11-07 10:05:42 +01:00
Rodrigo Primo
83319949ef Use WooCommerce code instead of direct query to get highest order ID
[MAILPOET-4570]
2022-10-03 09:30:42 +02:00
Rodrigo Primo
b6bdce3535 Change insertSubscriberFromOrder() to use WooCommerce methods
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]
2022-10-03 09:30:42 +02:00
Jan Lysý
4deb137063 Rename method in repository
[MAILPOET-4685]
2022-09-29 15:19:09 -03:00
Jan Lysý
f2e355f7d5 Refactor building newsletters lists
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]
2022-09-19 14:32:55 +02:00
Jan Lysý
5c57dd2006 Add saving tags for imported subscribers
[MAILPOET-4558]
2022-09-15 11:26:10 +02:00
Rostislav Wolny
0b54ae6506 Refactor updating create and modified dates in WooCommerce order factory
[MAILPOET-4566]
2022-09-08 13:02:52 +02:00
David Remer
baa4d369af Introduce template storage and rebuild create form template endpoint
[MAILPOET-4538]
2022-08-23 14:03:24 +02:00
Rodrigo Primo
d874375c25 Remove MP2 migration main class and its test class
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]
2022-08-15 12:46:22 +02:00
Jan Lysý
571a91b809 Fix setting segment type
[MAILPOET-4292]
2022-07-14 11:29:09 +02:00
Jan Lysý
670e6e4cba Replace Swift Mailer for PHPMailer
[MAILPOET-4142]
2022-05-23 11:38:32 +02:00
Rodrigo Primo
cf2a0eb5cc Get the list of tables to truncate when running tests dynamically
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]
2022-05-16 11:33:00 +02:00
John Oleksowicz
780dd7f609 Use data factory for test newsletter
MAILPOET-4236
2022-05-16 11:17:29 +02:00
Brezo Cordero
6e0b639fd3 Use intval instead of (int) to remove PHPStan errors
[MAILPOET-4281]
2022-05-09 13:05:21 +02:00
Brezo Cordero
bb3d1c2a7c Fix type error in meta in SubscribersEmailCount task
[MAILPOET-4281]
2022-05-09 13:05:21 +02:00
Jan Lysý
c08bde077b Update symfony/dependency-injection package to v5
[MAILPOET-4227]
2022-04-27 08:57:54 +02:00
Sam
c32dc0a372 Revert "Revert "Define BlockPostQuery for nicer args processing for quering""
This reverts commit 62e393a76d.
2022-04-18 11:43:47 +02: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
Sam Najian
5b40a585e7 Define BlockPostQuery for nicer args processing for quering
[MAILPOET-4082]
2022-04-11 14:54:56 -03:00
Brezo Cordero
36baf4c4e3 Simplify the query to calculate lifetime emails
Get max and count of subscribers in the query.

[MAILPOET-4177]
2022-04-07 10:17:38 +02:00
Brezo Cordero
8b7b234446 Create controller to count emails per subscriber
This controller is built to be called by a cron SimpleWorker.

[MAILPOET-4177]
2022-04-07 10:17:38 +02:00
David Remer
cb55cae1b2 Escape SQL queries following wp org sniffs
[MAILPOET-4129]
2022-04-04 17:12:33 +02:00
David Remer
a8d88beec9 Escape output according to WP sniffs
[MAILPOET-4129]
2022-04-04 17:12:33 +02:00
Rodrigo Primo
2e374d1a3b Remove unused property from Pages
[MAILPOET-4020]
2022-04-04 16:24:21 +02:00
Rostislav Wolny
11d4ae47a8 Remove Listing Handler unused methods
[MAILPOET-4006]
2022-04-04 15:33:52 +02:00