Open bilalmalkoc opened 5 years ago
I get the same error(( What is the reason can be?
I don't know. Can't find solution.
@bilalmalkoc the error appears only on my local server. I have tried to install the theme on my hosting and it was ok.
@kaganvmz it is interesting. Because it shows this error in real server, but works in localhost.
@bilalmalkoc It seems I have just solved the problem. Which version do you use? I have used 1.0.0 and I just installed 1.0.0-rc.1 and the issue disappeared.
@kaganvmz I am using latest release Are you sure want to use old version?
@bilalmalkoc No. But it helped to find where is the problem. The problem is on this commit https://github.com/richtabor/MerlinWP/commit/c199cd24a399868d7aa917796962acb549466692 If you do roll back everything will work even on the latest version.
@bilalmalkoc The plugin is printing output (text) to the browser, but then WordPress is redirecting the user (with wp_redirect) away from that page before the whole page is rendered. We can't start printing output and then redirect, or we'll get the error we see.
I've fixed this in my own experience by buffering the output of the script.
In my theme's functions.php file, put the following:
add_action('init', 'do_output_buffer'); function do_output_buffer() { ob_start(); }
And now the plugin is working on the right way even I use the latest version. @richtabor We need your help to understand why is it happens?
@kaganvmz it works now.
same +
It might be a temporary solution.
In case anyone wants to solve this issue in the lastest realease( 1.0.0 ), I solved it by passing second parameter as false
in merlin/class-merlin.php L373
like below:
wp_safe_redirect( menu_page_url( $this->merlin_url, false ) );
@sachyya What about Pull Request?
I found the fix for this problem.
wp-content\themes\yourtheme\merlin\class-merlin.php 373 line ))
wp_safe_redirect( admin_url( 'themes.php?page=merlin') );
A more proper way to remedy this until it is permanently fixed would be using WordPress hooks.
The plugin hooks to admin_init in order to make the redirect upon theme activation. We can see that on line 292 of the class-merlin.php (the latest release version).
add_action( 'admin_init', array( $this, 'redirect' ), 30 );
To remove that redirect without having to edit any of the original files we can add this line
remove_action( 'admin_init', array( $wizard, 'redirect' ), 30 );
at the bottom of the merlin-config.php (provided that your merlin-config.php is based on the merlin-config-sample.php found in this repo).
This will cleanly remove the redirect and we won't have to edit the original plugin class file.
I got this error when activating theme.
Warning: Cannot modify header information - headers already sent by (output started at /home/server/public_html/wp-admin/includes/plugin.php:1511) in /home/server/public_html/wp-includes/pluggable.php on line 1223 https://site.com/wp-admin/themes.php?page=mytheme-welcome