Code Monkey home page Code Monkey logo

tgm-updater's Introduction

TGM Updater

Here we go, world. A first-class premium plugin updater class that has been battle-tested and approved. It has been tested, refined, used and abused on over 10,000 WordPress installs. To put it short - this class simply works. Just follow the instructions correctly and you will be up and running with your own automatic plugin updates in no time flat!

This class has been tested and works with both regular and Multisite installs, and it even works with services like ManageWP!

Usage

Drop the following code somewhere inside your main plugin file. Adjust the commented settings with your own plugin information.

add_action( 'init', 'tgm_updater_plugin_load' );
/**
 * Loads the updater file and initializes the updater.
 *
 * IMPORTANT: Namespace this function.
 *
 * @since 1.0.0
 *
 * @package Test TGM Updater Plugin
 * @author  Thomas Griffin
 */
function tgm_updater_plugin_load() {
	
	// Return early if not in the admin.
	if ( ! is_admin() ) {
		return;
	}
	
	// Load the updater file.
	if ( ! class_exists( 'TGM_Updater' ) ) {
		require plugin_dir_path( __FILE__ ) . 'class-tgm-updater.php';
	}
	
	// Prepare updater args and initialize the updater.
	$args = array(
        'plugin_name' => 'Your Plugin Name',		  // Your plugin name goes here.
        'plugin_slug' => 'your-plugin-slug',		  // Your plugin slug goes here.
        'plugin_path' => plugin_basename( __FILE__ ),
        'plugin_url'  => trailingslashit( WP_PLUGIN_URL ) . 'your-plugin-slug',
        'remote_url'  => 'http://yourdomain.com',     // Set to the domain that should receive update requests.
        'version'     => '1.0.0',					  // Adjust to your latest plugin version.
        'key'         => 'license_key_here_if_needed' // Optionally, you can set this to false if you don't want to verify updates.
    );
    $tgm_updater = new TGM_Updater( $args );
	
}

That's it. You've now integrated the updater class into your plugin.

License

The TGM Updater class is released under the GPL v2 license.

Issues

Got bugs? Make sure to report them as an issue so they can be squashed.

Credits

This class was developed and is maintained by Thomas Griffin.

tgm-updater's People

Contributors

garyjones avatar thomasgriffin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tgm-updater's Issues

Create a meta plugin for MultiSite instances

Plugins utilizing this class (or any other class for that matter) inside of MultiSite will not receive updates if they are activated on an individual site basis (network activated MS plugins are fine). A meta plugin should be created that can be customized so that plugin authors can provide it as a complimentary download to ensure update parity across all types of WordPress installs.

About future

Hi,
First of all, thanks a lot for releasing this project. Can we use it for themes?

Add ability to mimic all of WordPress' Plugin Info API data

There can be more data retrieved from the WordPress Plugin Info API that I have not accounted for, such as download counts, ratings and notes. These should be added to give plugin authors full control of the update experience and to integrate as seamlessly as possible into the WordPress update system.

f(x) Updater - WordPress Update Server

Hi all,
It seems that this project is no longer updated/maintain for over 2 years?

I create a similar project: f(x) Updater: https://genbumedia.com/plugins/fx-updater/
The feature is still limited, but I use it on daily basis.

GitHub Repo: https://github.com/turtlepod/fx-updater/

The script TGM updater is the updater class to be included in a theme/plugin. (only half the project)
But f(x) Updater also include the updater server.

It's not a PHP script, but a WordPress plugin, so you can use your own site as update server for your private/premium themes and plugins. You can create a "theme repo" and "plugin repo" entry, just like creating post.

So it's not using external site as update server (like Github) but using your own WP install/site.
But if you host your project on github (public), you can use github zip URL as download file url.

I highly recommend you check the screenshot to get ideas how this plugin works.

thanks. I hope this plugin is useful.

  • David.

What is the remote url exactly? The URL to the .zip?

I don't know exactly how it should work. I know another library where you just add the plugin slug to a URL, and the script check for the plugin-slug.zip on the other FTP server and shows in WP that an update is available and can be automatically updated.

With the TGM Updater I am asking myself if the remote url should be the plugin-slug.zip URL and this class also checks if the .zip is newer than my installed plugin version?

Do I just need to add my .zip file to another FTP server and add the URL to the TGM Updater?

serve updates from subdomain

I may be willing to contribute the code to server downloads from a regular subdomain URL.
can you give me an idea of what would be necessary, where I should start?

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.