bbpress, user roles and redirect broken after multisite install

After moving to multisite a myriad of issues has arisen from out of the blue.
I'll mention some others before moving into the error I keep receiving from bbpress.

To begin with, when first changing my website into a network I'd forgotten to turn off the theme. This led to database inconsistencies and upon using repair I'd found what WP was looking for the DB files to be named and then renamed them. After this I was able to login to my admin side again. Unfortunately impossible redirects that I don't comprehend had begun. I can access the dashboard but I can not view the front end whatsoever. The redirect for some reason tries to make me visit
http://www.example.com/wp-signup.php?new=example.com

Here is my .htacces

SetEnv MAGICK_THREAD_LIMIT 1
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

# BEGIN WP-HUMMINGBIRD-GZIP

# END WP-HUMMINGBIRD-GZIP
# BEGIN WP-HUMMINGBIRD-CACHING

# END WP-HUMMINGBIRD-CACHING

here is what is in my wpconfig file above the stop editing line.

define('WP_DEBUG', false);
define( 'WP_ALLOW_MULTISITE', true );
define('SUBDOMAIN_INSTALL', true);
define('DOMAIN_CURRENT_SITE', 'www.example.com');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

Now here is my problem with bbpress specifically.
These two errors are showing up about a dozen times above any and all dashboard items which push the dashboard content down underneath it.

Warning: array_keys() expects parameter 1 to be array, boolean given in /home/michael/public_html/wp-content/plugins/bbpress/includes/core/capabilities.php on line 442

Warning: Invalid argument supplied for foreach() in /home/michael/public_html/wp-content/plugins/bbpress/includes/core/capabilities.php on line 442

Here is the section pertaining to line 442

function bbp_filter_blog_editable_roles( $all_roles = array() ) {

// Loop through bbPress roles
foreach ( array_keys( bbp_get_dynamic_roles() ) as $bbp_role ) {

// Loop through WordPress roles
foreach ( array_keys( $all_roles ) as $wp_role ) {

// If keys match, unset
if ( $wp_role === $bbp_role ) {
unset( $all_roles[$wp_role] );
}
}
}

return $all_roles;
}

