Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter webhost2

    (@webhost2)

    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.

    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.

    Thread Starter webhost2

    (@webhost2)

    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?

    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.

    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.

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

    See here

    And here

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘WPMUBar not showing sites list’ is closed to new replies.