WordPress.org

Ready to get started?Download WordPress

Forums

WPMUBar
WPMUBar not showing sites list (8 posts)

  1. webhost2
    Member
    Posted 1 year ago #

    Hi buddies,

    I have installed WPMUBar plugin v1.1 in my multisite(subdirectory) and network activated it. I have around 25 sites in the multisite. But when I go to the settings tab of WPMUBar i don't see the sites listed there under sites list and is empty. Do I need to make any changes for the wpmubar to grab and show the sites?
    screenshot here

    http://wordpress.org/extend/plugins/wpmubar/

  2. webhost2
    Member
    Posted 1 year ago #

    I sent 2 mails to the support prior to posting here. No replies from them yet. I thought of getting support here from peers but i guess either I am the only one who bought this plugin or I am the only one who is facing this issue and doesn't know how to fix it.

  3. voopress
    Member
    Posted 1 year ago #

    I too purchased this and can't reach them. They mention forums but I've yet to find them so have been trying to contact them.

    As for your question, I'm assuming you added the sites which already existed after you installed this? Go to it's config and make sure they are added.

  4. webhost2
    Member
    Posted 1 year ago #

    Problem is sites are not showing up in the wpmubar config. I tried creating new sites, but neither the old nor the new sites are showing up in the config for me to add. Please check the screenshot in my first post. Are you facing the same issue by any chance? or sites are showing up for you under the sites list?

  5. voopress
    Member
    Posted 1 year ago #

    As I mentioned, I'm not having this problem.

    All I can think of is make sure that you have installed the plugin as a network since you are running network. It should show up in the network menu. If not, I don't really know much else about it yet.

    I too have been trying to get help for some basic anomalies.

  6. essemme-fe
    Member
    Posted 1 year ago #

    Same here.

    I made a quick and dirty patch, here it is (works for me).
    Edit the file /wp-content/plugins/wpmubar/wpmubar.php, look for the function wp_list_sites (around line 85 in version 1.1 pro) and replace it with the following:

    function wp_list_sites($expires = 7200)
    	{
    
    		if (!is_multisite()) return false;
    		// Because the get_blog_list() function is currently flagged as deprecated
    		// due to the potential for high consumption of resources, we'll use
    		// $wpdb to roll out our own SQL query instead. Because the query can be
    		// memory-intensive, we'll store the results using the Transients API
    		if (false === ($site_list = get_transient('multisite_site_list'))) {
    			global $wpdb;
    			$site_list =  get_blog_list(); //$wpdb->get_results($wpdb->prepare('SELECT * FROM wp_blogs ORDER BY blog_id'));
    
    			// Set the Transient cache to expire every two hours
    			set_site_transient('multisite_site_list', $site_list, $expires);
    		}
    
    		$current_site_url = get_site_url(get_current_blog_id());
    		foreach ($site_list as $site) {
    			switch_to_blog($site['blog_id']);
    			$class = (home_url() == $current_site_url) ? ' class="current-site-item"' : '';
    			$html[] = array("blog_id" => $site['blog_id'], "domain" => home_url(), "path" => "");
    			restore_current_blog();
    		}
    
    		return $html;
    	}

    I just used the deprecated get_blog_list() function
    (WARNING: it is very resource intensive if you have a lot of sites), for some reason the plain query through $wpdb is returning an empty set.

    Then replace the occurrences of $site->blog_id with $site['blog_id'], as it is an array now (not an object)

    Caveat: as I said, it is a quick and dirty hack to make it work. Should be considered a temporary solution, being based on a deprecated function - a potential bottleneck for your multisite.

  7. essemme-fe
    Member
    Posted 1 year ago #

    Even better: instead of get_blog_list() use the suggested new function - wp_get_sites().

    See here

    And here

  8. voopress
    Member
    Posted 1 year ago #

    Thanks very much for sharing. I moved on to Snippets instead of this since the author is not maintaining it.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic