Avatar
Kontext
0271e1b9ad97e3f15ed742327c5cea3493bd66280611638b7a0f6e28ad8cff90
LOVER WRITER FREEDOM FIGHTER / human doing @ SATOSH.EE BOOK OUT NOW: https://www.kontext.store/product/a-stoic-resurrection/ Use the promo code "nostr" for 4 EUR off the hardcover! The .PDF is CC-BY, Name Your Price :)

Rocket.net support said they can't even completely disable it 🤦‍♂️ Only specific URL paths

Replying to Avatar Kontext

Web developers / Wordpress experts / Code wizards! I need help with the following issue: WooCommerce referral links only trigger on 2nd visit.

25k sats + lifetime Gold membership on SATOSH.EE and my eternal gratitude to whoever helps me solve the problem.

I’m running into an issue with referral links on a WooCommerce site (WordPress + WooRewards paid version + Referral Codes (WooRewards and Referral Codes are LongWatchStudio plugins); also tested with the Affiliates plugin - the issue also occurred with that one). The goal is to establish referral bonds between users for a loyalty/affiliate program.

The problem:

Referral logic only triggers on the second visit to a referral URL.

On first visit, cookies for tracking (e.g., lwsadmsession…) either don’t appear or the plugin code never runs.

Reloading the same link triggers the referral logic as expected.

This behavior occurs with multiple referral plugins, not just WooRewards.

What I’ve tried:

Disabled all other plugins, switched to default theme

Cloudflare + Rocket.net: disabled query string caching

.htaccess rules to bypass server caching

Early hook code to force session/logic execution (relied on ChatGPT to come up with those codes, would not be surprised if they were faulty in and of themselves)

Verified no Varnish or server-level caching interference

Developer insight from WooRewards:

“Our code is never called. Something else takes charge before WordPress, and (even if unintentional) fakes our redirection.”

Looking for ideas why referral plugin code isn’t executing on first visit, even when cookies or sessions should be available.

Happy to provide more details, just drop a comment or email me kontext@satosh.ee

Thanks!

#asknostr #devs #wordpress #woocommerce #bounty

25k sats + a lifetime membership upgrade at nostr:nprofile1qyd8wumn8ghj7cn0wd68ytnvv43hgatjd9n8jtnwv46z7qg4waehxw309a5xjum59ehx7um5wghxcctwvsqzqr5g4trndr2lykpyx7pxqs4nlvazdgfx70v9wcvvddn99204h7s27tcduj still up for grabs to whoever can find me a working solution:

The issue seems to be that referral cookie attempts to set too late, after WooCommerce sessions have started or headers have been sent. On first visit, no session exists → cookie cannot be set → referral only works on second visit.

What I've tried to do is - launch referral logic at the earliest hooks - many times (even before posting this problem here) with different code snippets from ChatGPT, Claude, now also Lumo and Duck.ai (which, admittedly, also uses ChatGPT) but none of the solutions work. The end result is still the same.

#asknostr #wordpress #woocommerce #devs

nostr:nevent1qvzqqqqqqypzqqn3uxu6m9lr790dws3j03ww5dynh4nzsps3vw9h5rmw9zkcelusqyt8wumn8ghj7etyv4hzumn0wd68ytnvv9hxgtcpzemhxue69uhks6tnwshxummnw3ezumrpdejz7qgswaehxw309ahx7tnnw3ezucmj9uqzptp5jayaqmpfrf98yxnlfqew5hxe2f0dpt0xm4yrqveslpenregda7xxuf

Replying to Avatar Dune Messias

Well according to Chat (again) this is a known issue: plugins like WooRewards don’t run on the first visit via a referral URL — the plugin’s code doesn’t execute until a second visit, which suggests something is bypassing WordPress early on.

From reddit: “It usually comes down to caching and when WooCommerce sessions actually start. What helped me was hooking into WordPress really early, like on init or wp_loaded, to catch the referral info before any caching or redirects happen."

