Patch for WordPress 2.0 trackback issue

After upgrading to wordpress 2.0, I found the WP2.0 is failed to send trackback.

This issue is also confirmed by ijliao, priv, and Ah Knight’s Blog.

There has been a workaround in Ah Knight’s Blog for this issue.But even you clean up the “to_ping” field, you may encounter this issue again later. Instead of clean up the “to_ping” field times by times, I try to dig the bug out from the source.

The bug is intrduced by an infinite-loop condition located in wp-admin/execute-pings.php, which is implemented for “ping deley removed” feature in WordPress 2.0. If you have any un-sent and failed-to-sent trackbacks, this bug will cause the script continuously trying to send the first trackback in the “to_ping” field, and failed to process the other to_pings.

Which conditions will cause “to_ping” fail to be sent?

First, it occurs when the trackback url can’t be reached. Maybe the site has been closed, maybe he refuses receiving trackbacks. The url will remain in the “to_ping” field and make the infinite-loop triggered.

Second, there is another bug existed in wp-includes/function-post.php. When the content in “to_ping” field is nothing but some character like “\n”, the get_to_ping() function will return an empty array, then do_trackback() will just return nothing, let the “to_ping” field untouched. It will also cause the infinite-loop triggered.

I’ve make a patch for fixing these two bugs.you can download them here(Or try the ZIP version). Make sure that you’ve put them into the correct dirs(wp-admin for execute-pings.php.diff and wp-includes for functions-post.php.diff) and applied the patch by executing following command:


patch functions-post.php functions-post.php.diff
patch execute-pings.php execute-pings.php.diff

Please don’t just rename the .php.diff to .php then upload them.

****IMPORTMENT****
For those don’t know what the patch is, or don’t know how to use patch, please read the following:

I’ve made the patched file for your convenience. Now you can download the patched source in tgz format or ZIP format. All you need to do is just uploading and putting them into the correct dirs.
Hope the WordPress dev team fix the bugs(including pingback issue) in the next release/patch :) AFAIK, this patch has been put into the codebase of WordPress.

PS. A chinese version for this post can be found here.

Update:
The Patch has been merged into dev’s codebase since WP 2.0.1. Recommend to upgrade your WP to 2.0.2 if you are still using 2.0.
If you already use 2.0.1/2.0.2 please do not try to apply this patch.

 

延伸閱讀

文章資訊

 

目前有 64 個迴響

  1. Jim says:

    Is this fixed in wordpress 2.02 already?

    I think I still have the same problem even with the patch. I’ll just wait for the official fix.

  2. PipperL says:

    Jim:
    Yes. The issue fixed since 2.0.1

  3. [...] As some may have noticed, i tested a little bit the last days. Trackbacks didn’t work on this blog and i didn’t know why. After reading a lot in the Wordpresse-Forum and trying several things out, i finally found the problem and solved it – sort of. [...]

  4. [...] Stundenlang gesucht, im Wordpress Forum gefragt, zig Blogs mit der Problematik angesteuert und Tips umgesetzt, aber nichts hat geholfen. Dann noch das Patch ausprobiert, welches ebenfalls nicht geholfen hat und dann nach und nach Plugins ausgeschaltet und immer wieder trackback zu svoogle.org gesendet, bis es dann endlich geklappt hat. der “Übeltäter” war [...]

  5. [...] Stundenlang gesucht, im Wordpress Forum gefragt, zig Blogs mit der Problematik angesteuert und Tips umgesetzt, aber nichts hat geholfen. Dann noch das Patch ausprobiert, welches ebenfalls nicht geholfen hat und dann nach und nach Plugins ausgeschaltet und immer wieder trackback zu svoogle.org gesendet, bis es dann endlich geklappt hat. der “Übeltäter” war das Wordpress Plugin Anti Spam Image 0.4 (nicht verlinkt, da die Seite offensichtlich nicht mehr existiert). Auf jedenfall musste man durch dieses Plugin vor dem Submit eines Kommentars einen Sicherheitscode eintippen und dieser hat wohl Trackbacks und Pingbacks geschluckt…jetzt scheint es jedenfalls wieder 100% zu funktionieren. [...]

  6. sohbet says:

    Yes. The issue fixed since 2.0.1

  7. chat says:

    I just installed the patch that should fix the Wordpress 2.0 Trackback Bug.

  8. [...] [WordPress] トラックバックがとばない現象で 2006年 11月 17日 金曜日 よく WordPress を使用していてトラックバックが飛ばない、という現象をフォーラムやブログ記事のエントリーで目にします。phpに割り当てるメモリが足りないとか、functions-post.php, execute-pings.php が何も入力されていない場合に無限ループになるとかで、パッチをあてられたものが配布されていたりします。まだ原因が解明できていないケースが多いようなのですが、もしかすると案外原因はシンプルな可能性があります。 [...]

  9. Sohbet says:

    Then I thought, how dumb of me, I should take the .diff off at the end and replace file

  10. Sohbet says:

    just installed the patch that should fix the Wordpress 2.0 Trackback Bug

  11. [...] a few issues with the pingback/trackback features, the read up and a third party patch can be found here. I’m guessing this has already been submitted as a bug, but I have not checked as of [...]