Title: [Plugin: Allow PHP in Posts and Pages] Plugin Busted
Last modified: August 20, 2016

---

# [Plugin: Allow PHP in Posts and Pages] Plugin Busted

 *  Resolved [Bill Weye](https://wordpress.org/support/users/billhector/)
 * (@billhector)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-allow-php-in-posts-and-pages-plugin-busted/)
 * Your plugin appears to be busted with version 3.4.1 of WP. I’m getting two errors(
   before and after the php code is output (the tag cloud I wanted was output correctly,
   despite the php errors).
 * The errors were:
 * `Parse error: syntax error, unexpected $end in /home/weye5/public_html/wp-content/
   plugins/allow-php-in-posts-and-pages/allowphp.php(110) : eval()'d code on line
   3`
 * and
 * `Parse error: syntax error, unexpected T_ENDIF in /home/weye5/public_html/wp-
   content/plugins/allow-php-in-posts-and-pages/allowphp.php(110) : eval()'d code
   on line 1`
 * [http://wordpress.org/extend/plugins/allow-php-in-posts-and-pages/](http://wordpress.org/extend/plugins/allow-php-in-posts-and-pages/)

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

 *  Plugin Author [hit-reach](https://wordpress.org/support/users/hit-reach/)
 * (@hit-reach)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-allow-php-in-posts-and-pages-plugin-busted/#post-2969189)
 * Hi Bill,
 * It could be the code you are using is not using the correct syntax,
 * The error is in the evaluating of your code which is the most likely possibility,
   are you sure the code is correct? 🙂
 * Thanks!
 *  [jimsander](https://wordpress.org/support/users/jimsander/)
 * (@jimsander)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-allow-php-in-posts-and-pages-plugin-busted/#post-2969245)
 * I am seeing the same since upgrading, but can’t say which upgrade (to wp 3.4.2
   or upgrading the plugin)
 * Code
 *     ```
       [php]
       if ( 1 == 1 ) {
       [/php]
       this is one
   
       [php]
       } else {
       [/php]
   
       this is two
   
       [php]
       }
       [/php]
       ```
   
 * Output
 *     ```
       Parse error: syntax error, unexpected $end in /mnt/target07/350037/589494/www.rapidresultspersonaltraining.net/web/content/wp-content/plugins/allow-php-in-posts-and-pages/allowphp.php(373) : eval()'d code on line 3
   
       this is one
   
       Parse error: syntax error, unexpected '}' in /mnt/target07/350037/589494/www.rapidresultspersonaltraining.net/web/content/wp-content/plugins/allow-php-in-posts-and-pages/allowphp.php(373) : eval()'d code on line 2
       this is two
   
       Parse error: syntax error, unexpected '}' in /mnt/target07/350037/589494/www.rapidresultspersonaltraining.net/web/content/wp-content/plugins/allow-php-in-posts-and-pages/allowphp.php(373) : eval()'d code on line 2
       ```
   
 *  Plugin Author [hit-reach](https://wordpress.org/support/users/hit-reach/)
 * (@hit-reach)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-allow-php-in-posts-and-pages-plugin-busted/#post-2969246)
 * Hi Jimsander,
 * Way to hijack!
 * if you are not using the advanced filter then you cannot break apart your code
   like that as its being evaluated individually, its the equivalent of creating
   a new php file with only the contents:
 *     ```
       <?php
        if ( 1 == 1 ){
       ```
   
 * which would cause an error anyway.
 * Thanks
    Hit Reach
 *  [sazanetti](https://wordpress.org/support/users/sazanetti/)
 * (@sazanetti)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/plugin-allow-php-in-posts-and-pages-plugin-busted/#post-2969256)
 * getting this error message:
 * Parse error: syntax error, unexpected ‘<‘ in /home/content/97/8218197/html/wp-
   content/plugins/allow-php-in-posts-and-pages/allowphp.php(191) : eval()’d code
   on line 1
 * from this `[allowphp function=1]`
 * <?php
    if ( is_user_logged_in() ) { echo ‘Welcome, registered user!’; } else {
   echo ‘Welcome, visitor!’; } ?>
 *  [yosh](https://wordpress.org/support/users/yosh/)
 * (@yosh)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/plugin-allow-php-in-posts-and-pages-plugin-busted/#post-2969257)
 * [@sazanetti](https://wordpress.org/support/users/sazanetti/)
 * all snippets automatically start with <?php
 * Try it with that removed.
 *  [xehyundai3s](https://wordpress.org/support/users/xehyundai3s/)
 * (@xehyundai3s)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/plugin-allow-php-in-posts-and-pages-plugin-busted/#post-2969258)
 * I used this code:
 *     ```
       <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('home_sidebar_products') ) : ?><?php endif; ?>
       ```
   
 * I converted this to [php]code[/php]
 * but it display same error abow. Please help me to fix this?
 *  [AaronRobeson](https://wordpress.org/support/users/aaronrobeson/)
 * (@aaronrobeson)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/plugin-allow-php-in-posts-and-pages-plugin-busted/#post-2969267)
 * Old thread but I figured I’d post my fix in case someone else finds it.
    I was
   getting the: _/wp-content/plugins/allow-php-in-posts-and-pages/allowphp.php(110):
   eval()’d code on line 3_ error with the code:
 *     ```
       [php]
       $result = mysql_query("SELECT Id,Name FROM recipes");
       if (!$result) {
       echo 'Could not run query: ' . mysql_error();
       exit;
       }
       $row = mysql_fetch_row($result);
   
       echo $row[0]; // 42
       echo $row[1]; // the email value
       [/php]
       ```
   
 * I replaced the code with:
 *     ```
       [php]
       echo 'hello world';
       [/php]
       ```
   
 * it echoed properly and when I replaced hello world with the original code it 
   worked.

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

The topic ‘[Plugin: Allow PHP in Posts and Pages] Plugin Busted’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/allow-php-in-posts-and-pages_edefed.
   svg)
 * [Allow PHP in Posts and Pages](https://wordpress.org/plugins/allow-php-in-posts-and-pages/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/allow-php-in-posts-and-pages/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/allow-php-in-posts-and-pages/)
 * [Active Topics](https://wordpress.org/support/plugin/allow-php-in-posts-and-pages/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/allow-php-in-posts-and-pages/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/allow-php-in-posts-and-pages/reviews/)

 * 7 replies
 * 7 participants
 * Last reply from: [AaronRobeson](https://wordpress.org/support/users/aaronrobeson/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/plugin-allow-php-in-posts-and-pages-plugin-busted/#post-2969267)
 * Status: resolved