Support » Plugin: WP-dTree » PHP7: WPDT_Links_Widget has a deprecated constructor

  • Resolved cronwerk

    (@cronwerk)


    Hi!
    WP-dTree is amazing: has wonderful features and no deprecated and unsafe code.
    Great thanks for this Ingenious plugin!!!

    But PHP7 differs from PHP5.6 and after upgrading to PHP7 I received in debug.log:

    “PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; WPDT_Links_Widget has a deprecated constructor in …/wp-content/plugins/wp-dtree-30/wp-dtree-lnk-widget.php on line 2”.

    Is it bad or I should not pay attention to this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello
    find this line in wp-dtree-lnk-widget.php

    class WPDT_Links_Widget extends WPDT_Widget{	
    	function WPDT_Links_Widget(){				
    		$widget_ops = array('classname' => 'wpdt-links', 'description' => __('List your links in a dTree.', 'wp-dtree-30')); //widget settings. 
    		$control_ops = array('width' => 200, 'height' => 350, 'id_base' => 'wpdt-links-widget'); //Widget control settings.
    		parent::__construct('wpdt-links-widget', __('WP-dTree Links', 'wp-dtree-30'), $widget_ops, $control_ops); //Create the widget.		
    		
    	}

    replace it with

      class WPDT_Links_Widget extends WPDT_Widget{	       
        function __construct()
        {
    		$widget_ops = array('classname' => 'wpdt-links', 'description' => __('List your links in a dTree.', 'wp-dtree-30')); //widget settings. 
    		$control_ops = array('width' => 200, 'height' => 350, 'id_base' => 'wpdt-links-widget'); //Widget control settings.
    		parent::__construct('wpdt-links-widget', __('WP-dTree Links', 'wp-dtree-30'), $widget_ops, $control_ops); //Create the widget.	
        }
     
            function WPDT_Links_Widget()
        {
            self::__construct();
        }
    • This reply was modified 1 year, 1 month ago by  faramirtr. Reason: forgot a code line

    Thank you very much!

    It helped. There are no debug messages now.

    Best regards!

    Welcome mate! I am happy it helped.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘PHP7: WPDT_Links_Widget has a deprecated constructor’ is closed to new replies.