• Resolved raptor235

    (@raptor235)


    Hey there,

    Thanks for the plugin, we’re testing it out now.. also thanks for pointing out WPE had issues with the mime type…

    I have pushed them hard on our end to fix the issue.. their nginx should support avif but it’s not being set. We had to write a new set of nginx rules to work around setting mime types around the location blocks.

    Anyway back to my issue.. we need the uploads directory and optimized directory to be the same…

    I changed the locations via filter webpc_dir_name

    add_filter('webpc_dir_name', function ($path, $directory) {
    
    switch ($directory) {
    
    case 'uploads':
    
    return 'wp-content/uploads';
    
    case 'webp':
    
    return 'wp-content/uploads';
    
    case 'plugins':
    
    return 'wp-content/plugins';
    
    case 'themes':
    
    return 'wp-content/themes';
    
    }
    
    return $path;
    
    }, 10, 2);

    However your plugin is complaining that both paths are the same… and images don’t seem to be generated… our nginx rules rely on the images being in the same folder… can we make this check a warning but still allow for the paths to be the same?

Viewing 1 replies (of 1 total)
  • Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    Hi @raptor235,

    Thank you for your message.

    You cannot set WebP/AVIF files to be saved in the /uploads directory. These files must be in a person directory and this is a deliberate action of the plugin.

    For example, WebP files from the /uploads directory can be converted to the AVIF format, which is why directory separation is so important.

    Best,
    Mateusz

Viewing 1 replies (of 1 total)
  • The topic ‘Need upload directory to be same as optimized’ is closed to new replies.