Support » Plugin: Slimstat Analytics » [Plugin: WP SlimStat] Dashboard widgets are not displayed all the time

  • Resolved flauschi

    (@flauschi)


    Hello,

    I have a little fix for the problem with the dashboard widgets. They don’t work/display after login and seemed to work only at random times.

    I think it is also the bug mentioned here:
    WP SlimStat Dashboard Widgets not working with update

    I tried a little bit around and figured out that the widgets are only displayed, when the dashboard is called with “wp-admin/index.php”. If the dashboard is called with “wp-admin/” without “index.php” (like after the login) they are not displayed.

    In “wp-slimstat/wp-slimstat-dashboard.php” the following line on the top is not correct / not complete:

    if (!empty($_GET['page']) || strpos($_SERVER['REQUEST_URI'], '/wp-admin/index.php') === false ) return;

    I think something has changed in WordPress or this check has changed in SlimStat. A simple preg_match does fix the problem. Change the line to the following and everything works fine again:
    if (!empty($_GET['page']) || ! preg_match('#wp-admin/(index.php)?(\?.*)?$#', $_SERVER['REQUEST_URI'])) return;

    really great plugin and have a nice day
    (and I already voted for it 😛 )
    flauschi

    http://wordpress.org/extend/plugins/wp-slimstat/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jason Crouse

    (@coolmann)

    Hi there,

    I really wish I had many more users like you, Flauschi 🙂 I think you’re right, index.php in the Request URI is optional, so a preg_match is more appropriate than a simple strpos 🙂 I will add this fix to the code asap.

    Thank you!
    Camu

    Hi,

    I’m glad that I could help. 🙂

    Really looking forward to the jQuery graph release 😀
    flauschi

    Plugin Author Jason Crouse

    (@coolmann)

    Yeah, that’s something that will make this plugin really cool and lightweight (I hope!). It will take a while, though, since now I’m working on my other plugin (Subscribe to Comments Reloaded) and unfortunately I don’t have much spare time to follow both at the same time 🙂

    Best,
    Camu

    Plugin Author Jason Crouse

    (@coolmann)

    I just released a new version that includes your fix 🙂 Thank you again for your contribution!

    Camu

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: WP SlimStat] Dashboard widgets are not displayed all the time’ is closed to new replies.