Giter Site home page Giter Site logo

theme-updater's Introduction

No Longer Supported

Since we are no longer supporting this plugin please feel free to look at one of the many forks for possible updates and fixes. If you are couragous enough you can fork this project and upgrade it as needed. Thanks

Wordpress plugin: a theme updater for GitHub-hosted Wordpress themes

Do you wish that you could somehow get update notifications within WordPress for custom themes that you use for your site? Perhaps a custom theme that you had developed specifically for your site? Or a theme you developed for a client site? And do you wish you could do "automatic updates" to those custom themes just like you can for public themes available from WordPress.org?

This WordPress plugin lets you host a custom theme in a Github public repository (private repos are not supported) and then notify sites when a new version of the theme is available. Those sites can then perform an auto-update just as with publicly available themes. The plugin also allows you to roll back to a previous version of the theme.

This plugin works with WordPress in both a standalone and MultiSite mode and has been tested up to WordPress 3.3.x. It can be found in the WordPress plugin directory at:

Bugs, feature requests or other suggestions should be filed as issues at the plugin's Github repository

Screenshots

Screenshot One


Screenshot Two


Screenshot Three


Installation

Here is a sample theme. Download (.zip)

1 - Publish your theme to a public GitHub Repository

2 - Update Your theme's style.css

Add Github Theme URI to your style.css header, this will be where the plugin looks for updates. I also recommend using semantic versioning for the version number. (Note that the version number does not need to start with "v" as shown in the examples below. You can simply use a number such as "1.2.0". You just need to be consistent with how you create version numbers.)

Example header:

Theme Name: Example
Theme URI: http://example.com/
Github Theme URI: https://github.com/username/repo
Description: My Example Theme
Author: person
Version: v1.0.0

Push these changes back to the project.

3 - Create a new tag and push the change back to the repo

$ git tag v1.0.0
$ git push origin v1.0.0

Note, your tag numbers and theme version numbers should match. If you want to increment the version number, be sure to update and commit your style.css prior to creating the new git tag.

4 - Upload your modified theme to your WordPress site

Before the plugin can work, your theme with the Github Theme URI addition needs to be uploaded to our WordPress site.

  • Create a ZIP file of your theme on your local computer.
  • Inside your WordPress admin menu (standalone) or network admin menu (MultiSite) go to the Install Themes panel and click on "Upload".
  • Choose your ZIP file and press "Install Now".

Your theme will now be installed inside of WordPress and can be activated for your site. From this point forward all updates will be installed automatically once the plugin is activated.

5 - Download and install the plugin

Inside your WordPress admin menu (standalone) or network admin menu (MultiSite) choose "Add New" under the Plugins menu. Search for "Theme Updater" and this will bring you to the plugin's WordPress page where you can install the plugin directly into your WordPress installation. (Alternatively you can visit that page, download the plugin as a zip file and upload it to your WordPress install, but why go through all that work?)

With the plugin installed and activated (it must be network activated on multisite installs) on your site and the theme uploaded, the next time you push a new tag to your Github repository, it will be recognized by the plugin and an update notice will appear in your admin menu.

This is no configuration or settings panel for this plugin.


Updating The Theme

The process of updating your theme and generating auto-update notifications is now simply this:

1 - Make your changes to the theme and commit those changes to your local git repository.

2 - IMPORTANT - Update your style.css file with a new version number and commit that change to your local repository.

3 - Push your changes to the Github repository

$ git push origin master

4 - Create a new tag and push the change back to the repo

$ git tag v1.1.0
$ git push origin v1.1.0

Note, you should use the identical number for the tag that you did for a version number in style.css in step #2.

That's it. Now any sites with your theme installed will receive an update notification the next time their WordPress installation checks for updates.


Code Comments

The flow of the plugin is:

1 - Get the Theme's Update URI

Code is a mashup of Wordpress source. I'm looking at:

2 - Get the github tags

Pull the tags trough the Repository Refs API.

3 - Notify Worpress of the Update

Publish the update details to the response array in the update_themes transient, similar to how Wordpress updates themes.

Changelog

*** v1.3.7 - July 23, 2012

  • URLencode repo and user names
  • Handle Github API errors appropriately