Immediate Fixes to Try

1. Ensure Cloudflare Excludes Referral URLs from Cache

Cloudflare’s default behavior often serves cached pages for URLs with query parameters unless explicitly configured otherwise. You can address this by:

• Using Cache Rules to bypass caching when the query string contains your referral parameter. Example rule: (If http.request.uri.query contains "ref", then bypass cache.)

2. Use Cloudflare Transform Rules for Query Ignoring

If you’re using “Cache Everything,” query strings may still get cached. Transform Rules can help you ignore specific query parameters — like ref — to ensure each visit is treated as unique

3. Launch Referral Logic at the Earliest Hooks

Move your referral tracking code to the earliest stages of WordPress execution — ideally in an mu‑plugin — using hooks like:

add_action('init', 'set_referral_cookie', 1);

function set_referral_cookie(){

if (isset($_GET['ref'])) {

setcookie('custom_ref', sanitize_text_field($_GET['ref']), time() + DAY_IN_SECONDS * 30, '/');

error_log('Referral cookie set: ' . $_GET['ref']);

}

}

If you don’t see this log on first visit — but do on reload — it’s strong evidence that the code isn’t being run due to caching interference.

4. Add Debug Logs for Plugin Calls

Add logging at the very start of your referral plugin’s main file or in a mu-plugin:

error_log('Referral plugin reached init at ' . current_time('mysql'));

If you don’t see this log on first visit — but do on reload — it’s strong evidence that the code isn’t being run due to caching interference.

Summary Diagnostic Flow

Step

Description

1. Add early logging

Confirm if plugin or cookie logic executes at first visit.

2. Test referral link

Use curl -I https://satosh.ee/?ref=test — check headers like cf-cache-status: HIT vs MISS.

3. Adjust cache rules

Use Cloudflare Cache or Transform rules to bypass referrals.

4. Validate in Incognito

Remove preload/prefetch interference from browser.

5. Re-test every change

Confirm if the plugin logic actually runs on first visit post-changes.

Hey, just wanted to say thanks for the input, I've tried most of the things on your list beforehand, and as much as I've continued testing the culprit seems to be: referral cookie attempts to set too late, after WooCommerce sessions have started or headers have been sent. On first visit, no session exists → cookie cannot be set → referral only works on second visit.

I've tried to do step 3: Launch Referral Logic at the Earliest Hooks many times (even before posting this problem here) with different code snippets from ChatGPT, Claude, now also Lumo and Duck.ai (which, admittedly, also uses ChatGPT) but none of the solutions work. The end result is still the same (or sometimes worse).

I know the feeling. Literally posted this on Stacker News a couple of hours ago:

"...And battling fatigue / lack of motivation in the face of uncertainty in terms of how much any of this work actually means to the world. In any case, slow progress is better than no progress and I have done some incremental headway on most of those tasks..."

But I also keep in mind the following quote:

“The writer must believe that what he is doing is the most important thing in the world. And he must hold onto this illusion, even though he knows it's not true.”

― John Steinbeck

And listening to David Goggins always fires me up. Hearing the stuff that he talks about, from a guy like him, it's much easier to accept and embrace the fact that we must go through these deep, dark dungeons & face the dragons in our souls, alone and constantly. It's not "follow your bliss" BS. It can be, for short moments in time, but it never lasts. Mostly, doing something meaningful and especially doing something novel and meaningful is hard work and suffering and it's never truly clear if and when any of it pays off. But then, the question of faith and belief (as per Steinbeck) comes to play.

I'll leave you with these, in case it's of any help:

nostr:nevent1qvzqqqqqqypzqqn3uxu6m9lr790dws3j03ww5dynh4nzsps3vw9h5rmw9zkcelusqyd8wumn8ghj7cn0wd68ytnvv43hgatjd9n8jtnwv46z7qgswaehxw309ahzummtxqhx7un89uqzpjh257uz4mfpsa2e6u7h688la0vu2fvu6jgyamm605ax998ualcc5jf38n

