Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'test'

Viewing 25 results - 1,626 through 1,650 (of 11,582 total)
  • Author
    Search Results
  • ukutabs
    Participant

    Hi everyone,

    Hopefully someone can help me decipher this error (with WP_DEBUG). Without WP_DEBUG simply getting a blank page. Front index and viewing topics works fine, but for some reason the forums (where you see a list of topics) don’t work.

    Tried disabling all plugins, besides bbPress of course. Running the latest WordPress version 5.1.

    Kind regards,
    Jonas.

    
    Fatal error: Uncaught Error: [] operator not supported for strings in /var/www/ukuworld/wp-content/plugins/bbpress/includes/forums/functions.php:1800 Stack trace: #0 /var/www/ukuworld/wp-includes/class-wp-hook.php(286): bbp_pre_get_posts_normalize_forum_visibility(Object(WP_Query)) #1 /var/www/ukuworld/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #2 /var/www/ukuworld/wp-includes/plugin.php(531): WP_Hook->do_action(Array) #3 /var/www/ukuworld/wp-includes/class-wp-query.php(1736): do_action_ref_array('pre_get_posts', Array) #4 /var/www/ukuworld/wp-includes/class-wp-query.php(3387): WP_Query->get_posts() #5 /var/www/ukuworld/wp-includes/class-wp.php(622): WP_Query->query(Array) #6 /var/www/ukuworld/wp-includes/class-wp.php(739): WP->query_posts() #7 /var/www/ukuworld/wp-includes/functions.php(1105): WP->main('') #8 /var/www/ukuworld/wp-blog-header.php(16): wp() #9 /var/www/ukuworld/index.php(17): require('/var/www/ukuwor...') #10 {main} thrown in /var/www/ukuworld/wp-content/plugins/bbpress/includes/forums/functions.php on line 1800
    #199054
    Robin W
    Moderator

    that is presuming you have run the normal tests

    Plugins

    Deactivate all but bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    Themes

    If plugins don’t pinpoint the problem, as a test switch to a default theme such as twentyfifteen, and see if this fixes.

    #199037

    In reply to: Comments Blacklist

    Robin W
    Moderator

    ok, try this plugin

    bbp blacklist checker

    once activated go to tools>bbp blacklist checker

    This lets you switch off the code that is causing the issue.

    It’s just a bit of testing code, not intended for permanent live use, but may help confirm if it’s bbpress or something behind that is causing the issue.

    Try it for both anew post and an edited one

    #198995
    Robin W
    Moderator

    for anyone finding this topic

    I kicked this code around to improve it and also stop the 404 error when a participant trashes a topic, so latest version is

    /*Customize the BBPress roles to allow Participants to trash topics*/
    add_filter( 'bbp_get_caps_for_role', 'ST_add_role_caps_filter', 10, 2 );
    
    function ST_add_role_caps_filter( $caps, $role ){
        // Only filter for roles we are interested in!
        if( $role == bbp_get_participant_role() ) {
    			//only change delete topics 
    			$caps ['delete_topics']= true ;
    	}
    	return $caps;
    }
    /*then only allow participants to trash their own topics*/
    add_filter( 'bbp_map_topic_meta_caps', 'ST_tweak_trash_meta_caps', 11, 4 );
    
    function ST_tweak_trash_meta_caps( $caps, $cap, $user_id, $args ){
    	// apply only to delete_topic
    	if ( $cap == "delete_topic" ){
    		// Get the post
    		$_post = get_post( $args[0] );
    		if ( !empty( $_post ) ) {
    
    			// Get caps for post type object
    			$post_type = get_post_type_object( $_post->post_type );
    			
    			// Add 'do_not_allow' cap if user is spam or deleted
    			if ( bbp_is_user_inactive( $user_id ) ) {
    				$caps[] = 'do_not_allow';
    
    			// Moderators can always edit forum content
    			} elseif ( user_can( $user_id, 'moderate' ) ) {
    				$caps[] = 'moderate';
    
    			// User is author so allow edit if not in admin
                } elseif ( user_can( $user_id, 'participate' ) && ( (int) $user_id === (int) $_post->post_author ) ) {
                    $caps      = array();
    				
    			// Unknown so do not allow
    			} else {
    				$caps[] = 'do_not_allow';
    			}
    		}
    	}	
    	// return the capabilities
    	return $caps;
    	}
    
    //then redirect to the forum after trashing topic
    add_action('bbp_template_redirect', 'ST_trash_topic_check', 8);
    
    //check if topic has been trashed by author and show forum if it has
    function ST_trash_topic_check() {
    	$topic_slug = get_option( '_bbp_topic_slug') ;
    	//quick check if we need to do this function, so bail if not a topic
    	if (strpos($_SERVER['REQUEST_URI'], $topic_slug) == FALSE) return ;
    	$forum_slug = bbp_get_root_slug() ;
    	//if check is set (ie we prefix forums with the forum slug) then part 1 will be forum slug and part 2 will be topic slug, if not part 1 will be topic slug
    	$check = bbp_include_root_slug() ;
    	$link = explode('/',$_SERVER['REQUEST_URI']);
    	//next we need the topic id (post id) of the topic so we need to check if it is a topic and if so, find the topic id
    	if (is_user_logged_in() && $check && $link[1] == $forum_slug && $link[2] == $topic_slug ) {
    		$post = bsp_get_page_by_slug( $link[3], OBJECT, 'topic' );
    		$login_check=1 ;
    		} 
    	elseif (is_user_logged_in() && empty($check) && $link[1] === $topic_slug) {
    		$post = bsp_get_page_by_slug( $link[2], OBJECT, 'topic' );
    		$login_check=1 ;
    	}
    	//now we need to check if the topic has been trashed by author
    	if (!empty ($login_check) && $post->post_status == 'trash' && $post->post_author == get_current_user_id() ) {
    		$topic_id =  $post->ID;
    		//then redirect to the forum we came from
    		$forum = bbp_get_forum_permalink (bbp_get_topic_forum_id (  $topic_id )) ;
    		wp_redirect ($forum) ;
    		exit ;
    	}
    	else return ;
    					
    }

    I’ll add this function into my style pack plugin shortly

    bbp style pack

    #198994
    Robin W
    Moderator

    I kicked this code around to improve it and also stop the 404 error when a participant trashes a topic, so latest version is

    /*Customize the BBPress roles to allow Participants to trash topics*/
    add_filter( 'bbp_get_caps_for_role', 'ST_add_role_caps_filter', 10, 2 );
    
    function ST_add_role_caps_filter( $caps, $role ){
        // Only filter for roles we are interested in!
        if( $role == bbp_get_participant_role() ) {
    			//only change delete topics 
    			$caps ['delete_topics']= true ;
    	}
    	return $caps;
    }
    /*then only allow participants to trash their own topics*/
    add_filter( 'bbp_map_topic_meta_caps', 'ST_tweak_trash_meta_caps', 11, 4 );
    
    function ST_tweak_trash_meta_caps( $caps, $cap, $user_id, $args ){
    	// apply only to delete_topic
    	if ( $cap == "delete_topic" ){
    		// Get the post
    		$_post = get_post( $args[0] );
    		if ( !empty( $_post ) ) {
    
    			// Get caps for post type object
    			$post_type = get_post_type_object( $_post->post_type );
    			
    			// Add 'do_not_allow' cap if user is spam or deleted
    			if ( bbp_is_user_inactive( $user_id ) ) {
    				$caps[] = 'do_not_allow';
    
    			// Moderators can always edit forum content
    			} elseif ( user_can( $user_id, 'moderate' ) ) {
    				$caps[] = 'moderate';
    
    			// User is author so allow edit if not in admin
                } elseif ( user_can( $user_id, 'participate' ) && ( (int) $user_id === (int) $_post->post_author ) ) {
                    $caps      = array();
    				
    			// Unknown so do not allow
    			} else {
    				$caps[] = 'do_not_allow';
    			}
    		}
    	}	
    	// return the capabilities
    	return $caps;
    	}
    
    //then redirect to the forum after trashing topic
    add_action('bbp_template_redirect', 'ST_trash_topic_check', 8);
    
    //check if topic has been trashed by author and show forum if it has
    function ST_trash_topic_check() {
    	$topic_slug = get_option( '_bbp_topic_slug') ;
    	//quick check if we need to do this function, so bail if not a topic
    	if (strpos($_SERVER['REQUEST_URI'], $topic_slug) == FALSE) return ;
    	$forum_slug = bbp_get_root_slug() ;
    	//if check is set (ie we prefix forums with the forum slug) then part 1 will be forum slug and part 2 will be topic slug, if not part 1 will be topic slug
    	$check = bbp_include_root_slug() ;
    	$link = explode('/',$_SERVER['REQUEST_URI']);
    	//next we need the topic id (post id) of the topic so we need to check if it is a topic and if so, find the topic id
    	if (is_user_logged_in() && $check && $link[1] == $forum_slug && $link[2] == $topic_slug ) {
    		$post = bsp_get_page_by_slug( $link[3], OBJECT, 'topic' );
    		$login_check=1 ;
    		} 
    	elseif (is_user_logged_in() && empty($check) && $link[1] === $topic_slug) {
    		$post = bsp_get_page_by_slug( $link[2], OBJECT, 'topic' );
    		$login_check=1 ;
    	}
    	//now we need to check if the topic has been trashed by author
    	if (!empty ($login_check) && $post->post_status == 'trash' && $post->post_author == get_current_user_id() ) {
    		$topic_id =  $post->ID;
    		//then redirect to the forum we came from
    		$forum = bbp_get_forum_permalink (bbp_get_topic_forum_id (  $topic_id )) ;
    		wp_redirect ($forum) ;
    		exit ;
    	}
    	else return ;
    					
    }

    I’ll add this function into my style pack plugin shortly

    bbp style pack

    #198975
    cacarlyle
    Participant

    Hi there, first of all, sorry if this is something everybody knows, i did try to google it but came up with only things that aren’t the same as what i’m looking for.

    What i would like is for an image preview of some sort to come up within the post or reply, in bbpress, whenever somebody pastes a URL. Ideally it should only happen for the first URL in each post or reply, and ignore any subsequent URLs, but if that’s fiddly then just something that will generate previews for any URLs posted would be very helpful.

    Here is an example of it not happening: https://yesbook.scot/forums/topic/the-greatest-argument-of-all/

    That’s me posting an OP in my bbpress forum, and as you can see i pasted some text from a web page, and then a URL link to the page. Now what would be ideal is if the post also automatically showed a picture, drawn from the URL, inline within the bbprss post, in the same way that facebook pulls a picture in when you post a URL on their site.

    Is there a plugin that does this, or some simple tweak i can make to the config files of the site to make this happen? I’m not totally ignorant of how to use php and CSS but for the sake of argument, please assume that i am, because it isn’t far from the truth!

    Thanks in advance for any assistance you can provide.

    It is currently WordPress version 5.1 and bbPress version 2.5.14-6684
    I am using DI Business Responsive theme, though i don’t think that makes much difference for this particular question.

    #198892
    Robin W
    Moderator

    that’s what spectator should do.

    Suggest you set up a test user and check that that works.

    #198848
    Robin W
    Moderator

    that measures site loading, not server performance as such, eg it doesn’t test dadatabase writes.

    cache will not affect non cache actions such as post submission

    I’d suggest you talk to your host providers.

    #198821
    angeljs
    Participant

    I’m using the latest versions of both WP and bbPress

    #198814
    Robin W
    Moderator

    not really bbpress related – This is server/theme/other plugins issue.

    My test site which is full of stuff takes 1-2 seconds for a post, it is on a shared server, so depends on what else is happening on that server with other websites.

    I would ask that why your forum is so dependant on the need for lightening speed of posting, is the content really that boring ? Few users worry about posting speed, as longs as the site displays posted stuff in good speed:-)

    #198813

    In reply to:

    Robin W
    Moderator

    not really bbpress related – This is server/theme/other plugins issue.

    My test site which is full of stuff takes 1-2 seconds for a post, it is on a shared server, so depends on what else is happening on that server with other websites.

    I would ask that why your forum is so dependant on the need for lightening speed of posting, is the content really that boring ? Few users worry about posting speed, as longs as the site displays posted stuff in good speed:-)

    #198803
    Robin W
    Moderator

    It could be a theme or plugin issue

    Themes

    As a test switch to a default theme such as twentyfifteen, and see if this fixes.

    Plugins

    If that doesn’t work, also deactivate all plugins apart from bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    Then come back

    w3215
    Participant

    Hi. On the issue of whether bbpress registration goes through WordPress registration–it appears that it does.

    I put the bbpress registration page on my test site, and tried to create a new user. It took me to a WordPress page that said email not recognized. I believe what was happening was that in order to register for bbpress, I had to be a wordpress user, and I was taken to the wordpress page when wordpress could not find the email address.

    So, based on this, indeed it does seem like in order to use bbpress users have to have WordPress accounts. This is what I do not want. Users should never be taken to a wordpress page to check if they are wordpress users.

    Rather, users should be able to register directly on the site without having to have wordpress accounts.

    Does anyone have a good way around this?

    I am assuming the only way is through a front end registration plugin like Ultimate Member, but I would be happy if there was another way.

    w3215
    Participant

    Thank you for your reply.

    Here is the issue: I am considering using bbpress as an important part of a site that anyone can use. Imagine it like stackoverflow, discussion sites run by discourse, or practically any web app–users register directly on the site without need to have an underlying account somewhere else. It seems to me that if someone wanted to build a site like these–entirely separate from a wordpress blog– bbpress would be a good place to start. (Please let me know if you disagree.)

    So I will require a way for anyone who wants to use my site–wordpress user or not–to register and use the site. One of the great things about bbpress is that out of the box it covers so much and it has been around long enough to be thoroughly tested; so I had hoped I could just use bbpress’s registration, without having to configure a separate registration process.

    In particular, I like how bbpress generates a user profile page that summarizes a user’s activity in a simple way.

    Is there a way to allow non-wordpress users to register, while still utilizing bbpress’s tools like its user profile page? Maybe a bbpress plugin?

    I know there are general wordpress plugins that allow registration on the front end by non-wordpress users, like Ultimate Member. I am not familiar with how those could work with bbpress.

    Thanks!

    #198765
    richflickinger
    Participant

    Hi All,

    I’m having 2 issues with the same page.

    1. When I click a topic to read it, the page title shows up as “topics” instead of the title of the topic. I have figured out how to get the topic title there but can’t figure out how to get rid of topics. I only want it gone for all the single topic pages and not every page.

    2. I can’t figure out how to center that same sigle topic page.

    Here’s a link to the forum with a test topic in it.

    General Questions

    Any help would be greatly appreciated. Thanks.
    Rich

    #198761
    w3215
    Participant

    Hi. I recently installed BBPress and was surprised the latest version for installation was 2.5.14. I also get a notice that the plugin “has not been tested with your current version of WordPress.”

    Is BBPress being maintained? What is the expected timing for 2.6?

    Performance/speed is important to me, and last I looked into it 2.6 was supposed to be a big improvement.

    #198760
    Pleiades
    Participant

    Thanks, Robin W.
    It’s a site I inherited with 100+ plugins. I’m trying to unravel the necessary from the superfluous but too many things keep breaking.

    I’m trying to put traps in the code to see where conflicts are occurring. It seems like bbp_has_forums calls methods that call methods that call methods…

    I would appreciate if someone could help shortcircuit this process and point me to the place where the actual test is happening.

    Please forgive my snarky comment earlier. This site has been a cluster and I’ve been frustrated by a long list of plugins with no doc and no response to developers.

    Robin W
    Moderator

    totally untested but try

    function rew_status_transitions( $post ) {
    	if ( $post->post_type == 'reply') {
    		$topic = bbp_get_reply_topic_id ($post->ID) ;
    		//update the post meta
    		update_post_meta ($topic, '_bbp_last_active_time' , $post->post_date) ;
    	}
    	 
    }
    add_action(  'future_to_publish',  'rew_status_transitions', 10, 1 );
    wpturk
    Participant

    In the latest version 2.6 RC7, If a post goes to status=pending the author directly gets 404 page.

    example.com/forum/?post_type=topic&p=xxxxx is directed to 404 page.

    I use moderation tools plugin and when a user submits a topic, the user sees directly a 404 page due to the problem above.

    This is not related to other plugins or theme.
    My test environment is version: 2.6 RC5 and there it’s working fine. Authors can see their pending posts.

    Ticket #3252

    Let me know, if you know quick fix?

    #198730
    w3215
    Participant

    Hi. What is the expected timing for 2.6?

    I recently installed BBPress and was surprised the latest version for installation was 2.5.14. I also get a notice that the plugin “has not been tested with your current version of WordPress.”

    Performance/speed is important to me, and last I looked into it 2.6 was supposed to be a big improvement.

    Robin W
    Moderator

    it really needs to also update the forum latest activity – I’ll try and look at that as well

    neon67
    Participant

    Thank very much for your concern.
    I’ll report the results as soon as I test it.

    #198666

    In reply to: bbpress Slow

    Robin W
    Moderator

    I can only suggest as a test remove the notification plugin and see if this is making the difference

    #198548
    PDidee
    Participant

    I was wondering if it’s possible to set up master forums with bbPress. We have a client that has a courses site and would like to setup forums for each course. So this page for example: http://mbmembers.staging.wpengine.com/community-forum/ would be one of multiple “master” forums.

    Other items they are looking to implement that may or may not be available through this plugin include:

    • different master forums for different courses on site as mentioned above
    • each master forum has sub-forums, then threads
    • on threads, responses to topic or other responses get nested (saw this as an option and have it enabled but I’m not seeing the replies indented at the moment on the test link above)
    • option for people to receive an email per forum post, or a daily digest per that sub-forum
    • ability to turn email for each sub-forum on/off – or switch to daily digest vs. individual posts
    • exception is Announcements sub-forum – everyone should be automatically subscribed to individual messages email, can change to daily digest, but users CANNOT turn off emails for this sub-forum
    • note: it may be wise to have a spot on the My Account page (a tab?) where users can edit their email preferences for all the forums at once
    • only admins can start new threads in Announcements sub-forum; other forums anyone can start a new thread
    • we are creating a participant directory — the front-end needs to have links to for users to view a participant’s forum posts, or the forum threads they’ve started (currently, these are two separate links)

    Any help or info you can provide would be super appreciated.

    #198356
    hthornhillhww
    Participant

    Hi,

    I have created a custom notification for my site when a post is published, the code used to do this is :-

    // this is to add a fake component to BuddyPress. A registered component is needed to add notifications
    function custom_filter_notifications_get_registered_components( $component_names = array() ) {
        // Force $component_names to be an array
        if ( ! is_array( $component_names ) ) {
            $component_names = array();
        }
        // Add 'custom' component to registered components array
        array_push( $component_names, 'publishpost' );
        // Return component's with 'custom' appended
        return $component_names;
    }
    add_filter( 'bp_notifications_get_registered_components', 'custom_filter_notifications_get_registered_components' );
    
    // this hooks to post creation and saves the post id
    function bp_custom_add_notification( $post_id, $post ) {
            $post = get_post( $post_id );
            $author_id = $post->post_author;
    		
    		$blogusers = get_users( array( 'role' => 'staff' ) );
    		// Array of WP_User objects.
    		foreach ( $blogusers as $user ) {
    			bp_notifications_add_notification( array(
                'user_id'           => $user->id,
                'item_id'           => $post_id,
                'component_name'    => 'publishpost',
                'component_action'  => 'publishpost_action',
                'date_notified'     => bp_core_current_time(),
                'is_new'            => 1,
            ) );   
    		}        
    }
    add_action( 'publish_post', 'bp_custom_add_notification', 99, 2 );
    
    /**
     * Format the BuddyBar/Toolbar notifications
     *
     * @since bbPress (r5155)
     *
     * @package bbPress
     *
     * @param string $action The kind of notification being rendered
     * @param int $item_id The primary item id
     * @param int $secondary_item_id The secondary item id
     * @param int $total_items The total number of messaging-related notifications waiting for the user
     * @param string $format 'string' for BuddyBar-compatible notifications; 'array' for WP Toolbar
     */
    function custom_format_buddypress_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) 
    {
    // New custom notifications
        if ( 'publishpost_action' === $action ) {
    
            $post = get_post( $item_id );
    		$author_name = get_the_author_meta('display_name', $post->post_author);
            $custom_title = bp_core_get_user_displayname( $post->post_author ) . ' published a new post "' . get_the_title( $item_id ) . '"';
            $custom_link  = get_permalink( $post );
            $custom_text = bp_core_get_user_displayname( $post->post_author ) . ' published a new post "' . get_the_title( $item_id ) . '"';
            // WordPress Toolbar
            if ( 'string' === $format ) {
                $return = apply_filters( 'publishpost_filter', '<a href="' . esc_url( $custom_link ) . '" title="' . esc_attr( $custom_title ) . '">' . esc_html( $custom_text ) . '</a>', $custom_text, $custom_link );
            // Deprecated BuddyBar
            } else {
                $return = apply_filters( 'publishpost_filter', array(
                    'text' => $custom_text,
                    'link' => $custom_link
                ), $custom_link, (int) $total_items, $custom_text, $custom_title );
            }
    
            return $return;
    
        } 
    	
    	if ( 'bbp_new_reply' === $action ) {
    		$topic_id    = bbp_get_reply_topic_id( $item_id );
    		$topic_title = bbp_get_topic_title( $topic_id );
    		$topic_link  = wp_nonce_url( add_query_arg( array( 'action' => 'bbp_mark_read', 'topic_id' => $topic_id ), bbp_get_reply_url( $item_id ) ), 'bbp_mark_topic_' . $topic_id );
    		$title_attr  = __( 'Topic Replies', 'bbpress' );
    
    		if ( (int) $total_items > 1 ) {
    			$text   = sprintf( __( 'You have %d new replies', 'bbpress' ), (int) $total_items );
    			$filter = 'bbp_multiple_new_subscription_notification';
    		} else {
    			if ( !empty( $secondary_item_id ) ) {
    				$text = sprintf( __( 'You have %d new reply to %2$s from %3$s', 'bbpress' ), (int) $total_items, $topic_title, bp_core_get_user_displayname( $secondary_item_id ) );
    			} else {
    				$text = sprintf( __( 'You have %d new reply to %s',             'bbpress' ), (int) $total_items, $topic_title );
    			}
    			$filter = 'bbp_single_new_subscription_notification';
    		}
    
    		// WordPress Toolbar
    		if ( 'string' === $format ) {
    			$return = apply_filters( $filter, '<a href="' . esc_url( $topic_link ) . '" title="' . esc_attr( $title_attr ) . '">' . esc_html( $text ) . '</a>', (int) $total_items, $text, $topic_link );
    
    		// Deprecated BuddyBar
    		} else {
    			$return = apply_filters( $filter, array(
    				'text' => $text,
    				'link' => $topic_link
    			), $topic_link, (int) $total_items, $text, $topic_title );
    		}
    
    		do_action( 'bbp_format_buddypress_notifications', $action, $item_id, $secondary_item_id, $total_items );
    
    		return $return;
    	}
    }
    add_filter( 'bp_notifications_get_notifications_for_user', 'custom_format_buddypress_notifications', 1, 5 );

    How can i create the same for a new bbpress topic? i’m thinking i need to change this code section but not sure how

    // this hooks to post creation and saves the post id
    function bp_custom_add_notification( $post_id, $post ) {
            $post = get_post( $post_id );
            $author_id = $post->post_author;
    		
    		$blogusers = get_users( array( 'role' => 'staff' ) );
    		// Array of WP_User objects.
    		foreach ( $blogusers as $user ) {
    			bp_notifications_add_notification( array(
                'user_id'           => $user->id,
                'item_id'           => $post_id,
                'component_name'    => 'publishpost',
                'component_action'  => 'publishpost_action',
                'date_notified'     => bp_core_current_time(),
                'is_new'            => 1,
            ) );   
    		}        
    }
    add_action( 'publish_post', 'bp_custom_add_notification', 99, 2 );

    I am using woffice as the theme, bbpress version 2.5.14, buddypress version 4.1.0 and the latest version of wordpress

    Thanks

Viewing 25 results - 1,626 through 1,650 (of 11,582 total)
Skip to toolbar