Chartbeat 1.4 update causes "Warning: Missing argument 2 for WP_Widget" (9 posts)

  1. web559
    Posted 3 years ago #

    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="http://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'); ?> );
    		echo $after_widget;
    function chartbeat_widget_init() {
      register_widget( 'Chartbeat_Widget' );
    add_action('widgets_init', 'chartbeat_widget_init');
    add_action('admin_menu', 'chartbeat_menu');


  2. Samer Sultan
    Posted 3 years ago #

    Some one hacked chartbeat this morning, dont update to 1.4

    Here is a link to more news: http://techcrunch.com/2011/04/13/hacker-gains-access-to-wordpress-com-servers/

  3. Chartbeat
    Plugin Author

    Posted 3 years ago #

    We're testing a patch for this now, will have it fixed shortly. If you want to try it out the code is here:


  4. Chartbeat
    Plugin Author

    Posted 3 years ago #

    This is fixed on wordpress.org if you want to go ahead and download it again.

  5. bassmansim
    Posted 3 years ago #

    I've got exactly the same problem. Have tried deactivating the Chartbeat Plugin but as yet the issue is still there. Is there anything else I need to do??

  6. Chartbeat
    Plugin Author

    Posted 3 years ago #

    @samersultan1 the error was caused by a bad merge during an update done by us, there was no hack. It was fixed by adding back in the missing constructor.

    @bassmansim This is a common issue plugin issue. If the chartbeat plugin is disabled try checking your other plugins.

  7. bassmansim
    Posted 3 years ago #

    @Chartbeat Thanks for the update. The problem was resolved once I completely removed the Chartbeat plugin. Will try a reinstall later...

  8. web559
    Posted 3 years ago #

    FYI Chartbeat, 1.4.1 seems to be numbered as 1.4, so that it doesn't offer itself as an automatic update from within WordPress. The version on WordPress.org still says it's 1.4.

    Plugin Name: Chartbeat
    Plugin URI: http://chartbeat.com/wordpress/
    Description: Adds Chartbeat pinging to WordPress.
    Version: 1.4
    Author: Chartbeat
    Author URI: http://chartbeat.com/
  9. Chartbeat
    Plugin Author

    Posted 3 years ago #

    Yeah, didn't seem worth a version increment for a minor patch, but I'll go ahead and increment it.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Chartbeat
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic