Image Compress with reSmush for OpenCart 1.5-3.*

Image Compress with reSmush for OpenCart 1.5-3.*
     Use the "Image Compress with reSmush" to optimize images' size in your store, make your pages’ load faster, save space, and rank better in Google. You can set up a CRON job to automatically compress your product images.

! - Increase your SEO rank by having a faster site load.
! - Improve your customers' attitude by getting them a faster pages' load.

     Easily and FREE compress JPG, GIF, and PNG images by reSmush service. Reduce images' size significantly by compressing them, even for shops with more 100.000 products. On average, JPG images are compressed by 40-60% and PNG images by 50-80% WITHOUT visible loss in quality.
It makes it possible to save a lot of disk space on the server.





Lazy loading is an additional way to improve the page's loading time and overall performance.
Lazy load defers loading of ALL your images not just catalog images, for example, it lazy loads: logo, cms images, module images, theme images, etc.

     Also, using this plugin, you can create a complete site map with an XML image in a few seconds to upload it to Webmaster from Google and Yandex. It increases your shop rating and improves its SEO by allowing Google to scan all of your site images.

Features:
  • Adds gzip compress for Apache server
  • It saves original image files
  • Added lazy load for images
  • Auto convert images (run CRON command)
  • You can change the quality of compress
  • You can choose files which you want to compress
  • The module does not delete your images' classes in frontend
  • It compresses an unlimited number of images
  • Create an XML images sitemap


This plugin can compress:
  • product images
  • manufacturer images
  • banner images
  • extension images
  • option voucher images



When using nginx server.
To redirect to webp images, you need to add configurations to * .conf of your nginx server
========================================================================================
* Find in the config the location that processes the images
--------------------------
location ~* ^.+\.(jpg|jpeg|png|gif|svg|...)$ {
...
}
---------------------------
* Add webp, jp2 formats inside the brackets

--------------------------
location ~* ^.+\.(jpg|jpeg|png|webp|jp2|gif|svg|...)$ {
...
}
--------------------------

* Add rules for interception from converted images (opencart 2.3->3.x)
---------------------------
location ~* ^.+\.(jpg|jpeg|png|webp|jp2|gif|svg|...)$ {
######################################
location ~* /?(.+\.(jpeg|jpg|png|webp|jp2)) {

location ~* /?(.+)(_compress.jpg)$ {
try_files $uri /$1 =404;
add_header IMAGE-COMPRESS-PRO link-image_jpg;
break;
}
location ~* /?(.+)\.(webp)$ {
try_files $uri /$1 =404;
add_header IMAGE-COMPRESS-PRO-FORMAT $format;
add_header IMAGE-COMPRESS-PRO link-image_webp;
break;
}
location ~* /?(.+)\.(jp2)$ {
try_files $uri /$1 =404;
add_header Content-Type image/jp2;
add_header IMAGE-COMPRESS-PRO-FORMAT $format;
add_header IMAGE-COMPRESS-PRO link-image_jp2;
break;
}
set $format .jpg;
set $safari 0;
set $rules_format_jpg 0;
set $rules_format_webp 0;
set $rules_format_jp2 0;
if ($http_accept !~* "webp"){
set $safari 1;
}
if ( -f {{DIR_STORAGE}}/images_compress_resmush/jpg.enabled ) {
set $rules_format_jpg 1;
}
if ( -f {{DIR_STORAGE}}/images_compress_resmush/webp.enabled ) {
set $rules_format_webp 2;
}
if ( -f {{DIR_STORAGE}}/images_compress_resmush/jp2.enabled ) {
set $rules_format_jp2 3;
}

set $check1 $safari$rules_format_jp2;
if ( $check1 = 13) {
set $format .jp2;
}
set $check2 $safari$rules_format_jpg;
if ( $check2 = 01) {
set $format _compress.jpg;
}
set $check3 $safari$rules_format_webp;
if ( $check3 = 02) {
set $format .webp;
}

if ( -f $request_filename$format) {
rewrite /?(.+\.(jpe?g|jpg|png)$) $uri$format last;
break;
}
if ( -f {{DIR_STORAGE}}/images_compress_resmush/getimage.php) {
rewrite /?(.+)\.(jpe?g|jpg|png)$ /index.php?route=extension/module/images_compress_resmush/getImage&url=$1.$2 last;
}

}
#########################
...
}

