From 23606ea4f4f222107fbec5ba043a90a389caa4e9 Mon Sep 17 00:00:00 2001 From: Ronny Grobel Date: Mon, 13 Apr 2026 22:47:39 +0200 Subject: [PATCH] Fix plugin details popup metadata --- kgv-updater.php | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/kgv-updater.php b/kgv-updater.php index 5d6c88f..35e8f36 100644 --- a/kgv-updater.php +++ b/kgv-updater.php @@ -88,15 +88,32 @@ final class KGV_Updater { $repo_url = isset( $plugin_data['UpdateURI'] ) ? $plugin_data['UpdateURI'] : ''; $release = $this->get_release_data( $repo_url ); + $homepage = ! empty( $plugin_data['PluginURI'] ) ? $plugin_data['PluginURI'] : $repo_url; + + $author_name = isset( $plugin_data['AuthorName'] ) ? (string) $plugin_data['AuthorName'] : ''; + $author_uri = isset( $plugin_data['AuthorURI'] ) ? (string) $plugin_data['AuthorURI'] : ''; + $author_display = $author_name; + + if ( '' !== $author_name && '' !== $author_uri ) { + $author_display = sprintf( + '%2$s', + esc_url( $author_uri ), + esc_html( $author_name ) + ); + } return (object) array( 'name' => $plugin_data['Name'], 'slug' => dirname( $plugin_file ), 'version' => ! empty( $release['version'] ) ? $release['version'] : $plugin_data['Version'], - 'author' => $plugin_data['AuthorName'], - 'homepage' => $repo_url, - 'section' => array( + 'author' => $author_display, + 'author_profile'=> $author_uri, + 'homepage' => $homepage, + 'plugin_url' => $homepage, + 'sections' => array( 'description' => ! empty( $plugin_data['Description'] ) ? $plugin_data['Description'] : 'KGV Plugin aus Gitea.', + 'installation' => 'Installation erfolgt wie gewohnt in WordPress. Updates werden automatisch ueber KGV Updater bereitgestellt.', + 'changelog' => 'Aktuelle Version: ' . ( ! empty( $release['version'] ) ? $release['version'] : $plugin_data['Version'] ), ), 'download_link' => ! empty( $release['package'] ) ? $release['package'] : '', );