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
- Install ClassicPress on a server running PHP 7.4
- Turn on Debugging
- Load pages either on backend admin or frontend
- 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.