• Scott

    (@scottblackopsca)


    FILE: wp-content/plugins/slideshow-jquery-image-gallery/classes/SlideshowPluginWidget.php
    | WARNING | Use of deprecated PHP4 style class constructor is not supported since PHP 7.

    I am trying to upgrade to PHP7 this plugin is the only one left that shows an error.

Viewing 6 replies - 1 through 6 (of 6 total)
  • This is because the class SlideshowPluginWidget has a deprecated constructor (it’s old and php does it differently now).
    This is actually an easy fix if you have access to the file in question “/wp-content/plugins/slideshow-jquery-image-gallery/classes/SlideshowPluginWidget.php”

    Line 8 of SlideshowPluginWidget.php looks like this:

             function SlideshowPluginWidget()
              {

    change that to

             function __construct()
              {

    Mine looks like this:

           /**
             * Initializes the widget
             *
             * @since 1.2.0
             */
    // commented the old constructor out because it is deprecated 
    //      function SlideshowPluginWidget() 
    // add the new generic constructor name
            function __construct()
            {

    This is actually an easy fix if you have access to the file in question “/wp-content/plugins/slideshow-jquery-image-gallery/classes/SlideshowPluginWidget.php”

    Line 8 of SlideshowPluginWidget.php looks like this:

             function SlideshowPluginWidget()
              {

    change that to

             function __construct()
              {

    Mine looks like this:

           /**
             * Initializes the widget
             *
             * @since 1.2.0
             */
    // commented the old constructor out because it is deprecated 
    //      function SlideshowPluginWidget() 
    // add the new generic constructor name
            function __construct()
            {
    Thread Starter Scott

    (@scottblackopsca)

    I agree it’s not a big deal to fix.
    But if I fix it and then change my PHP version then it will break the next time there is an update, unless it’s fixed there as welll

    When you said:

    it will break the next time there is an update, unless it’s fixed there as well

    Did you mean next time there is an update to the plugin? If so, you are correct. But hopefully the author of the plugin StefanBoonstra will update that part of the plugin. If not, you can do it easily yourself – again.

    Sorry for the repeated posts. It did not update the first time I submitted and so I reposted my response. Now I cannot delete it.

    We need to upgrade our web server to PHP7. We are getting this warning as well:

    FILE: /plugins/slideshow-jquery-image-gallery/classes/SlideshowPluginWidget.php
    ---------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------------
     18 | WARNING | Use of deprecated PHP4 style class constructor is not supported since PHP 7.
    ---------------------------------------------------------------------------------------------------------------

    @tamarakorr,

    Assuming you can edit the php files directly you can alter them to use the updated method. See my post above for details. Post here if you have more questions.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Use of deprecated PHP4 style class constructor is not supported’ is closed to new replies.