Fatal Error: Call to a member function flush_rules()

Home Forums General issues Fatal Error: Call to a member function flush_rules()

This topic contains 33 replies, has 3 voices, and was last updated by  Mark Wolters 3 months, 3 weeks ago.

Viewing 30 posts - 1 through 30 (of 34 total)
  • Author
    Posts
  • #41980 Reply

    Brian

    Hello,
    Thank you so much for this plugin. I am having an issue with the final steps to activating the plugin. I got the following message:

    Almost ready to migrate to SSL!
    Some things can’t be done automatically. Before you migrate, please check for:
    Http references in your .css and .js files: change any http:// into //
    Images, stylesheets or scripts from a domain without an ssl certificate: remove them or move to your own server.

    When I click the button to “Go ahead, Activate SSL”, I get the following error:Fatal error: Call to a member function flush_rules() on null in /wp-includes/rewrite.php on line 273`

    It seems like it is working but I am getting that constant message and error. Not sure how to continue.

    Thanks,
    Brian

    #41987 Reply

    Hi Brian,

    This is a known issue that pops up in a few cases. In the release that is planned tomorrow this is fixed, but you can fix it now if you change in class-admin.php, line 97
    add_action( 'admin_init', 'flush_rewrite_rules');
    into this:
    add_action( 'shutdown', 'flush_rewrite_rules');

    or replace with the class-admin.php file from github:
    https://github.com/rlankhorst/really-simple-ssl/blob/master/class-admin.php

    #43127 Reply

    Kevin

    I downloaded the plugin today. I got the same error and It already say add_action( ‘shutdown’, ‘flush_rewrite_rules’);s

    Website using divi theme

    #43175 Reply

    Hm, that is strange. If you have trouble activating because of this, the quick fix is to comment that line out.
    //add_action( 'shutdown', 'flush_rewrite_rules');

    Then you can do the flush manually by re-saving the permalinks in settings/permalinks. I’ll have to investigate why this works fine in most cases, but sometimes causes this issue.

    Thanks for reporting it.

    #45644 Reply

    Adrian

    Not working even comment out.

    #45645 Reply

    What error do you get? If you comment out this line, it can’t cause an error anymore.

    Do you get an error from another line? If you can post some more details I can take a look.

    #45647 Reply

    Adrian

    Sorry, it’s working now. Browser was cached.

    Thanks!

    #45648 Reply

    Glad to hear that. So you had this error on activation? I’m trying to find out what is causing this. It might have something to do with another plugin flushing the rules on the wrong hook.

    #50338 Reply

    marcel

    Hallo Rogier,

    Ik heb vandaag de plugin geinstalleerd en krijg ook de melding:
    /wp-includes/rewrite.php on line 273

    Ik heb ‘purge all caches’ gedaan van W3 Total cache en daarna de permalinks opnieuw opgelagen. Maar het probleem lost zich niet op. Moet ik ‘browser cache’ van W3 total cache ook uitschakelen?

    greetz, Marcel

    #50340 Reply

    Mark Wolters
    Keymaster

    Hallo Marcel,

    wat je kan proberen is om in de class-admin.php op regel 93 de volgende regel uit te commentaren:

    add_action( 'shutdown', 'flush_rewrite_rules');

    door er // aan toe te voegen:

    //add_action( 'shutdown', 'flush_rewrite_rules');

    dat zou het probleem op moeten lossen. Als je wil mag je een lijst met plugins die je gebruikt sturen via https://really-simple-ssl.com/support/. Dan kunnen wij dit verder onderzoeken.

    Mark

    #50453 Reply

    marcel

    Het is gelukt hoor, Mark, dank! Ik heb nog wel even eerst de cache geleegd en daarna permalinks gesaved, dan krijg je die foutmelding ook nier meer als de SSL opnieuw activeert.

    Maar als ik de plugin update naar een nieuwe versie, wat heeft dat voor consequenties?

    Het lijstje met plugins is onderweg…

    groet, Marcel

    #50456 Reply

    Het uitgecommentaarde stukje wordt alleen gebruikt bij de initiele activatie, daarna nooit meer. Dus een update heeft geen effect. Dank voor de plugins lijst! We gaan dit onderzoeken.

    #74807 Reply

    Hugo O.

    I had the same problem in my website https://lavish.solutions and commenting the line out helped to fix it.
    What’s strange is that the website was forced to SSL even though I got that error message.
    The first time I couldn’t access so I used PHPMyAdmin to log-in and in the wp_options I changed the home to https://

    Then I could login and https was already in place but I couldn’t get rid of the message that says “Almost ready to migrate to SSL” and I followed the instructions here – https://wordpress.org/support/topic/how-to-remove-the-big-message-shown-after-activating-the-plugin/ but it didn’t work.

    I deactivated the plugin and then enabled it again and I got the error message of a major security issue and that I had to change the force-deactivate file from .php to .txt

    I did that following the instructions here – https://really-simple-ssl.com/knowledge-base/uninstall-websitebackend-not-accessible/ and it worked but not for the message.

    I still had the message “Almost ready to migrate” and that was solved until I commented the line out. Not even un-checking the “Flush out” box helped.

    #74946 Reply

    Mark Wolters
    Keymaster

    Hi Hugo,

    good to see you got your site working. The flush rewrites error has been a tough one to tackle, strange that unchecking the ‘flush rewrite rules’ box didn’t help to solve the rewrite error in your situation.

    Did you try to add the

    define(‘RSSSL_DISMISS_ACTIVATE_SSL_NOTICE’,true);

    line to your wp-config.php file to remove the message? That should tell the plugin to not show the message, even after updating it.

    Mark

    #80031 Reply

    Cat Russell

    Hi, I was seeing this error today when I tried to enable SSL.

    Despite the error the SSL / https was enabled on the admin backend but still not on the front-end. When I checked the WP settings page the https had only been applied to the WordPress address and not the site address. When I updated this manually and saved it, re-saved the permalinks and then went back to enable the SSL it then worked fine, even with the flush box checked. Not sure why that happened but maybe it can help someone else.

    #80074 Reply

    Hi Cat,

    Thanks for sharing this. This issue seems related to other plugins flushing the rewrite rules too early. If the “flush” checkbox is unchecked, the rewrite rules are not flushed and you can do this manually. But when unchecked you should not see this error, because it won’t flush then. We’re still looking to reproduce this problem so we can resolve it.

    #88713 Reply

    Bruno

    Good morning, I had the same problem, I solved by disabling all plugins, except really-simple-ssl, everything was successful! Later I reactivated them!

    #88746 Reply

    Great, thanks for sharing your solution!

    #131900 Reply

    D.G.

    I got this error a few times, persisted in the same way that someone might try to open a door with their forehead (1. Reload page, 2. Click “Go Ahead, Activate SSL” again). Worked on the third try.

    ¯\_(ツ)_/¯

    #132599 Reply

    Greg Burkett

    Just to add some details to this error (which I just got on activation).. Disabling the plugin WP Super Cache allowed me to activate normally. This is a pretty common plugin, so perhaps why this issue pops up from time to time.

    #134381 Reply

    Mirza

    I had this same error, then I opened the site in incognito mode and activated the SSL plugin with no issues.

    #134737 Reply

    Wolf

    Activation worked after disabling Super RSS Reader

    #156474 Reply

    Chris Carman

    Mirza’s recommendation of using a private/incognito browser window made the difference for me when activating individual sites on a multisite configuration. Thanks!

    #159077 Reply

    Paul

    Hi there,

    Have used your plugin on numerous sites and never had an issue.

    However, on this one …

    Fatal error: Uncaught Error: Call to a member function flush_rules() on null in /home/##########/public_html/wp-includes/rewrite.php:273 Stack trace: #0 /home/##########/public_html/wp-admin/includes/misc.php(469): flush_rewrite_rules() #1 /home/##########/public_html/wp-includes/class-wp-hook.php(288): update_home_siteurl(‘http://##########…’, ‘https://modelaf…’) #2 /home/##########/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(”, Array) #3 /home/##########/public_html/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #4 /home/##########/public_html/wp-includes/option.php(401): do_action(‘update_option_s…’, ‘http://##########…’, ‘https://modelaf…’, ‘siteurl’) #5 /home/##########/public_html/wp-content/plugins/really-simple-ssl/class-admin.php(1064): update_option(‘siteurl’, ‘https://modelaf…’) #6 /home/##########/public_html/wp-content/plugins/really-simple-ssl/class-admin.php(324): rsssl_admin->set_siteurl_to_ssl() #7 /home/##########/public_html/wp-content/plugins/really-simple-ssl/class-admin.php( in /home/##########/public_html/wp-includes/rewrite.php on line 273

    Hopefully you can help? It may well be a plugin conflict.

    Thanks,

    Paul

    #159079 Reply

    Hi Paul,

    Did you try waiting a few minutes, then reloading the page? When this happens, it usually passes after some time.

    If this does not help, and you have a caching plugin active, you might try deactivating the caching plugin. That will lower the memory usage during activation.

    Let me know if this helps!

    #159092 Reply

    Paul

    Thanks.

    Have disabled cache plugin and trying again. Still same error message, but will wait a while before I refresh page.

    Will let you know.

    #159093 Reply

    Paul

    Thank you for all your help.

    Had to disable cache plugin and a plugin called User Profiles Made Easy.

    Hopefully now all good! https://modelafordclub.co.nz

    Thanks again,

    Paul

    #161580 Reply

    muller

    Hello,

    I had the same error.
    I commented line 120 and it was ok.

    `if (get_option(‘rsssl_flush_rewrite_rules’) && get_option(‘rsssl_flush_rewrite_rules’) < strtotime(“-1 minute”)){
    delete_option(‘rsssl_flush_rewrite_rules’);
    // add_action(‘shutdown’, ‘flush_rewrite_rules’);
    }`

    Should I now take the comment off, or is not necessary?

    Thnanks for the plugin anf or this fix,

    véronique m.

    #161582 Reply

    v muller

    oups, Sorry, me again,
    actually the plugin is not working as i still have the lock on the address bar.

    #161635 Reply

    Hi,

    The lock in the address bar is a good thing! Or do you mean you don’t have the lock?

Viewing 30 posts - 1 through 30 (of 34 total)
Reply To: Fatal Error: Call to a member function flush_rules()
Your information: