Insert Headers and Footers - Version 1.4.5

Version Description

  • Tested compatibility with WordPress 5.3.2
  • Add support for printing scripts right after the opening body tag using the wp_body_open action
Download this release

Release Info

Developer deb255
Plugin Icon 128x128 Insert Headers and Footers
Version 1.4.5
Comparing to
See all releases

Code changes from version 1.4.4 to 1.4.5

ihaf.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Insert Headers and Footers
4
  * Plugin URI: http://www.wpbeginner.com/
5
- * Version: 1.4.4
6
  * Author: WPBeginner
7
  * Author URI: http://www.wpbeginner.com/
8
  * Description: Allows you to insert code or text in the header or footer of your WordPress blog
@@ -40,61 +40,26 @@ class InsertHeadersAndFooters {
40
  $this->plugin = new stdClass;
41
  $this->plugin->name = 'insert-headers-and-footers'; // Plugin Folder
42
  $this->plugin->displayName = 'Insert Headers and Footers'; // Plugin Name
43
- $this->plugin->version = '1.4.4';
44
  $this->plugin->folder = plugin_dir_path( __FILE__ );
45
  $this->plugin->url = plugin_dir_url( __FILE__ );
46
  $this->plugin->db_welcome_dismissed_key = $this->plugin->name . '_welcome_dismissed_key';
47
-
48
- // Check if the global wpb_feed_append variable exists. If not, set it.
49
- if ( ! array_key_exists( 'wpb_feed_append', $GLOBALS ) ) {
50
- $GLOBALS['wpb_feed_append'] = false;
51
- }
52
 
53
  // Hooks
54
  add_action( 'admin_init', array( &$this, 'registerSettings' ) );
55
  add_action( 'admin_menu', array( &$this, 'adminPanelsAndMetaBoxes' ) );
56
- add_action( 'wp_feed_options', array( &$this, 'dashBoardRss' ), 10, 2 );
57
  add_action( 'admin_notices', array( &$this, 'dashboardNotices' ) );
58
  add_action( 'wp_ajax_' . $this->plugin->name . '_dismiss_dashboard_notices', array( &$this, 'dismissDashboardNotices' ) );
59
 
60
  // Frontend Hooks
61
  add_action( 'wp_head', array( &$this, 'frontendHeader' ) );
62
  add_action( 'wp_footer', array( &$this, 'frontendFooter' ) );
63
-
64
- // Filters
65
- add_filter( 'dashboard_secondary_items', array( &$this, 'dashboardSecondaryItems' ) );
66
- }
67
-
68
- /**
69
- * Number of Secondary feed items to show
70
- */
71
- function dashboardSecondaryItems() {
72
- return 6;
73
  }
74
 
75
- /**
76
- * Update the planet feed to add the WPB feed
77
- */
78
- function dashboardRss( $feed, $url ) {
79
- // Return early if not on the right page.
80
- global $pagenow;
81
- if ( 'admin-ajax.php' !== $pagenow ) {
82
- return;
83
- }
84
-
85
- // Return early if not on the right feed.
86
- if ( strpos( $url, 'planet.wordpress.org' ) === false ) {
87
- return;
88
- }
89
-
90
- // Only move forward if this action hasn't been done already.
91
- if ( ! $GLOBALS['wpb_feed_append'] ) {
92
- $GLOBALS['wpb_feed_append'] = true;
93
- $urls = array( 'http://www.wpbeginner.com/feed/', $url );
94
- $feed->set_feed_url( $urls );
95
- }
96
- }
97
-
98
  /**
99
  * Show relevant notices for the plugin
100
  */
@@ -126,6 +91,7 @@ class InsertHeadersAndFooters {
126
  function registerSettings() {
127
  register_setting( $this->plugin->name, 'ihaf_insert_header', 'trim' );
128
  register_setting( $this->plugin->name, 'ihaf_insert_footer', 'trim' );
 
129
  }
130
 
131
  /**
@@ -161,7 +127,8 @@ class InsertHeadersAndFooters {
161
  // so do nothing before saving
162
  update_option( 'ihaf_insert_header', $_REQUEST['ihaf_insert_header'] );
163
  update_option( 'ihaf_insert_footer', $_REQUEST['ihaf_insert_footer'] );
164
- update_option( $this->plugin->db_welcome_dismissed_key, 1 );
 
165
  $this->message = __( 'Settings Saved.', 'insert-headers-and-footers' );
166
  }
167
  }
@@ -170,6 +137,7 @@ class InsertHeadersAndFooters {
170
  $this->settings = array(
171
  'ihaf_insert_header' => esc_html( wp_unslash( get_option( 'ihaf_insert_header' ) ) ),
172
  'ihaf_insert_footer' => esc_html( wp_unslash( get_option( 'ihaf_insert_footer' ) ) ),
 
173
  );
174
 
175
  // Load Settings Form
@@ -197,6 +165,13 @@ class InsertHeadersAndFooters {
197
  $this->output( 'ihaf_insert_footer' );
198
  }
199
 
 
 
 
 
 
 
 
200
  /**
201
  * Outputs the given setting, if conditions are met
202
  *
@@ -224,6 +199,11 @@ class InsertHeadersAndFooters {
224
  return;
225
  }
226
 
 
 
 
 
 
227
  // Get meta
228
  $meta = get_option( $setting );
229
  if ( empty( $meta ) ) {
2
  /**
3
  * Plugin Name: Insert Headers and Footers
4
  * Plugin URI: http://www.wpbeginner.com/
5
+ * Version: 1.4.5
6
  * Author: WPBeginner
7
  * Author URI: http://www.wpbeginner.com/
8
  * Description: Allows you to insert code or text in the header or footer of your WordPress blog
40
  $this->plugin = new stdClass;
41
  $this->plugin->name = 'insert-headers-and-footers'; // Plugin Folder
42
  $this->plugin->displayName = 'Insert Headers and Footers'; // Plugin Name
43
+ $this->plugin->version = '1.4.5';
44
  $this->plugin->folder = plugin_dir_path( __FILE__ );
45
  $this->plugin->url = plugin_dir_url( __FILE__ );
46
  $this->plugin->db_welcome_dismissed_key = $this->plugin->name . '_welcome_dismissed_key';
47
+ $this->body_open_supported = function_exists( 'wp_body_open' ) && version_compare( get_bloginfo( 'version' ), '5.2' , '>=' );
 
 
 
 
48
 
49
  // Hooks
50
  add_action( 'admin_init', array( &$this, 'registerSettings' ) );
51
  add_action( 'admin_menu', array( &$this, 'adminPanelsAndMetaBoxes' ) );
 
52
  add_action( 'admin_notices', array( &$this, 'dashboardNotices' ) );
53
  add_action( 'wp_ajax_' . $this->plugin->name . '_dismiss_dashboard_notices', array( &$this, 'dismissDashboardNotices' ) );
54
 
55
  // Frontend Hooks
56
  add_action( 'wp_head', array( &$this, 'frontendHeader' ) );
57
  add_action( 'wp_footer', array( &$this, 'frontendFooter' ) );
58
+ if ( $this->body_open_supported ) {
59
+ add_action( 'wp_body_open', array( &$this, 'frontendBody' ), 1 );
60
+ }
 
 
 
 
 
 
 
61
  }
62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  /**
64
  * Show relevant notices for the plugin
65
  */
91
  function registerSettings() {
92
  register_setting( $this->plugin->name, 'ihaf_insert_header', 'trim' );
93
  register_setting( $this->plugin->name, 'ihaf_insert_footer', 'trim' );
94
+ register_setting( $this->plugin->name, 'ihaf_insert_body', 'trim' );
95
  }
96
 
97
  /**
127
  // so do nothing before saving
128
  update_option( 'ihaf_insert_header', $_REQUEST['ihaf_insert_header'] );
129
  update_option( 'ihaf_insert_footer', $_REQUEST['ihaf_insert_footer'] );
130
+ update_option( 'ihaf_insert_body', isset( $_REQUEST['ihaf_insert_body'] ) ? $_REQUEST['ihaf_insert_body'] : '' );
131
+ update_option( $this->plugin->db_welcome_dismissed_key, 1 );
132
  $this->message = __( 'Settings Saved.', 'insert-headers-and-footers' );
133
  }
134
  }
137
  $this->settings = array(
138
  'ihaf_insert_header' => esc_html( wp_unslash( get_option( 'ihaf_insert_header' ) ) ),
139
  'ihaf_insert_footer' => esc_html( wp_unslash( get_option( 'ihaf_insert_footer' ) ) ),
140
+ 'ihaf_insert_body' => esc_html( wp_unslash( get_option( 'ihaf_insert_body' ) ) ),
141
  );
142
 
143
  // Load Settings Form
165
  $this->output( 'ihaf_insert_footer' );
166
  }
167
 
168
+ /**
169
+ * Outputs script / CSS to the frontend below opening body
170
+ */
171
+ function frontendBody() {
172
+ $this->output( 'ihaf_insert_body' );
173
+ }
174
+
175
  /**
176
  * Outputs the given setting, if conditions are met
177
  *
199
  return;
200
  }
201
 
202
+ // provide the opportunity to Ignore IHAF - below opening body only via filters
203
+ if ( 'ihaf_insert_body' == $setting && apply_filters( 'disable_ihaf_body', false ) ) {
204
+ return;
205
+ }
206
+
207
  // Get meta
208
  $meta = get_option( $setting );
209
  if ( empty( $meta ) ) {
languages/insert-headers-and-footers.pot CHANGED
@@ -1,17 +1,17 @@
1
- # Copyright (C) 2019 WPBeginner
2
  # This file is distributed under the same license as the Insert Headers and Footers plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Insert Headers and Footers 1.4.4\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/insert-headers-and-footers\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2019-05-08T12:58:16+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
- "X-Generator: WP-CLI 2.2.0\n"
15
  "X-Domain: insert-headers-and-footers\n"
16
 
17
  #. Plugin Name of the plugin
@@ -31,6 +31,35 @@ msgstr ""
31
  msgid "WPBeginner"
32
  msgstr ""
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  #: views/settings.php:2
35
  #: views/settings.php:23
36
  msgid "Settings"
@@ -40,115 +69,98 @@ msgstr ""
40
  msgid "Scripts in Header"
41
  msgstr ""
42
 
43
- #: views/settings.php:30
44
- msgid "These scripts will be printed in the <code>&lt;head&gt;</code> section."
45
- msgstr ""
46
-
47
  #: views/settings.php:33
48
- msgid "Scripts in Footer"
49
  msgstr ""
50
 
51
- #: views/settings.php:35
52
- msgid "These scripts will be printed above the <code>&lt;/body&gt;</code> tag."
53
  msgstr ""
54
 
55
- #: views/settings.php:39
56
- msgid "Save"
 
57
  msgstr ""
58
 
59
- #. translators: %s: Name of this plugin
60
- #: views/dashboard-notices.php:11
61
- msgid "Thank you for installing %1$s!"
62
  msgstr ""
63
 
64
- #: views/dashboard-notices.php:14
65
- msgid "Click here"
 
66
  msgstr ""
67
 
68
- #: views/dashboard-notices.php:14
69
- msgid "to configure the plugin."
70
  msgstr ""
71
 
72
  #: views/sidebar.php:9
73
  msgid "Improve Your Site"
74
  msgstr ""
75
 
76
- #: views/sidebar.php:14
77
- msgid "Want to take your site to the next level? Check out our daily free WordPress tutorials on "
 
78
  msgstr ""
79
 
80
- #: views/sidebar.php:15
81
  msgid "WPBeginner blog"
82
  msgstr ""
83
 
84
- #: views/sidebar.php:19
85
  msgid "Some of our popular guides:"
86
  msgstr ""
87
 
88
- #: views/sidebar.php:24
89
  msgid "Speed Up WordPress"
90
  msgstr ""
91
 
92
- #: views/sidebar.php:27
93
  msgid "Improve WordPress Security"
94
  msgstr ""
95
 
96
- #: views/sidebar.php:31
97
  msgid "Boost Your WordPress SEO"
98
  msgstr ""
99
 
100
- #: views/sidebar.php:41
101
  msgid "Our WordPress Plugins"
102
  msgstr ""
103
 
104
- #: views/sidebar.php:45
105
  msgid "Like this plugin? Check out our other WordPress plugins:"
106
  msgstr ""
107
 
108
- #: views/sidebar.php:49
109
  msgid "WPForms"
110
  msgstr ""
111
 
112
- #: views/sidebar.php:51
113
- msgid " - Drag & Drop WordPress Form Builder"
114
  msgstr ""
115
 
116
- #: views/sidebar.php:55
117
  msgid "MonsterInsights"
118
  msgstr ""
119
 
120
- #: views/sidebar.php:57
121
- msgid " - Google Analytics Made Easy for WordPress"
122
  msgstr ""
123
 
124
- #: views/sidebar.php:61
125
  msgid "OptinMonster"
126
  msgstr ""
127
 
128
- #: views/sidebar.php:63
129
- msgid " - Best WordPress Lead Generation Plugin"
130
  msgstr ""
131
 
132
- #: views/sidebar.php:67
133
  msgid "SeedProd"
134
  msgstr ""
135
 
136
- #: views/sidebar.php:69
137
- msgid " - Get the best WordPress Coming Soon Page plugin"
138
- msgstr ""
139
-
140
- #: ihaf.php:145
141
- msgid "Sorry, you are not allowed to access this page."
142
- msgstr ""
143
-
144
- #: ihaf.php:154
145
- msgid "nonce field is missing. Settings NOT saved."
146
- msgstr ""
147
-
148
- #: ihaf.php:157
149
- msgid "Invalid nonce specified. Settings NOT saved."
150
- msgstr ""
151
-
152
- #: ihaf.php:165
153
- msgid "Settings Saved."
154
- msgstr ""
1
+ # Copyright (C) 2020 WPBeginner
2
  # This file is distributed under the same license as the Insert Headers and Footers plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Insert Headers and Footers 1.4.5\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/insert-headers-and-footers\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2020-02-25T05:53:20+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
+ "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: insert-headers-and-footers\n"
16
 
17
  #. Plugin Name of the plugin
31
  msgid "WPBeginner"
32
  msgstr ""
33
 
34
+ #: ihaf.php:111
35
+ msgid "Sorry, you are not allowed to access this page."
36
+ msgstr ""
37
+
38
+ #: ihaf.php:120
39
+ msgid "nonce field is missing. Settings NOT saved."
40
+ msgstr ""
41
+
42
+ #: ihaf.php:123
43
+ msgid "Invalid nonce specified. Settings NOT saved."
44
+ msgstr ""
45
+
46
+ #: ihaf.php:132
47
+ msgid "Settings Saved."
48
+ msgstr ""
49
+
50
+ #. translators: %s: Name of this plugin
51
+ #: views/dashboard-notices.php:11
52
+ msgid "Thank you for installing %1$s!"
53
+ msgstr ""
54
+
55
+ #: views/dashboard-notices.php:14
56
+ msgid "Click here"
57
+ msgstr ""
58
+
59
+ #: views/dashboard-notices.php:14
60
+ msgid "to configure the plugin."
61
+ msgstr ""
62
+
63
  #: views/settings.php:2
64
  #: views/settings.php:23
65
  msgid "Settings"
69
  msgid "Scripts in Header"
70
  msgstr ""
71
 
72
+ #. translators: %s: The `<head>` tag
 
 
 
73
  #: views/settings.php:33
74
+ msgid "These scripts will be printed in the %s section."
75
  msgstr ""
76
 
77
+ #: views/settings.php:40
78
+ msgid "Scripts in Body"
79
  msgstr ""
80
 
81
+ #. translators: %s: The `<head>` tag
82
+ #: views/settings.php:45
83
+ msgid "These scripts will be printed just below the opening %s tag."
84
  msgstr ""
85
 
86
+ #: views/settings.php:52
87
+ msgid "Scripts in Footer"
 
88
  msgstr ""
89
 
90
+ #. translators: %s: The `</body>` tag
91
+ #: views/settings.php:57
92
+ msgid "These scripts will be printed above the closing %s tag."
93
  msgstr ""
94
 
95
+ #: views/settings.php:64
96
+ msgid "Save"
97
  msgstr ""
98
 
99
  #: views/sidebar.php:9
100
  msgid "Improve Your Site"
101
  msgstr ""
102
 
103
+ #. translators: %s: Link to WPBeginner blog
104
+ #: views/sidebar.php:17
105
+ msgid "Want to take your site to the next level? Check out our daily free WordPress tutorials on %s."
106
  msgstr ""
107
 
108
+ #: views/sidebar.php:20
109
  msgid "WPBeginner blog"
110
  msgstr ""
111
 
112
+ #: views/sidebar.php:27
113
  msgid "Some of our popular guides:"
114
  msgstr ""
115
 
116
+ #: views/sidebar.php:33
117
  msgid "Speed Up WordPress"
118
  msgstr ""
119
 
120
+ #: views/sidebar.php:38
121
  msgid "Improve WordPress Security"
122
  msgstr ""
123
 
124
+ #: views/sidebar.php:43
125
  msgid "Boost Your WordPress SEO"
126
  msgstr ""
127
 
128
+ #: views/sidebar.php:54
129
  msgid "Our WordPress Plugins"
130
  msgstr ""
131
 
132
+ #: views/sidebar.php:58
133
  msgid "Like this plugin? Check out our other WordPress plugins:"
134
  msgstr ""
135
 
136
+ #: views/sidebar.php:65
137
  msgid "WPForms"
138
  msgstr ""
139
 
140
+ #: views/sidebar.php:66
141
+ msgid "Drag & Drop WordPress Form Builder"
142
  msgstr ""
143
 
144
+ #: views/sidebar.php:75
145
  msgid "MonsterInsights"
146
  msgstr ""
147
 
148
+ #: views/sidebar.php:76
149
+ msgid "Google Analytics Made Easy for WordPress"
150
  msgstr ""
151
 
152
+ #: views/sidebar.php:85
153
  msgid "OptinMonster"
154
  msgstr ""
155
 
156
+ #: views/sidebar.php:86
157
+ msgid "Best WordPress Lead Generation Plugin"
158
  msgstr ""
159
 
160
+ #: views/sidebar.php:95
161
  msgid "SeedProd"
162
  msgstr ""
163
 
164
+ #: views/sidebar.php:96
165
+ msgid "Get the best WordPress Coming Soon Page plugin"
166
+ msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -2,8 +2,9 @@
2
  Contributors: WPbeginner, smub, deb255
3
  Tags: code, content, css, facebook pixel, footer, footer code, footer scripts, footers, google analytics, head, header, header code, header scripts, headers, insert, insert code, insert scripts, js, meta, meta tags, scripts, wpmu
4
  Requires at least: 3.6
5
- Tested up to: 5.2
6
- Stable tag: 1.4.4
 
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -71,7 +72,7 @@ Yes, to verify your account or to tag your page for Auto ads, paste the code AdS
71
 
72
  = How to disable Insert Headers and Footers on a specific page? =
73
 
74
- You can use one of the three available boolean filters: disable_ihaf, disable_ihaf_footer, disable_ihaf_header and return true value in order to disable printing either on the entire page or specifically in the header or footer of a given page.
75
 
76
  == Notes ==
77
  Insert Headers and Footers is the easiest way to insert code in your WordPress headers and footers.
@@ -85,6 +86,10 @@ Syed Balkhi
85
 
86
  == Changelog ==
87
 
 
 
 
 
88
  = 1.4.4 =
89
  * Tested compatibility with WordPress 5.2
90
  * Updated text-domain standards and in plugin header
@@ -126,4 +131,4 @@ Syed Balkhi
126
  * fixed unecessary CSS loading
127
 
128
  = 1.0 =
129
- * Initial version
2
  Contributors: WPbeginner, smub, deb255
3
  Tags: code, content, css, facebook pixel, footer, footer code, footer scripts, footers, google analytics, head, header, header code, header scripts, headers, insert, insert code, insert scripts, js, meta, meta tags, scripts, wpmu
4
  Requires at least: 3.6
5
+ Tested up to: 5.3.2
6
+ Requires PHP: 5.2
7
+ Stable tag: 1.4.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
72
 
73
  = How to disable Insert Headers and Footers on a specific page? =
74
 
75
+ You can use one of the three available boolean filters: disable_ihaf, disable_ihaf_footer, disable_ihaf_header, disable_ihaf_body and return true value in order to disable printing either on the entire page or specifically in the header or footer of a given page.
76
 
77
  == Notes ==
78
  Insert Headers and Footers is the easiest way to insert code in your WordPress headers and footers.
86
 
87
  == Changelog ==
88
 
89
+ = 1.4.5 =
90
+ * Tested compatibility with WordPress 5.3.2
91
+ * Add support for printing scripts right after the opening body tag using the `wp_body_open` action
92
+
93
  = 1.4.4 =
94
  * Tested compatibility with WordPress 5.2
95
  * Updated text-domain standards and in plugin header
131
  * fixed unecessary CSS loading
132
 
133
  = 1.0 =
134
+ * Initial version
views/dashboard-notices.php CHANGED
File without changes
views/settings.php CHANGED
@@ -27,16 +27,41 @@
27
  <p>
28
  <label for="ihaf_insert_header"><strong><?php esc_html_e( 'Scripts in Header', 'insert-headers-and-footers' ); ?></strong></label>
29
  <textarea name="ihaf_insert_header" id="ihaf_insert_header" class="widefat" rows="8" style="font-family:Courier New;"><?php echo $this->settings['ihaf_insert_header']; ?></textarea>
30
- <?php esc_html_e( 'These scripts will be printed in the <code>&lt;head&gt;</code> section.', 'insert-headers-and-footers' ); ?>
 
 
 
 
 
 
31
  </p>
32
- <p>
33
- <label for="ihaf_insert_footer"><strong><?php esc_html_e( 'Scripts in Footer', 'insert-headers-and-footers' ); ?></strong></label>
34
- <textarea name="ihaf_insert_footer" id="ihaf_insert_footer" class="widefat" rows="8" style="font-family:Courier New;"><?php echo $this->settings['ihaf_insert_footer']; ?></textarea>
35
- <?php esc_html_e( 'These scripts will be printed above the <code>&lt;/body&gt;</code> tag.', 'insert-headers-and-footers' ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  </p>
37
  <?php wp_nonce_field( $this->plugin->name, $this->plugin->name . '_nonce' ); ?>
38
  <p>
39
- <input name="submit" type="submit" name="Submit" class="button button-primary" value="<?php esc_html_e( 'Save', 'insert-headers-and-footers' ); ?>" />
40
  </p>
41
  </form>
42
  </div>
@@ -54,4 +79,4 @@
54
  <!-- /postbox-container -->
55
  </div>
56
  </div>
57
- </div>
27
  <p>
28
  <label for="ihaf_insert_header"><strong><?php esc_html_e( 'Scripts in Header', 'insert-headers-and-footers' ); ?></strong></label>
29
  <textarea name="ihaf_insert_header" id="ihaf_insert_header" class="widefat" rows="8" style="font-family:Courier New;"><?php echo $this->settings['ihaf_insert_header']; ?></textarea>
30
+ <?php
31
+ printf(
32
+ /* translators: %s: The `<head>` tag */
33
+ esc_html__( 'These scripts will be printed in the %s section.', 'insert-headers-and-footers' ),
34
+ '<code>&lt;head&gt;</code>'
35
+ );
36
+ ?>
37
  </p>
