Cannot reactivate MainWP Child plugin after MainWP Code Snippet fail


I did saved a code snippet using MainWP Code Snippets plugin, and I realized I goofed up the syntax a little and it broke the website. Unfortunately in my case it was the MainWP site itself I broke with a critical error. I deactivated all plugins and then reactivated one by one and I get an error when trying to activate the MainWP Child plugin. The error is as follows:

**Parse error** : syntax error, unexpected '$premiums' (T_VARIABLE) in **/app/data/public/wp-content/plugins/mainwp-child/class/class-mainwp-utility.php(87) : eval()'d code** on line **5**

I have looked at the file it lists (though can’t find a file with 87 in it), and line 5 is part of a commented section so it shouldn’t be it. I tried to run into the database of the MainWP Child site (which in my case is also the MainWP Dashboard site) and correct the DB entries for the code snippets along the ones from the tables on this KB article: Remove a Code Snippet From a Broken Site - MainWP Documentation

I also tried to remove the entries in the DB entirely but saw no changes when trying to activate the plugin. How do I go about resolving this and getting the ability to re-activate the MainWP Child plugin? Your help would be greatly appreciated!

PS - I also can restore from a backup if absolutely needed, however my concern with that was that the changes I made to various code snippets would be lost and wasn’t sure how that’d stay in sync with the Child Sites in which they were applied, etc (I had deleted a few snippets and merged with others, etc).

1 Like

I think I fixed it, and the changes I tried to do before were apparently correct however in my case I had Object Cache enabled for redis, and so I think that was why changes I made didn’t seem to take effect at all, and once I flushed the Object Cache, it worked correctly. :slight_smile:

1 Like

Hey @d19dotca

Glad you managed to fix it. Cache is always a usual suspect :slight_smile:

1 Like

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