Skip to content

Better error handling of wp_filesystem issue #19

@j-falk

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' ) );?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions