AdSense Plugin WP QUADS - Version 2.0.30

Version Description

(24th August 2021) = * Fix: Fixed error message while adblocker with classic editor #408 * Fix: Reduce the API calls on server. #390 * Fix: Need to hide in between li tags. #3411

Download this release

Release Info

Developer wpquads
Plugin Icon 128x128 AdSense Plugin WP QUADS
Version 2.0.30
Comparing to
See all releases

Code changes from version 2.0.29 to 2.0.30

includes/admin/settings/register-settings.php CHANGED
@@ -29,9 +29,9 @@ function quads_get_option( $key = '', $default = false ) {
29
 
30
 
31
 
32
- add_action( 'admin_init', 'quads_check_licene_my_upgrade_function',10);
33
 
34
- function quads_check_licene_my_upgrade_function() {
35
 
36
  $quads_license_bug_fixed = get_transient('quads_license_bug_fixed');
37
  $quads_mode = get_option('quads-mode');
29
 
30
 
31
 
32
+ add_action( 'admin_init', 'quads_check_licene_upgrade_modified',10);
33
 
34
+ function quads_check_licene_upgrade_modified() {
35
 
36
  $quads_license_bug_fixed = get_transient('quads_license_bug_fixed');
37
  $quads_mode = get_option('quads-mode');
includes/admin/welcome.php CHANGED
@@ -33,13 +33,27 @@ class quads_Welcome {
33
  */
34
  public function __construct() {
35
  add_action( 'admin_init', array( $this, 'welcome' ) );
36
- add_filter( 'mce_external_plugins', array( $this, 'quads_add_plugin' ) );
37
  add_filter( 'mce_buttons', array( $this, 'quads_register_buttons' ) );
 
 
 
 
38
 
39
  }
40
 
41
 
42
-
 
 
 
 
 
 
 
 
 
 
 
43
  /**
44
  * Sends user to the Settings page on first activation of QUADS as well as each
45
  * time QUADS is upgraded to a new version
@@ -66,6 +80,16 @@ class quads_Welcome {
66
  wp_safe_redirect( admin_url( 'admin.php?page=quads-settings' ) ); exit;
67
 
68
  }
 
 
 
 
 
 
 
 
 
 
69
 
70
  /**
71
  * Add the plugin to array of external TinyMCE plugins
@@ -74,31 +98,26 @@ class quads_Welcome {
74
  *
75
  * @return array
76
  */
77
- public function quads_add_plugin( $plugin_array ) {
78
- global $quads_options;
 
79
 
80
- if ( ! is_array( $plugin_array ) ) {
81
- $plugin_array = array();
82
  }
83
- if(isset($quads_options['ad_blocker_support']) && $quads_options['ad_blocker_support']){
84
- $upload_dir = wp_upload_dir();
85
- $content_url = $upload_dir['basedir'].'/wpquads/tinymce_shortcode.js';
86
- $plugin_array['quads_shortcode'] = $upload_dir['baseurl'].'/wpquads/tinymce_shortcode.js';
87
- wp_mkdir_p($upload_dir['basedir'].'/wpquads', 755, true);
88
- $sourc = QUADS_PLUGIN_URL . 'assets/js/tinymce_shortcode_uploads.js';
89
- if (!file_exists($content_url)) {
90
- copy($sourc,$content_url);
91
- }
92
- $sourc = QUADS_PLUGIN_URL . 'admin/assets/js/src/images/wpquads_classic_icon.png';
93
- $content_url = $upload_dir['basedir'].'/wpquads/wpquads_classic_icon.png';
94
- if (!file_exists($content_url)) {
95
- copy($sourc,$content_url);
96
- }
97
- }else{
98
- $plugin_array['quads_shortcode'] = QUADS_PLUGIN_URL . 'assets/js/tinymce_shortcode.js';
99
  }
100
- return $plugin_array;
 
 
 
 
101
  }
 
102
  /**
103
  * Add button to tinyMCE window.
104
  *
33
  */
34
  public function __construct() {
35
  add_action( 'admin_init', array( $this, 'welcome' ) );
 
36
  add_filter( 'mce_buttons', array( $this, 'quads_register_buttons' ) );
37
+ add_filter( 'tiny_mce_plugins', array( $this, 'tiny_mce_plugins' ) );
38
+ add_filter( 'wp_tiny_mce_init', array( $this, 'print_shortcode_plugin' ) );
39
+ add_action( 'print_default_editor_scripts', array( $this, 'print_shortcode_plugin' ) );
40
+
41
 
42
  }
43
 
44
 
45
+ private function hooks_exist() {
46
+ if (
47
+ (
48
+ has_action( 'wp_tiny_mce_init', array( $this, 'print_shortcode_plugin' ) )
49
+ || add_action( 'print_default_editor_scripts', array( $this, 'print_shortcode_plugin' ) )
50
+ )
51
+ && has_filter( 'mce_buttons', array( $this, 'quads_register_buttons' ) )
52
+ && has_filter( 'tiny_mce_plugins', array( $this, 'tiny_mce_plugins' ) ) ) {
53
+ return true;
54
+ }
55
+ return false;
56
+ }
57
  /**
58
  * Sends user to the Settings page on first activation of QUADS as well as each
59
  * time QUADS is upgraded to a new version
80
  wp_safe_redirect( admin_url( 'admin.php?page=quads-settings' ) ); exit;
81
 
82
  }
83
+
84
+ public function tiny_mce_plugins( $plugins ) {
85
+ if ( ! $this->hooks_exist() ) {
86
+ return $plugins;
87
+ }
88
+
89
+ $plugins[] = 'quads_shortcode';
90
+ return $plugins;
91
+ }
92
+
93
 
94
  /**
95
  * Add the plugin to array of external TinyMCE plugins
98
  *
99
  * @return array
100
  */
101
+ public function print_shortcode_plugin( ) {
102
+
103
+ static $printed = null;
104
 
105
+ if ( $printed !== null ) {
106
+ return;
107
  }
108
+
109
+ $printed = true;
110
+
111
+ if ( ! $this->hooks_exist() ) {
112
+ return;
 
 
 
 
 
 
 
 
 
 
 
113
  }
114
+ echo "<script>\n"
115
+
116
+ . file_get_contents( QUADS_PLUGIN_URL . 'assets/js/tinymce_shortcode.js' ) . "\n"
117
+ . "</script>\n";
118
+
119
  }
120
+
121
  /**
122
  * Add button to tinyMCE window.
123
  *
includes/template-functions.php CHANGED
@@ -1132,9 +1132,19 @@ function quads_filter_default_ads_new( $content ) {
1132
  if ( $word_count_number == $index + 1 ) {
1133
  $flag= true;
1134
  }
1135
- if($flag && preg_match("/<[^<]+>/",$paragraphs[$index])){
1136
-
 
 
 
 
 
 
 
 
 
1137
  $paragraphs[$index] .= $cusads;
 
1138
  $flag= false;
1139
  }
1140
  }
1132
  if ( $word_count_number == $index + 1 ) {
1133
  $flag= true;
1134
  }
1135
+ if($flag && preg_match("/<[^<]+>/",$paragraphs[$index])){
1136
+ $pattern = "#<\s*?li\b[^>]*>(.*?)#s"; // to find the tag name
1137
+ preg_match($pattern, $paragraphs[$index], $matches);
1138
+ if(isset($matches[0])){
1139
+ $tagname =$matches[0];
1140
+ $stringarray= explode($tagname,$paragraphs[$index]);
1141
+ if(isset($stringarray[0])){
1142
+ $stringarray[0]=$stringarray[0].$cusads;
1143
+ $paragraphs[$index] = implode($tagname,$stringarray);
1144
+ }
1145
+ }else{
1146
  $paragraphs[$index] .= $cusads;
1147
+ }
1148
  $flag= false;
1149
  }
1150
  }
includes/vendor/vi/vi.php CHANGED
@@ -91,10 +91,10 @@ class vi {
91
  // We need to ensure publishers privacy and do not want to send more personal information than absolutely necessary
92
  if (!empty($this->token)) {
93
  // Cron Check vi api settings daily
94
- add_action('quads_weekly_event', array($this, 'setSettings'));
95
  // add_action('quads_daily_event', array($this, 'setActive'));
96
- add_action('quads_daily_event', array($this, 'setRevenue'));
97
- add_action('quads_weekly_event', array($this, 'verifyViAdCode'));
98
  }
99
 
100
  // Shortcodes
91
  // We need to ensure publishers privacy and do not want to send more personal information than absolutely necessary
92
  if (!empty($this->token)) {
93
  // Cron Check vi api settings daily
94
+ // add_action('quads_weekly_event', array($this, 'setSettings'));
95
  // add_action('quads_daily_event', array($this, 'setActive'));
96
+ //add_action('quads_daily_event', array($this, 'setRevenue'));
97
+ // add_action('quads_weekly_event', array($this, 'verifyViAdCode'));
98
  }
99
 
100
  // Shortcodes
quick-adsense-reloaded.php CHANGED
@@ -6,7 +6,7 @@
6
  * Description: Insert Google AdSense and other ad formats fully automatic into your website
7
  * Author: WP Quads
8
  * Author URI: https://wordpress.org/plugins/quick-adsense-reloaded/
9
- * Version: 2.0.29
10
  * Text Domain: quick-adsense-reloaded
11
  * Domain Path: languages
12
  * Credits: WP QUADS - Quick AdSense Reloaded is a fork of Quick AdSense
@@ -38,7 +38,7 @@ if( !defined( 'ABSPATH' ) )
38
 
39
  // Plugin version
40
  if( !defined( 'QUADS_VERSION' ) ) {
41
- define( 'QUADS_VERSION', '2.0.29' );
42
  }
43
 
44
  // Plugin name
6
  * Description: Insert Google AdSense and other ad formats fully automatic into your website
7
  * Author: WP Quads
8
  * Author URI: https://wordpress.org/plugins/quick-adsense-reloaded/
9
+ * Version: 2.0.30
10
  * Text Domain: quick-adsense-reloaded
11
  * Domain Path: languages
12
  * Credits: WP QUADS - Quick AdSense Reloaded is a fork of Quick AdSense
38
 
39
  // Plugin version
40
  if( !defined( 'QUADS_VERSION' ) ) {
41
+ define( 'QUADS_VERSION', '2.0.30' );
42
  }
43
 
44
  // Plugin name
readme.txt CHANGED
@@ -10,7 +10,7 @@ Tags: ad manager, ads, adsense, amp, banner
10
  Requires at least: 3.6+
11
  Tested up to: 5.8
12
  Requires PHP: 5.4
13
- Stable tag: 2.0.29
14
 
15
  Ads & AdSense Ad Plugin is the quickest way to insert Google AdSense & other ads into your website. Google AdSense integration with Google AMP support.
16
 
@@ -204,6 +204,11 @@ Alternative Installation:
204
 
205
 
206
  == Changelog ==
 
 
 
 
 
207
  = 2.0.29 (13th August 2021) =
208
  * New: Role based quads display #388
209
  * Fix: Word count bug fix #407
10
  Requires at least: 3.6+
11
  Tested up to: 5.8
12
  Requires PHP: 5.4
13
+ Stable tag: 2.0.30
14
 
15
  Ads & AdSense Ad Plugin is the quickest way to insert Google AdSense & other ads into your website. Google AdSense integration with Google AMP support.
16
 
204
 
205
 
206
  == Changelog ==
207
+ = 2.0.30 (24th August 2021) =
208
+ * Fix: Fixed error message while adblocker with classic editor #408
209
+ * Fix: Reduce the API calls on server. #390
210
+ * Fix: Need to hide in between li tags. #3411
211
+
212
  = 2.0.29 (13th August 2021) =
213
  * New: Role based quads display #388
214
  * Fix: Word count bug fix #407