Support » Plugin: SimpleMap Store Locator » [Plugin: SimpleMap Store Locator] Fix Suggestion for Import Directory

  • Resolved zaus

    (@zaus)


    Currently uploading a CSV file for import saves the file (temporarily) to the /plugins/ directory, which requires that you change folder permissions to allow it to do so.

    This seems a little weird — why not use the actual WordPress upload directory? Then you don’t need to worry about permissions, as this is the appropriate folder for uploads.

    I suggest changing anywhere in the file import-export.php it uses $file_location = ... to the following:

    $file_location = $this->get_import_path($blog_id . '.csv');

    using

    function get_import_path($file) {
    	$upload_dir = wp_upload_dir();
    
    	// fallback to original path...?
    	if( isset($upload_dir['error']) && !empty($upload_dir['error']) ) return WP_PLUGIN_DIR . '/sm-temp-csv-' . $file;
    
    	return $upload_dir['path'] . '\\' . $file;
    }

    http://wordpress.org/extend/plugins/simplemap/

  • The topic ‘[Plugin: SimpleMap Store Locator] Fix Suggestion for Import Directory’ is closed to new replies.