Title: Integration between multiple sites
Last modified: August 21, 2016

---

# Integration between multiple sites

 *  Resolved [godavid33](https://wordpress.org/support/users/godavid33/)
 * (@godavid33)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/integration-between-multiple-sites/)
 * I need to set the plugin up so the same points system is used between two different
   wordpress installs. I plan on sharing a user database (which I still need to 
   figure out how to do). I know that there is a remote API, do I need to manually
   configure this on the remote site in order for it to add and deduct points or
   is there a way I can configure the remote plugin to automatically do all points
   functions on the primary site?
 * [https://wordpress.org/plugins/mycred/](https://wordpress.org/plugins/mycred/)

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

 *  Plugin Author [myCred](https://wordpress.org/support/users/designbymerovingi/)
 * (@designbymerovingi)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/integration-between-multiple-sites/#post-4611851)
 * Hey.
 * Thank you for your question.
    There are several ways to accomplish this and it
   all depends on how these two websites are connected.
 * If you have two separate websites on two different servers then the remove API
   would be the way to go. If on the other hand you are using a multisite or have
   two sites on the same server with their user and usermeta tables [shared](http://codex.wordpress.org/Editing_wp-config.php#Custom_User_and_Usermeta_Tables),
   then the [remote API](http://codex.mycred.me/classes/mycred_remote/) would be
   overkill.
 * When it comes to the Remote API, you should see it as a “car engine”. I provide
   you with the engine but it is up to you to design and built the car it will power.
   There are simply way to many features the API can offer for me to build something
   that will suit all myCRED users. There are a lot of things you need to take into
   consideration like what type of security you want since the [Remote API](http://codex.mycred.me/classes/mycred_remote/)
   would allow outsides to adjust / query your users point balances.
 * You are welcome to contact me directly via the [myCRED website](http://mycred.me/contact/)
   if you have any further queries or need assistance with the [Remote API](http://codex.mycred.me/classes/mycred_remote/).
 *  Thread Starter [godavid33](https://wordpress.org/support/users/godavid33/)
 * (@godavid33)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/integration-between-multiple-sites/#post-4611908)
 * Okay, so the remote API will probably be overkill in my case. Same server, going
   to be implementing a shared database. How would you suggest going about sharing
   the points system between both sites? Is there a way I can point the secondary
   install of MyCred to the primary MyCred databases (i.e. ideally just set the 
   prefix to look for)?
 *  Plugin Author [myCred](https://wordpress.org/support/users/designbymerovingi/)
 * (@designbymerovingi)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/integration-between-multiple-sites/#post-4611923)
 * If you are not going to use Multisite, then you would need to do the following:
 * 1. Have myCRED installed and setup on your “main site”.
    2. On your second website,
   before enabling myCRED, add the following to your wp-config.php file:
 * `define( 'MYCRED_LOG_TABLE', 'your_main_sites_mycred_log_table' );`
 * Replace the dummy text with your main sites log table name so if your main sites
   db prefix is wp_ while your second site is other_ then the code would be:
 * `define( 'MYCRED_LOG_TABLE', 'wp_myCRED_log' );`
 * If you are unsure what the table name is, just go to your db admin area and check
   the table name. myCRED always names it myCRED_log but if you have been using 
   myCRED since 1.0 then it might be mycred_Log.
 * 3. Now enable myCRED on your second site and run the setup. Since the table will
   exist, myCRED will skip the install and you will be able to see your main sites
   log and users balance on your second site.
 * Now at this stage, both sites will share the log and since you are using the 
   same usermeta table (where the balance is stored) on both sites everyones balance
   will be the same on both sites.
 * But this is where it ends. Since you are not using Multisite, you do not have
   access to the “Master Template” feature. This means that each site will have 
   to be setup separate with regards of hooks and add-ons. If you want both sites
   to give the same amount of points then you will need to update myCRED on both
   sites to match.
 * The “Master Template” feature basically overrides all other sites settings with
   your main sites. But it requires Multisite and myCRED being network wide enabled.
 * I hope it all makes sense.
    Let me know if you require further assistance.
 *  Thread Starter [godavid33](https://wordpress.org/support/users/godavid33/)
 * (@godavid33)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/integration-between-multiple-sites/#post-4612003)
 * Great reply! I hope I can be as responsive as you when I am a plugin author haha.
 * So I made the change and it definitely seems to have worked (shared user DB, 
   shared log) but when I get the balance on the second site it is still showing
   the old users balance. I’m thinking this is possibly because I had previously
   had myCred installed. Though I deactivated and deleted it prior to defining the
   myCred log table in the “secondary” site. Is there another table that houses 
   balances? Could it be a cache problem?
 * Thanks!
    Gabe
 *  Plugin Author [myCred](https://wordpress.org/support/users/designbymerovingi/)
 * (@designbymerovingi)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/integration-between-multiple-sites/#post-4612004)
 * Users balances are stored in your user meta table under the “mycred_default” 
   key. If you connect both sites users and usermeta tables then on all sits you
   should see the balance as all sites will pull the balance from the same table.
 *  Thread Starter [godavid33](https://wordpress.org/support/users/godavid33/)
 * (@godavid33)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/integration-between-multiple-sites/#post-4612009)
 * Thank you very much!
 * I ran into some problems wrought by my own hand due to omitting an underscore
   from CUSTOM_USER_META_TABLE (doh >< )
 * I hope when I’m a plugin author I can be half as responsive and helpful as you
   are. Cheers!
 *  Plugin Author [myCred](https://wordpress.org/support/users/designbymerovingi/)
 * (@designbymerovingi)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/integration-between-multiple-sites/#post-4612020)
 * Excellent. Yeah, I have been there myself, staring myself blind at the smallest
   mistake and appreciate the kind words. Have fun and let me know if you require
   further assistance.

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

The topic ‘Integration between multiple sites’ is closed to new replies.

 * ![](https://ps.w.org/mycred/assets/icon-128x128.gif?rev=3512531)
 * [Points Management System For Gamification, Ranks, Badges, and Loyalty Rewards Program - myCred](https://wordpress.org/plugins/mycred/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mycred/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mycred/)
 * [Active Topics](https://wordpress.org/support/plugin/mycred/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mycred/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mycred/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [myCred](https://wordpress.org/support/users/designbymerovingi/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/integration-between-multiple-sites/#post-4612020)
 * Status: resolved