WordPress.org

Ready to get started?Download WordPress

Forums

Insert PHP
[resolved] Code executed twice (3 posts)

  1. dskowronski
    Member
    Posted 4 months ago #

    Hello,

    I am using php_insert for long time but recently (probably after update to 3.8.2 but there is no way I can check it) my code started to be executed twice.

    Normally I use require_once for external script - and it works. But now script does not produce output - even file with echo "OK";
    When I changed require_once into require PHP complained about redeclaration of function. Quick way around is using if (!function_exist('foo')){ function foo(){ ... } }

    My script downloads content from other website it's quite slow and executing it twice is really bad.

    I beleive that there is something in wordpress core that checks content of article with executing [php_insert].
    I know PHP well but I do not have idea how to debug which function is guilty except reading source code of everything in /wp-include

    Is there anything I can do not to execute code twice by modyfying only plugin?

    https://wordpress.org/plugins/insert-php/

  2. WillBontrager
    Member
    Plugin Author

    Posted 4 months ago #

    dskowronski, there may be another plugin that scans the post. A social media plugin, perhaps, or an SEO one. According to what you've told me, I'm thinking something is making the page load twice.

    The procedure described at this support cycle
    http://www.willmaster.com/support/forum/viewtopic.php?t=534
    revealed that a Facebook plugin or extension was the culprit.

    Let me know what you find out.

    Will

  3. WillBontrager
    Member
    Plugin Author

    Posted 3 weeks ago #

    Because there has been no response, I'm assuming the original poster resolved the issue.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.