Plugin Directory

Changeset 3047822


Ignore:
Timestamp:
03/08/2024 12:49:22 PM (2 years ago)
Author:
ashishajani
Message:

Improved security and tested plugin with latest WP version

Location:
wp-tech-lookup/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • wp-tech-lookup/trunk/classes/wtl-cron-info.php

    r1692273 r3047822  
    99            $crons = get_option('cron');
    1010            $timeFormate = get_option('date_format') . ' ' . get_option('time_format');
    11 
    1211            foreach ($crons as $key => $cron) {
    1312                if (is_numeric($key)) {
     
    2625                }
    2726            }
    28 
    2927            add_action('wp_ajax_wtl_cron_delete', array($this, 'wtl_cron_delete'));
    3028            add_action('wp_ajax_nopriv_wtl_cron_delete', array($this, 'wtl_cron_delete'));
     
    3331        function display_info() {
    3432
    35             foreach ($this->details as $info) {
    36                 ?>
     33            foreach ($this->details as $info) { ?>
    3734                <div class="cron-schedules" id="<?php echo $info['event_name']; ?>">
    3835                    <div class="cron-action"><strong>Event Action: </strong><?php echo $info['event_name']; ?> </div>
     
    4340                    <div class="cron-argu"><strong>Arguments: </strong> <?php echo $info['event_argu']; ?></div>
    4441                </div>
    45                 <?php
    46             }
     42            <?php }
    4743        }
    4844
    4945        function wtl_cron_delete() {
     46            if (!current_user_can( 'manage_options' ) ) {
     47                return wp_send_json( array( 'result' => 'Authentication error' ) );
     48            }
    5049            $time = intval($_POST['event_time']);
    5150            $hook = $_POST['event_hook'];
     
    6463            exit();
    6564        }
    66 
    6765    }
    68 
    6966    $wtl_cron_info = new wtl_cron_info();
    7067}
  • wp-tech-lookup/trunk/classes/wtl-database-info.php

    r1692273 r3047822  
    3333        function display_info() {
    3434
    35             foreach ($this->details as $info) {
    36                 ?>
     35            foreach ($this->details as $info) { ?>
    3736                <tr>
    3837                    <td><span><?php echo $info['title']; ?></span></td>
     
    4241                    <td><span><?php echo $info['size']; ?> KB</span></td>
    4342                </tr>
    44                 <?php
    45             }
     43        <?php }
    4644        }
    47 
    4845    }
    49 
    5046}
  • wp-tech-lookup/trunk/classes/wtl-filepermisions-info.php

    r1692273 r3047822  
    4141        function display_info() {
    4242
    43             foreach ($this->details as $info) {
    44                 ?>
     43            foreach ($this->details as $info) { ?>
    4544                <tr>
    4645                    <td><span><?php echo $info['title']; ?></span></td>
     
    5049                    <td class="wtl-status-<?php echo strtolower($info['status']); ?>"><span class="status"></span></td>
    5150                </tr>
    52                 <?php
    53             }
     51        <?php }
    5452        }
    5553
  • wp-tech-lookup/trunk/classes/wtl-server-info.php

    r1692273 r3047822  
    1616                'heading' => true
    1717            );
    18 
    1918            // Server Hostname
    2019            $this->details[] = array(
     
    2625                'status' => ''
    2726            );
    28 
    2927            // Server IP
    3028            $this->details[] = array(
     
    3634                'status' => ''
    3735            );
    38 
    3936            // Server Protocol
    4037            $this->details[] = array(
     
    4643                'status' => ''
    4744            );
    48 
    4945            // OS
    5046            $this->details[] = array(
     
    5652                'status' => ''
    5753            );
    58 
    5954            // Server Web Port
    6055            $this->details[] = array(
     
    6661                'status' => ''
    6762            );
    68 
    6963            if (isset($_SERVER['GATEWAY_INTERFACE'])) {
    7064                // CGI Version
     
    7872                );
    7973            }
    80 
    8174            // OS
    8275            $this->details[] = array(
     
    8982            );
    9083
    91 
    92 
    9384            //  PHP title
    9485            $this->details[] = array(
     
    9687                'heading' => true
    9788            );
    98 
    9989            // PHP version
    10090            $this->details[] = array(
     
    10696                'status' => $this->check_status($this->min_php_version, phpversion(), 'version')
    10797            );
    108 
    10998            // REGISTER GLOBALS
    11099            $this->details[] = array(
     
    116105                'status' => $this->check_status('disabled', ($this->ini_get_bool('register_globals') === true) ? 'enabled' : 'disabled')
    117106            );
    118 
    119107            // MAGIC QUOTES GPC
    120108            $this->details[] = array(
     
    126114                'status' => $this->check_status('disabled', ($this->ini_get_bool('magic_quotes_gpc') === true) ? 'enabled' : 'disabled')
    127115            );
    128 
    129116            // MAGIC QUOTES RUNTIME
    130117            $this->details[] = array(
     
    136123                'status' => $this->check_status('disabled', ($this->ini_get_bool('magic_quotes_runtime') === true) ? 'enabled' : 'disabled')
    137124            );
    138 
    139125            // SAFE MODE
    140126            $this->details[] = array(
     
    146132                'status' => $this->check_status('disabled', ($this->ini_get_bool('safe_mode') === true) ? 'enabled' : 'disabled')
    147133            );
    148 
    149134            // PHP Max execution time
    150135            $this->details[] = array(
     
    156141                'status' => $this->check_status(30, ini_get('max_execution_time'), 'number')
    157142            );
    158 
    159143            // MEMORY LIMIT
    160144            $memoryLimit = $this->check_memory_limit();
     
    167151                'status' => $memoryLimit
    168152            );
    169 
    170153            $this->details[] = array(
    171154                'title' => 'PHP Max Upload Size',
     
    175158                'tip' => '',
    176159                'status' => ''
    177             );
    178            
     160            );           
    179161            $this->details[] = array(
    180162                'title' => 'Post Max Size',
     
    185167                'status' => $this->check_status(8, ini_get('post_max_size'), 'number')
    186168            );
    187 
    188169            $this->details[] = array(
    189170                'title' => 'PHP Max Input Vars',
     
    200181                'heading' => true
    201182            );
    202 
    203183            // SQL
    204 
    205184            $this->details[] = array(
    206185                'title' => 'Database Software',
     
    211190                'status' => ''
    212191            );
    213 
    214192            $this->details[] = array(
    215193                'title' => 'Max No. Of Connection',
     
    220198                'status' => ''/* $this->check_status(1, $this->database_max_no_connection(), 'number') */
    221199            );
    222 
    223200            global $wpdb;
    224201            $this->details[] = array(
     
    234211        function check_status($require, $current, $compare = 'string') {
    235212            $status = 'WARNING';
    236 
    237213            if ($compare == 'number' && $require <= $current) {
    238214                $status = "OK";
     
    254230                }
    255231            }
    256 
    257232            $ok = ($memory_limit >= 128 * 1024 * 1024); // at least 64M?
    258 
    259233            return ($ok ? 'OK' : 'WARNING');
    260234        }
     
    263237
    264238            foreach ($this->details as $info) {
    265                 if (isset($info['heading'])):
    266                     ?>
    267                     <tr class="wtl-table-heading">
     239                if (isset($info['heading'])): ?>
     240                    <tr class="wtl-table-head
    268241                        <td colspan="5"><strong><span><?php echo $info['title']; ?></span></strong></td>
    269242                    </tr>
    270                 <?php else:
    271                     ?>
     243                <?php else: ?>
    272244                    <tr>
    273245                        <td><span><?php echo $info['title']; ?></span></td>
     
    277249                        <td class="wtl-status-<?php echo strtolower($info['status']); ?>"><span class="status"></span></td>
    278250                    </tr>
    279                 <?php
    280                 endif;
     251                <?php endif;
    281252            }
    282253        }
     
    289260                case 'true':
    290261                    return 'assert.active' !== $a;
    291 
    292262                case 'stdout':
    293263                case 'stderr':
    294264                    return 'display_errors' === $a;
    295 
    296265                default:
    297266                    return (bool) (int) $b;
     
    302271
    303272            $db_software = get_transient('wpss_db_software');
    304 
    305273            if ($db_software === FALSE) {
    306274                global $wpdb;
     
    315283                }
    316284            }
    317 
    318285            return $db_software;
    319286        }
     
    322289
    323290            $db_max_connection = get_transient('wpss_db_max_connection');
    324 
    325291            if ($db_max_connection === FALSE) {
    326292                global $wpdb;
     
    334300                }
    335301            }
    336 
    337302            return $db_max_connection;
    338303        }
  • wp-tech-lookup/trunk/readme.txt

    r2095742 r3047822  
    33Donate link: http://freelancer-coder.com
    44Tags: server information, server monitor, php information, mysql information, wordpress information, file permissions, os information
    5 Requires at least: 3.4
    6 Tested up to: 5.2.1
    7 Requires PHP: 5.5.9
    8 Stable tag: 1.0
     5Requires at least: 4.7
     6Tested up to: 6.4.3
     7Requires PHP: 7.4
     8Stable tag: 1.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9797
    9898== Changelog ==
    99 * Initial release of this plugin
     99
     100= 1.1 =
     101* Improved security and tested plugin with the latest WP version
    100102
    101103= 1.0 =
  • wp-tech-lookup/trunk/wp-tech-lookup.php

    r1692273 r3047822  
    55 * Plugin URI: http://wordpress.org/extend/plugins/wp-tech-lookup/
    66 * Description: WP Tech Lookup plugin is to see all the necessary information about server at one place.
    7  * Version: 1.0
     7 * Version: 1.1
    88 * Author: Ashish Ajani
    99 * Author URI: http://freelancer-coder.com
     
    1414
    1515// define required contastants
    16 @define('WP_TECH_LOOKUP_VERSION', '1.0');
     16define('WP_TECH_LOOKUP_VERSION', '1.1');
    1717
    1818// Define plugin constants
Note: See TracChangeset for help on using the changeset viewer.