WP-UserAgent is a simple plugin that allows you to display details about a computer's
operating system or
web browser that your visitors comment from.
It uses the comment->agent property to access the
User-Agent string. Through a series of regular expressions, this plugin is able to detect the operating system and browser which can be integrated in comments or placed in custom places through your template(s).
I’m adding new web browsers and operating systems frequently, as well as updating and optimizing the source code. Your feedback is very important, new features have been added by request, so if there’s something you would like to see in
WP-UserAgent,
leave a comment, and I’ll see what I can do.
WP-UserAgent was written with Geany -
http://www.geany.org/
Images created with The Gimp -
http://www.gimp.org/
- Upload the "wp-useragent" folder to /wp-contents/plugins/
- Login to your WordPress Admin menu, go to Plugins, and activate it.
-
In your WordPress Admin menu, you will find a new menu under Settings called WP-UserAgent. There you can choose the displayed icons size, and select where to display the plugin. There are three options for displaying the plugin:
-
Before the comment text. User's WebBrowser and OS will be displayed before comment text.
- After the comment text.User's WebBrowser and OS will be displayed after comment text.
- Custom (Advanced). You can specify the location using the wpua_custom_output() function inside the comments loop in your template (Generally in comments.php).
Example:
<?php foreach ($comments as $comment) : ?>
<?php comment_author_link() ?> <?php wpua_custom_output(); ?> says:
<?php comment_text() ?>
CAUTION: If you select "Custom" and don't use <?php wpua_custom_output(); ?> in your template, you won't get the information displayed.
Other options include the text to use when displaying the user's web browser and operating system as well as whether or not to show the full User-Agent string.