[wp-trac] [WordPress Trac] #48116: Proposal: Tracking PHP Extension Usage
WordPress Trac
noreply at wordpress.org
Tue Sep 24 02:52:47 UTC 2019
#48116: Proposal: Tracking PHP Extension Usage
-----------------------------+--------------------------------------
Reporter: dd32 | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Upgrade/Install | Version:
Severity: normal | Keywords: 2nd-opinion dev-feedback
Focuses: |
-----------------------------+--------------------------------------
WordPress.org currently tracks the PHP usage of the platform and a bunch
of other details, but one data point that's been needed time and time
again is PHP Extension usage.
While we have some data sources which we refer to sometimes (VaultPress,
[https://make.wordpress.org/hosting/test-results/ Hosting Test Runner])
these don't necessarily represent the very broad and varied hosting
environments that WordPress runs on, as evidenced in the past by having to
guess and revert/make changes based on bug reports afterwards.
WordPress can't be the only project that would benefit from knowing what
~34% of the web is running either, we're positioned in a very good place
to influence other projects and PHP itself.
It could also give some direction to the Site Health project as to what
segment of users it should potentially target with extra warnings.
Some decisions that rely upon knowing what PHP extensions are in use
include..
- #47699 Can we drop the JSON Extension polyfill?
- #35517 Should the SSH endpoint even be in core since it's been broken
for 3 year for some (most?) users
- #17268 Can we use the native gettext extension to improve translation
speed?
- Do we still need to support the MySQL PHP extension? Can we just rely
upon MySQLi?
- #42352 Can we add support for proper prepared queries based on MySQLi?
Do we need to think about `ext/MySQL` support? (And is PDO an option?)
- #47186 How many users are using 32bit PHP without the libSodium
Extension installed? (How wide spread is libSodium in the first place?)
I [https://wordpress.slack.com/archives/C60K3MP2Q/p1558670043176100
brought this up back in May on Slack] and there wasn't any significant
concerns raised, so I've finally made this ticket - if we can start
sending the data from core I can get the API side storing data and we can
find a way to publish the data for all to use as needed in these
decisions.
The attached patch is just a quick POC, I'm not sure if there's anything
else that should be included (or shouldn't be) but it could include other
things like the following in the `platform_flags` section:
- `'db' => defined( 'WP_USE_EXT_MYSQL' ) && WP_USE_EXT_MYSQL ?
'mysql_forced' : ( function_exists( 'mysqli_connect') ? 'mysqli' : 'mysql'
)` to determine MySQL vs MySQLi usage
- `'db_class' => get_class( $wpdb )` to detect the usage of other
Database droppins
- web server in use based on the `$is_apache, $is_IIS, $is_iis7,
$is_nginx` globals
On the privacy side of this - The new elements pass through the
`core_version_check_query_args` filter that exists to opt-out of sending
this data, and it doesn't contain personal details, so when used and
processed in aggregate it should be okay.
Note: Any API would simply be aggregate percentages of an unknown total,
ie. `{ platform: { bits: { 32: 50.5, 64: 49.5 } }, extensions: { json:
99.999, mysqli: 95.4, mysql: 45.2, .... } }`
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48116>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list