WordPress.org

Ready to get started?Download WordPress

Forums

You have 0 sites and 0 users. (24 posts)

  1. ResQTek
    Member
    Posted 3 years ago #

    I installed the Multisite version on my web server.
    I have two sites that I can successfully administer.
    The Network Dashboard reads: You have 0 sites and 0 users.
    But when I click on Sites, the two sites are there.

    I am expecting to see: You have 2 sites and 1 user.

    All functions see to work properly, but zeroes are confusing me.

    Any ideas?

    Thank you...

  2. you and your main site are not counted.

  3. ResQTek
    Member
    Posted 3 years ago #

    I have the main site, yes, and myself as the user.
    I created a second site, and I am the user for that, too.

    Is that the problem? Maybe If I had a different user on the 2nd site?

    With what you said, I would still expect to see: You have 1 site and 1 user.

    Thanks for the reply, by the way.

  4. Yes, you are the only user.

  5. ResQTek
    Member
    Posted 3 years ago #

    Ah ok, thank you. :)

  6. ResQTek
    Member
    Posted 3 years ago #

    Okay, so I created another user for site #2.

    The Network Dashboard still reads: You have 0 sites and 0 users.

    I looked at my separate WPMU 2.9.1 installation, and despite that I am the only user on seven sites, it says: You have 7 blogs and 1 user.

    Any ideas?

    tia

  7. disable plguins.

  8. ResQTek
    Member
    Posted 3 years ago #

    I have no plugins yet.

  9. Nothing in mu-plugins? This is a totally fresh, nothing, install?

  10. ResQTek
    Member
    Posted 3 years ago #

    I installed the network version of WP 3.1 just the other day. It's clean except for some settings that I changed.

    My completely separate installation of WPMU 2.9.1 counts the sites and users accurately. That one has lots of plug-ins and things going on.

  11. I installed the network version of WP 3.1 just the other day.

    Dumb question... You mean you installed WordPress and activated MultiSite, or ... something else?

  12. ResQTek
    Member
    Posted 3 years ago #

    I installed WP 3.1 and activated Multisite.

  13. It's clean except for some settings that I changed.

    and those would be?

  14. Kaktus
    Member
    Posted 3 years ago #

    I have added 2 users and 2 blogs, but my network count is also saying I have 0 sites and 0 users.
    I haven't installed any plugins either.

  15. ResQTek
    Member
    Posted 3 years ago #

    I'm going to spit the SQL out to the screen to see what it's NOT counting...

  16. ResQTek
    Member
    Posted 3 years ago #

    Okay, rather than fight with SQL yet -- I noticed something in the DB:

    Three tables:
    > wp_site
    > wp_sitemeta
    > wp_blogs

    wp_blogs has two site records (primary/default site and the one I added)

    wp_site has one (primary/default site only)

    wp_meta has one (primary/default site only)

    The SQL for the dashboard count appears to be querying the wp_sitemeta table and therefore returns zeroes. That is assuming it is supposed to ignore the primary/default site.

  17. Tim Moore
    Moderator
    Posted 3 years ago #

    The code I see in my 3.1 install that counts users/blogs is:

    $c_users = $wpdb->get_var("SELECT COUNT(id) FROM {$wpdb->users}");
    $c_blogs = $wpdb->get_var("SELECT COUNT(blog_id) FROM {$wpdb->blogs}");

    This works perfectly fine on my system, though it is an upgraded 3.1 install and not a fresh install. I'd check that you don't have any plugins that are messing with this for some reason.

  18. ResQTek
    Member
    Posted 3 years ago #

    1. I don't have any plugins.
    2. This is not an upgraded installation.
    3. What function is that query in?
  19. Tim Moore
    Moderator
    Posted 3 years ago #

    That query is in the wpmu-admin.php file in the wp-admin directory. I've checked out the three MultiSite installs I run and they all work fine when counting blogs/users.

    Where are you seeing the query against wp_sitemeta?

  20. ResQTek
    Member
    Posted 3 years ago #

    functions.php get_site_option()

  21. wp_site has one (primary/default site only)

    wp_meta has one (primary/default site only)

    this is correct. In the db, anything referencing SITE refers to the network itself. Anythign referencing BLOGS should match up with the list under network admin -> sites.

    Where are you seeing the query against wp_sitemeta?

    up above, people are seeing this in network admin dashboard

  22. ResQTek
    Member
    Posted 3 years ago #

    dashboard.php
    function wp_network_dashboard_right_now()
    $c_blogs = get_blog_count();

    ms-functions.php
    function get_blog_count()
    return get_site_option( 'blog_count' );

    functions.php
    function get_site_option()
    $row = $wpdb->get_row( $wpdb->prepare("SELECT meta_value FROM $wpdb->sitemeta WHERE meta_key = %s AND site_id = %d", $option, $wpdb->siteid ) );

    That is the flow and it's looking in the sitemeta table which only has one site id and it's the default which is not being counted, therefore it returns zero.

  23. Tim Moore
    Moderator
    Posted 3 years ago #

    Okay, I see the flow you are talking about. However, the get_blog_count function says it is cached twice a day, so the count you see won't be live.

    Not sure what's going on. Probably need to investigate and find the function that does the twice daily update and make sure it isn't running up against any issues.

  24. ResQTek
    Member
    Posted 3 years ago #

    Except that I modified this line to prevent it from looking at cache (yesterday):

    function get_site_option( $option, $default = false, $use_cache = false )

Topic Closed

This topic has been closed to new replies.

About this Topic