Version Description
- New: WordPress 5.0 Gutenberg support
- New: WordPress 5.1 support
- New: WordPress 5.1.1 support
- Fix: Undefined offset in wpquads\adsense
Download this release
Release Info
Developer | ReneHermi |
Plugin | AdSense Plugin WP QUADS |
Version | 1.8.3 |
Comparing to | |
See all releases |
Code changes from version 1.8.2 to 1.8.3
- assets/js/blocks.js +21 -0
- includes/admin/admin-notices.php +5 -3
- includes/admin/settings/register-settings.php +6 -2
- includes/scripts.php +130 -106
- includes/vendor/google/adsense.php +6 -2
- quick-adsense-reloaded.php +2 -18
- readme.txt +11 -4
assets/js/blocks.js
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var el = wp.element.createElement,
|
2 |
+
registerBlockType = wp.blocks.registerBlockType,
|
3 |
+
blockStyle = { backgroundColor: '#900', color: '#fff', padding: '20px' };
|
4 |
+
|
5 |
+
registerBlockType( 'wpquads/blocks', {
|
6 |
+
title: 'Hello World (Step 1)',
|
7 |
+
|
8 |
+
icon: 'universal-access-alt',
|
9 |
+
|
10 |
+
category: 'layout',
|
11 |
+
|
12 |
+
edit: function() {
|
13 |
+
return el( 'p', { style: blockStyle }, 'Hello editor.' );
|
14 |
+
},
|
15 |
+
|
16 |
+
save: function() {
|
17 |
+
return el( 'p', { style: blockStyle }, 'Hello saved content.' );
|
18 |
+
},
|
19 |
+
} );
|
20 |
+
|
21 |
+
|
includes/admin/admin-notices.php
CHANGED
@@ -663,18 +663,20 @@ function quads_show_license_expired() {
|
|
663 |
|
664 |
$lic = get_option( 'quads_wp_quads_pro_license_active' );
|
665 |
|
666 |
-
//
|
667 |
-
|
668 |
if( !$lic || (isset( $lic->license ) && $lic->license !== 'invalid') ) {
|
669 |
return false;
|
670 |
}
|
671 |
|
|
|
672 |
if( get_transient( 'quads_notice_lic_expired' ) ) {
|
673 |
return false;
|
674 |
}
|
|
|
|
|
675 |
echo '<div class="notice notice-error">';
|
676 |
echo sprintf(
|
677 |
-
__( '<p>Oh No! <strong>WP Quads Pro</strong> expired on %s. Renew your license key to make sure that your (AdSense) ads are shown properly with your WordPress, version ' . $wp_version . '<br>'
|
678 |
. '<a href="%s" target="_blank" title="Renew your license key" class="button"><strong>Renew Your License Key Now</strong></a> | <a href="%s" title="Renew your license key">I am aware of possible issues and want to hide this reminder</a>'
|
679 |
, 'quick-adsense-reloaded' ), date_i18n( get_option( 'date_format' ), strtotime( $lic->expires, current_time( 'timestamp' ) ) ), 'http://wpquads.com/checkout/?edd_license_key=' . $licKey . '&utm_campaign=adminnotic123e&utm_source=adminnotice123&utm_medium=admin&utm_content=license-expired', admin_url() . 'admin.php?page=quads-settings&tab=licenses&quads-action=hide_license_expired_notice'
|
680 |
);
|
663 |
|
664 |
$lic = get_option( 'quads_wp_quads_pro_license_active' );
|
665 |
|
666 |
+
// Do not show if no license at all or if there is a valid license key
|
|
|
667 |
if( !$lic || (isset( $lic->license ) && $lic->license !== 'invalid') ) {
|
668 |
return false;
|
669 |
}
|
670 |
|
671 |
+
// Do not show notice for another 30 days
|
672 |
if( get_transient( 'quads_notice_lic_expired' ) ) {
|
673 |
return false;
|
674 |
}
|
675 |
+
|
676 |
+
|
677 |
echo '<div class="notice notice-error">';
|
678 |
echo sprintf(
|
679 |
+
__( '<p>Oh No! <strong>WP Quads Pro</strong> license key is not activated or has been expired. It expires on %s. Renew or activate your license key to make sure that your (AdSense) ads are shown properly with your WordPress, version ' . $wp_version . '<br>'
|
680 |
. '<a href="%s" target="_blank" title="Renew your license key" class="button"><strong>Renew Your License Key Now</strong></a> | <a href="%s" title="Renew your license key">I am aware of possible issues and want to hide this reminder</a>'
|
681 |
, 'quick-adsense-reloaded' ), date_i18n( get_option( 'date_format' ), strtotime( $lic->expires, current_time( 'timestamp' ) ) ), 'http://wpquads.com/checkout/?edd_license_key=' . $licKey . '&utm_campaign=adminnotic123e&utm_source=adminnotice123&utm_medium=admin&utm_content=license-expired', admin_url() . 'admin.php?page=quads-settings&tab=licenses&quads-action=hide_license_expired_notice'
|
682 |
);
|
includes/admin/settings/register-settings.php
CHANGED
@@ -2150,7 +2150,9 @@ function quads_adsense_code_callback( $args ) {
|
|
2150 |
//get g_data_ad_slot
|
2151 |
$explode_ad_code = explode( 'data-ad-slot', $value['code'] );
|
2152 |
preg_match( '#"([a-zA-Z0-9/\s]+)"#', $explode_ad_code[1], $matches_add_slot );
|
|
|
2153 |
$quads_options['ads'][$key]['g_data_ad_slot'] = str_replace( array('"', ' '), array(''), $matches_add_slot[1] );
|
|
|
2154 |
} else {
|
2155 |
//*** GOOGLE SYNCRON *************
|
2156 |
$quads_options['ads'][$key]['current_ad_type'] = 'google_sync';
|
@@ -2161,8 +2163,10 @@ function quads_adsense_code_callback( $args ) {
|
|
2161 |
|
2162 |
//get g_data_ad_slot
|
2163 |
$explode_ad_code = explode( 'google_ad_slot', $value['code'] );
|
2164 |
-
preg_match( '#"([a-zA-Z0-9/\s]+)"#', $explode_ad_code[1], $matches_add_slot );
|
2165 |
-
|
|
|
|
|
2166 |
}
|
2167 |
}
|
2168 |
}
|
2150 |
//get g_data_ad_slot
|
2151 |
$explode_ad_code = explode( 'data-ad-slot', $value['code'] );
|
2152 |
preg_match( '#"([a-zA-Z0-9/\s]+)"#', $explode_ad_code[1], $matches_add_slot );
|
2153 |
+
if (isset($matches_add_slot[1])){
|
2154 |
$quads_options['ads'][$key]['g_data_ad_slot'] = str_replace( array('"', ' '), array(''), $matches_add_slot[1] );
|
2155 |
+
}
|
2156 |
} else {
|
2157 |
//*** GOOGLE SYNCRON *************
|
2158 |
$quads_options['ads'][$key]['current_ad_type'] = 'google_sync';
|
2163 |
|
2164 |
//get g_data_ad_slot
|
2165 |
$explode_ad_code = explode( 'google_ad_slot', $value['code'] );
|
2166 |
+
//preg_match( '#"([a-zA-Z0-9/\s]+)"#', $explode_ad_code[1], $matches_add_slot );
|
2167 |
+
//$quads_options['ads'][$key]['g_data_ad_slot'] = str_replace( array('"', ' '), array(''), $matches_add_slot[1] );
|
2168 |
+
preg_match( '#"([a-zA-Z0-9/\s]+)"#', isset($explode_ad_code[1]) ? $explode_ad_code[1] : null, $matches_add_slot );
|
2169 |
+
$quads_options['ads'][$key]['g_data_ad_slot'] = str_replace( array('"', ' '), array(''), isset($matches_add_slot[1]) ? $matches_add_slot[1] : null );
|
2170 |
}
|
2171 |
}
|
2172 |
}
|
includes/scripts.php
CHANGED
@@ -18,29 +18,29 @@ add_action( 'wp_print_styles', 'quads_inline_styles', 9999 );
|
|
18 |
add_action( 'admin_enqueue_scripts', 'quads_load_admin_scripts', 100 );
|
19 |
add_action( 'admin_enqueue_scripts', 'quads_load_plugins_admin_scripts', 100 );
|
20 |
add_action( 'admin_enqueue_scripts', 'quads_load_all_admin_scripts', 100 );
|
21 |
-
add_action('admin_print_footer_scripts', 'quads_check_ad_blocker');
|
22 |
|
23 |
/**
|
24 |
* Create ad blocker admin script
|
25 |
*
|
26 |
* @return mixed boolean | string
|
27 |
*/
|
28 |
-
function quads_check_ad_blocker(){
|
29 |
-
if
|
30 |
return false;
|
31 |
}
|
32 |
?>
|
33 |
-
<script type="text/javascript">
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
</script>
|
43 |
-
<?php
|
44 |
}
|
45 |
|
46 |
/**
|
@@ -58,13 +58,13 @@ function quads_load_admin_scripts( $hook ) {
|
|
58 |
return;
|
59 |
}
|
60 |
global $wp_version, $quads;
|
61 |
-
|
62 |
-
$js_dir
|
63 |
$css_dir = QUADS_PLUGIN_URL . 'assets/css/';
|
64 |
|
65 |
// Use minified libraries if SCRIPT_DEBUG is turned off
|
66 |
$suffix = ( quadsIsDebugMode() ) ? '' : '.min';
|
67 |
-
|
68 |
|
69 |
// These have to be global
|
70 |
wp_enqueue_script( 'quads-admin-ads', $js_dir . 'ads.js', array('jquery'), QUADS_VERSION, false );
|
@@ -74,24 +74,24 @@ function quads_load_admin_scripts( $hook ) {
|
|
74 |
wp_enqueue_script( 'jquery-form' );
|
75 |
|
76 |
$vi_dir = QUADS_PLUGIN_URL . 'includes/vendor/vi/public/js/';
|
77 |
-
wp_enqueue_script('quads-vi', $vi_dir . 'vi.js', array(), QUADS_VERSION, false);
|
|
|
78 |
|
79 |
-
|
80 |
wp_enqueue_style( 'quads-admin', $css_dir . 'quads-admin' . $suffix . '.css', QUADS_VERSION );
|
81 |
wp_enqueue_style( 'jquery-chosen', $css_dir . 'chosen' . $suffix . '.css', QUADS_VERSION );
|
82 |
-
|
83 |
$signupURL = $quads->vi->getSettings()->data->signupURL;
|
84 |
-
|
85 |
wp_localize_script( 'quads-admin-scripts', 'quads', array(
|
86 |
-
'nonce'
|
87 |
-
'error'
|
88 |
-
'path'
|
89 |
-
'vi_revenue'
|
90 |
-
'vi_login_url'
|
91 |
-
'vi_signup_url' => !empty($signupURL) ? $signupURL : '',
|
92 |
-
'domain'
|
93 |
-
'email'
|
94 |
-
'aid'
|
95 |
) );
|
96 |
}
|
97 |
|
@@ -110,15 +110,16 @@ function quads_load_plugins_admin_scripts( $hook ) {
|
|
110 |
return;
|
111 |
}
|
112 |
|
113 |
-
$js_dir
|
114 |
$css_dir = QUADS_PLUGIN_URL . 'assets/css/';
|
115 |
|
116 |
// Use minified libraries if SCRIPT_DEBUG is turned off
|
117 |
$suffix = ( quadsIsDebugMode() ) ? '' : '.min';
|
118 |
|
119 |
wp_enqueue_script( 'quads-plugins-admin-scripts', $js_dir . 'quads-plugins-admin' . $suffix . '.js', array('jquery'), QUADS_VERSION, false );
|
120 |
-
wp_enqueue_style( 'quads-plugins-admin', $css_dir . 'quads-plugins-admin' . $suffix . '.css', QUADS_VERSION );
|
121 |
}
|
|
|
122 |
/**
|
123 |
* Load Admin Scripts available on all admin pages
|
124 |
*
|
@@ -130,15 +131,29 @@ function quads_load_plugins_admin_scripts( $hook ) {
|
|
130 |
* @return void
|
131 |
*/
|
132 |
function quads_load_all_admin_scripts( $hook ) {
|
133 |
-
|
134 |
-
// //return;
|
135 |
-
// }
|
136 |
|
137 |
$css_dir = QUADS_PLUGIN_URL . 'assets/css/';
|
138 |
|
139 |
-
wp_enqueue_style( 'quads-admin-all', $css_dir . 'quads-admin-all.css', QUADS_VERSION );
|
140 |
}
|
141 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
/**
|
143 |
* Register CSS Styles
|
144 |
*
|
@@ -170,20 +185,20 @@ function quads_load_all_admin_scripts( $hook ) {
|
|
170 |
*/
|
171 |
function quads_inline_styles() {
|
172 |
global $quads_options;
|
173 |
-
|
174 |
$css = '';
|
175 |
-
|
176 |
if( isset( $quads_options['ads'] ) ) {
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
}
|
188 |
|
189 |
/**
|
@@ -193,31 +208,31 @@ function quads_inline_styles() {
|
|
193 |
* @param string $value
|
194 |
* @return string
|
195 |
*/
|
196 |
-
function quads_render_media_query($key, $value){
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
if
|
205 |
//$html .= '/* Hide on desktop */';
|
206 |
-
$html .= '@media only screen and (min-width:1140px){#quads-'
|
207 |
}
|
208 |
-
if
|
209 |
//$html .= '/* Hide on tablet landscape */';
|
210 |
-
$html .= '@media only screen and (min-width:1024px) and (max-width:1140px) {#quads-'
|
211 |
}
|
212 |
-
if
|
213 |
//$html .= '/* Hide on tablet portrait */';
|
214 |
-
$html .= '@media only screen and (min-width:768px) and (max-width:1023px){#quads-'
|
215 |
}
|
216 |
-
if
|
217 |
//$html .= '/* Hide on mobile device */';
|
218 |
-
$html .= '@media only screen and (max-width:767px){#quads-'
|
219 |
}
|
220 |
-
|
221 |
return $html;
|
222 |
}
|
223 |
|
@@ -227,10 +242,11 @@ function quads_render_media_query($key, $value){
|
|
227 |
* @since 0.9.0
|
228 |
* @return bool true if Mashshare debug mode is on
|
229 |
*/
|
230 |
-
|
|
|
231 |
global $quads_options;
|
232 |
|
233 |
-
$debug_mode = isset($quads_options['debug_mode']) ? true : false;
|
234 |
return $debug_mode;
|
235 |
}
|
236 |
|
@@ -240,53 +256,61 @@ function quadsIsDebugMode(){
|
|
240 |
* @author Tedd Garland, René Hermenau
|
241 |
* @since 0.9.0
|
242 |
*/
|
|
|
243 |
|
244 |
-
|
245 |
-
|
246 |
-
$wpvcomp = (bool)(version_compare(get_bloginfo('version'), '3.1', '>='));
|
247 |
function quads_ads_head_script() {
|
248 |
global $quads_options, $wpvcomp;
|
249 |
|
250 |
-
|
|
|
251 |
<script type="text/javascript">
|
252 |
-
|
253 |
edaddID = new Array();
|
254 |
edaddNm = new Array();
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
<?php } ?>
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
</script>
|
286 |
-
|
287 |
}
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
|
|
|
|
292 |
}
|
18 |
add_action( 'admin_enqueue_scripts', 'quads_load_admin_scripts', 100 );
|
19 |
add_action( 'admin_enqueue_scripts', 'quads_load_plugins_admin_scripts', 100 );
|
20 |
add_action( 'admin_enqueue_scripts', 'quads_load_all_admin_scripts', 100 );
|
21 |
+
add_action( 'admin_print_footer_scripts', 'quads_check_ad_blocker' );
|
22 |
|
23 |
/**
|
24 |
* Create ad blocker admin script
|
25 |
*
|
26 |
* @return mixed boolean | string
|
27 |
*/
|
28 |
+
function quads_check_ad_blocker() {
|
29 |
+
if( !quads_is_admin_page() ) {
|
30 |
return false;
|
31 |
}
|
32 |
?>
|
33 |
+
<script type="text/javascript">
|
34 |
+
window.onload = function(){
|
35 |
+
if (typeof wpquads_adblocker_check === 'undefined' || false === wpquads_adblocker_check) {
|
36 |
+
if (document.getElementById('wpquads-adblock-notice')){
|
37 |
+
document.getElementById('wpquads-adblock-notice').style.display = 'block';
|
38 |
+
console.log('adblocker detected');
|
39 |
+
}
|
40 |
+
}
|
41 |
+
}
|
42 |
+
</script>
|
43 |
+
<?php
|
44 |
}
|
45 |
|
46 |
/**
|
58 |
return;
|
59 |
}
|
60 |
global $wp_version, $quads;
|
61 |
+
|
62 |
+
$js_dir = QUADS_PLUGIN_URL . 'assets/js/';
|
63 |
$css_dir = QUADS_PLUGIN_URL . 'assets/css/';
|
64 |
|
65 |
// Use minified libraries if SCRIPT_DEBUG is turned off
|
66 |
$suffix = ( quadsIsDebugMode() ) ? '' : '.min';
|
67 |
+
|
68 |
|
69 |
// These have to be global
|
70 |
wp_enqueue_script( 'quads-admin-ads', $js_dir . 'ads.js', array('jquery'), QUADS_VERSION, false );
|
74 |
wp_enqueue_script( 'jquery-form' );
|
75 |
|
76 |
$vi_dir = QUADS_PLUGIN_URL . 'includes/vendor/vi/public/js/';
|
77 |
+
wp_enqueue_script( 'quads-vi', $vi_dir . 'vi.js', array(), QUADS_VERSION, false );
|
78 |
+
|
79 |
|
|
|
80 |
wp_enqueue_style( 'quads-admin', $css_dir . 'quads-admin' . $suffix . '.css', QUADS_VERSION );
|
81 |
wp_enqueue_style( 'jquery-chosen', $css_dir . 'chosen' . $suffix . '.css', QUADS_VERSION );
|
82 |
+
|
83 |
$signupURL = $quads->vi->getSettings()->data->signupURL;
|
84 |
+
|
85 |
wp_localize_script( 'quads-admin-scripts', 'quads', array(
|
86 |
+
'nonce' => wp_create_nonce( 'quads_ajax_nonce' ),
|
87 |
+
'error' => __( "error", 'quick-adsense-reloaded' ),
|
88 |
+
'path' => get_option( 'siteurl' ),
|
89 |
+
'vi_revenue' => !empty( $quads->vi->getRevenue()->mtdReport ) ? $quads->vi->getRevenue()->mtdReport : '',
|
90 |
+
'vi_login_url' => $quads->vi->getLoginURL(),
|
91 |
+
'vi_signup_url' => !empty( $signupURL ) ? $signupURL : '',
|
92 |
+
'domain' => $quads->vi->getDomain(),
|
93 |
+
'email' => get_option( 'admin_email' ),
|
94 |
+
'aid' => 'WP_Quads'
|
95 |
) );
|
96 |
}
|
97 |
|
110 |
return;
|
111 |
}
|
112 |
|
113 |
+
$js_dir = QUADS_PLUGIN_URL . 'assets/js/';
|
114 |
$css_dir = QUADS_PLUGIN_URL . 'assets/css/';
|
115 |
|
116 |
// Use minified libraries if SCRIPT_DEBUG is turned off
|
117 |
$suffix = ( quadsIsDebugMode() ) ? '' : '.min';
|
118 |
|
119 |
wp_enqueue_script( 'quads-plugins-admin-scripts', $js_dir . 'quads-plugins-admin' . $suffix . '.js', array('jquery'), QUADS_VERSION, false );
|
120 |
+
wp_enqueue_style( 'quads-plugins-admin', $css_dir . 'quads-plugins-admin' . $suffix . '.css', QUADS_VERSION );
|
121 |
}
|
122 |
+
|
123 |
/**
|
124 |
* Load Admin Scripts available on all admin pages
|
125 |
*
|
131 |
* @return void
|
132 |
*/
|
133 |
function quads_load_all_admin_scripts( $hook ) {
|
134 |
+
|
|
|
|
|
135 |
|
136 |
$css_dir = QUADS_PLUGIN_URL . 'assets/css/';
|
137 |
|
138 |
+
wp_enqueue_style( 'quads-admin-all', $css_dir . 'quads-admin-all.css', QUADS_VERSION );
|
139 |
}
|
140 |
|
141 |
+
/**
|
142 |
+
* Create Gutenberg block
|
143 |
+
*/
|
144 |
+
function quads_load_blocks() {
|
145 |
+
$js_dir = QUADS_PLUGIN_URL . 'assets/js/';
|
146 |
+
|
147 |
+
wp_register_script( 'wpquads', $js_dir . 'blocks.js', array('wp-blocks', 'wp-element', 'wp-editor') );
|
148 |
+
|
149 |
+
register_block_type( 'wpquads/blocks', array(
|
150 |
+
'editor_script' => 'wpquads',
|
151 |
+
) );
|
152 |
+
}
|
153 |
+
|
154 |
+
add_action( 'init', 'quads_load_blocks' );
|
155 |
+
|
156 |
+
|
157 |
/**
|
158 |
* Register CSS Styles
|
159 |
*
|
185 |
*/
|
186 |
function quads_inline_styles() {
|
187 |
global $quads_options;
|
188 |
+
|
189 |
$css = '';
|
190 |
+
|
191 |
if( isset( $quads_options['ads'] ) ) {
|
192 |
+
foreach ( $quads_options['ads'] as $key => $value ) {
|
193 |
+
$css .= quads_render_media_query( $key, $value );
|
194 |
+
}
|
195 |
+
}
|
196 |
+
// Register empty style so we do not need an external css file
|
197 |
+
wp_register_style( 'quads-styles', false );
|
198 |
+
// Enque empty style
|
199 |
+
wp_enqueue_style( 'quads-styles' );
|
200 |
+
// Add inline css to that style
|
201 |
+
wp_add_inline_style( 'quads-styles', $css );
|
202 |
}
|
203 |
|
204 |
/**
|
208 |
* @param string $value
|
209 |
* @return string
|
210 |
*/
|
211 |
+
function quads_render_media_query( $key, $value ) {
|
212 |
+
$lic = get_option( 'quads_wp_quads_pro_license_active' );
|
213 |
+
if( !$lic || (is_object( $lic ) && $lic->success !== true) ) {
|
214 |
+
return '';
|
215 |
+
}
|
216 |
+
|
217 |
+
$html = '';
|
218 |
+
|
219 |
+
if( isset( $value['desktop'] ) ) {
|
220 |
//$html .= '/* Hide on desktop */';
|
221 |
+
$html .= '@media only screen and (min-width:1140px){#quads-' . $key . ', .quads-' . $key . ' {display:none;}}' . "\n";
|
222 |
}
|
223 |
+
if( isset( $value['tablet_landscape'] ) ) {
|
224 |
//$html .= '/* Hide on tablet landscape */';
|
225 |
+
$html .= '@media only screen and (min-width:1024px) and (max-width:1140px) {#quads-' . $key . ', .quads-' . $key . ' {display:none;}}' . "\n";
|
226 |
}
|
227 |
+
if( isset( $value['tablet_portrait'] ) ) {
|
228 |
//$html .= '/* Hide on tablet portrait */';
|
229 |
+
$html .= '@media only screen and (min-width:768px) and (max-width:1023px){#quads-' . $key . ', .quads-' . $key . ' {display:none;}}' . "\n";
|
230 |
}
|
231 |
+
if( isset( $value['phone'] ) ) {
|
232 |
//$html .= '/* Hide on mobile device */';
|
233 |
+
$html .= '@media only screen and (max-width:767px){#quads-' . $key . ', .quads-' . $key . ' {display:none;}}' . "\n";
|
234 |
}
|
235 |
+
|
236 |
return $html;
|
237 |
}
|
238 |
|
242 |
* @since 0.9.0
|
243 |
* @return bool true if Mashshare debug mode is on
|
244 |
*/
|
245 |
+
|
246 |
+
function quadsIsDebugMode() {
|
247 |
global $quads_options;
|
248 |
|
249 |
+
$debug_mode = isset( $quads_options['debug_mode'] ) ? true : false;
|
250 |
return $debug_mode;
|
251 |
}
|
252 |
|
256 |
* @author Tedd Garland, René Hermenau
|
257 |
* @since 0.9.0
|
258 |
*/
|
259 |
+
$wpvcomp = ( bool ) (version_compare( get_bloginfo( 'version' ), '3.1', '>=' ));
|
260 |
|
|
|
|
|
|
|
261 |
function quads_ads_head_script() {
|
262 |
global $quads_options, $wpvcomp;
|
263 |
|
264 |
+
if( isset( $quads_options['quicktags']['QckTags'] ) ) {
|
265 |
+
?>
|
266 |
<script type="text/javascript">
|
267 |
+
wpvcomp = <?php echo (($wpvcomp == 1) ? "true " : "false"); ?>;
|
268 |
edaddID = new Array();
|
269 |
edaddNm = new Array();
|
270 |
+
if (typeof (edButtons) != 'undefined') {
|
271 |
+
edadd = edButtons.length;
|
272 |
+
var dynads = {"all":[
|
273 |
+
<?php
|
274 |
+
for ( $i = 1; $i <= count( quads_get_ads() ) - 1; $i++ ) {
|
275 |
+
if( isset( $quads_options['ads']['ad' . $i]['code'] ) && $quads_options['ads']['ad' . $i]['code'] != '' ) {
|
276 |
+
echo('" 1",');
|
277 |
+
} else {
|
278 |
+
echo('"0",');
|
279 |
+
};
|
280 |
+
}
|
281 |
+
?>
|
282 |
+
" 0 "] };
|
283 |
+
for (i = 1; i <=<?php echo count( quads_get_ads() ) - 1; ?>; i++) { i f (dynads.all[ i - 1 ] == "1") {
|
284 |
+
edButtons [ edButtons.le n gth] = n ew edB u tton("ads" + i.toString(), "Ads" + i.toString(), "\n<!--Ads"+i.toSt r ing()+"-->\n", "", "", - 1);
|
285 |
+
edaddID[eda d dID.length] = " ads" + i.t oString();
|
286 |
+
edaddNm[edaddNm.length] ="Ads" + i.toString();
|
287 |
+
}
|
288 |
+
}
|
289 |
+
<?php if( !isset( $quads_options['quicktags']['QckRnds'] ) ) { ?>
|
290 |
+
edButtons[edButtons.length] = n e w edButton("random_ads", " RndAds", "\n<!--RndAds-->\n", "", "", - 1);
|
291 |
+
edaddID[edaddID.length] = "random_ads";
|
292 |
+
edaddNm[edaddNm.length] = "RndAds";
|
293 |
<?php } ?>
|
294 |
+
edButtons[edButtons.length] = new edButton("no_ads", "NoAds", "\n<!--NoAds-->\n","","",-1);
|
295 |
+
edaddID[edaddID.length] = "no_ads";
|
296 |
+
edaddNm[edaddNm.length] = "NoAds";
|
297 |
+
};
|
298 |
+
(function(){
|
299 |
+
if(typeof(edButtons)!='undefined' && typeof(jQuery)!='undefined' && wpvcomp){
|
300 |
+
jQuery(document).ready(function(){
|
301 |
+
for(i=0;i<edaddID.length;i++) {
|
302 |
+
jQuery("#ed_toolbar").append('<input type="button" value="' + edaddNm[i] +'" id="' + edaddID[i] +'" class="ed_button" onclick="edInsertTag(edCanvas, ' + (edadd+i) + ');" title="' + edaddNm[i] +'" />');
|
303 |
+
}
|
304 |
+
});
|
305 |
+
}
|
306 |
+
}());
|
307 |
</script>
|
308 |
+
<?php
|
309 |
}
|
310 |
+
}
|
311 |
+
|
312 |
+
if( $wpvcomp ) {
|
313 |
+
add_action( 'admin_print_footer_scripts', 'quads_ads_head_script' );
|
314 |
+
} else {
|
315 |
+
add_action( 'admin_head', 'quads_ads_head_javascript_script' );
|
316 |
}
|
includes/vendor/google/adsense.php
CHANGED
@@ -67,13 +67,17 @@ class adsense {
|
|
67 |
//get g_data_ad_client
|
68 |
$explode_ad_code = explode('data-ad-client', $value['code']);
|
69 |
preg_match('#"([a-zA-Z0-9-\s]+)"#', $explode_ad_code[1], $matches_add_client);
|
70 |
-
|
|
|
|
|
71 |
} else {
|
72 |
//*** GOOGLE SYNCRON *************
|
73 |
//get g_data_ad_client
|
74 |
$explode_ad_code = explode('google_ad_client', $value['code']);
|
75 |
preg_match('#"([a-zA-Z0-9-\s]+)"#', $explode_ad_code[1], $matches_add_client);
|
76 |
-
|
|
|
|
|
77 |
}
|
78 |
}
|
79 |
}
|
67 |
//get g_data_ad_client
|
68 |
$explode_ad_code = explode('data-ad-client', $value['code']);
|
69 |
preg_match('#"([a-zA-Z0-9-\s]+)"#', $explode_ad_code[1], $matches_add_client);
|
70 |
+
if(isset($matches_add_client[1])){
|
71 |
+
$this->publisherIds[] = str_replace(array('"', ' '), array(''), $matches_add_client[1]);
|
72 |
+
}
|
73 |
} else {
|
74 |
//*** GOOGLE SYNCRON *************
|
75 |
//get g_data_ad_client
|
76 |
$explode_ad_code = explode('google_ad_client', $value['code']);
|
77 |
preg_match('#"([a-zA-Z0-9-\s]+)"#', $explode_ad_code[1], $matches_add_client);
|
78 |
+
if(isset($matches_add_client[1])){
|
79 |
+
$this->publisherIds[] = str_replace(array('"', ' '), array(''), $matches_add_client[1]);
|
80 |
+
}
|
81 |
}
|
82 |
}
|
83 |
}
|
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: Rene Hermenau, WP-Staging
|
8 |
* Author URI: https://wordpress.org/plugins/quick-adsense-reloaded/
|
9 |
-
* Version: 1.8.
|
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', '1.8.
|
42 |
}
|
43 |
|
44 |
// Plugin name
|
@@ -269,22 +269,6 @@ if( !class_exists( 'QuickAdsenseReloaded' ) ) :
|
|
269 |
$autoloader->register();
|
270 |
}
|
271 |
|
272 |
-
/**
|
273 |
-
* Set a variable to DI with given name
|
274 |
-
* @param string $name
|
275 |
-
* @param mixed $variable
|
276 |
-
* @return $this
|
277 |
-
*/
|
278 |
-
// public function set( $name, $variable ) {
|
279 |
-
// // It is a function
|
280 |
-
// if( is_callable( $variable ) )
|
281 |
-
// $variable = $variable();
|
282 |
-
//
|
283 |
-
// // Add it to services
|
284 |
-
// $this->services[$name] = $variable;
|
285 |
-
//
|
286 |
-
// return $this;
|
287 |
-
// }
|
288 |
|
289 |
|
290 |
public function load_hooks() {
|
6 |
* Description: Insert Google AdSense and other ad formats fully automatic into your website
|
7 |
* Author: Rene Hermenau, WP-Staging
|
8 |
* Author URI: https://wordpress.org/plugins/quick-adsense-reloaded/
|
9 |
+
* Version: 1.8.3
|
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', '1.8.3' );
|
42 |
}
|
43 |
|
44 |
// Plugin name
|
269 |
$autoloader->register();
|
270 |
}
|
271 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
|
273 |
|
274 |
public function load_hooks() {
|
readme.txt
CHANGED
@@ -8,9 +8,9 @@ License: GPLv2 or later
|
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
Tags: adsense, ads, ad, google adsense, advertising, amp, ad injection, ad inserter, ad manager
|
10 |
Requires at least: 3.6+
|
11 |
-
Tested up to: 5.
|
12 |
Requires PHP: 5.3
|
13 |
-
Stable tag: 1.8.
|
14 |
|
15 |
Quick Adsense Reloaded! Quickest way to insert Google AdSense & other ads into your website. Google AdSense integration with Google AMP support
|
16 |
|
@@ -130,6 +130,13 @@ Alternative Installation:
|
|
130 |
|
131 |
== Changelog ==
|
132 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
= 1.8.2 =
|
134 |
* Fix: Gutenberg breaks traditional admin notices so we remove our admin notices from the edit screen
|
135 |
|
@@ -168,5 +175,5 @@ Complete changelog: https://wpquads.com/changelog
|
|
168 |
|
169 |
== Upgrade Notice ==
|
170 |
|
171 |
-
= 1.
|
172 |
-
1.
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
Tags: adsense, ads, ad, google adsense, advertising, amp, ad injection, ad inserter, ad manager
|
10 |
Requires at least: 3.6+
|
11 |
+
Tested up to: 5.1
|
12 |
Requires PHP: 5.3
|
13 |
+
Stable tag: 1.8.3
|
14 |
|
15 |
Quick Adsense Reloaded! Quickest way to insert Google AdSense & other ads into your website. Google AdSense integration with Google AMP support
|
16 |
|
130 |
|
131 |
== Changelog ==
|
132 |
|
133 |
+
= 1.8.3 =
|
134 |
+
* New: WordPress 5.0 Gutenberg support
|
135 |
+
* New: WordPress 5.1 support
|
136 |
+
* New: WordPress 5.1.1 support
|
137 |
+
* Fix: Undefined offset in wpquads\adsense
|
138 |
+
|
139 |
+
|
140 |
= 1.8.2 =
|
141 |
* Fix: Gutenberg breaks traditional admin notices so we remove our admin notices from the edit screen
|
142 |
|
175 |
|
176 |
== Upgrade Notice ==
|
177 |
|
178 |
+
= 1.8.3 =
|
179 |
+
1.8.3 Gutenberg Support
|