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 sanity check: Is Yoast installed and active? #175

Open
OldGrumpy-de opened this issue Nov 16, 2022 · 0 comments
Open

Add sanity check: Is Yoast installed and active? #175

OldGrumpy-de opened this issue Nov 16, 2022 · 0 comments

Comments

@OldGrumpy-de
Copy link

OldGrumpy-de commented Nov 16, 2022

I know it sounds ridiculous but I had two cases of this over the last week, so I thought I'd put in this feature suggestion.

The thing is that the Yoast test helper plugin tries to make use of code in the main plugin without checking if it is even installed and active. In "my" two current cases this results in a fatal PHP error and infuriated clients ;)

How to reproduce: Create a WordPress website, set it up, DO NOT INSTALL YOAST SEO, just install the Yoast test helper plugin. Enable the debug log to see what's going on. Go to Tools -> Yoast Test. There, click on "Reset Indexables tables & migrations". BOOM. (Read: WordPress shows the "there has been a critical error on your website" screen and sends you an email with error details.)

PHP Fatal error: Uncaught Error: Class 'WPSEO_Options' not found in [...]/wp-content/plugins/yoast-test-helper/src/wordpress-plugins/yoast-seo.php:177

Yes, you may argue that nobody will do that without having a) Yoast installed, and b) having a problem with Yoast. And yet still, I had two different people doing exactly that, within a single week.

Admittedly, one of the cases is a bit special. There, we got a main site WITH Yoast and a sub-site without it. So the website owner just installed the test helper plugin on both sites and tried to click "Reset Indexables tables & migrations". This is slightly more reasonable than the other case where some googling gave the website owner the wrong idea about what his problem was...

To cut a long story short: I think the plugin should be able to deal with this problem (Yoast SEO not installed or not active) in a more graceful way than a fatal error. ;) Yes, it doesn't have a high priority, but it is definitely "nice to have" if the plugin can exit more gracefully, possibly even with a diagnostic message that points out that the main plugin is not present (and thus probably no reason to run the helper plugin anyway).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants