Skip to content

Commit b652336

Browse files
committed
Merge branch 'develop' into add-woocommerce-blueprint-support
2 parents 904debd + 8078646 commit b652336

761 files changed

Lines changed: 50261 additions & 5602 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ddev/bin/carriers-extractor.js

Lines changed: 506 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash
2+
#ddev-generated
3+
# PayPal Carriers Extractor Command
4+
## Description: Extract PayPal carrier data using Playwright
5+
6+
## Usage: carriers-extractor
7+
## Example: ddev carriers-extractor
8+
9+
10+
cd /var/www/html || exit 1
11+
PRE="sudo -u pwuser PLAYWRIGHT_BROWSERS_PATH=0 "
12+
13+
# Check if the carriers-extractor.js file exists
14+
if [ ! -f ".ddev/bin/carriers-extractor.js" ]; then
15+
echo "❌ Error: carriers-extractor.js not found in project root"
16+
echo "Please make sure the carriers-extractor.js file is in your project root directory"
17+
exit 1
18+
fi
19+
20+
# Check if Playwright is installed
21+
if [ ! -d "node_modules/playwright" ] && [ ! -d "${PLAYWRIGHT_TEST_DIR}/node_modules/playwright" ]; then
22+
echo "❌ Error: Playwright is not installed"
23+
echo "Please run 'ddev playwright-install' first to install Playwright"
24+
exit 1
25+
fi
26+
27+
28+
# Install Playwright browsers if not already installed
29+
if [ ! -d "node_modules/playwright-core/.local-browsers" ]; then
30+
echo "🎭 Installing Playwright browsers..."
31+
$PRE npx playwright install --with-deps chromium >/dev/null
32+
fi
33+
34+
35+
echo "🚀 Starting PayPal carriers extraction..."
36+
echo "📡 Fetching data from: https://developer.paypal.com/docs/tracking/reference/carriers/"
37+
echo ""
38+
39+
# Run the carriers extractor script
40+
$PRE node .ddev/bin/carriers-extractor.js
41+
42+
if [ $? -eq 0 ]; then
43+
echo ""
44+
echo "📄 Generated file: carriers_data.php in the root of the project"
45+
echo ""
46+
47+
echo "⏭️ Next steps:"
48+
echo "1. Copy the array from carriers_data.php into your PayPal Payments plugin in \`modules/ppcp-order-tracking/carriers.php\`"
49+
echo "2. Run \`yarn run ddev:fix-lint modules/ppcp-order-tracking/carriers.php\` to format the file."
50+
echo "3. Run \`yarn run ddev:unit-tests\` to be sure nothing is broken :)"
51+
echo "3. Remove the temporary carries_data.php from the root of the project"
52+
echo "4. Review and commit your changes"
53+
54+
else
55+
echo "❌ Extraction failed. Please check the error messages above."
56+
exit 1
57+
fi

.ddev/commands/web/wp-cleanup

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,18 @@
11
#!/bin/bash
22

33
show-help() {
4-
echo -e "\nDelete all posts -p [post type]"
5-
echo -e "\tExample: ddev wp-cleanup -p shop_order,product"
64
echo -e "\nDelete all logs -l [wp-content path]"
75
echo -e "\tExample: ddev wp-cleanup -l uploads/wc-logs\n"
86
}
97

