awesomemotive / one-click-demo-import

One Click Demo Import plugin
https://www.awesomemotive.com/
195 stars 84 forks source link

Filter on `Helpers::download_import_files` for AWS S3 presigned url's #191

Closed hogash closed 5 years ago

hogash commented 5 years ago

I'm trying to pass AWS S3 presigned download url's with expiration time on import_file_url, import_widget_file_url and import_customizer_file_url but because they're temporary, this would be applicable only if the expiring URL request is made when the dialog is confirmed ( clear decision that user wants to import the demo ).

If you're familiar with WP's upgrader_package_options filter, i was thinking of filtering $import_file_info in Helpers::download_import_files. For example adding this filter ocdi/pre_download_import_files eg:

...
$downloader = new Downloader();

$import_file_info = apply_filters('pt-ocdi/pre_download_import_files', $import_file_info);

// ----- Set content file path -----
...

@primozcigler , do you think such pull request would be accepted?

Thanks!