PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

s2member css performance

s2Member Plugin. A Membership plugin for WordPress®.

s2member css performance

Postby markelshark » October 17th, 2010, 12:58 pm

Hi Jason,

I'm looking to improve the responsiveness of my s2member / s2clean installation and one of the big hangups (to the tune of 2 seconds) is the s2member css load. Here is the GET request:

http://domain.com/?ws_plugin__s2member_ ... 8;qcABC=1&ver=1.0761284149693

What I would like to test is disabling this dynamic css and making it into a regular static .css file. The file itself is tiny so I don't know why a) it takes so long and b) why it is a separate file at all? Why not combine it with one of the other many css files?
User avatar
markelshark
Registered User
Registered User
 
Posts: 27
Joined: June 18, 2010

Re: s2member css performance

Postby Jason Caldwell » October 23rd, 2010, 5:07 am

Thanks for the great question.

The delay that you're seeing ( I'm guessing in Firebug ) is attributed to the overhead of your particular installation of WordPress®. s2Member loads it's CSS through WordPress® to maximize the flexibility of it's framework. If you're running lots of other plugins, it could add to the overhead you're seeing.

That being said, if you would rather load a static CSS file, you can create a PHP file at this location: /wp-content/mu-plugins/my-s2member-hacks.php
Code: Select all
<?php
add_action
("ws_plugin__s2member_during_add_css", "use_static_css_for_s2member");

function use_static_css_for_s2member(){
    wp_dequeue_style("ws-plugin--s2member");
    wp_enqueue_style("ws-plugin--s2member", "http://path/to/your.css");
}

// Required function.
// This will be added in WordPress 3.1
if(!function_exists('wp_dequeue_style')) {
    function wp_dequeue_style( $handle ) {
        global $wp_styles;
        if ( !is_a($wp_styles, 'WP_Styles') )
            $wp_styles = new WP_Styles(); 

        $wp_styles
->dequeue( $handle );
    }
}
?>
This code is untested ( just wrote this up quickly ) but it should do the trick. If you don't have an /mu-plugins/ directory, please create one. /mu-plugins = Must use plugins, which are loaded automatically.

Related Codex topic: http://codex.wordpress.org/Function_Ref ... ueue_style
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 1 guest

cron