Assuming a plugin parameter is added that becomes:

    if ($controller !== $plugin . 'AppController') {