From c4945136b29ee0ed8619cef3219606abfd70b8be Mon Sep 17 00:00:00 2001 From: Kevin Date: Wed, 24 Jan 2024 21:44:33 +0100 Subject: [PATCH] v 0.32.2 Ignore .mo.php files. --- .gitignore | 1 + inc/WPUBaseUpdate/WPUBaseUpdate.php | 7 ++++++- wpupostmetas.php | 10 +++++----- 3 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78568eb --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.mo.php diff --git a/inc/WPUBaseUpdate/WPUBaseUpdate.php b/inc/WPUBaseUpdate/WPUBaseUpdate.php index 1643465..121ce1e 100644 --- a/inc/WPUBaseUpdate/WPUBaseUpdate.php +++ b/inc/WPUBaseUpdate/WPUBaseUpdate.php @@ -4,7 +4,7 @@ /* Class Name: WPU Base Update Description: A class to handle plugin update from github -Version: 0.4.3 +Version: 0.4.5 Class URI: https://github.com/WordPressUtilities/wpubaseplugin Author: Darklg Author URI: https://darklg.me/ @@ -13,6 +13,8 @@ Thanks: https://gist.github.com/danielbachhuber/7684646 */ +defined('ABSPATH') || die; + class WPUBaseUpdate { public $current_version; @@ -126,6 +128,9 @@ public function get_new_plugin_info() { /* Fetch plugin data */ $plugin_data = array(); if (file_exists($this->plugin_dir)) { + if (!function_exists('get_plugin_data')) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } $plugin_data = get_plugin_data($this->plugin_dir); } diff --git a/wpupostmetas.php b/wpupostmetas.php index f11789f..d3fdab5 100644 --- a/wpupostmetas.php +++ b/wpupostmetas.php @@ -5,13 +5,13 @@ Plugin URI: https://github.com/WordPressUtilities/wpupostmetas Update URI: https://github.com/WordPressUtilities/wpupostmetas Description: Simple admin for post metas -Version: 0.32.1 +Version: 0.32.2 Author: Darklg Author URI: https://darklg.me/ Text Domain: wpupostmetas Domain Path: /lang -Requires at least: 6.1 -Requires PHP: 7.4 +Requires at least: 6.2 +Requires PHP: 8.0 License: MIT License License URI: https://opensource.org/licenses/MIT */ @@ -22,7 +22,7 @@ class WPUPostMetas { public $qtranslatex; public $qtranslate; - public $version = '0.32.1'; + public $version = '0.32.2'; public $boxes = array(); public $fields = array(); public $settings_update; @@ -67,7 +67,7 @@ public function __construct() { } public function check_update() { - include dirname(__FILE__) . '/inc/WPUBaseUpdate/WPUBaseUpdate.php'; + include __DIR__ . '/inc/WPUBaseUpdate/WPUBaseUpdate.php'; $this->settings_update = new \wpupostmetas\WPUBaseUpdate( 'WordPressUtilities', 'wpupostmetas',