Make WordPress Core

Opened 12 months ago

Closed 11 months ago

Last modified 11 months ago

#59185 closed defect (bug) (fixed)

Remove the Unused global variables in the wp-includes folder.

Reported by: upadalavipul's profile upadalavipul Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.4 Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: coding-standards Cc:

Description

I have reviewed the code and found Unused global variables in some of the below files. Please check the below files:

Files:

  1. wp-includes/class-wp-xmlrpc-server.php
  2. wp-includes/user.php

Attachments (2)

59185.patch (1.4 KB) - added by upadalavipul 12 months ago.
Added patch
59185.2.patch (1.3 KB) - added by upadalavipul 12 months ago.
need to removed one more file in unused global variable.

Download all attachments as: .zip

Change History (8)

@upadalavipul
12 months ago

Added patch

@upadalavipul
12 months ago

need to removed one more file in unused global variable.

#1 @SergeyBiryukov
12 months ago

In 56477:

Users: Remove unused wpdb global in check_password_reset_key().

Follow-up to [45716].

Props upadalavipul.
See #59185.

#2 @SergeyBiryukov
11 months ago

  • Milestone changed from Awaiting Review to 6.4

#3 @SergeyBiryukov
11 months ago

  • Owner set to SergeyBiryukov
  • Status changed from new to accepted

#4 @SergeyBiryukov
11 months ago

In 56480:

XML-RPC: Remove unused wpdb global in wp_xmlrpc_server::mw_newMediaObject().

Follow-up to [2676], [4961], [5008], [24716], [34578].

Props upadalavipul.
See #59185.

#5 @SergeyBiryukov
11 months ago

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

Hi there, thanks for the patches!

Looking at 59185.2.patch, I don't think those variables should be removed, as they are explicitly globalized for use in theme templates, and removing them would break backward compatibility. For reference, load_template() was introduced in [1910].

So I believe this is fixed by [56477] and [56480].

#6 @SergeyBiryukov
11 months ago

#59349 was marked as a duplicate.

Note: See TracTickets for help on using tickets.