Skip to content

Commit

Permalink
removed github update checker
Browse files Browse the repository at this point in the history
  • Loading branch information
fatihbalsoy committed Dec 9, 2023
1 parent 1e0b867 commit 33e9cd1
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions src/settings/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,6 @@ function fbwpmdp_get_local_file_contents($file_path)
return $contents;
}

// Check whether instance has curl installed and enabled.
// For instance, the expiremental Wordpress Playground project running on WebAssembly does not have curl enabled.
function curl_exists()
{
return function_exists('curl_version');
}

/** CHECK FOR UPDATES (GITHUB) **/
if (curl_exists()) {
// create curl resource
$ch = curl_init();

// set url
curl_setopt($ch, CURLOPT_URL, $GLOBALS["fbwpmdp_github_releases"]);

//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');

// $output contains the output string
$output = curl_exec($ch);
$github_json_obj = json_decode($output);
$github_latest_release = $github_json_obj[0]->tag_name;

// close curl resource to free up system resources
curl_close($ch);
}

?>

<!-- Page-specific stylesheet -->
Expand All @@ -59,15 +31,6 @@ function curl_exists()

<!-- TODO: Implement instant preview -->
<div class='wrap'>
<!-- Update Banner -->
<?php
if (curl_exists() and $github_latest_release != "v" . $GLOBALS["fbwpmdp_version"]) {
echo '
<div class="update-nag notice notice-warning inline"><a href="' . $GLOBALS["fbwpmdp_github"] . '/releases/tag/' . $github_latest_release . '">' . $GLOBALS["fbwpmdp_settings_title"] . ' ' . $github_latest_release . '</a> is available! <a href="' . $GLOBALS["fbwpmdp_github"] . '/releases" aria-label="Please update Material Board now">Please update now</a>.</div>
';
}
?>

<!-- HEADER -->
<!-------------------------------------------------------------------------------->
<!-- Material Board -->
Expand Down

0 comments on commit 33e9cd1

Please sign in to comment.