- This topic has 6 replies, 2 voices, and was last updated 5 years ago by
David.
-
AuthorPosts
-
March 8, 2021 at 8:58 pm #1687510
Stew
Using SpinupWP as my host, trying to import content for templates in the Site Library results in a 400 error, however the linked docs don’t really help me other than to suggest it could be my hosting setup https://docs.generatepress.com/article/error-codes-importing/#400-error
This is a fresh WP installation, only things installed are GeneratePress and the Premium plugin.
The debug log says:
[09-Mar-2021 04:40:02 UTC] PHP Notice: Trying to access array offset on value of type bool in /sites/*/files/wp-content/plugins/gp-premium/sites/classes/class-site.php on line 797 [09-Mar-2021 04:40:02 UTC] PHP Notice: Trying to access array offset on value of type bool in /sites/*/files/wp-content/plugins/gp-premium/sites/classes/class-site.php on line 798 [09-Mar-2021 04:40:02 UTC] PHP Notice: Trying to access array offset on value of type bool in /sites/*/files/wp-content/plugins/gp-premium/sites/classes/class-site.php on line 799(I’ve replaced the site name with a * in the paths above)
Lines 796-799 of that class-site.php read:
$existing_settings = get_option( 'generate_settings', array() ); $existing_settings['hide_title'] = $backup_data['theme_options']['options']['generate_settings']['hide_title']; $existing_settings['hide_tagline'] = $backup_data['theme_options']['options']['generate_settings']['hide_tagline']; $existing_settings['logo_width'] = $backup_data['theme_options']['options']['generate_settings']['logo_width'];So it looks like it’s trying to access options that haven’t been set. Not sure whether this is related to the 404 issue though as that’s supposed to be about permissions.
March 8, 2021 at 9:28 pm #1687526Stew
I’m thinking that the problem with the import is because the host is using Nginx and there might be some security constraints around admin-ajax.php calls.
March 8, 2021 at 10:19 pm #1687549Stew
Can confirm the Site Library import process worked fine on localhost so it must be the server setup. If anyone else uses SpinupWP and knows what the workaround is that would be great. I think one way could just be to build the site locally then migrate to SpinupWP later (using Migrate DB Pro or similar).
March 9, 2021 at 3:48 am #1687836David
StaffCustomer SupportHi there,
don’t have any experience with SpinupWP – might be worth asking in our FB group – high chance there is someone using that service and have some insight.
March 13, 2021 at 8:53 am #1693822Stew
I’ve done some more troubleshooting and it looks like the POST to admin-ajax.php (with action=generate_import_site_options_<template-name-here>) always returns 0 on this host. Works fine on local as mentioned.
Read some forum/stack answers that might suggest it returns 0 when the action can’t be found, but it’s obviously being registered for it to work on localhost — so maybe it’s the caching that’s messing with the nonce that gets sent, or the action isn’t being registered properly due to caching or some other host-specific reason.
Anyway, that’s where I’m up to so far but I’m sure there’s an explanation lurking out there somewhere.
March 13, 2021 at 9:17 am #1693853Stew
Of course I find the solution minutes after my previous post!
Turns out it _was_ to do with caching as suspected. You can disable the Page Cache using SpinupWP’s dashboard, but the problem is caused by the Object Cache, which you can only disable by adding the following line to wp-config.php:
define( 'WP_REDIS_DISABLED', true );See https://spinupwp.com/doc/caching-in-spinupwp/#object-caching
After adding the above line and doing a hard refresh I was able to successfully install templates from the Site Library! Hope this helps anyone else using SpinupWP to manage the hosting for a GeneratePress site.
March 13, 2021 at 9:34 am #1693882David
StaffCustomer SupportGlad to hear that – and thanks for sharing the solution!
-
AuthorPosts
- You must be logged in to reply to this topic.