diff --git a/.github/workflows/js.yml b/.github/workflows/js.yml index 301b432..d3191e8 100644 --- a/.github/workflows/js.yml +++ b/.github/workflows/js.yml @@ -10,7 +10,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install modules run: npm install -g eslint@^8 - name: Run ESLint diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index c55b4e3..aa092ae 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: PHP Lint uses: michaelw90/PHP-Lint@2.1.0 diff --git a/inc/WPUBaseUpdate/WPUBaseUpdate.php b/inc/WPUBaseUpdate/WPUBaseUpdate.php index 88f8678..7e9a53d 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.5.0 +Version: 0.6.0 Class URI: https://github.com/WordPressUtilities/wpubaseplugin Author: Darklg Author URI: https://darklg.me/ @@ -176,7 +176,7 @@ public function plugins_api($res, $action, $args) { return false; } - if ('github-' . $this->github_project !== $args->slug) { + if ('github-' . $this->github_project !== $args->slug && $this->github_project !== $args->slug) { return $res; } @@ -185,7 +185,20 @@ public function plugins_api($res, $action, $args) { return (object) $plugin_info; } - return false; + $plugin_details = array( + 'name' => $this->github_project, + 'slug' => $this->github_project + ); + + $parent_plugin = __DIR__ . '/../../' . $this->github_project . '.php'; + if (file_exists($parent_plugin)) { + $plugin_name = get_plugin_data($parent_plugin); + if (isset($plugin_name['Name'])) { + $plugin_details['name'] = $plugin_name['Name']; + } + } + + return (object) $plugin_details; } diff --git a/wpuoptions.php b/wpuoptions.php index 35defd1..6143f14 100644 --- a/wpuoptions.php +++ b/wpuoptions.php @@ -4,7 +4,7 @@ Plugin Name: WPU Options Plugin URI: https://github.com/WordPressUtilities/wpuoptions Update URI: https://github.com/WordPressUtilities/wpuoptions -Version: 8.0.0 +Version: 8.0.1 Description: Friendly interface for website options Author: Darklg Author URI: https://darklg.me/ @@ -29,7 +29,7 @@ class WPUOptions { private $main_url; private $options = array( 'plugin_name' => 'WPU Options', - 'plugin_version' => '8.0.0', + 'plugin_version' => '8.0.1', 'plugin_userlevel' => 'manage_categories', 'plugin_menutype' => 'admin.php', 'plugin_pageslug' => 'wpuoptions-settings' @@ -701,7 +701,7 @@ private function admin_field($id, $field = array()) { $is_multiple = isset($field['multiple']) && $field['multiple']; $idname = ' id="' . $idf . '" name="' . $idf . ($is_multiple ? '[]' : '') . '" '; $originalvalue = get_option($field_version['prefix_opt'] . $field_version['id']); - if (!$originalvalue && $main_value) { + if (!$originalvalue && $originalvalue !== '' && $main_value) { $originalvalue = $main_value; } $field_post_type = isset($field['post_type']) ? $field['post_type'] : 'post';