ns ) { $active_plugins = array_merge( $active_plugins, $network_plugins ); } } sort( $active_plugins ); return array_unique( $active_plugins ); } /** * Get the current site's WordPress.com ID. * * @return int Blog ID. */ public static function get_wpcom_site_id() { // Returns local blog ID for a multi-site network. if ( defined( 'IS_WPCOM' ) && constant( 'IS_WPCOM' ) ) { return \get_current_blog_id(); } // Returns cache site ID. return \Jetpack_Options::get_option( 'id' ); } /** * Returns true if the free_plan is set to not empty in URL, which is used for testing purpose. */ public static function is_forced_free_plan() { // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.ValidatedSanitizedInput.MissingUnslash return isset( $_GET['free_plan'] ) && $_GET['free_plan']; } /** * Returns true if the new_pricing_202210 is set to not empty in URL for testing purpose. */ public static function is_forced_new_pricing_202208() { $referrer = wp_get_referer(); // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.ValidatedSanitizedInput.MissingUnslash return ( isset( $_GET['new_pricing_202208'] ) && $_GET['new_pricing_202208'] ) || $referrer && strpos( $referrer, 'new_pricing_202208=1' ) !== false; } }