[wp-trac] [WordPress Trac] #47699: Remove redundant JSON polyfills for PHP native functionality

WordPress Trac noreply at wordpress.org
Mon Jul 15 05:15:11 UTC 2019


#47699: Remove redundant JSON polyfills for PHP native functionality
-------------------------------------------------+-------------------------
 Reporter:  jrf                                  |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  General                              |     Version:  trunk
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch 2nd-opinion has-unit-      |     Focuses:  coding-
  tests                                          |  standards
-------------------------------------------------+-------------------------

Comment (by jrf):

 @Clorith I've added a new patch which aggressively deprecates any and all
 deprecatable JSON related functionality.

 Note: Constants, interfaces, (global) variables can not throw deprecation
 notices, so this still doesn't cover everything, but AFAICS it's as close
 as it can get.

 The patch includes:
 * Adding the `JSON` extension as a **required** module to Site Health. The
 check is based on the `json_last_error()` function, which is the only
 function in the JSON extension not polyfilled.
 * Removing version based checks from `wp_json_encode()`. See my remark
 about that above.
 * In a few cases, replacing version based logic with feature based logic.

 For WP 5.4/5.5, a secondary patch will be needed to remove everything. My
 original patch can be used for inspiration at that time.

 Note: I have **not** applied this deprecation route to the patches in
 #47698 as, IMO, it doesn't apply for those patches.

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


More information about the wp-trac mailing list