Support » Plugin: Insert PHP » Parse Error / Syntax Error

  • I am receiving the following error, with code that I have used on 2 other WordPress sites without issue:

    Parse error: syntax error, unexpected ‘=’, expecting ‘)’ in /home/content/99/10524399/html/tiamo/wordpress/wp-content/plugins/insert-php/insert_php.php(48) : eval()’d code on line 6

    Below is the PHP that I am inserting:

    $path = $_SERVER[‘DOCUMENT_ROOT’];
    $path .= ‘/bazaarvoice/bvseosdk.php’;
    require($path);
    $bv = new BV(array(
    ‘deployment_zone_id’ => ‘Main_Site-en_US’,
    ‘product_id’ => ‘TA-000012’,
    ‘cloud_key’ => ‘xxxxxxxxxx’,
    ‘staging’ => ‘TRUE’,
    ));

    I have pasted this into a ‘text’ field of a Text Block as part of Visual Composer.

    Any idea what the issue could be?

    https://wordpress.org/plugins/insert-php/

Viewing 2 replies - 1 through 2 (of 2 total)
  • In the meantime, I found that I can use the ‘Allow PHP in Posts and Pages’ plugin to do the same thing without any errors.

    I am considering this a temporary solution, since this plugin is no longer maintained—if possible, I would like to get a resolution for this plugin.

    Plugin Author WillBontrager

    (@willbontrager)

    Visual Composer and the Insert PHP plugin don’t work well together. Sometimes, no problem. Other times issues such as you’re experiencing. I’m not certain about this, but Visual Composer may be treating the Insert PHP boundary markers as if they were shortcodes, when they really aren’t.

    It may be that Visual Composer is changing => to =& gt; (no space between “&” and “gt;” – was the only way this interface would let me insert an html entity), which is likely to spawn an error message similar to what you see. Or, it may be code in the bvseosdk.php file.

    Try putting the code into a stand-alone page with <?php and ?> instead of [insert_php] and [/insert_php]. If no errors, then it’s not your code and is likely a Visual Composer/Insert PHP incompatibility.

    Will

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Parse Error / Syntax Error’ is closed to new replies.