• A Code Snippets person said the problem might not be with Code Snippets.

    I used the following code to try to make the hyperlinks in bbPress (which is a forum plugin) categories go away. (The categories are in a forum. At the first page of my site that used to show up, the categories include “Introduction” and “Comment on administrator’s writings.”)

    After pasting the code

    <?php do_action( 'bbp_theme_before_forum_title' ); ?>
    		
    		<?php if  (!bbp_is_forum_category( bbp_get_forum_id())){ ?>
    
    		<a class="bbp-forum-title" href="<?php bbp_forum_permalink(); ?>"><?php bbp_forum_title(); ?></a>
    		
    		<?php } else { ?>
    		
    		<div class="bbp-forum-title"> <?php bbp_forum_title();?> </div>
    		<?php }
    		?>
    		
    		<?php do_action( 'bbp_theme_after_forum_title' ); ?>

    which I found at

    https://bbpress.org/forums/topic/remove-category-hyperlink/

    into a Code Snippets page

    I got a message that read “There has been a critical error on your website”

    and now I am not able to see any of my pages or log in

    and it seems too dangerous to use add define( 'CODE_SNIPPETS_SAFE_MODE', true ); to wp-config.php

    and using ?snippets-safe-mode=true doesn’t work.

    I’m using version 5.5.5 of WordPress, and version 2.6.6 of bbPress. The version of the Code Snippets plugin is the version that people could download yesterday.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Using FTP or the control panel provided by your host (e.g. cPanel), navigate to the /wp-content/ >>> /plugins/ directory. Rename the /code-snippets/ directory to /code-snippets-old/. That should give you access back into the site and back-end. Then, if you rename that plugin directory back to to /code-snippets/ it will show as being installed but disabled in your plugin directory.

    After that, are you able to enable the plugin and remove that snippet before the fatal error triggers? If not then you will either need to delete the plugin from the /plugins/ directory, and lose all your existing snippets, or ask in the plugin support forum for a way to remove that code (e.g. from the MySQL database): https://www.ads-software.com/support/plugin/code-snippets/#new-post

    and it seems too dangerous to use add define( ‘CODE_SNIPPETS_SAFE_MODE’, true ); to wp-config.php

    Any tinkering with files can trigger issues, but if you follow 2 rules then you can lalways revert any troubles that occur:
    1) make sure you take a backup of the file before making any changes
    2: Make sure you have another way to access the site files, apart from the WordPress dashboard (e.g. FTP, SSH, the control panel provided by your host)

    Provided that you can meet these 2 conditions, then adding define( 'CODE_SNIPPETS_SAFE_MODE', true ); to a new line at the bottom of the wp-config.php file may be your easiest way out of this problem. I imagine that will allow you to access the WordPress backend and remove that code from the plugin. Then, you should remove that line of code from wp-config.php.

    Thread Starter jason4locations

    (@jason975)

    Thanks, barnez, for giving me so much information so quickly. It worked.

    Which file should I make a backup of? Is a plugin the easiest way to make the backup? If so, could you recommend a plugin?

    Should I start a new topic if I want to get the code (which is above) that caused the problem to work? Please know that I am a beginner, so while safer is better than easier, easier is better than efficient, elegant, etc..

    Which file should I make a backup of?

    If you make changes to an individual file, like wp-config.php, then you should manually take a backup of that file (e.g. download a copy to your local machine). Best practice is also to take regular backups of all the site files and database, in case disaster strikes. You can use a plugin for this: https://www.ads-software.com/plugins/search/backup/

    To try and get that code working, you should continue with your support request that I can see in the BBPress forum.

    Good luck!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Site down after using Code Snippets plugin’ is closed to new replies.