• Upgrading to Chartbeat 1.4 causes this error at the top of my site:

    Warning: Missing argument 2 for WP_Widget::__construct(), called in /path/to/wp-includes/widgets.php on line 324 and defined in /path/to/wp-includes/widgets.php on line 93

    Deactivating the plugin fixes it, activating brings back the error; it’s definitely the Chartbeat plugin.

    I suspect it has to do with the plugin code around line 232-256:

    class Chartbeat_Widget extends WP_Widget {
    	function widget( $args ) {
    		extract( $args );
    		echo $before_widget;
    		if ( get_option( 'chartbeat_apikey' ) ) : ?>
    			<div id="cb_top_pages"></div>
    			<script src="https://static.chartbeat.com/js/topwidgetv2.js" type="text/javascript" language="javascript"></script>
    			<script type="text/javascript" language="javascript">
    			var options = { };
    			new CBTopPagesWidget( '<?php echo esc_js( get_option('chartbeat_apikey') ); ?>', <?php echo get_option('chartbeat_widgetconfig'); ?> );
    			</script>
    		<?php
    		endif;
    		echo $after_widget;
    	}
    }
    
    function chartbeat_widget_init() {
      register_widget( 'Chartbeat_Widget' );
    }
    
    add_action('widgets_init', 'chartbeat_widget_init');
    add_action('admin_menu', 'chartbeat_menu');

    https://www.ads-software.com/extend/plugins/chartbeat/

Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Chartbeat 1.4 update causes "Warning: Missing argument 2 for WP_Widget"’ is closed to new replies.