Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Theme auto-update problem WordPress

  • SOLVED

EDIT: I think this problem automagically solved itself. I'd been clicking "Check Again" on the update page repeatedly, but to no avail. Then all of a sudden it just seemed to work for no apparent reason. I'm not sure how or why, but the problem seems to have just disapeared.




I'm trying to get an auto-updater working for a theme, but not having any luck whatsoever.

I followed the instructions here ... http://w-shadow.com/blog/2011/06/02/automatic-updates-for-commercial-themes/

And came up with the following which is not working ...
http://demo.pixopoint.com/static/randomtesttheme.zip


EDIT: <strong>The problem appears to be with the URL used for the API call ... http://wppaintbrush.com/?pixopoint_autoupdate_api=randomtesttheme</strong>


Any idea what I'm doing wrong?

Answers (3)

2011-10-03

Abdessamad Idrissi answers:

did you copy the api folder to the place it should? and did you change the variable "$api_url"? I can't find it your files :(

If you can pm me some login details I will fix this :)


Ryan Hellyer comments:

I don't know anything about $api_url. Where are you suggesting that be?

The theme was provided above:
http://demo.pixopoint.com/static/randomtesttheme.zip

And the URL for the corresponding JSON file (as declared in functions.php) is here ... http://wppaintbrush.com/?pixopoint_autoupdate_api=randomtesttheme


Ryan Hellyer comments:

Oh, and what are you wanting login details for?

This is a problem with a theme. You can just install it yourself.


Abdessamad Idrissi comments:

Ok if I understood your question: you have created a theme and wanted to share/sell it to the public and you want the users of the theme to be able to automaticlly update the theme you have created.. wright?
If so, then you would need to specify a link that your somewhere-installed-theme checks to see if you have made updates to it or not.. that's why you need an API in your server that communicates whith blogs who installed your theme and provide them with necessary data to download new versions of the theme that you have created.

PS; I needed the temporary login to check if you have setup the API directory.


Ryan Hellyer comments:

Did you look at the theme?

The API stuff is in there. That's what I'm stuck on and what the question is about.


Ryan Hellyer comments:

I've updated the post with specific information about where the problem lies.


Abdessamad Idrissi comments:

I found it :)
the method you are using depends on the filter

add_filter('pre_set_site_transient_update_themes', array($this, 'onTransientUpdate'));


to make it work I edited the functions.php


require( get_template_directory() . '/theme-update-checker.php' );

$example_update_checker = new ThemeUpdateChecker(
'randomtesttheme',
'http://wppaintbrush.com/?pixopoint_autoupdate_api=randomtesttheme'
);
add_action( 'load-update-core.php', $example_update_checker->checkForUpdates() );


Ryan Hellyer comments:

Thanks. That looks like it :)

I'll use your code for testing it with.

2011-10-03

WraithKenny answers:

I've built this before, and while I don't have time for a complete answer, I can tell you that getting the code in the plugin to work well as a theme is tougher then the original plugin code. I think I remember that the archive url needed to be encoded differently.


Ryan Hellyer comments:

It needs to have a JSON header which may have been where you had difficulties perhaps.


Ryan Hellyer comments:

Since you helped me on Twitter with this I voted to award part of the prize to you too.

2011-10-03

Bogdan answers:

You`ve tried with a FTP client? It might sound stupid.


Bogdan comments:

Oh my god, is the "shorter" theme I ever saw.


Bogdan comments:

It`s a test theme: "Random test theme" :)


Ryan Hellyer comments:

I don't understand. What use would FTP be?


Bogdan comments:

Can you be more explicit? I understood, wrong.


Ryan Hellyer comments:

I'm trying to setup a theme to use the built in WordPress auto-updater, but for a theme hosted outside of the WordPress.org theme repository.


Ryan Hellyer comments:

I've updated the question with specific information about where the problem lies.