https://www.youtube.com/watch?v=nDLb8_wgX50

Take care, brother! 💜

Maybe you're one of those who has to press both buttons simultaneously? :) Aside from being married - do you have children? Have you found a calling to commit to? If yes, are you actually all in and feel like you're making a difference? Not that I need to know. But you do.

All of the above aside, the old world is dying (or perhaps already dead) and the new one is struggling to be born. That is heavy, however you look at it. But that is not an excuse to give up - if anything, it's the opposite - it's a cue to stay strong, resilient and composed. To not decay with the old world, but to help the new world blossom ☀️ Even when tired and down and stressed, have faith - WAGMI 💜

"The key aspect of faith, of course, is devotion; work and sacrifice. You don’t wish to be able to do this. You work towards being able to do this. You give up certain things, you put up with certain things, you don’t go looking for comfort or validation or glory. You do it because it calls you."

Full text: https://stacker.news/items/1201227

LOL I was also hoping nostr:npub12vkcxr0luzwp8e673v29eqjhrr7p9vqq8asav85swaepclllj09sylpugg would be at nostr:npub1w2eget49s60cyeznumcmqczk0xkmhz24ajqgzfyfrugdfl4mz7ns7rpmgp or the Baltic Honeybadger #BH2025 in Riga with those things! They weren't. But the other day I saw a local sports event poster in my hometown and they had a hanging competition in the program! So I went and got a respectable 2nd place (2 minutes 15 seconds)... Not a world-class time, but hey, I also haven't trained for that specifically + been pretty inconsistent with my pullups so I'm quite pleased. Funny thing is, as I had time to kill, I also went and did a 60m run and, surprisingly, got 1st place (8.96 seconds) 🤠 (Mind you, it's a very small, rural area and the event was not oriented at professional athletes at all)

#NOSTR #VLOG VOLUME 3

“You hope and you hope and hope. And it keeps getting worse. Your last hope is to become hopeless.”

— A note from my journal, July 5, 2025

I recorded this video as I was in the process of working through and making sense of my thoughts on this subject for my own sanity, first and foremost, but also for the creative non-fiction week on nostr:nprofile1qythwumn8ghj7ct5d3shxtnwdaehgu3wd3skuep0qyt8wumn8ghj7etyv4hzumn0wd68ytnvv9hxgtcqyzf8jfmtl7urem3nj3h9vnpkqz3jsspxn2pqd5qamaqvvset4g9ukgq8syn, for which I wrote "The Last Hope:"

https://stacker.news/items/1201227

https://blossom.primal.net/46b9c4be09f087f9a2d5029df0ec943348ead11ac476139f0fbd92a856697090.mp4

#vlogstr

https://youtu.be/Whe2Jh9q6jI

Confessions by Leo Tolstoy

