CSS JS Loader [Support Thread]
Since I didn't find a support thread for the CSS/JS Loader (http://www.zen-cart.com/downloads.php?do=file&id=1774), I've created this one!
I've installed v3.0.2 on a v1.5.3 test site and it's working quite well! I did make the following changes before I installed:
1. I run local test sites for all my installations, with a /includes/local/configure.php file to allow me to keep the /includes/configure.php as it is in the "live" store. The following change to /min/config.php allows that environment to work properly with the loader:
Code:
// added for Zen Cart
//-20140806-lat9-Enable proper operation if a local configure.php file is being used.
if (file_exists('../includes/local/configure.php')) {
include('../includes/local/configure.php');
} else {
include('../includes/configure.php');
}
//-eof-20140806-lat9
2. The new-install script "kills" configuration_group_id = 0 in the configuration table; I made the following change to /YOUR_ADMIN/includes/installers/css_js_loader/new_install.php:
Code:
<?php
$configuration = $db->Execute("SELECT configuration_group_id FROM " . TABLE_CONFIGURATION_GROUP . " WHERE configuration_group_title = 'CSS/JS Loader' OR configuration_group_title = 'CSS/JS Loader Configuration';");
if ($configuration->RecordCount() > 0) {
while (!$configuration->EOF) {
$db->Execute("DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_group_id = " . $configuration->fields['configuration_group_id'] . ";");
$db->Execute("DELETE FROM " . TABLE_CONFIGURATION_GROUP . " WHERE configuration_group_id = " . $configuration->fields['configuration_group_id'] . ";");
$configuration->MoveNext();
}
}
//$db->Execute("DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_group_id = 0;"); //-20140806-lat9-Don't kill CGI(0)!
$db->Execute("DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = '';");
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION_GROUP . " (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES (NULL, 'CSS/JS Loader Configuration', 'Set CSS/JS Loader Options', '1', '1');");
$configuration_group_id = $db->Insert_ID();
$db->Execute("UPDATE " . TABLE_CONFIGURATION_GROUP . " SET sort_order = " . $configuration_group_id . " WHERE configuration_group_id = " . $configuration_group_id . ";");
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES
('Version', 'CSS_JS_LOADER_VERSION', '2.0.0', 'Installed Version', " . $configuration_group_id . ", 0, NOW(), NOW(), NULL, 'trim('),
('Enable Minify', 'MINIFY_STATUS', 'true', 'Minifying will speed up your site\'s loading speed by combining and compressing css/js files (valid CSS and JS are required).', " . $configuration_group_id . ", 10, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(\'true\', \'false\'),'),
('Max URL Length', 'MINIFY_MAX_URL_LENGHT', '500', 'On some servers the maximum length of any POST/GET request URL is limited. If this is the case for your server, you can change the setting here', " . $configuration_group_id . ", 20, NOW(), NOW(), NULL, NULL),
('Minify Cache Time', 'MINIFY_CACHE_TIME_LENGHT', '31536000', 'Set minify cache time (in second). Default is 1 year (31536000)', " . $configuration_group_id . ", 30, NOW(), NOW(), NULL, NULL),
('Latest Cache Time', 'MINIFY_CACHE_TIME_LATEST', '0', 'Normally you don\'t have to set this, but if you have just made changes to your js/css files and want to make sure they are reloaded right away, you can reset this to 0.', " . $configuration_group_id . ", 40, NOW(), NOW(), NULL, NULL)");
Re: CSS JS Loader [Support Thread]
There are plans to rebuild the auto_installer. I'm sure that will be resolved with that change
Re: CSS JS Loader [Support Thread]
Hi everyone I am trying to get CSS/JS Loader installed as a first step to installing Fast and Easy checkout.
I am running V1.5.3 with PHP 5.5.3
I have installed the latest available version ( v3.0.2 ? ) which broke the site. After enabling the minify's in admin I got back a large portion of CSS functionality , but there are still some CSS's that are being blocked.
Further it slows the site down by almost 2 seconds.
Un-installing and modifying the " new_install.php " just produces he same results.
The cache time thru all this always stays at : 1407828153 (I have reset it to zero a number of times )
I have not worked on the config in /min/config.php
Anybody got any pointers for me?
Re: CSS JS Loader [Support Thread]
The /plugins directory created by this plugin needs an .htaccess and empty index.html to prevent the directory structure from being "snooped":
Code:
#
# @copyright Copyright 2003-2010 Zen Cart Development Team
# @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
# @version $Id: .htaccess 16111 2010-04-29 22:39:02Z drbyte $
#
# This is used with Apache WebServers
#
# The following blocks direct HTTP requests to all filetypes in this directory recursively, except certain approved exceptions
# It also prevents the ability of any scripts to run. No type of script, be it PHP, PERL or whatever, can normally be executed if ExecCGI is disabled.
# Will also prevent people from seeing what is in the dir. and any sub-directories
#
# For this to work, you must include either 'All' or at least: 'Limit' and 'Indexes' parameters to the AllowOverride configuration in your apache/conf/httpd.conf file.
# Additionally, if you want the added protection offered by the OPTIONS directive below, you'll need to add 'Options' to the AllowOverride list, if 'All' is not specified.
# Example:
#<Directory "/usr/local/apache/htdocs">
# AllowOverride Limit Options Indexes
#</Directory>
###############################
# deny *everything*
<FilesMatch ".*">
Order Allow,Deny
Deny from all
</FilesMatch>
# but now allow just *certain* necessary files:
<FilesMatch ".*\.(php|html)$">
Order Allow,Deny
Allow from all
</FilesMatch>
IndexIgnore */*
OPTIONS -Indexes -ExecCGI
Code:
<html>
<head>
<title></title>
<meta content="">
<style></style>
</head>
<body></body>
</html>
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
lat9
The /plugins directory created by this plugin needs an .htaccess and empty index.html to prevent the directory structure from being "snooped":
Code:
#
# @copyright Copyright 2003-2010 Zen Cart Development Team
# @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
# @version $Id: .htaccess 16111 2010-04-29 22:39:02Z drbyte $
#
# This is used with Apache WebServers
#
# The following blocks direct HTTP requests to all filetypes in this directory recursively, except certain approved exceptions
# It also prevents the ability of any scripts to run. No type of script, be it PHP, PERL or whatever, can normally be executed if ExecCGI is disabled.
# Will also prevent people from seeing what is in the dir. and any sub-directories
#
# For this to work, you must include either 'All' or at least: 'Limit' and 'Indexes' parameters to the AllowOverride configuration in your apache/conf/httpd.conf file.
# Additionally, if you want the added protection offered by the OPTIONS directive below, you'll need to add 'Options' to the AllowOverride list, if 'All' is not specified.
# Example:
#<Directory "/usr/local/apache/htdocs">
# AllowOverride Limit Options Indexes
#</Directory>
###############################
# deny *everything*
<FilesMatch ".*">
Order Allow,Deny
Deny from all
</FilesMatch>
# but now allow just *certain* necessary files:
<FilesMatch ".*\.(php|html)$">
Order Allow,Deny
Allow from all
</FilesMatch>
IndexIgnore */*
OPTIONS -Indexes -ExecCGI
Code:
<html>
<head>
<title></title>
<meta content="">
<style></style>
</head>
<body></body>
</html>
lat9,
The change you have recommended has added to the module, and should be submitted for moderation shortly.
Re: CSS JS Loader [Support Thread]
Quote:
Originally Posted by
bislewl
lat9,
The change you have recommended has added to the module, and should be submitted for moderation shortly.
Excellent! Thanks much.
Re: CSS JS Loader [Support Thread]
Alright, so I validated my css's and disabled minify option in admin config, BUT it's still breaking my site.
My template frame's are now whole page wide, categories bars in sidebox are full page wide etc.
looks like this:
http://i61.tinypic.com/333adc3.jpg
Upon validation I removed *zoom property from css. Could this be responsible for good look of my page?
I noticed that now links in my footer has additional display:none, but when I'm checking this with chrome dev tools, it shows no source.
It doesn't make much sense to me.
Re: CSS JS Loader [Support Thread]
any errors in /logs?
how many version of jquery are you running? should be 1.11.0 and migrate 1.2.1, in my opinion.
Re: CSS JS Loader [Support Thread]
There's nothing in logs. I don't know where to check jquery.
Re: CSS JS Loader [Support Thread]
in your <HEAD> what are the js files that are loading sometimes things get messed up and the javascript files get loaded in the body as well
also jquery should be the first with migrate being the 2nd