Hi AleJuliet,
We are facing a very similar problem:
Warning: Cannot modify header information - headers already sent by (output started at /home/revendot/public_html/revendoch/wp-includes/functions.php:4757) in /home/revendot/public_html/revendoch/wp-content/plugins/jwt-authentication-for-wp-rest-api/public/class-jwt-auth-public.php on line 94
The issue seems to be originated somehow in the plugin JWT Authentication for WP REST API (plugins/jwt-authentication-for-wp-rest-api).
I’ve already reported the issue also on the plugin’s support forum. Please see:
https://wordpress.org/support/topic/warning-cannot-modify-header-information-class-jwt-auth-public-php-on-line-94/
Let’s hope the developer publishes a fix soon!
I was having the same issue after installing this today and found this this warning is because Functions that send/modify HTTP headers must be invoked before any output is made.
What i have done for now to work around this was to edit the plugin code.
In the word press plugins folder go to jwt-authentication-for-wp-rest-api/includes/class-jwt-auth.php
If you then find the line function define_public_hooks()
Change this line
$this->loader->add_filter('rest_api_init', $plugin_public, 'add_cors_support');
To
$this->loader->add_filter('init', $plugin_public, 'add_cors_support');
This will fix this issue for now
-
This reply was modified 4 years, 1 month ago by
bullantt.
-
This reply was modified 4 years, 1 month ago by
bullantt.
Thank you @bullantt for your contribution.
I have adopted your fix and set this plugin under GIT control so that future updates of this plugin won’t override this fix, in case the developers don’t include it already in the update, which seems the most probable thing.
We are migrating our WP online shop to Shopware since some months ago, so this is actually a legacy topic for us.