Wordpress OpenId plugin fix

In case you have problems with using your own url as openid server with wordpress OpenId plugin, the reason may be that server actually works but does not declare itself - so no openid system can recognize it.

If you can login to your blog as http://myblog.com/author/myname/ but can’t use just http://myblog.com/ then it’s possibly the case.

You can fix it for now with a little plugin which adds this declaration.

Plugin code (copy-paste it to your wp-content\plugins directory, change “https://jehy.ru/articles/“ to your main blog directory, “jehy” to your login and activate plugin)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?
/*
Plugin Name: openid-rel
Plugin URI: https://jehy.ru/articles/2008/12/14/wordpress-openid-plugin-fix
Description: Mini plugin for displaying of fucken openid rel link
Version: 0.01
Author: Jehy
Author URI: https://jehy.ru*/

function add_openid_rel()
{?>

<link rel="openid2.provider" href="https://jehy.ru/articles/?openid_server=1" />
<link rel="openid2.local_id" href="https://jehy.ru/articles/author/jehy/" />
<link rel="openid.server" href="https://jehy.ru/articles/?openid_server=1" />
<link rel="openid.delegate" href="https://jehy.ru/articles/author/jehy/" />
<?
}
add_action('wp_head', 'add_openid_rel');
?>

I really hope that strange bug will be fixed soon so I don’t want to write a complete plugin with interface. Use that fix for now.


By the way, if you don't have wordpress openid plugin, but want to use external openid provider, you can use the following code (the example is for myopenid.com, but I am sure that you will get the idea):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?
/*
Plugin Name: openid-rel
Plugin URI: https://jehy.ru/articles/2008/12/14/wordpress-openid-plugin-fix
Description: Mini plugin for displaying of fucken openid rel link
Version: 0.01
Author: Jehy
Author URI: https://jehy.ru*/

function add_openid_rel()
{?>
<link rel="openid.server"
href="http://www.myopenid.com/server" />
<link rel="openid.delegate"
href="http://youraccount.myopenid.com/" />
<link rel="openid2.local_id"
href="http://youraccount.myopenid.com" />
<link rel="openid2.provider"
href="http://www.myopenid.com/server" />
<meta http-equiv="X-XRDS-Location"
content="http://www.myopenid.com/xrds?username=youraccount.myopenid.com" />
<?
}
add_action('wp_head', 'add_openid_rel');
?>