Fatal error: Call to a member function is_main_query() on a non-object in /home/username/public_html

All of a sudden we saw this:
Fatal error: Call to a member function is_main_query() on a non-object in /home/everythi/public_html/wp-content/plugins/events-and-bookings/lib/default_filters.php on line 122

I deleted the plugin from ftp as we could not log in. Tried it again both with individual and network activation on this website and get the same error.

  • Michelle Shull
    • DEV MAN’s Apprentice

    Hi Luby!

    Since it's working okay on one site, let's try to find what's different about the site where everything works, and the site where everything falls apart.

    My first suspect would be the theme or a plugin conflict. Have you tried general troubleshooting by switching to a default theme and disabling your plugins temporarily to find if one of them or your theme is causing the issue?

    Thanks!

  • LubyG
    • Site Builder, Child of Zeus

    Wow! This is frustrating. I re-enabled some plugins and then the problem was intermittent. I then disabled them all again.

    Next, I networked enabled the WPMU Dashboard, enabled the Events + and Google Maps just on the main site and activated Google Maps inside Events + Settings.

    Now I cannot even Create New Map in an event or post. The screen just goes blank. I can see previously added map locations in the list, just can't create a new one. Tried both Safari and Chrome on my MAC.

    I think the best bet for me at this point is to take the whole network down and try to recreate it over the next 5 months. It is for a seasonal beach area so the traffic is lower this time of year. Bottom line, the fewer plugins the better. I will just keep it simple and create a category for Events and use posts. Maps can be directly coded from Google Maps for the 300 to 400 events we have a year. No calendar but that is not the biggest draw to the website.

    Hope you are able to help others. I simply don't have time. We run hundreds of websites.

  • Michelle Shull
    • DEV MAN’s Apprentice

    Hi Luby!

    I understand your frustration, I've been there myself with my own sites. Pulling one thread breaks something seemingly unrelated in another part of the site, then it's a house of cards. Still, dismantling the network might be like burning down the house to kill a spider right now, tempting, but not the easiest long-term solution. : )

    WordPress, on it's own, is a fantastic and easy to use tool. The issues arise when we start bringing in themes and plugins written by third parties, and the nearly endless number of unique site configurations that result. We do our best to test all our plugins and themes in a variety of environments, but it's impossible to test every combination. That's why we rely on information in these threads, from users just like you, to help us track down exactly where these conflicts pop up.

    Let's not give up yet! It's going on one site, we just need to find the right trigger to pull to make it work on the second one.

    #TeamLuby : )

  • LubyG
    • Site Builder, Child of Zeus

    I guess I can try to load some of the same plugins to the test site that is a single install. Just don't have time to fool with it this week. I will let it sit a while in case you find others with the same issue and we figure it out. I understand things from the developers point of view too. It is nice that WP is open but then along with that comes the potential for conflicts.

  • Michelle Shull
    • DEV MAN’s Apprentice

    Hello!

    You're right, WordPress' openness is a blessing and a curse. We're here all the time (there's always at least one staff person watching the forums), so feel free to come back to this thread when you dig in again.

    Have a great week, and thanks for being a great member.

  • aristath
    • Recruit

    Hello there @LubyG, I hope you're well today!

    To download previous version of the plugin you can go to the plugin page on https://premium.wpmudev.org/project/events-plus/
    On the right sidebar, just below the image you will see 3 links. The one in the middle says "Changelog" (see attached screenshot). If you click the changelog you will see a list with all previous versions and their changes.
    You can click on the version numbers to download these previous versions of the plugin.

    I hope that helps!

    Cheers,
    Ari.

  • LubyG
    • Site Builder, Child of Zeus

    Thanks but 1.7.4 still shows the same error. I'm not sure if the attached image is related. Under My Sites there are two links that lead to the same Dashboard. I don't see this in other WP Networks I have. One shows it by name and the other by domain. They are the last two on the list. Put a big arrow to them.

  • Michelle Shull
    • DEV MAN’s Apprentice

    Hello, Luby! Nice to see you back in the fight.

    That is odd, in your above screenshot. And it makes me think we've got some sort of pathing error going on, whether it's within your DNS settings or something in your install.

    Let's do a few troubleshooting questions.
    1. How did you create that site? Was it Sites>Add New, or did you use a plugin like Cloner to copy an pre-existing site?

    2. When you follow the links in your sites list above, do both everythingouterbanks.com links go to the same page? Does either one send you to a broken page?

    We'll get this sorted!

  • LubyG
    • Site Builder, Child of Zeus

    Hi Michelle,
    Background:
    The original install was done with Fantastico in Cpanel. I then set up the Network and all was fine. Not sure how many years it has been. Of course, I added and removed way too many plugins over time. I did have Cloner installed at one point but it was not used to create the main site. It was installed years after the original install.

    1. Sites > Add New is the way I usually create new sites. Never tried to create two of the same thing. I just noticed it was there in the list one day. Wish I could recall when it happened.

    2. When I follow the links it goes to the same dashboard with no errors.

    The system uses subdirectories rather than subdomains. I do have Cloudflare installed and bypassed it with no change. Also looked at the DNS Zone files
    and it looks good.

    If it is a path issue where would I look, wp-config.php?

  • Michelle Shull
    • DEV MAN’s Apprentice

    Hello again!

    Ah, the collected debris from long gone plugins plagues me on some of my sites, as well.

    If your DNS is correct and both links go to the same (working) page, it's probably not a pathing issue, and we can mark that off the list.

    I would check wp-config, not for pathing, but for any holdover code inserted by plugins you're not using any more. I'd also check your database to see if there are any tables from plugins you know you'll never reinstall that can be dropped. There's a plugin to do this for single site, but I've never tested it on a multi, and you seem to be pretty savvy/experienced, dropping db tables is probably already in your wheelhouse.

    While you're in wp-config, can you temporarily switch debug to true? If you get any errors on your site, copy/paste them here for me.

    Thanks so much!

  • LubyG
    • Site Builder, Child of Zeus

    Yep, I tried deleting old db tables using a plugin and it broke the site. Luckily we run our own dedicated server and have 3 month retention. I dislike the plugins and prefer to use the WHM.

    I also tried to manually drop old db tables in phpMyAdmin and that is tedious. I doubt it helps much as most tables are only a couple kb's and aren't being called. I also run a db optimizer. Got tired of doing it manually so I use a plugin that runs daily.

    I'll have to look through the wp-config.php file to see what I can understand. I get some of it but not all. I'll try the "debug" thing and let you know. Thanks,
    Mike

  • Tyler Postle
    • CGO

    Hey Luby,

    Hope you're doing well today and thanks for the replies!

    To turn on debug, if you don't have the code in there already, you can just paste this in:

    define( 'WP_DEBUG', true );

    There are some other defines you can use as well to hide the errors on the frontend and just feed them to a log file that you can open later, they are on this page here: http://codex.wordpress.org/WP_DEBUG

    Once done, you can set debug back to 'false' :slight_smile:

    Let us know if that gives out any errors/warnings!

    All the best,
    Tyler

  • LubyG
    • Site Builder, Child of Zeus

    Here is the debug info. What a mess. I'll have to take a fresh look in the morning. Thanks to you all.

    Notice: Undefined index: reset in /home/everythi/public_html/wp-content/mu-plugins/cets_blog_defaults.php on line 1402

    Deprecated: Assigning the return value of new by reference is deprecated in /home/everythi/public_html/wp-content/plugins/logout-redirect/logout-redirect.php on line 203

    Notice: load_plugin_textdomain was called with an argument that is deprecated since version 2.7 with no alternative available. in /home/everythi/public_html/wp-includes/functions.php on line 3320

    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/everythi/public_html/wp-content/mu-plugins/cets_blog_defaults.php:1402) in /home/everythi/public_html/wp-content/plugins/wpmu_dev_maps_plugin/inc/external/wpmu-lib/functions-wpmulib.php on line 73

    Notice: Undefined variable: control_ops in /home/everythi/public_html/wp-content/plugins/super-cool-qrcode/super-cool-qrcodes.php on line 36

    Notice: define() was called with an argument that is deprecated since version 3.0! The constant VHOST is deprecated. Use the boolean constant SUBDOMAIN_INSTALL in wp-config.php to enable a subdomain configuration. Use is_subdomain_install() to check whether a subdomain configuration is enabled. in /home/everythi/public_html/wp-includes/functions.php on line 3318

    Notice: load_plugin_textdomain was called with an argument that is deprecated since version 2.7 with no alternative available. in /home/everythi/public_html/wp-includes/functions.php on line 3320

    Notice: Undefined index: syndicationsource in /home/everythi/public_html/wp-content/plugins/autoblogged_2-9-1/autoblogged.php on line 3856

  • aristath
    • Recruit

    Hello again @LubyG, I hope you're well today!

    Most of the errors above are simple PHP & deprecated notices.
    However some of them indicate there's something wrong with the mu-plugins/cets_blog_defaults.php file.
    If I'm not mistaken it's from this plugin: https://wordpress.org/plugins/wpmu-new-blog-defaults/

    Can you please verify that you are using tits latest version?
    If you're still having issues with that, could you pelase try reporting them to the plugin develper on http://wordpress.org/support/plugin/wpmu-new-blog-defaults

    Please advise,
    Ari.

  • LubyG
    • Site Builder, Child of Zeus

    Took a look at my error log and had to delete it yesterday as it was huge. It is growing today again. Of course, there are repeats. Here are a couple:

    [14-Sep-2014 04:46:16 UTC] PHP Warning: rtrim() expects parameter 1 to be string, object given in /home/everythi/public_html/wp-includes/formatting.php on line 1659

    [14-Sep-2014 17:32:02 UTC] WordPress database error Table 'everythi_eobxmu.wp_173_options' doesn't exist for query SELECT option_value FROM wp_173_options WHERE option_name = 'home' LIMIT 1 made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/Divi/page.php'), get_footer, locate_template, load_template, require_once('/themes/Divi/footer.php'), wp_footer, do_action('wp_footer'), call_user_func_array, wp_admin_bar_render, do_action_ref_array, call_user_func_array, wp_admin_bar_my_sites_menu, home_url, get_home_url, get_option

  • Tyler Postle
    • CGO

    Hey Luby,

    Hope you're doing well today!

    Thanks for posting that screenshot. It is odd that an notice still comes up for that plugin when you no longer have it added.

    I don't see anywhere in this thread that you've tested out the latest 1.7.6.1 version, that one was released after the topic was started. I just want to double check you have tried that one before any other troubleshooting takes place :slight_smile:

    Look forward to hearing back Luby!

    All the best,
    Tyler

  • LubyG
    • Site Builder, Child of Zeus

    Yes, that version was tested. Funny, it does not cause the error on a subdomain just the main site.

    After seeing all the bugs I have on this system I'm fairly sure I am going to export the content to another site, take this one down, re-install and import the content. I don't think there is an easier way to clean it all up.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.