Changeset 47119 for trunk/src/wp-admin/includes/plugin.php
- Timestamp:
- 01/29/2020 12:33:45 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/plugin.php
r47113 r47119 332 332 } 333 333 334 $plugin_data = get_plugin_data( "$plugin_root/$plugin_file", false, false ); //Do not apply markup/translate as it'll be cached. 334 // Do not apply markup/translate as it will be cached. 335 $plugin_data = get_plugin_data( "$plugin_root/$plugin_file", false, false ); 335 336 336 337 if ( empty( $plugin_data['Name'] ) ) { … … 358 359 */ 359 360 function get_mu_plugins() { 360 $wp_plugins = array(); 361 // Files in wp-content/mu-plugins directory. 361 $wp_plugins = array(); 362 362 $plugin_files = array(); 363 363 … … 365 365 return $wp_plugins; 366 366 } 367 368 // Files in wp-content/mu-plugins directory. 367 369 $plugins_dir = @opendir( WPMU_PLUGIN_DIR ); 368 370 if ( $plugins_dir ) { … … 387 389 } 388 390 389 $plugin_data = get_plugin_data( WPMU_PLUGIN_DIR . "/$plugin_file", false, false ); //Do not apply markup/translate as it'll be cached. 391 // Do not apply markup/translate as it will be cached. 392 $plugin_data = get_plugin_data( WPMU_PLUGIN_DIR . "/$plugin_file", false, false ); 390 393 391 394 if ( empty( $plugin_data['Name'] ) ) { … … 396 399 } 397 400 398 if ( isset( $wp_plugins['index.php'] ) && filesize( WPMU_PLUGIN_DIR . '/index.php' ) <= 30 ) { // silence is golden 401 if ( isset( $wp_plugins['index.php'] ) && filesize( WPMU_PLUGIN_DIR . '/index.php' ) <= 30 ) { 402 // Silence is golden. 399 403 unset( $wp_plugins['index.php'] ); 400 404 } … … 432 436 $_dropins = _get_dropins(); 433 437 434 // These exist in thewp-content directory.438 // Files in wp-content directory. 435 439 $plugins_dir = @opendir( WP_CONTENT_DIR ); 436 440 if ( $plugins_dir ) { … … 454 458 continue; 455 459 } 456 $plugin_data = get_plugin_data( WP_CONTENT_DIR . "/$plugin_file", false, false ); //Do not apply markup/translate as it'll be cached. 460 461 // Do not apply markup/translate as it will be cached. 462 $plugin_data = get_plugin_data( WP_CONTENT_DIR . "/$plugin_file", false, false ); 463 457 464 if ( empty( $plugin_data['Name'] ) ) { 458 465 $plugin_data['Name'] = $plugin_file; 459 466 } 467 460 468 $dropins[ $plugin_file ] = $plugin_data; 461 469 } … … 478 486 function _get_dropins() { 479 487 $dropins = array( 480 'advanced-cache.php' => array( __( 'Advanced caching plugin.' ), 'WP_CACHE' ), // WP_CACHE481 'db.php' => array( __( 'Custom database class.' ), true ), // auto on load482 'db-error.php' => array( __( 'Custom database error message.' ), true ), // auto on error483 'install.php' => array( __( 'Custom installation script.' ), true ), // auto on installation484 'maintenance.php' => array( __( 'Custom maintenance message.' ), true ), // auto on maintenance485 'object-cache.php' => array( __( 'External object cache.' ), true ), // auto on load486 'php-error.php' => array( __( 'Custom PHP error message.' ), true ), // auto on error487 'fatal-error-handler.php' => array( __( 'Custom PHP fatal error handler.' ), true ), // auto on error488 'advanced-cache.php' => array( __( 'Advanced caching plugin.' ), 'WP_CACHE' ), // WP_CACHE 489 'db.php' => array( __( 'Custom database class.' ), true ), // Auto on load. 490 'db-error.php' => array( __( 'Custom database error message.' ), true ), // Auto on error. 491 'install.php' => array( __( 'Custom installation script.' ), true ), // Auto on installation. 492 'maintenance.php' => array( __( 'Custom maintenance message.' ), true ), // Auto on maintenance. 493 'object-cache.php' => array( __( 'External object cache.' ), true ), // Auto on load. 494 'php-error.php' => array( __( 'Custom PHP error message.' ), true ), // Auto on error. 495 'fatal-error-handler.php' => array( __( 'Custom PHP fatal error handler.' ), true ), // Auto on error. 488 496 ); 489 497 490 498 if ( is_multisite() ) { 491 499 $dropins['sunrise.php'] = array( __( 'Executed before Multisite is loaded.' ), 'SUNRISE' ); // SUNRISE 492 $dropins['blog-deleted.php'] = array( __( 'Custom site deleted message.' ), true ); // auto on deleted blog493 $dropins['blog-inactive.php'] = array( __( 'Custom site inactive message.' ), true ); // auto on inactive blog494 $dropins['blog-suspended.php'] = array( __( 'Custom site suspended message.' ), true ); // auto on archived or spammed blog500 $dropins['blog-deleted.php'] = array( __( 'Custom site deleted message.' ), true ); // Auto on deleted blog. 501 $dropins['blog-inactive.php'] = array( __( 'Custom site inactive message.' ), true ); // Auto on inactive blog. 502 $dropins['blog-suspended.php'] = array( __( 'Custom site suspended message.' ), true ); // Auto on archived or spammed blog. 495 503 } 496 504 … … 639 647 if ( ( $network_wide && ! isset( $current[ $plugin ] ) ) || ( ! $network_wide && ! in_array( $plugin, $current ) ) ) { 640 648 if ( ! empty( $redirect ) ) { 641 wp_redirect( add_query_arg( '_error_nonce', wp_create_nonce( 'plugin-activation-error_' . $plugin ), $redirect ) ); // we'll override this later if the plugin can be included without fatal error 649 // We'll override this later if the plugin can be included without fatal error. 650 wp_redirect( add_query_arg( '_error_nonce', wp_create_nonce( 'plugin-activation-error_' . $plugin ), $redirect ) ); 642 651 } 643 652 … … 909 918 if ( ! WP_Filesystem( $credentials ) ) { 910 919 ob_start(); 911 request_filesystem_credentials( $url, '', true ); // Failed to connect, Error and request again. 920 // Failed to connect. Error and request again. 921 request_filesystem_credentials( $url, '', true ); 912 922 $data = ob_get_clean(); 913 923 … … 959 969 960 970 // If plugin is in its own directory, recursively delete the directory. 961 if ( strpos( $plugin_file, '/' ) && $this_plugin_dir != $plugins_dir ) { //base check on if plugin includes directory separator AND that it's not the root plugin folder 971 // Base check on if plugin includes directory separator AND that it's not the root plugin folder. 972 if ( strpos( $plugin_file, '/' ) && $this_plugin_dir != $plugins_dir ) { 962 973 $deleted = $wp_filesystem->delete( $this_plugin_dir, true ); 963 974 } else { … … 1238 1249 1239 1250 // 1240 // Menu 1251 // Menu. 1241 1252 // 1242 1253 … … 1307 1318 $_registered_pages[ $hookname ] = true; 1308 1319 1309 // No parent as top level 1320 // No parent as top level. 1310 1321 $_parent_pages[ $menu_slug ] = false; 1311 1322 … … 1413 1424 } 1414 1425 } 1415 // Sort the parent array 1426 // Sort the parent array. 1416 1427 ksort( $submenu[ $parent_slug ] ); 1417 1428 … … 1794 1805 1795 1806 // 1796 // Pluggable Menu Support -- Private 1807 // Pluggable Menu Support -- Private. 1797 1808 // 1798 1809 /** … … 1933 1944 } 1934 1945 1935 if ( $submenu_array[2] != $pagenow || isset( $_GET['page'] ) ) { // not the current page1946 if ( $submenu_array[2] != $pagenow || isset( $_GET['page'] ) ) { // Not the current page. 1936 1947 continue; 1937 1948 }
Note: See TracChangeset
for help on using the changeset viewer.