This plugin hasn’t been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Avatar Preview

Description

Shows an avatar preview on the comment form based on the email address entered.

Uses the Javascript MD5 library by Paul Johnston.

Installation

  1. Upload the plugin directory to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Place <div id="avatarPreviewBox"></div> in your comments template where you want the preview to appear. Make sure your email input field has id="email". You may optionally add class="previewsize-64" to change the size of the preview, where 64 is the size in pixels.

FAQ

What do I need to know to style it to match my theme?

The following IDs are used:

  • avatarPreviewImage for the avatar itself
  • avatarPreviewDesc for the description/status (“Enter your email to see an avatar preview.” for example)
  • avatarChangeLink for the link to http://www.gravatar.com/

Example generated HTML:

<div id="avatarPreviewBox">
    <img id="avatarPreviewImage" src="https://secure.gravatar.com/avatar/23463b99b62a72f26ed677cc556c44e8?r=pg&amp;d=identicon&amp;s=32" height="32" width="32" />
    <p id="avatarPreviewDesc">Gravatar for 'example@example.com'</p>
    <p><a id="avatarChangeLink" target="_blank" href="http://www.gravatar.com/">Change at Gravatar.com</a></p>
</div>

Example CSS:

avatarPreviewBox {

padding: 0;
margin: 0;
background: transparent;
}

avatarPreviewBox #avatarPreviewImage {

float: left;
padding-right: 3px;
}

avatarPreviewBox p {

margin: 0;
padding: 0;
}

Contributors & Developers

“Avatar Preview” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.1.3

  • Fix broken check that caused the preview to fail to load.

1.1.2

  • Don’t serve the javascript to logged in users.

1.1.1

  • Fix Javascript errors if the email field or preview box aren’t found.
  • Embed avatarpreview.js in the footer instead of the header.
  • Update compatable version to 2.9.2
  • Document format of generated code better, for easier styling.

1.1

  • Correctly support rating settings other than “g” and default avatars other than “identicon”.
  • Support configuring the size of the preview image via a “previewsize-NUMBER” class.

1.0.1

  • Add additional documentation
  • Update compatable version to 2.9

1.0

  • First public release