• Resolved advwebmaster777

    (@advwebmaster777)


    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=1

    When 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=2

    This 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=78

    In 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=100

    Is this an error, or is it normal behavior?

Viewing 1 replies (of 1 total)
  • Hello @advwebmaster777,

    Hope you are doing well.

    Actually, It is necessary to use shortcode. Without shortcode it doesn’t work. myCred Affiliate link value is stored in the user meta. It is the normal behavior of the plugin. This is not a bug.

    Let me know if you have any further questions. We will help you out.

    Thanks & Regards,
    WP Experts Support Team

Viewing 1 replies (of 1 total)
  • The topic ‘Issues with Shortcodes [mycred_affiliate_id] and [mycred_affiliate_link]’ is closed to new replies.