Commit Graph

40 Commits

Author SHA1 Message Date
Rostislav Wolny
f1941bc4da Add support for overriding cron site url via constant
This allows to configure a special URL base for cron.
Cases here are dev environments, but also potentially intranet sites or anything else with an atypical network layout
[MAILPOET-4406]
2022-06-09 09:31:56 +02:00
Jan Lysý
3bd49fbc27 Fix annotation in AutomatedEmails
[MAILPOET-4308]
2022-05-19 14:18:18 +02:00
Jan Lysý
5ab04b8b22 Remove usage constant from the old model
[MAILPOET-4338]
2022-05-19 14:18:06 +02:00
David Remer
33e5e15e98 Remove MailPoet Trigger
[MAILPOET-4271]
2022-05-09 13:06:28 +02:00
Brezo Cordero
add4039495 Cast type of meta in SubscribersEmailCount task for backwards fix
[MAILPOET-4281]
2022-05-09 13:05:21 +02:00
Rostislav Wolny
fe2397a65e Optimize WordPress cron trigger SQL
Majority of scheduled tasks DB records are completed tasks.
We check completed tasks only for Migration worker task type.
Excluding other workers' completed tasks significantly speeds up the query
on sites with longer history. E.g. on mailpoet.com the query sped up from 0.6s to 0.003s.

[MAILPOET-4314]
2022-05-09 10:19:20 +02:00
Rodrigo Primo
4113c35dc7 Replace Paris code with Doctrine in \MailPoet\Cron\Triggers\WordPress
[MAILPOET-4140]
2022-05-05 19:14:21 +02:00
David Remer
e4b53dd763 Do not deactivate an inactive daemon
If the daemon is already inactive, we do not need an additional SQL
insert

[MAILPOET-4267]
2022-05-02 13:09:12 +02:00
David Remer
8879e505e2 Exit early when the runInterval is -1
By default checkRunInterval will always return true because there is no way
the time which has passed since the last run is smaller than -1. To prevent
unnecessary code execution and an not needed SQL insert, we can return true
in checkRunInterval() early.

[MAILPOET-4267]
2022-05-02 13:09:12 +02:00
David Remer
ca3f8bdc43 Make Scheduler non-static
[MAILPOET-4252]
2022-04-25 12:08:18 +02:00
Jan Lysý
1310e5afec Disable marking subscribers as processed on error
[MAILPOET-4200]
2022-04-25 10:58:12 +02: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
d4a8315933 Use mailerFactory in SendingQueue Mailer task
[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
Jan Lysý
4a0534ac2a Remove deprecated upgrade link
[MAILPOET-4183]
2022-04-11 15:26:39 +02:00
Brezo Cordero
d0f645d239 Do not run email count if inactive subscribers disabled
[MAILPOET-4177]
2022-04-07 10:17:38 +02:00
Brezo Cordero
ba1da229a8 Add SimpleWorker to calculate Subscriber email_counts
[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
Sam Najian
a2ab1a3cfd Escape queries before passing to $wpdb methods
[MAILPOET-4219]
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
Rostislav Wolny
095f85c897 Update PHPStan and fix new issues
[MAILPOET-4175]
2022-03-28 13:49:41 +02:00
Rostislav Wolny
9b71a7804c Update Monolog/Monolog from v1 to v2
[MAILPOET-4175]
2022-03-28 13:49:41 +02:00
Rodrigo Primo
54ecb6065c Replace old ScheduledTask model with ScheduledTaskEntity in SubscribersFinder
[MAILPOET-3925]
2022-03-28 08:13:53 +02:00
Rodrigo Primo
0a73135c83 Replace old Segment model with Doctrine in SubscribersFinder
[MAILPOET-3925]
2022-03-28 08:13:53 +02:00
Jan Lysý
82e05dfe0f Add fixes for better compatibility with PHP8.1
[MAILPOET-4015]
2022-03-14 09:38:20 +01:00
Rostislav Wolny
b1976b2d1b Save correct processed_at when finishing scheduled task
[MAILPOE-4172]
2022-03-08 12:39:34 +01:00
Rostislav Wolny
6a6c04f168 Fetch only subscribed recipients when sending a newsletter
[MAILPOET-4166]
2022-03-07 16:05:48 +01:00
Jan Lysý
15877215d1 Use exception instead of early return
[MAILPOET-4047]
2022-03-01 10:58:31 +01:00
Jan Lysý
9fa2f7d051 Add annotation for the Bridge property
[MAILPOET-4047]
2022-03-01 10:58:31 +01:00
Rodrigo Primo
8c379cac1f Add bounced and unsubscribed stats to stats notification automated email
[MAILPOET-4102]
2022-02-16 11:19:02 +01:00
Rodrigo Primo
bdadcec987 Automated stats email: display clicks before opens and add machine opens
[MAILPOET-4102]
2022-02-16 11:19:02 +01:00
Rodrigo Primo
8fdd8b8120 Add unsubscribed and bounced data to stats notification email
[MAILPOET-3324]
2022-02-09 15:07:41 +01:00
Rodrigo Primo
6aae62505d Update stats notification email preheader to display clicks before opens
[MAILPOET-3324]
2022-02-09 15:07:41 +01:00
Rodrigo Primo
a43fd34f7d Stats email: display clicked in the first row and opened in the second
This commit makes some changes to the stats email. It displays just the
clicked stats in the first row and it moves the opened stats to the
second row. It also adds machine-opens alongside opens in the second
row.

[MAILPOET-3324]
2022-02-09 15:07:41 +01:00
David Remer
db6e963c94 Reset $metas array in processing method 'individual' [MAILPOET-3943] 2022-02-09 15:07:21 +01:00
Jan Lysý
6a20082782 Add check that createdAt is not null
[MAILPOET-4067]
2022-01-24 10:55:11 +01:00
Jan Lysý
5373c811b2 Add return annotation in BatchIterator
PHPStan reported an error in PHP8.1. When we use
the annotation ReturnTypeWillChange it caused another error
for PHPStan in combination in PHP7.2. The new annotations
are solving those issues.
[MAILPOET-4053]
2022-01-19 13:14:42 +01:00
Jan Jakes
9f790efbf0 Move plugin files to a subfolder
[MAILPOET-3988]
2022-01-18 15:30:22 +01:00