line 442 reads
foreach ( array_keys( $all_roles ) as $wp_role ) {

I have been searching for solutions for days.
I can not find a publicly available solution for any of these issues and have tried and failed utilizing many different probable solutions.

Thank you for your time

  • Predrag Dubajic

    Hey Michael,

    Hope you're doing well today :slight_smile:

    First thing I would suggest is making a backup of your current .htaccess file and completely replace the content of file with default rules:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
    RewriteRule ^(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]

    Second, try removing WWW from:
    define('DOMAIN_CURRENT_SITE', 'www.example.com');
    Using www in subdomain installation is not recommended as it can cause more troubles than it's worth.

    As for the warnings, I would suggest switching to logging debug on your server instead of showing it on site directly.
    You can do this by replacing define('WP_DEBUG', false); in w-config.php with this code:

    // Enable WP_DEBUG mode
    define('WP_DEBUG', true);
    
    // Enable Debug logging to the /wp-content/debug.log file
    define('WP_DEBUG_LOG', true);
    
    // Disable display of errors and warnings
    define('WP_DEBUG_DISPLAY', false);
    @ini_set( 'display_errors', 0 );

    This will create debug.log file in your wp-content folder that will log your errors instead of showing it on site.

    Those errors look related to user capabilities on your site so if you have any plugins that do change capabilities try turning them off to see if the errors are still there after that.

    Best regards,
    Predrag

  • Michael Rodriguez

    Suddenly I'm completely locked out of network access on dashboard.
    The redirect to admin login has not yet ceased.
    The errors in the log which are new are as follows.

    [10-May-2016 12:53:31 UTC] PHP Strict Standards: Redefining already defined constructor for class Wdsi_Options in /home/michael/public_html/wp-content/plugins/slide-in/lib/class_wdsi_options.php on line 9

    [10-May-2016 12:53:31 UTC] PHP Notice: Trying to get property of non-object in /home/michael/public_html/wp-content/plugins/e-newsletter/email-newsletter-files/builder/class.builder.php on line 368

    [10-May-2016 12:53:31 UTC] PHP Notice: bbp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 2.3.) in /home/michael/public_html/wp-includes/functions.php on line 3897

    [10-May-2016 12:53:31 UTC] PHP Notice: bp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 1.7.) in /home/michael/public_html/wp-includes/functions.php on line 3897

  • Predrag Dubajic

    Hi Michael,

    If the issue with network access is happening after removing WWW make sure you update your database to replace www links with non www ones, this SQL query should come in handy for that just make sure to use correct domain name:

    UPDATE wp_options SET option_value = replace(option_value, 'http://www.example.com', 'http://example.com ') WHERE option_name = 'home' OR option_name = 'siteurl';
    
    UPDATE wp_posts SET guid = replace(guid, 'http://www.example.com','http://example.com ');
    
    UPDATE wp_posts SET post_content = replace(post_content, 'http://www.example.com', 'http://example.com ');
    
    UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.example.com','http://example.com ');

    Make sure to change the URL inside WP settings as well.

    And remember to have full site backup before doing these changes.

    About the debug, those are only notices and couldn't cause such issues on your site.

    Best regards,
    Predrag

  • Predrag Dubajic

    Hi Michael,

    Should I also use this sql query for the subdomains?

    Yes, you should try running it through subsites as well.

    About changing DB names, I'm not sure about this part, those 10 tables were missing or just didn't have wp_1_ prefix?
    Main site uses standard names like wp_posts, wp_options etc, while subsites have subsite ID in it and look like this wp_2_posts, wp_2_options so I don't see why it would ask to add ID for main site tables.

    Best regards,
    Predrag

  • Michael Rodriguez

    The ten tables did not have wp_1_prefix and so I'd thought it meant that something had gone wrong and began renaming tables with names like wp_cpm_users to wp_1_cpm_users. Simply because the database repair for wp said that wp_1_ was a missing name for those ten tables and I'd seen wp_ were available. For some reason I changed them 1 by 1 and did repair in between and wp db did not mention to me that it had begun to miss wp_ tables but instead that wp_1_ tables that were missing from the list were instead found.

  • Michael Rodriguez

    I can't access the Network Admin panel to ensure the site address is correct in wp.

    When trying to visit the front end of the main site an impossible redirect is caused which causes the url to redirect to
    https://www.example.com/www.example.com/www.example.com/www.example.com
    over and over until it stops

    When trying to visit the back end of the Network Admin panel I'm pointed to another impossible redirect but for some reason to the url
    https://example.com/wp-signup.php?new=example.com

    When trying to visit any of the subdomains whether on the front or back end I receive the message that the security settings are installed improperly.

    Now I'm again entirely locked out of any admin access whatsoever.

    How am I supposed to solve this problem on the back end?
    What php files may need editing?
    I've received the following error logs and some of them make me feel as if I should be removing plugins from the server side and deleting associated db tables until later when I can finally access the dashboard again. Some of them also seem as if they are suggesting a required database table is missing entirely.

    [01-May-2016 14:57:18 UTC] PHP Fatal error: Call to a member function is_main_query() on a non-object in /home/michael/public_html/wp-content/plugins/events-and-bookings/lib/default_filters.php on line 122

    [01-May-2016 15:06:06 UTC] WordPress database error Table 'michael_wp1.wp_user_activity' doesn't exist for query SELECT COUNT(*) FROM wp_user_activity WHERE user_ID = '1' made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/evolve-plus/index.php'), get_footer, locate_template, load_template, require_once('/themes/evolve-plus/footer.php'), wp_footer, do_action('wp_footer'), call_user_func_array, User_Activity->global_db_sync

    [01-May-2016 15:06:06 UTC] WordPress database error Table 'michael_wp1.wp_user_activity' doesn't exist for query UPDATE wp_user_activity SET last_active = '1462115166' WHERE user_ID = '1' made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/evolve-plus/index.php'), get_footer, locate_template, load_template, require_once('/themes/evolve-plus/footer.php'), wp_footer, do_action('wp_footer'), call_user_func_array, User_Activity->global_db_sync

    [01-May-2016 15:06:06 UTC] WordPress database error Table 'michael_wp1.wp_user_activity_log' doesn't exist for query INSERT INTO wp_user_activity_log (user_ID, visit_date) VALUES (1, 1462115166) made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/evolve-plus/index.php'), get_footer, locate_template, load_template, require_once('/themes/evolve-plus/footer.php'), wp_footer, do_action('wp_footer'), call_user_func_array, User_Activity->global_db_sync

    [01-May-2016 17:55:06 UTC] PHP Warning: array_key_exists(): The first argument should be either a string or an integer in /home/michael/public_html/wp-content/plugins/coursepress/includes/classes/class.course.php on line 374

    [01-May-2016 17:55:06 UTC] PHP Warning: array_keys() expects parameter 1 to be array, boolean given in /home/michael/public_html/wp-content/plugins/coursepress/includes/classes/class.instructor.php on line 33

    [01-May-2016 17:55:06 UTC] PHP Warning: array_filter() expects parameter 1 to be array, null given in /home/michael/public_html/wp-content/plugins/coursepress/includes/classes/class.instructor.php on line 33

    [01-May-2016 17:55:06 UTC] PHP Warning: Invalid argument supplied for foreach() in /home/michael/public_html/wp-content/plugins/coursepress/includes/classes/class.instructor.php on line 53

    [01-May-2016 17:55:08 UTC] PHP Warning: array_key_exists(): The first argument should be either a string or an integer in /home/michael/public_html/wp-content/plugins/coursepress/includes/classes/class.course.php on line 374

    [02-May-2016 07:14:48 UTC] PHP Warning: array_key_exists(): The first argument should be either a string or an integer in /home/michael/public_html/wp-content/plugins/coursepress/includes/classes/class.course.php on line 374

    [02-May-2016 07:14:48 UTC] PHP Warning: array_keys() expects parameter 1 to be array, boolean given in /home/michael/public_html/wp-content/plugins/coursepress/includes/classes/class.instructor.php on line 33

    [02-May-2016 07:14:48 UTC] PHP Warning: array_filter() expects parameter 1 to be array, null given in /home/michael/public_html/wp-content/plugins/coursepress/includes/classes/class.instructor.php on line 33

    [02-May-2016 07:14:48 UTC] PHP Warning: Invalid argument supplied for foreach() in /home/michael/public_html/wp-content/plugins/coursepress/includes/classes/class.instructor.php on line 53

    [02-May-2016 07:14:52 UTC] PHP Warning: array_key_exists(): The first argument should be either a string or an integer in /home/michael/public_html/wp-content/plugins/coursepress/includes/classes/class.course.php on line 374

    [02-May-2016 08:52:35 UTC] PHP Warning: Invalid argument supplied for foreach() in /home/michael/public_html/wp-content/plugins/wp-defender/app/module/hardener-module/component/class-wd-plugin-theme-version.php on line 90

    [06-May-2016 04:29:03 UTC] WordPress database error Lost connection to MySQL server during query for query SELECT option_value FROM wp_options WHERE option_name = 'functionality_plugin_activated' LIMIT 1 made by require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call_user_func_array, create_functionality_plugin, get_option, W3_Db->query, W3_DbCache->query, W3_DbCallUnderlying->query, W3_Db->query, W3_DbProcessor->query, W3_Db->default_query

    I don't have any explanation for why these brand new errors would arise for I've not been able to make any changes since I last stated that I'd made some in this forum.

  • Michael Rodriguez

    I'll log my changes and results here.

    In database tables changed the following
    in wp_sitemeta changed site url to https://example.com
    no change

    in wp_site changed url to https://example.com
    no change

    discovered an interesting problem in wp_1_minification_chart
    every single file is linked to site url http://www.example.com/wp-signup.php?new=example.com
    essentially breaking the entire theme
    I'm contemplating deleting the table but I'm nervous.

  • Michael Rodriguez

    I've deleted a lot of apps and useless app database information on the server end.

    In the database tables I've changed the url of every location to https://www.example.com
    The source of all the files had been https://www.example.com anyway and using https://example.com had not fixed the theme either.

    An error was caused by membership2pro in a database table, column was deleted.
    Access to the front end, back end and network access has been granted.
    No longer redirects to /wp-signup.php?new=example.com

    Impossible redirect is fixed but the url is not, visiting the url https://example.com forces a working redirect to https://example.com/www.example.com/www.example.com/www.example.com which is clearly a page that can not be found.

    Front side theme clearly broken.
    Deleting and reinstalling theme did not fix the theme.
    Deactivated all WPMU plugins. Theme working in perfect condition.
    Deleting and reinstalling all WPMU plugins.
    Also deleting and reinstalling W3 Total Cache.
    Deleted every column in db wp_1_minification_chart

  • Michael Rodriguez

    On the server side found that Apache 5.5 was running.
    Bumped it up to Apache 5.6 and selected all types.
    Impossible redirect problem is solved.

    All WP media files, pages and posts I've uploaded are corrupted and/or broken after this debacle. In the database they are all http:// and I'm unsure if that is causing a problem. I've read in another forum that any url with capitalized letters will be broken by the new wordpress, this is definitely a big case with my images.

    We will call this problem solved and if I have another issue then I will open a separate ticket.
    Looks like a lot was learned in this thread, thank you for all of your assistance Predrag.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.