Increment user meta data by 1 each time a page is visited
This line is wrong. if(!get_user_meta(bp_displayed_user_id(), ‘page_visits’, true) >= 0){ That is “not value greater than or equal to zero”. The NOT operator has precedence over the greater than comparison. So, assuming the value is a number, then NOT a number evaluates to false. Then you are comparing false to greater than or equal to zero. … Read more