Magento 2 JS bundling

I recently found a site that had JS merging and bundling turned on, when I looked into it a little more I found that the bundling side was making the JS huge. Turning the bundling off made the JS 4 times smaller and knocked a good few seconds off the site load time.

Looking further into it I really like the idea of JS bundling but it’s got a long way to come before it can be used and widely adapted.

mysql2 search engine doesn’t exists

I kept seeing the following error in system.log

“main.ERROR: mysql2 search engine doesn’t exists. Falling back to mysql [] []”

The fix for me was to go to Stores > Configuration > Catalog > Catalog under the section “Catalog Search” you’ve probably got MySQL selected for “Search Engine” and you’ve probably got “use system value” unticked. For me ticking “use system value” made the error go away.

I did see another fix for this which was to run the following sql query “UPDATE core_config_data set value = ‘mysql’ where path=’catalog/search/engine’;”

Top 5 Modules To Speed Up Magento 2

Magento 2, it’s slow out of the box, everyone knows that and knows it’s something they have to deal with.

But there must be ways to speed it up, right?

These are the modules I recommend to help speed that most of the other articles don’t cover.

  1. WebP – jpgs and pngs are old news, the latest format of images for web is WebP. By using WebP images you get either lossless and lossy compression, typically 25% smaller than jpgs. So how do we make our jpgs and pngs in Magento into WebP files? I use this module https://github.com/yireo/Yireo_Webp2
  2. Pre Loading – it’s possible to preload your primary resources, I like this module to do that https://github.com/yireo/Yireo_LinkPreload I’ve seen some good improvements in fully loaded times with this module.
  3. Cron manager – this one doesn’t always provide a direct speed improvement but I install this on every single site I develop. The module I use is https://github.com/magemojo/m2-ce-cron it’s been proven to stop cron’s stacking up with can quite often result in performance issues.
  4. Defer JS – Magento 2’s JS files tend to be huge! I use this module https://bsscommerce.com/magento-2-defer-javascript-extension.html to defer the JS by moving the JS to the bottom of the HTML.
  5. Lazy Load images – there’s loads of modules to do this, but they all basically only load the images that are visible on screen and then load the rest as you scroll. This is the module I like for doing so https://www.weltpixel.com/magento-2-lazy-load-product-extension.html

I actually think the top 3 modules should all be included in the Magento core, especially the cron module.

Give some of the above ago and let me know if you see some good improvements.

Magento 1.9 Image file was not found

I recently came across an error after upgrading to Magento 1.9.3.10, if you navigated to category page you sometimes saw the error message “Image file was not found” The reason for seeing this error is because some products have no got an image set and the default placeholder is missing.

The easiest way to get over this issue is to go to System > Configuration > Catalog > Product Image Placeholders and set new placeholder images, my guess is that you have them missing currently?

Installing Magento 2 solely from Composer

The documentation on how to install a Magento 2 project solely using the command line is pretty limited so here are the steps I take on creating a project.

composer create-project –repository=https://repo.magento.com/ magento/project-community-edition /your/local/dir/ 

The above will install all the packages need and sticks them in your directory.

Once that has finished you then can start installing Magento 2, to do that here is an install script.

bin/magento setup:install \
–base-url=http://magento2.local \
–db-host=localhost \
–db-name=magento2 \
–db-user=root \
–db-password=mysql \
–backend-frontname=admin \
–admin-firstname=admin \
–admin-lastname=admin \
[email protected] \
–admin-user=admin \
–admin-password=admin123 \
–language=en_US \
–currency=USD \
–timezone=America/Chicago \
–use-rewrites=1

Magento 1.9.3.9 Please make sure your passwords match

Some customers are seeing an issue with Magento 1.9.3.9 but actually I think it can be any version above 1.9.1

Step 1: Open This file /app/code/core/Mage/Customer/Model/Customer.php

Step 2: Find This line in Customer.php $confirmation = $this->getPasswordConfirmation();

Step 3: Replace That that line with $confirmation = $this->getConfirmation();

Obviously any changes should be made within app/code/local rather than app/code/core so copy the file to that folder first.

Magento 2.2.4 Issues with Multistore Emails

If you have taken the plunge to Magento 2.2.4 and you are running multiple stores within Magento you may have noticed a few issues, if not you should check your transactional emails for a start.

There’s a well known bug with Magento 2.2.4 whereby it ignores your email sender values for store views if you use different values per view.

There is one way to get around this issue and that’s too use the different store email address options. If you go to Stores > Configuration > General > Store Email Addresses and then populate one Contact for each store (hopefully you don’t have more than 5 stores). Once you have done that go to Sales > Sales Emails  and change the Sender for the different store views.

Magento 1 blank page frontend and backend

Ever noticed your website go completely white? Both frontend and backend? How long before panic set in? How long did it take you to discover that going to /var/cache/ and doing rm rf * gets the website back?

The annoying thing about this bug is it can randomly happen when you least expect it and you might have to wait weeks to see it again.

The best way to get rid of this bug is to upgrade your Magento version, this bug only seems to exist in version earlier than 1.9.2.0.

If this still continues get in touch and I’ll provide another potential fix.