WordPress.org

Ready to get started?Download WordPress

Forums

Widget Logic
[resolved] Error after Widget Logic upgrade (36 posts)

  1. Meginoz
    Member
    Posted 1 year ago #

    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?
    http://wordpress.org/extend/plugins/widget-logic/

  2. philibertperusse
    Member
    Posted 1 year ago #

    I have the exact same issue! Same warning accross the website!

  3. philibertperusse
    Member
    Posted 1 year ago #

    I found the issue, it appears that if your condition logic contains quotes, like:
    is_page('about')

    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.

  4. godoggydaddy
    Member
    Posted 1 year ago #

    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 http://wordpress.org/extend/plugins/widget-logic/developers/. 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.

  5. jrstaatsiii
    Member
    Posted 1 year ago #

    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.

  6. deadhippo
    Member
    Posted 1 year ago #

    Me too.

  7. ElizaTaylor
    Member
    Posted 1 year ago #

    I just upgraded the plugin and I'm getting terrible errors all over my website too :(
    http://www.spacepops.com/

  8. zreNET
    Member
    Posted 1 year ago #

    me too, please fix it

  9. Meginoz
    Member
    Posted 1 year ago #

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

  10. khan.shabnam
    Member
    Posted 1 year ago #

    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');
    
    wp_enqueue_script('jquery.1.7');

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

  11. alanft
    Member
    Plugin Author

    Posted 1 year ago #

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

  12. khan.shabnam
    Member
    Posted 1 year ago #

    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.

  13. alanft
    Member
    Plugin Author

    Posted 1 year ago #

    i am not - visual is nothing to do with me

  14. alanft
    Member
    Plugin Author

    Posted 1 year ago #

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

  15. khan.shabnam
    Member
    Posted 1 year ago #

    This solution is for Widget logic Visual plugin. (http://wordpress.org/extend/plugins/widget-logic-visual/ )

    Widget Logic Visual is better than Widget Logic( http://wordpress.org/extend/plugins/widget-logic/ )

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

  16. Christian Foellmann
    Member
    Posted 1 year ago #

    @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

  17. gabstine
    Member
    Posted 1 year ago #

    Thanks so much philibertperusse, your help came in handy for me after editing the file. Have a great day. Cheers. Merry Xmas & Happy New Year in advance.

  18. Christian Foellmann
    Member
    Posted 1 year ago #

    Another argument for GitHub? ;-)

  19. igorlaszlo
    Member
    Posted 1 year ago #

    @alanft, have the same problem here and yes, it would be kind to fix it as your widget is very useful for me in several web sites... and thanks in advance ! :)

  20. alanft
    Member
    Plugin Author

    Posted 1 year ago #

    My temporary advice is to roll back to 0.52 (which is now the current version) until I can fix this properly - which may be a few hours away

  21. igorlaszlo
    Member
    Posted 1 year ago #

    No worries, i already did like others :)

  22. alanft
    Member
    Plugin Author

    Posted 1 year ago #

    you know what, I'm finding it hard to replicate this problem! I added a is_page with a slug name and it works as normal. :-/

    gonna keep at it…

  23. alanft
    Member
    Plugin Author

    Posted 1 year ago #

    now i have made something odd happen, but it's not what I expected. #runningcommentary

  24. worthdesigning
    Member
    Posted 1 year ago #

    Great plugin alanft ... thanks for making it and for all your efforts to fix latest version. I too have rolled back, so no biggie ;)

  25. ElizaTaylor
    Member
    Posted 1 year ago #

    Ditto, I just deleted the plugin and redownloaded version 0.52 so my website is back to normail again :)

  26. alanft
    Member
    Plugin Author

    Posted 1 year ago #

    OK. If anyone wants to try 0.54 again

    http://downloads.wordpress.org/plugin/widget-logic.0.54.zip

    I added a stripslashes as there's clearly some new cleaning of options via escaping at least quotes.

    (I was confused cos I found that a is_pages('slug-name') code I've relied on forever stopped working properly too.)

    If it clears things up I'll do a .55 with another translation added in

  27. BizWriter
    Member
    Posted 1 year ago #

    Agggghh. To install the replacement plugin, do we delete the broken version and then install this zip? If the plugin is deleted, won't all the widgets disappear too??

  28. worthdesigning
    Member
    Posted 1 year ago #

    @BizWriter - I deleted the plugin then reinstalled - all widgets back to the way they were so no drama

  29. BizWriter
    Member
    Posted 1 year ago #

    Thanks AuntyAstro! Worked fine. Phew!

  30. worthdesigning
    Member
    Posted 1 year ago #

    No worries BizWriter - it's great having these support forums with RSS feeds ;)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic