WordPress.org

Ready to get started?Download WordPress

Forums

Shortcode functions called twice on page load? (6 posts)

  1. WandererLLC
    Member
    Posted 2 years ago #

    Hello everyone,

    I've written several plugins and have just noticed that every shortcode function that I've tested is being called twice. At first, I thought this was theme related, but it's not. It's generally not noticeable unless you do things like increment indexes (they'll be incremented twice) or generate forms (submitted twice), etc.

    Can anyone share some wisdom on this? If this should not be happening, then I'll dig more deeply into my code. Just wanted to know if anyone else has seen this and experienced it.

    Thanks!

  2. WandererLLC
    Member
    Posted 2 years ago #

    Update on this. It's only happening when I run locally on my desktop (running LAMP on Ubuntu 10.x).

  3. chrisallenlane
    Member
    Posted 2 years ago #

    @WandererLLC

    I've witnessed this exact behavior twice now on my local development machine. I'm running Ubuntu 11.04 on an Intel Core i5. I can't confirm whether or not this bug occurs on my production server (at this time), because I'm reluctant to deploy the affected code.

    For what it's worth, I'm an "expert" PHP developer, and I don't believe the issue I'm seeing lies within my own code. (I suspect you feel the same way). I've also grepped through my code to confirm that I'm not invoking wp_head() twice or something, which I'm not.

    So, I don't know what is happening or why, but I can confirm that I'm having the same issue.

  4. chrisallenlane
    Member
    Posted 2 years ago #

    @WandererLLC

    So, a bit of lucky Googling just put me on the right track.

    Are you using Simple Facebook Connect on your site? I am, and disabling it solved this problem entirely for me. Presumably, then, this is just some kind of bug within that plugin.

    I'll send the developer a bug report about his otherwise fantastic plugin.

    I hope that's helpful.

  5. WandererLLC
    Member
    Posted 2 years ago #

    Oh, interesting! Thank you for that update. No, I wasn't running that plugin on my local installation, nor on any production server. I just noticed that it went away when I deployed the plugin anywhere remotely. I don't know if it was related to another plugin that I did have installed on my machine, but I'll keep an eye on it (recently upgraded machines and set up my local installation - likely with different plugins. Same OS though. :-)

  6. jonkristian
    Member
    Posted 1 year ago #

    Same issue here, with sfc.

Topic Closed

This topic has been closed to new replies.

About this Topic