Home › Forum › Problemi Vari con WP › Aiuto "Rimanda analisi del codice Javascript"
-
AutorePost
-
-
9 Marzo 2012 alle 14:55 #21030rapstylePartecipante
Ciao a tutti,
sto tentando di velocizzare il mio sito Netclick.it.Non è molto veloce soprattutto a causa dei numerosi script Javascript e infatti quando eseguo una verifica delle prestazioni con Pagespeed mi dà il seguente suggerimento: “Rimanda analisi del codice Javascript”.Ho cercato su Google qualche possibile soluzione ma non c’è praticamente nulla.Qualcuno sa come fare?
Grazie in anticipo.
-
9 Marzo 2012 alle 15:56 #94253Alt Design Web AgencyPartecipante
Vedo che usi parecchi plugin che inseriscono codice javascript. E supppongo quindi tu non abbia le competenze tecniche per “smanettare” nel codice.
In caso mi sbagliassi, prova a minificare (tramite questo tool http://refresh-sf.com/yui/ ad esempio) i vari javascript (e i css volendo) e ad inserirli in coda alle pagine (prima di </body>) e non nella sezione head.
Poi controlla di aver veramente bisogno dei vari javascript che carichi e in caso rimuovi la loro inclusione direttamente dal codice php.
-
10 Marzo 2012 alle 0:42 #94263rapstylePartecipante
Ciao Alt e grazie per la risposta.In realtà ci capisco abbastanza di programmazione e il sito l’ho creato io da solo.Il problema è che di javascript non so praticamente nulla.I numerosi codici javascript provengono da pubblicità o bottoni di condivisione dei social network.
Ho provato il tool che mi hai linkato e, tranne in un paio di occasioni, mi ha dato quasi sempre degli errori.
Ho spostato i codici javascript che stavano nell’header, nel footer prima di </body>, ma erano solo un paio di Google.Tutti gli altri si trovano nell’index.php o nel single.php e sono posizionato nel punto in cui devono apparire nel tema, perciò se li sposto i vari pulsanti o banner appaiono ovviamente nel footer!
Probabilmente esiste qualche funzione che mi permette di richiamarli nel tema, ma non so quale sia.Hai qualche altro suggerimento?
-
10 Marzo 2012 alle 11:28 #94265TittiModeratore
Io vedo che l’analisi del Javascript è tra le low priority. Risolvi prima quelle segnate come “high” e “medium”, quindi soprattutto compressione, caching e ottimizzazione immagini
https://developers.google.com/pagespeed/#url=http_3A_2F_2Fwww.netclick.it_2F&mobile=false
-
10 Marzo 2012 alle 15:24 #94271rapstylePartecipante
Effettuando l’analisi col plugin di Page Speed per Firefox me lo dà tra le alte priorità e dice che sono ben 2,4 MB di codice javascript.Mentre da dove l’hai fatto tu dice che sono solo 200Kb.A quale dovrei dare retta?
Cmq pian piano risolverò pure le altre, ora mi stavo dedicando a questa perchè mi sembrava che rallentava il sito più di tutte.
-
10 Marzo 2012 alle 16:10 #94273TittiModeratore
Premesso che l’argomento è abbastanza OT, e che a me il tuo sito non m’è sembrato particolarmente lento, puoi sempre provare a disattivare/togliere momentaneamente tutto quel codice e vedere come va, e a reinserirlo gradualmente.
In ogni caso, dopo che avrai fatto tutte le ottimizzazioni del caso (a mano, non usando dei tool) e aver attivato la compressione, puoi sempre usare un plugin per la cache e un plugin per la minimizzazione del codice.
-
10 Marzo 2012 alle 16:32 #94274rapstylePartecipante
In realtà nemmeno a me sembra molto lento e il punteggio con Page Speed è abbastanza alto, ma Strumenti per i Webmaster mi dice che il caricamento del sito dura 18 secondi(cosa che non mi risulta) e che è più lento del 100% degli altri siti!
Per la cache uso già il plugin WP Super Cache ed effettuando i test dice che funziona senza problemi.Ora devo solo capire come attivare la compressione gzip(tophost non ha un’opzione per farlo nel pannello di controllo) e risolvere il problema dell’aggiornamento breve di alcune risorse cache.Se te per caso sai già come si fa te ne sarei immensamente grato
Per javascript farò i test come mi hai detto e forse userò un plugin.Grazie per l’aiuto
-
10 Marzo 2012 alle 17:44 #94281TittiModeratore
Vedo qua che la compressione gzip sul server è attiva (e si vede anche dal sorgente pagina) – ma nel dubbio puoi sempre chiedere al provider – quindi o qualche tool è troppo approssimativo (bisogna provarne diversi e incrociare i risultati perché hanno priorità differenti) oppure il plugin di cache non è ben configurato… io non ce l’ho ma credo che nei settaggi dovrebbe esserci la possibilità di attivare non solo gzip, ma anche deflate, database cache, minify e compressione html
Inoltre, specificare le dimensioni delle immagini è molto importante
(E poi aggiorna WordPress)
-
15 Marzo 2012 alle 12:55 #94403Alt Design Web AgencyPartecipante
puoi sempre usare un plugin per la cache e un plugin per la minimizzazione del codice.
Ciao Titti, che plugin consigli per la minimizzazione del codice?
-
15 Marzo 2012 alle 12:59 #94405
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.