Mastery by Robert Greene (listened to that a while ago but recently finished The 33 Strategies of War... while interesting - as was The Art of Seduction - I liked Mastery the best. Haven't listened to the The 48 Laws of Power yet)

Also, started The Red Book by C. G. Jung a few days ago... fascinating stuff as well. Quite dense though, not sure how well it would go together w/ working on the house at the same time.

All these audiobooks are available on Spotify if you're using that (and have Premium)

Just updated my bio on nostr:nprofile1qyt8wumn8ghj7ct5d3shxtnwdaehgu3wd3skueqpz4mhxue69uhk2er9dchxummnw3ezumrpdejqqg8jlaadfuy26t22px7dcrdnvazhv9pgyqlfnuedapcd49tkxcpxzswrhwd6 ... what y'all think? Yay or nay?

Sometimes I read the notes in my own journal and I’m like:

1. Who writes these?

2. Whoa.

3. Am I listening to too much David Goggins?

Case in point - May 7, 2025:

Remember: on the path of the Warrior, there will be no comfort, no certainty, no glory. You will suffer like Jesus did, but without the followers, without the Divine guidance, without your name ever being written in any history book. Perform without a cause; sacrifice without redemption. Taking that path and taking those risks though - it’s the only way to truly live, to truly evolve and individuate. Perhaps there is something there along the journey, but you cannot expect that. You must accept suffering for the sake of suffering.

Great job on the video & many thanks for featuring nostr:nprofile1qyd8wumn8ghj7cn0wd68ytnvv43hgatjd9n8jtnwv46z7qg4waehxw309a5xjum59ehx7um5wghxcctwvsqzqr5g4trndr2lykpyx7pxqs4nlvazdgfx70v9wcvvddn99204h7s27tcduj 😉

One small correction: the Memberships feature on the website is live and running, but some features are yet to be rolled out (hence, the memberships are currently also discounted 👀)

A 2.5 hour podcast on the Science & Health Benefits of Belief in God & Religion wasn't on my bingo card for 2025, but I love to see it 🙏❤️

https://blossom.primal.net/61082e328028ba4f571935cb32ce578911bf88e2662bb12c8325368e3037d426.3gp

Full episode:

https://youtu.be/Whe2Jh9q6jI

🤗❤️

#memestr

Yes, great stuff, thanks for tagging me! And I can combine learning Spanish and about the Stoics in that manner 😄 Double-win!

I haven't read Epictetus much aside from just some quotes here and there, you're making me think I should go into it more seriously... but on the other hand, I started the "Red Book" by C G Jung audio version the other day and am quite hooked! But maybe I can make room for some Epictetus, somewhere :)

Web developers / Wordpress experts / Code wizards! I need help with the following issue: WooCommerce referral links only trigger on 2nd visit.

25k sats + lifetime Gold membership on SATOSH.EE and my eternal gratitude to whoever helps me solve the problem.

I’m running into an issue with referral links on a WooCommerce site (WordPress + WooRewards paid version + Referral Codes (WooRewards and Referral Codes are LongWatchStudio plugins); also tested with the Affiliates plugin - the issue also occurred with that one). The goal is to establish referral bonds between users for a loyalty/affiliate program.

The problem:

Referral logic only triggers on the second visit to a referral URL.

On first visit, cookies for tracking (e.g., lwsadmsession…) either don’t appear or the plugin code never runs.

Reloading the same link triggers the referral logic as expected.

This behavior occurs with multiple referral plugins, not just WooRewards.

What I’ve tried:

Disabled all other plugins, switched to default theme

Cloudflare + Rocket.net: disabled query string caching

.htaccess rules to bypass server caching

Early hook code to force session/logic execution (relied on ChatGPT to come up with those codes, would not be surprised if they were faulty in and of themselves)

Verified no Varnish or server-level caching interference

Developer insight from WooRewards:

“Our code is never called. Something else takes charge before WordPress, and (even if unintentional) fakes our redirection.”

Looking for ideas why referral plugin code isn’t executing on first visit, even when cookies or sessions should be available.

Happy to provide more details, just drop a comment or email me kontext@satosh.ee

Thanks!

#asknostr #devs #wordpress #woocommerce #bounty

YES. Bitcoin/money is a tool, not a goal. What's your goal? Do you want to live the best life you can, be the best person you can be, do the things really want and are called to? Or do you want to live like a rat, eat ramen noodles and work a shitty soul-crushing job just so you can be SURE to have a larger stack in 5 years compared to today? Like, is your goal really JUST MONEY? Or is it actually more than that?

“If you’re going to invest Bitcoin anywhere, invest it in yourself.”

― nostr:nprofile1qyv8wue69uhk6mmwv9jzu6nzx56jucm0d5arsvpcxqq3qamn8ghj7atdvfex2mp6xsurgwqqyzdkm9dhdgq3jxjvw7qc26q76lememf0l75wg9gka3uzgzepx2zl2ewxw6s (at Baltic Honeybadger 2025, Riga)

