Jump to content

PageViewStatistic for ProcessWire


tcnet
 Share

Recommended Posts

7 hours ago, tcnet said:

Anyway, project is on GitHub now. But it's probably the last time. For updates and new features check my blog. Thank you!

Thanks for setting this up! ?

Of course this won't be a problem for everyone, but personally I avoid direct downloads. Here are a few reasons:

  • With direct downloads I can't easily validate the package to make sure it is indeed the original one in case the server has been compromised or something along those lines — which of course is something that shouldn't happen, but in this regard I have more trust in GitHub than individual hosting providers / server maintainers.
  • GitHub (/ Git) allows me to see and track the full change history in case something doesn't work. This way it's easier to track what change caused the problem, why it was made (commit message), and (assuming that the module author is somewhat active on GitHub) file an issue or even submit a fixed version for approval.
  • Finally, I prefer to handle updates via either Git or Composer. It would be too much work to keep track of different blogs for individual modules, let alone download the module package every now and then to see if it has changed . GitHub makes this trivial (periodic git fetch or git pull is quite enough).

No pressure, but big thumbs up from here for always uploading modules to GitHub ??

  • Like 4
Link to comment
Share on other sites

  • 2 months later...

Interesting module. It works in my local environment, but unfortunately online.

Trying to view the statistics I get an unspecific  server error (500), with Tracy debugger I get some details but don't have a clue what's happening. I assume some security setting on the host, but have no idea to find this.

Quote

message protected => "SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server v ... "
string private => ""
code protected => "42000"
file protected => "/var/www/k11065/html/site/modules/ProcessPageViewStat/ProcessPageViewStat.module"
line protected => 772
trace private =>

previous private => null
errorInfo =>

0 => "42000"
1 => 1064
2 => "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''100'' at line  ... "

 

Link to comment
Share on other sites

53 minutes ago, sujag said:

Interesting module. It works in my local environment, but unfortunately online.

Trying to view the statistics I get an unspecific  server error (500), with Tracy debugger I get some details but don't have a clue what's happening. I assume some security setting on the host, but have no idea to find this.

 

It seems to be the row LIMIT. But I cannot be reproduce it. Try to change the row limit in the configuration to another value. Please also search the problem in your PHP/MySQL environment.

Did you uploaded the files with FTP in the right transfer mode?

Link to comment
Share on other sites

Yes it is the row LIMIT but it's indepedent of the value. Changing the value just alters the text of the error message:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''100''

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''25''

But I just notices, that this server still works with PHP5.6 I ask the hoster, if it is possible / planned to upgrade.

 

Link to comment
Share on other sites

17 minutes ago, sujag said:

Yes it is the row LIMIT but it's indepedent of the value. Changing the value just alters the text of the error message:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''100''

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''25''

But I just notices, that this server still works with PHP5.6 I ask the hoster, if it is possible / planned to upgrade.

 

No, this are single quotes: ''
I guess you uploaded the files in the wrong transfer mode. Otherwise, the stored int variables becoming strings. I don't know why. Or it has to do with PDO.

Edited by tcnet
Link to comment
Share on other sites

Another question. Would it be possible to partly anonymize the IP-Adresses?

German (european?) privacy laws prohibit the permanent logging of ip-adresses as private data. A common solution that respects this while still allowing some analysis is to set the last triplet to 0 or xxx before it get's stored.

Link to comment
Share on other sites

Just now, sujag said:

Another question. Would it be possible to partly anonymize the IP-Adresses?

German (european?) privacy laws prohibit the permanent logging of ip-adresses as private data. A common solution that respects this while still allowing some analysis is to set the last triplet to 0 or xxx before it get's stored.

Nobody except you can see the IP's! Where is the problem? If IP's stored with xxx in the database then it's no more possible to count the visitors and this would make the whole module worthless.

Link to comment
Share on other sites

There is no need to xxx the whole IP-address, this would indeed make no sense, only the last three digits are masked.

Google analytics implements this as IP Anonymization (or IP masking) in Analytics to allow compliance to privacy statements and laws.  https://support.google.com/analytics/answer/2763052?hl=en

