mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-03 20:24:26 +00:00
Code Modernization: Replace dirname( __FILE__ ) calls with __DIR__ magic constant.
This avoids the performance overhead of the function call every time `dirname( __FILE__ )` was used instead of `__DIR__`. This commit also includes: * Removing unnecessary parentheses from `include`/`require` statements. These are language constructs, not function calls. * Replacing `include` statements for several files with `require_once`, for consistency: * `wp-admin/admin-header.php` * `wp-admin/admin-footer.php` * `wp-includes/version.php` Props ayeshrajans, desrosj, valentinbora, jrf, joostdevalk, netweb. Fixes #48082. git-svn-id: https://develop.svn.wordpress.org/trunk@47198 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
/** WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
require_once __DIR__ . '/admin.php';
|
||||
|
||||
if ( ! current_user_can( 'activate_plugins' ) ) {
|
||||
wp_die( __( 'Sorry, you are not allowed to manage plugins for this site.' ) );
|
||||
@@ -143,7 +143,7 @@ if ( $action ) {
|
||||
$parent_file = 'plugins.php';
|
||||
|
||||
wp_enqueue_script( 'updates' );
|
||||
require_once( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
require_once ABSPATH . 'wp-admin/admin-header.php';
|
||||
|
||||
echo '<div class="wrap">';
|
||||
echo '<h1>' . esc_html( $title ) . '</h1>';
|
||||
@@ -153,7 +153,7 @@ if ( $action ) {
|
||||
|
||||
echo "<iframe src='$url' style='width: 100%; height:100%; min-height:850px;'></iframe>";
|
||||
echo '</div>';
|
||||
require_once( ABSPATH . 'wp-admin/admin-footer.php' );
|
||||
require_once ABSPATH . 'wp-admin/admin-footer.php';
|
||||
exit;
|
||||
|
||||
case 'error_scrape':
|
||||
@@ -277,13 +277,13 @@ if ( $action ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
include( ABSPATH . 'wp-admin/update.php' );
|
||||
require ABSPATH . 'wp-admin/update.php';
|
||||
|
||||
$parent_file = 'plugins.php';
|
||||
|
||||
if ( ! isset( $_REQUEST['verify-delete'] ) ) {
|
||||
wp_enqueue_script( 'jquery' );
|
||||
require_once( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
require_once ABSPATH . 'wp-admin/admin-header.php';
|
||||
?>
|
||||
<div class="wrap">
|
||||
<?php
|
||||
@@ -373,7 +373,7 @@ if ( $action ) {
|
||||
</form>
|
||||
</div>
|
||||
<?php
|
||||
require_once( ABSPATH . 'wp-admin/admin-footer.php' );
|
||||
require_once ABSPATH . 'wp-admin/admin-footer.php';
|
||||
exit;
|
||||
} else {
|
||||
$plugins_to_delete = count( $plugins );
|
||||
@@ -483,7 +483,7 @@ get_current_screen()->set_screen_reader_content(
|
||||
$title = __( 'Plugins' );
|
||||
$parent_file = 'plugins.php';
|
||||
|
||||
require_once( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
require_once ABSPATH . 'wp-admin/admin-header.php';
|
||||
|
||||
$invalid = validate_active_plugins();
|
||||
if ( ! empty( $invalid ) ) {
|
||||
@@ -645,4 +645,4 @@ wp_print_request_filesystem_credentials_modal();
|
||||
wp_print_admin_notice_templates();
|
||||
wp_print_update_row_templates();
|
||||
|
||||
include( ABSPATH . 'wp-admin/admin-footer.php' );
|
||||
require_once ABSPATH . 'wp-admin/admin-footer.php';
|
||||
|
||||
Reference in New Issue
Block a user