• Hello,
    The following Deprecated PHP thrown in PHP 7.4. Can you please fix them.

    PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; cw_axmascount has a deprecated constructor in /wp-content/plugins/santas-christmas-countdown/xmascount.php on line 68
    PHP Deprecated:  Function create_function() is deprecated in /wp-content/plugins/santas-christmas-countdown/xmascount.php on line 111
    PHP Deprecated:  The called constructor method for WP_Widget in cw_axmascount is <strong>deprecated</strong> since version 4.3.0! Use <code>__construct()</code> instead. in /wp-includes/functions.php on line 4870
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Malae

    (@malae)

    The deprecated PHP was flooding the wp-debug.log file and it grew to > 1 MB in a few days. I looked at the deprecated code and found three lines that need updating, after which. the plugin is now OK. If anybody is interested I will be happy to share the new code.

    I have been using this plugin, I would be interested in the updated code.

    Thread Starter Malae

    (@malae)

    @ alicewarcu

    I hope this will fix your problem, but take no responsibility for any issues that may arise.

    Please replace the deprecated lines, as shown below:

    Line 68 function cw_axmascount() is deprecated and should be replaced with:

    class cw_axmascount extends WP_Widget {
        function __construct()

    Line 111 add_action( 'widgets_init', create_function('', 'return register_widget("cw_axmascount");') ); is deprecated and should be replaced with:

    add_action( 'widgets_init', function(){return register_widget("cw_axmascount");});

    Thank you 🙂

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

The topic ‘PHP Deprecated code’ is closed to new replies.