Plugin Directory

Changeset 1854382


Ignore:
Timestamp:
04/06/2018 11:54:57 PM (8 years ago)
Author:
fs1995
Message:

dont hardcode php log, view phpinfo, version 0.3.6

Location:
lw-mwp-tools/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lw-mwp-tools/trunk/lw-mwp-tools.php

    r1850976 r1854382  
    55Description: Easy access to system logs and resource usage on the Liquid Web Managed WordPress Hosting Platform.
    66Author: Francis Smith
    7 Version: 0.3.5
     7Version: 0.3.6
    88Author URI: https://github.com/fs1995
    99License: GPL2
     
    6666
    6767function lw_mwp_tools_info(){ //generate the resource monitor page
     68  if(isset($_POST['servermonitor-phpinfo'])){
     69    echo phpinfo();
     70    exit;
     71  }
    6872  $lwmwptools_uptime = floatval(file_get_contents('/proc/uptime')); //read uptime
    6973  $lwmwptools_uptime_secs = round(fmod($lwmwptools_uptime, 60), 0); $lwmwptools_uptime = (int)($lwmwptools_uptime / 60);
     
    7276  $lwmwptools_uptime_days = $lwmwptools_uptime;
    7377
    74   echo "<div class=\"wrap\"><h1>System Information</h1>Hostname: ", gethostname(), "<br>Uptime: ", $lwmwptools_uptime_days, " days, ", $lwmwptools_uptime_hr, " hours, ", $lwmwptools_uptime_mins, " minutes, ", $lwmwptools_uptime_secs, " seconds.<br>Server IP: ", $_SERVER['SERVER_ADDR'], "<br>PHP version: ", phpversion(), "<br>Platform: ", PHP_OS,  "</div>";
     78  echo "<div class=\"wrap\"><h1>System Information</h1>Hostname: ", gethostname(), "<br>Uptime: ", $lwmwptools_uptime_days, " days, ", $lwmwptools_uptime_hr, " hours, ", $lwmwptools_uptime_mins, " minutes, ", $lwmwptools_uptime_secs, " seconds.<br>Server IP: ", $_SERVER['SERVER_ADDR'], "<br>PHP version: ", phpversion(), "<br>Platform: ", PHP_OS, "<br><br></div><form method=\"post\" action=\"\"><input type=\"submit\" name=\"servermonitor-phpinfo\" value=\"View phpinfo()\" /></form>";
    7579}
    7680
     
    116120
    117121function lw_mwp_tools_php(){ //generate the php error log page
    118   echo "<div class=\"wrap\"><h1>PHP Error Log viewer</h1>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?</div><pre>". lwmwptools_readlog('/var/log/'.get_current_user().'-php-fpm-errors.log') ."</pre>";
    119 }
     122  echo "<div class=\"wrap\"><h1>PHP Error Log viewer</h1>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?</div><pre>". lwmwptools_readlog(ini_get('error_log')) ."</pre>";
     123} //passing the lwmwptools_readlog function the php error log location, which will return the contents of the log for this function to display
    120124
    121125function lw_mwp_tools_nginx_access(){ //generate the nginx access log page
  • lw-mwp-tools/trunk/readme.txt

    r1850972 r1854382  
    22Contributors: fs1995
    33Donate link: https://paypal.me/fs1995
    4 Tags: liquidweb, liquid web, server info
     4Tags: liquidweb, liquid web, server info, monitor, debug
    55Requires at least: 3.4
    66Tested up to: 4.9.4
     
    2424
    2525== Changelog ==
     26
     27= 0.3.6 =
     28*Release Date - Apr 6, 2018*
     29
     30* Don't hardcode PHP error log location.
     31* View phpinfo().
    2632
    2733= 0.3.5 =
Note: See TracChangeset for help on using the changeset viewer.