Things like this are THE best result I could have ever wished for by putting my book out there

Thank you for the kind words, Morty, and for the permission to share your testimonial!

Hey, valid points, and I might be wrong - I haven't studied any surveys or empirical data. But my personal experience is that most of the people around me are atheists, and whether they admit to it or not, they are also statists. I myself was a very selfish and nihilistic person, as an atheist, until some mystical experiences convinced me that there is more to life than what the eye can see. FYI I very much oppose any religious dogmaticism and would not associate myself with any specific religion - as I pointed out to someone else commenting on this meme, I think they've all been corrupted anyway. I have an old WIP piece on the way I would describe the nature of reality, if you're interested: https://medium.com/@mckontext/unified-creation-energy-theory-ucet-8814041ed94c

Peace! ☮️

https://www.youtube.com/watch?v=80PosNZa-4s

Heard this song on the radio today and it brought me down memory lane....

Backdrop. It's early 2005, I'm 12 years old. I was already in my "rebellious teenager" phase so pop music and the Eurovision song contest seemed pretty lame to me by then. However, it was still all over the Estonian media and my parents were into it as well, so for better or for worse, I got exposed to the whole thing.

The Estonian preliminary round of the contest is on. My parents are watching it downstairs; I'm somewhere around, probably playing video games or something, and then I hear this song. And I see this girl... I'm enamored. Gobsmacked. Spellbound. Who is she and why do feel this way? I leave the living room and run upstairs to my room. And no, I didn't go there to do what you’re now probably thinking I went to do.

Nowadays, some people know me as the guy who does 120+ pushups every day. This was not always the case. However, this song and this girl (she was 16 at the time) propelled me to do some pushups and sit-ups right then and there, as I figured I'd have to be in top shape to ever get a girl like this. A shame I didn’t commit to 100+ a day and stick with it… otherwise, who knows!

In the end, the song got a close second place in the votes, and the (absolutely horrendous) song "Let's Get Loud" by the girl group Suntribe went on to represent Estonia in Kyiv that year. Unsurprisingly, it didn't do too well - 20th place out of 25 in the semi-final.

Fun fact: the singer of "Moonwalk" - Laura Põldvere - was also one of the members of Suntribe. So, while one could be moderately happy that she at least got to go to the contest, the fact that "Let's Get Loud" was a better song than "Moonwalk" in the eyes of the Estonian public, forever remains, to me, a sign of my compatriots’ utter lack of taste.

#tunestr #2005 #Estonia #childhood #100ADayTilIDie

"With atheism, there is no cultural identity, there is no philosophical framework, symbolism or ritual."

I agree and I think that the lack of all of the above is detrimental to society. It results in confusion, selfishness, hedonism, separation, nihilism. And any of those can lead one to much darker places.

"It's simply not believing in something without good reason."

I can't really agree with that. If that were the case, it would be a good thing. But one of the things that my meme is intended to hint at is that it is NOT the case. It seems to me that most atheists take the laws of the State as the laws of God, the word of the mainstream media as the word of God, the indoctrination by the education system as baptism.

Just because a tool or a concept has been misused doesn't mean it's invalid or useless. If anything, it points to the contrary.

A Sunday sermon... excuse me, a Sunday #VLOG, featuring me reading a couple of pages the book "The Saviors of God" by Nikos Kazantzakis. Take it or leave it 🤠

https://blossom.primal.net/08f4e8afeae0b28be42a3cbcbb4ea01b2a2258ae601d606040b4fd26c2e33d34.mp4

#vlogstr

If you can get a sense of meaning and a grip on reality without religion/spirituality and also without regressing into statism and/or narcissism, good on you.

For context (no pun intended), here's the longer thought this meme kind of arised from:

nostr:note1tfngh5sc3yvvayxd3etgw9xvcus90x7sllaflwl9j8ewzfgp8hnqpag679

I don't know of any Western states trying to use the bearded man for anything. If anything, they're saying the bearded man doesn't exist. It's only the science that exists, or something else equally pragmatic - and equally controllable by humans (the state).

