There is a subtitle difference in that the dir must be an OS path when creating the file and a url when returning the file for download.
There should also be a leading / on settings.ini and settings.zip
Here is my workaround. Try out at your own risk.
NOTE: I have not tested the resulting import yet.
Additions market with > starting from line 80. Mods marked with |
> $upload_dir = wp_upload_dir();
> $wpseo_upload_path = $upload_dir['path'];
> $wpseo_upload_url = $upload_dir['url'];
| if ( !$handle = fopen( $wpseo_upload_path.'/settings.ini', 'w' ) )
if ( !fwrite($handle, $content) )
require_once (ABSPATH . 'wp-admin/includes/class-pclzip.php');
$zip = new PclZip('./settings.zip');
if ($zip->create('./settings.ini') == 0)
| return $wpseo_upload_url.'/settings.zip';