38
+ <?php if ( $this->body_open_supported ) : ?>
39
+ <p>
40
+ <label for="ihaf_insert_body"><strong><?php esc_html_e( 'Scripts in Body', 'insert-headers-and-footers' ); ?></strong></label>
41
+ <textarea name="ihaf_insert_body" id="ihaf_insert_body" class="widefat" rows="8" style="font-family:Courier New;"><?php echo $this->settings['ihaf_insert_body']; ?></textarea>
42
+ <?php
43
+ printf(
44
+ /* translators: %s: The `<head>` tag */
45
+ esc_html__( 'These scripts will be printed just below the opening %s tag.', 'insert-headers-and-footers' ),
46
+ '<code>&lt;body&gt;</code>'
47
+ );
48
+ ?>
49
+ </p>
50
+ <?php endif; ?>
51
+ <p>
52
+ <label for="ihaf_insert_footer"><strong><?php esc_html_e( 'Scripts in Footer', 'insert-headers-and-footers' ); ?></strong></label>
53
+ <textarea name="ihaf_insert_footer" id="ihaf_insert_footer" class="widefat" rows="8" style="font-family:Courier New;"><?php echo $this->settings['ihaf_insert_footer']; ?></textarea>
54
+ <?php
55
+ printf(
56
+ /* translators: %s: The `</body>` tag */
57
+ esc_html__( 'These scripts will be printed above the closing %s tag.', 'insert-headers-and-footers' ),
58
+ '<code>&lt;/body&gt;</code>'
59
+ );
60
+ ?>
61
  </p>
