WordPress.org

Ready to get started?Download WordPress

Forums

WP SlimStat
[resolved] Dashboard widgets are not displayed all the time (5 posts)

  1. flauschi
    Member
    Posted 3 years ago #

    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 :-P )
    flauschi

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

  2. camu
    Member
    Plugin Author

    Posted 3 years ago #

    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

  3. flauschi
    Member
    Posted 3 years ago #

    Hi,

    I'm glad that I could help. :)

    Really looking forward to the jQuery graph release :D
    flauschi

  4. camu
    Member
    Plugin Author

    Posted 3 years ago #

    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

  5. camu
    Member
    Plugin Author

    Posted 2 years ago #

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

    Camu

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic