Changeset 3063437
- Timestamp:
- 04/03/2024 08:50:45 AM (23 months ago)
- Location:
- divit-extension-evaluator/trunk
- Files:
-
- 4 edited
-
index.php (modified) (2 diffs)
-
mu-plugins/divit-extn-eval-checker.php (modified) (11 diffs)
-
readme.txt (modified) (2 diffs)
-
src/html/js-css.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
divit-extension-evaluator/trunk/index.php
r2872384 r3063437 7 7 Author URI: https://www.linkedin.com/in/pradeep-pandey-b6b162b/ 8 8 Requires at least: 4.6 9 Tested up to: 6. 19 Tested up to: 6.5 10 10 Stable tag: 2.1 11 11 Version: 2.1 … … 36 36 37 37 require_once __DIR__ . '/vendor/autoload.php'; 38 require_once __DIR__ . '/src/admin.php'; 38 39 39 40 if ( is_admin() ) { -
divit-extension-evaluator/trunk/mu-plugins/divit-extn-eval-checker.php
r2870510 r3063437 1 1 <?php 2 2 namespace DIVIT_EXTENSION_EVALUATOR; 3 3 4 define( 'WPC_TRANSIENT_KEY', 'divit_extn_eval_settings' ); 4 5 … … 9 10 public static $checker; 10 11 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(); 13 14 public static $current_plugins = array(); 14 15 public static $filter_applied = false; … … 20 21 21 22 public static function check_active_plugins( $plugins, $option ) { 22 if ( self::$filter_applied) {23 if ( self::$filter_applied ) { 23 24 return $plugins; 24 } 25 } 25 26 $plugins = self::process_checker( $plugins, $option ); 26 27 self::$filter_applied = true; … … 29 30 public static function process_checker( $plugins, $option ) { 30 31 self::set_checker(); 31 if ( ! self::is_allowed()){32 if ( ! self::is_allowed() ) { 32 33 return $plugins; 33 34 } … … 36 37 $show_info = self::get_val_array( self::$checker, 'show_info', 'N' ); 37 38 38 $allowed_plugins = array_keys( $plugins );39 $allowed_plugins = array_keys( $plugins ); 39 40 40 41 if ( $unload_all == 'Y' ) { … … 57 58 $p_settings[ $v ] = $val; 58 59 } 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'] ) ) { 64 65 $p_settings['unload_plugins'][] = $i; 65 66 } 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'] ) ) { 74 75 $p_settings['load_plugins'][] = $i; 75 76 } 76 77 } 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'] ) ) { 84 85 $allowed_plugins = $p_settings['load_plugins']; 85 86 } … … 91 92 unset( $plugins[ $k ] ); 92 93 self::$unload_plugins[ $k ] = $v; 93 } 94 } 95 94 } 95 } 96 96 97 self::$current_plugins = $plugins; 97 98 if ( $show_info == 'Y' ) { … … 108 109 return $array[ $key ]; 109 110 } 110 111 111 112 public static function loop( $data, $single_item_markup, $callbacks = array(), $additional_data = array(), $glue = '' ) { 112 113 $html = array(); … … 122 123 foreach ( $v as $key => $value ) { 123 124 $search = "[$key]"; 124 $row = str_ireplace( $search, $value, $row );125 $row = str_ireplace( $search, $value, $row ); 125 126 } 126 127 127 128 foreach ( $callbacks as $kf => $kv ) { 128 129 $search = "[$kf]"; 129 $value = $kv( $v );130 $row = str_ireplace( $search, $value, $row );130 $value = $kv( $v ); 131 $row = str_ireplace( $search, $value, $row ); 131 132 } 132 133 133 134 foreach ( $additional_data as $ka => $va ) { 134 135 $search = "[$ka]"; 135 $row = str_ireplace( $search, $va, $row );136 $row = str_ireplace( $search, $va, $row ); 136 137 } 137 138 … … 152 153 </script> 153 154 <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 } 156 208 </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%;'> 160 213 <h3 style="margin:0px; padding:0px">Unloaded Plugins</h3> 161 214 <ul class="divit_extn_eval_list"> … … 204 257 205 258 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'] ) ); 209 262 $current_url = $host . $uri; 210 263 if ( strtolower( $target_url ) != strtolower( $current_url ) ) { -
divit-extension-evaluator/trunk/readme.txt
r2872384 r3063437 7 7 Author URI: https://www.linkedin.com/in/pradeep-pandey-b6b162b/ 8 8 Requires at least: 4.6 9 Tested up to: 6. 110 Stable tag: 2. 111 Version: 2. 19 Tested up to: 6.5 10 Stable tag: 2.2 11 Version: 2.2 12 12 Requires PHP: 7.2 13 13 License: GPL v2 or later … … 60 60 = 2.1 = 61 61 Updated instructions and help section. 62 = 2.2 = 63 Updated code to fix fatal errors in some cases. -
divit-extension-evaluator/trunk/src/html/js-css.php
r2870772 r3063437 18 18 19 19 .checker_active { 20 background-color: red!important;20 background-color: #4c0707 !important; 21 21 } 22 22
Note: See TracChangeset
for help on using the changeset viewer.