Title: updatescheck.php and php 7.4
Last modified: April 30, 2020

---

# updatescheck.php and php 7.4

 *  Resolved [hutman](https://wordpress.org/support/users/hutman/)
 * (@hutman)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/updatescheck-php-and-php-7-4/)
 * We are having troubles running the updatescheck.php with php 7.4 and getting 
   a depreciation error. What is the maximum PHP version that can be run with MainWP
   for the cron jobs?
 * PHP Deprecated: Array and string offset access syntax with curly braces is deprecated
   in (….) wp-content/plugins/mainwp/class/class-mainwp-utility.php on line 2126
   
   PHP Stack trace:(…)
 * Thank you

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

 *  Thread Starter [hutman](https://wordpress.org/support/users/hutman/)
 * (@hutman)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/updatescheck-php-and-php-7-4/#post-12759721)
 * Update from developer (post here for convenience of others): (we are running 
   php 7.4.5 as well – when we had the error);
 * ————–
    As per our testing, everything works fine on our test servers where we
   run PHP 7.4.5
 *  Thread Starter [hutman](https://wordpress.org/support/users/hutman/)
 * (@hutman)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/updatescheck-php-and-php-7-4/#post-12759774)
 * Running with php 7.3 works for us, so, take it for whatever works for you.
 * php7.3 (…)/wp-content/plugins/mainwp/cron/updatescheck.php
 * (no errors emitted).
 *  [linux4me2](https://wordpress.org/support/users/linux4me2/)
 * (@linux4me2)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/updatescheck-php-and-php-7-4/#post-12760194)
 * I ran PHP CodeSniffer on the mainwp/ folder on my installation. This is what 
   I found testing for WordPress PHP 7.4 compatibility:
 *     ```
       FILE: .../mainwp/wp-content/plugins/mainwp/class/class-mainwp-creport.php
       ----------------------------------------------------------------------
       FOUND 6 ERRORS AND 1 WARNING AFFECTING 7 LINES
       ----------------------------------------------------------------------
        1246 | WARNING | Function create_function() is deprecated since PHP
             |         | 7.2; Use an anonymous function instead
        2828 | ERROR   | Extension 'mysql_' is deprecated since PHP 5.5 and
             |         | removed since PHP 7.0; Use mysqli instead
        2836 | ERROR   | Extension 'mysql_' is deprecated since PHP 5.5 and
             |         | removed since PHP 7.0; Use mysqli instead
        2844 | ERROR   | Extension 'mysql_' is deprecated since PHP 5.5 and
             |         | removed since PHP 7.0; Use mysqli instead
        2852 | ERROR   | Extension 'mysql_' is deprecated since PHP 5.5 and
             |         | removed since PHP 7.0; Use mysqli instead
        2860 | ERROR   | Extension 'mysql_' is deprecated since PHP 5.5 and
             |         | removed since PHP 7.0; Use mysqli instead
        2868 | ERROR   | Extension 'mysql_' is deprecated since PHP 5.5 and
             |         | removed since PHP 7.0; Use mysqli instead
       ----------------------------------------------------------------------
   
       FILE: .../mainwp/wp-content/plugins/mainwp/class/class-mainwp-utility.php
       ----------------------------------------------------------------------
       FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
       ----------------------------------------------------------------------
         846 | WARNING | [ ] INI directive 'safe_mode' is deprecated since
             |         |     PHP 5.3 and removed since PHP 5.4
        1121 | WARNING | [ ] INI directive 'safe_mode' is deprecated since
             |         |     PHP 5.3 and removed since PHP 5.4
        1651 | WARNING | [ ] INI directive 'safe_mode' is deprecated since
             |         |     PHP 5.3 and removed since PHP 5.4
        2126 | WARNING | [x] Curly brace syntax for accessing array elements
             |         |     and string offsets has been deprecated in PHP
             |         |     7.4. Found: $Str{$i}
        2163 | WARNING | [x] Curly brace syntax for accessing array elements
             |         |     and string offsets has been deprecated in PHP
             |         |     7.4. Found: $HashStr{$i}
       ----------------------------------------------------------------------
   
       FILE: ..._html/mainwp/wp-content/plugins/mainwp/class/class-mainwp-db.php
       ----------------------------------------------------------------------
       FOUND 7 ERRORS AFFECTING 7 LINES
       ----------------------------------------------------------------------
        1925 | ERROR | Extension 'mysql_' is deprecated since PHP 5.5 and
             |       | removed since PHP 7.0; Use mysqli instead
        1933 | ERROR | Extension 'mysql_' is deprecated since PHP 5.5 and
             |       | removed since PHP 7.0; Use mysqli instead
        1945 | ERROR | Extension 'mysql_' is deprecated since PHP 5.5 and
             |       | removed since PHP 7.0; Use mysqli instead
        1957 | ERROR | Extension 'mysql_' is deprecated since PHP 5.5 and
             |       | removed since PHP 7.0; Use mysqli instead
        1969 | ERROR | Extension 'mysql_' is deprecated since PHP 5.5 and
             |       | removed since PHP 7.0; Use mysqli instead
        1981 | ERROR | Extension 'mysql_' is deprecated since PHP 5.5 and
             |       | removed since PHP 7.0; Use mysqli instead
        1993 | ERROR | Extension 'mysql_' is deprecated since PHP 5.5 and
             |       | removed since PHP 7.0; Use mysqli instead
       ----------------------------------------------------------------------
   
       FILE: ...-content/plugins/mainwp/pages/page-mainwp-server-information.php
       ----------------------------------------------------------------------
       FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
       ----------------------------------------------------------------------
        864 | WARNING | INI directive 'safe_mode' is deprecated since PHP
            |         | 5.3 and removed since PHP 5.4
       ----------------------------------------------------------------------
       ```
   
 * The findings in class-mainwp-utility.php are warnings, and shouldn’t prevent 
   anything from running.
 *  Thread Starter [hutman](https://wordpress.org/support/users/hutman/)
 * (@hutman)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/updatescheck-php-and-php-7-4/#post-12760222)
 * Thank you linux4me2. Will take another look to see if we can get 7.4 working 
   on our site and post back there.
 *  [linux4me2](https://wordpress.org/support/users/linux4me2/)
 * (@linux4me2)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/updatescheck-php-and-php-7-4/#post-12760284)
 * You’re welcome! Good luck with it. Please post back with your results. I was 
   planning on upgrading to PHP 7.4.x once they release a compatible version of 
   IonCube for it.
 * I didn’t look at the code, but the errors PHP CodeSniffer found may be in there
   for backward compatibility, and not run with PHP >= 7.x, so they may not be an
   issue.
 *  Thread Starter [hutman](https://wordpress.org/support/users/hutman/)
 * (@hutman)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/updatescheck-php-and-php-7-4/#post-12760319)
 * The lines are in wp-content/plugins/mainwp/class/class-mainwp-utility.php
 * Changing lines 2126 and 2163 from:
    – in protected static function StrToNum( 
   $Str, $Check, $Magic ) {
 * $Check += ord( $Str{$i} );
    to $Check += ord( $Str[$i] );
 * and
    – in protected static function CheckHash( $Hashnum ) {
 * $Re = $HashStr{$i};
    to $Re = $HashStr[$i];
 * Makes it work under php 7.4 (at least not emit errors and the return code is 
   0). Not sure about the validity of the fix for sure though, other than the suggestion
   based on the error output.
 *  Plugin Support [Bogdan Rapaic](https://wordpress.org/support/users/bogdanrapaic/)
 * (@bogdanrapaic)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/updatescheck-php-and-php-7-4/#post-12760338)
 * Hi [@hutman](https://wordpress.org/support/users/hutman/), since you have already
   opened a support ticket, we will continue there.
 * Hi [@linux4me2](https://wordpress.org/support/users/linux4me2/), PHP Compatibility
   Scanner is giving false positives since it doesn’t check code context. Deprecated
   functions are never executed on the unsupported version.
 *  [linux4me2](https://wordpress.org/support/users/linux4me2/)
 * (@linux4me2)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/updatescheck-php-and-php-7-4/#post-12760379)
 * Hi [@bogdanrapaic](https://wordpress.org/support/users/bogdanrapaic/)
 * Yes, I’ve noticed that with PHP CodeSniffer in the past. I suspected you had 
   them in there for backward compatibility.
 *  Thread Starter [hutman](https://wordpress.org/support/users/hutman/)
 * (@hutman)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/updatescheck-php-and-php-7-4/#post-12760442)
 * Code changes seem to have fixed it for us.

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

The topic ‘updatescheck.php and php 7.4’ is closed to new replies.

 * ![](https://ps.w.org/mainwp/assets/icon-256x256.png?rev=2734946)
 * [MainWP Dashboard: Self-hosted WordPress Management for Agencies](https://wordpress.org/plugins/mainwp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mainwp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mainwp/)
 * [Active Topics](https://wordpress.org/support/plugin/mainwp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mainwp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mainwp/reviews/)

 * 9 replies
 * 3 participants
 * Last reply from: [hutman](https://wordpress.org/support/users/hutman/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/updatescheck-php-and-php-7-4/#post-12760442)
 * Status: resolved