Title: unexpected &#039;;&#039; in widget_logic.php
Last modified: August 24, 2016

---

# unexpected ';' in widget_logic.php

 *  [SRD75](https://wordpress.org/support/users/srd75/)
 * (@srd75)
 * [10 years, 12 months ago](https://wordpress.org/support/topic/unexpected-in-widget_logicphp/)
 * My error log contains the following:
 * PHP Parse error: syntax error, unexpected ‘;’ in /home/…/public_html/wp-content/
   plugins/widget-logic/widget_logic.php(286) : eval()’d code on line 1
 * [https://wordpress.org/plugins/widget-logic/](https://wordpress.org/plugins/widget-logic/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [videomike](https://wordpress.org/support/users/videomike/)
 * (@videomike)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/unexpected-in-widget_logicphp/#post-6136197)
 * What exactly does line 1 look like in widget_logic.php? There should be no eval
   command there, so this could be a sign that your wordpress install has been hacked
   and some files (probably not only in the widget_logic plugin) have been altered
   to contain a eval(somecode) line which executes malicious code…
 *  [George wp-website-mastery](https://wordpress.org/support/users/lernerconsult/)
 * (@lernerconsult)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/unexpected-in-widget_logicphp/#post-6136235)
 * The plugin clearly says it evaluates Your code, the error is on line 1 of what
   SRD75 (or Someone) put it. The error is not line 1 of the plugin, it is triggered
   at line 286 of the plugin.
 * You have to use valid PHP, and it has to return a true/false result; RTFM.
 * If anyone puts HTML in that field, the angle bracket will cause a PHP Fatal Error;
   you may have to remove it in phpMyAdmin == Don’t!
 * The whole field is a security risk, since you can eval() a string that has malicious
   contents…
 *  [alanft](https://wordpress.org/support/users/alanft/)
 * (@alanft)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/unexpected-in-widget_logicphp/#post-6136239)
 * yes, the original poster has invalid PHP in one of their widget logic fields 
   somewhere.
 *  [iltdevunit](https://wordpress.org/support/users/iltdevunit/)
 * (@iltdevunit)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/unexpected-in-widget_logicphp/#post-6136240)
 * This caught me out too. In my case I had this in a widget logic:
 * `is_page(123);`
 * It should be:
 * `is_page(123)`
 * Some validation on the widget logic field would be a nice addition.
 *  [Panthony54](https://wordpress.org/support/users/panthony54/)
 * (@panthony54)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/unexpected-in-widget_logicphp/#post-6136242)
 * How can that be corrected because on my widget.php page I have added a widget
   in an area but have put a wrong code, but in that area the widget is not visible
   anymore hence cannot correct or delete the code.
 *  [George wp-website-mastery](https://wordpress.org/support/users/lernerconsult/)
 * (@lernerconsult)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/unexpected-in-widget_logicphp/#post-6136243)
 * [@panthony54](https://wordpress.org/support/users/panthony54/), If you can’t 
   see the widget configuration, you’ll have to edit the bad code via phpMyAdmin(
   or whatever MySQL editing tool you use).
 * `select * from ``wp_options` where option_name like ‘%widget_logic%’
 * Once you’ve seen the records, you can edit the ones with bad code in them. Warning:
   Errors in editing the MySQL database directly, can cause “big problems”. If you’re
   not knowledgeable about phpMyAdmin, Keep Out; find someone who is.
 * Basically, the Widget Logic plugin has no error checking, no debugging, no way
   of removing bad entries. That whole box where you should put valid PHP allows
   invalid PHP, or HTML, or anything else. Either never use that box, or find another
   plugin.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘unexpected ';' in widget_logic.php’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/widget-logic_c8dde5.svg)
 * [Widget Logic](https://wordpress.org/plugins/widget-logic/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/widget-logic/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/widget-logic/)
 * [Active Topics](https://wordpress.org/support/plugin/widget-logic/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/widget-logic/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/widget-logic/reviews/)

 * 6 replies
 * 6 participants
 * Last reply from: [George wp-website-mastery](https://wordpress.org/support/users/lernerconsult/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/unexpected-in-widget_logicphp/#post-6136243)
 * Status: not resolved