• The solution given here doesn’t seem to work anymore. *

    *
    if ($request_uri ~ ‘\?action=koko_analytics’) {
    set $is_trusted 1;
    }

    We tried to change it to
    if ($request_uri ~ ‘\?action=koko_analytics_collect’) {
    set $is_trusted 1;
    }
    but that didn’t work either.

    We have moved the pageviews.php to the root since WP Engine doesn’t support php files in wp-content. So the path to pageviews.php in koko-analytics-collect.php
    was changed to /nas/content/live/[CUSTOMER]/pageviews.php

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Danny van Kooten

    (@dvankooten)

    Hello Johan,

    What happens if you try the following NGINX config:

    
    if ($request_uri ~ "koko_analytics_collect") {
    	set $is_trusted 1;
    }
    

    That should account for both the default /wp-admin/admin-ajax.php and the /koko-analytics-collect.php endpoint.

    Let us know if that does the trick please.

    Thread Starter Johan Jonk Stenstr?m

    (@jonkastonka)

    It worked a little better. The problem now is that I get the 500 error when logged out. When I’m logged in it works just fine.

    Thread Starter Johan Jonk Stenstr?m

    (@jonkastonka)

    PHP Fatal error: require(): Failed opening required ‘/nas/content/live/[CUSTOMER]/wp-content/plugins/koko-analytics/src/functions.php’ (include_path=’.:/usr/share/pear/php:/usr/share/php’) in /nas/content/live/[CUSTOMER]/koko-analytics-collect.php on line 14

    Plugin Author Danny van Kooten

    (@dvankooten)

    Hello Johan,

    That’s weird. Looks like the actual tracking is now firing, but generating an error.

    It looks like the custom tracking endpoint file exists but has a wrong path in it. If you visit the Koko Analytics dashboard page then the plugin should pick up on the error and attempt to remove the endpoint file, but if the website root is not writable (anymore) then it may not succeed in deleting it.

    If you manually delete the file /koko-analytics-collect.php in your website root directory then the error will be gone.

    Thread Starter Johan Jonk Stenstr?m

    (@jonkastonka)

    pageviews.php is in root since WP Engine doesn’t allow for php to run in wp-content.

    /koko-analytics-collect.php is automatically recreated if I delete it.

    Thread Starter Johan Jonk Stenstr?m

    (@jonkastonka)

    Now I was able to delete koko-analytics-collect.php without it reappearing. But still I get that 500 error. https://[DOMAIN]/wp-admin/admin-ajax.php?action=koko_analytics_collect&p=277&nv=0&up=0&r=&rqp=ub2qoh7xt8 500

    Plugin Author Danny van Kooten

    (@dvankooten)

    Hello Johan,

    Is the 500 error for the fatal error you posted earlier? If so, can you please verify whether the wp-content/plugins/koko-analytics/src/functions.php file exists?

    If it doesn’t, your plugin installation is somehow missing crucial files. But if the admin pages of the plugin work just fine, this really shouldn’t be the case.

    The plugin will also respond with a 500 error in case the pageviews.php file is not writable. So I would also check whether that file is writable by the system user that your webserver (usually nginx or Apache) is running as.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Not working on WPEngine’ is closed to new replies.