Shortcode Widget - Version 1.5.2

Version Description

  • Some PHPCS corrections, making code adhering to WordPress coding standards.
  • Replaced strip_tags function with wp_strip_all_tags.
Download this release

Release Info

Developer gagan0123
Plugin Icon 128x128 Shortcode Widget
Version 1.5.2
Comparing to
See all releases

Code changes from version 1.5.1 to 1.5.2

includes/class-shortcode-widget-plugin.php CHANGED
@@ -1,58 +1,62 @@
1
  <?php
2
-
3
- /** If this file is called directly, abort. */
4
- if ( !defined( 'ABSPATH' ) ) {
5
- die;
 
 
 
 
6
  }
7
 
8
- if ( !class_exists( 'Shortcode_Widget_Plugin' ) ) {
9
 
10
  /**
11
  * Handles most of the interaction of the plugin with WordPress
12
- *
13
  * @since 1.5
14
  */
15
  class Shortcode_Widget_Plugin {
16
 
17
  /**
18
  * The instance of the class Shortcode_Widget_Plugin
19
- *
20
  * @since 1.5
21
- *
22
  * @access protected
23
- *
24
  * @var Shortcode_Widget_Plugin
25
  */
26
  protected static $instance = null;
27
 
28
  /**
29
  * Require the necessary files and calls register hooks method.
30
- *
31
  * @access public
32
- *
33
  * @since 1.5
34
  */
35
  public function __construct() {
36
  /** The main widget class */
37
- require_once( SHORTCODE_WIDGET_PATH . 'includes/class-shortcode-widget.php');
38
  $this->register_hooks();
39
  }
40
 
41
  /**
42
  * Returns the current instance of the class, in case some other
43
  * plugin needs to use its public methods.
44
- *
45
  * @since 1.5
46
- *
47
  * @access public
48
- *
49
  * @return Shortcode_Widget_Plugin Returns the current instance of the class
50
  */
51
  public static function get_instance() {
52
 
53
  // If the single instance hasn't been set, set it now.
54
- if ( null == self::$instance ) {
55
- self::$instance = new self;
56
  }
57
 
58
  return self::$instance;
@@ -60,11 +64,11 @@ if ( !class_exists( 'Shortcode_Widget_Plugin' ) ) {
60
 
61
  /**
62
  * Registers the shortcode and actions required for this plugin.
63
- *
64
  * @access public
65
- *
66
  * @since 1.5
67
- *
68
  * @return void
69
  */
70
  public function register_hooks() {
@@ -80,11 +84,11 @@ if ( !class_exists( 'Shortcode_Widget_Plugin' ) ) {
80
 
81
  /**
82
  * Registers the Shortcode_Widget at widget_init
83
- *
84
  * @access public
85
- *
86
  * @since 1.5
87
- *
88
  * @return void
89
  */
90
  public function widget_init() {
@@ -93,29 +97,29 @@ if ( !class_exists( 'Shortcode_Widget_Plugin' ) ) {
93
 
94
  /**
95
  * Loads the text domain for the plugin.
96
- *
97
  * @access public
98
- *
99
  * @since 1.5
100
- *
101
  * @return void
102
  */
103
- function load_text_domain() {
104
  load_plugin_textdomain( 'shortcode-widget', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
105
  }
106
 
107
  /**
108
  * Returns the output of the test shortcode.
109
- *
110
  * @access public
111
- *
112
  * @since 1.5
113
- *
114
  * @return string Returns a string "It works", or a translated string if
115
  * available for the language of the WordPress site.
116
  */
117
- function test_widget() {
118
- return __( "It works", 'shortcode-widget' );
119
  }
120
 
121
  }
1
  <?php
2
+ /**
3
+ * Shortcode Widget Setup
4
+ *
5
+ * @package Shortcode_Widget
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ die; // If this file is called directly, abort.
10
  }
11
 
12
+ if ( ! class_exists( 'Shortcode_Widget_Plugin' ) ) {
13
 
14
  /**
15
  * Handles most of the interaction of the plugin with WordPress
16
+ *
17
  * @since 1.5
18
  */
19
  class Shortcode_Widget_Plugin {
20
 
21
  /**
22
  * The instance of the class Shortcode_Widget_Plugin
23
+ *
24
  * @since 1.5
25
+ *
26
  * @access protected
27
+ *
28
  * @var Shortcode_Widget_Plugin
29
  */
30
  protected static $instance = null;
31
 
32
  /**
33
  * Require the necessary files and calls register hooks method.
34
+ *
35
  * @access public
36
+ *
37
  * @since 1.5
38
  */
39
  public function __construct() {
40
  /** The main widget class */
41
+ require_once SHORTCODE_WIDGET_PATH . 'includes/class-shortcode-widget.php';
42
  $this->register_hooks();
43
  }
44
 
45
  /**
46
  * Returns the current instance of the class, in case some other
47
  * plugin needs to use its public methods.
48
+ *
49
  * @since 1.5
50
+ *
51
  * @access public
52
+ *
53
  * @return Shortcode_Widget_Plugin Returns the current instance of the class
54
  */
55
  public static function get_instance() {
56
 
57
  // If the single instance hasn't been set, set it now.
58
+ if ( null === self::$instance ) {
59
+ self::$instance = new self();
60
  }
61
 
62
  return self::$instance;
64
 
65
  /**
66
  * Registers the shortcode and actions required for this plugin.
67
+ *
68
  * @access public
69
+ *
70
  * @since 1.5
71
+ *
72
  * @return void
73
  */
74
  public function register_hooks() {
84
 
85
  /**
86
  * Registers the Shortcode_Widget at widget_init
87
+ *
88
  * @access public
89
+ *
90
  * @since 1.5
91
+ *
92
  * @return void
93
  */
94
  public function widget_init() {
97
 
98
  /**
99
  * Loads the text domain for the plugin.
100
+ *
101
  * @access public
102
+ *
103
  * @since 1.5
104
+ *
105
  * @return void
106
  */
107
+ public function load_text_domain() {
108
  load_plugin_textdomain( 'shortcode-widget', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
109
  }
110
 
111
  /**
112
  * Returns the output of the test shortcode.
113
+ *
114
  * @access public
115
+ *
116
  * @since 1.5
117
+ *
118
  * @return string Returns a string "It works", or a translated string if
119
  * available for the language of the WordPress site.
120
  */
121
+ public function test_widget() {
122
+ return __( 'It works', 'shortcode-widget' );
123
  }
124
 
125
  }
includes/class-shortcode-widget.php CHANGED
@@ -1,10 +1,15 @@
1
  <?php
2
- /** If this file is called directly, abort. */
3
- if ( !defined( 'ABSPATH' ) ) {
4
- die;
 
 
 
 
 
5
  }
6
 
7
- if ( !class_exists( 'Shortcode_Widget' ) ) {
8
 
9
  /**
10
  * Shortcode Widget Class
@@ -15,96 +20,108 @@ if ( !class_exists( 'Shortcode_Widget' ) ) {
15
 
16
  /**
17
  * Defines this widgets arguments and calls parent class constructor
18
- *
19
  * @access public
20
- *
21
  * @since 0.1
22
  */
23
  public function __construct() {
24
- $widget_ops = array( 'classname' => 'shortcode_widget', 'description' => __( 'Shortcode or HTML or Plain Text.', 'shortcode-widget' ) );
25
- $control_ops = array( 'width' => 400, 'height' => 350 );
 
 
 
 
 
 
26
  parent::__construct( 'shortcode-widget', __( 'Shortcode Widget', 'shortcode-widget' ), $widget_ops, $control_ops );
27
  }
28
 
29
  /**
30
  * Echoes the widget content.
31
- *
32
  * @access public
33
- *
34
  * @since 0.1
35
- *
36
  * @param array $args Display arguments including 'before_title', 'after_title',
37
  * 'before_widget', and 'after_widget'.
38
- *
39
  * @param array $instance The settings for the particular instance of the widget.
40
- *
41
  * @return void
42
  */
43
  public function widget( $args, $instance ) {
44
  /** This filter is documented in wp-includes/default-widgets.php */
45
- $title = apply_filters( 'widget_title', empty( $instance[ 'title' ] ) ? '' : $instance[ 'title' ], $instance, $this->id_base );
46
 
47
  /** This filter is documented in wp-includes/widgets/class-wp-widget-text.php */
48
- $text = do_shortcode( apply_filters( 'widget_text', empty( $instance[ 'text' ] ) ? '' : $instance[ 'text' ], $instance, $this ) );
49
- echo $args[ 'before_widget' ];
50
- if ( !empty( $title ) ) {
51
- echo $args[ 'before_title' ] . $title . $args[ 'after_title' ];
52
  }
53
  ?>
54
- <div class="textwidget"><?php echo!empty( $instance[ 'filter' ] ) ? wpautop( $text ) : $text; ?></div>
55
  <?php
56
- echo $args[ 'after_widget' ];
57
  }
58
 
59
  /**
60
  * Updates a particular instance of a widget.
61
- *
62
  * @access public
63
- *
64
  * @since 0.1
65
- *
66
  * @param array $new_instance New settings for this instance as input by the user via
67
  * WP_Widget::form().
68
  * @param array $old_instance Old settings for this instance.
69
- *
70
  * @return array|false Settings to save or bool false to cancel saving.
71
  */
72
  public function update( $new_instance, $old_instance ) {
73
- $instance = $old_instance;
74
- $instance[ 'title' ] = strip_tags( $new_instance[ 'title' ] );
75
  if ( current_user_can( 'unfiltered_html' ) ) {
76
- $instance[ 'text' ] = $new_instance[ 'text' ];
77
  } else {
78
- $instance[ 'text' ] = stripslashes( wp_filter_post_kses( addslashes( $new_instance[ 'text' ] ) ) ); // wp_filter_post_kses() expects slashed
79
  }
80
- $instance[ 'filter' ] = !empty( $new_instance[ 'filter' ] );
81
  return $instance;
82
  }
83
 
84
  /**
85
  * Outputs the settings update form.
86
- *
87
  * @access public
88
- *
89
  * @since 0.1
90
- *
91
  * @param array $instance Current settings.
92
- *
93
  * @return void
94
  */
95
  public function form( $instance ) {
96
- $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'text' => '' ) );
 
 
 
 
 
 
97
  ?>
98
  <p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title:', 'shortcode-widget' ); ?></label>
99
- <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $instance[ 'title' ] ); ?>" /></p>
100
 
101
  <p><label for="<?php echo esc_attr( $this->get_field_id( 'text' ) ); ?>"><?php esc_html_e( 'Content:', 'shortcode-widget' ); ?></label>
102
- <textarea class="widefat" rows="16" cols="20" id="<?php echo esc_attr( $this->get_field_id( 'text' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'text' ) ); ?>"><?php echo esc_textarea( $instance[ 'text' ] ) ?></textarea></p>
103
 
104
- <p><input id="<?php echo esc_attr( $this->get_field_id( 'filter' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'filter' ) ); ?>" type="checkbox" <?php checked( isset( $instance[ 'filter' ] ) ? $instance[ 'filter' ] : 0 ); ?> />&nbsp;<label for="<?php echo esc_attr( $this->get_field_id( 'filter' ) ); ?>"><?php esc_html_e( 'Automatically add paragraphs', 'shortcode-widget' ); ?></label></p>
105
  <?php
106
  }
107
 
108
  }
109
 
110
- }
1
  <?php
2
+ /**
3
+ * Contains the Shortcode Widget
4
+ *
5
+ * @package Shortcode_Widget
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ die; // If this file is called directly, abort.
10
  }
11
 
12
+ if ( ! class_exists( 'Shortcode_Widget' ) ) {
13
 
14
  /**
15
  * Shortcode Widget Class
20
 
21
  /**
22
  * Defines this widgets arguments and calls parent class constructor
23
+ *
24
  * @access public
25
+ *
26
  * @since 0.1
27
  */
28
  public function __construct() {
29
+ $widget_ops = array(
30
+ 'classname' => 'shortcode_widget',
31
+ 'description' => __( 'Shortcode or HTML or Plain Text.', 'shortcode-widget' ),
32
+ );
33
+ $control_ops = array(
34
+ 'width' => 400,
35
+ 'height' => 350,
36
+ );
37
  parent::__construct( 'shortcode-widget', __( 'Shortcode Widget', 'shortcode-widget' ), $widget_ops, $control_ops );
38
  }
39
 
40
  /**
41
  * Echoes the widget content.
42
+ *
43
  * @access public
44
+ *
45
  * @since 0.1
46
+ *
47
  * @param array $args Display arguments including 'before_title', 'after_title',
48
  * 'before_widget', and 'after_widget'.
49
+ *
50
  * @param array $instance The settings for the particular instance of the widget.
51
+ *
52
  * @return void
53
  */
54
  public function widget( $args, $instance ) {
55
  /** This filter is documented in wp-includes/default-widgets.php */
56
+ $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
57
 
58
  /** This filter is documented in wp-includes/widgets/class-wp-widget-text.php */
59
+ $text = do_shortcode( apply_filters( 'widget_text', empty( $instance['text'] ) ? '' : $instance['text'], $instance, $this ) );
60
+ echo $args['before_widget'];
61
+ if ( ! empty( $title ) ) {
62
+ echo $args['before_title'] . $title . $args['after_title'];
63
  }
64
  ?>
65
+ <div class="textwidget"><?php echo ! empty( $instance['filter'] ) ? wpautop( $text ) : $text; ?></div>
66
  <?php
67
+ echo $args['after_widget'];
68
  }
69
 
70
  /**
71
  * Updates a particular instance of a widget.
72
+ *
73
  * @access public
74
+ *
75
  * @since 0.1
76
+ *
77
  * @param array $new_instance New settings for this instance as input by the user via
78
  * WP_Widget::form().
79
  * @param array $old_instance Old settings for this instance.
80
+ *
81
  * @return array|false Settings to save or bool false to cancel saving.
82
  */
83
  public function update( $new_instance, $old_instance ) {
84
+ $instance = $old_instance;
85
+ $instance['title'] = wp_strip_all_tags( $new_instance['title'] );
86
  if ( current_user_can( 'unfiltered_html' ) ) {
87
+ $instance['text'] = $new_instance['text'];
88
  } else {
89
+ $instance['text'] = stripslashes( wp_filter_post_kses( addslashes( $new_instance['text'] ) ) ); // wp_filter_post_kses() expects slashed.
90
  }
91
+ $instance['filter'] = ! empty( $new_instance['filter'] );
92
  return $instance;
93
  }
94
 
95
  /**
96
  * Outputs the settings update form.
97
+ *
98
  * @access public
99
+ *
100
  * @since 0.1
101
+ *
102
  * @param array $instance Current settings.
103
+ *
104
  * @return void
105
  */
106
  public function form( $instance ) {
107
+ $instance = wp_parse_args(
108
+ (array) $instance,
109
+ array(
110
+ 'title' => '',
111
+ 'text' => '',
112
+ )
113
+ );
114
  ?>
115
  <p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title:', 'shortcode-widget' ); ?></label>
116
+ <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>" /></p>
117
 
118
  <p><label for="<?php echo esc_attr( $this->get_field_id( 'text' ) ); ?>"><?php esc_html_e( 'Content:', 'shortcode-widget' ); ?></label>
119
+ <textarea class="widefat" rows="16" cols="20" id="<?php echo esc_attr( $this->get_field_id( 'text' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'text' ) ); ?>"><?php echo esc_textarea( $instance['text'] ); ?></textarea></p>
120
 
121
+ <p><input id="<?php echo esc_attr( $this->get_field_id( 'filter' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'filter' ) ); ?>" type="checkbox" <?php checked( isset( $instance['filter'] ) ? $instance['filter'] : 0 ); ?> />&nbsp;<label for="<?php echo esc_attr( $this->get_field_id( 'filter' ) ); ?>"><?php esc_html_e( 'Automatically add paragraphs', 'shortcode-widget' ); ?></label></p>
122
  <?php
123
  }
124
 
125
  }
126
 
127
+ }
includes/index.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Silence is golden
4
+ *
5
+ * This file exists to stop directory listings on poorly configured servers.
6
+ */
index.php CHANGED
@@ -1,3 +1,6 @@
1
  <?php
2
-
3
- //Silence is golden
 
 
 
1
  <?php
2
+ /**
3
+ * Silence is golden
4
+ *
5
+ * This file exists to stop directory listings on poorly configured servers.
6
+ */
languages/index.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Silence is golden
4
+ *
5
+ * This file exists to stop directory listings on poorly configured servers.
6
+ */
languages/shortcode-widget.pot CHANGED
@@ -1,14 +1,14 @@
1
- # Copyright (C) 2017 Gagan Deep Singh
2
  # This file is distributed under the GPLv2.
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: Shortcode Widget 1.5.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/shortcode-widget\n"
7
- "POT-Creation-Date: 2017-09-05 08:56:33+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2017-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
  "Poedit: \n"
@@ -26,15 +26,15 @@ msgstr ""
26
  msgid "Shortcode Widget"
27
  msgstr ""
28
 
29
- #: includes/class-shortcode-widget.php:114
30
  msgid "Title:"
31
  msgstr ""
32
 
33
- #: includes/class-shortcode-widget.php:117
34
  msgid "Content:"
35
  msgstr ""
36
 
37
- #: includes/class-shortcode-widget.php:120
38
  msgid "Automatically add paragraphs"
39
  msgstr ""
40
 
1
+ # Copyright (C) 2019 Gagan Deep Singh
2
  # This file is distributed under the GPLv2.
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: Shortcode Widget 1.5.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/shortcode-widget\n"
7
+ "POT-Creation-Date: 2019-02-21 10:52:37+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
  "Poedit: \n"
26
  msgid "Shortcode Widget"
27
  msgstr ""
28
 
29
+ #: includes/class-shortcode-widget.php:115
30
  msgid "Title:"
31
  msgstr ""
32
 
33
+ #: includes/class-shortcode-widget.php:118
34
  msgid "Content:"
35
  msgstr ""
36
 
37
+ #: includes/class-shortcode-widget.php:121
38
  msgid "Automatically add paragraphs"
39
  msgstr ""
40
 
readme.txt CHANGED
@@ -1,10 +1,11 @@
1
  === Shortcode Widget ===
2
  Contributors: gagan0123
3
- Donate Link: PayPal.me/gagan0123
4
  Tags: Shortcode, Widget
5
  Requires at least: 3.3
6
- Tested up to: 4.8.1
7
- Stable tag: 1.5.1
 
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -29,6 +30,10 @@ To test the widget you can add the widget and use the shortcode "[shortcode_widg
29
 
30
  == Changelog ==
31
 
 
 
 
 
32
  = 1.5.1 =
33
  * Unescaped title back in the code as escaping it was creating issues with other plugins.
34
 
@@ -63,4 +68,4 @@ To test the widget you can add the widget and use the shortcode "[shortcode_widg
63
  * Added translation support.
64
 
65
  = 0.1 =
66
- * Added the shortcode widget.
1
  === Shortcode Widget ===
2
  Contributors: gagan0123
3
+ Donate Link: https://PayPal.me/gagan0123
4
  Tags: Shortcode, Widget
5
  Requires at least: 3.3
6
+ Requires PHP: 5.6
7
+ Tested up to: 5.1
8
+ Stable tag: 1.5.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
30
 
31
  == Changelog ==
32
 
33
+ = 1.5.2 =
34
+ * Some PHPCS corrections, making code adhering to WordPress coding standards.
35
+ * Replaced strip_tags function with wp_strip_all_tags.
36
+
37
  = 1.5.1 =
38
  * Unescaped title back in the code as escaping it was creating issues with other plugins.
39
 
68
  * Added translation support.
69
 
70
  = 0.1 =
71
+ * Added the shortcode widget.
shortcode-widget.php CHANGED
@@ -1,27 +1,27 @@
1
  <?php
2
-
3
- /*
4
- Plugin Name: Shortcode Widget
5
- Plugin URI: https://wordpress.org/plugins/shortcode-widget/
6
- Description: Adds a text-like widget that allows you to write shortcode in it. (Just whats missing in the default text widget)
7
- Version: 1.5.1
8
- Author: Gagan Deep Singh
9
- Author URI: https://gagan0123.com
10
- License: GPLv2
11
- License URI: https://www.gnu.org/licenses/gpl-2.0.html
12
- Text Domain: shortcode-widget
13
- Domain Path: /languages
 
14
  */
15
 
16
- /** If this file is called directly, abort. */
17
- if ( !defined( 'ABSPATH' ) ) {
18
  die;
19
  }
20
 
21
- if ( !defined( 'SHORTCODE_WIDGET_PATH' ) ) {
22
  /**
23
  * Absolute path of this plugin
24
- *
25
  * @since 1.5
26
  */
27
  define( 'SHORTCODE_WIDGET_PATH', trailingslashit( plugin_dir_path( __FILE__ ) ) );
@@ -29,4 +29,3 @@ if ( !defined( 'SHORTCODE_WIDGET_PATH' ) ) {
29
 
30
  /** Loading the core plugin class */
31
  require_once SHORTCODE_WIDGET_PATH . 'includes/class-shortcode-widget-plugin.php';
32
-
1
  <?php
2
+ /**
3
+ * Plugin Name: Shortcode Widget
4
+ * Plugin URI: https://wordpress.org/plugins/shortcode-widget/
5
+ * Description: Adds a text-like widget that allows you to write shortcode in it. (Just whats missing in the default text widget)
6
+ * Version: 1.5.2
7
+ * Author: Gagan Deep Singh
8
+ * Author URI: https://gagan0123.com
9
+ * License: GPLv2
10
+ * License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
+ * Text Domain: shortcode-widget
12
+ * Domain Path: /languages
13
+ *
14
+ * @package Shortcode_Widget
15
  */
16
 
17
+ if ( ! defined( 'ABSPATH' ) ) {
 
18
  die;
19
  }
20
 
21
+ if ( ! defined( 'SHORTCODE_WIDGET_PATH' ) ) {
22
  /**
23
  * Absolute path of this plugin
24
+ *
25
  * @since 1.5
26
  */
27
  define( 'SHORTCODE_WIDGET_PATH', trailingslashit( plugin_dir_path( __FILE__ ) ) );
29
 
30
  /** Loading the core plugin class */
31
  require_once SHORTCODE_WIDGET_PATH . 'includes/class-shortcode-widget-plugin.php';