Giter Club home page Giter Club logo

wp-foo-plugin's Introduction

#WP Foo Plugin A Wordpress Plugin that is mainly used for testing

You can use this plugin to test Automatic Updates For Private And Commercial Plugins.

See below details and instructions on how to use and configure this to work in your plugins.

For plugins stored on Github repositories, the below configs are used.

Metadata

Can be stored within the plugin folder e.g. wp-foo-plugin/metadata.json so when it is committed to the repo it will be publicly available via the url using the raw file e.g. https://raw.githubusercontent.com/ramalveyra/wp-foo-plugin/master/metadata.json. This can also be placed on a separate repository ie. a separate repository that would just contain the metadata for every plugin you own as long as it is publicly available.

Change this each time there is an update to the plugin.

Supply the details that you want to show within the update on this file.

{
    "name" : "WP Foo Plugin",
    "slug" : "wp-foo-plugin",
    "homepage" : "https://github.com/Link7",
    "download_url" : "https://github.com/ramalveyra/wp-foo-plugin/archive/v0.1.zip",
    
    "version" : "0.1",
    "requires" : "0.1",
    "tested" : "0.1",
    "last_updated" : "2012-04-21 09:00:00",
    "upgrade_notice" : "List here why you should upgrade...",
    
    "author" : "Link7",
    "author_homepage" : "https://github.com/Link7",
    
    "sections" : {
        "description" : "(Required) Plugin description. Basic HTML can be used in all sections.",
        "installation" : "(Recommended) Installation instructions.",
        "changelog" : "(Recommended) Changelog. <p>This section will be opened by default when the user clicks 'View version XYZ information'.</p>",
        "custom_section" : "This is a custom section labeled 'Custom Section'." 
    }
}

NOTE: For this to work on plugins stored in Github, the download_url has been supplied with the plugin's "download zip" link: https://github.com/ramalveyra/wp-foo-plugin/archive/v0.1.zip.

Auto updater client libraries and configs

A copy of the client library: http://1.shadowcdn.com/files/plugin-updates-1.4.zip must be placed within your plugin directory.

On top of the main plugin file, supply the necessary auto updater plugin call

require 'plugin-updates/plugin-update-checker.php';
$MyUpdateChecker = PucFactory::buildUpdateChecker(
    'https://raw.githubusercontent.com/ramalveyra/wp-foo-plugin/master/metadata.json',
    __FILE__,
    'wp-foo-plugin'
);

NOTE: One of the params supplied is the link to the raw version of the metadata file.

When all of the items above have been configured properly, there should be a link saying "Check for Updates" on the plugin when viewed on the admin plugin list. It should also display a badge whenever there is an update available (whenever there is a change in the metadata json file). The default cron check (wordpress) is every 12 hours and can be configured as well.

See http://w-shadow.com/blog/2010/09/02/automatic-updates-for-any-plugin/ for more details on the auto updater plugin configs.

A big note, use a separate plugin copy and NOT the actual cloned (git) repo once you have added the auto updater. The idea of auto update is that there would be no need to do a "git pull" to update your plugins.It will instead use the default way Wordpress allows updates to the plugins which is via the UI. If you use a git cloned repo of your plugin and apply the update via the UI, it will overwrite the plugin folder and the git repository will be replaced, your branches and git references etc. will be lost.

Credits: Yahnis Elsts http://w-shadow.com/

wp-foo-plugin's People

Watchers

 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.