MarketPress Statistics
[resolved] Editors can't view the statistics (4 posts)

  1. stefan.kruger
    Posted 3 years ago #


    first of all thank you for this plugin it's really usefull to be able to track statistics for marketpress.

    I just have a question about the capabilities required to access the statistic pages.

    I'd need to change these so editors can view them.

    I have changed the current code so it's possible for people to do that but i'm not sure it's a good solution as any update of the plugin will remove my code.

    I've also tried with a plugin i usually use to give people access to things they aren't supposed to but the admin slug is not correctly set, maybe because of the restrictions set in the code itself.

    Again thanks for your help :)



  2. Aristeides Stathopoulos
    Plugin Author

    Posted 3 years ago #

    On the code there are 2 lines that you should be aware of:
    add_menu_page( __('Sales Statistics', 'mp_st'), __('Store Statistics', 'mp_st'), 'administrator', 'mp_st', 'mp_st_page');
    This one creates the menu item and allows only administrators to see it. changing this to "editors" for example will allow them to see the menu item.

    if ( function_exists('current_user_can') && !current_user_can('manage_options') )
    This is the line that determines which one can actually see the page. You can see who can do what here: http://codex.wordpress.org/Roles_and_Capabilities#Capability_vs._Role_Table
    A solution would be to give editors the option to 'manage_options' (using a plugin like this: http://wordpress.org/extend/plugins/user-role-editor/screenshots/ )
    but I wouldn't advise that... Simply change the code on the 2 lines I pointed out before.
    I hope this helps...

  3. stefan.kruger
    Posted 3 years ago #

    Thank you this is the solution I used :)

  4. Aristeides Stathopoulos
    Plugin Author

    Posted 3 years ago #

    I'm glad it worked. :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • MarketPress Statistics
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.