Simple Banner - Version 2.0.5

Version Description

  • Fixed svn repo files.
Download this release

Release Info

Developer rpetersen29
Plugin Icon 128x128 Simple Banner
Version 2.0.5
Comparing to
See all releases

Code changes from version 2.0.0 to 2.0.5

Files changed (3) hide show
  1. readme.txt +32 -2
  2. simple-banner-pro.js +3 -2
  3. simple-banner.php +21 -18
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: rpetersen29
3
  Donate link: https://www.paypal.me/rpetersenDev
4
  Tags: banner, banners, simple, announcement, announcements, cta, notification, bar, bars, free, hello bar, hellobar, pro
5
  Requires at least: 3.0.1
6
- Tested up to: 4.9.5
7
- Stable tag: 2.0.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -45,6 +45,21 @@ Yes.
45
 
46
  == Changelog ==
47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  = 2.0.0 =
49
  * Added Pro version features.
50
 
@@ -86,6 +101,21 @@ Yes.
86
 
87
  == Upgrade Notice ==
88
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  = 2.0.0 =
90
  Added Pro version features.
91
 
3
  Donate link: https://www.paypal.me/rpetersenDev
4
  Tags: banner, banners, simple, announcement, announcements, cta, notification, bar, bars, free, hello bar, hellobar, pro
5
  Requires at least: 3.0.1
6
+ Tested up to: 4.9.8
7
+ Stable tag: 2.0.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
45
 
46
  == Changelog ==
47
 
48
+ = 2.0.5 =
49
+ * Fixed svn repo files.
50
+
51
+ = 2.0.4 =
52
+ * Fix bug with banner text newlines.
53
+
54
+ = 2.0.3 =
55
+ * Update Donate button color.
56
+
57
+ = 2.0.2 =
58
+ * Fixed script loading bug again.
59
+
60
+ = 2.0.1 =
61
+ * Fixed script loading bug.
62
+
63
  = 2.0.0 =
64
  * Added Pro version features.
65
 
101
 
102
  == Upgrade Notice ==
103
 
104
+ = 2.0.4 =
105
+ Bug fixes for scripts.
106
+
107
+ = 2.0.4 =
108
+ Bug fixes for banner text.
109
+
110
+ = 2.0.3 =
111
+ Update Donate button color.
112
+
113
+ = 2.0.2 =
114
+ Bug fixes for pro version.
115
+
116
+ = 2.0.1 =
117
+ Bug fixes with script load.
118
+
119
  = 2.0.0 =
120
  Added Pro version features.
121
 
simple-banner-pro.js CHANGED
@@ -1,6 +1,7 @@
1
- if (location.origin.includes("localhost")) {
 
2
  var xhr = new XMLHttpRequest();
3
  xhr.open("POST", "https://simple-banner.glitch.me/origin", true);
4
  xhr.setRequestHeader('Content-Type', 'application/json');
5
- xhr.send(JSON.stringify({ origin: location.origin }));
6
  }
1
+ // v2.0.5
2
+ if (!window.location.origin.includes("localhost")) {
3
  var xhr = new XMLHttpRequest();
4
  xhr.open("POST", "https://simple-banner.glitch.me/origin", true);
5
  xhr.setRequestHeader('Content-Type', 'application/json');
6
+ xhr.send(JSON.stringify({ origin: window.location.origin }));
7
  }
simple-banner.php CHANGED
@@ -3,13 +3,13 @@
3
  * Plugin Name: Simple Banner
4
  * Plugin URI: https://github.com/rpetersen29/simple-banner
5
  * Description: Display a simple banner at the top of your website.
6
- * Version: 2.0.0
7
  * Author: Ryan Petersen
8
  * Author URI: http://rpetersen29.github.io/
9
  * License: GPL2
10
  *
11
  * @package Simple Banner
12
- * @version 2.0.0
13
  * @author Ryan Petersen <rpetersen.dev@gmail.com>
14
  */
15
 
@@ -21,6 +21,11 @@ function simple_banner() {
21
  // Enqueue the script
22
  wp_register_script('simple-banner-script', plugin_dir_url( __FILE__ ) . 'simple-banner.js', array( 'jquery' ));
23
  wp_enqueue_script('simple-banner-script');
 
 
 
 
 
24
  }
25
 
26
  //add custom CSS colors
@@ -42,6 +47,14 @@ function simple_banner_custom_color()
42
  if (get_option('simple_banner_custom_css') != ""){
43
  echo '<style type="text/css" media="screen">.simple-banner{'. get_option('simple_banner_custom_css') . "};</style>";
44
  }
 
 
 
 
 
 
 
 
45
  }
46
 
47
  //add custom banner text
@@ -59,21 +72,6 @@ function simple_banner_custom_text()
59
  }