*** v1.3.6 - July 23, 2012

v1.3.5 - July 23, 2012

v1.3.4 - February 8, 2012

  • Fix to SSL issue. Code by Github user bainternet. Added by Github user danyork.

theme-updater's People

Contributors

beck avatar conover avatar danyork avatar dfieldfl avatar jslang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

theme-updater's Issues

Inconsistency in templates and updated detection

Hey Beck,

I found another problem with Plugin update detection. I created a simple theme to test and you can see it here https://github.com/juarezpaf/i2uTheme this theme works just fine and plugin recognize my updates just like that http://awesomescreenshot.com/030ekz709 but I'm starting to use the great Whiteboard Framework, but this theme doesn't have internationalization and other cool features and I'm going to improve it, so I copy the files to this repo https://github.com/juarezpaf/Whiteboard-Revamped and the plugin is not detecting updates in my Tags http://awesomescreenshot.com/015ekzm42, any assistance we'll be great.

Thanks in advance!

notices for depricated function

Notice: get_themes is deprecated since version 3.4! Use wp_get_themes() instead. in /public_html/wlwp.sethmatics.com/wp-includes/functions.php on line 2628

I highly suggest you turn on debug mode and click through the WordPress admin. Still some issues hanging around in there. Now that you have updated the plugin I'm going to take a second look at integrating a "more full" version of what you have but simply activating the plugin gives me errors (notices that cause problems while developing).

single site install issues

  • Can't roll back a theme
  • The theme link is using a broken in-window popup instead of a new window linking to github
  • Some styling would be nice to distinguish github vs standard themes

f(x) Updater - Auto Theme and Plugin Updater

Hi all,
It seems that this project is no longer updated/maintain for over 2 years?

I create a similar project: f(x) Updater: https://genbumedia.com/plugins/fx-updater/
The feature is still limited, but I use it on daily basis.

GitHub Repo: https://github.com/turtlepod/fx-updater/

It's not a PHP script, but a WordPress plugin, so you can use your own site as update server for your private/premium themes and plugins. You can create a "theme repo" and "plugin repo" entry, just like creating post.

So it's not using external site as update server (like Github) but using your own WP install/site.
But if you host your project on github (public), you can use github zip URL as download file url.

I highly recommend you check the screenshot to get ideas how this plugin works.

thanks. I hope this plugin is useful.

  • David.

Installation for MultiSite should mention "Network Activate"

I just realized that the installation instructions don't mention that in a WordPress MultiSite environment you should "Network Activate" the plugin.

I just installed the plugin into one of my sites that uses WordPress MultiSite. Then, instead of doing "Network Activate", I said to myself that I'd just test it in one of the blogs. I went to that blog and to the plugins menu where I clicked "Activate" on the plugin... but of course that was useless because updating the themes in a MultiSite installation is ONLY possible through the "Network Admin" interface. When I went to the Appearance->Themes in my test blog there was no update info at all, as there shouldn't be.

Interestingly, when I then went into Network Admin and into Themes, I did see that an update was available for a Github-hosted theme. So essentially activating the plugin for one of the blogs did do a "network" activation.

