Issues with Shortcodes [mycred_affiliate_id] and [mycred_affiliate_link]
-
Please help me understand the behavior of the shortcodes [mycred_affiliate_id] and [mycred_affiliate_link]. I have enabled Referrals in the Hook and set up to earn points for Referring Visits. For Referral Links, I chose “Assign numeric referral IDs to each user.”
Even when I simply access siteurl/?mref=2 without using the shortcode, points are not awarded to the user with WordPress UserID 2.
When logged in as the user with UserID 2 and accessing the page containing the [mycred_affiliate_id] and [mycred_affiliate_link] shortcodes, the frontend displays:
[mycred_affiliate_id] -> 2
[mycred_affiliate_link] -> siteurl/?mref=1When I accessed siteurl/?mref=1 in incognito mode, points were awarded to the user with WordPress UserID 2.
Upon checking, [mycred_affiliate_id] always matches the WordPress UserID. It seems that [mycred_affiliate_link] is written in the usermeta table in the order it is displayed on the frontend after the site user logs in, with the key and value of mycred_affiliate_link.
I, as the administrator (WordPressUserID=1), displayed the shortcode page on the frontend after the aforementioned user (WordPressUserID=2).
As a result, when I accessed the page with [mycred_affiliate_id] and [mycred_affiliate_link] shortcodes as the administrator (WordPressUserID=1), the frontend displayed:
[mycred_affiliate_id] -> 1
[mycred_affiliate_link] -> siteurl/?mref=2This caused a reversal. The operation of writing the key and value of mycred_affiliate_link in ascending order in the usermeta table when accessed from the frontend leads to a discrepancy with the WPUserID.
If there are 100 WP users, and few users display the page containing [mycred_affiliate_link], it results in:
WordPress User ID -> 100
[mycred_affiliate_id] -> 100
[mycred_affiliate_link] -> siteurl/?mref=78In this case, when there is access to siteurl/?mref=78, points go to the user with WPUserID=100. If this user generates a URL like siteurl/?mref=[mycred_affiliate_id] using the [mycred_affiliate_id] shortcode, no one gets the points.
The expected behavior should be:
WordPress User ID -> 100
[mycred_affiliate_id] -> 100
[mycred_affiliate_link] -> siteurl/?mref=100Is this an error, or is it normal behavior?
- The topic ‘Issues with Shortcodes [mycred_affiliate_id] and [mycred_affiliate_link]’ is closed to new replies.