'asi', 'title' => 'System Info', 'description' => __('Displays system info and debugging features for the AdPress plugin', 'wp-asi'), 'author' => 'Abid Omar', 'version' => '1.0', 'basename' => plugin_basename(__FILE__), 'settings' => 'adpress-asi', ); array_push($addons, $addon); return $addons; } // Define some paths define('ASI_URLPATH', trailingslashit(WP_PLUGIN_URL . '/' . plugin_basename(dirname(__FILE__)))); // PAD i18n function asi_i18n() { $plugin_dir = basename(dirname(__FILE__)); load_plugin_textdomain( 'wp-asi', false, $plugin_dir ); } add_action('plugins_loaded', 'asi_i18n'); // Register the Add-on Settings Page add_action('admin_menu', 'asi_menu', 20); function asi_menu() { $asi_mang = add_management_page( 'System Info', 'System Info', 'manage_options', 'adpress-asi', 'asi_page' ); $asi_adp = add_submenu_page('adpress-campaigns', 'AdPress | System Info', 'System Info', 'manage_options', 'adpress-asi', 'asi_page'); add_action("load-$asi_mang", 'asi_settings_help'); add_action("load-$asi_mang", 'asi_actions'); add_action("load-$asi_adp", 'asi_settings_help'); add_action("load-$asi_adp", 'asi_actions'); } // Load the Settings Page function asi_page() { require_once('settings.php'); } // Display Dropdown Help function asi_settings_help() { global $current_screen; $current_screen->add_help_tab(array( 'id' => 'asi_help_tab', 'title' => __('System Information', 'wp-asi'), 'content' => '

' . __('Displays System Information for debugging', 'wp-asi') . '

' )); } // Register the Settings page Scripts and Styles add_action('admin_print_scripts', 'asi_load_scripts', 20); add_action('admin_print_styles', 'asi_load_styles', 20); // Load Scripts function asi_load_scripts() { // Current Screen global $current_screen; if ($current_screen->id === 'adpress_page_adpress-asi') { } } // Load Styles function asi_load_styles() { // Current Screen global $current_screen; if ($current_screen->id === 'adpress_page_adpress-asi' || $current_screen->id === 'tools_page_adpress-asi') { wp_enqueue_style('asi_settings', ASI_URLPATH . 'files/css/style.css'); } } /* * Handle Settings Page Actions */ function asi_actions() { if (isset($_GET['action'])) { switch($_GET['action']) { case 'download': nocache_headers(); header( "Content-type: text/plain" ); header( 'Content-Disposition: attachment; filename="system-info.txt"' ); asi_sys_info(); exit; break; case 'reinstall': $install = new wp_adpress_install(); break; } } } /** * Echo the Sys Info */ function asi_sys_info() { if (!class_exists('Browser')) { require_once ('lib/browser.php'); } global $wpdb, $wpadpress; if (!isset($wpadpress)) { $adversion = "not available"; } else { $adversion = $wpadpress->version; } $browser = new Browser(); if ( get_bloginfo( 'version' ) < '3.4' ) { $theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' ); $theme = $theme_data['Name'] . ' ' . $theme_data['Version']; } else { $theme_data = wp_get_theme(); $theme = $theme_data->Name . ' ' . $theme_data->Version; } // Try to identifty the hosting provider $host = false; if( defined( 'WPE_APIKEY' ) ) { $host = 'WP Engine'; } elseif( defined( 'PAGELYBIN' ) ) { $host = 'Pagely'; } ?> ### Begin System Info ### ## Please include this information when posting support requests ## Multisite: SITE_URL: HOME_URL: AdPress Version: WordPress Version: Permalink Structure: Active Theme: Host: PHP Version: Web Server Info: PHP Safe Mode: PHP Memory Limit: WordPress Memory Limit: PHP Upload Max Size: PHP Post Max Size: PHP Upload Max Filesize: PHP Time Limit: PHP Max Input Vars: WP_DEBUG: WP Table Prefix: prefix ); echo " Status:"; if ( strlen( $wpdb->prefix )>16 ) {echo " ERROR: Too Long";} else {echo " Acceptable";} echo "\n"; ?> Show On Front: Page On Front: Page For Posts: false, 'timeout' => 60, 'user-agent' => 'EDD/' . EDD_VERSION, 'body' => $request ); $response = wp_remote_post( 'https://www.paypal.com/cgi-bin/webscr', $params ); if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { $WP_REMOTE_POST = 'wp_remote_post() works' . "\n"; } else { $WP_REMOTE_POST = 'wp_remote_post() does not work' . "\n"; } ?> WP Remote Post: Session: Session Name: Cookie Path: Save Path: Use Cookies: Use Only Cookies: DISPLAY ERRORS: FSOCKOPEN: cURL: SOAP Client: SUHOSIN: ACTIVE PLUGINS: $plugin ) { // If the plugin isn't active, don't show it. if ( ! in_array( $plugin_path, $active_plugins ) ) continue; echo $plugin['Name'] . ': ' . $plugin['Version'] ."\n"; } if ( is_multisite() ) : ?> NETWORK ACTIVE PLUGINS: AdPress Settings ### End System Info ###