Skip to content

Commit 324bbff

Browse files
author
Alex
committed
fix: settings
1 parent b10e6db commit 324bbff

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/Config/wp-addon-settings.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,17 @@ private function get_github_plugins() {
9393
continue;
9494
}
9595
$contents = json_decode(wp_remote_retrieve_body($contents_response), true);
96-
if (!is_array($contents)) {
96+
97+
// GitHub can return an error object like ['message' => '...'] – treat it as invalid.
98+
if (!is_array($contents) || isset($contents['message'])) {
9799
continue;
98100
}
99101
$has_plugin_file = false;
100102
foreach ($contents as $file) {
103+
if (!is_array($file) || empty($file['name'])) {
104+
continue;
105+
}
106+
101107
if ($file['name'] === $name . '.php' || $file['name'] === 'plugin.php' || $file['name'] === 'readme.txt') {
102108
$has_plugin_file = true;
103109
break;

0 commit comments

Comments
 (0)