10-
delete-posts() {
11-
for post in $(wp post list --post_type=$1 --format=ids --path=.ddev/wordpress); do
12-
wp post delete $post --force --path=.ddev/wordpress
13-
done
14-
}
15-
168
delete-logs() {
179
rm .ddev/wordpress/wp-content/$1/*.log
1810
}
1911

2012
declare -i param_counter=0
2113

22-
while getopts "p:l:h" arg; do
14+
while getopts "l:h" arg; do
2315
case $arg in
24-
p)
25-
delete-posts $OPTARG
26-
param_counter+=1
27-
;;
2816
l)
2917
delete-logs $OPTARG
3018
param_counter+=1

.ddev/commands/web/wp-reset

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/bash
2+
3+
show-help() {
4+
echo -e "\nReset the WordPress database and reinstall WordPress"
5+
echo -e "\tExample: ddev wp-reset"
6+
echo -e "\nRemove all plugins --clean-plugins"
7+
echo -e "\tExample: ddev wp-reset --clean-plugins\n"
8+
}
9+
10+
remove-plugins() {
11+
echo "Deactivating all plugins..."
12+
wp plugin deactivate --all --path=.ddev/wordpress
13+
14+
echo "Deleting all plugins..."
15+
wp plugin delete --all --path=.ddev/wordpress
16+
}
17+
18+
reset-database() {
19+
echo "Resetting database..."
20+
wp db reset --yes --path=.ddev/wordpress
21+
22+
if [ "$1" = "clean-plugins" ]; then
23+
remove-plugins
24+
fi
25+
26+
echo "Installing WordPress..."
27+
wp core install \
28+
--url="${DDEV_PRIMARY_URL}" \
29+
--title="${WP_TITLE}" \
30+
--admin_user="${ADMIN_USER}" \
31+
--admin_password="${ADMIN_PASS}" \
32+
--admin_email="${ADMIN_EMAIL}" \
33+
--path=.ddev/wordpress
34+
35+
echo "Database reset and WordPress installation completed!"
36+
}
37+
38+
clean_plugins=false
39+
40+
while [[ $# -gt 0 ]]; do
41+
case $1 in
42+
--clean-plugins)
43+
clean_plugins=true
44+
shift
45+
;;
46+
-h|--help)
47+
show-help
48+
exit 0
49+
;;
50+
*)
51+
echo "Unknown option: $1"
52+
show-help
53+
exit 1
54+
;;
55+
esac
56+
done
57+
58+
if [ "$clean_plugins" = true ]; then
59+
reset-database "clean-plugins"
60+
else
61+
reset-database
62+
fi

.ddev/config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ hooks:
1919
pre-start:
2020
- exec-host: "mkdir -p .ddev/wordpress/wp-content/plugins/${DDEV_PROJECT}"
2121
web_environment:
22-
- WP_VERSION=6.7.1
22+
- WP_VERSION=6.8.2
2323
- WP_LOCALE=en_US
2424
- WP_TITLE=WooCommerce PayPal Payments
25-
- WP_MULTISITE=true
25+
- WP_MULTISITE=false
2626
- WP_MULTISITE_SLUGS=de,es
2727
- ADMIN_USER=admin
2828
- ADMIN_PASS=admin
2929
- ADMIN_EMAIL=admin@example.com
30-
- WC_VERSION=9.5.1
30+
- WC_VERSION=10.1.2
3131

3232
# Key features of ddev's config.yaml:
3333

.ddev/docker-compose.phpunit.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
services:
2+
web:
3+
volumes:
4+
- ../coverage:/var/www/html/.ddev/wordpress/coverage:ro

.ddev/docker-compose.wp-plugin.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: '3.6'
21
services:
32
web:
43
volumes:

.distignore

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
.gitattributes
44
.gitignore
55
.eslintrc
6-
.ddev
6+
.ddev*
77
.git*
88
.phpstorm*
9-
.idea
9+
.idea*
1010
*.env*
1111
.psalm*
12-
tests
12+
tests*
1313
*.xml*
1414
.phpunit.result.cache
1515
babel.config.json
16-
node_modules
16+
node_modules*
1717
modules/*/resources/css
1818
modules/*/resources/js/**/*.js
1919
*.lock
@@ -28,7 +28,8 @@ assets-compiler.json
2828
patchwork.json
2929
.babelrc
3030
README.md
31-
wordpress_org_assets
31+
wordpress_org_assets*
3232
.DS_Store
3333
auth.json
3434
*.log
35+
scoper.inc.php

.github/CODEOWNERS

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# CODEOWNERS file for PayPal Payments Plugin
2+
# This file defines code owners who will automatically be requested for review
3+
# when a pull request touches files matching the specified patterns.
4+
5+
# Global owners - will be requested for review on all changes
6+
# @Dinamiko is listed first as dev lead, followed by team members in alphabetical order
7+
* @Dinamiko @AlexP11223 @danieldudzic @hmouhtar @Narek13 @puntope @stracker-phil
8+
9+
# You can also add specific patterns for different parts of the codebase:
10+
# Examples (uncomment and modify as needed):
11+
# /src/ @Dinamiko @stracker-phil
12+
# /tests/ @AlexP11223 @hmouhtar
13+
# /assets/ @danieldudzic @puntope
14+
# /.github/workflows/ @Narek13
15+
# /docs/ @Dinamiko

.github/workflows/e2e-tests.yml

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
name: E2E Tests
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
update-workflows:
7+
description: 'Weather generate new snapshots'
8+
type: boolean
9+
default: false
10+
wp-rc-version:
11+
description: 'WordPress version for Release Candidate (i.e. 6.3-RC3)'
12+
wc-rc-version:
13+
description: 'WooCommerce version for Release Candidate (i.e. 8.0.0-rc.1)'
14+
test-suite:
15+
description: 'Test suite to run'
16+
required: true
17+
default: 'critical'
18+
type: choice
19+
options:
20+
- critical
21+
- onboarding
22+
- all
23+
24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.ref }}
26+
cancel-in-progress: true
27+
28+
jobs:
29+
build:
30+
name: Build package
31+
uses: inpsyde/reusable-workflows/.github/workflows/build-plugin-archive.yml@a9af34f34e95cbe18703198c7e972e97ebcd7473
32+
with:
33+
PHP_VERSION: 7.4
34+
NODE_VERSION: 22
35+
PLUGIN_MAIN_FILE: ./woocommerce-paypal-payments.php
36+
PLUGIN_VERSION: 3.0.0
37+
PLUGIN_FOLDER_NAME: woocommerce-paypal-payments
38+
ARCHIVE_NAME: woocommerce-paypal-payments
39+
COMPILE_ASSETS_ARGS: '-vv --env=root'
40+
41+
E2ETests:
42+
name: E2E Tests
43+
needs: build
44+
runs-on: ubuntu-latest
45+
env:
46+
FORCE_COLOR: 2
47+
steps:
48+
- uses: actions/checkout@v2
49+
50+
- name: Download artifact
51+
uses: actions/download-artifact@v4
52+
with:
53+
name: woocommerce-paypal-payments
54+
path: ./tests/qa/resources/files
55+
56+
- name: Create and upload zip file
57+
working-directory: ./tests/qa/resources/files
58+
run: |
59+
zip -r ./woocommerce-paypal-payments.zip ./woocommerce-paypal-payments
60+
rm -rf woocommerce-paypal-payments
61+
62+
- name: Configure npm for GitHub Packages
63+
working-directory: ./tests/qa
64+
run: |
65+
# Create clean .npmrc
66+
echo "@inpsyde:registry=https://npm.pkg.github.com" > .npmrc
67+
echo "//npm.pkg.github.com/:_authToken=${{ secrets.NPM_SYDE }}" >> .npmrc
68+
69+
- name: Install Environment
70+
working-directory: ./tests/qa
71+
run: npm run setup:env
72+
env:
73+
COMPOSER_AUTH: '${{ secrets.COMPOSER_AUTH_SYDE }}'
74+
75+
- name: Install WP release candidate (optional)
76+
if: github.event.inputs.wp-rc-version != ''
77+
working-directory: ./tests/qa
78+
env:
79+
INPUT_WP_RC_VERSION: ${{ github.event.inputs.wp-rc-version }}
80+
run: |
81+
npm run -- wp-env run tests-cli -- wp core update --version="${INPUT_WP_RC_VERSION}"
82+
npm run -- wp-env run tests-cli -- wp core update-db
83+
84+
- name: Install WC release candidate (optional)
85+
if: github.event.inputs.wc-rc-version != ''
86+
working-directory: ./tests/qa
87+
env:
88+
INPUT_WC_RC_VERSION: ${{ github.event.inputs.wc-rc-version }}
89+
run: |
90+
npm run -- wp-env run tests-cli -- wp plugin update woocommerce --version="${INPUT_WC_RC_VERSION}"
91+
npm run -- wp-env run tests-cli -- wp wc update
92+
93+
- name: Install Tests
94+
working-directory: ./tests/qa
95+
run: npm run setup:tests
96+
97+
- name: Create .env file
98+
working-directory: ./tests/qa
99+
run: |
100+
echo "${{ secrets.QA_ENV_FILE }}" > .env
101+
102+
- name: Run E2E tests
103+
working-directory: ./tests/qa
104+
run: |
105+
if [ "${{ github.event.inputs.update_snapshots }}" == "true" ]; then
106+
npm run tests:${{ github.event.inputs.test-suite }} -- --update-snapshots
107+
else
108+
npm run tests:${{ github.event.inputs.test-suite }}
109+
fi
110+
111+
- name: Archive updated snapshots
112+
if: github.event.inputs.update_snapshots == 'true'
113+
uses: actions/upload-artifact@v4
114+
with:
115+
name: snapshots
116+
path: tests/qa/snapshots
117+
if-no-files-found: warn
118+
retention-days: 5
119+
120+
- name: Archive Playwright Report
121+
if: ${{ always() }}
122+
uses: actions/upload-artifact@v4
123+
with:
124+
name: playwright-test-results
125+
path: tests/qa/playwright-report
126+
if-no-files-found: ignore
127+
retention-days: 5
128+
129+
- name: Archive Test Results
130+
if: ${{ always() }}
131+
uses: actions/upload-artifact@v4
132+
with:
133+
name: test-results
134+
path: tests/qa/test-results/
135+
if-no-files-found: ignore
136+
retention-days: 5

0 commit comments

Comments
 (0)