This should be clarified in the installation instructions. (And I'll volunteer to add the text sometime in the next week or so if no one else does it first.)

Need LICENSE file outlining distribution license for code

Developer team,

As I was thinking about incorporating this code directly into my theme (and noting a couple of others have done this in issue #20 ), I realized that there was no LICENSE file or anywhere else indicating that distribution license the code falls under.

I think a file needs to be added. For my part I'd encourage use of a permissive license like the BSD, Apache or MIT license, primarily because that makes it easiest for people to use the code.

Dan

WordPress 3.4 - Error with Github Theme Updater. Incorrect github project url.

I just installed WordPress 3.4 on my site and the error in issue #18 was replaced with a new error:

Error with Github Theme Updater. Incorrect github project url. Format should be (no trailing slash): https://github.com/<username>/<repo>

as shown here:

Also, very bizarrely this message now appears for ALL my themes! (even ones that have no linkage whatsoever to Github)

Rewritten - fixed all notices and errors - reference only

We used your code to build our own updater function. Biggest difference being we were doing it for theme inclusion instead of plugin inclusion. Several items were removed and several other items were hard coded. Please not this gist is the codes current state within our theme but hopefully it may have some references on how to fix your plugin to work correctly on WordPress again.

https://gist.github.com/3133020

Getting an updated plugin to WordPress.org?

Guys,

How can I help with getting an updated plugin out to WordPress.org? (with the fix for the SSL failure issue)

I notice you have a 'svn' branch and I'm guessing that is for the WordPress.org SVN site. Would it help if I go in and update that branch with some of the doc fixes I did and then send you a pull request?

Basically... I'm here to help... what can I do to help you guys get a new version of this plugin up online as soon as possible? Just tell me what I can do and I'll do it.

(I want to get this plugin out to a couple of people to see if this will solve a custom theme distribution challenge I'm facing, but I want them to pull it from WP.org and at least one will need the SSL fix.)

Thanks,
Dan

SSL certificate problem, verify that the CA cert is OK.

I just setup the theme I am using on one of my Wordpress site to use Theme Updater. I got it working on another site I have hosted, but with the site I am getting the issue on is failing with theme updates.

Here is the error I am getting:

Download failed. SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed.

I am not entirely sure where the SSL certificate problem is coming from. Any help would be much appreciated.

Thank you!

Plugin documentation (readme.markdown) needs updates

In wanting to refer some people to this plugin and repo, it seems to me that the following updates need to be made to the readme.markdown file:

  1. Some introductory text should be added at the beginning explaining what this does. Also that it works with standalone or MultiSite WordPress.
  2. There should be a link over to the page on WordPress.org where people can install the plugin (or explain that you can search on "Theme Updater" in the WordPress admin interface.
  3. A step needs to be added to explain that after the theme has been updated it needs to be uploaded to your WordPress installation.
  4. I would also suggest a note be added that the "v" in the tags in "v1.0.0" is not mandatory as some people (myself included) may find that rather strange to see within the WordPress interface.

I will work on some draft text and send over a pull request when done. (Any other suggestions for edits are welcome.)

WordPress.org should indicate compatibility to 3.3.1

With the update to 1.3.4 on WordPress.org today (THANKS!), it still says that it is compatible only up to 3.1.4, which resulted in a warning message when I went to install it onto my WP 3.3.1 system.

It does work with 3.3.1 and so that meta-data can be updated.

Docs should mention that there is no configuration or settings panel

I realized as I was getting ready to tell someone about this plugin that the documentation doesn't say anything about the fact that the plugin "just works". There is no configuration interface, no settings panel, nothing. Updates just appear in the Themes panel when there are updates to display. A note to that effect should be in the docs.

(And as with issue #13 I'll volunteer to add some text if no one else does it first.)

theme folder gets renamed

Hello,
I don't know if it's the Theme-Updater plugin or WordPress core that renaming my theme folder on update, but eachtime I update my theme it gets renamed and I don't find what is causing this.

To be clear, on update my theme folder get renamed from "mythemename" to "anou-mythemename-b18c999" where anou is my user name on github and the number I don't know...

or maybe github api changed ?

Any help appreciated
David

Theme options meta is rewritten

This is the first time I am attempting to use git and the theme updater in a build and I may be missing something but when I push an update the theme options are ignored/rewritten... Any suggestions or work arounds?

I'm just getting started with https://github.com/bielefeldt/wb-hospital, it's based from bones by themble and uses https://github.com/leemason/NHP-Theme-Options-Framework for theme options and settings.

Disclaimer: the theme is still in development and not complete or cleaned...

Documentation fixes - custom theme, spacing

In re-reading the doc fixes I just sent in, I realized that in the first paragraph where I mention a "private" theme, the correct WordPress terminology would be to talk about a "custom" theme. That instance should be changed.

Also, the spacing around the "-" after numbers is inconsistent. Sometimes there is no space, "1-", and sometimes there is a space, "1 -". This is just a nit, but something to be picked up in an update.

I will make these fixes when i get a chance if no one else does.

Theme Updater no longer working? "Github theme does not have any tags"

I've noticed in the past week or so that the Theme Updater is no longer working. For all my themes I now get the message "Error with Github Theme Updater. Github theme does not have any tags".

Theme Updater error message

This is for themes that definitely DO have tags and were working perfectly fine with the Theme Updater before.

I noticed this on two different systems running WordPress 3.3.1 and 3.3.2, and I had someone leave a message on my blog (where I wrote about Theme Updater) saying she was having this problem with WP 3.4.

Did something perhaps change with the Github APIs recently?

Possible to disable tag comparison and only refer to "Version" from style.css

I don't see how it's necessary to check both the "Version" number and the github tag when looking for updates. I'm using the github app for mac which doesn't support tagging... so in order to use Theme Updater I'm forced to switch to the command line each time (to update the tag).

Is there an easy way to disable this part of the update check?

Weird behavior after installing & setting up

On one Wordpress install that I have, I am getting and error that says: "Automatic update is unavailable for this theme" even though it checks github and sees the repo is newer. The sample theme provided is doing the same thing, so I'm pretty sure its not just my repo/theme.
Here's a picture: http://economy.webcraftlabs.com/screenshot.png

Also, when I tried installing it on another site, and when I click activate I get the following error:
Fatal error: Cannot redeclare class WP_Upgrader in /mnt/stor9-wc1-dfw1/629700/www.webcraftlabs.com/web/content/wp-admin/includes/class-wp-upgrader.php on line 23

WordPress.org - suggestion about adding extra theme headers

http://wordpress.org/support/topic/plugin-theme-updater-adding-extra-theme-headers?replies=1

Over on WordPress.org there is a suggestion about a way to add extra theme headers. The suggestion is copied here:


Unfortunately Theme URI is not available via default get_theme_data(), which is probably for the best because I don't want to conflict with standard wordpress conventions.

Couldn't you do:

add_action( 'extra_theme_headers', 'frosty_extra_theme_headers' );
function frosty_extra_theme_headers( $headers ) {
    $headers['Github Theme URI'] = 'Github Theme URI';
    return $headers;
}

Then you can call:

$theme_data = get_theme_data( '/style.css' );
$theme_data['Github Theme URI']

Fatal Error - Cannot Upgrade WordPress

Install the plugin, activate it and then goto the updates tab and try to update WordPress. You can "manually re-install the current version" with the button at the top.

At first I though it was just something I modified for my "one theme version" of your script, but its not. WordPress updates completely fail with this plugin activated.

Fatal error: Cannot redeclare class Plugin_Upgrader in /home/ibseth2/public_html/wlwp.sethmatics.com/wp-admin/includes/class-wp-upgrader.php on line 632

Note that its probably not the "best way" to fix the problem, but I wrapped my filter call like this to solve the issue:

if(!empty($_GET['action']) && $_GET['action'] == 'do-core-reinstall'); else {
require_once('updater-assets.php');
add_filter('site_transient_update_themes', 'transient_update_themes_filter');
}

Note that my filename and location might be different then how you have your programmed. Its just for reference. You might use this until somebody figures out a better way to detect and not include that class object twice.

Automatic update is unavailable

I'm running WordPress 3.5.1.

I get the following message that says there an update available but that "Automatic update is unavailable",

Screen Shot 2013-03-08 at 12 26 50 AM

Here is my repo: https://github.com/parleer/eccdsm-wptheme-demo

Originally I was using https://github.com/parleer/eccdsm-wptheme.git, which has the theme in a subdirectory. I thought that might be the problem, so I created the other repo with all theme files in the root folder.

When I click on "View version details", this is what I see:

Screen Shot 2013-03-08 at 12 30 54 AM

Any help is much appreciated!

Thanks, Ryan

Tags out-of-date

Guys,

I noticed that the Github tags are out-of-date with the code version numbers:

https://github.com/UCF/Theme-Updater/tags

After I submit the documentation tweaks in #8, do you want to call this a 1.3.4 release and tag it? (I did already update updater.php with that version number.)

I'm assuming you guys need to tag it (versus me doing so and sending you a pull request - do tags work in pull requests?)

Dan

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.