Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check to ensure site is using WordPress 4.8 #1319

Merged

Conversation

aaronjorbin
Copy link
Member

Fixes #1290

@aaronjorbin aaronjorbin force-pushed the add/minimum-wordpress-version-check branch from a02c660 to 0956714 Compare June 20, 2017 19:13
@aaronjorbin aaronjorbin force-pushed the add/minimum-wordpress-version-check branch from 0956714 to b41702b Compare June 20, 2017 19:15
gutenberg.php Outdated
function gutenberg_wordpress_version_notice() {
echo '<div class="error"><p>';
echo __( 'Gutenburg requires WordPress 4.8 to function properly. Please upgrade WordPress before activating Gutenburg.', 'gutenberg' );
echo '</p></div>';;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a doubled semicolon here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@nylen
Copy link
Member

nylen commented Jun 20, 2017

deactivate_plugins( array( 'gutenberg/gutenberg.php' ) );

I would not have thought to deactivate the plugin here. Is this common practice, or would it be better to keep this notice around?

@aaronjorbin
Copy link
Member Author

@nylen I think it's best to deactivate the plugin so that it's very clear that Gutenberg is not in use and then after WordPress has been updated, the user can activate Gutenberg and see it in all its might.

@nylen
Copy link
Member

nylen commented Jun 20, 2017

A few fixes in the latest commits, including moving the PHP version check to a separate file, with the goal of keeping the gutenberg.php entry point extremely simple and short.

Moving the version check to its own function also fixes the build, because the plugin was loaded via a function during PHPUnit runs, which meant that the $wp_version global was not available at the top level of the code.

@nylen
Copy link
Member

nylen commented Jun 20, 2017

Thanks for working on this. It's working well (tested by temporarily changing $wp_version in my dev install); let's merge it.

@nylen nylen merged commit 537f436 into WordPress:master Jun 20, 2017
@mtias mtias added the Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts label Jun 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants