Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin configuration in a multisite environment #316

Closed
danielhartnell opened this issue May 19, 2017 · 2 comments
Closed

Plugin configuration in a multisite environment #316

danielhartnell opened this issue May 19, 2017 · 2 comments

Comments

@danielhartnell
Copy link

Issue summary and objective

This is a follow up to an Auth0 Community post that I created recently. We have a WordPress multisite environment and we would like to enable the Auth0 plugin, network activate it and then configure it once for all blogs.

I'm not able to do that today. I have to access each blog and reconfigure the Auth0 plugin for that specific site. The import function makes this easier but I would like to improve the situation so we do not have to manually configure existing and future blogs.

I'd like to start a discussion with you regarding this and see if it's an enhancement worth pursuing.

Details

After reviewing the plugin source, it looks like you are primarily using calls to the update_option() function. As I understand it, this function will update the options table associated with a specific site ID. So rather than storing the options in the global options table in the WordPress database, it will store them in a site specific table called wp_XX_options (XX is the site ID).

Would it be possible to provide an option for users to use the add_site_option() function? I think this will amend the global options table. Is this something you have evaluated?

Citation: https://codex.wordpress.org/Function_Reference/add_site_option

An alternative

I've also noticed that you have declared some default configuration parameters here:
https://github.com/auth0/wp-auth0/blob/master/lib/WP_Auth0_Options.php#L52

I would prefer not to make code changes to the plugin itself but I could try to extract the relevant parameters from a configuration export and then reinstall the plugin with those defaults set.

Conclusion

If you're aware of any reasons that this will not work, I would love to hear it. If there's anything I could do to help move this along faster, I'd be happy to try and help.

@joshcanhelp
Copy link
Contributor

I know this is old but it's still relevant, even more so with some recent focus on testing, configuration, and documentation around WordPress networks.

I definitely understand the pain point here and happy to work towards a clear, coherent solution. In writing documentation for the multisite install process, though, it's clear that the hard part here is going to be coming up with a solution that works for the many different ways that Auth0 can be configured for networks. In short:

  • Each site can have it's own Application and DB Connection
  • Each site can have it's own Application and share a DB Connection (generally how I would recommend doing it)
  • All sites can share an Application and a DB Connection

Documentation explaining this process is going live tomorrow after the 3.6.0 update, guiding site owners through this configuration. But, without significant and specific UI for network installs, this might be impossible to fulfill. Still, I'm tagging an issue at the bottom here related to improving the whole setup process and we'll try to address this as best as we can.

Relates to #408.

@joshcanhelp
Copy link
Contributor

Backlogging this internally for a future release.

In the meantime, we now allow for settings to be stored in a PHP constant:

https://auth0.com/docs/cms/wordpress/configuration#php-constant-setting-storage

This will allow all sites in a mutli-site network to use the same settings.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants