Title: php warnings
Last modified: September 20, 2023

---

# php warnings

 *  Resolved [gerold1968](https://wordpress.org/support/users/gerold1968/)
 * (@gerold1968)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/php-warnings-169/)
 * Hi again, php faatl errors are patched, but after further investigation I see
   a php warning:
 * AH01071: Got error ‘PHP message: PHP Warning: Cannot modify header information–
   headers already sent by (output started at [/var/www/vhosts/bettamberg.work/httpdocs/wp-content/plugins/content-control/classes/Base/Stream.php](https://t4.hpress.de:8443/smb/file-manager/code-editor?currentDir=%2Fhttpdocs%2Fwp-content%2Fplugins%2Fcontent-control%2Fclasses%2FBase&subscriptionId=101&file=Stream.php&redirect=%2Fsmb%2Flog-file%2Fbrowser%2Fid%2F101):
   88) in [/var/www/vhosts/bettamberg.work/httpdocs/wp-content/plugins/content-control/classes/Base/Stream.php](https://t4.hpress.de:8443/smb/file-manager/code-editor?currentDir=%2Fhttpdocs%2Fwp-content%2Fplugins%2Fcontent-control%2Fclasses%2FBase&subscriptionId=101&file=Stream.php&redirect=%2Fsmb%2Flog-file%2Fbrowser%2Fid%2F101)
   on line 68PHP message: PHP Warning: Cannot modify header information – headers
   already sent by (output started at [/var/www/vhosts/bettamberg.work/httpdocs/wp-content/plugins/content-control/classes/Base/Stream.php](https://t4.hpress.de:8443/smb/file-manager/code-editor?currentDir=%2Fhttpdocs%2Fwp-content%2Fplugins%2Fcontent-control%2Fclasses%2FBase&subscriptionId=101&file=Stream.php&redirect=%2Fsmb%2Flog-file%2Fbrowser%2Fid%2F101):
   88) in [/var/www/vhosts/bettamberg.work/httpdocs/wp-content/plugins/content-control/classes/Base/Stream.php](https://t4.hpress.de:8443/smb/file-manager/code-editor?currentDir=%2Fhttpdocs%2Fwp-content%2Fplugins%2Fcontent-control%2Fclasses%2FBase&subscriptionId=101&file=Stream.php&redirect=%2Fsmb%2Flog-file%2Fbrowser%2Fid%2F101)
   on line 69PHP message: PHP Warning: Cannot modify header information – headers
   already sent by (output started at [/var/www/vhosts/bettamberg.work/httpdocs/wp-content/plugins/content-control/classes/Base/Stream.php](https://t4.hpress.de:8443/smb/file-manager/code-editor?currentDir=%2Fhttpdocs%2Fwp-content%2Fplugins%2Fcontent-control%2Fclasses%2FBase&subscriptionId=101&file=Stream.php&redirect=%2Fsmb%2Flog-file%2Fbrowser%2Fid%2F101):
   88) in [/var/www/vhosts/bettamberg.work/httpdocs/wp-content/plugins/content-control/classes/Base/Stream.php](https://t4.hpress.de:8443/smb/file-manager/code-editor?currentDir=%2Fhttpdocs%2Fwp-content%2Fplugins%2Fcontent-control%2Fclasses%2FBase&subscriptionId=101&file=Stream.php&redirect=%2Fsmb%2Flog-file%2Fbrowser%2Fid%2F101)
   on line 70PHP message: PHP Warning: Cannot modify header information – headers
   already sent by (output started at [/var/www/vhosts/bettamberg.work/httpdocs/wp-content/plugins/content-control/classes/Base/Stream.php](https://t4.hpress.de:8443/smb/file-manager/code-editor?currentDir=%2Fhttpdocs%2Fwp-content%2Fplugins%2Fcontent-control%2Fclasses%2FBase&subscriptionId=101&file=Stream.php&redirect=%2Fsmb%2Flog-file%2Fbrowser%2Fid%2F101):
   88) in [/var/www/vhosts/bettamberg.work/httpdocs/wp-content/plugins/content-control/classes/Base/Stream.php](https://t4.hpress.de:8443/smb/file-manager/code-editor?currentDir=%2Fhttpdocs%2Fwp-content%2Fplugins%2Fcontent-control%2Fclasses%2FBase&subscriptionId=101&file=Stream.php&redirect=%2Fsmb%2Flog-file%2Fbrowser%2Fid%2F101)
   on line 71PHP message: PHP Warning: Cannot modify header information – headers
   already sent by (output started at [/var/www/vhosts/bettamberg.work/httpdocs/wp-content/plugins/content-control/classes/Base/Stream.php](https://t4.hpress.de:8443/smb/file-manager/code-editor?currentDir=%2Fhttpdocs%2Fwp-content%2Fplugins%2Fcontent-control%2Fclasses%2FBase&subscriptionId=101&file=Stream.php&redirect=%2Fsmb%2Flog-file%2Fbrowser%2Fid%2F101):
   88) in [/var/www/vhosts/bettamberg.work/httpdocs/wp-content/plugins/content-control/classes/Base/Stream.php](https://t4.hpress.de:8443/smb/file-manager/code-editor?currentDir=%2Fhttpdocs%2Fwp-content%2Fplugins%2Fcontent-control%2Fclasses%2FBase&subscriptionId=101&file=Stream.php&redirect=%2Fsmb%2Flog-file%2Fbrowser%2Fid%2F101)
   on line 73′, referer: [https://www.bettamberg.work/wp-admin/options-general.php?page=content-control-settings](https://www.bettamberg.work/wp-admin/options-general.php?page=content-control-settings)
 * Not urgent, but maybe you can help. Best Gerold
 * BTW: I very appreciate your fast responses and fixes! Outstanding. Thanks a lot!

Viewing 15 replies - 1 through 15 (of 20 total)

1 [2](https://wordpress.org/support/topic/php-warnings-169/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/php-warnings-169/page/2/?output_format=md)

 *  Plugin Support [Kim L](https://wordpress.org/support/users/kimmyx/)
 * (@kimmyx)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/php-warnings-169/#post-17067168)
 * Hi [@gerold1968](https://wordpress.org/support/users/gerold1968/),
 * Thanks so much for sharing! Daniel and the team are working very hard to patch
   some of the issues reported.
 * We appreciate your patience! 🙏
 *  Plugin Author [Daniel Iser](https://wordpress.org/support/users/danieliser/)
 * (@danieliser)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/php-warnings-169/#post-17068164)
 * [@gerold1968](https://wordpress.org/support/users/gerold1968/) – Are you seeing
   these everywhere, or only in the admin, or only when running our upgrades? Any
   extra info would be helpful. I’m about to push a large set of small changes meant
   to make things more strict in our code, and have patched about 7 other known 
   reported issues so this might have been resolved already.
 * Also from the looks these were during an upgrade. If your done with the upgrade
   you might likely not ever see them again anyways.
 * If your not seeing them any longer lets go ahead and mark this resolved for now.
 *  Thread Starter [gerold1968](https://wordpress.org/support/users/gerold1968/)
 * (@gerold1968)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/php-warnings-169/#post-17068201)
 * Hi, I see this all the time, repeated warnings. But only using the patched code
   you gave me. (Update from 2.0.6). I can´t see it on the 1. version.
 *  Plugin Author [Daniel Iser](https://wordpress.org/support/users/danieliser/)
 * (@danieliser)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/php-warnings-169/#post-17070346)
 * [@gerold1968](https://wordpress.org/support/users/gerold1968/) – Hmm, I went 
   through and the only time those things are called is during the upgrade in the
   admin. I can’t see how it would be run on the frontend at all, and shouldn’t 
   be running in the admin either.
 * Did you already open an email ticket and submit a login token? Would like to 
   see if I can work out what is happening.
 *  Thread Starter [gerold1968](https://wordpress.org/support/users/gerold1968/)
 * (@gerold1968)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/php-warnings-169/#post-17071359)
 * Ok, seems I was unclear. I see these warnings in server protocol, not on frontend
   or in the admin. If I roll back to version 1.1.10 I see no errors in protocol.
 * Upgrade on the neweset version 2.0.8 results in fatal error:
 * _(AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught Error: Call to a
   member function using_index_permalinks() on null in /wp-includes/rest-api.php:
   467\nStack trace:\n#0 /wp-includes/rest-api.php(530): get_rest_url()\n#1 /wp-
   content/plugins/content-control/inc/functions/compatibility.php(51): rest_url()\
   n#2 /wp-content/plugins/content-control/inc/functions/compatibility.php(99): 
   ContentControl\is_rest()\n#3 /wp-content/plugins/content-control/inc/functions/
   developers.php(217): ContentControl\is_frontend()\n#4 /wp-content/plugins/content-
   control/classes/Controllers/Frontend/Restrictions/QueryPosts.php(45): ContentControl\
   protection_is_disabled()\n#5/wp-includes/class-wp-hook.php(310): ContentControl\
   Controllers\Frontend\Restrictions\Que…’,)
 * So rolling back to 1.1.10
 *  Plugin Author [Daniel Iser](https://wordpress.org/support/users/danieliser/)
 * (@danieliser)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/php-warnings-169/#post-17072913)
 * [@gerold1968](https://wordpress.org/support/users/gerold1968/) – Ahh, thats a
   different error than the previous one. Can you check if there are any others,
   I’d love to patch them all in one go, the more we solve & the earlier we solve
   it the better for any body else who might run into this.
   Also that log is truncated(…),
   any chance of getting the full message or logs? I’m trying to figure out what
   is starting this process leading to an error, and the initial calls are buried
   in the …
 *  Plugin Author [Daniel Iser](https://wordpress.org/support/users/danieliser/)
 * (@danieliser)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/php-warnings-169/#post-17072917)
 * Ok so just based on what I do see, this function is where the error occurs is
   here: [https://developer.wordpress.org/reference/functions/get_rest_url/](https://developer.wordpress.org/reference/functions/get_rest_url/)
   
   Specifically it means `$wp_rewrite` is null when this line is called: `$wp_rewrite-
   >using_index_permalinks()` I’m back tracking up through our usage of that function,
   but I believe this means something is forcing our plugins query filters to be
   run much earlier than they should.In which case I need to find the source so 
   I can figure out how to best address it on our end.Those logs would be super 
   helpful.
 *  Plugin Author [Daniel Iser](https://wordpress.org/support/users/danieliser/)
 * (@danieliser)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/php-warnings-169/#post-17073290)
 * [@gerold1968](https://wordpress.org/support/users/gerold1968/) – I’ve added a
   new filter in v2.0.9 (will be out later tonight).
   This might be a temporary filter
   so lets not rely on it long term, but it should help us track down the sweet 
   spot for enabling query filters, or at least test the validity of that as the
   cause of the problem
 * When you update, please add the following filter somewhere in your sites code(
   Code Snippets plugin is great if you need something).
 *     ```wp-block-code
       add_filter( 'content_control/query_filter_init_hook', function () {
           return 'init'; // Try setup_theme, after_theme_setup, init or wp_loaded
       } );
       ```
   
 *  Thread Starter [gerold1968](https://wordpress.org/support/users/gerold1968/)
 * (@gerold1968)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/php-warnings-169/#post-17073316)
 * Thanks for all your efforts! This is outstanding. As I am in Austria/Europe we
   have a litte timeshift of 7-8 hours I think. During today I am going to try this
   and reply in detail. If you need anything else for debugging pls. tell me. I 
   will be more than happy to do so.
 *  Thread Starter [gerold1968](https://wordpress.org/support/users/gerold1968/)
 * (@gerold1968)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/php-warnings-169/#post-17073532)
 * Unfortunately, after updating to 2.0.8 (with your snippet installed) fatal error
   and site crashed:
 * Got error ‘PHP message: PHP Fatal error: Uncaught Error: Call to a member function
   using_index_permalinks() on null in /wp-includes/rest-api.php:467\nStack trace:\
   n#0 /wp-includes/rest-api.php(530): get_rest_url()\n#1 /wp-content/plugins/content-
   control/inc/functions/compatibility.php(51): rest_url()\n#2 /wp-content/plugins/
   content-control/inc/functions/compatibility.php(99): ContentControl\\is_rest()\
   n#3 wp-content/plugins/content-control/inc/functions/developers.php(217): ContentControl\\
   is_frontend()\n#4 /wp-content/plugins/content-control/classes/Controllers/Frontend/
   Restrictions/QueryPosts.php(45): ContentControl\\protection_is_disabled()\n#5/
   wp-includes/class-wp-hook.php(310): ContentControl\\Controllers\\Frontend\\Restrictions\\
   Que…’, referer: [https://xxxxx/wp-admin/admin.php?page=edit-snippet&id=244](https://xxxxx/wp-admin/admin.php?page=edit-snippet&id=244)
 * Snippet 244 is your provided filter.
 * Rollback to 1.1.10
    -  This reply was modified 2 years, 8 months ago by [gerold1968](https://wordpress.org/support/users/gerold1968/).
 *  Plugin Author [Daniel Iser](https://wordpress.org/support/users/danieliser/)
 * (@danieliser)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/php-warnings-169/#post-17074507)
 * [@gerold1968](https://wordpress.org/support/users/gerold1968/) – Sorry for the
   confusion. I didn’t get the update out as I ran into a longer fix for another
   issue I was trying to get in. I’m about to push v2.0.9 shortly which will add
   that filter.
 * That said I’m concerned about finding what plugin is actually causing this error.
   Let me explain.
 * We call rest_url(), a WP function that then looks for the global $wp_rewrite.
   
   The global $rewrite is set within `wp-settings.php` file which is one of the 
   first loaded. There are only a handful of actions which can be used before that
   time.
 *     ```wp-block-code
       sanitize_comment_cookiesplugins_loadedplugin_loadedmuplugins_loadednetwork_plugin_loadedmu_plugin_loaded
       ```
   
 * The error suggests a plugin, theme or custom code is running post type queries
   this early, there are very few valid reasons to do so. Either they have a valid
   use case we need to account for, or someone should let them know so they might
   address it long term.
 * The filter I gave will hopefully prevent our code from running that early, thus
   causing that wp function to not run either.
 * Look for it in the next few hours.
 *  Plugin Author [Daniel Iser](https://wordpress.org/support/users/danieliser/)
 * (@danieliser)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/php-warnings-169/#post-17074537)
 * [@gerold1968](https://wordpress.org/support/users/gerold1968/) I wanted to add,
   you can also install the Health Check & Troubleshooting plugin, with that you
   can enable Troubleshooting mode on our plugin. This will deactivate (only for
   you) all the other plugins.
   Then you can follow the following to narrow down 
   the conflict:
    1. Activate other plugins a few at a time.
    2. Test if it works. If so, return to step #1.
    3. If it breaks, deactivate each plugin you just enabled one at a time.
    4. Test if it works. If not, return to step #3.
    5. If it works, the last plugin deactivated is a conflict.
    6. Deactivate that one, return to step #1 skipping known conflicts.
    7. Follow this until you have a list of all the conflicting plugins.
 *  Thread Starter [gerold1968](https://wordpress.org/support/users/gerold1968/)
 * (@gerold1968)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/php-warnings-169/#post-17078064)
 * Hi, I have updated to 2.0.9 and ould trace the error down to the Plugin **WooCommerce
   Order Status Manager** by SkyVerge.
 *  Plugin Author [Daniel Iser](https://wordpress.org/support/users/danieliser/)
 * (@danieliser)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/php-warnings-169/#post-17078548)
 * [@gerold1968](https://wordpress.org/support/users/gerold1968/) – Very good. Can
   you give me a quick idea of how you used that plugin? Probably straight forward
   but want to try and duplicate it in the same way your seeing issues.
 * Did this code not help at all?
 *     ```wp-block-code
       add_filter( 'content_control/query_filter_init_hook', function () {
           return 'wp_loaded'; // Try setup_theme, after_theme_setup, init or wp_loaded
       } );
       ```
   
 *  Thread Starter [gerold1968](https://wordpress.org/support/users/gerold1968/)
 * (@gerold1968)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/php-warnings-169/#post-17079187)
 * Hi, I am using this plugin for what it is intended to do: create custom order
   statusses. I cannot imagine, why there is any incompatibilty, but the plugin 
   is used quite commonly…
 * And yes: your code helps. No more errors with that!

Viewing 15 replies - 1 through 15 (of 20 total)

1 [2](https://wordpress.org/support/topic/php-warnings-169/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/php-warnings-169/page/2/?output_format=md)

The topic ‘php warnings’ is closed to new replies.

 * ![](https://ps.w.org/content-control/assets/icon-256x256.gif?rev=2968535)
 * [Content Control - The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks & More](https://wordpress.org/plugins/content-control/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/content-control/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/content-control/)
 * [Active Topics](https://wordpress.org/support/plugin/content-control/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/content-control/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/content-control/reviews/)

 * 20 replies
 * 4 participants
 * Last reply from: [gerold1968](https://wordpress.org/support/users/gerold1968/)
 * Last activity: [2 years, 8 months ago](https://wordpress.org/support/topic/php-warnings-169/page/2/#post-17095997)
 * Status: resolved