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

Commit ded65d8

Browse files
authored
Merge pull request #24 from Codeinwp/development
Fixed issue with updates for old users
2 parents a0ef5cb + fa02073 commit ded65d8

9 files changed

+48
-22
lines changed

.jshintignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ If you don't have any caching/minify plugin, it is mostly due to your theme whic
128128

129129
== Changelog ==
130130

131+
= 2.0.1 =
132+
* Fixed comptibility issues for users on upgrade
133+
131134
= 2.0.0 =
132135
* Tested on WP 4.6.1 with success!
133136
* Added compatibility with pro plugin

adblock-notify-files.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function an_change_files_css_selectors( $flush, $tempFolderPath, $tempFolderURL,
5050
$fileContent = str_replace( $defaultSelectors, $oldSelectors, $fileContent );
5151

5252
}
53-
53+
require_once( ABSPATH . 'wp-admin/includes/file.php' );
5454
// Load WP_Filesystem API
5555
WP_Filesystem();
5656
global $wp_filesystem;
@@ -93,7 +93,7 @@ function an_change_files_css_selectors( $flush, $tempFolderPath, $tempFolderURL,
9393
* ************************************************************
9494
* Save scripts and styles with new random selectors after saving Titan Options
9595
***************************************************************/
96-
function an_save_setting_random_selectors() {
96+
function an_save_setting_random_selectors( $force = false ) {
9797

9898
// Restart cookie on every options save.
9999
if ( isset( $_COOKIE[ AN_COOKIE ] ) ) {
@@ -103,7 +103,7 @@ function an_save_setting_random_selectors() {
103103
$an_option = unserialize( an_get_option( 'adblocker_notify_options' ) );
104104
$anScripts = unserialize( an_get_option( 'adblocker_notify_selectors' ) );
105105

106-
if ( true == $an_option['an_option_selectors'] ) {
106+
if ( true == $an_option['an_option_selectors'] || $force ) {
107107

108108
// Define new temp path
109109
$uploadDir = wp_upload_dir();

adblock-notify-functions.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ function an_check_key( $key ) {
375375
'adblocker_notify_options',
376376
'adblocker_notify_selectors',
377377
'adblocker_notify_counter',
378+
'adblocker_upgrade_200',
378379
);
379380

380381
return in_array( $key, $all_keys );
@@ -480,3 +481,22 @@ function an_build_selected_template() {
480481

481482
return ob_get_clean();
482483
}
484+
485+
486+
add_action( 'an_upgrade_routine','an_upgrade_routine_200' );
487+
/**
488+
* Upgrade routine from version <= 2.0.1
489+
*/
490+
function an_upgrade_routine_200() {
491+
if ( version_compare( AN_VERSION,'2.0.1' ) < 1 ) {
492+
$upgrade = an_get_option( 'adblocker_upgrade_200','no' );
493+
if ( $upgrade != 'yes' ) {
494+
$anTempDir = unserialize( an_get_option( 'adblocker_notify_selectors' ) );
495+
if ( isset( $anTempDir['temp-path'] ) ) {
496+
an_delete_temp_folder( $anTempDir['temp-path'] );
497+
an_save_setting_random_selectors( true );
498+
an_update_option( 'adblocker_upgrade_200','yes' );
499+
}
500+
}
501+
}
502+
}

adblock-notify-widget.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
function an_dashboard_widgets() {
1919
$an_option = TitanFramework::getInstance( 'adblocker_notify' );
2020
if ( isset( $an_option ) && $an_option->getOption( 'an_option_stats' ) != 2 ) {
21-
wp_add_dashboard_widget( 'an_dashboard_widgets', '<img src="' . AN_URL . 'img/icon-bweb.svg" class="bweb-logo" alt="addblock-notify" style="display:none"/>&nbsp;&nbsp;' . __( 'Adblock Notify Stats', 'an-translate' ), 'an_get_counters' );
21+
wp_add_dashboard_widget( 'an_dashboard_widgets', '<img src="' . AN_URL . 'img/icon-adblock-notify.png" class="bweb-logo" alt="addblock-notify" style="display:none"/>&nbsp;&nbsp;' . __( 'Adblock Notify Stats', 'an-translate' ), 'an_get_counters' );
2222
// Chart JS
2323
wp_enqueue_script( 'an_chart_js', AN_URL . 'vendor/chart-js/Chart.min.js', array( 'jquery' ), null );
2424
// CSS & JS

adblock-notify.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Plugin Name: Adblock Notify Lite
88
* Plugin URI: http://themeisle.com/plugins/adblock-notify-lite/
99
* Description: An Adblock detection and nofitication plugin with get around options and a lot of settings. Dashboard widget with adblock counter included!
10-
* Version: 2.0.0
10+
* Version: 2.0.1
1111
* Author: Themeisle
1212
* Author URI: http://themeisle.com
1313
* Text Domain: an-translate
@@ -47,7 +47,7 @@
4747
define( 'AN_COOKIE', 'anCookie' );
4848
}
4949
if ( ! defined( 'AN_VERSION' ) ) {
50-
define( 'AN_VERSION', '2.0.0' );
50+
define( 'AN_VERSION', '2.0.1' );
5151
}
5252
if ( ! defined( 'AN_TEMP_DEVELOPMENT' ) ) {
5353
define( 'AN_TEMP_DEVELOPMENT', false );
@@ -68,6 +68,8 @@
6868
function an_translate_load_textdomain() {
6969
$path = basename( dirname( __FILE__ ) ) . '/languages/';
7070
load_plugin_textdomain( 'an-translate', false, $path );
71+
72+
do_action( 'an_upgrade_routine' );
7173
}
7274

7375
add_action( 'plugins_loaded', 'an_translate_load_textdomain', 1 );
@@ -225,7 +227,7 @@ function an_add_favicon() {
225227
return;
226228
}
227229

228-
$favicon_url = AN_URL . 'img/icon-bweb.svg';
230+
$favicon_url = AN_URL . 'img/icon-adblock-notify.png';
229231
echo '<link rel="shortcut icon" href="' . $favicon_url . '" />';
230232
}
231233

css/an-style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
an_style.css
33
AdBlock Notify
44
Copyright: (c) 2016 Themeisle, themeisle.com
5-
Version: 2.0.0
5+
Version: 2.0.1
66
*/
77
.reveal-modal-bg {
88
display: none;

languages/an-translate.pot

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Copyright (C) 2016 Themeisle
2-
# This file is distributed under the same license as the Adblock Notify package.
2+
# This file is distributed under the same license as the Adblock Notify Lite package.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: Adblock Notify 1.9.2\n"
5+
"Project-Id-Version: Adblock Notify Lite 2.0.0\n"
66
"Report-Msgid-Bugs-To: "
77
"https://github.com/Codeinwp/adblock-notify-by-bweb/issues\n"
8-
"POT-Creation-Date: 2016-10-21 15:02:38+00:00\n"
8+
"POT-Creation-Date: 2016-10-24 12:43:37+00:00\n"
99
"MIME-Version: 1.0\n"
1010
"Content-Type: text/plain; charset=utf-8\n"
1111
"Content-Transfer-Encoding: 8bit\n"
@@ -39,19 +39,19 @@ msgid ""
3939
"change your uploads directory CHMOD."
4040
msgstr ""
4141

42-
#: adblock-notify-functions.php:414
42+
#: adblock-notify-functions.php:423
4343
msgid "Show your love"
4444
msgstr ""
4545

46-
#: adblock-notify-functions.php:417
46+
#: adblock-notify-functions.php:426
4747
msgid "Leave A Review"
4848
msgstr ""
4949

50-
#: adblock-notify-functions.php:423
50+
#: adblock-notify-functions.php:432
5151
msgid "Buy now"
5252
msgstr ""
5353

54-
#: adblock-notify-functions.php:426
54+
#: adblock-notify-functions.php:435
5555
msgid "Multi-Site Support"
5656
msgstr ""
5757

@@ -115,7 +115,7 @@ msgstr ""
115115
msgid "You can easily switch between them without losing your options."
116116
msgstr ""
117117

118-
#. Plugin Name of the plugin/theme
118+
#: adblock-notify-options.php:79
119119
msgid "Adblock Notify"
120120
msgstr ""
121121

@@ -744,7 +744,7 @@ msgstr ""
744744
msgid "You may probably increase this number by improving your custom messages"
745745
msgstr ""
746746

747-
#: adblock-notify-widget.php:231 adblock-notify.php:192
747+
#: adblock-notify-widget.php:231 adblock-notify.php:194
748748
msgid "Settings"
749749
msgstr ""
750750

@@ -756,7 +756,7 @@ msgstr ""
756756
msgid "Reset Stats"
757757
msgstr ""
758758

759-
#: adblock-notify.php:207
759+
#: adblock-notify.php:209
760760
msgid "More Plugins"
761761
msgstr ""
762762

@@ -1017,6 +1017,10 @@ msgstr ""
10171017
msgid "Issue Tracker"
10181018
msgstr ""
10191019

1020+
#. Plugin Name of the plugin/theme
1021+
msgid "Adblock Notify Lite"
1022+
msgstr ""
1023+
10201024
#. Plugin URI of the plugin/theme
10211025
msgid "http://themeisle.com/plugins/adblock-notify-lite/"
10221026
msgstr ""

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "adblock-notify-by-bweb",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "Adblock Notify plugin",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)