Skip to content
This repository was archived by the owner on Mar 14, 2021. It is now read-only.

Commit 545d430

Browse files
authored
Merge pull request #40 from Codeinwp/development
Fixed reset stats error Fixed icon menu Fixed dashboard widget showing for non-admins
2 parents 80a1950 + f3c7c20 commit 545d430

15 files changed

+1909
-415
lines changed

README.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Contributors: themeisle
33
Tags: adblock, page redirect, cookies, notify, modal box, dashboard widget, ads, notification, adBlocker, Responsive, plugin, popup, modal, jquery, ajax, free, advetissement, shortcode, images, image, CSS, lightbox
44
Requires at least: 3.7
5-
Tested up to: 4.6.1
5+
Tested up to: 4.7
66
License: GPLv2 or later
77
License URI: http://www.gnu.org/licenses/gpl-2.0.html
88

@@ -21,6 +21,7 @@ Adblock Notify is a very easy to use plugin with get around options and a lot of
2121

2222
> **Time-saving features available in the Pro version:**
2323
>
24+
> * Up to 250k page views blocked by our plugin
2425
> * Supoort for multisite ( Setup in one place and use it across all network sites )
2526
> * Advance templating system for modal and easy to customize inside the themes
2627
> * Advance control for modal behaviour
@@ -128,6 +129,13 @@ If you don't have any caching/minify plugin, it is mostly due to your theme whic
128129

129130
== Changelog ==
130131

132+
= 2.1.0 =
133+
134+
* Fixed reset stats issue.
135+
* Removed old menu icon.
136+
* Removed dashboard widget showing non-admins.
137+
* Added testimonials from plugin users.
138+
131139
= 2.0.12 =
132140

133141
* Fixed issue with modal showing on the footer

adblock-notify-files.php

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ function an_change_files_css_selectors( $flush, $tempFolderPath, $tempFolderURL,
7373
}
7474
// Create new dir and files
7575
if ( $wp_filesystem->is_dir( $tempFolderPath ) ) {
76-
array_map( 'unlink', glob( $tempFolderPath . '*.' . $fileExt ) );
76+
$glob_files = glob( $tempFolderPath . '*.' . $fileExt );
77+
array_map( 'unlink', is_array( $glob_files ) ? $glob_files : false );
7778
} else {
7879
$wp_filesystem->mkdir( $tempFolderPath );
7980
}
@@ -101,7 +102,11 @@ function an_save_setting_random_selectors( $force = false ) {
101102
}
102103
$an_option = unserialize( an_get_option( 'adblocker_notify_options' ) );
103104
$anScripts = unserialize( an_get_option( 'adblocker_notify_selectors' ) );
104-
if ( true == $an_option['an_option_selectors'] || $force ) {
105+
$selectors_option = isset( $an_option['an_option_selectors'] ) ? $an_option['an_option_selectors'] : true;
106+
if ( true == $selectors_option || $force ) {
107+
if ( ! isset( $an_option['an_option_flush'] ) ) {
108+
$an_option['an_option_flush'] = false;
109+
}
105110
// Define new temp path
106111
$uploadDir = wp_upload_dir();
107112
$tempDirName = an_random_slug();
@@ -122,7 +127,7 @@ function an_save_setting_random_selectors( $force = false ) {
122127
}
123128
// Define new selectors
124129
$newSelectors = array( an_random_slug(), an_random_slug(), an_random_slug() );
125-
$flush = false;
130+
$flush = false;
126131
if ( true == $an_option['an_option_flush'] || ! file_exists( $anScripts['temp-path'] ) || false == $anScripts['temp-path'] ) {
127132
$flush = true;
128133
}
@@ -178,14 +183,17 @@ function an_save_setting_random_selectors( $force = false ) {
178183
);
179184
an_update_option( 'adblocker_notify_selectors', serialize( $newFiles ) );
180185
// remove option flush
186+
if ( ! isset( $an_option['an_option_flush'] ) ) {
187+
$an_option['an_option_flush'] = false;
188+
}
181189
$an_option['an_option_flush'] = false;
182190
an_update_option( 'adblocker_notify_options', serialize( $an_option ) );
183191
} else {
184192
// Remove temp files
185193
if ( isset( $anScripts['temp-path'] ) ) {
186194
an_delete_temp_folder( $anScripts['temp-path'] );
187195
}
188-
}
196+
}// End if().
189197
}
190198

191199
add_action( 'tf_admin_options_saved_adblocker_notify', 'an_save_setting_random_selectors', 99 );
@@ -244,19 +252,19 @@ function an_update_titan_css_selectors( $an_option ) {
244252
***************************************************************/
245253
function an_print_change_files_css_selectors( $an_option, $anScripts ) {
246254
// Get AN style and script
247-
$anCSS = AN_URL . 'css/an-style.css';
248-
$anJS = AN_URL . 'js/an-scripts.js';
255+
$anCSS = AN_URL . 'css/an-style.css';
256+
$anJS = AN_URL . 'js/an-scripts.js';
249257
$newSelectors = $anScripts['selectors'];
250258
$defaultSelectors = array( 'an-Modal', 'reveal-modal', 'an-alternative' );
251-
$tfStyle = '';
259+
$tfStyle = '';
252260
$tfStyle .= $an_option->getOption( 'an_alternative_custom_css' );
253261
$tfStyle .= $an_option->getOption( 'an_option_modal_custom_css' );
254262
$anCSSFileContent = wp_remote_get( $anCSS );
255263
$anCSSFileContent = wp_remote_retrieve_body( $anCSSFileContent );
256264
$anCSSFileContent = str_replace( $defaultSelectors, $newSelectors, $anCSSFileContent . $tfStyle );
257-
$anJSFileContent = wp_remote_get( $anJS );
258-
$anJSFileContent = wp_remote_retrieve_body( $anJSFileContent );
259-
$anJSFileContent = str_replace( $defaultSelectors, $newSelectors, $anJSFileContent );
265+
$anJSFileContent = wp_remote_get( $anJS );
266+
$anJSFileContent = wp_remote_retrieve_body( $anJSFileContent );
267+
$anJSFileContent = str_replace( $defaultSelectors, $newSelectors, $anJSFileContent );
260268

261269
return '
262270
<style type="text/css">

0 commit comments

Comments
 (0)