本文整理汇总了PHP中Redux_Helpers::compileSystemStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP Redux_Helpers::compileSystemStatus方法的具体用法?PHP Redux_Helpers::compileSystemStatus怎么用?PHP Redux_Helpers::compileSystemStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Redux_Helpers
的用法示例。
在下文中一共展示了Redux_Helpers::compileSystemStatus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: support_hash
public function support_hash()
{
if (!wp_verify_nonce($_POST['nonce'], 'redux-support-hash')) {
die;
}
$data = get_option('redux_support_hash');
$data = array();
$data = wp_parse_args($data, array('check' => '', 'identifier' => ''));
$generate_hash = true;
$system_info = Redux_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' => Redux_Helpers::getTrackingObject(), 'system_status' => $system_info);
$post_data = json_encode($post_data);
if ($generate_hash) {
$data['check'] = $newHash;
$data['identifier'] = "";
$response = wp_remote_post('http://support.redux.io/v1/', array('method' => 'POST', 'timeout' => 65, 'redirection' => 5, 'httpversion' => '1.0', 'blocking' => true, 'compress' => true, 'headers' => array(), 'body' => array('data' => $post_data)));
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('redux_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.", 'redux-framework');
}
echo json_encode($return);
die(1);
}
示例2: redux_get_support_object
/**
* Admin View: Page - Status Report
*/
if (!defined('ABSPATH')) {
exit;
}
global $wpdb;
function redux_get_support_object()
{
$obj = array();
}
function redux_clean($var)
{
return sanitize_text_field($var);
}
$sysinfo = Redux_Helpers::compileSystemStatus(false, true);
?>
<div class="wrap about-wrap redux-status">
<h1><?php
esc_html_e('Redux Framework - System Status', 'redux-framework');
?>
</h1>
<div
class="about-text"><?php
esc_html_e('Our core mantra at Redux is backwards compatibility. With hundreds of thousands of instances worldwide, you can be assured that we will take care of you and your clients.', 'redux-framework');
?>
</div>
<div
class="redux-badge"><i
class="el el-redux"></i><span><?php