How do we solve the plugin activation error in wordpress - wordpress

The plugin generated 1 characters of unexpected output during
activation. If you notice “headers already sent” messages, problems
with syndication feeds or other issues, try deactivating or removing
this plugin.
While activating the plugin in wordpress i got the above error.
Don't know why it's happening.
Kindly suggest some ideas.
Thanks

Your plugin is outputing something on activation. Validate that the included PHP files have no extra whitespace outside the <?php ?> tags and make sure there's no printing happening anywhere.
A hacky solution is to use ob_start() and ob_end_clean() during the activation. It might hide it but it really doesn't fix the problem.
Plugin activation and deactivation processes should not print anything from PHP. If you need to get some info out of the process consider logging.
If the plugin is not yours, try to contact the original developer about the issue.

Related

Does anyone know how to fix this?

My website http://edmcginnis.net is down and showing the following:
Parse error: syntax error, unexpected 'namespace' (T_NAMESPACE), expecting identifier (T_STRING) in /home/content/94/11030494/html/wp-content/plugins/contact-form-7/includes/rest-api.php on line 15
I thought it was the contact form 7 plug-in so I disabled it via ftp. That didn't work so I updated the php to 8.0 and when that didn't work I disabled all plug-ins. Still nothing.
Can anyone help me get this site back online? I'm not really sure what to do next. Thanks
Revert all code back to how it was before it was broken, including PHP. Someone probably upgraded a PHP, WP, plugin, or accidentally edited line 15 of the CF7 rest api file. If you are unable to debug you may need to reset your code.
One last thing to remember is that if you have anything in your theme that relies on a plugin function to work it will kill your site too. Disabling plugins isn't always a good way to remove issues but it will identify them.

My Wordpress is showing a blank page in the editor, how can I fix this?

I manage a Wordpress site for a client, after trying to resolve some updates I cannot seem to edit anything inside the editor anymore. Everything is blank (see image). The site itself is still up and working fine. Has anyone ever encountered this?
There are tons of reasons, why this could be happened. Like #jiali sent you a very helpful link, I would say to try and open the debugger: inside wp-config.php file search for define('WP_DEBUG', false); and change the value to true. Then, you propably would see what causing the error and where (either plugin or custom code, or maybe plugins conflict)
Okay so in this case the problem was (when I checked the error log) that the update was not properly installed. Deactivated the plugins inside PHP MyAdmin and then reinstalled Wordpress manually onto site.

Getting "An active PHP session was detected" critical warning in wordpress

A PHP session was created by a session_start() function call. This interferes with REST API and loopback requests. The session should be closed by session_write_close() before making any HTTP requests.
In most cases, the real reason of the above errors is the incorrect mechanism for using PHP sessions within plugins or themes when they are using the session_start() function.
Now you need to identify what plugin cause this issue by deactive your plugin one by one.
Then in that plugin, you need to find a piece of code similar to this:
if ( !session_id() ) {
session_start();
}
then change it to:
if ( !session_id() ) {
session_start( [
'read_and_close' => true,
] );
}
Then you are done. In most cases, this will fix the issue. Good luck!
Had the same issue due to WP Hotel Booking plugin use. I fixed it! Took me a while to find a plugin it caused and editing the plugin .php didn’t help. But I fixed it adding a snippet of code to functions.php of the CHILD theme:
function mymodule_curl_before_request($curlhandle){
session_write_close();
}
add_action( ‘requests-curl.before_request’,’mymodule_curl_before_request’, 9999 );
There's a background to this solution at: Make WordPress Core, Loopback request fails if headers set in curl
(Original link in German doesn't exist anymore and was referring to this other related discussion.)
Often this critical issue is caused by conflict in SESSION when using the PHP session_start() function.
For example I have used a Calculation plugin in Wordpress and after Wordpress version update this error occured.
So I detected the plugin which causes this issue as activated/deactivated plugins one by one.
SOLVING these errors: In File manager of my site I got the .php files of the plugin and searched for session_start() function. Where it was used after it I used this function in a row session_write_close();
Source of the function
Regards!
To chime in with my own experience here, this very issue was resolved by turning off the “cross sell pop up” module of Shopengine Pro. Indeed there’s a session start in the php. I have notified them about this today. Maybe it’ll help someone else meantime!
I found out that you get these critical health warnings when you install a plugin or a plugin Adon and fail to complete its setup to the end. So the simplest solution is to deactivate the plugin or complete the plugin set-up. My errors were caused by a Woocommerce Adon which I deactivated and when I refreshed the health status the two issues were gone. I hope this helps.
#David M., If the issue is specifically happening with the Cross-Sell Popup Module of the ShopEngine PRO plugin, then it can be fixed by adding a small piece of code on the cross-sell-popup.php file that will read and close the session of the Cross Sale Popup module immediately.
Big Thanks to #thống nguyễn for the solution.
On the line 18th, from where the session starts, replace the session_start() with the following code:
session_start([
'read_and_close' => true
]);
Hope it will help.
If you tried the above and it's not working try to change the php version from your hosting's CPanel
I had the same error ande i changed the php version from 7.4 to 7.3 and it all went well

WordPress RSS Feed Returning 404

We have an RSS feed (or we should have) via wordpress but it is just giving using a 404 Page Not Found on load - http://www.warrenaccess.co.uk/feed/rss2
We have tried changing back to default theme and deactivating all plugins to see if we could find an issue but it still didn't work.
Does anyone have any idea what could be causing this?
My hunch is that you don't actually have any blog posts, but you are using WP as a pseudo-CMS. From having looked at the feed and network conditions (CDN / cloud hosting can sometimes ignore feed content), things are working as they should.
Your 404 does provide some useful information about the feed:
<lastBuildDate>Fri, 11 May 2012 10:14:42 +0000</lastBuildDate>
Which is awhile ago, relatively speaking. I'm guessing that your site content is all based on pages, which don't and shouldn't actually show up in RSS feeds.
To fix the problem, you'd have to make some blog posts or try this plugin or its variant:
http://wordpress.org/extend/plugins/rss-includes-pages/
Edit: turns out WP syndication setting was set to show -1 posts. Fixed by setting it > 0.
I was using custom post type for my primary website content, so to include more post types use this in your functions file:
function customfeed_request( $request ) {
if ( isset($request['feed']) && !isset($request['post_type']) ) {
$request['post_type'] = array('post', 'my_custom_post_type');
}
return $request;
}
add_filter('request', 'customfeed_request');
I spent a lot of time fixing this; I hope this helps someone.
The scenario: when Permalinks is off, I can access the RSS Feed url "/?feed=rss2" without error, but enabling the Permalinks the above returns the feed content and after this, an 404 error code. It is possible see the error code response under network browser inspection tools, like "Web Developer" plugin of Chrome.
Well, the feed client does not understand this error code and raises an exception, breaking the consumption page.
I traced the problem to the WP Super Cache. I think the cache does not generate the feed response content, but it tries to get the cache file and it don´t exist, resulting in error 404.
The simple solution, disable feed cache in "Advanced" topic of the "WP Super Cache Settings", checking "Feeds (is_feed)" options and save.
Perhaps your issue is in WP Super Cache.
I just had a similar issue happen to me but perhaps the cause could be a bit different. I made a custom RSS feed. I was getting the page 404 error.
The reason is that I was not doing a flush rewrite (https://codex.wordpress.org/Function_Reference/flush_rewrite_rules). Can do this by going to settings > permalinks and then just updating it. Then feed is available.
Was the solution for me anyhow.
have you checked your .htaccess
Turn it off by renaming it to something jibberish
If that doesn't help check your wp-config.php
What are we suppose to do if the product URLs are returning 404 i.e. www .abc .com/product /name/feed/ Rest everything is fine on web but only product feed URLs are 404. Also can it cause any performance issues and rank my website down?

after wordpress site hacked only displaying white page

Recently a clients site got hacked on Rackspace and since then I have been trying to recover certain items on the site.
I have cleaned everything up and did a framework upgrade.
Now when I am trying to install something new, make changes, or simply post an update it renders a white page after success...
I have disabled all my plugins and still the same issue.
Have any of you experienced this before and what are some of the steps you could give to recover this...
Thanks in advanced.
Ok, so I have managed to find some good tips that has helped.
Ultimately disabled all plugins, reinstalled wordpress, there were some issues in the following files.
wp-config.php, pluggable.php and class.wp-scripts.php - all these missed a closing ?>
And make sure that your themes functions.php file doesn't have any whitespace.

Resources