Compare commits

..

1 Commits

Author SHA1 Message Date
6dbcdd5638 Release 3.101.0 2022-10-17 14:57:59 +02:00
2625 changed files with 36137 additions and 87541 deletions

View File

@ -71,6 +71,13 @@ anchors:
- trunk
- release
only_trunk_and_cot: &only_trunk_and_cot
filters:
branches:
only:
- trunk
- /^cot-.*/
multisite_acceptance_config: &multisite_acceptance_config
multisite: 1
requires:
@ -78,16 +85,11 @@ anchors:
- static_analysis_php8
<<: *only_trunk_and_release
command_add_github_key: &command_add_github_key
command: |
# Add GitHub to known_hosts (for jobs without a checkout step that need to clone repos)
echo "github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=" >> ~/.ssh/known_hosts
executors:
wpcli_php_oldest:
<<: *default_job_config
docker:
- image: mailpoet/wordpress:7.3_20230518.1
- image: mailpoet/wordpress:7.2_20220309.1
wpcli_php_max_wporg:
<<: *default_job_config
@ -97,18 +99,18 @@ executors:
wpcli_php_latest:
<<: *default_job_config
docker:
- image: mailpoet/wordpress:8.1_20230307.1
- image: mailpoet/wordpress:8.1_20220718.1
wpcli_php_mysql_oldest:
<<: *default_job_config
docker:
- image: mailpoet/wordpress:7.3_20230518.1
- image: mailpoet/wordpress:7.2_20220309.1
- image: cimg/mysql:5.7
wpcli_php_mysql_latest:
<<: *default_job_config
docker:
- image: mailpoet/wordpress:8.1_20230307.1
- image: mailpoet/wordpress:8.1_20220718.1
- image: cimg/mysql:8.0
command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_520_ci
@ -184,11 +186,10 @@ jobs:
- run:
name: Download additional WP Plugins for tests
command: |
./do download:woo-commerce-zip latest
./do download:woo-commerce-subscriptions-zip 4.9.1
./do download:woo-commerce-memberships-zip 1.24.0
./do download:woo-commerce-blocks-zip 9.6.2
./do download:automate-woo-zip 5.6.8
./do download:woo-commerce-zip 6.8.2
./do download:woo-commerce-subscriptions-zip 4.5.1
./do download:woo-commerce-memberships-zip 1.23.0
./do download:woo-commerce-blocks-zip 8.4.0
- run:
name: Dump tests ENV variables for acceptance tests
command: |
@ -206,12 +207,11 @@ jobs:
- attach_workspace:
at: /home/circleci
- add_ssh_keys
- run:
name: 'Add GitHub to known_hosts'
<<: *command_add_github_key
- run:
name: 'Install Premium plugin'
command: |
# Add GitHub to known_hosts because there is no checkout step in this job
echo "github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==" >> ~/.ssh/known_hosts
git clone ${MAILPOET_PREMIUM_REPO_URL} mailpoet-premium
- restore_cache:
key: premium-tools-{{ checksum "mailpoet-premium/tools/install.php" }}
@ -256,26 +256,6 @@ jobs:
- run:
name: 'Static analysis'
command: ./do qa:phpstan --php-version=<< parameters.php_version >>
security_analysis:
working_directory: /home/circleci/mailpoet/mailpoet
machine:
image: ubuntu-2204:2022.10.2
docker_layer_caching: false
steps:
- attach_workspace:
at: /home/circleci
- add_ssh_keys
- run:
name: 'Add GitHub to known_hosts'
<<: *command_add_github_key
- run:
name: 'Set up PHP'
command: |
sudo apt update
sudo apt install -y php8.1-cli
- run:
name: 'QA Security'
command: ./do qa:semgrep
qa_js:
executor: wpcli_php_latest
working_directory: /home/circleci/mailpoet/mailpoet
@ -338,8 +318,7 @@ jobs:
parallelism: 20
working_directory: /home/circleci/mailpoet/mailpoet
machine:
image: ubuntu-2204:2022.10.2
docker_layer_caching: false
image: ubuntu-2204:2022.07.1
parameters:
multisite:
type: integer
@ -350,7 +329,7 @@ jobs:
mysql_command:
type: string
default: ''
mysql_image:
mysql_image_version:
type: string
default: ''
codeception_image_version:
@ -371,18 +350,18 @@ jobs:
woo_blocks_version:
type: string
default: ''
automate_woo_version:
type: string
default: ''
enable_cot:
type: integer
default: 0
enable_cot_sync:
type: integer
default: 0
allow_fail:
type: integer
default: 0
environment:
MYSQL_COMMAND: << parameters.mysql_command >>
MYSQL_IMAGE: << parameters.mysql_image >>
MYSQL_IMAGE_VERSION: << parameters.mysql_image_version >>
CODECEPTION_IMAGE_VERSION: << parameters.codeception_image_version >>
WORDPRESS_IMAGE_VERSION: << parameters.wordpress_image_version >>
steps:
@ -395,18 +374,6 @@ jobs:
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
- 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
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
docker-compose run --rm -w /project -e COMPOSER_DEV_MODE=1 --entrypoint "php tools/install.php" codeception_acceptance
- when:
condition: << parameters.woo_core_version >>
steps:
@ -439,21 +406,11 @@ jobs:
command: |
cd tests/docker
docker-compose run --rm -w /project --entrypoint "./do download:woo-commerce-blocks-zip << parameters.woo_blocks_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 >>
steps:
- run:
name: Download AutomateWoo
command: |
cd tests/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
command: |
# Convert test result filename values to be relative paths because the circleci CLI's split command requires exact matches
if [ -e $CIRCLE_INTERNAL_TASK_DATA/circle-test-results/results.json ]; then
sed -i.bak 's#/wp-core/wp-content/plugins/mailpoet/##g' $CIRCLE_INTERNAL_TASK_DATA/circle-test-results/results.json
fi
sed -i.bak 's#/wp-core/wp-content/plugins/mailpoet/##g' $CIRCLE_INTERNAL_TASK_DATA/circle-test-results/results.json
# `circleci tests split` returns different values based on the container it's run on
# in case group is defined find only tests containing the group
if [[ -n '<< parameters.group >>' ]]; then
@ -475,6 +432,9 @@ jobs:
--xml
-g circleci_split_group
)
if [[ << parameters.allow_fail >> == 1 ]]; then
args+=(--no-exit)
fi
docker-compose run -e SKIP_DEPS=1 \
-e CIRCLE_BRANCH=${CIRCLE_BRANCH} \
-e CIRCLE_JOB=${CIRCLE_JOB} \
@ -482,78 +442,22 @@ jobs:
-e ENABLE_COT=<< parameters.enable_cot >> \
-e ENABLE_COT_SYNC=<< parameters.enable_cot_sync >> \
codeception_acceptance "${args[@]}"
- run:
name: Check exceptions
command: |
if [ "$(ls tests/_output/exceptions/*.html)" ]; then
echo "There were some exceptions during the tests run"
exit 1
fi
- when:
condition:
not:
equal: [1, << parameters.allow_fail >>]
steps:
- run:
name: Check exceptions
command: |
if [ "$(ls tests/_output/exceptions/*.html)" ]; then
echo "There were some exceptions during the tests run"
exit 1
fi
- store_artifacts:
path: tests/_output
- store_test_results:
path: tests/_output
performance_tests:
working_directory: /home/circleci/mailpoet/mailpoet
machine:
image: ubuntu-2204:2022.10.2
docker_layer_caching: false
parameters:
mysql_command:
type: string
default: ''
mysql_image:
type: string
default: ''
wordpress_image_version:
type: string
default: ''
url:
type: string
default: 'http://localhost:9500'
pw:
type: string
default: 'password'
scenario:
type: string
default: 'pullrequests'
steps:
- attach_workspace:
at: /home/circleci
- run:
name: 'Set up PHP'
command: |
sudo apt update
sudo apt install -y php8.1-cli
- run:
name: 'Pull test docker images'
# Pull docker images with 3 retries
command: i='0';while ! docker-compose -f tests/performance/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/performance
docker-compose create || docker-compose create
- run:
name: Run performance tests
command: |
mkdir -p tests/performance/_output
mkdir -p tests/performance/_screenshots
./do test:performance --url=<< parameters.url >> --pw=<< parameters.pw >> --scenario=<< parameters.scenario >>
- run:
name: Check exceptions
command: |
if [ "$(ls tests/performance/_output/exceptions/*.html)" ]; then
echo "There were some exceptions during the tests run"
exit 1
fi
- store_artifacts:
path: tests/performance/_output
- store_artifacts:
path: tests/performance/_screenshots
- store_test_results:
path: tests/performance/_output
unit_tests:
working_directory: /home/circleci/mailpoet/mailpoet
parameters:
@ -570,10 +474,6 @@ jobs:
- run:
name: 'Prepare example.com for testing'
command: echo 127.0.0.1 example.com | sudo tee -a /etc/hosts
- run:
# Some tools we use may need different version based on PHP version used in docker
name: Ensure correct versions of tools
command: COMPOSER_DEV_MODE=1 php tools/install.php
- run:
name: 'Set up test environment'
command: source ../.circleci/setup.bash && setup php7
@ -592,12 +492,9 @@ jobs:
integration_tests:
working_directory: /home/circleci/mailpoet/mailpoet
machine:
image: ubuntu-2204:2022.10.2
docker_layer_caching: false
image: ubuntu-2204:2022.07.1
environment:
CODECEPTION_IMAGE_VERSION: << parameters.codeception_image_version >>
MYSQL_COMMAND: << parameters.mysql_command >>
MYSQL_IMAGE: << parameters.mysql_image >>
parameters:
codeception_image_version:
type: string
@ -620,27 +517,12 @@ jobs:
multisite:
type: integer
default: 0
mysql_command:
type: string
default: ''
mysql_image:
type: string
default: ''
woo_core_version:
type: string
default: ''
woo_subscriptions_version:
type: string
default: ''
woo_memberships_version:
type: string
default: ''
woo_blocks_version:
type: string
default: ''
automate_woo_version:
type: string
default: ''
allow_fail:
type: integer
default: 0
steps:
- attach_workspace:
at: /home/circleci
@ -648,18 +530,6 @@ jobs:
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
- 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
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
docker-compose run --rm -w /project -e COMPOSER_DEV_MODE=1 --entrypoint "php tools/install.php" codeception_integration
- when:
condition: << parameters.woo_core_version >>
steps:
@ -667,39 +537,7 @@ jobs:
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
- when:
condition: << parameters.woo_subscriptions_version >>
steps:
- run:
name: Download WooCommerce Subscriptions
command: |
cd tests/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 >>
steps:
- run:
name: Download WooCommerce Memberships
command: |
cd tests/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.woo_blocks_version >>
steps:
- run:
name: Download WooCommerce Blocks
command: |
cd tests/docker
docker-compose run --rm -w /project --entrypoint "./do download:woo-commerce-blocks-zip << parameters.woo_blocks_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 >>
steps:
- run:
name: Download AutomateWoo
command: |
cd tests/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
docker-compose run --rm -w /project --entrypoint "./do download:woo-commerce-zip << parameters.woo_core_version >>" --no-deps codeception_integration
- run:
name: 'PHP Integration tests'
command: |
@ -718,6 +556,9 @@ jobs:
if [[ -n '<< parameters.skip_group >>' ]]; then
args+=(--skip-group << parameters.skip_group >>)
fi
if [[ << parameters.allow_fail >> == 1 ]]; then
args+=(--no-exit)
fi
docker-compose run -e SKIP_DEPS=1 \
-e CIRCLE_BRANCH=${CIRCLE_BRANCH} \
-e CIRCLE_JOB=${CIRCLE_JOB} \
@ -792,10 +633,6 @@ workflows:
php_version: 80000
requires:
- build
- security_analysis:
<<: *slack-fail-post-step
requires:
- build
- qa_js:
<<: *slack-fail-post-step
requires:
@ -814,7 +651,7 @@ workflows:
- build
- acceptance_tests:
<<: *slack-fail-post-step
name: acceptance_tests_base_and_woo_cot_off
name: acceptance_tests
requires:
- unit_tests
- static_analysis_php8
@ -822,10 +659,13 @@ workflows:
- qa_php
- acceptance_tests:
<<: *slack-fail-post-step
<<: *only_trunk_and_cot
name: acceptance_tests_woo_cot_sync
group: woo
enable_cot: 1
enable_cot_sync: 1
allow_fail: 1
woo_core_version: woo-cot-beta # Temporarily force COT beta version
requires:
- unit_tests
- static_analysis_php8
@ -833,18 +673,24 @@ workflows:
- qa_php
- acceptance_tests:
<<: *slack-fail-post-step
<<: *only_trunk_and_cot
name: acceptance_tests_woo_cot_no_sync
group: woo
enable_cot: 1
enable_cot_sync: 0
allow_fail: 1
woo_core_version: woo-cot-beta # Temporarily force COT beta version
requires:
- unit_tests
- static_analysis_php8
- qa_js
- qa_php
- performance_tests:
- acceptance_tests:
<<: *slack-fail-post-step
name: performance_tests
<<: *only_trunk_and_cot
name: acceptance_tests_woo_cot_off
group: woo
woo_core_version: woo-cot-beta # Temporarily force COT beta version
requires:
- unit_tests
- static_analysis_php8
@ -857,8 +703,20 @@ workflows:
- integration_tests:
<<: *slack-fail-post-step
group: woo
name: integration_test_woocommerce
requires:
- unit_tests
- static_analysis_php8
- qa_js
- qa_php
- integration_tests:
<<: *slack-fail-post-step
<<: *only_trunk_and_cot
group: woo
enable_cot: 1
enable_cot_sync: 1
allow_fail: 1
woo_core_version: woo-cot-beta # Temporarily force COT beta version
name: integration_test_woo_cot_sync
requires:
- unit_tests
@ -867,9 +725,12 @@ workflows:
- qa_php
- integration_tests:
<<: *slack-fail-post-step
<<: *only_trunk_and_cot
group: woo
enable_cot: 1
enable_cot_sync: 0
allow_fail: 1
woo_core_version: woo-cot-beta # Temporarily force COT beta version
name: integration_test_woo_cot_no_sync
requires:
- unit_tests
@ -878,7 +739,9 @@ workflows:
- qa_php
- integration_tests:
<<: *slack-fail-post-step
<<: *only_trunk_and_cot
group: woo
woo_core_version: woo-cot-beta # Temporarily force COT beta version
name: integration_test_woo_cot_off
requires:
- unit_tests
@ -914,15 +777,10 @@ workflows:
<<: *slack-fail-post-step
requires:
- build
- acceptance_tests_base_and_woo_cot_off
- acceptance_tests
- js_tests
- integration_test_woocommerce
- integration_test_base
- integration_test_woo_cot_no_sync
- integration_test_woo_cot_off
- integration_test_woo_cot_sync
- acceptance_tests_woo_cot_sync
- acceptance_tests_woo_cot_no_sync
- performance_tests
nightly:
triggers:
@ -942,29 +800,19 @@ workflows:
woo_subscriptions_version: latest
woo_memberships_version: latest
woo_blocks_version: latest
automate_woo_version: latest
requires:
- build
- acceptance_tests:
<<: *slack-fail-post-step
name: acceptance_oldest
woo_core_version: 7.6.0
woo_core_version: 6.2.2
woo_subscriptions_version: 4.3.0
woo_memberships_version: 1.21.0
woo_blocks_version: 6.8.0
automate_woo_version: 5.1.1
mysql_command: --max_allowed_packet=100M --default-storage-engine=MYISAM
mysql_image: mysql:5.5
codeception_image_version: 7.4-cli_20220605.0
wordpress_image_version: wp-6.0_php7.4_20230425.1
requires:
- build
- performance_tests:
<<: *slack-fail-post-step
name: performance_latest
url: https://mpperftesting.mystagingwebsite.com
pw: $WP_TEST_PERFORMANCE_PW
scenario: nightlytests
woo_blocks_version: 5.3.2
mysql_command: --max_allowed_packet=100M
mysql_image_version: 5.7.36
codeception_image_version: 7.4-cli_20210126.1
wordpress_image_version: wp-5.6_php7.2_20220406.1
requires:
- build
- unit_tests:
@ -986,14 +834,7 @@ workflows:
- integration_tests:
<<: *slack-fail-post-step
name: integration_oldest
woo_core_version: 7.6.0
woo_subscriptions_version: 4.3.0
woo_memberships_version: 1.21.0
woo_blocks_version: 6.8.0
automate_woo_version: 5.1.1
codeception_image_version: 7.3-cli_20230516.0
mysql_command: --max_allowed_packet=100M --default-storage-engine=MYISAM
mysql_image: mysql:5.5
codeception_image_version: 7.2-cli_20220605.0
requires:
- build
- build_premium:

