Subida del módulo y tema de PrestaShop

This commit is contained in:
Kaloyan
2026-04-09 18:31:51 +02:00
parent 12c253296f
commit 16b3ff9424
39262 changed files with 7418797 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
<div class="col-4">
<table class="table table-condensed">
<tr>
<td>PrestaShop Version</td>
<td>{$configuration.psVersion}</td>
</tr>
<tr>
<td>PHP Version</td>
<td>{$configuration.phpVersion}</td>
</tr>
<tr>
<td>MySQL Version</td>
<td>{$configuration.mysqlVersion}</td>
</tr>
<tr>
<td>Memory Limit</td>
<td>{$configuration.memoryLimit}</td>
</tr>
<tr>
<td>Max Execution Time</td>
<td>{$configuration.maxExecutionTime}s</td>
</tr>
<tr>
<td>Smarty Cache</td>
<td>
{if $configuration.smartyCache}
<span class="success">enabled</span>
{else}
<span class="error">disabled</span>
{/if}
</td>
</tr>
<tr>
<td>Smarty Compilation</td>
<td>
{if $configuration.smartyCompilation == 0}
<span class="success">never recompile</span>
{elseif $configuration.smartyCompilation == 1}
<span class="warning">auto</span>
{else}
<span class="red">force compile</span>
{/if}
</td>
</tr>
</table>
</div>

View File

@@ -0,0 +1,24 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
<div class="row">
<h2>
<a name="doubles">Doubles</a>
</h2>
<table class="table table-condensed">
{foreach $doublesQueries as $q => $nb}
{if $nb > 1}
<tr>
<td>
{sql_queries data=$nb}
</td>
<td class="pre">
<pre>{$q}</pre>
</td>
</tr>
{/if}
{/foreach}
</table>
</div>

View File

@@ -0,0 +1,31 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
<div class="row">
<h2>
<a name="includedFiles">
Included Files
</a>
</h2>
<table class="table table-condensed">
<tr>
<th>#</th>
<th>Filename</th>
</tr>
{foreach $files as $i => $file}
{$file = str_replace('\\', '/', str_replace(_PS_ROOT_DIR_, '', $file))}
{if (strpos($file, '/tools/profiling/') !== 0)}
<tr>
<td>
{$i}
</td>
<td>
{$file}
</td>
</tr>
{/if}
{/foreach}
</table>
</div>

View File

@@ -0,0 +1,16 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
{include file="./functions/load-time.tpl"}
{include file="./functions/memory.tpl"}
{include file="./functions/mysql-version.tpl"}
{include file="./functions/objectmodel.tpl"}
{include file="./functions/peak-memory.tpl"}
{include file="./functions/php-version.tpl"}
{include file="./functions/rows-browsed.tpl"}
{include file="./functions/sql-queries.tpl"}
{include file="./functions/table.tpl"}
{include file="./functions/time.tpl"}
{include file="./functions/total-queries.tpl"}
{include file="./functions/total-querying-time.tpl"}

View File

@@ -0,0 +1,14 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
{function name=load_time}
{if $data > 1.6}
<span class="danger">{round($data * 1000)}</span>
{elseif $data > 0.8}
<span class="warning">{round($data * 1000)}</span>
{else}
<span class="success">{sprintf('%01.3f', $data * 1000)}</span>
{/if}
ms
{/function}

View File

@@ -0,0 +1,17 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
{function name=memory}
{$data = round($data / 1048576, 2)}
{if $data > 3}
<span class="danger">{$data|string_format:"%0.2f"}</span>
{elseif $data > 1}
<span class="warning">{$data|string_format:"%0.2f"}</span>
{elseif round($data, 2) > 0}
<span class="success">{$data|string_format:"%0.2f"}</span>
{else}
<span class="success">-</span>
{/if}
Mb
{/function}

View File

