• Resolved bahraingeneral

    (@bahraingeneral)


    Hello,

    I am facing a fatal error on my WordPress website after activating the “Code Snippets” plugin. The error message displayed is:

    “Fatal error: Cannot redeclare convert_order_item_total_to_bhd()”.

    This error indicates that there is a conflict caused by redeclaring the function convert_order_item_total_to_bhd() within the code added via the “Code Snippets” plugin. As a result, I cannot access the WordPress admin dashboard, and the site is showing as down.

    I need help either disabling the plugin or modifying the code to prevent the function from being declared multiple times.

    Additional Information:

    • Site URL: generalbahrain.com
    • WordPress Version: 6.7.1
    • Plugin causing the issue: Code Snippets (version 3.6.8)
    • PHP Version: 8.1.31

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @bahraingeneral,

    You could try adding the following constant in your wp-config.php file (located at the root directory of your WordPress installation), just before the line that reads /* That's all, stop editing! Happy blogging. */:

    define( 'CODE_SNIPPETS_SAFE_MODE', true );

    See: Help! My site broke! How can I fix it?

    Plugin Author Imants

    (@0aksmith)

    Thank you @yordansoares for your helpful suggestion to enable Safe Mode, this is indeed a great first step when troubleshooting.

    @bahraingeneral, I’d just like to add that if you see errors referencing the snippets-ops.php file, they most often relate to an issue inside one of your activated snippets, such as a duplicate function declaration or a typo.

    Please carefully read the PHP error message; it usually points directly to the problematic code.

    Reviewing and correcting the affected snippet should resolve the issue, and please let us know if you still need help.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.