View File

@ -1,23 +0,0 @@
import * as fs from 'fs/promises';
import * as os from 'os';
// Get logical CPU count for a container on CircleCI. Adapted from:
// https://circleci.canny.io/cloud-feature-requests/p/have-nproc-accurately-reporter-number-of-cpus-available-to-container
async function cgroupCpuCount() {
const quotaS = await fs.readFile('/sys/fs/cgroup/cpu/cpu.cfs_quota_us');
const periodS = await fs.readFile('/sys/fs/cgroup/cpu/cpu.cfs_period_us');
const quota = parseInt(quotaS);
const period = parseInt(periodS);
return quota / period;
}
async function cpuCount() {
try {
return await cgroupCpuCount();
} catch {
return os.cpus().length;
}
}
cpuCount().then(console.log);

View File

@ -21,9 +21,3 @@ _N/A_
## After-merge notes
_N/A_
## Tasks
- [ ] I followed [best practices](https://codex.wordpress.org/I18n_for_WordPress_Developers) for translations
- [ ] I added sufficient test coverage
- [ ] I embraced TypeScript by either creating new files in TypeScript or converting existing JavaScript files when making changes

View File

@ -1,18 +0,0 @@
name: Pull Request Stats
on:
pull_request:
types: [opened]
branches-ignore:
- 'dependabot/**'
jobs:
stats:
runs-on: ubuntu-latest
steps:
- name: Run pull request stats
uses: flowwer-dev/pull-request-stats@master
with:
period: 90
charts: true
sort-by: 'TIME'

3
.gitignore vendored
View File

@ -7,5 +7,4 @@ docker-compose.override.yml
node_modules
npm-debug.log
mailpoet-premium
tsconfig.tsbuildinfo
/wordpress
wordpress

2
.npmrc
View File

@ -1,2 +1,2 @@
auto-install-peers=false
save-workspace-protocol=rolling
strict-peer-dependencies=false

2
.nvmrc
View File

@ -1 +1 @@
v19.7.0
v17.9.1

View File

@ -1,22 +0,0 @@
function readPackage(pkg) {
// Resolve @wordpress/* dependencies of @woocommerce packages to those used by MailPoet.
// This avoids their duplication and downgrading due to @woocommerce pinning them to wp-6.0.
// This should be removed once we adopt similar pinning strategy and use dependency extraction.
// See: https://github.com/woocommerce/woocommerce/pull/37034
if (pkg.name?.startsWith('@woocommerce/')) {
pkg.dependencies = Object.fromEntries(
Object.entries(pkg.dependencies).map(([name, version]) =>
name.startsWith('@wordpress/') || name.startsWith('@types/wordpress__')
? [name, '*']
: [name, version],
),
);
}
return pkg;
}
module.exports = {
hooks: {
readPackage,
},
};

View File

@ -22,7 +22,6 @@ vendor-prefixed
/mailpoet/temp
/mailpoet/tests/javascript_newsletter_editor/testBundles
/mailpoet/tests/plugins
/mailpoet/tools/wpscan-semgrep-rules
/mailpoet/views
/mailpoet-premium
/wordpress

View File

@ -126,37 +126,25 @@ You can access this help in your command line running `./do` without parameters.
[Read the article.](https://mailpoet.atlassian.net/wiki/spaces/MAILPOET/pages/629374977/Adding+new+templates+to+the+plugin)
## 🚥 Testing with different PHP versions
## 🚥 Testing with PHP 7.4 or PHP 8.0
To switch the environment to a different PHP version:
To switch the environment to PHP 7.4/8.0:
1. Check https://github.com/mailpoet/mailpoet/tree/trunk/dev for a list of available PHP versions. Each directory starting with `php` corresponds to a available version.
2. Configure the `wordpress` service in `docker-compose.override.yml` to build from the desired PHP version Dockerfile (replace {PHP_VERSION} with the name of the directory that corresponds to the version that you want to use):
1. Configure the `wordpress` service in `docker-compose.override.yml` to build from the php74 Dockerfile:
```yaml
wordpress:
build:
context: .
dockerfile: dev/{PHP_VERSION}/Dockerfile
dockerfile: dev/php74/Dockerfile # OR dev/php80/Dockerfile
```
3. Run `docker-compose build wordpress`.
4. Start the stack with `./do start`.
2. Run `docker-compose build wordpress`.
3. Start the stack with `./do start`.
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,
To switch back to PHP 8.1 remove what was added in 1) 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
To disable the Tracy panel, add the following to `docker-compose.override.yml`:
```yaml
services:
wordpress:
environment:
MAILPOET_DISABLE_TRACY_PANEL: 1
```
## ✅ TODO
- install woo commerce, members and other useful plugins by default

View File

@ -1,8 +0,0 @@
export default {
presets: [
['@babel/preset-react', { runtime: 'automatic' }],
'@babel/preset-env',
'@babel/preset-typescript',
],
plugins: [['@babel/plugin-transform-runtime']],
};

View File

@ -10,7 +10,7 @@ RUN apt-get update \
&& pecl install xdebug-2.9.8 && \
\
# Install NodeJS, enable Corepack
curl -sL https://deb.nodesource.com/setup_19.x | bash - && \
curl -sL https://deb.nodesource.com/setup_17.x | bash - && \
apt-get install -y nodejs build-essential && \
corepack enable && \
\

View File

@ -8,7 +8,7 @@ RUN apt-get update \
&& apt-get install -y git zlib1g-dev libzip-dev zip wget gnupg msmtp libpng-dev gettext subversion \
&& \
# Install NodeJS, enable Corepack
curl -sL https://deb.nodesource.com/setup_19.x | bash - && \
curl -sL https://deb.nodesource.com/setup_17.x | bash - && \
apt-get install -y nodejs build-essential && \
corepack enable && \
\

View File

@ -8,7 +8,7 @@ RUN apt-get update \
&& apt-get install -y git zlib1g-dev libzip-dev zip wget gnupg msmtp libpng-dev gettext subversion \
&& \
# Install NodeJS, enable Corepack
curl -sL https://deb.nodesource.com/setup_19.x | bash - && \
curl -sL https://deb.nodesource.com/setup_17.x | bash - && \
apt-get install -y nodejs build-essential && \
corepack enable && \
\

View File

@ -1,46 +0,0 @@
FROM php:8.2.0RC6-apache
ARG UID=1000
ARG GID=1000
# additinal extensions
RUN apt-get update \
&& apt-get install -y git zlib1g-dev libzip-dev zip wget gnupg msmtp libpng-dev gettext subversion \
&& \
# Install NodeJS, enable Corepack
curl -sL https://deb.nodesource.com/setup_19.x | bash - && \
apt-get install -y nodejs build-essential && \
corepack enable && \
\
# Install WP-CLI
curl -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && \
chmod +x /usr/local/bin/wp && \
\
# Clean up
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY dev/php.ini /usr/local/etc/php/conf.d/php_user.ini
# msmtp config
RUN printf "account default\nhost smtp\nport 1025" > /etc/msmtprc
# xdebug build an config
ENV XDEBUGINI_PATH=/usr/local/etc/php/conf.d/xdebug.ini
RUN git clone -b "3.2.0RC2" --depth 1 https://github.com/xdebug/xdebug.git /usr/src/php/ext/xdebug \
&& docker-php-ext-configure xdebug --enable-xdebug-dev \
&& docker-php-ext-install xdebug \
&& mkdir /tmp/debug
COPY dev/xdebug.ini /tmp/xdebug.ini
RUN cat /tmp/xdebug.ini >> $XDEBUGINI_PATH
# php extensions
RUN docker-php-ext-install pdo_mysql
RUN docker-php-ext-install mysqli
# allow .htaccess files (between <Directory /var/www/> and </Directory>, which is WordPress installation)
RUN sed -i '/<Directory \/var\/www\/>/,/<\/Directory>/ s/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf
# ensure existing content in /var/www/html respects UID and GID, give Node permissions for Corepack
RUN chown -R ${UID}:${GID} /var/www/html && \
mkdir -p /.node && chown -R ${UID}:${GID} /.node

View File

@ -28,7 +28,6 @@ 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)
- [Add Subscriber Field (addSubscriberField)](api_methods/AddSubscriberField.md)
- [Delete List (deleteList)](api_methods/DeleteList.md)
- [Get Lists (getLists)](api_methods/GetLists.md)
- [Get Subscriber (getSubscriber)](api_methods/GetSubscriber.md)
- [Get Subscribers (getSubscribers)](api_methods/GetSubscribers.md)
@ -37,10 +36,8 @@ Class `\MailPoet\API\API` becomes available once MailPoet plugin is loaded by Wo
- [Is Setup Complete (isSetupComplete)](api_methods/IsSetupComplete.md)
- [Subscribe to List (subscribeToList)](api_methods/SubscribeToList.md)
- [Subscribe to Lists (subscribeToLists)](api_methods/SubscribeToLists.md)
- [Unsubscribe globally](api_methods/UnsubscribeGlobally.md)
- [Unsubscribe from List (unsubscribeFromList)](api_methods/UnsubscribeFromList.md)
- [Unsubscribe from Lists (unsubscribeFromLists)](api_methods/UnsubscribeFromLists.md)
- [Update List (updateList)](api_methods/UpdateList.md)
### Usage examples

