Visitor Counter Plugin – Track Unique Visitors by IP Address

By WP Scriptly

9m & 19d ago

Aug 2024

🕑 2 min read

👁 Views: 300

(1) Leave a Comment

Plugin - WpScriptly

The Visitor Counter Plugin for WordPress allows you to track unique visitors based on their IP addresses, providing more accurate visitor counts for your posts and pages. It features a shortcode that displays the visitor count with customizable inline styles for both the “Views:” label and the number itself. The plugin includes an admin panel where you can configure settings such as excluding admin visits from being counted. It’s ideal for anyone looking to monitor real visitor engagement while maintaining control over styling and functionality.

Admin panel View:

Post view count:

Download:

Version: 1.7 final release

Explanation of the Changes

  1. Inline Styles for “Views:” and Count:
    • The vc_display_view_count() function now includes two inline style variables: $label_style and $count_style.
    • These styles are applied to the “Views:” label and the count number respectively, using inline styles directly within the HTML output.
    Example styles:
    • "Views:" has blue text (#0000FF) and normal font weight.
    • The count number has orange text (#FF4500), bold font weight, and an 18px font size.
  2. Example Output: When you use the shortcode, the HTML will look like this: Views: 120
html code:
Views:
15

This allows you to customize the appearance of both elements independently via inline styles.

Usage

  • Add the shortcode:
  • The inline styles will automatically apply to the “Views:” label and the visitor count.
The shortcode:
[visitor_count]

If you need to customize the CSS you can ether edit the plugin files or use this to over write the CSS. Save this to your style.css

.vc-view-label {
    color: #0000FF; /* Blue text for "Views:" */
    font-weight: normal;
}

.vc-view-count {
    color: #FF4500; /* Orange text for the count */
    font-weight: bold;
}
Author: WP Scriptly, Admin at WpScriptly

Hey, I’m Scot, the guy behind WpScriptly. I create simple, no-fluff WordPress plugins and tools to make your site easier to manage and more powerful. Everything I build is tested on my own projects first — if it’s here, it’s because it works. Thanks for checking out the site. Hope you find something useful at Wp Scriptly.

*These scripts and plugins are provided as is with no guarantees or warranties. If you need assistance or run into issues, feel free to reach out via the contact page.

One Comment

Master Coder

I’m in the process of replacing wp-postview plugin since it has not been updated in over a year with my own plugin. I really plan to do alot of plugins that I have used before. To replace them all for my own. Since I know they are generally compliant with the any version of WordPress for a very long time.