62
  <?php wp_nonce_field( $this->plugin->name, $this->plugin->name . '_nonce' ); ?>
63
  <p>
64
+ <input name="submit" type="submit" name="Submit" class="button button-primary" value="<?php esc_attr_e( 'Save', 'insert-headers-and-footers' ); ?>" />
65
  </p>
66
  </form>
67
  </div>
79
  <!-- /postbox-container -->
80
  </div>
81
  </div>
82
+ </div>
views/sidebar.php CHANGED
@@ -1,72 +1,101 @@
1
  <?php
2
  /**
3
- * Donations Sidebar
4
- */
5
  ?>
6
  <!-- Improve Your Site -->
7
  <div class="postbox">
8
- <h3 class="hndle">
9
- <span><?php esc_html_e('Improve Your Site', 'insert-headers-and-footers' ); ?></span>
10
- </h3>
11
 
12
- <div class="inside">
13
- <p>
14
- <?php esc_html_e( 'Want to take your site to the next level? Check out our daily free WordPress tutorials on ', 'insert-headers-and-footers' ); ?>
15
- <a href="http://www.wpbeginner.com/?utm_source=wpadmin&utm_campaign=freeplugins"><?php esc_html_e( 'WPBeginner blog', 'insert-headers-and-footers' ); ?></a>.
16
- </p>
 
 
 
 
 
 
 
 
17
 
