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

WordPress Trac noreply at wordpress.org
Fri Jul 19 00:49:27 UTC 2019


#47699: Remove redundant JSON polyfills for PHP native functionality
-------------------------------------------------+-------------------------
 Reporter:  jrf                                  |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  5.3
Component:  General                              |     Version:  trunk
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests needs-      |     Focuses:  coding-
  refresh needs-dev-note                         |  standards
-------------------------------------------------+-------------------------
Changes (by pento):

 * keywords:  has-patch 2nd-opinion has-unit-tests => has-patch has-unit-
     tests needs-refresh needs-dev-note


Comment:

 The good folks at VaultPress have run some checks across the sites they
 monitor, and have found approximately 0.01% of PHP 5.6+ sites don't have
 the JSON extension available.

 Giving this some more thought, I'm inclined to remove the polyfills in WP
 5.3, except for `Services_JSON`, which is still used by plugins/themes
 (often without even checking if they need to).

 We can mark `Services_JSON` as deprecated, and put up a dev note to remind
 devs that they need to check that `json_last_error()` doesn't exist before
 using it.

 For the handful of sites that don't have the JSON extension, it'd be good
 to push out a fix in WP 5.2.3 that would warn them of this. Site Health is
 part of it, but it should also block updates when WP 5.3 is released, with
 a relevant error message.

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


More information about the wp-trac mailing list