Plugin Directory

Changeset 3063437


Ignore:
Timestamp:
04/03/2024 08:50:45 AM (23 months ago)
Author:
elexpradeep
Message:

Updated style and code to fix a fatal error in some cases

Location:
divit-extension-evaluator/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • divit-extension-evaluator/trunk/index.php

    r2872384 r3063437  
    77    Author URI: https://www.linkedin.com/in/pradeep-pandey-b6b162b/
    88    Requires at least: 4.6
    9     Tested up to: 6.1
     9    Tested up to: 6.5
    1010    Stable tag: 2.1
    1111    Version: 2.1
     
    3636
    3737require_once __DIR__ . '/vendor/autoload.php';
     38require_once __DIR__ . '/src/admin.php';
    3839
    3940if ( is_admin() ) {
  • divit-extension-evaluator/trunk/mu-plugins/divit-extn-eval-checker.php

    r2870510 r3063437  
    11<?php
    22namespace DIVIT_EXTENSION_EVALUATOR;
     3
    34define( 'WPC_TRANSIENT_KEY', 'divit_extn_eval_settings' );
    45
     
    910    public static $checker;
    1011    public static $TRANSIENT_KEY;
    11     public static $unload_plugins  = array();
    12     public static $load_plugins    = array();
     12    public static $unload_plugins = array();
     13    public static $load_plugins = array();
    1314    public static $current_plugins = array();
    1415    public static $filter_applied = false;
     
    2021
    2122    public static function check_active_plugins( $plugins, $option ) {
    22         if( self::$filter_applied) {
     23        if ( self::$filter_applied ) {
    2324            return $plugins;
    24         } 
     25        }
    2526        $plugins = self::process_checker( $plugins, $option );
    2627        self::$filter_applied = true;
     
    2930    public static function process_checker( $plugins, $option ) {
    3031        self::set_checker();
    31         if( ! self::is_allowed()){
     32        if ( ! self::is_allowed() ) {
    3233            return $plugins;
    3334        }
     
    3637        $show_info = self::get_val_array( self::$checker, 'show_info', 'N' );
    3738
    38         $allowed_plugins = array_keys( $plugins);
     39        $allowed_plugins = array_keys( $plugins );
    3940
    4041        if ( $unload_all == 'Y' ) {
     
    5758            $p_settings[ $v ] = $val;
    5859        }
    59        
    60         if ( strlen( $p_settings['unload_plugins_from'][0] ) > 0 && strlen( $p_settings['unload_plugins_to'][0] ) > 0  ) {
    61            
    62             for( $i = $p_settings['unload_plugins_from'][0];  $i<= $p_settings['unload_plugins_to'][0]; $i++ ){
    63                 if( ! in_array( $i, $p_settings[ 'load_plugins' ] )){
     60
     61        if ( strlen( $p_settings['unload_plugins_from'][0] ) > 0 && strlen( $p_settings['unload_plugins_to'][0] ) > 0 ) {
     62
     63            for ( $i = $p_settings['unload_plugins_from'][0]; $i <= $p_settings['unload_plugins_to'][0]; $i++ ) {
     64                if ( ! in_array( $i, $p_settings['load_plugins'] ) ) {
    6465                    $p_settings['unload_plugins'][] = $i;
    6566                }
    66                
    67             }
    68             $p_settings[ 'load_plugins' ] = [];
    69         }
    70         if ( strlen( $p_settings['load_plugins_from'][0] ) > 0 &&  strlen( $p_settings['load_plugins_to'][0] > 0 ) ) {
    71            
    72             for( $i = $p_settings['load_plugins_from'][0];  $i<= $p_settings['load_plugins_to'][0]; $i++ ){
    73                 if( ! in_array( $i, $p_settings[ 'unload_plugins' ] )){
     67
     68            }
     69            $p_settings['load_plugins'] = [];
     70        }
     71        if ( strlen( $p_settings['load_plugins_from'][0] ) > 0 && strlen( $p_settings['load_plugins_to'][0] > 0 ) ) {
     72
     73            for ( $i = $p_settings['load_plugins_from'][0]; $i <= $p_settings['load_plugins_to'][0]; $i++ ) {
     74                if ( ! in_array( $i, $p_settings['unload_plugins'] ) ) {
    7475                    $p_settings['load_plugins'][] = $i;
    7576                }
    7677            }
    77             $p_settings[ 'unload_plugins' ] = [];
    78         }
    79        
    80         if( ! empty( $p_settings['unload_plugins'] ) ) {
    81             $allowed_plugins = array_diff( $allowed_plugins , $p_settings['unload_plugins'] );
    82         } 
    83         if( ! empty( $p_settings['load_plugins'] ) ) {
     78            $p_settings['unload_plugins'] = [];
     79        }
     80
     81        if ( ! empty( $p_settings['unload_plugins'] ) ) {
     82            $allowed_plugins = array_diff( $allowed_plugins, $p_settings['unload_plugins'] );
     83        }
     84        if ( ! empty( $p_settings['load_plugins'] ) ) {
    8485            $allowed_plugins = $p_settings['load_plugins'];
    8586        }
     
    9192                unset( $plugins[ $k ] );
    9293                self::$unload_plugins[ $k ] = $v;
    93             } 
    94         }
    95        
     94            }
     95        }
     96
    9697        self::$current_plugins = $plugins;
    9798        if ( $show_info == 'Y' ) {
     
    108109        return $array[ $key ];
    109110    }
    110    
     111
    111112    public static function loop( $data, $single_item_markup, $callbacks = array(), $additional_data = array(), $glue = '' ) {
    112113        $html = array();
     
    122123            foreach ( $v as $key => $value ) {
    123124                $search = "[$key]";
    124                 $row    = str_ireplace( $search, $value, $row );
     125                $row = str_ireplace( $search, $value, $row );
    125126            }
    126127
    127128            foreach ( $callbacks as $kf => $kv ) {
    128129                $search = "[$kf]";
    129                 $value  = $kv( $v );
    130                 $row    = str_ireplace( $search, $value, $row );
     130                $value = $kv( $v );
     131                $row = str_ireplace( $search, $value, $row );
    131132            }
    132133
    133134            foreach ( $additional_data as $ka => $va ) {
    134135                $search = "[$ka]";
    135                 $row    = str_ireplace( $search, $va, $row );
     136                $row = str_ireplace( $search, $va, $row );
    136137            }
    137138
     
    152153        </script>
    153154        <style>
    154             .divit_extn_eval_hidden {display: none;}
    155             .divit_extn_eval_list{max-height: 100px;overflow-y: scroll;overflow-x: hidden;}
     155            .divit_extn_eval_hidden {
     156                display: none;
     157            }
     158
     159            .show_info_divit_extn_eval {
     160                font-family: Arial, sans-serif;
     161                width: 40%;
     162            }
     163
     164            #wpc_info {
     165                background-color: #fff;
     166                border: 1px solid #ddd;
     167                border-radius: 8px;
     168                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
     169                padding: 20px;
     170                margin-bottom: 20px;
     171            }
     172            @media only screen and (max-width: 768px) {
     173                .show_info_divit_extn_eval {
     174                    width: 90%;
     175                }
     176
     177            }
     178           
     179
     180            #wpc_info h3 {
     181                color: #333;
     182                margin-top: 0;
     183            }
     184
     185            #wpc_info ul.divit_extn_eval_list {
     186                list-style: none;
     187                padding-left: 0;
     188                margin-top: 10px;
     189            }
     190
     191            #wpc_info ul.divit_extn_eval_list li {
     192                background-color: #e9e9e9;
     193                margin-bottom: 0px;
     194                padding: 6px;
     195                border-radius: 0px;
     196                font-size: 12px;
     197            }
     198
     199            #wpc_info ul.divit_extn_eval_list li:nth-child(odd) {
     200                background-color: #d9d9d9;
     201            }
     202
     203            .divit_extn_eval_list {
     204                max-height: 100px;
     205                overflow-y: scroll;
     206                overflow-x: hidden;
     207            }
    156208        </style>
    157         <div class='show_info' style='position: fixed;bottom: 4px;width: 100%;z-index: 999;'>
    158             <button onclick="divit_extn_eval_toggle()" style="cursor: pointer;background-color: red;color: white;">Plugin Checker</button>
    159             <div id='wpc_info' class="divit_extn_eval_hidden" style='background: #d9ca9b; width: 100%;'>
     209        <div class='show_info_divit_extn_eval' style='position: fixed;bottom: 4px;z-index: 999;'>
     210        <button onclick="divit_extn_eval_toggle()" style="cursor: pointer; background-color: #d9ca9b; color: white; border: none; padding: 10px 20px; border-radius: 5px; font-size: 16px; transition: background-color 0.3s, box-shadow 0.3s;">Plugin Checker List</button>
     211
     212            <div id='wpc_info' class="divit_extn_eval_hidden" style='background: #d9ca9b; width: 100%;'>
    160213                <h3 style="margin:0px; padding:0px">Unloaded Plugins</h3>
    161214                <ul class="divit_extn_eval_list">
     
    204257
    205258        if ( ! empty( $target_url ) ) {
    206             $target_url  = str_replace( array( 'https://', 'http://' ), array( '', '' ), $target_url );
    207             $host   = sanitize_text_field( wp_unslash( $_SERVER['HTTP_HOST'] ) );
    208             $uri   = sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) );
     259            $target_url = str_replace( array( 'https://', 'http://' ), array( '', '' ), $target_url );
     260            $host = sanitize_text_field( wp_unslash( $_SERVER['HTTP_HOST'] ) );
     261            $uri = sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) );
    209262            $current_url = $host . $uri;
    210263            if ( strtolower( $target_url ) != strtolower( $current_url ) ) {
  • divit-extension-evaluator/trunk/readme.txt

    r2872384 r3063437  
    77Author URI: https://www.linkedin.com/in/pradeep-pandey-b6b162b/
    88Requires at least: 4.6
    9 Tested up to: 6.1
    10 Stable tag: 2.1
    11 Version: 2.1
     9Tested up to: 6.5
     10Stable tag: 2.2
     11Version: 2.2
    1212Requires PHP: 7.2
    1313License: GPL v2 or later
     
    6060= 2.1 =
    6161Updated instructions and help section.
     62= 2.2 =
     63Updated code to fix fatal errors in some cases.
  • divit-extension-evaluator/trunk/src/html/js-css.php

    r2870772 r3063437  
    1818
    1919    .checker_active {
    20         background-color: red !important;
     20        background-color: #4c0707 !important;
    2121    }
    2222
Note: See TracChangeset for help on using the changeset viewer.