clean wp site to log and increment cache times
This commit is contained in:
parent
87876bbf14
commit
2ab58438c9
1 changed files with 4 additions and 10 deletions
|
|
@ -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.3.3
|
* Version: 0.3.4
|
||||||
* Author: Pau Capó
|
* Author: Pau Capó
|
||||||
* Author URI: http://www.paucapo.com
|
* Author URI: http://www.paucapo.com
|
||||||
* Text Domain: gitea
|
* Text Domain: gitea
|
||||||
|
|
@ -11,12 +11,6 @@
|
||||||
* Gitea URI: wp/gitea-updater
|
* Gitea URI: wp/gitea-updater
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
# TODO:
|
|
||||||
** branches?
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
defined('ABSPATH') or exit;
|
defined('ABSPATH') or exit;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -44,7 +38,7 @@ class Gitea_Updater
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->site = urlencode(str_replace(array('http://', 'https://'), '', get_site_url()));
|
$this->site = str_replace(array('http://', 'https://'), '', get_site_url());
|
||||||
|
|
||||||
add_action('plugins_loaded', array($this, 'plugins_loaded'));
|
add_action('plugins_loaded', array($this, 'plugins_loaded'));
|
||||||
|
|
||||||
|
|
@ -87,12 +81,12 @@ class Gitea_Updater
|
||||||
{
|
{
|
||||||
// disable cache in case of a force-check from admin site
|
// disable cache in case of a force-check from admin site
|
||||||
if (isset($_GET['force-check'])) {
|
if (isset($_GET['force-check'])) {
|
||||||
return true;
|
$this->cache = 30;
|
||||||
}
|
}
|
||||||
// small hack for multiple checks when asked throw IWP
|
// small hack for multiple checks when asked throw IWP
|
||||||
foreach ($_POST as $key => $value) {
|
foreach ($_POST as $key => $value) {
|
||||||
if (substr($key, 0, 5) == '_IWP_') {
|
if (substr($key, 0, 5) == '_IWP_') {
|
||||||
$this->cache = 30;
|
$this->cache = 300;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$last_update = get_option('gitea_' . $type . '_updated');
|
$last_update = get_option('gitea_' . $type . '_updated');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue