Skip to content

Better error handling of wp_filesystem issue #19

Description

@j-falk

We had an issue with importing settings not working on our hosting. After some testing and troubleshooting we found that we needed to set define('FS_METHOD','direct'); in our wp-config.php for the import to work.

This is obviously connected to an issue with our hosting setup but it would have been great if the plugin could have thrown an error about that the import didn't work to guide us at least a litte about why it didn't work. Instead it actually looked like the import had gone through but instead it reset all settings.

So maybe if there could be a check after this code:

global $wp_filesystem;
if ( empty( $wp_filesystem ) ) {
require_once ABSPATH . '/wp-admin/includes/file.php';
WP_Filesystem();
}

if $wp_filesystem worked, and if it didn't throw an error similar to eg wp_die( esc_html__( 'Upload failed', 'astra-import-export' ) );?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions