Title: PHP script gets executed twice in SiteOrigin
Last modified: June 21, 2022

---

# PHP script gets executed twice in SiteOrigin

 *  Resolved [doffine](https://wordpress.org/support/users/doffine/)
 * (@doffine)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/php-script-gets-executed-twice-in-siteorigin/)
 * Hello Woody support team,
 * we just noticed a problem with your plugin used via Shortcode in a widget called“
   SiteOrigin Editor” that is part of [https://wordpress.org/plugins/so-widgets-bundle/](https://wordpress.org/plugins/so-widgets-bundle/)(
   800k installations) and related to [https://wordpress.org/plugins/siteorigin-panels/](https://wordpress.org/plugins/siteorigin-panels/)(
   900k installations).
 * If we put a Woody PHP Snippet shortcode into such a “SiteOrigin Editor” widget,
   then the PHP script gets executed twice. At least this happens if you send some
   data via POST to the WordPress page / script. Then the script gets executed twice
   with the same POST data within some microseconds. Perhaps interesting: We could
   stop this behaviour by putting…
 * `<?php exit(); ?>`
 * …to the end of our PHP script. But then of course the website’s footer didn’t
   get rendered anymore.
 * We solved the problem by not putting your script’s shortcode into a “SiteOrigin
   Editor” widget but into a widget “Individual HTML”. Then all was fine and the
   script is only executed once as it should.
 * We cannot guarantee if there are not more SiteOrigin Widgets having such problems.
   But at least it is the “SiteOrigin Editor” one.
 * For our case we don’t need a solution for this anymore since we solved it by 
   using another widget type. But we thought perhaps you want to look into this.
 * Thanks for your great plugin and work,
    -doffine

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

 *  [Temyk](https://wordpress.org/support/users/webtemyk/)
 * (@webtemyk)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/php-script-gets-executed-twice-in-siteorigin/#post-15763151)
 * Hello.
 * This is not a Woody plugin issue. Woody generates a shortcode and executes the
   code at the place where the shortcode is inserted. Shortcodes are a standard 
   WordPress mechanism. Most likely, the editor widget calls the content twice.
 *  Thread Starter [doffine](https://wordpress.org/support/users/doffine/)
 * (@doffine)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/php-script-gets-executed-twice-in-siteorigin/#post-15765324)
 * Hey,
 * I understand and think you will be right. I’ll mark this as resolved here and
   post in the SiteOrigin support forum.
 * Thanks for your reply,
    -doffine

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

The topic ‘PHP script gets executed twice in SiteOrigin’ is closed to new replies.

 * ![](https://ps.w.org/insert-php/assets/icon-256x256.gif?rev=3523853)
 * [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/)

 * 2 replies
 * 2 participants
 * Last reply from: [doffine](https://wordpress.org/support/users/doffine/)
 * Last activity: [3 years, 11 months ago](https://wordpress.org/support/topic/php-script-gets-executed-twice-in-siteorigin/#post-15765324)
 * Status: resolved