diff --git a/restrictcontent.php b/restrictcontent.php index c71901f..ce73780 100644 --- a/restrictcontent.php +++ b/restrictcontent.php @@ -943,15 +943,25 @@ function rc_deactivate_plugin() add_action('admin_init', 'rc_deactivate_plugin'); -function restrict_content_3_update_notification() -{ - if (! get_option('dismissed-restrict-content-upgrade-notice', false) ) { +function restrict_content_3_update_notification() { + global $pagenow; + + // Check if the current page is an admin.php or plugins.php page + if ($pagenow !== 'admin.php' && $pagenow !== 'plugins.php') { + return; + } + + // Sanitize the 'page' query parameter + $page = isset($_GET['page']) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : ''; + + // Check if the current screen is one of the Restrict Content screens or the plugins page + if (($pagenow === 'plugins.php' || (strpos($page, 'rcp-') === 0)) && !get_option('dismissed-restrict-content-upgrade-notice', false)) { ?>

Why Go Pro →', 'LION'), + __('Thinking about upgrading to Restrict Content Pro? Check out our pro-only features. Why Go Pro →', 'LION'), 'https://restrictcontentpro.com/why-go-pro/?utm_source=restrictcontent&utm_medium=plugin&utm_campaign=rc3_release&utm_content=dashboard-notice' ); ?> @@ -960,6 +970,9 @@ function restrict_content_3_update_notification()