-----------------------------
### {{DIR_STORAGE}} replace with the path to the "storage" folder of your project
For example: /home/www/storage/
----------------------------

* Add rules for interception from converted images (opencart 1.5->2.2)
---------------------------
location ~* ^.+\.(jpg|jpeg|png|webp|jp2|gif|svg|...)$ {
######################################
location ~* /?(.+\.(jpeg|jpg|png|webp|jp2)) {

location ~* /?(.+)(_compress.jpg)$ {
try_files $uri /$1 =404;
add_header IMAGE-COMPRESS-PRO link-image_jpg;
break;
}
location ~* /?(.+)\.(webp)$ {
try_files $uri /$1 =404;
add_header IMAGE-COMPRESS-PRO-FORMAT $format;
add_header IMAGE-COMPRESS-PRO link-image_webp;
break;
}
location ~* /?(.+)\.(jp2)$ {
try_files $uri /$1 =404;
add_header Content-Type image/jp2;
add_header IMAGE-COMPRESS-PRO-FORMAT $format;
add_header IMAGE-COMPRESS-PRO link-image_jp2;
break;
}
set $format .jpg;
set $safari 0;
set $rules_format_jpg 0;
set $rules_format_webp 0;
set $rules_format_jp2 0;
if ($http_accept !~* "webp"){
set $safari 1;
}
if ( -f {{DIR_STORAGE}}/images_compress_resmush/jpg.enabled ) {
set $rules_format_jpg 1;
}
if ( -f {{DIR_STORAGE}}/images_compress_resmush/webp.enabled ) {
set $rules_format_webp 2;
}
if ( -f {{DIR_STORAGE}}/images_compress_resmush/jp2.enabled ) {
set $rules_format_jp2 3;
}

set $check1 $safari$rules_format_jp2;
if ( $check1 = 13) {
set $format .jp2;
}
set $check2 $safari$rules_format_jpg;
if ( $check2 = 01) {
set $format _compress.jpg;
}
set $check3 $safari$rules_format_webp;
if ( $check3 = 02) {
set $format .webp;
}

if ( -f $request_filename$format) {
rewrite /?(.+\.(jpe?g|jpg|png)$) $uri$format last;
break;
}
if ( -f {{DIR_STORAGE}}/images_compress_resmush/getimage.php) {
rewrite /?(.+)\.(jpe?g|jpg|png)$ /index.php?route=module/images_compress_resmush/getImage&url=$1.$2 last;
}

}
#########################
...
}

-----------------------------
### {{DIR_STORAGE}} replace with the path to the "storage" folder of your project
For example: /home/www/my_doman/system/storage/
----------------------------




Buy
Price
$35.00

  • Developed by OpenCart Community
  • Documentation Included

Rating

Compatibility
3.0.0.0, 3.0.1.1, 3.0.1.2, 3.0.2.0, 3.1.0.0_b, 3.0.3.0, 3.0.3.1, 3.0.3.2, 3.0.3.3, 3.0.3.5, 3.0.3.6, 2.1.0.1, 2.1.0.2, 2.2.0.0, 2.3.0.0, 2.3.0.1, 2.3.0.2, 2.0.0.0, 2.0.1.0, 2.0.1.1, 2.0.2.0, 2.0.3.1, 1.5.4, 1.5.4.1, 1.5.5.1, 1.5.6, 1.5.6.1, 1.5.6.2, 1.5.6.3, 1.5.6.4

Last Update
28 Sep 2020

Created
7 Jul 2020
0 Sales
0 Comments
pintawebware
pintawebware
Member since: 19 Dec 2016

View all extensions Get Support