You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today I had to change the domain name of a website, resulting in a path change causing an error in the endpoint.
PHP Warning: require(/home/username/domains/domain.old/public_html/wp-content/plugins/koko-analytics/src/collect-functions.php): Failed to open stream: No such file or directory in /home/username/domains/domain.new/public_html/koko-analytics-collect.php on line 14PHP Fatal error: Uncaught Error: Failed opening required '/home/username/domains/domain.old/public_html/wp-content/plugins/koko-analytics/src/collect-functions.php' (include_path='.:/usr/local/php83/lib/php') in /home/username/domains/domain.new/public_html/koko-analytics-collect.php:14
Stack trace:
#0 {main}
thrown in /home/username/domains/domain.new/public_html/koko-analytics-collect.php on line 14
So I went to Koko's settings and found a notification that the endpoint file didn't exist (but it did cause the error?!?) and I tried to create it by clicking the appropriate button. That didn't work. I refreshed the page and tried again and this time it worked.
There was no issue with disk space or permissions. So I hope this issue can be detected and automatically fixed. 😄
The text was updated successfully, but these errors were encountered:
The plugin does a "health check" on the endpoint every hour to prevent exactly this kind of issue from occurring for too long. I am afraid I don't know of a way to fix it right away except for running the health check more often, but open to ideas here...
What happened is:
You changed path, so the "optimized endpoint file" became invalid and started throwing errors.
After a maximum of 1 hour, the plugin did its health check and noticed the optimized endpoint was no longer working. It then proceeded to remove it and reverted to the default endpoint.
I'll think of a way to improve this process or maybe even use relative paths in the optimized endpoint file...
In this case it was still giving errors 8 hours after I changed the domain, so the recreation process didn't work. Only when I tried to recreate it myself if was solved at the second attempt.
There was not much traffic on the website, so could that be an issue in the automated check?
Would it be possible to check if the file exists before requiring it and if it doesn't exist trigger the creation?
This would be something similar to what Wordfence uses in the wordfence-waf.php:
// Before removing this file, please verify the PHP ini setting `auto_prepend_file` does not point to this.
if (file_exists(__DIR__.'/wp-content/plugins/wordfence/waf/bootstrap.php')) {
define("WFWAF_LOG_PATH", __DIR__.'/wp-content/wflogs/');
include_once __DIR__.'/wp-content/plugins/wordfence/waf/bootstrap.php';
}
This also uses relative paths, so a change of domain name or server path would not matter, but I'm not sure if that would work with Koko.
Today I had to change the domain name of a website, resulting in a path change causing an error in the endpoint.
So I went to Koko's settings and found a notification that the endpoint file didn't exist (but it did cause the error?!?) and I tried to create it by clicking the appropriate button. That didn't work. I refreshed the page and tried again and this time it worked.
There was no issue with disk space or permissions. So I hope this issue can be detected and automatically fixed. 😄
The text was updated successfully, but these errors were encountered: