WordPress / wordcamp.org

WordCamps are casual, locally-organized conferences covering everything related to WordPress.
https://wordcamp.org
130 stars 74 forks source link

Deprecating the JSON REST API (v1) plugin #699

Open ryelle opened 3 years ago

ryelle commented 3 years ago

The JSON REST API plugin is network activated on WordCamp.org. This is the original feature plugin used before the REST API was available in core. The original plugin was deprecated when WordPress 4.7 was released, in 2016.

Once the "real" REST API was released, a workaround was added to bypass the JSON API handler for "v2" endpoints.

In 2017, a notice was added to each item in each endpoint:

"_WARNING_DEPRECATED": "All v1 endpoints have been deprecated, and will be deactivated after 2018-04-01. Please switch to the v2 endpoints by then, in order to ensure that your application continues to function. If you have any questions, join the #meta-wordcamp channel on Slack or email support@wordcamp.org",

Recently, there was an issue when saving widgets, reported in slack. I tracked it down to this JSON API plugin, and proposed using this issue to deactivate the plugin and deprecate these endpoints. After talking about it privately, we decided to deactivate the plugin for an immediate fix, and try to get usage data for the API to make a long-term plan. The only know client of this API is a WordCamp app for Android, so we're looking for installation stats.

After deactivating the plugin, there was a cascade of issues across the network (reported by WordCamp Italia and WordCamp US) - the JSON API plugin loaded wp-admin/includes/admin.php on every page, and there are a few places we’ve come to unintentionally rely on that in our code. For example, submit_button is not defined in wordcamp-reports/views/public/ticket-revenue.php, get_current_screen is not defined in wc-post-types/wc-post-types.php, etc.

The plugin was reactivated to fix those issues, and the initial widgets issue was also fixed.

This issue is to track the discussion of possibly deactivating the JSON REST API plugin, and what work would need to happen to get there.

iandunn commented 3 years ago

IIRC the reason we didn't actually shut it off in 2018 was because there's an open PR for the WordCamp app to migrate to the V2 endpoints, and we were expecting it to be merged.

That still hasn't happened, so I think it's worth seeing what the stats are, and shutting it off if they're low enough.