• Resolved doffine

    (@doffine)


    Hello SiteOrigin support,

    we just noticed a problem with your widget “SiteOrigin Editor”. If we put a shortcode of the plugin “Woody code snippets – Insert Header Footer Code, AdSense Ads” (https://www.ads-software.com/plugins/insert-php/) into your widget, it gets executed twice.

    Woody allows to execute PHP scripts in the place where its shortcodes get executed. Our PHP script takes POST variables sent to it and performs some database operations with it. We clearly can see that if we send the POST request then the PHP script put via shortcode into your SiteOrigin Editor widget gets executed twice with the same POST variables – with some microseconds in between round 1 and 2.

    If we put the same shortcode into another widget (Individual HTML) then it only gets execute one time as it should.

    We wrote this to the Woody support forum (https://www.ads-software.com/support/topic/php-script-gets-executed-twice-in-siteorigin/) and the Woody support thinks it must be your widget that executes the shortcode twice.

    Perhaps you want to look into this.

    Thank you for your work,
    -doffine

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Andrew Misplon

    (@misplon)

    Hi Doffine

    Thanks for your detailed feedback. Do you have the Classic Editor installed? If so, could you perhaps run a quick test and see what happens if you insert the shortcode into the Visual or Text tabs of a new page?

    Thread Starter doffine

    (@doffine)

    I’m sorry we cannot perform this test, because the solution with another widget (Individual HTML) for the shortcode is already in live mode since we found that as a solution yesterday evening. We simply wanted to let you know about this problem although we have found a workaround for us by using another widget. We use your “Page Builder by SiteOrigin” and we have no extra classic editor plugin installed in the WP.

    Perhaps the following can also be of interest for you:
    – If we put an exit(); at the end of our PHP script, it only gets executed once – but the website’s footer is missing of course.
    – If we don’t put the exit(); at the end, it gets executed twice, but the output it echoes is only shown once in the website. It is the second execution that shows it’s output in the website, not the first round.

    Greetings,
    -doffine

    Plugin Contributor alexgso

    (@alexgso)

    Hi Doffine,

    Thank you for the additional information. I’ve run a few tests and I can’t replicate this issue. Based on the provided information, you’re adding the shortcode using a SiteOrigin Editor widget to your footer widget area and that’s something I’m not able to directly test – I can test a fairly certain footer widget area but it’s unlikely to be exactly the same as the theme you’re using. At this stage, it’s quite possible this issue could be as a result of how the widget area is handled rather than directly an issue with the widget itself.

    If possible, I recommend trying the shortcode using the SiteOrigin Widgets Block, or a different theme (ideally a non-custom theme) footer widget area. I totally get if this isn’t something you would like to do. Unfortunately, for these sorts of issues we need to be able to replicate it to be able to resolve them.

    Kind regards,
    Alex

    Thread Starter doffine

    (@doffine)

    Hello alexgso,

    ah, there is a misunderstanding. The shortcode isn’t put in the footer area.

    The Woody shortcode is put into a normal page using the SiteOrigin page builder. The shortcode is put in a normal page builder line using a “SiteOrigin Editor” widget there.

    The Woody shortcode executes a very simple PHP script that gets POST variables and INSERTs something into the database. This happens twice as long as the shortcode is executed in the SiteOrigin Editor widget.

    WordPress is 5.9.3, PHP is 7.4, theme is Virtue Premium.

    Greetings,
    -doffine

    Plugin Contributor alexgso

    (@alexgso)

    Hi doffine,

    Thank you for clarifying. There are a few situations where the SiteOrigin page Builder layout can be rendered twice and that can result in data being submitted twice. There aren’t any known instances related to any widget directly doing this, but other plugins have ben known to cause this type of issue. For example, the Yoast SEO automatic Open Graph tags used to process the page twice (we accounted for this in an update) and that resulted in this type of issue. I recommend running a plugin conflict test to rule out a third party plugin causing this issue. You can do this by disabling all non-SiteOrigin plugins except for Woody code snippets plugin and seeing if the issue occurs.

    Kind regards,
    Alex

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PHP script gets executed twice in SiteOrigin Editor widget’ is closed to new replies.