-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 plugins endpoints #22454
Add plugins endpoints #22454
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
6f08659
to
cdfa290
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I pushed a commit that refactors the block directory install and uninstall endpoints to use the plugins controller. Ideally we'll drop those methods and the block directory would One thing of note is the uninstall endpoint. It is performing a deactivation and uninstall in one request. As far as I know this can't happen in the WordPress UI typically. It can also lead to all sorts of weird errors since the request started with the plugin active and running its code, but ends the request without the plugin files. This would mean if that plugin would include any files on a hook that occurred after it got uninstalled, everything could blow up. I've left this for now, but I think we should drop it and do the separate status update to inactive and then delete. |
Also, I dropped the item specific permission checks for activating and deactivating since that will be handled by the plugins controller. The purpose of those permission checks now is just to generate an I've also fixed the single |
35d0d3e
to
298d886
Compare
I've adjusted the tests to mark as skipped instead of erroring if they run into a permission error while we wait on #22515. The tests should all work if you run them locally. I also started to add some multisite tests, but I couldn't get multisite tests to work using |
Review complete. |
Introduces a pattern to validate the .org plugin slug, and moves specific callbacks to a dedicated method instead of an inline closure. WordPress#22454 (comment) WordPress#22454 (comment) WordPress#22454 (comment)
Fix ordering issue of network only plugin activation check. WordPress#22454 (comment) WordPress#22454 (comment) WordPress#22454 (comment)
Thanks for the review @spacedmonkey! I've pushed commits or left comments for all of your feedback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is good first version. Once merged we can do some testing and tweak as required.
Definitely. I've tested with the inserter and searching blocks and installing blocks all still works as normal in my testing. Going to go ahead and merge this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once merged we can do some testing and tweak as required.
Definitely.
I've tested with the inserter and searching blocks and installing blocks all still works as normal in my testing. Going to go ahead and merge this.
I am able to reproduce the issue that i mentioned in my review in master now. I'm curious, how did you test?
Introduces a set of plugin endpoints, intended to compliment the block directory searching endpoints.
Brings tests and endpoint code from tellyworth/wordpress-develop/add/rest-api/block-directory.
For some reason it seems like the filesystem isn't available when running tests.
Description
How has this been tested?
This has been manually tested and has some test coverage. Needs more test coverage and coverage on multisite.
Types of changes
New Feature
Checklist: