• Resolved parkerinforme.org

    (@parkerinformeorg)


    I upgraded WordPress from 4.0 to 4.1, and now receive the following error messages:

    Notice: Undefined variable: pagenow in /wordpress/wp-content/plugins/wp-statistics/wp-statistics.php on line 111

    The plugin generated 127 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.

    Line 111 of wp-statistics.php begins with the nested IF statement in the following block:

    if( !$WP_Statistics->get_option('useronline') || !$WP_Statistics->get_option('visits') || !$WP_Statistics->get_option('visitors') || !$WP_Statistics->get_option('geoip') ) {
                    if( $pagenow == "admin.php" && substr( $_GET['page'], 0, 14) == 'wp-statistics/') {
                            add_action('admin_notices', 'wp_statistics_not_enable');
                    }
            }

    https://wordpress.org/plugins/wp-statistics/

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

    (@gregross)

    $pagenow is a global set by WordPress so it should be available, however replace the above block of code with the following and see if it clears the problem:

    if( !$WP_Statistics->get_option('useronline') || !$WP_Statistics->get_option('visits') || !$WP_Statistics->get_option('visitors') || !$WP_Statistics->get_option('geoip') ) {
    	if( isset( $pagenow ) && array_key_exists( 'page', $_GET ) ) {
    		if( $pagenow == "admin.php" && substr( $_GET['page'], 0, 14) == 'wp-statistics/') {
    			add_action('admin_notices', 'wp_statistics_not_enable');
    		}
    	}
    }
    Thread Starter parkerinforme.org

    (@parkerinformeorg)

    Greg, that worked like a charm.

    Thank you!

    Plugin Contributor Greg Ross

    (@gregross)

    No problem, I’ll include it in the next release as well.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Error after upgrading WordPress, using wp-statistics 8.7.2’ is closed to new replies.