View File

@ -1,27 +0,0 @@
[back to list](../Readme.md)
# Delete List
## `bool deleteList(string $list_id)`
This method provides functionality for deleting a list that is of the type 'default'.
It returns a boolean value.
## 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 |
| ---- | --------------------------------------------------------------- |
| 5 | List does not exist |
| 18 | List id is empty |
| 20 | List cannot be deleted because its used for an automatic email |
| 21 | List cannot be deleted because its used for a form |
| 22 | The list couldnt be deleted from the database |
| 23 | Only lists of the type 'default' can be deleted |

View File

@ -18,8 +18,8 @@ This method returns a list of subscribers. To see the subscriber data structure,
Filter argument supports following array keys.
| Key | Type | Description |
| ------------ | ------------ | ----------------------------------------------------------------------------------------------------------------- |
| status | string | Specific status of subscribers. One of values: `unconfirmed`, `subscribed`, `unsubscribed`, `bounced`, `inactive` |
| listId | int | List id or dynamic segment id |
| minUpdatedAt | DateTime\int | DateTime object or timestamp of the minimal last update of subscribers |
| Key | Type | Description |
| -------------- | ------------ | ----------------------------------------------------------------------------------------------------------------- |
| status | string | Specific status of subscribers. One of values: `unconfirmed`, `subscribed`, `unsubscribed`, `bounced`, `inactive` |
| list_id | int | List id or dynamic segment id |
| min_updated_at | DateTime\int | DateTime object or timestamp of the minimal last update of subscribers |

View File

@ -1,29 +0,0 @@
[back to list](../Readme.md)
# Unsubscribe from all lists and change subscriber status
## `array unsubscribe(string $subscriber_id)`
This method removes a subscriber from all lists and updates its status to 'unsubscribed'.
It returns a subscriber. See [Get Subscriber](GetSubscriber.md) for returned data structure.
## Arguments
### string `$subscriber_id` (required)
An id or email of an existing subscriber. An `\Exception` is thrown when an id or email doesn't match any subscriber.
## 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 | Invalid subscriber that does not exist |
| 24 | Subscriber already has 'unsubscribed' status |

View File

@ -1,39 +0,0 @@
[back to list](../Readme.md)
# Add Subscriber
## `array updateList(array $list)`
This method provides functionality for updating a list name or description. Only lists of type 'default' are supported.
It returns the updated list. See [Get Lists](GetLists.md) for a list data structure description.
## Arguments
### `$list` (required)
An associative array which contains list data.
| Property | Type | Limits | Description |
| ---------------------- | ------------ | --------- | -------------------------- |
| id (required) | string | 11 chars | A id of the list. |
| name (required) | string | 90 chars | A name of the list. |
| description (optional) | string\|null | 250 chars | A description of the list. |
## 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 |
| ---- | ----------------------------------------------- |
| 5 | The list was not found by id |
| 14 | Missing list name |
| 15 | Trying to use a list name that is already used |
| 18 | Missing list id |
| 19 | The list couldnt be updated in the database |
| 23 | Only lists of the type 'default' can be updated |

View File

@ -15,7 +15,6 @@ services:
volumes:
- my-datavolume:/var/lib/mysql
- ./dev/database/create_test_db.sh:/docker-entrypoint-initdb.d/10-create_test_db.sh
command: --sql_mode=STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,ANSI,ONLY_FULL_GROUP_BY
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
@ -47,7 +46,6 @@ services:
PHP_IDE_CONFIG: 'serverName=Mailpoet'
COMPOSER_HOME: '/tmp/.composer'
NPM_CONFIG_CACHE: '/tmp/.npm'
XDG_CACHE_HOME: '/tmp/.cache'
MAILPOET_DEV_SITE: 1
volumes:
- './wordpress:/var/www/html'

View File

@ -1,10 +1,11 @@
{
"presets": [
"@babel/preset-typescript",
["@babel/preset-react", { "runtime": "automatic" }],
"@babel/preset-env",
["@babel/preset-typescript", { "allowDeclareFields": true }]
"@babel/preset-env"
],
"plugins": [
"babel-plugin-typescript-to-proptypes",
[
"@babel/plugin-transform-runtime",
{

View File

@ -37,10 +37,3 @@ WP_GITHUB_TOKEN=
# Jira username/email and a token from https://id.atlassian.com/manage/api-tokens:
WP_JIRA_USER=
WP_JIRA_TOKEN=
# k6 performance test suite
# Get following secrets from the Secret Store, look for "MailPoet: plugin .env":
WP_TEST_PERFORMANCE_DATA_URL=
WP_TEST_PERFORMANCE_PW=
K6_CLOUD_TOKEN=
K6_CLOUD_ID=

3
mailpoet/.eslintignore Normal file
View File

@ -0,0 +1,3 @@
**/vendor/**
**/vendor-prefixed/**
**/testBundles/**

View File

@ -1,2 +1 @@
# we can set this back to "true" once @woocommerce/components have less restrictive definitions
engine-strict=false
engine-strict=true

1
mailpoet/.nvmrc Normal file
View File

@ -0,0 +1 @@
v17.9.1

View File

@ -90,6 +90,7 @@ $ ./do test:debug-unit # alias for ./do test:unit --debug
$ ./do test:debug-integration # alias for ./do test:integration --debug
$ ./do test:failed-unit # run the last failing unit test.
$ ./do test:failed-integration # run the last failing integration test.
$ ./do test:coverage # run tests and output coverage information.
$ ./do test:javascript # run the JS tests.
$ ./do test:acceptance [--file=...] [--skip-deps]
# run acceptances tests into a docker environment.

View File

@ -1,4 +1,4 @@
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
<?php
// phpcs:disable PSR1.Classes.ClassDeclaration
// phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
@ -117,48 +117,11 @@ class RoboFile extends \Robo\Tasks {
}
public function translationsBuild() {
$exclude = implode(',', [
'.mp_svn',
'assets/css',
'assets/img',
'assets/js',
'generated',
'lang',
'lib-3rd-party',
'mailpoet-premium',
'node_modules',
'plugin_repository',
'prefixer',
'tasks',
'temp',
'tests',
'tools',
'vendor',
'vendor-prefixed',
'RoboFile.php',
'.storybook',
'storybook-static',
]);
$headers = escapeshellarg(
json_encode([
'Report-Msgid-Bugs-To' => 'http://support.mailpoet.com/',
'Last-Translator' => 'MailPoet i18n (https://www.transifex.com/organization/wysija)',
'Language-Team' => 'MailPoet i18n <https://www.transifex.com/organization/wysija>',
'Plural-Forms' => 'nplurals=2; plural=(n != 1);',
])
);
$this->collectionBuilder()
->taskExec('mkdir -p ' . __DIR__ . '/lang')
// HTML, HBS
->taskExec("php -d memory_limit=-1 tasks/makepot/makepot-views.php . > lang/mailpoet.pot")
// PHP, JS/TS
->taskExec("php -d memory_limit=-1 vendor/wp-cli/wp-cli/php/boot-fs.php i18n make-pot --merge --slug=mailpoet --domain=mailpoet --exclude=$exclude --headers=$headers . lang/mailpoet.pot")
->run();
->taskExec(
'php -d memory_limit=-1 tasks/makepot/grunt-makepot.php wp-plugin . lang/mailpoet.pot mailpoet .mp_svn,assets,lang,node_modules,plugin_repository,tasks,tests,vendor'
)->run();
}
public function translationsGetPotFileFromBuild() {
@ -221,7 +184,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, 'enable-cot' => false, 'enable-cot-sync' => 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, 'enable-cot' => false, 'enable-cot-sync' => false]) {
return $this->runTestsInContainer(array_merge($opts, ['test_type' => 'integration']));
}
@ -237,6 +200,21 @@ class RoboFile extends \Robo\Tasks {
return $this->runTestsInContainer(array_merge($opts, ['test_type' => 'integration', 'skip-group' => 'woo', 'skip-deps' => true, 'skip-plugins' => true]));
}
public function testCoverage($opts = ['file' => null, 'xml' => false]) {
$command = join(' ', [
'vendor/bin/codecept run -s acceptance',
(($opts['file']) ? $opts['file'] : ''),
'--coverage',
($opts['xml']) ? '--coverage-xml' : '--coverage-html',
]);
if ($opts['xml']) {
$command .= ' --xml';
}
return $this->execWithXDebug($command);
}
public function testNewsletterEditor($xmlOutputFile = null) {
$command = join(' ', [
'./node_modules/.bin/mocha',
@ -285,80 +263,6 @@ class RoboFile extends \Robo\Tasks {
return $this->runTestsInContainer($opts);
}
public function testPerformance($path = null, $opts = ['url' => null, 'pw' => null, 'head' => false, 'scenario' => null]) {
$dir = __DIR__;
if ((getenv('K6_CLOUD_TOKEN')) === false) {
return $this->collectionBuilder()
->addCode([$this, 'testPerformanceSetup'])
->taskExec("php $dir/tools/k6.php")
->arg('run')
->option('env', 'K6_BROWSER_ENABLED=1')
->option('env', 'URL=' . $opts['url'])
->option('env', 'PW=' . $opts['pw'])
->option('env', 'HEADLESS=' . ($opts['head'] ? 'false' : 'true'))
->option('env', 'SCENARIO=' . $opts['scenario'])
->arg($path ?? "$dir/tests/performance/scenarios.js")
->dir($dir)->run();
} else {
return $this->collectionBuilder()
->addCode([$this, 'testPerformanceSetup'])
->taskExec("php $dir/tools/k6.php")
->arg('run')
->option('env', 'K6_BROWSER_ENABLED=1')
->option('env', 'URL=' . $opts['url'])
->option('env', 'PW=' . $opts['pw'])
->option('env', 'HEADLESS=' . ($opts['head'] ? 'false' : 'true'))
->option('env', 'SCENARIO=' . $opts['scenario'])
->option('env', 'K6_CLOUD_TOKEN=' . getenv('K6_CLOUD_TOKEN'))
->option('env', 'K6_CLOUD_ID=' . getenv('K6_CLOUD_ID'))
->option('env', 'K6_PROJECT_NAME=' . $opts['scenario'])
->option('out', 'cloud')
->arg($path ?? "$dir/tests/performance/scenarios.js")
->dir($dir)->run();
}
}
public function testPerformanceSetup() {
// get data file URL
$url = getenv('WP_TEST_PERFORMANCE_DATA_URL');
if (!$url) {
$this->yell("Please set 'WP_TEST_PERFORMANCE_DATA_URL'. You'll find it in the secret store.", 40, 'red');
exit(1);
}
// download data
$dataFile = __DIR__ . '/tests/performance/_data/data.sql';
if (!file_exists($dataFile)) {
$this->say('Downloading data file...');
if (!is_dir(dirname($dataFile))) {
mkdir(dirname($dataFile), 0777, true);
}
$source = gzopen($url, 'rb');
$destination = fopen($dataFile, 'wb');
while (!gzeof($source)) {
fwrite($destination, gzread($source, 4096));
}
fclose($destination);
gzclose($source);
$this->say("Data file downloaded to: $dataFile");
} else {
$this->say("Data file already exists: $dataFile");
}
// import data & run WordPress setup
$this->say('Importing data and running a WordPress setup...');
$this->taskExec('COMPOSE_HTTP_TIMEOUT=200 docker-compose run --rm -it setup')
->dir(__DIR__ . '/tests/performance')
->run();
$this->say('Data imported, WordPress set up.');
}
public function testPerformanceClean() {
$this->taskExec('COMPOSE_HTTP_TIMEOUT=200 docker-compose down --remove-orphans -v')
->dir(__DIR__ . '/tests/performance')
->run();
}
public function testAcceptanceMultisite($opts = ['file' => null, 'skip-deps' => false, 'group' => null, 'timeout' => null, 'enable-cot' => false, 'enable-cot-sync' => false]) {
return $this->runTestsInContainer(array_merge($opts, ['multisite' => true]));
}
@ -447,30 +351,6 @@ class RoboFile extends \Robo\Tasks {
$this->say("Validator metadata generated to: $validatorMetadataDir");
}
/**
* Creates a new migration file. Use `migrations:new db` for a db level migration or `migrations:new app` for app level migration.
* @param $level string - db or app
*/
public function migrationsNew($level) {
$generator = new \MailPoet\Migrator\Repository();
$level = strtolower($level);
$result = $generator->create($level);
$path = realpath($result['path']);
$this->output->writeln('MAILPOET DATABASE MIGRATIONS');
$this->output->writeln("============================\n");
$this->output->writeln("New migration created ✔\n");
$this->output->writeln(" Name: {$result['name']}");
$this->output->writeln(" Path: $path");
}
public function migrationsStatus() {
return $this->taskExec('vendor/bin/wp mailpoet:migrations:status');
}
public function migrationsRun() {
return $this->taskExec('vendor/bin/wp mailpoet:migrations:run');
}
public function qa() {
$collection = $this->collectionBuilder();
$collection->addCode([$this, 'qaPhp']);
@ -492,9 +372,6 @@ class RoboFile extends \Robo\Tasks {
$collection->addCode(function() {
return $this->qaCodeSniffer([]);
});
$collection->addCode(function() {
return $this->qaMinimalPluginStandard([]);
});
return $collection->run();
}
@ -522,8 +399,8 @@ class RoboFile extends \Robo\Tasks {
'lib-3rd-party/',
'vendor/composer',
'vendor/mtdowling',
'vendor/soundasleep',
'vendor-prefixed/',
'vendor-prefixed/soundasleep',
'mailpoet.php',
]);
// The list of files and folders to exclude is coming from build.sh
@ -541,7 +418,7 @@ class RoboFile extends \Robo\Tasks {
'vendor/phpmailer/phpmailer/test',
'vendor-prefixed/psr/log/Psr/Log/Test',
'vendor-prefixed/sabberworm/php-css-parser/tests',
'vendor-prefixed/soundasleep/html2text/tests',
'vendor/soundasleep/html2text/tests',
'vendor-prefixed/swiftmailer/swiftmailer/tests',
'vendor-prefixed/symfony/service-contracts/Tests',
'vendor-prefixed/symfony/translation/Tests',
@ -569,60 +446,9 @@ class RoboFile extends \Robo\Tasks {
$task = implode(' ', [
'php -d memory_limit=-1',
'./tasks/code_sniffer/vendor/bin/phpcs',
"--parallel=" . $this->getParallelism(),
'--extensions=php',
$severityFlag,
'--standard=tasks/code_sniffer/MailPoet/free-ruleset.xml',
'-s',
]);
$ignorePaths = [
'.mp_svn',
'assets',
'doc',
'generated',
'lib/Config/PopulatorData/Templates',
'lib-3rd-party',
'node_modules',
'plugin_repository',
'prefixer/build',
'prefixer/vendor',
'tasks/code_sniffer/vendor',
'tasks/phpstan/vendor',
'tasks/makepot',
'tools/vendor',
'temp',
'tests/_data',
'tests/_output',
'tests/_support/_generated',
'vendor',
'vendor-prefixed',
'views',
];
// the "--ignore" arg takes a list of regexes, we need to anchor and escape them
$ignorePatterns = array_map(function (string $path): string {
return '^' . preg_quote(__DIR__ . DIRECTORY_SEPARATOR . $path);
}, $ignorePaths);
$stringFilesToCheck = !empty($filesToCheck) ? implode(' ', $filesToCheck) : '.';
return $this->taskExec($task)
->arg('--ignore=' . implode(',', $ignorePatterns))
->rawArg($stringFilesToCheck)
->run();
}
public function qaMinimalPluginStandard(array $filesToCheck, $opts = ['severity' => 'all']) {
$severityFlag = $opts['severity'] === 'all' ? '-w' : '-n';
$task = implode(' ', [
'php -d memory_limit=-1',
'./tasks/code_sniffer/vendor/bin/phpcs',
'--parallel=' . $this->getParallelism(),
'--extensions=php',
$severityFlag,
'--standard=tasks/code_sniffer/vendor/wporg/plugin-directory/MinimalPluginStandard',
'--standard=tasks/code_sniffer/MailPoet',
'-s',
]);
@ -665,22 +491,59 @@ class RoboFile extends \Robo\Tasks {
}
public function qaFixFile($filePath) {
$extension = pathinfo($filePath, PATHINFO_EXTENSION);
if ($extension === 'php') {
if (substr($filePath, -4) === '.php') {
// fix PHPCS rules
return $this->collectionBuilder()
->taskExec(
'./tasks/code_sniffer/vendor/bin/phpcbf ' .
'--standard=./tasks/code_sniffer/MailPoet ' .
'--runtime-set testVersion 7.3-8.2 ' .
'--runtime-set testVersion 7.2-8.0 ' .
$filePath . ' -n'
)
->run();
}
if (in_array($extension, ['js', 'jsx', 'ts', 'tsx'], true)) {
// fix ESLint rules
if (substr($filePath, -4) === '.jsx') {
// fix ESLint using ES6 rules
return $this->collectionBuilder()
->taskExec("pnpm eslint --max-warnings 0 --fix $filePath")
->taskExec(
'npx ../eslint-config/node_modules/.bin/eslint -c ../eslint-config/.eslintrc.es6.json ' .
'--max-warnings 0 ' .
'--fix ' .
$filePath
)
->run();
}
if (substr($filePath, -4) === '.tsx' || substr($filePath, -3) === '.ts') {
// fix ESLint using TS rules
return $this->collectionBuilder()
->taskExec(
'npx ../eslint-config/node_modules/.bin/eslint -c ../eslint-config/.eslintrc.ts.json ' .
'--max-warnings 0 ' .
'--fix ' .
$filePath
)
->run();
}
if (substr($filePath, -8) === '.spec.js') {
// fix ESLint using tests rules
return $this->collectionBuilder()
->taskExec(
'npx ../eslint-config/node_modules/.bin/eslint -c ../eslint-config/.eslintrc.tests_newsletter_editor.json ' .
'--max-warnings 0 ' .
'--fix ' .
$filePath
)
->run();
}
if (substr($filePath, -3) === '.js') {
// fix ESLint using ES5 rules
return $this->collectionBuilder()
->taskExec(
'npx ../eslint-config/node_modules/.bin/eslint -c ../eslint-config/.eslintrc.es5.json ' .
'--max-warnings 0 ' .
'--fix ' .
$filePath
)
->run();
}
}
@ -717,10 +580,6 @@ class RoboFile extends \Robo\Tasks {
->run();
}
public function qaSemgrep() {
return $this->_exec('./tools/semgrep.sh lib/ lib-3rd-party/');
}
public function storybookBuild() {
return $this->_exec('pnpm run build-storybook');
}
@ -887,9 +746,6 @@ class RoboFile extends \Robo\Tasks {
->addCode(function () use ($version) {
$this->releaseCreatePullRequest($version);
})
->addCode(function () use ($version) {
$this->releaseRerunCircleWorkflow(\MailPoetTasks\Release\CircleCiController::PROJECT_PREMIUM);
})
->addCode(function () use ($version) {
$this->translationsPrepareLanguagePacks($version);
})
@ -1026,23 +882,9 @@ class RoboFile extends \Robo\Tasks {
->addCode(function () use ($version) {
return $this->releasePublishSlack($version);
})
->addCode(function () {
return $this->releaseMergePullRequest(\MailPoetTasks\Release\GitHubController::RELEASE_SOURCE_BRANCH);
})
->run();
}
public function releaseMergePullRequest(string $branch) {
try {
$this->createGitHubController()
->mergePullRequest(\MailPoetTasks\Release\CircleCiController::PROJECT_MAILPOET, $branch);
} catch (\Exception $e) {
$this->yell($e->getMessage(), 40, 'red');
exit(1);
}
$this->say("Pull request for branch: '{$branch}' was successfully merged");
}
/**
* This command displays how many pull request each person did recently
*/
@ -1221,18 +1063,6 @@ class RoboFile extends \Robo\Tasks {
$this->say("Release '$version[name]' info was published on Slack.");
}
public function releaseRerunCircleWorkflow(string $project = null) {
$circleciController = $this->createCircleCiController();
$result = $circleciController->rerunLatestWorkflow($project);
// Sometimes can be useful to know which Circle project workflow was restarted
$project = $project ? " for the project '{$project}'" : '';
if (!$result) {
$this->yell("Circle Workflow{$project} was not restarted", 40, 'red');
} else {
$this->say("Circle Workflow{$project} was started from the beginning");
}
}
public function downloadWooCommerceBlocksZip($tag = null) {
$this->createWpOrgDownloader('woo-gutenberg-products-block')
->downloadPluginZip('woo-gutenberg-products-block.zip', __DIR__ . '/tests/plugins/', $tag);
@ -1256,20 +1086,21 @@ class RoboFile extends \Robo\Tasks {
->downloadReleaseZip('woocommerce-subscriptions.zip', __DIR__ . '/tests/plugins/', $tag);
}
public function downloadAutomateWooZip($tag = null) {
if (!getenv('WP_GITHUB_USERNAME') && !getenv('WP_GITHUB_TOKEN')) {
$this->yell("Skipping download of Automate Woo", 40, 'red');
exit(0); // Exit with 0 since it is a valid state for some environments
}
$this->createGithubClient('woocommerce/automatewoo')
->downloadReleaseZip('automatewoo.zip', __DIR__ . '/tests/plugins/', $tag);
}
public function downloadWooCommerceZip($tag = null) {
if ($tag === 'woo-cot-beta') {
$this->downloadWooCommerceCotZip();
return;
}
$this->createWpOrgDownloader('woocommerce')
->downloadPluginZip('woocommerce.zip', __DIR__ . '/tests/plugins/', $tag);
}
public function downloadWooCommerceCotZip() {
$cotBuildUrl = 'https://github.com/woocommerce/woocommerce/files/9706609/woocommerce.zip';
file_put_contents(__DIR__ . '/tests/plugins/woocommerce.zip', file_get_contents($cotBuildUrl));
file_put_contents(__DIR__ . '/tests/plugins/woocommerce.zip-info', $cotBuildUrl);
}
public function generateData($generatorName = null, $threads = 1) {
require_once __DIR__ . '/tests/DataGenerator/_bootstrap.php';
$generator = new \MailPoet\Test\DataGenerator\DataGenerator(new \Codeception\Lib\Console\Output([]));
@ -1459,14 +1290,7 @@ class RoboFile extends \Robo\Tasks {
(isset($opts['xml']) && $opts['xml'] ? '--xml ' : '') .
(isset($opts['group']) && $opts['group'] ? '--group ' . $opts['group'] . ' ' : '') .
(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'] : '')
'-f ' . (isset($opts['file']) && $opts['file'] ? $opts['file'] : '')
)->dir(__DIR__ . '/tests/docker')->run();
}
private function getParallelism(int $multiplier = 1, int $min = 4, int $max = 32): int {
$path = __DIR__ . '/../.circleci/nproc.js';
$nproc = (int)$this->taskExec("node $path")->printOutput(false)->run()->stopOnFail()->getMessage();
return max(min($nproc * $multiplier, $max), $min);
}
}

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,19 +0,0 @@
$color-grey: #ddd;
$color-wp-gray-0: #fbfbfb;
$color-poet-gray-dividers: #dcdcde;
$color-gutenberg-blue: #007cba;
$color-gutenberg-grey-100: #f0f0f0;
$color-gutenberg-grey-600: #949494;
$color-gutenberg-grey-700: #757575;
$color-gutenberg-grey-800: #2f2f2f;
$color-white: #fff;
$color-black: #1e1e1e;
$color-primary: #007cba;
$color-gutenberg-alert-green: #4ab866;
$color-wp-green-0: #edfaef;
$color-wp-green-60: #007017;
$color-wp-yellow-0: #fcf9e8;
$color-wp-yellow-50: #996800;
$color-wp-yellow-60: #755100;
$color-wp-red-0: #fcf0f1;
$color-wp-red-60: #b32d2e;

View File

@ -1,18 +0,0 @@
.mailpoet-analytics-header {
align-items: end;
display: flex;
justify-content: space-between;
margin-bottom: 24px;
.woocommerce-filters-filter {
width: 100%;
.components-dropdown__content .components-popover__content {
padding: 0
}
* {
box-sizing: border-box;
}
}
}

View File

@ -1,21 +0,0 @@
@import './colors';
.mailpoet-automation-analytics-overview {
background: $color-white;
margin-bottom: 24px;
h1 {
border: 1px solid $color-grey;
border-bottom: none;
padding: 16px 24px;
}
.woocommerce-summary {
background: $color-white;
margin: 0;
}
.woocommerce-summary__item {
background: $color-white;
}
}

View File

@ -1,162 +0,0 @@
@import '../colors';
.mailpoet-automation-editor-stats-placeholder {
.mailpoet-automation-stats-label {
background: $color-gutenberg-grey-100;
color: $color-gutenberg-grey-100;
margin-bottom: 3px;
}
.mailpoet-automation-stats-value {
background: $color-gutenberg-grey-100;
color: $color-gutenberg-grey-100;
display: block;
margin: auto;
width: 10px;
}
}
.mailpoet-automation-editor-step-wrapper-placeholder {
.mailpoet-automation-editor-step-icon {
background: $color-gutenberg-grey-100;
border-radius: 50%;
height: 49px;
width: 49px;
}
.mailpoet-automation-editor-step-title {
background: $color-gutenberg-grey-100;
height: 20px;
margin-bottom: 3px;
width: 50%;
}
.mailpoet-automation-editor-step-subtitle {
background: $color-gutenberg-grey-100;
height: 20px;
width: 90%;
}
}
.mailpoet-automation-analytics-step-failed {
bottom: 0;
display: none;
grid-column: 1 / -1;
justify-content: center;
left: -100px;
position: absolute;
&:after {
border-top: 1px dashed $color-gutenberg-grey-600;
content: '';
height: 0;
left: 100%;
position: absolute;
top: 15px;
width: 100px;
}
span {
display: block;
}
p {
padding: 0 8px;
}
}
@media screen and (min-width: 600px) {
.mailpoet-automation-analytics-step-failed {
display: block;
}
}
.mailpoet-automation-analytics-step-footer {
background: $color-wp-gray-0;
border-top: 1px solid $color-poet-gray-dividers;
display: flex;
grid-column: 1 / -1;
justify-content: center;
margin-bottom: -12px;
margin-left: -12px;
width: calc(100% + 24px);
z-index: 1;
p {
padding: 6px 0;
}
}
.mailpoet-automation-analytics-step-footer,
.mailpoet-automation-analytics-step-failed {
p {
margin: 0;
a {
color: $color-gutenberg-grey-800;
text-decoration: none;
&:hover {
color: $color-gutenberg-blue;
}
}
}
span {
color: $color-gutenberg-grey-600;
}
a:hover span {
color: $color-gutenberg-blue;
}
}
.mailpoet-automation-analytics-separator {
p {
background: $color-wp-gray-0;
text-align: center;
}
span {
display: block;
}
.mailpoet-automation-analytics-separator-text {
color: $color-gutenberg-grey-600;
}
}
// Send Email Panel
.mailpoet-automation-analytics-send-email-panel {
grid-column: 1 / -1;
}
.mailpoet-automation-analytics-send-email-panel-section {
display: flex;
justify-content: space-between;
margin: 1em 0;
&.is-loading {
background: $color-gutenberg-grey-100;
height: 20px;
}
}
.mailpoet-automation-analytics-send-email-panel-label {
color: $color-gutenberg-grey-700;
}
.mailpoet-automation-analytics-send-email-panel-value {
text-align: end;
}
.mailpoet-automation-editor-automation-notices {
background: $color-wp-gray-0;
padding: 32px 0 0;
}
.mailpoet-automation-flow-notice {
margin: 0 auto;
max-width: 480px;
width: 100%;
}

View File

@ -1,56 +0,0 @@
@import '../colors';
@import 'mixins';
.mailpoet-analytics-main-value {
font-size: 13px;
font-weight: 400;
line-height: 18px;
margin: 0 0 4px;
}
.mailpoet-analytics-badge {
font-weight: 600;
}
.mailpoet-analytics-badge-text {
@include badge;
}
.mailpoet-automation-analytics-email-name {
max-width: 300px;
}
.mailpoet-automation-analytics-email-clicked {
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;
margin: 0;
}
.mailpoet-analytics-email-actions {
align-items: center;
display: flex;
gap: 8px;
justify-content: end;
}

View File

@ -1,32 +0,0 @@
@import '../colors';
.mailpoet-analytics-tabs {
background: $color-white;
border: 1px solid $color-grey;
.components-tab-panel__tabs-item.is-active {
box-shadow: inset 0 -4px 0 0 var(--wp-admin-theme-color);
}
.components-tab-panel__tabs {
border-bottom: 1px solid $color-grey;
}
.components-tab-panel__tab-content {
padding: 0;
}
.woocommerce-table {
box-shadow: none;
margin-bottom: 0;
/** Remove table header */
.components-card-header {
display: none;
}
}
}
.woocommerce-summary__item {
box-sizing: border-box;
}

View File

@ -1,6 +0,0 @@
@import 'mixins';
@import 'general';
@import 'email';
@import 'orders';
@import 'automation_flow';
@import 'subscribers';

View File

@ -1,11 +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;
}

View File

@ -1,80 +0,0 @@
@import '../colors';
@import 'mixins';
.mailpoet-analytics-tab-orders,
.mailpoet-analytics-tab-subscribers {
color: $color-gutenberg-grey-600;
}
.mailpoet-analytics-filter {
.is-loading {
background: $color-gutenberg-grey-100;
height: 20px;
max-width: 200px;
width: 45%;
}
}
.woocommerce-table__item {
a.mailpoet-analytics-orders__customer {
align-items: flex-start;
display: flex;
flex: 1 0 0;
gap: 8px;
img {
border-radius: 50%;
}
}
.mailpoet-automations-analytics-order-products {
align-items: center;
display: flex;
.quantity {
color: $color-gutenberg-grey-700;
}
.woocommerce-view-more-list {
button {
background: transparent;
border-radius: 0;
text-decoration: underline dotted;
}
}
}
}
.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;
.components-notice__content {
margin: 0;
}
.mailpoet-analytics-upgrade-banner__inner {
align-items: center;
display: flex;
justify-content: space-between;
}
}

View File

@ -1,38 +0,0 @@
@import '../colors';
.mailpoet-analytics-clear-filters {
margin-right: 8px;
}
.mailpoet-analytics-filter {
align-items: end;
display: flex;
justify-content: space-between;
padding: 16px;
}
.mailpoet-analytics-filter-controls {
display: flex;
gap: 8px;
}
.mailpoet-analytics-subscribers-step-cell {
display: grid;
gap: 8px;
grid-template-columns: 24px 1fr;
grid-template-rows: auto 1fr;
.mailpoet-automation-colored-icon {
padding: 5px;
}
p {
margin: 0;
}
span {
color: $color-gutenberg-grey-600;
font-size: 11px;
grid-column-start: 2;
}
}

View File

@ -1,4 +1,4 @@
.mailpoet-automation-add-trigger {
.mailpoet-automation-workflow-add-trigger {
align-items: center;
border: 1px dashed #c3c4c7;
border-radius: 4px;

View File

@ -1,37 +0,0 @@
.mailpoet-automation-editor-automation {
background: #fbfbfb;
flex-grow: 1;
}
.mailpoet-automation-editor-automation-wrapper {
display: grid;
padding: 50px 20px;
}
.mailpoet-automation-editor-automation-end {
background: #8c8f94;
border-radius: 999999px;
fill: white;
height: 18px;
margin: 4px auto;
padding: 3px;
width: 18px;
}
.mailpoet-automation-editor-stats {
margin: 0 auto 32px;
max-width: 480px;
width: 100%;
.mailpoet-automation-stats-item {
line-height: 22px;
}
.mailpoet-automation-stats-label {
color: #787c82;
}
.mailpoet-automation-stats-value {
font-size: 14px;
}
}

View File

@ -1,8 +1,8 @@
.mailpoet-automation-chip {
align-items: center;
background: #f0f0f1;
background: #fcf0f1;
border-radius: 9999px;
color: #2c3338;
color: #8a2424;
cursor: pointer;
display: flex;
font-size: 13px;
@ -24,17 +24,4 @@
height: 32px;
padding: 0 12px;
}
&.chip-danger {
background: #fcf0f1;
color: #8a2424;
}
&[aria-expanded='true'] {
filter: brightness(95%);
}
&:focus {
box-shadow: 0 0 0 calc(var(--wp-admin-border-width-focus)) var(--wp-admin-theme-color);
}
}

View File

@ -1,44 +0,0 @@
.mailpoet-automatoin-deactivate-modal {
color: #1d2327;
font-size: 13px;
line-height: 21px;
max-width: 480px;
.mailpoet-automation-options {
li {
margin-bottom: 12px;
}
}
.mailpoet-automation-option {
border: 2px solid #dcdcde;
border-radius: 4px;
color: #646970;
display: grid;
font-size: 12px;
grid-gap: 8px;
grid-template-columns: 20px auto;
line-height: 16px;
padding: 8px;
&.active {
border-color: #2271b1;
}
strong {
color: #1d2327;
display: block;
font-size: 13px;
font-weight: normal;
line-height: 21px;
}
}
.components-button {
float: right;
&.is-tertiary {
margin-right: 12px;
}
}
}

View File

@ -1,4 +1,4 @@
.mailpoet-automation-editor-empty-automation {
.mailpoet-automation-editor-empty-workflow {
align-items: center;
display: grid;
height: 100%;

View File

@ -30,32 +30,3 @@
outline: none;
}
}
.mailpoet-automation-field__error {
position: relative;
input:not([type='radio'])
select,
textarea,
input[type='text'].components-form-token-field__input {
background: right top/26px no-repeat url('../../img/icons/alert.svg');
padding-right: 26px;
}
select,
input[type=number] {
background-position-x: calc(100% - 26px);
padding-right: 8px !important;
}
.components-base-control__help,
.mailpoet-automation-field-message {
color: #d63638;
}
.components-button.mailpoet-automation-button-sidebar-primary,
.components-button.mailpoet-automation-button-sidebar-primary.has-text,
.components-button.mailpoet-automation-button-sidebar-primary.has-icon {
background: #d63638;
}
}

View File

@ -1,88 +0,0 @@
.mailpoet-automation-filters-panel-content {
margin-top: 16px;
}
button.components-button.mailpoet-automation-filters-panel-add-filter {
padding-right: 12px;
&.has-icon > svg {
margin-right: 4px;
}
}
.mailpoet-automation-filters-list {
display: grid;
gap: 12px;
}
.mailpoet-automation-filters-list-group-description {
color: #646970;
font-size: 13px;
margin-bottom: 16px;
}
.mailpoet-automation-filters-list-group-description-operator {
font-weight: 600;
}
.mailpoet-automation-filters-list-group-operator {
.components-base-control__field > div {
display: flex;
flex-direction: row;
flex-wrap: wrap;
gap: 8px 16px;
justify-content: flex-start;
}
}
.mailpoet-automation-filters-list-item {
align-items: center;
background: #f0f0f0;
display: grid;
grid-template-columns: 1fr auto;
&.mailpoet-automation-filters-list-item-has-error {
background: #fcf0f1;
color: #8a2424;
}
.mailpoet-automation-filters-list-item-content {
color: inherit;
display: block;
height: auto;
line-height: inherit;
padding: 8px 12px;
text-align: left;
&:disabled {
opacity: 1;
}
}
.mailpoet-automation-filters-list-item-remove {
color: #757575;
margin: 4px;
padding: 0;
}
}
.mailpoet-automation-filters-list-item-error {
color: #8a2424;
font-size: 12px;
margin-top: 4px;
}
.mailpoet-automation-filters-list-item-field,
.mailpoet-automation-filters-list-item-value {
font-weight: 600;
}
.mailpoet-automation-filters-list-item-value-missing {
color: #757575;
display: inline-block;
vertical-align: middle;
svg {
margin: -2px 0;
}
}

View File

@ -5,10 +5,6 @@
.components-panel__body-title.mailpoet-automation-panel-plain-body-title {
display: grid;
grid-template-columns: 1fr auto;
&:hover {
background: none;
}
}
.mailpoet-automation-panel-plain-body-title-text {
@ -16,10 +12,6 @@
font-weight: 500;
line-height: normal;
padding: 16px 48px 16px 16px;
label & {
padding: 0;
}
}
.mailpoet-automation-panel-plain-body-title-action {
@ -65,78 +57,3 @@
color: #757575;
font-style: italic;
}
.mailpoet-automation-activate-panel {
animation: mailpoet-automation-activate-panel-animation .1s forwards;
background: #fff;
border-left: 1px solid #ddd;
bottom: 0;
height: 100%;
left: auto;
overflow: auto;
position: fixed;
right: 0;
top: 0;
transform: translateX(100%);
width: 281px;
z-index: 999999;
button {
justify-content: center;
width: 100%;
}
}
.mailpoet-automation-activate-panel__header {
align-content: space-between;
align-items: center;
display: flex;
height: 61px;
.has-icon {
margin-left: auto;
width: auto;
}
}
.mailpoet-automation-activate-panel__header,
.mailpoet-automation-activate-panel__section {
border-bottom: 1px solid #ddd;
}
.mailpoet-automation-activate-panel__header,
.mailpoet-automation-activate-panel__body {
padding-left: 16px;
padding-right: 16px;
.components-spinner {
display: block;
margin: 100px auto 0;
}
}
.mailpoet-automation-activate-panel__section {
margin-left: -16px;
margin-right: -16px;
padding: 16px;
}
.mailpoet-automation-activate-panel__header-activate-button,
.mailpoet-automation-activate-panel__header-cancel-button {
flex-grow: 1;
max-width: 160px;
}
.mailpoet-automation-activate-panel__header-activate-button {
padding-right: 4px;
}
.mailpoet-automation-activate-panel__header-cancel-button {
padding-left: 4px;
}
@keyframes mailpoet-automation-activate-panel-animation {
100% {
transform: translateX(0);
}
}

View File

@ -1,19 +0,0 @@
.mailpoet-automation-editor-step-filters {
display: grid;
gap: 8px;
max-height: 400px;
padding: 8px;
width: 300px;
}
.mailpoet-automation-editor-step-filters-title {
font-size: 13px;
font-weight: 600;
line-height: 1;
}
.mailpoet-automation-editor-step-filters-description {
color: #646970;
font-size: 13px;
margin-bottom: 4px;
}

View File

@ -54,10 +54,7 @@
}
.mailpoet-automation-editor-step-title {
align-items: center;
color: $color-wordpress-grey-dark;
display: flex;
gap: 8px;
}
.mailpoet-automation-editor-step-subtitle {
@ -66,10 +63,12 @@
}
.mailpoet-automation-editor-step-footer {
column-gap: 4px;
display: flex;
grid-column: 1 / -1;
justify-content: flex-end;
}
.mailpoet-automation-editor-step-error {
margin-left: auto;
}
.mailpoet-automation-colored-icon {

View File

@ -0,0 +1,19 @@
.mailpoet-automation-editor-workflow {
background: #fbfbfb;
flex-grow: 1;
}
.mailpoet-automation-editor-workflow-wrapper {
display: grid;
padding: 50px 20px;
}
.mailpoet-automation-editor-workflow-end {
background: #8c8f94;
border-radius: 999999px;
fill: white;
height: 18px;
margin: 4px auto;
padding: 3px;
width: 18px;
}

View File

@ -1,4 +1,3 @@
@import './mailpoet/button';
@import './mailpoet/edit';
@import './mailpoet/thumbnail';
@import './mailpoet/steps';

View File

@ -1,15 +0,0 @@
.mailpoet-sendmail-description {
display: grid;
grid-gap: 4px;
grid-template-columns: 14px auto;
grid-template-rows: auto auto;
}
.mailpoet-sendemail-description-main {
grid-column-end: -1;
grid-column-start: 1;
}
.mailpoet-sendmail-description-type {
color: #787c82;
}

View File

@ -4,64 +4,18 @@
.mailpoet-add-new-button {
padding-right: 12px;
}
}
.mailpoet-automation-is-onboarding {
.notice {
display: none;
}
}
.mailpoet-automation-listing-heading {
margin-bottom: 16px;
}
.mailpoet-automation-listing {
box-shadow: none;
margin-bottom: 0;
}
.mailpoet-automation-listing-cell-name {
position: relative;
width: 100%;
> a:only-child {
bottom: 2px;
display: flex;
left: 0;
padding: 16px 24px;
position: absolute;
right: 0;
top: 0;
.mailpoet-automation-listing {
/* Prevent border radius beneath tabs */
border-radius: 0 0 1px 1px;
}
}
.mailpoet-filter-tab-panel {
background-color: #fff;
border: 1px solid #dcdcde;
border-radius: 2px;
.components-tab-panel__tabs {
box-shadow: inset 0 -1px 0 0 #dcdcde;
}
.components-tab-panel__tabs-item:focus {
box-shadow: none;
}
.components-tab-panel__tabs-item.is-active {
box-shadow: inset 0 -4px 0 0 var(--wp-admin-theme-color);
}
.components-tab-panel__tabs-item:focus-visible {
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
}
.components-tab-panel__tabs-item.is-active:focus-visible {
box-shadow:
inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color),
inset 0 -4px 0 0 var(--wp-admin-theme-color);
}
border-radius: 1px;
box-shadow: 0 0 0 1px rgba(0, 0, 0, .1);
outline: none;
.count {
background-color: #f0f0f1;
@ -73,13 +27,6 @@
}
}
.mailpoet-automation-listing-more-button button.components-button {
height: 36px;
padding: 0;
width: 36px;
svg {
height: 28px;
width: 28px;
}
.mailpoet-automation-listing-heading {
margin-bottom: 16px;
}

View File

@ -1,201 +0,0 @@
@mixin full-width {
margin-left: -20px;
padding-left: 104px;
padding-right: 104px;
width: calc(100% + 60px);
@media screen and (max-width: 782px) {
margin-left: -10px;
width: calc(100% + 34px);
}
}
.mailpoet-automation-section {
@include full-width;
}
.mailpoet-automation-white-background {
background: #fff;
}
.mailpoet-automation-section-content {
display: block;
margin: auto;
max-width: 1072px;
padding: 65px 0;
h2 {
font-size: 23px;
font-weight: 400;
line-height: 32px;
margin: 0;
padding: 0 0 8px;
}
p {
font-size: 14px;
font-weight: 400;
line-height: 22px;
margin: 0;
padding: 0 0 40px;
}
}
.mailpoet-automation-section-hero {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-top: -20px;
h1 {
font-size: 32px;
font-weight: 400;
line-height: 40px;
}
p {
font-size: 14px;
line-height: 22px;
margin-bottom: 32px;
}
> div {
width: 400px;
}
img {
margin-top: 16px;
max-width: 100%;
width: 532px;
@media screen and (min-width: 1305px) {
height: 100%;
margin-top: 0;
max-height: 294px;
width: auto;
}
}
}
.mailpoet-automation-preheading {
display: block;
font-size: 11px;
letter-spacing: .2px;
line-height: 16px;
margin-bottom: 32px;
text-transform: uppercase;
}
.mailpoet-section-templates {
padding: 48px 0;
.components-button {
display: block;
font-size: 16px;
font-weight: 400;
line-height: 25px;
text-align: center;
text-underline-offset: 5px;
}
}
.mailpoet-section-template-list {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-bottom: 40px;
> li {
flex-grow: 1;
margin-right: 8px;
max-width: 336px;
&:last-child {
margin-right: 0;
}
button {
background: #fff;
border: 1px solid #dcdcde;
border-radius: 0;
color: #1d2327;
cursor: pointer;
padding: 24px;
text-align: left;
h3 {
font-size: 16px;
font-weight: 600;
line-height: 24px;
}
}
}
}
.mailpoet-section-build-list-button {
background: transparent;
border: 0;
color: #000;
cursor: pointer;
font-size: 16px;
font-weight: 400;
line-height: 24px;
padding: 0;
text-align: left;
width: 100%;
}
.mailpoet-section-build-your-own {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
ol {
list-style: decimal-leading-zero inside;
margin: 0;
max-width: 373px;
padding: 0;
> li {
border-bottom: 1px solid #dcdcde;
display: grid;
grid-gap: 16px;
grid-template-columns: 16px auto;
margin-bottom: 16px;
padding-bottom: 16px;
&.open {
p {
display: block;
}
.mailpoet-section-build-list-button {
font-weight: 600;
}
}
&:last-of-type {
border: 0;
}
}
.marker {
color: #ff5301;
display: inline-block;
font-size: 16px;
font-weight: 600;
line-height: 24px;
}
p {
display: none;
padding: 0;
}
}
img {
height: auto;
max-width: 400px;
width: 100%;
}
}

View File

@ -1,7 +0,0 @@
.mailpoet-automation-listing-cell-actions {
align-items: center;
display: grid;
gap: 8px;
grid-auto-flow: column;
white-space: nowrap;
}

View File

@ -1,8 +1,6 @@
.mailpoet-automation-listing-cell-status {
align-items: center;
display: grid;
grid-auto-flow: column;
white-space: nowrap;
display: flex;
> div.components-base-control > div.components-base-control__field {
margin-bottom: 0;

View File

@ -1,33 +0,0 @@
.mailpoet-option-button {
display: flex;
margin-top: 8px;
position: relative;
}
.mailpoet-option-button-main {
border-radius: 2px 0 0 2px;
margin-right: 1px;
}
.mailpoet-option-button-opener {
background: var(--wp-admin-theme-color);
border-radius: 0 2px 2px 0;
color: white;
}
.mailpoet-option-button-opener svg {
fill: white;
}
.mailpoet-option-button-opener .is-opened svg {
transform: scale(-1, -1);
transform-origin: center 12.5px;
}
.mailpoet-option-button-opener.is-busy {
animation: components-button__busy-animation 2500ms infinite linear;
background-color: var(--wp-admin-theme-color);
background-image: linear-gradient(-45deg, var(--wp-admin-theme-color) 33%, var(--wp-admin-theme-color-darker-20) 33%, var(--wp-admin-theme-color-darker-20) 70%, var(--wp-admin-theme-color) 70%);
background-size: 100px 100%;
border-color: var(--wp-admin-theme-color);
}

View File

@ -1,32 +0,0 @@
.mailpoet-automation-stats {
display: grid;
grid-auto-flow: column;
justify-content: space-between;
}
.mailpoet-automation-stats-item {
color: $color-wordpress-heading;
display: grid;
font-size: 12px;
line-height: 16px;
text-align: center;
}
.mailpoet-automation-stats-label {
color: #646970;
display: block;
&.display-after {
order: 1;
}
}
.mailpoet-automation-stats-value {
font-weight: 600;
}
.mailpoet-automation-stats-item-separator {
color: #a7aaad;
font-size: 20px;
margin: 0 16px;
}

View File

@ -145,11 +145,11 @@
/* Sidepanel overrides */
.mailpoet_panel_body {
margin: 0;
margin: 19px;
padding: 0;
.mailpoet_editor_settings h3 {
margin: 19px;
margin-top: 0;
}
}

View File

@ -1,6 +1,7 @@
.admin_page_mailpoet-newsletter-editor {
.mailpoet_form_field {
margin: 19px 15px;
margin-bottom: 15px;
margin-top: 15px;
}
.mailpoet_form_field_title {
@ -50,8 +51,4 @@
.mailpoet_form_field_block {
display: block;
}
.mailpoet_form_field_input_nowrap {
white-space: nowrap;
}
}

View File

@ -12,12 +12,6 @@
font-size: 1.4em;
text-transform: uppercase;
}
.components-panel__row {
align-items: flex-start;
flex-direction: column;
justify-content: flex-start;
}
}
.mailpoet_sidepanel_field {

View File

@ -1,90 +0,0 @@
.mailpoet_coupon_block {
.mailpoet_editor_coupon {
text-align: center;
}
.mailpoet_editor_coupon_overlay {
background: rgba(255, 255, 255, .5);
color: #000;
cursor: pointer;
display: none;
font-size: 18px;
height: 100%;
position: absolute;
text-align: center;
top: 0;
width: 100%;
}
:hover {
.mailpoet_editor_coupon {
opacity: .5;
}
.mailpoet_editor_coupon_overlay {
display: block;
}
}
}
.coupon_amount_wrapper {
position: relative;
}
.amount_percentage_sign {
font-size: 18px;
font-weight: bold;
left: 150px; // .mailpoet_input_medium width
line-height: 30px;
margin-left: 10px;
position: absolute;
}
.mailpoet_coupon_block_coupon {
background: $color-white;
font-size: 13px;
height: auto;
line-height: 21px;
margin-bottom: 16px;
padding: 16px 0;
width: 100%;
input[type='radio'] {
margin-left: 16px;
}
div {
padding: 0 16px 0 40px;
&.discount_type {
font-style: italic;
}
}
}
.mailpoet_coupon_block_settings,
.mailpoet_coupon_block_display_options {
@include animation-slide-open-downwards();
overflow-x: hidden;
}
.mailpoet_editor_settings {
.components-panel__header.edit-post-sidebar__panel-tabs {
background: $color-primary-background;
border-bottom: none;
}
.components-base-control {
width: 100%;
}
.components-panel {
background: $color-primary-background;
border-left: none;
border-right: none;
}
.components-search-control input[type=search].components-search-control__input {
background: $color-white;
}
}

View File

@ -24,7 +24,6 @@
.mailpoet_settings_posts_selection {
@include animation-slide-open-downwards();
overflow-x: hidden;
padding: 0 19px;
}
.mailpoet_settings_posts_show_display_options,

View File

@ -24,7 +24,6 @@
.mailpoet_settings_products_selection {
@include animation-slide-open-downwards();
overflow-x: hidden;
padding: 0 19px;
}
.mailpoet_settings_products_show_display_options,

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