pull down to refresh
Thank you for the detailed & step-by-step response! Phase 1 I have tried, although I will make a note to the plugin devs that it would be good to have an option to have specific referral links i.e. site.com/ref/code. Currently the Referral Codes plugin creates them simply as site.com/code which is the same format as any other page. However, I did have Rocket.net support turn off Cloudflare for the specific URL's and it didn't work, so that's probably not the issue anyway. Phase 2 & 3 I have also tried in different formats (and solutions via different LLM's - I'm not a dev myself, unfortunately), but I'll definitely give your specific instructions a go.
One thing that I didn't mention - ChatGPT said it shouldn't make a difference in how the links act - was that there was also a PHP error that came up in debugging:
PHP Deprecated: Creation of dynamic property WC_Coupon::$lws_referralcode
Chat: Not critical for functionality yet, but in PHP 8.2+ dynamically adding properties to objects is deprecated. The plugin is trying to attach $lws_referralcode directly to the WC_Coupon object. This should ideally be stored in meta instead:
php Copy code $coupon->update_meta_data('lws_referralcode', $code);
Chat: This doesn’t directly break the cookie behavior, but it’s good to fix for future PHP compatibility.
In any case, I'll follow your instructions and see where it takes me. Can't guarantee I'll get to it tonight (has been a long day), but tomorrow at the latest!
reply
Step by Step solution
Phase 1: Quick Wins (Start Here - 70% Success Rate)
yoursite.com/*ref*
→ Cache Level: BypassPhase 2: Server-Level Issues (25% Success Rate)
.htaccess
to.htaccess-backup
Phase 3: WordPress Code Solutions (30% Success Rate)
functions.php
file:.htaccess
:Note Hosting-Specific Quick Fixes
Advanced Solutions (If above Steps Fail)
/wp-content/mu-plugins/
force-referral-early.php
:To make sure this never happens again