Commit Graph

23 Commits

Author SHA1 Message Date
Yahnis Elsts ea25c4366a * Add a "Check for updates" link to the plugin row.
* checkForUpdates() now returns the update or null.
* Added a new getUpdate() method. Use it to retrieve update details (if there is an update available). It uses the internal cache, so use checkForUpdates() instead if you want the most recent info. Also, if no update is available, or if its older than the installed version, it will return null.
* Changed our plugins_api filter priority to 20 to fix a compatibility problem caused by a bug in the WooThemes plugin updater. In short, the WooThemes updater also has a plugins_api filter, and their implementation will throw away the response returned by other filters.
2012-10-20 11:32:19 +00:00
Yahnis Elsts 242622214d Make it possible to filter update/plugin info just before it's passed to WordPress.
Also adds another convenience method for registering filter callbacks.
2012-10-19 18:10:46 +00:00
Yahnis Elsts c085ce28e8 Check if an update actually exists before converting to StdClass (what if $state was null?). 2012-10-19 17:01:16 +00:00
Yahnis Elsts 6206797e75 Add a lot more error logging - for debugging purposes. Enable by setting $debugMode to TRUE. 2012-07-19 07:47:31 +00:00
Yahnis Elsts 655b93a3bb Fail silently if we can't find the plugin in /wp-content/plugins/ or can't read its header. Note that this will also fail if the plugin is installed in mu-plugins.
This could be improved.
2012-07-11 12:12:51 +00:00
Yahnis Elsts b440d1662a * Fix stupid copy & paste errors. 2012-05-29 09:41:10 +00:00
Yahnis Elsts fa9172b477 Can't use $this in a static method, you fool. 2012-05-27 12:14:24 +00:00
Yahnis Elsts 14fcf30366 Hopefully prevent problems with caching plugins 2012-05-25 14:28:23 +00:00
Yahnis Elsts dad7e6da64 When converting plugin info to WP format, set missing fields to null instead of completely omitting them. Fixes a notice in WP core when displaying the info. 2011-09-01 11:49:48 +00:00
Yahnis Elsts 33a19853d3 Removed unnecessary &'s from callback setup routines; objects are pass-by-reference anyway in newer PHP versions. 2011-09-01 11:46:42 +00:00
Yahnis Elsts 854a9854f1 Automatically clear the cron event used by the library when the associated plugin is deactivated.
Library version 1.1
2011-09-01 10:53:07 +00:00
Yahnis Elsts b6ca731702 * Fixed several incorrect comments
* The default wp_remote_get() options are now correctly filtered, not completely discarded.
* Fixed a bunch of IDE warnings about incorrectly inferred variable types.
2011-09-01 10:28:05 +00:00
Yahnis Elsts 55a9e86e1a Added licensing information (GPL). 2011-07-04 21:31:20 +00:00
Yahnis Elsts dfffd3cef2 * Fixed the "get_plugins() not found" error when running via Cron. 2010-09-28 06:46:07 +00:00
Yahnis Elsts 79097ff988 * Specify the full URL to info.json right away instead of assembling it from an "API" URL, the slug and constants. 2010-09-01 17:02:20 +00:00
Yahnis Elsts 98dc6dbe51 * Extra comments. 2010-08-31 15:47:27 +00:00
Yahnis Elsts 4dcbbfa83e * Kill debug code. 2010-08-30 19:00:21 +00:00
Yahnis Elsts 13ed8c3e8f * Add checking_for_updates=1 to the URL when loading info.json with the purpose of checking for updates.
* Increased info.json download timeout to 10 seconds.
* Be a good netizen and send the "Accept: application/json" header when asking for the info.json file.
* Don't check the plugin's version on every pageload. Too slow (get_plugins() scans all likely-looking .php files, which can be a lot). 
* Pass the return value of wp_remote_get() as the second arg. of the result filter callback.
2010-08-30 18:50:22 +00:00
Yahnis Elsts be3210884d * Added convenience functions for registering updater-related hooks.
* Use "&" as query argument separator (instead of the oft-default "&").
* Added the missing $slug suffix to the puc_request_info_result hook.
2010-08-30 09:39:13 +00:00
Yahnis Elsts d258708e87 * Disabled (not removed) some debug output. 2010-08-29 18:06:04 +00:00
Yahnis Elsts b45e825f58 * Forgot to call installHooks, shame on me.
* Fixed update retrieval.
2010-08-29 17:56:59 +00:00
Yahnis Elsts c9d2f5e2bb 2010-08-29 17:13:18 +00:00
Yahnis Elsts e7693bf832 2010-08-29 17:10:04 +00:00