bugfix new install and new_version

This commit is contained in:
Pau Capó 2017-03-15 15:43:21 +01:00
parent fec4e75dbb
commit 2a39783e6c

View file

@ -3,7 +3,7 @@
* Plugin Name: Gitea Updater * Plugin Name: Gitea Updater
* Plugin URI: http://www.paucapo.com * Plugin URI: http://www.paucapo.com
* Description: Plugins updater * Description: Plugins updater
* Version: 0.1.1 * Version: 0.2
* Author: Pau Capó * Author: Pau Capó
* Author URI: http://www.paucapo.com * Author URI: http://www.paucapo.com
* Text Domain: gitea * Text Domain: gitea
@ -58,6 +58,9 @@ class Gitea_Updater {
function plugins_loaded() { function plugins_loaded() {
load_plugin_textdomain('gitea', FALSE, basename( dirname( __FILE__ ) ) . '/languages/'); load_plugin_textdomain('gitea', FALSE, basename( dirname( __FILE__ ) ) . '/languages/');
if (!get_option('gitea_plugins') || !get_option('gitea_plugins'))
$this->get_all();
} }
function get_all() { function get_all() {
@ -84,8 +87,8 @@ class Gitea_Updater {
$url = $this->get_url($host, $repo, '/raw/master/'.$file); $url = $this->get_url($host, $repo, '/raw/master/'.$file);
if ($url != false) { if ($url != false) {
$new_version = $this->get_version($url, 'plugin'); $new_version = $this->get_version($url, 'plugin');
$new_version = $new_version ? $new_version : $local_version;
} }
$new_version = $new_version ? $new_version : $local_version;
// here we have the remote version from gitea/repo/plugin_file // here we have the remote version from gitea/repo/plugin_file