Support » Plugin: Widget Logic » Error after Widget Logic upgrade

  • Resolved Meginoz


    I’ve just upgraded the Widget Logic plugin on my local test site, and am seeing this error at the top of each page, and everywhere a widget should be:

    Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING in C:\xampp\htdocs\megansweb2012\wp-content\plugins\widget-logic\widget_logic.php(284) : eval()'d code on line 1

    I’m guessing it’s something to do with the following item in the Change Log, but it’s a bit above my head what this means.

    Added a ‘widget_logic_eval_override’ filter. This allows advanced users to bypass EVAL with a function of their own.

    Any idea what this error means, and how I can fix it?

Viewing 15 replies - 1 through 15 (of 35 total)
  • I have the exact same issue! Same warning accross the website!

    I found the issue, it appears that if your condition logic contains quotes, like:

    then these quotes gets escaped, and then eval tries to eval
    return (is_page(\'about\'))

    I patched it by manually modifying widget_logic.php as follows, starting at line 281:

    if (stristr($wl_value,"return")===false) {
       $wl_value="return (" . $wl_value . ");";
       // Unescape the quotes in $wl_value
       $wl_value=preg_replace("/\\\'/","'", $wl_value);

    Hopefully the author will fix it and I will just have to overwrite my change.

    Happened to me as well. For a temp fix I deactivated the plugin, downloaded the previous version, 0.52, from the developers page of the plugin at I then overwrote the new plugin which is located in the wp-content/plugins/widget-logic/ directory with the previous plugin and then activated the plugin again. That fixes the immediate problem and I will wait until wiser heads than mine figure out the fix. Hope this helps.

    This happened to us as well. glad to see it is a common error and not something we did internally. Widget Logic has had great support in the past, and I’m sure we’ll get a patch out ASAP.

    Me too.

    I just upgraded the plugin and I’m getting terrible errors all over my website too 🙁

    me too, please fix it

    Thanks phil, I guess I’ll just roll back to the old version and wait for the fix.

    FIX for wordpress 3.5 version

    Add following code on line number 58 (in widget_logic_visual_admin_enqueue_script() function) in plugins/widget-logic-visual/widget_logic.php

    wp_register_script('jquery.1.7' ,plugin_dir_url(__FILE__).'js/jquery-1.7.1.min.js');

    and upload jquery1.7.1.min.js in plugin js folder
    And it works fine for.

    Plugin Contributor alanft


    🙁 I will patch ASAP. Thanks all and apologies. My own site WL doesn’t have any strings in it so didn’t catch that

    hi alanft

    Are you using Widget logic Visual plugin?

    If yes, then open plugins/widget-logic-visual/widget_logic.php and you will find widget_logic_visual_admin_enqueue_script() on line number 58.

    Plugin Contributor alanft


    i am not – visual is nothing to do with me

    Plugin Contributor alanft


    I have tried to roll back the ‘stable tag’ to 0.52, and will have a proper fix this evening (GMT)

    This solution is for Widget logic Visual plugin. ( )

    Widget Logic Visual is better than Widget Logic( )

    Let me know, when your issues will fix and how.

    @khan.shabnam I did not understand your last post.

    What is better? Widget Logic OR Widget Logic Visual?
    Alanft is the maintainer of Widget Logic

Viewing 15 replies - 1 through 15 (of 35 total)
  • The topic ‘Error after Widget Logic upgrade’ is closed to new replies.