site inaccessible after manually extending pro site status

Hi guys

I´ve just create a website in my multisite installation, I was able to access it with its´s own administration user (different than admin) then I went to the super admin dashboard (in a different session) and manually extended the pro sites status. But now either with the site admin or the super admin the website is inaccessible and it´s dashboard as well.

this definitely happened after extending the pro site status.

this is the message I´m getting

Fatal error: Call to a member function flush_rules() on a non-object in /home/webstud1/public_html/wp-includes/rewrite.php on line 108

thanks

  • Ash
    • WordPress Hacker

    Hello @raulcabrerar

    Welcome to WPMU community!

    I hope you are well today and thanks for asking the question.

    Well, we need to be sure if it happened for Pro Sites. Would you please go to Network Admin > Plugins > All Plugins and deactivate Pro Sites plugin and then check if that site is accessible now?

    Please let me know.

    Cheers
    Ash

  • raulcabrerar
    • Design Lord, Child of Thor

    hi Ashok

    Follow up

    I´ve created another website and promoted to a pro status but this time only for a year and everything is working alright. Seems to me that when trying to permanently extend a pro status the problem arises. fortunately the site was recently created and I can delete and create a new one, but this issue should be corrected because if the website is up and running would be headache.

    regards.

  • raulcabrerar
    • Design Lord, Child of Thor

    Seems I need some help because I can´t figure out where to do the change you suggested because I didn´t even could activate a theme.

    In addition I deleted the web site and create a new one with the same name, promoted to a pro status only for a year and I´m facing the same problem, is there any relation with the website name?

  • Ash
    • WordPress Hacker

    I am sorry, I need to make it more clear.

    You will need to go to /wp-content/themes/ACTIVE_THEME_NAME/functions.php

    You don't need to activate any theme. You know the name of active theme, right? Go to that folder.

    If you can't figure it out in any change, please do the follow:

    Otherwise mu-plugins is the better solution. To use mu-plugins, go to /wp-content/ and find the folder with name 'mu-plugins'. If there is no folder in that name, then create a folder, name it 'mu-plugins', create a file inside that, give any name you like and paste the code in there. You don't need to activate that plugin. Mu-plugins means must use plugins, so it will be activated automatically always.

    Hope it helps! Please feel free to ask more question if you have.

    Cheers
    Ash

  • Ash
    • WordPress Hacker

    Yes, you can test with 2012, 2013 or 2014 :slight_smile: I like 2012 for testing though.

    And yes, then create another file in mu-plugins folder, name it anything, use the code:

    <?php
    add_action('init', 'flush_rewrite_rules');

    And check by then.

    Let me know.

    Cheers
    Ash

  • raulcabrerar
    • Design Lord, Child of Thor

    I created the pro.php file in the mu-plugins and used to code you said

    <?php
    add_action('init', 'flush_rewrite_rules');

    it´s that ok?

    Now regarding the change in the funtions.php file I have located the file in the twentyforteen theme folder but there are a lot of ?> ending tags, before which one should I add this?

    add_action('init', 'flush_rewrite_rules');,

    Sorry to ask too much but I I don´t want to mess things up

    I´ve noticed the two codes you told me to add are similar, may I ask what are they suppose to do

    Regards

  • Ash
    • WordPress Hacker

    Can you access your site now?

    If still you can't access, please delete my code, go to /wp-includes/rewrite.php line no 107. replace

    global $wp_rewrite;
    $wp_rewrite->flush_rules( $hard );

    with

    add_action('init', 'flush_rewrite_rules');

    Then manually extend again and let me know if you can access.

    Note that, editing core files is not a good idea, I just want to be sure where is the main issue.

    Cheers
    Ash

  • raulcabrerar
    • Design Lord, Child of Thor

    HI there Ash

    Yes I´ve just checked them out and everything is fine now, I´ve even created a new one and extended the level permanently and works

    Glad you did your magic and fixed, but please let me know what to do "or not" because I'll have other websites using the pro sites plug in and I´d like to be sure I won´t have the same problem.

    regards..

  • Ash
    • WordPress Hacker

    Hi @raulcabrerar

    In fact, I didn't face any issue like this before. But after seeing your issue, I just investigated and got some fix.

    Well, as long the code snippets fixed your issues, I don't think you should have any limitation :slight_smile: If you see any more issue, please feel free to create a new topic.

    Please let me know if you find this is helpful, or if you have any further questions.

    Cheers
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.