Support » Plugin: WebP Express » Not generating the images

  • Resolved basvandijkk

    (@basvandijkk)


    I have some that are generated and the testing file is also being displayed as the image/webp image type. But I can’t seem to find the reason for not all of the images getting generated.

    Oh and credentials for popup:
    username: web
    password: whales

    • This topic was modified 2 years, 3 months ago by basvandijkk. Reason: added credentials

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author rosell.dk

    (@roselldk)

    The webp’s I see are either from a direct redirect to existing, or from Alter HTML. I see no redirects to the converter.

    So it seems that you have some files converted somehow, but are unable to get new ones converted.
    Did you perhaps use another plugin to get some converted?

    Or perhaps you accidently removed those of the nginx rewrites that redirects to the converter?

    Thread Starter basvandijkk

    (@basvandijkk)

    Well initially I’ve used another plugin, but I have changed the Nginx settings according to the ones stated in the FAQ of this plugin.

    • This reply was modified 2 years, 3 months ago by basvandijkk.
    Plugin Author rosell.dk

    (@roselldk)

    Ok, seems that the problem is the redirection then.

    Nginx can be set up differently and the other rules impacts the rules I provided a lot. I provided two methods in the FAQ you could try the other…

    Thread Starter basvandijkk

    (@basvandijkk)

    Hi Rosel, we’ve looked at our Nginx settings again haha..

    This is currently what we have:

    # WebP support
    location ~* ^/?wp-content/.*\.(png|jpe?g)$ {
        access_log                  off;
        log_not_found               off;
        expires                     max;
        add_header                  Vary Accept;
        try_files                   $uri$webp_extension /wp-content/plugins/webp-express/wod/webp-on-demand.php?xsource=x$request_filename&wp-content=wp-content;
    }
    # Pass all .php files to php-fpm, make sure the backend variable has been set in the server block that includes this snippet
    location ~ [^/]\.php(/|$) {
        fastcgi_pass                unix:$backend;
    
        # regex to split $uri to $fastcgi_script_name and $fastcgi_path
        fastcgi_split_path_info     ^(.+\.php)(/.+)$;
    
        try_files                   $fastcgi_script_name =404;
    
        set                         $path_info                  $fastcgi_path_info;
    
        include                     fastcgi.conf;
    
        fastcgi_param               PATH_INFO                   $path_info;
        fastcgi_index               index.php;
    
        proxy_read_timeout          60s;
        proxy_connect_timeout       60s;
        fastcgi_connect_timeout     60s;
        fastcgi_read_timeout        60s;
    
        fastcgi_param               PHP_VALUE                   "memory_limit=768M \n                     
        max_execution_time=60";
    
        fastcgi_intercept_errors    on;
        proxy_intercept_errors      on;
    }

    the problem is that when we use $uri =404; behind the try files when targeting the webp-on-demand.php file there are no new webp images being created. We are only able to let them generate when not using the $uri =404;.

    Do you have any idea what could cause this?

    Plugin Author rosell.dk

    (@roselldk)

    You are using a variable $webp_extension
    I bet you have defined it elsewhere, like this?

    
     map $http_accept $webp_suffix {
        default   "";
        "~*webp"  ".webp";
      }
    

    – following the solution first presented by Eugene Lazutkin, here and here

    The reason adding =404 to the try_files doesn’t work seems to be that the URL to the converter (/wp-content/plugins/webp-express/wod/webp-on-demand.php?xsource=x$request_filename&wp-content=wp-content) isn’t immediately registred as a “hit”. But it is handled as a new uri anyway, and that new uri is catched by the location block for handling PHP. Sorry, but I’m no expert in this area. You can also try reading up upon it here: https://nginx.org/en/docs/http/ngx_http_core_module.html#try_files

    Anyway, I should tell you that there will be a tool for bulk converting images in the next release. With that, you don’t really need these rules for *triggering* conversion (if you wish to serve varied image responses, and not completely rely on Alter HTML, you still need the rules that redirects directly to existing webp’s – the ones you have, and which are presumably working). I’m also planning on an option for triggering conversion when new images are added to the media library. Status on development here: https://github.com/rosell-dk/webp-express/milestone/16

    • This reply was modified 2 years, 3 months ago by rosell.dk.
    Thread Starter basvandijkk

    (@basvandijkk)

    @roselldk Hi, do you already have any idea when you will be releasing the next update?

    Plugin Author rosell.dk

    (@roselldk)

    Yes, it will not be long. Have just closed the last issue in the milestone: https://github.com/rosell-dk/webp-express/milestone/16?closed=1

    Next, I need to run manual tests. It takes a while. I expect to release tomorrow.

    Plugin Author rosell.dk

    (@roselldk)

    Its released…

    Thread Starter basvandijkk

    (@basvandijkk)

    Thanks Rosel! So far it’s working 🙂

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Not generating the images’ is closed to new replies.