swatit-jromero / wpng-calendar

Automatically exported from code.google.com/p/wpng-calendar
0 stars 0 forks source link

The script is very long to load #60

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Install and activate the wpng plugin
2. Check your loading time
3. Desactivate the wpng plugin and compare the loading time

What is the expected output? What do you see instead?
I should have my homepage loaded in like 2/3 seconds, and it just double
the loading time on all pages that contain the sidebar with the widget when
it's activated.

What version of the product are you using? On what operating system?
WPNG 0.8.5 / WP 2.6

Is there a way to improve the script ???

Thanks,
Nicolas

Original issue reported on code.google.com by parisgolo on 17 Jul 2008 at 9:11

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Results I get to load my homepage with the plugin activated (in French but you 
should
understand):

Plate-forme serveur:    cafe
Taille totale des pages :   297.183 octets
Nombre total d'éléments :     28
Temps de chargement théorique avec Modem / ISDN (56-64 kbs):   39,62 s
Temps de chargement théorique avec DSL1000 (1024 kbit/s):  2,32 s
Temps de chargement théorique avec DSL 2000 (2048 kbit/s): 1,16 s
Temps de chargement théorique avec DSL 3000 (3064 kbit/s): 0,77 s
Temps de chargement théorique avec DSL6000 (6128 kbit/s):  0,39 s
Evaluation globale (notes de 0 à 10) : 3  (passable)

Results without the plugin:

Plate-forme serveur:    cafe
Taille totale des pages :   139.022 octets
Nombre total d'éléments :     19
Temps de chargement théorique avec Modem / ISDN (56-64 kbs):   18,54 s
Temps de chargement théorique avec DSL1000 (1024 kbit/s):  1,09 s
Temps de chargement théorique avec DSL 2000 (2048 kbit/s): 0,54 s
Temps de chargement théorique avec DSL 3000 (3064 kbit/s): 0,36 s
Temps de chargement théorique avec DSL6000 (6128 kbit/s):  0,18 s
Evaluation globale (notes de 0 à 10) : 7  (bien)

The script that is very long to execute is clearly flagged (54Ko) :
http://www.parisgolo.com/wp-content/plugins/wpng-calendar/js/jquery.js?ver=6124

Original comment by parisgolo on 18 Jul 2008 at 11:58

GoogleCodeExporter commented 8 years ago
Not sure this will help you if you're using the widget. I am using the calendar 
on a
single page only. I wrapped some of the functions located in wpng-calendar.php 
with
conditional statements.

With this change the js and css is only loaded on the page containing the 
calendar.

Replace ID# below with your pages ID number

*******
function addWPNGHeader() {
//  if statement only loads js & css files on calendar page with ID 1612
//  Replace ID# below with your pages ID number

   if (is_page('1612')) {
   // rest of existing function here
*******

Then add "}" before each functions final "}"

Do that to the following 3 functions.

function addWPNGHeader() (shown above)
function addWPNGSettings()
function addOnLoadScript()

Original comment by travt...@gmail.com on 22 Oct 2008 at 3:39