Head and Footer Scripts Inserter - Version 4.12

Version Description

  • At the request of some users, plugin settings page moved to the submenu item in the top-level menu item "Settings", like before.
Download this release

Release Info

Developer Arthur Gareginyan
Plugin Icon 128x128 Head and Footer Scripts Inserter
Version 4.12
Comparing to
See all releases

Code changes from version 4.11 to 4.12

header-and-footer-scripts-inserter.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Easily add your scripts to the WordPress website's head and footer sections. This is a must have tool for authors and website's owners.
6
  * Author: Arthur Gareginyan
7
  * Author URI: https://www.arthurgareginyan.com
8
- * Version: 4.11
9
  * License: GPL3
10
  * Text Domain: header-and-footer-scripts-inserter
11
  * Domain Path: /languages/
5
  * Description: Easily add your scripts to the WordPress website's head and footer sections. This is a must have tool for authors and website's owners.
6
  * Author: Arthur Gareginyan
7
  * Author URI: https://www.arthurgareginyan.com
8
+ * Version: 4.12
9
  * License: GPL3
10
  * Text Domain: header-and-footer-scripts-inserter
11
  * Domain Path: /languages/
inc/php/core.php CHANGED
@@ -20,7 +20,7 @@ add_action( 'init', 'spacexchimp_p006_textdomain' );
20
  * and inserts a link to the plugin admin page
21
  */
22
  function spacexchimp_p006_settings_link( $links ) {
23
- $page = '<a href="' . admin_url( 'admin.php?page=spacexchimp/' . SPACEXCHIMP_P006_SLUG ) .'">' . __( 'Settings', SPACEXCHIMP_P006_TEXT ) . '</a>';
24
  array_unshift( $links, $page );
25
  return $links;
26
  }
@@ -44,55 +44,20 @@ function spacexchimp_p006_plugin_row_meta( $links, $file ) {
44
  add_filter( 'plugin_row_meta', 'spacexchimp_p006_plugin_row_meta', 10, 2 );
45
 
46
  /**
47
- * Register brand menu item in the Admin Menu
48
- */
49
- function spacexchimp_p006_register_admin_menu() {
50
-
51
- // Return if the brand menu item is already existed
52
- if ( !empty ( $GLOBALS['admin_page_hooks']['spacexchimp'] ) ) return;
53
-
54
- $page_title = 'Space X-Chimp';
55
- $menu_title = 'Space X-Chimp';
56
- $capability = 'manage_options';
57
- $menu_slug = 'spacexchimp';
58
- $function = null;
59
- $icon_url = 'dashicons-star-filled';
60
- $position = 66;
61
-
62
- add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position );
63
- }
64
- add_action( 'admin_menu', 'spacexchimp_p006_register_admin_menu' );
65
-
66
- /**
67
- * Register plugin's submenu item in the brand menu item
68
  */
69
  function spacexchimp_p006_register_submenu_page() {
70
 
71
- $parent_slug = 'spacexchimp';
72
  $page_title = SPACEXCHIMP_P006_NAME;
73
  $menu_title = __( 'Scripts Inserter', SPACEXCHIMP_P006_TEXT );
74
  $capability = 'manage_options';
75
- $menu_slug = 'spacexchimp/' . SPACEXCHIMP_P006_SLUG;
76
  $function = 'spacexchimp_p006_render_submenu_page';
77
 
78
- add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function);
79
  }
80
  add_action( 'admin_menu', 'spacexchimp_p006_register_submenu_page' );
81
 
82
- /**
83
- * Remove the 'Space X-Chimp' sub menu item in the brand menu item
84
- */
85
- function spacexchimp_p006_remove_submenu_item() {
86
-
87
- // Read global variable
88
- global $submenu;
89
-
90
- if ( isset( $submenu['spacexchimp'] ) ) {
91
- unset( $submenu['spacexchimp'][0] );
92
- }
93
- }
94
- add_action( 'admin_menu', 'spacexchimp_p006_remove_submenu_item' );
95
-
96
  /**
97
  * Register settings
98
  */
@@ -111,7 +76,7 @@ function spacexchimp_p006_admin_footer_text() {
111
  $current_screen = get_current_screen();
112
 
113
  // Return if the page is not a settings page of this plugin
114
- $settings_page = 'space-x-chimp_page_spacexchimp/' . SPACEXCHIMP_P006_SLUG;
115
  if ( $settings_page != $current_screen->id ) return;
116
 
117
  // Filter footer text
20
  * and inserts a link to the plugin admin page
21
  */
22
  function spacexchimp_p006_settings_link( $links ) {
23
+ $page = '<a href="' . admin_url( 'options-general.php?page=' . SPACEXCHIMP_P006_SLUG . '.php' ) .'">' . __( 'Settings', SPACEXCHIMP_P006_TEXT ) . '</a>';
24
  array_unshift( $links, $page );
25
  return $links;
26
  }
44
  add_filter( 'plugin_row_meta', 'spacexchimp_p006_plugin_row_meta', 10, 2 );
45
 
46
  /**
47
+ * Register a submenu item in the top-level menu item "Settings"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  */
49
  function spacexchimp_p006_register_submenu_page() {
50
 
 
51
  $page_title = SPACEXCHIMP_P006_NAME;
52
  $menu_title = __( 'Scripts Inserter', SPACEXCHIMP_P006_TEXT );
53
  $capability = 'manage_options';
54
+ $menu_slug = SPACEXCHIMP_P006_SLUG;
55
  $function = 'spacexchimp_p006_render_submenu_page';
56
 
57
+ add_options_page( $page_title, $menu_title, $capability, $menu_slug, $function );
58
  }
59
  add_action( 'admin_menu', 'spacexchimp_p006_register_submenu_page' );
60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  /**
62
  * Register settings
63
  */
76
  $current_screen = get_current_screen();
77
 
78
  // Return if the page is not a settings page of this plugin
79
+ $settings_page = 'settings_page_' . SPACEXCHIMP_P006_SLUG;
80
  if ( $settings_page != $current_screen->id ) return;
81
 
82
  // Filter footer text
inc/php/enqueue.php CHANGED
@@ -16,7 +16,7 @@ function spacexchimp_p006_load_scripts_admin( $hook ) {
16
  $url = SPACEXCHIMP_P006_URL;
17
 
18
  // Return if the page is not a settings page of this plugin
19
- $settings_page = 'space-x-chimp_page_spacexchimp/' . $slug;
20
  if ( $settings_page != $hook ) return;
21
 
22
  // Load jQuery library
16
  $url = SPACEXCHIMP_P006_URL;
17
 
18
  // Return if the page is not a settings page of this plugin
19
+ $settings_page = 'settings_page_' . $slug;
20
  if ( $settings_page != $hook ) return;
21
 
22
  // Load jQuery library
languages/header-and-footer-scripts-inserter-es_ES.mo CHANGED
Binary file
languages/header-and-footer-scripts-inserter-es_ES.po CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Head and Footer Scripts Inserter\n"
4
- "POT-Creation-Date: 2017-09-15 14:26+0300\n"
5
- "PO-Revision-Date: 2017-09-15 14:26+0300\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "Language: es\n"
@@ -28,7 +28,7 @@ msgstr "Ajustes"
28
  msgid "Donate"
29
  msgstr "Donar"
30
 
31
- #: inc/php/core.php:73
32
  msgid "Scripts Inserter"
33
  msgstr "Scripts Inserter"
34
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Head and Footer Scripts Inserter\n"
4
+ "POT-Creation-Date: 2017-09-23 04:52+0300\n"
5
+ "PO-Revision-Date: 2017-09-23 04:52+0300\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "Language: es\n"
28
  msgid "Donate"
29
  msgstr "Donar"
30
 
31
+ #: inc/php/core.php:52
32
  msgid "Scripts Inserter"
33
  msgstr "Scripts Inserter"
34
 
languages/header-and-footer-scripts-inserter-pl_PL.mo CHANGED
Binary file
languages/header-and-footer-scripts-inserter-pl_PL.po CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Header and Footer Scripts Inserter\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2017-09-15 14:26+0300\n"
6
- "PO-Revision-Date: 2017-09-15 14:26+0300\n"
7
  "Last-Translator: psouu <koko887@wp.pl>\n"
8
  "Language-Team: \n"
9
  "Language: pl\n"
@@ -33,7 +33,7 @@ msgstr "Ustawienia"
33
  msgid "Donate"
34
  msgstr "Wesprzyj"
35
 
36
- #: inc/php/core.php:73
37
  msgid "Scripts Inserter"
38
  msgstr ""
39
 
2
  msgstr ""
3
  "Project-Id-Version: Header and Footer Scripts Inserter\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2017-09-23 04:52+0300\n"
6
+ "PO-Revision-Date: 2017-09-23 04:52+0300\n"
7
  "Last-Translator: psouu <koko887@wp.pl>\n"
8
  "Language-Team: \n"
9
  "Language: pl\n"
33
  msgid "Donate"
34
  msgstr "Wesprzyj"
35
 
36
+ #: inc/php/core.php:52
37
  msgid "Scripts Inserter"
38
  msgstr ""
39
 
languages/header-and-footer-scripts-inserter-ru_RU.mo CHANGED
Binary file
languages/header-and-footer-scripts-inserter-ru_RU.po CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Header and Footer Scripts Inserter\n"
4
- "POT-Creation-Date: 2017-09-15 14:16+0300\n"
5
- "PO-Revision-Date: 2017-09-15 14:16+0300\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "Language: ru\n"
@@ -29,7 +29,7 @@ msgstr "Настройки"
29
  msgid "Donate"
30
  msgstr "Поддержать"
31
 
32
- #: inc/php/core.php:73
33
  msgid "Scripts Inserter"
34
  msgstr "Scripts Inserter"
35
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Header and Footer Scripts Inserter\n"
4
+ "POT-Creation-Date: 2017-09-23 04:53+0300\n"
5
+ "PO-Revision-Date: 2017-09-23 04:53+0300\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "Language: ru\n"
29
  msgid "Donate"
30
  msgstr "Поддержать"
31
 
32
+ #: inc/php/core.php:52
33
  msgid "Scripts Inserter"
34
  msgstr "Scripts Inserter"
35
 
languages/header-and-footer-scripts-inserter.pot CHANGED
@@ -3,7 +3,7 @@ msgid ""
3
  msgstr ""
4
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
  "Project-Id-Version: Header and Footer Scripts Inserter\n"
6
- "POT-Creation-Date: 2017-09-15 14:07+0300\n"
7
  "PO-Revision-Date: 2016-01-30 11:39+0300\n"
8
  "Last-Translator: \n"
9
  "Language-Team: \n"
@@ -26,7 +26,7 @@ msgstr ""
26
  msgid "Donate"
27
  msgstr ""
28
 
29
- #: inc/php/core.php:73
30
  msgid "Scripts Inserter"
31
  msgstr ""
32
 
3
  msgstr ""
4
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
  "Project-Id-Version: Header and Footer Scripts Inserter\n"
6
+ "POT-Creation-Date: 2017-09-23 04:49+0300\n"
7
  "PO-Revision-Date: 2016-01-30 11:39+0300\n"
8
  "Last-Translator: \n"
9
  "Language-Team: \n"
26
  msgid "Donate"
27
  msgstr ""
28
 
29
+ #: inc/php/core.php:52
30
  msgid "Scripts Inserter"
31
  msgstr ""
32
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: inject, insert, insert scripts, insert javascript, insert js, insert html,
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8A88KC7TFF6CS
5
  Requires at least: 3.9
6
  Tested up to: 4.8
7
- Stable tag: 4.11
8
  License: GPL3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -82,7 +82,7 @@ Manually via FTP access:
82
  4. Log into Admin Panel of your WordPress website.
83
  5. Activate this plugin through the "`Plugins`" tab.
84
 
85
- After installation and activation, the "`Scripts Inserter`" menu item will appear in the "`Space X-Chimp`" section of Admin Panel. Click on it in order to view the plugin settings page.
86
 
87
  [More help installing plugins](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins "WordPress Codex: Installing Plugins")
88
 
@@ -97,7 +97,7 @@ A. Yes. This plugin is ready for translation and has already been translated int
97
 
98
  = Q. How does it work? =
99
  A. Simply go to the plugin settings page, place your scripts in the field and click the "Save changes" button. Enjoy the result of applying your scripts. It's that simple!
100
- You can find the plugin settings page at "`WP Admin Panel`" -> "`Space X-Chimp`" -> "`Scripts Inserter`".
101
 
102
  = Q. How much of scripts I can enter in the field? =
103
  A. I don't limit the number of characters.
@@ -175,6 +175,9 @@ Commercial licensing (e.g. for projects that can’t use an open-source license)
175
 
176
  == Changelog ==
177
 
 
 
 
178
  = 4.11 =
179
  * Fixed the issue due tof which the 'Space X-Chimp' sub menu item in the brand menu item was displayed.
180
  * Added branded footer text on the plugin's settings page.
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8A88KC7TFF6CS
5
  Requires at least: 3.9
6
  Tested up to: 4.8
7
+ Stable tag: 4.12
8
  License: GPL3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
82
  4. Log into Admin Panel of your WordPress website.
83
  5. Activate this plugin through the "`Plugins`" tab.
84
 
85
+ After installation and activation, the "`Scripts Inserter`" menu item will appear in the "`Settings`" section of Admin Panel. Click on it in order to view the plugin settings page.
86
 
87
  [More help installing plugins](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins "WordPress Codex: Installing Plugins")
88
 
97
 
98
  = Q. How does it work? =
99
  A. Simply go to the plugin settings page, place your scripts in the field and click the "Save changes" button. Enjoy the result of applying your scripts. It's that simple!
100
+ You can find the plugin settings page at "`WP Admin Panel`" -> "`Settings`" -> "`Scripts Inserter`".
101
 
102
  = Q. How much of scripts I can enter in the field? =
103
  A. I don't limit the number of characters.
175
 
176
  == Changelog ==
177
 
178
+ = 4.12 =
179
+ * At the request of some users, plugin settings page moved to the submenu item in the top-level menu item "Settings", like before.
180
+
181
  = 4.11 =
182
  * Fixed the issue due tof which the 'Space X-Chimp' sub menu item in the brand menu item was displayed.
183
  * Added branded footer text on the plugin's settings page.