you need to evaluate your footwear and use proper footbeds or insoles.
This comes from my personal when I put a wrong 3mm wedge in my boot and even that after just 3hours of skiing taking them out at lunch gave me excruciating plantar fasciatis and bottom foot cramps for that I had to abandon skiing plans that day and for the next day and was laid up for 3days basically with a cramped foot.
So something as small as just a couple mm can cause the pain, especially if you're doing somethign like a step class.
If you get insoles and never gotten them before, you also should be careful to not get too stiff of an insole, it needs to have some give if you're exercising and doing pure impacts on it. If you get too stiff of an insole and are exercising on it, the oversupport will also give you foot pain. I personally use Sole trim-to-fit footbeds in my regular shoes, which do flex and give a bit after molding to your foot, after throwing out superfeet and an inhouse store brand from a running shop which had solid and supportive to me soles.
Because of the flex though, they will eventually wear out though, so they won't last as long as say a superfeet.