• Rhapsody348

    (@rhapsody348)


    Three items – An error encountered, suggested action when an error is encountered, suggested execution role switch

    Error Encountered
    I am experience this error message when using the front end loader with the shortcode [import-users-from-csv-with-meta role=”subscriber”]. The import appears to work correctly.

    Suggestion – Action When Error Encountered
    It appears that wp_die is used whenever an error is encountered. While this stops futher execution, it leaves the display in a state that appears to break the theme with a white background, offset page image and fonts mapped differently.

    Rather than executing wp_die when an error is encountered, would it be possible to have an error handling subroutine that returns to the original calling page and displays the error there? This would be much less disruptive to the users

    Suggestion – Include Option for Required Role to Execute Front End
    It would be good to limit the ability for the front end shortcode to be executed only by users having sufficient permissions. I have done this by embedding your shortcode in another shortcode that checks the users permissions and only displays the file chooser and import button if sufficient permissions exist for that user. It might be helpful to include a switch in the front end shortcode to restrict execution unless the user had permission. Something like [import-users-from-csv-with-meta role=”subscriber” permission=”Editor”]

Viewing 1 replies (of 1 total)
  • Thread Starter Rhapsody348

    (@rhapsody348)

    I made the following change to the file classes/import.php that fixes the front end import error display on my site. Obviously this is temporary until a solution by the plugin developer is found since it will be overwritten with any future updates.

    approximately line 145 search for:
    wp_die( __( 'Error, we cannot find the file', 'import-users-from-csv-with-meta' ) . ": $path_to_file" );

    and replace with the following:

    			if ( !$_FILES['uploadfile']['name']) echo "<script>alert('No file was selected');</script>";
    
    			echo "<h3><b>Refresh the page when ready, or navigate to another desired page</b></h3>";
    
    			exit;
    
Viewing 1 replies (of 1 total)
  • The topic ‘“Error, we cannot find the file” & Suggestions’ is closed to new replies.