Thread Starter
remiCs
(@emersong20)
PS: I can’t use wp-cli because I can’t require my customers has SSH access to install in your web hosting provider.
Thread Starter
remiCs
(@emersong20)
I didn’t find any endpoint available that allows me send a zip archive to upload a plugin
Are you aware that using the REST API for administrative tasks requires an authorization header containing the site owner’s WP username/password? Asking customers to provide these credentials to you is not in their best interest.
Also keep in mind that you have no idea whether a customer site has filesystem restrictions that prohibit non-media HTTP file uploads. WordPress has some built-in ways to get around the restrictions, but they are interactive and therefore not available in the REST API.
If the code you desire is meant to run on the customer’s site, give some thought to writing a custom plugin that handles these tasks. A number of (mainly older) themes in the repository here contain code that is fairly close to what you would need in such a custom plugin.
Thread Starter
remiCs
(@emersong20)
Are you aware that using the REST API for administrative tasks requires an authorization header containing the site owner’s WP username/password? Asking customers to provide these credentials to you is not in their best interest.
As far as I know, you can create an “application secret” that does not require the customer to share your user and password.
If the code you desire is meant to run on the customer’s site, give some thought to writing a custom plugin that handles these tasks.
Sorry, I can’t develop a WordPress plugin because at the end of the day I need to have an API to integrate with an external system. Maybe I could develop a plugin that creates a new wp-json endpoint in WP REST API:
POST /wp/v2/plugins/upload
Do you have any idea how could I start?