wp-cli/media-command

Regenerate thumbnails with DO Spaces not working

royduin opened this issue · 3 comments

We're using https://wordpress.org/plugins/do-spaces-sync/ to store all media in Digital Ocean Spaces. The regenerate thumbnails command checks to see if the file exists (see:

if ( false === $fullsizepath || !file_exists( $fullsizepath ) ) {
), which isn't the case because they're not on the local filesystem. Maybe add an option to skip this check?

Hi @royduin,

Thanks for the report. I'm not sure it's within scope of wp media regenerate to regenerate files outside of the filesystem, in large part because WP-CLI doesn't know whether it has access to the remote files.

Can you describe the current behavior vs. your expected behavior in greater detail?

I had a look into the actual code to see what the regeneration does. Getting past the above check is not enough, as there are lot of places in the code that just assume that everything is stored on a regular filesystem, like using filename suffixes, using parent/child folder relationships, etc...

I think for such a use case, you would need a third-party version of media regenerate to override the default. This could even be bundled with the above plugin and override the WP-CLI default.

Thanks guys, closing because it's out of the scope of WP CLI. I'm not using the plugin anymore because of this, back to the local filesystem with an additional disk attached. I hope Wordpress is going to use Flysystem some day...