Opened 20 months ago
Closed 20 months ago
#60006 closed defect (bug) (invalid)
Remove the Unused global variables in the wp-admin
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Administration | Keywords: | close |
Focuses: | Cc: |
Description
Hello Team,
I have reviewed the wp-admin folder code and found that a few files function with unused global $wpdb variable. So, we need to remove the $wpdb global variable here.
File Path:
/wp-admin/includes/class-core-upgrader.php src/wp-admin/includes/class-core-upgrader.php
/wp-admin/includes/post.php src/wp-admin/includes/post.php
Attachments (2)
Change History (5)
#1
@
20 months ago
- Component changed from Site Health to Administration
- Keywords close added; needs-patch dev-feedback removed
#2
@
20 months ago
- Version 6.4 deleted
Removing the Version
as these globals were not introduced in 6.4.
#3
@
20 months ago
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
Hello @viralsampat,
Welcome to WordPress Core's Trac :)
Thank you for the patch. As @SergeyBiryukov noted, these globals are used in within their function scope and thus need to remain.
I'll close this ticket. However, if there are others to remove, please reopen.
Note: See
TracTickets for help on using
tickets.
Hi there, thanks for the patch!
The suggested changes don't seem correct to me:
$_wp_filesystem_direct_method
global is used on line 235 ofwp-admin/includes/class-core-upgrader.php
.$current_user
global is used on line 948 ofwp-admin/includes/post.php
.So the
@global
tags should not be removed.