In any case, for context (no pun intended), here's the longer thought this meme kind of arised from:

nostr:note1tfngh5sc3yvvayxd3etgw9xvcus90x7sllaflwl9j8ewzfgp8hnqpag679

If you’re in a place that feels good and right in the present moment, it’s very easy to be lenient with your old self, to forgive your former self. Because, after all, whatever was before, brought you to this place that’s right and just and beautiful.

If you’re not in such a place, if you’re not where you want to be, forgiving yourself (and the world) becomes increasingly difficult the further away you are from your ideal. In that case, it becomes of vital importance to shift your focus from what has been to what could be. From what you lack to what you have in abundance, and to find a way to transmute what you have to that which it could be.

It’s useful to keep in mind that there is never a real lack of anything. All of it exists, somewhere, sometime. You can be the one who makes it manifest.

If anybody can do it, it’s you.

nostr:nprofile1qqs89v5v46jcd8uzv3f7dudsvpt8ntdm3927eqypyjy37yx5l6a30fcpr4mhxue69uhkummnw3ez6ur4vgh8wetvd3hhyer9wghxuet5qyw8wumn8ghj7mn0wd68yttjv4kxz7fwwak8vuewwdcxzcm9qyw8wumn8ghj7mn0wd68ytnzd96xxmmfdejhytnnda3kjctv7syqwq 🧡

I've tried, but with very little success. The reasons being (I think):

1) I don't really have a "community" or an audience as such to begin with

2) Most haven't been banned/censored so they don't see the value in the uncensorable aspect of the protocol

3) Most don't understand or have interest in Bitcoin so they also don't see value in zaps

4) The network effect is strong (in favor of X/IG/FB, etc.)

5) Centralized social media still has a much better UX than any of the nostr clients

6) The "no algorithms" part of nostr clients means that discoverability is bad, as is discovering (you're not constantly being catered content according to your interests - you have to find and curate your own feed)

I'm still perplexed by the fact that this meme never went viral

#memestr

Coopers Beach, Northland, New Zealand ☀️🤠

(7 March 2025)

#photography #nature #newzealand #aotearoa

#ZAP THE CONTENT YOU WANT TO SEE

YOU ARE THE ALGORITHM

ZAPS ARE THE SIGNAL

#plebchain

https://www.youtube.com/watch?v=ggol_GGL_nc

"Tähevärav" ("Stargate") is a lyrical stream of consciousness; it's wordplay and rhyme scheming, but its central narrative is the importance of confidence, staying unapologetically true to yourself & facing the hardships of life with courage. These are all themes and issues that I've been struggling and dealing with for most of my life and, the track serves, first and foremost, the purpose of being a reminder to myself to not give in to the pressure, to not give up, to continue betting on myself and what I believe to be true. Life is too short to let yourself be ruled by anyone else but your higher self.

You are the Stargate. You are the connection to the vastness of the Universe. It is all within.

― Kontext

nostr:npub1yfg0d955c2jrj2080ew7pa4xrtj7x7s7umt28wh0zurwmxgpyj9shwv6vg:

https://wavlake.com/album/24523d52-b30a-48ac-bbf3-b5ea245ea4e0

Bandcamp:

https://mckontext.bandcamp.com/album/t-hev-rav

SoundCloud:

https://soundcloud.com/mckontext/sets/tahevarav

#tunestr #estonia #hiphop #rap #opensourceculture

6 months of 100+ pushups per day

https://video.nostr.build/e1176673a4af2ceda18395fda94e8d753c98eba76d58dc316ff66969271b6b66.mp4

#100aDayTil100k #100aDayTilIDie

+ also:

Approx. 1 year no alcohol

Approx. 2 months sleeping on a yoga mat

I've said it before and I'll say it again:

Gyms are overrated

#100aDayTil100k #100aDayTilIDie #fitness #calisthenics