• Resolved Wendihihihi

    (@wendihihihi)


    Getting this warning when using php 8.2:

    Deprecated: Creation of dynamic property dynWid::$wpml is deprecated in?/home2/xxxx/public_html/xxxx/wp-content/plugins/dynamic-widgets/classes/dynwid_class.php?on line?95

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Wendihihihi

    (@wendihihihi)

    There might be a better solution, but these changes fixed it for me.

    Line 11

    class dynWid {
    
            private $dbtable;
    
            public  $device;
    
            public  $hostname;
    
            public  $dwoptions = array();
    
            public  $dynwid_list;
    
            public  $enabled;
    
            private $firstmessage = TRUE;
    
            public  $ip_address;
    
            public  $listmade = FALSE;
    
            public  $overrule_maintype = array();
    
            private $registered_sidebars;
    
            public  $registered_widget_controls;
    
            public  $registered_widgets;
    
            public  $removelist = array();
    
            public  $sidebars;
    
            public  $template;
    
            public  $url;
    
            public  $plugin_url;
    
            public  $useragent;
    
            public  $userrole;
    
            public  $whereami;
    
            private $wpdb;
    
            public $wpml;
    
            public $custom_taxonomy;
    
    

    Line 67

    /**
    
             * dynWid::__get() Overload get
    
             *
    
             * @param string $name
    
             * @return mixed
    
             */
    
            public function __get($name) {
    
                if(property_exists($this, $name)) {
    
                    return $this->$name;
    
                } else {
    
                    return null;
    
                }
    
            }

    Line 95

    /**
    
             * dynWid::__set() Overload set
    
             *
    
             * @param string $name
    
             * @param mixed $value
    
             */
    
            public function __set($name, $value) {
    
                if(property_exists($this, $name)) {
    
                    $this->$name = $value;
    
                } else {
    
                }
    
            }
    Plugin Author vivalex

    (@vivalex)

    @wendihihihi

    Can you share the minimum set of dynamic widget edit options that lead to this behavior? We have tested on PHP 8 and with WP 6.4 and can’t reproduce this error.

    Thanks for your code change suggestions. If we can get some step-to-reproduce, that will make it straightforward to incorporate your fix!

    Thread Starter Wendihihihi

    (@wendihihihi)

    Did you test it also for php 8.2?

    If you only test it on php8 you won’t get the errors. I also won’t get them in php 8.1.

    Also, make sure in wp-config.php set the debug to true

    define( 'WP_DEBUG', true );

    • This reply was modified 10 months, 1 week ago by Wendihihihi.
    Plugin Author vivalex

    (@vivalex)

    Hi,

    Thanks for your patience and suggested solution. We’ve rolled out the fix for the “Creation of dynamic property” warning in 1.6.3, please update and let us know if you have any further issues.

    Thanks,
    Alex

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Warning with php 8.2’ is closed to new replies.