• Resolved ks4el

    (@ks4el)


    Not sure how this happened, but using wp-optimize I can see that I have tables with 2 different prefixes (wp_ and wp_3_). My wp-config.php only has wp_ defined and I can’t find a wp_3_ defined anywhere when I grep. There are some things in each it seems. For example all cimy fields are in wp_3_ but the users are in wp_. There is no wp_3_users and the number of records in wp_users is correct for my site. I am using subdomain network and have 2 sites right now. I suspect that may be the cause of this but I’m no expert on the inner workings of wordpress’ db. I’m guessing that’s correct given that the plugin records for network activated plugins are in both prefixes and there are some plugins activated independently for each of the sites and those are in the respective prefixes. In this case I’m trying to use Dynamic User Directory for the site I created second in the network which appears to be the wp_3_. All the users though are stored as I mentioned in wp_users. When I turn on DUD debug it says I’m using wp_3_ which makes sense. Copied from the debug screen:

    Users Table Name: wp_3_users

    User Meta Table Name: wp_3_usermeta

    So that would explain why it always says “There are no users in the directory at this time.”

    Am I missing a setting to force this to the right prefix if my guesses about the problem are correct? Am I just off base?

    Happy to help with additional debug info and assistance as needed. Looks like a promising plugin if I can get it to work.

    Thanks!

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

    (@ks4el)

    Here is a bit of an update on my part. While no php developer, I am well versed in several other languages, so I tried a little hack. I went through and replaced the prefix variable with “wp_” everywhere and now I see the users, so my guess must’ve been correct. The problem though is to use CIMY user extra fields with DUD it’ll be confused since they are in 2 different prefixes. Users in wp_ and CIMY in wp_3_.

    I hope this helps. I’m surprised I’m the first one to find this, maybe I did something odd in the setup that triggered it.

    Thanks!

    Thread Starter ks4el

    (@ks4el)

    Looks like my hack didn’t affect the CIMY fields after all. Hopefully all this is helpful for a fix.

    Thanks!

    Thread Starter ks4el

    (@ks4el)

    One other thing, as expected, when I did that it now gives me all users regardless of whether they are a user on that particular site or not. It would certainly be best if it just gave users for the given site. Yes, users can be manually removed, but that doesn’t work well for multiple sites with lots of users.

    Thanks again!

    Plugin Author Sarah Giles

    (@sarah_dev)

    Hi ks4el,

    Thanks for reporting this problem. The Cimy table prefix is currently hard-coded. I will change this to pull the prefix from the config file as I do with the users and usermeta tables.

    That of course won’t solve your wp_ / wp_3_ problem. You first need to identify where the wp_3_ prefix is coming from. I’m guessing you have two separate WP installations? If so, do they both share one database or do they each have their own?

    Thanks,
    Sarah

    Thread Starter ks4el

    (@ks4el)

    Hi Sarah,

    Thought this made it via email but it didn’t go anywhere, sorry about that.

    Thanks for getting back. I have found that the different prefixes are indeed related to the different sub-domain sites. Looks like the overall network items and the first site I configured are wp_ and the subdomain only items are wp_3_

    So it depends on how I activated the plugin as to which prefix gets used. I don’t know enough of the internals to know if that’s normal or not but it’s what I ended up with just by following normal set up instructions from the WordPress.org docs.

    Please let me know if there is anything I can do to help debug on my end. Happy to help.

    Thanks,
    Steve

    Plugin Author Sarah Giles

    (@sarah_dev)

    Hi Steve,

    It’s difficult to assess your situation without getting a look at how your WP database is set up in relation to your subdomain site. Can you possibly email me a screen shot of the WP-Optimize results that list the tables? You can reach me at sarah@sgcustomwebsolutions.com.

    Thanks,
    Sarah

    Plugin Author Sarah Giles

    (@sarah_dev)

    As discussed in our email correspondence, I found that a multisite setup requires some additional code within the plugin to access the database properly.

    While my plugin does not currently support this ability, I plan to release an add-on in the near future that will enable multisite setups to use Dynamic User Directory.

    Best Regards,
    Sarah

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Reading wrong prefix wp_ vs wp_3_’ is closed to new replies.