Support » Plugin: SRS Simple Hits Counter » 1.01 Update
1.01 Update
-
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?
-
What is your PHP and WordPress version
Please replace the function on line 131 with this and let me know if it solves the issue for you.
function count_total_visitors_views($return){ global $wpdb; $table_name = $wpdb->prefix . 'srs_simple_hits_counter'; if ($return == 'views') { $srs_views = $wpdb->get_results("SELECT SUM(srs_views_count) as total FROM $table_name "); return $srs_views[0]; } else { $srs_visitors = $wpdb->get_results("SELECT SUM(srs_visitors_count) as total FROM $table_name "); return $srs_visitors[0]; } }
PHP 5.2.17 and WP 4.8.1
After replacing i can see:
Parse error: syntax error, unexpected ‘&’ in /home/…/wp-content/plugins/srs-simple-hits-counter/SRS_Simple_Hits_Counter.php on line 134
And there is not table “wp_srs_simple_hits_counter” in my wpdb.
That’s the issue, please deactivate and then re activate the plugin. It’s supposed to create the table on activation.
Somenthing is wrong with instalation. I downloaded plugin again, there is error in line 135 (when im trying to turn it on) and i cant find table in db.
-
This reply was modified 5 years, 10 months ago by
poch78.
Please run this in your database and let me know the result.
SELECT * FROM wp_options WHERE option_name LIKE 'migrated_to_version'
-
This reply was modified 5 years, 10 months ago by
SandyRig.
Empty result:)
Just want to confirm that manually reactivating the plugin is not helping.
-
This reply was modified 5 years, 10 months ago by
SandyRig.
Unfortunately not, i tried several times to uninstall and download it again.
We are aware of an issue with upgrades but that generally fixes it self if the plugin is reactivated because our data migration function is hooked to register activation hook that no longer works for upgrades. It doesn’t break the site, only the plugin stops counting.
But in your case even reactivating the plugin is not working.
I’ll investigate and update over the weekend.
-
This reply was modified 5 years, 10 months ago by
SandyRig.
Ok, no problem, thank You for your attention and help. I’ll be waiting for be waiting for an update:)
I have released an update please install that and let me know how it goes.
Hello,
Now i can see critical error in line 149
Parse error: syntax error, unexpected ‘[‘ in /home/…/wp-content/plugins/srs-simple-hits-counter/SRS_Simple_Hits_Counter.php on line 149
Ok, try replacing this function ‘count_total_visitors_views’ near that line with the below code.
function count_total_visitors_views($return){ global $wpdb; $table_name = $wpdb->prefix . 'srs_simple_hits_counter'; if ($return == 'views') { $srs_views = $wpdb->get_results("SELECT SUM(srs_views_count) as total FROM $table_name "); return $srs_views[0]; } else { $srs_visitors = $wpdb->get_results("SELECT SUM(srs_visitors_count) as total FROM $table_name "); return $srs_visitors[0]; } }
-
This reply was modified 5 years, 9 months ago by
SandyRig.
-
This reply was modified 5 years, 10 months ago by
- The topic ‘1.01 Update’ is closed to new replies.