Black Friday sale! Get 25% off WPSP Pro! Discount automatically applied at checkout.

[Resolved] PHP Error

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support PHP Error

Tagged: ,

  • This topic has 5 replies, 2 voices, and was last updated 1 year ago by Tom.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #11880
    Michael
    Participant

    Got error 'PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /.../wp-content/plugins/wp-show-posts-pro/modules/social-sharing/love-it.php on line 122\n'

    In my log files I always find this error message. In line 122 a PHP error is generated in the module love it.php.

    #11881
    Michael
    Participant

    PHP-Version: 7.2.24
    Show Posts Pro-Version: 0.5

    #11882
    Michael
    Participant

    Line 122:

    		$post_meta_users = get_post_meta( $post_id, "_wpsp_user_IP" ); 
    		if ( count( $post_meta_users ) != 0 ) { 
    #11934
    Tom
    Keymaster

    Hi there,

    Thanks for reporting this.

    Can you try replacing this:

    if ( count( $post_meta_users ) != 0 ) {

    With this?:

    if ( count( (array) $post_meta_users ) != 0 ) {

    Does it fix the warning?

    #11942
    Michael
    Participant

    It works! Thank you very much!

    #11961
    Tom
    Keymaster

    Awesome – thanks for the heads up! 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.