Project Update API for Wordpress
Handles Wordpress plugin and theme update requests by comparing the
request data with files hosted on github,
bitbucket or your own gitlab server.
See Project Wiki for detailed information and documentation.
This is targeted to Wordpress plugin and theme developers who do not
want to use the official Wordpress Plugin Directory for whatever
For example some might want to use GIT instead of SVN or want to keep the project private and only distribute updates it to specific IP-addresses or to requests containing a valid API key.
It it possible to specify the branch on which the updates will be distributed so you can have a development branch and a live branch.
The projects class files are versioned itself and have their independent version.
- Tested with github and bitbucket in july 2012.
- Tested with gitlab version 2.7.0 installed on debian.
- Protected repositories on github.
- Public repositories on bitbucket.
I've written this project for my own needs so i am not willing to give full support. Anyway, i am very interested in any bugs, hints, requests or whatever. Please use the github issue system and i will try to answer.
- PHP 5.3
- Support for PHPs cURL functions
- PEAR module File_Archive
File_Archive is used to rename the project Folders for github and bitbucket and convert the archives from gitlab from tar.gz to zip. If you choose not to use it you have to set the global settings "useCache" and "renameFolders" to false.
- Make sure your web-server supports all the dependences.
- Download or Clone the Project Files into a folder on your web-server.
- Rename the globalSettings.json-sample to globalSettings.json
- Rename db.json-rename to db.json
- Make sure your www-user can write to:
- cache folder
- cookies folder
- temp folder
- db.json file
- Make your settings in globalSettings.json. See Project Wiki - Global Settings for details.
- Setup your first project
- Choose the appropriate file from /projectSettingsSamples folder.
- Copy it into /projectSettings folder.
- Rename it in [your Project Slug].json.
- Insert the project data. See Project Wiki - Project Settings for details.
- Check if everything works by testing one of the api requests. See Project Wiki - API Requests for documentation.
Preparing your Plugin/Theme
It is required that you change your plugin code so the update requests will not be send to wordpress.org but to your server.
I am currently developing a Wordpress sub-framework for handling this. Keep watching THEUPDATES standalone for more to come.
I have not tested it but it should work as well with the plugin and theme files of the Automatic Theme & Plugin Updater from jeremyclark13. Which, btw. can also be a great alternative to this project if you want to keep your plugin code completely on your server.
by Kaspars Dambis (firstname.lastname@example.org)
Modified by Jeremy Clark
- BitBucket API Library
by Anthony Steiner
Inspired means that i have seen these brilliant projects, started to use them
and than started to write my own version with the intention to just have the
functionality i really use.
I got the idea of how things are working by analyzing and using the code of them and i can't say where i used snippets from these projects but they've influenced my code strongly.
- Markdown Extra
A text-to-HTML conversion tool for web writers
PHP Markdown & Extra
Copyright (c) 2004-2009 Michel Fortin
Copyright (c) 2004-2006 John Gruber
- Random String generation from noobis.de
- json_readable_encode from php.net comments
by bohwaz licensed under GNU/AGPLv3 or GPLv3
- PEAR module File_Archive
- Supports now page-level DocBlocks before WP-project-info comment in the info-file.
- Internal change to the way the Request class gets its parameters from the request.
- Added a "clean_cacheandtemp" action (?action=clean_cacheandtemp&confirm=[yourPassword])
The confirmation password can be set in globalSettings.json.
- Added the filename to error outputs via _exit().
- Recursive dir deletion now via readdir() instead of glob().
- Added "remoteSlug" to documentation of optional project Settings.
- Added the possibility to include The pear package "File_Archive" from the projects folder. This way it is possible to change the package without affecting other projects relying on this package. The change might be required to address this issue.
- Minor bugfixes and cosmetics.
Here is a list of tasks that i think would be nice to have. But i did not took the time to build/test them.
- Test with larger repositories
- Get gitlab https to work
- Check protected github + public bitbucket
- Add forceCacheLive option for relying on local cache for a specific time frame
- Add cronjob requests for checking cache and gitlab login.
- Write tests
- Spice up the theme detail page.
- Backend ;)
This tasks are hard to me it would be nice if anyone can help:
- Check documentation for logical and spelling mistakes
- Check the code for security issues.
- Check the code for logic optimization.
I am not an native English speaker so please pardon any spelling or grammar mistakes. I'd really love to get some feedback for any errors in the documentation.
Copyright (C) 2012 Hannes Diercks
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.