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.
How can I solve this problem?
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!
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.
I got your email and we are checking your site, we will fix and let me know about it.
Please login or Register to submit your answer