- This topic has 15 replies, 3 voices, and was last updated 3 years, 8 months ago by Tom.
August 2, 2017 at 12:29 pm #358721Kirk
Related is a problem with the GP Hooks page. I’m unable to save anything. I get a timeout with this error in the inspector:
XMLHttpRequest cannot load http://www.kirkville.com/wordpress/wp-admin/admin-ajax.php due to access control checks.
I’ve Googled this, and it is apparently not uncommon, and I’ve tried one of the solutions offered – something about a Heartbeat API – but that does nothing. As it stands, I’m unable to use the GP hooks, and the site overall is simply not as fast as it should be.GP Premium 1.3.1August 2, 2017 at 12:47 pm #358736LeoStaffCustomer Support
Sorry about your experience so far. GP should definitely be light and fast.
Can you please disable all non-GP plugins to see if it fixes the problem for the hook?
Let us know. Thanks!August 2, 2017 at 12:54 pm #358742Kirk
No, that doesn’t change anything.
Load the page and check in Safari’s or another web inspector. There are all sorts of spots in the timeline where styles are invalidated and recalculated. What does all that mean?
As for the error coming from the GP Hooks page, that seems to be something to do with too many ajax calls, but I don’t really understand that.August 2, 2017 at 2:17 pm #358776LeoStaffCustomer SupportAugust 2, 2017 at 11:41 pm #358917TomLead DeveloperLead Developer
For overall front-end page speed, it looks like the issue is your hosting: https://tools.pingdom.com/#!/4X3a7/http://www.kirkville.com/
Check out file requests. The big yellow bar is how long it’s taking your server just to connect (“waiting”). The actual receiving of data is super fast.
The next slowest parts are your Amazon ads.
As for GP Hooks – there’s no AJAX required for GP Hooks to work at all. However, many parts of the WP Dashboard rely on AJAX. Again, I’m willing to bet there’s hosting/server issues causing these issues.
Do you have another server to test on?August 3, 2017 at 1:57 am #358978Kirk
No, I don’t have another server. However, I have a staging server on the same host (staging.mcelhearn.com), and the hooks work perfectly there. So it’s not my hosting; nor is it my hosting for the general wait at the beginning of the page load, because on the staging server – without several plugins – it runs very fast.
I just tried again, deactivating all plugins. The Hooks feature works. Then when I activate Jetpack, it fails. So there’s something going on with Jetpack. I would expect that, of all the many plugins, this theme be compatible with Jetpack, because many people use it (notably for VaultPress backups).
Also, everything on the dashboard is very slow with this theme.August 3, 2017 at 10:14 am #359205TomLead DeveloperLead Developer
So when you activate Jetpack on the staging server, do you get the same issues?
I personally use VaultPress here on this site with no issues. Many people use Jetpack with GP with no issues as well – it could very well be a server configuration not playing well with Jetpack on your site.
GP doesn’t add any resources to your dashboard, except in “Appearance > GeneratePress” and “Appearance > GP Hooks”, so those are the only two pages it could actually slow down.August 3, 2017 at 10:22 am #359218Kirk
I just added Jetpack to the staging server. I can’t replicate the exact same setup, since on the production server I have Jetpack Premium, so I set it up with the free version.
The same thing happens; when I add something to Hooks, it times out.
So, how can we debug this? The Hooks feature is very useful to me, to add some code – Google Analytics and Amazon ads – and not have to mess around with the .php files. I’d like to be able to use it. As I mentioned earlier, this is the error I get in Safari’s Web Inspector:
XMLHttpRequest cannot load http://staging.kirkville.com/wp-admin/admin-ajax.php due to access control checks.
I would assume you have an idea what that means; I certainly don’t.August 3, 2017 at 10:23 am #359221Kirk
There’s some stuff here on Stack Exchange, but, again, I don’t quite understand it, and, when there are several solutions offered, I’m not sure which is safest:August 3, 2017 at 10:27 am #359225TomLead DeveloperLead Developer
Try this solution: https://wordpress.stackexchange.com/a/248729/90661
Add it using these instructions: https://docs.generatepress.com/article/adding-php/
These kinds of errors usually happen when the URL you’re visiting (in your browser bar), doesn’t match the URLs you have set in “Settings > General”.
For example, if my URLs in “Settings > General” are:
But the site I’m visiting is:
https://tomusborne.com(with the added s to http)
I can get access controls errors.August 3, 2017 at 10:31 am #359230KirkAugust 3, 2017 at 10:43 am #359241TomLead DeveloperLead Developer
That is likely the problem.
There’s probably workarounds you can add to your .htaccess file, but I would suggest moving your WP installation into the root of your site instead of it being a “wordpress” folder. If you contact your hosting, they might be able to help you make that change.August 3, 2017 at 10:52 am #359249Kirk
I can’t do that. I have a number of sites on the server, and each needs to be in its own folder.
So if the code you suggested above doesn’t work, is there a modification to it that will work?August 3, 2017 at 11:19 am #359268TomLead DeveloperLead Developer
You could try adding this to your .htaccess file:
<IfModule mod_headers.c> Header add Access-Control-Allow-Origin: * </IfModule>
This kind of stuff is pretty advanced though, so you might be better off contacting your hosting support and asking what they think the best method to resolve this would be.August 3, 2017 at 11:23 am #359274Kirk
Nope, that doesn’t work either.
Frankly, I find it a bit odd that you don’t have a solution for this. It’s not like it’s odd for people to have a WordPress blog point to a folder on a domain. I have three clients for whom I write who have blogs at .com/blog/
And I can’t really ask my host how to fix this, because I don’t really understand what “this” is. I don’t understand what the error is and why your theme is causing it.
- You must be logged in to reply to this topic.