Brianovi navojni komentari: optimizirano

Jedan od dodataka koje volim pokretati na svom blogu je Brian's Threaded Comments. Omogućuje gniježđenje, organiziranje i vrlo lako čitanje i odgovaranje na njih. Nisam siguran zašto logika nije uvučena u srž WordPress, Ipak.

Dok sam gledao izvor svojih stranica, dodatak je dodao nered. Dodatak ubacuje i Javascript i styling oznake kako bi ga pokrenuo. Problem je u tome što ugrađeni styling i javascript mogu povećati vrijeme učitavanja jer preglednik može jednom predmemorirati povezane tabele stilova i javascript datoteke.

Budući da pretraživački botovi indeksiraju gornju 'x' količinu stranice, ovakav kod gura stvarni sadržaj prema dolje. Nisam čuo da se to pokazalo, ali vjerujem da to može utjecati na optimizaciju pretraživača na vašoj web lokaciji. Pravi način hranjenja tražilice je preskakanje preljeva i davanje više mesa. Upravo sam to učinio i prebacio sam Javascript i CSS u povezanu datoteku. Ovdje pokrećem optimizirani dodatak.

Napisao sam Briana na optimiziranom dodatku, ali e-pošta se odbila. Bacio sam mu i savjet sa svog bloga da vidim hoće li svratiti. Ako ste zainteresirani, možete preuzmite optimizirani dodatak ovdje.

8 Komentari

  1. 1

    Thank you very much for posting this file!
    I briefly (less than ten minutes) dipped my toe into Intense Debate because easily installed threaded comments appealed.. Much as I love tooling out my site, their system was too much to put up with for this luxury alone.

  2. 2

    I was looking at your files in the zip and it looks really good, however someone beat you to the punch back in April. Check out ovaj post.

    Something else to improve upon would be having the images local verses having them called from an external location with some sort of encrypted code, at least that’s what it looks like around the lines where it calls the png images.

    Misli?

  3. 4

    Bok Doug,
    Thanks for this?I was about to endeavor to do the exact same thing, you saved me the time.

    I had to add a few functions from Brians Threaded Comments 1.5 that were breaking your iteration.
    Iznad btc_add_reply_id($id):

    function btc_has_avatars() {
    if( function_exists('get_avatar'))
    return true;
    else if(function_exists('MyAvatars'))
    return true;
    return false;
    }

    function btc_avatar() {
    if( function_exists('get_avatar')) {
    echo get_avatar(get_comment_author_email(), '64');
    return;
    }
    else if(function_exists('MyAvatars')) {
    MyAvatars();
    return;
    }
    }

    I also added a little CSS from BTC 1.5 to the .css file:

    .btc_gravatar {
    float: right;
    margin: 3px 3px 4px 4px;
    }
    .collapsed .btc_gravatar { display:none; } /* I added this, since the gravatars weren't collapsing nicely */

  4. 5

    This is great, Doug! One issue: It seems that the plugin now wants to be in the briansthreadedcomments subfolder of plugins, but a few of the images are rendered by accessing the PHP file in the plugins directory (when a user has subscribed to email alerts, for example). I worked around this by having the PHP file in both places. Probably just needs to have a URL adjusted somewhere in the code.

  5. 8

Što vi mislite?

Ova web stranica koristi Akismet za smanjenje neželjene pošte. Saznajte kako se podaci vašeg komentara obrađuju.