@@ -0,0 +1,13 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
{function name=mysql_version}
{if version_compare($version, '5.6') < 0}
<span class="danger">{$data} (Upgrade strongly recommended)</span>
{elseif version_compare($version, '5.7') < 0}
<span class="warning">{$data} (Consider upgrading)</span>
{else}
<span class="success">{$data} (OK)</span>
{/if}
{/function}

View File

@@ -0,0 +1,13 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
{function name=objectmodel}
{if $data > 50}
<span class="danger">{$data}</span>
{elseif $data > 10}
<span class="warning">{$data}</span>
{else}
<span class="success">{$data}</span>
{/if}
{/function}

View File

@@ -0,0 +1,16 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
{function name=peak_memory}
{$data = round($data / 1048576, 2)}
{if $data > 16}
<span class="danger">{$data|string_format:"%0.1f"}</span>
{elseif $data > 12}
<span class="warning">{$data|string_format:"%0.1f"}</span>
{else}
<span class="success">{$data|string_format:"%0.1f"}</span>
{/if}
Mb
{/function}

View File

@@ -0,0 +1,13 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
{function name=php_version}
{if version_compare($version, '8.1') <= 0}
<span class="danger">{$data} (Upgrade strongly recommended)</span>
{elseif version_compare($version, '8.2') <= 0}
<span class="warning">{$data} (Consider upgrading)</span>
{else}
<span class="success">{$data} (OK)</span>
{/if}
{/function}

View File

@@ -0,0 +1,13 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
{function name=rows_browsed}
{if $data > 400}
<span class="danger">{$data} rows browsed</span>
{elseif $data > 100}
<span class="warning">{$data} rows browsed</span>
{else}
<span class="success">{$data} rows browsed</span>
{/if}
{/function}

View File

@@ -0,0 +1,13 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
{function name=sql_queries}
{if $data > 150}
<span class="danger">{$data} queries</span>
{elseif $data > 100}
<span class="warning">{$data} queries</span>
{else}
<span class="success">{$data} queries</span>
{/if}
{/function}

View File

@@ -0,0 +1,13 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
{function name=table}
{if $data > 30}
<span class="danger">{$data}</span>
{elseif $data > 20}
<span class="warning">{$data}</span>
{else}
<span class="success">{$data}</span>
{/if}
{/function}

View File

@@ -0,0 +1,13 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
{function name=time}
{if $data > 4}
<span class="danger">{$data}</span>
{elseif $data > 2}
<span class="warning">{$data}</span>
{else}
<span class="success">{$data}</span>
{/if}
{/function}

View File

@@ -0,0 +1,13 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
{function name=total_queries}
{if $data >= 100}
<span class="danger">{$data}</span>
{elseif $data >= 50}
<span class="warning">{$data}</span>
{else}
<span class="success">{$data}</span>
{/if}
{/function}

View File

@@ -0,0 +1,13 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
{function name=total_querying_time}
{if $data >= 100}
<span class="danger">{$data}</span>
{elseif $data >= 50}
<span class="warning">{$data}</span>
{else}
<span class="success">{$data}</span>
{/if}
{/function}

View File

@@ -0,0 +1,53 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
<div class="col-5">
<table class="table table-condensed">
<thead>
<tr>
<th>Hook</th>
<th>Time</th>
<th>Memory Usage</th>
</tr>
</thead>
<tbody>
{foreach $hooks.perfs as $hook => $hooksPerfs}
<tr>
<td>
<a href="javascript:void(0);" onclick="$('.{$hook}_modules_details').toggle();">{$hook}</a>
</td>
<td>
{load_time data=$hooksPerfs['time']}
</td>
<td>
{memory data=$hooksPerfs['memory']}
</td>
</tr>
{foreach $hooksPerfs['modules'] as $perfs}
<tr class="{$hook}_modules_details" style="background-color:#EFEFEF;display:none">
<td>
=&gt; {$perfs['module']}
</td>
<td>
{load_time data=$perfs['time']}
</td>
<td>
{memory data=$perfs['memory']}
</td>
</tr>
{/foreach}
{/foreach}
</tbody>
<tfoot>
<tr>
<th><b>{$hooks.perfs|count} hook(s)</b></th>
<th>{load_time data=$hooks.totalHooksTime}</th>
<th>{memory data=$hooks.totalHooksMemory}</th>
</tr>
</tfoot>
</table>
</div>

View File

@@ -0,0 +1,28 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
<div id="profiling-links">
<span>Profiling</span>
<ol>
<li>
<a href="#summary">Summary</a>
</li>
<li>
<a href="#stopwatch">Stopwatch SQL</a>
</li>
<li>
<a href="#doubles">Doubles</a>
</li>
<li>
<a href="#tables">Tables stress</a>
</li>
<li>
<a href="#objectModels">ObjectModel instances</a>
</li>
<li>
<a href="#includedFiles">Included Files</a>
</li>
</ol>
</div>

View File

@@ -0,0 +1,75 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/OSL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*}
<div class="col-5">
<table class="table table-condensed">
<thead>
<tr>
<th>Module</th>
<th>Time</th>
<th>Memory Usage</th>
</tr>
</thead>
<tbody>
{foreach $modules.perfs as $moduleName => $perfs}
<tr>
<td>
<a href="javascript:void(0);" onclick="$('.{$moduleName}_modules_details').toggle();">{$moduleName}</a>
</td>
</td>
<td>
{load_time data=$perfs['total_time']}
</td>
<td>
{memory data=$perfs['total_memory']}
</td>
</tr>
{foreach $perfs['details'] as $perfs}
<tr class="{$moduleName}_modules_details" style="background-color:#EFEFEF;display:none">
<td>
{$perfs['method']}
</td>
<td>
{load_time data=$perfs['time']}
</td>
<td>
{memory data=$perfs['memory']}
</td>
</tr>
{/foreach}
{/foreach}
</tbody>
<tfoot>
<tr>
<th><b>{$modules.perfs|count} module(s)</b></th>
<th>{load_time data=$modules.totalHooksTime}</th>
<th>{memory data=$modules.totalHooksMemory}</th>
</tr>
</tfoot>
</table>
</div>

View File

@@ -0,0 +1,38 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
<div class="row">
<h2>
<a name="objectModels">
ObjectModel instances
</a>
</h2>
<table class="table table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Instances</th>
<th>Source</th>
</tr>
</thead>
<tbody>
{foreach $objectmodel as $class => $info}
<tr>
<td>{$class}</td>
<td>
{objectmodel data=count($info)}
</td>
<td>
{foreach $info as $trace}
{str_replace([_PS_ROOT_DIR_, '\\'], ['', '/'], $trace['file'])}:{$trace['line']} ({$trace['function']}) [id: {$trace['id']}]
<br />
{/foreach}
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>

View File

@@ -0,0 +1,25 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
{include file="./functions.tpl"}
{include file="./styles.tpl"}
<div id="prestashop-profiling" class="container">
{include file="./links.tpl"}
<div class="row">
{include file="./summary.tpl" summary=$summary}
{include file="./configuration.tpl" configuration=$configuration}
{include file="./run.tpl" run=$run}
</div>
<div class="row">
{include file="./hooks.tpl" hooks=$hooks}
{include file="./modules.tpl" modules=$modules}
</div>
{include file="./stopwatch.tpl" stopwatchQueries=$stopwatchQueries}
{include file="./doubles.tpl" doublesQueries=$doublesQueries}
{include file="./table-stress.tpl" tableStress=$tableStress}
{include file="./objectmodel.tpl" objectmodel=$objectmodel}
{include file="./files.tpl" files=$files}
</div>

View File

@@ -0,0 +1,21 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
<html>
<head>
<meta charset="utf-8" />
<script src="//code.jquery.com/jquery-3.7.1.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="container" style="width:100%">
<div class="row">
<div class="col-lg-12">
<h2>Caught redirection to <a href="{$redirectAfter}">{$redirectAfter}</a></h2>
</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,37 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
<div class="col-4">
<table class="table table-condensed">
<thead>
<tr>
<th>&nbsp;</th>
<th>Time</th>
<th>Cumulated Time</th>
<th>Memory Usage</th>
<th>Memory Peak Usage</th>
</tr>
</thead>
<tbody>
{assign var="last" value=['time' => $run.startTime, 'memory_usage' => 0]}
{foreach from=$run.profiler item=row}
{if $row['block'] == 'checkAccess' && $row['time'] == $last['time']}
{continue}
{/if}
<tr>
<td>{$row['block']}</td>
<td>{load_time data=($row['time'] - $last['time'])}</td>
<td>{load_time data=($row['time'] - $run.startTime)}</td>
<td>{memory data=($row['memory_usage'] - $last['memory_usage'])}</td>
<td>{peak_memory data=($row['peak_memory_usage'])}</td>
</tr>
{assign var="last" value=$row}
{/foreach}
</tbody>
</table>
</div>

View File

@@ -0,0 +1,58 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
<div class="row">
<h2>
<a name="stopwatch">
Stopwatch SQL - {$summary.nbQueries} queries
</a>
</h2>
<table class="table table-condensed table-bordered sortable">
<thead>
<tr>
<th>#</th>
<th>Query</th>
<th>Time (ms)</th>
<th>Rows</th>
<th>Filesort</th>
<th>Group By</th>
<th>Location</th>
</tr>
</thead>
<tbody>
{foreach $stopwatchQueries as $data}
{$callstack = implode('<br>', $data['stack'])}
{$callstack_md5 = md5($callstack)}
<tr>
<td>{$data['id']}</td>
<td class="pre" style="max-width: 60vw"><pre>{preg_replace("/(^[\s]*)/m", "", htmlspecialchars($data['query'], ENT_NOQUOTES, 'utf-8', false))}</pre></td>
<td data-value="{sprintf('%01.6f', $data['time'])}">
{load_time data=($data['time'])}
</td>
<td>{$data['rows']}</td>
<td data-value="{$data['filesort']}">
{if $data['filesort']}
<span class="danger">Yes</span>
{/if}
</td>
<td data-value="{$data['group_by']}">
{if $data['group_by']}
<span class="danger"">Yes</span>
{/if}
</td>
<td data-value="{$data['location']}">
<a href="javascript:void(0);" onclick="$('#callstack_{$callstack_md5}').toggle();">{$data['location']}</a>
<div id="callstack_{$callstack_md5}" style="display:none">
{foreach $data['stack'] as $stack}
{$stack}<br/>
{/foreach}
</div>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>

View File

