/**
 * Admin View: Page - Status Report
 */
if (!defined('ABSPATH')) {
    exit;
}
global $wpdb;
function seedredux_get_support_object()
{
    $obj = array();
}
function seedredux_clean($var)
{
    return sanitize_text_field($var);
}
$sysinfo = SeedRedux_Helpers::compileSystemStatus(false, true);
?>
<div class="wrap about-wrap seedredux-status">
    <h1><?php 
_e('SeedRedux Framework - System Status', 'seedredux-framework');
?>
</h1>

    <div
        class="about-text"><?php 
_e('Our core mantra at SeedRedux is backwards compatibility. With hundreds of thousands of instances worldwide, you can be assured that we will take care of you and your clients.', 'seedredux-framework');
?>
</div>
    <div
        class="seedredux-badge"><i
            class="el el-seedredux"></i><span><?php 
示例#2
0
 public function support_hash()
 {
     if (!wp_verify_nonce($_POST['nonce'], 'seedredux-support-hash')) {
         die;
     }
     $data = get_option('seedredux_support_hash');
     $data = wp_parse_args($data, array('check' => '', 'identifier' => ''));
     $generate_hash = true;
     $system_info = SeedRedux_Helpers::compileSystemStatus();
     $newHash = md5(json_encode($system_info));
     $return = array();
     if ($newHash == $data['check']) {
         unset($generate_hash);
     }
     $post_data = array('hash' => md5(network_site_url() . '-' . $_SERVER['REMOTE_ADDR']), 'site' => esc_url(home_url('/')), 'tracking' => SeedRedux_Helpers::getTrackingObject(), 'system_status' => $system_info);
     //$post_data = json_encode( $post_data );
     $post_data = serialize($post_data);
     if (isset($generate_hash) && $generate_hash) {
         $data['check'] = $newHash;
         $data['identifier'] = "";
         $response = wp_remote_post('http://support.seedredux.io/v1/', array('method' => 'POST', 'timeout' => 65, 'redirection' => 5, 'httpversion' => '1.0', 'blocking' => true, 'compress' => true, 'headers' => array(), 'body' => array('data' => $post_data, 'serialize' => 1)));
         if (is_wp_error($response)) {
             echo json_encode(array('status' => 'error', 'message' => $response->get_error_message()));
             die(1);
         } else {
             $response_code = wp_remote_retrieve_response_code($response);
             if ($response_code == 200) {
                 $response = wp_remote_retrieve_body($response);
                 $return = json_decode($response, true);
                 if (isset($return['identifier'])) {
                     $data['identifier'] = $return['identifier'];
                     update_option('seedredux_support_hash', $data);
                 }
             } else {
                 $response = wp_remote_retrieve_body($response);
                 echo json_encode(array('status' => 'error', 'message' => $response));
             }
         }
     }
     if (!empty($data['identifier'])) {
         $return['status'] = "success";
         $return['identifier'] = $data['identifier'];
     } else {
         $return['status'] = "error";
         $return['message'] = __("Support hash could not be generated. Please try again later.", 'seedredux-framework');
     }
     echo json_encode($return);
     die(1);
 }