Post by webdesires » Wed Jan 05, 2022 7:27 pm

soulliving wrote:
Mon Jan 03, 2022 4:54 am
JNeuhoff wrote:
Sun Jan 02, 2022 8:27 pm
Since you use the Journal3 framework (including for example \Journal3\Utils\Img) you really would have to get in touch with the Journal3 support on this.

Or use a standard compliant web theme.

As regards product description: In a standard OpenCart framework, it would require some modifications in the admin backend for the image file manager (admin/controller/common/filemanager.php).
All other pictures are done by Journal framework and that`s all working fine with webp.
Product description seems to be left out and is as I see it OpenCart core feature - I`m not looking for freebies, just wondering if there is a solution to this issue because after hours of searching I can`t find anyone that has come across this or touched this topic regarding media in product description.
Hello mate,
We have experience with this sort of thing with another client, in our case we simply needed to just resize the images down as they were being planted into product descriptions are full sized images which was not good for speed.

So we have code for pulling out all images uncompressed and then compressing those images.

If journal runs up from the original oc functions then this might be what your after.

Contact me if you would like me to put something together for you and we can see if it does what you need.

However I still think serving webp is quite dodgy as I said above.

Regards, WebDesires.
We are a team of developers in the UK - professional and friendly, message us or give us a call anytime and we will be happy to help.

Phone: +44 (0) 121 318 6336 - Web: webdesires.co.uk - Skype: WebDesires
OpenCart Support - OpenCart Web Development - Our OpenCart Plugins


User avatar
Active Member

Posts

Joined
Mon Sep 28, 2015 6:34 pm
Location - West Midlands, United Kingdom

Post by by mona » Wed Jan 05, 2022 7:42 pm

soulliving wrote:
Wed Jan 05, 2022 7:09 pm
by mona wrote:
Wed Jan 05, 2022 12:59 pm
WebP module for all store images.
https://www.opencart.com/index.php?rout ... n_id=43173

Image
Awesome!
Quick question, I have to upload through the uploader (admin), I mostly upload pictures through FTP.
At the moment the current webp setup I have creates webp versions of the pictures (product picture etc) in the cache folder - guess it`s a code they implemented in one of the image.php (not a developer so do not know where it`s done exactly).

This extention would be perfect if it would make them on the "fly" when cache is created.
It works with the uploader not ftp. There are ways do also do it in “bulk” via ftp, you can PM me to discuss.

UPDATE : Yes it works on the "fly" when cache is created and with the uploader
Last edited by by mona on Sat Jan 22, 2022 8:56 am, edited 1 time in total.

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by soulliving » Thu Jan 13, 2022 11:23 pm

webdesires wrote:
Wed Jan 05, 2022 7:27 pm
Hello mate,
We have experience with this sort of thing with another client, in our case we simply needed to just resize the images down as they were being planted into product descriptions are full sized images which was not good for speed.

So we have code for pulling out all images uncompressed and then compressing those images.

If journal runs up from the original oc functions then this might be what your after.

Contact me if you would like me to put something together for you and we can see if it does what you need.

However I still think serving webp is quite dodgy as I said above.
I`ve triplechecked now with the setup I`ve done for my site and no issues there so far and seems to serve the correct picture based on what the browser supports.
Also I`ve been using NitroPack for quite some time and after tweaking it it`s actually doing great.

Pagespeed score is now mostly in the 80+ (mobile) and 95+ (desktop) on Product page and Home page - So I`m happy with my results for now, not sure what I can optimize more :crazy:

Soulliving is an Norwegian webshop for korean skincare products - Setup in OpenCart 3.0.8..0 with Journal 3 theme


Newbie

Posts

Joined
Thu Nov 23, 2017 3:43 am


Post by webdesires » Thu Jan 13, 2022 11:46 pm

soulliving wrote:
Thu Jan 13, 2022 11:23 pm
webdesires wrote:
Wed Jan 05, 2022 7:27 pm
Hello mate,
We have experience with this sort of thing with another client, in our case we simply needed to just resize the images down as they were being planted into product descriptions are full sized images which was not good for speed.

So we have code for pulling out all images uncompressed and then compressing those images.

If journal runs up from the original oc functions then this might be what your after.

Contact me if you would like me to put something together for you and we can see if it does what you need.

However I still think serving webp is quite dodgy as I said above.
I`ve triplechecked now with the setup I`ve done for my site and no issues there so far and seems to serve the correct picture based on what the browser supports.
Also I`ve been using NitroPack for quite some time and after tweaking it it`s actually doing great.

Pagespeed score is now mostly in the 80+ (mobile) and 95+ (desktop) on Product page and Home page - So I`m happy with my results for now, not sure what I can optimize more :crazy:
I struggled to run any lighthouse tests on your site, your server seems to be EXTREMELY slow. I just get timeouts when trying to test it. And even when just browsing the site myself.

Dont know if this is just an issue right now with your hosting or a recurring incident.

anyway I dont know why you think your getting 80+ and 95+ because im getting awful results.

Homepage:
https://webdesires.co.uk/seo-tool/?test ... 2-15-43-27

Category:
https://webdesires.co.uk/seo-tool/?test ... 2-15-45-42

Product:
https://webdesires.co.uk/seo-tool/?test ... 2-15-46-35

Regards, WebDesires.
We are a team of developers in the UK - professional and friendly, message us or give us a call anytime and we will be happy to help.

Phone: +44 (0) 121 318 6336 - Web: webdesires.co.uk - Skype: WebDesires
OpenCart Support - OpenCart Web Development - Our OpenCart Plugins


User avatar
Active Member

Posts

Joined
Mon Sep 28, 2015 6:34 pm
Location - West Midlands, United Kingdom

Post by JNeuhoff » Fri Jan 14, 2022 12:16 am

Most pages on soulliving.no are extremely slow. The issue is caused by nitrocdn.com! And it certainly doesn't help using one of worst and slowest themes based on the Journal3 framework. Get a proper standard compliant web theme, and get rid of nitro cache!

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by soulliving » Fri Jan 14, 2022 7:16 pm

JNeuhoff wrote:
Fri Jan 14, 2022 12:16 am
Most pages on soulliving.no are extremely slow. The issue is caused by nitrocdn.com! And it certainly doesn't help using one of worst and slowest themes based on the Journal3 framework. Get a proper standard compliant web theme, and get rid of nitro cache!
My hosting is having trouble with their servers which they still are trying to figure out.
I know what I`m doing, and all metrics say the site is working perfectly fine (as long as my hosting isn`t messing things up).

Soulliving is an Norwegian webshop for korean skincare products - Setup in OpenCart 3.0.8..0 with Journal 3 theme


Newbie

Posts

Joined
Thu Nov 23, 2017 3:43 am


Post by soulliving » Fri Jan 14, 2022 7:24 pm

webdesires wrote:
Thu Jan 13, 2022 11:46 pm
I struggled to run any lighthouse tests on your site, your server seems to be EXTREMELY slow. I just get timeouts when trying to test it. And even when just browsing the site myself.

Dont know if this is just an issue right now with your hosting or a recurring incident.

anyway I dont know why you think your getting 80+ and 95+ because im getting awful results.

Homepage:
https://webdesires.co.uk/seo-tool/?test ... 2-15-43-27

Category:
https://webdesires.co.uk/seo-tool/?test ... 2-15-45-42

Product:
https://webdesires.co.uk/seo-tool/?test ... 2-15-46-35
Yes my hosting (a2hosting) is having some trouble with their servers in Amsterdam for the past few days, which does give timeouts.
I`d rather ust gtmetrix.com for results, where product pages mostly get A grade
https://gtmetrix.com/reports/www.soulli ... /8ESlvi86/ (Run for with 5/1mbps throttling which should cover the averate internet user)

Soulliving is an Norwegian webshop for korean skincare products - Setup in OpenCart 3.0.8..0 with Journal 3 theme


Newbie

Posts

Joined
Thu Nov 23, 2017 3:43 am


Post by webdesires » Fri Jan 14, 2022 8:00 pm

soulliving wrote:
Fri Jan 14, 2022 7:24 pm
webdesires wrote:
Thu Jan 13, 2022 11:46 pm
I struggled to run any lighthouse tests on your site, your server seems to be EXTREMELY slow. I just get timeouts when trying to test it. And even when just browsing the site myself.

Dont know if this is just an issue right now with your hosting or a recurring incident.

anyway I dont know why you think your getting 80+ and 95+ because im getting awful results.

Homepage:
https://webdesires.co.uk/seo-tool/?test ... 2-15-43-27

Category:
https://webdesires.co.uk/seo-tool/?test ... 2-15-45-42

Product:
https://webdesires.co.uk/seo-tool/?test ... 2-15-46-35
Yes my hosting (a2hosting) is having some trouble with their servers in Amsterdam for the past few days, which does give timeouts.
I`d rather ust gtmetrix.com for results, where product pages mostly get A grade
https://gtmetrix.com/reports/www.soulli ... /8ESlvi86/ (Run for with 5/1mbps throttling which should cover the averate internet user)
a) not in amsterdam pal
b) gtmetrix isnt good and isnt official
c) 5/1mbs broadband is not how you should be testing, you should be worrying about mobile...
d) googles lighthouse showed much worse than the server, your site is NOT optimized and this is what google officially uses too for rankings etc.

Your welcome to continue thinking your site is good, but it isnt.

Regards, WebDesires.
We are a team of developers in the UK - professional and friendly, message us or give us a call anytime and we will be happy to help.

Phone: +44 (0) 121 318 6336 - Web: webdesires.co.uk - Skype: WebDesires
OpenCart Support - OpenCart Web Development - Our OpenCart Plugins


User avatar
Active Member

Posts

Joined
Mon Sep 28, 2015 6:34 pm
Location - West Midlands, United Kingdom

Post by webdesires » Fri Jan 14, 2022 8:05 pm

Today is a little better though https://webdesires.co.uk/seo-tool/?test ... 2-12-04-34 But a lot more improvement needed, and I recommend better hosting too when you can. A2 are not great.

Regards, WebDesires.
We are a team of developers in the UK - professional and friendly, message us or give us a call anytime and we will be happy to help.

Phone: +44 (0) 121 318 6336 - Web: webdesires.co.uk - Skype: WebDesires
OpenCart Support - OpenCart Web Development - Our OpenCart Plugins


User avatar
Active Member

Posts

Joined
Mon Sep 28, 2015 6:34 pm
Location - West Midlands, United Kingdom

Post by JNeuhoff » Fri Jan 14, 2022 8:24 pm

I have to agree with webdesires. E.g. it took 76279 ms (more than a minute) to load one of your category pages. Even for Journal3, which is 2 to 3 times slower anyway than a standard-compliant OpenCart web theme, this is way too slow. When we tested your website a couple of days ago, the nitropack caused a severe slowdown, too.

Get rid of Nitropack, ditch A2 Hosting, get rid of the Journal3 framework!

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by soulliving » Fri Jan 14, 2022 8:27 pm

Lighthouse seems okay to me, compared to what it was, even for mobile
Homepage: https://pagespeed.web.dev/report?url=ht ... ving.no%2F
Product page: https://pagespeed.web.dev/report?url=ht ... -65ml.html

A2hosting is having issues in Amsterdam: https://a2status.com/ (Which is ongoing)
I`ve had no issues with a2hosting until now, support has been good too - But there are probably better options out there.

And since I`m an one man team there is so much I can do, I`m happy with how far I`ve gotten the site until now.

Edit: As soon as the business grows I will go for a 3rd party developer that can support further development etc. Since all money right now is going in to expanding the product range.

Soulliving is an Norwegian webshop for korean skincare products - Setup in OpenCart 3.0.8..0 with Journal 3 theme


Newbie

Posts

Joined
Thu Nov 23, 2017 3:43 am


Post by by mona » Fri Jan 14, 2022 8:41 pm

Being happy where you are is important, having the fastest site in the world or 100% page scores no matter from what platform will not make the difference between success and failure. They are only guidelines and improvements. There are far more important factors to success.

However, if there is a switch to turn off webp in your theme you should turn it off or revert to jpg/png images throughout - it is not working on all browsers.
This will affect your sales.
It is better to have a slow functioning store than a non functioning fast one.

Attachments

Screen-Shot.png

Screen-Shot.png (75.79 KiB) Viewed 1010 times


DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by soulliving » Fri Jan 14, 2022 9:12 pm

by mona wrote:
Fri Jan 14, 2022 8:41 pm
Being happy where you are is important, having the fastest site in the world or 100% page scores no matter from what platform will not make the difference between success and failure. They are only guidelines and improvements. There are far more important factors to success.

However, if there is a switch to turn off webp in your theme you should turn it off or revert to jpg/png images throughout - it is not working on all browsers.
This will affect your sales.
It is better to have a slow functioning store than a non functioning fast one.
Thanks for info, seems like the part of the site without NitroPack activated reverts to jpg/png afther testing with older safari browsers (works fine on the newest version). Will have a chat with NitroPack about this and hopefully they can give some more insight on how to solve it.

Soulliving is an Norwegian webshop for korean skincare products - Setup in OpenCart 3.0.8..0 with Journal 3 theme


Newbie

Posts

Joined
Thu Nov 23, 2017 3:43 am


Post by Rainforest » Tue Jan 18, 2022 3:38 am

Hey I just switched back to Journal which in my opinion, as a real world store owner not a developer, is probably the best theme out there for opencart.

We had the webp image issue but added some code from a comment in this extension:


https://www.opencart.com/index.php?rout ... n_id=38025

<file path="catalog/model/journal3/image.php">
<operation>
<search><![CDATA[return $this->model_tool_image->resize($filename, $width, $height, $resize_type);]]></search>
<add position="before"><![CDATA[$resize_type = '';]]></add>
</operation>
</file>

Fixed any broken image issue. And yes, you should use webp. If someone is using a browser that doesn't support it, they are probably 80 years old and don't shop online anyway.


soulliving wrote:
Sun Jan 02, 2022 4:48 am
Hello!
Webp pictures is working everywhere else on the site, but I can`t find a module or thread on how to get it to work with insterted images (uploaded to server) in product description. We use up to 20 images sometimes and would be nice to get them in webp format too.
Any experience with this?

Running Opencart 3.0.3.8 with Journal 3 theme (yes I know the feelings about the theme).

Image.php in ocartdata is this:

Code: Select all

<?php
class ModelToolImage extends Model {
	public function resize($filename, $width, $height, $type = '') {
		if (!is_file(DIR_IMAGE . $filename) || substr(str_replace('\\', '/', realpath(DIR_IMAGE . $filename)), 0, strlen(DIR_IMAGE)) != str_replace('\\', '/', DIR_IMAGE)) {
			return;
		}

		$extension = pathinfo($filename, PATHINFO_EXTENSION);

		$image_old = $filename;
		$image_new = 'cache/' . utf8_substr($filename, 0, utf8_strrpos($filename, '.')) . '-' . (int)$width . 'x' . (int)$height . $type . '.' . $extension;

		if (!is_file(DIR_IMAGE . $image_new) || (filemtime(DIR_IMAGE . $image_old) > filemtime(DIR_IMAGE . $image_new))) {
			list($width_orig, $height_orig, $image_type) = getimagesize(DIR_IMAGE . $image_old);
				 
			if (!in_array($image_type, array(IMAGETYPE_PNG, IMAGETYPE_JPEG, IMAGETYPE_GIF))) { 
				return DIR_IMAGE . $image_old;
			}
						
			$path = '';

			$directories = explode('/', dirname($image_new));

			foreach ($directories as $directory) {
				$path = $path . '/' . $directory;

				if (!is_dir(DIR_IMAGE . $path)) {
					@mkdir(DIR_IMAGE . $path, 0777);
				}
			}

			if ($width_orig != $width || $height_orig != $height) {
				$image = new Image(DIR_IMAGE . $image_old);
				$image->resize($width, $height, $type);
				$image->save(DIR_IMAGE . $image_new);

                if (defined('JOURNAL3_ACTIVE')) {
                    if ($this->journal3->settings->get('performanceCompressImagesStatus')) {
                        \Journal3\Utils\Img::optimise(DIR_IMAGE . $image_new);
                    }
                }
            
			} else {
				copy(DIR_IMAGE . $image_old, DIR_IMAGE . $image_new);

                if (defined('JOURNAL3_ACTIVE')) {
                    if ($this->journal3->settings->get('performanceCompressImagesStatus')) {
                        \Journal3\Utils\Img::optimise(DIR_IMAGE . $image_new);
                    }
                }
            
			}
		}
		

                if (defined('JOURNAL3_ACTIVE')) {
                    if ($this->journal3->settings->get('performanceCompressImagesStatus')) {
                        $image_new = \Journal3\Utils\Img::cwebp($image_new);
                    }
                }
            
		$image_new = str_replace(' ', '%20', $image_new);  // fix bug when attach image on email (gmail.com). it is automatic changing space " " to +
		

                if (defined('JOURNAL3_STATIC_URL')) {
                    return JOURNAL3_STATIC_URL . 'image/' . $image_new;
                }
            
		if ($this->request->server['HTTPS']) {
			return $this->config->get('config_ssl') . 'image/' . $image_new;
		} else {
			return $this->config->get('config_url') . 'image/' . $image_new;
		}
	}
}
Image.php in /catalog/model/tool/ is

Code: Select all

<?php
class ModelToolImage extends Model {
	public function resize($filename, $width, $height) {
		if (!is_file(DIR_IMAGE . $filename) || substr(str_replace('\\', '/', realpath(DIR_IMAGE . $filename)), 0, strlen(DIR_IMAGE)) != str_replace('\\', '/', DIR_IMAGE)) {
			return;
		}

		$extension = pathinfo($filename, PATHINFO_EXTENSION);

		$image_old = $filename;
		$image_new = 'cache/' . utf8_substr($filename, 0, utf8_strrpos($filename, '.')) . '-' . (int)$width . 'x' . (int)$height . '.' . $extension;

		if (!is_file(DIR_IMAGE . $image_new) || (filemtime(DIR_IMAGE . $image_old) > filemtime(DIR_IMAGE . $image_new))) {
			list($width_orig, $height_orig, $image_type) = getimagesize(DIR_IMAGE . $image_old);
				 
			if (!in_array($image_type, array(IMAGETYPE_PNG, IMAGETYPE_JPEG, IMAGETYPE_GIF))) { 
				return DIR_IMAGE . $image_old;
			}
						
			$path = '';

			$directories = explode('/', dirname($image_new));

			foreach ($directories as $directory) {
				$path = $path . '/' . $directory;

				if (!is_dir(DIR_IMAGE . $path)) {
					@mkdir(DIR_IMAGE . $path, 0777);
				}
			}

			if ($width_orig != $width || $height_orig != $height) {
				$image = new Image(DIR_IMAGE . $image_old);
				$image->resize($width, $height);
				$image->save(DIR_IMAGE . $image_new);
			} else {
				copy(DIR_IMAGE . $image_old, DIR_IMAGE . $image_new);
			}
		}
		
		$image_new = str_replace(' ', '%20', $image_new);  // fix bug when attach image on email (gmail.com). it is automatic changing space " " to +
		
		if ($this->request->server['HTTPS']) {
			return $this->config->get('config_ssl') . 'image/' . $image_new;
		} else {
			return $this->config->get('config_url') . 'image/' . $image_new;
		}
	}
}
Hope there is someone that has fixed something like this before :)

Self Taught Opencart User & Developer Since 2010.


User avatar
Active Member

Posts

Joined
Fri Jan 28, 2011 3:50 am

Post by by mona » Sat Jan 22, 2022 9:00 am

UPDATED :
https://www.opencart.com/index.php?rout ... n_id=43173

Now working with the uploader and on the “fly” for all images and back up images for non Webp browsers

made with love and with thanks :good:

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am
Who is online

Users browsing this forum: No registered users and 101 guests