PHP 7.4 Warnings & Notices

I just downloaded and installed ClassicPress 1.1.4 on my local Dev server running PHP 7.4.8 and it generates multiple entries in my debug log mostly related to code that is deprecated in PHP 7.4, in particular the use of “get_magic_quotes_gpc()” which was deprecated for security reasons.

Expected behavior

ClassicPress should generate nothing in the debug log.

Current behavior

Here’s the log entries, this is from any page in the Admin. Frontend generates similar output:

debug.log

[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/load.php on line 655
[27-Aug-2020 23:05:37 UTC] PHP Notice: Trying to access array offset on value of type bool in /wp-includes/theme.php on line 2241
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /wp-includes/formatting.php:4381) in /wp-admin/includes/misc.php on line 1245
[27-Aug-2020 23:05:37 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /wp-includes/formatting.php:4381) in /wp-includes/option.php on line 919
[27-Aug-2020 23:05:37 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /wp-includes/formatting.php:4381) in /wp-includes/option.php on line 920
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Notice: Trying to access array offset on value of type bool in /wp-admin/includes/update.php on line 604
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 2442
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 2442
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /wp-includes/class-wp-editor.php on line 730
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /wp-includes/class-wp-editor.php on line 730
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /wp-includes/class-wp-editor.php on line 731
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /wp-includes/class-wp-editor.php on line 731
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 2442
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 2442
[27-Aug-2020 23:05:37 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /wp-includes/formatting.php on line 4381

Possible solution

The “magic quotes” stuff needs to be removed from the code. Curly braces in array and string offset access need to replaced with square bracket syntax. Array offset on value of type boolean could maybe add an isset() check first? I didn’t look into what might be causing the “headers already sent” warnings.

Steps to reproduce

  1. Install ClassicPress on a server running PHP 7.4
  2. Turn on Debugging
  3. Load pages either on backend admin or frontend
  4. See your log file fill up with magic quote deprecation notices

Context

Debugging my own plugins to make sure they’re compatible with ClassicPress. Note that the debug log is from a fresh install of ClassicPress, I haven’t yet installed any other plugins or themes.

2 Likes

Welcome @KMH! These issues are fixed in the latest development version of ClassicPress and are awaiting our next release 1.2.0-rc1 which is due out in a few days.

You can install directly from https://github.com/ClassicPress/ClassicPress right now and these errors will go away, or wait for the 1.2.0-rc1 release to be announced here and on other channels such as https://twitter.com/GetClassicPress.

4 Likes

Fantastic! I’ll go grab that dev release then.

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.