Beispiel #1
0
function wpe_db_debug_page()
{
    $data = array('queries' => get_option('wpe_debug_queries'));
    $data['show'] = @$_GET['show'] ? $_GET['show'] : 'slowest';
    //create slowest array
    $slowest = array();
    foreach ($data['queries'] as $k => $v) {
        $v['query'] = $k;
        $time = $v['time'];
        $slowest["{$time}"] = $v;
    }
    krsort($slowest);
    //create frequent array
    $temp = array();
    foreach ($data['queries'] as $k => $v) {
        $v['query'] = $k;
        $count = $v['count'];
        $temp["{$count}"] = $v;
    }
    krsort($temp);
    $data['plugin'] = WpeCommon::instance();
    $data['slowest'] = $slowest;
    $data['frequent'] = $temp;
    WpeCommon::view('admin/debug-db', $data);
}
/**
 * Create the widget
 */
function display_wpe_dify_news_feed()
{
    $plugin = WpeCommon::instance();
    $site_info = $plugin->get_site_info();
    $install_name = $site_info->name;
    $show_hidden = apply_filters('wpengine_show_hidden_news', false) ? "true" : "false";
    wp_enqueue_script('wpe-dify-blog', WPE_PLUGIN_URL . '/js/dify-blog.js', array('jquery'), WPE_PLUGIN_VERSION, true);
    ?>
	<div id='wpe-dify-widget' >
	<?php 
    include __DIR__ . "/dify-partial.php";
    display_wpe_dify($show_hidden, $install_name);
    ?>
		<div class='wpe-dify-widget-overlay'>
		</div>
	</div>
<?php 
}
function wpe_echo_powered_by_html($affiliate_code = null, $widget = false)
{
    $plugin = WpeCommon::instance();
    $plugin->is_widget = $widget;
    $plugin->wpe_emit_powered_by_html($affiliate_code);
}
Beispiel #4
0
$active_tab = @$_GET['tab'] ?: 'general';
$form_url = add_query_arg(array('page' => 'wpengine-common', 'tab' => $active_tab), $form_url['path']);
if (!current_user_can('manage_options')) {
    return false;
}
if (is_multisite() && !is_super_admin()) {
    //echo 'You do not have permission';
    ?>
    <div class="wrap">
        <h2>Error</h2>
        <p>You do not have permission to access this.</p>
    </div>
    <?php 
    return false;
}
$plugin = WpeCommon::instance();
$message = '';
$error = '';
$options = $plugin->get_options();
$site_info = $plugin->get_site_info();
$env_domain_ips = getenv('WPENGINE_DOMAIN_IPS');
if ($env_domain_ips) {
    $env_ip_pairs = $plugin->env_get_dedicated_ips($env_domain_ips);
}
// Load current field values, which come from option settings unless they're given by parameters to pre-populate.
$fv_regex_html_post_process = isset($_REQUEST['regex_html_post_process']) ? stripslashes($_REQUEST['regex_html_post_process']) : $this->get_regex_html_post_process_text();
// Process form submissions
if (isset($_POST['options']) && isset($_POST['submit'])) {
    check_admin_referer(PWP_NAME . '-config');
    foreach ($options as $key => $value) {
        if (isset($_POST['options'][$key])) {