@@ -66,7 +66,7 @@ private function get_repository_info()
6666 ]);
6767
6868 $ response = curl_exec ($ curl );
69-
69+ //write_log($response);
7070 // print_r($response);
7171 // exit;
7272
@@ -112,6 +112,8 @@ public function modify_transient($transient)
112112 'package ' => $ new_files ,
113113 'new_version ' => $ this ->github_response ['tag_name ' ]
114114 ];
115+ write_log ($ plugin );
116+ write_log ($ this ->plugin );
115117
116118 $ transient ->response [$ this ->basename ] = (object ) $ plugin ;
117119 }
@@ -123,32 +125,34 @@ public function modify_transient($transient)
123125
124126 public function plugin_popup ($ result , $ action , $ args )
125127 {
128+ write_log ("called " );
126129 if ($ action !== 'plugin_information ' ) {
127130 return false ;
128131 }
129-
130132 if (!empty ($ args ->slug )) {
131133 if ($ args ->slug == current (explode ('/ ' , $ this ->basename ))) {
132134 $ this ->get_repository_info ();
133-
135+ $ slug = current ( explode ( ' / ' , $ this -> basename ));
134136 $ plugin = [
135- 'name ' => $ this ->plugin ['Name ' ],
136- 'slug ' => $ this -> basename ,
137+ 'name ' => isset ( $ this ->plugin ['Name ' ]) ? $ this -> plugin [ ' Name ' ] : '' ,
138+ 'slug ' => $ slug ,
137139 'requires ' => '5.3 ' ,
138140 'tested ' => '5.4 ' ,
139141 'version ' => $ this ->github_response ['tag_name ' ],
140- 'author ' => $ this ->plugin ['AuthorName ' ],
142+ 'author ' => $ this ->plugin ['Author ' ],
141143 'author_profile ' => $ this ->plugin ['AuthorURI ' ],
142144 'last_updated ' => $ this ->github_response ['published_at ' ],
143145 'homepage ' => $ this ->plugin ['PluginURI ' ],
144- 'short_description ' => $ this ->plugin ['Description ' ],
146+ 'short_description ' => isset ( $ this ->plugin ['Description ' ]) ? $ this -> plugin [ ' Description ' ] : '' ,
145147 'sections ' => [
146- 'Description ' => $ this ->plugin ['Description ' ],
147- 'Updates ' => $ this ->github_response ['body ' ],
148+ 'Description ' => isset ( $ this ->plugin ['Description ' ]) ? $ this -> plugin [ ' Description ' ] : '' ,
149+ 'Updates ' => isset ( $ this ->github_response ['body ' ]) ? $ this -> github_response [ ' body ' ] : '' ,
148150 ],
149151 'download_link ' => $ this ->github_response ['zipball_url ' ]
150152 ];
151153
154+ write_log ($ plugin );
155+
152156 return (object ) $ plugin ;
153157 }
154158 }
0 commit comments