Skip to content

Commit

Permalink
release 1.15.3
Browse files Browse the repository at this point in the history
  • Loading branch information
toonvd committed Aug 26, 2021
1 parent ea9e9af commit 79dedbe
Show file tree
Hide file tree
Showing 5 changed files with 154 additions and 51 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### 1.15.3 (2021-08-26)

* Added MySQL default settings check
* Added move_script_to_bottom check
* Removed merge and bundling checks since they often hurt performance

### 1.15.2 (2021-07-23)

* Fixed logger path
Expand Down
94 changes: 94 additions & 0 deletions Model/DashboardRow/MySQLSettings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?php


/**
* Performance Dashboard Extension for Magento 2
*
* PHP version 5
*
* @category MageHost
* @package MageHost\PerformanceDashboard
* @author Jeroen Vermeulen <jeroen@magehost.pro>
* @copyright 2019 MageHost BV (https://magehost.pro)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://github.com/magehost/performance-dashboard
*/

namespace MageHost\PerformanceDashboard\Model\DashboardRow;

use MageHost\PerformanceDashboard\Model\DashboardRow;
use MageHost\PerformanceDashboard\Model\DashboardRowInterface;
use Magento\Framework\App\ResourceConnection;

/**
* Class MySQLSettings
*
* Dashboard row to check MySQL configuration
*
* @category MageHost
* @package MageHost\PerformanceDashboard\Model\DashboardRow
* @author Jeroen Vermeulen <jeroen@magehost.pro>
* @license https://opensource.org/licenses/MIT MIT License
* @link https://github.com/magehost/performance-dashboard
*/
class MySQLSettings extends DashboardRow implements DashboardRowInterface
{
/**
* @var ResourceConnection
*/
private $resourceConnection;


/**
* @var int[]
*/
private $defaultValues
= [
'innodb_buffer_pool_size' => 134217728,
'max_connections' => 150,
'innodb_thread_concurrency' => 0,
];

/**
* MySQLSettings constructor.
*
* @param ResourceConnection $resourceConnection
* @param array $data
*/
public function __construct(
ResourceConnection $resourceConnection,
array $data
) {
$this->resourceConnection = $resourceConnection;
parent::__construct($data);
}

/**
* Load Row, is called by DashboardRowFactory
*/
public function load()
{
/** @noinspection PhpUndefinedMethodInspection */
$this->setTitle(__('MySQL Configuration'));
$this->buttons[] = '[devdocs-guides]/performance-best-practices/software.html' .
'#mysql';

$connection = $this->resourceConnection->getConnection();
$info = '';
foreach ($this->defaultValues as $key => $value) {
$currentValue = $connection->fetchRow('SHOW VARIABLES LIKE \'' . $key . '\'');
if ($currentValue['Value'] <= $value) {
$this->problems .= $key . ' lower than - or equal to the default value: '
. $currentValue['Value'];
$this->actions .= 'Ask your hosting to tune ' . $key;
}
$info .= $key . ' = ' . $currentValue['Value'] . "\n";
}

if ($this->problems == '') {
$this->info = $info;
}

$this->groupProcess();
}
}
98 changes: 50 additions & 48 deletions Model/ResourceModel/Grid/Collection.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Performance Dashboard Extension for Magento 2
*
Expand Down Expand Up @@ -93,7 +94,7 @@ public function loadData($printQuery = false, $logQuery = false)
$this->logger->debug(
sprintf(
"%s::%s does not get its data from direct database queries," .
"it is gathered from several internal Magento objects and logging.",
"it is gathered from several internal Magento objects and logging.",
__CLASS__,
__FUNCTION__
)
Expand All @@ -104,6 +105,8 @@ public function loadData($printQuery = false, $logQuery = false)
/** @noinspection PhpUnhandledExceptionInspection */
$this->addItem($this->rowFactory->create('PhpSettings'));
/** @noinspection PhpUnhandledExceptionInspection */
$this->addItem($this->rowFactory->create('MySQLSettings'));
/** @noinspection PhpUnhandledExceptionInspection */
$this->addItem($this->rowFactory->create('AppStateMode'));
/** @noinspection PhpUnhandledExceptionInspection */
$this->addItem($this->rowFactory->create('HttpVersion'));
Expand Down Expand Up @@ -131,21 +134,20 @@ private function addItemsCache()
$this->rowFactory->create(
'CacheStorage',
[
'identifier' => 'default',
'name' => 'Magento Cache',
'buttons' => '[devdocs-guides]/config-guide/redis/redis-pg-cache.html'
'identifier' => 'default',
'name' => 'Magento Cache',
'buttons' => '[devdocs-guides]/config-guide/redis/redis-pg-cache.html'
]
)
);
if (Config::BUILT_IN ==$this->scopeConfig->getValue('system/full_page_cache/caching_application')
) {
if (Config::BUILT_IN == $this->scopeConfig->getValue('system/full_page_cache/caching_application')) {
$this->addItem(
$this->rowFactory->create(
'CacheStorage',
[
'identifier' => 'page_cache',
'name' => 'Full Page Cache',
'buttons' => '[devdocs-guides]/config-guide/redis/redis-pg-cache.html'
'identifier' => 'page_cache',
'name' => 'Full Page Cache',
'buttons' => '[devdocs-guides]/config-guide/redis/redis-pg-cache.html'
]
)
);
Expand Down Expand Up @@ -206,11 +208,11 @@ private function addItemsConfig()
$this->rowFactory->create(
'ConfigSetting',
[
'title' => 'Full Page Caching Application',
'path' => 'system/full_page_cache/caching_application',
'recommended' => Config::VARNISH,
'source' => \Magento\PageCache\Model\System\Config\Source\Application::class,
'buttons' => '[devdocs-guides]/config-guide/varnish/config-varnish.html'
'title' => 'Full Page Caching Application',
'path' => 'system/full_page_cache/caching_application',
'recommended' => Config::VARNISH,
'source' => \Magento\PageCache\Model\System\Config\Source\Application::class,
'buttons' => '[devdocs-guides]/config-guide/varnish/config-varnish.html'
]
)
);
Expand All @@ -220,34 +222,34 @@ private function addItemsConfig()
$this->rowFactory->create(
'ConfigSetting',
[
'title' => 'Enable JavaScript Bundling',
'path' => 'dev/js/enable_js_bundling',
'recommended' => true,
'buttons' => '[devdocs-guides]/frontend-dev-guide/themes/js-bundling.html'
'title' => 'Enable JavaScript Bundling',
'path' => 'dev/js/enable_js_bundling',
'recommended' => true,
'buttons' => '[devdocs-guides]/frontend-dev-guide/themes/js-bundling.html'
]
)
);
$this->addItem(
$this->rowFactory->create(
'ConfigSetting',
[
'title' => 'Merge JavaScript Files',
'path' => 'dev/js/merge_files',
'recommended' => true,
'buttons' => '[devdocs-guides]/config-guide/prod/prod_perf-optimize.html'.
'#magento---performance-optimizations'
'title' => 'Merge JavaScript Files',
'path' => 'dev/js/merge_files',
'recommended' => true,
'buttons' => '[devdocs-guides]/config-guide/prod/prod_perf-optimize.html' .
'#magento---performance-optimizations'
]
)
);
$this->addItem(
$this->rowFactory->create(
'ConfigSetting',
[
'title' => 'Merge CSS Files',
'path' => 'dev/css/merge_css_files',
'recommended' => true,
'buttons' => '[devdocs-guides]/config-guide/prod/prod_perf-optimize.html'.
'#magento---performance-optimizations'
'title' => 'Merge CSS Files',
'path' => 'dev/css/merge_css_files',
'recommended' => true,
'buttons' => '[devdocs-guides]/config-guide/prod/prod_perf-optimize.html' .
'#magento---performance-optimizations'
]
)
);
Expand All @@ -256,35 +258,35 @@ private function addItemsConfig()
$this->rowFactory->create(
'ConfigSetting',
[
'title' => 'Minify JavaScript Files',
'path' => 'dev/js/minify_files',
'recommended' => true,
'buttons' => '[devdocs-guides]/config-guide/prod/prod_perf-optimize.html'.
'#magento---performance-optimizations'
'title' => 'Minify JavaScript Files',
'path' => 'dev/js/minify_files',
'recommended' => true,
'buttons' => '[devdocs-guides]/config-guide/prod/prod_perf-optimize.html' .
'#magento---performance-optimizations'
]
)
);
$this->addItem(
$this->rowFactory->create(
'ConfigSetting',
[
'title' => 'Minify CSS Files',
'path' => 'dev/css/minify_files',
'recommended' => true,
'buttons' => '[devdocs-guides]/config-guide/prod/prod_perf-optimize.html'.
'#magento---performance-optimizations'
'title' => 'Minify CSS Files',
'path' => 'dev/css/minify_files',
'recommended' => true,
'buttons' => '[devdocs-guides]/config-guide/prod/prod_perf-optimize.html' .
'#magento---performance-optimizations'
]
)
);
$this->addItem(
$this->rowFactory->create(
'ConfigSetting',
[
'title' => 'Minify HTML',
'path' => 'dev/template/minify_html',
'recommended' => true,
'buttons' => '[devdocs-guides]/config-guide/prod/prod_perf-optimize.html'.
'#magento---performance-optimizations'
'title' => 'Minify HTML',
'path' => 'dev/template/minify_html',
'recommended' => true,
'buttons' => '[devdocs-guides]/config-guide/prod/prod_perf-optimize.html' .
'#magento---performance-optimizations'
]
)
);
Expand All @@ -293,11 +295,11 @@ private function addItemsConfig()
$this->rowFactory->create(
'ConfigSetting',
[
'title' => 'Asynchronous sending of sales emails',
'path' => 'sales_email/general/async_sending',
'recommended' => true,
'buttons' => '[user-guides]/configuration/sales/sales-emails.html'.
'#stores---configuration---sales---sales-emails'
'title' => 'Asynchronous sending of sales emails',
'path' => 'sales_email/general/async_sending',
'recommended' => true,
'buttons' => '[user-guides]/configuration/sales/sales-emails.html' .
'#stores---configuration---sales---sales-emails'
]
)
);
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Checks executed:
* Is PHP 7 in use?
* Is HTTP/2 in use?
* Are the PHP performance settings correct?
* Are the MySQL performance settings tuned?
* Is Magento in Production mode?
* Is the Magento Cache stored in Redis?
* Is the Full Page Cache stored in Redis?
Expand All @@ -49,10 +50,10 @@ Checks executed:
* Is the Full Page Cache using Varnish?
* For Magento >= 2.3.1:
* Is Elastic Search in use?
* For Magento >= 2.3.2:
* Is JavaScript defered?
* For Magento < 2.2:
* If not on HTTP/2:
* Is JavaScript bundling enabled?
* Is merging JavaScript files enabled?
* Is merging CSS files enabled?
* Is minify of JavaScript files enabled?
* Is minify of CSS files enabled?
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Performance Dashboard for Magento 2.x by MageHost.pro",
"homepage": "https://github.com/magehost/performance-dashboard",
"type": "magento2-module",
"version": "1.15.2",
"version": "1.15.3",
"minimum-stability": "beta",
"license": "MIT",
"authors":[
Expand Down

0 comments on commit 79dedbe

Please sign in to comment.