Commit Graph

256 Commits

Author SHA1 Message Date
Jan Lysý
ac473c412e Use WP functions from internal class
[MAILPOET-4516]
2022-08-03 16:52:02 +02:00
Jan Lysý
679d586d2b Fix settings action link order
[MAILPOET-4516]
2022-08-03 16:52:02 +02:00
Rostislav Wolny
16807fe9e3 Update and fix comments related to usage of Action Scheduler in cron
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
Rostislav Wolny
869697e025 Allow Action Scheduler Cron trigger in cli environment
We don't want our loopback cron to run in cli environment
but we want to allow the action scheduler so that we can use it via wp cli
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
Rostislav Wolny
f745975c03 Prevent triggering migrations when tables are being removed
This was causing flakiness of acceptance test ReinstallFromScratchCest.php:reinstallFromScratch
and also potential issue for production.
In Activator::deactivate we remove MailPoet's DB tables. This takes some time.
In case there is another request during the deletion it may detect some tables are missing and trigger activation
and we end up creating MailPoet tables and removing them at the same time.

This commit adds locking to deactivate method so that any other attempt for activation ends up with an error.

[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
Rostislav Wolny
b525f9f876 Deactivate action scheduler actions when another method is active
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
Rostislav Wolny
272e875643 Deactivate action scheduler recurring actions on plugin deactivation
We need to cleanup these recurring actions otherwise they would be rescheduled indefinitely.
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
Rostislav Wolny
e3fbf2421d Move action scheduler initialization to Initializer as one of first actions
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
Sam Najian
31aa18868b Remove traces of older models in PersonalDataExports namespace
[MAILPOET-4348]
2022-08-01 14:18:59 +02:00
Sam Najian
10d4eb5d7f Remove old models from SegmentsExporter
[MAILPOET-4348]
2022-08-01 14:18:59 +02:00
Sam Najian
6b12255bb8 Move PersonalDataExporters to DI
[MAILPOET-4348]
2022-08-01 14:18:59 +02:00
Rodrigo Primo
c30fe1305b Replace Paris models with Doctrine entities in Shortcodes
It was necessary to deprecate the filter
mailpoet_archive_email_subject and create a new one since the type
of one of the parameters passed to the filter had to change.

[MAILPOET-4307]
2022-08-01 09:57:10 +02:00
Rodrigo Primo
6896758f13 Add a link to the MailPoet settings page in the page that lists plugins
[MAILPOET-4412]
2022-07-29 14:52:50 +02:00
Daniel Bachhuber
e53505354a Switch to SVG menu icon for Calypso compatibility
[MAILPOET-4472]
2022-07-27 09:43:42 +02:00
Rodrigo Primo
d8ad8ec97d Remove the deprecated filters mailpoet_archive_date and mailpoet_archive_subject
Those two filters were deprecated over six months ago and were scheduled
to be removed last month.

[MAILPOET-4470]
2022-07-21 16:35:09 +02:00
Rodrigo Primo
7f055aef06 Replace Paris models with Doctrine in SubscriberPersonalDataEraser
[MAILPOET-4349]
2022-07-20 15:05:19 +02:00
John Oleksowicz
c2612f4511 Shorten the max tag name from 255 to 191 chars
MySQL has maximum key lengths for indexes, and the number can vary based
 on storage engine and MySQL version. Using utf8mb4, the index would be
 255 * 4 = 1020 bytes long, exceeding the MyISAM maximum of 1000 bytes
 and the MySQL 5.6 maximum of 767 bytes.

 See Column Prefix Key Parts in the MySQL reference:
 https://dev.mysql.com/doc/refman/8.0/en/create-index.html

 By reducing this length to 191, we ensure that the maximum likely index
 length will be less than the 767 lower bound (191 * 4 = 764).

 MAILPOET-4489
2022-07-20 09:30:43 +02:00
Sam Najian
f44afbddf2 Remove SendingQueue model usages
[MAILPOET-4361]
2022-07-18 16:47:48 +02:00
Sam Najian
1814a69719 Remove SubscriberModel usages
[MAILPOET-4361]
2022-07-18 16:47:48 +02:00
Rodrigo Primo
b2ba612145 Fix: don't run the code to enable third party libraries for new installs
This commit fixes the logic of the code that enables third party
libraries by default. It was meant to enable those libraries only for
existing installs when the code was introduced in cfae753601
to avoid breaking functionality. But due to a bug, it was also enabling
those libraries for new installs.

To fix this issue, this commit moves the code to the Migrator class and
makes sure it is only executed for existing installs and only once when
doing a version update.

[MAILPOET-4285]
2022-07-12 16:01:39 +02:00
Jan Jakes
7df8342a18 Define manage automation capability in automation code
[MAILPOET-4465]
2022-07-12 13:36:58 +02:00
Jan Lysý
6b2445e8ec Move plugin style loading into assets loader
[MAILPOET-4440]
2022-07-12 13:35:00 +02:00
Jan Lysý
94524f5447 Move wordpress/components styles to higher level
[MAILPOET-4440]
2022-07-12 13:35:00 +02:00
Jan Lysý
2a74f92e10 Create tables for subscriber tags
[MAILPOET-4440]
2022-07-12 13:35:00 +02:00
David Remer
55880fb257 Disable auto_reload only in non development environments
[MAILPOET-4439]
2022-06-16 10:45:57 +02:00
David Remer
5b49dd0fc7 Do not autoload twig templates
Set to true auto_load will attempt to overwrite existing files, which is
to be avoided.

[MAILPOET-4439]
2022-06-16 10:45:57 +02:00
David Remer
0d4048b682 Remove WordPress from build process
[MAILPOET-3985]
2022-06-08 15:25:41 +02:00
David Remer
467ed02043 Add short doc to explain, why the methods where altered.
[MAILPOET-3985]
2022-06-08 15:25:41 +02:00
David Remer
6a7b2f3952 Try to create the temporary folder
[MAILPOET-3985]
2022-06-08 15:25:41 +02:00
David Remer
d5b25ac28f Add getTwig method
[MAILPOET-3985]
2022-06-08 15:25:41 +02:00
David Remer
4ffb4e0dc2 Rename temp folder creation method
[MAILPOET-3985]
2022-06-08 15:25:41 +02:00
David Remer
4b7ecfba94 Use newly introduced twig classes
[MAILPOET-3985]
2022-06-08 15:25:41 +02:00
David Remer
052d5e4531 Change path to cached templates
[MAILPOET-3985]
2022-06-08 15:25:41 +02:00
David Remer
382ae901cc Introduce TwigFileSystemCache
The original FileSystemCache of twig generates the key depending on PHP_VERSION.
We need to produce the same key regardless of PHP_VERSION. Therefore
TwigFileSystemCache overwrites this method.

[MAILPOET-3985]
2022-06-08 15:25:41 +02:00
David Remer
89b871775a Introduce TwigEnvironment
This commit introduces our own TwigEnvironment class which extends the original Twig\Environment.
The original class produced a different templateClass depending on the PHP version and
the selected options. As we can not rely on PHP version, this would have produced different
template hash keys in the end and Twig would have attempted to store new templates
on the disk, which we want to prevent.

[MAILPOET-3985]
2022-06-08 15:25:41 +02:00
David Remer
246268e00d Fix logic operator when detecting newsletter-editor page
[MAILPOET-4247]
2022-06-06 10:54:12 +02:00
David Remer
047040b0ed Prevent Google fonts from loading when they are disabled
[MAILPOET-4247]
2022-06-06 10:54:12 +02:00
Jan Lysý
5ab04b8b22 Remove usage constant from the old model
[MAILPOET-4338]
2022-05-19 14:18:06 +02:00
Jan Jakes
d9c47a40f2 Add permissions to manage automations
[MAILPOET-4287]
2022-05-19 10:09:05 +02:00
Jan Jakes
2c18b851e4 Add automation editor page
[MAILPOET-4287]
2022-05-19 10:09:05 +02:00
David Remer
7b33a94d37 Add set_user_role hook
[MAILPOET-2834]
2022-05-12 11:41:57 +02:00
David Remer
9bd6f29870 Add add_user_role hook to synchronizeUser
[MAILPOET-2834]
2022-05-12 11:41:57 +02:00
David Remer
acd8fbb773 Move MailPoet cron users to WordPress cron
[MAILPOET-4271]
2022-05-09 13:06:28 +02:00
Jan Lysý
c08bde077b Update symfony/dependency-injection package to v5
[MAILPOET-4227]
2022-04-27 08:57:54 +02:00
Brezo Cordero
8077322a29 Simplify the query to calculate lifetime emails
Also rename email_counts to email_count and update tests

[MAILPOET-4177]
2022-04-07 10:17:38 +02:00
Brezo Cordero
8fe323c9c7 Add new column on subscribers to store email counts
This value will store the emails received in the lifetime of a subscriber. Used for stats and deactivation.

[MAILPOET-4177]
2022-04-07 10:17:38 +02:00
David Remer
53fc49d1eb Simplify phpcs:disable comments
Additionally this commit contains a conversion from %d to %s in a query

[MAILPOET-4219]
2022-04-04 17:12:33 +02:00
David Remer
9f39843189 Sanitize incoming data according to WP sniffer
[MAILPOET-4219]
2022-04-04 17:12:33 +02:00
David Remer
cb55cae1b2 Escape SQL queries following wp org sniffs
[MAILPOET-4129]
2022-04-04 17:12:33 +02:00
David Remer
bde6c1ce65 Escape output according to sniffs
[MAILPOET-4219]
2022-04-04 17:12:33 +02:00