tires Posted August 1, 2017 Posted August 1, 2017 Hi Bernhard, thank you for your answer. Maybe there is another way to solve this with this modul? Thanks!
bernhard Posted August 1, 2017 Posted August 1, 2017 https://github.com/FlipZoomMedia/ProcessWire-AIOM-All-In-One-Minify/blob/AIOM%2B/AllInOneMinify.module#L993-L1014
tires Posted August 3, 2017 Posted August 3, 2017 On 1.8.2017 at 1:31 PM, bernhard said: https://github.com/FlipZoomMedia/ProcessWire-AIOM-All-In-One-Minify/blob/AIOM%2B/AllInOneMinify.module#L993-L1014 Thanks once again, Bernhard! Do i have to change the module code, to get prevent (all?) comments to be deleted? Or did i misunderstood your answer/link? Best regards and tanks!
bernhard Posted August 3, 2017 Posted August 3, 2017 i don't know what the code does exactly, so if you also don't understand it in detail you have 3 options wait and hope that somebody else helps you you invest some time, learn something about REGEX and try to find a way that prevents the module of minifying your comments buy procache for 49$ and be happy (for 1 site) and benefit of a lot more options and improvements that it offers (or pay 169$ for unlimited sites) 1
DV-JF Posted August 24, 2017 Posted August 24, 2017 Hi, I switched my site to https and now I can't get AIOM to running. Here are the errors I'm getting: Mixed Content: The page at 'https://****/' was loaded over HTTPS, but requested an insecure stylesheet 'warning: A non-numeric value encountered in /mnt/****/site/assets/cache/FileCompiler/site/modules/AllInOneMinify/AllInOneMinify.module on line 713/work/roltek/site/assets/aiom/css_b863322778056fb524ea6127cc06763c_dev.css?no-cache=1503581072'. This request has been blocked; the content must be served over HTTPS. (index):1 Mixed Content: The page at 'https://****/' was loaded over HTTPS, but requested an insecure script 'warning: A non-numeric value encountered in /mnt/****/site/assets/cache/FileCompiler/site/modules/AllInOneMinify/AllInOneMinify.module on line 713/work/roltek/site/assets/aiom/js_656d424f993dafdaf7bd972288171ab2_dev.js?no-cache=1503581072'. This request has been blocked; the content must be served over HTTPS. When I disable AIOM everything works like it should be. Any ideas? EDIT: In order to debug this error I generated a subdomain without HTTPS encription. Now I get the following error: Warning: A non-numeric value encountered in /***/site/assets/cache/FileCompiler/site/modules/AllInOneMinify/AllInOneMinify.module on line 713 /site/assets/aiom/js_656d424f993dafdaf7bd972288171ab2_dev.js?no-cache=1503583266 EDIT: I've figured out, that the error only happens, when I'm using PHP Ver. 7.1. with PHP Ver. 7.0. everything works like it should be. Many greets, Jens alias DV-JF
mel47 Posted September 17, 2017 Posted September 17, 2017 Hi I tried to add AIOM to my website but I can't figure why I have this error message : Class 'ProcessWire\AIOM' not found <script src="<?php echo AIOM::JS(array('scripts/jquery.unveil.js', 'scripts/jquery-popup.js')); ?>"></script> What I did wrong? Thanks Mel PW3.0.75 AIOM 3.2.3
Macrura Posted September 17, 2017 Posted September 17, 2017 just a stab at this - it may depend on how the file with that code is being included; you can try a backslash in front of the AIOM and see if that works, or you can instantiate the AIOM into a variable like $aiom = $modules->get('AllInOneMinify') or whatever the class name of the module is.. 1
Ahmad Posted October 30, 2017 Posted October 30, 2017 Hello everyone, I'm new in Processwire CMS. and when i create my first website on it i notice it's very slowly. i tried use AIOM module to resolve the problem but when i try using this Quote <script src="<?php echo AIOM::JS(array('js/jquery-2.1.0.min.js', 'js/jquery-ui.min.js', 'js/jquery.queryloader2.min.js')); ?>"></script> the website doesn't open it's appear Blank page can anybody help me, and tell me where the problem? Thanks.
abdus Posted October 30, 2017 Posted October 30, 2017 Enable debug mode in site/config.php. You're probably getting an error that's preventing PW to complete page render. 1
rafaoski Posted October 30, 2017 Posted October 30, 2017 Hello @Ahmad ... You must add a backslash before \AIOM like: <script src="<?php echo \AIOM::JS(array('assets/js/uikit.min.js', 'assets/js/uikit-icons.min.js')); ?>"></script> In this case, the js files are in the assets / js directory ... 2
dragan Posted October 30, 2017 Posted October 30, 2017 It seems like you don't really need the AIOM module anymore - all the 3 JS files are already minified. The only advantage you'd have is the concatenation (1 instead of 3 files). What do you see when you open the browser inspector? As for the general slowness of the site - we would need more hints/infos.
DaveP Posted October 30, 2017 Posted October 30, 2017 There are/(were?) a couple of issues with AIOM running under PHP 7.0.x & 7.1.x, but they are easily rectified, if that is the issue here.
rafaoski Posted October 30, 2017 Posted October 30, 2017 @Ahmad This module has a problem in the AllInOneMinify.module file ... When you go to the processwire installation directory and site\modules\AllInOneMinify/AllInOneMinify.module And change this code from the line 713: foreach ($files as $file) { $_timestamp = ($_timestamp + $file['last_modified']); } Change to : foreach ($files as $file) { $_timestamp = ($file['last_modified']); } I only deleted the variable " $_timestamp + " and it worked ... But I do not know if it will have any later consequences ... In addition, you should install a great debugging module that will help you find problems with the name Tracy Debugger 1 1
Ahmad Posted October 30, 2017 Posted October 30, 2017 2 hours ago, dragan said: It seems like you don't really need the AIOM module anymore - all the 3 JS files are already minified. The only advantage you'd have is the concatenation (1 instead of 3 files). What do you see when you open the browser inspector? As for the general slowness of the site - we would need more hints/infos. these js only example
Ahmad Posted October 30, 2017 Posted October 30, 2017 2 hours ago, rafaoski said: @Ahmad This module has a problem in the AllInOneMinify.module file ... When you go to the processwire installation directory and site\modules\AllInOneMinify/AllInOneMinify.module And change this code from the line 713: foreach ($files as $file) { $_timestamp = ($_timestamp + $file['last_modified']); } Change to : foreach ($files as $file) { $_timestamp = ($file['last_modified']); } I only deleted the variable " $_timestamp + " and it worked ... But I do not know if it will have any later consequences ... In addition, you should install a great debugging module that will help you find problems with the name Tracy Debugger Thank u, It's worked method with JS. and still the problem with css files. 1
rafaoski Posted October 30, 2017 Posted October 30, 2017 @Ahmad ... My styles and scripts look like this ( Remember the slash before \AIOM ): <link rel="stylesheet" href="<?php echo \AIOM::CSS(array('assets/css/uikit.min.css', 'styles/main.css')); ?>"> <script src="<?php echo \AIOM::JS(array('assets/js/uikit.min.js', 'assets/js/uikit-icons.min.js')); ?>"></script> I using Processwire Version 3.0.81 DEV with Uikit 3 site/blog profile ... Sometimes also a test environment can cause problems (the last one I had trouble because I used xampp server) which I swapped by going to Laragon development environment for Windows ... More options you have in the module, where I usually clean the system cahe ( Empty Cache ) in Menu => Modules/Site/AllInOneminify: You can remove cache folders from site\assets\cache and also remove browsing history in chrome or firefox to clear browsing data and finally refresh page and see if it works ...
matjazp Posted November 1, 2017 Posted November 1, 2017 Maybe this can help? //https://github.com/FlipZoomMedia/ProcessWire-AIOM-All-In-One-Minify/issues/64 $_timestamp = ((int)$_timestamp + $file['last_modified'] + hexdec(md5(basename($file['absolute_path'])))); 2
Kholja Posted November 6, 2017 Posted November 6, 2017 Hello Community, just used AIOM for the first time and ran in some of the issues mentioned above. Got it to work with the help of this thread. Thank you guys. Just in case someone finds it useful I add additionally some steps to update the CssMin Library quickly, until we get the next AIOM Update: Create Folder site/modules/AllInOneMinify/lib/CssMin Get the four files from: https://github.com/tubalmartin/YUI-CSS-compressor-PHP-port/tree/master/src (Colors.php, Command.php, Minifier.php, Utils.php) and put them in the folder above. Remove namespacing after php tag in these files (i.e. delete namespace tubalmartin\CssMin;) Change code in site/modules/AllInOneMinify/AllInOneMinify.module: Z.541 replace the require_once statement where it includes the CssMin Class File with: // require_once(wire('config')->paths->AllInOneMinify.'lib/CssMin'.DIRECTORY_SEPARATOR.'cssmin.php'); require_once(wire('config')->paths->AllInOneMinify.'lib/CssMin'.DIRECTORY_SEPARATOR.'Minifier.php'); require_once(wire('config')->paths->AllInOneMinify.'lib/CssMin'.DIRECTORY_SEPARATOR.'Colors.php'); require_once(wire('config')->paths->AllInOneMinify.'lib/CssMin'.DIRECTORY_SEPARATOR.'Command.php'); require_once(wire('config')->paths->AllInOneMinify.'lib/CssMin'.DIRECTORY_SEPARATOR.'Utils.php'); Z.620 replace the following line // $cssMin = new CSSmin(); $cssMin = new Minifier(); That did the job for me.
matjazp Posted November 10, 2017 Posted November 10, 2017 I have a forked version at https://github.com/matjazpotocnik/ProcessWire-AIOM-All-In-One-Minify that includes a lot of pull requests and fixes from several contributors. Test on dev site first!!! 4
adrian Posted November 10, 2017 Posted November 10, 2017 4 hours ago, matjazp said: I have a forked version at https://github.com/matjazpotocnik/ProcessWire-AIOM-All-In-One-Minify that includes a lot of pull requests and fixes from several contributors. Test on dev site first!!! Seems to me that you should take over this project and the modules directory should point to your fork. Is it time to PM @David Karich and get the ball rolling 1
matjazp Posted November 10, 2017 Posted November 10, 2017 To be honest I don't have enough knowledge on what's really going on in the source files, I just included fixes and PR's from others, hoping that it might help them. But it's not a problem for me to maintain this fork with PR's of other contributors, if that helps.
Mike Rockett Posted November 11, 2017 Posted November 11, 2017 A little while ago, I began a complete rewrite of the module that was set to add additional features (like SASS and Stylus, for example). Unfortunately, I won’t have time to work on it as fast as I’d like. But, it’s still something I’d like to do. 3
dragan Posted November 12, 2017 Posted November 12, 2017 This new fork doesn't work at all for me. Well, it did work, but as soon as I needed to clear the cache (after adding/changing some CSS/JS), I get a fatal error. Exception: DirectoryIterator::__construct(C:/xampp/htdocs/xxx/site/assets/cache/Page/,C:/xampp/htdocs/xxx/site/assets/cache/Page/): Das System kann die angegebene Datei nicht finden. (code: 2) (in C:\xampp\htdocs\xxx\wire\core\CacheFile.php line 240) Das System kann die angegebene Datei nicht finden = the system can't find the supplied file Also, the HTML doesn't get minified at all, although it's checked in the module settings. PW 3.0.82, Tracy Debugger active, debug-mode true, local install
matjazp Posted November 12, 2017 Posted November 12, 2017 Please provide the full stack (everything in red). It looks like C:/xampp/htdocs/xxx/site/assets/cache/Page/ folder is not found/accessible? Does it help if you run aiom in development mode? After providing above answers, please replace /site/modules/AllInOneMinify/AllInOneMinify.module with this one attached. AllInOneMinify.module
theo Posted November 21, 2017 Posted November 21, 2017 For me, this works: private static function _getCacheName($files, $prefix = 'css_', $ext = '.css') { // ------------------------------------------------------------------------ // Initialize timestamp variable. // ------------------------------------------------------------------------ $_timestamp = 0; //<-theo // ------------------------------------------------------------------------ // Calculate timestamp of all files // ------------------------------------------------------------------------ foreach ($files as $file) { //$_timestamp = ($_timestamp + $file['last_modified']); $_timestamp += ($file['last_modified'] + hexdec(md5(basename($file['absolute_path'])))); //<--theo } // ------------------------------------------------------------------------ // Create a unique MD5 file name with the specified prefix. // ------------------------------------------------------------------------ return (self::$developmentMode !== true) ? $prefix.md5($_timestamp).$ext : $prefix.md5($_timestamp).'_dev'.$ext; } ..when using AIOM like this: <?php $stylesheets = array( array('loadOn' => 'template=home', 'files' => array('styles/kuengmain.css')), array('loadOn' => 'template=categories', 'files' => array('styles/jquery.fullpage.css','styles/kuengmain.css')), array('loadOn' => 'template=kontakt', 'files' => array('styles/bootstrap_ms.css','styles/kuengmain.css')), ); ?> <link rel="stylesheet" type="text/css" href="<?php echo AllInOneMinify::CSS($stylesheets); ?>" /> Because different files may have the same timestamp.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now