joomla / jdoc missing when optimzer activated

3 views
Skip to first unread message

Matthew Philogene (raramuridesign)

unread,
Jun 27, 2009, 5:09:49 PM6/27/09
to Web Optimizer
Hi
I have installed this code and it works very well
however the one issue I found it that the jdoc code in joomla does not
output the code.

is there anything that I should be doing to avoid this ?

Matthew

Nikolay Matsievsky

unread,
Jun 28, 2009, 7:53:13 PM6/28/09
to Web Optimizer
Matthew --

please provide full explanation:
1. What version of Joomla
2. What jdoc code. Exact PHP code snippet.
3. What was before Web Optimizer (or you expect to see)
4. What is outputed exactly.

I will investigate this problem

Matthew Philogene [raramuridesign.com]

unread,
Jun 29, 2009, 3:26:40 AM6/29/09
to web-op...@googlegroups.com
Hi
Thanks for getting back to me

Info

Joomla v1.5.11
We have added the code to the index.php file in the template, not in the
root of the site, I hope this is correct.

When the code is switched off there it outputs all the css and js in the
<head>, this is normal.

When the web optimizer code is active the following happens

1. a single line of css code is inserted at the top of the page.
2. all javascript is removed, and I cannot find any reference to this in the
code
3. the following tag which is used in joomla, <jdoc:include type="head" />,
does not work. This tag also contains the javascript.
4. I have tried various combinations of settings, but none will show the
javascript.
5. on another page which has javascript in the <body> Tag, the code is not
moved to the top

Are you available on chat, if so let me know and I can walk you through
this.

Matthew

Nikolay Matsievsky

unread,
Jun 30, 2009, 7:01:23 AM6/30/09
to Web Optimizer
You need to update index.php of your website, not template.

Required changed for Joomla! 1.5:
first call (require for web.optimizer.php) in index.php after
$mainframe =& JFactory::getApplication('site');

