Compare commits

..

761 Commits

Author SHA1 Message Date
b602edae52 Release 5.0.2 2024-08-26 16:33:59 +02:00
7ebcf324a6 Update code for the new cron-expression package
[MAILPOET-6167]
2024-08-26 14:52:05 +02:00
029b698b56 Replace cron-expression package with a fork
[MAILPOET-6167]
2024-08-26 14:52:05 +02:00
cbc2be2368 Remove the MYISAM tests
Now we have a check and warn users
InnoDB has been a default for 14 years

[MAILPOET-6184]
2024-08-26 10:20:45 +02:00
95476418fa Update used WooCommerce Subscriptions plugin in Circle CI
- latest version: 6.6.0
 - previous version: 6.5.0
2024-08-26 09:13:00 +02:00
db354f03c2 Update used Automate Woo plugin in Circle CI
- latest version: 6.0.32
 - previous version: 5.8.5
2024-08-26 09:13:00 +02:00
60c18e9cfa Update used WooCommerce plugin in Circle CI
- latest version: 9.2.2
 - previous version: 9.1.4
2024-08-26 09:13:00 +02:00
c75bcbd1ab Add Ukrainian community translations. Thanks Sasha
[MAILPOET-6198]
2024-08-26 08:55:28 +02:00
a91fd0abf1 Replace t() with __() in task scheduler translations
[MAILPOET-6200]
2024-08-25 22:42:20 +02:00
7068a7e6b1 Rename action scheduler cron option to prevent confusion for HEs
[MAILPOET-6200]
2024-08-25 22:42:20 +02:00
a94efb5563 Release 5.0.1 2024-08-23 16:32:40 +02:00
7756827b6e Remove unused parameters in MailPoet.date.toDate
The options were just set in init but there was no effect.
[MAILPOET-6197]
2024-08-23 15:36:00 +02:00
82c0b186d4 Do not apply offset when manipulating with date in the Date picker
We use DateTime component on the send page.
The DateTime component uses DateText for picking date.
We add site's offset before we pass the date to the DateTime.

The date-text component is nested in the DateTime and was also applying
offset on the date.

The second issue was we needed to convert the value to JS Date.
The MailPoet.Date.toDate expects the value to be in UTC, and we provided an already converted date.

So for offset -07:00
MailPoet.Date.toDate('2023-09-01');
ends up
Thu Aug 31 2023 17:00:00 GMT-0700 (Pacific Daylight Time) and calendar display's incorrect value.

This commit fixes it so that we don't touch offset in the DateText component.
[MAILPOET-6197]
2024-08-23 15:36:00 +02:00
f960b55acb Make sure the array contains the correct key
[MAILPOET-6184]
2024-08-22 14:33:54 +02:00
d137b55dd4 Catch errors while performing query
[MAILPOET-6184]
2024-08-22 14:33:54 +02:00
c039b220a7 Check the tables engine once per day
[MAILPOET-6184]
2024-08-22 14:33:54 +02:00
e9969b64ae Only display two table names
[MAILPOET-6184]
2024-08-22 14:33:54 +02:00
12cdba005c Add a warning if a table with incorrect engine detected
[MAILPOET-6184]
2024-08-22 14:33:54 +02:00
3c9cde6a45 Add an empty test
[MAILPOET-6184]
2024-08-22 14:33:54 +02:00
64c75fd0ca Create a new class for database notice
[MAILPOET-6184]
2024-08-22 14:33:54 +02:00
dd685f3284 Use __() for translations in new tsx file
[MAILPOET-6164]
2024-08-22 14:11:26 +02:00
b77cd11c02 Update tests
[MAILPOET-6164]
2024-08-22 14:11:26 +02:00
0f4bf52ca2 Hide machine opens in UI when opens are merged
[MAILPOET-6164]
2024-08-22 14:11:26 +02:00
8a506e7278 Show merged opens if respective setting is set
[MAILPOET-6164]
2024-08-22 14:11:26 +02:00
ee1043fce9 Add human and machine opens setting
[MAILPOET-6164]
2024-08-22 14:11:26 +02:00
c987733fba Make the form border consistent
In the renderer we only display the border if both
colour and size are set. Before this commit in the
editor we showed the border even if the colour
was transparent. This make it consistent and display
the border in the editor same way as in the renderer

[MAILPOET-6193]
2024-08-22 13:56:54 +02:00
912cd7965a Temporarily replace DROP DEFAULT with a CHANGE COLUMN for WP Playground
[MAILPOET-6185]
2024-08-22 13:28:09 +02:00
f584a673cb Temporarily skip queries incompatible with SQLite
[MAILPOET-6185]
2024-08-22 13:28:09 +02:00
4b69005900 Use subquery in DELETE for SQLite
[MAILPOET-6185]
2024-08-22 13:28:09 +02:00
279364cf86 Avoid using information_schema for WP Playground 2024-08-22 13:28:09 +02:00
53919dd71b Add helper for detecting SQLite database engine
[MAILPOET-6185]
2024-08-22 13:28:09 +02:00
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
fd72597e2c Fix last insert ID type check
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
c25d7d6b53 Use single quotes for strings in SQL queries
This is more standard SQL and required by WPDB.

