Support » Plugin: Comments - wpDiscuz » Dynamic CSS takes a long time to load

  • Resolved Kosta92

    (@kosta92)



    As I already wrote in the title, dynamic CSS take a long time to load, which is around 1 second. The connection is not the problem because I am testing this plugin on a local WordPress installation.

    I am talking about this request: <link rel=’stylesheet’ id=’wpdiscuz-dynamic-css-css’ href=’http://192.168.0.13/wp-admin/admin-ajax.php?action=dynamicCss&ver=3.0.6′ type=’text/css’ media=’all’ />,

    which results with this CSS code:

    #wpcomm .wc_new_comment{ background:#136FD2;} #wpcomm .wc_new_reply{background:#136FD2;} #wpcomm .wc-form-wrapper{background:#FFFFFF;} #wpcomm select, #wpcomm textarea, #wpcomm input[type="text"], #wpcomm input[type="email"], #wpcomm input[type="url"]{ border:#F1F1F1 1px solid;} #wpcomm .wc-comment .wc-comment-right{ background:#FFFFFF;} #wpcomm .wc-reply .wc-comment-right{ background:#FFFFFF; } #wpcomm .wc-comment-text{ font-size:14px;color:#000000;} #wpcomm .wc-blog-post_author > .wc-comment-right .wc-comment-author, #wpcomm .wc-blog-post_author > .wc-comment-right .wc-comment-author a{ color:#D21313;} #wpcomm .wc-blog-post_author > .wc-comment-left .wc-comment-label{background:#D21313;}#wpcomm .wc-blog-administrator > .wc-comment-right .wc-comment-author, #wpcomm .wc-blog-administrator > .wc-comment-right .wc-comment-author a{ color:#000000;} #wpcomm .wc-blog-administrator > .wc-comment-left .wc-comment-label{background:#000000;}#wpcomm .wc-blog-editor > .wc-comment-right .wc-comment-author, #wpcomm .wc-blog-editor > .wc-comment-right .wc-comment-author a{ color:#000000;} #wpcomm .wc-blog-editor > .wc-comment-left .wc-comment-label{background:#000000;}#wpcomm .wc-blog-author > .wc-comment-right .wc-comment-author, #wpcomm .wc-blog-author > .wc-comment-right .wc-comment-author a{ color:#000000;} #wpcomm .wc-blog-author > .wc-comment-left .wc-comment-label{background:#000000;}#wpcomm .wc-blog-contributor > .wc-comment-right .wc-comment-author, #wpcomm .wc-blog-contributor > .wc-comment-right .wc-comment-author a{ color:#000000;} #wpcomm .wc-blog-contributor > .wc-comment-left .wc-comment-label{background:#000000;}#wpcomm .wc-blog-subscriber > .wc-comment-right .wc-comment-author, #wpcomm .wc-blog-subscriber > .wc-comment-right .wc-comment-author a{ color:#000000;} #wpcomm .wc-blog-subscriber > .wc-comment-left .wc-comment-label{background:#000000;}#wpcomm .wc-blog-ap_moderator > .wc-comment-right .wc-comment-author, #wpcomm .wc-blog-ap_moderator > .wc-comment-right .wc-comment-author a{ color:#000000;} #wpcomm .wc-blog-ap_moderator > .wc-comment-left .wc-comment-label{background:#000000;}#wpcomm .wc-blog-ap_participant > .wc-comment-right .wc-comment-author, #wpcomm .wc-blog-ap_participant > .wc-comment-right .wc-comment-author a{ color:#000000;} #wpcomm .wc-blog-ap_participant > .wc-comment-left .wc-comment-label{background:#000000;}#wpcomm .wc-blog-betteroptin > .wc-comment-right .wc-comment-author, #wpcomm .wc-blog-betteroptin > .wc-comment-right .wc-comment-author a{ color:#000000;} #wpcomm .wc-blog-betteroptin > .wc-comment-left .wc-comment-label{background:#000000;}#wpcomm .wc-blog-guest > .wc-comment-right .wc-comment-author, #wpcomm .wc-blog-guest > .wc-comment-right .wc-comment-author a{ color:#000000;} #wpcomm .wc-blog-guest > .wc-comment-left .wc-comment-label{background:#000000;} #wpcomm .wc-comment-footer a, #wpcomm .wc-comment-footer span.wc_editable_comment,  #wpcomm .wc-comment-footer span.wc_save_edited_comment, #wpcomm span.wc_cancel_edit { color:#A9A9A9; } #wpcomm .wc-comment-footer .wc-vote-result{ background:#A9A9A9;} #wpcomm .wc-reply-link, #wpcomm .wc-vote-link, #wpcomm .wc-share-link {color: #A9A9A9; }.wc-load-more-submit {border: 1px solid #F1F1F1;} #wc_openModalFormAction > div#wc_response_info a.close {  background: url("http://192.168.0.13/wp-content/plugins/wpdiscuz/assets/img/x.png") no-repeat;}#wpcomm .wc-new-loaded-comment > .wc-comment-right {background: #FFFFFF;} .comments-area { width: auto; margin: 0 auto; margin-top: 100px; } .wpdiscuz-front-actions{ background:#FFFFFF;  } .wpdiscuz-subscribe-bar{ background:#FFFFFF;  } .wpdiscuz-sort-buttons{ color:#A9A9A9; } .wpdiscuz-sort-button{ color:#A9A9A9; cursor:pointer; } .wpdiscuz-sort-button:hover{ color: #136FD2; cursor:pointer; } .wpdiscuz-sort-button-active{ color: #136FD2!important; cursor:default!important; }#wpcomm .page-numbers{ color:#000000; border:#000000 1px solid; } #wpcomm span.current{ background:#000000; }

    Do you know why is it so slow and if it can be improved to load faster?

    https://wordpress.org/plugins/wpdiscuz/

Viewing 5 replies - 1 through 5 (of 5 total)
  • I also want to add that the image /assets/img/x.png is missing. You should fix that in your dynamic.css.php file on line 10.

    <?php echo plugins_url(WpdiscuzCore::$PLUGIN_DIRECTORY . '/assets/img/x.png'); ?>
    Plugin Author gVectors Team

    (@gvectors-team)

    Hi Kosta92,
    It’s very fast on our websites, could you please leave here the list of plugins you use?
    We’re going to test it again, we’ll update soon…

    Thank you!

    Looks like the problem is gone in the newest version of this plugin. After some testing, I found out that it was only appearing in versions 3.0.5 and 3.0.6. Version 3.0.4 also didn’t have it. It have had internal CSS loaded instead of loading the external one via the admin-ajax.php?action=dynamicCss&ver=3.0.6 command, just like the way that the new version is doing.

    Even though my problem is resolved now, I’m interested in what caused it. Can you tell me?

    Plugin Author gVectors Team

    (@gvectors-team)

    We’ve tested and found that this official WordPress method of loading dynamic CSS is not a good way. It’s bit of heavy. So the regular loading of this small piece of css code is dozens time faster, and it’s being cached on second load. So the current way doesn’t spend time and memory at all.

    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Dynamic CSS takes a long time to load’ is closed to new replies.