diff --git a/gitea-updater.php b/gitea-updater.php index 0ca6be3..f5d5705 100644 --- a/gitea-updater.php +++ b/gitea-updater.php @@ -3,7 +3,7 @@ * Plugin Name: Gitea Updater * Plugin URI: http://www.paucapo.com * Description: Plugins updater - * Version: 0.3.2 + * Version: 0.3.3 * Author: Pau Capó * Author URI: http://www.paucapo.com * Text Domain: gitea @@ -82,9 +82,16 @@ class Gitea_Updater function update($type) { + // disable cache in case of a force-check from admin site if (isset($_GET['force-check'])) { return true; } + // small hack for multiple checks when asked throw IWP + foreach ($_POST as $key => $value) { + if (substr($key, 0, 5) == '_IWP_') { + $this->cache = 30; + } + } $last_update = get_option('gitea_' . $type . '_updated'); return ($last_update + $this->cache) < time(); } @@ -93,6 +100,7 @@ class Gitea_Updater { if (!$this->update('plugins')) { + $this->plugins = get_option('gitea_plugins'); return; } @@ -148,6 +156,7 @@ class Gitea_Updater { if (!$this->update('themes')) { + $this->themes = get_option('gitea_themes'); return; }