-1

I am running a Wordpress website: link

All plugins, wordpress and theme are updated to the latest version.

I am also running on Woocommerce. When disabling the Woocommerce-plugin, the site is running fast. When enabling Woocommerce, site is slowing down desperately.

Theme is also compatible with Woocommerce according to the theme-developer. However, the developer can't figure out what the issue is.

I already installed WP-Rocket plugin to optimize speed and caching the site, without result.

When checking Pingdom Tools and GTMetrix, the waterfall shows a huge slowdown in: admin-ajax.php?action=grandtour_custom_css

See testing results here: link

Any suggestions how to solve this?

1 Answers1

1

I checked your website speed test o Gtmatrix under waterfall. One of your ajax action is taking 3.7 seconds, which actually is main reason of delay.

You should remove this ajax action.

remove_action('grandtour_custom_css');

Check wordpress documentation for remove action. Wordpress Documentation

remove_action() must be called inside function as shown below.

add_action( 'wp_head', 'remove_my_action' );
function remove_my_action(){

   remove_action( 'grandtour_custom_css');
   remove_action( 'wp_ajax_grandtour_custom_css');
   remove_action( 'wp_ajax_nopriv_grandtour_custom_css');

}

On next step add css from ajax call here on wordpress customizer under appreance.

If it still does not solve your problem then try to optimize the animation css.

Rahat Hameed
  • 412
  • 3
  • 16
  • Thanks so far! Stupid question maybe, but where do I put this piece of code? – user2152403 Oct 02 '19 at 13:09
  • You should place below code inside functions.php file at theme root. remember to find wp_head action there, place below code inside acton call back function. remove_action( 'grandtour_custom_css'); – Rahat Hameed Oct 02 '19 at 13:12
  • This is my code. I don't know where to put it. Im so sorry for being an amature – user2152403 Oct 02 '19 at 13:55
  • `add_action('wp_ajax_grandtour_custom_css', 'grandtour_custom_css'); add_action('wp_ajax_nopriv_grandtour_custom_css', 'grandtour_custom_css'); function grandtour_custom_css() { get_template_part("/modules/custom_css"); die(); } /** * Setup responsive CSS function **/ add_action('wp_ajax_grandtour_responsive_css', 'grandtour_responsive_css'); add_action('wp_ajax_nopriv_grandtour_responsive_css', 'grandtour_responsive_css'); function grandtour_responsive_css() { get_template_part("/modules/responsive_css"); die(); }` – user2152403 Oct 02 '19 at 14:00
  • comment these two lines. //add_action('wp_ajax_grandtour_custom_css', 'grandtour_custom_css'); //add_action('wp_ajax_nopriv_grandtour_custom_css', 'grandtour_custom_css'); – Rahat Hameed Oct 02 '19 at 14:01
  • I am so sorry, that I don't understand you. Can you maybe help me out how to adjust this code?
    `add_action('wp_ajax_grandtour_custom_css', 'grandtour_custom_css'); add_action('wp_ajax_nopriv_grandtour_custom_css', 'grandtour_custom_css'); function grandtour_custom_css() { get_template_part("/modules/custom_css"); die(); }`
    – user2152403 Oct 02 '19 at 14:17
  • remove this code get_template_part("/modules/custom_css"); die(); from function grandtour_custom_css() { } – Rahat Hameed Oct 02 '19 at 14:24
  • Then copy css from from following file to Appreance -> customise -> Additional Css https://wintersportvakantie.nl/wp-admin/admin-ajax.php?action=grandtour_custom_css – Rahat Hameed Oct 02 '19 at 14:26
  • Thanks for your help so far. I removed that line AND I added the content of that file to the additional CSS, but without any luck :( – user2152403 Oct 02 '19 at 14:50
  • I still see ajax call is returning the animation css. add remove actions inside wordpress head action as mentioned in answer above. – Rahat Hameed Oct 02 '19 at 17:03