Jump to content

Edit History

maestrobo

maestrobo

Hi there,

Just wanted to share my findings. PS 1.7 is very slow on the categories Page. Tested on 1.7.6.7

I have found it why. It is because of the little info about the "TOP CATEGORIES".

 

I found the culprit, it was a SQL query that was taking too much time.

It is in controllers/admin/AdminStatsController.php

Look for top_category and comment the section. You will speed really fast your categories page.
 

 case 'top_category':
            /*
                if (!($id_category = AdminStatsController::getBestCategory(
                    date('Y-m-d', strtotime('-1 month')),
                    date('Y-m-d')
                ))) {
                    $value = $this->trans('No category', array(), 'Admin.Stats.Feature');
                } else {
                    $category = new Category($id_category, $this->context->language->id);
                    $value = $category->name;
                }

                ConfigurationKPI::updateValue('TOP_CATEGORY', array($this->context->language->id => $value));
                ConfigurationKPI::updateValue(
                    'TOP_CATEGORY_EXPIRE',
                    array($this->context->language->id => strtotime('+1 day'))
                );
            */

break;

I have reported the bug:

https://github.com/PrestaShop/PrestaShop/issues/21106

 

maestrobo

maestrobo

Hi there,

Just wanted to share my findings. PS 1.7 is very slow on the categories Page. Tested on 1.7.6.7

I have found it why. It is because of the little info about the "TOP CATEGORIES".

 

I found the culprit, it was a SQL query that was taking too much time.

It is in controllers/admin/AdminStatsController.php

Look for top_category and comment the section. You will speed really fast your categories page.
 

 case 'top_category':
            /*
                if (!($id_category = AdminStatsController::getBestCategory(
                    date('Y-m-d', strtotime('-1 month')),
                    date('Y-m-d')
                ))) {
                    $value = $this->trans('No category', array(), 'Admin.Stats.Feature');
                } else {
                    $category = new Category($id_category, $this->context->language->id);
                    $value = $category->name;
                }

                ConfigurationKPI::updateValue('TOP_CATEGORY', array($this->context->language->id => $value));
                ConfigurationKPI::updateValue(
                    'TOP_CATEGORY_EXPIRE',
                    array($this->context->language->id => strtotime('+1 day'))
                );
            */

break;

 

×
×
  • Create New...