• Resolved Jer Clarke

    (@jerclarke)


    Hi all, I’m back with more PHP notices that I’d love it if you could fix!

    These ones are triggered in the PowerPressStatsWidget class, specifically it seems that on my site the PowerPressStatsWidget->content array is empty, but the class doesn’t check that, and powers through, accessing a dozen or so missing fields and generating a notice each time.

    Examples:

    PHP Notice:? Undefined index: scale_step in /…/powerpress/powerpressadmin-stats-widget.class.php on line 368

    PHP Notice:? Undefined index: scale_max in //powerpress/powerpressadmin-stats-widget.class.php on line 371

    PHP Notice:? Undefined index: scale_min in //powerpress/powerpressadmin-stats-widget.class.php on line 371?

    PHP Notice:? Undefined index: scale_max in //powerpress/powerpressadmin-stats-widget.class.php on line 391

    PHP Notice:? Undefined index: scale_min in //powerpress/powerpressadmin-stats-widget.class.php on line 391

    PHP Notice:? Undefined index: day_total_data in //powerpress/powerpressadmin-stats-widget.class.php on line 398

    ?PHP Warning:? Invalid argument supplied for foreach() in //powerpress/powerpressadmin-stats-widget.class.php on line 398

    PHP Notice:? Undefined index: widget_title in /…/powerpress/powerpressadmin-stats-widget.class.php on line 515

    PHP Notice:? Undefined index: day_total_data in /…/powerpress/powerpressadmin-stats-widget.class.php on line 216

    PHP Notice:? Undefined index: month_average_change in //powerpress/powerpressadmin-stats-widget.class.php on line 237

    ?PHP Notice:? Undefined index: month_average_change in /…/powerpress/powerpressadmin-stats-widget.class.php on line 240

    ?PHP Notice:? Undefined index: month_average in //powerpress/powerpressadmin-stats-widget.class.php on line 248

    PHP Notice:? Undefined index: month_average in /…/powerpress/powerpressadmin-stats-widget.class.php on line 249

    PHP Notice:? Undefined index: day_total_data in /…/powerpress/powerpressadmin-stats-widget.class.php on line 258

    PHP Notice:? Undefined index: program_total in /…/powerpress/powerpressadmin-stats-widget.class.php on line 267

    PHP Notice:? Undefined index: program_total in //powerpress/powerpressadmin-stats-widget.class.php on line 268

    ?PHP Notice:? Undefined index: stats_prog_id in //powerpress/powerpressadmin-stats-widget.class.php on line 275

    I have no idea why it’s empty, but for sure it shouldn’t be dumping all these errors in the logs. It only happens on the settings page at least, but it’s very disruptive for my testing. Seems like what needs to happen is you just turn this rendering off if there’s nothing to show, as seems to be the case. This is a site that hardly ever used Powerpress aside from rendering some MP3 players, there’s no reason for it to have stats.

    Thank you for taking a look!

    Versions: WP 6.1.1 PP 9.10

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Shawn

    (@shawnogordo)

    This has been passed on to the Blubrry dev team.

    Thread Starter Jer Clarke

    (@jerclarke)

    Hi, thank you for that.

    I have another similar report, so I’ll put it here rather than starting a new thread:

    From /powerpress/views/settings_tab_appearance.php on line 32:

                    <input type="text" id="subscribe_page_link_href" class="pp-settings-text-input" value="<?php echo esc_attr($FeedSettings['subscribe_page_link_href']); ?>" name="Feed[subscribe_page_link_href]" placeholder="Subscribe URL"<?php echo (!empty($FeedSettings['subscribe_page_link_id'])?'':' disabled'); ?> />
    

    This generates the following error:

    PHP Notice:  Undefined index: subscribe_page_link_href in /.../wp-content/plugins/powerpress/views/settings_tab_appearance.php on line 32 
    

    The reason is obvious, the code accesses subscribe_page_link_href without checking it exists, unlike subscribe_page_link_id which it uses on the same line, but only after checking !empty

    The state of the page, for me is that I don’t have any settings set up, so I guess it’s empty in that case:

    Plugin Support Shawn

    (@shawnogordo)

    This should be fixed with the most recent PowerPress update. If you continue to have trouble with it, let us know.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘PHP notices from dashboard stats i.e. Notice: Undefined index: widget_title’ is closed to new replies.