• Resolved wpgerd

    (@wpgerd)


    After installing the code snippet, I received a fatal error with the following messages:
    Ein Fehler vom Typ E_ERROR wurde in der Zeile 1 der Datei /…../wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()’d code verursacht. Fehlermeldung: Uncaught Error: Undefined constant “‚woocommerce_product_subcategories_args‘” in /…../wp-content/plugins/code-snippets/php/snippet-ops.php(663) : eval()’d code:1
    Stack trace:
    #0 /…../wp-content/plugins/code-snippets/php/snippet-ops.php(663): eval()
    #1 /…../wp-content/plugins/code-snippets/php/evaluation/class-evaluate-functions.php(170): Code_Snippets\execute_snippet(‘add_filter( \xE2\x80\x9A…’, 5)
    #2 /…../wp-content/plugins/code-snippets/php/evaluation/class-evaluate-functions.php(150): Evaluation\Evaluate_Functions->evaluate_db_snippets()
    #3 /…../wp-includes/class-wp-hook.php(341): Evaluation\Evaluate_Functions->evaluate_early(”)
    #4 /…../wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters(NULL, Array)
    #5 /…../wp-includes/plugin.php(522): WP_Hook->do_action(Array)
    #6 /…../wp-settings.php(593): do_action(‘plugins_loaded’)
    #7 /…../wp-config.php(113): require_once(‘/home/httpd/vho…’)
    #8 /…../wp-load.php(50): require_once(‘/home/httpd/vho…’)
    #9 /…../wp-admin/admin.php(35): require_once(‘/home/httpd/vho…’)
    #10 /…../wp-admin/plugins.php(10): require_once(‘/home/httpd/vho…’)
    #11 {main}
    thrown

    This is installed:
    WordPress-Version 6.9.1
    Aktives Theme: Flatsome Child (Version 3.0)
    Aktuelles Plugin: Code Snippets (Version 3.9.5)
    PHP-Version 8.3.21

    What can I do to fix the problem?
    Reinstalling the plugin led to the same result.

    Thanks
    Gerd

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Carolina

    (@carolinaop)

    Hello @wpgerd,

    Thank you for reaching out! I’m sorry you ran into this.

    The issue is most likely caused by smart (curly) quotes in the snippet. When curly quotes like ‘ ’ or “ ” are used instead of standard straight quotes, PHP doesn’t recognize them properly and can interpret the text as an undefined constant — which triggers the error.

    So in order to fix it please update the snippet using only standard straight quotes.

    If your site became inaccessible because of this, you can use Safe Mode (or temporarily deactivate the plugin) to regain access and edit the snippet. If you’re having trouble accessing your snippets, please check this link for help: https://codesnippets.pro/doc/help-my-site-broke-how-can-i-fix-it/

    Once you’re back in, replace any curly quotes with straight ones and save again — that should resolve the issue. 🙂

    Plugin Contributor Carolina

    (@carolinaop)

    Hello @wpgerd

    Since we haven’t received any further feedback, I’ll go ahead and close this ticket for now. Please feel free to reopen it at any time if needed—we’ll be happy to assist 🙂

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

You must be logged in to reply to this topic.