18
- <p>
19
- <?php esc_html_e( 'Some of our popular guides:', 'insert-headers-and-footers' ); ?>
20
- </p>
21
 
22
- <ul>
23
- <li><a href="http://www.wpbeginner.com/wordpress-performance-speed/?utm_source=wpadmin&utm_campaign=freeplugins" target="_blank">
24
- <?php esc_html_e( 'Speed Up WordPress', 'insert-headers-and-footers' ); ?>
25
- </a></li>
26
- <li><a href="http://www.wpbeginner.com/wordpress-security/?utm_source=wpadmin&utm_campaign=freeplugins" target="_blank">
27
- <?php esc_html_e( 'Improve WordPress Security', 'insert-headers-and-footers' ); ?>
28
- </a></li>
 
 
 
 
 
 
 
 
 
 
29
 
30
- <li><a href="http://www.wpbeginner.com/wordpress-seo/?utm_source=wpadmin&utm_campaign=freeplugins" target="_blank">
31
- <?php esc_html_e( 'Boost Your WordPress SEO', 'insert-headers-and-footers' ); ?>
32
- </a></li>
33
- </ul>
34
-
35
- </div>
36
  </div>
37
 
38
  <!-- Donate -->
39
  <div class="postbox">
40
- <h3 class="hndle">
41
- <span><?php esc_html_e( 'Our WordPress Plugins', 'insert-headers-and-footers' ); ?></span>
42
- </h3>
43
- <div class="inside">
44
- <p>
45
- <?php esc_html_e( 'Like this plugin? Check out our other WordPress plugins:', 'insert-headers-and-footers' ); ?>
46
- </p>
47
- <p>
48
- <a href="https://wordpress.org/plugins/wpforms-lite/" target="_blank">
49
- <?php esc_html_e( 'WPForms', 'insert-headers-and-footers' ); ?>
50
- </a>
51
- <?php esc_html_e( ' - Drag & Drop WordPress Form Builder', 'insert-headers-and-footers' ); ?>
52
- </p>
53
- <p>
54
- <a href="https://wordpress.org/plugins/google-analytics-for-wordpress/" target="_blank">
55
- <?php esc_html_e( 'MonsterInsights', 'insert-headers-and-footers' ); ?>
56
- </a>
57
- <?php esc_html_e( ' - Google Analytics Made Easy for WordPress', 'insert-headers-and-footers' ); ?>
58
- </p>
59
- <p>
60
- <a href="http://optinmonster.com/" target="_blank">
61
- <?php esc_html_e( 'OptinMonster', 'insert-headers-and-footers' ); ?>
62
- </a>
63
- <?php esc_html_e( ' - Best WordPress Lead Generation Plugin', 'insert-headers-and-footers' ); ?>
64
- </p>
65
- <p>
66
- <a href="https://www.seedprod.com/" target="_blank">
67
- <?php esc_html_e( 'SeedProd', 'insert-headers-and-footers' ); ?>
68
- </a>
69
- <?php esc_html_e( ' - Get the best WordPress Coming Soon Page plugin', 'insert-headers-and-footers' ); ?>
70
- </p>
71
- </div>
72
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
  /**
3
+ * Donations Sidebar
4
+ */
5
  ?>
