How do check the status of a member plan

Hi,
I want to check the status of the member plan then hide a button. If the Member plan is expired hide button and only show then the plan is active.
Any help, please!!! I already spent half-night trying to figure this out!!!

I see that you have created a similar post. I have answered it here .