Garlic, broccoli sprouts, wheat bran (organic!! glyphosate is a terrible thing to eat in your grains!), etc.
Sulfur helps both with the joints and with keeping bile moving in the liver.
It's important as vitamin B1 (wheat bran has lots of it) for sending neural signals and maintaining the health of the central nervous system.
If you're eating food contaminated with glyphosate you can get issues with your sulfur cycle. Glyphosate (roundup) kills the gut flora that help you take in manganese (another nutrient which nuts and grains are rich in), and can further contribute to problems in nerves and muscles.
Make sure to observe if there's anything you're doing on a regular basis that effects your flexibility. I find for example that applying essential oils to the skin too frequently can make me more prone to numbness in my hand if I lay on that side.
This is a shot in the dark, but I'm replying because you mention a lot of the symptoms I have experienced. Really sore soles of the feet? Stiffness of the muscles/joints-
Are you using any sulfur nutrients to begin with, and maybe living with / having had dental Amalgams (metal fillings in the teeth)?
Mercury from vaccinations and fillings tends to accumulate in the muscle and cartilage. If you use sulfur nutrients, the body tries to kick the mercury out of those tissues, and that can make them sore.
Sulfur nutrients, if you're using supplements, have names like these:
Methylsulfuromethane (MSM), Vitamin B1 (Thiamine, benfothiamine), DMSO (Di methyl sulfur oxide), Epsom Salts (magnesium sulfate), Sulphurophane (Broccoli sprout powder), among others...
When I use too much sulfur at a time I can get those sore feet and stiff joints. But that's usually with some pain.