6
  <!-- Improve Your Site -->
7
  <div class="postbox">
8
+ <h3 class="hndle">
9
+ <span><?php esc_html_e('Improve Your Site', 'insert-headers-and-footers'); ?></span>
10
+ </h3>
11
 
12
+ <div class="inside">
13
+ <p>
14
+ <?php
15
+ printf(
16
+ /* translators: %s: Link to WPBeginner blog */
17
+ esc_html__('Want to take your site to the next level? Check out our daily free WordPress tutorials on %s.', 'insert-headers-and-footers'),
18
+ sprintf(
19
+ '<a href="http://www.wpbeginner.com/?utm_source=wpadmin&utm_campaign=freeplugins" target="_blank">%s</a>',
20
+ esc_html__('WPBeginner blog', 'insert-headers-and-footers')
21
+ )
22
+ );
23
+ ?>
24
+ </p>
25
 
26
+ <p>
27
+ <?php esc_html_e('Some of our popular guides:', 'insert-headers-and-footers'); ?>
28
+ </p>
29
 
30
+ <ul>
31
+ <li>
32
+ <a href="http://www.wpbeginner.com/wordpress-performance-speed/?utm_source=wpadmin&utm_campaign=freeplugins" target="_blank">
33
+ <?php esc_html_e('Speed Up WordPress', 'insert-headers-and-footers'); ?>
34
+ </a>
35
+ </li>
36
+ <li>
37
+ <a href="http://www.wpbeginner.com/wordpress-security/?utm_source=wpadmin&utm_campaign=freeplugins" target="_blank">
38
+ <?php esc_html_e('Improve WordPress Security', 'insert-headers-and-footers'); ?>
39
+ </a>
40
+ </li>
41
+ <li>
42
+ <a href="http://www.wpbeginner.com/wordpress-seo/?utm_source=wpadmin&utm_campaign=freeplugins" target="_blank">
43
+ <?php esc_html_e('Boost Your WordPress SEO', 'insert-headers-and-footers'); ?>
44
+ </a>
45
+ </li>
46
+ </ul>
47
 
48
+ </div>
 
 
 
 
 
49
  </div>
50
 
51
  <!-- Donate -->
52
  <div class="postbox">
53
+ <h3 class="hndle">
54
+ <span><?php esc_html_e('Our WordPress Plugins', 'insert-headers-and-footers'); ?></span>
55
+ </h3>
56
+ <div class="inside">
57
+ <p>
58
+ <?php esc_html_e('Like this plugin? Check out our other WordPress plugins:', 'insert-headers-and-footers'); ?>
59
+ </p>
60
+ <p>
61
+ <?php
62
+ printf(
63
+ '<a href="%1$s" target="_blank">%2$s</a> - %3$s',
64
+ esc_url('https://wordpress.org/plugins/wpforms-lite/'),
65
+ esc_html__('WPForms', 'insert-headers-and-footers'),
66
+ esc_html__('Drag & Drop WordPress Form Builder', 'insert-headers-and-footers')
67
+ );
68
+ ?>
69
+ </p>
70
+ <p>
71
+ <?php
72
+ printf(
73
+ '<a href="%1$s" target="_blank">%2$s</a> - %3$s',
74
+ esc_url('https://wordpress.org/plugins/google-analytics-for-wordpress/'),
75
+ esc_html__('MonsterInsights', 'insert-headers-and-footers'),
76
+ esc_html__('Google Analytics Made Easy for WordPress', 'insert-headers-and-footers')
77
+ );
78
+ ?>
79
+ </p>
80
+ <p>
81
+ <?php
82
+ printf(
83
+ '<a href="%1$s" target="_blank">%2$s</a> - %3$s',
84
+ esc_url('http://optinmonster.com/'),
85
+ esc_html__('OptinMonster', 'insert-headers-and-footers'),
86
+ esc_html__('Best WordPress Lead Generation Plugin', 'insert-headers-and-footers')
87
+ );
88
+ ?>
89
+ </p>
90
+ <p>
91
+ <?php
92
+ printf(
93
+ '<a href="%1$s" target="_blank">%2$s</a> - %3$s',
94
+ esc_url('https://www.seedprod.com/'),
95
+ esc_html__('SeedProd', 'insert-headers-and-footers'),
96
+ esc_html__('Get the best WordPress Coming Soon Page plugin', 'insert-headers-and-footers')
97
+ );
98
+ ?>
99
+ </p>
100
+ </div>
101
+ </div>