WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#2599 closed defect (bug) (invalid)

Non-PHP-as-CGI servers never send Trackbacks

Reported by: markjaquith Owned by:
Milestone: Priority: high
Severity: major Version: 2.0.2
Component: Administration Keywords:
Focuses: Cc:

Description (last modified by masquerade)

I am submitting this ticket for "thermoman" in #wordpress because the new forum account he signed up for did now grant him access to Trac. What follows it the report he mailed to me.

Summary

Running PHP not as cgi causes a bug preventing execute-pings.php
ever being called -> No Trackbacks are ever sent to other blogs.

Details

Sending Pings/Trackbacks to other blogs are handled by calling
http://yourdomain.tld/wordpress/wp-admin/execute-pings.php

This URL is to be called on almost every page in the admin section
via the admin-footer.php file:

if ( (substr(php_sapi_name(), 0, 3) == 'cgi') && spawn_pinger() ) {
   echo '<iframe id="pingcheck" src="' . get_settings('siteurl')
       .'/wp-admin/execute-pings.php?time=' . time() . '"
       style="border:none;width:1px;height:1px;"></iframe>';
}

When you're running Apache with mod_php then the above block is never
being executed since the first condition in the if statement will be
false resulting in _not_ considering (and executing) the second
condition (spawn_pinger).

no cgi -> no IFRAME, no spawn_pinger() -> no trackbacks being sent

When fixing this you should also have a look at spawn_pinger() in
wp-includes/functions.php:

spawn_pinger() only returns a value if php is running as cgi.
When apache is running mod_php the function returns no value. This has
to be fixed, too.

Workaround

Comment out the 'if ( ...)' check in execute-pings.php so the iframe
is called on every page in the admin section regardless or apache
running php as cgi or not.

Change History (3)

comment:1 masquerade8 years ago

  • Description modified (diff)
  • Resolution set to invalid
  • Status changed from new to closed

Pinging works fine on non-cgi, the above code is actually a hack to make it work on CGI, on mod_php servers this is unneccessary because it would spawn the pinger twice. See write_post() for when it is originally called.

If you can't actually send trackbacks (which I highly doubt, I'm guessing you looked at the code and jumped to conclusions), feel free to reopen with something more helpful than this.

comment:2 masquerade8 years ago

s/write_post/wp_insert_post/
I was close :D

comment:3 Nazgul7 years ago

  • Milestone 2.1 deleted
Note: See TracTickets for help on using tickets.