diff --git a/CHANGELOG.md b/CHANGELOG.md index b02442b..ced3b02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ All notable changes to this project will be documented in this file. - Updated POT file version for consistency - Improved JavaScript localization with proper fallbacks - Enhanced code quality for WordPress.org submission +- Fixed Git Updater configuration with correct Update URI +- Improved update server URL configuration ## [1.6.1] - 2024-05-15 ### Added diff --git a/fix-plugin-does-not-exist-notices.php b/fix-plugin-does-not-exist-notices.php index 2b35c26..5f5cf03 100644 --- a/fix-plugin-does-not-exist-notices.php +++ b/fix-plugin-does-not-exist-notices.php @@ -20,6 +20,7 @@ * Domain Path: /languages * Requires at least: 5.0 * Requires PHP: 7.0 + * Update URI: https://git-updater.wpallstars.com * GitHub Plugin URI: wpallstars/fix-plugin-does-not-exist-notices * GitHub Branch: main * Gitea Plugin URI: wpallstars/fix-plugin-does-not-exist-notices diff --git a/includes/Updater.php b/includes/Updater.php index 655ac51..b4f34f3 100644 --- a/includes/Updater.php +++ b/includes/Updater.php @@ -9,7 +9,7 @@ namespace WPAllStars\FixPluginDoesNotExistNotices; /** * Class Updater - * + * * Handles plugin updates from different sources based on installation origin. */ class Updater { @@ -59,7 +59,7 @@ class Updater { private function determine_installation_source() { // Default to WordPress.org $source = 'wordpress.org'; - + // Check if the plugin was installed from GitHub if ($this->is_github_installation()) { $source = 'github'; @@ -68,7 +68,7 @@ class Updater { elseif ($this->is_gitea_installation()) { $source = 'gitea'; } - + return $source; } @@ -80,7 +80,7 @@ class Updater { private function is_github_installation() { // Check for GitHub-specific markers in the plugin directory $plugin_dir = plugin_dir_path($this->plugin_file); - + // Look for .git directory with GitHub remote if (file_exists($plugin_dir . '.git')) { $git_config = @file_get_contents($plugin_dir . '.git/config'); @@ -88,12 +88,12 @@ class Updater { return true; } } - + // Check for GitHub-specific files that might indicate it was downloaded from GitHub if (file_exists($plugin_dir . '.github')) { return true; } - + return false; } @@ -105,7 +105,7 @@ class Updater { private function is_gitea_installation() { // Check for Gitea-specific markers in the plugin directory $plugin_dir = plugin_dir_path($this->plugin_file); - + // Look for .git directory with Gitea remote if (file_exists($plugin_dir . '.git')) { $git_config = @file_get_contents($plugin_dir . '.git/config'); @@ -113,7 +113,7 @@ class Updater { return true; } } - + return false; } @@ -136,10 +136,8 @@ class Updater { // Set the update server based on the installation source add_filter('gul_update_server', function() { - if ($this->source === 'github') { - return 'https://wpallstars.com'; // GitHub update server - } elseif ($this->source === 'gitea') { - return 'https://wpallstars.com'; // Gitea update server + if ($this->source === 'github' || $this->source === 'gitea') { + return 'https://git-updater.wpallstars.com'; // Update server for both GitHub and Gitea } return ''; }); diff --git a/readme.txt b/readme.txt index 73207ae..fcc991e 100644 --- a/readme.txt +++ b/readme.txt @@ -93,6 +93,8 @@ Although this plugin consumes minimal disk space, and doesn't run unless you are * Updated POT file version for consistency * Improved JavaScript localization with proper fallbacks * Enhanced code quality for WordPress.org submission +* Fixed Git Updater configuration with correct Update URI +* Improved update server URL configuration = 1.6.1 = * Added AI assistant guide and workflow documentation @@ -183,7 +185,7 @@ Although this plugin consumes minimal disk space, and doesn't run unless you are == Upgrade Notice == = 1.6.2 = -Improved JavaScript localization and enhanced code quality for WordPress.org submission! +Improved JavaScript localization, enhanced code quality, and fixed Git Updater configuration for seamless updates! = 1.6.1 = Added comprehensive AI assistant guide and workflow documentation for improved development processes!