Title: [insert_php] legacy code not working
Last modified: July 22, 2019

---

# [insert_php] legacy code not working

 *  Resolved [debuger25](https://wordpress.org/support/users/debuger25/)
 * (@debuger25)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/insert_php-legacy-code-not-working/)
 * Good Morning,
    After the “php insert” plugin got updated, php code in my webpage
   stopped working(I haven’t changed the code in this page). I have tried turning
   on and off “Support old shortcodes [insert_php]” setting, deactivating and reactivating
   the plugin, uninstalling the plugin in with the Complete Uninstall option turned
   on and reinstalling the plugin. But I still can’t get these legacy php code to
   work.
 * Result when “Support old shortcodes [insert_php]” turned off:
    [http://www.chfoundationlubbock.com/wp-content/uploads/2019/07/OldShortcodeTurnedOff.jpg](http://www.chfoundationlubbock.com/wp-content/uploads/2019/07/OldShortcodeTurnedOff.jpg)
 * Changing setting to ON position:
    [http://www.chfoundationlubbock.com/wp-content/uploads/2019/07/OldShortcodeTurnedOnSettings.jpg](http://www.chfoundationlubbock.com/wp-content/uploads/2019/07/OldShortcodeTurnedOnSettings.jpg)
 * Result when “Support old shortcodes [insert_php]” turned ON:
    [http://www.chfoundationlubbock.com/wp-content/uploads/2019/07/OldShortcodeTurnedOn.jpg](http://www.chfoundationlubbock.com/wp-content/uploads/2019/07/OldShortcodeTurnedOn.jpg)
 * I haven’t modified the php code in my original “contact us” page. Following website
   shows how the webpage used to work:
    [https://web.archive.org/web/20190321074316/http://www.chfoundationlubbock.com/contact/](https://web.archive.org/web/20190321074316/http://www.chfoundationlubbock.com/contact/)
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Finsert_php-legacy-code-not-working%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [Temyk](https://wordpress.org/support/users/webtemyk/)
 * (@webtemyk)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/insert_php-legacy-code-not-working/#post-11757758)
 * Hi,
 * I can see that your code has been executed, but nothing has been displayed. Check
   your code.
 * To make sure everything works, add this code to the post:
    `[insert_php]echo "
   It's work!";[/insert_php]`
 *  Thread Starter [debuger25](https://wordpress.org/support/users/debuger25/)
 * (@debuger25)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/insert_php-legacy-code-not-working/#post-11758516)
 * Hello Temyk. Thank you for the reply. I see that the old [insert_php]..[/insert_php]
   works. I was able to point out that the following php code is what stopped working
   with the updated plugin. This same code used to work fine before the plugin got
   updated (this code is provided by google for ReCaptcha):
 * [insert_php]
    $secret = “XXXXXXXXXXXXXXXXXXXX”; // your secret key $response 
   = null;// empty response $reCaptcha = new ReCaptcha($secret);// check secret 
   key $response = $reCaptcha->verifyResponse($_SERVER[“REMOTE_ADDR”], $_POST[“g-
   recaptcha-response”]); if ($response != null && $response->success) { exit(0);[/
   insert_php]
 * Please let me know if you have any idea about why this peace of php code stopped
   working. It used to work fine before and I haven’t made any changes to it.
 *  [Temyk](https://wordpress.org/support/users/webtemyk/)
 * (@webtemyk)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/insert_php-legacy-code-not-working/#post-11758593)
 * Judging by the blank page, you have PHP errors. You need to include WordPress
   error log.
    In wp-config.php: define( ‘WP_DEBUG’, true ); define( ‘WP_DEBUG_LOG’,
   true ); // /wp-content/debug.log
 * Find the bug yourself or send it to me.
 *  Thread Starter [debuger25](https://wordpress.org/support/users/debuger25/)
 * (@debuger25)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/insert_php-legacy-code-not-working/#post-11758860)
 * Following is the error I get (you can see this by going to: [http://www.chfoundationlubbock.com/contact/](http://www.chfoundationlubbock.com/contact/)
 * Parse error: syntax error, unexpected end of file in /home/chfounda/public_html/
   wp-content/plugins/insert-php/includes/shortcodes/shortcode-insert-php.php(25):
   eval()’d code on line 8
 * I think another issue could be that google recaptcha deprecating code in their
   recaptchalib.php file as well. ReCaptcha has a deprecated constructor
 * Thank you for the help.
 *  [Temyk](https://wordpress.org/support/users/webtemyk/)
 * (@webtemyk)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/insert_php-legacy-code-not-working/#post-11758989)
 * You have deprecated PHP code in the plugin jquery-image-gallery, but it does 
   not affect the work.
 * Your code is missing a closing brace:
    [insert_php] $secret = “XXXXXXXXXXXXXXXXXXXX”;//
   your secret key $response = null;// empty response $reCaptcha = new ReCaptcha(
   $secret);// check secret key $response = $reCaptcha->verifyResponse($_SERVER[“
   REMOTE_ADDR”], $_POST[“g-recaptcha-response”]); if ($response != null && $response-
   >success) { exit(0); } [/insert_php]
    -  This reply was modified 6 years, 8 months ago by [Temyk](https://wordpress.org/support/users/webtemyk/).
    -  This reply was modified 6 years, 8 months ago by [Temyk](https://wordpress.org/support/users/webtemyk/).
 *  Thread Starter [debuger25](https://wordpress.org/support/users/debuger25/)
 * (@debuger25)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/insert_php-legacy-code-not-working/#post-11759146)
 * Hello Temyk, Thank you so much for helping me with this and pointing out my error.
   You are an great assert this company. Have a wonderful day.

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

The topic ‘[insert_php] legacy code not working’ is closed to new replies.

 * ![](https://ps.w.org/insert-php/assets/icon-256x256.gif?rev=3475630)
 * [Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts](https://wordpress.org/plugins/insert-php/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-php/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-php/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-php/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-php/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-php/reviews/)

## Tags

 * [legacy](https://wordpress.org/support/topic-tag/legacy/)

 * 6 replies
 * 2 participants
 * Last reply from: [debuger25](https://wordpress.org/support/users/debuger25/)
 * Last activity: [6 years, 8 months ago](https://wordpress.org/support/topic/insert_php-legacy-code-not-working/#post-11759146)
 * Status: resolved