• Skip to content
  • Skip to primary sidebar
  • Skip to footer

Foliovision

Main navigation

  • Weblog
    • FV Player
    • WordPress
    • Video of the Week
    • Case Studies
    • Business
  • About
    • Testimonials
    • Meet the Team
    • We Support
    • Careers
    • Contact
    • Pricing
  • Products
  • Support
    • FV Player Docs
    • Pro Support
  • Login
  • Basket is empty
Affordable VAST/VPAID for Wordpress has arrived. Serve ads with your videos starting today!

How to make WordPress 4.0 play nice with original bbPress

5 September 2014 / Martin / 37 Comments

We still use bbPress version 1 on some of our websites. It’s powerful and integrates well with WordPress. Alas the recently released upgrade to WordPress 4.0 breaks the integration and here are the steps for all of you who need to resolve this issue right now. In case you are wondering, for simple customisable forums, bbPress 1 absolutely rocks.

If you wonder why we still use bbPress version 1:

  • We like its permalinks more than permalinks of bbPress version 2 (although we know enough about customizing WordPress rewrite rules, it’s still a big job)
  • The integration with WordPress is only partial (no plugins load, so it’s faster)
  • WordPress.org still uses bbPress 1.1 on their support forums (check generator meta tag here)

WordPress 4.0 forces the upgrade so you may have some clients in extreme pain. No need to panic. With two simple steps you can make WordPress 4.0 and bbPress 1 completely compatible again.

