← WordPress

Isto pesa muito num site?

Lida 9636 vezes

Offline

Carlos Gandra 
Administrador
Mensagens 3081 Gostos 97
Feedback +1

Troféus totais: 34
Trófeus: (Ver todos)
Level 6 Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4

Ok, done. Já agora, quais são as que coloco Enable? Para já só tenho a Page Cache e Minify...

Page Cache método 'Disk enhanced' e Minify método 'Disk', não precisas de mais nada.

Na minha questão inicial só queria saber se aquele PHP todo pesava ou não muito no site:

Código: [Seleccione]
<?php if (is_category(22)) { ?>
<img src="http://ptwrestling.net/images/thumb_noticias.jpg" width="100" height="75" alt="<?php the_title(); ?>" title="<?php the_title(); ?>">
<?php } elseif (has_tag(43)) { ?>
<img src="http://ptwrestling.net/images/thumb_roh.jpg" width="100" height="75" alt="<?php the_title(); ?>" title="<?php the_title(); ?>">
<?php } elseif (has_tag(174)) { ?>
<img src="http://ptwrestling.net/images/thumb_vintagecollection.jpg" width="100" height="75" alt="<?php the_title(); ?>" title="<?php the_title(); ?>">
<?php } elseif (has_tag(313)) { ?>
<img src="http://ptwrestling.net/images/thumb_toughenough.jpg" width="100" height="75" alt="<?php the_title(); ?>" title="<?php the_title(); ?>">
<?php } elseif (has_tag(298)) { ?>
<img src="http://ptwrestling.net/images/thumb_semanadelucha.jpg" width="100" height="75" alt="<?php the_title(); ?>" title="<?php the_title(); ?>">
<?php } elseif (has_tag(81)) { ?>
<img src="http://ptwrestling.net/images/thumb_wp.jpg" width="100" height="75" alt="<?php the_title(); ?>" title="<?php the_title(); ?>">
<?php } elseif (has_tag(83)) { ?>
<img src="http://ptwrestling.net/images/thumb_wsw.jpg" width="100" height="75" alt="<?php the_title(); ?>" title="<?php the_title(); ?>">
<?php } elseif (has_tag(84)) { ?>
<img src="http://ptwrestling.net/images/thumb_apw.jpg" width="100" height="75" alt="<?php the_title(); ?>" title="<?php the_title(); ?>">
<?php } elseif (has_tag(70)) { ?>
<img src="http://ptwrestling.net/images/thumb_ufc.jpg" width="100" height="75" alt="<?php the_title(); ?>" title="<?php the_title(); ?>">
<?php } else { ?>
<?php get_thumbnail($post->ID'thumbnail''alt="' $post->post_title '"'); ?>
<?php ?>

Isto porque todos os posts dessas Tags têm um thumbnail fixo e sempre igual, os outros é que já têm um personalizado a cada post (penúltima linha do código).

Não me parece que vá pesar...
Offline

Luís Salvador 
Membro
Mensagens 2068 Gostos 37
Feedback +4

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Ok, tá feito. Obrigado ;D

Tass bem, é que assim poupo o trabalho de fazer upload imensas vezes da mesma imagem (mas com nomes diferentes) para as associar aos diversos posts pertencentes à mesma categoria ou com a mesma tag : )
Offline

Luís Salvador 
Membro
Mensagens 2068 Gostos 37
Feedback +4

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Uma cena, na parte do Minify tenho que adicionar os vários links de .js e .css ? Um a um ?
Offline

Carlos Gandra 
Administrador
Mensagens 3081 Gostos 97
Feedback +1

Troféus totais: 34
Trófeus: (Ver todos)
Level 6 Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4

Uma cena, na parte do Minify tenho que adicionar os vários links de .js e .css ? Um a um ?

Yap (se quiseres a melhor performance)
Offline

Luís Salvador 
Membro
Mensagens 2068 Gostos 37
Feedback +4

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Ganda trabalheira LOL ok, lá vou eu meter os links lá...
Offline

Luís Salvador 
Membro
Mensagens 2068 Gostos 37
Feedback +4

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Alguns não posso por porque avariam os plugins, deixam de funcionar...
Offline

Fernando Augusto 
Membro
Mensagens 922 Gostos 0
Feedback +1

Troféus totais: 30
Trófeus: (Ver todos)
Linux User Mobile User Windows User Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3

Pois isso acontece as vezes, mas também não é por um ou dois que o site fica mais lento/rapido pelo menos nao noto isso.

ac99 como tiras os  - Remove os ?ver=x.xx ?
Offline

rtbfreitas 
Equipa
Mensagens 1497 Gostos 9
Feedback +24

Troféus totais: 30
Trófeus: (Ver todos)
Windows User Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4

ac99 como tiras os  - Remove os ?ver=x.xx ?

Basta colocares nas configurações sem os ?ver=x.xx .

Alguns não posso por porque avariam os plugins, deixam de funcionar...

Estás a colocar no footer? Se sim, experimenta colocar esses no header.
Offline

Luís Salvador 
Membro
Mensagens 2068 Gostos 37
Feedback +4

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Desenterro!!

E isto, pesa muito:

É que com este código não preciso de estar a associar imagens a posts para aparecer thumbnails "por defeito".

