• Hi,

    I’ve build a Pingback agent for a small custom developed blog engine and it successfully communicates with an installation of WordPress (2.9.2) that’s deployed on the same box (both to receive and send pingbacks). It does not however work with my wordpress.com blog.

    WordPress.com’s pingback server always return Fault 17: ‘The source URL does not contain a link to the target URL, and so cannot be used as a source.’. I’ve traced the HTTP exchange between wordpress and my blog and the returned HTTP body (HTML) includes the link. I’ve also checked the wordpress source and tested the HTML against the xmlrpc/pingback implementation and the HTML matches the regular expressions.

    I’ve also checked my wordpress spam settings but cannot find anything.

    So, I though it might be a timeout, reduced the markup on my blog to just a couple of lines and – it WORKS!. But why? The intercepted HTTP exchange for the original/larger page was also successful (HTTP 200) and the size of my original page was not any greater than that of other wordpress blogs for which pingbacks work (and as I said, the regular expressions match).

    I’m at a loss. Are there perhaps filters or something that reject my pingback request with Fault 17.

    Please help.

    Regards,
    HC

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    WordPress.com blog or a self-hosted www.ads-software.com install?

    If you need help with wordpress.com, you need to go there and post in their forusm. This site is for self-hosted WordPress installs only.

    Thread Starter hcvst

    (@hcvst)

    Hi Ipstenu,

    thanks for your reply. I have the issue with any hosted WordPress installation (wordpress.com, name.com) however not with the one that sits on the same server as my custom blog. If you have a self-hosted install perhaps I could try to ping one of your posts to see whether the same error occurs, please ??

    I was hoping to find a wordpress developer here – sorry if I posed in the wrong place. The file in question is xmlrpc.php and possibly line 3259 ‘$linea = apply_filters(‘pre_remote_source’, $linea, $pagelinkedto);’

    I don’t have another server to test this with but if nothing else helps I’ll get an Amazon instance for a day and deploy WP there and try to debug.

    Best regards,
    HC

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    I have pingbacks turned off on all my stuff, actually.

    I suspect it’s probably just not working on wordpress.com sites (which are different from self-hosted in many levels). You could try posting about it in https://core.trac.www.ads-software.com/ though that’s really not the place for support per sey….

    I would get a second server (or someone who has one) and test against that to see if it works on self-hosteds on other servers.

    I’ve been working on a plugin that works with pingbacks, and you were close, I tested the line you mentioned, but the problem seems to be with the line in class-wp-xmlrpc-server.php which uses strip_tags.

    (line 3422 in WP 3.1):
    $linea = strip_tags( $linea, '<a>' ); // just keep the tag we need

    For some reason this function is not working properly at all on some templates (or that is the way it seems) and instead of returning all the <a> tags is cutting a lot of them out, making it seem to the server like there is no target link in the source URI.

    Unfortunately, even if this were fixed in WordPress in the future, pinging servers with old versions without the fix is still going to give you the same old error. but the good new is..

    I have included a workaround in my new plugin:
    https://www.ads-software.com/extend/plugins/pingchecker/
    Basically it does a regex match for links in your content, then echoes them in a hidden div in the footer, making it much easier for the strip_tags function to actually find them.

    …am off to post this as a bug in the appropriate forum, hopefully then it will be fixed for future versions of WordPress at the source.

    ??

    Thread Starter hcvst

    (@hcvst)

    Thanks majick777. Good timing too, just deployed another blog and started to see Fault 17 again ?? Any idea which anchor tags get picked up and which don’t? Do they need a newline following them for example – or something similar that could be fixed in my blog posts?
    HC

    It’s pretty hard to tell why some are actually getting picked and which ones stripped without testing a particular page. I don’t think newlines are going to help, it’s just going to strip them anyway.. From what I could tell it is influenced by different templates and plugins adding code, the main site I was testing on it seemed to be all the plugins adding javascript code to the header that confused the hell out of strip_tags. You could always run something like this as a test with a php file (run it from anywhere really), but I’d still recommend the plugin just in case…

    <?php $linea = file_get_contents('https://yourblog.com/yourpage/'); $linea = str_replace('<!DOC','<DOC',$linea);$linea = preg_replace('/[\s\r\n\t]+/', ' ', $linea); $linea = preg_replace( "/ <(h1|h2|h3|h4|h5|h6|p|th|td|li|dt|dd|pre|caption|input|textarea|button|body)[^>]*>/","\n\n",$linea); $linea = strip_tags($linea,'<a>'); echo $linea; ?>

    …which basically just replicates the output that the xmlrpc server class checks for valid href tags. if you see valid links outputted, they are the ones that are showing up. in my case, I am getting a whole bunch of chopped up javascript at the top, then my menu links but no post content links, and then with the new plugin the content links show up at the bottom now.

    ?? so I’m happy with that.

    Just another note, it was definitely some code in my header causing the main problems, some javascript and some style code added by some plugins. Moving it to the footer seemed to make a difference to running the above test code. ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Pingback server’ is closed to new replies.