Version Description
- Security improvements
Download this release
Release Info
Developer | rpetersen29 |
Plugin | Simple Banner |
Version | 2.12.0 |
Comparing to | |
See all releases |
Code changes from version 2.11.0 to 2.12.0
- readme.txt +8 -2
- simple-banner.php +15 -15
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: rpetersen29
|
|
3 |
Donate link: https://www.paypal.me/rpetersenDev
|
4 |
Tags: banner, simple, top, bar, announcement, top bar, topbar, bulletin, notification, notice, cta, free
|
5 |
Requires at least: 3.0.1
|
6 |
-
Tested up to:
|
7 |
-
Stable tag: 2.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -120,6 +120,9 @@ Set your banner position to <code>relative</code> and try this in 'Website Custo
|
|
120 |
|
121 |
== Changelog ==
|
122 |
|
|
|
|
|
|
|
123 |
= 2.11.0 =
|
124 |
* New feature: ability to change expiration date by specific time
|
125 |
|
@@ -297,6 +300,9 @@ Set your banner position to <code>relative</code> and try this in 'Website Custo
|
|
297 |
|
298 |
== Upgrade Notice ==
|
299 |
|
|
|
|
|
|
|
300 |
= 2.11.0 =
|
301 |
* New feature: ability to change expiration date by specific time
|
302 |
|
3 |
Donate link: https://www.paypal.me/rpetersenDev
|
4 |
Tags: banner, simple, top, bar, announcement, top bar, topbar, bulletin, notification, notice, cta, free
|
5 |
Requires at least: 3.0.1
|
6 |
+
Tested up to: 6.0.1
|
7 |
+
Stable tag: 2.12.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
120 |
|
121 |
== Changelog ==
|
122 |
|
123 |
+
= 2.12.0 =
|
124 |
+
* Security improvements
|
125 |
+
|
126 |
= 2.11.0 =
|
127 |
* New feature: ability to change expiration date by specific time
|
128 |
|
300 |
|
301 |
== Upgrade Notice ==
|
302 |
|
303 |
+
= 2.12.0 =
|
304 |
+
* Security improvements
|
305 |
+
|
306 |
= 2.11.0 =
|
307 |
* New feature: ability to change expiration date by specific time
|
308 |
|
simple-banner.php
CHANGED
@@ -3,16 +3,16 @@
|
|
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.
|
7 |
* Author: Ryan Petersen
|
8 |
* Author URI: http://rpetersen29.github.io/
|
9 |
* License: GPL2
|
10 |
*
|
11 |
* @package Simple Banner
|
12 |
-
* @version 2.
|
13 |
* @author Ryan Petersen <rpetersen.dev@gmail.com>
|
14 |
*/
|
15 |
-
define ('
|
16 |
|
17 |
register_activation_hook( __FILE__, 'simple_banner_activate' );
|
18 |
function simple_banner_activate() {
|
@@ -42,13 +42,13 @@ function get_disabled_on_current_page() {
|
|
42 |
add_action( 'wp_enqueue_scripts', 'simple_banner' );
|
43 |
function simple_banner() {
|
44 |
// Enqueue the style
|
45 |
-
wp_register_style('simple-banner-style', plugin_dir_url( __FILE__ ) .'simple-banner.css', '',
|
46 |
wp_enqueue_style('simple-banner-style');
|
47 |
// Set Script parameters
|
48 |
$disabled_on_current_page = get_disabled_on_current_page();
|
49 |
$script_params = array(
|
50 |
// script specific parameters
|
51 |
-
'version' =>
|
52 |
'hide_simple_banner' => get_option('hide_simple_banner'),
|
53 |
'simple_banner_position' => get_option('simple_banner_position'),
|
54 |
'header_margin' => get_option('header_margin'),
|
@@ -84,8 +84,8 @@ function simple_banner() {
|
|
84 |
'close_button_cookie_set' => isset($_COOKIE['simplebannerclosed']),
|
85 |
);
|
86 |
// Enqueue the script
|
87 |
-
wp_register_script('simple-banner-script', plugin_dir_url( __FILE__ ) . 'simple-banner.js', array( 'jquery' ),
|
88 |
-
|
89 |
wp_enqueue_script('simple-banner-script');
|
90 |
}
|
91 |
|
@@ -555,7 +555,7 @@ function simple_banner_settings_page() {
|
|
555 |
<br><span style="font-weight:400;">Leaving this blank removes the banner</span>
|
556 |
</th>
|
557 |
<td>
|
558 |
-
<textarea id="simple_banner_text" class="large-text code" style="height: 150px;width: 97%;" name="simple_banner_text"><?php echo get_option('simple_banner_text'); ?></textarea>
|
559 |
</td>
|
560 |
</tr>
|
561 |
<!-- Custom CSS -->
|
@@ -571,24 +571,24 @@ function simple_banner_settings_page() {
|
|
571 |
<tr valign="top">
|
572 |
<th scope="row" style="font-weight:400;">
|
573 |
<div>.simple-banner {</div>
|
574 |
-
<textarea id="simple_banner_custom_css" class="code" style="height: 150px;width: 90%;" name="simple_banner_custom_css"><?php echo get_option('simple_banner_custom_css'); ?></textarea>
|
575 |
<div>}</div>
|
576 |
</th>
|
577 |
<td>
|
578 |
<div style="display:flex">
|
579 |
<div style="flex-grow:1;">
|
580 |
<div>.simple-banner-scrolling {</div>
|
581 |
-
<textarea id="simple_banner_scrolling_custom_css" class="code" style="height: 150px;width: 90%;" name="simple_banner_scrolling_custom_css"><?php echo get_option('simple_banner_scrolling_custom_css'); ?></textarea>
|
582 |
<div>}</div>
|
583 |
</div>
|
584 |
<div style="flex-grow:1;">
|
585 |
<div>.simple-banner-text {</div>
|
586 |
-
<textarea id="simple_banner_text_custom_css" class="code" style="height: 150px;width: 90%;" name="simple_banner_text_custom_css"><?php echo get_option('simple_banner_text_custom_css'); ?></textarea>
|
587 |
<div>}</div>
|
588 |
</div>
|
589 |
<div style="flex-grow:1;">
|
590 |
<div>.simple-banner-button {</div>
|
591 |
-
<textarea id="simple_banner_button_css" class="code" style="height: 150px;width: 90%;" name="simple_banner_button_css"><?php echo get_option('simple_banner_button_css'); ?></textarea>
|
592 |
<div>}</div>
|
593 |
</div>
|
594 |
</div>
|
@@ -709,7 +709,7 @@ function simple_banner_settings_page() {
|
|
709 |
Activation Code
|
710 |
</th>
|
711 |
<td>
|
712 |
-
<input type="text" style="border: 2px solid gold;border-radius: 5px;" id="pro_version_activation_code" name="pro_version_activation_code" value="<?php echo get_option('pro_version_activation_code'); ?>" />
|
713 |
</td>
|
714 |
</tr>
|
715 |
<!-- Permissions -->
|
@@ -823,7 +823,7 @@ function simple_banner_settings_page() {
|
|
823 |
<td>
|
824 |
<?php
|
825 |
if (get_option('pro_version_enabled')) {
|
826 |
-
echo '<textarea id="site_custom_css" style="height: 150px;width: 75%;" name="site_custom_css">'. get_option('site_custom_css') . '</textarea>';
|
827 |
} else {
|
828 |
echo '<textarea style="height: 150px;width: 75%;" disabled></textarea>';
|
829 |
}
|
@@ -854,7 +854,7 @@ function simple_banner_settings_page() {
|
|
854 |
<td>
|
855 |
<?php
|
856 |
if (get_option('pro_version_enabled')) {
|
857 |
-
echo '<textarea id="site_custom_js" style="height: 150px;width: 75%;" name="site_custom_js">'. get_option('site_custom_js') . '</textarea>';
|
858 |
} else {
|
859 |
echo '<textarea style="height: 150px;width: 75%;" disabled></textarea>';
|
860 |
}
|
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.12.0
|
7 |
* Author: Ryan Petersen
|
8 |
* Author URI: http://rpetersen29.github.io/
|
9 |
* License: GPL2
|
10 |
*
|
11 |
* @package Simple Banner
|
12 |
+
* @version 2.12.0
|
13 |
* @author Ryan Petersen <rpetersen.dev@gmail.com>
|
14 |
*/
|
15 |
+
define ('SB_VERSION', '2.12.0');
|
16 |
|
17 |
register_activation_hook( __FILE__, 'simple_banner_activate' );
|
18 |
function simple_banner_activate() {
|
42 |
add_action( 'wp_enqueue_scripts', 'simple_banner' );
|
43 |
function simple_banner() {
|
44 |
// Enqueue the style
|
45 |
+
wp_register_style('simple-banner-style', plugin_dir_url( __FILE__ ) .'simple-banner.css', '', SB_VERSION);
|
46 |
wp_enqueue_style('simple-banner-style');
|
47 |
// Set Script parameters
|
48 |
$disabled_on_current_page = get_disabled_on_current_page();
|
49 |
$script_params = array(
|
50 |
// script specific parameters
|
51 |
+
'version' => SB_VERSION,
|
52 |
'hide_simple_banner' => get_option('hide_simple_banner'),
|
53 |
'simple_banner_position' => get_option('simple_banner_position'),
|
54 |
'header_margin' => get_option('header_margin'),
|
84 |
'close_button_cookie_set' => isset($_COOKIE['simplebannerclosed']),
|
85 |
);
|
86 |
// Enqueue the script
|
87 |
+
wp_register_script('simple-banner-script', plugin_dir_url( __FILE__ ) . 'simple-banner.js', array( 'jquery' ), SB_VERSION);
|
88 |
+
wp_add_inline_script('simple-banner-script', 'const simpleBannerScriptParams = ' . wp_json_encode($script_params));
|
89 |
wp_enqueue_script('simple-banner-script');
|
90 |
}
|
91 |
|
555 |
<br><span style="font-weight:400;">Leaving this blank removes the banner</span>
|
556 |
</th>
|
557 |
<td>
|
558 |
+
<textarea id="simple_banner_text" class="large-text code" style="height: 150px;width: 97%;" name="simple_banner_text"><?php echo esc_textarea(get_option('simple_banner_text')); ?></textarea>
|
559 |
</td>
|
560 |
</tr>
|
561 |
<!-- Custom CSS -->
|
571 |
<tr valign="top">
|
572 |
<th scope="row" style="font-weight:400;">
|
573 |
<div>.simple-banner {</div>
|
574 |
+
<textarea id="simple_banner_custom_css" class="code" style="height: 150px;width: 90%;" name="simple_banner_custom_css"><?php echo esc_textarea(get_option('simple_banner_custom_css')); ?></textarea>
|
575 |
<div>}</div>
|
576 |
</th>
|
577 |
<td>
|
578 |
<div style="display:flex">
|
579 |
<div style="flex-grow:1;">
|
580 |
<div>.simple-banner-scrolling {</div>
|
581 |
+
<textarea id="simple_banner_scrolling_custom_css" class="code" style="height: 150px;width: 90%;" name="simple_banner_scrolling_custom_css"><?php echo esc_textarea(get_option('simple_banner_scrolling_custom_css')); ?></textarea>
|
582 |
<div>}</div>
|
583 |
</div>
|
584 |
<div style="flex-grow:1;">
|
585 |
<div>.simple-banner-text {</div>
|
586 |
+
<textarea id="simple_banner_text_custom_css" class="code" style="height: 150px;width: 90%;" name="simple_banner_text_custom_css"><?php echo esc_textarea(get_option('simple_banner_text_custom_css')); ?></textarea>
|
587 |
<div>}</div>
|
588 |
</div>
|
589 |
<div style="flex-grow:1;">
|
590 |
<div>.simple-banner-button {</div>
|
591 |
+
<textarea id="simple_banner_button_css" class="code" style="height: 150px;width: 90%;" name="simple_banner_button_css"><?php echo esc_textarea(get_option('simple_banner_button_css')); ?></textarea>
|
592 |
<div>}</div>
|
593 |
</div>
|
594 |
</div>
|
709 |
Activation Code
|
710 |
</th>
|
711 |
<td>
|
712 |
+
<input type="text" style="border: 2px solid gold;border-radius: 5px;" id="pro_version_activation_code" name="pro_version_activation_code" value="<?php echo esc_attr(get_option('pro_version_activation_code')); ?>" />
|
713 |
</td>
|
714 |
</tr>
|
715 |
<!-- Permissions -->
|
823 |
<td>
|
824 |
<?php
|
825 |
if (get_option('pro_version_enabled')) {
|
826 |
+
echo '<textarea id="site_custom_css" style="height: 150px;width: 75%;" name="site_custom_css">'. esc_textarea(get_option('site_custom_css')) . '</textarea>';
|
827 |
} else {
|
828 |
echo '<textarea style="height: 150px;width: 75%;" disabled></textarea>';
|
829 |
}
|
854 |
<td>
|
855 |
<?php
|
856 |
if (get_option('pro_version_enabled')) {
|
857 |
+
echo '<textarea id="site_custom_js" style="height: 150px;width: 75%;" name="site_custom_js">'. esc_textarea(get_option('site_custom_js')) . '</textarea>';
|
858 |
} else {
|
859 |
echo '<textarea style="height: 150px;width: 75%;" disabled></textarea>';
|
860 |
}
|