Head and Footer Scripts Inserter - Version 4.19

Version Description

  • Added new constant "_FILE".
  • Added a function that runs during the plugin activation. Now the date of the first activation of the plugin is recorded in the database.
Download this release

Release Info

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

Code changes from version 4.18 to 4.19

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: Space X-Chimp
7
  * Author URI: https://www.spacexchimp.com
8
- * Version: 4.18
9
  * License: GPL3
10
  * Text Domain: header-and-footer-scripts-inserter
11
  * Domain Path: /languages/
@@ -55,6 +55,7 @@ function spacexchimp_p006_define_constants( $constant_name, $value ) {
55
  if ( !defined( $constant_name ) )
56
  define( $constant_name, $value );
57
  }
 
58
  spacexchimp_p006_define_constants( 'DIR', dirname( plugin_basename( __FILE__ ) ) );
59
  spacexchimp_p006_define_constants( 'BASE', plugin_basename( __FILE__ ) );
60
  spacexchimp_p006_define_constants( 'URL', plugin_dir_url( __FILE__ ) );
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: Space X-Chimp
7
  * Author URI: https://www.spacexchimp.com
8
+ * Version: 4.19
9
  * License: GPL3
10
  * Text Domain: header-and-footer-scripts-inserter
11
  * Domain Path: /languages/
55
  if ( !defined( $constant_name ) )
56
  define( $constant_name, $value );
57
  }
58
+ spacexchimp_p006_define_constants( 'FILE', __FILE__ );
59
  spacexchimp_p006_define_constants( 'DIR', dirname( plugin_basename( __FILE__ ) ) );
60
  spacexchimp_p006_define_constants( 'BASE', plugin_basename( __FILE__ ) );
61
  spacexchimp_p006_define_constants( 'URL', plugin_dir_url( __FILE__ ) );
inc/php/core.php CHANGED
@@ -87,3 +87,24 @@ function spacexchimp_p006_admin_footer_text() {
87
  add_filter( 'admin_footer_text', 'spacexchimp_p006_new_admin_footer_text', 11 );
88
  }
89
  add_action( 'current_screen', 'spacexchimp_p006_admin_footer_text' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  add_filter( 'admin_footer_text', 'spacexchimp_p006_new_admin_footer_text', 11 );
88
  }
89
  add_action( 'current_screen', 'spacexchimp_p006_admin_footer_text' );
90
+
91
+ /**
92
+ * Runs during the plugin activation
93
+ */
94
+ function spacexchimp_p006_activation() {
95
+
96
+ // Read the plugin service information from the database and put it into an array
97
+ $info = get_option( SPACEXCHIMP_P006_SETTINGS . '_service_info' );
98
+
99
+ // Make the "$info" array if the plugin service information in the database is not exist
100
+ if ( ! is_array( $info ) ) $info = array();
101
+
102
+ // Get the activation date of the plugin from the database
103
+ $activation_date = !empty( $info['activation_date'] ) ? $info['activation_date'] : '';
104
+
105
+ if ( $activation_date == '' ) {
106
+ $info['activation_date'] = time();
107
+ update_option( SPACEXCHIMP_P006_SETTINGS . '_service_info', $info );
108
+ }
109
+ }
110
+ register_activation_hook( SPACEXCHIMP_P006_FILE, 'spacexchimp_p006_activation' );
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: inject, insert, insert scripts, insert javascript, insert js, insert html,
4
  Donate link: https://www.spacexchimp.com/donate.html
5
  Requires at least: 3.9
6
  Tested up to: 4.9
7
- Stable tag: 4.18
8
  License: GPL3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -187,6 +187,10 @@ Commercial licensing (e.g. for projects that can’t use an open-source license)
187
 
188
  == Changelog ==
189
 
 
 
 
 
190
  = 4.18 =
191
  * Added auto-versioning of the CSS and JavaScript files to avoid cache issues.
192
  * CSS code in the file 'admin.css' is optimized.
4
  Donate link: https://www.spacexchimp.com/donate.html
5
  Requires at least: 3.9
6
  Tested up to: 4.9
7
+ Stable tag: 4.19
8
  License: GPL3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
187
 
188
  == Changelog ==
189
 
190
+ = 4.19 =
191
+ * Added new constant "_FILE".
192
+ * Added a function that runs during the plugin activation. Now the date of the first activation of the plugin is recorded in the database.
193
+
194
  = 4.18 =
195
  * Added auto-versioning of the CSS and JavaScript files to avoid cache issues.
196
  * CSS code in the file 'admin.css' is optimized.