UpdateCheck for CMSimple_XH

A little CMSimple-Plugin to help to keep your CMSimple_XH installation up-tp-date

Version 1.2
© 2013-2014 Holger Irmler, http://CMSimple.HolgerIrmler.de.


Installation

  1. Always make a backup of your installation before adding a new plugin.
  2. Unzip the archive and upload the files and folders into your plugins-folder.

    It should look like this:

    • [Root]
      • [2lang]
      • [cmsimple]
      • ...
      • [plugins]
        • ...
        • [pluginloader]
        • [hi_updatecheck]
          • [config]
          • [css]
          • [help]
          • [languages]
          • admin.php
          • index.php
          • JSON.php
          • updatecheck.php
          • version.nfo
        • index.php
      • [...]
      • index.php
  3. If you want to do the plugin-administration online, you must set write permissions for the folders 'config', 'css' and 'languages' and for the contained files.

  4. Configuration
    The default configuration should be fine for the most users. You'll find hints for the configuration options if you hover over the blue questionmarks.

Usage

By default (config-setting "autocheck" = 1), the plugin performs a "silent quick-check" in the background immediately after you login to your CMSimple_XH installation. If time is enough until you do your next click in the backend, and updates are available, you'll find an info-icon next to the logout-button in the menubar.
Beside this, a notification is displayed on top of the "System Info" page ( Settings -> Info ).


Info icon and notification at the "System Info" page


This "quick-check" is only done once per session.
Click the icon or the link at the System-Info page to start a complete update-check.



Example Updatecheck Results


From time to time you should check for updates by yourself:

go to Plugins -> hi_updatecheck -> Search for updates

Compatibility

Be warned! This plugin will only work with the original CMSimple_XH from www.cmsimple-xh.org.
Using it under other versions / forks may result in errors and/or wrong informations!



If you're not a developer, you can stop reading here.
Have fun and stay up to date ;-).




Developers View

If you're a plugin developer, me - and hopefully all the CMSimple_XH - users - will be happy when you prepare your plugins to work together with this script.

It's really simple and you must not made changes on your plugin-code.
All you need to do is to put a little file called "version.nfo" to the root-folder of your plugin and a renamed copy somewhere for the world readable on your server.

So how does it work?

UpdateCheck looks for a version.nfo - file in every pluginfolder, extracts the contained informations and compares them with the informations on your server.
Depending on the result, the user will get informations about available updates, the link to the download page, critical updates or just a hint that the plugin is up to date.

Creating a version.nfo file

The version.nfo is just a csv-file with exactly the following seven entries in one line:

Plugin_Name,Version,Readable_Version,Critical?,Additional_Infos,Download_Url,Url_to_remote_nfo


Field description:
*Plugin_Name: The readable name of your plugin, used for the info-messages in the (x)html-output
Example: Update-Check
*Version: The version of the plugin. This entry is used to compare the versions.
Format: everything PHPs version_compare() can understand
Examples: 1.5.7 or 1.3.2 RC ... or Build(dates) like 2013051601, 2013051602
*Readable Version: This entry is displayed in the (x)html-output to the user
Examples: 1.5.3 - 2013-05-16 or just 1.5.2 or anything useful for you
Critical? This field is used to inform the user about critical updates.
If you have released a version with a critical bug, give here it's version number and the user will notified with a warning message when his installed version is equal or older than given here.
Format: same as "Version" above.
NOTE: keep this entry in future releases too, if a user missed some former updates
Additional_Infos: This entry is displayed in the (x)html-output to the user.
Normally keep this field empty. You can only give a short additional hint in only one language. Beside this, every script / html markup will be removed
*Download_Url The full url to the downloadpage of the new version. This entry is used to build a link in the message displayed to the user.
Example: http://www.domain.tld?Plugins:Pluginname
*Url_to_remote_nfo Full url to the .nfo - file on your server with the latest version informations of the plugin. This file must be accessible over the internet.
Remember: this url should not change in the future!
Example: http://www.domain.tld/downloads/versioninfos/Pluginname_version.nfo

Note: fields marked with " * " must be not empty.
And don't forget the commas, if you leave fields blank! The plugin checks if exactly seven entries provided by the .nfo-file and ignore the plugin otherwise.

Complete Example from jQuery-Plugin:
(here I've used "Build" to compare the versions. "Critical?" and "Additional_Infos" is empty)
:


Save a file with the informations above to the root-folder of your plugin - same level as index.php and admin.php. The filename must be "version.nfo".
Then put a (renamed) copy of this file to your server, accessible by the url given in the last field "Url_to_remote_nfo".

That's all - beside updating the file(s) with every new version of your plugin.

Credits

The design of the message boxes based on an article written by Janko Jovanovic.
The icons used for the messages were created and provided for free by Miles Ponson.
The plugin icon was created and provided for free by Alexandre Moore.

Special thanks to Christoph M. Becker for checking my code, sharing ideas and giving constructive feedback regarding this plugin

The danish translation is provided by Jens Maegaard - www.JmNet.dk - www.CMSimple-xh.dk

Copyright & License

Copyright ©2013-2014 Holger Irmler - all rights reserved

License: GPL3

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Need help?

... visit cmsimpleforum.com.