I have been reading Tasty bits of several complex variables https://www.jirka.org/scv/scv.pdf . In Section 6.7, we have the following exercise:
Exercise 6.7.10 Suppose $X \subset U$ is an irreducible subvariety of an open set $U$, and suppose $f : U \to\mathbb{R} \cup \{-\infty\}$ is a plurisubharmonic function. If the modulus of the restriction $f|_X$ achieves a maximum at some point $p \in X$, then the restriction $f|_X$ is constant.
My question is if the statement still holds if we drop the irreducibility condition or in general, do we have an analogue of maximum principle for analytic varieties in a domain ?