Insert Headers And Footers - Version 1.3.2

Version Description

  • 2022-02-18
  • Enhancement: Added a filter wp_hnf_header_script to enhance the header scripts.
  • Enhancement: Added a filter wp_hnf_body_script to enhance the body scripts.
  • Enhancement: Added a filter wp_hnf_footer_script to enhance the footer scripts.
  • Compatibility : Compatible with WordPress 5.9.
Download this release

Release Info

Developer WPBrigade
Plugin Icon wp plugin Insert Headers And Footers
Version 1.3.2
Comparing to
See all releases

Code changes from version 1.3.1 to 1.3.2

lib/wpb-sdk/includes/wpb-sdk-logger.php CHANGED
@@ -4,7 +4,7 @@
4
  * In effort to provide better customer experience.
5
  *
6
  * @package WPB_SDK
7
- * @since 1.4.0
8
  */
9
 
10
  namespace WPHeaderAndFooter_SDK;
4
  * In effort to provide better customer experience.
5
  *
6
  * @package WPB_SDK
7
+ * @since 1.3.1
8
  */
9
 
10
  namespace WPHeaderAndFooter_SDK;
lib/wpb-sdk/includes/wpb-sdk-track.php CHANGED
@@ -3,7 +3,7 @@
3
  * Send tracking data (logs) to WPB server.
4
  *
5
  * @package WPB_SDK
6
- * @since 1.4.0
7
  */
8
 
9
  namespace WPHeaderAndFooter_SDK;
3
  * Send tracking data (logs) to WPB server.
4
  *
5
  * @package WPB_SDK
6
+ * @since 1.3.1
7
  */
8
 
9
  namespace WPHeaderAndFooter_SDK;
readme.txt CHANGED
@@ -4,8 +4,8 @@ Author URI: https://wpbrigade.com/?utm_source=wphf-org&utm_medium=author-url-lin
4
  Donate link: Author URI: https://wpbrigade.com/?utm_source=wphf-org&utm_medium=donate-url-link
5
  Tags: header, footer, Google Analytics, custom css, Facebook Pixel
6
  Requires at least: 5.0
7
- Tested up to: 5.8
8
- Stable tag: 1.3.1
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -76,6 +76,12 @@ You can insert code in Header, Body and Footer areas of any WordPress site.
76
 
77
  == Changelog ==
78
 
 
 
 
 
 
 
79
  = 1.3.1 - 2021-12-01
80
  * Enhancement : Code Optimization.
81
  * Enhancement : Add compatibility of Mozilla Firefox on dashboard settings.
@@ -111,5 +117,5 @@ You can insert code in Header, Body and Footer areas of any WordPress site.
111
 
112
  == Upgrade Notice ==
113
 
114
- = 1.3.1 =
115
  * Upgrade Immediately.
4
  Donate link: Author URI: https://wpbrigade.com/?utm_source=wphf-org&utm_medium=donate-url-link
5
  Tags: header, footer, Google Analytics, custom css, Facebook Pixel
6
  Requires at least: 5.0
7
+ Tested up to: 5.9
8
+ Stable tag: 1.3.2
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
76
 
77
  == Changelog ==
78
 
79
+ = 1.3.2 - 2022-02-18
80
+ * Enhancement: Added a filter `wp_hnf_header_script` to enhance the header scripts.
81
+ * Enhancement: Added a filter `wp_hnf_body_script` to enhance the body scripts.
82
+ * Enhancement: Added a filter `wp_hnf_footer_script` to enhance the footer scripts.
83
+ * Compatibility : Compatible with WordPress 5.9.
84
+
85
  = 1.3.1 - 2021-12-01
86
  * Enhancement : Code Optimization.
87
  * Enhancement : Add compatibility of Mozilla Firefox on dashboard settings.
117
 
118
  == Upgrade Notice ==
119
 
120
+ = 1.3.2 =
121
  * Upgrade Immediately.
wp-headers-and-footers.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WP Headers And Footers
4
  * Plugin URI: https://www.WPBrigade.com/wordpress/plugins/wp-headers-and-footers/
5
  * Description: Allows you to insert code or text in the header or footer of your WordPress site.
6
- * Version: 1.3.1
7
  * Author: WPBrigade
8
  * Author URI: https://wpbrigade.com/?utm_source=plugin-meta&utm_medium=author-uri-link
9
  * License: GPLv3
@@ -27,7 +27,7 @@ if ( ! class_exists( 'WPHeaderAndFooter' ) ) :
27
  *
28
  * @var string $version
29
  */
30
- public $version = '1.3.1';
31
 
32
  /**
33
  * The single instance of the class.
@@ -49,7 +49,7 @@ if ( ! class_exists( 'WPHeaderAndFooter' ) ) :
49
  /**
50
  * Include required core files used in admin and on the frontend.
51
  *
52
- * @version 1.4.0
53
  */
