Page 5 - Monthly Archives: 2019
- 2 min read
The "Product Key is empty or invalid. The extension has been automatically disabled." issue appears because of three common reasons. Usually, it's because you use the outdated version of the Magefan_Communty module, you downloaded a free version of the module for Magento Commerce or you use Translation extension v2.2.9.
Let's see what you can do to fix this issue in different cases.
Solution for Magento Open Source (CE)
If you get this error while saving the Magefan extension on the Magento Community edition and don't see any Product Key field, as on the screenshot:
make sure that you have the latest version of the Magefan Community extension.
Note: Magefan Community is not a Magefan Blog or Magefan Login as Customer. It is a separate module that is used together with all Magefan extensions.
To check the version of the Magefan Community extension have a look inside one of these files:
app/code/Magefan/Community/composer.jsonapp/code/Magefan/Community/etc/module.xmlvendor/magefan/module-community/composer.jsonvendor/magefan/module-community/etc/module.xmlihor
- 1 min read
Sometimes instead of the real customer IP address, you can see 127.0.0.1 or some other wrong customer IP in your Magento 2 Admin panel. It can be due to proxies, like Varnish, Cloudflare, Sucuri.net, that may be enabled for your Magento 2 store.
To solve the wrong IP address issue you need to:
1. Create a new file in M2 directory:
app/etc/XIP/di.xml
2. Paste the code:
<?xml version="1.0"?><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Framework\HTTP\PhpEnvironment\RemoteAddress"> <arguments> <argument name="alternativeHeaders" xsi:type="array"> <item name="x-client-ip" xsi:type="string">HTTP_X_REAL_IP</item> <item name="x-cf-connecting-ip" xsi:type="string">HTTP_CF_CONNECTING_IP</item> <!-- <item name="x-cf-mfcustom-ip" xsi:type="string">SOME_CUSTOM_SERVER_KEY</item> --> </argument> </arguments> </type></config>
3. Save the file, andihor
- 2 min read
Configuring Image Lazy Load is one of the great that allows you to improve your website loading speed and reduce the page size by loading images gradually.
Once your images are lazy-loaded you are sure there won't be any delay in loading the page caused by images so that your customers receive the best user experience.
How to Configure Image Lazy Load in Magento 2?
First, you need to install the by Magefan. Then, navigate to Stores > Configuration > Magefan Extensions > Image Lazy Load and enable the extension. There are two options you can choose from. Let's talk more about both.
Lazy Load All Website Images
All you need to do to lazy load all website images is choose a corresponding option in the Blocks to Lazy Load select box. However, if you want to exclude some images from the lazy load, define them in the Lazy Load Blocks section and specify how many First Images from those blocks To Skip.
Lazy Load Selected Website Images
In case you want to lazy load only some specific imagesihor
- 1 min read
To get a resized post image in you can use this code in your template files:
<?php
$width = 100;
$height = 150;
$imageHelper = $this->helper(\Magefan\Blog\Helper\Image::class);
?>
<img
src="<?php echo $imageHelper->init($_post->getFeaturedImg())->resize($width, $height); ?>"
alt="<?php echo $block->escapeHtml($_post->getTitle()) ?>" />
If you don't want to use the height parameter then you can execute the resize function only with the first parameter, e.g.
<?php echo $imageHelper->init($_post->getFeaturedImg())->resize($width); ?>
Or if you use Magefan Blog version greater equal than v2.9.8, you can use this line (it will allow you to save the image width x height file proportion and not create a square image with white borders):
<?php echo $imageHelper->init($_post->getFeaturedImg())->resize($width, null, false); ?>
- 2 min read
Sitemap is one of the most important things when it comes to website indexing and crawling. The same is true for your Magento 2 blog sitemap. If you want your content to be discovered by the search robots, you need to configure the blog sitemap.
So, today you'll learn everything you need to know about the sitemap in to ensure proper content indexing.
Configure Magento 2 Blog Sitemap
Once you install the Magento 2 Blog Extension, the blog XML sitemap is generated automatically together with the regular . You don't have to do anything.
Note: in all blog versions before 2.11.0, a separate blog sitemap is generated. It is available via the same path as your Magento sitemap, but with the blog_ or pub/blog_ suffix, like in the https://domain.com/blog_sitemap.xml.
Configure Frequency and Priority of Indexing
If you use editions of the Blog extension you can change the priority and frequency of the blog items indexing in the XML sitemap.
To do this go to Stores > Configuration > Blogihor
- 2 min read
The sortOrder property for determines when to call them (before, after, or around a method), on condition more than one plugin is configured for the same method.
<config>
<type name="{ObservedType}">
<plugin name="{pluginName}" type="{PluginClassName}" sortOrder="1" disabled="false" />
</type>
</config>
Prioritizing rules are as follows:
Before executing the original method, Magento will run before plugins from the smallest to the biggest value in sortOrder.
The part of the plugin around code will also be executed from the smallest to the biggest value before calling the original method (callable).
The after plugin is called from the biggest to the smallest after calling the original method.
Example:
Suppose there are three plugin classes (Plugin10, Plugin20, Plugin30). Each plugin class has before, after and around methods for the same method. sortOrder looks as follows for each of them:
Plugin10 - 10Plugin20 - 20Plugin30 - 30
The plugins and theihor
- 1 min read
Once you have configured OG tags on our website you may want to test it. In order to validate Open Graph tags please take the following steps:
1. Visit official Facebook Sharing Debugger.
2. Enter the URL of the page you want to validate in a corresponding field.
3. Press the Debug button. Example:
You may be interested in:
✔
✔
✔
4. Once done you'll see the page validation result. In this way, you can make sure Open Graph tags were implemented correctly.
- 2 min read
Loading JS files is critical for page rendering. However, in a lot of cases, it causes speed issues and leads to low Google PageSpeed Insights stores. That's why you need to make sure to defer JavaScript in Magento and optimize it properly.
While you can spend lots of time optimizing the code, it's not worth it. Especially when tools like are there to help.
So, today we'll go through the process of deferring JS in Magento step by step. You'll basically need to enable a few options and let the module do the rest.
Ready to start?
But before we do, navigate to Stores > Configuration > Magefan Extensions > Rocket JavaScript and enable it.
Step 1: Minify and Merge JS Files
Here you need to choose whether to Minify and Merge JavaScript Files. Both options improve JS loading and optimize JS files in general.
Minification — the process of removing unnecessary data (blank lines, commend, delimiter, etc.) from JS files. This makes browsers to read them faster and return pages to customers fasterihor
- 1 min read
If for some reason you need to copy from one database (DB1) to another (DB2) (in fact Import Blog data from one Magento installation to another), please follow these steps:
1. Make sure that Magento 2 instance that uses DB2 has the same blog extension version as the one that uses DB1. If not, please update the Magento 2 Blog module on one of them.
2. Create a backup of magefan_blog_* tables in DB2.
3. Remove all magefan_blog_* tables from DB2.
4. Make export (dump) of all magefan_blog_* tables from DB1
5. Import DB1 dump to DB2.
Using this instruction, you'll easily migrate ALL blog data from DB1 to DB2. For database manipulations, you can use phpMyAdmin, Adminer.
