All Meta Tags - Version 4.8

Version Description

  • Plugin data that saved in the database upgraded to version 0001.
Download this release

Release Info

Developer Arthur Gareginyan
Plugin Icon 128x128 All Meta Tags
Version 4.8
Comparing to
See all releases

Code changes from version 4.7 to 4.8

Files changed (4) hide show
  1. all-meta-tags.php +3 -3
  2. inc/php/controls.php +3 -3
  3. inc/php/upgrade.php +50 -0
  4. readme.txt +4 -1
all-meta-tags.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Easily and safely add your custom Meta Tags to WordPress website's header.
6
  * Author: Arthur Gareginyan
7
  * Author URI: https://www.arthurgareginyan.com
8
- * Version: 4.7
9
  * License: GPL3
10
  * Text Domain: all-meta-tags
11
  * Domain Path: /languages/
@@ -71,8 +71,8 @@ spacexchimp_p004_define_constants( 'SLUG', dirname( plugin_basename( __FILE__ )
71
  spacexchimp_p004_define_constants( 'NAME', $plugin_data['name'] );
72
  spacexchimp_p004_define_constants( 'VERSION', $plugin_data['version'] );
73
  spacexchimp_p004_define_constants( 'TEXT', $plugin_data['text'] );
74
- spacexchimp_p004_define_constants( 'PREFIX', 'allmetatags' );
75
- spacexchimp_p004_define_constants( 'SETTINGS', 'allmetatags' );
76
 
77
  /**
78
  * Load the plugin modules
5
  * Description: Easily and safely add your custom Meta Tags to WordPress website's header.
6
  * Author: Arthur Gareginyan
7
  * Author URI: https://www.arthurgareginyan.com
8
+ * Version: 4.8
9
  * License: GPL3
10
  * Text Domain: all-meta-tags
11
  * Domain Path: /languages/
71
  spacexchimp_p004_define_constants( 'NAME', $plugin_data['name'] );
72
  spacexchimp_p004_define_constants( 'VERSION', $plugin_data['version'] );
73
  spacexchimp_p004_define_constants( 'TEXT', $plugin_data['text'] );
74
+ spacexchimp_p004_define_constants( 'PREFIX', 'spacexchimp_p004' );
75
+ spacexchimp_p004_define_constants( 'SETTINGS', 'spacexchimp_p004' );
76
 
77
  /**
78
  * Load the plugin modules
inc/php/controls.php CHANGED
@@ -6,7 +6,7 @@
6
  defined( 'ABSPATH' ) or die( "Restricted access!" );
7
 
8
  /**
9
- * Generatator of the help text under controls
10
  */
11
  function spacexchimp_p004_control_help( $help=null ) {
12
 
@@ -28,7 +28,7 @@ function spacexchimp_p004_control_help( $help=null ) {
28
  }
29
 
30
  /**
31
- * Generatator of the fields for saving settings data to database
32
  */
33
  function spacexchimp_p004_control_field( $name, $label, $placeholder, $help=null, $link=null ) {
34
 
@@ -62,7 +62,7 @@ function spacexchimp_p004_control_field( $name, $label, $placeholder, $help=null
62
  }
63
 
64
  /**
65
- * Generatator of the textarea fields for saving settings data to database
66
  */
67
  function spacexchimp_p004_control_textarea( $name, $label, $placeholder, $help=null ) {
68
 
6
  defined( 'ABSPATH' ) or die( "Restricted access!" );
7
 
8
  /**
9
+ * Generator of the help text under controls
10
  */
11
  function spacexchimp_p004_control_help( $help=null ) {
12
 
28
  }
29
 
30
  /**
31
+ * Generator of the fields for saving settings data to database
32
  */
33
  function spacexchimp_p004_control_field( $name, $label, $placeholder, $help=null, $link=null ) {
34
 
62
  }
63
 
64
  /**
65
+ * Generator of the textarea fields for saving settings data to database
66
  */
67
  function spacexchimp_p004_control_textarea( $name, $label, $placeholder, $help=null ) {
68
 
inc/php/upgrade.php CHANGED
@@ -4,3 +4,53 @@
4
  * Prevent Direct Access
5
  */
6
  defined( 'ABSPATH' ) or die( "Restricted access!" );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  * Prevent Direct Access
5
  */
6
  defined( 'ABSPATH' ) or die( "Restricted access!" );
7
+
8
+ /**
9
+ * Upgrade plugin data in the database to version 4.8
10
+ */
11
+ function spacexchimp_p004_upgrade_4_8() {
12
+
13
+ // Upgrade number
14
+ $upgrade_number_new = '0001';
15
+ $prefix_old = 'allmetatags';
16
+ $prefix_new = 'spacexchimp_p004';
17
+
18
+ ///////////////////////////////////////////////////////////////////
19
+ // SEEVICE INFO //
20
+ ///////////////////////////////////////////////////////////////////
21
+
22
+ // Read plugin service info from the database
23
+ $service_info_old = get_option( $prefix_old . '_service_info' );
24
+ $service_info_current = get_option( $prefix_new . '_service_info' );
25
+ $upgrade_number_current = !empty( $service_info_current['upgrade'] ) ? $service_info_current['upgrade'] : '0000';
26
+
27
+ // Setting array with new data
28
+ $service_info_new = is_array( $service_info_old ) ? $service_info_old : array();
29
+ $service_info_new['upgrade'] = $upgrade_number_new;
30
+
31
+ // Exit if the upgrade is not needed or alreade done
32
+ if ( $upgrade_number_current >= $upgrade_number_new ) return;
33
+
34
+ // Update service info in the database
35
+ delete_option( $prefix_old . '_service_info' );
36
+ update_option( $prefix_new . '_service_info', $service_info_new );
37
+
38
+ ///////////////////////////////////////////////////////////////////
39
+ // SETTINGS //
40
+ ///////////////////////////////////////////////////////////////////
41
+
42
+ // Read plugin settings from the database
43
+ $settings_current = get_option( $prefix_old . '_settings' );
44
+
45
+ // Setting array with new data
46
+ $settings_new = is_array( $settings_current ) ? $settings_current : array();
47
+
48
+ // Exit if the upgrade is not needed or alreade done
49
+ if ( empty( $settings_current ) ) return;
50
+
51
+ // Update plugin setting in the database
52
+ delete_option( $prefix_old . '_settings' );
53
+ update_option( $prefix_new . '_settings', $settings_new );
54
+
55
+ }
56
+ spacexchimp_p004_upgrade_4_8();
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: meta, tag,tags, custom, simple, plugin, twitter, facebook, g+, google, goo
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.7
8
  License: GPL3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -195,6 +195,9 @@ Commercial licensing (e.g. for projects that can’t use an open-source license)
195
 
196
  == Changelog ==
197
 
 
 
 
198
  = 4.7 =
199
  * Added Spanish translation. (Thanks Patricio Toledo)
200
  * Function that render controls on the settings page is moved to a separate file 'controls.php'.
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.8
8
  License: GPL3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
195
 
196
  == Changelog ==
197
 
198
+ = 4.8 =
199
+ * Plugin data that saved in the database upgraded to version 0001.
200
+
201
  = 4.7 =
202
  * Added Spanish translation. (Thanks Patricio Toledo)
203
  * Function that render controls on the settings page is moved to a separate file 'controls.php'.