File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -146,15 +146,20 @@ public function checkForUpdate($option) {
146146
147147 $ url = 'https://api.github.com/repos/studiohyperset/page-links-single-page-option/tags ' ;
148148
149- //$response = get_transient(md5($url)); // Note: WP transients fail if key is long than 45 characters
150- $ response = array (); // Note: WP transients fail if key is long than 45 characters
149+ $ response = get_transient (md5 ($ url )); // Note: WP transients fail if key is long than 45 characters
151150
152151 if (empty ($ response )){
153152 $ raw_response = wp_remote_get ($ url , array ('sslverify ' => false , 'timeout ' => 10 ));
154153 if ( is_wp_error ( $ raw_response ) ){
155154 return ;
156155 }
156+
157+ //Error. Probably Exceed Limit
157158 $ response = json_decode ($ raw_response ['body ' ]);
159+ if (isset ($ response ->message )) {
160+ unset($ option ->response [$ plugin ]);
161+ return $ option ;
162+ }
158163 $ response = $ response [0 ];
159164
160165 //set cache
You can’t perform that action at this time.
0 commit comments