Skip to content

Commit 994e15a

Browse files
dkottercadicjeffpaul
authored
PHP Compat Revamp (#307)
* Ignore vscode logs * Composer allow plugins * Composer update lockfile * Drop Node to 14 * package-lock.json * Test exclude plugin * Function to get list of plugins with slugs * Deprecation notices * Apply filters on plugins * Compact output for plugins * Function to get list of themes * Remove deprecated function related to directories * Rename functions * Remove deprecated function * Minor formatting and text updates * Remove loadtextdomain * Conditional check for empty plugins list * Fix legacy tests * Docblocks * sanitize * AJAX queue with debug output * Enqueue new JS file * Comments * Minor formatting and text updates * Move phpcompat_excluded_plugins filter into main function Co-authored-by: Darin Kotter <[email protected]> * Add phpcompat_excluded_themes filter Co-authored-by: Darin Kotter <[email protected]> * Advanced console output * Fix formatting * Remove exclude_plugin method and tests * Rename activeOnly variable * Refactor JS sources and build scripts * Watch make command * Render * Remove PHP Versions select * Remove old assets * Handle unknown errors * Truncate queue on init * Cleanup and comments * Avoid long if/else * Remove todo 'indicate in progress' * Todo change staging endpoint * JS Code formatting, remove debug console output * Add translations to JS, change the makepot command * Remove gulp config * Change admin page slug and remove version constant * Change textdomain * Remove gulp deps * Update limitations text, fix textdomain * Add escaping to translations * Abort process on change of active/all target * Display PHPCS-like details, add 'view results as raw text' checkbox * Download button * Download section styles, clear results * Handle plugins outside of WP repository * Change 'test this site' link to LocalWP * Remove unused code * Use is_wpe() * Clean legacy data during activate and uninstall * Cleanup during plugin upgrade * Code styles * Aside styles * Update codeable form with scan report * Lint * Remove code comments * migration improvements * Minor formatting and text updates * Disable scan button during the scan * lint * Ignore wp-env local config * Unified error reporting * Extended error reporting * Close report clicking on the version or link * Update title and clean up * Add all PHP versions to the raw report * Add errors to raw report * Remove string that was left behind * Change how we sanitize slugs to ensure they have no spaces * Fix mixing full report with single version report * lint * shortcut runButton * If we get a success response back from the Tide API but that response does not contain the report data, handle that error state and return early * Update src/js/include/render.js Co-authored-by: Max Lyuchin <[email protected]> * Version bump and plugin header * Fix * Reset to normal state when results are cleared * Add Start Scan link * fix * add back missing readme.txt file pulled directly from https://github.com/wpengine/phpcompat/blob/bad35e118fd9b4c8915f438ecb695da6ba954a1d/readme.txt * formatting updates to readme.txt * cleanup plugin header fields * updated readme.txt content for 1.6.0 version * Text update * update LocalWP and PHP 7 text references * Avoid a fatal error if the plugin isn't built properly * Ensure we only load our assets on the scan page * If connection is lost during the middle of the scan, show proper error message * If on multisite, make sure we include network active plugins in our list of active plugins * Add RTL styling * Add a progress indicator at the top of the scan page to make it easier to see progress Co-authored-by: Max Lyuchin <[email protected]> Co-authored-by: Max Lyuchin <[email protected]> Co-authored-by: Jeffrey Paul <[email protected]> Co-authored-by: Jeffrey Paul <[email protected]>
1 parent 75279b9 commit 994e15a

24 files changed

+7341
-2983
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ assets/js/*.js
203203
assets/js/*.map
204204
coverage.clover
205205
/plugin/scripts/*-min.js
206+
/plugin/build/
206207
wpe-php-compat.zip
207208
.phpunit.result.cache
208209

@@ -222,3 +223,7 @@ Docker/debug
222223
# Build files
223224
/build/
224225
clover.xml
226+
227+
.vscode/*.log
228+
229+
.wp-env.override.json

.jshintignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
gulpfile.js
22
**/*-min.js
3+
plugin/build/
34
wordpress/
45
node_modules/
56
vendor/

Docker/Dockerfile-node

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:lts
1+
FROM node:14
22
ARG UID=1000
33
ARG GID=1000
44

Makefile

+7-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ END_HIGHLIGHT :=\033[0m # No Color
1212
build: build-docker build-assets
1313

1414
.PHONY: build-assets
15-
build-assets: | build-docker-node install-npm
15+
build-assets: | build-docker-node install-npm install-composer
1616
@echo "Building plugin assets"
1717
rm -f plugin/languages/*.pot plugin/scripts/*-min.js
18-
$(DOCKER_RUN) $(NODE_IMAGE) ./node_modules/gulp-cli/bin/gulp.js
18+
$(DOCKER_RUN) $(NODE_IMAGE) npm run build
19+
$(DOCKER_RUN) $(COMPOSER_BASE_CONTAINER) run-script makepot
1920

2021
.PHONY: build-docker
2122
build-docker: build-docker-node build-docker-php
@@ -160,6 +161,10 @@ update-composer: lando-stop
160161
update-npm: | build-docker-node
161162
$(DOCKER_RUN) $(NODE_IMAGE) npm update
162163

164+
.PHONY: watch
165+
watch: | build-docker-node install-npm
166+
$(DOCKER_RUN) $(NODE_IMAGE) npm run start
167+
163168
wpe-php-compat.zip:
164169
@echo "Building release file: wpe-php-compat.zip"
165170
rm -f wpe-php-compat.zip

README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ __URL:__ _http://localhost:8888/wp-admin_
2626

2727
__Admin User:__ _admin_
2828

29-
__Admin Password:__ _password
30-
31-
After you have logged in, go to http://localhost:8888/wp-admin/admin.php?page=fakerpress and generate some dummy content for the block to render.
29+
__Admin Password:__ _password_
3230

3331
If anything goes wrong and you suspect your local is frozen, you can always `make choose-violence` to rebuild the local environment and containers. Hopefully you never have to choose violence. :)
3432

composer.json

+10
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,17 @@
55
"phpunit/phpunit": "^9.5.4",
66
"brain/monkey": "^2.6.0",
77
"dealerdirect/phpcodesniffer-composer-installer": "^v0.7.1",
8+
"wp-cli/wp-cli-bundle": "*",
89
"wpengine/wpengine-coding-standards": "^1.0.0",
910
"johnpbloch/wordpress": "*"
11+
},
12+
"config": {
13+
"allow-plugins": {
14+
"johnpbloch/wordpress-core-installer": true,
15+
"dealerdirect/phpcodesniffer-composer-installer": true
16+
}
17+
},
18+
"scripts": {
19+
"makepot": "./vendor/bin/wp i18n make-pot plugin --slug=wpe-php-compat"
1020
}
1121
}

0 commit comments

Comments
 (0)