[wp-trac] [WordPress Trac] #58723: Remove deprecated parameter tests in comments_link()

WordPress Trac noreply at wordpress.org
Wed Aug 16 16:23:02 UTC 2023


#58723: Remove deprecated parameter tests in comments_link()
--------------------------+------------------------------
 Reporter:  Cybr          |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Comments      |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  performance
--------------------------+------------------------------

Comment (by joemcgill):

 In #58724 it was suggested that this ticket be expanded to cover
 additional functions that could be optimized in the same way. Per
 [https://core.trac.wordpress.org/ticket/58724#comment:2 this comment]:

 > Yes. After realizing there was a pattern, I found a total of 38
 instances (including this one) in Trunk using regex:
 > function.*?deprecated[0-9]{0,2} = .{1,10} \)

 Personally, I don't think that removing these params entirely are that
 beneficial. Avoiding the `empty` check on deprecated functions like this
 is a valid suggestion. Thanks for providing some benchmarking numbers,
 @Cybr.

 In practice, I suspect this type of change would have very little
 measurable impact since these functions are not called all that often.

 Looking over the list of functions returned in your regex, we seem to be
 pretty inconsistent about how we're handling deprecated parameters, with
 only some calling `_deprecated_argument`. A good task would be to go
 through all of these functions and see if we can standardize how these are
 handled, with any performance optimizations in mind.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58723#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list