54
  public function includes() {
55
 
@@ -92,7 +92,7 @@ if ( ! class_exists( 'WPHeaderAndFooter' ) ) :
92
  * Hook into actions and filters
93
  *
94
  * @since 1.0.0
95
- * @version 1.4.0
96
  */
97
  private function hooks() {
98
 
@@ -125,7 +125,7 @@ if ( ! class_exists( 'WPHeaderAndFooter' ) ) :
125
  * Admin Scripts
126
  *
127
  * @param string $page The page slug.
128
- * @version 1.4.0
129
  */
130
  public function admin_scripts( $page ) {
131
 
@@ -159,6 +159,7 @@ if ( ! class_exists( 'WPHeaderAndFooter' ) ) :
159
  * @param string|bool $value The value of the variable.
160
  */
161
  private function define( $name, $value ) {
 
162
  if ( ! defined( $name ) ) {
163
  define( $name, $value );
164
  }
@@ -173,6 +174,7 @@ if ( ! class_exists( 'WPHeaderAndFooter' ) ) :
173
  * @return Main instance
174
  */
175
  public static function instance() {
 
176
  if ( is_null( self::$instance ) ) {
177
  self::$instance = new self();
178
  }
@@ -195,30 +197,54 @@ if ( ! class_exists( 'WPHeaderAndFooter' ) ) :
195
  * Outputs script / style to the header
196
  *
197
  * @since 1.0.0
198
- * @version 1.4.0
199
  */
200
  public function frontend_header() {
201
- $this->wp_hnf_output( 'wp_header_textarea' );
 
 
 
 
 
 
 
 
202
  }
203
 
204
  /**
205
  * Outputs script / style to the frontend below opening body
206
  *
207
  * @since 1.0.0
208
- * @version 1.4.0
209
  */
210
  public function frontend_body() {
211
- $this->wp_hnf_output( 'wp_body_textarea' );
 
 
 
 
 
 
 
 
212
  }
213
 
214
  /**
215
  * Outputs script / style to the footer
216
  *
217
  * @since 1.0.0
218
- * @version 1.4.0
219
  */
220
  public function frontend_footer() {
221
- $this->wp_hnf_output( 'wp_footer_textarea' );
 
 
 
 
 
 
 
 
222
  }
223
 
224
  /**
@@ -226,7 +252,7 @@ if ( ! class_exists( 'WPHeaderAndFooter' ) ) :
226
  *
227
  * @param string $script Setting Name.
228
  *
229
- * @version 1.4.0
230
  * @return output
231
  */
232
  public function wp_hnf_output( $script ) {
@@ -246,9 +272,7 @@ if ( ! class_exists( 'WPHeaderAndFooter' ) ) :
246
 
247
  // Output.
248
  echo wp_unslash( $meta ) . PHP_EOL; // @codingStandardsIgnoreLine.
249
-
250
  }
251
-
252
  }
253
 
254
  endif;
3
  * Plugin Name: WP Headers And Footers
4
  * Plugin URI: https://www.WPBrigade.com/wordpress/plugins/wp-headers-and-footers/
5
  * Description: Allows you to insert code or text in the header or footer of your WordPress site.
6
+ * Version: 1.3.2
7
  * Author: WPBrigade
8
  * Author URI: https://wpbrigade.com/?utm_source=plugin-meta&utm_medium=author-uri-link
9
  * License: GPLv3
27
  *
28
  * @var string $version
29
  */
30
+ public $version = '1.3.2';
31
 
32
  /**
33
  * The single instance of the class.
49
  /**
50
  * Include required core files used in admin and on the frontend.
51
  *
52
+ * @version 1.3.1
53
  */
54
  public function includes() {
55
 
92
  * Hook into actions and filters
93
  *
94
  * @since 1.0.0
95
+ * @version 1.3.1
96
  */
97
  private function hooks() {
98
 
125
  * Admin Scripts
126
  *
127
  * @param string $page The page slug.
128
+ * @version 1.3.1
129
  */
130
  public function admin_scripts( $page ) {
131
 
159
  * @param string|bool $value The value of the variable.
160
  */
161
  private function define( $name, $value ) {
162
+
163
  if ( ! defined( $name ) ) {
164
  define( $name, $value );
165
  }
174
  * @return Main instance
175
  */
176
  public static function instance() {
177
+
178
  if ( is_null( self::$instance ) ) {
179
  self::$instance = new self();
180
  }
197
  * Outputs script / style to the header
198
  *
199
  * @since 1.0.0
200
+ * @version 1.3.2
201
  */
202
  public function frontend_header() {
203
+
204
+ /**
205
+ * Filter to add or exclude scripts to and from the frontend header.
206
+ *
207
+ * @since 1.3.2
208
+ */
209
+ if ( apply_filters( 'wp_hnf_header_script', true ) ) {
210
+ $this->wp_hnf_output( 'wp_header_textarea' );
211
+ }
212
  }
213
 
214
  /**
215
  * Outputs script / style to the frontend below opening body
216
  *
217
  * @since 1.0.0
218
+ * @version 1.3.2
219
  */
220
  public function frontend_body() {
221
+
222
+ /**
223
+ * Filter to add or exclude scripts to and from the frontend body.
224
+ *
225
+ * @since 1.3.2
226
+ */
227
+ if ( apply_filters( 'wp_hnf_body_script', true ) ) {
228
+ $this->wp_hnf_output( 'wp_body_textarea' );
229
+ }
230
  }
231
 
232
  /**
233
  * Outputs script / style to the footer
234
  *
235
  * @since 1.0.0
236
+ * @version 1.3.2
237
  */
238
  public function frontend_footer() {
239
+
240
+ /**
241
+ * Filter to add or exclude scripts to and from the frontend footer.
242
+ *
243
+ * @since 1.3.2
244
+ */
245
+ if ( apply_filters( 'wp_hnf_footer_script', true ) ) {
246
+ $this->wp_hnf_output( 'wp_footer_textarea' );
247
+ }
248
  }
249
 
250
  /**
252
  *
253
  * @param string $script Setting Name.
254
  *
255
+ * @version 1.3.1
256
  * @return output
257
  */
258
  public function wp_hnf_output( $script ) {
272
 
273
  // Output.
274
  echo wp_unslash( $meta ) . PHP_EOL; // @codingStandardsIgnoreLine.
 
275
  }
 
276
  }
277
 
278
  endif;