This is one of those stupidly simple plugins that just WORKS exactly as advertised. I see that it has not been updated in 3+ WP releases, and I hope this message will get to the author who will update it. It’s a GREAT PLUGIN and I hope it will keep going.
]]>[29-Jul-2021 08:24:42 UTC] PHP Notice: wp_enqueue_script() was called incorrectly. “wp-editor” script should not be enqueued together with the new widgets editor (wp-edit-widgets or wp-customize-widgets). Please see Debugging in WordPress for more information. (This message was added in version 5.8.0.)
[29-Jul-2021 08:24:20 UTC] PHP Deprecated: block_categories is deprecated since version 5.8.0! Use block_categories_all instead.
]]>Hi.
I have installed the SRS hit counter on my page. Can i edit it so it only counts visitors on the front-page, and not all pages? How can i fix it?
From
Robin
]]>Hi @sandyrig
is the Counter working with the newest WP Version 5.6.1?
]]>When trying to edit (start from a great number) the number of Unique visitors, the result is exatly the DOUBLE number.
This is kind of strange.
I put in 700000 and i get 1400000 and several notices in the debug.log from the plugin while saving the settings.
(WP 5.5 and PHP 7.3.x)
Thanks
]]>Some notices appear:
[03-Dec-2020 03:54:02 UTC] PHP Notice: Trying to get property \’srs_views_count\’ of non-object in /home/wp-content/plugins/srs-simple-hits-counter/SRS_Simple_Hits_Counter.php on line 88
[03-Dec-2020 03:54:02 UTC] PHP Notice: Undefined offset: 0 in /home/wp-content/plugins/srs-simple-hits-counter/SRS_Simple_Hits_Counter.php on line 88
[03-Dec-2020 03:54:02 UTC] PHP Notice: Trying to get property \’srs_visitors_count\’ of non-object in /home/wp-content/plugins/srs-simple-hits-counter/SRS_Simple_Hits_Counter.php on line 87
]]>Hi! Does your plugin have a count import or manual count setting? I have 20k+ hits on my comics in Tapas and I want to be able to define their Tapas hit count in your plugin and then let the hits naturally go up from there. Thanks.
]]>Hi everyone;
I think this is generally a good plugin – but there’s one change I recommend.
Please find here a customised version with my recommended changes:
In the settings page, there’s a link that will set an ‘exclusion’ cookie (‘srs_exclude’). In the example above, this cookie lasts for one year. When the plugin detects this cookie, the unique visitor and views counter won’t be updated by that visitor.
This is intended for admins such as myself, who spend inordinate amounts of time working on their website and find themselves unintentionally inflating their numbers. It’s also completely optional – if you never click the link to set the cookie, you’ll never be excluded.
]]>After experimentation, I found that on ONE of my websites, whenever I use the dashboard to pre-set the page counts, it actually sets the number to exactly 44 times what I type in.
Totally bizarre, I know. If I put “1” in the Visitor/PageView boxes, they show up as “44” when the admin page refreshes after saving, and the shortcode produces that same thing on the display. If I put in “1234” and save, I get “54296”. Each refresh of the displayed page properly increments by 1 pageview.
I have another website where this is NOT the case; consequently, there appears to be some sort of collision with other plugins, but I am using the same theme and many of the same plugins on both sites.
The workaround that I am using is to divide the number I want to set by 44 and use that as the starting point.
]]>My hosting provider (DreamHost) uses Varnish and this plugin is stopping from Varnish caching pages because the plugin is setting PHPSESSID for every page. It looks like it’s because on initialisation it calls session_start() — when I comment out that line PHPSESSID is no longer being set.
Is it possible to make this plugin Varnish friendly? Would that be done by setting it’s own cookie name rather than setting PHPSESSID?
]]>Hi,
The Plugin works perfectly. However It is small issues…here.
My initial page views exceed 9M however when I save It can keep only value less than 8.7M.
it must be the column defined in the table to medium integer.
It can be change to big integer instead for all integer columns.
Thank You, For Kindly update the plugins.
]]>Greetings,
My visits counter is stuck at this number for 2-3 months, even though there is traffic according to google analytics.
]]>Thanks for writing this plugin, I’ve been using it for a while now.
However, look at the following from my log:
[12-Sep-2017 01:57:18 UTC] PHP Notice: Undefined offset: 0 in /home/redacted/www/wp-content/plugins/srs-simple-hits-counter/SRS_Simple_Hits_Counter.php on line 92
[12-Sep-2017 01:57:18 UTC] PHP Notice: Trying to get property of non-object in /home/redacted/www/wp-content/plugins/srs-simple-hits-counter/SRS_Simple_Hits_Counter.php on line 92
[12-Sep-2017 01:57:18 UTC] PHP Notice: Undefined offset: 0 in /home/redacted/www/wp-content/plugins/srs-simple-hits-counter/SRS_Simple_Hits_Counter.php on line 93
[12-Sep-2017 01:57:18 UTC] PHP Notice: Trying to get property of non-object in /home/redacted/www/wp-content/plugins/srs-simple-hits-counter/SRS_Simple_Hits_Counter.php on line 93
I looked at the code and modified it:
function update_views_visitors($post_id, $visitors, $views){
global $wpdb;
$table_name = $wpdb->prefix.'srs_simple_hits_counter';
$date = Date("Y-m-d");
$time = Date("h:i:s");
$post_data = $wpdb->get_results("SELECT * FROM $table_name WHERE (srs_post_id = '". $post_id ."' AND srs_date = '".$date."' )");
if($post_data){
$visitors = $post_data[0]->srs_visitors_count+$visitors;
$views = $post_data[0]->srs_views_count+$views;
$wpdb->update($table_name, array('srs_visitors_count' => $visitors, 'srs_views_count' => $views), array('srs_post_id' => $post_id, 'srs_date' => "$date"));
}else{
$sql = "INSERT INTO $table_name (<code>srs_id</code>, <code>srs_date</code>, <code>srs_time</code>, <code>srs_post_id</code>, <code>srs_visitors_count</code>, <code>srs_views_count</code>) VALUES (NULL, '".$date."', '".$time."', '". $post_id."', '". $visitors."', '". $views."')";
$wpdb->insert(
$table_name,
array(
'srs_id' => NULL,
'srs_date' => $date,
'srs_time' => $time,
'srs_post_id' => $post_id,
'srs_visitors_count' =>$visitors,
'srs_views_count' => $views
)
);
}
}
You should not assume that a variable takes always a value, because when it doesn’t this opens up the possibility for sql injections.
When you have a string that you construct a query with and it has variables, please enclose them in quotes to ensure empty is really empty.
thanks
]]>After last update (1.01) i can see error:
Parse error: syntax error, unexpected ‘[‘ in /home/…/wp-content/plugins/srs-simple-hits-counter/SRS_Simple_Hits_Counter.php on line 135
And i can’t turn on plugin. Isn’t a multisite. What to do?
]]>Hi,
I made an update to latest version (1.0.1) and now my counter reset to 0, and I can’t set it up again.
It’s a multisite.
Hi’
I would like to define if i need to count all visits or non-registrered visits only.
In you function called:
srs_simple_hits_counter
You can do something like:
if (is_single() && is_user_logged_in() ) {
// Do not count!
}else{
$srs_pageViews = intval( get_option('srs_pageViews_count') );
update_option('srs_pageViews_count', $srs_pageViews+1);
}
[Moderator note: code fixed. Please wrap code in the backtick character or use the code button.]
Hope you will implement it, in a update ?? Currently i just hardcoded it in the plugin – but that’s not how i like it ??
Best Regards
]]>Hi, thanks for this nice plugin is there a way to start the counter for example at 1,500? how can i do it? thank you.
]]>Thank you for your widget and time. Is there a way to output the number so that it has commas in it? Example: 1,000 instead of 1000, 1,000,000 instead of 1000000.
Otherwise it does what I want.
Thanks again and take care.
-tony
After adding the widget to my sidebar, there were php warning errors at the top of each page:
“Cannot send session cache limiter – headers already sent”
Had to deactivate
]]>The unique visitors counter acts the same as the page view counter.
It is incremented for each visited page.