Critical Error – deleted code in PHP but can’t reload plugin
-
Hi,
Awesome plugin thank you! Hoping for some help please – I made a PHP snippet … which crashed my site.
I’ve googled high and low so did the following:
– I went via FTP and renamed the plugin to old-insert-headers-and-footers
– I found the snippet stored in my database under _posts – I searched by most recent then just deleted it
… and hooray my site came back.. BUT I can’t get the plugin back on the site with my old working snippets, without crashing the site:To get the plugin back I tried these things:
- I renamed my plugin back to insert-headers-and-footers but the site still crashed so..
- I left it as old-insert-headers-and-footers and went into my Plugins > Activate it again, and again it crashed and I worked out I had to rename the plugin again to have a live site
- I checked my error log which said: [29-Dec-2022 00:40:22 UTC] PHP Fatal error: Uncaught Error: Call to a member function get_queried_object() on null in /home/hosting/mysite.com/wp-includes/query.php:44 (more info below)
Do you have any advice please on how I get the plugin back?
Thanks in advance!
[29-Dec-2022 00:40:22 UTC] PHP Fatal error: Uncaught Error: Call to a member function get_queried_object() on null in /home/hosting/mysite.com/wp-includes/query.php:44 Stack trace: #0 /home/hosting/mysite.com/wp-content/plugins/old-insert-headers-and-footers/includes/conditional-logic/class-wpcode-conditional-page.php(206): get_queried_object() #1 /home/hosting/mysite.com/wp-content/plugins/old-insert-headers-and-footers/includes/conditional-logic/class-wpcode-conditional-type.php(137): WPCode_Conditional_Page->get_taxonomy() #2 /home/hosting/mysite.com/wp-content/plugins/old-insert-headers-and-footers/includes/conditional-logic/class-wpcode-conditional-type.php(107): WPCode_Conditional_Type->evaluate_rule('taxonomy_page', '=', 'plan') #3 /home/hosting/mysite.com/wp-content/plugins/old-insert-headers-and-footers/includes/class-wpcode-conditional-logic.php(151): WPCode_Conditional_Type->evaluate_rule_row(Array) #4 /home/hosting/mysite.com/wp-content/plugins/o in /home/hosting/mysite.com/wp-includes/query.php on line 44
The topic ‘Critical Error – deleted code in PHP but can’t reload plugin’ is closed to new replies.