So, I’ve had this working for a while, but not a lot of people noticed, so I figured I’d spell it out explicitly.
WordPress.org plugin pages have special magic Google markup. This is what allows many of the Google tricks we do for plugin pages to work. If you’ve ever searched for one of our plugins on Google, you may have noticed that it says it’s “free” as well as showed the rating as stars and such. This is all using Google’s Rich Snippets functionality with markup from the schema.org specifications.
One of the magic tricks we do is to point to your WordPress.org Profiles page as the “author” of the plugin. It’s your plugin, after all, and you deserve the credit. But promoting the authorship is only half the picture, it helps if Google also knows who you are as an author. Then they can do something clever too:

This is a sample entry for one of my plugins from the Rich Snippets Testing tool. The photo and authorship info may not show up on every search result that gets my plugin up on Google’s search results, but it certainly doesn’t hurt. But to get this information to be capable of showing, Google needs to connect your profile and user information on WordPress.org with a profile and user information from Google+. To do this, there’s two steps:
Step 1: Edit your WordPress.org profile to include a link to your Google+ account. You can do this yourself, and you can see how I did it on my Profiles page. I included this link in my “About Me” section: https://plus.google.com/100201852715113506716?rel=author
Note that the ?rel=author bit is important, that’s what tells Google that you are the author here and links your G+ account to this page.
Step 2: Tell Google that you contribute to WordPress.org. To do this, go to your Google+ Profile. In the “Links” section you will find a “Contributor To” area. You need to add two links to this area:
- The first link will be a link to your own profile page, on http://profiles.wordpress.org. This completes the connection and tells Google that you and the profile are the same person. Because your plugin page automatically links to your profile with the author information, making this connection creates an indirect authorship connection to all your plugins.
- The second link you need to make is a link to http://wordpress.org itself. This is because Google wants there to be an explicit connection on the same domain name (not a subdomain), and so this link is required. And hey, you’re contributing to WordPress.org every time you update your plugin or theme, so well done there!
After doing both these steps, you can try your plugin’s URL in the Rich Snippets tool yourself, and voila, you’ll see the magic. Note that you may not see it in the actual Google search results for weeks, and it may never appear. Google shows snippets like these on terms of their own choosing. All you’re doing here is to give them the data that lets their engine do the magic, if it can.
takien 3:24 pm on September 12, 2013 Permalink | Log in to Reply
Thanks for this info bro
Mike Schinkel 4:10 pm on September 12, 2013 Permalink | Log in to Reply
In general @nacin‘s advice that the only thing a plugin should be doing on inclusion is
add_action()andadd_filter()is extremely good advice, but I’m concerned it might be taken too literally.There are other things that can and should be done when loading files and I’d hate for people who review code for best practices for corporations but who are not really experienced with WordPress to add that literally to the list of required best practices without including some caveats.
Here are some caveats I would add to @nacin‘s advice as being okay to do on plugin inclusion:
__FILE__or__DIR__into a static variable of a class for later use.spl_autoload_register().$_SERVER['REQUEST_URI']into static variables of classes.Ipstenu (Mika Epstein) 4:42 pm on September 12, 2013 Permalink | Log in to Reply
Thank you for the clarification and thoughts, Mike!
+1
Andrey "Rarst" Savchenko 6:54 pm on September 12, 2013 Permalink | Log in to Reply
> The error is due to plugins that call wp_get_referer() on init.
You probably meant on load rather than init?
Knut Sparhell 5:05 pm on September 14, 2013 Permalink | Log in to Reply
Maybe more precise: Calling any WordPress functions, except add_action() and add_filter(), on plugin inclusion is a bad idea.
brasofilo 5:08 am on October 17, 2013 Permalink | Log in to Reply
Knut, just to clarify my ignorance, what do you guys refer as “plugin inclusion”? I suppose it’s an activated plugin start up…. Normally, if it’s the case, I call
I also suppose
is_admin()is not a bad idea, is it?