Module for smart compression of PNG and JPEG images at the stage of their uploading in OpenCart. Image optimization is performed via the TinyPNG API, which uses unique compression techniques to reduce the size of JPEG and PNG files. Selectively reducing the number of colors in an image results in fewer bytes to store data. The effect is almost invisible visually, but there is a big difference in file size, up to 80% of the original file size. This will have a positive effect on the page load speed, data display, and this is an important indicator when checking the site in PageSpeed Insights, ie directly affects SEO.
The main advantages of the Tinify module:
automatic compression when uploading JPG and PNG images to products, categories, etc.;
photo optimization with almost no visible loss of quality;
saving disk space on the hosting;
view statistics in the personal account on the TinyPNG service;
free compression of 500 images per month for one API key.
How to build a variable name or array key in Twig: attribute(context, 'var'~id), square brackets, the .() operator from Twig 3.15, interpolation, and OpenCart compatibility.
An analysis of OpenCart 4.2.x.x development plans: the switch to jQuery 4.0.0, changes to `oc_product_code`, a 15–20 MB reduction in the distribution size, and the module adaptation process.
Daniel Kerr has announced the static OpenCart 5 and the opencart.js project. We analyze the advantages and limitations of this concept, as well as the development of PHP branches 3.0, 4.1, and 4.2.