• Hi,

    I’m trying to diagnose why our CPU usage is up and I believe one of the issues is the way that this plugin adds css. When added via the normal enqueue method, it is automatically picked up by WP Super Cache and served from a cookieless domain. However you appear to be serving the CSS by intercepting a GET request to the homepage, which is costly in terms of CPU processing when compared to the request for a static file.

    Here is the debug log for the caching related to this file request. And I can see in other logs that WP is being fully loaded for this request.

    14:58:46 /?mcsf_action=main_css&ver=3.6.1 wp_cache_get_cookies_values: /^wp-postpass|^comment_author_|^wordpress_logged_in_5f[redacted]7/ Cookie detected: wordpress_logged_in_5f[redacted]7
    14:58:46 /?mcsf_action=main_css&ver=3.6.1 In WP Cache Phase 2
    14:58:46 /?mcsf_action=main_css&ver=3.6.1 Setting up WordPress actions
    14:58:46 /?mcsf_action=main_css&ver=3.6.1 Supercache caching disabled. Only using wp-cache. Non empty GET request. Array
    (
        [mcsf_action] => main_css
        [ver] => 3.6.1
    )
    
    14:58:46 /?mcsf_action=main_css&ver=3.6.1 Created output buffer
    14:58:46 /?mcsf_action=main_css&ver=3.6.1 Output buffer callback
    14:58:46 /?mcsf_action=main_css&ver=3.6.1 No closing html tag. Not caching.
    14:58:46 /?mcsf_action=main_css&ver=3.6.1 wp_cache_shutdown_callback: collecting meta data.
    14:58:46 /?mcsf_action=main_css&ver=3.6.1 Did not write meta file: wp-cache-b7[redacted]5.meta ** *1* **

    My question is, can this css file not be served using the normal hooks? Or is there some way I can bring in that small bit of css into my own style sheet and disable the one you have in the plugin while remaining upgrade-safe?

    http://wordpress.org/plugins/mailchimp/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hey Skoskie,

    Thanks for writing in to the forum! As this does delve into the back-end of the plugin, this may ultimately require me passing along this info to our developers, but first, I want to make sure that we address your questions, as well as to see if we can provide a ‘fix’ for the mean time.

    I was able to find a plugin user’s blog post that spoke about similar performance issues with the way that CSS is being served up, here: http://www.gravitationalfx.com/how-to-stop-the-mailchimp-plugin-slowing-down-your-website/

    Their recommendation was to comment out those two lines of code mentioned, which are on lines 108 and 109 of the mailchimp.php file. In my own testing, I also had to comment out line 111, or else I was getting an error message. Here’s what I ended up with:

    //wp_enqueue_style('mailchimpSF_main_css', home_url('?mcsf_action=main_css&ver='.MCSF_VER));
    	//wp_enqueue_style('mailchimpSF_ie_css', MCSF_URL.'css/ie.css');
    	global $wp_styles;
    	//$wp_styles->add_data( 'mailchimpSF_ie_css', 'conditional', 'IE' );

    So one recommendation would be to try that and then check if your performance issues cease. If they do, then you’ll just need to copy over the CSS that would be otherwise included in those files and add them to your own static CSS files. To do that, the easiest way would be to copy that CSS before you comment it out. Meaning, make sure the above lines of code are not commented, then access your site, view the source, and click on the CSS file to copy and paste from it.

    While I can’t speak on what will be included in future iterations and updates for the plugin, I’m afraid that since this solution does require editing code in the mailchimp.php file that it will most likely not be something that would be retained in a plugin upgrade. So unfortunately, the fix would have to be manually re-applied if not addressed in a future update.

    Let me know if there’s any additional questions. On my end, I’ll be sure to pass these details related to performance concerns along to our developers for further consideration.

    -tk

    Commenting out these lines helped a lot.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Non-standard CSS call causing problems’ is closed to new replies.