Caching blocking the import of GeneratePress site library settings and content.

Hello! I’m a GeneratePress user and I’m attempting to import a site using the GeneratePress site library.

When importing the content, I receive a 400 error.

GeneratePress has stated that they see this problem with servers using EasyEngine. Does WPMU DEV hosting using EasyEngine? I don’t even know that that is to be honest.

In other searching for a resolution, I discovered information stating it could relate to caching hence I attempted to deactivate Hummingbird to troubleshoot but I can’t. Are we unable to deactivate or remove Hummingbird from WPMU DEV hosted websites?

I should say I’ve got this site set up with multisite.

As per the GeneratePress documentation, I created a debug file and got the following:

[31-May-2020 18:46:10 UTC] PHP Notice:  Only variables should be passed by reference in /var/web/site/public_html/wp-content/object-cache.php on line 317
[31-May-2020 18:46:10 UTC] PHP Notice:  wp_cache_flush() used, this is broadly not recommended. Called in /var/web/site/public_html/wp-content/plugins/gp-premium/sites/libs/wxr-importer/WXRImporter.php line 541 in /var/web/site/public_html/wp-content/object-cache.php on line 322
[31-May-2020 18:50:42 UTC] PHP Notice:  Only variables should be passed by reference in /var/web/site/public_html/wp-content/object-cache.php on line 317
[31-May-2020 18:50:42 UTC] PHP Notice:  wp_cache_flush() used, this is broadly not recommended. Called in /var/web/site/public_html/wp-content/plugins/gp-premium/sites/libs/wxr-importer/WXRImporter.php line 541 in /var/web/site/public_html/wp-content/object-cache.php on line 322

So it does have to do with the Hummingbird. Or at least that’s what I get from the log.

I attempted to disable Hummingbird by renaming it’s folder in the plugins directory but still got the error.

I attempted to disable the object-cache.php file but reaming it but I was not able to do that.

Any ideas how I can shut down Hummingbird completely to attempted to import a site?

Thanks in advance,

Lawrence

  • Pawel Pela
    • Ex Staff

    Hello Lawrence !

    This is an odd issue in fact! Let’s tackle this one by one.

    EasyEngine – we’re not using it, that’s for sure. Actually, I just learned that it exists as well.

    If disabling Hummingbird by renaming the folder didn’t help in this case, then Hummingbird isn’t part of the issue here. I’d say that it shouldn’t have any influence here as it does page caching and that shouldn’t affect the import process in any way.

    The notices in debug.log actually mention something completely different. wp_cache_flush is a function from WordPress core that handles internal WP caching. You can find out more about it here: https://developer.wordpress.org/reference/functions/wp_cache_flush/

    We do have another cache on our host however, Object Cache. It’s server side and you can clear it from the Tools tab on your hosting admin page (Tools >> Object Cache >> Flush).

    Clearing Object Cache may be needed especially in cases when the database was changed without using standard WordPress functions.

    I think this is the case with the importer here, if it’s using a custom method to insert data into the database (that’s the most probable cause of the issue here). It’s generally highly discouraged to make edits to the database skipping the functionalities provided by WordPress, because oftentimes it causes issues like this one. The functions provided by WordPress for changing the contents of the database take server-side caches into account and thus won’t cause that kind of issue.

    By the way, the object-cache.php file can’t be renamed or deleted on our hosting as it’s an important system file that’s required for the site to work.

    That said, I’d talk with GeneratePress support about possible issues with Object Caching and request them to check that route further.

    Hope this helps!

    Kind regards,
    Pawel

  • Lawrence
    • The Incredible Code Injector

    I appologize… I jumped the gun. Disabling the sheild worked well on my other hosting account but I’m still getting errors here on WPMU DEV hosting. Here is what the developer of GeneratePress said in response to the Pawel’s comments above:

    The importer uses 100% core WordPress functions to process the import. We don’t use a single out-of-core function. Even the content importer is a fork of the core WordPress importer.

    I believe the 400 error is a security error. We have various security checks in place throughout the importer to make sure no unauthorized users can make changes to your website.

    When using a caching plugin (or something like object cache), these security checks don’t validate, as the request is cached.

    I could look into forcing the cache not to take effect during import, which might be a possibility.

    For now, the best thing to do is completely disable any caching plugins or server caching just while you do the import. Once the import is done, you can re-enable any caching without issue.

    So far, the 400 error seems to be 100% related to caching plugins/server caching. If caching is present, the security checks simply don’t check out, and the importer won’t work (for good reason).

  • Dimitris Kalliris
    • Support Team Lead

    Hey there Lawrence

    Could you please edit the wp-config.php file and insert the following line just above the /* That’s all, stop editing! Happy blogging. */ comment:
    define( 'WPMUDEV_HOSTING_OBJECT_CACHE_ENABLED', false );

    Then try to re-run the importer and let us know about your results. I’d strongly recommend removing that line after import though, as it will heavily affect the performance of your server.

    Warm regards,
    Dimitris