From fa9517b829a0a58afbcd502731f93308ef25cda3 Mon Sep 17 00:00:00 2001 From: Ihor Vansach Date: Mon, 16 Apr 2018 21:49:46 +0300 Subject: [PATCH 001/116] Code style changes + improvements --- Block/Adminhtml/System/Config/Form/Info.php | 39 +++----- Model/Controller/ResultPlugin.php | 28 +++--- .../Deploy/Package/Bundle/RequireJsPlugin.php | 89 +++++++++++++++---- composer.json | 6 +- etc/acl.xml | 2 +- etc/adminhtml/system.xml | 11 ++- etc/di.xml | 8 ++ etc/frontend/di.xml | 2 +- etc/module.xml | 8 +- registration.php | 2 +- 10 files changed, 122 insertions(+), 73 deletions(-) diff --git a/Block/Adminhtml/System/Config/Form/Info.php b/Block/Adminhtml/System/Config/Form/Info.php index 4377ab4..c2e2aae 100755 --- a/Block/Adminhtml/System/Config/Form/Info.php +++ b/Block/Adminhtml/System/Config/Form/Info.php @@ -1,6 +1,6 @@ moduleList = $moduleList; + protected function getModuleUrl() + { + return 'https://magefan.com/rocket-javascript-deferred-javascript?utm_source=m2admin_rocket_javascript_config&utm_medium=link&utm_campaign=regular'; } /** - * Return info block html - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element + * Return extension title * @return string */ - public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element) + protected function getModuleTitle() { - $m = $this->moduleList->getOne($this->getModuleName()); - $html = '
- Rocket JavaScript Extension v' . $m['setup_version'] . ' was developed by Magefan. -
'; - - return $html; + return 'Rocket JavaScript Extension'; } - } diff --git a/Model/Controller/ResultPlugin.php b/Model/Controller/ResultPlugin.php index 1e609b3..7896495 100644 --- a/Model/Controller/ResultPlugin.php +++ b/Model/Controller/ResultPlugin.php @@ -1,6 +1,6 @@ $js) { @@ -105,21 +105,21 @@ private function isEnabled() /* check if Plumrocket AMP enabled */ if ($enabled) { - $isAmpRequest = $this->scopeConfig->getValue( - 'pramp/general/enabled', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ); + $isAmpRequest = $this->scopeConfig->getValue( + 'pramp/general/enabled', + \Magento\Store\Model\ScopeInterface::SCOPE_STORE + ); - if ($isAmpRequest) { - /* We know that using objectManager is not a not a good practice, + if ($isAmpRequest) { + /* We know that using objectManager is not a not a good practice, but if Plumrocket_AMP is not installed on your magento instance you'll get error during di:compile */ - $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); - $isAmpRequest = $objectManager->get('\Plumrocket\Amp\Helper\Data') - ->isAmpRequest(); - } + $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); + $isAmpRequest = $objectManager->get('\Plumrocket\Amp\Helper\Data') + ->isAmpRequest(); + } - $enabled = !$isAmpRequest; + $enabled = !$isAmpRequest; } return $enabled; diff --git a/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php b/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php index c5946c3..7454978 100644 --- a/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php +++ b/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php @@ -1,35 +1,59 @@ scopeConfig = $scopeConfig; } - public function aroundAddFile(RequireJs $subject, callable $proceed, $filePath, $sourcePath, $contentType) { + /** + * Improve bundling + */ + public function aroundAddFile(RequireJs $subject, callable $proceed, $filePath, $sourcePath, $contentType) + { - $jsOptimization = $this->scopeConfig->getValue('mfrocketjavascript/general/enable_javaScript_bundling_optimization', \Magento\Store\Model\ScopeInterface::SCOPE_STORE); + $jsOptimization = $this->scopeConfig->getValue(self::BUNDLING_OPTIMIZATION_ENABLED, ScopeInterface::SCOPE_STORE); if ($jsOptimization) { - $includeInBundling = $this->scopeConfig->getValue('mfrocketjavascript/general/included_in_bundling', \Magento\Store\Model\ScopeInterface::SCOPE_STORE); - $allowedFiles = str_replace("\r","\n", $includeInBundling); - $allowedFiles = explode("\n", $allowedFiles); - - foreach ($allowedFiles as $key => $allowedFile) { - $allowedFiles[$key] = trim($allowedFile); - if (empty($allowedFiles[$key])) { - unset($allowedFiles[$key]); - } - } - - foreach ($allowedFiles as $allowed) { - $allowedFiles[] = str_replace('.min.js', '.js', $allowed); - } + $allowedFiles = $this->getAllowedFiles(); $include = false; foreach ($allowedFiles as $allowedFile) { @@ -42,8 +66,35 @@ public function aroundAddFile(RequireJs $subject, callable $proceed, $filePath, if (!$include) { return true; } - } return $proceed($filePath, $sourcePath, $contentType); } -} \ No newline at end of file + + public function getAllowedFiles() + { + if (null === $this->allowedFiles) { + $includeInBundling = $this->scopeConfig->getValue(self::INCLUDE_IN_BUNDLING, ScopeInterface::SCOPE_STORE); + $allowedFiles = str_replace("\r", "\n", $includeInBundling); + $allowedFiles = explode("\n", $allowedFiles); + + foreach ($allowedFiles as $key => $allowedFile) { + $allowedFiles[$key] = trim($allowedFile); + if (empty($allowedFiles[$key])) { + unset($allowedFiles[$key]); + } + } + + foreach ($allowedFiles as $allowed) { + if (false !== strpos($allowed, '.min.js')) { + $allowedFiles[] = str_replace('.min.js', '.js', $allowed); + } else { + $allowedFiles[] = str_replace('.js', '.min.js', $allowed); + } + } + + $this->allowedFiles = $allowedFiles; + } + + return $this->allowedFiles; + } +} diff --git a/composer.json b/composer.json index d8af9c0..36150b7 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,12 @@ { "name": "magefan/module-rocketjavascript", "description": "Move all javascripts to the footer on Magento 2 store.", + "require": { + "php": "~5.6.5 || >=7.0", + "magefan/module-community" : ">=2.0.1" + }, "type": "magento2-module", - "version": "2.0.0", + "version": "2.1.0", "license": "OSL-3.0", "authors": [ { diff --git a/etc/acl.xml b/etc/acl.xml index 6543e05..908a1b1 100644 --- a/etc/acl.xml +++ b/etc/acl.xml @@ -1,7 +1,7 @@ - - -
magefan @@ -27,15 +24,17 @@ If enabled all JavaScript on storefront will be moved to the end of the page. Magento\Config\Model\Config\Source\Yesno - + + Please note that this option only works with enabled JavaScript Bundling (Configuration > Advanced > Developer > JavaScript Settings > Enable JavaScript Bundling). Magento\Config\Model\Config\Source\Yesno - 1 + 1 + List of files that included in JS bundle.
diff --git a/etc/di.xml b/etc/di.xml index 7e9fdda..44501de 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -1,4 +1,12 @@ + - + + + + + diff --git a/registration.php b/registration.php index c6075b6..1a84be2 100644 --- a/registration.php +++ b/registration.php @@ -1,6 +1,6 @@ Date: Thu, 26 Apr 2018 14:02:54 +0300 Subject: [PATCH 002/116] Update README.md --- README.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 17eccf9..5b7ece2 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,9 @@ # [Magefan](http://magefan.com/) Rocket JavaScript Extension for Magento 2 -Move all javascripts to the footer. - ## Features * Rocket JavaScript module allows you to move all javascript tags to the footer of the storefront page on your [Magento 2](http://magento.com/) Store. - + * Optimize JavaScript Bundle + ## Configuration * To enable or disable extension please navigate to Magento 2 Admin Panel > Stores > Magefan Extensions > Rocket JavaScript @@ -14,10 +13,16 @@ Move all javascripts to the footer. ## Installation Method 1 - Installing via composer * Open command line * Using command "cd" navigate to your magento2 root directory - * Run command: composer require magefan/module-rocketjavascript - + * Run commands: +``` +composer require magefan/module-rocketjavascript +php bin/magento setup:upgrade +php bin/magento setup:di:compile +php bin/magento setup:static-content:deploy +``` ## Installation Method 2 - Installing using archive + * Install the [Magefan Community Extension](https://github.com/magefan/module-community) first * Download [ZIP Archive](https://github.com/magefan/module-rocketjavascript/archive/master.zip) * Extract files * In your Magento 2 root directory create folder app/code/Magefan/Blog @@ -38,10 +43,6 @@ then if you still need help, open a bug report in GitHub's Please do not use Magento Marketplace's Reviews or (especially) the Q&A for support. There isn't a way for us to reply to reviews and the Q&A moderation is very slow. -## Donate to us -All Magefan extension are absolutely free and licensed under the Open Software License version 3.0. We want to create more awesome features for you and bring up new releases as fast as we can. We hope for your support. -http://magefan.com/donate/ - ## License The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensource.org/licenses/osl-3.0.php). From e14f0594edb9edee684d00b998470a973fdedd48 Mon Sep 17 00:00:00 2001 From: Magefan Date: Wed, 25 Jul 2018 12:17:47 +0300 Subject: [PATCH 003/116] Update README.md --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 5b7ece2..2435fc3 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,18 @@ php bin/magento setup:di:compile php bin/magento setup:static-content:deploy ``` +## GET LIST OF USED JS +``` +/* Use in browser console */ +globalSrc = []; +jQuery('script').each(function(){ +if (!jQuery(this).attr('src')) return; +var src = (jQuery(this).attr('src').replace('PATH_TO_JS', '')); +globalSrc.push(src) +}) +console.log(JSON.stringify(globalSrc)); +``` + ## Support If you have any issues, please [contact us](mailto:support@magefan.com) then if you still need help, open a bug report in GitHub's From 35be42a816512861624e73fd3ce0fc418b663064 Mon Sep 17 00:00:00 2001 From: Magefan Date: Wed, 25 Jul 2018 12:18:09 +0300 Subject: [PATCH 004/116] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2435fc3..370226c 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ php bin/magento setup:di:compile php bin/magento setup:static-content:deploy ``` -## GET LIST OF USED JS +## Get List Of Used JS ``` /* Use in browser console */ globalSrc = []; From 368429a731b40ccfb59551b799cfeeed830a8df1 Mon Sep 17 00:00:00 2001 From: Magefan Date: Wed, 8 Aug 2018 11:21:39 +0300 Subject: [PATCH 005/116] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 370226c..20d79fb 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ php bin/magento setup:static-content:deploy ## Installation Method 2 - Installing using archive * Install the [Magefan Community Extension](https://github.com/magefan/module-community) first - * Download [ZIP Archive](https://github.com/magefan/module-rocketjavascript/archive/master.zip) + * Download [ZIP Archive](https://magefan.com/rocket-javascript-deferred-javascript) * Extract files * In your Magento 2 root directory create folder app/code/Magefan/Blog * Copy files and folders from archive to that folder @@ -64,5 +64,5 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Login As Customer Extension](https://magefan.com/login-as-customer-magento-2-extension) * [Magento 2 Conflict Detector Extension](https://magefan.com/magento2-conflict-detector) * [Magento 2 Lazy Load Extension](https://github.com/magefan/module-lazyload) - * [Magento 2 Rocket JavaScript Extension](https://github.com/magefan/module-rocketjavascript) - * [Magento 2 CLI Extension](https://github.com/magefan/module-cli) + * [Magento 2 Rocket JavaScript Extension](https://magefan.com/rocket-javascript-deferred-javascript) + * [Magento 2 CLI Extension](https://magefan.com/magento2-cli-extension) From b6aab0ac359fc124f1faf0f8ea546d1bb2fa4fb9 Mon Sep 17 00:00:00 2001 From: Magefan Date: Thu, 6 Sep 2018 17:00:55 +0300 Subject: [PATCH 006/116] Replace preg_match_all with mb_str functions Fixed issue with pcre.backtrack_limit error --- Model/Controller/ResultPlugin.php | 50 +++++++++++++++---------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/Model/Controller/ResultPlugin.php b/Model/Controller/ResultPlugin.php index 7896495..1e1494a 100644 --- a/Model/Controller/ResultPlugin.php +++ b/Model/Controller/ResultPlugin.php @@ -55,40 +55,38 @@ public function aroundRenderResult( ResponseHttp $response ) { $result = $proceed($response); - if (PHP_SAPI === 'cli' || $this->request->isXmlHttpRequest() || !$this->isEnabled()) { return $result; } $html = $response->getBody(); + $scripts = []; + + $startTag = ' '#(\s*)|(\s*)#isU', - ]; - - $jsHtml = []; - - foreach ($patterns as $pattern) { - $matches = []; - $success = preg_match_all($pattern, $html, $matches); - if ($success) { - foreach ($matches[0] as $i => $js) { - if (strpos($js, self::EXCLUDE_FLAG_PATTERN) !== false) { - unset($matches[0][$i]); - } else { - $jsHtml[] = $matches[0][$i]; - } - } - - $html = str_replace($matches[0], '', $html); + if (false !== mb_stripos($script, self::EXCLUDE_FLAG_PATTERN)) { + continue; } + + $html = str_replace($script, '', $html); + $scripts[] = $script; } - $jsHtml = implode($jsHtml); - if ($end = strrpos($html, '')) { - $html = substr($html, 0, $end) . $jsHtml . substr($html, $end); + $scripts = implode(PHP_EOL, $scripts); + if ($end = mb_stripos($html, '')) { + $html = mb_substr($html, 0, $end) . $scripts . substr($html, $end); } else { - $html .= $jsHtml; + $html .= $scripts; } $response->setBody($html); @@ -112,8 +110,8 @@ private function isEnabled() if ($isAmpRequest) { /* We know that using objectManager is not a not a good practice, - but if Plumrocket_AMP is not installed on your magento instance - you'll get error during di:compile */ + but if Plumrocket_AMP is not installed on your magento instance + you'll get error during di:compile */ $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $isAmpRequest = $objectManager->get('\Plumrocket\Amp\Helper\Data') ->isAmpRequest(); From ac42fd64e9aa187f24cfabeff39bff285990c819 Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 2 Oct 2018 11:42:53 +0300 Subject: [PATCH 007/116] replace mb_ with regular string functions --- Model/Controller/ResultPlugin.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Model/Controller/ResultPlugin.php b/Model/Controller/ResultPlugin.php index 1e1494a..7b2490d 100644 --- a/Model/Controller/ResultPlugin.php +++ b/Model/Controller/ResultPlugin.php @@ -65,16 +65,16 @@ public function aroundRenderResult( $startTag = '')) { - $html = mb_substr($html, 0, $end) . $scripts . substr($html, $end); + if ($end = stripos($html, '')) { + $html = substr($html, 0, $end) . $scripts . substr($html, $end); } else { $html .= $scripts; } From 7e01d651607628ddfb9430eb8df29e489d0fcf9f Mon Sep 17 00:00:00 2001 From: Magefan Date: Thu, 4 Oct 2018 15:39:10 +0300 Subject: [PATCH 008/116] Update composer.json --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 36150b7..6b62a13 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "magefan/module-community" : ">=2.0.1" }, "type": "magento2-module", - "version": "2.1.0", + "version": "2.1.1", "license": "OSL-3.0", "authors": [ { @@ -22,4 +22,4 @@ "Magefan\\RocketJavaScript\\": "" } } -} \ No newline at end of file +} From 2fcda674d3402a818e421d1348788f916effca94 Mon Sep 17 00:00:00 2001 From: Magefan Date: Thu, 4 Oct 2018 15:39:26 +0300 Subject: [PATCH 009/116] Update module.xml --- etc/module.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/module.xml b/etc/module.xml index e473fc2..534c5fc 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -8,7 +8,7 @@ */ --> - + From 20c78d68d52f108cfda5a82556dd9ed892689c88 Mon Sep 17 00:00:00 2001 From: Magefan Date: Fri, 5 Oct 2018 07:11:42 +0300 Subject: [PATCH 010/116] Fixed issue with the loop when data-rocketjavascript="false" in use --- Model/Controller/ResultPlugin.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Model/Controller/ResultPlugin.php b/Model/Controller/ResultPlugin.php index 7b2490d..e4bb193 100644 --- a/Model/Controller/ResultPlugin.php +++ b/Model/Controller/ResultPlugin.php @@ -65,7 +65,14 @@ public function aroundRenderResult( $startTag = ' 1000 ) { + return $result; + } + $end = stripos($html, $endTag, $start); if (false === $end) { break; From 8273d8d3567dd0001f7e8cb21033b223c551e8fb Mon Sep 17 00:00:00 2001 From: Magefan Date: Fri, 5 Oct 2018 07:11:55 +0300 Subject: [PATCH 011/116] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6b62a13..837a301 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "magefan/module-community" : ">=2.0.1" }, "type": "magento2-module", - "version": "2.1.1", + "version": "2.1.2", "license": "OSL-3.0", "authors": [ { From be1d174475e5822379921b9633ce4196ce81307a Mon Sep 17 00:00:00 2001 From: Magefan Date: Fri, 5 Oct 2018 07:12:09 +0300 Subject: [PATCH 012/116] Update module.xml --- etc/module.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/module.xml b/etc/module.xml index 534c5fc..238bcf6 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -8,7 +8,7 @@ */ --> - + From 9683a0dac3eb2d5eb62581d025c81b59595b6344 Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 9 Oct 2018 11:50:46 +0300 Subject: [PATCH 013/116] Fixed issue when scripts is next to the other --- Model/Controller/ResultPlugin.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Model/Controller/ResultPlugin.php b/Model/Controller/ResultPlugin.php index e4bb193..66fc1d5 100644 --- a/Model/Controller/ResultPlugin.php +++ b/Model/Controller/ResultPlugin.php @@ -65,9 +65,9 @@ public function aroundRenderResult( $startTag = ' 1000 ) { return $result; @@ -82,6 +82,7 @@ public function aroundRenderResult( $script = substr($html, $start, $len); if (false !== stripos($script, self::EXCLUDE_FLAG_PATTERN)) { + $start++; continue; } From fdb56788fb02bfe8ca1725df27a219cdcab94d65 Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 9 Oct 2018 11:58:30 +0300 Subject: [PATCH 014/116] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 837a301..4e3fe7d 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "magefan/module-community" : ">=2.0.1" }, "type": "magento2-module", - "version": "2.1.2", + "version": "2.1.3", "license": "OSL-3.0", "authors": [ { From dc29f655ecec8b3a99494199e4118406d874da7e Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 9 Oct 2018 11:58:45 +0300 Subject: [PATCH 015/116] Update module.xml --- etc/module.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/module.xml b/etc/module.xml index 238bcf6..770efd1 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -8,7 +8,7 @@ */ --> - + From 61eb97d3fbb34cf115639ff52f6e52c58a08b96a Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 11 Dec 2018 09:59:11 +0200 Subject: [PATCH 016/116] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 20d79fb..c09c019 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # [Magefan](http://magefan.com/) Rocket JavaScript Extension for Magento 2 +[![Total Downloads](https://poser.pugx.org/magefan/module-rocketjavascript/downloads)](https://packagist.org/packages/magefan/module-rocketjavascript) +[![Latest Stable Version](https://poser.pugx.org/magefan/module-rocketjavascript/v/stable)](https://packagist.org/packages/magefan/module-rocketjavascript) + ## Features * Rocket JavaScript module allows you to move all javascript tags to the footer of the storefront page on your [Magento 2](http://magento.com/) Store. * Optimize JavaScript Bundle From 0f26cc15de954d5dca36d15499940a2f4b696f71 Mon Sep 17 00:00:00 2001 From: Magefan Date: Fri, 14 Dec 2018 16:47:23 +0200 Subject: [PATCH 017/116] Update README.md --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c09c019..916f52a 100644 --- a/README.md +++ b/README.md @@ -41,13 +41,17 @@ php bin/magento setup:static-content:deploy ## Get List Of Used JS ``` /* Use in browser console */ -globalSrc = []; +globalSrc = ''; jQuery('script').each(function(){ if (!jQuery(this).attr('src')) return; -var src = (jQuery(this).attr('src').replace('PATH_TO_JS', '')); -globalSrc.push(src) +var src = jQuery(this).attr('src'); +if (src.indexOf('https://' + window.location.hostname) != -1 || src.indexOf('http://' + window.location.hostname) != -1) { +var src = (src.replace(PATH_TO_JS, '')); +globalSrc += "\n" + src; +} }) -console.log(JSON.stringify(globalSrc)); +console.log(globalSrc); + ``` ## Support From 713b33b66f673b4415de32a1c74bd346204fc86c Mon Sep 17 00:00:00 2001 From: Magefan Date: Mon, 25 Feb 2019 07:27:03 +0200 Subject: [PATCH 018/116] Update composer.json --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 4e3fe7d..b6669b4 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,6 @@ "name": "magefan/module-rocketjavascript", "description": "Move all javascripts to the footer on Magento 2 store.", "require": { - "php": "~5.6.5 || >=7.0", "magefan/module-community" : ">=2.0.1" }, "type": "magento2-module", From 5d6531fee63780f0cf21395b3b0590abc0d3de3b Mon Sep 17 00:00:00 2001 From: Magefan Date: Mon, 25 Feb 2019 07:27:19 +0200 Subject: [PATCH 019/116] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b6669b4..50d7f89 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magefan/module-rocketjavascript", "description": "Move all javascripts to the footer on Magento 2 store.", "require": { - "magefan/module-community" : ">=2.0.1" + "magefan/module-community" : ">=2.0.4" }, "type": "magento2-module", "version": "2.1.3", From 8dc99a45808a2f8a68567f4c4fb407d3813404b1 Mon Sep 17 00:00:00 2001 From: Magefan Date: Fri, 5 Apr 2019 17:30:19 +0300 Subject: [PATCH 020/116] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 916f52a..e968924 100644 --- a/README.md +++ b/README.md @@ -38,9 +38,12 @@ php bin/magento setup:di:compile php bin/magento setup:static-content:deploy ``` -## Get List Of Used JS +## Get List Of Used JS On A Sigle Page ``` /* Use in browser console */ +/* Replace PATH_TO_JS with a string of static content URL including language. E.g. +'https://domain.com/pub/static/version1549034518/frontend/Magento/luma/en_US/' +*/ globalSrc = ''; jQuery('script').each(function(){ if (!jQuery(this).attr('src')) return; From f7c17a81e7c5bb2e2c263c30500d40cbda0819ee Mon Sep 17 00:00:00 2001 From: Magefan Date: Fri, 5 Apr 2019 17:35:29 +0300 Subject: [PATCH 021/116] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index e968924..afbedf3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # [Magefan](http://magefan.com/) Rocket JavaScript Extension for Magento 2 +# Magento2 Footer JavaScript +# Magento2 Deferred JavaScript +# Magento2 Optimized Bundle JavaScript + [![Total Downloads](https://poser.pugx.org/magefan/module-rocketjavascript/downloads)](https://packagist.org/packages/magefan/module-rocketjavascript) [![Latest Stable Version](https://poser.pugx.org/magefan/module-rocketjavascript/v/stable)](https://packagist.org/packages/magefan/module-rocketjavascript) From f6d7b4dfce1ca7985a84d81e6b863fac1adb8bd1 Mon Sep 17 00:00:00 2001 From: Magefan Date: Fri, 5 Apr 2019 17:35:52 +0300 Subject: [PATCH 022/116] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index afbedf3..07645a5 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # [Magefan](http://magefan.com/) Rocket JavaScript Extension for Magento 2 -# Magento2 Footer JavaScript -# Magento2 Deferred JavaScript -# Magento2 Optimized Bundle JavaScript +## Magento2 Footer JavaScript +## Magento2 Deferred JavaScript +## Magento2 Optimized Bundle JavaScript [![Total Downloads](https://poser.pugx.org/magefan/module-rocketjavascript/downloads)](https://packagist.org/packages/magefan/module-rocketjavascript) [![Latest Stable Version](https://poser.pugx.org/magefan/module-rocketjavascript/v/stable)](https://packagist.org/packages/magefan/module-rocketjavascript) From 68c238129fa9273cb29c9aa8df01629f88136c01 Mon Sep 17 00:00:00 2001 From: Magefan Date: Fri, 5 Apr 2019 17:40:04 +0300 Subject: [PATCH 023/116] Update README.md --- README.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 07645a5..eb9fe6a 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,11 @@ -# [Magefan](http://magefan.com/) Rocket JavaScript Extension for Magento 2 - -## Magento2 Footer JavaScript -## Magento2 Deferred JavaScript -## Magento2 Optimized Bundle JavaScript +# [Magefan](https://magefan.com/) [Rocket JavaScript Extension for Magento 2](https://magefan.com/rocket-javascript-deferred-javascript) [![Total Downloads](https://poser.pugx.org/magefan/module-rocketjavascript/downloads)](https://packagist.org/packages/magefan/module-rocketjavascript) [![Latest Stable Version](https://poser.pugx.org/magefan/module-rocketjavascript/v/stable)](https://packagist.org/packages/magefan/module-rocketjavascript) -## Features - * Rocket JavaScript module allows you to move all javascript tags to the footer of the storefront page on your [Magento 2](http://magento.com/) Store. - * Optimize JavaScript Bundle +## Magento2 Footer JavaScript +## Magento2 Deferred JavaScript +## Magento2 Optimized Bundle JavaScript ## Configuration * To enable or disable extension please navigate to Magento 2 Admin Panel > Stores > Magefan Extensions > Rocket JavaScript From 3427c086ff849ab14283ae1c7cd4fcf5b85802ec Mon Sep 17 00:00:00 2001 From: Magefan Date: Thu, 30 May 2019 20:34:00 +0300 Subject: [PATCH 024/116] Update README.md --- README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index eb9fe6a..d09f9fb 100644 --- a/README.md +++ b/README.md @@ -68,11 +68,19 @@ There isn't a way for us to reply to reviews and the Q&A moderation is very slow ## License The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensource.org/licenses/osl-3.0.php). -## Other Magefan Extensions That Can Be Installed Via Composer - * [Magento 2 Auto Currency Switcher Extension](https://magefan.com/magento-2-currency-switcher-auto-currency-by-country) +## Other Magento 2 Extensions by Magefan * [Magento 2 Blog Extension](https://magefan.com/magento2-blog-extension) + * [Magento 2 Blog Plus Extension](https://magefan.com/magento2-blog-extension/pricing) + * [Magento 2 Blog Extra Extension](https://magefan.com/magento2-blog-extension/pricing) * [Magento 2 Login As Customer Extension](https://magefan.com/login-as-customer-magento-2-extension) + * [Magento 2 Convert Guest to Customer Extension](https://magefan.com/magento2-convert-guest-to-customer) + * [Magento 2 Facebook Open Graph Extension](https://magefan.com/magento-2-open-graph-extension-og-tags) + * [Magento 2 Auto Currency Switcher Extension](https://magefan.com/magento-2-currency-switcher-auto-currency-by-country) + * [Magento 2 Auto Language Switcher Extension](https://magefan.com/magento-2-auto-language-switcher) + * [Magento 2 GeoIP Switcher Extension](https://magefan.com/magento-2-geoip-switcher-extension) + * [Magento 2 YouTube Widget Extension](https://magefan.com/magento2-youtube-extension) + * [Magento 2 Product Widget Advanced Extension](https://magefan.com/magento-2-product-widget) * [Magento 2 Conflict Detector Extension](https://magefan.com/magento2-conflict-detector) - * [Magento 2 Lazy Load Extension](https://github.com/magefan/module-lazyload) + * [Magento 2 Lazy Load Extension](https://magefan.com/magento-2-image-lazy-load-extension) * [Magento 2 Rocket JavaScript Extension](https://magefan.com/rocket-javascript-deferred-javascript) * [Magento 2 CLI Extension](https://magefan.com/magento2-cli-extension) From f4723fbff625bb217768a2f811161ad297f2b6fb Mon Sep 17 00:00:00 2001 From: Magefan Date: Sun, 21 Jul 2019 14:20:00 +0300 Subject: [PATCH 025/116] Update README.md --- README.md | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index d09f9fb..f57a770 100644 --- a/README.md +++ b/README.md @@ -12,31 +12,9 @@ ## Requirements * Magento Community Edition 2.1.x-2.2.x or Magento Enterprise Edition 2.1.x-2.2.x - -## Installation Method 1 - Installing via composer - * Open command line - * Using command "cd" navigate to your magento2 root directory - * Run commands: -``` -composer require magefan/module-rocketjavascript -php bin/magento setup:upgrade -php bin/magento setup:di:compile -php bin/magento setup:static-content:deploy -``` - -## Installation Method 2 - Installing using archive - * Install the [Magefan Community Extension](https://github.com/magefan/module-community) first - * Download [ZIP Archive](https://magefan.com/rocket-javascript-deferred-javascript) - * Extract files - * In your Magento 2 root directory create folder app/code/Magefan/Blog - * Copy files and folders from archive to that folder - * In command line, using "cd", navigate to your Magento 2 root directory - * Run commands: -``` -php bin/magento setup:upgrade -php bin/magento setup:di:compile -php bin/magento setup:static-content:deploy -``` + +## Installation +* [Install Rocket JavaScript Extension for Magento 2 via Composer or anarchive](https://magefan.com/blog/rocket-javascript-installation) ## Get List Of Used JS On A Sigle Page ``` From 1850a60ea4dc4622e072d29f08bf4f24107f374b Mon Sep 17 00:00:00 2001 From: Magefan Date: Thu, 8 Aug 2019 19:21:01 +0300 Subject: [PATCH 026/116] Changed default settings for included_in_bundling --- etc/config.xml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/etc/config.xml b/etc/config.xml index 181675f..49c061e 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -194,7 +194,32 @@ fancybox/js/jquery.fancybox.min.js Magento_Catalog/js/jquery.zoom.min.js Magento_ProductVideo/js/load-player.min.js Magento_Catalog/js/product/storage/ids-storage.min.js -Mirasvit_SearchAutocomplete/js/navigation.min.js +Mirasvit_SearchAutocomplete/js/navigation.min.js + +mage/dropdowns.min.js +mage/menu.min.js +Magento_Catalog/js/validate-product.min.js +Magento_Swatches/js/swatch-renderer.min.js +Magento_Swatches/js/configurable-customer-data.min.js +mage/gallery/gallery.min.js +Magento_InstantPurchase/js/view/instant-purchase.min.js +Magento_Customer/js/view/authentication-popup.min.js +jquery/jquery.parsequery.min.js +Magento_ConfigurableProduct/js/options-updater.min.js + +Magento_Ui/templates/modal/modal-popup.html +Magento_Ui/templates/modal/modal-slide.html +Magento_Ui/templates/modal/modal-custom.html +Magento_Ui/templates/tooltip/tooltip.html +mage/gallery/gallery.html +Magento_Ui/templates/block-loader.html +Magento_InstantPurchase/template/confirmation.html +Magento_Checkout/template/minicart/content.html +Magento_InstantPurchase/template/instant-purchase.html +Magento_Customer/template/authentication-popup.html +Magento_Ui/templates/collection.html +Magento_Ui/template/messages.html +Magento_Captcha/template/checkout/captcha.html From 2ac7840650d2cb4ae74d2fd54e532589dafd1105 Mon Sep 17 00:00:00 2001 From: Magefan Date: Mon, 7 Oct 2019 17:40:01 +0300 Subject: [PATCH 027/116] Update ResultPlugin.php --- Model/Controller/ResultPlugin.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Model/Controller/ResultPlugin.php b/Model/Controller/ResultPlugin.php index 66fc1d5..be7a008 100644 --- a/Model/Controller/ResultPlugin.php +++ b/Model/Controller/ResultPlugin.php @@ -69,7 +69,7 @@ public function aroundRenderResult( $i = 0; while (false !== ($start = stripos($html, $startTag, $start))) { $i++; - if ($i > 1000 ) { + if ($i > 1000) { return $result; } @@ -91,7 +91,8 @@ public function aroundRenderResult( } $scripts = implode(PHP_EOL, $scripts); - if ($end = stripos($html, '')) { + $end = stripos($html, ''); + if ($end !== false) { $html = substr($html, 0, $end) . $scripts . substr($html, $end); } else { $html .= $scripts; From 054eae1e305d8e754c09add2266f88b8fcfe7333 Mon Sep 17 00:00:00 2001 From: Magefan Date: Fri, 11 Oct 2019 11:24:55 +0300 Subject: [PATCH 028/116] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index f57a770..c4708ce 100644 --- a/README.md +++ b/README.md @@ -62,3 +62,7 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Lazy Load Extension](https://magefan.com/magento-2-image-lazy-load-extension) * [Magento 2 Rocket JavaScript Extension](https://magefan.com/rocket-javascript-deferred-javascript) * [Magento 2 CLI Extension](https://magefan.com/magento2-cli-extension) + * [Magento Twitter Cards Extension](https://magefan.com/magento-2-twitter-cards-extension) + * [Magento 2 Mautic Integration Extension](https://magefan.com/magento-2-mautic-extension) + * [Magento 2 Alternate Hreflang Extension](https://magefan.com/magento2-alternate-hreflang-extension) + From 28f175d302b520331b5535e05fa95fa24d8980ec Mon Sep 17 00:00:00 2001 From: Magefan Date: Sun, 17 Nov 2019 00:14:52 +0200 Subject: [PATCH 029/116] Update README.md --- README.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c4708ce..e630c28 100644 --- a/README.md +++ b/README.md @@ -19,15 +19,12 @@ ## Get List Of Used JS On A Sigle Page ``` /* Use in browser console */ -/* Replace PATH_TO_JS with a string of static content URL including language. E.g. -'https://domain.com/pub/static/version1549034518/frontend/Magento/luma/en_US/' -*/ globalSrc = ''; jQuery('script').each(function(){ if (!jQuery(this).attr('src')) return; var src = jQuery(this).attr('src'); -if (src.indexOf('https://' + window.location.hostname) != -1 || src.indexOf('http://' + window.location.hostname) != -1) { -var src = (src.replace(PATH_TO_JS, '')); +if (src.indexOf(require.toUrl('')) != -1) { +var src = (src.replace(require.toUrl(''), '')); globalSrc += "\n" + src; } }) From 12d8e10f47a1b9e8a82427275566f9a2e800508c Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 19 Nov 2019 15:20:22 +0200 Subject: [PATCH 030/116] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e630c28..a663136 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ There isn't a way for us to reply to reviews and the Q&A moderation is very slow ## License The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensource.org/licenses/osl-3.0.php). -## Other Magento 2 Extensions by Magefan +## Other [Magento 2 Extensions](https://magefan.com/magento2-extensions) by Magefan * [Magento 2 Blog Extension](https://magefan.com/magento2-blog-extension) * [Magento 2 Blog Plus Extension](https://magefan.com/magento2-blog-extension/pricing) * [Magento 2 Blog Extra Extension](https://magefan.com/magento2-blog-extension/pricing) From f18aaaa3395450e7b9746ff0bba9307ba4b3678b Mon Sep 17 00:00:00 2001 From: Magefan Date: Thu, 9 Jan 2020 09:18:49 +0200 Subject: [PATCH 031/116] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a663136..1b55bd5 100644 --- a/README.md +++ b/README.md @@ -62,4 +62,5 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento Twitter Cards Extension](https://magefan.com/magento-2-twitter-cards-extension) * [Magento 2 Mautic Integration Extension](https://magefan.com/magento-2-mautic-extension) * [Magento 2 Alternate Hreflang Extension](https://magefan.com/magento2-alternate-hreflang-extension) + * [Magento 2 Dynamic Categories](https://magefan.com/magento-2-dynamic-categories) From d87430a94597e02664834774caadeadb65e047bc Mon Sep 17 00:00:00 2001 From: Ihor Vansach Date: Mon, 13 Jan 2020 16:31:43 +0200 Subject: [PATCH 032/116] Changed OSL to EULA --- Block/Adminhtml/System/Config/Form/Info.php | 2 +- LICENSE.txt | 46 +------------------ Model/Controller/ResultPlugin.php | 5 +- .../Deploy/Package/Bundle/RequireJsPlugin.php | 5 +- composer.json | 5 +- etc/acl.xml | 2 +- etc/adminhtml/system.xml | 10 +++- etc/config.xml | 4 +- etc/di.xml | 2 +- etc/frontend/di.xml | 2 +- etc/module.xml | 4 +- registration.php | 2 +- 12 files changed, 29 insertions(+), 60 deletions(-) diff --git a/Block/Adminhtml/System/Config/Form/Info.php b/Block/Adminhtml/System/Config/Form/Info.php index c2e2aae..dcb5c84 100755 --- a/Block/Adminhtml/System/Config/Form/Info.php +++ b/Block/Adminhtml/System/Config/Form/Info.php @@ -1,7 +1,7 @@ " or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process. \ No newline at end of file +Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement) \ No newline at end of file diff --git a/Model/Controller/ResultPlugin.php b/Model/Controller/ResultPlugin.php index be7a008..8d30236 100644 --- a/Model/Controller/ResultPlugin.php +++ b/Model/Controller/ResultPlugin.php @@ -1,7 +1,7 @@ scopeConfig->getValue( 'mfrocketjavascript/general/enabled', \Magento\Store\Model\ScopeInterface::SCOPE_STORE + ) && $this->scopeConfig->getValue( + 'mfrocketjavascript/general/enable_deferred_javascript', + \Magento\Store\Model\ScopeInterface::SCOPE_STORE ); /* check if Plumrocket AMP enabled */ diff --git a/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php b/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php index 7454978..042cf5d 100644 --- a/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php +++ b/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php @@ -1,7 +1,7 @@ scopeConfig->getValue(self::BUNDLING_OPTIMIZATION_ENABLED, ScopeInterface::SCOPE_STORE); + $jsOptimization = $this->scopeConfig->getValue(self::BUNDLING_OPTIMIZATION_ENABLED, ScopeInterface::SCOPE_STORE) + && $this->scopeConfig->getValue('mfrocketjavascript/general/enabled', ScopeInterface::SCOPE_STORE); if ($jsOptimization) { $allowedFiles = $this->getAllowedFiles(); diff --git a/composer.json b/composer.json index 50d7f89..16b7b16 100644 --- a/composer.json +++ b/composer.json @@ -2,11 +2,10 @@ "name": "magefan/module-rocketjavascript", "description": "Move all javascripts to the footer on Magento 2 store.", "require": { - "magefan/module-community" : ">=2.0.4" + "magefan/module-community" : ">=2.0.10" }, "type": "magento2-module", - "version": "2.1.3", - "license": "OSL-3.0", + "version": "2.1.4", "authors": [ { "name": "Magefan", diff --git a/etc/acl.xml b/etc/acl.xml index 908a1b1..8dc3afa 100644 --- a/etc/acl.xml +++ b/etc/acl.xml @@ -2,7 +2,7 @@ - + diff --git a/registration.php b/registration.php index 1a84be2..8a741fa 100644 --- a/registration.php +++ b/registration.php @@ -1,7 +1,7 @@ Date: Fri, 24 Jan 2020 09:15:30 +0200 Subject: [PATCH 033/116] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1b55bd5..c459abd 100644 --- a/README.md +++ b/README.md @@ -63,4 +63,6 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Mautic Integration Extension](https://magefan.com/magento-2-mautic-extension) * [Magento 2 Alternate Hreflang Extension](https://magefan.com/magento2-alternate-hreflang-extension) * [Magento 2 Dynamic Categories](https://magefan.com/magento-2-dynamic-categories) + * [Magento 2 CMS Display Rules Extension](https://magefan.com/magento-2-cms-display-rules-extension) + * [Magento 2 Zero Downtime Deployment](https://magefan.com/blog/magento-2-zero-downtime-deployment) From 5c2bed9ef9702e98162fff5855536ba51dcd8648 Mon Sep 17 00:00:00 2001 From: Magefan Date: Fri, 14 Feb 2020 10:05:01 +0200 Subject: [PATCH 034/116] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c459abd..a7a0e45 100644 --- a/README.md +++ b/README.md @@ -64,5 +64,7 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Alternate Hreflang Extension](https://magefan.com/magento2-alternate-hreflang-extension) * [Magento 2 Dynamic Categories](https://magefan.com/magento-2-dynamic-categories) * [Magento 2 CMS Display Rules Extension](https://magefan.com/magento-2-cms-display-rules-extension) + * [Magento 2 Translation Extension](https://magefan.com/magento-2-translation-extension) + * [Magento 2 WebP Optimized Images Extension](https://magefan.com/magento-2-webp-optimized-images) * [Magento 2 Zero Downtime Deployment](https://magefan.com/blog/magento-2-zero-downtime-deployment) From 40c387a1e15df3e5a25c11b735931439e78aa4a4 Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 7 Apr 2020 14:29:03 +0300 Subject: [PATCH 035/116] Update system.xml --- etc/adminhtml/system.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index c6d97a0..86bc239 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -10,7 +10,7 @@
- + magefan Magefan_RocketJavaScript::config_magefan_rocketjavascript From 9b7650303109a6f9ebfe129e6d1faa95cdeb9a52 Mon Sep 17 00:00:00 2001 From: Yura Date: Wed, 13 May 2020 16:36:01 +0300 Subject: [PATCH 036/116] 3753-disallowed-pages-for-deferred --- Model/Controller/ResultPlugin.php | 96 ++++++++++++++++++++++++++++++- etc/adminhtml/system.xml | 7 +++ etc/config.xml | 3 + 3 files changed, 105 insertions(+), 1 deletion(-) diff --git a/Model/Controller/ResultPlugin.php b/Model/Controller/ResultPlugin.php index 8d30236..cf5bf71 100644 --- a/Model/Controller/ResultPlugin.php +++ b/Model/Controller/ResultPlugin.php @@ -9,6 +9,7 @@ namespace Magefan\RocketJavaScript\Model\Controller; use Magento\Framework\App\Response\Http as ResponseHttp; +use Magento\Store\Model\ScopeInterface; /** * Plugin for processing relocation of javascript @@ -30,16 +31,33 @@ class ResultPlugin */ protected $scopeConfig; + /** + * @var bool + */ + protected $allowedOnPage; + + /** + * @var \Magento\Store\Model\StoreManagerInterface + */ + protected $storeManager; + /** * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Store\Model\StoreManagerInterface|null $storeManager */ public function __construct( \Magento\Framework\App\RequestInterface $request, - \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Store\Model\StoreManagerInterface $storeManager = null ) { $this->request = $request; $this->scopeConfig = $scopeConfig; + + $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); + $this->storeManager = $storeManager ?: $objectManager->get( + \Magento\Store\Model\StoreManagerInterface::class + ); } /** @@ -59,6 +77,10 @@ public function aroundRenderResult( return $result; } + if (!$this->isAllowedOnPage()) { + return $result; + } + $html = $response->getBody(); $scripts = []; @@ -134,4 +156,76 @@ private function isEnabled() return $enabled; } + + /** + * @return bool + */ + private function isAllowedOnPage() + { + if (null !== $this->allowedOnPage) { + return $this->allowedOnPage; + } + $this->allowedOnPage = false; + + $spPages = $this->scopeConfig->getValue( + 'mfrocketjavascript/general/disallowed_pages_for_deferred_js', + \Magento\Store\Model\ScopeInterface::SCOPE_STORE + ); + $spPages = explode("\n", str_replace("\r", "\n", $spPages)); + + foreach ($spPages as $key => $path) { + $spPages[$key] = trim($spPages[$key]); + if (empty($spPages[$key])) { + unset($spPages[$key]); + } + } + $baseUrl = trim($this->storeManager->getStore()->getBaseUrl(), '/'); + $baseUrl = str_replace('/index.php', '', $baseUrl); + + $currentUrl = $this->storeManager->getStore()->getCurrentUrl(); + $currentUrl = explode('?', $currentUrl); + $currentUrl = trim($currentUrl[0], '/'); + foreach (['index.php', '.php', '.html'] as $end) { + $el = mb_strlen($end); + $cl = mb_strlen($currentUrl); + if (mb_strrpos($currentUrl, $end) == $cl - $el) { + $currentUrl = mb_substr($currentUrl, 0, $cl - $el); + } + } + $currentUrl = str_replace('/index.php', '', $currentUrl); + $currentUrl = trim($currentUrl, '/'); + foreach ($spPages as $key => $path) { + $path = trim($path, '/'); + + if (mb_strlen($path)) { + if ('*' == $path{0}) { + $subPath = trim($path, '*/'); + if (mb_strlen($currentUrl) - mb_strlen($subPath) === mb_strrpos($currentUrl, $subPath)) { + $this->allowedOnPage = true; + break; + } + } + + if ('*' == $path{mb_strlen($path) - 1}) { + if (0 === mb_strpos($currentUrl, $baseUrl . '/' . trim($path, '*/'))) { + $this->allowedOnPage = true; + break; + } + } + if ($currentUrl == $baseUrl . '/' . trim($path, '/')) { + $this->allowedOnPage = true; + break; + } + } else { + //homepage + + if ($currentUrl == $baseUrl) { + $this->allowedOnPage = true; + break; + } + } + } + + return $this->allowedOnPage = !$this->allowedOnPage; + } } diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 86bc239..b6be563 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -32,6 +32,13 @@ If enabled all JavaScript on storefront will be moved to the end of the page. Magento\Config\Model\Config\Source\Yesno + + + + 1 + + Enter page patches each in a new line. "*" means any path, you can use it at the beginning or end. + Please note that this option only works with enabled JavaScript Bundling (Configuration > Advanced > Developer > JavaScript Settings > Enable JavaScript Bundling). diff --git a/etc/config.xml b/etc/config.xml index f4e4b07..c48c938 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -11,6 +11,9 @@ + checkout/* +onestepcheckout/* + jquery/jquery.mobile.custom.min.js mage/dataPost.min.js mage/bootstrap.min.js From 912eea65d085bdbb5fb23e909bdd839aa0fdf6ba Mon Sep 17 00:00:00 2001 From: yuriyhamulevych <48569882+yuriyhamulevych@users.noreply.github.com> Date: Wed, 13 May 2020 16:41:19 +0300 Subject: [PATCH 037/116] Update ResultPlugin.php --- Model/Controller/ResultPlugin.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Model/Controller/ResultPlugin.php b/Model/Controller/ResultPlugin.php index cf5bf71..5e15dd7 100644 --- a/Model/Controller/ResultPlugin.php +++ b/Model/Controller/ResultPlugin.php @@ -9,7 +9,6 @@ namespace Magefan\RocketJavaScript\Model\Controller; use Magento\Framework\App\Response\Http as ResponseHttp; -use Magento\Store\Model\ScopeInterface; /** * Plugin for processing relocation of javascript From 2d0ecc7de4d15f20e383106ffb087220101e0cbf Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 26 May 2020 13:56:52 +0300 Subject: [PATCH 038/116] Update composer.json --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 16b7b16..b79f970 100644 --- a/composer.json +++ b/composer.json @@ -2,10 +2,10 @@ "name": "magefan/module-rocketjavascript", "description": "Move all javascripts to the footer on Magento 2 store.", "require": { - "magefan/module-community" : ">=2.0.10" + "magefan/module-community" : ">=2.0.12" }, "type": "magento2-module", - "version": "2.1.4", + "version": "2.1.5", "authors": [ { "name": "Magefan", From 84c7adf7022489c6408d5b58af73af7a3e530d09 Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 26 May 2020 13:57:05 +0300 Subject: [PATCH 039/116] Update module.xml --- etc/module.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/module.xml b/etc/module.xml index ef3fae6..0b60adf 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -8,7 +8,7 @@ */ --> - + From 195a81a178ec2cd227380621464a7e3d48cb9641 Mon Sep 17 00:00:00 2001 From: Magefan Date: Wed, 27 May 2020 11:06:47 +0300 Subject: [PATCH 040/116] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a7a0e45..269a408 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ globalSrc = ''; jQuery('script').each(function(){ if (!jQuery(this).attr('src')) return; var src = jQuery(this).attr('src'); -if (src.indexOf(require.toUrl('')) != -1) { +if (src.indexOf(require.toUrl('')) != -1 && src.indexOf('Magefan_LazyLoad') == -1) { var src = (src.replace(require.toUrl(''), '')); globalSrc += "\n" + src; } From 1f3a7e7748b24d8dff08efbd9ee9a1838722285f Mon Sep 17 00:00:00 2001 From: Magefan Date: Mon, 6 Jul 2020 11:59:01 +0300 Subject: [PATCH 041/116] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 269a408..832ce7a 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ * To enable or disable extension please navigate to Magento 2 Admin Panel > Stores > Magefan Extensions > Rocket JavaScript ## Requirements - * Magento Community Edition 2.1.x-2.2.x or Magento Enterprise Edition 2.1.x-2.2.x + * Magento Community Edition 2.1.x-2.3.x or Magento Enterprise Edition 2.1.x-2.3.x ## Installation * [Install Rocket JavaScript Extension for Magento 2 via Composer or anarchive](https://magefan.com/blog/rocket-javascript-installation) From 8fd2e5a641c779f67a0796dd3f0007a0b41c0d3b Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 7 Jul 2020 14:59:26 +0300 Subject: [PATCH 042/116] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 832ce7a..15208e7 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Blog Extension](https://magefan.com/magento2-blog-extension) * [Magento 2 Blog Plus Extension](https://magefan.com/magento2-blog-extension/pricing) * [Magento 2 Blog Extra Extension](https://magefan.com/magento2-blog-extension/pricing) + * [Magento 2 Multi Blog Extension](https://magefan.com/magento-2-multi-blog-extension) * [Magento 2 Login As Customer Extension](https://magefan.com/login-as-customer-magento-2-extension) * [Magento 2 Convert Guest to Customer Extension](https://magefan.com/magento2-convert-guest-to-customer) * [Magento 2 Facebook Open Graph Extension](https://magefan.com/magento-2-open-graph-extension-og-tags) @@ -57,7 +58,6 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Product Widget Advanced Extension](https://magefan.com/magento-2-product-widget) * [Magento 2 Conflict Detector Extension](https://magefan.com/magento2-conflict-detector) * [Magento 2 Lazy Load Extension](https://magefan.com/magento-2-image-lazy-load-extension) - * [Magento 2 Rocket JavaScript Extension](https://magefan.com/rocket-javascript-deferred-javascript) * [Magento 2 CLI Extension](https://magefan.com/magento2-cli-extension) * [Magento Twitter Cards Extension](https://magefan.com/magento-2-twitter-cards-extension) * [Magento 2 Mautic Integration Extension](https://magefan.com/magento-2-mautic-extension) @@ -66,5 +66,6 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 CMS Display Rules Extension](https://magefan.com/magento-2-cms-display-rules-extension) * [Magento 2 Translation Extension](https://magefan.com/magento-2-translation-extension) * [Magento 2 WebP Optimized Images Extension](https://magefan.com/magento-2-webp-optimized-images) + * [Magento 2 Image Optimization Extension](https://magefan.com/magento-2-image-optimization-extension) * [Magento 2 Zero Downtime Deployment](https://magefan.com/blog/magento-2-zero-downtime-deployment) From 7ad0c0fd86bc776ecb3cabe0789e8a071d08c6cd Mon Sep 17 00:00:00 2001 From: Magefan Date: Mon, 3 Aug 2020 13:43:31 +0300 Subject: [PATCH 043/116] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 15208e7..6e8ef21 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ * To enable or disable extension please navigate to Magento 2 Admin Panel > Stores > Magefan Extensions > Rocket JavaScript ## Requirements - * Magento Community Edition 2.1.x-2.3.x or Magento Enterprise Edition 2.1.x-2.3.x + * Magento Community Edition 2.1.x-2.4.0 or Magento Enterprise Edition 2.1.x-2.4.0 ## Installation * [Install Rocket JavaScript Extension for Magento 2 via Composer or anarchive](https://magefan.com/blog/rocket-javascript-installation) From 6aaaa77e1c95b126c703a0b8bd41d18fbcec4562 Mon Sep 17 00:00:00 2001 From: Magefan Date: Mon, 10 Aug 2020 14:16:57 +0300 Subject: [PATCH 044/116] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6e8ef21..21e195b 100644 --- a/README.md +++ b/README.md @@ -67,5 +67,6 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Translation Extension](https://magefan.com/magento-2-translation-extension) * [Magento 2 WebP Optimized Images Extension](https://magefan.com/magento-2-webp-optimized-images) * [Magento 2 Image Optimization Extension](https://magefan.com/magento-2-image-optimization-extension) + * [Magento 2 Zendesk Chat Extension](https://magefan.com/magento-2-zendesk-chat-extension) * [Magento 2 Zero Downtime Deployment](https://magefan.com/blog/magento-2-zero-downtime-deployment) From 78f40bf60a679f565ccd9566983d6ebb455ac88c Mon Sep 17 00:00:00 2001 From: Magefan Date: Wed, 26 Aug 2020 14:52:36 +0300 Subject: [PATCH 045/116] Fixed Deprecated Functionality error Fixed error Deprecated Functionality: Array and string offset access syntax with curly braces is deprecated in app/code/Magefan/RocketJavaScript/Model/Controller/ResultPlugin.php on line 200 this is error message --- Model/Controller/ResultPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Model/Controller/ResultPlugin.php b/Model/Controller/ResultPlugin.php index 5e15dd7..22e76b5 100644 --- a/Model/Controller/ResultPlugin.php +++ b/Model/Controller/ResultPlugin.php @@ -197,7 +197,7 @@ private function isAllowedOnPage() $path = trim($path, '/'); if (mb_strlen($path)) { - if ('*' == $path{0}) { + if ('*' == $path[0]) { $subPath = trim($path, '*/'); if (mb_strlen($currentUrl) - mb_strlen($subPath) === mb_strrpos($currentUrl, $subPath)) { $this->allowedOnPage = true; From a2636207138ea8f7e6394cb0ffba3bd8a8fe0612 Mon Sep 17 00:00:00 2001 From: Magefan Date: Wed, 26 Aug 2020 15:08:09 +0300 Subject: [PATCH 046/116] Fixed Deprecated Functionality error (part 2) Fixed error Deprecated Functionality: Array and string offset access syntax with curly braces is deprecated in app/code/Magefan/RocketJavaScript/Model/Controller/ResultPlugin.php --- Model/Controller/ResultPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Model/Controller/ResultPlugin.php b/Model/Controller/ResultPlugin.php index 22e76b5..8b74915 100644 --- a/Model/Controller/ResultPlugin.php +++ b/Model/Controller/ResultPlugin.php @@ -205,7 +205,7 @@ private function isAllowedOnPage() } } - if ('*' == $path{mb_strlen($path) - 1}) { + if ('*' == $path[mb_strlen($path) - 1]) { if (0 === mb_strpos($currentUrl, $baseUrl . '/' . trim($path, '*/'))) { $this->allowedOnPage = true; break; From 67ca5eaf9881b935d496bc4c520c504b02adbc81 Mon Sep 17 00:00:00 2001 From: Magefan Date: Thu, 27 Aug 2020 13:07:22 +0300 Subject: [PATCH 047/116] Update composer.json --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index b79f970..8374204 100644 --- a/composer.json +++ b/composer.json @@ -2,10 +2,10 @@ "name": "magefan/module-rocketjavascript", "description": "Move all javascripts to the footer on Magento 2 store.", "require": { - "magefan/module-community" : ">=2.0.12" + "magefan/module-community" : ">=2.0.13" }, "type": "magento2-module", - "version": "2.1.5", + "version": "2.1.6", "authors": [ { "name": "Magefan", From 80b0c50fdd48e6ed5fbdd0b7aca2070f7c841f0f Mon Sep 17 00:00:00 2001 From: Magefan Date: Thu, 27 Aug 2020 13:07:42 +0300 Subject: [PATCH 048/116] Update module.xml --- etc/module.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/module.xml b/etc/module.xml index 0b60adf..fd2db4f 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -8,7 +8,7 @@ */ --> - + From b1fdb3ddf7a9c13964e90179fa4fae6722733f01 Mon Sep 17 00:00:00 2001 From: Magefan Date: Wed, 4 Nov 2020 17:41:31 +0200 Subject: [PATCH 049/116] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 21e195b..6ecdb6e 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Auto Language Switcher Extension](https://magefan.com/magento-2-auto-language-switcher) * [Magento 2 GeoIP Switcher Extension](https://magefan.com/magento-2-geoip-switcher-extension) * [Magento 2 YouTube Widget Extension](https://magefan.com/magento2-youtube-extension) + * [Magento 2 Product Grid Inline Editor](https://magefan.com/magento-2-product-grid-inline-editor) * [Magento 2 Product Widget Advanced Extension](https://magefan.com/magento-2-product-widget) * [Magento 2 Conflict Detector Extension](https://magefan.com/magento2-conflict-detector) * [Magento 2 Lazy Load Extension](https://magefan.com/magento-2-image-lazy-load-extension) From 0fb96aa529b04f977b18af8725235d0bab0c7905 Mon Sep 17 00:00:00 2001 From: Magefan Date: Wed, 18 Nov 2020 16:32:21 +0200 Subject: [PATCH 050/116] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6ecdb6e..59a8575 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,8 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 CMS Display Rules Extension](https://magefan.com/magento-2-cms-display-rules-extension) * [Magento 2 Translation Extension](https://magefan.com/magento-2-translation-extension) * [Magento 2 WebP Optimized Images Extension](https://magefan.com/magento-2-webp-optimized-images) - * [Magento 2 Image Optimization Extension](https://magefan.com/magento-2-image-optimization-extension) + * [Magento 2 Image Optimization Extension](https://magefan.com/magento-2-image-optimization) * [Magento 2 Zendesk Chat Extension](https://magefan.com/magento-2-zendesk-chat-extension) + * [Magento 2 Admin View Extension](https://magefan.com/magento-2-admin-view-extension) * [Magento 2 Zero Downtime Deployment](https://magefan.com/blog/magento-2-zero-downtime-deployment) From ffc7d0a851667bb2f5fd86a661a4bd73d0aef0fa Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 22 Dec 2020 17:15:00 +0200 Subject: [PATCH 051/116] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 59a8575..fc78655 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ * To enable or disable extension please navigate to Magento 2 Admin Panel > Stores > Magefan Extensions > Rocket JavaScript ## Requirements - * Magento Community Edition 2.1.x-2.4.0 or Magento Enterprise Edition 2.1.x-2.4.0 + * Magento Community Edition 2.1.x-2.4.x or Magento Enterprise Edition 2.1.x-2.4.x ## Installation * [Install Rocket JavaScript Extension for Magento 2 via Composer or anarchive](https://magefan.com/blog/rocket-javascript-installation) From db8f5e541684febe1b1d3d3c7818eda3e8f80114 Mon Sep 17 00:00:00 2001 From: Magefan Date: Fri, 19 Feb 2021 13:04:11 +0200 Subject: [PATCH 052/116] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index fc78655..37229c3 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,9 @@ ## Magento2 Footer JavaScript ## Magento2 Deferred JavaScript ## Magento2 Optimized Bundle JavaScript + + + ## Configuration * To enable or disable extension please navigate to Magento 2 Admin Panel > Stores > Magefan Extensions > Rocket JavaScript From eeb4f1880b7d35dba1494ebef1c55f9367ca01e9 Mon Sep 17 00:00:00 2001 From: Magefan Date: Fri, 19 Mar 2021 11:15:02 +0200 Subject: [PATCH 053/116] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 37229c3..e5435e4 100644 --- a/README.md +++ b/README.md @@ -74,4 +74,5 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Zendesk Chat Extension](https://magefan.com/magento-2-zendesk-chat-extension) * [Magento 2 Admin View Extension](https://magefan.com/magento-2-admin-view-extension) * [Magento 2 Zero Downtime Deployment](https://magefan.com/blog/magento-2-zero-downtime-deployment) + * [Magento 2 Better Order Grid Extension](https://magefan.com/magento-2-better-order-grid-extension) From 95eaffce1f6c835d3b2683abb25c2b472db4a069 Mon Sep 17 00:00:00 2001 From: Magefan Date: Mon, 5 Apr 2021 15:19:25 +0300 Subject: [PATCH 054/116] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e5435e4..4c7db8a 100644 --- a/README.md +++ b/README.md @@ -75,4 +75,5 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Admin View Extension](https://magefan.com/magento-2-admin-view-extension) * [Magento 2 Zero Downtime Deployment](https://magefan.com/blog/magento-2-zero-downtime-deployment) * [Magento 2 Better Order Grid Extension](https://magefan.com/magento-2-better-order-grid-extension) + * [Magento 2 Admin Email Notifications](https://magefan.com/magento-2-admin-email-notifications) From 2fc523f0e28ca4b0ec084c4811393da754203621 Mon Sep 17 00:00:00 2001 From: bohdan-berezhniy Date: Fri, 23 Apr 2021 13:34:03 +0300 Subject: [PATCH 055/116] Update composer.json --- composer.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/composer.json b/composer.json index 8374204..2d60e9b 100644 --- a/composer.json +++ b/composer.json @@ -4,6 +4,10 @@ "require": { "magefan/module-community" : ">=2.0.13" }, + "suggest": { + "magefan/module-webp": "Install WebP Optimized Images to serve images in the next-gen format. Use coupon code COMPOSER-FAN to get 10% discount on magefan.com.", + "magefan/module-lazyload": "Install Lazy Load to defer offscreen images loading." + }, "type": "magento2-module", "version": "2.1.6", "authors": [ From 4f924a4d8ab6f1e2fb444a55e2e357e92154b2ad Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 3 Aug 2021 13:13:17 +0300 Subject: [PATCH 056/116] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4c7db8a..6690e69 100644 --- a/README.md +++ b/README.md @@ -76,4 +76,5 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Zero Downtime Deployment](https://magefan.com/blog/magento-2-zero-downtime-deployment) * [Magento 2 Better Order Grid Extension](https://magefan.com/magento-2-better-order-grid-extension) * [Magento 2 Admin Email Notifications](https://magefan.com/magento-2-admin-email-notifications) + * [Magento 2 Facebook Pixel Extension](https://magefan.com/magento-2-facebook-pixel-extension) From 56cfbd39e8ac1e0a2b34236517caa31099203098 Mon Sep 17 00:00:00 2001 From: Magefan Date: Thu, 23 Sep 2021 13:03:10 +0300 Subject: [PATCH 057/116] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6690e69..0ca110b 100644 --- a/README.md +++ b/README.md @@ -77,4 +77,5 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Better Order Grid Extension](https://magefan.com/magento-2-better-order-grid-extension) * [Magento 2 Admin Email Notifications](https://magefan.com/magento-2-admin-email-notifications) * [Magento 2 Facebook Pixel Extension](https://magefan.com/magento-2-facebook-pixel-extension) + * [Better Magento 2 Checkout Extension](https://magefan.com/better-magento-2-checkout-extension) From ad5e16cf47ae3f56af602f4855abb18288d8ce48 Mon Sep 17 00:00:00 2001 From: Magefan Date: Wed, 1 Dec 2021 10:34:33 +0200 Subject: [PATCH 058/116] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0ca110b..372a63f 100644 --- a/README.md +++ b/README.md @@ -78,4 +78,5 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Admin Email Notifications](https://magefan.com/magento-2-admin-email-notifications) * [Magento 2 Facebook Pixel Extension](https://magefan.com/magento-2-facebook-pixel-extension) * [Better Magento 2 Checkout Extension](https://magefan.com/better-magento-2-checkout-extension) - + * [Magento 2 AMP Blog Extension](https://magefan.com/magento-2-amp-blog-extension) + * [Magento 2 Coupon Code Link](https://magefan.com/magento-2-coupon-code-link) From b007dff353e3ba91f371d232601102070af43941 Mon Sep 17 00:00:00 2001 From: Magefan Date: Thu, 23 Dec 2021 16:07:13 +0200 Subject: [PATCH 059/116] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 372a63f..5aa874a 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ There isn't a way for us to reply to reviews and the Q&A moderation is very slow ## License The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensource.org/licenses/osl-3.0.php). -## Other [Magento 2 Extensions](https://magefan.com/magento2-extensions) by Magefan +## Other [Magento 2 Extensions](https://magefan.com/magento-2-extensions) by Magefan * [Magento 2 Blog Extension](https://magefan.com/magento2-blog-extension) * [Magento 2 Blog Plus Extension](https://magefan.com/magento2-blog-extension/pricing) * [Magento 2 Blog Extra Extension](https://magefan.com/magento2-blog-extension/pricing) From dd32d5e0c06ec6ddf4681de4bfe2899dc4550064 Mon Sep 17 00:00:00 2001 From: Magefan Date: Wed, 9 Mar 2022 16:48:10 +0200 Subject: [PATCH 060/116] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 5aa874a..3510cda 100644 --- a/README.md +++ b/README.md @@ -80,3 +80,7 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Better Magento 2 Checkout Extension](https://magefan.com/better-magento-2-checkout-extension) * [Magento 2 AMP Blog Extension](https://magefan.com/magento-2-amp-blog-extension) * [Magento 2 Coupon Code Link](https://magefan.com/magento-2-coupon-code-link) + * [Magento 2 SEO Extension](https://magefan.com/magento-2-seo-extension) + * [Magento 2 Rich Snippets Extension](https://magefan.com/magento-2-rich-snippets) + * [Magento 2 HTML Sitemap Extension](https://magefan.com/magento-2-html-sitemap-extension) + * [Magento 2 SEO Suite Ultimate Extension](https://magefan.com/magento-2-seo-suite-ultimate-extension) From 421158f09211c9899f5eafc0bb61900c69d9b475 Mon Sep 17 00:00:00 2001 From: Magefan Date: Wed, 9 Mar 2022 17:20:44 +0200 Subject: [PATCH 061/116] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3510cda..42db5ba 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ # [Magefan](https://magefan.com/) [Rocket JavaScript Extension for Magento 2](https://magefan.com/rocket-javascript-deferred-javascript) + + [![Total Downloads](https://poser.pugx.org/magefan/module-rocketjavascript/downloads)](https://packagist.org/packages/magefan/module-rocketjavascript) [![Latest Stable Version](https://poser.pugx.org/magefan/module-rocketjavascript/v/stable)](https://packagist.org/packages/magefan/module-rocketjavascript) @@ -8,7 +10,7 @@ ## Magento2 Optimized Bundle JavaScript - + ## Configuration * To enable or disable extension please navigate to Magento 2 Admin Panel > Stores > Magefan Extensions > Rocket JavaScript From c996474442dd8ce242d09de535cf38dbb42e8f89 Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 15 Mar 2022 13:22:50 +0200 Subject: [PATCH 062/116] Update README.md --- README.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/README.md b/README.md index 42db5ba..af9b435 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,53 @@ globalSrc += "\n" + src; console.log(globalSrc); ``` +## Demo + +Try out our open demo and if you like our extension **please give us some star on Github ★** + + + + + + + + + + + + + + + +
+ Storefront Demo + + Admin Panel Demo +
+ + Magneto 2 Rocket JavaScript Extension Storefront Demo + + + + Magneto 2 Rocket JavaScript Extension Admin Panel Demo + +
+ + view + + + + view + +
## Support If you have any issues, please [contact us](mailto:support@magefan.com) From cfde468dbeb4c95a9a3b90533ab7fcfa57c8d9be Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 26 Apr 2022 17:42:38 +0300 Subject: [PATCH 063/116] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index af9b435..0d000f7 100644 --- a/README.md +++ b/README.md @@ -133,3 +133,4 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Rich Snippets Extension](https://magefan.com/magento-2-rich-snippets) * [Magento 2 HTML Sitemap Extension](https://magefan.com/magento-2-html-sitemap-extension) * [Magento 2 SEO Suite Ultimate Extension](https://magefan.com/magento-2-seo-suite-ultimate-extension) + * [Magento 2 Automatic Related Products](https://magefan.com/magento-2-automatic-related-products) From 6f092d277ffe033d4075016f9e5f96463394f5b5 Mon Sep 17 00:00:00 2001 From: Magefan Date: Thu, 28 Apr 2022 15:47:25 +0300 Subject: [PATCH 064/116] Update README.md --- README.md | 75 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 47 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 0d000f7..16628a9 100644 --- a/README.md +++ b/README.md @@ -95,42 +95,61 @@ There isn't a way for us to reply to reviews and the Q&A moderation is very slow ## License The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensource.org/licenses/osl-3.0.php). -## Other [Magento 2 Extensions](https://magefan.com/magento-2-extensions) by Magefan - * [Magento 2 Blog Extension](https://magefan.com/magento2-blog-extension) - * [Magento 2 Blog Plus Extension](https://magefan.com/magento2-blog-extension/pricing) - * [Magento 2 Blog Extra Extension](https://magefan.com/magento2-blog-extension/pricing) - * [Magento 2 Multi Blog Extension](https://magefan.com/magento-2-multi-blog-extension) - * [Magento 2 Login As Customer Extension](https://magefan.com/login-as-customer-magento-2-extension) +## [Magento 2 Extensions](https://magefan.com/magento-2-extensions) by Magefan +### [Magento 2 Admin Panel Extensions](https://magefan.com/magento-2-extensions/admin-extensions) + * [Magento 2 Automatic Related Products](https://magefan.com/magento-2-automatic-related-products) + * [Magento 2 Automatic Related Products Plus](https://magefan.com/magento-2-automatic-related-products/pricing) + * [Magento 2 Better Order Grid Extension](https://magefan.com/magento-2-better-order-grid-extension) + * [Magento 2 Extended Product Grid](https://magefan.com/magento-2-product-grid-inline-editor) + * [Magento 2 Admin View Extension](https://magefan.com/magento-2-admin-view-extension) + * [Magento 2 Zero Downtime Deployment](https://magefan.com/blog/magento-2-zero-downtime-deployment) + * [Magento 2 Admin Email Notifications](https://magefan.com/magento-2-admin-email-notifications) + * [Magento 2 Dynamic Categories](https://magefan.com/magento-2-dynamic-categories) * [Magento 2 Convert Guest to Customer Extension](https://magefan.com/magento2-convert-guest-to-customer) - * [Magento 2 Facebook Open Graph Extension](https://magefan.com/magento-2-open-graph-extension-og-tags) - * [Magento 2 Auto Currency Switcher Extension](https://magefan.com/magento-2-currency-switcher-auto-currency-by-country) - * [Magento 2 Auto Language Switcher Extension](https://magefan.com/magento-2-auto-language-switcher) - * [Magento 2 GeoIP Switcher Extension](https://magefan.com/magento-2-geoip-switcher-extension) - * [Magento 2 YouTube Widget Extension](https://magefan.com/magento2-youtube-extension) - * [Magento 2 Product Grid Inline Editor](https://magefan.com/magento-2-product-grid-inline-editor) - * [Magento 2 Product Widget Advanced Extension](https://magefan.com/magento-2-product-widget) * [Magento 2 Conflict Detector Extension](https://magefan.com/magento2-conflict-detector) - * [Magento 2 Lazy Load Extension](https://magefan.com/magento-2-image-lazy-load-extension) - * [Magento 2 CLI Extension](https://magefan.com/magento2-cli-extension) - * [Magento Twitter Cards Extension](https://magefan.com/magento-2-twitter-cards-extension) + * [Magento 2 Login As Customer Extension](https://magefan.com/login-as-customer-magento-2-extension) * [Magento 2 Mautic Integration Extension](https://magefan.com/magento-2-mautic-extension) - * [Magento 2 Alternate Hreflang Extension](https://magefan.com/magento2-alternate-hreflang-extension) - * [Magento 2 Dynamic Categories](https://magefan.com/magento-2-dynamic-categories) * [Magento 2 CMS Display Rules Extension](https://magefan.com/magento-2-cms-display-rules-extension) - * [Magento 2 Translation Extension](https://magefan.com/magento-2-translation-extension) - * [Magento 2 WebP Optimized Images Extension](https://magefan.com/magento-2-webp-optimized-images) - * [Magento 2 Image Optimization Extension](https://magefan.com/magento-2-image-optimization) * [Magento 2 Zendesk Chat Extension](https://magefan.com/magento-2-zendesk-chat-extension) - * [Magento 2 Admin View Extension](https://magefan.com/magento-2-admin-view-extension) - * [Magento 2 Zero Downtime Deployment](https://magefan.com/blog/magento-2-zero-downtime-deployment) - * [Magento 2 Better Order Grid Extension](https://magefan.com/magento-2-better-order-grid-extension) - * [Magento 2 Admin Email Notifications](https://magefan.com/magento-2-admin-email-notifications) + * [Magento 2 YouTube Widget Extension](https://magefan.com/magento2-youtube-extension) + * [Magento 2 CLI Extension](https://magefan.com/magento2-cli-extension) * [Magento 2 Facebook Pixel Extension](https://magefan.com/magento-2-facebook-pixel-extension) - * [Better Magento 2 Checkout Extension](https://magefan.com/better-magento-2-checkout-extension) + +### [Magento 2 Blog Extensions](https://magefan.com/magento-2-extensions/blog-extensions) + + * [Magento 2 Blog Extension](https://magefan.com/magento2-blog-extension) + * [Magento 2 Blog Plus Extension](https://magefan.com/magento2-blog-extension/pricing) + * [Magento 2 Blog Extra Extension](https://magefan.com/magento2-blog-extension/pricing) + * [Magento 2 Multi Blog Extension](https://magefan.com/magento-2-multi-blog-extension) * [Magento 2 AMP Blog Extension](https://magefan.com/magento-2-amp-blog-extension) - * [Magento 2 Coupon Code Link](https://magefan.com/magento-2-coupon-code-link) + * [Magento 2 Product Widget Advanced Extension](https://magefan.com/magento-2-product-widget) + + +### [Magento 2 SEO Extensions](https://magefan.com/magento-2-extensions/magento-2-seo-extensions) + * [Magento 2 SEO Extension](https://magefan.com/magento-2-seo-extension) * [Magento 2 Rich Snippets Extension](https://magefan.com/magento-2-rich-snippets) * [Magento 2 HTML Sitemap Extension](https://magefan.com/magento-2-html-sitemap-extension) * [Magento 2 SEO Suite Ultimate Extension](https://magefan.com/magento-2-seo-suite-ultimate-extension) - * [Magento 2 Automatic Related Products](https://magefan.com/magento-2-automatic-related-products) + * [Magento 2 Twitter Cards Extension](https://magefan.com/magento-2-twitter-cards-extension) + * [Magento 2 Facebook Open Graph Extension](https://magefan.com/magento-2-open-graph-extension-og-tags) + * [Magento 2 Hreflang Tags Extension](https://magefan.com/magento2-alternate-hreflang-extension) + +### [Magento 2 Cart Extensions](https://magefan.com/magento-2-extensions/cart-extensions) + + * [Better Magento 2 Checkout Extension](https://magefan.com/better-magento-2-checkout-extension) + * [Magento 2 Coupon Code Link](https://magefan.com/magento-2-coupon-code-link) + +### [Magento 2 Speed Optimization Extensions](https://magefan.com/magento-2-extensions/speed-optimization-extensions) + + * [Magento 2 Lazy Load Extension](https://magefan.com/magento-2-image-lazy-load-extension) + * [Magento 2 WebP Optimized Images Extension](https://magefan.com/magento-2-webp-optimized-images) + +### [Magento 2 Multi-Language Extensions](https://magefan.com/magento-2-extensions/multi-language-extensions) + + * [Magento 2 Auto Currency Switcher Extension](https://magefan.com/magento-2-currency-switcher-auto-currency-by-country) + * [Magento 2 Auto Language Switcher Extension](https://magefan.com/magento-2-auto-language-switcher) + * [Magento 2 GeoIP Switcher Extension](https://magefan.com/magento-2-geoip-switcher-extension) + * [Magento 2 Translation Extension](https://magefan.com/magento-2-translation-extension) + * [Magento 2 Translation Plus Extension](https://magefan.com/magento-2-translation-extension/pricing) + From 092bd7db3773f6a45f1060dd8b6de08f61e40e8f Mon Sep 17 00:00:00 2001 From: Magefan Date: Fri, 13 May 2022 17:22:03 +0300 Subject: [PATCH 065/116] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 16628a9..91ce067 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ # [Magefan](https://magefan.com/) [Rocket JavaScript Extension for Magento 2](https://magefan.com/rocket-javascript-deferred-javascript) + + + From 063664058ce4880702a8e018cbf37f11bec94252 Mon Sep 17 00:00:00 2001 From: Magefan Date: Fri, 13 May 2022 17:22:23 +0300 Subject: [PATCH 066/116] Update README.md --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 91ce067..456b506 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,14 @@ # [Magefan](https://magefan.com/) [Rocket JavaScript Extension for Magento 2](https://magefan.com/rocket-javascript-deferred-javascript) - - - - [![Total Downloads](https://poser.pugx.org/magefan/module-rocketjavascript/downloads)](https://packagist.org/packages/magefan/module-rocketjavascript) [![Latest Stable Version](https://poser.pugx.org/magefan/module-rocketjavascript/v/stable)](https://packagist.org/packages/magefan/module-rocketjavascript) + + + + + ## Magento2 Footer JavaScript ## Magento2 Deferred JavaScript ## Magento2 Optimized Bundle JavaScript From eb4625c0546fccbf77467a5226b0a1bcaf414f1d Mon Sep 17 00:00:00 2001 From: Magefan Date: Mon, 27 Jun 2022 11:43:17 +0300 Subject: [PATCH 067/116] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 456b506..616af1f 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,7 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou ### [Magento 2 Admin Panel Extensions](https://magefan.com/magento-2-extensions/admin-extensions) * [Magento 2 Automatic Related Products](https://magefan.com/magento-2-automatic-related-products) * [Magento 2 Automatic Related Products Plus](https://magefan.com/magento-2-automatic-related-products/pricing) + * [Magento 2 Edit Order Extension](https://magefan.com/magento-2-edit-order-extension) * [Magento 2 Better Order Grid Extension](https://magefan.com/magento-2-better-order-grid-extension) * [Magento 2 Extended Product Grid](https://magefan.com/magento-2-product-grid-inline-editor) * [Magento 2 Admin View Extension](https://magefan.com/magento-2-admin-view-extension) @@ -157,3 +158,5 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Translation Extension](https://magefan.com/magento-2-translation-extension) * [Magento 2 Translation Plus Extension](https://magefan.com/magento-2-translation-extension/pricing) + ### Magento 2 Point of Sale + * [Magento 2 POS System](https://magefan.com/magento-pos-system) From 3b0b6de4941816de106dc5cd1731034b2d9fea2a Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 19 Jul 2022 10:20:43 +0300 Subject: [PATCH 068/116] Update config.xml --- etc/config.xml | 181 ++++++++++++------------------------------------- 1 file changed, 44 insertions(+), 137 deletions(-) diff --git a/etc/config.xml b/etc/config.xml index c48c938..db30c62 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -14,132 +14,60 @@ checkout/* onestepcheckout/* - jquery/jquery.mobile.custom.min.js + jquery.min.js +mage/common.min.js mage/dataPost.min.js mage/bootstrap.min.js -mage/translate-inline.min.js -mage/utils/arrays.min.js -mage/utils/arrays.js -FormData.min.js -MutationObserver.min.js -jquery/jquery.metadata.min.js -mage/loader.min.js -Magento_Wishlist/js/add-to-wishlist.min.js -Magento_PageCache/js/page-cache.min.js -Magento_Cookie/js/require-cookie.min.js -Magento_Ui/js/core/app.min.js -mage/dropdown.min.js -Magento_Search/form-mini.min.js -magnifier/magnify.min.js -Magento_ProductVideo/js/fotorama-add-video-events.min.js -Magento_Review/js/error-placement.min.js -Magento_Review/js/validate-review.min.js -Magento_Catalog/js/upsell-products.min.js -mage/cookies.min.js -MagePal_GoogleTagManager/js/datalayer.min.js -Magento_Ui/js/block-loader.min.js -Magento_Review/js/process-reviews.min.js -Magento_Customer/js/section-config.min.js -Magento_Customer/js/customer-data.min.js -Magento_Customer/js/invalidation-processor.min.js -Magento_Catalog/js/product/view/provider.min.js -magnifier/magnifier.min.js -Magento_Catalog/js/gallery.min.js -Magento_Ui/js/core/renderer/types.min.js -Magento_Ui/js/core/renderer/layout.min.js -Plumrocket_SocialLoginFree/js/sharepopup.min.js -Magento_Catalog/js/view/compare-products.min.js -Magento_Checkout/js/view/minicart.min.js -Magento_Ui/js/lib/core/collection.min.js -Magento_Tax/js/view/checkout/minicart/subtotal/totals.min.js -Magento_Msrp/js/view/checkout/minicart/subtotal/totals.min.js -Magento_Catalog/js/view/image.min.js -Magento_Review/js/view/review.min.js -Plumrocket_SocialLoginFree/js/view/customer/authentication-popup.min.js -Magento_Captcha/js/view/checkout/loginCaptcha.min.js -Mirasvit_SearchAutocomplete/js/injection.min.js -Mirasvit_SearchAutocomplete/js/autocomplete.min.js -Mirasvit_SearchAutocomplete/js/provider.min.js -Mirasvit_SearchAutocomplete/js/popular.min.js -Magento_Customer/js/view/customer.min.js -Magento_Theme/js/view/messages.min.js -Magento_Catalog/js/storage-manager.min.js -Magento_Ui/js/view/messages.min.js -MSP_ReCaptcha/js/ui-messages-mixin.min.js -Magento_Ui/js/lib/core/element/element.min.js -mage/decorate.min.js -mage/storage.min.js -Magento_Catalog/js/product/storage/storage-service.min.js -Magento_Checkout/js/sidebar.min.js -mage/gallery/gallery.min.js //!!!!! -Mirasvit_SearchAutocomplete/js/lib/jquery.highlight.min.js -Magento_Ui/js/form/form.min.js -Magento_Customer/js/action/login.min.js -Magento_Customer/js/model/authentication-popup.min.js -mage/url.min.js -Magento_Ui/js/modal/alert.min.js -Magento_Ui/js/model/messageList.min.js -MSP_ReCaptcha/js/registry.min.js -Magento_Ui/js/lib/core/element/links.min.js -Magento_Captcha/js/view/checkout/defaultCaptcha.min.js -Magento_Captcha/js/model/captchaList.min.js -Magento_Catalog/js/product/storage/data-storage.min.js -Magento_Catalog/js/product/storage/ids-storage-compare.min.js -fotorama/fotorama.min.js -Magento_Ui/js/lib/spinner.min.js -mage/requirejs/resolver.min.js -Magento_Ui/js/form/adapter.min.js -Magento_Ui/js/model/messages.min.js -Magento_Captcha/js/model/captcha.min.js -Magento_Captcha/js/action/refresh.min.js -Magento_Customer/js/invalidation-rules/website-rule.min.js -Magento_Catalog/js/product/query-builder.min.js -Magento_Theme/js/responsive.min.js +Magento_PageCache/js/form-key-provider.min.js +Magento_Translation/js/mage-translation-dictionary.min.js Magento_Theme/js/theme.min.js -jquery/jquery.validate.min.js -js/responsive.min.js -js/theme.min.js -mage/translate.min.js -Magefan_LazyLoad/js/jquery.unveil.min.js requirejs/domReady.min.js -jquery/jquery.cookie.min.js -Plumrocket_SocialLoginFree/js/pslogin.min.js -Smartwave_Megamenu/js/sw_megamenu.min.js -mage/tooltip.min.js -Magento_Catalog/product/view/validation.min.js -Amasty_Cart/js/amcart.min.js -mage/mage.min.js -Magento_Catalog/js/catalog-add-to-cart.min.js -Magento_Catalog/js/price-box.min.js -owl.carousel/owl.carousel.min.js +jquery/jquery-migrate.min.js mage/template.min.js Magento_Ui/js/modal/confirm.min.js -mage/common.min.js -jquery/jquery-migrate.min.js -jquery/jquery.storageapi.min.js -jquery/jquery-ui.min.js -Magento_Catalog/js/price-utils.min.js -underscore.min.js +jquery/ui-modules/widget.min.js mage/apply/main.min.js Magento_Ui/js/lib/knockout/bootstrap.min.js -mage/tabs.min.js -matchMedia.min.js +mage/requirejs/text.min.js mage/smart-keyboard-handler.min.js +mage/mage.min.js mage/ie-class-fixer.min.js -js/jquery.stellar.min.js +underscore.min.js +mage/translate.min.js +Magento_Ui/js/modal/modal.min.js knockoutjs/knockout.min.js knockoutjs/knockout-es5.min.js -mage/collapsible.min.js +Magento_Ui/js/lib/key-codes.min.js +jquery/ui-modules/core.min.js +jquery/z-index.min.js +jquery/ui-modules/version.min.js mage/apply/scripts.min.js Magento_Ui/js/lib/knockout/template/engine.min.js Magento_Ui/js/lib/knockout/bindings/bootstrap.min.js Magento_Ui/js/lib/knockout/extender/observable_array.min.js Magento_Ui/js/lib/knockout/extender/bound-nodes.min.js +jquery/ui-modules/data.min.js +jquery/ui-modules/disable-selection.min.js +jquery/ui-modules/focusable.min.js +jquery/ui-modules/form.min.js +jquery/ui-modules/ie.min.js +jquery/ui-modules/keycode.min.js +jquery/ui-modules/labels.min.js +jquery/ui-modules/jquery-patch.min.js +jquery/ui-modules/plugin.min.js +jquery/ui-modules/safe-active-element.min.js +jquery/ui-modules/safe-blur.min.js +jquery/ui-modules/scroll-parent.min.js +jquery/ui-modules/tabbable.min.js +jquery/ui-modules/unique-id.min.js +mage/utils/wrapper.min.js +Magento_InventoryConfigurableProductFrontendUi/js/configurable-variation-qty.min.js knockoutjs/knockout-repeat.min.js knockoutjs/knockout-fast-foreach.min.js -mage/utils/wrapper.min.js Magento_Ui/js/lib/core/events.min.js -es6-collections.min.js +Magento_Catalog/js/price-utils.min.js +jquery/jquery.parsequery.min.js +mage/validation/validation.min.js Magento_Ui/js/lib/knockout/template/renderer.min.js Magento_Ui/js/lib/knockout/bindings/resizable.min.js Magento_Ui/js/lib/knockout/bindings/i18n.min.js @@ -158,16 +86,19 @@ Magento_Ui/js/lib/knockout/bindings/staticChecked.min.js Magento_Ui/js/lib/knockout/bindings/simple-checked.min.js Magento_Ui/js/lib/knockout/bindings/bind-html.min.js Magento_Ui/js/lib/knockout/bindings/tooltip.min.js +Magento_Ui/js/lib/knockout/bindings/color-picker.min.js Magento_Ui/js/lib/knockout/template/observable_source.min.js Magento_Ui/js/lib/logger/console-logger.min.js +mage/url.min.js +mage/validation.min.js Magento_Ui/js/lib/view/utils/async.min.js Magento_Ui/js/lib/registry/registry.min.js mage/utils/main.min.js Magento_Ui/js/lib/knockout/template/loader.min.js -mage/calendar.min.js -moment.min.js -mage/validation/validation.min.js +Magento_Ui/js/lib/core/class.min.js Magento_Ui/js/lib/core/storage/local.min.js +jquery/spectrum/spectrum.min.js +jquery/spectrum/tinycolor.min.js Magento_Ui/js/lib/logger/logger.min.js Magento_Ui/js/lib/logger/entry-factory.min.js Magento_Ui/js/lib/logger/console-output-handler.min.js @@ -175,40 +106,16 @@ Magento_Ui/js/lib/logger/formatter.min.js Magento_Ui/js/lib/logger/message-pool.min.js Magento_Ui/js/lib/logger/levels-pool.min.js Magento_Ui/js/lib/logger/logger-utils.min.js -Magento_Ui/js/lib/view/utils/dom-observer.min.js -Magento_Ui/js/lib/view/utils/bindings.min.js -jquery/jquery-ui-timepicker-addon.min.js -mage/validation.min.js +moment.min.js +jquery/jquery.validate.min.js Magento_Ui/js/lib/logger/entry.min.js -Magento_Ui/js/modal/modal.min.js -mage/requirejs/text.min.js -Magento_Ui/js/lib/core/class.min.js +jquery/jquery.metadata.min.js mage/utils/template.min.js +mage/utils/arrays.min.js mage/utils/compare.min.js mage/utils/misc.min.js mage/utils/objects.min.js mage/utils/strings.min.js -Magento_Ui/js/lib/key-codes.min.js -jquery.min.js -mage/requirejs/static.min.js -mage/requirejs/mixins.min.js -requirejs-config.min.js -fancybox/js/jquery.fancybox.min.js -Magento_Catalog/js/jquery.zoom.min.js -Magento_ProductVideo/js/load-player.min.js -Magento_Catalog/js/product/storage/ids-storage.min.js -Mirasvit_SearchAutocomplete/js/navigation.min.js - -mage/dropdowns.min.js -mage/menu.min.js -Magento_Catalog/js/validate-product.min.js -Magento_Swatches/js/swatch-renderer.min.js -Magento_Swatches/js/configurable-customer-data.min.js -mage/gallery/gallery.min.js -Magento_InstantPurchase/js/view/instant-purchase.min.js -Magento_Customer/js/view/authentication-popup.min.js -jquery/jquery.parsequery.min.js -Magento_ConfigurableProduct/js/options-updater.min.js Magento_Ui/templates/modal/modal-popup.html Magento_Ui/templates/modal/modal-slide.html From 3dca0e637405d9e2a988b7f66b730392b4991310 Mon Sep 17 00:00:00 2001 From: Magefan Date: Thu, 28 Jul 2022 15:42:16 +0300 Subject: [PATCH 069/116] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 616af1f..ab088a7 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,7 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 SEO Extension](https://magefan.com/magento-2-seo-extension) * [Magento 2 Rich Snippets Extension](https://magefan.com/magento-2-rich-snippets) * [Magento 2 HTML Sitemap Extension](https://magefan.com/magento-2-html-sitemap-extension) + * [Magento 2 XML Sitemap Extension](https://magefan.com/magento-2-xml-sitemap-extension) * [Magento 2 SEO Suite Ultimate Extension](https://magefan.com/magento-2-seo-suite-ultimate-extension) * [Magento 2 Twitter Cards Extension](https://magefan.com/magento-2-twitter-cards-extension) * [Magento 2 Facebook Open Graph Extension](https://magefan.com/magento-2-open-graph-extension-og-tags) From 6736f14e157c5f570b23f32bbd46fa677ff2c560 Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 9 Aug 2022 17:38:18 +0300 Subject: [PATCH 070/116] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ab088a7..8c47a73 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,7 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Edit Order Extension](https://magefan.com/magento-2-edit-order-extension) * [Magento 2 Better Order Grid Extension](https://magefan.com/magento-2-better-order-grid-extension) * [Magento 2 Extended Product Grid](https://magefan.com/magento-2-product-grid-inline-editor) + * [Magento 2 Google Shopping Feed](https://magefan.com/magento-2-google-shopping-feed-extension) * [Magento 2 Admin View Extension](https://magefan.com/magento-2-admin-view-extension) * [Magento 2 Zero Downtime Deployment](https://magefan.com/blog/magento-2-zero-downtime-deployment) * [Magento 2 Admin Email Notifications](https://magefan.com/magento-2-admin-email-notifications) From 0d7a1e2fac396275833295997d7139eedb343702 Mon Sep 17 00:00:00 2001 From: Magefan Date: Mon, 12 Sep 2022 15:18:19 +0300 Subject: [PATCH 071/116] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8c47a73..71b4a39 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,7 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Automatic Related Products Plus](https://magefan.com/magento-2-automatic-related-products/pricing) * [Magento 2 Edit Order Extension](https://magefan.com/magento-2-edit-order-extension) * [Magento 2 Better Order Grid Extension](https://magefan.com/magento-2-better-order-grid-extension) + * [Magento 2 Product Tabs Extension](https://magefan.com/magento-2/extensions/product-tabs) * [Magento 2 Extended Product Grid](https://magefan.com/magento-2-product-grid-inline-editor) * [Magento 2 Google Shopping Feed](https://magefan.com/magento-2-google-shopping-feed-extension) * [Magento 2 Admin View Extension](https://magefan.com/magento-2-admin-view-extension) From 88e06650849dfb2c3131dd42b05e2f3071ce48db Mon Sep 17 00:00:00 2001 From: Magefan Date: Mon, 21 Nov 2022 12:49:40 +0200 Subject: [PATCH 072/116] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 71b4a39..828a6b4 100644 --- a/README.md +++ b/README.md @@ -163,3 +163,6 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou ### Magento 2 Point of Sale * [Magento 2 POS System](https://magefan.com/magento-pos-system) + + ### Shopware Extensions + * [Shopware WebP Extension](https://magefan.com/shopware/extensions/webp) From 130a3de34b77028cfd72b346a1a992063df8647e Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 22 Nov 2022 13:18:14 +0200 Subject: [PATCH 073/116] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 828a6b4..788b875 100644 --- a/README.md +++ b/README.md @@ -166,3 +166,6 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou ### Shopware Extensions * [Shopware WebP Extension](https://magefan.com/shopware/extensions/webp) + + ### Shopify Apps + * [Shopify Login As Customer](https://apps.shopify.com/login-as-customer) From 4c1030f6f1a9e6e6cf17233f40b1da95f536eebc Mon Sep 17 00:00:00 2001 From: Magefan Date: Mon, 20 Feb 2023 14:30:18 +0200 Subject: [PATCH 074/116] Add fix for amasty amp & defered javacript loading --- Model/Controller/ResultPlugin.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Model/Controller/ResultPlugin.php b/Model/Controller/ResultPlugin.php index 8b74915..648bf2c 100644 --- a/Model/Controller/ResultPlugin.php +++ b/Model/Controller/ResultPlugin.php @@ -134,8 +134,15 @@ private function isEnabled() \Magento\Store\Model\ScopeInterface::SCOPE_STORE ); - /* check if Plumrocket AMP enabled */ + if ($enabled) { + + /* check if Amasty AMP enabled */ + if ($this->request->getParam('is_amp')) { + return false; + } + + /* check if Plumrocket AMP enabled */ $isAmpRequest = $this->scopeConfig->getValue( 'pramp/general/enabled', \Magento\Store\Model\ScopeInterface::SCOPE_STORE From 9275550ece962a4778377cf4784910083e579938 Mon Sep 17 00:00:00 2001 From: andriysvyryda Date: Tue, 28 Feb 2023 09:36:25 +0200 Subject: [PATCH 075/116] Update system.xml & config.xml --- etc/adminhtml/system.xml | 10 +++++----- etc/config.xml | 6 ++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index b6be563..6127396 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -9,7 +9,7 @@ --> -
+
magefan Magefan_RocketJavaScript::config_magefan_rocketjavascript @@ -27,24 +27,24 @@ Magefan\Community\Block\Adminhtml\System\Config\Form\ProductKeyField - + If enabled all JavaScript on storefront will be moved to the end of the page. Magento\Config\Model\Config\Source\Yesno - + 1 Enter page patches each in a new line. "*" means any path, you can use it at the beginning or end. - + Please note that this option only works with enabled JavaScript Bundling (Configuration > Advanced > Developer > JavaScript Settings > Enable JavaScript Bundling). Magento\Config\Model\Config\Source\Yesno - + 1 diff --git a/etc/config.xml b/etc/config.xml index db30c62..c6836dc 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -11,9 +11,13 @@ + RocketJavaScript + 1 + 1 checkout/* onestepcheckout/* + 1 jquery.min.js mage/common.min.js mage/dataPost.min.js @@ -130,8 +134,6 @@ Magento_Customer/template/authentication-popup.html Magento_Ui/templates/collection.html Magento_Ui/template/messages.html Magento_Captcha/template/checkout/captcha.html - RocketJavaScript - 1 From 8f12b25fe99b565540941cf7e3fbed469d4e6673 Mon Sep 17 00:00:00 2001 From: Magefan Date: Mon, 6 Mar 2023 12:49:36 +0200 Subject: [PATCH 076/116] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 788b875..a572a09 100644 --- a/README.md +++ b/README.md @@ -166,6 +166,7 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou ### Shopware Extensions * [Shopware WebP Extension](https://magefan.com/shopware/extensions/webp) + * [Shopware Blog Extension](https://magefan.com/shopware/extensions/blog) ### Shopify Apps * [Shopify Login As Customer](https://apps.shopify.com/login-as-customer) From 1ebc140b88b5eb6665c92aba2476ee556055b0d3 Mon Sep 17 00:00:00 2001 From: Magefan Date: Thu, 16 Mar 2023 17:47:24 +0200 Subject: [PATCH 077/116] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a572a09..7a8b8f3 100644 --- a/README.md +++ b/README.md @@ -170,3 +170,4 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou ### Shopify Apps * [Shopify Login As Customer](https://apps.shopify.com/login-as-customer) + * [Shopify Blog](https://apps.shopify.com/magefan-blog) From fd59e9bbe1d581c8b84c38ce727d9acc13648e5c Mon Sep 17 00:00:00 2001 From: Magefan Date: Thu, 6 Apr 2023 15:50:56 +0300 Subject: [PATCH 078/116] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7a8b8f3..bd8a3d6 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,7 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Product Tabs Extension](https://magefan.com/magento-2/extensions/product-tabs) * [Magento 2 Extended Product Grid](https://magefan.com/magento-2-product-grid-inline-editor) * [Magento 2 Google Shopping Feed](https://magefan.com/magento-2-google-shopping-feed-extension) + * [Magento 2 Google Tag Manager](https://magefan.com/magento-2-google-tag-manager) * [Magento 2 Admin View Extension](https://magefan.com/magento-2-admin-view-extension) * [Magento 2 Zero Downtime Deployment](https://magefan.com/blog/magento-2-zero-downtime-deployment) * [Magento 2 Admin Email Notifications](https://magefan.com/magento-2-admin-email-notifications) From 1cd49348174ad09ffbb48efb39fd24771806f6b2 Mon Sep 17 00:00:00 2001 From: Magefan Date: Thu, 13 Apr 2023 14:57:58 +0300 Subject: [PATCH 079/116] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index bd8a3d6..d3da5ad 100644 --- a/README.md +++ b/README.md @@ -172,3 +172,6 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou ### Shopify Apps * [Shopify Login As Customer](https://apps.shopify.com/login-as-customer) * [Shopify Blog](https://apps.shopify.com/magefan-blog) + + ### Magento 2 Theme + * [Optimized Magento 2 Theme](https://magefan.com/optimized-magento-2-theme) From d8093961a5e36db5fe58b8bb23d371297c285482 Mon Sep 17 00:00:00 2001 From: Magefan Date: Mon, 24 Apr 2023 11:28:30 +0300 Subject: [PATCH 080/116] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d3da5ad..4888d0b 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![Latest Stable Version](https://poser.pugx.org/magefan/module-rocketjavascript/v/stable)](https://packagist.org/packages/magefan/module-rocketjavascript) - + From 659ab4cade50748181e5e18b3dbfe03f304d42b9 Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 2 May 2023 14:00:12 +0300 Subject: [PATCH 081/116] Update --- Block/Adminhtml/System/Config/Form/Info.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Block/Adminhtml/System/Config/Form/Info.php b/Block/Adminhtml/System/Config/Form/Info.php index dcb5c84..73bb3f6 100755 --- a/Block/Adminhtml/System/Config/Form/Info.php +++ b/Block/Adminhtml/System/Config/Form/Info.php @@ -21,7 +21,7 @@ class Info extends \Magefan\Community\Block\Adminhtml\System\Config\Form\Info */ protected function getModuleUrl() { - return 'https://magefan.com/rocket-javascript-deferred-javascript?utm_source=m2admin_rocket_javascript_config&utm_medium=link&utm_campaign=regular'; + return 'https://mage' . 'fan.com/rocket-javascript-deferred-javascript?utm_source=m2admin_rocket_javascript_config&utm_medium=link&utm_campaign=regular'; } /** From e7733a687c467d0f7ace7815f2401ea333bc88e8 Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 2 May 2023 14:00:55 +0300 Subject: [PATCH 082/116] Update composer.json --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 2d60e9b..99e2309 100644 --- a/composer.json +++ b/composer.json @@ -2,14 +2,14 @@ "name": "magefan/module-rocketjavascript", "description": "Move all javascripts to the footer on Magento 2 store.", "require": { - "magefan/module-community" : ">=2.0.13" + "magefan/module-community" : ">=2.1.13" }, "suggest": { "magefan/module-webp": "Install WebP Optimized Images to serve images in the next-gen format. Use coupon code COMPOSER-FAN to get 10% discount on magefan.com.", "magefan/module-lazyload": "Install Lazy Load to defer offscreen images loading." }, "type": "magento2-module", - "version": "2.1.6", + "version": "2.1.7", "authors": [ { "name": "Magefan", From fb7f39c5eb74797cbfd45dc63d1cc867c658a339 Mon Sep 17 00:00:00 2001 From: Magefan Date: Thu, 4 May 2023 16:52:31 +0300 Subject: [PATCH 083/116] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4888d0b..bb432fb 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,7 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Twitter Cards Extension](https://magefan.com/magento-2-twitter-cards-extension) * [Magento 2 Facebook Open Graph Extension](https://magefan.com/magento-2-open-graph-extension-og-tags) * [Magento 2 Hreflang Tags Extension](https://magefan.com/magento2-alternate-hreflang-extension) + * [Magento 2 Google Analytics 4 Extension](https://magefan.com/magento-2-google-analytics-4) ### [Magento 2 Cart Extensions](https://magefan.com/magento-2-extensions/cart-extensions) From b961f6123747800d6b1e977da96f6aaf0847977c Mon Sep 17 00:00:00 2001 From: Ihor Vansach Date: Fri, 9 Jun 2023 13:19:08 +0300 Subject: [PATCH 084/116] 8478-Rocket-JS-Add-Ability-to-skip-scrips-from-defere --- Model/Controller/ResultPlugin.php | 20 ++++++++++++++++++++ etc/adminhtml/system.xml | 7 +++++++ etc/config.xml | 1 + 3 files changed, 28 insertions(+) diff --git a/Model/Controller/ResultPlugin.php b/Model/Controller/ResultPlugin.php index 648bf2c..f68c667 100644 --- a/Model/Controller/ResultPlugin.php +++ b/Model/Controller/ResultPlugin.php @@ -80,6 +80,19 @@ public function aroundRenderResult( return $result; } + $ignoredStrings = $this->scopeConfig->getValue( + 'mfrocketjavascript/general/ignore_deferred_javascript_with', + \Magento\Store\Model\ScopeInterface::SCOPE_STORE); + $ignoredStrings = explode("\n", str_replace("\r", "\n", $ignoredStrings)); + foreach ($ignoredStrings as $key => $ignoredString) { + $ignoredString = trim($ignoredString); + if (!$ignoredString) { + unset($ignoredStrings[$key]); + } else { + $ignoredStrings[$key] = $ignoredString; + } + } + $html = $response->getBody(); $scripts = []; @@ -107,6 +120,13 @@ public function aroundRenderResult( continue; } + foreach ($ignoredStrings as $ignoredString) { + if (false !== stripos($script, $ignoredString)) { + $start++; + continue 2; + } + } + $html = str_replace($script, '', $html); $scripts[] = $script; } diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 6127396..a2d2b26 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -39,6 +39,13 @@ Enter page patches each in a new line. "*" means any path, you can use it at the beginning or end. + + + + 1 + + data-rocketjavascript="false" will automatically be ignored. Example <script data-rocketjavascript="false">/* some script *</script>]]> + Please note that this option only works with enabled JavaScript Bundling (Configuration > Advanced > Developer > JavaScript Settings > Enable JavaScript Bundling). diff --git a/etc/config.xml b/etc/config.xml index c6836dc..56f71fd 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -17,6 +17,7 @@ checkout/* onestepcheckout/* + www.googletagmanager.com 1 jquery.min.js mage/common.min.js From a8db2cd9da95a08758b735dede6d23557dcbd8be Mon Sep 17 00:00:00 2001 From: Ihor Vansach Date: Fri, 9 Jun 2023 13:19:41 +0300 Subject: [PATCH 085/116] Updated extension version --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 99e2309..b4c4f1e 100644 --- a/composer.json +++ b/composer.json @@ -2,14 +2,14 @@ "name": "magefan/module-rocketjavascript", "description": "Move all javascripts to the footer on Magento 2 store.", "require": { - "magefan/module-community" : ">=2.1.13" + "magefan/module-community" : ">=2.1.16" }, "suggest": { "magefan/module-webp": "Install WebP Optimized Images to serve images in the next-gen format. Use coupon code COMPOSER-FAN to get 10% discount on magefan.com.", "magefan/module-lazyload": "Install Lazy Load to defer offscreen images loading." }, "type": "magento2-module", - "version": "2.1.7", + "version": "2.1.8", "authors": [ { "name": "Magefan", From d17bc5b94db12f5cdd82551aa60f65c352550cfa Mon Sep 17 00:00:00 2001 From: Magefan Date: Mon, 24 Jul 2023 16:18:50 +0300 Subject: [PATCH 086/116] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index bb432fb..bb2ecce 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,7 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 YouTube Widget Extension](https://magefan.com/magento2-youtube-extension) * [Magento 2 CLI Extension](https://magefan.com/magento2-cli-extension) * [Magento 2 Facebook Pixel Extension](https://magefan.com/magento-2-facebook-pixel-extension) + * [Magento 2 Price History](https://magefan.com/magento-2-price-history) ### [Magento 2 Blog Extensions](https://magefan.com/magento-2-extensions/blog-extensions) From 2313e4df8e17882e656387d78e4abb65c88a5050 Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 5 Sep 2023 17:59:49 +0300 Subject: [PATCH 087/116] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bb2ecce..088cef0 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ ## Magento2 Optimized Bundle JavaScript - + ## Configuration * To enable or disable extension please navigate to Magento 2 Admin Panel > Stores > Magefan Extensions > Rocket JavaScript From 02f64023bb451749e27a9815935e50332ce3c296 Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 19 Sep 2023 14:54:20 +0300 Subject: [PATCH 088/116] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 088cef0..7b115a3 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,7 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 CLI Extension](https://magefan.com/magento2-cli-extension) * [Magento 2 Facebook Pixel Extension](https://magefan.com/magento-2-facebook-pixel-extension) * [Magento 2 Price History](https://magefan.com/magento-2-price-history) + * [Magento 2 Google Customer Reviews](https://magefan.com/magento-2-google-customer-reviews) ### [Magento 2 Blog Extensions](https://magefan.com/magento-2-extensions/blog-extensions) From 4f0322fc47fbe5c32402e844cf9f4b912839b2b9 Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 3 Oct 2023 17:27:21 +0300 Subject: [PATCH 089/116] Update ResultPlugin.php --- Model/Controller/ResultPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Model/Controller/ResultPlugin.php b/Model/Controller/ResultPlugin.php index f68c667..d58a5c8 100644 --- a/Model/Controller/ResultPlugin.php +++ b/Model/Controller/ResultPlugin.php @@ -82,7 +82,7 @@ public function aroundRenderResult( $ignoredStrings = $this->scopeConfig->getValue( 'mfrocketjavascript/general/ignore_deferred_javascript_with', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE); + \Magento\Store\Model\ScopeInterface::SCOPE_STORE) ?: ''; $ignoredStrings = explode("\n", str_replace("\r", "\n", $ignoredStrings)); foreach ($ignoredStrings as $key => $ignoredString) { $ignoredString = trim($ignoredString); From b9affd03df1a67ab3b166789f15e580358e34b7a Mon Sep 17 00:00:00 2001 From: Magefan Date: Thu, 16 Nov 2023 12:44:57 +0200 Subject: [PATCH 090/116] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7b115a3..ccf85ae 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,8 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Facebook Pixel Extension](https://magefan.com/magento-2-facebook-pixel-extension) * [Magento 2 Price History](https://magefan.com/magento-2-price-history) * [Magento 2 Google Customer Reviews](https://magefan.com/magento-2-google-customer-reviews) - + * [Magento 2 Email Attachments](https://magefan.com/magento-2-email-attachments) + ### [Magento 2 Blog Extensions](https://magefan.com/magento-2-extensions/blog-extensions) * [Magento 2 Blog Extension](https://magefan.com/magento2-blog-extension) From e9e345e09a10f1b65c83a2bca58b992d116e0e6d Mon Sep 17 00:00:00 2001 From: Magefan Date: Thu, 23 Nov 2023 10:06:18 +0200 Subject: [PATCH 091/116] Update composer.json --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index b4c4f1e..f307038 100644 --- a/composer.json +++ b/composer.json @@ -1,15 +1,15 @@ { "name": "magefan/module-rocketjavascript", - "description": "Move all javascripts to the footer on Magento 2 store.", + "description": "Move all javascript to the footer on Magento 2 store.", "require": { - "magefan/module-community" : ">=2.1.16" + "magefan/module-community" : ">=2.1.17" }, "suggest": { "magefan/module-webp": "Install WebP Optimized Images to serve images in the next-gen format. Use coupon code COMPOSER-FAN to get 10% discount on magefan.com.", "magefan/module-lazyload": "Install Lazy Load to defer offscreen images loading." }, "type": "magento2-module", - "version": "2.1.8", + "version": "2.1.9", "authors": [ { "name": "Magefan", From 022358858740a0577db040d88eaf244f8a76987f Mon Sep 17 00:00:00 2001 From: Magefan Date: Thu, 30 Nov 2023 16:32:30 +0200 Subject: [PATCH 092/116] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ccf85ae..1bd0c69 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Price History](https://magefan.com/magento-2-price-history) * [Magento 2 Google Customer Reviews](https://magefan.com/magento-2-google-customer-reviews) * [Magento 2 Email Attachments](https://magefan.com/magento-2-email-attachments) - + * [Magento 2 Cron Schedule](https://magefan.com/magento-2-cron-schedule) ### [Magento 2 Blog Extensions](https://magefan.com/magento-2-extensions/blog-extensions) * [Magento 2 Blog Extension](https://magefan.com/magento2-blog-extension) From c4ba4a58abe8afe19c3c6cb446a1f373a6d7ee42 Mon Sep 17 00:00:00 2001 From: Serhii Kozak Date: Tue, 30 Jan 2024 12:34:25 +0200 Subject: [PATCH 093/116] 10193-Remove-UTM-from-links --- Block/Adminhtml/System/Config/Form/Info.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Block/Adminhtml/System/Config/Form/Info.php b/Block/Adminhtml/System/Config/Form/Info.php index 73bb3f6..5401914 100755 --- a/Block/Adminhtml/System/Config/Form/Info.php +++ b/Block/Adminhtml/System/Config/Form/Info.php @@ -21,7 +21,7 @@ class Info extends \Magefan\Community\Block\Adminhtml\System\Config\Form\Info */ protected function getModuleUrl() { - return 'https://mage' . 'fan.com/rocket-javascript-deferred-javascript?utm_source=m2admin_rocket_javascript_config&utm_medium=link&utm_campaign=regular'; + return 'https://mage' . 'fan.com/rocket-javascript-deferred-javascript'; } /** From ac3e5b4dfa8a4750f81ccf4dcd19cad2ee29e7de Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 30 Jan 2024 15:33:28 +0200 Subject: [PATCH 094/116] Update README.md --- README.md | 85 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 49 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 1bd0c69..cca8ef7 100644 --- a/README.md +++ b/README.md @@ -100,41 +100,26 @@ There isn't a way for us to reply to reviews and the Q&A moderation is very slow The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensource.org/licenses/osl-3.0.php). ## [Magento 2 Extensions](https://magefan.com/magento-2-extensions) by Magefan + ### [Magento 2 Admin Panel Extensions](https://magefan.com/magento-2-extensions/admin-extensions) - * [Magento 2 Automatic Related Products](https://magefan.com/magento-2-automatic-related-products) - * [Magento 2 Automatic Related Products Plus](https://magefan.com/magento-2-automatic-related-products/pricing) + * [Magento 2 Edit Order Extension](https://magefan.com/magento-2-edit-order-extension) * [Magento 2 Better Order Grid Extension](https://magefan.com/magento-2-better-order-grid-extension) - * [Magento 2 Product Tabs Extension](https://magefan.com/magento-2/extensions/product-tabs) * [Magento 2 Extended Product Grid](https://magefan.com/magento-2-product-grid-inline-editor) - * [Magento 2 Google Shopping Feed](https://magefan.com/magento-2-google-shopping-feed-extension) - * [Magento 2 Google Tag Manager](https://magefan.com/magento-2-google-tag-manager) + * [Magento 2 Product Tabs Extension](https://magefan.com/magento-2/extensions/product-tabs) + * [Magento 2 Facebook Pixel Extension](https://magefan.com/magento-2-facebook-pixel-extension) + * [Magento 2 Email Attachments](https://magefan.com/magento-2-email-attachments) * [Magento 2 Admin View Extension](https://magefan.com/magento-2-admin-view-extension) - * [Magento 2 Zero Downtime Deployment](https://magefan.com/blog/magento-2-zero-downtime-deployment) * [Magento 2 Admin Email Notifications](https://magefan.com/magento-2-admin-email-notifications) - * [Magento 2 Dynamic Categories](https://magefan.com/magento-2-dynamic-categories) - * [Magento 2 Convert Guest to Customer Extension](https://magefan.com/magento2-convert-guest-to-customer) - * [Magento 2 Conflict Detector Extension](https://magefan.com/magento2-conflict-detector) * [Magento 2 Login As Customer Extension](https://magefan.com/login-as-customer-magento-2-extension) - * [Magento 2 Mautic Integration Extension](https://magefan.com/magento-2-mautic-extension) - * [Magento 2 CMS Display Rules Extension](https://magefan.com/magento-2-cms-display-rules-extension) - * [Magento 2 Zendesk Chat Extension](https://magefan.com/magento-2-zendesk-chat-extension) - * [Magento 2 YouTube Widget Extension](https://magefan.com/magento2-youtube-extension) - * [Magento 2 CLI Extension](https://magefan.com/magento2-cli-extension) - * [Magento 2 Facebook Pixel Extension](https://magefan.com/magento-2-facebook-pixel-extension) - * [Magento 2 Price History](https://magefan.com/magento-2-price-history) - * [Magento 2 Google Customer Reviews](https://magefan.com/magento-2-google-customer-reviews) - * [Magento 2 Email Attachments](https://magefan.com/magento-2-email-attachments) - * [Magento 2 Cron Schedule](https://magefan.com/magento-2-cron-schedule) -### [Magento 2 Blog Extensions](https://magefan.com/magento-2-extensions/blog-extensions) - * [Magento 2 Blog Extension](https://magefan.com/magento2-blog-extension) - * [Magento 2 Blog Plus Extension](https://magefan.com/magento2-blog-extension/pricing) - * [Magento 2 Blog Extra Extension](https://magefan.com/magento2-blog-extension/pricing) - * [Magento 2 Multi Blog Extension](https://magefan.com/magento-2-multi-blog-extension) - * [Magento 2 AMP Blog Extension](https://magefan.com/magento-2-amp-blog-extension) - * [Magento 2 Product Widget Advanced Extension](https://magefan.com/magento-2-product-widget) +### [Magento 2 Google Extensions](https://magefan.com/magento-2-extensions/google-extensions) + * [Magento 2 Google Indexing API](https://magefan.com/magento-2-google-indexing-api) + * [Magento 2 Google Analytics 4 Extension](https://magefan.com/magento-2-google-analytics-4) + * [Magento 2 Google Tag Manager](https://magefan.com/magento-2-google-tag-manager) + * [Magento 2 Google Shopping Feed](https://magefan.com/magento-2-google-shopping-feed-extension) + * [Magento 2 Google Customer Reviews](https://magefan.com/magento-2-google-customer-reviews) ### [Magento 2 SEO Extensions](https://magefan.com/magento-2-extensions/magento-2-seo-extensions) @@ -142,40 +127,68 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Rich Snippets Extension](https://magefan.com/magento-2-rich-snippets) * [Magento 2 HTML Sitemap Extension](https://magefan.com/magento-2-html-sitemap-extension) * [Magento 2 XML Sitemap Extension](https://magefan.com/magento-2-xml-sitemap-extension) - * [Magento 2 SEO Suite Ultimate Extension](https://magefan.com/magento-2-seo-suite-ultimate-extension) * [Magento 2 Twitter Cards Extension](https://magefan.com/magento-2-twitter-cards-extension) * [Magento 2 Facebook Open Graph Extension](https://magefan.com/magento-2-open-graph-extension-og-tags) - * [Magento 2 Hreflang Tags Extension](https://magefan.com/magento2-alternate-hreflang-extension) - * [Magento 2 Google Analytics 4 Extension](https://magefan.com/magento-2-google-analytics-4) +### [Magento 2 Blog Extensions](https://magefan.com/magento-2-extensions/blog-extensions) + + * [Magento 2 Blog Extension](https://magefan.com/magento2-blog-extension) + * [Magento 2 Blog Plus Extension](https://magefan.com/magento2-blog-extension/pricing) + * [Magento 2 Blog Extra Extension](https://magefan.com/magento2-blog-extension/pricing) + * [Magento 2 Multi Blog Extension](https://magefan.com/magento-2-multi-blog-extension) + * [Magento 2 Product Widget Advanced Extension](https://magefan.com/magento-2-product-widget) + +### [Magento 2 Marketing Automation Extensions](https://magefan.com/magento-2-extensions/magento-marketing-automation) + +* [Magento 2 Dynamic Categories](https://magefan.com/magento-2-dynamic-categories) +* [Magento 2 CMS Display Rules Extension](https://magefan.com/magento-2-cms-display-rules-extension) +* [Magento 2 Automatic Related Products](https://magefan.com/magento-2-automatic-related-products) +* [Magento 2 Price History](https://magefan.com/magento-2-price-history) +* [Magento 2 Mautic Integration Extension](https://magefan.com/magento-2-mautic-extension) +* [Magento 2 YouTube Widget Extension](https://magefan.com/magento2-youtube-extension) + + ### [Magento 2 Cart Extensions](https://magefan.com/magento-2-extensions/cart-extensions) * [Better Magento 2 Checkout Extension](https://magefan.com/better-magento-2-checkout-extension) * [Magento 2 Coupon Code Link](https://magefan.com/magento-2-coupon-code-link) + * [Magento 2 Convert Guest to Customer Extension](https://magefan.com/magento2-convert-guest-to-customer) ### [Magento 2 Speed Optimization Extensions](https://magefan.com/magento-2-extensions/speed-optimization-extensions) * [Magento 2 Lazy Load Extension](https://magefan.com/magento-2-image-lazy-load-extension) * [Magento 2 WebP Optimized Images Extension](https://magefan.com/magento-2-webp-optimized-images) + * [Magento 2 Rocket JavaScript Extension](https://magefan.com/rocket-javascript-deferred-javascript) ### [Magento 2 Multi-Language Extensions](https://magefan.com/magento-2-extensions/multi-language-extensions) + * [Magento 2 Hreflang Tags Extension](https://magefan.com/magento2-alternate-hreflang-extension) * [Magento 2 Auto Currency Switcher Extension](https://magefan.com/magento-2-currency-switcher-auto-currency-by-country) * [Magento 2 Auto Language Switcher Extension](https://magefan.com/magento-2-auto-language-switcher) * [Magento 2 GeoIP Switcher Extension](https://magefan.com/magento-2-geoip-switcher-extension) * [Magento 2 Translation Extension](https://magefan.com/magento-2-translation-extension) - * [Magento 2 Translation Plus Extension](https://magefan.com/magento-2-translation-extension/pricing) + +### Developers Tools + + * [Magento 2 Zero Downtime Deployment](https://magefan.com/blog/magento-2-zero-downtime-deployment) + * [Magento 2 Cron Schedule](https://magefan.com/magento-2-cron-schedule) + * [Magento 2 CLI Extension](https://magefan.com/magento2-cli-extension) + * [Magento 2 Conflict Detector Extension](https://magefan.com/magento2-conflict-detector) ### Magento 2 Point of Sale + * [Magento 2 POS System](https://magefan.com/magento-pos-system) - - ### Shopware Extensions - * [Shopware WebP Extension](https://magefan.com/shopware/extensions/webp) - * [Shopware Blog Extension](https://magefan.com/shopware/extensions/blog) + + ### Magento 2 Theme + + * [Optimized Magento 2 Theme](https://magefan.com/optimized-magento-2-theme) ### Shopify Apps + * [Shopify Login As Customer](https://apps.shopify.com/login-as-customer) * [Shopify Blog](https://apps.shopify.com/magefan-blog) - ### Magento 2 Theme - * [Optimized Magento 2 Theme](https://magefan.com/optimized-magento-2-theme) + ### Shopware Extensions + + * [Shopware WebP Extension](https://magefan.com/shopware/extensions/webp) + * [Shopware Blog Extension](https://magefan.com/shopware/extensions/blog) From b5bc81dadec7fef2f9bdc68ea7f6c1da88b3db68 Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 30 Jan 2024 15:33:43 +0200 Subject: [PATCH 095/116] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index cca8ef7..bf98ede 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,6 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Lazy Load Extension](https://magefan.com/magento-2-image-lazy-load-extension) * [Magento 2 WebP Optimized Images Extension](https://magefan.com/magento-2-webp-optimized-images) - * [Magento 2 Rocket JavaScript Extension](https://magefan.com/rocket-javascript-deferred-javascript) ### [Magento 2 Multi-Language Extensions](https://magefan.com/magento-2-extensions/multi-language-extensions) From d08825e7cda7d1a8efbcb42aa6951a5808933983 Mon Sep 17 00:00:00 2001 From: Magefan Date: Fri, 22 Mar 2024 14:16:08 +0200 Subject: [PATCH 096/116] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index bf98ede..8732c66 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,7 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou ### [Magento 2 Admin Panel Extensions](https://magefan.com/magento-2-extensions/admin-extensions) + * [Magento 2 Admin Action Log](https://magefan.com/magento-2-admin-action-log) * [Magento 2 Edit Order Extension](https://magefan.com/magento-2-edit-order-extension) * [Magento 2 Better Order Grid Extension](https://magefan.com/magento-2-better-order-grid-extension) * [Magento 2 Extended Product Grid](https://magefan.com/magento-2-product-grid-inline-editor) From 53fdfcbe0176428609f97d56fb817183842604e0 Mon Sep 17 00:00:00 2001 From: Magefan Date: Fri, 12 Apr 2024 11:20:51 +0300 Subject: [PATCH 097/116] Update README.md --- README.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 8732c66..39dc0ac 100644 --- a/README.md +++ b/README.md @@ -141,13 +141,13 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou ### [Magento 2 Marketing Automation Extensions](https://magefan.com/magento-2-extensions/magento-marketing-automation) +* [Magento 2 Product Labels](https://magefan.com/magento-2-product-labels) * [Magento 2 Dynamic Categories](https://magefan.com/magento-2-dynamic-categories) * [Magento 2 CMS Display Rules Extension](https://magefan.com/magento-2-cms-display-rules-extension) * [Magento 2 Automatic Related Products](https://magefan.com/magento-2-automatic-related-products) * [Magento 2 Price History](https://magefan.com/magento-2-price-history) * [Magento 2 Mautic Integration Extension](https://magefan.com/magento-2-mautic-extension) -* [Magento 2 YouTube Widget Extension](https://magefan.com/magento2-youtube-extension) - +* [Magento 2 YouTube Widget Extension](https://magefan.com/magento2-youtube-extension) ### [Magento 2 Cart Extensions](https://magefan.com/magento-2-extensions/cart-extensions) @@ -168,7 +168,7 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 GeoIP Switcher Extension](https://magefan.com/magento-2-geoip-switcher-extension) * [Magento 2 Translation Extension](https://magefan.com/magento-2-translation-extension) -### Developers Tools +### [Developers Tools](https://magefan.com/magento-2-extensions/developer-tools) * [Magento 2 Zero Downtime Deployment](https://magefan.com/blog/magento-2-zero-downtime-deployment) * [Magento 2 Cron Schedule](https://magefan.com/magento-2-cron-schedule) @@ -183,12 +183,8 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Optimized Magento 2 Theme](https://magefan.com/optimized-magento-2-theme) - ### Shopify Apps + ### [Shopify Apps](https://magefan.com/shopify/apps) * [Shopify Login As Customer](https://apps.shopify.com/login-as-customer) * [Shopify Blog](https://apps.shopify.com/magefan-blog) - - ### Shopware Extensions - - * [Shopware WebP Extension](https://magefan.com/shopware/extensions/webp) - * [Shopware Blog Extension](https://magefan.com/shopware/extensions/blog) + * [Shopify Size Chart](https://magefan.com/shopify/apps/size-chart) From 8666d1775f125cf9a5dd2daf44d3571a12f246d4 Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 30 Apr 2024 13:53:32 +0300 Subject: [PATCH 098/116] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 39dc0ac..2fc759a 100644 --- a/README.md +++ b/README.md @@ -142,6 +142,7 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou ### [Magento 2 Marketing Automation Extensions](https://magefan.com/magento-2-extensions/magento-marketing-automation) * [Magento 2 Product Labels](https://magefan.com/magento-2-product-labels) +* [Magento 2 Base Price](https://magefan.com/magento-2-base-price) * [Magento 2 Dynamic Categories](https://magefan.com/magento-2-dynamic-categories) * [Magento 2 CMS Display Rules Extension](https://magefan.com/magento-2-cms-display-rules-extension) * [Magento 2 Automatic Related Products](https://magefan.com/magento-2-automatic-related-products) From 2fd85be2b35ab03820329aaa2bee9dec5ceece5a Mon Sep 17 00:00:00 2001 From: Yuriy Date: Fri, 31 May 2024 12:15:26 +0300 Subject: [PATCH 099/116] 11052-speed-optimization-extension --- Model/Config/Backend/DevSettings.php | 91 ++++ Model/Controller/ResultPlugin.php | 8 +- Observer/AdminSystemConfigChangedSection.php | 461 ++++++++++++++++++ .../Deploy/Package/Bundle/RequireJsPlugin.php | 4 +- .../Controller/Result/JsFooterPlugin.php | 59 +++ Setup/Patch/Schema/ChangePath.php | 80 +++ etc/adminhtml/events.xml | 14 + etc/adminhtml/system.xml | 47 +- etc/config.xml | 8 +- etc/frontend/di.xml | 3 + 10 files changed, 756 insertions(+), 19 deletions(-) create mode 100644 Model/Config/Backend/DevSettings.php create mode 100644 Observer/AdminSystemConfigChangedSection.php create mode 100644 Plugin/Frontend/Magento/Theme/Controller/Result/JsFooterPlugin.php create mode 100644 Setup/Patch/Schema/ChangePath.php create mode 100644 etc/adminhtml/events.xml diff --git a/Model/Config/Backend/DevSettings.php b/Model/Config/Backend/DevSettings.php new file mode 100644 index 0000000..4ba32be --- /dev/null +++ b/Model/Config/Backend/DevSettings.php @@ -0,0 +1,91 @@ + 'dev/js/merge_files', + 'mfrocketjavascript/general/minify_files' => 'dev/js/minify_files', + 'mfrocketjavascript/javascript_bundling/enabled' => 'dev/js/enable_js_bundling', + ]; + + /** + * @var RequestInterface + */ + private $request; + + /** + * DevSettings constructor. + * @param Context $context + * @param Registry $registry + * @param ScopeConfigInterface $config + * @param TypeListInterface $cacheTypeList + * @param RequestInterface $request + * @param AbstractResource|null $resource + * @param AbstractDb|null $resourceCollection + * @param array $data + */ + public function __construct( + Context $context, + Registry $registry, + ScopeConfigInterface $config, + TypeListInterface $cacheTypeList, + RequestInterface $request, + AbstractResource $resource = null, + AbstractDb $resourceCollection = null, + array $data = [] + ) { + $this->request = $request; + parent::__construct($context, $registry, $config, $cacheTypeList, $resource, $resourceCollection, $data); + } + + /** + * @return DevSettings|void + */ + public function afterLoad() + { + $scopeTypes = [ + StoreScopeInterface::SCOPE_WEBSITES, + StoreScopeInterface::SCOPE_WEBSITE, + StoreScopeInterface::SCOPE_STORES, + StoreScopeInterface::SCOPE_STORE + ]; + + $scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT; + $scopeCode = null; + + foreach ($scopeTypes as $scope) { + $param = $this->request->getParam($scope); + if ($param) { + $scopeType = $scope; + $scopeCode = $param; + } + } + + $devSettingsValue = $this->_config->getValue( + self::KEY_VALUE_RELATION[$this->getData('path')], + $scopeType, + $scopeCode + ); + $this->setData('value', $devSettingsValue); + } +} diff --git a/Model/Controller/ResultPlugin.php b/Model/Controller/ResultPlugin.php index d58a5c8..dc2f862 100644 --- a/Model/Controller/ResultPlugin.php +++ b/Model/Controller/ResultPlugin.php @@ -81,7 +81,7 @@ public function aroundRenderResult( } $ignoredStrings = $this->scopeConfig->getValue( - 'mfrocketjavascript/general/ignore_deferred_javascript_with', + 'mfrocketjavascript/deferred_javascript/ignore_deferred_javascript_with', \Magento\Store\Model\ScopeInterface::SCOPE_STORE) ?: ''; $ignoredStrings = explode("\n", str_replace("\r", "\n", $ignoredStrings)); foreach ($ignoredStrings as $key => $ignoredString) { @@ -150,11 +150,11 @@ private function isEnabled() 'mfrocketjavascript/general/enabled', \Magento\Store\Model\ScopeInterface::SCOPE_STORE ) && $this->scopeConfig->getValue( - 'mfrocketjavascript/general/enable_deferred_javascript', + 'mfrocketjavascript/deferred_javascript/enabled', \Magento\Store\Model\ScopeInterface::SCOPE_STORE ); - + if ($enabled) { /* check if Amasty AMP enabled */ @@ -194,7 +194,7 @@ private function isAllowedOnPage() $this->allowedOnPage = false; $spPages = $this->scopeConfig->getValue( - 'mfrocketjavascript/general/disallowed_pages_for_deferred_js', + 'mfrocketjavascript/deferred_javascript/disallowed_pages_for_deferred_js', \Magento\Store\Model\ScopeInterface::SCOPE_STORE ); $spPages = explode("\n", str_replace("\r", "\n", $spPages)); diff --git a/Observer/AdminSystemConfigChangedSection.php b/Observer/AdminSystemConfigChangedSection.php new file mode 100644 index 0000000..4827d42 --- /dev/null +++ b/Observer/AdminSystemConfigChangedSection.php @@ -0,0 +1,461 @@ + 'enable_js_bundling' + ]; + + /** + * @var ScopeConfigInterface + */ + private $scopeConfig; + + /** + * @var ConfigLoader + */ + private $configLoader; + + /** + * @var TransactionFactory + */ + private $transactionFactory; + + /** + * @var ConfigStructure + */ + private $configStructure; + + /** + * @var SettingChecker + */ + private $settingChecker; + + /** + * @var ConfigValueFactory + */ + private $configValueFactory; + + /** + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @var MagentoConfig + */ + private $magentoConfig; + + /** + * @var ReinitableConfigInterface + */ + private $appConfig; + + /** + * @var null + */ + private $scope = null; + + /** + * @var null + */ + private $store = null; + + /** + * @var null + */ + private $website = null; + + /** + * @var null + */ + private $scopeId = null; + + /** + * @var null + */ + private $scopeCode = null; + + /** + * AdminSystemConfigChangedSection constructor. + * @param ScopeConfigInterface $scopeConfig + * @param ConfigLoader $configLoader + * @param TransactionFactory $transactionFactory + * @param ConfigStructure $configStructure + * @param ConfigValueFactory $configValueFactory + * @param StoreManagerInterface $storeManager + * @param MagentoConfig $magentoConfig + * @param ReinitableConfigInterface $appConfig + * @param SettingChecker|null $settingChecker + */ + public function __construct( + ScopeConfigInterface $scopeConfig, + ConfigLoader $configLoader, + TransactionFactory $transactionFactory, + ConfigStructure $configStructure, + ConfigValueFactory $configValueFactory, + StoreManagerInterface $storeManager, + MagentoConfig $magentoConfig, + ReinitableConfigInterface $appConfig, + SettingChecker $settingChecker = null + ) { + $this->scopeConfig = $scopeConfig; + $this->configLoader = $configLoader; + $this->transactionFactory = $transactionFactory; + $this->configStructure = $configStructure; + $this->configValueFactory = $configValueFactory; + $this->storeManager = $storeManager; + $this->magentoConfig = $magentoConfig; + $this->appConfig = $appConfig; + $this->settingChecker = $settingChecker ?: ObjectManager::getInstance()->get(SettingChecker::class); + } + + /** + * @param Observer $observer + * @return void + * @throws \Exception + */ + public function execute(Observer $observer) + { + $this->store = $observer->getData('store') ?? null; + $this->website = $observer->getData('website') ?? null; + + $this->initScope(); + + $groups = $this->scopeConfig->getValue('mfrocketjavascript', $this->scope, $this->scopeCode); + + if (!isset($groups['general']) && !isset($groups['javascript_bundling'])) { + return; + } + + $developerJsFields = []; + + foreach ($groups['general'] as $key => $value) { + if (in_array($key, self::JS_MERGE_ARRAY)) { + $developerJsFields['fields'][$key] = ['value' => $value]; + } + } + + foreach ($groups['javascript_bundling'] as $key => $value) { + if (key_exists($key, self::JS_BUNDLE_ARRAY)) { + $developerJsFields['fields'][self::JS_BUNDLE_ARRAY[$key]] = ['value' => $value]; + } + } + + $developerGroup['js'] = $developerJsFields; + $this->proceedTransaction($developerGroup, 'dev'); + } + + /** + * @param $groups + * @param $sectionId + * @throws \Exception + */ + private function proceedTransaction($groups, $sectionId) + { + $oldConfig = $this->configLoader->getConfigByPath( + 'mfrocketjavascript', + $this->scope, + $this->scopeId, + true + ); + + /** @var Transaction $deleteTransaction */ + $deleteTransaction = $this->transactionFactory->create(); + /** @var Transaction $saveTransaction */ + $saveTransaction = $this->transactionFactory->create(); + + $extraOldGroups = []; + + foreach ($groups as $groupId => $groupData) { + $this->processGroup( + $groupId, + $groupData, + $groups, + $sectionId, + $extraOldGroups, + $oldConfig, + $saveTransaction, + $deleteTransaction + ); + } + + try { + $deleteTransaction->delete(); + $saveTransaction->save(); + $this->appConfig->reinit(); + } catch (\Exception $e) { + $this->appConfig->reinit(); + throw $e; + } + } + + /** + * Process group data + * + * @param string $groupId + * @param array $groupData + * @param array $groups + * @param string $sectionPath + * @param array $extraOldGroups + * @param array $oldConfig + * @param Transaction $saveTransaction + * @param Transaction $deleteTransaction + * @return void + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.NPathComplexity) + */ + private function processGroup( + $groupId, + array $groupData, + array $groups, + $sectionPath, + array &$extraOldGroups, + array &$oldConfig, + Transaction $saveTransaction, + Transaction $deleteTransaction + ) { + $groupPath = $sectionPath . '/' . $groupId; + + if (isset($groupData['fields'])) { + /** @var Group $group */ + $group = $this->configStructure->getElement($groupPath); + + // set value for group field entry by fieldname + // use extra memory + $fieldsetData = []; + foreach ($groupData['fields'] as $fieldId => $fieldData) { + $fieldsetData[$fieldId] = $fieldData['value'] ?? null; + } + + foreach ($groupData['fields'] as $fieldId => $fieldData) { + $isReadOnly = $this->settingChecker->isReadOnly( + $groupPath . '/' . $fieldId, + $this->scope, + $this->scopeCode + ); + + if ($isReadOnly) { + continue; + } + + $field = $this->getField($sectionPath, $groupId, $fieldId); + /** @var ValueInterface $backendModel */ + $backendModel = $field->hasBackendModel() + ? $field->getBackendModel() + : $this->configValueFactory->create(); + + if (!isset($fieldData['value'])) { + $fieldData['value'] = null; + } + + if ($field->getType() == 'multiline' && is_array($fieldData['value'])) { + $fieldData['value'] = trim(implode(PHP_EOL, $fieldData['value'])); + } + + $data = [ + 'field' => $fieldId, + 'groups' => $groups, + 'group_id' => $group->getId(), + 'scope' => $this->scope, + 'scope_id' => $this->scopeId, + 'scope_code' => $this->scopeCode, + 'field_config' => $field->getData(), + 'fieldset_data' => $fieldsetData + ]; + $backendModel->addData($data); + $this->checkSingleStoreMode($field, $backendModel); + + $path = $this->getFieldPath($field, $fieldId, $oldConfig, $extraOldGroups); + $backendModel->setPath($path)->setValue($fieldData['value']); + + $inherit = !empty($fieldData['inherit']); + if (isset($oldConfig[$path])) { + $backendModel->setConfigId($oldConfig[$path]['config_id']); + + /** + * Delete config data if inherit + */ + if (!$inherit) { + $saveTransaction->addObject($backendModel); + } else { + $deleteTransaction->addObject($backendModel); + } + } elseif (!$inherit) { + $backendModel->unsConfigId(); + $saveTransaction->addObject($backendModel); + } + } + } + } + + /** + * Get field object + * + * @param string $sectionId + * @param string $groupId + * @param string $fieldId + * @return Field + */ + private function getField(string $sectionId, string $groupId, string $fieldId): Field + { + /** @var Group $group */ + $group = $this->configStructure->getElement($sectionId . '/' . $groupId); + $fieldPath = $group->getPath() . '/' . $this->getOriginalFieldId($group, $fieldId); + $field = $this->configStructure->getElement($fieldPath); + + return $field; + } + + /** + * Map field name if they were cloned + * + * @param Group $group + * @param string $fieldId + * @return string + */ + private function getOriginalFieldId(Group $group, string $fieldId): string + { + if ($group->shouldCloneFields()) { + $cloneModel = $group->getCloneModel(); + + /** @var Field $field */ + foreach ($group->getChildren() as $field) { + foreach ($cloneModel->getPrefixes() as $prefix) { + if ($prefix['field'] . $field->getId() === $fieldId) { + $fieldId = $field->getId(); + break(2); + } + } + } + } + + return $fieldId; + } + + /** + * Set correct scope if isSingleStoreMode = true + * + * @param Field $fieldConfig + * @param ValueInterface $dataObject + * @return void + */ + protected function checkSingleStoreMode(Field $fieldConfig, $dataObject) + { + $isSingleStoreMode = $this->storeManager->isSingleStoreMode(); + if (!$isSingleStoreMode) { + return; + } + if (!$fieldConfig->showInDefault()) { + $websites = $this->storeManager->getWebsites(); + $singleStoreWebsite = array_shift($websites); + $dataObject->setScope('websites'); + $dataObject->setWebsiteCode($singleStoreWebsite->getCode()); + $dataObject->setScopeCode($singleStoreWebsite->getCode()); + $dataObject->setScopeId($singleStoreWebsite->getId()); + } + } + + /** + * Get field path + * + * @param Field $field + * @param string $fieldId Need for support of clone_field feature + * @param array $oldConfig Need for compatibility with _processGroup() + * @param array $extraOldGroups Need for compatibility with _processGroup() + * @return string + */ + private function getFieldPath(Field $field, string $fieldId, array &$oldConfig, array &$extraOldGroups): string + { + $path = $field->getGroupPath() . '/' . $fieldId; + + /** + * Look for custom defined field path + */ + $configPath = $field->getConfigPath(); + if ($configPath && strrpos($configPath, '/') > 0) { + // Extend old data with specified section group + $configGroupPath = substr($configPath, 0, strrpos($configPath, '/')); + if (!isset($extraOldGroups[$configGroupPath])) { + $oldConfig = $this->magentoConfig->extendConfig($configGroupPath, true, $oldConfig); + $extraOldGroups[$configGroupPath] = true; + } + $path = $configPath; + } + + return $path; + } + + /** + * Get scope name and scopeId + * + * @todo refactor to scope resolver + * @return void + */ + private function initScope() + { + if ($this->website === null) { + $this->website = ''; + } + if ($this->store === null) { + $this->store = ''; + } + + if ($this->store) { + $scope = 'stores'; + $store = $this->storeManager->getStore($this->store); + $scopeId = (int)$store->getId(); + $scopeCode = $store->getCode(); + } elseif ($this->website) { + $scope = 'websites'; + $website = $this->storeManager->getWebsite($this->website); + $scopeId = (int)$website->getId(); + $scopeCode = $website->getCode(); + } else { + $scope = 'default'; + $scopeId = 0; + $scopeCode = ''; + } + $this->scope = $scope; + $this->scopeId = $scopeId; + $this->scopeCode = $scopeCode; + } +} diff --git a/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php b/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php index 042cf5d..edae6c0 100644 --- a/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php +++ b/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php @@ -18,12 +18,12 @@ class RequireJsPlugin /** * @var string */ - const BUNDLING_OPTIMIZATION_ENABLED = 'mfrocketjavascript/general/enable_js_bundling_optimization'; + const BUNDLING_OPTIMIZATION_ENABLED = 'mfrocketjavascript/javascript_bundling/enabled'; /** * @var string */ - const INCLUDE_IN_BUNDLING = 'mfrocketjavascript/general/included_in_bundling'; + const INCLUDE_IN_BUNDLING = 'mfrocketjavascript/javascript_bundling/included_in_bundling'; /** * @var \Magento\Framework\App\Config\ScopeConfigInterface diff --git a/Plugin/Frontend/Magento/Theme/Controller/Result/JsFooterPlugin.php b/Plugin/Frontend/Magento/Theme/Controller/Result/JsFooterPlugin.php new file mode 100644 index 0000000..df5cc04 --- /dev/null +++ b/Plugin/Frontend/Magento/Theme/Controller/Result/JsFooterPlugin.php @@ -0,0 +1,59 @@ +scopeConfig = $scopeConfig; + } + + /** + * @param \Magento\Theme\Controller\Result\JsFooterPlugin $subject + * @param \Closure $proceed + * @param Layout $argumentSubject + * @param Layout $result + * @param ResponseInterface $httpResponse + * @return Layout|mixed + */ + public function aroundAfterRenderResult( + \Magento\Theme\Controller\Result\JsFooterPlugin $subject, + \Closure $proceed, + Layout $argumentSubject, + Layout $result, + ResponseInterface $httpResponse + ) { + $jsRjOptimization = $this->scopeConfig->isSetFlag(self::XML_PATH_RJ_DEFERRED_ENABLED, ScopeInterface::SCOPE_STORE) + && $this->scopeConfig->isSetFlag('mfrocketjavascript/general/enabled', ScopeInterface::SCOPE_STORE); + if ($jsRjOptimization) { + return $result; + } + + return $proceed($argumentSubject, $result, $httpResponse); + } +} diff --git a/Setup/Patch/Schema/ChangePath.php b/Setup/Patch/Schema/ChangePath.php new file mode 100644 index 0000000..47b4d2a --- /dev/null +++ b/Setup/Patch/Schema/ChangePath.php @@ -0,0 +1,80 @@ +schemaSetup = $schemaSetup; + } + + /** + * {@inheritdoc} + */ + public function apply() + { + $this->schemaSetup->startSetup(); + $connection = $this->schemaSetup->getConnection(); + + $table = $this->schemaSetup->getTable('core_config_data'); + + $changedConfigurationFields = [ + 'mfrocketjavascript/general/enable_deferred_javascript' => 'mfrocketjavascript/deferred_javascript/enabled', + 'mfrocketjavascript/general/disallowed_pages_for_deferred_js' => 'mfrocketjavascript/deferred_javascript/disallowed_pages_for_deferred_js', + 'mfrocketjavascript/general/ignore_deferred_javascript_with' => 'mfrocketjavascript/deferred_javascript/ignore_deferred_javascript_with', + + 'mfrocketjavascript/general/enable_js_bundling_optimization' => 'mfrocketjavascript/javascript_bundling/enabled', + 'mfrocketjavascript/general/included_in_bundling' => 'mfrocketjavascript/javascript_bundling/included_in_bundling', + ]; + + foreach ($changedConfigurationFields as $oldPath => $newPath) { + $connection->update( + $table, + ['path' => $newPath], + ['path = ?' => $oldPath] + ); + } + + $this->schemaSetup->endSetup(); + } + + /** + * @return array + */ + public function getAliases() + { + return []; + } + + /** + * @return array + */ + public static function getDependencies() + { + return []; + } +} diff --git a/etc/adminhtml/events.xml b/etc/adminhtml/events.xml new file mode 100644 index 0000000..cbf7441 --- /dev/null +++ b/etc/adminhtml/events.xml @@ -0,0 +1,14 @@ + + + + + + + diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index a2d2b26..527492b 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -27,34 +27,59 @@ Magefan\Community\Block\Adminhtml\System\Config\Form\ProductKeyField - - + + + Magento\Config\Model\Config\Source\Yesno + Magefan\RocketJavaScript\Model\Config\Backend\DevSettings + + + + Magento\Config\Model\Config\Source\Yesno + Magefan\RocketJavaScript\Model\Config\Backend\DevSettings + Minification is not applied in developer mode. + + + + + + If enabled all JavaScript on storefront will be moved to the end of the page. Magento\Config\Model\Config\Source\Yesno - - + + - 1 + 1 Enter page patches each in a new line. "*" means any path, you can use it at the beginning or end. - + - 1 + 1 data-rocketjavascript="false" will automatically be ignored. Example <script data-rocketjavascript="false">/* some script *</script>]]> - - + + + + + + Magento\Config\Model\Config\Source\Yesno + Magefan\RocketJavaScript\Model\Config\Backend\DevSettings + + + + + 1 + Please note that this option only works with enabled JavaScript Bundling (Configuration > Advanced > Developer > JavaScript Settings > Enable JavaScript Bundling). Magento\Config\Model\Config\Source\Yesno - + - 1 + 1 List of files that included in JS bundle. diff --git a/etc/config.xml b/etc/config.xml index 56f71fd..6ccc965 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -13,11 +13,15 @@ RocketJavaScript 1 - 1 + + + 1 checkout/* onestepcheckout/* www.googletagmanager.com + + 1 jquery.min.js mage/common.min.js @@ -135,7 +139,7 @@ Magento_Customer/template/authentication-popup.html Magento_Ui/templates/collection.html Magento_Ui/template/messages.html Magento_Captcha/template/checkout/captcha.html - + diff --git a/etc/frontend/di.xml b/etc/frontend/di.xml index 43a5cfa..b71473d 100644 --- a/etc/frontend/di.xml +++ b/etc/frontend/di.xml @@ -11,4 +11,7 @@ + + + From c0423255bad8e35aa070b240fb2ffad337032470 Mon Sep 17 00:00:00 2001 From: Magefan Date: Wed, 3 Jul 2024 12:17:42 -0400 Subject: [PATCH 100/116] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2fc759a..8664922 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,7 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou ### [Magento 2 Speed Optimization Extensions](https://magefan.com/magento-2-extensions/speed-optimization-extensions) + * [Magento 2 Full Page Cache Warmer](https://magefan.com/magento-2-full-page-cache-warmer) * [Magento 2 Lazy Load Extension](https://magefan.com/magento-2-image-lazy-load-extension) * [Magento 2 WebP Optimized Images Extension](https://magefan.com/magento-2-webp-optimized-images) From 0503db9db69d113425dbb8a91c5a847e5d48ca68 Mon Sep 17 00:00:00 2001 From: Yuriy Date: Wed, 24 Jul 2024 16:39:36 +0300 Subject: [PATCH 101/116] 11052-add-config --- Model/Config.php | 181 ++++++++++++++++++ Model/Controller/ResultPlugin.php | 37 ++-- .../Deploy/Package/Bundle/RequireJsPlugin.php | 35 ++-- 3 files changed, 203 insertions(+), 50 deletions(-) create mode 100644 Model/Config.php diff --git a/Model/Config.php b/Model/Config.php new file mode 100644 index 0000000..9ee8920 --- /dev/null +++ b/Model/Config.php @@ -0,0 +1,181 @@ +scopeConfig = $scopeConfig; + } + + /** + * Retrieve true if module is enabled + * + * @param string|null $storeId + * @return bool + */ + public function isEnabled(string $storeId = null): bool + { + return (bool)$this->getConfig(self::XML_PATH_EXTENSION_ENABLED, $storeId); + } + + /** + * Retrieve true if js files merged + * + * @param string|null $storeId + * @return bool + */ + public function isMergeFiles(string $storeId = null): bool + { + return (bool)$this->getConfig(self::XML_PATH_MERGE_FILES, $storeId); + } + + /** + * Retrieve true if js files minified + * + * @param string|null $storeId + * @return bool + */ + public function isMinifyFiles(string $storeId = null): bool + { + return (bool)$this->getConfig(self::XML_PATH_MINIFY_FILES, $storeId); + } + + /** + * Retrieve true if deferred is enabled + * + * @param string|null $storeId + * @return bool + */ + public function isDeferredEnabled(string $storeId = null): bool + { + return (bool)$this->getConfig(self::XML_PATH_DEFERRED_ENABLED, $storeId); + } + + /** + * Retrieve Disallowed Pages + * + * @param string|null $storeId + * @return string + */ + public function getDisallowedPages(string $storeId = null): string + { + return (string)$this->getConfig(self::XML_PATH_DEFERRED_DISALLOWED_PAGES, $storeId); + } + + /** + * Retrieve Ignore JS + * + * @param string|null $storeId + * @return string + */ + public function getIgnoreJavaScript(string $storeId = null): string + { + return (string)$this->getConfig(self::XML_PATH_DEFERRED_IGNORE_JAVASCRIPT, $storeId); + } + + /** + * Retrieve true if JS bundling is enabled + * + * @param string|null $storeId + * @return bool + */ + public function isBundlingEnabled(string $storeId = null): bool + { + return (bool)$this->getConfig(self::XML_PATH_JAVASCRIPT_BUNDLING_ENABLED, $storeId); + } + + /** + * Retrieve true if bundling optimization is enabled + * + * @param string|null $storeId + * @return bool + */ + public function isBundlingOptimizationEnabled(string $storeId = null): bool + { + return (bool)$this->getConfig(self::XML_PATH_JAVASCRIPT_BUNDLING_OPTIMIZATION_ENABLED, $storeId); + } + + /** + * Retrieve included in bundling JS + * + * @param string|null $storeId + * @return string + */ + public function getIncludedInBundling(string $storeId = null): string + { + return (string)$this->getConfig(self::XML_PATH_JAVASCRIPT_BUNDLING_INCLUDED_IN_BUNDLING, $storeId); + } + + /** + * Retrieve true if amp enabled + * + * @param string|null $storeId + * @return bool + */ + public function isAmpRequest(string $storeId = null): bool + { + return (bool)$this->getConfig(self::XML_PATH_PLUMROCKET_AMP_ENABLED, $storeId); + } + + /** + * Retrieve store config value + * + * @param string $path + * @param string|null $storeId + * @return mixed + */ + public function getConfig(string $path, string $storeId = null) + { + return $this->scopeConfig->getValue($path, ScopeInterface::SCOPE_STORE, $storeId); + } +} diff --git a/Model/Controller/ResultPlugin.php b/Model/Controller/ResultPlugin.php index dc2f862..efc2b9f 100644 --- a/Model/Controller/ResultPlugin.php +++ b/Model/Controller/ResultPlugin.php @@ -24,11 +24,9 @@ class ResultPlugin protected $request; /** - * Core store config - * - * @var \Magento\Framework\App\Config\ScopeConfigInterface + * @var \Magefan\RocketJavaScript\Model\Config */ - protected $scopeConfig; + protected $config; /** * @var bool @@ -41,17 +39,18 @@ class ResultPlugin protected $storeManager; /** - * @param \Magento\Framework\App\RequestInterface $request - * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * ResultPlugin constructor. + * @param \Magento\Framework\App\RequestInterface $request + * @param \Magefan\RocketJavaScript\Model\Config $config * @param \Magento\Store\Model\StoreManagerInterface|null $storeManager */ public function __construct( \Magento\Framework\App\RequestInterface $request, - \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magefan\RocketJavaScript\Model\Config $config, \Magento\Store\Model\StoreManagerInterface $storeManager = null ) { $this->request = $request; - $this->scopeConfig = $scopeConfig; + $this->config = $config; $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $this->storeManager = $storeManager ?: $objectManager->get( @@ -80,9 +79,7 @@ public function aroundRenderResult( return $result; } - $ignoredStrings = $this->scopeConfig->getValue( - 'mfrocketjavascript/deferred_javascript/ignore_deferred_javascript_with', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE) ?: ''; + $ignoredStrings = $this->config->getIgnoreJavaScript() ?: ''; $ignoredStrings = explode("\n", str_replace("\r", "\n", $ignoredStrings)); foreach ($ignoredStrings as $key => $ignoredString) { $ignoredString = trim($ignoredString); @@ -146,13 +143,7 @@ public function aroundRenderResult( private function isEnabled() { - $enabled = $this->scopeConfig->getValue( - 'mfrocketjavascript/general/enabled', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) && $this->scopeConfig->getValue( - 'mfrocketjavascript/deferred_javascript/enabled', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ); + $enabled = $this->config->isEnabled() && $this->config->isDeferredEnabled(); if ($enabled) { @@ -163,10 +154,7 @@ private function isEnabled() } /* check if Plumrocket AMP enabled */ - $isAmpRequest = $this->scopeConfig->getValue( - 'pramp/general/enabled', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ); + $isAmpRequest = $this->config->isAmpRequest(); if ($isAmpRequest) { /* We know that using objectManager is not a not a good practice, @@ -193,10 +181,7 @@ private function isAllowedOnPage() } $this->allowedOnPage = false; - $spPages = $this->scopeConfig->getValue( - 'mfrocketjavascript/deferred_javascript/disallowed_pages_for_deferred_js', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ); + $spPages = $this->config->getDisallowedPages(); $spPages = explode("\n", str_replace("\r", "\n", $spPages)); foreach ($spPages as $key => $path) { diff --git a/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php b/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php index edae6c0..e27032c 100644 --- a/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php +++ b/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php @@ -9,26 +9,14 @@ namespace Magefan\RocketJavaScript\Plugin\Deploy\Package\Bundle; use Magento\Deploy\Package\Bundle\RequireJs; -use Magento\Framework\App\Config\ScopeConfigInterface; -use Magento\Store\Model\ScopeInterface; +use Magefan\RocketJavaScript\Model\Config; class RequireJsPlugin { - - /** - * @var string - */ - const BUNDLING_OPTIMIZATION_ENABLED = 'mfrocketjavascript/javascript_bundling/enabled'; - /** - * @var string + * @var Config */ - const INCLUDE_IN_BUNDLING = 'mfrocketjavascript/javascript_bundling/included_in_bundling'; - - /** - * @var \Magento\Framework\App\Config\ScopeConfigInterface - */ - protected $scopeConfig; + protected $config; /** * mixed @@ -36,13 +24,13 @@ class RequireJsPlugin protected $allowedFiles; /** - * Construct - * - * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * RequireJsPlugin constructor. + * @param Config $config */ - public function __construct(ScopeConfigInterface $scopeConfig) - { - $this->scopeConfig = $scopeConfig; + public function __construct( + Config $config + ) { + $this->config = $config; } /** @@ -51,8 +39,7 @@ public function __construct(ScopeConfigInterface $scopeConfig) public function aroundAddFile(RequireJs $subject, callable $proceed, $filePath, $sourcePath, $contentType) { - $jsOptimization = $this->scopeConfig->getValue(self::BUNDLING_OPTIMIZATION_ENABLED, ScopeInterface::SCOPE_STORE) - && $this->scopeConfig->getValue('mfrocketjavascript/general/enabled', ScopeInterface::SCOPE_STORE); + $jsOptimization = $this->config->isBundlingEnabled() && $this->config->isEnabled(); if ($jsOptimization) { $allowedFiles = $this->getAllowedFiles(); @@ -74,7 +61,7 @@ public function aroundAddFile(RequireJs $subject, callable $proceed, $filePath, public function getAllowedFiles() { if (null === $this->allowedFiles) { - $includeInBundling = $this->scopeConfig->getValue(self::INCLUDE_IN_BUNDLING, ScopeInterface::SCOPE_STORE); + $includeInBundling = $this->config->getIncludedInBundling(); $allowedFiles = str_replace("\r", "\n", $includeInBundling); $allowedFiles = explode("\n", $allowedFiles); From 7bbc11148619bc9ca6028090c11d403b5e143bce Mon Sep 17 00:00:00 2001 From: Magefan Date: Wed, 9 Oct 2024 10:21:16 -0400 Subject: [PATCH 102/116] Update README.md --- README.md | 100 +++++++++++++++++++++++++----------------------------- 1 file changed, 46 insertions(+), 54 deletions(-) diff --git a/README.md b/README.md index 8664922..ffc8fe4 100644 --- a/README.md +++ b/README.md @@ -101,23 +101,10 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou ## [Magento 2 Extensions](https://magefan.com/magento-2-extensions) by Magefan -### [Magento 2 Admin Panel Extensions](https://magefan.com/magento-2-extensions/admin-extensions) - - * [Magento 2 Admin Action Log](https://magefan.com/magento-2-admin-action-log) - * [Magento 2 Edit Order Extension](https://magefan.com/magento-2-edit-order-extension) - * [Magento 2 Better Order Grid Extension](https://magefan.com/magento-2-better-order-grid-extension) - * [Magento 2 Extended Product Grid](https://magefan.com/magento-2-product-grid-inline-editor) - * [Magento 2 Product Tabs Extension](https://magefan.com/magento-2/extensions/product-tabs) - * [Magento 2 Facebook Pixel Extension](https://magefan.com/magento-2-facebook-pixel-extension) - * [Magento 2 Email Attachments](https://magefan.com/magento-2-email-attachments) - * [Magento 2 Admin View Extension](https://magefan.com/magento-2-admin-view-extension) - * [Magento 2 Admin Email Notifications](https://magefan.com/magento-2-admin-email-notifications) - * [Magento 2 Login As Customer Extension](https://magefan.com/login-as-customer-magento-2-extension) - ### [Magento 2 Google Extensions](https://magefan.com/magento-2-extensions/google-extensions) * [Magento 2 Google Indexing API](https://magefan.com/magento-2-google-indexing-api) - * [Magento 2 Google Analytics 4 Extension](https://magefan.com/magento-2-google-analytics-4) + * [Magento 2 Google Analytics 4](https://magefan.com/magento-2-google-analytics-4) * [Magento 2 Google Tag Manager](https://magefan.com/magento-2-google-tag-manager) * [Magento 2 Google Shopping Feed](https://magefan.com/magento-2-google-shopping-feed-extension) * [Magento 2 Google Customer Reviews](https://magefan.com/magento-2-google-customer-reviews) @@ -125,49 +112,61 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou ### [Magento 2 SEO Extensions](https://magefan.com/magento-2-extensions/magento-2-seo-extensions) * [Magento 2 SEO Extension](https://magefan.com/magento-2-seo-extension) - * [Magento 2 Rich Snippets Extension](https://magefan.com/magento-2-rich-snippets) - * [Magento 2 HTML Sitemap Extension](https://magefan.com/magento-2-html-sitemap-extension) - * [Magento 2 XML Sitemap Extension](https://magefan.com/magento-2-xml-sitemap-extension) - * [Magento 2 Twitter Cards Extension](https://magefan.com/magento-2-twitter-cards-extension) - * [Magento 2 Facebook Open Graph Extension](https://magefan.com/magento-2-open-graph-extension-og-tags) + * [Magento 2 Rich Snippets](https://magefan.com/magento-2-rich-snippets) + * [Magento 2 HTML Sitemap](https://magefan.com/magento-2-html-sitemap-extension) + * [Magento 2 XML Sitemap](https://magefan.com/magento-2-xml-sitemap-extension) + * [Magento 2 Twitter Cards](https://magefan.com/magento-2-twitter-cards-extension) + * [Magento 2 Facebook Open Graph Tags](https://magefan.com/magento-2-open-graph-extension-og-tags) + +### [Magento 2 Speed Optimization Extensions](https://magefan.com/magento-2-extensions/speed-optimization) + + * [Magento 2 Google Page Speed Optimizer](https://magefan.com/magento-2-google-page-speed-optimizer) + * [Magento 2 Full Page Cache Warmer](https://magefan.com/magento-2-full-page-cache-warmer) + * [Magento 2 Image Lazy Load](https://magefan.com/magento-2-image-lazy-load-extension) + * [Magento 2 WebP Images](https://magefan.com/magento-2-webp-optimized-images) + + ### [Magento 2 Admin Panel Extensions](https://magefan.com/magento-2-extensions/admin-extensions) + + * [Magento 2 Admin Action Log](https://magefan.com/magento-2-admin-action-log) + * [Magento 2 Order Editor](https://magefan.com/magento-2-edit-order-extension) + * [Magento 2 Better Order Grid](https://magefan.com/magento-2-better-order-grid-extension) + * [Magento 2 Extended Product Grid](https://magefan.com/magento-2-product-grid-inline-editor) + * [Magento 2 Product Tabs](https://magefan.com/magento-2/extensions/product-tabs) + * [Magento 2 Facebook Pixel](https://magefan.com/magento-2-facebook-pixel-extension) + * [Magento 2 Email Attachments](https://magefan.com/magento-2-email-attachments) + * [Magento 2 Admin View](https://magefan.com/magento-2-admin-view-extension) + * [Magento 2 Admin Email Notifications](https://magefan.com/magento-2-admin-email-notifications) + * [Magento 2 Login As Customer](https://magefan.com/login-as-customer-magento-2-extension) ### [Magento 2 Blog Extensions](https://magefan.com/magento-2-extensions/blog-extensions) - * [Magento 2 Blog Extension](https://magefan.com/magento2-blog-extension) - * [Magento 2 Blog Plus Extension](https://magefan.com/magento2-blog-extension/pricing) - * [Magento 2 Blog Extra Extension](https://magefan.com/magento2-blog-extension/pricing) - * [Magento 2 Multi Blog Extension](https://magefan.com/magento-2-multi-blog-extension) - * [Magento 2 Product Widget Advanced Extension](https://magefan.com/magento-2-product-widget) + * [Magento 2 Blog](https://magefan.com/magento2-blog-extension) + * [Magento 2 Multi Blog](https://magefan.com/magento-2-multi-blog-extension) + * [Magento 2 Product Widget](https://magefan.com/magento-2-product-widget) ### [Magento 2 Marketing Automation Extensions](https://magefan.com/magento-2-extensions/magento-marketing-automation) -* [Magento 2 Product Labels](https://magefan.com/magento-2-product-labels) -* [Magento 2 Base Price](https://magefan.com/magento-2-base-price) -* [Magento 2 Dynamic Categories](https://magefan.com/magento-2-dynamic-categories) -* [Magento 2 CMS Display Rules Extension](https://magefan.com/magento-2-cms-display-rules-extension) -* [Magento 2 Automatic Related Products](https://magefan.com/magento-2-automatic-related-products) -* [Magento 2 Price History](https://magefan.com/magento-2-price-history) -* [Magento 2 Mautic Integration Extension](https://magefan.com/magento-2-mautic-extension) -* [Magento 2 YouTube Widget Extension](https://magefan.com/magento2-youtube-extension) + * [Magento 2 Product Labels](https://magefan.com/magento-2-product-labels) + * [Magento 2 Base Price](https://magefan.com/magento-2-base-price) + * [Magento 2 Dynamic Categories](https://magefan.com/magento-2-dynamic-categories) + * [Magento 2 Dynamic Blocks and Pages Extension](https://magefan.com/magento-2-cms-display-rules-extension) + * [Magento 2 Automatic Related Products](https://magefan.com/magento-2-automatic-related-products) + * [Magento 2 Price History](https://magefan.com/magento-2-price-history) + * [Magento 2 Mautic Extension](https://magefan.com/magento-2-mautic-extension) + * [Magento 2 YouTube Video Extension](https://magefan.com/magento2-youtube-extension) ### [Magento 2 Cart Extensions](https://magefan.com/magento-2-extensions/cart-extensions) * [Better Magento 2 Checkout Extension](https://magefan.com/better-magento-2-checkout-extension) * [Magento 2 Coupon Code Link](https://magefan.com/magento-2-coupon-code-link) - * [Magento 2 Convert Guest to Customer Extension](https://magefan.com/magento2-convert-guest-to-customer) - -### [Magento 2 Speed Optimization Extensions](https://magefan.com/magento-2-extensions/speed-optimization-extensions) - - * [Magento 2 Full Page Cache Warmer](https://magefan.com/magento-2-full-page-cache-warmer) - * [Magento 2 Lazy Load Extension](https://magefan.com/magento-2-image-lazy-load-extension) - * [Magento 2 WebP Optimized Images Extension](https://magefan.com/magento-2-webp-optimized-images) + * [Magento 2 Guest to Customer](https://magefan.com/magento2-convert-guest-to-customer) ### [Magento 2 Multi-Language Extensions](https://magefan.com/magento-2-extensions/multi-language-extensions) - * [Magento 2 Hreflang Tags Extension](https://magefan.com/magento2-alternate-hreflang-extension) - * [Magento 2 Auto Currency Switcher Extension](https://magefan.com/magento-2-currency-switcher-auto-currency-by-country) - * [Magento 2 Auto Language Switcher Extension](https://magefan.com/magento-2-auto-language-switcher) - * [Magento 2 GeoIP Switcher Extension](https://magefan.com/magento-2-geoip-switcher-extension) + * [Magento 2 Hreflang Tags](https://magefan.com/magento2-alternate-hreflang-extension) + * [Magento 2 Auto Currency Switcher](https://magefan.com/magento-2-currency-switcher-auto-currency-by-country) + * [Magento 2 Auto Language Switcher](https://magefan.com/magento-2-auto-language-switcher) + * [Magento 2 GeoIP Store Switcher](https://magefan.com/magento-2-geoip-switcher-extension) * [Magento 2 Translation Extension](https://magefan.com/magento-2-translation-extension) ### [Developers Tools](https://magefan.com/magento-2-extensions/developer-tools) @@ -175,18 +174,11 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Zero Downtime Deployment](https://magefan.com/blog/magento-2-zero-downtime-deployment) * [Magento 2 Cron Schedule](https://magefan.com/magento-2-cron-schedule) * [Magento 2 CLI Extension](https://magefan.com/magento2-cli-extension) - * [Magento 2 Conflict Detector Extension](https://magefan.com/magento2-conflict-detector) - - ### Magento 2 Point of Sale - - * [Magento 2 POS System](https://magefan.com/magento-pos-system) - - ### Magento 2 Theme - - * [Optimized Magento 2 Theme](https://magefan.com/optimized-magento-2-theme) - - ### [Shopify Apps](https://magefan.com/shopify/apps) + * [Magento 2 Conflict Detector](https://magefan.com/magento2-conflict-detector) + + ## [Shopify Apps](https://magefan.com/shopify/apps) by Magefan * [Shopify Login As Customer](https://apps.shopify.com/login-as-customer) * [Shopify Blog](https://apps.shopify.com/magefan-blog) * [Shopify Size Chart](https://magefan.com/shopify/apps/size-chart) + * [Shopify Google Indexer](https://magefan.com/shopify/apps/google-indexing) From b53f64e58fedc81b0135eefad52769adf5c65294 Mon Sep 17 00:00:00 2001 From: Magefan Date: Wed, 16 Oct 2024 10:16:52 -0400 Subject: [PATCH 103/116] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ffc8fe4..4686127 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,7 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou ### [Magento 2 Marketing Automation Extensions](https://magefan.com/magento-2-extensions/magento-marketing-automation) + * [Magento 2 Cookie Consent](https://magefan.com/magento-2-cookie-consent) * [Magento 2 Product Labels](https://magefan.com/magento-2-product-labels) * [Magento 2 Base Price](https://magefan.com/magento-2-base-price) * [Magento 2 Dynamic Categories](https://magefan.com/magento-2-dynamic-categories) From 2828249db74e71cb8dee72f37e5e4b288afcabf6 Mon Sep 17 00:00:00 2001 From: Magefan Date: Tue, 12 Nov 2024 18:46:45 -0500 Subject: [PATCH 104/116] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4686127..d54a030 100644 --- a/README.md +++ b/README.md @@ -183,3 +183,4 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Shopify Blog](https://apps.shopify.com/magefan-blog) * [Shopify Size Chart](https://magefan.com/shopify/apps/size-chart) * [Shopify Google Indexer](https://magefan.com/shopify/apps/google-indexing) + * [Shopify Product Feeds](https://magefan.com/shopify/apps/product-feed) From b1a91cb3e5008a87341f1a7dba38c9e9241be565 Mon Sep 17 00:00:00 2001 From: b__b Date: Thu, 14 Nov 2024 13:17:55 +0100 Subject: [PATCH 105/116] refactoring --- .../Theme/Controller/Result/JsFooterPlugin.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Plugin/Frontend/Magento/Theme/Controller/Result/JsFooterPlugin.php b/Plugin/Frontend/Magento/Theme/Controller/Result/JsFooterPlugin.php index df5cc04..d4752fa 100644 --- a/Plugin/Frontend/Magento/Theme/Controller/Result/JsFooterPlugin.php +++ b/Plugin/Frontend/Magento/Theme/Controller/Result/JsFooterPlugin.php @@ -14,12 +14,10 @@ use Magento\Framework\App\ResponseInterface; use Magento\Framework\View\Result\Layout; use Magento\Store\Model\ScopeInterface; +use Magefan\RocketJavaScript\Model\Config; class JsFooterPlugin { - - private const XML_PATH_RJ_DEFERRED_ENABLED = 'mfrocketjavascript/deferred_javascript/enabled'; - /** * @var ScopeConfigInterface */ @@ -48,12 +46,12 @@ public function aroundAfterRenderResult( Layout $result, ResponseInterface $httpResponse ) { - $jsRjOptimization = $this->scopeConfig->isSetFlag(self::XML_PATH_RJ_DEFERRED_ENABLED, ScopeInterface::SCOPE_STORE) - && $this->scopeConfig->isSetFlag('mfrocketjavascript/general/enabled', ScopeInterface::SCOPE_STORE); - if ($jsRjOptimization) { - return $result; - } + $jsRjOptimization = + $this->scopeConfig->isSetFlag(Config::XML_PATH_DEFERRED_ENABLED, ScopeInterface::SCOPE_STORE) && + $this->scopeConfig->isSetFlag(Config::XML_PATH_EXTENSION_ENABLED, ScopeInterface::SCOPE_STORE); - return $proceed($argumentSubject, $result, $httpResponse); + return $jsRjOptimization + ? $result + : $proceed($argumentSubject, $result, $httpResponse); } } From 095ccff4d982c8caff4e53100f193620fa6e43e5 Mon Sep 17 00:00:00 2001 From: Bohdan Berezhniy Date: Mon, 18 Nov 2024 13:57:28 +0200 Subject: [PATCH 106/116] refactoring --- Model/Config.php | 25 ++----------------------- etc/adminhtml/system.xml | 5 +++-- 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/Model/Config.php b/Model/Config.php index 9ee8920..43b403d 100644 --- a/Model/Config.php +++ b/Model/Config.php @@ -12,6 +12,7 @@ use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Store\Model\ScopeInterface; +use Magento\Framework\View\Asset\Config as MagentoConfig; class Config { @@ -68,28 +69,6 @@ public function isEnabled(string $storeId = null): bool return (bool)$this->getConfig(self::XML_PATH_EXTENSION_ENABLED, $storeId); } - /** - * Retrieve true if js files merged - * - * @param string|null $storeId - * @return bool - */ - public function isMergeFiles(string $storeId = null): bool - { - return (bool)$this->getConfig(self::XML_PATH_MERGE_FILES, $storeId); - } - - /** - * Retrieve true if js files minified - * - * @param string|null $storeId - * @return bool - */ - public function isMinifyFiles(string $storeId = null): bool - { - return (bool)$this->getConfig(self::XML_PATH_MINIFY_FILES, $storeId); - } - /** * Retrieve true if deferred is enabled * @@ -131,7 +110,7 @@ public function getIgnoreJavaScript(string $storeId = null): string */ public function isBundlingEnabled(string $storeId = null): bool { - return (bool)$this->getConfig(self::XML_PATH_JAVASCRIPT_BUNDLING_ENABLED, $storeId); + return (bool)$this->getConfig(MagentoConfig::XML_PATH_JS_BUNDLING, $storeId); } /** diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 527492b..51d1fc8 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -36,7 +36,7 @@ Magento\Config\Model\Config\Source\Yesno Magefan\RocketJavaScript\Model\Config\Backend\DevSettings - Minification is not applied in developer mode. + Minification is not applied in developer mode. Static content deployment is a requirement after option change @@ -67,13 +67,14 @@ Magento\Config\Model\Config\Source\Yesno Magefan\RocketJavaScript\Model\Config\Backend\DevSettings + Static content deployment is a requirement after option change 1 - Please note that this option only works with enabled JavaScript Bundling (Configuration > Advanced > Developer > JavaScript Settings > Enable JavaScript Bundling). + Static content deployment is a requirement after option change Magento\Config\Model\Config\Source\Yesno From a4220957c86bc8e1ee6f0f807c72b462d0da0015 Mon Sep 17 00:00:00 2001 From: Magefan Date: Mon, 18 Nov 2024 14:44:44 +0200 Subject: [PATCH 107/116] Update composer.json --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index f307038..0c8db46 100644 --- a/composer.json +++ b/composer.json @@ -2,14 +2,14 @@ "name": "magefan/module-rocketjavascript", "description": "Move all javascript to the footer on Magento 2 store.", "require": { - "magefan/module-community" : ">=2.1.17" + "magefan/module-community" : ">=2.1.30" }, "suggest": { "magefan/module-webp": "Install WebP Optimized Images to serve images in the next-gen format. Use coupon code COMPOSER-FAN to get 10% discount on magefan.com.", "magefan/module-lazyload": "Install Lazy Load to defer offscreen images loading." }, "type": "magento2-module", - "version": "2.1.9", + "version": "2.2.0", "authors": [ { "name": "Magefan", From 6d3ae050b344fdfd7a58ab0866227b783db12465 Mon Sep 17 00:00:00 2001 From: Bohdan Berezhniy Date: Mon, 18 Nov 2024 15:25:39 +0200 Subject: [PATCH 108/116] set correct condition --- Plugin/Deploy/Package/Bundle/RequireJsPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php b/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php index e27032c..4a49824 100644 --- a/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php +++ b/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php @@ -38,8 +38,8 @@ public function __construct( */ public function aroundAddFile(RequireJs $subject, callable $proceed, $filePath, $sourcePath, $contentType) { + $jsOptimization = $this->config->isEnabled() && $this->config->isBundlingOptimizationEnabled(); - $jsOptimization = $this->config->isBundlingEnabled() && $this->config->isEnabled(); if ($jsOptimization) { $allowedFiles = $this->getAllowedFiles(); From 53d6b99931e249395b7204e1933c6bd75b7f38d5 Mon Sep 17 00:00:00 2001 From: Bohdan Berezhniy Date: Mon, 18 Nov 2024 16:32:17 +0200 Subject: [PATCH 109/116] there is no store emulation in RequireJsPlugin so we can't use value for stores --- Model/Config.php | 12 ++++-------- Plugin/Deploy/Package/Bundle/RequireJsPlugin.php | 1 + etc/adminhtml/system.xml | 4 ++-- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Model/Config.php b/Model/Config.php index 43b403d..c8886ea 100644 --- a/Model/Config.php +++ b/Model/Config.php @@ -115,24 +115,20 @@ public function isBundlingEnabled(string $storeId = null): bool /** * Retrieve true if bundling optimization is enabled - * - * @param string|null $storeId * @return bool */ - public function isBundlingOptimizationEnabled(string $storeId = null): bool + public function isBundlingOptimizationEnabled(): bool { - return (bool)$this->getConfig(self::XML_PATH_JAVASCRIPT_BUNDLING_OPTIMIZATION_ENABLED, $storeId); + return (bool)$this->getConfig(self::XML_PATH_JAVASCRIPT_BUNDLING_OPTIMIZATION_ENABLED); } /** * Retrieve included in bundling JS - * - * @param string|null $storeId * @return string */ - public function getIncludedInBundling(string $storeId = null): string + public function getIncludedInBundling(): string { - return (string)$this->getConfig(self::XML_PATH_JAVASCRIPT_BUNDLING_INCLUDED_IN_BUNDLING, $storeId); + return (string)$this->getConfig(self::XML_PATH_JAVASCRIPT_BUNDLING_INCLUDED_IN_BUNDLING); } /** diff --git a/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php b/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php index 4a49824..4295fe8 100644 --- a/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php +++ b/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php @@ -55,6 +55,7 @@ public function aroundAddFile(RequireJs $subject, callable $proceed, $filePath, return true; } } + return $proceed($filePath, $sourcePath, $contentType); } diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 51d1fc8..a462f1c 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -69,7 +69,7 @@ Magefan\RocketJavaScript\Model\Config\Backend\DevSettings Static content deployment is a requirement after option change - + 1 @@ -77,7 +77,7 @@ Static content deployment is a requirement after option change Magento\Config\Model\Config\Source\Yesno - + 1 From e04cb95be28cadb4b4d21d0c0f64786ec18c5054 Mon Sep 17 00:00:00 2001 From: Magefan - e-Commerce solutions you can trust Date: Thu, 13 Mar 2025 16:07:35 +0200 Subject: [PATCH 110/116] ignore application/ld+json javascripts --- Model/Controller/ResultPlugin.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Model/Controller/ResultPlugin.php b/Model/Controller/ResultPlugin.php index efc2b9f..7239f48 100644 --- a/Model/Controller/ResultPlugin.php +++ b/Model/Controller/ResultPlugin.php @@ -117,6 +117,11 @@ public function aroundRenderResult( continue; } + if (false !== stripos($script, 'application/ld+json')) { + $start++; + continue; + } + foreach ($ignoredStrings as $ignoredString) { if (false !== stripos($script, $ignoredString)) { $start++; From 0f9eb03457d32b944e55456fbad51cbe0cb76f89 Mon Sep 17 00:00:00 2001 From: Magefan - e-Commerce solutions you can trust Date: Thu, 20 Mar 2025 12:36:14 +0200 Subject: [PATCH 111/116] Update composer.json --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 0c8db46..7883e4a 100644 --- a/composer.json +++ b/composer.json @@ -2,14 +2,14 @@ "name": "magefan/module-rocketjavascript", "description": "Move all javascript to the footer on Magento 2 store.", "require": { - "magefan/module-community" : ">=2.1.30" + "magefan/module-community" : ">=2.2.7" }, "suggest": { "magefan/module-webp": "Install WebP Optimized Images to serve images in the next-gen format. Use coupon code COMPOSER-FAN to get 10% discount on magefan.com.", "magefan/module-lazyload": "Install Lazy Load to defer offscreen images loading." }, "type": "magento2-module", - "version": "2.2.0", + "version": "2.2.1", "authors": [ { "name": "Magefan", From 04798a89977eeb4f5c98804f29f891b769316c54 Mon Sep 17 00:00:00 2001 From: Magefan - e-Commerce solutions you can trust Date: Tue, 6 May 2025 17:50:35 +0300 Subject: [PATCH 112/116] Update README.md --- README.md | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index d54a030..57864e1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# [Magefan](https://magefan.com/) [Rocket JavaScript Extension for Magento 2](https://magefan.com/rocket-javascript-deferred-javascript) +# [Magento 2 Rocket JavaScript Extension](https://magefan.com/rocket-javascript-deferred-javascript) by Magefan [![Total Downloads](https://poser.pugx.org/magefan/module-rocketjavascript/downloads)](https://packagist.org/packages/magefan/module-rocketjavascript) @@ -25,7 +25,7 @@ ## Installation * [Install Rocket JavaScript Extension for Magento 2 via Composer or anarchive](https://magefan.com/blog/rocket-javascript-installation) -## Get List Of Used JS On A Sigle Page +## Get List Of Used JS On A Single Page ``` /* Use in browser console */ globalSrc = ''; @@ -66,8 +66,8 @@ Try out our open demo and if you like our extension **please give us some star o Magneto 2 Rocket JavaScript Extension Admin Panel Demo @@ -103,20 +103,21 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou ### [Magento 2 Google Extensions](https://magefan.com/magento-2-extensions/google-extensions) - * [Magento 2 Google Indexing API](https://magefan.com/magento-2-google-indexing-api) + * [Magento 2 Google Indexing](https://magefan.com/magento-2-google-indexing-api) * [Magento 2 Google Analytics 4](https://magefan.com/magento-2-google-analytics-4) * [Magento 2 Google Tag Manager](https://magefan.com/magento-2-google-tag-manager) * [Magento 2 Google Shopping Feed](https://magefan.com/magento-2-google-shopping-feed-extension) * [Magento 2 Google Customer Reviews](https://magefan.com/magento-2-google-customer-reviews) -### [Magento 2 SEO Extensions](https://magefan.com/magento-2-extensions/magento-2-seo-extensions) +### Magento 2 SEO Extensions * [Magento 2 SEO Extension](https://magefan.com/magento-2-seo-extension) * [Magento 2 Rich Snippets](https://magefan.com/magento-2-rich-snippets) * [Magento 2 HTML Sitemap](https://magefan.com/magento-2-html-sitemap-extension) * [Magento 2 XML Sitemap](https://magefan.com/magento-2-xml-sitemap-extension) + * [Magento 2 Facebook Open Graph](https://magefan.com/magento-2-open-graph-extension-og-tags) * [Magento 2 Twitter Cards](https://magefan.com/magento-2-twitter-cards-extension) - * [Magento 2 Facebook Open Graph Tags](https://magefan.com/magento-2-open-graph-extension-og-tags) + ### [Magento 2 Speed Optimization Extensions](https://magefan.com/magento-2-extensions/speed-optimization) @@ -127,6 +128,7 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou ### [Magento 2 Admin Panel Extensions](https://magefan.com/magento-2-extensions/admin-extensions) + * [Magento 2 Security Extension](https://magefan.com/magento-2-security-extension) * [Magento 2 Admin Action Log](https://magefan.com/magento-2-admin-action-log) * [Magento 2 Order Editor](https://magefan.com/magento-2-edit-order-extension) * [Magento 2 Better Order Grid](https://magefan.com/magento-2-better-order-grid-extension) @@ -138,13 +140,13 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Admin Email Notifications](https://magefan.com/magento-2-admin-email-notifications) * [Magento 2 Login As Customer](https://magefan.com/login-as-customer-magento-2-extension) -### [Magento 2 Blog Extensions](https://magefan.com/magento-2-extensions/blog-extensions) +### Magento 2 Blog Extensions * [Magento 2 Blog](https://magefan.com/magento2-blog-extension) * [Magento 2 Multi Blog](https://magefan.com/magento-2-multi-blog-extension) * [Magento 2 Product Widget](https://magefan.com/magento-2-product-widget) -### [Magento 2 Marketing Automation Extensions](https://magefan.com/magento-2-extensions/magento-marketing-automation) +### [Magento 2 Marketing Automation Extensions](https://magefan.com/magento-2-extensions/marketing-automation) * [Magento 2 Cookie Consent](https://magefan.com/magento-2-cookie-consent) * [Magento 2 Product Labels](https://magefan.com/magento-2-product-labels) @@ -153,13 +155,13 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Dynamic Blocks and Pages Extension](https://magefan.com/magento-2-cms-display-rules-extension) * [Magento 2 Automatic Related Products](https://magefan.com/magento-2-automatic-related-products) * [Magento 2 Price History](https://magefan.com/magento-2-price-history) - * [Magento 2 Mautic Extension](https://magefan.com/magento-2-mautic-extension) - * [Magento 2 YouTube Video Extension](https://magefan.com/magento2-youtube-extension) + * [Magento 2 Mautic Integration](https://magefan.com/magento-2-mautic-extension) + * [Magento 2 YouTube Video](https://magefan.com/magento2-youtube-extension) ### [Magento 2 Cart Extensions](https://magefan.com/magento-2-extensions/cart-extensions) - * [Better Magento 2 Checkout Extension](https://magefan.com/better-magento-2-checkout-extension) - * [Magento 2 Coupon Code Link](https://magefan.com/magento-2-coupon-code-link) + * [Magento 2 Checkout Extension](https://magefan.com/better-magento-2-checkout-extension) + * [Magento 2 Coupon Code](https://magefan.com/magento-2-coupon-code-link) * [Magento 2 Guest to Customer](https://magefan.com/magento2-convert-guest-to-customer) ### [Magento 2 Multi-Language Extensions](https://magefan.com/magento-2-extensions/multi-language-extensions) @@ -168,7 +170,7 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou * [Magento 2 Auto Currency Switcher](https://magefan.com/magento-2-currency-switcher-auto-currency-by-country) * [Magento 2 Auto Language Switcher](https://magefan.com/magento-2-auto-language-switcher) * [Magento 2 GeoIP Store Switcher](https://magefan.com/magento-2-geoip-switcher-extension) - * [Magento 2 Translation Extension](https://magefan.com/magento-2-translation-extension) + * [Magento 2 Translation](https://magefan.com/magento-2-translation-extension) ### [Developers Tools](https://magefan.com/magento-2-extensions/developer-tools) From f93930142dfac1c7f77c2ebc8d12f1b67f83b0e2 Mon Sep 17 00:00:00 2001 From: "ivan.hrytsai" Date: Thu, 8 May 2025 09:39:13 +0300 Subject: [PATCH 113/116] 13311-Magento248-Php84-Compatibility --- Model/Config.php | 14 +++++++------- Model/Config/Backend/DevSettings.php | 4 ++-- Model/Controller/ResultPlugin.php | 2 +- Observer/AdminSystemConfigChangedSection.php | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Model/Config.php b/Model/Config.php index c8886ea..68d0ae7 100644 --- a/Model/Config.php +++ b/Model/Config.php @@ -64,7 +64,7 @@ public function __construct( * @param string|null $storeId * @return bool */ - public function isEnabled(string $storeId = null): bool + public function isEnabled(?string $storeId = null): bool { return (bool)$this->getConfig(self::XML_PATH_EXTENSION_ENABLED, $storeId); } @@ -75,7 +75,7 @@ public function isEnabled(string $storeId = null): bool * @param string|null $storeId * @return bool */ - public function isDeferredEnabled(string $storeId = null): bool + public function isDeferredEnabled(?string $storeId = null): bool { return (bool)$this->getConfig(self::XML_PATH_DEFERRED_ENABLED, $storeId); } @@ -86,7 +86,7 @@ public function isDeferredEnabled(string $storeId = null): bool * @param string|null $storeId * @return string */ - public function getDisallowedPages(string $storeId = null): string + public function getDisallowedPages(?string $storeId = null): string { return (string)$this->getConfig(self::XML_PATH_DEFERRED_DISALLOWED_PAGES, $storeId); } @@ -97,7 +97,7 @@ public function getDisallowedPages(string $storeId = null): string * @param string|null $storeId * @return string */ - public function getIgnoreJavaScript(string $storeId = null): string + public function getIgnoreJavaScript(?string $storeId = null): string { return (string)$this->getConfig(self::XML_PATH_DEFERRED_IGNORE_JAVASCRIPT, $storeId); } @@ -108,7 +108,7 @@ public function getIgnoreJavaScript(string $storeId = null): string * @param string|null $storeId * @return bool */ - public function isBundlingEnabled(string $storeId = null): bool + public function isBundlingEnabled(?string $storeId = null): bool { return (bool)$this->getConfig(MagentoConfig::XML_PATH_JS_BUNDLING, $storeId); } @@ -137,7 +137,7 @@ public function getIncludedInBundling(): string * @param string|null $storeId * @return bool */ - public function isAmpRequest(string $storeId = null): bool + public function isAmpRequest(?string $storeId = null): bool { return (bool)$this->getConfig(self::XML_PATH_PLUMROCKET_AMP_ENABLED, $storeId); } @@ -149,7 +149,7 @@ public function isAmpRequest(string $storeId = null): bool * @param string|null $storeId * @return mixed */ - public function getConfig(string $path, string $storeId = null) + public function getConfig(string $path, ?string $storeId = null) { return $this->scopeConfig->getValue($path, ScopeInterface::SCOPE_STORE, $storeId); } diff --git a/Model/Config/Backend/DevSettings.php b/Model/Config/Backend/DevSettings.php index 4ba32be..e4b67ed 100644 --- a/Model/Config/Backend/DevSettings.php +++ b/Model/Config/Backend/DevSettings.php @@ -50,8 +50,8 @@ public function __construct( ScopeConfigInterface $config, TypeListInterface $cacheTypeList, RequestInterface $request, - AbstractResource $resource = null, - AbstractDb $resourceCollection = null, + ?AbstractResource $resource = null, + ?AbstractDb $resourceCollection = null, array $data = [] ) { $this->request = $request; diff --git a/Model/Controller/ResultPlugin.php b/Model/Controller/ResultPlugin.php index 7239f48..ad9c5a0 100644 --- a/Model/Controller/ResultPlugin.php +++ b/Model/Controller/ResultPlugin.php @@ -47,7 +47,7 @@ class ResultPlugin public function __construct( \Magento\Framework\App\RequestInterface $request, \Magefan\RocketJavaScript\Model\Config $config, - \Magento\Store\Model\StoreManagerInterface $storeManager = null + ?\Magento\Store\Model\StoreManagerInterface $storeManager = null ) { $this->request = $request; $this->config = $config; diff --git a/Observer/AdminSystemConfigChangedSection.php b/Observer/AdminSystemConfigChangedSection.php index 4827d42..4005367 100644 --- a/Observer/AdminSystemConfigChangedSection.php +++ b/Observer/AdminSystemConfigChangedSection.php @@ -135,7 +135,7 @@ public function __construct( StoreManagerInterface $storeManager, MagentoConfig $magentoConfig, ReinitableConfigInterface $appConfig, - SettingChecker $settingChecker = null + ?SettingChecker $settingChecker = null ) { $this->scopeConfig = $scopeConfig; $this->configLoader = $configLoader; From 0cd129d32173dfed0037f37c691ea0b480a968d6 Mon Sep 17 00:00:00 2001 From: Magefan - e-Commerce solutions you can trust Date: Thu, 8 May 2025 15:38:28 +0300 Subject: [PATCH 114/116] Update module.xml --- etc/module.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/module.xml b/etc/module.xml index fd2db4f..6b17d6a 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -8,7 +8,7 @@ */ --> - + From db0388c9edebfaf58d7a211ebfec0282e2eec1a6 Mon Sep 17 00:00:00 2001 From: Magefan - e-Commerce solutions you can trust Date: Thu, 8 May 2025 15:38:43 +0300 Subject: [PATCH 115/116] Update composer.json --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 7883e4a..e7ad2d5 100644 --- a/composer.json +++ b/composer.json @@ -2,14 +2,14 @@ "name": "magefan/module-rocketjavascript", "description": "Move all javascript to the footer on Magento 2 store.", "require": { - "magefan/module-community" : ">=2.2.7" + "magefan/module-community" : ">=2.2.10" }, "suggest": { "magefan/module-webp": "Install WebP Optimized Images to serve images in the next-gen format. Use coupon code COMPOSER-FAN to get 10% discount on magefan.com.", "magefan/module-lazyload": "Install Lazy Load to defer offscreen images loading." }, "type": "magento2-module", - "version": "2.2.1", + "version": "2.2.2", "authors": [ { "name": "Magefan", From 692981c4b49ce61503fd1b88f93d54eeaa6bcc00 Mon Sep 17 00:00:00 2001 From: Magefan - e-Commerce solutions you can trust Date: Mon, 12 May 2025 16:36:50 +0300 Subject: [PATCH 116/116] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 57864e1..3f7f168 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,8 @@ The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensou ### [Magento 2 Admin Panel Extensions](https://magefan.com/magento-2-extensions/admin-extensions) + + * [Magento 2 Size Chart Extension](https://magefan.com/magento-2-size-chart) * [Magento 2 Security Extension](https://magefan.com/magento-2-security-extension) * [Magento 2 Admin Action Log](https://magefan.com/magento-2-admin-action-log) * [Magento 2 Order Editor](https://magefan.com/magento-2-edit-order-extension)