Changeset 1983432
- Timestamp:
- 11/30/2018 07:12:52 PM (7 years ago)
- Location:
- site-info/trunk
- Files:
-
- 2 edited
-
alar-site-info.php (modified) (30 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
site-info/trunk/alar-site-info.php
r1929772 r1983432 4 4 * Plugin Name: Site Info 5 5 * Description: Discover your current versions for WordPress, PHP, plugins, themes, and various other server information. 6 * Version: 1. 1.06 * Version: 1.2.0 7 7 * Author: John Alarcon 8 8 * Author URI: https://twitter.com/realJohnAlarcon … … 49 49 */ 50 50 class SiteInfo { 51 51 52 52 /** 53 53 * Minimum PHP version required. … … 65 65 66 66 /** 67 * Default platform. 68 * 69 * @var string 70 */ 71 public $platform = 'WordPress'; 72 73 /** 67 74 * The constructor provides a PHP gate to ensure that installation cannot be 68 75 * completed on an incompatible PHP version. … … 71 78 */ 72 79 public function __construct() { 73 80 74 81 // This plugin requires at least PHP 5.3. Abort if less than that. 75 82 if(version_compare('5.3', $this->min_php, '<')) { … … 77 84 return; 78 85 } 79 86 80 87 // Ensure minimum PHP is met or abort installation. 81 88 if(version_compare(PHP_VERSION, $this->min_php, '<')) { … … 83 90 return; 84 91 } 85 92 93 if (function_exists('classicpress_version')) { 94 $this->platform = 'ClassicPress'; 95 } 96 86 97 // If here, PHP version is acceptable – load the plugin. 87 98 $this->init(); … … 94 105 */ 95 106 private function init() { 96 107 97 108 // Load constants used within the plugin; do this first. 98 109 require_once plugin_dir_path(__FILE__).'includes/constants.php'; 99 110 100 111 // Register hooks for plugin activation and deactivation; use $this. 101 112 register_activation_hook(__FILE__, [$this, 'activate_plugin']); 102 113 register_deactivation_hook(__FILE__, [$this, 'deactivate_plugin']); 103 114 104 115 // Register hook for plugin deletion; use __CLASS__. 105 116 register_uninstall_hook(__FILE__, [__CLASS__, 'uninstall_plugin']); 106 117 107 118 // Register admin menu and notices. 108 119 add_action('admin_menu', [$this, 'register_admin_menu']); 109 120 110 121 // Register scripts and styles. 111 122 add_action('admin_enqueue_scripts', [$this, 'register_backend_scripts'], 10); … … 141 152 } 142 153 } 143 154 144 155 /** 145 156 * Register backend styles … … 166 177 return $item; 167 178 } 168 179 169 180 /** 170 181 * Render the information page. … … 173 184 */ 174 185 public function render_site_info() { 175 186 176 187 // Globalize the database object. 177 188 global $wpdb; 178 189 179 190 // Include core version.php file. 180 191 include(PATH_HOME.'/wp-includes/version.php'); 181 192 182 193 // Include core file.php file. 183 194 if(!function_exists('get_home_path')) { … … 192 203 // Open container and add plugin title. 193 204 echo '<div class="wrap">'."\n"; 194 echo '<h1 class="wp-heading">'.__('Site Info', 'alar-site-info').'</h1>'."\n"; 195 196 // -------------------------------------------------- 197 // Heading for WordPress Info section 198 // -------------------------------------------------- 199 echo '<h1 class="alar-site-info-heading">'.__('WordPress Information', 'alar-site-info').'</h1>'; 200 205 echo '<h1 class="wp-heading">'.$this->platform.' '.__('Information', 'alar-site-info').'</h1>'."\n"; 206 201 207 // WP VERSION 202 208 echo '<h2 class="alar-site-info-subheading">'.__('Installed Version', 'alar-site-info').'</h2>'; … … 204 210 if (!isset($wp_version)) { 205 211 $dashicon = 'warning'; 206 $tooltip = __(' WordPressversion not detected.', 'alar-site-info');212 $tooltip = __('Platform version not detected.', 'alar-site-info'); 207 213 $message = $tooltip; 208 214 echo $this->get_list_item($dashicon, $tooltip, $message); … … 217 223 } else { 218 224 $dashicon = 'warning'; 219 $tooltip = __('For maximum security and stability, please update your WordPressto the latest version.', 'alar-site-info');225 $tooltip = __('For maximum security and stability, please update your site to the latest version.', 'alar-site-info'); 220 226 $message = $wp_version.' [<a href="'.admin_url().'update-core.php">'.__('Update Recommended', 'alar-site-info').'</a>]'; 221 227 } … … 223 229 } 224 230 echo '</ul>'; 225 231 226 232 // DATABASE 227 233 echo '<h2 class="alar-site-info-subheading">'.__('Database', 'alar-site-info').'</h2>'; … … 237 243 } 238 244 echo '</ul>'; 239 245 240 246 // THEMES 241 247 $all_themes = wp_get_themes(); … … 256 262 } 257 263 echo '</ul>'; 258 264 259 265 // PLUGINS 260 266 $all_plugins = get_plugins(); … … 276 282 } 277 283 echo '</ul>'; 278 284 279 285 // URIs 280 286 $uploads = wp_upload_dir(); … … 290 296 echo $this->get_list_item('yes', '', '<strong>'.__('Uploads', 'alar-site-info').'</strong>: '.$uploads['baseurl']); 291 297 echo '</ul>'; 292 293 298 299 294 300 // -------------------------------------------------- 295 301 // HEADING: Server information 296 302 // -------------------------------------------------- 297 303 echo '<h1 class="alar-site-info-heading">'.__('Server Information', 'alar-site-info').'</h1>'; 298 304 299 305 // SERVER OPERATING SYSTEM 300 306 echo '<h2 class="alar-site-info-subheading">'.__('Operating System', 'alar-site-info').'</h2>'; … … 302 308 echo $this->get_list_item('yes', '', php_uname()); 303 309 echo '</ul>'; 304 310 305 311 // SERVER SOFTWARE 306 312 if (isset($_SERVER['SERVER_SOFTWARE']) && !empty($_SERVER['SERVER_SOFTWARE'])) { … … 322 328 echo $this->get_list_item($dashicon, $tooltip, $message); 323 329 echo '</ul>'; 324 330 325 331 // SERVER PROTOCOL 326 332 if (isset($_SERVER['SERVER_PROTOCOL']) && !empty($_SERVER['SERVER_PROTOCOL'])) { … … 336 342 echo $this->get_list_item($dashicon, $tooltip, $message); 337 343 echo '</ul>'; 338 344 339 345 // SERVER PORT 340 346 if (isset($_SERVER['SERVER_PORT']) && !empty($_SERVER['SERVER_PORT'])) { … … 350 356 echo $this->get_list_item($dashicon, $tooltip, $message); 351 357 echo '</ul>'; 352 358 353 359 // SSL 354 360 echo '<h2 class="alar-site-info-subheading">'.__('SSL', 'alar-site-info').'</h2>'; … … 405 411 echo $this->get_list_item($dashicon, $tooltip, $message); 406 412 echo '</ul>'; 407 408 413 414 409 415 // cURL 410 416 echo '<h2 class="alar-site-info-subheading">'.__('cURL', 'alar-site-info').'</h2>'; … … 421 427 } 422 428 echo '</ul>'; 423 429 424 430 // TRANSPORTS 425 431 echo '<h2 class="alar-site-info-subheading">'.__('Supported Transports', 'alar-site-info').'</h2>'; … … 430 436 } 431 437 echo '</ul>'; 432 438 433 439 // ------------------------------ 434 440 // PHP version & extensions … … 463 469 } 464 470 echo '</ul>'; 465 471 466 472 // FULL PHP INFO 467 473 echo '<ul class="alar-site-info-indent-two alar-site-info-full-php-info">'; … … 477 483 echo '</li>'; 478 484 echo '</ul>'; 479 485 480 486 // OUTER CONTAINER 481 487 echo '</div><!-- .wrap -->'; 482 488 } 483 489 484 490 /** 485 491 * Prevent installation … … 506 512 echo $markup; 507 513 } 508 514 509 515 /** 510 516 * Plugin activation … … 519 525 } 520 526 } 521 527 522 528 /** 523 529 * Plugin deactivation … … 532 538 } 533 539 } 534 540 535 541 /** 536 542 * Plugin deletion -
site-info/trunk/readme.txt
r1982722 r1983432 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.txt 10 10 11 Quickly see your site's version numbers, database info, installed plugins and themes, paths and URLs, ports, protocols, and other info. Built as a POC for a local Meetup. Works with WordPress and ClassicPress.11 Quickly see your site's version numbers, database info, installed plugins and themes, paths and URLs, ports, protocols, and other info. Built as a POC for a local Meetup. 12 12 13 13 == Description == … … 36 36 37 37 == Frequently Asked Questions == 38 **Does it work with Gutenberg?** 39 Yes. Because the plugin does not have any editor functionality, it is unaffected by Gutenberg. 40 41 **Does it work with ClassicPress?** 42 Yes. 43 38 44 **Where is my site info displayed?** 39 45 In your WordPress dashboard, hover the **Tools** menu and you will find a new item named **Site Info**. … … 52 58 53 59 == Changelog == 60 **1.2.0** 61 Add conditional to check whether installed on WordPress or ClassicPress; update onscreen titles accordingly. 62 54 63 **1.1.0** 55 64 Fix Server Error 406 that occurred on some hosts due to including a local file via HTTP URL instead of relative path.
Note: See TracChangeset
for help on using the changeset viewer.