antispam-bee icon indicating copy to clipboard operation
antispam-bee copied to clipboard

Improve Multisite compatibility

Open swissspidy opened this issue 8 years ago • 8 comments

See https://wordpress.org/support/topic/multisite-default-settings-1 and pluginkollektiv/statify#23

swissspidy avatar Jul 12 '16 11:07 swissspidy

Network activation of ASB does not apply the same settings to each site (so true network-wide settings would be a possible feature).

mundschenk-at avatar Mar 01 '18 11:03 mundschenk-at

If we move on with this feature, we should take into consideration that single site settings should be able to overwrite network site settings. E.g. if you use Multisite for different languages, you might want to change the allowed languages on each site.

websupporter avatar Mar 01 '18 11:03 websupporter

Hello, first step might be to at least add a filter for the settings - that way it would be super simple to change the settings globally for the whole network. I guess two filters might come handy:

	private static function _init_internal_vars()
            ....
             self::$defaults = apply_filters('ab_default_options',self::$defaults);

       public static function get_options()
        ....
              return apply_filters('ab_options', wp_parse_args(
                 $options,
                 self::$defaults['options']
              ));

vaclavgreif avatar Mar 15 '18 18:03 vaclavgreif

Hi @vasikgreif, this would be a good approach. Currently, I do not know, if we could support such a filter after our re-factoring, this is why I hesitate to say, we should go down this path. Maybe @schlessera can chim in for this?

websupporter avatar Mar 19 '18 08:03 websupporter

Adding a filter now would create a public interface we need to support indefinitely, while we are actually planning on doing a major refactor. For people having an immediate need to manage these options, I think adding a basic WP-CLI command for now would be the safer approach. The command can always be rewritten to adapt its behavior, a filter can't, as you're directly manipulating the internal data.

schlessera avatar Mar 21 '18 20:03 schlessera

@vasikgreif You can use the option_antispam_bee filter from WordPress core. https://developer.wordpress.org/reference/hooks/option_option/

JustThomas avatar Mar 23 '18 16:03 JustThomas

Idea from Twitter: having one table with spam from all sites in a multisite (https://twitter.com/xwolf/status/1443576562335424531)

florianbrinkmann avatar Oct 07 '21 09:10 florianbrinkmann