@@ -0,0 +1,166 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
<style>
#prestashop-profiling {
max-width: 100%;
padding: 20px;
}
.ps_back-office.page-sidebar #prestashop-profiling {
margin-left: 210px;
}
.ps_back-office.page-sidebar-closed #prestashop-profiling {
margin-left: 50px;
}
.ps_back-office #prestashop-profiling {
clear: both;
padding: 10px;
margin-bottom: 50px;
}
#prestashop-profiling * {
box-sizing:border-box;
-moz-box-sizing:border-box;
}
#prestashop-profiling .table {
width: 100%;
}
#prestashop-profiling .table td,
#prestashop-profiling .table th {
padding: 6.4px;
padding: .4rem;
vertical-align: top;
border-top: 1px solid #bbcdd2;
vertical-align: middle;
text-align: left;
}
#prestashop-profiling .table th {
padding-top: 0.625rem;
padding-bottom: 0.625rem;
}
#prestashop-profiling .table thead th {
border-bottom: .125rem solid #25b9d7;
}
#prestashop-profiling .table tfoot th {
border-top: .125rem solid #25b9d7;
}
#prestashop-profiling .sortable thead th {
cursor:pointer;
}
#prestashop-profiling .table td .pre {
padding: 6px;
margin-right: 10px;
overflow: auto;
display: block;
color: #777;
font-size: 12px;
line-height: 1.42857;
word-break: break-all;
word-wrap: break-word;
background-color: whitesmoke;
border: 1px solid #cccccc;
max-width: 960px;
}
#prestashop-profiling .row {
clear: both;
margin-bottom: 20px;
}
#prestashop-profiling .col-4 {
float: left;
padding: 0 10px;
width: 33%;
}
@media (max-width: 1200px) {
#prestashop-profiling .col-4 {
width: 50%;
}
}
@media (max-width: 600px) {
#prestashop-profiling .col-4 {
width: 100%;
}
}
#prestashop-profiling .col-5 {
float: left;
padding: 0 10px;
width: 40%;
}
@media (max-width: 1200px) {
#prestashop-profiling .col-5 {
width: 50%;
}
}
@media (max-width: 600px) {
#prestashop-profiling .col-5 {
width: 100%;
}
}
#prestashop-profiling .col-2 {
float: left;
padding: 0 10px;
width: 20%;
}
@media (max-width: 1200px) {
#prestashop-profiling .col-2 {
width: 20%;
}
}
@media (max-width: 600px) {
#prestashop-profiling .col-2 {
width: 100%;
}
}
#profiling-links {
display: flex;
width: fit-content;
position: fixed;
top: 0;
right: 0;
transform: translateX(calc(100% - 38px));
padding: 10px;
background: #EEE;
z-index: 10000;
transition: transform ease-in-out .2s;
}
#profiling-links:hover {
left: unset;
transform: translateX(0);
}
#profiling-links span {
writing-mode: vertical-rl;
text-orientation: mixed;
}
#profiling-links ol {
padding-left: 25px;
}
.success {
color: green;
}
.danger {
color: red;
}
.warning {
color: #EF8B00;
}
</style>
<script type="text/javascript" src="https://cdn.rawgit.com/drvic10k/bootstrap-sortable/1.11.2/Scripts/bootstrap-sortable.js"></script>

View File

@@ -0,0 +1,73 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
<div class="col-4" id="summary">
<table class="table table-condensed">
<tr>
<td>
Load Time
</td>
<td>
{load_time data=$summary.loadTime}
</td>
</tr>
<tr>
<td>Querying Time</td>
<td>
{total_querying_time data=$summary.queryTime} ms
</td>
</tr>
<tr>
<td>
Queries
</td>
<td>
{total_queries data=$summary.nbQueries}
</td>
</tr>
<tr>
<td>
Memory Peak Usage
</td>
<td>
{peak_memory data=$summary.peakMemoryUsage}
</td>
</tr>
<tr>
<td>
Included Files
</td>
<td>
{$summary.includedFiles} files - {memory data=$summary.totalFileSize}
</td>
</tr>
<tr>
<td>
PrestaShop Cache
</td>
<td>
{memory data=$summary.totalCacheSize}
</td>
</tr>
<tr>
<td>
<a href="javascript:void(0);" onclick="$('.global_vars_detail').toggle();">Global vars</a>
</td>
<td>
{memory data=$summary.totalGlobalVarSize}
</td>
</tr>
{foreach $summary.globalVarSize as $global=>$size}
<tr class="global_vars_detail" style="display:none">
<td>
- global ${$global}
</td>
<td>
{$size}k
</td>
</tr>
{/foreach}
</table>
</div>

View File

@@ -0,0 +1,16 @@
{**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*}
<div class="row">
<h2><a name="tables">Tables stress</a></h2>
<table class="table table-condensed">
{foreach $tableStress as $table => $nb}
<tr>
<td>
{table data=$nb} {$table}
</td>
</tr>
{/foreach}
</table>
</div>