Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error handling of wp_filesystem issue #19

Open
j-falk opened this issue Apr 15, 2021 · 0 comments
Open

Better error handling of wp_filesystem issue #19

j-falk opened this issue Apr 15, 2021 · 0 comments

Comments

@j-falk
Copy link

j-falk commented Apr 15, 2021

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

MasterLena pushed a commit to MasterLena/astra-import-export that referenced this issue Apr 16, 2021
- Check if WP_Filesystem is generating some errors
- Print error generated by WP_Filesystem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant