Giter Club home page Giter Club logo

unisphere_notifier's Introduction

WordPress Theme Update Notifier

This is a simple WordPress theme update notifier that will provide your theme Buyers with a notification every time you issue a theme update.

It's a very simple script that requires and assumes you have an XML file in your own server. This XML file serves as an endpoint for the script to check what the latest version of the theme is, and compares it with the current version of the theme installed in the Client's server.

One of the script requirements is that the version number are floats. Versions like 1.0, 1.1, 2.3 are acceptable and required.

Installation

Upload the notifier.xml file to your own server (the update notifier on the Client sites will check this file for the latest version)

Copy the update-notifier.php file to the root of the theme.

Edit your theme's functions.php file and include the update-notifier.php file with the following code:

require('update-notifier.php');

Edit the update-notifier.php file and make the appropriate changes to the following constants:

define( 'NOTIFIER_THEME_NAME', 'JohnDoe' ); // The theme name
define( 'NOTIFIER_THEME_FOLDER_NAME', 'johndoe' ); // The theme folder name
define( 'NOTIFIER_XML_FILE', 'http://www.yourdomain.com/johndoe/notifier.xml' ); // The remote notifier XML file containing the latest version of the theme and changelog
define( 'NOTIFIER_CACHE_INTERVAL', 21600 ); // The time interval for the remote XML cache in the database (21600 seconds = 6 hours)

Everything should be in place now. Every time you submit a theme update you should edit the XML file in your server and change the following code to the latest version you've updated:

<latest>1.0</latest>

This way, your Clients will see an update notification on the WordPress admin panel informing them that there's a new version available and they should update.

NOTE: when you submit theme updates make sure to update the theme version number in the style.css file. This file is in the root of your theme and the "Version" is the value used for comparison.

Screenshot

theme update notifier

unisphere_notifier's People

Contributors

that-joao avatar

Watchers

James Cloos avatar Dinesh Kesarwani 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.