Plugin Directory

Changeset 1816927


Ignore:
Timestamp:
02/07/2018 01:52:20 AM (8 years ago)
Author:
fs1995
Message:

updated readme, function/file names, and better comments

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

Legend:

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

    r1816122 r1816927  
    1212defined('ABSPATH') or die('No!');
    1313
    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.
    1515$is_lwmwp = 1;
    1616if (get_current_user()[0] !== 's')
     
    1919  $is_lwmwp = 0;
    2020if(!$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.
    2222
    23 add_action('admin_menu', 'lw_mwp_tools_menu');
     23add_action('admin_menu', 'lw_mwp_tools_menu'); //hook into WP menu
    2424
    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');
     25function 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');
    2828  add_submenu_page ('lw-mwp-tools', 'PHP error log', 'PHP error log', 'manage_options', 'lw-mwp-tools-php', 'lw_mwp_tools_php');
    2929  add_submenu_page ('lw-mwp-tools', 'NGINX access log', 'NGINX access log', 'manage_options', 'lw-mwp-tools-nginx-access', 'lw_mwp_tools_nginx_access');
     
    3131}
    3232
    33 function lw_mwp_tools_init(){
    34   require 'core.php';
     33function lw_mwp_tools_monitor(){ //generate the resource monitor page
     34  require 'monitor.php'; //in a separate file cause theres a bit to this page.
    3535}
    3636
    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>.");
     37function 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
    3939  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>";
    4040}
    4141
    42 function lw_mwp_tools_nginx_access(){
     42function lw_mwp_tools_nginx_access(){ //generate the nginx access log page
    4343  $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>.");
    4444  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>";
    4545}
    4646
    47 function lw_mwp_tools_nginx_error(){
     47function lw_mwp_tools_nginx_error(){ //generate the nginx error log page
    4848  $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>.");
    4949  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  
    44Tags: liquidweb, liquid web, server info
    55Requires at least: 3.0.1
    6 Tested up to: 4.9.3
     6Tested up to: 4.9.4
    77Requires PHP: 5.1.3
    88Stable tag: 0.2
     
    1414== Description ==
    1515
    16 This plugin allows easy access to your PHP error log, nginx logs, and to view system resources without having to contact support.
     16This 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.
    1717
    1818This is an unofficial plugin and is not affiliated with Liquid Web.
Note: See TracChangeset for help on using the changeset viewer.