-
-
Notifications
You must be signed in to change notification settings - Fork 208
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
Fatal when other plugins use old-style constructors #7
Comments
I cannot work out what in QM is getting run on these constructors so I can determine a fix. Do you know what might be getting triggered on an old-style constructor? |
I've tracked it down to the diff --git a/wp-content/plugins/query-monitor/components/php_errors.php b/wp-content/plugins/query-monitor/components/php_errors.php
index 3a95363..0f84c48 100755
--- a/wp-content/plugins/query-monitor/components/php_errors.php
+++ b/wp-content/plugins/query-monitor/components/php_errors.php
@@ -173,6 +173,19 @@ class QM_Component_PHP_Errors extends QM_Component {
if ( error_reporting() > 0 ) {
+ if ( ! is_callable( 'QM_Util::backtrace' ) ) {
+ $this->data['errors'][$type][$key] = (object) array(
+ 'errno' => $errno,
+ 'type' => $type,
+ 'message' => $message,
+ 'file' => $file,
+ 'filename' => 'unknown',
+ 'line' => $line,
+ 'funcs' => 'unknown',
+ 'calls' => 1
+ );
+ return;
+ }
$funcs = QM_Util::backtrace();
if ( !isset( $funcs[0] ) ) |
Can you try updating to the latest QM code from the GitHub repo? It should fix that issue. |
Updating didn't seem to fix it. QM on WPE is v2.4.1. |
(Double checking that.) |
Ah ok, I just looked in the cftp/ir-2013 repo and saw QM was still on a 2.4 beta. |
I hadn't pushed the IR changes to GitHub. Here they are now:
Anyway, this is getting dangerously close to you doing Work™. I'm going to shut up now. |
whispers I'm testing on staging. ;) /me was never here |
Seeing this issue too when activating plugins on Pearson (WPE again).
I am running 2.4.1 of QM and this is against our own Video Library plugin. |
@scottsweb – If you patch QM with this https://github.com/cftp/st-jpp/commit/cabad94e7d7b34fa00a65790a5a25d0837372155 does it work for you? |
I think this is a combination of the way strict errors are reported on WPE and the fact that WPE doesn't allow the wp-content/db.php symlink to be put into place. I'll take a look at my next available opportunity :) |
Before even applying the patch @simonwheatley I decided to deactivate and reactivate the plugin... and it worked. So without the patch a second activation seems fine. I have now applied the patch and will see if it appears again. |
If a plugin uses the old-style constructor then Query Monitor fails with a PHP fatal error on WPEngine:
Fatal error: Class 'QM_Util' not found in /nas/wp/www/staging/pencil/wp-content/plugins/co-authors-plus/co-authors-plus.php on line 112
If the old style constructor method is commented out, leaving the proper
__construct
, then the fatal goes away.The text was updated successfully, but these errors were encountered: