So I’ve been writing simple plugins for a while and creating settings pages for them for a while also. Then I installed a multisite and my plugins worked perfectly… but my dashboards do not. In fact, my dashboard(s) get entirely nuked… ??
Please have a look at the code below:
include_once(plugins_url('settings.php', __FILE__));
include_once('settings.php');
If I use the first method then I am able to use Network Enable but I am not able to enable it on individual websites. On the flip side of the coin, if I use the latter method then I can install the plugin on individual websites but I can’t use Network Enable.
In both cases the plugin is enabled just fine and if I go to the site the plugin is functioning perfectly but when I try to go back to my dashboard all I see is an error about an unrecognised user and that is that… my entire dashboard is replaced by a white screen with a single error message on it. I have absolute 0 access to any part of my dashboard unless I open up either the individual website or the network dashboard, respectively, depending on which one I enabled the plugin on.
So, if I use network enable I can then open the dashboards of each individual site but have no access to the settings of the plugin nor the option to disable it. Alternatively, if I enable it on an individual website in my multisite then I no longer have access to the site’s dashboard AT ALL(!) but I can still get to the main dashboard, which doesn’t help me at all with getting into my subsite’s plugins section…
Once I click on the enable button (or network enable) the plugin functions as it should on the site(s) but if I want to get access to my dashboard again I need to ftp into my site and rename the plugin folder or delete it completely.
So my question to you is simply this: How do I properly include a settings file when I create a plugin for a multisite website?
Thanks for any support in this regard. Currently all my plugins have a “Supports multisite, just don’t use Network Enable” label slapped on top of it ??
For a sample of my code, see here: Asset Store affiliate link generator
]]>I think you might get more traction for help over in the WP-Advanced forum, or the Hacks forum, which deals more with things like plugin development issues. This forum is mostly dealing with implementations of multisite. As a moderator, I can shift this topic over to either of those forums, but you might get a better response if you just create a new topic. ??
]]>Thanks for the suggestions. If you wouldn’t mind, would you please move this to whichever one you feel is more likely to get me a response? If I have to make a new post I’m just going to asking the exact same thing again so I don’t see any logic in retyping what could just be moved ??
Again, thanks for getting back to me with those suggestions. This is the single greatest WP mystery I have yet encountered and I would love to get an answer to this ??
]]>