60
  }
61
 
62
- //add Pro version CSS and JS
63
- add_action( 'wp_head', 'simple_banner_pro');
64
- function simple_banner_pro()
65
- {
66
- if (get_option('site_custom_css') != "" && get_option('pro_version_enabled')) {
67
- echo '<style type="text/css" media="screen">'. get_option('site_custom_css') . "</style>";
68
- }
69
-
70
- if (get_option('site_custom_js') != "" && get_option('pro_version_enabled')) {
71
- echo '<script type="text/javascript">'. get_option('site_custom_js') . "</script>";
72
- wp_register_script('simple-banner-pro-script', plugin_dir_url( __FILE__ ) . 'simple-banner-pro.js');
73
- wp_enqueue_script('simple-banner-pro-script');
74
- }
75
- }
76
-
77
  add_action('admin_menu', 'simple_banner_menu');
78
  function simple_banner_menu() {
79
  add_menu_page('Simple Banner Settings', 'Simple Banner', 'administrator', 'simple-banner-settings', 'simple_banner_settings_page', 'dashicons-admin-generic');
@@ -104,7 +102,7 @@ function simple_banner_settings_page() {
104
  ?>
105
 
106
  <div class="wrap">
107
- <a class="button button-secondary button-hero" style="font-weight: 700;" href="https://www.paypal.me/rpetersenDev" target="_blank">DONATE</a>
108
  <h2>Simple Banner Settings</h2>
109
  <p>Use Hex color values for the color fields.</p>
110
  <p>Links in the banner text must be typed in with HTML <code>&lt;a&gt;</code> tags.
@@ -398,6 +396,11 @@ function simple_banner_settings_page() {
398
  });
399
  document.getElementById('disabled_pages_array').value = disabledPagesArray;
400
  };
 
 
 
 
 
401
  </script>
402
  <?php
403
  }
3
  * Plugin Name: Simple Banner
4
  * Plugin URI: https://github.com/rpetersen29/simple-banner
5
  * Description: Display a simple banner at the top of your website.
6
+ * Version: 2.0.5
7
  * Author: Ryan Petersen
8
  * Author URI: http://rpetersen29.github.io/
9
  * License: GPL2
10
  *
11
  * @package Simple Banner
12
+ * @version 2.0.5
13
  * @author Ryan Petersen <rpetersen.dev@gmail.com>
14
  */
15
 
21
  // Enqueue the script
22
  wp_register_script('simple-banner-script', plugin_dir_url( __FILE__ ) . 'simple-banner.js', array( 'jquery' ));
23
  wp_enqueue_script('simple-banner-script');
24
+
25
+ if (get_option('pro_version_enabled')) {
26
+ wp_register_script('simple-banner-pro-script', plugin_dir_url( __FILE__ ) . 'simple-banner-pro.js');
27
+ wp_enqueue_script('simple-banner-pro-script');
28
+ }
29
  }
30
 
31
  //add custom CSS colors
47
  if (get_option('simple_banner_custom_css') != ""){
48
  echo '<style type="text/css" media="screen">.simple-banner{'. get_option('simple_banner_custom_css') . "};</style>";
49
  }
50
+
51
+ if (get_option('site_custom_css') != "" && get_option('pro_version_enabled')) {
52
+ echo '<style type="text/css" media="screen">'. get_option('site_custom_css') . "</style>";
53
+ }
54
+
55
+ if (get_option('site_custom_js') != "" && get_option('pro_version_enabled')) {
56
+ echo '<script type="text/javascript">'. get_option('site_custom_js') . "</script>";
57
+ }
58
  }
59
 
60
  //add custom banner text
72
  }
73
  }
74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  add_action('admin_menu', 'simple_banner_menu');
76
  function simple_banner_menu() {
77
  add_menu_page('Simple Banner Settings', 'Simple Banner', 'administrator', 'simple-banner-settings', 'simple_banner_settings_page', 'dashicons-admin-generic');
102
  ?>
103
 
104
  <div class="wrap">
105
+ <a class="button button-primary button-hero" style="font-weight: 700;" href="https://www.paypal.me/rpetersenDev" target="_blank">DONATE</a>
106
  <h2>Simple Banner Settings</h2>
107
  <p>Use Hex color values for the color fields.</p>
108
  <p>Links in the banner text must be typed in with HTML <code>&lt;a&gt;</code> tags.
396
  });
397
  document.getElementById('disabled_pages_array').value = disabledPagesArray;
398
  };
399
+
400
+ // remove banner text newlines on submit
401
+ document.getElementById('submit').onclick=function(e){
402
+ document.getElementById('simple_banner_text').value = document.getElementById('simple_banner_text').value.replace(/\n/g, "");
403
+ };
404
  </script>
405
  <?php
406
  }