• I’ve been using Code Snippets without a problem to add a particular Google Font to a website. I wanted to add another font so added a second snippet for that font, but when I tried to turn to activate it I gota message saying that my site was experiencing technical difficulties.

    I deleted the Code Snippet plug in folder from wp-contents and the site worked fine (but without the desired fonts). I reinstalled the Code Snippets plug in and as soo as I activated it, before I re-input the Google font add, immediately the site went back to experiencing technical difficulties.

    Restarted the the site in recovery mode and the following message is showing under the Code Snippet Plugin

    An error of type E_COMPILE_ERROR was caused in line 10 of the file /var/www/vhosts/domainname.com/httpdocs/wp-content/plugins/code-snippets/php/snippet-ops.php(361) : eval()’d code. Error message: Cannot redeclare tu_add_google_fonts() (previously declared in /var/www/vhosts/domainname.com/httpdocs/wp-content/plugins/code-snippets/php/snippet-ops.php(361) : eval()’d code:2)

    I don’t know much aboput PHP, but I’m guessing that I shouldn’t have done added each font in separate snippets, but done a combined one.

    How do I clear out the problem and start again?

    I have Code Snippets v2.13.3 and wordpress 5.2.3 running

    Thanks

    • This topic was modified 6 years, 8 months ago by pagallery. Reason: Additional info added
Viewing 1 replies (of 1 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Hi @pagallery,

    The problem here is that if a snippet defines a function as part of it’s code, then you can’t reuse that code verbatim as all functions in PHP must be uniquely named.

    If you are able to find the code you are using to add fonts and share it here, I would be happy to rewrite it for you so that you can safely reuse it without causing an error, or perhaps even combine the two fonts into the same snippet.

Viewing 1 replies (of 1 total)

The topic ‘E_COMPILE_ERROR’ is closed to new replies.