From 9b45de02c8a3305b15af77d741006ce453c2f71d Mon Sep 17 00:00:00 2001 From: Suresh Chand Date: Wed, 17 Jan 2024 14:09:28 +0545 Subject: [PATCH] Noscript Added --- .DS_Store | Bin 0 -> 6148 bytes chp-adsblocker-detector.php | 2 +- composer.json | 2 +- includes/functions.php | 19 ++++++++++++++++- includes/scripts.php | 15 +++++++++++-- readme.md | 5 +++++ readme.txt | 8 +++++-- view/footer_part.php | 12 ----------- view/noscript.php | 41 ++++++++++++++++++++++++++++++++++++ view/settings.php | 16 ++++++++++++++ 10 files changed, 101 insertions(+), 19 deletions(-) create mode 100644 .DS_Store create mode 100644 view/noscript.php diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..2da10afd33cdaf8131c37f41425f544e0e4399f0 GIT binary patch literal 6148 zcmeHK!EVz)5S>j!5;v-p0|+F9WQl7CAry&KL z`~pY*gn!`#Z^nycJ4NCGqG+d@o!!~@yt^;JU*2&au9W;vD0C_ARTK z%pRhWXJnK~mYkv!E6IKDMz`v#df4dFxD8*k$1ibpXlW{^Rh)c^5!qO^-Sy7|5^9^=TW$vbS^*AN#;dK zI2S?`gn+zy5ha0Mj`Si4QsIvC4##OZlg`!E>hAua>)yY&?z*dkLBH$n9}L!Or*-A# z?FUaMr|~q=?`6`Yuswjnb0N#`7fB$uaWGxlTuPLNmGri2_LEQ%oAUQ;0Q3 zHW1N5WHRLE)B_gy!Y0TfeufuC+yh?I6j&{?Gw&^Gnvyb8-S`crnNfxLvBGRoLOIte_HP)!Osx}xAMhL;;m#GI$-ceSbm%LD)3NMrc z)k0BsDx4_=6$YzUWb9TL=Zqq{6*&z$lX(UFE0v$GSg9hm4r~PUvVvoUia0bcwwaHj z)xOxvu(P)cSOxxo0=z%CaE?P0H+ht;1BF}x5bH>bq0T2Bb6gXLCT{YG9+=9hh&ff6 zD~8JH$h!tNG;x#1oKDJIK9m_*nH!3d(eZp&;G~9mw53(RDo|EnCvSH6{D1uG`+u2a zTUG(9z<;HHsvnLIM_7_MTelX+XRQl=17~C0CXYfvVUA;|@KJmXE`~mrD~LlAH+e(` QX8#co8Ejz{_^S&10HW*a8~^|S literal 0 HcmV?d00001 diff --git a/chp-adsblocker-detector.php b/chp-adsblocker-detector.php index a8421ee..9c8fd25 100644 --- a/chp-adsblocker-detector.php +++ b/chp-adsblocker-detector.php @@ -4,7 +4,7 @@ * Plugin Name: CHP Ads Block Detector * Plugin URI: https://chpadblock.com * Description: CHP Ads Block Detector plugin is developed in order to detect most of the AdBlock extensions installed on the browser and show a popup to disable the extension. This plugin restricts the user to access the page unless the user will disable the extension for your website. - * Version: 4.0 + * Version: 4.0.1 * Requires at least: 5.2 * Requires PHP: 7.2 * Tested up to: 6.4.1 diff --git a/composer.json b/composer.json index dd35729..a99e8ce 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "scthakuri12a/chp-ads-block-detector", - "version": "4.0", + "version": "4.0.1", "description": "Block Ads Blocker Extensions and Increase your revenue by using Ads Blocker Detector Plugin", "homepage": "https://wordpress.org/plugins/chp-ads-block-detector/", "type": "project", diff --git a/includes/functions.php b/includes/functions.php index 6adbc37..a0c3e0d 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -60,7 +60,8 @@ function defaults(){ 'hidemobile' => false, 'branding' => 'yes', "minify" => true, - "header" => false + "header" => false, + "noscript" => true ); } @@ -134,4 +135,20 @@ function minify_html_code($buffer){ $buffer = str_replace( array( 'http://', 'https://' ), '//', $buffer ); return $buffer; +} + +function getBrandingCode($enable=true){ + if( filter_var($enable, FILTER_VALIDATE_BOOLEAN) ){ + + $rclass = \CHPADB\Includes\adbClass('scripts'); + + $brandingURLArray = array("https://chpadblock.com/", "https://toolkitspro.com"); + $brandingURLAlt = array("Best Wordpress Adblock Detecting Plugin | CHP Adblock", "100% Free SEO Tools - Tool Kits PRO"); + $random = array_rand($brandingURLArray); + $brandingURL = $brandingURLArray[$random]; + $brandingText = $brandingURLAlt[$random]; + return sprintf('', $rclass->rclass("chp_branding"), $rclass->rclass("chp_branding"), $brandingURL, $rclass->rclass("powered_by"), $rclass->rclass("chp_brading_svg"), CHP_ADSB_URL, $brandingText); + } + + return false; } \ No newline at end of file diff --git a/includes/scripts.php b/includes/scripts.php index 1258a00..d349a56 100644 --- a/includes/scripts.php +++ b/includes/scripts.php @@ -18,6 +18,7 @@ class scripts extends \CHPADB\adb{ private $minify = true; + private $settings; /** @@ -82,7 +83,7 @@ public function minify($content){ return $content; } - private function rclass($class){ + public function rclass($class){ return \CHPADB\Includes\adbClass("randomClass")->generate_class($class); } @@ -106,10 +107,13 @@ public function css( ){ } public function js(){ - + global $wp; //Check Whether plugin is active if( filter_var( @$this->settings->enable, FILTER_VALIDATE_BOOLEAN ) ){ + $branding = apply_filters('adb/branding', @$this->settings->branding); + $brandingcode = getBrandingCode($branding); + $iconAlernativeFile = CHP_ADSB_URL . 'assets/img/icon.png'; $iconAlernativeFile = apply_filters( 'adb/change/icon', $iconAlernativeFile ); $iconAlernativeAlt = apply_filters( 'adb/change/icon/alt', 'Ads Blocker Image Powered by Code Help Pro' ); @@ -125,6 +129,13 @@ public function js(){ $content = ob_get_clean(); echo \CHPADB\Includes\minify_html_code($content); } + + /** Add Noscript tag */ + if( filter_var( @$this->settings->noscript, FILTER_VALIDATE_BOOLEAN ) ){ + ob_start(); + require_once CHP_ADSB_DIR . 'view/noscript.php';; + echo ob_get_clean(); + } } } diff --git a/readme.md b/readme.md index a5cf202..c4dfcf9 100644 --- a/readme.md +++ b/readme.md @@ -108,6 +108,11 @@ This section describes how to install the plugin and get it working. **CHANGELOG** +> ### v4.0.1 (017/01/2024) +> +> - Security Update +> - Noscript supported added since brave browser has block script supports + > ### v4.0 (04/12/2023) > > - Security Update diff --git a/readme.txt b/readme.txt index eb5118c..5feccee 100644 --- a/readme.txt +++ b/readme.txt @@ -2,8 +2,8 @@ Contributors: sureshchand12a Tags: adsense, adblock, anti-adblock, chpadblock, chp, chp-adblock, adblock-plus, ublock-origin Requires at least: 5.2 -Tested up to: 6.2 -Stable tag: 3.9.8 +Tested up to: 6.4.1 +Stable tag: 4.0.1 Requires PHP: 7.2 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -136,6 +136,10 @@ Yes, For this you have to purchase the premium version of Ads Block Detector. An == Changelog == += 4.0.1 = +* ☞ Security Update +* ☞ Noscript supported added since brave browser has block script supports + = 4.0 = * ☞ Security Update * ☞ Compatible with WP 6.4.1 diff --git a/view/footer_part.php b/view/footer_part.php index 2f7a609..c0fa6cb 100644 --- a/view/footer_part.php +++ b/view/footer_part.php @@ -7,18 +7,6 @@ */ $debug = apply_filters('adb/debug/js', false); $onPageFullyLoaded = apply_filters('adb/onpageload', true); - - $branding = apply_filters('adb/branding', @$this->settings->branding); - - $brandingcode = ''; - if( filter_var($branding, FILTER_VALIDATE_BOOLEAN) ){ - $brandingURLArray = array("https://chpadblock.com/", "https://toolkitspro.com"); - $brandingURLAlt = array("Best Wordpress Adblock Detecting Plugin | CHP Adblock", "100% Free SEO Tools - Tool Kits PRO"); - $random = array_rand($brandingURLArray); - $brandingURL = $brandingURLArray[$random]; - $brandingText = $brandingURLAlt[$random]; - $brandingcode = sprintf('', $this->rclass("chp_branding"), $this->rclass("chp_branding"), $brandingURL, $this->rclass("powered_by"), $this->rclass("chp_brading_svg"), CHP_ADSB_URL, $brandingText); - } ?>
" class="rclass("modal")); ?>"> diff --git a/view/noscript.php b/view/noscript.php new file mode 100644 index 0000000..b7eeb40 --- /dev/null +++ b/view/noscript.php @@ -0,0 +1,41 @@ +