Note: This will only help if you integrate your bbPress with your WordPress by including wp-load.php.

  1. Edit bb-includes/backpress/class.wp-auth.php – add following code right at the start of the validate_auth_cookie() function of the WP_Auth class (find function validate_auth_cookie(…) and enter it right behind the opening bracket {):

    return wp_validate_auth_cookie( $cookie, $scheme );
    

    WordPress 4.0 changed the cookie format and also the hash function, so without this fix bbPress won’t understand that you are logged in.

  2. If you use some advanced permission checks for WordPress capabilities, replace bb_get_current_user() with wp_get_current_user().

    Update: Edit bb-includes/backpress/class.wp-users.php – add following code into function WP_Users::get_user() after the line which says $user = wp_cache_get( $_safe_user_id, 'users' );

    $user_meta = wp_cache_get( $_safe_user_id, 'user_meta' );
    foreach( $user_meta AS $k => $i ) {
      if( count($i) == 1 && isset($i[0]) ) {
        $user_meta[$k] = $i[0];
      }
    }
    $user_meta = array_map( 'maybe_unserialize', $user_meta );
    foreach( $user_meta AS $k => $i ) {
      $user->{$k} = $i;
    }    
    

    WordPress 4.0 user and user meta object cache is no longer compatible with bbPress 1.x. The above it a little bridge which makes sure the required user meta values are present and bbPress user capability checks can function. Without the above fix, bbPress admin backend (bb-admin) won’t work.

  3. If the above step doesn’t help with broken access into bb-admin and you use s2Member, review your user user_meta and make sure bb_capabilities has value of a:1:{s:9:"keymaster";b:1;}. s2Member bbPress bridge demotes the admin users to regular users if the required user meta value is not found.

So if you are having trouble with bbPress 1 integration, no need for any rushed migrations to bbPress 2, BuddyPress, vBulletin, Vanilla or anything else. Just keep enjoy the simple life.

Martin Vicenik

Martin Viceník

Martin graduated as an engineer in Computer Science from Slovak Technical University in Bratislava. He grew up in Liptovský Mikuláš in northern Slovakia next to the beautiful Tatra mountains. He is the developer behind our FV Player.

Categories: WordPress

Related Posts

  1. Forums for WordPress sites: bbPress

    Forums for WordPress sites: bbPress

  2. How to convert bbPress 1 forums to bbPress 2

  3. WordPress user and page management glitch

    WordPress user and page management glitch

Reader Interactions

Comments

  1. Martin 6 September 2014 at 12:21 am

    Hi!

    The first step (return wp_validate_auth_cookie( $cookie, $scheme );) wowking fine. Without having done this I was not able to visit bbpress part of my website at all.

    But anyway, after implementation of the step above I am able to access the bbpress but I am not able to access the admin area of the bbpress.

    Where exactly should the described replacement (bb_get_current_user() with wp_get_current_user().) take place?

    Thanks a lot!

    Reply
  2. Stephen Edgar 7 September 2014 at 4:11 am

    Thanks for this, I added a topic on bbPress.org and in our Codex docs linking back here :)

    bbpress.org/forums/topic/bbpress-1-x-stand-alone-integration-and-wordpress-4-0/

    codex.bbpress.org/legacy/integrating-with-wordpress/

    Reply
  3. Martin 8 September 2014 at 2:01 pm

    Hello Martin and Stephen,

    thank you for your feedback!

    I updated the article with instructions about how to fix the broken bbPress admin section (bb-admin), as there is a problem in how Wordpress 4.0 caches the user meta in object cache – bbPress can’t read it anymore.

    We tried to also disable the object cache, but then we got hundreds of SQL queries on every page.

    Thanks, Martin

    Reply
  4. Sat 8 September 2014 at 3:29 pm

    Hi, where should i exactly place

    return wp_validate_auth_cookie( $cookie, $scheme );

    Is it not possible to upload to 2 new files?

    Regards, Sat

    Reply
  5. Martin 9 September 2014 at 10:56 am

    Hello Sat,

    just look for the function called “validate_auth_cookie” and put it behind the opening curly bracket.

    You can download the fixed files here, but we only tested it on bbPress 1.0.3. So you need to backup your original files in case you have a different version and you want to check if our fixed files work for you: foliovision.com/downloads/bbpress-1-0-3-wordpress-4-0-fix.zip

    Thanks, Martin

    Reply
  6. Sat 9 September 2014 at 5:00 pm

    Martin thanks for your reply.

    I have bbPress 1.1-alpha-2539. I tried to replace the files but i got an internal server error,

    Thanks, Sat

    Reply
  7. Avatar photoAlec 11 September 2014 at 1:40 pm

    Hi Sat,

    Sorry to hear about your issues.

    We’d be happy to investigate your site personally as a pro support incident.

    Cordial regards,

    Alec

    Reply
  8. Chris 11 September 2014 at 2:46 pm

    Hi

    I get this error upon changing the files, bbPress 1.2

    Warning: Invalid argument supplied for foreach() in /home/xxxxx/public_html/f/bb-includes/backpress/class.wp-users.php on line 279

    Warning: array_map(): Argument #2 should be an array in /home/xxxxx/public_html/f/bb-includes/backpress/class.wp-users.php on line 284

    Warning: Invalid argument supplied for foreach() in /home/xxxxx/public_html/f/bb-includes/backpress/class.wp-users.php on line 285

    Reply
  9. Avatar photoAlec 12 September 2014 at 7:50 pm

    Hi Chris,

    Thanks for the info.

    We aren’t running v. 1.2. If you come up with solution please let us know so we can help other bbPress 1.2 users update.

    Thanks!

    Reply
  10. Fridayana Baabullah 19 September 2014 at 8:29 pm

    Hi Martin

    this code return wp_validate_auth_cookie( $cookie, $scheme ); do multiple loop until the page down.

    Any ideas?

    Thanks

    Reply
  11. sim 1 October 2014 at 9:16 pm

    I got server error too, when i replaced the files.

    Reply
  12. Martin 2 October 2014 at 6:29 pm

    Hello Fridayana and Sim,

    what bbPress versions are you using? What do you see in the PHP error log? What error are you getting? Is it a “soft” error, or do you get HTTP Error 502?

    Our fix appears to work for version 1.0.3 only.

    We can’t really fix this without installing your website and having a look. As Alec noted above, we can have a look at the issue at your site if you purchase a pro support incident.

    Thanks, Martin

    Reply
  13. sim 6 October 2014 at 11:30 am

    Hi Martin,

    The error is 500 – internal server error. I have also version 1.0.3

    I don’t find this code WP_Auth::validate_auth_cookie() in bb-includes/backpress/class.wp-auth.php

    Reply
  14. Martin 6 October 2014 at 6:44 pm

    Hello Sim,

    WP_Auth::validate_auth_cookie() is the name of the class together with the name of the function.

    Just look for:

    function validate_auth_cookie( … ) {

    And add it right after the opening {. I updated the article as well.

    Thanks, Martin

    Reply
  15. Sim 7 October 2014 at 5:56 pm

    Hi Martin,

    I did this (previously i replaced files with one you posted here) and still there is 500 server error.

    Thanks for keeping posting.

    Reply
  16. Martin 8 October 2014 at 9:52 am

    Hello Sim,

    what about the PHP error log? You should be able to find it as a error_log file in the forum directory, or it might be in logs or directory of your site folder or your web server, depending on what setup you use.

    Thanks, Martin

    Reply
  17. sim 8 October 2014 at 6:15 pm

    Hi Martin,

    I don’t find any error log. When I add the code to class.wp-auth.php i get the 500 server error code and it shows hostgator website (since I host website there)

    Reply
  18. Martin 8 October 2014 at 6:18 pm

    Hello Sim,

    you could try to contact your server support to help you with locating the PHP error log.

    Thanks, Martin

    Reply
  19. JH 8 October 2014 at 10:30 pm

    Hmmm, I have BBPress version 1.0.2 and just after adding: return wp_validate_auth_cookie( $cookie, $scheme );

    in file: bb-includes/backpress/class.wp-auth.php

    at line: 144

    (as a first line of validate_auth_cookie function)

    I am getting: [error] [client 127.0.0.1] PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 130968 bytes) in /path/to/bbpress/bb-includes/backpress/class.bp-log.php

    I am investigating, but maybe you have already had that issue…

    Reply
  20. JH 9 October 2014 at 12:16 am

    There is something wrong. If I turn off logging, I get memory problems elsewhere. Those guys are also reporting similar/memory problem: wpml.org/forums/topic/fatal-error-allowed-memory-size-in-wpml-config-class-php/ wordpress.org/support/topic/pro-fatal-error-after-todays-update after upgrade…

    My abouts: PHP Version 5.4.4-14+deb7u12 memory_limit 512M

    I cant belive the solution is to go over 512M…

    Any idea???

    Reply
  21. JH 9 October 2014 at 2:06 pm

    I am not sure I do understand BBPress correctly, but it seems like calling wp will call bb just with logging a call to deprecated code. In our case global function wp_validate_auth_cookie calls global function bb_validate_auth_cookie, which then basically calls a method on the object $wp_auth_object->validate_auth_cookie that we just changed.

    This looks like a loop.

    @Martin: can you please explain more? Do I understand it correctly?

    Reply
  22. Martin 9 October 2014 at 4:07 pm

    Hello JH,

    thank you for your thoughts! The links about memory issues don’t appear to be related though.

    This could indeed by some php loop. Your assumptions about bb and wp functions are correct, but let’s stop here – notice that wp_validate_auth_cookie() only calls bb_validate_auth_cookie() if it’s not previously defined. And it should be defined from Wordpress already. Perhaps your integration with Wordpress works differently.

    Could you please check where do you include Your Wordpress’ wp-load.php in your bbPress install? We have it in bb-config.php, so it loads before bbPress and wp_validate_auth_cookie() is then defined.

    Thanks, Martin

    Reply
  23. JH 9 October 2014 at 5:14 pm

    Well, my installation doesnt share/(re)include any file(s) between wp and bb. Are you including something from wp? Or define it before BBPress standard does it?

    Lets find wp/bb function definitions or calls (in the BBPress directory): [code] grep -rin “_validate_auth_cookie” [/code]

    Result: [code] bb-includes/backpress/class.wp-auth.php:107: * @uses wp_validate_auth_cookie() Retrieves current logged in user. bb-includes/backpress/class.wp-auth.php:147:// return wp_validate_auth_cookie( $cookie, $scheme ); bb-includes/functions.bb-deprecated.php:838:if ( !function_exists( ‘wp_validate_auth_cookie’ ) ) : // Deprecated in bbPress not WordPress bb-includes/functions.bb-deprecated.php:839:function wp_validate_auth_cookie( $cookie = ”, $scheme = ‘auth’ ) { bb-includes/functions.bb-deprecated.php:840: bb_log_deprecated( ‘function’, FUNCTION, ‘bb_validate_auth_cookie’ ); bb-includes/functions.bb-deprecated.php:841: return bb_validate_auth_cookie( $cookie, $scheme ); bb-includes/functions.bb-pluggable.php:5: if ( !bb_validate_auth_cookie( ”, $scheme ) ) { bb-includes/functions.bb-pluggable.php:141:if ( !function_exists( ‘bb_validate_auth_cookie’ ) ) : bb-includes/functions.bb-pluggable.php:142:function bb_validate_auth_cookie( $cookie = ”, $scheme = ‘auth’ ) { [/code]

    2nd line in that output is commented out -> thats change suggested on this page (line numbers below might be shifted).

    It is a standard integration with shared cookies (BBPPress on subdomain) with user database sharing, nothing really fency/custom.

    Anyway, it means that you have this function defined elsewhere. Can you check your installation and paste your code in here?

    I do not have any PATH / DIR constants defined to the Wordpress directory, I also checked if anything is hardcoded – nothing like that. So BBPress has no way to include anything from Wordpress.

    Martin, can you explain your solution? What is its background, how did you came to it? Maybe I am missing something less or more obvious?

    Function definitions (conditional as you already noticed) are – as listed above – here: [code] bb-includes/functions.bb-deprecated.php:839 bb-includes/functions.bb-pluggable.php:142 [/code]

    I do not see any other place where those functions are defined.

    PS. I wish there was a way to use codes like [img] or [code] (I do not see the toolbar, so I suspect it is not possible)

    Reply
  24. JH 9 October 2014 at 5:18 pm

    Cant edit comment, sorry for spam :) I didnt see the part where you say you include wp-load… Woow, thats a big change… Did you do it becouse of WP4.0, or any other reason?

    Reply
  25. Martin 9 October 2014 at 5:20 pm

    Hello JH,

    our bb-config.php includes wp-load.php of our Wordpress to enable integration – mainly single-login and main menu.

    If your bbPress doesn’t work this way, then I’m not sure why your are having any issues after upgrade to Wordpress 4.0. Are you sure you have this problem and it’s not something else?

    Oh, I see, you use the same cookies and Wordpress changed the format of these cookies. We load Wordpress in bbPress, so we are able to use its core functions. If you don’t load Wordpress, then you can’t use it’s functions (which work with the new cookie data) and our solution won’t work for you.

    You can try including wp-load.php. It only caused issues for us when we used “WordPress HTTPS (SSL)” plugin (now the plugin is outdated).

    Thanks, Martin

    Reply
  26. Sim 9 October 2014 at 7:11 pm

    Hi Martin,

    I don’t have included wp-load.php in your bbPress install. How to add it to bb-config.php?

    Thanks

    Reply
  27. Martin 10 October 2014 at 11:44 am

    Hello Sim,

    let’s assume that your Wordpress is in /home/your-account/public_html (so you can see wp-load.php in there) and your bbPress is in /home/your-account/public_html/forum.

    In that case, put following at the start of /home/your-account/public_html/forum/bb-config.php (after the opening <?php tag):

    require_once(dirname(FILE) . ‘/../wp-load.php’); // make sure you convert the quotes to normal non-UTF-8 quotes!

    Hopefully that will resolve the issue. I suggest you test your forum functionality carefully after doing this (logged in as admin, logged in as normal user, not logged in, also bb-admin section as admin).

    Thanks, Martin

    Reply
  28. Sim 11 October 2014 at 9:34 am

    Hi Martin,

    I added this line require_once(dirname(FILE) . ‘/../wp-load.php’); in bb-config.php, and I got a blank page in forum. Maybe should I include any other code in the wp-load.php

    Thanks for posting.

    Reply
  29. Martin 13 October 2014 at 11:00 am

    Hello Sim,

    make sure you change the ‘ and ’ to regular quotes and it should work. Otherwise look into PHP error log.

    Wordpress automatically changes normal quotes to fancy UTF-8 quotes in comments, and I forgot about that, so you probably copied damaged code, sorry about that.

    Thanks, Martin

    Reply
  30. Sim 13 October 2014 at 5:54 pm

    Hi Martin,

    I already take care about the ‘ and ‘, but still same error, blank page. Here the error log

    PHP Fatal error: Call to a member function get() on a non-object in /home1/name/public_html/wp-includes/cache.php on line 113

    Reply
  31. Martin 13 October 2014 at 6:24 pm

    Hello Sim,

    I think we got similar issue when using the WP HTTPS plugin (see above: foliovision.com/2014/09/wordpress-original-bbpress#comment-4895651 )

    Solving this is not easy, you can start by trying to disable your plugins one by one. Or you can rename the plugins folder in your wp-content for a minute just to see if it helps if you are experienced. However don’t visit your wp-admin plugins section in this time, otherwise the plugins will all deactivate.

    Thanks, Martin

    Reply
  32. Sim 15 October 2014 at 7:48 pm

    Hi Martin,

    Thanks for keep posting. I don’t know, but still it was impossible for me to have wp site and bbpress connected. Previously I cookies worked well, so users who are logged in wp can be automatically logged in bbpress.

    Anyway, thank you.

    Reply
  33. Jack 30 June 2015 at 1:10 pm

    This worked perfectly for me… thank you for this!

    Reply
  34. Paul Newman 30 June 2015 at 2:16 pm

    Works well, except i can no longer post any new topics, the post form is no longer visible. post_form() only prints out the form header, nothing else. Please help.

    Reply
  35. Avatar photoAlec 1 July 2015 at 4:24 am

    Hi Paul,

    You may need a more experienced developer at this point, not a coach. Try the same technique on a clean install and see if it works for you, as it has for others.

    Hi Everyone,

    We’re preparing to migrate to bbPress 2 (we’re finally giving in) as there’s some nice plugins available for bbPress 2 which will replace our custom moderation code with a bit of tweaking.

    Reply
  36. Amir Mohammadi 16 January 2017 at 10:29 pm

    I know bbPress 1.2 or 1.1 is now antique and old but can you say why it is showing an Internal Server Error 500 to me when I try to install it?

    Reply
  37. Martin 17 January 2017 at 9:43 am

    Hello Amir,

    you should be checking your PHP error logs. Look into your public_html folder, into the bbPress folder or into and the folder where the web server accesss logs are stored.

    Thanks, Martin

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

You can click here to Subscribe without commenting

Primary Sidebar

Categories

  • Business
  • Camera Reviews
  • Case Studies
  • Design
  • FV Player
  • Internet Marketing
  • IT
  • Life
  • SEO
  • Slovak
  • Video of the Week
  • WordPress

Footer

Our Plugins

  • FV WordPress Flowplayer
  • FV Thoughtful Comments
  • FV Simpler SEO
  • FV Antispam
  • FV Gravatar Cache
  • FV Testimonials

Free Tools

  • Pandoc Online
  • Article spinner
  • WordPress Password Finder
  • Delete LinkedIn Account
  • Responsive Design Calculator
Foliovision logo
All materials © 2025 Foliovision s.r.o. | Panská 12 - 81101 Bratislava - Slovakia | info@foliovision.com
  • This Site Uses Cookies
  • Privacy Policy
  • Terms of Service
  • Site Map
  • Contact
  • Tel. ‭+421 2/5292 0086‬

We are using cookies to give you the best experience on our website.

You can find out more about which cookies we are using or switch them off in .

Powered by  GDPR Cookie Compliance
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

Necessary Cookies

Strictly Necessary Cookie allow you to log in and download your software or post to forums.

We use the WordPress login cookie and the session cookie.

If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.

Support Cookies

Foliovision.com uses self-hosted Rocket.chat and self-hosted Freescout support desk to provide support for FV Player users. These cookies allow our visitors to chat with us and/or submit support tickets.

We are delighted to recommend self-hosted Rocket.chat and especially Freescout to other privacy-conscious independent publishers who would prefer to self-host support.

Please enable Strictly Necessary Cookies first so that we can save your preferences!

3rd Party Cookies

This website uses Google Analytics and Statcounter to collect anonymous information such as the number of visitors to the site, and the most popular pages.

Keeping this cookie enabled helps us to improve our website.

We reluctantly use Google Analytics as it helps us to test FV Player against popular Google Analytics features. Feel free to turn off these cookies if they make you feel uncomfortable.

Statcounter is an independent Irish stats service which we have been using since the beginning of recorded time, sixteen years ago.

Please enable Strictly Necessary Cookies first so that we can save your preferences!