We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b10e6db commit 324bbffCopy full SHA for 324bbff
1 file changed
src/Config/wp-addon-settings.php
@@ -93,11 +93,17 @@ private function get_github_plugins() {
93
continue;
94
}
95
$contents = json_decode(wp_remote_retrieve_body($contents_response), true);
96
- if (!is_array($contents)) {
+
97
+ // GitHub can return an error object like ['message' => '...'] – treat it as invalid.
98
+ if (!is_array($contents) || isset($contents['message'])) {
99
100
101
$has_plugin_file = false;
102
foreach ($contents as $file) {
103
+ if (!is_array($file) || empty($file['name'])) {
104
+ continue;
105
+ }
106
107
if ($file['name'] === $name . '.php' || $file['name'] === 'plugin.php' || $file['name'] === 'readme.txt') {
108
$has_plugin_file = true;
109
break;
0 commit comments