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

Disabling QM on sub-site removes db.php for network #820

Closed
crstauf opened this issue Oct 6, 2023 · 4 comments · Fixed by #821
Closed

Disabling QM on sub-site removes db.php for network #820

crstauf opened this issue Oct 6, 2023 · 4 comments · Fixed by #821
Milestone

Comments

@crstauf
Copy link
Contributor

crstauf commented Oct 6, 2023

Crazy timing! I came to look up a different issue and was curious about this one. I've been trying to understand why my db.php symlink kept going away, and it is exactly the case that deactivating it on a single site in multisite removes the symlink (and yes we have DISALLOW_FILE_MODS in place).

For reference, I've been manually creating the symlink per the instructions here: https://github.com/johnbillion/query-monitor/wiki/db.php-Symlink

Originally posted by @MadtownLems in #817 (comment)

@johnbillion
Copy link
Owner

This is an interesting use case. If QM is active on one site on the network and I deactivate it on that site, I would expect the db.php file to be deleted too as it's no longer needed, but it might be active on another site on the network.

I don't want to introduce code to check the active status on all sites on the network because that's a mess. I think QM should not delete the db.php file when it's deactivated on a single site on the network. The file is harmless when QM isn't active anyway.

@crstauf
Copy link
Contributor Author

crstauf commented Oct 9, 2023

It's surprising that there aren't separate functions for network de/activations.

@MadtownLems
Copy link

It's surprising that there aren't separate functions for network de/activations.

I believe that whether it's network or not is passed in action calls: https://developer.wordpress.org/reference/hooks/activate_plugin/

However, I don't think that helps a ton, because of the following situation:

Subsite A has Query Monitor locally activated. Then QM is network activated. Then QM is network deactivated.
Subsite A still has QM locally activated, and thus, should still be using db.php

@crstauf
Copy link
Contributor Author

crstauf commented Oct 9, 2023

Oh, interesting. I was expecting there'd be register_network_activation_hook() function (and similar deactivation function), but that could work.

@johnbillion johnbillion added this to the 3.14.0 milestone Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants