• Resolved bseddon

    (@bseddon)


    This sort function expects that the items to be compared are arrays and that it is item ‘1’ that should be compared. In many examples there is no item one so my log contains notices of this type which will be good to be able to eliminate because they obscure problems I want to be able to see:

    [24-Nov-2014 20:49:12 UTC] PHP Notice:  Undefined offset: 1 in .\wp-content\plugins\wp-statistics\includes\functions\functions.php on line 234
    [24-Nov-2014 20:49:12 UTC] PHP Stack trace:
    [24-Nov-2014 20:49:12 UTC] PHP   1. {main}() .\wp-admin\admin.php:0
    [24-Nov-2014 20:49:12 UTC] PHP   2. do_action() .\wp-admin\admin.php:212
    [24-Nov-2014 20:49:12 UTC] PHP   3. call_user_func_array:{.\wp-includes\plugin.php:505}() .\wp-includes\plugin.php:505
    [24-Nov-2014 20:49:12 UTC] PHP   4. wp_statistics_log_overview() .\wp-includes\plugin.php:505
    [24-Nov-2014 20:49:12 UTC] PHP   5. wp_statistics_log() .\wp-content\plugins\wp-statistics\wp-statistics.php:393
    [24-Nov-2014 20:49:12 UTC] PHP   6. include_once() .\wp-content\plugins\wp-statistics\wp-statistics.php:552
    [24-Nov-2014 20:49:12 UTC] PHP   7. wp_statistics_display_column_b() .\wp-content\plugins\wp-statistics\includes\log\log.php:74
    [24-Nov-2014 20:49:12 UTC] PHP   8. wp_statistics_generate_pages_postbox() .\wp-content\plugins\wp-statistics\includes\log\log.php:158
    [24-Nov-2014 20:49:12 UTC] PHP   9. wp_statistics_get_top_pages() .\wp-content\plugins\wp-statistics\includes\log\widgets\pages.php:6
    [24-Nov-2014 20:49:12 UTC] PHP  10. usort() .\wp-content\plugins\wp-statistics\includes\functions\functions.php:273
    [24-Nov-2014 20:49:12 UTC] PHP  11. wp_stats_compare_uri_hits() .\wp-content\plugins\wp-statistics\includes\functions\functions.php:273

    https://www.ads-software.com/plugins/wp-statistics/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Greg Ross

    (@gregross)

    Easy fix, it will be in the next release.

    Thread Starter bseddon

    (@bseddon)

    That’s great. Are you able to share the revised function here so I can remove the messages from my log?

    Thanks

    Plugin Contributor Greg Ross

    (@gregross)

    Around line 270 in functions.php, change:

    if( count( $uris ) > 0 ) {

    To

    if( count( $uris ) > 1 ) {
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Problems in wp_stats_compare_uri_hits()’ is closed to new replies.