I have close to 30 wordpress installs that will grow very rapidly to double that number.
Each of these sites has the same theme that I frequently am updating.
I'd like to create a script on one of my servers that acts as a control panel for all my sites so that I can push out an updated theme file for all selected sites. The sites will be on multiple servers.
My interface consists of a list of sites (http://site1.com, http://site2.com, etc) with a checkbox beside each one and an "Update Sites" button at the bottom of the list.
I'd like to enable my "Update Sites" button to go out to all those selected sites and开发者_开发技巧 update/overwrite the files inside my theme directory with the updated version of the theme (which will always be stored in a specific known directory on this specific server).
Any help you could provide on the functions required would be appreciated.
In terms of authentication, Ideally, I would like to avoid having to supply login credentials for each individual site. Rather, I'd like to place something inside the site that would serve as a handshake token between my update server script and the target site. Not sure if this is possible or allowed with wordpress.
You're looking for rsync + ssh with passwordless key authentication, not something in PHP. Wheel reinvention imminent.
(You could still execute the rsync command from your PHP script, obviously.)
foreach ($hosts as $host) { exec("rsync theme_dir_here $host:theme_dir_here"); }
I think you could create a program on each installation that can grab files from a server predefined server when called. It then copies the theme files it got into the themes folder, and change the wordpress settings file to use the new theme.
The page that you discribed would just call the file on each installation you choose with cURL.
This might help you. http://infinitewp.com You can manage(updates, plugin/themes, do backups) all your WordPress sites from one single location. They don't have an API yet but I think they should have it soon.
精彩评论