Wordpress Theme

How to add Theme Auto Update notifier

8 views May 17, 2017 February 9, 2018 admin 0


-- Download How to add Theme Auto Update notifier as PDF --


How to add Theme Auto Update notifier

What is WordPress?

WordPress is an open source CMS (Content Management System) coded in PHP and MySQL. WordPress is completely free and it allows us to easily customize the look of our website using its themes and plugins architecture.

What is WordPress theme:-

A WordPress theme is representation of your content and theme changes the design of your website, and its layout. Changing your theme changes how your site looks on the front-end, i.e. what a visitor sees when they browse to your site on the web.

Why to add theme Auto Update notifier?

Because if we make certain changes in theme we need to make sure that we tell our customer about it that we have upgraded the theme version which require lot of time and support time to tell them about it to cut it short we can add auto update notifier which will notify in wordpress dashboard if there are some updates.

What are the prerequisites?

https://s3-us-west-2.amazonaws.com/wpupdater/themeupdate/theme-update-checker.php ,and some codes

How do add theme auto update notifier?

1.You need to download the files from below link

https://s3-us-west-2.amazonaws.com/wpupdater/themeupdate/theme-update-checker.php

2.You need to downloaded file and include it in theme folder.

3.You need to create .json file,edit it accordingly and add the below code in it.

{ “version” : “1.3”, “details_url” : “http://dfythemes.com/vitrafficstore/”, “download_url” :”https://s3.amazonaws.com/vitraffic/product/OTO1/theme/vitraffictheme.zip”}

Decoding the code

i.”version” : “1.3”, //changed version need to change version in template style css of theme too

ii.”details_url” : “http://dfythemes.com/vitrafficstore/“, //demo theme url

iii. “download_url” :”https://s3.amazonaws.com/vitraffic/product/OTO1/theme/vitraffictheme.zip

//need to replace the changed version theme file on amazonS3 on same link and set the permission properly can be viewed by all.

The parameters will be same but the values will change according to the theme.

4.After creating Json file you need to upload it on C-panel

On below path and make it public

http://dfythemes.com/changelog/theme/

5.After that you need to edit and add the below code in plugin’s main file.

require ‘inc/theme-update-checker.php’;

$example_update_checker = new ThemeUpdateChecker(

‘vitraffic’,

‘http://dfythemes.com/changelog/theme/viralinfooto.json’

);

Decoding the code

i.require ‘inc/theme-update-checker.php’;

//will include the file, please check the file_path is proper

ii.$example_update_checker = new ThemeUpdateChecker(

// will create the instance of class.

iii.’vitraffic’,

//theme name.

iv. ‘http://dfythemes.com/changelog/theme/viralinfooto.json

//will compare the version in that file with the version in the theme file

The theme updater will check the log file uploaded on cpanel for update in version if there is change in version it will notify to update. Like in below screenshot

2017-05-17_1615

 

This is how you can add auto update notifier in your theme file.

What can go wrong

1.Set the permission of json file to public

2.First upload or replace the file on the same link and set the permission view by all.

3.Don’t forget to upload or replace the updated theme.

4.Don’t forget to make version changes in both json and theme main file.

 

Created By Rahul