Link to comment
Share on other sites

16 hours ago, tcnet said:

Nobody except you can see the IP's! Where is the problem?

This by itself is already a problem. Given the gdpr privacy laws it's reasonable to justify why IPs need to be processed for actually handling the http request, but storing it (especially indefinitely) is a completely different ballpark. IPs can be used to identify people and therefore should be treated like that. It's not simple nor accessible to the everyday person, but if you have access to an ISPs records you can trace back an IP at a certain time to a certain household and potentially a single person.

Link to comment
Share on other sites

Hi,

I got this error too.

Quote

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''50'' at line 1

PHP 7.1
MariaDB 10
ProcessWire 3.0.149

Gideon

Link to comment
Share on other sites

15 minutes ago, Gideon So said:

Hi,

I got this error too.

PHP 7.1
MariaDB 10
ProcessWire 3.0.149

Gideon

Sames to be a bug in PDO in some PHP versions.

Please open ProcessPageViewStat.module and change line 771
from: $query->bindValue(':rowlimit', $rowlimit, \PDO::PARAM_INT);
to: $query->bindValue(':rowlimit', (int) $rowlimit, \PDO::PARAM_INT);

Link to comment
Share on other sites

  • 3 months later...
  • 3 weeks later...

I keep getting these errors (just one of them at a time)…

PHP Notice: Undefined offset: 1 in /home/.sites/66/site2760076/web/site/modules/ProcessPageViewStat/func/useragent.php:3310
PHP Notice: Undefined offset: 1 in /home/.sites/66/site2760076/web/site/modules/ProcessPageViewStat/func/useragent.php:1743
PHP Notice: Undefined offset: 3 in /home/.sites/66/site2760076/web/site/modules/ProcessPageViewStat/func/useragent.php:1656
PHP Notice: Undefined offset: 3 in /home/.sites/66/site2760076/web/site/modules/ProcessPageViewStat/func/useragent.php:1619

thoughts?

Link to comment
Share on other sites

2 hours ago, fruid said:

I keep getting these errors (just one of them at a time)…

PHP Notice: Undefined offset: 1 in /home/.sites/66/site2760076/web/site/modules/ProcessPageViewStat/func/useragent.php:3310
PHP Notice: Undefined offset: 1 in /home/.sites/66/site2760076/web/site/modules/ProcessPageViewStat/func/useragent.php:1743
PHP Notice: Undefined offset: 3 in /home/.sites/66/site2760076/web/site/modules/ProcessPageViewStat/func/useragent.php:1656
PHP Notice: Undefined offset: 3 in /home/.sites/66/site2760076/web/site/modules/ProcessPageViewStat/func/useragent.php:1619

thoughts?

As you can see, it's not an "error". It's an "PHP Notice". Why you get this Notice? Now, you didn't give me any info where you have seen this notice so I cannot help you. By the way, useragent.php is not my work. https://www.toms-world.org/blog/parseuseragentstring/

Link to comment
Share on other sites

  • 2 months later...
6 minutes ago, Roych said:

Hello,

I tried to upgrade the module on multiple sites but always get this error on all sites. any ideas how to fix this?

Thank you

R

 

error.png

This happened because you didn't realy upgrade it. You just replaced the files. In this case function ___upgrade($fromVersion, $toVersion) will be never called!

Click on Modules and then on Refresh in the top right corner. This will fire the ___upgrade function.

Link to comment
Share on other sites

38 minutes ago, tcnet said:

This happened because you didn't realy upgrade it. You just replaced the files. In this case function ___upgrade($fromVersion, $toVersion) will be never called!

Click on Modules and then on Refresh in the top right corner. This will fire the ___upgrade function.

I already tried that. I'm using upgrade module. As soon as I click upgrade I get error and can't even access admin area anymore. If there is "ProcessPageViewStat" folder present in modules folder I get this error and nothing works at all. If I remove the module folder it starts working again. I tried with refresh and from upgrade but all the same. Any ideas?

Thank you

R

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...