Commit Graph

22617 Commits

Author SHA1 Message Date
ad46417ee8 Add error handling logic for SQLite
[MAILPOET-6185]
2024-08-22 13:28:09 +02:00
a492658d48 Fix incorrect PHP version in comments
[MAILPOET-6195]
2024-08-21 19:23:28 +02:00
74b9d3788f Improve test for rollback to also check the outcome on the MyISAM engine
[MAILPOET-6195]
2024-08-21 19:23:28 +02:00
6b3592c4be Change default ordering in Automation analytics with subscribers
[MAILPOET-6174]
2024-08-21 15:15:21 +02:00
6b5fb2e92d Make all error messages translatable
[MAILPOET-6174]
2024-08-21 15:15:21 +02:00
50a00789b8 Add setting error message when email is missing
[MAILPOET-6174]
2024-08-21 15:15:21 +02:00
ecf0e1d2db Update error message in SendEmailAction
[MAILPOET-6174]
2024-08-21 15:15:21 +02:00
0761998eba Use typed properties in SendEmailAction
[MAILPOET-6174]
2024-08-21 15:15:21 +02:00
54043e5364 Update error messages in automations
[MAILPOET-6174]
2024-08-21 15:15:21 +02:00
2b2ee75288 Jump to version 5.0.0 2024-08-21 08:57:04 +03:00
38b5932c81 Release 4.59.0 2024-08-21 08:57:04 +03:00
a81163df71 Keep Typescript at 5.0.2
pnpm dedupe upated Typescript.
The update of Typescript is more complex. We also need to update the eslint
because there is a warning that TS version is not supported and
eslint-config-airbnb-typescript was abandoned so we need to remove it and
do some changes in eslint config for TS

[MAILPOET-6191]
2024-08-20 16:24:12 +02:00
1116b87eee pnpm dedupe
[MAILPOET-6191]
2024-08-20 16:24:12 +02:00
192725036d Update axios package
The package is a subdependency of @wordpress/scripts
I tried pnpm update axios but it didn't work.
I removed @wordpress/scripts and installed the same version again
and it updated the axios.
[MAILPOET-6191]
2024-08-20 16:24:12 +02:00
f31109d07c Update required pnpm manager version
I update pnpm because the required version is quite old and
some devs are using newer version anyways and mixing versions
causes strange changelogs in package-lock.yml

I ran corepack up but I removed the sha from the version
because the previous version didn't have it as well.
[MAILPOET-6191]
2024-08-20 16:24:12 +02:00
d16e1b69e7 Add timezone info to system report
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
bb7ab59ed5 Improve readability of scheduler code
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
07221d9c68 Get rid of unnecessary parameter in the Scheduler
The fromTimestamp parameter was used only in tests.
This commit replaces the parameter in tests by mocks and removes it.
 [MAILPOET-6142]
2024-08-19 15:29:42 +02:00
cb96086eb7 Rename methods for manipulating date in scheduling UI
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
6a4d3833c7 Get rid of unnecessary usages of .toISOString
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
54b800763b Replace usages of prefixed date methods with renamed variants
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
8c6136525e Remove unused date.ts methods and rename the prefixed methods
There is no use case for the methods without the translation to site's timezone.
When the input doesn't specify the timezone we treat it as utc.
When the input provides timezone (e.g. '2024-08-13 10:00+02:00' or new Date('2024-08-13 10:00+02:00'))
We respect the timezone of the input and print the result in the site's timezone.

When the site's timezone is set +01:00

'2024-08-13 10:00' prints as 2024-08-13 11:00
'2024-08-13 10:00:+02:00' prints as 2024-08-13 09:00
new Date('2024-08-13 10:00:+02:00') prints as 2024-08-13 09:00
new Date('2024-08-13 10:00:+00:00') prints as 2024-08-13 11:00

[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
9f32c59e49 Use DBAL Driver middleware to handle the correct connection timezone
I looked into using DBAL events for this but found that DBAL events
are deprecated so I went with middleware as they are recommended
as a replacement for the DBAL events.
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
3ea44e45d4 Remove adjustForTimezoneDifference functionality
This is no longer used. It was used in just a couple of places
and was fixing a difference between PHP time zone and browser time.
We rely on WordPress to set PHP timezone to UTC and we use the site's
timezone on the client so the fix is no longer useful.
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
f814624e0e Set GMT timezone to WPDB
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
506652bdc4 Fix scheduling post notifications
The user picks time in a select box, and we expect they pick a time
in the site's timezone so the saved cron expression is in the site's timezone.
When we calculate the next run date, we do it in the site's timezone and
to get UTC time, we convert it.
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
797a446470 Fix values in list of times in scheduling form
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
ef5ee6d59a Fix times in task lists on Help > System Status
The time adjustments are not necessary because we rely on WP setting
timezone to UTC.
Manipulation in adjustTimezone difference was causing us to display GMT time.
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
dac4eb82a4 Show proper time in listing for scheduled newsletter
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
73ffe485e7 Use isInFutureGmt to check future on send page
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
49ae4e5517 Show proper times for action scheduler info on help page
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
c6916431b0 Use proper time in scheduling calendar on send page
We add offset before we display time and we remove when we pass it to callback.
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
e9acdbf9ad Replace simple usages of date formating with offet aware methods
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
0bc5f3acc8 Add formatFromGmt etc to MailPoet.Date
This set of function expects input in GMT and add site's offset
They are meant to be used for data coming from server in GMT
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
9fa6890606 Pass GMT offset from WordPress settings to JS
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
5fdba0e170 Replace current_time usage in tests
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
33f4b2d729 Replace usage of WP's current_time without gmt parameter in libs
This commit replaces usages by Carbon::now or in case we need a timestamp it
keeps current_time but adds the gtm parameter as true.
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
9209a25199 Improve LastSubsribedAtListener to use fresh now
The cached now may cause the value to not be exact.
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
83fb7f55ea Use UTC time in TimestampListener
$this->wp->currentTime('timestamp') adds 'gmt_offset' value.
This was needed with PDO connection because the connection
used @session.time_zone set to the same offset value.

[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
9f56ee67b7 Skip null ids when deleting WP list subscribers with invalid emails
Theoretically, we may end up running the delete query with a condition like
WHERE wp_user_id IN (null, null);
This is a tiny optimization to skip null IDs to avoid running such a query.
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
c95cd1073b Improve SubscriberLifetieEmailCountTest to use saved entity
The test was using an empty entity which was not presisted. This may
potentially cause issues as in some places, an entity with a proper type might be expected.
It was already causing that an SQL query ran with WHERE type = null condition which is always false.
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
ec0210cdab Rename $value to $row in WPDB/Result for better readability
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
7f1c606040 Reintroduce legacy DB table name constants for backward compatibility
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
d53fde4250 Cleanup unused Doctrine drivers and other files
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
569204b594 Remove PDO
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
4531ae9e60 Use WPDB driver for Doctrine
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
200ea47926 Use mysqli to run test cleanups
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
accdb64894 Split mutli-query into multiple statements
WPDB doesn't support multi queries.

[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
8c4b2cf3ef Replace deprecated Statement::bindParam() and Statement::exec() with params
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
240f15e22a Fix missing array key
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00