A generalization of invariant and coinvariant subspaces

Let $$\mathcal{A}$$ be a subalgebra of $$M_n(\mathbb{C})$$. Is there a characterization of (or at least a name for) orthogonal projections $$P \in M_n(\mathbb{C})$$ with the property that $$PABP = PAPBP$$ for all $$A,B \in \mathcal{A}$$? In other words, for which the compression map $$A \mapsto PAP$$ is a homomorphism.

The orthogonal projection onto any invariant or (orthogonally) coinvariant subspace for $$\mathcal{A}$$ has this property.

Come to think of it, same question but not assuming $$P$$ is orthogonal, just a projection ($$P^2 = P$$).

Since you are refering to subalgebras of $$M_n(\mathbb{C})$$, i am not sure if this is what you are looking for, but if $$S$$ is a semigroup of operators on a Hilbert space $$\mathcal{H}$$, $$\mathcal{V}\subseteq\mathcal{H}$$ is a subspace of $$\mathcal{H}$$ and $$P$$ an orthogonal projection onto $$\mathcal{V}$$, satisfying $$PABP=PAPBP$$ for all $$A,B\in S$$, then $$\mathcal{V}$$ is called semi-invariant under $$S$$.