last call ($web_optimizer->finish();) as the end of index.php
+ in file plugins/system/cache.php after string
echo JResponse::toString($mainframe->getCfg(\'gzip\'));
please insert
global $web_optimizer;
$web_optimizer->finish();

Web Optimizer can make all changes (and roll back) automatically.

Matthew Philogene [raramuridesign.com]

unread,
Jun 30, 2009, 1:30:38 PM6/30/09
to web-op...@googlegroups.com
Hi

We have tried your suggestions, but this does not work.

So what we are doing is building in a switch into the template where we can
switch this on and off through the CMS backend.

We have also rebuilt the jdoc to our own, so it works with the optimizer..
As we come across issues, we will let you know

CSS works fine
Javascript still has an issue as some of the elements are removed
completely, for no reason at all.

From a usability point of view to allow this to work in the joomla template
would be far more effective than having this work in the main core index
files, otherwise we edit CORE code, which means that if you do a patch or
update this will overrite what has been added.

Could you please consider this, because its very important.

Matthew


-----Original Message-----
From: web-op...@googlegroups.com [mailto:web-op...@googlegroups.com]
On Behalf Of Nikolay Matsievsky
Sent: 30 June 2009 01:01 PM
To: Web Optimizer
Subject: Re: joomla / jdoc missing when optimzer activated


Nikolay Matsievsky

unread,
Jun 30, 2009, 6:52:17 PM6/30/09
to Web Optimizer
Matt --

Web Optimizer handles any PHP system in the same way: with index.php.
Or processing result HTML. There can be a lot of useful features if we
use HTML output, not earlier document look in some kind of templates.
I.e. images splitting between multiple hosts won't work as it can be
-- because component's HTML code will contain alot of images.

The second problem is that there can be a lot of templates. And we
need to decide how many of them must be parsed -- all? And what will
occur if we install one more template? We will need to run Web
Optimizer installation (which is right now not easy process for server
due to chained optimization and some other issues) only to change this
template?

I understand your point of view: we have MVC and are trying to update
only View part of overall system, not M or C.

We are going to add plugins to Web Optimizer (maybe in 0.5.5). Plugins
can be defined for current CMS to improve actual performance issues
that belong to particular, not general scope. If you have any thoughts
how described jdoc-changing system can be applied to Web Optimizer (or
conversely) -- please describe it in details. I.e.:

"We have 1 call that parses pseudo HTML with jdoc, for jdoc launches
some system functionaly and replace content with output. Call outputs
some optimized HTML."

Matthew Philogene [raramuridesign.com]

unread,
Jul 2, 2009, 5:35:36 PM7/2/09
to web-op...@googlegroups.com
Hi
Thanks for the feedback.

I understand the benefits of adidng into the main index.php file, however it
does not make sense having to edit these files, especially if you are not
familiar with code...

Templates
We do custom templates, so we are looking for a custom solution for our
needs.. So if we could get this to work like we want it to, then awesome...

Our main concern is the jdoc header is removed, and this contains all the js
files that are populated from other components...

Thanks for letting me know how things are developing, maybe there is a
better way to handle the Joomla environment and I am open to suggestions,
just not sure right now... You are of course the expert on your system..

How are you doing this for wordpress and drupal ?

Matthew


-----Original Message-----
From: web-op...@googlegroups.com [mailto:web-op...@googlegroups.com]
On Behalf Of Nikolay Matsievsky
Sent: 01 July 2009 12:52 AM
To: Web Optimizer
Subject: Re: joomla / jdoc missing when optimzer activated


Nikolay Matsievsky

unread,
Jul 3, 2009, 4:02:51 AM7/3/09
to Web Optimizer
Matt --

the solution was easier than I've supposed. Joomla! doesn't understand
full XHTML syntax for
<jdoc:include type="component" />
but Web Optimizer (with default settings) transforms it to
<jdoc:include type="component"/>

So there can be 2 ways: 1 -- fix Joomla!
line 372 in libraries/joomla/document/html/html.php:
#<jdoc:include\ type="([^"]+)" (.*)\/>#
to
#<jdoc:include\ type="([^"]+)"(.*)\/>#
(additional space removed)

2 -- to disable HTML minify in Web Optimizer. Setting:
['minify']['page'] = "0"
or via web interface "Minify HTML" unchecked

This solved described problem for me and default Joomla! 1.5.11
installation.

Matthew Philogene [raramuridesign.com]

unread,
Jul 3, 2009, 5:36:31 AM7/3/09
to web-op...@googlegroups.com
Hi Nikolay

Have tested this as option 2, as we don't want to touch the CORE code in
case of an update

All info remains now in the tag... This is a good step

I can confirm all the css files are being put into a single file, however
now that the js files form the jdoc are there, these don't get combined into
one... Javascript cached file.

When I added the same 2 lines from the jdoc, these are also removed..

Can you explain what the following options do, I have the first 2 checked.

Enable unobtrusive JavaScript
Include merged JavaScript file before </body>
Move JavaScript informers calls before </body>
Move counters calls before </body>
Move advertisement (context and banners) calls before </body>

On External and inline scripts I have all 3 checked
Minify options, first 3 are checked

Thanks for all the help so far
Matthew



-----Original Message-----
From: web-op...@googlegroups.com [mailto:web-op...@googlegroups.com]
On Behalf Of Nikolay Matsievsky
Sent: 03 July 2009 10:03 AM
To: Web Optimizer
Subject: Re: joomla / jdoc missing when optimzer activated


Nikolay Matsievsky

unread,
Jul 3, 2009, 9:07:30 AM7/3/09
to Web Optimizer
Matt --

Web Optimizer doesn't parse jdoc tag. It hadles only raw (X)HTML.

> I can confirm all the css files are being put into a single file, however
> now that the js files form the jdoc are there, these don't get combined into
> one... Javascript cached file.

I suppose that some scripts are included in template and some have
been added by modules / system. If you want to let Web Optimizer
combibe all scripts -- please include them into the template.

> When I added the same 2 lines from the jdoc, these are also removed..

Please write what lines exactly have you added -- and what output you
saw. It's really very hard to understand 'what' are you doing to get
'something'.

> Can you explain what the following options do, I have the first 2 checked.

I think there should be an interface bug with settings... 'Include
merged JavaScript file before </body>' should override 'Enable
unobtrusive JavaScript' -- so it shoud be radio buttons, not
checkboxes there...

Unobtrusive JavaScript loads all required JavaScript calls after
onDOMLoaded event (crossbrowser) -- it's supported by small JS
library, YASS. So all your heavy client side logic can be delayed to
the moment it's really required -- when content is ready.

'Include merged JavaScript file before </body>' -- just includes the
final merged JS file before </body>. Maybe all of your scripts are
moved before </body> if you have checked this option? Can you please
check.

I think thre will be a complete article about Web Optimizer settings
in English. Right now thre is only one in Russian
http://webo.in/articles/habrahabr/96-web-optimizer-settings/
It can be translated via Google Translate into:
http://translate.google.com/translate?prev=hp&hl=en&js=n&u=http://webo.in/articles/habrahabr/96-web-optimizer-settings/&sl=ru&tl=en
Reply all
Reply to author
Forward
0 new messages