• Resolved nickvernitsky

    (@nickvernitsky)


    Hi, please help me.

    I have upload folder on subdomain and use filters to indicate this:

    add_filter(‘webpc_uploads_root’, function($path){
    $upload_dir = wp_upload_dir();
    return $upload_dir[‘basedir’];
    });
    add_filter(‘webpc_uploads_path’, function($path){return ”;});
    add_filter(‘webpc_uploads_webp’, function($path){return ‘webp’;});

    So, webp files are saved to a folder $upload_dir[‘basedir’], not in $upload_dir[‘basedir’]/webp, although the folder /webp also exists. Such a structure suits me, files are added and deleted normally.

    But your function “checkFileSize($data)” does not work, and I think it does not work because of my folder structure. Webp files larger than the original continue to be written to disk.

    I will be very grateful for your kind help and advice.

    The page I need help with: [log in to see the link]

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

    (@mateuszgbiorczyk)

    Hi @nickvernitsky,

    Thank you for your message.

    Try to enter the plugin settings and click Renerate All button. When the process is completed please check if the problem has disappeared.

    Thread Starter nickvernitsky

    (@nickvernitsky)

    Thanks for answering!

    If I run Regenerate All, I get error “An error occurred while connecting to REST API. Please try again”. But if I add new jpg image, I get its webp copy (sometime smaller, sometime bigger).

    I think the error appears for the same reason – plugin can’t find right way to REST API.

    Thread Starter nickvernitsky

    (@nickvernitsky)

    My upload directory path ($upload_dir[‘basedir’]) is
    /var/www/media.gotomexico.today/htdocs/files

    But ABSPATH is
    /var/www/gotomexico.today/htdocs

    • This reply was modified 4 years, 9 months ago by nickvernitsky.
    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    Please read the FAQ. There is a question where you will find all the information he needs to help you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Webp is larger than the original’ is closed to new replies.