From c164025bbfd1647acd14b618b5b00aed6a51747f Mon Sep 17 00:00:00 2001 From: JohnnyNT Date: Fri, 25 Apr 2014 15:19:27 +0200 Subject: [PATCH 1/6] Plugin name added Plugin name is necessary for WP to display it in "what's new" popup. --- api/index.php | 1 + api/packages.php | 1 + 2 files changed, 2 insertions(+) diff --git a/api/index.php b/api/index.php index bc642f7..1aadda5 100644 --- a/api/index.php +++ b/api/index.php @@ -58,6 +58,7 @@ $data = new stdClass; $data->slug = $args->slug; + $data->name = $latest_package['name']; $data->version = $latest_package['version']; $data->last_updated = $latest_package['date']; $data->download_link = $latest_package['package']; diff --git a/api/packages.php b/api/packages.php index d43f425..9327504 100644 --- a/api/packages.php +++ b/api/packages.php @@ -26,6 +26,7 @@ 'versions' => array( '1.0' => array( //Array name should be set to current version of update 'version' => '1.0', //Current version available + 'name' => 'Plugin name', //Plugin name 'date' => '2010-04-10', //Date version was released 'author' => 'Author Name', //Author name - can be linked using html - Author Name 'requires' => '2.8', // WP version required for plugin From 6415e0bed1fd26681d9fad0830f92454baac749b Mon Sep 17 00:00:00 2001 From: Dzoni Date: Sun, 2 Nov 2014 20:33:29 +0100 Subject: [PATCH 2/6] Update download.php --- api/download.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/download.php b/api/download.php index ab29708..3e59cf5 100644 --- a/api/download.php +++ b/api/download.php @@ -9,8 +9,8 @@ // loop over all the versions for each theme and plugin foreach ( $package['versions'] as $version ) { // md5 timestamp of current and previous day and the file name - $tod_md5 = md5( $version['file_name'] . mktime( 0, 0, 0, date( "m" ), date( "d" ), date( "Y" ) ) ); - $yes_md5 = md5( $version['file_name'] . mktime( 0, 0, 0, date( "m" ), date( "d" ) - 1, date( "Y" ) ) ); + $tod_md5 = md5( $version['file_name'] . mktime( 0, 0, 0, date( "n" ), date( "j" ), date( "Y" ) ) ); + $yes_md5 = md5( $version['file_name'] . mktime( 0, 0, 0, date( "n" ), date( "j" ) - 1, date( "Y" ) ) ); // test if the either of the md5 hashes match what was passed if ( $_GET['key'] == $tod_md5 || $_GET['key'] == $yes_md5 ) { $download = $update_folder . $version['file_name']; @@ -29,4 +29,4 @@ } } } -?> \ No newline at end of file +?> From 8e4cbaae8662fb8df420927170c726ac42ce2fe1 Mon Sep 17 00:00:00 2001 From: Dzoni Date: Sun, 2 Nov 2014 20:34:21 +0100 Subject: [PATCH 3/6] Update packages.php --- api/packages.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/packages.php b/api/packages.php index 9327504..11a2966 100644 --- a/api/packages.php +++ b/api/packages.php @@ -6,7 +6,7 @@ 'version' => '1.0', //Current version available 'date' => '2010-04-10', //Date version was released //theme.zip is the same as file_name - 'package' => 'http://url_to_your_site/download.php?key=' . md5('theme.zip' . mktime(0,0,0,date("m"),date("d"),date("Y"))), + 'package' => 'http://url_to_your_site/download.php?key=' . md5('theme.zip' . mktime(0,0,0,date("n"),date("j"),date("Y"))), //file_name is the name of the file in the update folder. 'file_name' => 'theme.zip', //File name of theme zip file 'author' => 'Author Name', //Author of theme @@ -35,7 +35,7 @@ 'downloaded' => '1000', // Number of times downloaded 'external' => '', // Unused //plugin.zip is the same as file_name - 'package' => 'http://url_to_your_site/download.php?key=' . md5('plugin.zip' . mktime(0,0,0,date("m"),date("d"),date("Y"))), + 'package' => 'http://url_to_your_site/download.php?key=' . md5('plugin.zip' . mktime(0,0,0,date("n"),date("j"),date("Y"))), //file_name is the name of the file in the update folder. 'file_name' => 'plugin.zip', 'sections' => array( @@ -56,4 +56,4 @@ 'info' => array( 'url' => 'http://your_plugin_webiste' // Site devoted to your plugin if available ) -); \ No newline at end of file +); From 897b621ee859158e722c68d2fbd500a8f45fb3f8 Mon Sep 17 00:00:00 2001 From: Dzoni Date: Sun, 2 Nov 2014 20:40:10 +0100 Subject: [PATCH 4/6] Plugin homepage Array key "homepage" is updated to "plugin_homepage" in order to achieve this: http://prntscr.com/52ds65 --- api/packages.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/packages.php b/api/packages.php index 11a2966..ca2bc8a 100644 --- a/api/packages.php +++ b/api/packages.php @@ -31,7 +31,7 @@ 'author' => 'Author Name', //Author name - can be linked using html - Author Name 'requires' => '2.8', // WP version required for plugin 'tested' => '3.0.1', // WP version tested with - 'homepage' => 'http://your_plugin_website', // Site devoted to your plugin if available + 'plugin_homepage' => 'http://your_plugin_website', // Site devoted to your plugin if available 'downloaded' => '1000', // Number of times downloaded 'external' => '', // Unused //plugin.zip is the same as file_name From b75fc2594994e659a140a3e8846c4ce5a25d8288 Mon Sep 17 00:00:00 2001 From: Nikola Tomic Date: Tue, 23 Nov 2021 19:05:03 +0100 Subject: [PATCH 5/6] Update readme.md test --- readme.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 71c5657..25834ae 100644 --- a/readme.md +++ b/readme.md @@ -4,6 +4,7 @@ *Any amount is always appreciated* +TEST ## General Info @@ -53,4 +54,4 @@ Child themes are now supported. If the theme being updated is meant to be a par ## Securing Download location -Downloads are now always secured by a md5 hash of the package file_name and timestamp of current date. When downloading file current timestamp and timestamp of previous day are compared to key received from update request, if either match zip file is passed, and file can be downloaded. \ No newline at end of file +Downloads are now always secured by a md5 hash of the package file_name and timestamp of current date. When downloading file current timestamp and timestamp of previous day are compared to key received from update request, if either match zip file is passed, and file can be downloaded. From 6a2e69dda4c4865a4c26f75eff3b41d0210e4c4c Mon Sep 17 00:00:00 2001 From: Nikola Tomic Date: Tue, 23 Nov 2021 19:07:27 +0100 Subject: [PATCH 6/6] Update readme.md --- readme.md | 56 ------------------------------------------------------- 1 file changed, 56 deletions(-) diff --git a/readme.md b/readme.md index 25834ae..2a02d41 100644 --- a/readme.md +++ b/readme.md @@ -1,57 +1 @@ -## Automatic Theme & Plugin Updater for Self-Hosted Themes/Plugins - -**Support This Developer: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SE9ZVJUS324UC** - -*Any amount is always appreciated* - TEST - -## General Info - -For themes and plugins that can't be submitted to official WordPress repository, ie ... commercial themes/plugins/, non-gpl licensed, written for one client. - -### Folder structure -* api (Folder to upload to server where updates will be housed) - * .htaccess (set Options+Indexes to allow checking to work properly) - * index.php (holds code used to check request for new versions) - * packages.php (file containing all info about plugins and themes) - * download.php (validates md5 key of date and package zip file) - * update (folder to hold all zip file updates for url masking - protected by .htaccess to disallow file listings) - - -* update (default folder for holding theme and plugin zip files) - * .htaccess (prevents indexing and viewing of any zip files in directory) - - -* plugin (folder for adding plugin update checking) - * test-plugin-update (simple plugin folder to show how update functions work) - * test-plugin-update.php (example plugin that only checks for updates to server) - - -* theme (folder for theme update checking) - * update.php (file that can be included from functions.php of theme to check for updates) - ---------------- - -**Important:** - -*Change $api_url to your api server url in:* - - /plugin/test-plugin-update/test-plugin-update.php - /theme/update.php - -## Adding new versions - -Edit the packages.php under api folder on your server. Commented thoroughly throughout with sections that need to be changed to reflect themes/plugins that are to be updated. - -## Adding additional themes/plugins - -Simply create another $package array with the key of the new theme/plugin slug and add all the appropriate info. When releasing the theme/plugin make sure that functions and variables are prefixed to prevent errors and allow multiple themes/plugins to be updated. - -## Child theme support - -Child themes are now supported. If the theme being updated is meant to be a parent theme the standard theme/update.php from the theme file will work. If the theme is a child theme of another theme comment out the parent theme section and uncomment the child theme section on the theme/update.php - -## Securing Download location - -Downloads are now always secured by a md5 hash of the package file_name and timestamp of current date. When downloading file current timestamp and timestamp of previous day are compared to key received from update request, if either match zip file is passed, and file can be downloaded.