diff --git a/src/Admin/Admin.php b/src/Admin/Admin.php index 4cee90a5..2456b68e 100644 --- a/src/Admin/Admin.php +++ b/src/Admin/Admin.php @@ -23,6 +23,7 @@ public function __construct() { add_filter( 'woocommerce_screen_ids', array( $this, 'screen_ids' ) ); add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), PHP_INT_MAX ); add_filter( 'update_footer', array( $this, 'update_footer' ), PHP_INT_MAX ); + add_filter( 'allowed_redirect_hosts', array( $this, 'allowed_redirect_hosts' ) ); } /** @@ -182,4 +183,19 @@ public static function view( $view, $args = array(), $path = '' ) { include $file; } + + /** + * Allowed redirect hosts. + * + * @param array $hosts Allowed hosts. + * + * @since 1.0.0 + * @return array + */ + public function allowed_redirect_hosts( $hosts ) { + $hosts[] = 'pluginever.com'; + $hosts[] = 'www.pluginever.com'; + + return $hosts; + } } diff --git a/src/Admin/Menus.php b/src/Admin/Menus.php index 23340a91..34ea6582 100644 --- a/src/Admin/Menus.php +++ b/src/Admin/Menus.php @@ -306,8 +306,8 @@ public function output_reports_page() { public function go_pro_redirect() { wp_verify_nonce( '_nonce' ); if ( isset( $_GET['page'] ) && 'go_wcsn_pro' === $_GET['page'] ) { - wp_redirect( 'https://pluginever.com/plugins/woocommerce-serial-numbers-pro/?utm_source=admin-menu&utm_medium=link&utm_campaign=upgrade&utm_id=wc-serial-numbers' ); - die; + wp_safe_redirect( 'https://pluginever.com/plugins/woocommerce-serial-numbers-pro/?utm_source=admin-menu&utm_medium=link&utm_campaign=upgrade&utm_id=wc-serial-numbers' ); + exit; } }