Changeset 1816927
- Timestamp:
- 02/07/2018 01:52:20 AM (8 years ago)
- Location:
- lw-mwp-tools/trunk
- Files:
-
- 1 added
- 2 edited
-
lw-mwp-tools.php (modified) (3 diffs)
-
monitor.php (added)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lw-mwp-tools/trunk/lw-mwp-tools.php
r1816122 r1816927 12 12 defined('ABSPATH') or die('No!'); 13 13 14 //check if we are on MWPv2 platform 14 //check if we are on MWPv2 platform. this is not a thorough check, just seeing if the user php is running as begins with 's' then a number. 15 15 $is_lwmwp = 1; 16 16 if (get_current_user()[0] !== 's') … … 19 19 $is_lwmwp = 0; 20 20 if(!$is_lwmwp) 21 exit("This plugin requires the Liquid Web Managed WordPress V2 platform."); 21 exit("This plugin requires the Liquid Web Managed WordPress V2 platform."); //prevent plugin from activating if not MWPv2. 22 22 23 add_action('admin_menu', 'lw_mwp_tools_menu'); 23 add_action('admin_menu', 'lw_mwp_tools_menu'); //hook into WP menu 24 24 25 function lw_mwp_tools_menu(){ 26 add_menu_page('LW MWP Tools', 'LW MWP Tools', 'manage_options', 'lw-mwp-tools', 'lw_mwp_tools_ init');27 add_submenu_page ('lw-mwp-tools', 'Server Resource Monitor', 'Resource Monitor', 'manage_options', 'lw-mwp-tools', 'lw_mwp_tools_ init');25 function lw_mwp_tools_menu(){ //create the plugins menu 26 add_menu_page('LW MWP Tools', 'LW MWP Tools', 'manage_options', 'lw-mwp-tools', 'lw_mwp_tools_monitor'); 27 add_submenu_page ('lw-mwp-tools', 'Server Resource Monitor', 'Resource Monitor', 'manage_options', 'lw-mwp-tools', 'lw_mwp_tools_monitor'); 28 28 add_submenu_page ('lw-mwp-tools', 'PHP error log', 'PHP error log', 'manage_options', 'lw-mwp-tools-php', 'lw_mwp_tools_php'); 29 29 add_submenu_page ('lw-mwp-tools', 'NGINX access log', 'NGINX access log', 'manage_options', 'lw-mwp-tools-nginx-access', 'lw_mwp_tools_nginx_access'); … … 31 31 } 32 32 33 function lw_mwp_tools_ init(){34 require ' core.php';33 function lw_mwp_tools_monitor(){ //generate the resource monitor page 34 require 'monitor.php'; //in a separate file cause theres a bit to this page. 35 35 } 36 36 37 function lw_mwp_tools_php(){ 38 $lw_mwp_tools_log = file_get_contents('/var/log/' . get_current_user() . '-php-fpm-errors.log') or exit("Unable to access PHP error log. Please report this <a href=\"https://wordpress.org/support/plugin/lw-mwp-tools\" target=\"_blank\">here</a>."); 37 function lw_mwp_tools_php(){ //generate the php error log page 38 $lw_mwp_tools_log = file_get_contents('/var/log/' . get_current_user() . '-php-fpm-errors.log') or exit("Unable to access PHP error log. Please report this <a href=\"https://wordpress.org/support/plugin/lw-mwp-tools\" target=\"_blank\">here</a>."); //try to get the php error log 39 39 echo "<h2>PHP Error Log viewer</h2>This page does not automatically update, you will need to refresh it. If you are troubleshooting WordPress code, have you turned on <a href=\"https://codex.wordpress.org/Debugging_in_WordPress\" target=\"_blank\">WP_DEBUG</a> in wp-config.php?<pre>" . $lw_mwp_tools_log . "</pre>"; 40 40 } 41 41 42 function lw_mwp_tools_nginx_access(){ 42 function lw_mwp_tools_nginx_access(){ //generate the nginx access log page 43 43 $lw_mwp_tools_log = file_get_contents('/var/log/nginx/' . get_current_user() . '.access.log') or exit("Unable to access NGINX access log. Please report this <a href=\"https://wordpress.org/support/plugin/lw-mwp-tools\" target=\"_blank\">here</a>."); 44 44 echo "<h2>NGINX access Log viewer</h2>This page does not automatically update, you will need to refresh it.<pre>" . $lw_mwp_tools_log . "</pre>"; 45 45 } 46 46 47 function lw_mwp_tools_nginx_error(){ 47 function lw_mwp_tools_nginx_error(){ //generate the nginx error log page 48 48 $lw_mwp_tools_log = file_get_contents('/var/log/nginx/' . get_current_user() . '.error.log') or exit("Unable to access NGINX error log. Please report this <a href=\"https://wordpress.org/support/plugin/lw-mwp-tools\" target=\"_blank\">here</a>."); 49 49 echo "<h2>NGINX Error Log viewer</h2>This page does not automatically update, you will need to refresh it.<pre>" . $lw_mwp_tools_log . "</pre>"; -
lw-mwp-tools/trunk/readme.txt
r1816122 r1816927 4 4 Tags: liquidweb, liquid web, server info 5 5 Requires at least: 3.0.1 6 Tested up to: 4.9. 36 Tested up to: 4.9.4 7 7 Requires PHP: 5.1.3 8 8 Stable tag: 0.2 … … 14 14 == Description == 15 15 16 This plugin allows easy access to your PHP error log, nginx logs, and to view system resources without having to contact support.16 This plugin allows easy access to your PHP error log, nginx logs, and to view system resources on the Liquid Web Managed WordPress Hosting Platform without having to contact support. 17 17 18 18 This is an unofficial plugin and is not affiliated with Liquid Web.
Note: See TracChangeset
for help on using the changeset viewer.