WordPress.org

Plugin Directory

Changeset 522450


Ignore:
Timestamp:
03/23/12 01:04:48 (2 years ago)
Author:
andrewryno
Message:

add check to see if cURL is enabled on the server

File:
1 edited

Legend:

Unmodified
Added
Removed
  • media-temple-server-status/trunk/media-temple-server-status.php

    r522432 r522450  
    99License: GPLv2 
    1010*/ 
     11 
     12function mtss_curl_check() { 
     13    if  ( in_array( 'curl', get_loaded_extensions() ) ) { 
     14        return true; 
     15    } 
     16    else{ 
     17        return false; 
     18    } 
     19} 
    1120 
    1221register_uninstall_hook( __FILE__, 'mtss_uninstall_hook' ); 
     
    2534    if ( empty( $mtss_api_key ) OR empty( $mtss_service_id ) ) { 
    2635        echo 'Your (mt) API key and/or service ID are not set. <a href="' . get_admin_url() . 'options-general.php?page=mediatemple-server-stats">Enter them here!</a>'; 
     36        return; 
     37    } 
     38     
     39    if ( ! mtss_curl_check() ) { 
     40        echo 'You must have cURL enabled on your server in order to use this plugin.'; 
    2741        return; 
    2842    } 
     
    93107    } 
    94108     
     109    if ( ! mtss_curl_check() ) { 
     110        ?> 
     111        <div class="wrap"> 
     112            <div id="icon-options-general" class="icon32"><br></div> 
     113            <h2>(mt) Server Stats Options</h2> 
     114            <p>You must have cURL enabled on your server in order to use this plugin.</p> 
     115        </div> 
     116        <?php 
     117        return; 
     118    } 
     119     
    95120    // Check to see if the form was submitted 
    96121    if ( isset( $_POST['submit'] )) { 
Note: See TracChangeset for help on using the changeset viewer.