Tagged: compression, merging
-
AuthorPosts
-
July 24, 2018 at 2:06 pm #989192
hello Kriesi,
on my site, in enfold child theme administration, i went to performance tab and enabled both compression of the css and js. And choose load only used elements.
Nothing of these settings work. I deleted cache, reset nginx settings. Nothing work.
The compressed files are created correctly in dynamic_avia folder but the theme doesn’t use them… could you help me, please?- This topic was modified 6 years, 4 months ago by paolots.
July 25, 2018 at 8:17 am #989537Hey Paolo,
Thank you for using Enfold.
I am on another thread with exactly the same issue but I’m not sure why it’s not using the merged file. Have you tried to remove the “dynamic_avia” folder manually before? Where is the site hosted?
Best regards,
IsmaelJuly 25, 2018 at 8:52 am #989548hey Ismael, thank you for your reply.
i have tried to remove the dynamic_avia folder before compression, during and after compression and it was regenerated correctly, and the merged files also was.
the server is a vps that i personally configure with: debian 9.4, php 7.2.7, nginx 1.15.0, mariadb 10.1.26
i can help you, but for me the question is: where enfold told wordpress to use the compressed and merged files instead of the normal? And when i check Load Only Used Elements, why there are some elements that are loaded anyway (ex: google maps, that i don’t use in any part of the site)? is there a way to remove completely google maps from the child-theme?
I have this following code in my child functions.php, but it seems that it isn’t enough…
function avf_gmap_vars_disable($map) {
if(!is_admin()) {
$map = null;
}
return $map;
}add_filter(‘avf_load_google_map_api_prohibited’, ‘avf_load_google_map_api_prohibited_true’, 10, 1);
function avf_load_google_map_api_prohibited_true($prohibited) {
if( is_admin() ) $prohibited = true;
return $prohibited;
}add_action(‘wp_enqueue_scripts’, ‘ava_deregister_gmaps’, 9999);
function ava_deregister_gmaps() {
if(is_admin()) {
wp_deregister_script( ‘avia-google-maps-api’ );
wp_deregister_script( ‘avia_google_maps_front’ );
wp_deregister_script( ‘avia_google_maps_front_script’ );
wp_deregister_script( ‘avia_google_maps_api_script’ );
wp_deregister_script( ‘avia_google_maps_widget_admin_script’ );
}
}
Thank you- This reply was modified 6 years, 4 months ago by paolots.
July 25, 2018 at 10:21 am #989589Hey Ismael,
are there any good news about that issue?July 26, 2018 at 7:12 am #990073Hi,
i can help you, but for me the question is: where enfold told wordpress to use the compressed and merged files instead of the normal?
It’s in the config-templatebuilder > avia-template-builder > asset-manager.class.php > “try_minifying_scripts” function. It fails to generate the merged file. You can use the Autoptimize or the BWP Minify plugins temporarily while we debug the issue.
In the database > _options table, please search for and delete the “aviaAsset_avia-merged-styles” and “aviaAsset_avia-head-scripts” entries. Toggle the theme options again to regenerate the merged scripts and stylesheets. Let us know if it helps.
Best regards,
IsmaelAugust 21, 2018 at 9:20 am #999703Hey Ismael,
one month has passed and i would like to know if you have investigated. Are there any good news about that issue?
Let me know, please.August 21, 2018 at 9:40 am #999706As i wrote, all the errors still persists.
In the db i see:
aviaAsset_avia-merged-styles –> a:1:{s:51:”avia-merged-styles-ebf4dbc4ee7d2150f1b06bbeb9326870″;s:21:”error-generating-file”;}
aviaAsset_avia-head-scripts –> a:1:{s:50:”avia-head-scripts-54b9e591b8e206c5470da6c19cb248a4″;s:21:”error-generating-file”;}
aviaAsset_avia-footer-scripts –> a:3:{s:52:”avia-footer-scripts-5d4a752d6fb9ff8d6b9eb6c58ab06252″;s:21:”error-generating-file”;s:52:”avia-footer-scripts-107445883e2262d12295d8b6bb0c5ab4″;s:21:”error-generating-file”;s:52:”avia-footer-scripts-54b9e591b8e206c5470da6c19cb248a4″;s:21:”error-generating-file”;}There are some particular server specifications for the theme that i have to set with php or mysql for example?
My server is a debian 9.4 vps with
PHP 7.2.8-1+0~20180725124257.2+stretch~1.gbp571e56
nginx/1.15.2 built by gcc 6.3.0 20170516 (Debian 6.3.0-18+deb9u1) built with OpenSSL 1.1.0f 25 May 2017 TLS SNI support enabled
mysql Ver 15.1 Distrib 10.1.26-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
Let me know how can i help you if you want more informations about that.
Thank you
PaoloAugust 22, 2018 at 8:33 am #1000167can you help please?
August 24, 2018 at 8:29 am #1001057Hi,
Sorry for the delay, your server configuration looks good to me. Have you checked if the theme has proper folder permission? Please check the link in private.
Great pictures! but it’s recommended to use only 5 to 6 images in the slider to keep the page light. You can add more images to the gallery section.
Best regards,
VinayAugust 24, 2018 at 3:13 pm #1001268Hi Vinay,
thank you very much for the compliments.i made a chmod to all the site with 755 for the folders and 644 to all the files.
Nothing changes.
In the db all the aviaAsset_****** gives an s21:”error-generating-file”
in the dynamic_avia folder in wp-content/uploads i can see two avia-footer-scripts-[hash].js, one avia-merged-styles-[hash].css, one enfold_child.css and one index.php
so none avia-head-scripts-[hash].js was generated…
how could you resolve that issue?August 27, 2018 at 4:21 am #1002114Hi,
I’m pretty sure this is server related but I don’t know which configuration is missing. I’ll ask @Gunter to check the thread. Please wait for his response.
Best regards,
IsmaelSeptember 4, 2018 at 12:28 pm #1005479hi,
no response until now. And one month is passed. No word.
Is there anyone in kriesi able to solve my problem?
Thank youSeptember 4, 2018 at 2:54 pm #1005598Hi,
I temporarily fixed it by replacing line 137 in enfold/config-templatebuilder/avia-template-builder/php/asset-manager.class.phpif($generated_files[$data['hash']] && $generated_files[$data['hash']] !== "error-generating-file")
with
if($generated_files[$data['hash']])
The detection if a file was generated successfully or not does not work properly on your server. We’ll look into it. If we can’t find a solution for your server we’ll probably add a filter to the detection function which enables you to bypass the detection. The file generation works flawlessly and the merged/compressed files are in the right folder and valid.
Best regards,
DudeSeptember 4, 2018 at 3:35 pm #1005649Hi Dude,
now in the frontend source code i can see the merged and compressed files, but wp-content/uploads/dynamic_avia/avia-head-scripts-54b9e591b8e206c5470da6c19cb248a4.js is not generated neither saved in dynamic_avia folder…
I think something is wrong
ThanksSeptember 5, 2018 at 3:15 pm #1006170Hi,
I checked your site by creating a testpage and adding some php code which I removed again.
The problem is, that the files are probably generated (cannot check this because no ftp access) but cannot be read by WP (see screenshot in private content):
Error 52: Empty reply from server.
We check if we can read the file after creating it – if not we assume that an error occured creating the file and ignore the compression settings.
Best regards,
GünterSeptember 5, 2018 at 3:24 pm #1006175hi,
in dynamic_avia folder there are the merged css, footer but not header, so …
(see screenshot in private content)September 5, 2018 at 3:38 pm #1006181Hi,
but WP cannot read the files after creating them (header file missing is no problem, because there are no header scripts needed) – no idea why your server has a problem reading the files right after creating them. On other servers this is no problem.
Best regards,
GünterSeptember 5, 2018 at 3:51 pm #1006186Excuse me,
but i don’t understand why…. in the db i still see error generating files (see img in private) and in the frontend wp load all elements, everything but what i specify in performance…
it seems to me the theme compression and merging functions generates a lot of errors…September 6, 2018 at 8:44 am #1006505Hi,
Yes, the theme compression and merging functions do not work on your server. The files are generated but WordPress returns an error when it tries to read the files. Unfortunately we’re not able to solve this issue on your server, also Günter couldn’t find any reasons why wordpress doesn’t read the files properly.
I installed bwp minify and configured it for you now. It does the same like our compressing/merging script but offers some advanced features (you can select which files should be merged, etc.). I added a link to the option page into the private content field.
Best regards,
DudeNovember 9, 2021 at 2:36 pm #1328360Old thread but came up when I encountered a similar problem.
When using a host with a staging or dev environment like WpEngine, Siteground or Flywheel etc. or any server where a .htaccess password has been set.
Enfolds script merge function cannot verify the creation of the merged files and produces an error code 21 in the database merge fields.The function should run correctly in live anyway
To resolve in staging environments – I assume for testing purposes – Remove the password temporarily and then turn script merging off and on again in the Enfold performance control panel and click save.
This will allow the process to verify the creation of the files and serve a merged script.
Live push – I would recommend disabling script merge and re-enabling it after going live because the process will need to run again in live anyway.
Hope this helps others.- This reply was modified 3 years, 1 month ago by thinkjarvis. Reason: spelling mistake
November 10, 2021 at 6:03 am #1328422Hi thinkjarvis,
Thanks a lot for sharing, it’s much appreciated. We added your post to our documentation: https://kriesi.at/documentation/enfold/optimization/#performance-compression-is-not-working
Best regards,
RikardNovember 10, 2021 at 10:52 am #1328458on a customer installation – the hoster updated to Debian Bullseye (I guess it’s version 11), this version implemented only Apache 2.4 modules.
This caused some problems with various plugins. In the older theme was yes debian 9.x at the start, but maybe thinkjarvis problems stem exactly from that. Ask your provider if they also run Bullseye in the meantime. -
AuthorPosts
- You must be logged in to reply to this topic.