Improve Choose Update Source feature based on feedback
Some checks failed
ci/woodpecker/push/woodpecker Pipeline is pending
ci/woodpecker/tag/woodpecker Pipeline is pending
Plugin Asset Update / Push assets to WordPress.org (push) Has been cancelled
Build Release / Build and Create Release (push) Has been cancelled
Build Release / Deploy to WordPress.org (push) Has been cancelled

This commit is contained in:
2025-04-13 14:27:26 +01:00
parent 5e8da5d87b
commit eac794c54a
8 changed files with 71 additions and 32 deletions

View File

@ -62,15 +62,15 @@ class Updater {
*/
private function determine_installation_source() {
// Check for user preference first
$user_preference = \get_option('fpden_update_source', 'auto');
$user_preference = \get_option('fpden_update_source', '');
// If not set to auto, use the user preference
if ($user_preference !== 'auto') {
// If user has set a preference, use it
if (!empty($user_preference)) {
return $user_preference;
}
// Otherwise, auto-detect as before
$source = 'wordpress.org';
// Otherwise, auto-detect the installation source
$source = 'wordpress.org'; // Default to WordPress.org if unidentifiable
// Check if the plugin was installed from GitHub
if ($this->is_github_installation()) {