• Resolved McLibboc

    (@mclibboc)


    I had only tested the plugin with a WP multisite as the network admin.

    I was assuming that all admins would have access to the statistics for their individual subsites.

    But that is not the case. It appears that the correct capabilities are not added for site admins and/or editors on multisite instances.

    Is there a way to add those capabilities manually? What would a correct entry look like in the database?

    Best regards,
    McL

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter McLibboc

    (@mclibboc)

    In burst-statistics/burst.php, line 182:

    if ( ! function_exists( 'burst_set_activation_time_stamp' ) ) {
    	/**
    	 * Set an activation time stamp
    	 *
    	 * @param $networkwide
    	 */
    	function burst_set_defaults( $networkwide ) {
    		BURST()->admin->setup_defaults();
    	}
    
    	register_activation_hook( __FILE__, 'burst_set_defaults' );
    }

    As far as I can tell, the first if-condition will never be true, at least I couldn’t find any definition of a function called burst_set_activation_time_stamp.

    Just changing that to burst_set_defaults didn’t help, though, the problem persists.

    • This reply was modified 1 year, 10 months ago by McLibboc.
    Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    @mclibboc you are correct, this doesn’t work quite as expected right now. Thanks for reporting the issue.

    – We realised that on multisite, the capability is not linked to administrators on who are only active on subsites. I’ve created a fix that adds the capability to all administrators on subsites as well, and also on new site creation:
    https://github.com/Really-Simple-Plugins/burst/tree/capability
    The function triggers on site activation.

    – the if (function_exists) is a bug, but without consequences: this should protect from duplicate installation of Burst, but the if function exists contains the wrong function. As the function doesn’t exist, the activation hook will already run without issues. It will be corrected in the next update.

    Let me know if this resolves the issue for you.

    Thread Starter McLibboc

    (@mclibboc)

    @rogierlankhorst thank you for your quick reply.

    The issue remains:

    1. I have a multisite with many subsites already in use. I take it that the wp_initialize_site hook will not trigger then? When is the assignment of capabilities to roles triggered in this case?
    2. It seems to me that you addressed the capability manage_burst_statistics only, not the view_burst_statistics which is not implied but also needed.

    Best regards,
    McL

    • This reply was modified 1 year, 10 months ago by McLibboc.
    Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    @mclibboc I noticed the set_defaults doesn’t run again when activated again, so I’ve included the functions in the upgrade process as well. It should now run on upgrade. When running the upgrade, all current subsites will be processed.

    The wp_initialize_site is only triggered for new sites, to ensure the capabilities also get added on newly added sites.

    I’ve extended this with the view capability as well.

    Thread Starter McLibboc

    (@mclibboc)

    @rogierlankhorst

    That did the trick. Now it works as expected.

    Thanks a lot.

    • This reply was modified 1 year, 10 months ago by McLibboc. Reason: resolved
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Multisite: Only Network Admin sees Statistics’ is closed to new replies.