Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 29,251 through 29,275 (of 32,491 total)
  • Author
    Search Results
  • #56547

    In reply to: Strut Your bbPress!

    Simple forum for discussing some of my mac software.

    http://lorenb.com/bb/

    Just put it up, so not exactly a whole lot of content yet :). bbPress rocks.

    #60003
    howtogeek
    Member

    They are both slower than all hell for me.

    I’m very interested in your fastload plugin… but I wonder if it would matter much for opcode cached sites.

    Seems like the majority of the problems in speed I’m getting are from the repeated hooks in tight loops.

    #58889
    _ck_
    Participant

    ganzua, “headers already sent” means you have left white space before or after the plugin you made (or edited)

    ie.

    (remove any spaces here)<?php
    blah blah
    ?>(remove any spaces here)

    #60002
    _ck_
    Participant

    I’ve never seen their mysql take longer than 16-20ms to connect and never, ever more than 100ms to load all the queries. Storing code in mysql is crazy but just may work in weird cases like that. Of course if 1000 people did it, they’d ban the technique.

    What’s really interesting is their microtime never gives accurate results and frequently negative numbers. Either their multi-cores have clocks that are out of sync or parts of the code are somehow executing on different servers???? I posted a question about it on their support forum and it was mysteriously deleted the next day.

    #59996
    _ck_
    Participant

    I’ve reduced the number of files included to:

    === executed files ===
    /index.php : 0.44 Kb
    /bb-load.php : 0.46 Kb
    /config.php : 2.28 Kb
    /bb-settings.php : 7.49 Kb
    /bb-includes/db-mysqli.php : 12.77 Kb
    /my-plugins/fastload-includes.php : 298.75 Kb
    /my-plugins/fastload-plugins.php : 93.66 Kb
    /bb-includes/pluggable.php : 8.86 Kb
    /bb-includes/locale.php : 6.91 Kb
    /bb-templates/kakumei/front-page.php : 3.03 Kb
    /bb-templates/kakumei/header.php : 1.6 Kb
    /bb-templates/kakumei/logged-in.php : 0.21 Kb
    /bb-templates/kakumei/footer.php : 1.13 Kb
    ==================================================

    With a little work I could make pluggable & locale include properly too.

    #59994
    _ck_
    Participant

    Well every millisecond on the output does matter and the reasons you listed are very valid, but on heavily loaded servers, I have to believe the biggest weakness is the sheer number of files that have to seek and load. If they aren’t in the server’s file cache (dreamhost might have 1000 virtual hosts per node or more) that can cause long delays. Even if using an opcode cache, the cache still has to check the file date/size in the OS before it allows execution.

    But even bbpress’s output template requires 3+ files to be included. SMF does it entirely differently in one single file.

    I’ve built a prototype “fastload” plugin that concatinates two pools of files:

    1. includes (except a few outside the general block in bb-settings)

    2. all plugins

    It actually works to some degree to speed things up on dreamhost when they are are at insane loads.

    By reducing the number of files to seek from 40 to less than 10 the page load times are much better.

    #55101
    ronchicago
    Member

    Maybe this has been addressed above, not sure. The install menu reminds me I am not in the WordPress directory and will need some code tweeking in order for cookies to match with WP, as well as, getting WP functions. To get the WP functions to work in bbPress, more tweeking is required. Is there any advantage to not putting bbPRess inside the directory?

    Ultimately, I simply wish to have one WP blog address with a forum capability inside the WP blog.

    Should I move bbPress inside the WP subdirectory? Or leave it as is and fine tune?

    #59992
    _ck_
    Participant

    Ah, here’s SMF’s secret against bbPress – sheer number of files + size.

    This definitely makes me want to go ahead with making a “quick loader” that will concat all the includes and then all the plugins as two blobs that can be either loaded from disk or mysql at user discretion based on the weakness of their shared server:

    Front pages compared:

    (keep in mind SMF actually has even more features than the dozen plugins loaded with bbPress, online user tracker, etc)

    SMF 1.1.3
    files for front page: 8 files, 338.45 Kb

    index.php : 14.31 Kb
    Settings.php : 3.71 Kb
    Sources/QueryString.php : 18.84 Kb
    Sources/Subs.php : 132.37 Kb
    Sources/Errors.php : 15.94 Kb
    Sources/Load.php : 92.47 Kb
    Sources/Security.php : 29.88 Kb
    Sources/MessageIndex.php : 30.93 Kb
    =====================================================

    `

    bbPress 0.8.3 alpha

    files for front page: 40 files, 437.15 Kb

    index.php : 0.44 Kb

    bb-load.php : 0.46 Kb

    config.php : 2.28 Kb

    bb-settings.php : 7.14 Kb

    bb-includes/db-mysqli.php : 12.77 Kb

    bb-includes/functions.php : 71.73 Kb

    bb-includes/wp-classes.php : 3.37 Kb

    bb-includes/classes.php : 37.98 Kb

    bb-includes/formatting-functions.php : 8.73 Kb

    bb-includes/template-functions.php : 59.12 Kb

    bb-includes/capabilities.php : 13.15 Kb

    bb-includes/cache.php : 8.52 Kb

    bb-includes/deprecated.php : 8.17 Kb

    bb-includes/wp-functions.php : 36.06 Kb

    bb-includes/kses.php : 17.65 Kb

    bb-includes/l10n.php : 1.76 Kb

    bb-includes/bozo.php : 10.1 Kb

    bb-includes/akismet.php : 8.14 Kb

    bb-includes/default-filters.php : 4.45 Kb

    bb-includes/script-loader.php : 9.2 Kb

    bb-includes/compat.php : 0.57 Kb

    my-plugins/_bb-benchmark.php : 4.79 Kb

    my-plugins/_cookie-year.php : 0.92 Kb

    my-plugins/bb-polls.php : 21.04 Kb

    my-plugins/bb-signatures.php : 11.52 Kb

    my-plugins/report-post.php : 3.92 Kb

    my-plugins/user-topics-to-favorites.php : 0.59 Kb

    my-plugins/bb-topic-views.php : 5.91 Kb

    my-plugins/my-views.php : 10.13 Kb

    my-plugins/notification.php : 2.26 Kb

    my-plugins/my-views-started-participated-topics.php : 1.52 Kb

    my-plugins/my-views-most-least-views.php : 2.7 Kb

    my-plugins/plugin-browser.php : 21.72 Kb

    my-plugins/my-views-installed-available-plugins.php : 6.61 Kb

    bb-includes/pluggable.php : 8.86 Kb

    bb-includes/locale.php : 6.91 Kb

    bb-templates/kakumei/front-page.php : 3.03 Kb

    bb-templates/kakumei/header.php : 1.6 Kb

    bb-templates/kakumei/logged-in.php : 0.21 Kb

    bb-templates/kakumei/footer.php : 1.13 Kb

    =====================================================

    #60021

    Hmmm I’d already added the

    <? if (function_exists('show_blah')) { show_blah();} ?>

    block around stuff and I’ve added the

    error_reporting(E_ALL);

    To config.php but I’m not getting any more information – its very very odd

    #58887
    neyoung
    Member

    I’m learning slowly :) Figured it out.

    #60017
    neyoung
    Member

    Well, it turns out I shouldn’t play with bbpress/wpmu when I’m tired at 2am. I never ended up activating the plugin o.O . Anyways, I got the code that Detective wrote to work once I pulled my head outta my butt!

    Here’s for anyone else that has this problem…

    toss this into a file called default-role.php and put it in your my-plugins directory within your bbpress install folder.

    <?php

    /*

    Plugin Name: bbpress wpmu default role

    Plugin URI: https://bbpress.org/forums/topic/yet-another-integration-bug-no-role-set-on-registration?replies=5

    Description: Sets a default WPMU role for all new bbpress users.

    Author: Detective

    Author URI: http://www.ryuuko.cl/

    */

    function wpbb_add_user_role_rk($user_id) {

    $user = new WP_User($user_id);

    $user->set_role(get_option(‘default_role’));

    }

    add_action( ‘bb_new_user’, ‘wpbb_add_user_role_rk’);

    ?>

    #59990
    _ck_
    Participant

    eaccellerator and xcache are derived from the same original core – eaccellerator is a tad slower than both xcache and apc, but it also has the fewest problems and fewest incompatibilities compared to both. I believe it also has several people working on it, unlike xcache which means the project doesn’t grind to a halt when one person becomes distracted. No opcode cache project can in theory leapfrog in performance over another, it’s just little tweaks here and there.

    The big secret is replacing Apache with LiteSpeed or if you really have alot of time on your hands and don’t need virtual hosts, Lighttpd. Apache is very inefficient, especially running PHP.

    #2248
    ganzua
    Member

    I’m translating bbpress to spanish (using a custom mo file) and so far there are 3 phrases that I can’t translate;

    In topic view I can’t translate;

    ” You must log in to post. “

    ” Posted 2 weeks ago # ” (in this case “weeks” appears translated but not the rest of the phrase)

    ” Allowed markup: a blockquote br code em strong ul ol li img.

    Put code in between backticks. “

    I can’t locate them, where ca I find them so I can hand translate? or what do you need to put in the .po file so it works?

    #60020
    _ck_
    Participant

    First a quick tip: when you customise templates with a plugin function embeded, instead of this:

    <? show_blah(); ?>

    do this:

    <? if (function_exists('show_blah')) { show_blah();} ?>

    and that way if you deactivate a plugin, it will fail quietly and let the page still render.

    Now to address your problem, that error can happen if something is trying to call bb_get_header before bbpress is completely loaded somehow. Or an include could accidentally get renamed. Or some whitespace got inserted at the end of a plugin somewhere (after the ending ?>)

    You need more info. Go into your config.php and add this as the first line or so:

    error_reporting(E_ALL);

    And see what it throws at you.

    #59988
    _ck_
    Participant

    That’s exactly right about Dreamhost.

    I am working on a technique to try to load all the bbpress includes and plugins directly from the eaccelerator memcache instead of seeking on the disk first to check if they have changed (and just let the mysql plugins registry manage that).

    I suspect I can eliminate the 400ms lag if I can pull that off. Not an easy feat though. Requires a replacement bb-settings.php

    Oh and you’re probably paying per month for your dedicated what I pay per year for my VPS (I’ve migrated twice to get better neighbors):

    === benchmark & query results ===

    12:08:28 up 25 days, 3:37, 0 users, load average: 0.07, 0.04, 0.00

    total page time: 0.045 seconds.

    time to reach each section:
    bb_underscore_plugins_loaded = 0.005
    bb-polls.php loaded = 0.005
    bb-signatures.php loaded = 0.005
    report-post.php loaded = 0.006
    my-views.php loaded = 0.006
    bb-topic-views.php loaded = 0.006
    user-topics-to-favorites.php loaded = 0.006
    admin-post-anything.php loaded = 0.006
    tweaks.php loaded = 0.006
    my-views-most-least-views.php loaded = 0.007
    my-views-started-participated-topics.php loaded = 0.008
    my-views-installed-available-plugins.php loaded = 0.008
    ignore-member.php loaded = 0.009
    bb_plugins_loaded = 0.009
    bb_init = 0.011
    bb_index.php_pre_db = 0.011
    bb_index.php = 0.016
    front-page.php = 0.016
    header.php = 0.017
    logged-in.php = 0.018
    footer.php = 0.045

    time to render page: 0.0429 seconds (query time subtracted)

    total query count: 12

    total query time: 0.0021 seconds

    slowest call was # 1 : 0.0005 seconds
    SELECT * FROM bb_forums LIMIT 1 server:dbh_local connect: 0.38ms

    #60014
    neyoung
    Member

    Sorry for the duplicate post, I think I was tired when I posted the other one and I’d sort of forgot about it.

    Anyways, I’ve been playing with the two bits of code and I think I’ve ‘almost’ got it working. If I execute Detectives query manually from the terminal it works, but for some reason when I put it all in a little plugin nothing happens. Is there a type-o or a noob error somewhere?

    `<?php

    /*

    Plugin Name: bbpress wpmu default role

    */

    function trk_addDefaultRole($user_id) {

    global $bbdb;

    $bbdb->query(“INSERT INTO wp_usermeta ( user_id, meta_key, meta_value ) VALUES ( ‘$user_id’, ‘wp_1_capabilities’, ‘a:1:{s:10:”subscriber”;b:1;}’ )”);

    }

    add_action(‘bb_new_user’, ‘trk_addDefaultRole’);

    ?>

    #2247

    Got a bit of a weird error happening – Let me begin

    Yesterday I did a bit of work sorting out my quite frankly flaky forums – Got everything working quite nicely but then I decided to remove the Avatar Upload plugin because I couldn’t get it looking nice against the users in the forums in the time I had left

    However having turned it off I then found I couldn’t access any of the user profile pages including my own – I just get a completely blank page

    I’ve removed the calls to show the avatar on the profile page itself but its still falling over

    The site error log is reporting the following:

    [Wed Aug 15 04:24:42 2007] [error] [client 86.158.248.246] PHP Fatal error: Call to undefined function bb_get_header() in /home/httpd/vhosts/<sitename>/httpdocs/forums/profile.php on line 1, referer: http://<sitename>/forums/

    Now I know that this simply isn’t true – bb_get_header() is part of the core and its more likely that one of the plugins has gone screwy but I’ve tried turning off the plugins but I’ve done quite a bit of customisation and the majority of the plugins don’t die quietly – they cause major blow-outs if not available so I’m now having to go through all my template code and put if blocks around them to stop them

    The list of plugins I have installed are as follows

    Limit Latest Discussion 0.73

    Simple Onlinelist 1.5

    My Views 0.05

    BBPress Private Messaging 0.80

    Posts since last visit 0.5-beta

    Report Post 0.11

    Avatar Upload 0.8.2

    Private Forums 5.2

    Use Display Name 0.7.2

    bbPress signatures 0.14

    My Views module – Started/Participated Topics 0.05

    Any help would be really appreciated

    #59986
    _ck_
    Participant

    Yeah dreamhost certainly does suck. I just have a $20 per year promo account that I completely forgot about until recently when I wanted to test bbpress on various hosts (I’m looking for other super cheap hosts to try it on if you know of any, especially pay-as-you go like nearlyfreespeech.net)

    What’s really strange is that some other forum software works MUCH faster on dreamhost and I am trying to figure out why. Take a look at WP plugin author GamerZ’s SMF (simple machines forum, evolved from YaBB) which is on another Dreamhost node:

    http://forums.lesterchan.net

    It’s incredibly responsive. Not even running an opcode cache. Of course SMF has half a decade of development behind it, but still, it’s impressive. I suspect they use partial page caching somehow. Meanwhile GamerZ’s WP blog running on the same account, crawls at times.

    #59985
    howtogeek
    Member

    Thanks for that… good thought.

    I changed it to ob_start(null,8192) instead of using the 4096 value you were using in the plugin. I noticed that when I had it set to 4096, I was still getting the really slow page render time for some reason, but 8192 works perfectly.

    I think I’ve mentioned it before, but you rule =)

    Oh, and dreamhost sucks.

    #59983
    howtogeek
    Member

    I think I figured it out… I added my own timing mechanism to virtually every line of code on the front page, and noticed the extra 0.2 seconds was occurring at random places…

    So I put ob_start(); at the beginning of bb-settings.php to turn on output buffering, and now here’s the times I get with like 16 plugins installed, logged in as admin with a ton of custom stuff going on and everything is opcached:

    total page time: 0.078 seconds.

    time to reach each section:

    bb_underscore_plugins_loaded = 0.018

    bb_plugins_loaded = 0.021

    bb_init = 0.021

    bb_index.php_pre_db = 0.024

    front-page.php = 0.025

    header.php = 0.025

    logged-in.php = 0.026

    search-form.php = 0.035

    footer.php = 0.078

    Now that is more like it! Now to remove all my logging….

    And thanks for that benchmark plugin… it’s great, I can’t live without it now =)

    #2246
    neyoung
    Member

    As everyone knows, if a user registers in bbpress instead of through wordpress(mu) that user doesn’t get a default role set.

    I’ve dug and dug on both the bbpress and wpmu forums and haven’t found a fix for this. I did find a fix that apparently works for wordpress, but I tried it for wordpress mu with no luck.

    The 4th post in this thread explains a way to set roles in wordpress mu.

    I imagine that a plugin with the combination of the two solutions would allow users to register through bbpress and get a default role on the main wordpress mu blog. But, unfortunately I have no clue what I’m doing. If anyone has a free minute or two to look at the bits of code and maybe hack something together that would be awesome.

    Oh, and I’m using the latest versions of both bbpress and wpmu.

    #59982
    howtogeek
    Member

    After doing some more research, the plugin loading time is virtually instant when you an opcode cache.

    I added separate timestamp logging which shows that all the plugins are loaded at 0.019 but the bb_plugins_loaded action doesn’t get fired until 0.1 seconds later.

    bb-benchmark.php loaded = 0.019

    bb_underscore_plugins_loaded = 0.019

    bb_plugins_loaded = 0.102

    bb_init = 0.103

    bb_index.php_pre_db = 0.106

    front-page.php = 0.106

    header.php = 0.107

    logged-in.php = 0.107

    search-form.php = 0.116

    footer.php = 0.302

    The majority of the time is taken between search form and footer…. I’m not sure yet what gets executed between them.

    #2245

    Topic: DIV placement problems

    in forum Themes
    Null
    Member

    Hi,

    I have a problem placing a div. I want 2 divs placed in 1 div. I only get 1 div in the div, but the other 1 is giving me problems.

    This is the code I have:

    body
    {
    background: #fff;
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10pt;
    }

    .draggable {
    position: absolute;
    border: 1px solid #0090DF;
    background-color: #68BFEF;
    text-align: center;
    }

    #drag1 (= the green one)
    {
    position: absolute;
    border: 1px solid #fff;
    background-color: #9c0;
    padding: 2px;
    margin-left: auto;
    margin-right: auto;
    }

    #drag7
    {
    top: 10px;
    left: 250px;
    }
    #drag7 div (= the red one)
    {
    cursor: move;
    background-color: #900;
    height: 50px;
    width: 50px;
    margin-left: auto;
    margin-right: auto;
    }

    </style>
    </head>
    <body>
    <div id="drag1" class="draggable">Drag by handle</div>
    <div id="drag7" class="draggable"><div></div>Drag by handle</div>

    etc

    And this picture will explain excatly what I need (the green div under the red one):

    http://www.sourceskins.com/voorbeeld.jpg

    Thanks for the help

    #59980
    _ck_
    Participant

    I’ve put 0.16 into the SVN, I think it updates on the hour.

    Once you have 0.16 installed, go edit bb-settings.php in the bbpress root and around line 157 change that section so you add the line bb_benchmark_template_timer('',$plugin.' loaded');

    like so:

    if ( $plugins = bb_get_option( 'active_plugins' ) )
    foreach ( (array) $plugins as $plugin ) {
    if ( file_exists(BBPLUGINDIR . $plugin) ) {
    require( BBPLUGINDIR . $plugin );
    bb_benchmark_template_timer('',$plugin.' loaded');
    } }
    do_action( 'bb_plugins_loaded' );
    unset($plugins, $plugin);

    .

    That will give you the super detailed output, so if there is a single plugin that is consistently slowing your page load down, you might be able to spot it.

    #59979
    _ck_
    Participant

    If you are running xcache, the plugins are not slowing you down, they get cached.

    So “dedicated virtual” = VPS ? Interesting way to put it.

    If so, you are at the mercy of the disk load on the rest of the node.

    Your own average load rates have nothing to do with the rest of the server node, the VPS software tricks you.

    (the big myth about VPS is that you are you are isolated from your neighbors, you’re not – any high disk use by them will slow you down)

    However if you have 1gb guaranteed, then you have quite a huge VPS. If that’s 1gb burst, then it’s another story.

    But if you have your own vps you can be using an opcode cache (xcache is very good) and then make sure you are using mysql cache.

    Not much else can be done. You could in theory replace apache with LiteSpeed unless you are savvy enough to setup Lighttpd (which I myself won’t bother with)

Viewing 25 results - 29,251 through 29,275 (of 32,491 total)
Skip to toolbar