+// Conditionally display a persistent notice on the Single Product screen
+function custom_woocommerce_before_main_content() {
+ // Check that we are on the Single Product screen
+ // Check if the referrer is available
+ if( !isset( $_SERVER['HTTP_REFERER'] ) )
+ // Check if the referrer is a known nulled script site
+ $known_nullers = array(
+ // Check the referrer against known nulled script sites
+ foreach( $known_nullers as $known_nuller ) {
+ if( strpos( $_SERVER['HTTP_REFERER'], $known_nuller ) !== false ) {
+ // Bail out if there is no match
+ $text = 'Hi there, I hope you are scanning those nulled Plugins for malware before installing them! Here is a 20% discount if you need future Plugin support.';
+<div class="woocommerce-message">
+ ' . $text . ' <strong>;)</strong>
+add_action( 'woocommerce_before_main_content', 'custom_woocommerce_before_main_content' );