Describe the bug
The combination of the current Gutenberg plugin (5.6.1) and WordPress 5.0.x does not work for a couple reasons.
version_compare( '5.0', '5.0.0', '<' ); evaluates to true and the plugin immediately deactivates. Yay, non-semantic versioning. :)gutenberg_render_block_core_latest_comments() exists in both Gutenberg and WordPress 5.0.1. This was the case until it was renamed in the WP 5.1.0 release.To reproduce
Steps to reproduce the behavior:
wp core update --version=5.0 --forceExpected behavior
I expect (due to the minimum requirements) that the Gutenberg 5.6.1 plugin is compatible with WordPress 5.0. Maintaining that compatibility seems like a good idea. There are still groups working through the 4.9 -> 5.x upgrades on large installs with lots of content and trying to figure out how to adapt that to Gutenberg. It's much easier to do this when you're able to keep Gutenberg at the latest version.
I'd propose:
function_exists() check around gutenberg_render_block_core_latest_comments()Add a function_exists() check around gutenberg_render_block_core_latest_comments()
I know this is not possible because it means Gutenberg is not overriding the latest comments block server side rendering included in 5.0. I know @aduth and @gziolo worked on this "overriding" behavior and would know more here.
It might be possible to guard, but it would require some one-off workaround. In recent changes, the naming of these functions is automated in the Webpack build script:
Previously: #13521
Since Gutenberg is a development plugin now, I'm also ok updating the minimum version to a more recent WP release.
Yeah, it does seem like it would be more effort than it is worth to keep the 5.0.x compatibility. That this has been the case for several months now is probably an indicator that it's not something many people are running into. :)
If it's agreeable, should we create a separate issue for the minimum version requirement bump, or can we adapt this issue to serve that purpose?
Would WordPress 5.1 as a minimum version work here? We're releasing tomorrow and we can take care of this at the same time.
@youknowriad It should. The function was renamed from gutenberg_render_block_core_latest_comments to render_block_core_latest_comments as of WordPress 5.0.2:
https://github.com/WordPress/WordPress/blob/5.0.2/wp-includes/blocks/latest-comments.php#L43
I assume we should want to update the condition here, though:
It was also mentioned in original comment. Based on commentary there, it's unclear whether the logic needs to be updated to account for versions which omit the patch indicator?
Maybe something like this, to normalize the version:
while ( substr_count( $version, '.' ) < 3 ) {
$version .= '.0';
}
Giving the timing of the pending release and general non-urgency here, perhaps better to wait for the following release?
@aduth yes, that works for me
Minimum version has been updated to 5.1.0 with the release of GB 5.9.
Most helpful comment
Since Gutenberg is a development plugin now, I'm also ok updating the minimum version to a more recent WP release.