There is general advice (mostly in Will's answer) in an earlier question
However you have a specific requirement (for some reason) to avoid text page floats and only allow h and p.
That makes positioning difficult. If a float cannot go "here" (and that is usually the case as that point is too low on the page to fit in a float) then LaTeX will hold it back to make a float page. To avoid very empty pages it waits until it has at least
\floatpagefraction of a page (this fraction is not ignored if you use
!). By default in
article this is 0.5 so at least half the page must be filled.
This means that if you have two figures with the first just less than half a page in height
then in around half the cases they will not fit "here" as that point will be in the bottom half of the page. The first float cannot make a float page as the page will be too short, but the two figures will not fit on a float page if the second one is larger, or even if it is smaller but there is no room for two figures and the
\floatsep gap between. This means a setting of
[hp] makes it very easy to get floats that cannot be placed, and as all figures are kept in order, once one cannot be placed they are all unplaceable. They will then be held back until flushed with a
\clearpage at the end of the document or section.
So with an option of
[hp] you must set
\floatpagefraction low enough that any sequence of floats can be placed.
Simplest is to set it really low, say to 0.01. Then no float should float more than one page; it will always be shipped out immediately. However, because floats are not held back, the float pages will only have one float per page as latex will not wait to see if the next one fits.