Codesnippets break the website
-
I just installed WordPress and Kadence theme and Kadence Blocks plugin and Code Snippets plugin so my site is fairly new and updated.
When i applied a custom code using code snippets plugin then my website got crashed and I was forced to login via wordpress recovery mode.
Code
// Disable Microdata in Kadence function disable_kadence_microdata() { if (function_exists('kadence_blocks_init')) { remove_action('wp_head', array( Kadence_Structured_Data::get_instance(), 'output_structured_data' ), 20); } } add_action('init', 'disable_kadence_microdata');The above code crashed my website and I got this error.
ERROR
Error Details ============= An error of type E_ERROR was caused in line 4 of the file /home/mywebsite/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(582) : eval()'d code. Error message: Uncaught Error: Class "Kadence_Structured_Data" not found in /home/mywebsite/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(582) : eval()'d code:4 Stack trace: #0 /home/mywebsite/public_html/wp-includes/class-wp-hook.php(324): disable_kadence_microdata() #1 /home/mywebsite/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #2 /home/mywebsite/public_html/wp-includes/plugin.php(517): WP_Hook->do_action() #3 /home/mywebsite/public_html/wp-settings.php(643): do_action() #4 /home/mywebsite/public_html/wp-config.php(98): require_once('/home/mywebsite/...') #5 /home/mywebsite/public_html/wp-load.php(50): require_once('/home/mywebsite/...') #6 /home/mywebsite/public_html/wp-admin/admin.php(34): require_once('/home/mywebsite/...') #7 /home/mywebsite/public_html/wp-admin/plugins.php(10): require_once('/home/mywebsite/...') #8 {main} thrownI deleted the codesnippets plugin from wordpress using FTP and everything works fine.
Now, when I fresh install codesnippets plugin from wordpress admin dashboard using Add new plugin. After installation when I press ACTIVE then the website crashes again and I got the same error.
This is an endless loop for me and I am unable to use code snippets on my website.
please help.
The topic ‘Codesnippets break the website’ is closed to new replies.