Support » Plugin: Code Snippets » eval()’d code error

  • Resolved twicealive

    (@twicealive)


    I am getting the following error even when I have no snippet code entered:

    [16-Jan-2019 17:32:29 UTC] PHP Parse error: syntax error, unexpected ‘-‘, expecting ‘(‘ in /home/networkservices/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(356) : eval()’d code on line 5

    I checked the database and the code field is truly empty. I also purged the cache and deployed “define(‘CODE_SNIPPETS_SAFE_MODE’, true);” but I still get this error.

    I am running code snippets v2.13.0 wordpress v5.0.3 server php v5.6
    I want to update to php 7.x, but wordpress won’t load in php7 while code snippets is activated. Instead, I get a white screen that states the above error. (the site does load using php 5.6 and the error is logged in the error file).

    Any ideas?

    Thanks,
    Michael Robinson

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    It definitely looks like you have an active snippet that is causing an error. I would recommend removing all databases tables ending in snippets.

    Are you running a WordPress multisite network, or is this a single site install?

    Thread Starter twicealive

    (@twicealive)

    Thanks Shea

    I found a table in an old site where the plugin was not active; then the error was easy to locate. Since I fixed my code issue, everything is working fine.

    Your plugin evaluates all code snippets whether they are active or not, even if the plugin is not activated for a site, and even if it is disabled via the wp-config file.

    I like it.

    Plugin Author Shea Bunge

    (@bungeshea)

    That’s quite strange to hear. I’m not sure how an inactive plugin could possibly do anything at all, and the plugin checks whether the safe mode constant is set before executing anything.

    This might be a similar problem but I am getting the following:

    CRITICAL syntax error, unexpected ‘:’ in /home/marily91/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(356) : eval()’d code on line 2

    Plugin Author Shea Bunge

    (@bungeshea)

    Hi @andylockhart,

    This error is being caused by the code on line two of one of your snippets. It’s not something I can fix in the plugin; you’ll need to track down the snippet causing the error and fix it.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘eval()’d code error’ is closed to new replies.