Website Monetization by MageNet - Version 1.0.26

Version Description

  • MySQL version update
Download this release

Release Info

Developer MageNet
Plugin Icon 128x128 Website Monetization by MageNet
Version 1.0.26
Comparing to
See all releases

Code changes from version 1.0.25 to 1.0.26

MagenetLinkAutoinstall.php CHANGED
@@ -6,6 +6,13 @@ $plugin_data = get_plugin_data(plugin_file);
6
 
7
  define("magenet_plugin_version", $plugin_data['Version']);
8
 
 
 
 
 
 
 
 
9
  if (!class_exists('MagenetLinkAutoinstall')) {
10
 
11
  class MagenetLinkAutoinstall
@@ -81,11 +88,13 @@ if (!class_exists('MagenetLinkAutoinstall')) {
81
 
82
  public function activate()
83
  {
84
- global $wpdb;
85
  //require_once(ABSPATH . 'wp-admin/upgrade-functions.php'); // depricated
86
- require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
 
 
87
 
88
- $table = $this->tbl_magenet_links;
89
  $charset_collate = '';
90
 
91
  if (@version_compare(mysqli_get_server_info(), '4.1.0', '>=')) {
@@ -109,10 +118,41 @@ if (!class_exists('MagenetLinkAutoinstall')) {
109
  if ($wpdb->get_var("show tables like '" . $table . "'") != $table) {
110
  dbDelta($sql_table_magenet_links);
111
  $wpdb->query($sql_add_index);
112
- }
113
 
114
  $result = $this->sendRequest($this->api_host . $this->api_activate, $this->getKey());
115
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
 
117
  public function deactivate()
118
  {
6
 
7
  define("magenet_plugin_version", $plugin_data['Version']);
8
 
9
+ function magenet_upgrade_completed( $upgrader_object, $options )
10
+ {
11
+ $magenetLinkAutoinstall = new MagenetLinkAutoinstall();
12
+ $magenetLinkAutoinstall->table();
13
+ }
14
+ add_action( 'upgrader_process_complete', 'magenet_upgrade_completed', 10, 2 );
15
+
16
  if (!class_exists('MagenetLinkAutoinstall')) {
17
 
18
  class MagenetLinkAutoinstall
88
 
89
  public function activate()
90
  {
91
+ //global $wpdb;
92
  //require_once(ABSPATH . 'wp-admin/upgrade-functions.php'); // depricated
93
+ //require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
94
+
95
+ $this->table();
96
 
97
+ /*$table = $this->tbl_magenet_links;
98
  $charset_collate = '';
99
 
100
  if (@version_compare(mysqli_get_server_info(), '4.1.0', '>=')) {
118
  if ($wpdb->get_var("show tables like '" . $table . "'") != $table) {
119
  dbDelta($sql_table_magenet_links);
120
  $wpdb->query($sql_add_index);
121
+ }*/
122
 
123
  $result = $this->sendRequest($this->api_host . $this->api_activate, $this->getKey());
124
  }
125
+
126
+ public function table()
127
+ {
128
+ global $wpdb;
129
+ require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
130
+ $table = $this->tbl_magenet_links;
131
+ $charset_collate = '';
132
+
133
+ if (@version_compare(mysqli_get_server_info(), '4.1.0', '>=')) {
134
+ if (!empty($wpdb->charset)) {
135
+ $charset_collate = " DEFAULT CHARACTER SET {$wpdb->charset} ";
136
+ }
137
+ if (!empty($wpdb->collate)) {
138
+ $charset_collate .= " COLLATE {$wpdb->collate} ";
139
+ }
140
+ }
141
+
142
+ $sql_table_magenet_links = "
143
+ CREATE TABLE `" . $wpdb->prefix . "magenet_links` (
144
+ `ID` INT(10) NOT NULL AUTO_INCREMENT,
145
+ `page_url` TEXT NOT NULL DEFAULT '',
146
+ `link_html` TEXT NOT NULL DEFAULT '',
147
+ PRIMARY KEY (`ID`)
148
+ )" . $charset_collate . ";";
149
+ $sql_add_index = "CREATE INDEX page_url ON `" . $wpdb->prefix . "magenet_links` (page_url(100));";
150
+
151
+ if ($wpdb->get_var("show tables like '" . $table . "'") != $table) {
152
+ dbDelta($sql_table_magenet_links);
153
+ $wpdb->query($sql_add_index);
154
+ }
155
+ }
156
 
157
  public function deactivate()
158
  {
monetization-by-magenet.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Website Monetization by MageNet
4
  Description: Website Monetization by MageNet allows you to sell contextual ads from your pages automatically and receive payments with PayPal. To get started: 1) Click the "Activate" link to the left of this description, 2) <a href="http://www.magenet.com" target="_blank">Sign up for a MageNet Key</a>, and 3) Go to Settings > "Website Monetization by MageNet" configuration page, and save your MageNet Key.
5
- Version: 1.0.25
6
  Author: MageNet.com
7
  Author URI: http://www.magenet.com
8
  Text Domain: website-monetization-by-magenet
2
  /*
3
  Plugin Name: Website Monetization by MageNet
4
  Description: Website Monetization by MageNet allows you to sell contextual ads from your pages automatically and receive payments with PayPal. To get started: 1) Click the "Activate" link to the left of this description, 2) <a href="http://www.magenet.com" target="_blank">Sign up for a MageNet Key</a>, and 3) Go to Settings > "Website Monetization by MageNet" configuration page, and save your MageNet Key.
5
+ Version: 1.0.26
6
  Author: MageNet.com
7
  Author URI: http://www.magenet.com
8
  Text Domain: website-monetization-by-magenet
readme.txt CHANGED
@@ -80,6 +80,9 @@ MageNet crawler will index your sites the same way Google does. It will “read
80
  4. "Pages options" menu
81
 
82
  == Changelog ==
 
 
 
83
  = 1.0.25 =
84
  * Minor update
85
 
80
  4. "Pages options" menu
81
 
82
  == Changelog ==
83
+ = 1.0.26 =
84
+ * MySQL version update
85
+
86
  = 1.0.25 =
87
  * Minor update
88