Código: [Seleccione]
# DISPLAY POST IMAGE ATTACHMENT (sizes: thumbnail, medium, full)
function get_thumbnail($postid=0, $size='thumbnail', $attributes='') {
if ($postid<1) $postid = get_the_ID();
if ($images = get_children(array(
'post_parent' => $postid,
'post_type' => 'attachment',
'numberposts' => 1,
'post_mime_type' => 'image', )))
foreach($images as $image) {
$thumbnail=wp_get_attachment_image_src($image->ID, $size);
?>

<img src="<?php echo $thumbnail[0]; ?>" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" /*<?php echo $attributes?>*/ />
<?php }
elseif (in_category(22)) { echo '<img src="http://ptwrestling.net/images/thumb_noticias.jpg" />'; }

elseif (has_tag(43)) { echo '<img src="http://ptwrestling.net/images/thumb_roh.jpg" />'; }
elseif (has_tag(174)) { echo '<img src="http://ptwrestling.net/images/thumb_vintagecollection.jpg" />'; }
elseif (has_tag(313)) { echo '<img src="http://ptwrestling.net/images/thumb_toughenough.jpg" />'; }
elseif (has_tag(85)) { echo '<img src="http://ptwrestling.net/images/thumb_fcw.jpg" />'; }
elseif (has_tag(298)) { echo '<img src="http://ptwrestling.net/images/thumb_semanadelucha.jpg" />'; }
elseif (has_tag(81)) { echo '<img src="http://ptwrestling.net/images/thumb_wp.jpg" />'; }
elseif (has_tag(83)) { echo '<img src="http://ptwrestling.net/images/thumb_wsw.jpg" />'; }
elseif (has_tag(84)) { echo '<img src="http://ptwrestling.net/images/thumb_apw.jpg" />'; }
elseif (has_tag(389)) { echo '<img src="http://ptwrestling.net/images/thumb_wwe12.jpg" />'; }
elseif (has_tag(197)) { echo '<img src="http://ptwrestling.net/images/impacto_global_logo_thumb.jpg" />'; }

elseif (has_tag(149)) { echo '<img src="http://ptwrestling.net/images/tna_genesis_2011_logo.jpg" />'; }
elseif (has_tag(244)) { echo '<img src="http://ptwrestling.net/images/wwe_tlc_2010_logo.jpg" />'; }
elseif (has_tag(116)) { echo '<img src="http://ptwrestling.net/images/tna_final_resolution_logo.jpg" />'; }
elseif (has_tag(97)) { echo '<img src="http://ptwrestling.net/images/wwe_survivor_series_logo.jpg" />'; }
elseif (has_tag(98)) { echo '<img src="http://ptwrestling.net/images/tna_turning_point_logo.jpg" />'; }
elseif (has_tag(37)) { echo '<img src="http://ptwrestling.net/images/tna_bound_for_glory_logo.jpg" />'; }
elseif (has_tag(238)) { echo '<img src="http://ptwrestling.net/images/wwe_hell_in_a_cell_logo.jpg" />'; }
elseif (has_tag(241)) { echo '<img src="http://ptwrestling.net/images/wwe_bragging_rights_logo.jpg" />'; }
elseif (has_tag(147)) { echo '<img src="http://ptwrestling.net/images/wwe_royal_rumble_2011_logo.jpg" />'; }
elseif (has_tag(166)) { echo '<img src="http://ptwrestling.net/images/tna_against_all_odds_logo_thumb.jpg" />'; }
elseif (has_tag(193)) { echo '<img src="http://ptwrestling.net/images/tna_lockdown_t.jpg" />'; }
elseif (has_tag(248)) { echo '<img src="http://ptwrestling.net/images/wwe_elimination_chamber_logo_thumb.jpg" />'; }
elseif (has_tag(222)) { echo '<img src="http://ptwrestling.net/images/tna_victory_road_2011_thumb.jpg" />'; }
elseif (has_tag(135)) { echo '<img src="http://ptwrestling.net/images/wwe_wrestlemania_xxvii_thumb.jpg" />'; }
elseif (has_tag(206)) { echo '<img src="http://ptwrestling.net/images/wwe_extreme_rules_thumb.jpg" />'; }
elseif (has_tag(202)) { echo '<img src="http://ptwrestling.net/images/thumb_sacrifice.jpg" />'; }
elseif (has_tag(260)) { echo '<img src="http://ptwrestling.net/images/thumb_overthelimit.jpg" />'; }
elseif (has_tag(360)) { echo '<img src="http://ptwrestling.net/images/thumb_capitolpunishment.jpg" />'; }
elseif (has_tag(180)) { echo '<img src="http://ptwrestling.net/images/thumb_destinationx.jpg" />'; }
elseif (has_tag(263)) { echo '<img src="http://ptwrestling.net/images/thumb_moneyinthebank.jpg" />'; }
elseif (has_tag(378)) { echo '<img src="http://ptwrestling.net/images/thumb_hardcorejustice.jpg" />'; }
elseif (has_tag(228)) { echo '<img src="http://ptwrestling.net/images/thumb_summerslam.jpg" />'; }

else { echo '<img src="http://ptwrestling.net/wp-content/themes/channel/images/noimage.gif" />'; }
}
Offline

Luís Salvador 
Membro
Mensagens 2068 Gostos 37
Feedback +4

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Existe melhor maneira de fazer isto?
Offline

Luís Salvador 
Membro
Mensagens 2068 Gostos 37
Feedback +4

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Up! Alguém que perceba de PHP me sabe dizer se isso pesa muito no functions.php?