• Hello,

    Could you update the following in server-ip-memory-usage/server-ip-memory-usage.php on line 30:

    function ip_address_memory_usage() {

    To:

    public function __construct() {
    I believe the public statement is optional.

    This will remove a PHP7 deprecation warning ?? In the future this will be the standard.

    Thank you very much for your time and input! Your plugin helps me write better code ??

    https://www.ads-software.com/plugins/server-ip-memory-usage/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author apasionados

    (@apasionados)

    Hi Sybre,

    Thanks for pointing this out. We have just changed it and the new version should be available right now (version 1.1.0).

    We had been doubting to make changes to the deprecated PHP 4 constructors because of compatibility issues with the different PHP versions.

    Using the public function __construct() { seems to be compatible with PHP 5.2.14 – 5.2.17, 5.3.3 – 5.6, PHP 7 and PHP 8; but raises an E_STRICT "Redefining already defined constructor" error in versions PHP 5.0.0 – 5.2.13, 5.3.0 – 5.3.2. (Remove PHP 4 Constructors.

    Thanks and best regards.

    Thread Starter Sybre Waaijer

    (@cybr)

    Hi @apasionados,

    The link you’ve provided is interesting. Thanks!

    Also many thanks for updating ??

    I don’t think you’ll have to worry about deprecated PHP versions, since WordPress themselves have deprecated them too. https://make.www.ads-software.com/core/2015/07/02/deprecating-php4-style-constructors-in-wordpress-4-3/

    Not to mention PHP 5.2 has been deprecated for a good 4 years already by The PHP Group.
    https://php.net/eol.php

    Hosting parties should upgrade too for security reasons, if they haven’t then it’s best to stay away from them.

    I believe that users whom update a plugin will also update the core. Those who don’t I believe have a deserted website or company.

    Thanks ??

    With the most recent update (5 months ago) has it been made compatible with PHP 7?

    Thank you in advance. ??

    Best regards,
    Michael

    Thread Starter Sybre Waaijer

    (@cybr)

    Hi Michael,

    For as far as I can recall, it always has been PHP7 compatible. It’s just that the constructor was going to be deprecated – yet it’s still functional.

    apasionados has since released an update (quite long ago) which uses the new style. I’m still using it on my test server without any issues. Go ahead and good luck! ??

    Plugin Author apasionados

    (@apasionados)

    Hi Michael and Sybre,

    The plugin is compatible with PHP7 which we are running on all our sites.

    Today we released an update regarding the IP address on servers with IIS where the IP was not shown and a warning was shown with DEBUG on.

    Best regards and have a great weekend.

    Ramón.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PHP7 compatibility’ is closed to new replies.