Skip to content

Commit c8a1a3d

Browse files
Small fix for Git Check
1 parent 2ab3a28 commit c8a1a3d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

page-links.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)