  Following Wigert, various authors, including Ramanujan, Gronwall, Erd\H{o}s,
Ivi\'{c}, Schwarz, Wirsing, and Shiu, determined the maximal order of several
multiplicative functions, generalizing Wigert's result $$\max_{n\leq x} \log
d(n) = \frac{\log x}{\log \log x} (\log 2 + o(1)). $$ On the contrary, for many
multiplicative functions, the maximal order of iterations of the functions
remains widely open. The case of the iterated divisor function was only solved
recently, answering a question of Ramanujan from 1915. Here we determine the
maximal order of $\log f(f(n))$ for a class of multiplicative functions $f$. In
particular, this class contains functions counting ideals of given norm in the
ring of integers of an arbitrary, fixed quadratic number field. As a
consequence, we determine such maximal orders for several multiplicative $f$
arising as a normalized function counting representations by certain binary
quadratic forms. Incidentally, for the non-multiplicative function $r_2$ which
counts how often a positive integer is represented as a sum of two squares,
this entails the asymptotic formula $$ \max_{n\leq x} \log r_2(r_2(n))=
\frac{\sqrt{\log x}}{\log \log x} (c/\sqrt{2}+o(1))$$ with some explicitly
given constant $c>0$.
