1+ name : QA - EmbedPress Compatibility Testing
2+
3+ on :
4+ workflow_dispatch : # Manual trigger
5+ # pull_request:
6+ # branches: ["main", "dev"]
7+ # push:
8+ # branches: ["main"]
9+
10+ env :
11+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 : true
12+
13+ jobs :
14+ # 1. First, we call the existing Archive workflow to get the built zip
15+ build :
16+ uses : ./.github/workflows/dist-archive.yml
17+
18+ compatibility-test :
19+ needs : build
20+ runs-on : ubuntu-24.04
21+ strategy :
22+ fail-fast : false
23+ matrix :
24+ include :
25+ - wp-version : " 6.9.4"
26+ php-version : " 7.4"
27+ - wp-version : " 6.9.4"
28+ php-version : " 8.0"
29+ - wp-version : " 6.9.4"
30+ php-version : " 8.2"
31+ - wp-version : " 6.9.4"
32+ php-version : " 8.4"
33+ - wp-version : " 6.9.4"
34+ php-version : " 8.5"
35+ - wp-version : " 6.5.5"
36+ php-version : " 8.1"
37+ - wp-version : " 6.0.9"
38+ php-version : " 7.4"
39+
40+ name : WP ${{ matrix.wp-version }} / PHP ${{ matrix.php-version }}
41+
42+ steps :
43+ # 2. Setup PHP environment
44+ - name : Setup PHP Runtime
45+ uses : shivammathur/setup-php@v2
46+ with :
47+ php-version : ${{ matrix.php-version }}
48+ extensions : mysqli, mbstring, xml, gd
49+ tools : wp-cli
50+
51+ # 3. Download the built artifact from the 'build' job
52+ - name : Download Built EmbedPress
53+ uses : actions/download-artifact@v4
54+ with :
55+ name : ${{ needs.build.outputs.artifact-name }}
56+ path : ./embedpress-dist
57+
58+ - name : Start Database
59+ run : |
60+ sudo systemctl start mysql
61+ mysql -u root -proot -e "CREATE DATABASE wordpress_test;"
62+
63+ - name : Install WordPress Core
64+ run : |
65+ wp core download --version=${{ matrix.wp-version }} --path=./test-site --allow-root
66+ cd test-site
67+ wp config create --dbname=wordpress_test --dbuser=root --dbpass=root --dbhost=127.0.0.1 --allow-root
68+ wp core install --url=http://localhost:8080 --title="EmbedPress Test" --admin_user=admin --admin_password=password --admin_email=hurayra@wpdeveloper.com --allow-root
69+
70+ # 4. Move the built plugin to the WP folder
71+ - name : Install and Activate EmbedPress
72+ run : |
73+ # 1. Create the plugin directory
74+ mkdir -p ./test-site/wp-content/plugins/embedpress
75+
76+ # 2. Move the contents from the nested folder.
77+ cp -r ./embedpress-dist/embedpress/. ./test-site/wp-content/plugins/embedpress/
78+
79+ # 3. Debug: This should now show embedpress.php directly
80+ echo "Checking plugin directory structure (Fixed):"
81+ ls ./test-site/wp-content/plugins/embedpress | head -n 10
82+
83+ # 4. Activate
84+ cd test-site
85+ wp plugin activate embedpress --allow-root
86+
87+ - name : Run Integrity Check
88+ run : |
89+ cd test-site
90+ WP_STATUS=$(wp eval 'echo "Ready";' --quiet --allow-root)
91+ if [[ "$WP_STATUS" != "Ready" ]]; then
92+ echo "::error::WordPress crashed after activating EmbedPress."
93+ exit 1
94+ fi
95+ echo "✅ EmbedPress is active and stable on WP ${{ matrix.wp-version }} / PHP ${{ matrix.php-version }}"
96+
97+ # 5. Updated specific EmbedPress logic checks
98+ # - name: Verify EmbedPress Constants & Options
99+ # run: |
100+ # cd test-site
101+ # wp eval '
102+ # // Check critical constants (Adjust these based on your actual plugin code)
103+ # $constants = ["EMBEDPRESS_VERSION", "EMBEDPRESS_PATH", "EMBEDPRESS_URL"];
104+ # foreach ($constants as $c) {
105+ # if (!defined($c)) { echo "::error::Missing constant: $c\n"; exit(1); }
106+ # }
107+ # echo "✅ All EmbedPress constants defined\n";
108+
109+ # // Check default options
110+ # $val = get_option("embedpress_options", "__MISSING__");
111+ # if ($val === "__MISSING__") { echo "::error::Missing option: embedpress_options\n"; exit(1); }
112+ # echo "✅ Default options saved\n";
113+ # ' --allow-root
114+
115+ - name : Check for PHP Warnings & Deprecations
116+ run : |
117+ cd test-site
118+ wp config set WP_DEBUG true --raw --allow-root
119+ wp config set WP_DEBUG_LOG true --raw --allow-root
120+ wp eval 'do_action("admin_init"); echo "Bootstrap OK\n";' --allow-root
121+
122+ if [ -f wp-content/debug.log ]; then
123+ FATALS=$(grep -c "PHP Fatal" wp-content/debug.log || true)
124+ if [ "$FATALS" -gt 0 ]; then
125+ grep "PHP Fatal" wp-content/debug.log
126+ exit 1
127+ fi
128+ fi
129+ echo "✅ No fatal PHP errors under WP_DEBUG"
130+
131+ - name : Verify REST API Health
132+ run : |
133+ cd test-site
134+ wp eval '
135+ $request = new WP_REST_Request("GET", "/wp/v2/posts");
136+ $response = rest_do_request($request);
137+ if ($response->is_error()) {
138+ echo "::error::REST API broken: " . $response->as_error()->get_error_message() . "\n";
139+ exit(1);
140+ }
141+ echo "✅ REST API responding normally\n";
142+ ' --allow-root
0 commit comments