Thanks for getting in touch @xtazi3, and for sharing the many troubleshooting steps you already undertook. Given the same occurs, please share the following and we can hopefully determine:
- Does the same occur with any other sites on the same hosting platform? I’m aware you checked for any potential issues with your host, however, there may be something unexpected happening. You can create a new WordPress site from the same hosting platform, basing the site on a subdomain or subdirectory to check from if you wish.
- Does the same occur if you temporarily pause Cloudflare? I ask as from the checks I’ve been performing on your site, it looks like the nameserver points to Cloudflare servers.
- Does the same occur if you attempt Site Kit setup and view the dashboard from this disposable WordPress site? This will help indicate a possible host related issue if all works fine from here, while also ruling out local or browser related issues.
Once we have the above, we can advise on this further. I noticed some additional htaccess rules which we can troubleshoot, or we can perform some additional checks based on the information provided. Thank you.
Thread Starter
xtazi3
(@xtazi3)
Hi James,
Thank you for your detailed response and suggestions. I followed the steps you provided and here are the results:
- Testing on Another Site:
I created a subdirectory on the same hosting platform and installed a fresh WordPress instance. The Site Kit plugin successfully connected without any issues, which indicates that the problem may be specific to the main site configuration.
- Pausing Cloudflare:
I temporarily paused Cloudflare for the main site and attempted to reconnect Site Kit. Unfortunately, the issue persisted, so it seems Cloudflare is not the source of the problem.
- Testing on TasteWP:
I tested Site Kit on a temporary WordPress installation via TasteWP, and the connection worked perfectly. This further suggests that the issue is related to my site-specific configuration.
- htaccess Troubleshooting:
I replaced my .htaccess file with the default WordPress .htaccess rules. While this did not resolve the issue, it helped ensure that custom rules in the .htaccess file are not interfering.
Current Findings:
After further investigation, I found that the issue is tied to the wp-config.php file. When I use a simplified version of the file with minimal configurations, the plugin connects successfully. However, when I revert to the original wp-config.php, the connection fails. This suggests that specific entries or structures in the original file may be causing the issue.
Next Steps:
Could you advise on specific configurations in the wp-config.php file that may interfere with Site Kit? I am particularly curious whether the use of getenv() for keys and salts might cause problems or if any other elements should be adjusted.
Thank you for your continued support and assistance. Let me know if you need any additional details or logs.
@xtazi3 Thanks for sharing all the information you have shared that’s very useful to read. This does indeed sound like an issue with a particular setting in your wp-config file. Could I check in with you to see if you have performed anymore testing around this before looking into this further and suggesting anything that you have already tried in the last few days.
Once you provide an update, I’ll be happy to help you with this further where I can. Let me know if you have any questions in the meantime.
@xtazi3 Your Site Health Info doesn’t state your environment type. If the site environment type is not production then it would lead to an error. You can find out more on this from this previous Github issue.
We also have a filter that can be used to ensure Site Kit does bypass a non-production environment:
googlesitekit_allowed_tag_environment_types
If this is the reason then this would be useful to you. Please share an update once you have reviewed all of the above.
As we didn’t receive a response I’ll mark this as resolved. Feel free to open a new support topic if you continue to encounter issues, or reopen this topic and we’d be happy to assist.