Answer the question
In order to leave comments, you need to log in
Either fast or slow site loading. What could be?
Good day!
The customer complains that his website is loading slowly.
I tested it, and what seemed strange to me, it really happens when the download is terribly long
. For example:
It also takes about 20 minutes to load the page with the cache cleaning, etc. and get the results:
what is the reason for this result? Whose fault? mine or admin?
the only request on the page is the output of projects (there are not many of them 15-20 and many are not planned, i.e. there will not be 100-200, etc.)
<? foreach($project as $item) : ?>
<?
$img_small = simple_fields_value("small_img", $item->ID);
$project_year = simple_fields_value("project_year", $item->ID);
?>
<span class="item popup-contacts" data-tag="id<?=$item->ID?>" data-content="<?=$item->post_content?>" data-time="<?=$project_year?>" href="#">
<div class="time"><?=$project_year?></div>
<span class="title-project"><?=$item->post_title?></span>
<div class="wrap-icon">
<div style="background-image: url('<?=$img_small['url']?>')" class="icon"></div>
</div>
</span>
<? endforeach ?>
Answer the question
In order to leave comments, you need to log in
If this is vds or your server, then most likely it is incorrectly configured. To check, you need to place another test site on wp and test it.
If a simple hosting tariff, then resources are usually blocked for a while when using the maximum allowable amount of resources. Roughly speaking, if the memory is full.
- This moment is usually due to site scripts. Often the bottleneck is the queries to the database - complex or a lot of them. There can also be a large load due to file processing, such as images (this is just for reference, not in your case).
As many have already said, you need to find the simple_fields_value code and see what is being done there. But it seems to me that this is just a crude replacement for the standard get_post_meta().
It is very difficult to say from a small piece of code like this what can slow down there. But still I'll try.
It is not written according to WP standards.
More than standard. If even in this piece it does not meet the standards, I do not think that the rest of the code will be better.
That's where it slows down.
you ask strange questions
, it's enough to put a profiler and it will tell you where everything works slowly, why guess on coffee grounds.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question