[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
3b3ebb1cbd Pass SQLSTATE and code to query exceptions so they are converted to DBAL exceptions properly
The conversion is done by MailPoetVendor\Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter
that is returned from MailPoetVendor\Doctrine\DBAL\Driver\AbstractMySQLDriver.

[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
c42c37e8b1 Implement parameter conversion and named parameters
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
53cad38099 Implement Statement and Connection::prepare()
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
dc66a6a349 Implement Result and Connection::query()
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
2047f0b694 Implement Connection::exec() and other simple connection methods
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
c17d8feaa4 Implement basic WPDB Doctrine driver with connection, statement, and result stubs
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
ff6a98fae1 Replace deprecated array types with Doctrine's ArrayParameterType
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
c7dc7e5a24 Replace PDO types with Doctrine's ParameterType
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
8473511bff Remove Paris, Idiorm, and Sudzy
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
805c752843 Remove all old models and their setup
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
0584c63180 Replace old model table name constants with Doctrine repositories
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
437a4c414e Make sure the pQuery does not break html comments
We had the fix in the renderer, but we do use pQuery also in further processing of the rendered email
e.g. in code where we add GA tracking params to links.
In this commit, I moved the fix directly to the pQuery library so that it is safe to use
later in email code processing.
[MAILPOET-6190]
2024-08-19 13:14:12 +02:00
3214a86ee2 Add empty email check also for multisite registration
[MAILPOET-6188]
2024-08-16 09:35:45 +02:00
08ac80774c Add test for the registration class
[MAILPOET-6188]
2024-08-16 09:35:45 +02:00
a046d4ab6f Attempt to add a subscriber only when there is an email address
[MAILPOET-6188]
2024-08-16 09:35:45 +02:00
f022cc23fc Allow pingBridge endpoint for all users with access to the plugin admin
We call the endpoint on the admin pages and the restricted access was causing
that editor users were getting false error notices.
[MAILPOET-6189]
2024-08-14 11:54:28 +03:00
9feb0433e6 Show "from" value in logs when not explicitely set
It was empty before, and it looked like there are no logs. But they were just filtered for the last 7 days.

[MAILPOET-5670]
2024-08-14 10:26:54 +02:00
8ea0482ed8 Replace MailPoet.I18n.t with __() and _x()
[MAILPOET-5670]
2024-08-14 10:26:54 +02:00
4ce8ef48ab Add toggle button on MailPoet logs page
[MAILPOET-5670]
2024-08-14 10:26:54 +02:00
1722d383f9 Release 4.58.2 2024-08-13 15:23:15 +02:00
8ec7333a34 Track CAPTCHA setting to Mixpanel
[MAILPOET-6187]
2024-08-13 08:01:38 +02:00
172ffb7b61 Increase number of checks if the email was sent in automation
[MAILPOET-6175]
2024-08-12 16:11:19 +02:00
8868c98c25 Add test for CreateAutomationRunHookTest
[MAILPOET-6177]
2024-08-12 12:25:42 +02:00
2b38eb35ef Minimize the risk of race conditions for "once per subscriber" automations
[MAILPOET-6177]
2024-08-12 12:25:42 +02:00
e6e0d19a3a Update used Automate Woo plugin in Circle CI
- latest version: 6.0.31
 - previous version: 5.8.5
2024-08-12 09:27:45 +02:00
c5afaa9070 Fix flaky acceptance segment test
[MAILPOET-6141]
2024-08-09 11:12:31 +02:00
a2a30422a1 Fix twig generate cache error
[MAILPOET-6173]
2024-08-09 10:48:30 +02:00
5a7462a152 Delete max 10000 rows from scheduled task subscribers in cleanup.
DB may crash when deleting too many rows in one query.
The scheduled_task_subscribers has the potential to contain many records.
This commit adds limit when cleaning up inconsistent data from scheduled task subscribers.
[MAILPOET-6155]
2024-08-08 15:37:32 +02:00
4733bde082 Annotate types for PHPStan
[MAILPOET-1587]
2024-08-08 15:37:32 +02:00
12eabf26f2 Update Help API test
[MAILPOET-1587]
2024-08-08 15:37:32 +02:00
e646582942 Improve look of the data inconsistencies table
[MAILPOET-1587]
2024-08-08 15:37:32 +02:00
9b8af4cafd Add check for orphaned newsletter posts
[MAILPOET-1587]
2024-08-08 15:37:32 +02:00
45114e4da2 Add check for orphaned newsletter links
[MAILPOET-1587]
2024-08-08 15:37:32 +02:00
fe66e31b5f Add check for orphaned subscriptions
[MAILPOET-1587]
2024-08-08 15:37:32 +02:00
0d7898b3a5 Add inconsistency check and fix for sending queues without newsletter
[MAILPOET-1587]
2024-08-08 15:37:32 +02:00
cb4cea678a Show only inconsistencies that have at least one row
[MAILPOET-1587]
2024-08-08 15:37:32 +02:00
bbed9c35d2 Add check and cleanup for Orphaned sending task subscribers 2024-08-08 15:37:32 +02:00
34feae9f1f Delete also task subscribers when fixing orphaned scheduled tasks
[MAILPOET-1587]
2024-08-08 15:37:32 +02:00
c513befdb8 Add data inconsistency labels for humans
[MAILPOET-1587]
2024-08-08 15:37:32 +02:00
67a79728e2 Add fix button to data inconsistencies table
[MAILPOET-1587]
2024-08-08 15:37:32 +02:00
cb5f533e54 Add API for fixing inconsistent data
[MAILPOET-1587]
2024-08-08 15:37:32 +02:00
b68e6b7639 Add method for cleaning up orphaned sending tasks
[MAILPOET-1587]
2024-08-08 15:37:32 +02:00
08ffe6e3cf Refactor KeyValueTable to component to Typescript
[MAILPOET-1587]
2024-08-08 15:37:32 +02:00
85867d519e Print simple key-value table with data inconsistencies on help page
[MAILPOET-1587]
2024-08-08 15:37:32 +02:00
f10bce81a3 Pass data inconsistencies data to JS
[MAILPOET-1587]
2024-08-08 15:37:32 +02:00
54c21df3a6 Add backend classes for fetching inconsistent data
[MAILPOET-1587]
2024-08-08 15:37:32 +02:00
22ee156dcd Use inline property type hints for Help page
[MAILPOET-1587]
2024-08-08 15:37:32 +02:00
e1f38f3b83 Address offset issue in time comparison in AutomationEmailScheduler
[MAILPOET-6155]
2024-08-07 16:01:48 +02:00
0041a060b6 Improve check for recently scheduled tasks for sending action.
[MAILPOET-6155]
2024-08-07 16:01:48 +02:00
b2c7f49a41 Improve TimestampListener to use the current time for now instead of "cached" value
Using now "cached" on the TimestampListener instance was causing us to set createdAt and updatedAt slightly in the past.
It was potentially problematic in tests where the TimestampListener lives a long time or in long requests, such as a cron request.

[MAILPOET-6155]
2024-08-07 16:01:48 +02:00
8a0bd75cb1 Limit scheduled tasks fetching by automation run createdAt
This is a performance optimization to avoid fetching too many scheduled task rows.
Run is always created before the scheduled task which is created in send action step.
[MAILPOET-6155]
2024-08-07 16:01:48 +02:00
e5ab65f28e Fix send action checkSendingStatus to support multiple emails per subscriber.
It is possible that one email (e.g., purchase in category) is sent multiple times
to the same subscriber.

AutomationEmailScheduler::getScheduledTaskSubscriber was selecting the task based on subscriber and newsletter.
In the case of multiple emails sent to one subscriber, the method failed to pick ScheduledTaskSubsrciberEntity because
the query was fetching multiple results, but getOneOrNullResult expects only one result.

This commit fixes it by adding additional filtering by $runId to get the ScheduledTaskSubsriberEntity associated
with the correct run.

I did the filtering in PHP because an alternative would be using LIKE %% in the query. The meta column is text.
[MAILPOET-6155]
2024-08-07 16:01:48 +02:00
38b3fbe6fc Remove line-height from small variants of inputs
It was causing descender to be cut off. Removing it doesn't change the overall height of the input

[MAILPOET-5807]
2024-08-07 15:43:42 +02:00
c62fbda4df Add tracking for opt-in position
[MAILPOET-5807]
2024-08-07 15:43:42 +02:00
6a155ec454 Update migration to only check for presence of the setting, without version check
[MAILPOET-5807]
2024-08-07 15:43:42 +02:00
e640fa10cb Add default value for opt-in position to Populator
[MAILPOET-5807]
2024-08-07 15:43:42 +02:00
13e45a960f Add migration so existing active installations remain opt-in checkbox position
[MAILPOET-5807]
2024-08-07 15:43:42 +02:00
588f942640 Test all combinations of opt-in checkbox positions on block and shortcode checkout with AutomateWoo
[MAILPOET-5807]
2024-08-07 15:43:42 +02:00
59733db6de Fix hiding AutomateWoo opt-in checkbox when MailPoet opt-in is in different position
[MAILPOET-5807]
2024-08-07 15:43:42 +02:00
60895570af Add acceptance tests for opt-in checkbox positions on shortcode checkout page
[MAILPOET-5807]
2024-08-07 15:43:42 +02:00
9698795c7a Improve AutomateWoo integartion tests by checking both block and shortcode checkout pages
[MAILPOET-5807]
2024-08-07 15:43:42 +02:00
0da59169b9 Improve opt-in message test by checking both block and shortcode checkout pages
[MAILPOET-5807]
2024-08-07 15:43:42 +02:00
9f42614f92 Differentiate between block and shortcode checkout in tests
[MAILPOET-5807]
2024-08-07 15:43:42 +02:00
aca259068a Allow setting opt-in message in tests
[MAILPOET-5807]
2024-08-07 15:43:42 +02:00
02a148ef84 Use proper hook based on opt-in position setting
[MAILPOET-5807]
2024-08-07 15:43:42 +02:00
334756d18f Change the condition to check if opt-in on checkout is enabled to be easier to read
[MAILPOET-5807]
2024-08-07 15:43:42 +02:00
1c9ebb960f Add opt-in position setting
[MAILPOET-5807]
2024-08-07 15:43:42 +02:00
1200565a7f Use __() for translations in checkout-optin setting
[MAILPOET-5807]
2024-08-07 15:43:42 +02:00
80a7d3c5d7 Trigger abandoned cart check on WP user login
[MAILPOET-6161]
2024-08-07 12:45:42 +02:00
1115771b50 Release 4.58.1 2024-08-06 15:42:02 +02:00
b61d7f7b22 Add default value for only-tests parameter
The default value in the compile:all command was missing, which caused an error.
[MAILPOET-6178]
2024-08-06 13:31:15 +02:00
c5c89c400a Add comment to Circle config
[MAILPOET-6159]
2024-08-06 10:17:36 +02:00
644a963b01 Update PHP script updating used WordPress
[MAILPOET-6159]
2024-08-06 10:17:36 +02:00
5c16babf7b Add closing notice on Settings page in acceptance tests
[MAILPOET-6159]
2024-08-06 10:17:36 +02:00
4e8b7b7f34 Add command updating WP database to docker-entrypoint.sh
[MAILPOET-6159]
2024-08-06 10:17:36 +02:00
f86687ae1c Use WordPress image with oldest PHP and install specific WP version
Because required WordPress version does not have official images we need to install specific version via CLI.
[MAILPOET-6159]
2024-08-06 10:17:36 +02:00
c8e6c02851 Fix "Return value must be of type int, null returned" in Action Scheduler wrappers
[MAILPOET-6179]
2024-08-05 20:35:32 +03:00
1a80227b03 Fix button width when parent column is smaller
[MAILPOET-5732]
2024-08-05 14:09:31 +02:00
61e596e9d2 Fix width of button wrapping table
[MAILPOET-5732]
2024-08-05 14:09:31 +02:00
3a2d18308b Update integration tests
[MAILPOET-5732]
2024-08-05 14:09:31 +02:00
557e73e4cc Wrap email button to table for compatibility with Outlook 2023
[MAILPOET-5732]
2024-08-05 14:09:31 +02:00
a664186108 Unify setting no-cache headers, use only relevant headers
See also: https://stackoverflow.com/questions/49547/how-do-we-control-web-page-caching-across-all-browsers

[MAILPOET-6038]
2024-08-05 13:28:52 +02:00
ee6e22efa3 Regenerate CAPTCHA phrase using a custom request with cachebust to avoid caching
[MAILPOET-6038]
2024-08-05 13:28:52 +02:00
758cb09a77 Check for audio file existence before sending headers
[MAILPOET-6038]
2024-08-05 13:28:52 +02:00
975f42c56c Remove unnecessary check (it checks for image requirements, not audio)
[MAILPOET-6038]
2024-08-05 13:28:52 +02:00
38f7d97283 Compress captcha audio files more aggressively
This reduces the size of the files combined from 224KB to 64KB.

The command used was:

for f in originals/*.mp3; do ffmpeg -i "$f" -c:a libmp3lame -af "highpass=f=200, lowpass=f=15000, afftdn=nf=-30, anlmdn=s=1, rubberband=pitch=1.05, volume=1.5" -b:a 8k -ac 1 -ar 8000 "${f##*/}"; done

[MAILPOET-6038]
2024-08-05 13:28:52 +02:00
fad5e629af Simplify renderAudio and renderImage
[MAILPOET-6038]
2024-08-05 13:28:52 +02:00
71d7f46718 Make captcha session stateless
[MAILPOET-6038]
2024-08-05 13:28:52 +02:00
e8cf3d61ef Make captcha phrase stateless
[MAILPOET-6038]
2024-08-05 13:28:52 +02:00
10ef9ffce5 Initialize CAPTCHA session and phrase on page load
Previously, a new CAPTCHA phrase was generated when the CAPTCHA image
or audio was requested "again". For that, a counter needed to be stored in the
session, and since image and audio were fetched in parallel, any of them could
initialize the new CAPTCHA phrase. The problem appeared when they both
generated a new phrase at the same time. This resulted in a race condition,
where the image and audio had different CAPTCHA phrases and some users
weren't able to pass the CAPTCHA at all. This was occuring especially in Safari,
(maybe somehow due the type dectection range "preflight" request).

Now, the phrase is initialized on the CAPTCHA page load (and reloaded via AJAX),
so we don't need to store any additional metadata, apart from the phrase itself.

[MAILPOET-6038]x
2024-08-05 13:28:52 +02:00
3b0dd085bd Update Create an account label 2024-08-05 13:07:49 +02:00
784d7c1189 Move building Newsletter tests to their job
[MAILPOET-6178]
2024-08-05 12:31:08 +02:00
e2e1346649 Use skipping test in build all command
[MAILPOET-6178]
2024-08-05 12:31:08 +02:00
d12f88e80c Fix typo in filename, which prevents removing the file on case sensitive file systems
[MAILPOET-6172]
2024-08-02 12:03:45 +02:00
f2e048282a Reset terminal color
This caused that all output below this was in red color, even if it's unrelated to this script

[MAILPOET-6172]
2024-08-02 12:03:45 +02:00
e28faf837d Fix flaky ReceiveScheduledEmailCest test
[MAILPOET-6172]
2024-08-02 12:03:45 +02:00
d7330a1f65 Fix flaky ScheduleNewsletterCest test
[MAILPOET-6172]
2024-08-02 12:03:45 +02:00
83da3ada72 Fix typo causing all options to have the same key
Console Warning: Encountered two children with the same key, `option-8:00 am`.

[MAILPOET-6172]
2024-08-02 12:03:45 +02:00
b36b857891 Fix passing version to verify command
[MAILPOET-5678]
2024-08-02 08:58:56 +02:00
685b5f835c Use verify and delete zip in publish command
[MAILPOET-5678]
2024-08-02 08:58:56 +02:00
d9b524f08f Add new command verifying release zip
The command should verify containing the required version in the ZIP file.
[MAILPOET-5678]
2024-08-02 08:58:56 +02:00
e781843c6b Add new command for deleting old release zip
[MAILPOET-5678]
2024-08-02 08:58:56 +02:00
ccc922548b Rename test parameter from LATEST_BETA to WORDPRESS_VERSION
[PREMIUM-230]
2024-08-01 11:48:13 +03:00
a2f35526fa Remove forgotten calling debug function
[PREMIUM-230]
2024-08-01 11:48:13 +03:00
870008123c Make the test environment compatible with the premium plugin
[PREMIUM-230]
2024-08-01 11:48:13 +03:00
22584747a0 Move tests docker configuration
Because we want to unify tests environment in the premium plugin. This step should allow us to reuse it easier.
[PREMIUM-230]
2024-08-01 11:48:13 +03:00
6805d68ede Add label check-versions to link PRs with the job that created them
[MAILPOET-6171]
2024-07-31 12:28:20 +02:00
9c8aa381f0 Add info for local testing for check
[MAILPOET-6171]
2024-07-31 12:28:20 +02:00
d0be17e0d3 Force push changes to update existing PRs in Check Updates GH Workflow
[MAILPOET-6171]
2024-07-31 12:28:20 +02:00
0d14b58c91 Update PR title, label and content of PR with plugin and WP imaged updates
[MAILPOET-6171]
2024-07-31 12:28:20 +02:00
62ba5a4a1c Update used Automate Woo plugin in Circle CI
- latest version: 6.0.30
 - previous version: 5.8.5
2024-07-31 12:13:59 +02:00
71b2ee2ad6 Update used WooCommerce plugin in Circle CI
- latest version: 9.1.4
 - previous version: 9.0.2
2024-07-31 12:13:59 +02:00
ee976a13a7 Update used WordPress images in Circle CI
- latest version: 6.6.1-php8.3
 - previous version: 6.5.5-php8.1
2024-07-31 12:13:59 +02:00
b22c2d6b6f Release 4.58.0 2024-07-30 16:26:48 +02:00
7f1320258c Add migration to fix failed automation runs that should have been complete
[MAILPOET-6154]
2024-07-29 15:03:47 +02:00
7f27d5f850 Add test
[MAILPOET-6154]
2024-07-29 15:03:47 +02:00
2e13570dd7 Correctly complete automation run when there is an empty branch in if/else
[MAILPOET-6154]
2024-07-29 15:03:47 +02:00
63c19d2508 Always show Subscribers tabs in Analytics
[MAILPOET-6154]
2024-07-29 15:03:47 +02:00
682e3424ad Remove comments about deleting checks for BC support
We can't be sure that after a year, all customers will re-save the email.
To avoid future issues, we will keep the check in place.
[MAILPOET-4180]
2024-07-29 14:41:43 +02:00
8c0af16cf5 Add support for heading font color to Woo transaction email renderer
[MAILPOET-4180]
2024-07-29 14:41:43 +02:00
24fb78a696 Add heading font color control to Woo email customizer
[MAILPOET-4180]
2024-07-29 14:41:43 +02:00
560b5f37e6 Improve test coverage for Woo emails renderer
[MAILPOET-4180]
2024-07-29 14:41:43 +02:00
78cf676f71 Remove unused CSS for main heading font size in Woo emails
This heading will from now on respect H1 font-size which default
value is 36px.
[MAILPOET-4180]
2024-07-29 14:41:43 +02:00
3b53c69eb7 Refactor modifications of styles from Woo to an extra method
[MAILPOET-4180]
2024-07-29 14:41:43 +02:00
e3d60252a8 Render heading font family in Woo transactional emails
[MAILPOET-4180]
2024-07-29 14:41:43 +02:00
e5ca39b498 Add heading font family to Woo email customizer
[MAILPOET-4180]
2024-07-29 14:41:43 +02:00
6281e41243 Add Typography label and change label positioning in Styles panel
[MAILPOET-4180]
2024-07-29 14:41:43 +02:00
6d2dc2fbf8 Apply heading font sizes to Woo content in emails
[MAILPOET-4180]
2024-07-29 14:41:43 +02:00
dc2d66c42c Allow setting font sizes for headings in Woo customizer
[MAILPOET-4180]
2024-07-29 14:41:43 +02:00
2fcca5fcb9 Add a check to apply style fixes only after the email was re-saved
Some styles newly applied for the Woo Content blocks might
make the blocks look broken (e.g., too big font applied on the order items table).
This commit adds a check for existing emails, and for sites with existing customized the Woo email template
they are not applied unless a user saves the email in the editor.
[MAILPOET-4180]
2024-07-29 14:41:43 +02:00
53ca386f7a Enforce a special heading color for the Woo email header
[MAILPOET-4180]
2024-07-29 14:41:43 +02:00
e62fca24dd Set font size for Woo content
This set font size for the WooContent block.
The font size is applied to elements that don't have an inlined font size.
[MAILPOET-4180]
2024-07-29 14:41:43 +02:00
bb9b56a04d Enforce the same font family for headings in the Woo transaction email.
In the Woo email customizer, we have only one font family.
The newsletter data carry different default font families for headings.
In this commit, we enforce that the renderer uses the same font family
for text and headings.
This only applies to the part of the email that is handled by the MailPoet renderer.
The part that comes from the Woo itself is handled differently.
See previous commits.
I used clone to make sure we don't accidentally save the settings.
It wouldn't probably cause any damage because we don't expose these settings to users, but to be safe.
[MAILPOET-4180]
2024-07-29 14:41:43 +02:00
fcb865a1e7 Unify headings in Woo Customizer to use branding color and global font
[MAILPOET-4180]
2024-07-29 14:41:43 +02:00
c3b3df325b Replaced inlined font-family definitions in email content from Woo
[MAILPOET-4180]
2024-07-29 14:41:43 +02:00
49ca792fc2 Use font family from Woo Customizer in Woo email styles
Woo has a stylesheet that is later inlined into the email content by Emogrifier.
In this commit I replace all font family declarations by the font family set
in the Woo customizer.
[MAILPOET-4180]
2024-07-29 14:41:43 +02:00
5c3fdd9468 Apply style settings on Woo Blocks in the Woo Customizer
The font size was not applied at all, but Woo content comes with inlined font-family
styles so we need to use !important to override it.
[MAILPOET-4180]
2024-07-29 14:41:43 +02:00
14428c973c Revert "Keep text in square brackets in post notifications"
This reverts commit 14be775e74.
2024-07-29 15:36:07 +03:00
fd823efde8 Update sample run logs data structure
[PREMIUM-280]
2024-07-29 14:29:04 +02:00
d37cffd3ea Show time left for step in activity modal
[PREMIUM-280]
2024-07-29 14:29:04 +02:00
fe273284f4 Remove next step from activity modal
The previous assumption was, that a Delay action is not in mailpoet_automation_run_log database, and had to be calculated. But this was a wrong assumption, and since the action is there, we don't have to calculate it.

[PREMIUM-280]
2024-07-29 14:29:04 +02:00
b6653bac86 Show link to Scheduled Actions when the automation run is past due when it was suppose to run
[PREMIUM-280]
2024-07-29 14:29:04 +02:00
e3ad38e405 Properly close activity modal when there is an error in API
[PREMIUM-280]
2024-07-29 14:29:04 +02:00
7be9ade5f4 Prevent updating WordPress users data
[MAILPOET-6168]
2024-07-25 15:10:57 +02:00
2a10a5817b Add a test for non existing subsriber
[MAILPOET-6168]
2024-07-25 15:10:57 +02:00
2cdb12f712 Add Update Subscrber method to MP API
[MAILPOET-6168]
2024-07-25 15:10:57 +02:00
f471e332af Remove unnecessary circleci config re k6 2024-07-25 15:27:38 +03:00
077328c469 Fix flaky performance test and disable it from PRs
[MAILPOET-6157]
2024-07-25 15:27:38 +03:00
c05b45ac80 Replace deprecated prop
[MAILPOET-5184]
2024-07-25 08:39:13 +02:00
1f875ac14f Show automation action inserter popup in the bottom center position
This fixes position especially on mobile phones, but also on desktops < ~1050px

[MAILPOET-5184]
2024-07-25 08:39:13 +02:00
ed9e91e62a Fix automation action selector popup on small devices
[MAILPOET-5184]
2024-07-25 08:39:13 +02:00
c5c9b37198 Update test 2024-07-24 21:26:05 +02:00
4c91120654 Fix WooCheckoutBLocks test 2024-07-24 21:26:05 +02:00
0c000b0595 Fix deprecation warning from interact.js
[MAILPOET-6151]
2024-07-24 09:41:05 +02:00
4f72d7ee8c Release 4.57.0 2024-07-23 19:21:27 +03:00
6173077e4c Make 'At' lowercase
[MAILPOET-6158]
2024-07-23 09:01:34 +03:00
d4e239ace5 Declare tested up to 6.6
[PREMIUM-276]
2024-07-22 16:58:56 +03:00
0f37eb8ebf Allow formatting tags in post titles
[MAILPOET-5920]
2024-07-22 11:57:39 +02:00
4683a5f783 Fix typo. 'would' -> 'will'
[MAILPOET-6156]
2024-07-22 09:08:00 +03:00
36735e71f7 Fix flaky create segment test 2024-07-20 17:41:11 +02:00
9b3967e31e Add helper and fix flaky manage segments test 2024-07-20 17:41:11 +02:00
89b65adc30 Skip new email editor tests because it's not compatible with WP 6.6 yet 2024-07-19 17:41:09 +02:00
08a48c46ed Update used WooCommerce Subscriptions plugin in Circle CI
- latest version: 6.5.0
 - previous version: 6.4.1
2024-07-19 17:41:09 +02:00
dddf09d87b Update used WordPress images in Circle CI
- latest version: 6.6.0-php8.3
 - previous version: 6.5.5-php8.1
2024-07-19 17:41:09 +02:00
dec9a02ca4 Replace join query with a simple query
[MAILPOET-6148]
2024-07-19 15:03:35 +02:00
a9b7e5210c Add form placement options to readme.txt
[MAILPOET-6152]
2024-07-18 14:57:11 +02:00
d9edca0688 Improve condition in acceptance tests for WP 6.6
Because we run tests with release candidate versions, the condition didn't work as expected in those cases.
2024-07-17 16:35:00 +02:00
19b21fb2bf Improve TemplateImageLoader robustness
[MAILPOET-3923]
2024-07-17 16:03:19 +02:00
d82d6b89e9 Add test for external image loading
[MAILPOET-3923]
2024-07-17 16:03:19 +02:00
106c7d48f3 Add proxy to load external images for template thumbnails
[MAILPOET-3923]
2024-07-17 16:03:19 +02:00
2242d29e69 Release 4.56.0 2024-07-16 15:26:10 +02:00
934fd54278 Fix extraction of RC WordPress versions
[MAILPOET-6096]
2024-07-15 14:28:16 +02:00
268330f1a0 Disallow activating emails without list specified in listing
[MAILPOET-5352]
2024-07-15 14:04:12 +02:00
dbdb9b7ccc Show WooCommerce list on newsletters pages only when it makes sense
I found that we already have a logic for determining whether to show
Woo segment. It also covers case when there are Woo customers in the DB
but Woo plugin is not active.
This logic is used in segments listing API. I reused it also for fetching
lists on the newsletters page.
[MAILPOET-5224]
2024-07-15 13:51:13 +02:00
41d8bb3054 Unify properties declaration style in Newsletters.php
[MAILPOET-5224]
2024-07-15 13:51:13 +02:00
16525d5cce Fixed dragging images after being resized
[MAILPOET-6109]
2024-07-15 11:10:19 +02:00
c11460fd30 Prevent text selection when resizing
[MAILPOET-6109]
2024-07-15 11:10:19 +02:00
e4730f7e31 Prevent text selection when dragging
[MAILPOET-6109]
2024-07-15 11:10:19 +02:00
08f0f2bf38 Fix cloning dragged element
In new interact.js versions, you can no longer assign a clone to the element (it's read only). This is a workaround without doing a major refactor.

[MAILPOET-6109]
2024-07-15 11:10:19 +02:00
8c2f41dcf1 Fix calculating drop zone position
dragmove event is no longer present

[MAILPOET-6109]
2024-07-15 11:10:19 +02:00
5c349a506b Replace interact.js with interactjs
[MAILPOET-6109]
2024-07-15 11:10:19 +02:00
f0687b585d Check 500 error using exception 2024-07-15 11:01:48 +02:00
65f7f41f9f Add retry when downloading files from github 2024-07-15 11:01:48 +02:00
99a3cf2ea0 Remove obsolete property from docker compose 2024-07-15 11:01:48 +02:00
4b5d490e58 Update used Automate Woo plugin in Circle CI
- latest version: 6.0.29
 - previous version: 5.8.5
2024-07-15 09:59:55 +02:00
7864f99b3b Update used WooCommerce plugin in Circle CI
- latest version: 9.1.2
 - previous version: 9.0.2
2024-07-15 09:59:55 +02:00
06c3891eba Fix broken HPOS tests
We complete the actions in the database. However, we don't delete
the batch processes. Woo thinks those crashed. It tries to log an
error, but it doens't have suficient rights for that.
2024-07-12 10:05:39 +02:00
14be775e74 Keep text in square brackets in post notifications
[MAILPOET-5197]
2024-07-11 12:31:22 +02:00
b5eda778aa Update tests to be compatible with upcoming WP 6.6 2024-07-11 07:50:46 +02:00
6522654a9e Fix incorrect CSS import
This was causing that browser was trying to fetch the CSS file from
relative path from node modules and was getting 404.
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
cdd831d24d Set automation listing route basename to fix MailPoet logo link target
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
ac6bde4159 Improve navigation fallback to point to current page
This fixes click on logo e.g. on the Settings page.

[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
6057163b62 Revert "Fix tiny CSS glitches on segment editor page"
This reverts commit 65a44a947be6a134456271793183b5ad5f70d743.
2024-07-10 18:02:00 +02:00
b905ff1125 Fix MSS step in welcome wizard
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
80906c27f0 Fix newsletter listing routes
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
2534b58931 Fix welcome wizard router
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
ab50e3328e Fix routes in subscribers import
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
1699315a1d Fix default route in RoutedTabs
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
9e0ff7b99a Fix router for subscribers
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
9bd31fe2aa Fix useNavigate errors coming from Logo
Previously we used useHistory which wasn't throwing errors in case
it was used outside of router. It just returned undefined.
The undefined was causing errors being logged in console on admin pages
where we don't define onClick explicitly and where we don't use router.

useNavigate throws an error if it is not inside the router. In this commit, I added
handling of the error and default fallback that redirects to the homepage in cases where there is no router.
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
1bfe45fc10 Fix router in forms.jsx
Route must always be wrapped in Routes
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
7bcfe93269 Replace forgotten occurences of match.params with useParams hook
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
bb83d2ff1b Fix RoutedTabs for switch-only variant
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
a36d71850a Fix Routes and paths for newsletter listing
Paths don't support regexps any more https://reactrouter.com/en/main/upgrading/v5#note-on-route-path-patterns
[MAILPOE-3911]
2024-07-10 18:02:00 +02:00
6a4e81bd88 Remove nested HashRouter from dynamic segments list.tsx
This was causing: You cannot render a <Router> inside another <Router>. You should never have more than one in your app.
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
913bb7e50a Remove @types/react-router-dom
v6 is written in Typescript
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
cd3c6982da Fix tiny CSS glitches on segment editor page
This was causing small items like badges and values in multi selelect
to look broken.
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
feadef6c3c Update usage of Link components
See https://reactrouter.com/en/main/upgrading/v5#pass-link-state-as-separate-prop
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
d781b899c7 Delete unused component EventsConditions
This component seems to be a leftover after we removed automatic email.
It uses this.prop.history.push which is no longer available.

I was not able to find any usage of this component in the free or premium
plugin.
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
fc76b5608d Remove the rest of the usages of history.push
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
f54b9f590c Replace <Redirect> with <Navigate>
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
ca77a01d5c Replace useRouteMatch
The hook useRouteMatch was removed in react-router-dom v6
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
f917b4e885 Replace withRouter with react-router-dom hooks
withRouter was removed
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
0f5fbcf044 Replace useHistory which was removed from react-router-dom
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
530f62f021 Refactor Switch to Routes
See https://reactrouter.com/en/main/upgrading/v5#upgrade-all-switch-elements-to-routes
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
8810a734b5 Update react-router-dom package to v6
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
ce0901a237 Refactor redirects placed directly in <Switch>
This is per the second step in https://reactrouter.com/en/main/upgrading/v5
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
76cf3cfd75 Refactor Route render or component to children
This is per the first step in update guide https://reactrouter.com/en/main/upgrading/v5
[MAILPOET-3911]
2024-07-10 18:02:00 +02:00
c84910c075 Add test for switching active automation to draft
[MAILPOET-6131]
2024-07-10 12:56:52 +02:00
9be6895cf1 Simplify automation test helpers
[MAILPOET-6131]
2024-07-10 12:56:52 +02:00
b7cee657c7 When unscheduling automation run actions, cancel related runs
[MAILPOET-6131]
2024-07-10 12:56:52 +02:00
45592114bd Fix privacy policy links not being replaced if no privacy page exists
[MAILPOET-4504]
2024-07-10 12:27:20 +02:00
da93cc5237 Render sender domain notice together with other field errors
[MAILPOET-5270]
2024-07-09 17:09:41 +02:00
f3da8048c4 Expose sender domain notice component
[MAILPOET-5270]
2024-07-09 17:09:41 +02:00
63189e6b5d Move sender domain notice component up to components dir
[MAILPOET-5270]
2024-07-09 17:09:41 +02:00
b0c8d84c78 Ensure value is always number
https://github.com/mailpoet/mailpoet/security/code-scanning/13
2024-07-09 16:02:12 +02:00
1d0596f14f Update used WooCommerce Subscriptions plugin in Circle CI
- latest version: 6.4.1
 - previous version: 6.3.2
2024-07-09 13:28:25 +02:00
f490215ff2 Release 4.55.0 2024-07-09 13:12:56 +02:00
1c41fe81b1 Fix side effect in shortcodes test
[MAILPOET-5359]
2024-07-09 09:03:18 +02:00
b59e6fb683 Add instructions for running individual acceptance test in premium 2024-07-08 16:31:13 +02:00
0017e21523 Add Table of Contents in free plugin README
[MAILPOET-6136]
2024-07-08 16:31:13 +02:00
757582546d Simplify free plugin README + small improvements
[MAILPOET-6136]
2024-07-08 16:31:13 +02:00
3e40492caf Add section on translators comments
[MAILPOET-6136]
2024-07-08 16:31:13 +02:00
dc49f56c7f Add Table of Contents in README
[MAILPOET-6136]
2024-07-08 16:31:13 +02:00
c7cbece95c Better header structure in README
[MAILPOET-6136]
2024-07-08 16:31:13 +02:00
79ae36f4db Remove new template section - the link is 404
[MAILPOET-6136]
2024-07-08 16:31:13 +02:00
3912426190 Add examples how to run individual tests locally
[MAILPOET-6136]
2024-07-08 16:31:13 +02:00
f7b942ece6 Simplify SUPPORT
[MAILPOET-6136]
2024-07-08 16:31:13 +02:00
945680f643 Improve CONTRIBUTING
[MAILPOET-6136]
2024-07-08 16:31:13 +02:00
b6d8b86afd Remove issues section as it's irrelevant for external contributors
[MAILPOET-6136]
2024-07-08 16:31:13 +02:00
c87fc41a22 Remove IdiORM to Doctrine section as it's completed now
[MAILPOET-6136]
2024-07-08 16:31:13 +02:00
ce94e24fb1 Fix rendering of special characters using [site:name] shortcode
[MAILPOET-5359]
2024-07-08 14:45:41 +02:00
a4c6929e27 Fix type
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
a23d6e2609 Unify font-size and verically align activity modal header
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
cd424e9e58 Add detailed run logs sample data
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
964b391672 API now returns "Unknown step: $key" so fallback is not needed
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
0dffcc5ebd Update API endpoint response structure
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
ac751871f9 Unify automation endpoint 404 exceptions
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
8376494d6f Simplify managing state of runId URL parameter
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
9d964ab6e3 Rename "View subscribers activity" to "View subscriber activity"
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
131ecec452 Use tertiary button variant for bigger click area
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
b2853af8c7 Simplify code by removing ternary operator, which is not necessary, because logs is always an array
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
d18706d81f Return null when activity modal is hidden
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
61f992a823 Only render log status info when it's available
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
b725f7af17 More robust query building
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
9fa81e6887 Close modal on error (notice will be shown)
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
58a81a2f7a Make activity modal header white, so the text doesn't overlay when scrolling
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
ba79200f55 Show time left in activity modal for Delay action
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
abbabeef6a Show next step in activity modal
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
083b6bf8d6 Show step name instead of key in activity modal
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
0796b6d258 Show error message in activity modal
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
0d95963c15 Reduce flex-grow as it caused customer to be put on multiple lines
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
35995ce1be Show sample run logs when premium is not active and valid
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
785957731f Move RunData type to prevent cyclic dependency
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
83e8a828ac Use unified status badge
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
0c94994784 Update types for API response
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
302837724b Add footer to activity modal with run status
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
91aa10ac63 Show table of subscriber's run logs in modal
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
42bccf0a9a Add activity modal header with subscriber info
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
e833f34826 Fetch run data when URL parameter changes
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
a92f876b96 Add types for API response
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
8c612a7d82 Open activity modal when clicked on "View activity" button
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
79da5c5124 Add activity modal skeleton that reacts to "runId" URL parameter
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
d298ca40c4 Add new column to view subscriber's activity in automation analytics
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
10ed39ece3 Rename "View subscribers" to "View subscribers activity" in automation analytics
[MAILPOET-5436]
2024-07-08 14:37:30 +02:00
55d69869d7 Install react-codemirror
[MAILPOET-5483]
2024-07-08 14:29:08 +02:00
58c7ab526c Upgrade codemirror dependency
[MAILPOET-5483]
2024-07-08 14:29:08 +02:00
a0ada40c9f Use react code mirror
[MAILPOET-5483]
2024-07-08 14:29:08 +02:00
237e3988bf Fix flaky clicking segment action items 2024-07-04 09:14:56 +02:00
e52ffbc32c Don't show email stats for cancelled scheduled emails
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
22754ac717 Add tests for cancelling and rescheduling tasks, and check that it resumes sending queue
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
7f01d11a31 Add tests that it's not fetching deleted tasks
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
8b7556a479 Add more tests for rescheduling tasks
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
31821d05b5 Fix test
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
898e45b275 Show list of paused tasks
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
9236c0ee6a Fix query builder for getting tasks by status
st.deletedAt line was ignored, because the "->where" on the next line replaced it. Resulting query was also wrongy built because of mixing of OR and AND conditions.

[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
d4e42eead7 Show total number of cancelled task on System Status page
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
7bacd887a9 Resume sending queue when rescheduling cancelled task
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
255122ebd3 Show that newsletter is cancelled when sending task is cancelled
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
73d302556e Use class names instead of hardcoded classes in tests
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
4af5720741 Refactor help endpoint
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
5253d79e81 Use types in new class properties
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
d0d6cb108f Limit the width of confirm modal in welcome wizard
[MAILPOET-6113]
2024-07-04 08:04:34 +02:00
fe5010110b Fix typo
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
6155053f91 Limit the width of confirm modal when cancelling/rescheduling tasks
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
e2c6f61ecd Show "Cancel task" button on running tasks
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
ef2101ef46 Allow running tasks to be cancelled
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
b8ca544596 Fix HelpTest integartion tests
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
2117d43d6b Add integration tests for Help API
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
5847918409 Return 400 instead of 404 in Help API
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
64ccf5b948 Add ScheduledTasksRepository integration tests for new cancelled status
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
3f6210c7ed Show date time in local (not server) timezone on Help > System Status page
Related to #5650

[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
4805e611e7 Add message for reschedule task confirmation
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
d60629a98c Add message for cancel task confirmation
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
9a46009568 Show error message in confirm modal
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
d71278a6bb Call API to cancel or reschedule task
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
abfbdb4e7d Show confirm modal when cancelling or rescheduling task
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
7d4a737fb6 Update TaskButton component to accept the whole task, not just ID
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
e8de391741 Replace MailPoet.I18n.t with __
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
88c0836443 Create endpoints to cancel and reschedule tasks
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
65d347bf85 Refactor your-privacy to TypeScript
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
f2719f6716 Refactor queue-status to TypeScript
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
66e6de9be9 Refactor tasks-list to TypeScript
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
2dc036007e Refactor tasks-list-data-row to TypeScript
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
00824d82d3 Refactor tasks-list-labels-row to TypeScript
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
d38a63f0e6 Add column with (non-implemented) action to cancel or reschedule
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
4211e02d6a Show list of cancelled sending tasks
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
1918d30fcd Add migration for a new cancelled_at column for scheduled tasks
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
e55a861137 Show subscriber email if a sending task has only a single subscriber
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
5f4d4c59fd Increase number of tasks to 20 on Help > System Status
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
599ecd6323 Remove "type" column in Help > System Status as all tasks are with "sending" type
[MAILPOET-5755]
2024-07-04 08:04:34 +02:00
703bd75578 Fix datepicker header on pages with border-box applied to all elements
[MAILPOET-6140]
2024-07-02 18:22:25 +02:00
610f903f07 Release 4.54.0 2024-07-02 17:22:04 +03:00
83c6e94073 Fix destructuring assignment
Introduced in a351437

[MAILPOET-6138]
2024-07-02 11:34:41 +02:00
3ff825ffca Fix subscriber verification to allow sending all transactional emails
[MAILPOET-6115]
2024-07-01 13:01:30 +02:00
a24922a0d2 Use SubscriberEntity constants in tests
[MAILPOET-6115]
2024-07-01 13:01:30 +02:00
db62990c0c Make Legacy Abandoned Cart emails transactional
[MAILPOET-6115]
2024-07-01 13:01:30 +02:00
3ce6a83789 Test legacy emails are transactional
[MAILPOET-6115]
2024-07-01 13:01:30 +02:00
fd0d1036e6 Add isTransactional method to NewsletterEntity
[MAILPOET-6115]
2024-07-01 13:01:30 +02:00
2cba628c29 Do not check subscriber status during abandoned cart scheduling
The abandoned cart automation allows for transactional abandoned carts. Therefore we should not check for the subscriber status when initalizing the abandoned cart mechanism

[MAILPOET-6115]
2024-07-01 13:01:30 +02:00
18852e8ea4 Test abandoned cart gets scheduled regardless of subscriber status
[MAILPOET-6115]
2024-07-01 13:01:30 +02:00
21672efd3d Fix automation icons, that are wrapped in <div> (like if/else)
[MAILPOET-6132]
2024-07-01 10:24:30 +02:00
57ef2c83dc Make icons bigger in automation subscribers analytics
[MAILPOET-6132]
2024-07-01 10:24:30 +02:00
f2fddf43ee Make icons bigger in automation editor steps
[MAILPOET-6132]
2024-07-01 10:24:30 +02:00
a292ded28e Make icons bigger in automation editor block popup without scaling
Scaling can make icons blurred in some browsers.

[MAILPOET-6132]
2024-07-01 10:24:30 +02:00
baf8639de5 Normalize automation icon sizes
[MAILPOET-6132]
2024-07-01 10:24:30 +02:00
62b9223d2b Remove hardcoded sizes and scales from automation icons
[MAILPOET-6132]
2024-07-01 10:24:30 +02:00
55e1ff7d8f Fix fatal error when trying to create a new segment with option subscribed date
MAILPOET-6133
2024-06-28 17:41:42 +02:00
788112cbfc Fix condition for checking that the latest version is beta or RC
[MAILPOET-6096]
2024-06-28 17:36:36 +02:00
5f3b94381a Remove no longer needed packages
[MAILPOET-5491]
2024-06-28 16:11:07 +02:00
924b01d85c Remove no longer supported import syntax, use CommonJS for tests instead
Using inject-loader requires first transpiling modules to CommonJS. Previously,
we were doing this via parametrized imports, but these are no longer supported.
Instead, we can fix this by using CommonJS preset in Webpack config.

[MAILPOET-5491]
2024-06-28 16:11:07 +02:00
4ed5ce2ba3 Update babel-loader to 9.1.3
[MAILPOET-5491]
2024-06-28 16:11:07 +02:00
605664228e Improve code readability
[MAILPOET-6119]
2024-06-28 14:27:21 +02:00
242c29398d Keep the latest changelog in both readme and changelog files
[MAILPOET-6119]
2024-06-28 14:27:21 +02:00
0fac09172a Fix formating of readme file
[MAILPOET-6119]
2024-06-28 14:27:21 +02:00
e023501c31 Fix a typo in method name
[MAILPOET-6119]
2024-06-28 14:27:21 +02:00
7abfa53c2f Copy changeset on release
[MAILPOET-6119]
2024-06-28 14:27:21 +02:00
79285f3127 Retain the latest version in readme
[MAILPOET-6119]
2024-06-28 14:27:21 +02:00
f9a91649ed Move changelog to a new file
[MAILPOET-6119]
2024-06-28 14:27:21 +02:00
401751c576 Remove config for exposing storybook's port
[MAILPOET-6110]
2024-06-28 12:56:38 +02:00
f60819a741 Handle TS errors after uninstalling Storybook
[MAILPOET-6110]
2024-06-28 12:56:38 +02:00
261b50fe38 Remove Storybook from configs
[MAILPOET-6110]
2024-06-28 12:56:38 +02:00
42d9ad5b4a Remove Storybook mentions from readme.md
[MAILPOET-6110]
2024-06-28 12:56:38 +02:00
0593244476 Remove main storybook files
[MAILPOET-6110]
2024-06-28 12:56:38 +02:00
445085d25d Pnpm dedupe
[MAILPOET-6110]
2024-06-28 12:56:38 +02:00
0fa4f62aeb Remove storybook commands
[MAILPOET-6110]
2024-06-28 12:56:38 +02:00
2291999baa Remove storybook npm packages
[MAILPOET-6110]
2024-06-28 12:56:38 +02:00
40990042bf Move <OrderStatus> under MailPoet integration
[MAILPOET-6135]
2024-06-28 11:04:53 +02:00
9b085b4863 Unify status badges in Automations - use <AutomationRunStatus>
[MAILPOET-6135]
2024-06-28 11:04:53 +02:00
458fd79fe1 Unify status badges in Automations - use <StatusBadge> for email stats
[MAILPOET-6135]
2024-06-28 11:04:53 +02:00
8bc1cfc959 Unify status badges in Automations - use <OrderStatus>
[MAILPOET-6135]
2024-06-28 11:04:53 +02:00
19443d33b8 Unify status badges in Automations - use <AutomationStatus>
[MAILPOET-6135]
2024-06-28 11:04:53 +02:00
0bddd56879 Unify status badges in Automations - create new status components
[MAILPOET-6135]
2024-06-28 11:04:53 +02:00
e6a816584b Unify status badges in Automations - clean up styles
[MAILPOET-6135]
2024-06-28 11:04:53 +02:00
b91e33bfb6 Update k6 and selector for automation test
[MAILPOET-6134]
2024-06-27 15:31:44 +03:00
07cd37a8ff Use WordPress image with PHP 8.1 instead of 8.2
[MAILPOET-6097]
2024-06-27 11:17:19 +01:00
8570a17228 Increase count of fetching pages with WordPress iamges
[MAILPOET-6097]
2024-06-27 11:17:19 +01:00
b8cd7b80d0 Allow using RC versions as beta
[MAILPOET-6096]
2024-06-27 10:42:11 +02:00
1660df325e Move checking beta versions before pulling docker images
[MAILPOET-6096]
2024-06-27 10:42:11 +02:00
9a0bd94b6f Add integration and acceptance tests using WooCommerce beta
[MAILPOET-6096]
2024-06-27 10:42:11 +02:00
55194bc9c8 Add integration tests using WordPress beta
[MAILPOET-6096]
2024-06-27 10:42:11 +02:00
f58959e760 Add acceptance tests using WordPress beta
The job runs only if the last version from WordPress feeds is beta
[MAILPOET-6096]
2024-06-27 10:42:11 +02:00
7d80cda7aa Fix pnpm lock file
MAILPOET-5121
2024-06-27 09:04:25 +02:00
8ccdcb56c2 Patch invalid JS imports in @woocommerce/components
This fixes an error with the following:
1. CurrencyFactory patch

```js
import { CurrencyFactory } from '@woocommerce/currency';
```
instead of
```js
import CurrencyFactory from '@woocommerce/currency';
```

2. Error with TextComponent from `@wordpress/components`

Fixed with pnpm patch

MAILPOET-5121
2024-06-27 09:04:25 +02:00
b721cdf414 Patch invalid css in @woocommerce/components
The current version throws an error:
This function isn't allowed in plain CSS
color: darken(#cacccd)

Fixed with pnpm patch

MAILPOET-5121
2024-06-27 09:04:25 +02:00
5c39b5de8f Update @woocommerce/components to version 12.3.0
MAILPOET-5121
2024-06-27 09:04:25 +02:00
08178ce2fd Remove the old @woocommerce/components pnpm patch
MAILPOET-5121
2024-06-27 09:04:25 +02:00
e9e837ea8a Fix stylelint warningns
[MAILPOET-5490]
2024-06-27 08:44:03 +02:00
bbc2374a44 Update stylelint to v 16
[MAILPOET-5490]
2024-06-27 08:44:03 +02:00
120f2e1cda Fix warnings after stylelint update
[MAILPOET-5490]
2024-06-27 08:44:03 +02:00
b12887c07c Update stylelint package
[MAILPOET-5490]
2024-06-27 08:44:03 +02:00
45335e8260 Remove already updated packages from ignore list in the update command
[MAILPOET-5490]
2024-06-27 08:44:03 +02:00
871c161cb3 Update react-string-replace package
[MAILPOET-5490]
2024-06-27 08:44:03 +02:00
075aa016e5 Fix TS error for a react-string-replace argument in mailer-error.tsx
[MAILPOET-5490]
2024-06-27 08:44:03 +02:00
3730033986 Update used Automate Woo plugin in Circle CI
- latest version: 6.0.27
 - previous version: 5.8.5
2024-06-26 18:09:50 +02:00
66ff27405e Update used WooCommerce plugin in Circle CI
- latest version: 9.0.2
 - previous version: 8.9.3
2024-06-26 18:09:50 +02:00
3c8b5ba6a2 Update used WordPress images in Circle CI
- latest version: 6.5.5-php8.3
 - previous version: 6.4.3-php8.2
2024-06-26 18:09:50 +02:00
4c163d2cd4 Fix fetching versions
We have an issue when previous version of the plugin was not on the first page. This commit adds while loop to avoid this issue.
[MAILPOET-6097]
2024-06-26 14:42:26 +02:00
808f4cf1f8 Remove outdated hacks. WP.Org now supports PHP 8.1
MAILPOET-3901
2024-06-26 12:35:50 +02:00
395a22c0ee Revert unintentional updates done to other packages
MAILPOET-3901
2024-06-26 12:35:50 +02:00
b81a9837c4 Update composer.json file. Remove php72 and added php81 polyfill
MAILPOET-3901
2024-06-26 12:35:50 +02:00
bf1b7a2219 Update CircleCI config for WP.org lint
WP.org now supports PHP 8.1
https://meta.trac.wordpress.org/ticket/3791#comment:44

MAILPOET-3901
2024-06-26 12:35:50 +02:00
ef5d11748d Fix Scoper (prefixer) adding MailPoetVendor namespace when it wasn't required
MAILPOET-3901
2024-06-26 12:35:50 +02:00
fe5c02aff0 Update symfony polyfill packages
MAILPOET-3901
2024-06-26 12:35:50 +02:00
09036b1e01 Remove symfony/polyfill-php72 as it’s no longer needed
MAILPOET-3901
2024-06-26 12:35:50 +02:00
e51c20221a Only clear action if deactivating an automation
[MAILPOET-5982]
2024-06-26 11:22:45 +02:00
4b14ae26cb Use a constant instead of string
[MAILPOET-5982]
2024-06-26 11:22:45 +02:00
1f8edf666a Deactivate automations runs when deactivating automation
[MAILPOET-5982]
2024-06-26 11:22:45 +02:00
a7012e44cc Trigger "tag added" automation when tag is added via form
[MAILPOET-6128]
2024-06-26 09:42:13 +02:00
f242d4bb5f Update acceptance test for new version of TinyMCE
TinyMCE now forces hex colors by default
See https://www.tiny.cloud/docs/tinymce/latest/migration-from-6x/#force-hex-color
[MAILPOET-5988]
2024-06-25 16:10:54 +02:00
2a8b6ad58d Update CSS to match the expected look of the TinyMCE toolbar
Border and radius were causing dual borders.
Buttons were, by default, white and didn't match the toolbar background.
[MAILPOET-5988]
2024-06-25 16:10:54 +02:00
e5373286fe Update TinyMCE package
[MAILPOET-5988]
2024-06-25 16:10:54 +02:00
873a8be8bc Add licence_key configure option
By providing this option value 'gpl' we declare our intention
to use TinyMCE under GPLv2+ license.
Our plugin uses the GPL so we are fine.
[MAILOPET-5988]
2024-06-25 16:10:54 +02:00
95754df815 Update tinyMce loader config to cover new cases of global tinymce
[MAILPOET-5988]
2024-06-25 16:10:54 +02:00
7914bbef3b Refactor for placement selection to the grid
[MAILPOET-6127]
2024-06-25 15:08:47 +02:00
9451f4545a Fix form placement appearance when scrollbars are active
[MAILPOET-6127]
2024-06-25 15:08:47 +02:00
12fcbb10c9 Fix subscribers count tooltip overlay with recalculate button
[MAILPOET-6121]
2024-06-25 11:59:12 +02:00
61dedcabda Release 4.53.0 2024-06-25 10:53:14 +01:00
68d007123e Fix Archive page shortcode tooltip not working due to missing "name" attribute
[MAILPOET-6122]
2024-06-25 11:24:44 +02:00
39849a61f1 Use default sizes for captcha image in case invalid value is passed
[MAILPOET-6112]
2024-06-24 15:19:43 +02:00
d2b5932ba7 Add global objects that react tooltip uses
[MAILPOET-5482]
2024-06-24 14:51:41 +02:00
cbb3acbad2 Update react tooltip package
[MAILPOET-5482]
2024-06-24 14:51:41 +02:00
bfcb5940cb Rename data-for to data-tooltip-id
[MAILPOET-5482]
2024-06-24 14:51:41 +02:00
91b2bada15 Ensure tooltip ID is always set
[MAILPOET-5482]
2024-06-24 14:51:41 +02:00
40dd9bb554 Use the new tooltip in the legacy code
[MAILPOET-5482]
2024-06-24 14:51:41 +02:00
ec2b077eb3 Move border values to CSS in tooltip
[MAILPOET-5482]
2024-06-24 14:51:41 +02:00
a8e7bff850 Move styling values to CSS in tooltip
[MAILPOET-5482]
2024-06-24 14:51:41 +02:00
64ba6cb520 Remove multiline from tooltip it's supported by default
[MAILPOET-5482]
2024-06-24 14:51:41 +02:00
d00d72ea14 Update react tooltip imports
[MAILPOET-5482]
2024-06-24 14:51:41 +02:00
9f8fdfb85f Add scheduling to the GitHub action updating used versions
[MAILPOET-6097]
2024-06-24 13:30:05 +02:00
394aa30315 Update composer version
MAILPOET-6118
2024-06-24 10:57:09 +02:00
eb95edb938 Update used WooCommerce Subscriptions plugin in Circle CI
- latest version: 6.4.0
 - previous version: 6.3.2
2024-06-24 10:10:51 +02:00
d6e903a766 Update used Automate Woo plugin in Circle CI
- latest version: 6.0.26
 - previous version: 5.8.5
2024-06-24 10:10:51 +02:00
74960ce918 Update used WooCommerce plugin in Circle CI
- latest version: 9.0.1
 - previous version: 8.9.3
2024-06-24 10:10:51 +02:00
436b00a03a Update used WordPress images in Circle CI
- latest version: 6.5.4-php8.3
 - previous version: 6.4.3-php8.1
2024-06-24 10:10:51 +02:00
5791dafc3e Fix commit messages generated by GH action
[MAILPOET-6097]
2024-06-21 19:26:56 +02:00
f4adfaf732 Fix getting version from temporary files in GH action
[MAILPOET-6097]
2024-06-21 19:08:09 +02:00
46ad169439 Remove defaultProps from listing.jsx
[MAILPOET-6008]
2024-06-21 16:36:06 +02:00
7ffe562d70 Remove defaultProps from form-settings/selection.jsx
[MAILPOET-6008]
2024-06-21 16:36:06 +02:00
f2d7dc0321 Remove defaultProps from form.jsx
[MAILPOET-6008]
2024-06-21 16:36:06 +02:00
a3514377c8 Move default props to default parameters - simple cases
React throws a deprecation warning for defaultProps.
This commit refactors default props to default values in easy-to-fix cases.

[MAILPOET-6108]
2024-06-21 16:36:06 +02:00
b19c30d203 Fix compilation errors after upgrading react
[MAILPOET-6008]
2024-06-21 16:36:06 +02:00
58865ef3f5 Update react, react-dom and react types
[MAILPOET-6008]
2024-06-21 16:36:06 +02:00
932406c288 Update title for created pull request via GH action
[MAILPOET-6097]
2024-06-21 15:59:53 +02:00
0d794b3b2f Add type declarations to function in GH Action update scripts
This commit also fixes some bugs with function redeclaration and missing parameters.
[MAILPOET-6097]
2024-06-21 15:59:53 +02:00
3989594a56 Add used plugin versions to the commit messages
[MAILPOET-6097]
2024-06-21 15:59:53 +02:00
18dc3daa78 Extract replacing versions for a private plugin to a function
[MAILPOET-6097]
2024-06-21 15:59:53 +02:00
3898b3dccb Update script getting WooCommerce versions and store them to file
[MAILPOET-6097]
2024-06-21 15:59:53 +02:00
0b157c3ac9 Use exact version instead of latest
To unify with other plugins I decided to use the exact version number.
[MAILPOET-6097]
2024-06-21 15:59:53 +02:00
318424f0c4 Add used WordPress versions to the commit message
[MAILPOET-6097]
2024-06-21 15:59:53 +02:00
8e3f7faa0e Rename file containing update workflow
[MAILPOET-6097]
2024-06-21 15:59:53 +02:00
8e1abcedbd Add step creating pull-request
[MAILPOET-6097]
2024-06-21 15:59:53 +02:00
62b0a55805 Change branch name for the pushed changes
[MAILPOET-6097]
2024-06-21 15:59:53 +02:00
2e460d9b0b Move env variable definition to the correct step
[MAILPOET-6097]
2024-06-21 15:59:53 +02:00
d68280a4a1 Add initialTab parameter to the links redirecting to the automation templates
[MAILPOET-5848]
2024-06-21 14:53:05 +02:00
8761fd8f3f Add support for selected initial tab on automation templates page
[MAILPOET-5848]
2024-06-21 14:53:05 +02:00
428b40ac65 Fix acceptance test with abandoned cart
We cannot use the common method for newsletter page verification, because the email editor does not contain subject input.
[MAILPOET-5848]
2024-06-21 14:53:05 +02:00
e285349e1f Update integration test for HomePage
[MAILPOET-5848]
2024-06-21 14:53:05 +02:00
fe25ce4857 Update condition for abandoned cart emails on homepage
[MAILPOET-5848]
2024-06-21 14:53:05 +02:00
b8d03f012b Update link for the abandoned cart setup on homepage
[MAILPOET-5847]
2024-06-21 14:53:05 +02:00
1d77461b5d Update ws package
Fix for https://github.com/mailpoet/mailpoet/security/dependabot/103
and https://github.com/mailpoet/mailpoet/security/dependabot/102
2024-06-20 15:26:52 +02:00
b3b686d8bf Ensure not loaded Mixpanel is not blocking UI
[MAILPOET-6116]
2024-06-20 14:06:20 +02:00
638fb7e56a Simplify and speed up notification history search test
[MAILPOET-6072]
2024-06-20 13:31:46 +02:00
d8fca6c46f Add integration test for searching post notifications by subject
[MAILPOET-6072]
2024-06-20 13:31:46 +02:00
9b082f7ffa Update Test helper method name for better clarification
MAILPOET-6072
2024-06-20 13:31:46 +02:00
1e049018d4 Test for both static and dynamic Newsletter subject
MAILPOET-6072
2024-06-20 13:31:46 +02:00
4c21a25774 Add tests for feature and switch to leftJoin instead of InnerJoin because we always want to return Newsletter records when available
MAILPOET-6072
2024-06-20 13:31:46 +02:00
5789a61075 Update ListingRepository::applySearch abstract function to reflect new updates
MAILPOET-6072
2024-06-20 13:31:46 +02:00
ae275d0824 Fix post-notification history subject search
We previously were looking for search term on the Newsletter table subject column. Unfortunately, post-notification and its history items sometimes contain both static text and dynamic text i.e., MailPoet shortcodes. This prevented the search from returning any useful results.

 The RenderedSubject on the Sending queues table includes both the static text and dynamic text, so we can look for the search term on it

MAILPOET-6072
2024-06-20 13:31:46 +02:00
aea6eb3dbb Unify how an automation email type is detected
This fixes an issue when an automation transactional email showed wrong header in email editor.

[MAILPOET-6114]
2024-06-19 17:44:29 +03:00
93f0eb9604 Add new black and white social icon variants to config
[MAILPOET-5805]
2024-06-19 13:52:31 +02:00
15513ad1dd Add new black social icons variant based on grey
[MAILPOET-5805]
2024-06-19 13:52:31 +02:00
8e9a74b132 Add new white social icons variant based on grey
[MAILPOET-5805]
2024-06-19 13:52:31 +02:00
25feb4cccc Remove Google+ icon links from config
[MAILPOET-5805]
2024-06-19 13:52:31 +02:00
c3968e7cad Don't show "authorize now" message when email field is empty
[MAILPOET-6111]
2024-06-19 11:14:45 +01:00
a55725838d Update list of dependencies skipped by the update script
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
03b50bd2f5 Add mock for @woocommerce/settings module
Previously this module was mocked as an empty module, but
after updating @woocommerce/currency we need to provide at
least getSetting function.

The function is called only once with the parameter 'currency'.

I tried installing the full @woocommerce/settings, but it requires
complex initialization (e.g. passing some data from PHP). I find it
better to provide this simple mock and throw an error if it is used more than expected.
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
836772b5bb Pnpm dedupe
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
b83a2188e0 Remove deprecated @babel/plugin-proposal-nullish-coalescing-operator
It was replaced by @babel/plugin-transform-nullish-coalescing-operator
and it is already part of  @babel/preset-env
https://babeljs.io/docs/babel-plugin-transform-nullish-coalescing-operator

[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
922dd93961 Remove deprecated @babel/plugin-proposal-class-properties
It was replaced by @babel/plugin-transform-class-properties
Which is already part of  @babel/preset-env
See https://babeljs.io/docs/babel-plugin-transform-class-properties
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
1d32461b3d Workaround for the issue with chai v5 and ES modules
I couldn't make it work with the Babel loader. There is a possible
solution using ts-node as a loader. I didn't want to install another
package, so I chose a different workaround.
mocha-env.mjs is processed as a module thanks to the suffix, and it
sets chai. expect globally, and then I updated tests to use the global expect.

Please see https://github.com/chaijs/chai/issues/1568
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
73434e1ef7 Workaround for legacy newsletter editor tests after updating chai
Chain newly has to be imported as module and doesn't support CommonJs
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
ca8f6c64d6 Copy buildLocalizeFn into the place of usage
After 3.0.0 the date-fn's package.json contains 'exports' propperty
which prevents us from including the buildLocalizeFn function via direct import form it's file.
Because everything that is not listed in 'exports' throws ModuleNotFound error.
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
bde68b868d Update @babel/preset-env from 7.16.11 to 7.24.7
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
fd8fd8560e Update url from 0.11.1 to 0.11.3
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
706bf3cf2a Update storybook-addon-performance from 0.17.1 to 0.17.3
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
89948771ad Update stylelint-scss from 5.1.0 to 6.3.1
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
e5a27dc466 Update sinon from 15.2.0 to 18.0.0
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
9e102c0eef Update react-datepicker from 4.16.0 to 6.9.0
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
24b0f1ba09 Update postcss-cli from 10.1.0 to 11.0.0
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
5eaa16c286 Update jsdom from 22.1.0 to 24.1.0
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
556c0d479b Update imports-loader from 4.0.1 to 5.0.0
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
9d349dad84 Update husky from 8.0.3 to 9.0.11
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
ccaaea40c4 Update expose-loader from 4.1.0 to 5.0.0
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
1417bd87d5 Update exports-loader from 4.0.0 to 5.0.0
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
be369a87ac Update date-fns from 2.30.0 to 3.6.0
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
39d34ac14a Update copy-webpack-plugin from 11.0.0 to 12.0.2
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
4bdfb91480 Update chai from 4.3.8 to 5.1.1
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
7aab32cdf3 Update @storybook/react from 7.3.2 to 8.1.8
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
4010c196ce Update @storybook/builder-webpack5 from 7.3.2 to 8.1.8
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
d974f55068 Update @storybook/addon-storysource from 7.3.2 to 8.1.8
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
896962c7d1 Update @storybook/addon-links from 7.3.2 to 8.1.8
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
ca0d1cf95a Update @storybook/addon-actions from 7.3.2 to 8.1.8
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
22d7722bce Update wp-types from 3.62.4 to 3.65.0
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
f2dd6bdf2c Update webpack from 5.88.2 to 5.92.0
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
2eed2a7eb0 Update ts-loader from 9.4.4 to 9.5.1
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
2b98b79414 Update sass from 1.66.1 to 1.77.5
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
846f2d042e Update react-select from 5.7.4 to 5.8.0
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
90407a1791 Update react-dom from 18.2.0 to 18.3.1
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
8e14bceb88 Update react from 18.2.0 to 18.3.1
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
f15b0bc3a2 Update moment from 2.29.4 to 2.30.1
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
5c25f2c0b8 Update mocha from 10.2.0 to 10.4.0
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
2326197214 Update eslint-plugin-check-file from 2.6.2 to 2.8.0
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
e22bf254be Update core-js from 3.32.1 to 3.37.1
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
213a426c02 Update classnames from 2.3.2 to 2.5.1
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
5bfef4e765 Update browserslist from 4.21.10 to 4.23.1
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
0c05b36976 Update @woocommerce/date from 4.2.0 to 4.3.0
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
82ff431304 Update @woocommerce/currency from 4.2.0 to 4.3.0
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
a69eb0245b Update @storybook/addons from 7.3.2 to 7.6.17
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
06e330dd41 Update @babel/runtime-corejs3 from 7.22.11 to 7.24.7
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
1d44bd7cc6 Update @babel/runtime from 7.22.11 to 7.24.7
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
13929a841c Update @babel/register from 7.22.5 to 7.24.6
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
03b9a5665c Update @babel/preset-typescript from 7.22.11 to 7.24.7
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
e37517ed52 Update @babel/preset-react from 7.22.5 to 7.24.7
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
3551604d13 Update @babel/plugin-transform-runtime from 7.22.10 to 7.24.7
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
87eefbf9b6 Update @babel/plugin-transform-modules-commonjs from 7.22.11 to 7.24.7
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
a0fe80c313 Update @babel/plugin-proposal-throw-expressions from 7.22.5 to 7.24.7
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
72fba9e62b Update @babel/plugin-proposal-function-sent from 7.22.5 to 7.24.7
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
156bc6a487 Update @babel/core from 7.22.11 to 7.24.7
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
48d93f491d Update terser-webpack-plugin from 5.3.9 to 5.3.10
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
d98cab77c9 Update stylelint-order from 6.0.3 to 6.0.4
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
90ea3c3e36 Update postcss-scss from 4.0.7 to 4.0.9
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
ba191eec1d Update postcss from 8.4.31 to 8.4.38
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
91dd02f54a Update jquery from 3.7.0 to 3.7.1
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
b04130b75b Update autoprefixer from 10.4.15 to 10.4.19
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
8c424c343a Update @emotion/styled from 11.11.0 to 11.11.5
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
85bc690c1e Update @emotion/react from 11.11.1 to 11.11.4
[MAILPOET-6008]
2024-06-19 12:12:59 +02:00
4c2ac47d6d Fix live preview when changing button font size in form editor
[MAILPOET-5655]
2024-06-19 11:44:27 +02:00
985946549e Use the correct WP image version for the oldest acceptance job
[MAILPOET-6097]
2024-06-19 09:17:18 +02:00
8a0413dcbe Add missing env variable for two update steps in GH action
[MAILPOET-6097]
2024-06-18 19:33:49 +02:00
379b30e179 Use a newer version of GH checkout actions
[MAILPOET-6097]
2024-06-18 19:33:49 +02:00
dac241a939 Improve update workflow by pushing once at the end
[MAILPOET-6097]
2024-06-18 18:26:01 +02:00
8919902221 Use token from a different secret
[MAILPOET-6097]
2024-06-18 18:26:01 +02:00
92fdefda91 Add checking that a related versions were found
[MAILPOET-6097]
2024-06-18 18:26:01 +02:00
c72c876fb3 Use already configured token
We have already set existing GH token in the repository settings, so we can reuse it as well.
[MAILPOET-6097]
2024-06-18 16:31:15 +02:00
c766c781c4 Update used latest WooCommerce Memberships plugin
We were using older Memberships plugin version which caused throwing deprecated errors.
[MAILPOET-6097]
2024-06-18 16:31:15 +02:00
aa78d184d4 Use all updating scripts
We need to use all scripts and also use different IDs.
Some scripts also need to use token stored in GH secrets.
[MAILPOET-6097]
2024-06-18 16:31:15 +02:00
cd23be1e45 Add script updating used WC Subscriptions
[MAILPOET-6097]
2024-06-18 16:31:15 +02:00
4ae48e185f Add script updating used Automate Woo
[MAILPOET-6097]
2024-06-18 16:31:15 +02:00
57ebc876ab Add script updating used WC Memberships
[MAILPOET-6097]
2024-06-18 16:31:15 +02:00
aed63c7cd3 Create file with helper functions
To avoid code repetition I created a file,
which contains function that can be reused.
[MAILPOET-6097]
2024-06-18 16:31:15 +02:00
dd4bd67ed2 Add new GitHub action updating used WooCommerce plugin
[MAILPOET-6097]
2024-06-18 16:31:15 +02:00
be31c51379 Add new GitHub action for using newer WP image
[MAILPOET-6097]
2024-06-18 16:31:15 +02:00
69ea1a84ac Use official WP docker images in acceptance and integration tests
[MAILPOET-6097]
2024-06-18 16:31:15 +02:00
d8fdde90fe Release 4.52.0 2024-06-18 13:37:56 +02:00
710f22c94b Fix condition to capture all Woo list opt-outs 2024-06-17 13:15:42 +02:00
c20c569b35 Make isWooCommerceSubscribed() private 2024-06-17 13:15:42 +02:00
622357b40b Fix test assertion 2024-06-17 13:15:42 +02:00
e536c68289 Verify segment 2024-06-17 13:15:42 +02:00
becf40b2cb Tweak tests 2024-06-17 13:15:42 +02:00
e3b1a87f34 Sync AutomateWoo Opt-In when Subscribe event happens. 2024-06-17 13:15:42 +02:00
eeb59da01e Show the error message instead of loading spinner when there is an API error
MAILPOET-6037
2024-06-17 13:14:40 +02:00
d2084eced0 Make diff text bold, fix wrapping
[MAILPOET-6037]
2024-06-17 13:14:40 +02:00
7ff763c2d6 Add domain status badge
[MAILPOET-6037]
2024-06-17 13:14:40 +02:00
94b7fa9d9f Add domain error banner
[MAILPOET-6037]
2024-06-17 13:14:40 +02:00
e5d6e480a2 Style error message and diffs
[MAILPOET-6037]
2024-06-17 13:14:40 +02:00
cb35777716 Use @wordpress/components button and tooltip instead of custom ones
[MAILPOET-6037]
2024-06-17 13:14:40 +02:00
375c2515c1 Use @wordpress/components button and spinner instead of custom ones
[MAILPOET-6037]
2024-06-17 13:14:40 +02:00
0ce6826ab6 Use @wordpress/components modal instead of a custom one
[MAILPOET-6037]
2024-06-17 13:14:40 +02:00
c0a819f3bd Add steps to manage sender domain view, update texts and visuals
[MAILPOET-6037]
2024-06-17 13:14:40 +02:00
f7172e9186 Remove status column
[MAILPOET-6037]
2024-06-17 13:14:40 +02:00
0c22654c90 Display detailed DNS issues in domain authentication
[MAILPOET-6037]
2024-06-17 13:14:40 +02:00
e1b681043b Fix calculating time zone difference and add comments with explanations
[MAILPOET-5495]
2024-06-17 12:51:16 +02:00
64417c7bc8 Expose server_timezone_in_minutes on all MailPoet pages, not just Emails
[MAILPOET-5495]
2024-06-17 12:51:16 +02:00
f34e70f601 Adjust newsletter sending time with timezone difference between server and client on emails listing page
[MAILPOET-5495]
2024-06-17 12:51:16 +02:00
6e1462d4f4 Create function to adjust for timezone difference between server and the client
[MAILPOET-5495]
2024-06-17 12:51:16 +02:00
da190c5d06 Calculate server timezone offset in minutes
[MAILPOET-5495]
2024-06-17 12:51:16 +02:00
abbc4417ed Revert removing doctrine fix for plugin repository
[MAILPOET-6101]
2024-06-17 12:38:08 +02:00
e998e1f28f Add a comment why we need to remove the colon character
[MAILPOET-6101]
2024-06-17 12:38:08 +02:00
fb7ccbd8b9 Add missing handling database server timeout
Because we updated form Doctrine DBAL 2 to DBAL 3 we need to use a different handling for database server timeouts.
[MAILPOET-6101]
2024-06-17 12:38:08 +02:00
674b9cbcb2 Update composer package doctrine/orm
The used version is limited by the doctrine/lexer used by symfony/validator
[MAILPOET-6101]
2024-06-17 12:38:08 +02:00
26a98f1000 Update composer package doctrine/dbal
We cannot update to the latest version of the dbal 3 because there is a another package conflict.
[MAILPOET-6101]
2024-06-17 12:38:08 +02:00
487f1490b0 Update composer package doctrine/orm
The used version is limited by the package dependencies which can cause incompatibility on WP.org SVN.
[MAILPOET-6101]
2024-06-17 12:38:08 +02:00
90a4f8e591 Update composer package doctrine/common
[MAILPOET-6101]
2024-06-17 12:38:08 +02:00
d992ffc0e4 Update composer package doctrine/annotations
[MAILPOET-6101]
2024-06-17 12:38:08 +02:00
635e382cea Update composer packages symfony/validator and symfony/dependency-injection
Integration tests were failing because services were not public, and DI Container was getting them in tests.
[MAILPOET-6101]
2024-06-17 12:38:08 +02:00
9a40f08e66 Update composer package pelago/emogrifier
[MAILPOET-6101]
2024-06-17 12:38:08 +02:00
211ee1a7ec Update composer package twig/twig
[MAILPOET-6101]
2024-06-17 12:38:08 +02:00
3dbb646c20 Update composer package sabberworm/php-css-parser
[MAILPOET-6101]
2024-06-17 12:38:08 +02:00
75a604c79a Update composer package nesbot/carbon
[MAILPOET-6101]
2024-06-17 12:38:08 +02:00
ecb32a35c4 Update composer package monolog/monolog
[MAILPOET-6101]
2024-06-17 12:38:08 +02:00
ea909f8961 Update composer package gregwar/captcha
[MAILPOET-6101]
2024-06-17 12:38:08 +02:00
918758490d Update cerdic/css-tidy composer package
[MAILPOET-6101]
2024-06-17 12:38:08 +02:00
6d218bd1ea Increase required PHP version in prefixer folder
[MAILPOET-6101]
2024-06-17 12:38:08 +02:00
822a0d97f8 Configure spacing units in form editor properly
Without this configuration, the block editor uses a fallback value
which is always a new array and causes a shallow check to mark it as a new value
and was causing
"The 'useSelect' hook returns different values when called with the same state and parameters"
warning and rerenders of the blocks panel.
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
32bdb8cec8 Pass ref to the inserter library
The ref is needed to prevent an error triggered when inserting a block
from the inserter sidebar.
The error was not causing a visible issues but was logged in console and causing acceptance
test to fail.
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
c34bf297c6 Fix email editor snackbar notices
The notices property on the interface skeleton doesn't work anymore.
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
2a3ea5e4f4 Hide form editor preview button on mobile
Form preview doesn't work properly on mobile and the button takes
There is too much space in the header.
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
a7f66dcde6 Add ListView sidebar
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
4f84443a47 Fix drag and drop for options for custom select and radio options
This regression was introduced long ago when we switched to react 18.
More details here
https://medium.com/@wbern/getting-react-18s-strict-mode-to-work-with-react-beautiful-dnd-47bc909348e4
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
e8e5370c7e Replace deprecated useSetting hook usage
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
ef4eff86af Fix font size settings in the email editor
The size picker reads from a different settings property
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
6d509b7bc6 Fix saving fresh RichText value in the form editor
This commit addresses two issues:
1) Newly added paragraph and heading blocks have instance RichTextData
instead of a plain string as a content attribute. To address that I added .toString().
2) I experienced that blocks passed via onChange or onInput callbacks might not contain
the latest RichTextData for headings and paragraphs (for example last couple of letters was missing).
This was causing an issue when the user saved immediately after finishing editing (was caught by a test).
I fixed that by using the blocks directly from the block editor store for saving.
At the same time, I removed the onInput callback. The reasoning here is that currently, we use the blocks in our store
as a backup state, which is used to restore accidentally deleted required blocks.
So triggering the reducer and validation for both callbacks was a bit overkill.

[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
b69e508870 Group selects and useMemo for config in main form editor component
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
679039692e Enforce the big appender all the time and fix unselecting blocks
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
2a8362f4c2 Use Tabs component in coupon block settings
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
d1a4d80459 Fix the size and scrolling of the inserter sidebar in the form editor
[[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
99d726e378 Pnpm dedupe
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
f22976bf32 Update @wordpress/scripts and downgrade dependency-extraction plugin
We can't update to latest @wordpress/dependency-extraction-webpack-plugin
and latest @wordpress/scripts (at the time of committing 28.0.0) because
a BC issue is causing it doesn't work for WP lower than 6.6.

See https://github.com/WordPress/gutenberg/issues/62202#issuecomment-2149165189

[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
c2d782506b Update wordpress/scripts
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
dedd9d52c2 Group multiple useSelect to one in the dynamic segment from
This is just a tiny optimization I did when debugging the acceptance test, and I decided to keep it.
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
bd1cf97085 Hide tabs in inserter panel in form editor
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
ac1cd97819 Remove the commented validate-multiple-use hook from form editor
The code was commented because it was breaking the build after dependencies update.
The functionality is now directly included in the block editor
so we can safely remove the code.
See https://github.com/WordPress/gutenberg/pull/62086
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
9736265341 Fix js lint errors
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
ba3a29881c Limit TS check maximal memory usage
We were hitting the 2GB limit on CircleCI small instance
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
aa80fd8d1c Update acceptance tests
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
9424c720fc Fix form editor sidebar space for support beacon
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
90a8ee4503 Refactor form editor sidebar header to use Tabs instead of custom HTML
Gutenberg switched to tabs and removed CSS used for <ul>.
In this commit, we switched to the Tabs component.
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
a202db3532 Update className for email editor sidebar header
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
0d62d28d82 Refactor automation editor sidebar tabs to use Tabs component
Gutenberg switched to tabs and removed CSS used for <ul>.
In this commit, we switched to the Tabs component.
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
6e5d2654fb Use proper icon in more menu in automation and email editors
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
d083efacd9 Fix header appearance in the automation editor
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
6fa6f723f9 Fix header appearance in the form editor
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
65b72a2b88 Fix dropdown popover props in automation step's more menu
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
3a84ba3352 Remove ts-expect-error where no longer necessary
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
27045081b0 Fix TS errors related to __experimentalConfirmDialog
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
338a81e9c7 Comment out a hook that no longer exists
The file was removed. In this commit, I commented it out to make the build
pass.
This will need further investigation.
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
e5f5814974 Replace MoreMenuDropDown with basic DropdownMenu
The MoreMenuDropDown was removed from @wordpress/interface.
This commit replaces it with a generic DropdownMenu to make the build passing.
It will need further adjustments.
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
859520e235 Update all wordpress packages to their latest versions
[MAILPOET-6054]
2024-06-17 12:06:53 +02:00
6e81d3e149 Update readme.txt tags
[MAILPOET-6107]
2024-06-13 14:26:51 -05:00
f5ae03a5a6 Update import/export tests to account for WP and WC lists
[MAILPOET-3977]
2024-06-12 12:13:37 +02:00
057f25c119 Don't allow importing to WordPress Users list
[MAILPOET-3977]
2024-06-12 12:13:37 +02:00
552803bcf9 Add test for screen reader text rendering
[MAILPOET-6098]
2024-06-12 11:59:12 +02:00
3e6aeb7362 Hide screen reader text in emails, while still accessible by screen readers
[MAILPOET-6098]
2024-06-12 11:59:12 +02:00
5f598adee2 Extract ping notices common code to useServiceCheck hook
[MAILPOET-6030]
2024-06-12 11:16:51 +02:00
66d96e11be Add bridge ping error notice
[MAILPOET-6030]
2024-06-12 11:16:51 +02:00
a6caf0a1e6 Add bridge ping endpoint
[MAILPOET-6030]
2024-06-12 11:16:51 +02:00
7aa006d9f7 Release 4.51.2 2024-06-12 10:36:54 +02:00
80e01be083 Remove unit test with premium oldest
[MAILPOET-6095]
2024-06-12 10:05:48 +02:00
50ba99e99b Update used versions of 3rd party plugins in CI job
[MAILPOET-6095]
2024-06-12 10:05:48 +02:00
3dc40cf644 Change the time of running nightly builds
When the nightly build ran on Monday at 10 PM, we found the output from the nightly run was too late.
[MAILPOET-6095]
2024-06-12 10:05:48 +02:00
28c7d33f8f Differentiate between changing URL and iconType in social block
We prefixed iconType with URL protocol, which caused the changing iconType to stop working. I added a new function that helps make the difference between iconType and URLs.
[MAILPOET-6106]
2024-06-11 15:19:45 +02:00
e670d84b97 Bump composer/composer from 2.7.6 to 2.7.7 in /mailpoet
Bumps [composer/composer](https://github.com/composer/composer) from 2.7.6 to 2.7.7.
- [Release notes](https://github.com/composer/composer/releases)
- [Changelog](https://github.com/composer/composer/blob/main/CHANGELOG.md)
- [Commits](https://github.com/composer/composer/compare/2.7.6...2.7.7)

---
updated-dependencies:
- dependency-name: composer/composer
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-11 13:40:42 +02:00
3b190a3a21 Fix acceptance tests
MAILPOET-6028
2024-06-10 17:26:48 +02:00
f7d28c8999 Ensure page reload is only done for the settings page
MAILPOET-6028
2024-06-10 17:26:48 +02:00
62c9679804 Ensure the Authorize from address modal is shown on reload
MAILPOET-6028
2024-06-10 17:26:48 +02:00
25067a5e87 Ensure we fetch the user authorized_emails and domains when MSS is activated
MAILPOET-6028
2024-06-10 17:26:48 +02:00
e2cd1b315a Reload settings page after key activation
MAILPOET-6028
2024-06-10 17:26:48 +02:00
fb0f9d086f Update SendingMethodConfirmationModal, add links and fix minor errors
MAILPOET-6028
2024-06-10 17:26:48 +02:00
6efbd858a2 Fix inconsistent messaging around MailPoet API key state and validity
MAILPOET-6028
2024-06-10 17:26:48 +02:00
31d7309345 Add Sending Method Confirmation Modal
MAILPOET-6028
2024-06-10 17:26:48 +02:00
8caf7491d8 Change global-notices.jsx to tsx
[MAILPOET-6029]
2024-06-10 17:07:31 +02:00
00d83d657a Cache successful cron ping result
[MAILPOET-6029]
2024-06-10 17:07:31 +02:00
827888fed3 Show cron ping eror notice globally
[MAILPOET-6029]
2024-06-10 17:07:31 +02:00
28d09b8b5e Add cron ping error notice
[MAILPOET-6029]
2024-06-10 17:07:31 +02:00
c3a55ac1d8 Move some strings to layout view to make them shared
[MAILPOET-6029]
2024-06-10 17:07:31 +02:00
c59ae2d82c Add cron pinging endpoint
[MAILPOET-6029]
2024-06-10 17:07:31 +02:00
07ef513bce Expose cron trigger method setting to JS
[MAILPOET-6029]
2024-06-10 17:07:31 +02:00
514d028b5a Resize twitter icon
[MAILPOET-5582]
2024-06-10 14:38:45 +02:00
cc970e1dce Update Twitter icon
[MAILPOET-5582]
2024-06-10 14:38:45 +02:00
405b18e859 Update the default urls for social websites
[MAILPOET-5582]
2024-06-10 14:38:45 +02:00
d22936ede9 Rename Youtube
[MAILPOET-5582]
2024-06-10 14:38:45 +02:00
081c6f6301 Rename Twitter
[MAILPOET-5582]
2024-06-10 14:38:45 +02:00
2af4f4bfc6 Remove google plus
[MAILPOET-5582]
2024-06-10 14:38:45 +02:00
537afbdd89 Remove line icons
[MAILPOET-5582]
2024-06-10 14:38:45 +02:00
9c86227290 Update ERROR_MESSAGE_BULK_EMAIL_FORBIDDEN
[MAILPOET-6024]
2024-06-10 11:12:22 +02:00
4e218708b9 Show notice when WP-cron is disabled
[MAILPOET-6027]
2024-06-10 10:18:05 +02:00
070fd30b6e Update the notice message to fix consistency
MAILPOET-6022
2024-06-07 17:17:57 +02:00
f877918c19 Fix infinite error messages notice.
This is because we call `getItems()` in a few places already and this `notices.apiError` causes a render which causes `getItems()` to re-render, and so on.

MAILPOET-6022
2024-06-07 17:17:57 +02:00
0bbad6e24f Use MailPoet error notices in Dynamic Segments
MAILPOET-6022
2024-06-07 17:17:57 +02:00
c2a61ebd86 Fix lint error
MAILPOET-6022
2024-06-07 17:17:57 +02:00
b84585c4af Add support for MailPoet API Error notice in Frontend JS files.
This will ensure the error message is well displayed including any additional html content

MAILPOET-6022
2024-06-07 17:17:57 +02:00
67d6ff56f3 Use MailPoet API Error notice when possible.
This will ensure the error message is well displayed including any additional html content

MAILPOET-6022
2024-06-07 17:17:57 +02:00
4f63437ccc Add html to the error message
MAILPOET-6022
2024-06-07 17:17:57 +02:00
d7bad4d292 Fix failing test
MAILPOET-6022
2024-06-07 17:17:57 +02:00
95e595de42 Invalid API endpoint exception improvement
MAILPOET-6022
2024-06-07 17:17:57 +02:00
a7df6b496f Add logging for unexpected states when we reach the end of sending
[MAILPOET-5881]
2024-06-07 11:32:46 +02:00
9dd808a070 Set as invalid only for non-campaign email types
For non-campaign emails, we use scheduled tasks to display processed stats.
The invalid tasks are no longer processed, and they don't block the queue
and are not counted in the stats.
For campaign emails (bulk emails), we just mark them as sent to zero recipients.
[MAILPOET-5881]
2024-06-07 11:32:46 +02:00
e4cff6c14f Remove an unnecessary condition in the batch processing loop
The batch will be continued anyway because of the next condition
if (!$queue->getCountToProcess()) {
  continue;
}
The newsletter entity will be marked as sent (plus other stuff related to finished sending)
after the loop in $this->endSending.
2024-06-07 11:32:46 +02:00
55ae6264cc Add method for processing end of sending for completed tasks
[MAILPOET-5881]
2024-06-07 11:32:46 +02:00
1111bac58b Unify behavior for sending paused during processing
In all other cases when we pause sending, we immediately end
the processSending method. In this case, we would unnecessarily
start processing one more batch.
[MAILPOET-5881]
2024-06-07 11:32:46 +02:00
3cb92fb823 Display MSS notices on all MailPoet pages
[MAILPOET-6026]
2024-06-07 10:34:50 +02:00
5846b0add8 Reword sending paused message for Creator plans
[MAILPOET-6026]
2024-06-07 10:34:50 +02:00
79a05af23c Fix WooCommerce sync with empty email
[MAILPOET-5885]
2024-06-06 11:23:44 +02:00
eb6cd87133 Add a limit to timeout in throttling function
to prevent integer overflows

[MAILPOET-6103]
2024-06-06 09:17:52 +03:00
0515b0e5d0 Remove unused code 2024-06-05 10:13:07 +01:00
29589239d5 Add missing backward slash 2024-06-05 10:13:07 +01:00
db370dc962 Release 4.51.1 2024-06-04 09:38:40 -05:00
937 changed files with 21974 additions and 28465 deletions

View File

@ -0,0 +1,19 @@
#!/bin/bash
# Fetch the versions of WooCommerce from the WordPress API
VERSIONS=$(curl -s https://api.wordpress.org/plugins/info/1.0/woocommerce.json | jq -r '.versions | keys_unsorted | .[]' | grep -v 'trunk')
LATEST_VERSION=""
# Find the latest version
for version in $VERSIONS; do
LATEST_VERSION=$version
done
# Check if the latest version is a beta/RC version
if [[ $LATEST_VERSION != *'beta'* && $LATEST_VERSION != *'rc'* ]]; then
echo "No WooCommerce beta/RC version found."
echo "LATEST_BETA="
else
echo "Latest WooCommerce beta/RC version: $LATEST_VERSION"
echo "LATEST_BETA=$LATEST_VERSION"
fi

View File

@ -0,0 +1,28 @@
#!/bin/bash
# Fetch the WordPress releases RSS feed
RSS_FEED=$(curl -s https://wordpress.org/news/category/releases/feed/)
# Extract the latest version from the feed and convert it to lowercase
LAST_VERSION=$(echo "$RSS_FEED" | grep -o '<title>WordPress [^<]*</title>' | sed -E 's/<\/?title>//g' | head -n 1 | tr [:upper:] [:lower:])
# Check if a beta or RC version is found
if [[ $LAST_VERSION == *'beta'* ]]; then
# Extract titles containing beta versions from the feed
VERSION_LINE=$(echo "$RSS_FEED" | grep -o '<code>wp core update [^<]*</code>' | sed -E 's/<\/?code>//g' | head -n 1 | grep 'beta')
LATEST_BETA=$(echo "$VERSION_LINE" | sed -E 's/.*--version=([0-9\.]+-beta[0-9]+).*/\1/')
echo "Latest WordPress beta version: $LATEST_BETA"
echo "LATEST_BETA=$LATEST_BETA"
elif [[ $LAST_VERSION == *'release candidate'* ]]; then
# Extract titles containing RC versions from the feed
VERSION_LINE=$(echo "$RSS_FEED" | grep -o '<code>wp core update [^<]*</code>' | sed -E 's/<\/?code>//g' | head -n 1 | grep 'RC')
LATEST_BETA=$(echo "$VERSION_LINE" | sed -E 's/.*--version=([0-9\.]+-RC[0-9]+).*/\1/')
echo "Latest WordPress RC version: $LATEST_BETA"
echo "LATEST_BETA=$LATEST_BETA"
else
echo "No WordPress beta/RC version found."
echo "LATEST_BETA="
fi

View File

@ -2,6 +2,7 @@ version: 2.1
orbs:
slack: circleci/slack@4.2.0
jq: circleci/jq@3.0.0
slack-fail-post-step: &slack-fail-post-step
post-steps:
@ -98,7 +99,7 @@ executors:
wpcli_php_max_wporg:
<<: *default_job_config
docker:
- image: mailpoet/wordpress:7.4_20210122.1
- image: mailpoet/wordpress:8.1_20230307.1
wpcli_php_latest:
<<: *default_job_config
@ -154,7 +155,7 @@ jobs:
./tools/vendor/composer.phar validate --no-check-all --no-check-publish --working-dir=prefixer
touch .env
./do install
./do compile:all --env production
./do compile:all --env production --skip-tests
./do doctrine:generate-cache
vendor/bin/codecept build
./do twig:generate-cache
@ -190,10 +191,10 @@ jobs:
- run:
name: Download additional WP Plugins for tests
command: |
./do download:woo-commerce-zip latest
./do download:woo-commerce-subscriptions-zip 5.7.0
./do download:woo-commerce-memberships-zip 1.25.2
./do download:automate-woo-zip 6.0.10
./do download:woo-commerce-zip 9.2.2
./do download:woo-commerce-subscriptions-zip 6.6.0
./do download:woo-commerce-memberships-zip 1.26.5
./do download:automate-woo-zip 6.0.32
- run:
name: Dump tests ENV variables for acceptance tests
command: |
@ -329,6 +330,7 @@ jobs:
name: 'JS Newsletter Editor Tests'
command: |
mkdir test-results/mocha
./do compile:js --env production --only-tests
./do t:newsletter-editor test-results/mocha/newsletter_editor_junit.xml
- run:
name: 'JS Tests'
@ -388,48 +390,89 @@ jobs:
disable_hpos:
type: integer
default: 0
use_wordpress_beta:
type: boolean
default: false
use_woocommerce_beta:
type: boolean
default: false
wordpress_version:
type: string
default: ''
environment:
MYSQL_COMMAND: << parameters.mysql_command >>
MYSQL_IMAGE: << parameters.mysql_image >>
CODECEPTION_IMAGE_VERSION: << parameters.codeception_image_version >>
WORDPRESS_IMAGE_VERSION: << parameters.wordpress_image_version >>
WORDPRESS_VERSION: << parameters.wordpress_version >>
steps:
- attach_workspace:
at: /home/circleci
- run:
name: 'Set up virtual host'
command: echo 127.0.0.1 mailpoet.loc | sudo tee -a /etc/hosts
- run:
name: Check for Latest WordPress Beta Version
command: |
if [ "<< parameters.use_wordpress_beta >>" == "true" ]; then
LATEST_WP_BETA=$(../.circleci/check_wordpress_beta.sh | grep 'LATEST_BETA' | cut -d'=' -f2)
if [ -z "$LATEST_WP_BETA" ]; then
echo "No latest beta version found. Ending job early."
circleci-agent step halt
else
echo "export WORDPRESS_VERSION=$LATEST_WP_BETA" >> $BASH_ENV
echo "Using WordPress Beta Version: $LATEST_WP_BETA"
fi
else
echo "Not using WordPress Beta Version"
fi
- run:
name: Check for Latest WooCommerce Beta Version
command: |
if [ "<< parameters.use_woocommerce_beta >>" == "true" ]; then
LATEST_WC_BETA=$(../.circleci/check_woocommerce_beta.sh | grep 'LATEST_BETA' | cut -d'=' -f2)
if [ -z "$LATEST_WC_BETA" ]; then
echo "No WooCommerce Beta version found. Ending job early."
circleci-agent step halt
else
echo "export WOOCOMMERCE_VERSION=$LATEST_WC_BETA" >> $BASH_ENV
echo "Using WooCommerce Beta Version: $LATEST_WC_BETA"
fi
else
echo "export WOOCOMMERCE_VERSION=<< parameters.woo_core_version >>" >> $BASH_ENV
echo "Not using WooCommerce Beta Version"
fi
- run:
name: 'Pull test docker images'
# Pull docker images with 3 retries
command: i='0';while ! docker-compose -f tests/docker/docker-compose.yml pull && ((i < 3)); do sleep 3 && i=$[$i+1]; done
command: i='0';while ! docker-compose -f ../tests_env/docker/docker-compose.yml pull && ((i < 3)); do sleep 3 && i=$[$i+1]; done
- run:
name: Create docker containers for test
# We experienced some failures when creating containers so we do it explicitly with one retry
command: |
cd tests/docker
cd ../tests_env/docker
docker-compose create || docker-compose create
- run:
# Some tools we use may need different version based on PHP version used in docker
name: Ensure correct versions of tools
command: |
cd tests/docker
cd ../tests_env/docker
docker-compose run --rm -w /project -e COMPOSER_DEV_MODE=1 --entrypoint "php tools/install.php" codeception_acceptance
- when:
condition: << parameters.woo_core_version >>
condition: ${WOOCOMMERCE_VERSION}
steps:
- run:
name: Download WooCommerce Core
command: |
cd tests/docker
docker-compose run --rm -w /project --entrypoint "./do download:woo-commerce-zip << parameters.woo_core_version >>" --no-deps -e WP_GITHUB_USERNAME=${WP_GITHUB_USERNAME} -e WP_GITHUB_TOKEN=${WP_GITHUB_TOKEN} codeception_acceptance
cd ../tests_env/docker
docker-compose run --rm -w /project --entrypoint "./do download:woo-commerce-zip ${WOOCOMMERCE_VERSION}" --no-deps -e WP_GITHUB_USERNAME=${WP_GITHUB_USERNAME} -e WP_GITHUB_TOKEN=${WP_GITHUB_TOKEN} codeception_acceptance
- when:
condition: << parameters.woo_subscriptions_version >>
steps:
- run:
name: Download WooCommerce Subscriptions
command: |
cd tests/docker
cd ../tests_env/docker
docker-compose run --rm -w /project --entrypoint "./do download:woo-commerce-subscriptions-zip << parameters.woo_subscriptions_version >>" --no-deps -e WP_GITHUB_USERNAME=${WP_GITHUB_USERNAME} -e WP_GITHUB_TOKEN=${WP_GITHUB_TOKEN} codeception_acceptance
- when:
condition: << parameters.woo_memberships_version >>
@ -437,7 +480,7 @@ jobs:
- run:
name: Download WooCommerce Memberships
command: |
cd tests/docker
cd ../tests_env/docker
docker-compose run --rm -w /project --entrypoint "./do download:woo-commerce-memberships-zip << parameters.woo_memberships_version >>" --no-deps -e WP_GITHUB_USERNAME=${WP_GITHUB_USERNAME} -e WP_GITHUB_TOKEN=${WP_GITHUB_TOKEN} codeception_acceptance
- when:
condition: << parameters.automate_woo_version >>
@ -445,7 +488,7 @@ jobs:
- run:
name: Download AutomateWoo
command: |
cd tests/docker
cd ../tests_env/docker
docker-compose run --rm -w /project --entrypoint "./do download:automate-woo-zip << parameters.automate_woo_version >>" --no-deps -e WP_GITHUB_USERNAME=${WP_GITHUB_USERNAME} -e WP_GITHUB_TOKEN=${WP_GITHUB_TOKEN} codeception_acceptance
- run:
name: Group acceptance tests
@ -466,7 +509,7 @@ jobs:
name: Run acceptance tests
command: |
mkdir -m 777 -p tests/_output/exceptions
cd tests/docker
cd ../tests_env/docker
args=(
--steps
--debug
@ -483,6 +526,7 @@ jobs:
-e ENABLE_HPOS=<< parameters.enable_hpos >> \
-e ENABLE_HPOS_SYNC=<< parameters.enable_hpos_sync >> \
-e DISABLE_HPOS=<< parameters.disable_hpos >> \
-e WORDPRESS_VERSION=${WORDPRESS_VERSION} \
codeception_acceptance "${args[@]}"
- run:
name: Check exceptions
@ -603,10 +647,15 @@ jobs:
CODECEPTION_IMAGE_VERSION: << parameters.codeception_image_version >>
MYSQL_COMMAND: << parameters.mysql_command >>
MYSQL_IMAGE: << parameters.mysql_image >>
WORDPRESS_IMAGE_VERSION: << parameters.wordpress_image_version >>
WORDPRESS_VERSION: << parameters.wordpress_version >>
parameters:
codeception_image_version:
type: string
default: ''
wordpress_image_version:
type: string
default: ''
group:
type: string
default: ''
@ -646,40 +695,80 @@ jobs:
automate_woo_version:
type: string
default: ''
use_wordpress_beta:
type: boolean
default: false
use_woocommerce_beta:
type: boolean
default: false
wordpress_version:
type: string
default: ''
steps:
- attach_workspace:
at: /home/circleci
- run:
name: Check for Latest WordPress Beta Version
command: |
if [ "<< parameters.use_wordpress_beta >>" == "true" ]; then
LATEST_WP_BETA=$(../.circleci/check_wordpress_beta.sh | grep 'LATEST_BETA' | cut -d'=' -f2)
if [ -z "$LATEST_WP_BETA" ]; then
echo "No latest beta version found. Ending job early."
circleci-agent step halt
else
echo "export WORDPRESS_VERSION=$LATEST_WP_BETA" >> $BASH_ENV
echo "Using WordPress Beta Version: $LATEST_WP_BETA"
fi
else
echo "Not using WordPress Beta Version"
fi
- run:
name: Check for Latest WooCommerce Beta Version
command: |
if [ "<< parameters.use_woocommerce_beta >>" == "true" ]; then
LATEST_WC_BETA=$(../.circleci/check_woocommerce_beta.sh | grep 'LATEST_BETA' | cut -d'=' -f2)
if [ -z "$LATEST_WC_BETA" ]; then
echo "No WooCommerce Beta version found. Ending job early."
circleci-agent step halt
else
echo "export WOOCOMMERCE_VERSION=$LATEST_WC_BETA" >> $BASH_ENV
echo "Using WooCommerce Beta Version: $LATEST_WC_BETA"
fi
else
echo "export WOOCOMMERCE_VERSION=<< parameters.woo_core_version >>" >> $BASH_ENV
echo "Not using WooCommerce Beta Version"
fi
- run:
name: 'Pull test docker images'
# Pull docker images with 3 retries
command: i='0';while ! docker-compose -f tests/docker/docker-compose.yml pull && ((i < 3)); do sleep 3 && i=$[$i+1]; done
command: i='0';while ! docker-compose -f ../tests_env/docker/docker-compose.yml pull && ((i < 3)); do sleep 3 && i=$[$i+1]; done
- run:
name: Create docker containers for test
# We experienced some failures when creating containers so we do it explicitly with one retry
command: |
cd tests/docker
cd ../tests_env/docker
docker-compose create || docker-compose create
- run:
# Some tools we use may need different version based on PHP version used in docker
name: Ensure correct versions of tools
command: |
cd tests/docker
cd ../tests_env/docker
docker-compose run --rm -w /project -e COMPOSER_DEV_MODE=1 --entrypoint "php tools/install.php" codeception_integration
- when:
condition: << parameters.woo_core_version >>
condition: ${WOOCOMMERCE_VERSION}
steps:
- run:
name: Download WooCommerce Core
command: |
cd tests/docker
docker-compose run --rm -w /project --entrypoint "./do download:woo-commerce-zip << parameters.woo_core_version >>" --no-deps -e WP_GITHUB_USERNAME=${WP_GITHUB_USERNAME} -e WP_GITHUB_TOKEN=${WP_GITHUB_TOKEN} codeception_integration
cd ../tests_env/docker
docker-compose run --rm -w /project --entrypoint "./do download:woo-commerce-zip ${WOOCOMMERCE_VERSION}" --no-deps -e WP_GITHUB_USERNAME=${WP_GITHUB_USERNAME} -e WP_GITHUB_TOKEN=${WP_GITHUB_TOKEN} codeception_integration
- when:
condition: << parameters.woo_subscriptions_version >>
steps:
- run:
name: Download WooCommerce Subscriptions
command: |
cd tests/docker
cd ../tests_env/docker
docker-compose run --rm -w /project --entrypoint "./do download:woo-commerce-subscriptions-zip << parameters.woo_subscriptions_version >>" --no-deps -e WP_GITHUB_USERNAME=${WP_GITHUB_USERNAME} -e WP_GITHUB_TOKEN=${WP_GITHUB_TOKEN} codeception_integration
- when:
condition: << parameters.woo_memberships_version >>
@ -687,7 +776,7 @@ jobs:
- run:
name: Download WooCommerce Memberships
command: |
cd tests/docker
cd ../tests_env/docker
docker-compose run --rm -w /project --entrypoint "./do download:woo-commerce-memberships-zip << parameters.woo_memberships_version >>" --no-deps -e WP_GITHUB_USERNAME=${WP_GITHUB_USERNAME} -e WP_GITHUB_TOKEN=${WP_GITHUB_TOKEN} codeception_integration
- when:
condition: << parameters.automate_woo_version >>
@ -695,13 +784,13 @@ jobs:
- run:
name: Download AutomateWoo
command: |
cd tests/docker
cd ../tests_env/docker
docker-compose run --rm -w /project --entrypoint "./do download:automate-woo-zip << parameters.automate_woo_version >>" --no-deps -e WP_GITHUB_USERNAME=${WP_GITHUB_USERNAME} -e WP_GITHUB_TOKEN=${WP_GITHUB_TOKEN} codeception_integration
- run:
name: 'PHP Integration tests'
command: |
mkdir -m 777 -p tests/_output/exceptions
cd tests/docker
cd ../tests_env/docker
args=(
--steps
--debug
@ -735,6 +824,7 @@ jobs:
-e ENABLE_HPOS=<< parameters.enable_hpos >> \
-e ENABLE_HPOS_SYNC=<< parameters.enable_hpos_sync >> \
-e DISABLE_HPOS=<< parameters.disable_hpos >> \
-e WORDPRESS_VERSION=${WORDPRESS_VERSION} \
codeception_integration "${args[@]}"
- store_test_results:
path: tests/_output
@ -854,14 +944,6 @@ workflows:
- static_analysis_php8
- qa_js
- qa_php
- performance_tests:
<<: *slack-fail-post-step
name: performance_tests
requires:
- unit_tests
- static_analysis_php8
- qa_js
- qa_php
- js_tests:
<<: *slack-fail-post-step
requires:
@ -952,12 +1034,11 @@ workflows:
- acceptance_tests_woo_hpos_sync_on
- acceptance_tests_woo_hpos_off
- acceptance_tests_blockbased_theme
- performance_tests
nightly:
triggers:
- schedule:
cron: '0 22 * * 1-5'
cron: '0 1 * * 1-5'
filters:
branches:
only:
@ -968,10 +1049,6 @@ workflows:
- acceptance_tests:
<<: *slack-fail-post-step
name: acceptance_latest
woo_core_version: latest
woo_subscriptions_version: latest
woo_memberships_version: latest
automate_woo_version: latest
mysql_image: mysql:8.3
mysql_command: --default-authentication-plugin=mysql_native_password
requires:
@ -981,10 +1058,6 @@ workflows:
name: acceptance_latest_blockbased_theme
group: frontend
blockbased_theme: 1
woo_core_version: latest
woo_subscriptions_version: latest
woo_memberships_version: latest
automate_woo_version: latest
mysql_image: mysql:8.3
mysql_command: --default-authentication-plugin=mysql_native_password
requires:
@ -992,14 +1065,15 @@ workflows:
- acceptance_tests:
<<: *slack-fail-post-step
name: acceptance_oldest
woo_core_version: 8.8.3
woo_subscriptions_version: 5.6.0
woo_memberships_version: 1.23.1
woo_core_version: 9.1.4
woo_subscriptions_version: 6.5.0
woo_memberships_version: 1.25.2
automate_woo_version: 5.8.5
mysql_command: --max_allowed_packet=100M --default-storage-engine=MYISAM
mysql_command: --max_allowed_packet=100M
mysql_image: mysql:5.5
codeception_image_version: 7.4-cli_20220605.0
wordpress_image_version: wp-6.4_php8.0_20231114.1
wordpress_image_version: 6.1.1-php7.4 # We use image with PHP 7.4 and install required WordPress version via CLI
wordpress_version: 6.5.5
requires:
- build
- performance_tests:
@ -1032,12 +1106,14 @@ workflows:
- integration_tests:
<<: *slack-fail-post-step
name: integration_oldest
woo_core_version: 8.8.3
woo_subscriptions_version: 5.6.0
woo_memberships_version: 1.24.0
woo_core_version: 9.1.4
woo_subscriptions_version: 6.5.0
woo_memberships_version: 1.25.2
automate_woo_version: 5.8.5
codeception_image_version: 7.4-cli_20220605.0
mysql_command: --max_allowed_packet=100M --default-storage-engine=MYISAM
wordpress_image_version: 6.1.1-php7.4 # We use image with PHP 7.4 and install required WordPress version via CLI # We use image with PHP 7.4 and install required WordPress version via CLI
wordpress_version: 6.5.5
mysql_command: --max_allowed_packet=100M
mysql_image: mysql:5.5
requires:
- build
@ -1050,6 +1126,36 @@ workflows:
name: acceptance_with_premium_latest
requires:
- build_premium
- integration_tests:
<<: *slack-fail-post-step
name: integration_tests_wordpress_beta
use_wordpress_beta: true
mysql_image: mysql:8.3
mysql_command: --default-authentication-plugin=mysql_native_password
requires:
- build
- integration_tests:
<<: *slack-fail-post-step
name: integration_tests_woocommerce_beta
use_woocommerce_beta: true
mysql_image: mysql:8.3
mysql_command: --default-authentication-plugin=mysql_native_password
requires:
- build
- acceptance_tests:
<<: *slack-fail-post-step
name: acceptance_tests_wordpress_beta
enable_hpos: 1
use_wordpress_beta: true
requires:
- build
- acceptance_tests:
<<: *slack-fail-post-step
name: acceptance_tests_woocommerce_beta
enable_hpos: 1
use_woocommerce_beta: true
requires:
- build
- unit_tests:
<<: *slack-fail-post-step
name: unit_with_premium_latest
@ -1060,3 +1166,29 @@ workflows:
name: integration_with_premium_latest
requires:
- build_premium
- acceptance_tests:
<<: *slack-fail-post-step
name: acceptance_with_premium_oldest
woo_core_version: 9.1.4
woo_subscriptions_version: 6.5.0
woo_memberships_version: 1.25.2
automate_woo_version: 5.8.5
codeception_image_version: 7.4-cli_20220605.0
wordpress_image_version: 6.1.1-php7.4 # We use image with PHP 7.4 and install required WordPress version via CLI
wordpress_version: 6.5.5
requires:
- build_premium
- integration_tests:
<<: *slack-fail-post-step
name: integration_with_premium_oldest
woo_core_version: 9.1.4
woo_subscriptions_version: 6.5.0
woo_memberships_version: 1.25.2
automate_woo_version: 5.8.5
codeception_image_version: 7.4-cli_20220605.0
wordpress_image_version: 6.1.1-php7.4 # We use image with PHP 7.4 and install required WordPress version via CLI
wordpress_version: 6.5.5
mysql_command: --max_allowed_packet=100M
mysql_image: mysql:5.5
requires:
- build_premium

View File

@ -0,0 +1,10 @@
<?php
require_once __DIR__ . '/helpers.php';
$repository = 'woocommerce/automatewoo';
$downloadCommand = 'download:automate-woo-zip';
$configParameterName = 'automate_woo_version';
$versionsFilenameSuffix = 'automate_woo_version.txt';
replacePrivatePluginVersion($repository, $downloadCommand, $configParameterName, $versionsFilenameSuffix);

View File

@ -0,0 +1,10 @@
<?php
require_once __DIR__ . '/helpers.php';
$repository = 'woocommerce/woocommerce-memberships';
$downloadCommand = 'download:woo-commerce-memberships-zip';
$configParameterName = 'woo_memberships_version';
$versionsFilenameSuffix = 'woocommerce_memberships_version.txt';
replacePrivatePluginVersion($repository, $downloadCommand, $configParameterName, $versionsFilenameSuffix);

View File

@ -0,0 +1,10 @@
<?php
require_once __DIR__ . '/helpers.php';
$repository = 'woocommerce/woocommerce-subscriptions';
$downloadCommand = 'download:woo-commerce-subscriptions-zip';
$configParameterName = 'woo_subscriptions_version';
$versionsFilenameSuffix = 'woocommerce_subscriptions_version.txt';
replacePrivatePluginVersion($repository, $downloadCommand, $configParameterName, $versionsFilenameSuffix);

View File

@ -0,0 +1,45 @@
<?php
require_once __DIR__ . '/helpers.php';
$downloadCommand = 'download:woo-commerce-zip';
$configParameterName = 'woo_core_version';
$versionsFilenameSuffix = 'woocommerce_version.txt';
/**
* We get the official WooCommerce versions from the WordPress API.
*/
function getWooCommerceVersions(): array {
$url = "https://api.wordpress.org/plugins/info/1.0/woocommerce.json";
$response = file_get_contents($url);
$data = json_decode($response, true);
if (!isset($data['versions'])) {
die("Failed to fetch WooCommerce versions.");
}
return array_keys($data['versions']);
}
$allVersions = getWooCommerceVersions();
$stableVersions = filterStableVersions($allVersions);
[$latestVersion, $previousVersion] = getLatestAndPreviousMinorMajorVersions($stableVersions);
echo "Latest WooCommerce version: $latestVersion\n";
echo "Previous WooCommerce version: $previousVersion\n";
if ($latestVersion) {
echo "Replacing the latest version in the config file...\n";
replaceLatestVersion($latestVersion, $downloadCommand);
} else {
echo "No latest version found.\n";
}
if ($previousVersion) {
echo "Replacing the previous version in the config file...\n";
replacePreviousVersion($previousVersion, $configParameterName);
} else {
echo "No previous version found.\n";
}
saveVersionsToFiles($latestVersion, $previousVersion, $versionsFilenameSuffix);

View File

@ -0,0 +1,123 @@
<?php
require_once __DIR__ . '/helpers.php';
/**
* We try to get the current available official Docker images for WordPress.
*/
function getWordpressVersions(int $page = 1, int $pageSize = 100): array {
$url = "https://registry.hub.docker.com/v2/repositories/library/wordpress/tags?page_size={$pageSize}&page={$page}";
$response = file_get_contents($url);
$data = json_decode($response, true);
return array_column($data['results'], 'name');
}
/**
* We prefer the latest patch versions of WordPress with specified PHP versions.
* For example: 6.5.4-php8.3
*/
function filterVersions(array $versions): array {
return array_filter($versions, fn($version) => preg_match('/^\d+\.\d+\.\d+-php\d+\.\d+$/', $version));
}
/**
* We sort the versions by WordPress version and PHP version.
* The expected output is:
* - 6.5.4-php8.3
* - 6.5.4-php8.2
* - 6.5.3-php8.3
* - 6.5.3-php8.2
*/
function sortVersions(&$versions) {
usort($versions, function($a, $b) {
[$wpA, $phpA] = explode('-php', $a);
[$wpB, $phpB] = explode('-php', $b);
$wpCompare = version_compare($wpB, $wpA);
return $wpCompare !== 0 ? $wpCompare : version_compare($phpB, $phpA);
});
}
/**
* This function group docker tags by the WordPress version and returns the latest with the higher PHP version
* abd the previous with the lower PHP version.
*/
function getLatestAndPreviousVersions(array $sortedVersions): array {
$uniqueVersions = [];
foreach ($sortedVersions as $version) {
[$wpVersion] = explode('-php', $version);
$majorMinorVersion = preg_replace('/\.\d+$/', '', $wpVersion);
$uniqueVersions[$majorMinorVersion][] = $version;
}
krsort($uniqueVersions);
$latestVersionGroup = reset($uniqueVersions);
$previousVersionGroup = next($uniqueVersions);
$latestVersion = $latestVersionGroup === false ? null : reset($latestVersionGroup);
$previousVersion = $previousVersionGroup === false ? null : end($previousVersionGroup);
return [$latestVersion, $previousVersion];
}
/**
* We specify the latest WordPress version only in the docker-compose file for the tests.
*/
function replaceLatestWordPressVersion(string $latestVersion): void {
replaceVersionInFile(
__DIR__ . './../../../tests_env/docker/docker-compose.yml',
'/(wordpress:\${WORDPRESS_IMAGE_VERSION:-\s*)\d+\.\d+\.?\d*-php\d+\.\d+(})/',
'${1}' . $latestVersion . '${2}'
);
}
/**
* We use the previous WordPress version only in the CircleCI config file.
*/
function replacePreviousWordPressVersion(string $previousVersion): void {
replaceVersionInFile(
__DIR__ . './../../../.circleci/config.yml',
'/(wordpress_version: )\d+\.\d+\.?\d*/',
'${1}' . $previousVersion
);
}
$allVersions = [];
$page = 1;
$maxPages = 8;
$latestVersion = null;
$previousVersion = null;
echo "Fetching WordPress versions...\n";
// We fetch the versions until we find the latest and previous versions. But there is a limit of 4 pages.
while (($latestVersion === null || $previousVersion === null) && $page <= $maxPages) {
echo "Fetching page $page...\n";
$versions = getWordpressVersions($page);
$allVersions = array_merge($allVersions, $versions);
$allVersions = filterVersions($allVersions);
sortVersions($allVersions);
[$latestVersion, $previousVersion] = getLatestAndPreviousVersions($allVersions);
$page++;
}
echo "Latest version: $latestVersion\n";
echo "Previous version: $previousVersion\n";
if ($latestVersion) {
echo "Replacing the latest version in the docker file...\n";
replaceLatestWordPressVersion($latestVersion);
} else {
echo "No latest version found.\n";
}
if ($previousVersion) {
echo "Replacing the previous version in the config file...\n";
// We install previous WordPress version via CLI so we need a version without PHP in the name.
$previousVersion = preg_replace('/-php\d+\.\d+$/', '', $previousVersion);
replacePreviousWordPressVersion($previousVersion);
} else {
echo "No previous version found.\n";
}
saveVersionsToFiles($latestVersion, $previousVersion, 'wordpress_version.txt');

156
.github/workflows/scripts/helpers.php vendored Normal file
View File

@ -0,0 +1,156 @@
<?php
/**
* Function replacing versions in a file by the regex pattern.
*/
function replaceVersionInFile(string $filePath, string $pattern, string $replacement): void {
$content = file_get_contents($filePath);
if ($content === false) {
die("Failed to read the file at $filePath.");
}
$updatedContent = preg_replace($pattern, $replacement, $content);
if ($updatedContent === null || $updatedContent === $content) {
echo "Nothing to update in $filePath\n";
return;
}
if (file_put_contents($filePath, $updatedContent) === false) {
die("Failed to write the updated file at $filePath.");
}
}
/**
* Function to filter stable versions from a list of versions.
*/
function filterStableVersions(array $versions): array {
return array_filter($versions, function($version) {
// Only include stable versions (exclude versions with -rc, -beta, -alpha, etc.)
return preg_match('/^\d+\.\d+\.\d+$/', $version);
});
}
/**
* Function to get the latest and previous minor/major versions from a list of versions.
*/
function getLatestAndPreviousMinorMajorVersions(array $versions): array {
usort($versions, 'version_compare');
$currentVersion = end($versions);
$previousVersion = null;
foreach (array_reverse($versions) as $version) {
if (version_compare($version, $currentVersion, '<') && getMinorMajorVersion($version) !== getMinorMajorVersion($currentVersion)) {
$previousVersion = $version;
break;
}
}
return [$currentVersion, $previousVersion];
}
function getMinorMajorVersion(string $version): string {
$parts = explode('.', $version);
return $parts[0] . '.' . $parts[1];
}
/**
* Function to fetch tags from a GitHub repository.
*/
function fetchGitHubTags(string $repo, string $token, int $page = 1, int $limit = 50): array {
$url = "https://api.github.com/repos/$repo/tags?per_page=$limit&page=$page";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0'); // GitHub API requires a user agent
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: token $token"
]);
$response = curl_exec($ch);
curl_close($ch);
if ($response === false) {
die("Failed to fetch tags from GitHub.");
}
$data = json_decode($response, true);
if (isset($data['message']) && $data['message'] == 'Not Found') {
die("Repository not found or access denied.");
}
return array_column($data, 'name');
}
/**
* Function saving versions to a temporary files.
* File containing latest version is prefixed with 'latest_' and previous version is prefixed with 'previous_'.
*/
function saveVersionsToFiles(?string $latestVersion, ?string $previousVersion, string $fileNameSuffix): void {
file_put_contents("/tmp/latest_{$fileNameSuffix}", $latestVersion);
file_put_contents("/tmp/previous_{$fileNameSuffix}", $previousVersion);
}
function replaceLatestVersion(string $latestVersion, string $downloadCommand): void {
replaceVersionInFile(
__DIR__ . '/../../../.circleci/config.yml',
'/(.\/do ' . $downloadCommand . ' )\d+\.\d+\.\d+/',
'${1}' . $latestVersion
);
}
function replacePreviousVersion(string $previousVersion, string $configParameterName): void {
replaceVersionInFile(
__DIR__ . '/../../../.circleci/config.yml',
'/(' . $configParameterName . ': )\d+\.\d+\.\d+/',
'${1}' . $previousVersion
);
}
/**
* Function replacing the latest and previous versions of a private plugin in the config file.
* The function fetches the tags from the GitHub repository, filters stable versions,
* gets the latest and previous minor/major versions, and replaces the versions in the CircleCI config file.
*/
function replacePrivatePluginVersion(
string $repository,
string $downloadCommand,
string $configParameterName,
string $versionsFilename
): void {
// Read the GitHub token from environment variable
$token = getenv('GH_TOKEN');
if (!$token) {
die("GitHub token not found. Make sure it's set in the environment variable 'GH_TOKEN'.");
}
$page = 1;
$latestVersion = null;
$previousVersion = null;
$allVersions = [];
while (($latestVersion === null || $previousVersion === null) && $page < 10) {
$allVersions = array_merge($allVersions, fetchGitHubTags($repository, $token, $page));
$stableVersions = filterStableVersions($allVersions);
[$latestVersion, $previousVersion] = getLatestAndPreviousMinorMajorVersions($stableVersions);
$page++;
}
echo "Latest version: $latestVersion\n";
echo "Previous version: $previousVersion\n";
if ($latestVersion) {
echo "Replacing the latest version in the config file...\n";
replaceLatestVersion($latestVersion, $downloadCommand);
} else {
echo "No latest version found.\n";
}
if ($previousVersion) {
echo "Replacing the previous version in the config file...\n";
replacePreviousVersion($previousVersion, $configParameterName);
} else {
echo "No previous version found.\n";
}
saveVersionsToFiles($latestVersion, $previousVersion, $versionsFilename);
}

View File

@ -0,0 +1,182 @@
name: Check new versions of plugins and WordPress
on:
schedule:
- cron: '0 6 * * 1' # At 06:00 on Monday
workflow_dispatch: # Allows manual triggering
jobs:
check-versions:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3' # Specify the PHP version you want to use
# Updating used WordPress
- name: Check WordPress Docker Versions
run: php .github/workflows/scripts/check_wordpress_versions.php
- name: Check for WordPress changes
id: check_wp_changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
if [ "$(git status --porcelain)" != "" ]; then
echo "CHANGES_DETECTED=true" >> $GITHUB_ENV
echo "WORDPRESS_CHANGES=true" >> $GITHUB_ENV
fi
- name: Get WordPress versions from files
id: get_wp_versions
run: |
echo "WORDPRESS_LATEST_VERSION=$(cat /tmp/latest_wordpress_version.txt)" >> $GITHUB_ENV
echo "WORDPRESS_PREVIOUS_VERSION=$(cat /tmp/previous_wordpress_version.txt)" >> $GITHUB_ENV
- name: Commit WordPress changes
if: env.WORDPRESS_CHANGES == 'true'
run: |
git add .
git commit -m $'Update used WordPress images in Circle CI\n\n - latest version: ${{ env.WORDPRESS_LATEST_VERSION }}\n - previous version: ${{ env.WORDPRESS_PREVIOUS_VERSION }}'
# Updating used WooCommerce plugin
- name: Check WooCommerce Versions
run: php .github/workflows/scripts/check_woocommerce_versions.php
- name: Check for WooCommerce changes
id: check_wc_changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
if [ "$(git status --porcelain)" != "" ]; then
echo "CHANGES_DETECTED=true" >> $GITHUB_ENV
echo "WOOCOMMERCE_CHANGES=true" >> $GITHUB_ENV
fi
- name: Get WooCommerce versions from files
id: get_wc_versions
run: |
echo "WOOCOMMERCE_LATEST_VERSION=$(cat /tmp/latest_woocommerce_version.txt)" >> $GITHUB_ENV
echo "WOOCOMMERCE_PREVIOUS_VERSION=$(cat /tmp/previous_woocommerce_version.txt)" >> $GITHUB_ENV
- name: Commit WooCommerce changes
if: env.WOOCOMMERCE_CHANGES == 'true'
run: |
git add .
git commit -m $'Update used WooCommerce plugin in Circle CI\n\n - latest version: ${{ env.WOOCOMMERCE_LATEST_VERSION }}\n - previous version: ${{ env.WOOCOMMERCE_PREVIOUS_VERSION }}'
# Updating used Automate Woo plugin
- name: Check Automate Woo Versions
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: php .github/workflows/scripts/check_automate_woo_versions.php
- name: Check for Automate Woo changes
id: check_aw_changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
if [ "$(git status --porcelain)" != "" ]; then
echo "CHANGES_DETECTED=true" >> $GITHUB_ENV
echo "AUTOMATE_WOO_CHANGES=true" >> $GITHUB_ENV
fi
- name: Get Automate Woo versions from files
id: get_aw_versions
run: |
echo "AUTOMATE_WOO_LATEST_VERSION=$(cat /tmp/latest_automate_woo_version.txt)" >> $GITHUB_ENV
echo "AUTOMATE_WOO_PREVIOUS_VERSION=$(cat /tmp/previous_automate_woo_version.txt)" >> $GITHUB_ENV
- name: Commit Automate Woo changes
if: env.AUTOMATE_WOO_CHANGES == 'true'
run: |
git add .
git commit -m $'Update used Automate Woo plugin in Circle CI\n\n - latest version: ${{ env.AUTOMATE_WOO_LATEST_VERSION }}\n - previous version: ${{ env.AUTOMATE_WOO_PREVIOUS_VERSION }}'
# Updating used WooCommerce Subscriptions plugin
- name: Check WooCommerce Subscriptions Versions
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: php .github/workflows/scripts/check_woocommerce_subscriptions_versions.php
- name: Check for WooCommerce Subscriptions changes
id: check_ws_changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
if [ "$(git status --porcelain)" != "" ]; then
echo "CHANGES_DETECTED=true" >> $GITHUB_ENV
echo "SUBSCRIPTIONS_CHANGES=true" >> $GITHUB_ENV
fi
- name: Get WooCommerce Subscriptions versions from files
id: get_ws_versions
run: |
echo "WOOCOMMERCE_SUBSCRIPTIONS_LATEST_VERSION=$(cat /tmp/latest_woocommerce_subscriptions_version.txt)" >> $GITHUB_ENV
echo "WOOCOMMERCE_SUBSCRIPTIONS_PREVIOUS_VERSION=$(cat /tmp/previous_woocommerce_subscriptions_version.txt)" >> $GITHUB_ENV
- name: Commit WooCommerce Subscriptions changes
if: env.SUBSCRIPTIONS_CHANGES == 'true'
run: |
git add .
git commit -m $'Update used WooCommerce Subscriptions plugin in Circle CI\n\n - latest version: ${{ env.WOOCOMMERCE_SUBSCRIPTIONS_LATEST_VERSION }}\n - previous version: ${{ env.WOOCOMMERCE_SUBSCRIPTIONS_PREVIOUS_VERSION }}'
# Updating used WooCommerce Memberships plugin
- name: Check WooCommerce Memberships Versions
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: php .github/workflows/scripts/check_woocommerce_memberships_versions.php
- name: Check for WooCommerce Memberships changes
id: check_wm_changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
if [ "$(git status --porcelain)" != "" ]; then
echo "CHANGES_DETECTED=true" >> $GITHUB_ENV
echo "MEMBERSHIPS_CHANGES=true" >> $GITHUB_ENV
fi
- name: Get WooCommerce Memberships versions from files
id: get_wm_versions
run: |
echo "WOOCOMMERCE_MEMBERSHIPS_LATEST_VERSION=$(cat /tmp/latest_woocommerce_memberships_version.txt)" >> $GITHUB_ENV
echo "WOOCOMMERCE_MEMBERSHIPS_PREVIOUS_VERSION=$(cat /tmp/previous_woocommerce_memberships_version.txt)" >> $GITHUB_ENV
- name: Commit WooCommerce Memberships changes
if: env.MEMBERSHIPS_CHANGES == 'true'
run: |
git add .
git commit -m $'Update used WooCommerce Memberships plugin in Circle CI\n\n - latest version: ${{ env.WOOCOMMERCE_MEMBERSHIPS_LATEST_VERSION }}\n - previous version: ${{ env.WOOCOMMERCE_MEMBERSHIPS_PREVIOUS_VERSION }}'
# Push all changes at the end if any changes were detected
#
# For local testing with act tool add following:
# env:
# GH_PAT: ${{ secrets.GH_TOKEN }}
# run: |
# git remote set-url origin https://${GH_PAT}@github.com/mailpoet/mailpoet
# git push -f origin HEAD:refs/heads/update-plugins-and-wordpress-test
- name: Push changes
if: env.CHANGES_DETECTED == 'true'
run: |
git push -f origin HEAD:refs/heads/update-plugins-and-wordpress
# Create a pull request if there are changes
- name: Create Pull Request
if: env.CHANGES_DETECTED == 'true'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GH_TOKEN }}
branch: update-plugins-and-wordpress
title: Update WordPress and plugins in CI jobs
base: trunk
labels: automated, check-versions
body: |
1. If all checks passed, you can merge this PR.
2. If the build failed, please investigate the failure and either address the issues or delegate the job. Then, make sure these changes are merged.

View File

@ -1,65 +1,51 @@
# Contributing
There is a `./do` command that helps with the development process. See README.md for more details.
There is a `./do` command that helps with the development process. See [README](README.md) for more details.
## PHP Code
- Two spaces indentation.
- Space between keyword (if, for, switch...) and left bracket
- CamelCase for classes.
- camelCase for methods.
- snake_case for variables and class properties.
- Space between keyword and left bracket (`if ()`, `for ()`, `switch ()`...).
- `CamelCase` for classes.
- `camelCase` for methods.
- `snake_case` for variables and class properties.
- Composition over Inheritance.
- Comments are a code smell. If you need to use a comment - see if same idea can be achieved by more clearly expressing code.
- Require other classes with 'use' at the beginning of the class file.
- Do not specify 'public' if method is public, it's implicit.
- Require other classes with `use` at the beginning of the class file.
- Always use guard clauses.
- Ensure compatibility with PHP 7.1 and newer versions.
- Ensure compatibility with PHP 7.4 and newer versions.
- Cover your code in tests.
## SCSS Code
- camelCase for file name
- Components files are prefixed with underscore, to indicate, that they aren't compiled separately.
- `kebab-case` for file names.
- Components files are prefixed with underscore, to indicate, that they aren't compiled separately (`_new-component.scss`).
## JS Code
- Javascript code should follow the [Airbnb style guide](https://github.com/airbnb/javascript).
- Prefer named export before default export in JS and TS files
- Default to TypeScript for new files.
## Disabling linting rules
- we want to avoid using `eslint-disable`
- if we have to use it we need to use a comment explaining why do we need it:
- We want to avoid using `eslint-disable`
- If we have to use it we need to use a comment explaining why do we need it:
`/* eslint-disable no-new -- this class has a side-effect in the constructor and it's a library's. */`
- for PHP we do the same with the exception `// phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps` which for now doesnt require an explanation
- For PHP we do the same with the exception `// phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps` which for now doesnt require an explanation
## Git flow
- Do not commit to trunk.
- Open a short-living feature branch.
- Open a pull request.
- Add Jira issue reference in the title of the Pull Request.
- Work on the pull request.
- Use good commit messages as explained here https://chris.beams.io/posts/git-commit. Include Jira ticket in the commit message.
- Use the `./do qa` command to check your code style before pushing.
- Use good commit messages as explained here https://chris.beams.io/posts/git-commit
- Create a pull request when finished. Include Jira ticket in the title of the pull request.
- Wait for review from another developer.
## Issues creation
- Issues are managed on Jira.
- Discuss issues on public Slack chats, discuss code in pull requests.
- Open a small Jira issue only when it has been discussed.
## Migration from IdiORM to Doctrine
MailPoet used to use [IdiORM](https://github.com/j4mie/idiorm) as its object-relational mapper (ORM), but the project was abandoned a while ago, so we started a migration to [Doctrine](https://www.doctrine-project.org/). This is a significant effort that has been going on for quite some time. Although you will still see parts of the code that use IdioORM, we ask that all new code be added using Doctrine instead.
All IdioORM models live in [mailpoet/lib/Models](https://github.com/mailpoet/mailpoet/tree/trunk/mailpoet/lib/Models), should be considered deprecated and shouldn't be used by new code. We are moving everything to Doctrine entities and some auxiliary code when needed. You can find Doctrine entities in [mailpoet/lib/Entities](https://github.com/mailpoet/mailpoet/tree/trunk/mailpoet/lib/Entities).
## Feature flags
We use feature flags to control the visibility of new features. This allows us to work on new features in smaller chunks before they are released to all customers.
- Feature flags can be enabled on the experimental page: wp-admin/admin.php?page=mailpoet-experimental
- New feature flags can be added in the class `FeaturesController`
- Feature flags can be enabled on the experimental page: `/admin.php?page=mailpoet-experimental`.
- New feature flags can be added in the class `FeaturesController`.

View File

@ -1,4 +1,23 @@
# MailPoet
### Table of Contents
1. [MailPoet](#mailpoet)
2. [Initial setup](#initial-setup)
1. [Additional dependencies](#additional-dependencies)
3. [Xdebug](#xdebug)
1. [PhpStorm setup](#phpstorm-setup)
2. [Xdebug develop mode](#xdebug-develop-mode)
3. [Xdebug for integration tests](#xdebug-for-integration-tests)
4. [Local development](#local-development)
1. [NFS volume sharing for Mac](#nfs-volume-sharing-for-mac)
2. [Husky hooks](#husky-hooks)
5. [Docker](#docker)
1. [Commands](#commands)
2. [Available PHP versions](#available-php-versions)
3. [Disabling the Tracy panel](#disabling-the-tracy-panel)
4. [Running individual tests](#running-individual-tests)
6. [TODO](#todo)
## MailPoet
The **MailPoet** plugin monorepo.
@ -7,16 +26,16 @@ If you have **any questions or need help or support**, please see the [Support](
To use our Docker-based development environment (recommended), continue with the steps below.
If you'd like to use the plugin code directly, see details in [the plugin's readme](mailpoet/README.md).
## 🔌 Initial setup
## Initial setup
1. Run `./do setup` to pull everything and install necessary dependencies.
2. Add secrets to `.env` files in `mailpoet` and `mailpoet-premium` directories. Go to the Secret Store and look for "MailPoet: plugin .env"
3. Run `./do start` to start the stack.
4. Go to http://localhost:8888 to see the dashboard of the dev environment.
## Additional dependencies
### Additional dependencies
Even though it possible to run everything using Docker, in the development workflow,
Even though it's possible to run everything using Docker, in the development workflow,
it may be faster and more convenient to run some tasks outside the container. Therefore,
the following tools are recommended:
@ -24,7 +43,9 @@ the following tools are recommended:
2. **Node.js**, as specified by `.nvmrc`. For automatic management use [nvm](https://github.com/nvm-sh/nvm), [FNM](https://github.com/Schniz/fnm), or [Volta](https://github.com/volta-cli/volta).
3. **pnpm**, as specified in `package.json`. For automatic setup enable [Corepack](https://nodejs.org/docs/latest-v17.x/api/corepack.html) using `corepack enable`.
## 🔍 PHPStorm setup for XDebug
## Xdebug
### PhpStorm setup
In `Languages & Preferences > PHP > Servers` set path mappings:
@ -41,7 +62,7 @@ To use XDebug inside the **cron**, you need to pass a URL argument `&XDEBUG_TRIG
[in the cron request](https://github.com/mailpoet/mailpoet/blob/bf7bd6d2d9090ed6ec7b8b575bb7d6b08e663a52/lib/Cron/CronHelper.php#L155-L166).
Alternatively, you can add `XDEBUG_TRIGGER: yes` to the `wordpress` service in `docker-compose.yml` and restart it (which will run XDebug also for all other requests).
## Xdebug develop mode
### Xdebug develop mode
[Xdebug develop mode](https://xdebug.org/docs/develop) is disabled by default because it causes performance issues due to conflicts with the DI container.
@ -52,7 +73,7 @@ environment:
XDEBUG_MODE: debug, develop
```
## Xdebug for integration tests
### Xdebug for integration tests
- In Languages & Preferences > PHP > Servers create a new sever named `MailPoetTest`, set the host to `localhost` and port to `80` and set following path mappings:
@ -64,10 +85,12 @@ mailpoet/vendor/bin/codecept -> /project/vendor/bin/codecept
mailpoet/vendor/bin/wp -> /usr/local/bin/wp
```
- Add `XDEBUG_TRIGGER: 1` environment to `mailpoet/tests/docker/docker-compose.yml` -> codeception service to start triggering Xdebug
- Add `XDEBUG_TRIGGER: 1` environment to `tests_env/docker/docker-compose.yml` -> codeception service to start triggering Xdebug
- Make PHPStorm listen to connections by clicking on the phone icon
## 💾 NFS volume sharing for Mac
## Local development
### NFS volume sharing for Mac
NFS volumes can bring more stability and performance on Docker for Mac. To setup NFS volume sharing run:
@ -87,7 +110,7 @@ docker-compose up -d
**NOTE:** If you are on MacOS Catalina or newer, make sure to put the repository
outside your `Documents` folder, otherwise you may run into [file permission issues](https://objekt.click/2019/11/docker-the-problem-with-macos-catalina/).
# 🐶 Husky
### Husky hooks
We use [Husky](https://github.com/typicode/husky) to run automated checks in pre-commit hooks.
@ -102,7 +125,9 @@ export NVM_DIR="$HOME/.nvm"
Without it, you may experience errors in some Git clients.
## 🕹 Commands
## Docker
### Commands
The `./do` script define aliases for most of the commands you will need while working on plugins:
@ -124,11 +149,7 @@ Options:
You can access this help in your command line running `./do` without parameters.
## ✉️ Adding new templates to the plugin
[Read the article.](https://mailpoet.atlassian.net/wiki/spaces/MAILPOET/pages/629374977/Adding+new+templates+to+the+plugin)
## 🚥 Testing with different PHP versions
### Available PHP versions
To switch the environment to a different PHP version:
@ -148,7 +169,7 @@ To switch the environment to a different PHP version:
To switch back to the default PHP version remove what was added in 2) and, run `docker-compose build wordpress` for application container and `docker-compose build test_wordpress` for tests container,
and start the stack using `./do start`.
## Disabling the Tracy panel
### Disabling the Tracy panel
To disable the Tracy panel, add the following to `docker-compose.override.yml`:
@ -159,6 +180,39 @@ services:
MAILPOET_DISABLE_TRACY_PANEL: 1
```
## ✅ TODO
### Running individual tests
- install woo commerce, members and other useful plugins by default
It's recommended to run tests in Docker. Free plugin tests can be run using --test flag (`./do --test`). However, to run a premium test, you need to ssh into test container (`./do ssh --test`) and run tests there.
#### Integration test in the free plugin
```shell
./do --test test:integration --skip-deps --file=tests/integration/WP/EmojiTest.php
```
#### Acceptance test in the free plugin
```shell
./do --test test:acceptance --skip-deps --file=tests/acceptance/Misc/MailpoetMenuCest.php
```
#### Unit/integration test in the premium plugin
```shell
./do ssh --test # to enter the container
cd ../mailpoet-premium # switch to premium plugin directory
./do test:unit --file=tests/unit/Config/EnvTest.php
```
#### Acceptance test in the premium plugin
```shell
cd ./mailpoet-premium # switch to premium plugin directory on your local machine
./do test:acceptance --skip-deps --file tests/acceptance/PremiumCheckCest.php
```
## TODO
- [ ] Install WooCommerce
- [ ] Install Members
- [ ] Install other useful plugins by default

View File

@ -1,13 +1,5 @@
# Getting Support
# Support
Welcome to MailPoet!
This isn't the right place to get support for using MailPoet,
but the following resources are available below,
thanks for understanding.
Please visit our [Support](https://www.mailpoet.com/support/) page. We have a team of Happiness Engineers ready to help you.
When you need help, please visit our [Support](https://www.mailpoet.com/support) page.
We have a team of Happiness Engineers ready to help you.
Free users can also ask questions in the [WordPress.org support forum](https://wordpress.org/support/plugin/mailpoet).
For feature Requests use our [tracker](https://feedback.mailpoet.com).
For feature requests, please use our [tracker](https://feedback.mailpoet.com).

View File

@ -27,6 +27,7 @@ Class `\MailPoet\API\API` becomes available once MailPoet plugin is loaded by Wo
- [Add List (addList)](api_methods/AddList.md)
- [Add Subscriber (addSubscriber)](api_methods/AddSubscriber.md)
- [Update Subscriber (updateSubscriber)](api_methods/UpdateSubscriber.md)
- [Add Subscriber Field (addSubscriberField)](api_methods/AddSubscriberField.md)
- [Delete List (deleteList)](api_methods/DeleteList.md)
- [Get Lists (getLists)](api_methods/GetLists.md)

View File

@ -0,0 +1,33 @@
[back to list](../Readme.md)
# Update Subscriber
## `array updateSubscriber($subscriberIdOrEmail, array $subscriber): array`
This method allows a subscriber to be updated.
The argument `$subscriber` is similar to [Add Subscriber](AddSubscriber.md) method, but the subscriber is updated instead of created.
It returns the updated subscriber. See [Get Subscriber](GetSubscriber.md) for a subscriber data structure.
If the subscriber is a WordPress user, the method does not allow updating `email`, `first_name` and `last_name`. It needs to be updated in the `wp_users` and MailPoet will synchronise the new values.
## Arguments
| Argument | Type | Description |
| -------------------- | ------------- | ----------------------------------------- |
| $subscriberIdOrEmail | string or int | An id or email of an existing subscriber. |
| $subscriber | array | Subscriber data that will be updated |
## Error handling
All expected errors from the API are exceptions of class `\MailPoet\API\MP\v1\APIException`.
Code of the exception is populated to distinguish between different errors.
An exception of base class `\Exception` can be thrown when something unexpected happens.
Codes description:
| Code | Description |
| ---- | -------------------------------------------------- |
| 4 | Updating a subscriber that does not exist. |
| 13 | The subscriber couldnt be updated in the database |

View File

@ -1,5 +1,3 @@
version: '3.8'
services:
dashboard:
container_name: mp-dashboard
@ -33,7 +31,6 @@ services:
GID: ${GID:-1000}
ports:
- '8002:80'
- '8083:8083' # Storybook port number, see package.json
depends_on:
- db
- smtp

1
mailpoet/.gitignore vendored
View File

@ -26,5 +26,4 @@ tasks/code_sniffer/vendor
tasks/phpstan/vendor
tasks/phpstan/_phpstan-wp-source.neon
/tools/vendor
/storybook-static
assets/js/src/newsletter-editor/behaviors/tinymce-icons.js

View File

@ -1,48 +0,0 @@
const path = require('path');
const modulesDir = path.join(__dirname, '../node_modules');
console.log('NODE', modulesDir);
// Workaround for Emotion 11
// https://github.com/storybookjs/storybook/pull/13300#issuecomment-783268111
const updateEmotionAliases = (config) => ({
...config,
resolve: {
...config.resolve,
alias: {
...config.resolve.alias,
'@emotion/core': path.join(modulesDir, '@emotion/react'),
'@emotion/styled': path.join(modulesDir, '@emotion/styled'),
'@emotion/styled-base': path.join(modulesDir, '@emotion/styled'),
'emotion-theming': path.join(modulesDir, '@emotion/react'),
},
},
});
module.exports = {
core: {
builder: 'webpack5',
},
stories: ['../assets/js/src/**/_stories/*.tsx'],
webpackFinal: (config) => {
config.resolve.modules = ['node_modules', '../assets/js/src'];
return updateEmotionAliases(config);
},
managerWebpack: updateEmotionAliases,
addons: [
'@storybook/addon-actions',
'@storybook/addon-links',
'storybook-addon-performance/register',
{
name: '@storybook/addon-storysource',
options: {
rule: {
test: [/_stories\/.*\.tsx?$/],
include: [path.resolve(__dirname, '../assets/js/src')],
},
loaderOptions: {
parser: 'typescript',
},
},
},
],
};

View File

@ -1,14 +0,0 @@
import React from 'react';
import { addDecorator } from '@storybook/react';
import { withPerformance } from 'storybook-addon-performance';
import '../assets/css/src/storybook/wordpress-5.8.2.css';
import '../assets/dist/css/mailpoet-plugin.css';
import '../assets/dist/css/mailpoet-form-editor.css';
addDecorator(withPerformance);
addDecorator((story) => (
<div className="wp-core-ui" id="wpbody">
<div id="mailpoet-modal"></div>
{story()}
</div>
));

2653
mailpoet/CHANGELOG.md Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,26 +1,28 @@
# MailPoet
### Table of Contents
The **MailPoet** plugin.
1. [MailPoet](#mailpoet)
2. [Setup](#setup)
1. [Requirements](#requirements)
2. [Installation](#installation)
3. [Frameworks and libraries](#frameworks-and-libraries)
3. [Workflow Commands](#workflow-commands)
4. [Coding and Testing](#coding-and-testing)
1. [DI](#di)
2. [PHP-Scoper](#php-scoper)
3. [i18n](#i18n)
4. [Acceptance testing](#acceptance-testing)
If you have **any questions or need help or support**, please see the [Support](../SUPPORT.md) document.
## MailPoet
To use the official Docker-based development environment, see details
in [the readme file](../README.md) in the root of this repository. If
you'd like to use the plugin code directly, you can follow the instructions
below.
## Contents
- [Setup](#setup)
- [Frameworks and libraries](#frameworks-and-libraries)
- [Workflow Commands](#workflow-commands)
- [Coding and Testing](#coding-and-testing)
- For help with product, visit [SUPPORT](../SUPPORT.md).
- To use the Docker-based development environment, see [monorepo README](../README.md).
- To use plugin code directly, follow instructions below.
## Setup
### Requirements
- PHP >= 7.3 (only for the development environment, to run the plugin PHP >= 7.2 is required)
- PHP >= 7.4
- NodeJS
- WordPress
@ -48,9 +50,8 @@ cp .env.sample .env
./do compile:all
```
## Frameworks and libraries
### Frameworks and libraries
- [Paris ORM](https://github.com/j4mie/paris).
- [Symfony/dependency-injection](https://github.com/symfony/dependency-injection) ([docs for 3.4](https://symfony.com/doc/3.4/components/dependency_injection.html)).
- [PHP-Scoper](https://github.com/humbug/php-scoper) for moving dependencies into MP namespace
- [Twig](https://twig.symfony.com/) and [Handlebars](https://handlebarsjs.com/) are used for templates rendering.
@ -126,34 +127,6 @@ $ ./do container:dump # Generates DI container cache.
$ ./do generate:data [<generatorName>] [<threads>] # Generates random usage data (Note: requires WooCommerce active) e.g. ./do generate:data past_revenues 4
```
## Storybook
We use [Storybook.js](https://storybook.js.org/) to showcase our React components, which can be used throughout the plugin.
### Usage
Currently, we don't have Storybook published publicly, so developers need to run or build it locally.
To run it locally (on `http://localhost:8083`) while watching the changes (recommended when developing new component), run
```bash
./do storybook:watch
```
To build the static version, which can be accessed via browser, run
```bash
./do storybook:build
```
which will create a `storybook-static` folder with all necessary files. Don't forget to rebuild it when new components are added.
### Building new components
- All stories should be located in `_stories` folder inside the component folder they belong to.
- Run `./do storybook:watch` so all changes are automatically reflected in `http://localhost:8083`.
- Examples are available in `assets/js/src/storybook_demo/_stories` folder.
## Coding and Testing
### DI
@ -169,9 +142,23 @@ Dependencies handled by PHP-Scoper are configured in extra configuration files `
### i18n
We use functions `__()`, `_n()`, `_x()`, and `_nx()` with domain `mailpoet` to translate strings.
We use functions `__()`, `_n()`, `_x()`, and `_nx()` with domain `mailpoet` to translate strings. Please follow [best practices](https://codex.wordpress.org/I18n_for_WordPress_Developers).
**in PHP code**
#### Comments for translators
When the translation string can be ambiguous, add [a translators comment](https://codex.wordpress.org/I18n_for_WordPress_Developers#Descriptions) for clarification. Don't use `_x()` or `_xn()` for clarification.
```php
// translators:
$customErrorMessage = sprintf(
// translators: %1$s is the link, %2$s is the error message.
__('Please see %1$s for more information. %2$s.', 'mailpoet'),
'https://kb.mailpoet.com',
$errorMessage
);
```
#### In PHP code
```php
__('text to translate', 'mailpoet');
@ -180,7 +167,7 @@ _x('text to translate', 'context', 'mailpoet');
_xn('single text', 'plural text', $number, 'context', 'mailpoet');
```
**in JavaScript/TypeScript code**
#### In JavaScript/TypeScript code
```ts
import { __, _n, _x, _xn } from '@wordpress/i18n';

View File

@ -83,12 +83,8 @@ class RoboFile extends \Robo\Tasks {
}, ARRAY_FILTER_USE_KEY);
$excludePackages = [
'tinymce',
'react-router-dom', // MAILPOET-3911
'react-tooltip', // MAILPOET-5482
'codemirror', // MAILPOET-5483
'@babel/preset-env', // MAILPOET-5489
'react-string-replace', // MAILPOET-5490
'babel-loader', // MAILPOET-5491
'stylelint', // MAILPOET-5462
'backbone', // Will remove with new email editor
@ -191,7 +187,7 @@ class RoboFile extends \Robo\Tasks {
$this->_exec('./node_modules/webpack/bin/webpack.js --watch');
}
public function compileAll($opts = ['env' => null, 'skip-tests' => false]) {
public function compileAll($opts = ['env' => null, 'skip-tests' => false, 'only-tests' => false]) {
$collection = $this->collectionBuilder();
$collection->addCode(function() use ($opts) {
return call_user_func([$this, 'compileJs'], $opts);
@ -202,15 +198,17 @@ class RoboFile extends \Robo\Tasks {
return $collection->run();
}
public function compileJs($opts = ['env' => null, 'skip-tests' => false]) {
public function compileJs($opts = ['env' => null, 'skip-tests' => false, 'only-tests' => false]) {
if (!is_dir('assets/dist/js')) {
mkdir('assets/dist/js', 0777, true);
}
$this->_exec('rm -rf ' . __DIR__ . '/assets/dist/js/*');
if (!$opts['only-tests']) {
$this->_exec('rm -rf ' . __DIR__ . '/assets/dist/js/*');
}
$env = ($opts['env']) ?
sprintf('./node_modules/.bin/cross-env NODE_ENV="%s"', $opts['env']) :
null;
return $this->_exec($env . ' ./node_modules/webpack/bin/webpack.js --env BUILD_TESTS=' . ($opts['skip-tests'] ? 'skip' : 'build'));
return $this->_exec($env . ' ./node_modules/webpack/bin/webpack.js --env BUILD_TESTS=' . ($opts['skip-tests'] ? 'skip' : 'build') . '--env BUILD_ONLY_TESTS=' . ($opts['only-tests'] ? 'true' : 'false'));
}
public function compileCss($opts = ['env' => null]) {
@ -266,8 +264,6 @@ class RoboFile extends \Robo\Tasks {
'vendor',
'vendor-prefixed',
'RoboFile.php',
'.storybook',
'storybook-static',
]);
$headers = escapeshellarg(
@ -351,7 +347,7 @@ class RoboFile extends \Robo\Tasks {
return $this->_exec($command);
}
public function testIntegration(array $opts = ['file' => null, 'group' => null, 'skip-group' => null, 'xml' => false, 'multisite' => false, 'debug' => false, 'skip-deps' => false, 'skip-plugins' => false, 'disable-hpos' => false, 'enable-hpos-sync' => false, 'enable-hpos' => false, 'stop-on-fail' => false]) {
public function testIntegration(array $opts = ['file' => null, 'group' => null, 'skip-group' => null, 'xml' => false, 'multisite' => false, 'debug' => false, 'skip-deps' => false, 'skip-plugins' => false, 'disable-hpos' => false, 'enable-hpos-sync' => false, 'enable-hpos' => false, 'stop-on-fail' => false, 'wordpress-version' => null]) {
return $this->runTestsInContainer(array_merge($opts, ['test_type' => 'integration']));
}
@ -371,6 +367,7 @@ class RoboFile extends \Robo\Tasks {
$command = join(' ', [
'./node_modules/.bin/mocha',
'-r tests/javascript-newsletter-editor/mocha-test-helper.js',
'-r tests/javascript-newsletter-editor/mocha-chai.mjs',
'tests/javascript-newsletter-editor/testBundles/**/*.js',
'--exit',
]);
@ -387,7 +384,7 @@ class RoboFile extends \Robo\Tasks {
}
public function testJavascript($xmlOutputFile = null) {
$command = './node_modules/.bin/mocha --recursive --require tests/javascript/babel-register.js tests/javascript --extension spec.js --extension spec.ts';
$command = './node_modules/.bin/mocha --recursive --require tests/javascript/mocha-env.mjs tests/javascript --extension spec.ts';
if (!empty($xmlOutputFile)) {
$command .= sprintf(
@ -407,7 +404,7 @@ class RoboFile extends \Robo\Tasks {
return $this->testIntegration($opts);
}
public function testAcceptance($opts = ['file' => null, 'skip-deps' => false, 'group' => null, 'timeout' => null, 'disable-hpos' => false, 'enable-hpos-sync' => false, 'enable-hpos' => false]) {
public function testAcceptance($opts = ['file' => null, 'skip-deps' => false, 'group' => null, 'timeout' => null, 'disable-hpos' => false, 'enable-hpos-sync' => false, 'enable-hpos' => false, 'wordpress-version' => null]) {
return $this->runTestsInContainer($opts);
}
@ -498,7 +495,7 @@ class RoboFile extends \Robo\Tasks {
public function deleteDocker() {
return $this->taskExec(
'docker-compose down -v --remove-orphans --rmi all'
)->dir(__DIR__ . '/tests/docker')->run();
)->dir(__DIR__ . '/../tests_env/docker')->run();
}
/**
@ -508,7 +505,7 @@ class RoboFile extends \Robo\Tasks {
return $this
->taskExec(
'docker-compose down -v --remove-orphans'
)->dir(__DIR__ . '/tests/docker')
)->dir(__DIR__ . '/../tests_env/docker')
->addCode([$this, 'cleanupCachedFiles'])
->run();
}
@ -653,7 +650,7 @@ class RoboFile extends \Robo\Tasks {
'lib/',
'lib-3rd-party/',
'vendor/composer',
'vendor/mtdowling',
'vendor/dragonmantank',
'vendor-prefixed/',
'vendor-prefixed/soundasleep',
'mailpoet.php',
@ -669,7 +666,7 @@ class RoboFile extends \Robo\Tasks {
'vendor-prefixed/cerdic/css-tidy/COPYING',
'vendor-prefixed/cerdic/css-tidy/NEWS',
'vendor-prefixed/cerdic/css-tidy/testing',
'vendor/mtdowling/cron-expression/tests',
'vendor/dragonmantank/cron-expression/tests',
'vendor/phpmailer/phpmailer/test',
'vendor-prefixed/psr/log/Psr/Log/Test',
'vendor-prefixed/sabberworm/php-css-parser/tests',
@ -855,14 +852,6 @@ class RoboFile extends \Robo\Tasks {
return $this->_exec('./tools/semgrep.sh lib/ lib-3rd-party/');
}
public function storybookBuild() {
return $this->_exec('pnpm run build-storybook');
}
public function storybookWatch() {
return $this->_exec('pnpm run storybook');
}
public function svnCheckout() {
$svnDir = ".mp_svn";
@ -1139,6 +1128,9 @@ class RoboFile extends \Robo\Tasks {
->addCode(function () {
return $this->releaseDownloadZip();
})
->addCode(function () use ($version) {
return $this->releaseVerifyDownloadedZip($version);
})
->addCode(function () {
return $this->translationsGetPotFileFromBuild();
})
@ -1163,6 +1155,9 @@ class RoboFile extends \Robo\Tasks {
->addCode(function () {
return $this->releaseMergePullRequest(\MailPoetTasks\Release\GitHubController::RELEASE_SOURCE_BRANCH);
})
->addCode(function () {
return $this->releaseDeleteDownloadedZip();
})
->run();
}
@ -1321,6 +1316,29 @@ class RoboFile extends \Robo\Tasks {
$this->say("IMPORTANT NOTES \n" . ($outputs[2] ?: 'none'));
}
public function releaseVerifyDownloadedZip($version) {
$this->say('Verifying ZIP file');
$zip = new ZipArchive();
$versionFound = false;
if ($zip->open(self::ZIP_BUILD_PATH) === true) {
$fileContent = $zip->getFromName('mailpoet/readme.txt');
if ($fileContent !== false) {
$versionFound = strpos($fileContent, 'Stable tag: ' . $version);
}
$zip->close();
} else {
$this->yell('ZIP file could not be opened!', 40, 'red');
exit(1);
}
if (!$versionFound) {
$this->yell('ZIP file does not contain required version: "' . $version . '" in readme.txt! ', 40, 'red');
exit(1);
}
$this->say('ZIP file contains required version: "' . $version . '" in readme.txt.');
}
public function releaseDownloadZip() {
$circleciController = $this->createCircleCiController();
$path = $circleciController->downloadLatestBuild(self::ZIP_BUILD_PATH);
@ -1328,6 +1346,12 @@ class RoboFile extends \Robo\Tasks {
$this->say(sprintf('Release ZIP file size: %.2F MB', filesize($path) / pow(1024, 2)));
}
public function releaseDeleteDownloadedZip() {
$this->say('Delete downloaded ZIP: ' . self::ZIP_BUILD_PATH);
$this->taskExec('rm -f ' . self::ZIP_BUILD_PATH)->run();
$this->say('ZIP file was deleted');
}
public function releasePublishGithub($version = null) {
$jiraController = $this->createJiraController();
$version = $jiraController->getVersion($version);
@ -1626,7 +1650,7 @@ class RoboFile extends \Robo\Tasks {
$configuration = (new \MailPoet\Doctrine\ConfigurationFactory($annotationReaderProvider, true))->createConfiguration();
$platformClass = \MailPoet\Doctrine\ConnectionFactory::PLATFORM_CLASS;
return \MailPoetVendor\Doctrine\ORM\EntityManager::create([
'driver' => \MailPoet\Doctrine\ConnectionFactory::DRIVER,
'driverClass' => \MailPoet\Doctrine\ConnectionFactory::DRIVER_CLASS,
'platform' => new $platformClass,
], $configuration);
}
@ -1636,6 +1660,7 @@ class RoboFile extends \Robo\Tasks {
$this->doctrineGenerateCache();
return $this->taskExec(
'COMPOSE_HTTP_TIMEOUT=200 docker-compose run ' .
(isset($opts['wordpress-version']) && $opts['wordpress-version'] ? '-e WORDPRESS_VERSION=' . $opts['wordpress-version'] . ' ' : '') .
(isset($opts['skip-deps']) && $opts['skip-deps'] ? '-e SKIP_DEPS=1 ' : '') .
(isset($opts['disable-hpos']) && $opts['disable-hpos'] ? '-e DISABLE_HPOS=1 ' : '') .
(isset($opts['enable-hpos-sync']) && $opts['enable-hpos-sync'] ? '-e ENABLE_HPOS_SYNC=1 ' : '') .
@ -1649,7 +1674,7 @@ class RoboFile extends \Robo\Tasks {
(isset($opts['skip-group']) && $opts['skip-group'] ? '--skip-group ' . $opts['skip-group'] . ' ' : '') .
(isset($opts['stop-on-fail']) && $opts['stop-on-fail'] ? '-f ' : '') .
(isset($opts['file']) && $opts['file'] ? $opts['file'] : '')
)->dir(__DIR__ . '/tests/docker')->run();
)->dir(__DIR__ . '/../tests_env/docker')->run();
}
private function getParallelism(int $multiplier = 1, int $min = 4, int $max = 32): int {

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,4 +1,4 @@
@import 'colors';
@import '../components-automation/colors';
.mailpoet-automation-analytics-title {
color: $color-gutenberg-grey-700;
@ -12,7 +12,7 @@
color: $color-gutenberg-grey-900;
}
.mailpoet-analytics-badge {
.mailpoet-automation-status {
display: inline-block;
margin-left: 8px;
}

View File

@ -1,4 +1,4 @@
@import './colors';
@import '../components-automation/colors';
.mailpoet-automation-analytics-overview {
background: $color-white;

View File

@ -1,4 +1,4 @@
@import '../colors';
@import '../../components-automation/colors';
.mailpoet-automation-editor-stats-placeholder {
.mailpoet-automation-stats-label {
@ -20,8 +20,8 @@
.mailpoet-automation-editor-step-icon {
background: $color-gutenberg-grey-100;
border-radius: 50%;
height: 49px;
width: 49px;
height: 48px;
width: 48px;
}
.mailpoet-automation-editor-step-title {

View File

@ -1,5 +1,4 @@
@import '../colors';
@import 'mixins';
@import '../../components-automation/colors';
.mailpoet-analytics-main-value {
font-size: 13px;
@ -8,14 +7,6 @@
margin: 0 0 4px;
}
.mailpoet-analytics-badge {
font-weight: 600;
}
.mailpoet-analytics-badge-text {
@include badge;
}
.mailpoet-automation-analytics-email-name {
max-width: 300px;
}
@ -24,24 +15,6 @@
font-weight: 600;
}
.mailpoet-analytics-badge-success {
color: $color-gutenberg-alert-green;
.mailpoet-analytics-badge-text {
background: $color-wp-green-0;
color: $color-wp-green-60;
}
}
.mailpoet-analytics-badge-warning {
color: $color-wp-yellow-50;
.mailpoet-analytics-badge-text {
background: $color-wp-yellow-0;
color: $color-wp-yellow-60;
}
}
.mailpoet-automation-analytics-table-subvalue {
color: $color-gutenberg-grey-600;
font-size: 12px;

View File

@ -1,4 +1,4 @@
@import '../colors';
@import '../../components-automation/colors';
.mailpoet-analytics-tabs {
background: $color-white;

View File

@ -1,4 +1,3 @@
@import 'mixins';
@import 'general';
@import 'email';
@import 'orders';

View File

@ -1,12 +0,0 @@
@import '../colors';
@mixin badge {
background: $color-grey;
border-radius: 2px;
font-size: 11px;
font-weight: 400;
line-height: 16px;
margin-right: 4px;
padding: 4px 8px;
white-space: nowrap;
}

View File

@ -1,5 +1,4 @@
@import '../colors';
@import 'mixins';
@import '../../components-automation/colors';
.mailpoet-analytics-tab-orders,
.mailpoet-analytics-tab-subscribers {
@ -15,6 +14,7 @@
}
}
.mailpoet-analytics-activity-modal,
.mailpoet-automation-analytics .woocommerce-table__item {
a.mailpoet-analytics-orders__customer {
align-items: flex-start;
@ -26,7 +26,9 @@
border-radius: 50%;
}
}
}
.mailpoet-automation-analytics .woocommerce-table__item {
.mailpoet-automations-analytics-order-products {
align-items: center;
column-gap: 8px;
@ -56,26 +58,6 @@
}
}
.mailpoet-analytics-order-status {
@include badge;
}
.mailpoet-analytics-order-status-completed,
.mailpoet-analytics-order-status-processing {
background: $color-wp-green-0;
color: $color-wp-green-60;
}
.mailpoet-analytics-order-status-failed {
background: $color-wp-red-0;
color: $color-wp-red-60;
}
.mailpoet-analytics-order-status-on-hold {
background: $color-wp-yellow-0;
color: $color-wp-yellow-60;
}
.mailpoet-analytics-upgrade-banner {
margin: 24px;

View File

@ -1,4 +1,4 @@
@import '../colors';
@import '../../components-automation/colors';
.mailpoet-analytics-clear-filters {
margin-right: 8px;
@ -26,7 +26,7 @@
grid-template-columns: 20px 1fr;
.mailpoet-automation-colored-icon {
padding: 4px;
padding: 2px;
}
p {
@ -39,3 +39,55 @@
grid-column-start: 2;
}
}
.mailpoet-analytics-activity-modal-spinner {
text-align: center;
}
.mailpoet-analytics-activity-modal {
min-width: 500px;
.components-modal__header-heading {
margin-right: 10px;
}
}
.mailpoet-analytics-activity-modal-table {
margin-top: 50px;
}
.mailpoet-analytics-activity-modal-header {
background: $color-white;
.components-modal__header-heading,
.mailpoet-analytics-orders__customer {
font-size: 1.2rem;
height: 20px;
}
}
.mailpoet-analytics-activity-modal-header-spacer {
flex-grow: 1;
}
.mailpoet-analytics-activity-modal-footer {
align-items: center;
color: $color-gutenberg-grey-700;
display: flex;
font-size: 13px;
font-weight: 600;
justify-content: center;
padding-top: 24px;
svg {
margin-right: 10px;
}
}
.mailpoet-analytics-activity-modal-status-info {
max-width: 220px;
&:not(:empty) {
margin-top: 8px;
}
}

View File

@ -9,6 +9,11 @@
.mailpoet-automation-editor-automation-wrapper {
padding: 0 20px 50px;
// Fix for action selector popup on small devices
.components-popover__content {
min-width: 280px;
}
}
.mailpoet-automation-editor-automation-flow {

View File

@ -1,12 +1,15 @@
// See: https://github.com/WordPress/gutenberg/blob/af7da80dd54d7fe52772890e2cc1b65073db9655/packages/block-editor/src/components/block-icon/style.scss
.block-editor-block-icon {
.block-editor-block-icon,
.block-editor-block-icon > div {
align-items: center;
display: flex;
height: 24px;
justify-content: center;
width: 24px;
}
.block-editor-block-icon {
&.has-colors {
svg {
fill: currentColor;
@ -26,9 +29,10 @@
// indicated size.
// See: https://github.com/WordPress/gutenberg/pull/9828
svg {
max-height: 24px;
max-width: 24px;
min-height: 20px;
min-width: 20px;
margin: -4px;
max-height: 32px;
max-width: 32px;
min-height: 26px;
min-width: 26px;
}
}

View File

@ -81,6 +81,13 @@
box-sizing: content-box;
display: flex;
justify-content: center;
padding: 12px;
padding: 8px;
position: relative;
> div {
display: flex;
height: 100%;
justify-content: center;
width: 100%;
}
}

View File

@ -0,0 +1,28 @@
@import 'colors';
.mailpoet-automation-status {
background: $color-gutenberg-grey-100;
border-radius: 2px;
color: $color-gutenberg-grey-800;
font-size: 11px;
font-weight: 400;
line-height: 16px;
margin-right: 4px;
padding: 4px 8px;
white-space: nowrap;
}
.mailpoet-automation-status-success {
background: $color-wp-green-0;
color: $color-wp-green-60;
}
.mailpoet-automation-status-warning {
background: $color-wp-yellow-0;
color: $color-wp-yellow-60;
}
.mailpoet-automation-status-error {
background: $color-wp-red-0;
color: $color-wp-red-60;
}

View File

@ -30,8 +30,6 @@
.tox {
/* Small style changes to better fit TinyMCE to our editor */
&.tox-tinymce-inline {
border: 1px solid $color-editor-border-content;
border-radius: 3px;
box-shadow: 0 0 3px 1px rgba(0, 0, 0, 0.05);
/* Fix for fixed TinyMCE toolbar to be above WP menu */
@ -52,6 +50,11 @@
}
}
/* Override white button color when not selected or manipulated to let them match the background */
.tox-tbtn:not(.tox-tbtn--enabled):not(:hover):not(:active) {
background: transparent;
}
/* Slightly smaller TinyMCE button */
.tox-tbtn:not(.tox-tbtn--select) {
height: 28px;

View File

@ -23,8 +23,7 @@
height: 100%;
left: 0;
margin: 0 !important;
overflow-x: hidden;
overflow-y: auto;
overflow: hidden auto;
position: fixed;
top: 0;
width: 100%;

View File

@ -155,3 +155,8 @@
.mailpoet_popup .mailpoet_browser_preview_toggle {
top: -30px;
}
.mailpoet_newsletter_styles label {
display: block;
margin-bottom: $grid-gap-half;
}

View File

@ -40,8 +40,7 @@
.mailpoet_post_scroll_container {
max-height: 400px;
overflow-x: hidden;
overflow-y: scroll;
overflow: hidden scroll;
}
.mailpoet_settings_posts_single_post {

View File

@ -40,8 +40,7 @@
.mailpoet_product_scroll_container {
max-height: 400px;
overflow-x: hidden;
overflow-y: scroll;
overflow: hidden scroll;
}
.mailpoet_settings_products_single_product {

View File

@ -47,7 +47,7 @@
background: $color-white;
border: 1px solid $color-editor-border-content;
margin-bottom: 9px;
padding: 28px 9px (18px - 10px) 9px;
padding: 28px 9px (18px - 10px);
position: relative;
}

View File

@ -12,12 +12,6 @@
}
}
// Fix for settings toolbar placement in header
.edit-post-header {
flex-direction: row-reverse;
justify-content: space-between;
}
// Fix for default appender appearance
// We don't use any default block (WP Post editor has paragraph)
// and CSS distributed within packages is works only with the paragraph block
@ -132,6 +126,7 @@ h2 {
.edit-post-visual-editor {
background-color: $color-white;
height: 100%; // This is needed to catch all clicks to deselect a block
padding: 50px 10px 100px;
}
@ -140,22 +135,19 @@ h2 {
padding: 10px;
}
// Close button animation
.edit-post-header-toolbar.edit-post-header-toolbar__left
> .edit-post-header-toolbar__inserter-toggle {
svg {
transition: transform cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s;
}
&.is-pressed svg {
transform: rotate(45deg);
}
}
// Hide block selector header with close button on desktops
@include respond-to(not-small-screen) {
.edit-post-editor__inserter-panel-header {
.editor-inserter-sidebar__header {
display: none;
}
}
// We don't have any patterns so we don't want to display tabs in the inserter panel
.block-editor-inserter__tablist-and-close-button {
display: none !important;
}
// Scrollable inserter sidebar panel
.block-editor-inserter__tabs .block-editor-inserter__block-list {
overflow-y: auto;
}

View File

@ -1,15 +1,8 @@
.form-placement-option-list {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-around;
margin: 0 -8px;
}
.form-placement-option {
height: $form-placement-option-height;
display: grid;
grid-gap: $grid-gap;
grid-template-columns: 1fr 1fr;
text-align: center;
width: $form-placement-option-width;
}
.form-placement-settings {

View File

@ -1,9 +1,33 @@
// Fix for settings toolbar placement in header
.edit-post-header {
flex-direction: row-reverse;
justify-content: space-between;
}
// Header buttons spacing
.mailpoet-editor-header-button {
padding-left: 8px;
padding-right: 8px;
@media (min-width: 600px) {
margin-right: 12px;
padding: 0 12px;
}
}
// Close button animation
.editor-document-tools__left > .edit-post-header-toolbar__inserter-toggle {
svg {
transition: transform cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s;
}
&.edit-post-header-toolbar__inserter-toggle.is-pressed svg {
transform: rotate(45deg);
}
}
// Hide preview button on mobile
@include respond-to(small-screen) {
.mailpoet-preview-button {
display: none;
}
}

View File

@ -7,7 +7,6 @@
display: flex;
flex-direction: column;
justify-content: space-between;
margin-bottom: 16px;
padding: 6px;
pointer-events: auto;
position: relative;

View File

@ -124,8 +124,12 @@
padding-left: 16px;
}
}
// This style hides the horizontal scrollbar in Firefox browser
// This style hides the horizontal scrollbar in Firefox browser and add space for the support beacon
.interface-interface-skeleton__sidebar {
overflow-x: hidden;
padding-bottom: 100px;
div[role='tabpanel'] {
padding-bottom: 100px;
}
}

View File

@ -24,8 +24,8 @@ $task-icon-size: 32px;
display: flex;
flex-direction: column;
font-size: 14px;
justify-content: center;
line-height: 20px;
place-content: center;
p {
color: $color-text-light;

View File

@ -67,6 +67,8 @@ p.sender_email_address_warning:first-child {
.mailpoet-subscribers-in-plan {
font-size: 18px;
margin-bottom: 20px;
position: relative;
z-index: 1;
.mailpoet-subscribers-in-plan-spacer {
display: inline-block;
@ -90,27 +92,140 @@ p.sender_email_address_warning:first-child {
}
}
.mailpoet_manage_sender_domain_wrapper {
ol {
counter-reset: item;
li {
counter-increment: item;
list-style: none;
margin: 24px 0 0 16px;
position: relative;
}
li:before {
align-items: center;
border: 1px solid #007cba;
border-radius: 99999px;
color: #007cba;
content: counter(item);
display: inline-flex;
height: 24px;
justify-content: center;
margin-left: -44px;
margin-right: 16px;
position: absolute;
width: 24px;
}
}
.mailpoet_manage_sender_domain_step_header {
padding: 2px 0 16px;
}
}
.mailpoet_manage_sender_domain {
th,
td {
padding-left: 16px;
}
.mailpoet_table_header {
font-weight: 700 !important;
text-align: center !important; // to prevent being overwritten by widefat table classes
}
.dns_record_type_column {
font-weight: 550 !important;
text-align: center !important; // to prevent being overwritten by widefat table classes
padding: 16px;
width: 70px;
}
.mailpoet-form-input {
border: 1px solid #757575;
border-radius: 2px;
width: 100%;
}
}
.mailpoet_manage_sender_domain_actions {
margin-top: 16px;
.mailpoet_manage_sender_domain_status {
align-items: center;
border-radius: 2px;
display: inline-flex;
font-size: 12px;
font-weight: normal;
gap: 4px;
margin-left: 8px;
padding: 4px 6px;
&.mailpoet_manage_sender_domain_status_valid {
background: #edfaef;
color: #005c12;
}
&.mailpoet_manage_sender_domain_status_invalid {
background: #fcf0f1;
color: #8a2424;
}
&.mailpoet_manage_sender_domain_status_pending {
background: #f0f0f0;
color: #757575;
}
}
.mailpoet_manage_sender_domain_error {
background: #fcf0f1;
display: grid;
gap: 16px;
grid-template-columns: auto 1fr;
margin-bottom: 8px;
padding: 12px 16px;
svg {
color: #8a2424;
height: 24px;
margin-top: -2px;
width: 24px;
}
}
.mailpoet_manage_sender_domain_item_error {
display: grid;
gap: 4px;
grid-template-columns: auto 1fr;
margin-top: 8px;
svg {
color: #cc1818;
height: 18px;
margin-top: 1px;
width: 18px;
}
strong {
overflow-wrap: anywhere;
}
ins {
background: #22918b;
color: #fff;
text-decoration: none;
}
del {
background: #fae8e8;
color: #cc1818;
text-decoration: none;
}
}
body .components-modal__screen-overlay {
z-index: 9999999; // increased to overlay Gutenberg block inserter
}
.mailpoet-premium-modal.components-modal__frame {
.mailpoet-help-modal.components-modal__frame,
.mailpoet-premium-modal.components-modal__frame,
.mailpoet-welcome-wizard-confirmation-modal.components-modal__frame {
max-width: 500px;
}

View File

@ -1,4 +1,4 @@
@import '../components-automation-analytics/colors';
@import '../components-automation/colors';
.mailpoet-inline-notice {
color: $color-gutenberg-grey-900;

View File

@ -10,8 +10,7 @@ body.mailpoet_modal_opened {
height: 100%;
justify-content: center;
left: 0;
overflow-x: hidden;
overflow-y: auto;
overflow: hidden auto;
padding: $legacy-modal-popup-margin;
position: fixed;
top: 0;
@ -114,8 +113,7 @@ body.mailpoet_modal_opened {
border: 1px solid #e1e1e1;
border-top: 0 none;
height: 100%;
overflow-x: hidden;
overflow-y: auto;
overflow: hidden auto;
top: 0;
width: 100%;
z-index: 0;

View File

@ -1,7 +1,17 @@
.mailpoet-logs-full-message {
.mailpoet-logs-message {
font-size: 12px;
height: 120px;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.mailpoet-logs-message-full {
white-space: normal;
}
.mailpoet-logs-min-width {
white-space: nowrap;
width: 1px;
}
.mailpoet-logs {

View File

@ -1,4 +1,4 @@
@import '../components-automation-analytics/colors';
@import '../components-automation/colors';
$mp-toggle-border-radius: 0.125rem;
$mp-toggle-transition: cubic-bezier(0, 1, 0.5, 1);

View File

@ -49,7 +49,7 @@
justify-content: center;
h5 {
margin: 0 0 $grid-gap-half 0;
margin: 0 0 $grid-gap-half;
text-align: center;
width: 100%;
}

View File

@ -46,9 +46,8 @@
}
.mailpoet-newsletter-type-action {
align-self: flex-end;
justify-self: flex-end;
margin-top: $grid-gap-medium;
place-self: flex-end flex-end;
.mailpoet-dropdown-button-group {
display: inline-flex;
}

View File

@ -1,4 +1,4 @@
@import '../components-automation-analytics/colors';
@import '../components-automation/colors';
.mailpoet-tiers-page-hero-section {
align-items: center;

View File

@ -1,4 +1,4 @@
@import '../components-automation-analytics/colors';
@import '../components-automation/colors';
.mailpoet-tiers-page {
margin: 0 auto;

View File

@ -20,6 +20,10 @@
font-size: $font-size;
left: -1px;
width: $grid-column;
* {
box-sizing: border-box;
}
}
.react-datepicker-wrapper,
@ -49,7 +53,7 @@
.react-datepicker__current-month {
color: $color-tertiary;
font-size: $heading-font-size-h3;
height: 40px;
height: 40px + $grid-gap * 2;
line-height: 40px;
padding: $grid-gap 0;
}
@ -74,11 +78,11 @@
color: $color-tertiary;
display: inline-block;
font-weight: bold;
height: 48px;
height: 50px;
line-height: 48px;
margin: 0 -1px -1px 0;
text-align: center;
width: 49px;
width: 51px;
}
.react-datepicker__day:hover {

View File

@ -132,9 +132,30 @@
z-index: $modal-screen-overlay-z-index + 4; // overlay other modals
}
.authorize-sender-domain-modal {
p {
max-width: 1005px;
padding-right: 48px;
.has-authorize-sender-domain-modal {
overflow: hidden;
.components-modal__screen-overlay {
overflow: auto;
padding: 24px;
}
.components-modal__frame {
max-height: none;
}
.authorize-sender-domain-modal {
max-width: 1200px;
.mailpoet_manage_sender_domain_spinner {
display: flex;
height: 64px;
margin: 24px auto;
width: 64px;
}
}
.components-tooltip {
z-index: 99999999; // make tooltip visible within modals
}
}

View File

@ -1,7 +1,12 @@
.mailpoet-tooltip {
background-color: #fafbfe;
border-color: #e5e9f8;
border-radius: 4px;
border-style: solid;
border-width: 1px;
box-shadow: 0 2px 4px 0 rgba(229, 233, 248, 0.4),
0 5px 30px 0 $color-tertiary-light;
color: #1d2327;
max-width: 400px;
padding: $grid-gap-half;
z-index: 9990; // Allow tooltip to display over #adminmenuwrap (lefthand menu) core style

View File

@ -81,7 +81,6 @@
input,
select {
font-size: $font-size-small;
line-height: $form-control-line-height-small;
}
svg {

View File

@ -110,3 +110,10 @@ span.mailpoet-gap-half {
height: 6px;
width: 8px;
}
.mailpoet-is-dragging {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}

View File

@ -1,7 +1,7 @@
// dependencies
@import '../../../node_modules/@woocommerce/components/build-style/style';
@import '../../../node_modules/react-dates/lib/css/_datepicker.scss';
@import '../../../node_modules/react-dates/lib/css/_datepicker';
// settings & mixins
@ -11,6 +11,7 @@
// automation editor styles
@import './components-automation/badges';
@import './components-automation/statistics';
@import './components-automation-editor/editor';

View File

@ -1,10 +1,12 @@
@import '../../../node_modules/@wordpress/interface/build-style/style';
@import '../../../node_modules/@wordpress/edit-site/build-style/style';
@import '../../../node_modules/@wordpress/editor/build-style/style';
@import '../../../node_modules/@wordpress/block-editor/build-style/style'; // for inserter styles
@import 'settings/colors';
// automation components
@import './components-automation/badges';
@import './components-automation/statistics';
// automation editor

Some files were not shown because too many files have changed in this diff Show More