Error with latest version MainWP Child

We have now run into the followig issue: as soon as we try to enable the Latest MainWP Child plugin (v5.0) it throws a fatal error. We tried enabling just about all plugins, but this error does not go away, please advise.

[Tue Mar 05 23:53:53.645402 2024] [proxy_fcgi:error] [pid 308282:tid 139843313030912] [client x.x.x.x:0] AH01071: Got error ‘PHP message: PHP Deprecated: Hook contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead. in /xxxx/xxxx/domains/xxxx.com/public_html/wp-includes/functions.php on line 6031’, referer: https://www.xxxx.com/wp-admin/plugin-install.php?s=mainwp&tab=search&type=term

PS we have this on a few websites

Hey @SuppY

The PHP Deprecated warning message that you shared with us cannot be a cause for a fatal error.

PHP Deprecated messages are simply warnings that can usually be ignored, although we will be addressing this in the next version of MainWP.

Well, I wish it were the case but enabling the MainWP child V5.0 plugin throws a fatal error (which doesn’t happen the moment we remove the mainWP child). So no, we can’t use it on those sites.

There was little to no info in either wp debug or server log files, that is why I gave the little extra info I could find, it’s the fatal error that crashes the site that is the actual issue.

Plugin could not be activated because it triggered a fatal error.

Thanks for the additional information.

I want to point out that we’ve had over 400.000 updates of the MainWP Child plugin since the v5 release, and we haven’t had a report about the plugin activation triggering a Critical or Fatal Error.

We’ve also tried reproducing this on several of our test Dashboards, but we could not reproduce it. Thus, we conclude that this is an isolated case.

You said that this is affecting some of your sites, so I assume it’s not all of your sites.
Is there anything in common among the affected sites?

  1. Do they have older WP or PHP versions, which may be different than on the other sites?
  2. Do they have a plugin or a theme installed that the other sites do not?
  3. Are all affected sites on the same hosting provider that’s different than the other ones?

Finally, can you install a plugin for debug logs (e.g., Debug Log Manager – WordPress plugin | WordPress.org) and then try to reproduce the error? Hopefully, we will get more information about the error that way.

1 Like

I never said it would be a widespread issue, but it is an issue nonetheless.
Even when we disable all other plugins, the issue remains and the issue only seems to have appeared since the MainWP Child v.50. update.
(I’m just trying to make sure you have the info you need to Possibly prevent an issue arising for more clients so I didn’t mean to get your defences up :-)).

And yes, it is on some sites, not all, but all started at the same time.

I will try and get the debug installed on a smaller site and see if that brings anything. Will update you as soon as I can.

As for your info requests:

  1. All servers/sites involved are running latest WP and latest plugins (up until a few days ago) and we keep all servers identical, so there should be no difference between those at all. (Some do run PHP 7.4 still though)
  2. Yes, certainly themes as each site has their own and some need more plugins too. I’ll try again to see what may be causing it but up till now, the switching on/off of plugins/themes made no difference.
  3. They’re all hosted by the same provider, yes. (so also many that don’t have the issue of which enough even on the same servers)

I’ll update you further, if I can find anything, asap.

Ok, stripped a small site from all (but the bare necessitiy) plugins and disabled the non WP own theme.

Still no joy.

The only relevant error that is caught may be related to following:

Hey @SuppY

Great, you managed to log the PHP Fatal.

Based on this, the issue is almost certainly related to a code snippet you applied to these child sites using our Code Snippets extension.

When the MainWP Child plugin is activated, it tries to load the snippets from the database.
The snippet itself may contain invalid code, or, the snippet might be placed to these child sites in an additional way (e.g. directly to the functions.php file) which will cause a re-declaration error.

The snippets that are applied using our Code Snippets extension, can be removed from the database as outlined in this KB: Remove a Code Snippet From a Broken Site - MainWP Documentation

4 Likes

That worked but ideally this shouldn’t create an issue when it is added by the MainWP code Snippets extension. Maybe a double declaration check would help. Thanks for the input.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.