-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new Offloading_Files_Check
check
#566
Add new Offloading_Files_Check
check
#566
Conversation
I'd need some help. I don't find functions that will help to do:
|
Offloading_Files_Check
check
This is the first time we're writing custom sniffs for Plugin Check so there's lots to figure out still. |
Yes, for sure we have to figure out deeply how it fits with the checks. This is a good start. |
…s-etc-offloading-external
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
FYI, this is not done yet. What I meant with that to-do is that there ideally should be dedicated PHPCS-style unit tests under We probably also need to add |
This is getting closer. Unit tests now run and even code coverage works. What's left is just manual testing. Ideally by generating a production-ready ZIP file and then testing that on a new site to see whether the sniffs are really included. |
Amazing. I did not even know we could use separate composer package list this. 💗 |
I've made a zip for plugin-check and run in a clean site, and I couldn't manage to work. For test purposes, I use this plugin, and I'm afraid it does not detect offloaded. |
That's how I do it! Let me test it again. |
Anyway, if you manage to work, it's ok. |
I tested it in my local setup. |
…s-etc-offloading-external
Related #486
This adds a new PHPCS
Offloading_Files_Check
check for detecting asset offloading (styles, scripts, images, etc.)It does so by creating 2 custom PHPCS sniffs that are inspired by ones from WPCS:
EnqueuedResourceOffloadingSniff
- Detect arbitrary URLs inwp_enqueue_*
callsOffloadingSniff
- Detect arbitrary URLs in HTML stringsThese new sniffs are developed according to PHP_CodeSniffer requirements in a new Composer package that is symlinked from the
phpcs-sniffs
folder. We should consider moving those to a new repository or contribute them to WPCS.The sniffs need to be available in the final Plugin Check plugin, but I don't think we need to include the
phpcs-sniffs
folder in there. It should be included as part ofvendor
. Needs testing though!To-do:
vendor
situation for final plugin ZIP