It sounds like they may be getting too many treats. I would cut out all other items and just give them the crumbles. If you want to offer a treat, sometimes just a warm mash made by soaking the crumbles in warm water gets them excited. The crumbles are a complete feed designed to provide everything they need to be healthy (and lay eggs if it is a layer feed) Whatever else you give them means that they eat less of the formulated feed and that starts to knock their diet out of balance. Over a period of months, this can start to have a detrimental effect on some birds. Scratch and seeds can lead to fatty liver Haemorrhagic Syndrome and/or obesity which can cause laying ailments like egg binding and prolapse as well as the risk of sudden death from a liver rupture.
Foamy cecal poop can be normal but they could have worms. Getting their poop tested would be the most sensible way to approach the problem and it is not expensive. Most vets can do it without seeing the chicken or you can probably send a sample off to your state agricultural diagnostics lab.
If you need to administer medication, it can be done by picking them off the roost at night but some wormers can be added to the food or water, they just don't necessarily treat all types of worms and there is often an egg withdrawal period afterwards, so it can make financial sense to get their poop tested to see if they do actually have worms, rather than spend money on medication that may not be the correct one and discard eggs. I have not dewormed my flock in 4.5 years and I am not seeing a problem with internal parasites. Some people seem to have to deworm every few months. Environmental factors like climate and population density and ground management will play a part in that.