• Hi, when I try to install the plugin, I get a message from WordPress that my site is experiencing a critical error. My error log indicates the following:

    [01-Apr-2020 12:10:10 UTC] PHP Parse error: syntax error, unexpected end of file in /home1/lexataca/public_html/hlm/wp-content/plugins/code-snippets/php/snippet-ops.php(446) : eval()’d code on line 58.

    I am using the GeneratePress theme. I have been able to manually create a custom plugin for my code snippet and it works fine (a custom post type). So, I think the problem must be compatibility between Code Snippets and either my theme or another plugin. The only other plugins I have installed are Relevanssi and a CSV importer. Can you help me troubleshoot this issue? I would like to use Code Snippets because it offers a neat way of organizing snippets, if I can get it to work. Thanks very much. Leslie

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

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

    (@bungeshea)

    Hi Leslie,

    This error message isn’t do to any sort of compatibility problems – instead, it’s coming from one of the snippets you’ve added.

    I can’t tell you exactly which one it is, but the code has 58 lines, so it shouldn’t be too difficult to track down.

    If you’re able to upload the code somewhere (perhaps on https://gist.github.com), I can take a look at it for you and see what the problem might be.

    Thread Starter lmccallum

    (@lmccallum)

    Hi, thanks. I have now removed the only snippet from my site. That snippet successfully created a custom post type before I tried to install Code Snippets. The snippet came from a GenerateWP template. It is publicly available at https://generatewp.com/snippet/GX0O2wz/.

    In addition to deleting the above snippet from my wp files, I have deactivated and deleted the plugin that I created to hold the snippet.

    Yet I still get this message when I try to install Code Snippets:

    An error of type E_PARSE was caused in line 58 of the file /home1/lexataca/public_html/hlm/wp-content/plugins/code-snippets/php/snippet-ops.php(446) : eval()’d code. Error message: syntax error, unexpected end of file.

    Doesn’t the above indicate that the error is on line 58 of your php file snippet-ops.php? For your reference, lines 55-61 of that php code are as follows:

    /* Build a query containing the specified IDs if there are any */
    if ( $ids_count > 1 ) {
    $where = $wpdb->prepare( sprintf(
    ‘ AND id IN (%s)’,
    implode( ‘,’, array_fill( 0, $ids_count, ‘%d’ ) )
    ), $ids );
    }

    Thanks again for your help. As noted above, you can check line 58 of my snippet at the above link. I would be grateful if you would look at it, if you still think the error comes from there, even though it’s been removed from my site and wp files. Best, Leslie

    Plugin Author Shea Bunge

    (@bungeshea)

    Hi Leslie,

    The error message indicates that it comes from the snippet, not from the file. The reference to the file from the plugin only indicates the part of the plugin responsible for executing all the snippets.

    It looks like you have made a mistake when copying the snippet into Code Snippets, possibly leaving off some important characters near the end. I would recommend double checking whether this is the case before anything else.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘error message when trying to install and activate’ is closed to new replies.