Limit analysis and homogenization of nanoporous materials with a general isotropic plastic matrix