Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 4,876 through 4,900 (of 32,518 total)
  • Author
    Search Results
  • #187211
    Robin W
    Moderator

    not within free help – code digging would be needed.

    #187199

    In reply to: bbpress performance

    Fabian
    Participant

    Yes, BuddyPress registers its autoloader, but includes most files through BP_Component::includes() anyway. Thats only half-way implemented.

    #187196

    In reply to: bbpress performance

    Fabian
    Participant

    @johnjamesjacoby thats not true, WP has a “polyfill” for autoloading, and actively uses it on every request, even on legacy PHP 5.2. So autoloading is officially supported.

    These are first numbers about the impact of an unconfigured bbPress on a fresh WP server response time:

    PHP 5.6 + opcache : +35 % SRT
    PHP 7.0 + opcache : +28 % SRT
    PHP 7.1 no opcache: +28 % SRT

    As you can see bottleneck is loading and parsing. Note that the speedup of opcache in PHP 7 is about 6x.

    #187177
    rogerlridge
    Participant

    Thanks for the reply, I’m currently using that plugin but it doesn’t work the way I need it to. It tells me the number of users currently online but not currently viewing any particular thread, forum or page for that matter. But thank you for the suggestion. If you know of a way to maybe code it so that it does that please feel free to share whatever info you might have as it would be greatly appreciated! 😀

    #187168
    moejonet
    Participant

    because i cant edit my reply my correction:

    
    function bbp_update_reply_position( $reply_id = 0, $reply_position = 0 ) {
    
        global $wpdb;
        
    	// Bail if reply_id is empty
    	$reply_id = bbp_get_reply_id( $reply_id );
    	if ( empty( $reply_id ) )
    		return false;
    
    	// If no position was passed, get it from the db and update the menu_order
    	if ( empty( $reply_position ) ) {
    		$reply_position = bbp_get_reply_position_raw( $reply_id, bbp_get_reply_topic_id( $reply_id ) );
    	}
    	
    	$db_menu_order = $wpdb->get_var("select menu_order from {$wpdb->posts} where ID={$reply_id}");
    	
    	if($db_menu_order == $reply_position)
    	    return (int) $reply_position;
    
    	// Update the replies' 'menp_order' with the reply position
    	wp_update_post( array(
    		'ID'         => $reply_id,
    		'menu_order' => $reply_position
    	) );
    
    	return (int) $reply_position;
    }
    
    #187165
    moejonet
    Participant

    I would propose following changes in bbp_update_reply_position in bbpress/replies/functions.php:2128.

    
    function bbp_update_reply_position( $reply_id = 0, $reply_position = 0 ) {
    
    	// Bail if reply_id is empty
    	$reply_id = bbp_get_reply_id( $reply_id );
    	if ( empty( $reply_id ) )
    		return false;
    
    	// If no position was passed, get it from the db and update the menu_order
    	if ( empty( $reply_position ) ) {
    		$reply_position = bbp_get_reply_position_raw( $reply_id, bbp_get_reply_topic_id( $reply_id ) );
    	}
    	
    	$post = get_post($reply_id);
    	
    	if($post->menu_order == $reply_position)
    	    return (int) $reply_position;
    
    	// Update the replies' 'menp_order' with the reply position
    	wp_update_post( array(
    		'ID'         => $reply_id,
    		'menu_order' => $reply_position
    	) );
    
    	return (int) $reply_position;
    }
    
    #187164
    moejonet
    Participant

    There is an infite loop on reply update caused by buddypress activity from bbpress if bbp_thread_replies() is false.

    activity tries to get reply position, in this call position is updated for the reply but we are still in edit_post action so wp_update_post is called recursively until server gives up.

    stacktrace:

    
    var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/replies/functions.php(2143): wp_update_post(Array)
    #2 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/replies/template.php(1757): bbp_update_reply_position(508812, 1)
    #3 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/replies/template.php(487): bbp_get_reply_position(508812, 508811)
    #4 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/extend/buddypress/activity.php(552): bbp_get_reply_url(508812)
    #5 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/extend/buddypress/activity.php(642): BBP_BuddyPress_Activity->reply_create(508812, 508811, 495076, Array, 47710)
    #6 /var/www/clients/client1/web17/web/wp-includes/class-wp-hook.php(298): BBP_BuddyPress_Activity->reply_update(508812, Object(WP_Post))
    #7 /var/www/clients/client1/web17/web/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array)
    #8 /var/www/clients/client1/web17/web/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
    #9 /var/www/clients/client1/web17/web/wp-includes/post.php(3480): do_action('edit_post', 508812, Object(WP_Post))
    #10 /var/www/clients/client1/web17/web/wp-includes/post.php(3591): wp_insert_post(Array, false)
    #11 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/replies/functions.php(2143): wp_update_post(Array)
    #12 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/replies/template.php(1757): bbp_update_reply_position(508812, 1)
    #13 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/replies/template.php(487): bbp_get_reply_position(508812, 508811)
    #14 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/extend/buddypress/activity.php(552): bbp_get_reply_url(508812)
    #15 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/extend/buddypress/activity.php(642): BBP_BuddyPress_Activity->reply_create(508812, 508811, 495076, Array, 47710)
    #16 /var/www/clients/client1/web17/web/wp-includes/class-wp-hook.php(298): BBP_BuddyPress_Activity->reply_update(508812, Object(WP_Post))
    #17 /var/www/clients/client1/web17/web/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array)
    #18 /var/www/clients/client1/web17/web/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
    #19 /var/www/clients/client1/web17/web/wp-includes/post.php(3480): do_action('edit_post', 508812, Object(WP_Post))
    #20 /var/www/clients/client1/web17/web/wp-includes/post.php(3591): wp_insert_post(Array, false)
    #21 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/replies/functions.php(2143): wp_update_post(Array)
    #22 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/replies/template.php(1757): bbp_update_reply_position(508812, 1)
    #23 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/replies/template.php(487): bbp_get_reply_position(508812, 508811)
    #24 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/extend/buddypress/activity.php(552): bbp_get_reply_url(508812)
    #25 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/extend/buddypress/activity.php(642): BBP_BuddyPress_Activity->reply_create(508812, 508811, 495076, Array, 47710)
    #26 /var/www/clients/client1/web17/web/wp-includes/class-wp-hook.php(298): BBP_BuddyPress_Activity->reply_update(508812, Object(WP_Post))
    #27 /var/www/clients/client1/web17/web/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array)
    #28 /var/www/clients/client1/web17/web/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
    #29 /var/www/clients/client1/web17/web/wp-includes/post.php(3480): do_action('edit_post', 508812, Object(WP_Post))
    #30 /var/www/clients/client1/web17/web/wp-content/plugins/bbpress/includes/replies/functions.php(45): wp_insert_post(Array)
    #31 /var/www/clients/client1/web17/web/wp-content/themes/mikmag-child/lib/core/MundrImportForums.php(663): bbp_insert_reply(Array, Array)
    #32 /var/www/clients/client1/web17/web/wp-includes/class-wp-hook.php(298): lib\core\MundrImportForums->post_import_forums_threads('')
    #33 /var/www/clients/client1/web17/web/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters('', Array)
    #34 /var/www/clients/client1/web17/web/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
    #35 /var/www/clients/client1/web17/web/wp-admin/admin-ajax.php(91): do_action('wp_ajax_post_im...')
    
    #187144
    vegetarianzen
    Participant

    Hello Team bbpress

    I am using the plugin bbpress. I want to customise that view of forum similar to http://www.veggieboards.com/forum/index.php this link.

    I have created the child theme and add the css folder and archive-forums.php file in the child theme. I am not able to customise plugin using css only because I want to change the structure. If I change plugin core file then future update overwrite my code and when I am place the complete plugin in child then its stop working and page become blank.

    Please give me the solution I am waiting your solutions.

    My bbpress plugin Version: 2.5.14

    Wordpress Version: 4.8.2

    Thanks

    #187141
    Robin W
    Moderator
    #187139
    rogerlridge
    Participant

    Does anyone know where I can edit or find the source code to edit the layout of the blockquote? I would like to add a little image on the side of the blockquote. Does anyone know where I can find the code to achieve this please? Thanks in advance

    #187137

    In reply to: Free BBPress Theme

    MakarkinPRO
    Participant

    thx. Yeah it’s working a bit what I want.

    Any idea of how to remove Name/Email registration fields from the ShortCode (which is generation login details on the page) ?

    2017-09-24_1652

    #187123
    Robin W
    Moderator
    if (bbp_is_topic_sticky( $topic_id )) {
    //do something 
    }
    #187121
    Mike Costanzo
    Participant

    Hi there!

    I’m importing forums from Rainmaker into WordPress 4.8.2 and BBPress 2.5.14. On first glance, it looks like all has done well; a quick glance at a sample Forum, for example, tells me:

    “This forum contains 74 topics and 698 replies.”

    However, my Topics and Replies are not being “found” when a Forum is clicked on:

    “Oh bother! No topics were found here!”

    This appears to be because the post_parent in wp_posts for all these Topics and Replies is set to “0” in the database. And what’s worse, the “Repair” tools like “Recalculate the parent topic for each post” or “Recalculate the parent forum for each post” do not fix the problem; post_parent remains at value 0.

    The only way I have found to populate a Topic with the correct post_parent value is to open that topic in the Editor and click Publish. But since I have hundreds of Topics and thousands of Replies, manually saving all these Posts is hardly a workable solution.

    Does anyone know of a better way to solve this problem that doesn’t involve nearly infinite man-hours of drudgery and toil?

    Thanks in advance for any help you might be able to give. Long live BBPress!

    #187120
    heppusiel
    Participant

    I just try latest version of BBPress, and this problem exist. Is there any fix coming? Codes above didn’t work for me.

    #187118
    Robin W
    Moderator

    @lovechard if you’d like some code around JJJ’s filtering suggestions, contact me via my website

    http://www.rewweb.co.uk

    #187110
    Bharat Karavadra
    Participant

    Hello,

    I have had to add a space after the https:// to avoid the screen appearing

    If you look at Peter Recks’ posts here:
    https:// http://www.karavadra.net/forums/topic/header-image-formatting/

    There are quotes with text ‘Reconsidering Study, Qualifications & Experience’ with a link to here:
    1) https:// http://www.karavadra.net/reconsidering-study-qualifications-experience/

    However, Peter has only put in a link in his post which is not to the link 1 above but to here:
    2) https:// romancecalling.xyz/?page_id=35

    When I look at the link in admin it appears correctly as link 2

    Why is the link being changed from the 2nd to the 1st on the user side and the title of the page being added?

    And more importantly how do I get it to appear as it as posted, namely link 2.

    Note: no a hrefs or any other shortcodes for links are being used — only the URLs 1 and 2.

    Thank you,

    Bharat

    #187092

    Also, is it not possible to write one query that deletes content from two tables (wp_posts and postmeta)?

    Correct; it is not possible. Each deletion from each table needs its own query. It’s not possible to know which meta-data IDs to delete without SELECTing which post IDs before deleting them.

    #187059

    You won’t be able to do this with just 1 query, because you’ll also want to delete the associated meta-data; that will take at least another query with the post IDs of the topics you’re trying to delete. If you’re using any type of caching, those caches should be purged also, which usually requires PHP or a cache-key reset.

    There are a few alternatives.

    * Admin > Tools > Forums > Reset will let you erase all bbPress content completely. It may timeout depending on your server configuration, but it will eventually get through it.
    * Use WP-CLI: http://wp-cli.org
    * Export the DB, do the data delete on a more capable server (or locally) then re-import it back in. This obviously is the more technical solution, but works really well in a pinch.

    #187057

    In reply to: New replies first

    seth23
    Participant

    This code worked for me. Is there any way to put an option on the topics pages for people to choose if they want the thread to go oldest to newest or newest to oldest?

    #187044

    I understand the need for this, but this is coming from bbPress so there is only so much we can do. bbPress has no way to to blanket unsubscribe someone from all of their forums/thread email subscriptions. If bbpress had a way to unsubscribe globally, then we could look into it but going topic by topic, which is how they have it setup does not work. Simply put bbPress doesn’t have the utilities to make it reasonably possible

    The bbp_topic_subscription_user_ids filter can be used to remove users from the array of users to be notified about new replies to topics.

    The bbp_forum_subscription_user_ids filter can be used to remove users from the array of users to be notified about new topics in a forum.

    On the Memberpress side, or in a separate add-on, they can filter those arrays, remove “inactive” members from those emails, and problem solved.

    I’d also argue that you actually don’t want to blanket unsubscribe anyone from anything, because if they ever re-subscribe, they’ll want to get all of their previous history back; right? If you purged all those subscriptions when their membership expires, that would kinda stink for them.

    #187042

    In reply to: bbpress performance

    Fabian
    Participant

    1) It is true and I’ll show you some more precise benchmarks on this for a concrete example. Take the filter bbp_map_meta_caps, it’s within a filter recursion, where the filter fires it self again. The recursively fires 4 times with bbpress only. Now if another plugins does the same, it could get up to 16. Plugin run times include each other through the filter api. In worst case you can’t just add them to each other, they bias by some non-linear function that is definitely not O(n).
    Your point is true, that you can’t blame a plugin for being slower in conjuntion to others. But, you as a developer, should avoid that other plugins can slowdown your own plugin, by minimal intrusion into the WordPress plugin API. And bbPress does not have this minimal intrusion. Of course it is a big software product, but there is high potential to conditionally hook into WP only on pages it needs to.

    2) No its not completely irrelevant. I wasnt clear enouh here, I’m not referring to file count, but yeah -how you said- file size or LLOC. Were not talking about vulcanizing scripts. You’re right, the PHP interpreter got very fast and it should not matter, but consider:

    a) Only the inclusion of bbpress main file makes PHP allocate about 600 KB. Thats a lot, considering 0 output bytes. And this happens on every request, every REST.

    b) Think about who runs a WordPress site, not people that have a dedicated high performance server. Usually its a webspace in a VM. These systems can power hundreds of sites, so the webserver does not just read 500 files at the same time, but lets say 10000. This lowers the chance to find the same PHP code in some cache between subsequent requests. The code size per request starts to matter here.

    b) It is a style thing, I dont want my programs to load 1MB code without using it. And yeah, there are many plugins that just follow WordPress style to include everything, but this does not mean it is a good style to follow. Unfortunately, there is no well known code metric that covers this. WP was created in darker times of PHP, without autoloaders. Why do we have them now? I dont get it why so few plugins properly use them, it takes a day to refactor your plugin and another to test.

    bbPress is not doing bad. It could just be more minimal if the forum is just a smaller part of your website. I dont expect 25 plugins to allocate 0 memory, but I expect 25 plugins not to clog my dashboard and frontpage, where I do not want them to load. I want them to do what they are supposed to do on specific pages within the front- and backend.
    Its true that woocomerce is the worst.
    I could optimize it though. It only loads on the shop frontpage, on the checkout page, on product pages, specific ajax actions and REST endpoints. The cart can be XHR, or one can keep on loading the plugin once a cookie is set. This technique makes the wp-admin dashboard fast too.

    (I’ll back with the benchmarks)

    #187028
    Kutakizukari
    Participant
    .bbpress ARTICLE
    {
    	width: auto;
    }
    #187027
    MakarkinPRO
    Participant

    If I’m on the right way. Does anybody have help with the code in functions.php
    its should like:

    1) Change user role from Subcriber to PaidSubscriber if status is “Active” https://www.screencast.com/t/oAFwrSQVjMy for specific user.

    2) Change user role from PaidSubscriber to Subcriberif status is “Decline”, but if he have not any other orders which is “Active”. Becouse user may buy a 1 month subscription, and the continue it before 5 days before last one is end.

    Ok? anybody may help? )

    #187020

    In reply to: bbpress performance

    Milan Petrovic
    Participant

    1. That is simply not true. I developed many plugins for bbPress, and I always do extensive benchmarking of bbPress and various plugins, and if you have 25 plugins or if you have 5 plugins, bbPress has the same impact on WP regardless. If two websites add 0.1 seconds slowdown, you can’t blame one of the plugins for what other is doing.

    2. That is completely irrelevant to loading performance. It is possible to merge all files any plugin has into one huge file. A number of files don’t have too much impact on the loading, and it is even recommended to have a lot of smaller files to help with the code organization, improve loading of what is needed when it is needed (for the most part). WordPress loads about 200 files on average for each page request, and even more on the admin side, and I have seen plugins that load 100 or more files. Size of files have more impact on performance, then the number of files. And with modern servers using SSD discs and a lot of memory, files loading is negligible.

    The biggest impact of performance of any plugin has to work with the database in any way (getting posts, filtering). And yes, bbPress up to version 2.5 was not best optimized, and it was on the slower side when dealing with large topics or large forums. Version 2.6 (currently in Beta/RC stage), has significant performance improvements related to database operations, loading posts and processing them.

    PHP has Opcache, and other performance related tools for a reason: PHP is not compiled, it is interpreted, and that is always a slower method for doing things, and PHP needs help to make things faster. It is a good thing to have and use Opcache or Memcached. For instance, my website without Opcache uses 60MB for PHP process on average, with Opcache that goes down to 12MB. WordPress without Opcache uses about 20MB on its own, bbPress adds about 5MB, WooCommerce adds closer to 10MB, BuddyPress around 6-7MB. Huge and complex plugins always need memory to work, you can’t expect to run 25 plugins and keep memory to a zero. That is why we have systems to optimize PHP, we have cache plugins.

    Once the bbPress 2.6 is released, I will do a new benchmark to compare 2.5 to 2.6 and see how much gains are there when using bbPress with a forum having a large number of topics and replies. But, from current testing I am doing with 2.6, it is much faster than last 2.5.

    Milan

    #187006
    Robin W
    Moderator

    can I just confirm that this happens then with both the bbpress shortcode [bbp-lost-pass] AND with the wp-admin lost password ?

Viewing 25 results - 4,876 through 4,900 (of 32,518 total)
Skip to toolbar