Make WordPress Core

Opened 6 months ago

Closed 6 months ago

#63732 closed task (blessed) (fixed)

Observation on Unused Global Variables in WordPress Core PHP Files

Reported by: viralsampat's profile viralsampat Owned by: johnjamesjacoby's profile johnjamesjacoby
Milestone: 6.9 Priority: normal
Severity: normal Version: 6.7
Component: General Keywords: has-patch
Focuses: docs Cc:

Description

Hello Team,

I have reviewed the WordPress core PHP files and noticed that some global variables are referenced in the comments but are not explicitly defined in the code itself.

So, I think that if these variables are not being used anywhere, they should be removed from the list to avoid confusion and keep the codebase clean.

Files:


wp-admin/includes/plugin.php
wp-includes/rss.php
wp-includes/update.php

Please review it and share your feedback.

Thanks,

Attachments (1)

63732.patch (1.8 KB) - added by viralsampat 6 months ago.
I have checked above mentioned issue and resolved it. Here, I have added my patch.

Download all attachments as: .zip

Change History (5)

@viralsampat
6 months ago

I have checked above mentioned issue and resolved it. Here, I have added my patch.

#1 @johnjamesjacoby
6 months ago

  • Keywords needs-testing dev-feedback 2nd-opinion removed
  • Milestone changed from Awaiting Review to 6.9
  • Owner set to johnjamesjacoby
  • Status changed from new to assigned
  • Type changed from defect (bug) to task (blessed)

Both wp-admin/includes/plugin.php and wp-includes/rss.php look OK to me.

wp-includes/update.php uses wp_get_wp_version() since r58813, so some references to the $wp_version global could be removed.

#2 @johnjamesjacoby
6 months ago

I have checked above mentioned issue and resolved it. Here, I have added my patch.

@viralsampat $GLOBALS['wp_version'] is used in plugin.php and rss.php so those should stay.

#3 @johnjamesjacoby
6 months ago

  • Version set to 6.7

#4 @johnjamesjacoby
6 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 60493:

Docs: remove global references to $wp_version that are no longer accurate.

This commit cleans up a few global $wp_version doc-block entries for functions that switched to using wp_get_wp_version() in 6.7.

Follow up to [58848], [59192].

Props viralsampat.

Fixes #63732.

Note: See TracTickets for help on using tickets.