[wp-hackers] Minify Scripts and CSS and why it isn't completely
possible
Jacob Santos
wordpress at santosj.name
Tue Dec 23 05:34:23 GMT 2008
There isn't any supporting evidence to back your argument. I've come to
the conclusion that I can safely ignore what you've written until said
criteria has been met.
I think:
<?php
if( function_exists('wp_register_script') )
wp_register_script();
Might fix your problem or am I wrong? Your use of script is also
ambiguous in that script could mean JavaScript, in which case your point
is invalid or it could mean PHP, in which case the above should work fine.
Jacob Santos
Lynne Pope wrote:
> This has always been an issue with plugins but, for those who can, its not a
> bad idea to always look at the plugin's code before using. The issue with
> the API is a bit more complex though - if you are writing a script that is
> designed to work with more than just WordPress it often makes sense to
> ignore the WP Script/Styles API.
>
> Lynne
>
> 2008/12/23 DD32 <wordpress at dd32.id.au>
>
>
>> In addition to that Jacob:
>>
>> Why do so many plugin authors not use WP_DEBUG => true?
>>
>> I have a huge list of plugins i've modified for myself who rely on
>> undefined
>> constants, define constants multiple times, do not check for array items
>> existing before using (if( $_POST['something'] ) rather than if (
>> isset($_POST['something']) ) ). I'm not going to name and shame..
>>
>> *But to all plugin authors:* Please add "*define('WP_DEBUG', true);*" to
>> your wp-config.php and check to see if theres any error/warnings generated
>> by your plugin, I've re-invented the wheel for a few plugins simply due to
>> getting pages of notices on my development installs (aside from those i've
>> modified)
>>
>> For many i'm sure the answer will be "I've never heard of it" and in the
>> case of the Script/Styles API: "I need to support older versions of
>> wordpress" or "It was written before the API existed"
>>
>> 2008/12/23 Jacob Santos <wordpress at santosj.name>
>>
>>
>>> With WP Speedy and my plugin, I'm noticing that not all plugins are using
>>> the Script and Styles API. This prevents those stylesheets and scripts
>>>
>> from
>>
>>> being minified. I plan on going through the plugins I have and "fixing"
>>> them, and hopefully the patch is included for the future versions.
>>>
>>> Why don't more plugin and theme authors use the Scripts and Styles API?
>>>
>> Is
>>
>>> it a documentation issue or is it not high enough of a concern?
>>>
>>> Jacob Santos
>>>
>>>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
More information about the wp-hackers
mailing list