Title: constructor method for WP_Widget is deprecated
Last modified: August 30, 2016

---

# constructor method for WP_Widget is deprecated

 *  Resolved [leejosepho](https://wordpress.org/support/users/leejosepho/)
 * (@leejosepho)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/constructor-method-for-wp_widget-is-deprecated-2/)
 * Following WordPress 4.3 update:
 * Notice: The called constructor method for WP_Widget is deprecated since version
   4.3.0!
    Use __construct() instead.
 * “If you are sub classing a WordPress class and calling the PHP4 constructor, 
   you should update your code to use parent::__construct instead. You should also
   audit your own code to make sure it is using PHP5 style constructors.”
    [https://make.wordpress.org/core/2015/07/02/deprecating-php4-style-constructors-in-wordpress-4-3/](https://make.wordpress.org/core/2015/07/02/deprecating-php4-style-constructors-in-wordpress-4-3/)
 * “Here is a list of plugins (or rather the WordPress.org slugs for them) recently
   detected…
    [https://gist.github.com/chriscct7/d7d077afb01011b1839d](https://gist.github.com/chriscct7/d7d077afb01011b1839d)“
   Friends don’t let friends use PHP 4 style constructors.”
 * [https://www.google.com/search?q=called+constructor+method+for+WP_Widget+is+deprecated](https://www.google.com/search?q=called+constructor+method+for+WP_Widget+is+deprecated)
 * [https://wordpress.org/plugins/chatroll-live-chat/](https://wordpress.org/plugins/chatroll-live-chat/)

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

 *  [Guido](https://wordpress.org/support/users/guido07111975/)
 * (@guido07111975)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/constructor-method-for-wp_widget-is-deprecated-2/#post-6447753)
 * Hi Joe,
 * For now you can just change the file yourself.
    Open file wp-chatroll(.php) and
   look for:
 *     ```
       $this->WP_Widget('chatroll', $name, $widget_ops, $control_ops);
       ```
   
 * Change that into:
 *     ```
       parent::__construct('chatroll', $name, $widget_ops, $control_ops);
       ```
   
 * Did not test it but should work.
 * Guido
 * btw, you can create nice looking links by selecting text and clicking the link
   icon in the editor.
 *  Thread Starter [leejosepho](https://wordpress.org/support/users/leejosepho/)
 * (@leejosepho)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/constructor-method-for-wp_widget-is-deprecated-2/#post-6447754)
 * Many thanks, Mr. Guido! Some time ago I had asked Chatroll about possibly updating
   this plugin, but I doubt that will ever happen now that they make easy-to-use
   <iframe> and some related SSO (Single Sign On) code available at the Chatroll
   user’s Admin page.
 *  Thread Starter [leejosepho](https://wordpress.org/support/users/leejosepho/)
 * (@leejosepho)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/constructor-method-for-wp_widget-is-deprecated-2/#post-6447906)
 * Here is an updated file I am using in the ‘Chatroll Live Chat’ plugin:
 * > * Plugin Name: Chatroll Live Chat SSO
   >  * Description: Updated for PHP 5.4 and
   > widget removed while retaining SSO features for Chatroll HTML and shortcodes.
   > Shortcodes and HTML from Chatroll Dashboard can be pasted into WordPress pages,
   > posts and text widgets. * Version: 2.1.1.2 * Author: Chatroll & NoNameYet *
   > License: GNU General Public License GPLv3
   > [http://pastebin.com/Zw8YyF7e](http://pastebin.com/Zw8YyF7e)
 *  Plugin Author [Chatroll](https://wordpress.org/support/users/chatroll/)
 * (@chatroll)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/constructor-method-for-wp_widget-is-deprecated-2/#post-6448001)
 * Hi,
 * Just a quick update: we have incorporated a fix for this in version 2.2.1 of 
   the official Chatroll Live Chat plugin. Please update your plugin to get the 
   fix!
 * Kind regards,
    Chatroll Support

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

The topic ‘constructor method for WP_Widget is deprecated’ is closed to new replies.

 * ![](https://ps.w.org/chatroll-live-chat/assets/icon-256x256.png?rev=1260464)
 * [Chatroll Live Chat](https://wordpress.org/plugins/chatroll-live-chat/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/chatroll-live-chat/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/chatroll-live-chat/)
 * [Active Topics](https://wordpress.org/support/plugin/chatroll-live-chat/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/chatroll-live-chat/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/chatroll-live-chat/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Chatroll](https://wordpress.org/support/users/chatroll/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/constructor-method-for-wp_widget-is-deprecated-2/#post-6448001)
 * Status: resolved