Giter Site home page Giter Site logo

ryanmerritt / wordpress-github-plugin-updater Goto Github PK

View Code? Open in Web Editor NEW

This project forked from radishconcepts/wordpress-github-plugin-updater

0.0 1.0 0.0 107 KB

This class is meant to be used with your Github hosted WordPress plugins. The purpose of the class is to allow your WordPress plugin to be updated whenever you push out a new version of your plugin; similarly to the experience users know and love with the WordPress.org plugin repository.

Home Page: https://github.com/jkudish/WordPress-GitHub-Plugin-Updater

wordpress-github-plugin-updater's Introduction

WordPress Github Plugin Updater

This class is meant to be used with your Github hosted WordPress plugins. The purpose of the class is to allow your WordPress plugin to be updated whenever you push out a new version of your plugin; similarly to the experience users know and love with the WordPress.org plugin repository.

Not all plugins can or should be hosted on the WordPress.org plugin repository, or you may chose to host it on github only.

The code is still in it's infancy, but I am currently using it on a production plugin and production website, without any glitches. That being said, please consider this as a beta release. The project started off as a private client request, but is now public for anyone to collaborate on. I am open to any suggestions :)

Usage instructions

  • The class should be included somewhere in your plugin. You will need to require the file (example: include_once('updater.php');).

  • You will need to initialize the class using something similar to this:

      if (is_admin()) { // note the use of is_admin() to double check that this is happening in the admin
      	$config = array(
      		'slug' => plugin_basename(__FILE__), // this is the slug of your plugin
      		'proper_folder_name' => 'plugin-name', // this is the name of the folder your plugin lives in
      		'api_url' => 'https://api.github.com/repos/username/repository-name', // the github API url of your github repo
      		'raw_url' => 'https://raw.github.com/username/repository-name/master', // the github raw url of your github repo
      		'github_url' => 'https://github.com/username/repository-name', // the github url of your github repo
      		'zip_url' => 'https://github.com/username/repository-name/zipball/master', // the zip url of the github repo
      		'sslverify' => true // wether WP should check the validity of the SSL cert when getting an update, see https://github.com/jkudish/WordPress-GitHub-Plugin-Updater/issues/2 and https://github.com/jkudish/WordPress-GitHub-Plugin-Updater/issues/4 for details
      		'requires' => '3.0', // which version of WordPress does your plugin require?
      		'tested' => '3.3', // which version of WordPress is your plugin tested up to?
      		'readme' => 'README.MD' // which file to use as the readme for the version number
      	);
      	new WPGitHubUpdater($config);
      }
      
  • In your Github repository, you will need to include the following line (formatted exactly like this) anywhere in your Readme file:

    ~Current Version:1.4~

  • You will need to update the version number anytime you update the plugin, this will ultimately let the plugin know that a new version is available.

  • Note: this class will unfortunately not work with a private repository, your repository needs to be publicly accessible. If anyone knows how to make this work for private repositories, please get in touch!

Changelog

1.4

  • Minor fixes from @sc0ttkclark's use in Pods Framework
  • Added readme file into config

1.3

  • Fixed all php notices
  • Fixed minor bugs
  • Added an example plugin that's used as a test
  • Minor documentation/readme adjustments

1.2

1.0.3

1.0.2

  • Fixed potential timeout

1.0.1

  • Fixed potential fatal error with wp_error

1.0

  • Initial Public Release

Credits

This class is built and maintained by Joachim Kudish

License

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:

Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

wordpress-github-plugin-updater's People

Contributors

jkudish avatar sc0ttkclark avatar franz-josef-kaiser avatar maksidaindie avatar

Watchers

Ryan Merritt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.