Fatih Telis
asked 8 years ago

Hi,

I purchased your plugin “DW Reactions Pro” today, but when I was trying to activate the plugin, it gave the error:

> Plugin could not be activated because it triggered a fatal error.
>
> Fatal error: Can’t use function return value in write context in /home/prnkcp/public_html/wp-content/plugins/dw-reactions-pro/inc/class.main.php on line 203

I use “Bimber” theme on my site.
http://themeforest.net/item/bimber-viral-buzz-wordpress-theme/14493994

How can I solve this problem?

Thanks.

3 Answers
DominicStaff
answered 8 years ago

I have checked and I think it some issue with your theme, In your case, you can try the following solution:
Open the class.main.php file and find the line 202
Replace the following code:

$count = empty( get_post_meta( $post_id, 'dw_reaction_' . $reaction ) ) ? count( get_post_meta( $post_id, 'dw_reaction_' . $reaction ) ) : 0;

With new code:

$count1 = get_post_meta( $post_id, 'dw_reaction_' . $reaction );
$count = empty( $count1 ) ? count( get_post_meta( $post_id, 'dw_reaction_' . $reaction ) ) : 0;

If you still face their issue, you can send me username & password of your site for further checking.
Hope this help!

Fatih Telis
answered 8 years ago

The code in line 202 is a little different than you mentioned.

Line 202 in the plugin:

$count = !empty( getpostmeta( $postid, ‘dwreaction’ . $reaction ) ) ? count( getpostmeta( $postid, ‘dwreaction’ . $reaction ) ) : 0;

Difference: emtpy >> !empty

I changed this line with the code you gave. Then, same error is shown for line 218, which is exactly same with line 202. I also changed that line with the code that you gave. Now, the error has gone and I can activate the plugin. But it doesn’t work properly. When I click on any reaction, it does not increase the count number.

Dominic Staff
replied 8 years ago

Please send me username & password of your site for further checking.

Fatih Telis
replied 8 years ago

I couldn’t find how to send it as a private message. May I take your email or is there a way for sending message?

Dominic Staff
replied 8 years ago

Yes, you can send me via email: [email protected]

Fatih Telis
replied 8 years ago

Thank you. I sent a mail.

DominicStaff
answered 8 years ago

I got your email and we are checking your site, we will fix and let me know about it.

Fatih Telis
replied 8 years ago

Thank you. I’m waiting for you. I make some trials on the plugin, and latest situation is:

– Fatal Error has gone if you make the change you mentioned on lines 202 & 218, but you have to use “!empty” instead of “empty” for seeing count numbers.

– Counting works OK if you are “logged in”.
– If you are not logged in, you can give a vote. But, after refreshing the page, this vote disappears even you deactivate “Users must be registered and logged in to add reaction.” So, there is a problem about counting for users who are not registered/logged in.

Dominic Staff
replied 8 years ago

Please accept my apology for the delay in getting back to you, you can send me your FTP for further checking, I will re-install the plugin, to check your Fatal Error. Because I have installed the plugin on our demo and it still working fine.

Powered by DW Question & Answer Pro