New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report: Site vanished after update from v160902 to v160915 #273

Closed
juniorBR opened this Issue Sep 22, 2016 · 10 comments

Comments

Projects
None yet
5 participants
@juniorBR

juniorBR commented Sep 22, 2016

Hi,

After updating the plugin from the v160902 to v160915, my website vanished, only showed a blank screen. Then I deleted the plugin using FTP and it went back https://goo.gl/Ku9XZn

When trying to fix the problem, there was a Fatal Error message that I don’t know if it is directly related to the updating problem or related to my attempts to fix it.

Fatal error: Uncaught Error: Call to undefined function stcr\is_plugin_active() in /var/www/mysite.com.br/wp-content/plugins/subscribe-to-comments-reloaded/utils/stcr_upgrade.php:231 Stack trace: #0 /var/www/mysite.com.br/wp-content/plugins/subscribe-to-comments-reloaded/utils/stcr_manage.php(316): stcr\stcr_upgrade->_import_crn_data() #1 /var/www/mysite.com.br/wp-content/plugins/subscribe-to-comments-reloaded/utils/stcr_manage.php(302): stcr\stcr_manage->upgrade() #2 /var/www/mysite.com.br/wp-content/plugins/subscribe-to-comments-reloaded/wp_subscribe_reloaded.php(37): stcr\stcr_manage->maybe_update() #3 /var/www/mysite.com.br/wp-content/plugins/subscribe-to-comments-reloaded/subscribe-to-comments-reloaded.php(36): stcr\wp_subscribe_reloaded->__construct() #4 /var/www/mysite.com.br/wp-content/plugins/subscribe-to-comments-reloaded/subscribe-to-comments-reloaded.php(64): stcr\stcr_subscribe_reloaded->__construct() #5 /var/www/mysite.com.br/wp-settings.php(273) in /var/www/mysite.com.br/wp-content/plugins/subscribe-to-comments-reloaded/utils/stcr_upgrade.php on line 231

@Reedyseth

This comment has been minimized.

Member

Reedyseth commented Sep 22, 2016

I theory this error should only raise if the function is_plugin_active() is used within a template file. On this case the error ocurr within the Admin page where is should work without any problem.

I tried to replicate the issue by installing the comment reply plugin, but that plugin does not work on the latest wordpress version. So my suggestions is to delete that plugin.

Do you have pending subscriptions to import from that plugin?

@Reedyseth Reedyseth self-assigned this Sep 22, 2016

@juniorBR

This comment has been minimized.

juniorBR commented Sep 22, 2016

I didn't understand very well... Are you saying that "Subscribe to Comments Reloaded" v160915 are not compatible with WP4.6.1? Because this is the only plugin I have to manage subscriptions and notifications from comments. I have it also installed in other sites, but I am really afraid to update. This is another website I have that uses Subscribe to "Comments Reloaded" plugin https://goo.gl/uvLdbj

@Reedyseth

This comment has been minimized.

Member

Reedyseth commented Sep 22, 2016

I didn't understand very well... Are you saying that "Subscribe to Comments Reloaded" v160915 are not compatible with WP4.6.1?

It is compatible with that version and up to the latest WordPress development version. What I tried to say is that error only raises when the plugin detects an installation of the plugin Comment Reply or when that plugin was previously used.

You can test that by removing this line from the file subscribe-to-comments-reloaded/utils/stcr_manage.php

Also I installed the Comment Reply Notification plugin on my PHP 5.6 version and is using old MySQL version functions. I think that by deleting that line of code you should be OK.

@juniorBR

This comment has been minimized.

juniorBR commented Sep 24, 2016

Okay, I will try!

But the same problem may not happen again in the future updates of the plugin?

Thanks

@Reedyseth

This comment has been minimized.

Member

Reedyseth commented Sep 29, 2016

But the same problem may not happen again in the future updates of the plugin?

@juniorBR , no, that won't happend again, I will deprecate the importantion of that plugin subscriptions.

@mglbrignola

This comment has been minimized.

mglbrignola commented Oct 1, 2016

Just to let you know I experienced the same error. Solved it by removing the suggested line.

@AlphakDotNet

This comment has been minimized.

AlphakDotNet commented Dec 30, 2016

Hi!
I had a very similar error in one of my sites. Logs were flooded of this kind of messages:

[29-Dec-2016 20:48:40 UTC] PHP Fatal error: Call to undefined function stcr\is_plugin_active() in /path/to/wordpress/wp-content/plugins/subscribe-to-comments-reloaded/utils/stcr_upgrade.php on line 158

I tried a quick and dirty analysis of the situation - please forgive me if I'm wrong, I have knowledges about PHP but not about the Wordpress development framework.

The log says function called is stcr\is_plugin_active() (so function is in namespace stcr).
But when searching for this function content in the subscribe-to-comments-reloaded code, it does not appear anywhere. This function appears nevertheless in the base Wordpress code. So I assume this is only a namespace issue, because the faulty function is called without namespace reference, hence it is seached inside the stcr namespace (declared at the beginning of stcr_upgrade.php).

In order to verify this and make a durable workaround, I created and activated a temporary plugin with the following inside:

namespace stcr;
function is_plugin_active($plugin) {
	return \is_plugin_active($plugin);
}

... and the error vanished.
Then I deactivated the plugin and the error was not appearing anymore. I assume the check is not run every time the subscribe-to-comments-reloaded plugin is loaded...

Anyway, I think there is indeed a bug in stcr_upgrade.php and that replacing is_plugin_active by \is_plugin_active on lines 158, 231, 378 might fix the issue definitively.

@felixonmars

This comment has been minimized.

felixonmars commented May 11, 2017

Replacing is_plugin_active by \is_plugin_active doesn't work here, though. The SQL fix is needed and the function needs to be fixed in a different way. For my installation I just removed the function (so the check is always true), but there must be a cleaner way...

@Reedyseth

This comment has been minimized.

Member

Reedyseth commented May 11, 2017

Like I said before, I will remove this funciton to import the comments from the comment reply plugin and eventually this error will disappear.

Thank you guys for your effort on solving this.

@Reedyseth

This comment has been minimized.

Member

Reedyseth commented Dec 21, 2017

This issue is fix on commit 226ce9d

@Reedyseth Reedyseth closed this Dec 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment