Website Monetization by MageNet - Version 1.0.12

Version Description

  • Fixed the issue with installing links at the homepages
  • Fix some other small bugs
Download this release

Release Info

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

Code changes from version 1.0.11 to 1.0.12

Files changed (2) hide show
  1. monetization-by-magenet.php +11 -9
  2. readme.txt +4 -0
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://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.11
6
  Author: MageNet.com
7
  Author URI: http://magenet.com
8
  */
@@ -128,11 +128,11 @@ if (!class_exists('MagenetLinkAutoinstall')) {
128
  global $post;
129
  $link_count = 1;
130
  $is_active_plugin = $this->getSeoPluginParam();
131
- if($is_active_plugin=='on' && $post->post_type == 'page') $link_count = 2;
132
 
133
  $this->link_shown++;
134
  if($this->link_shown == $link_count) {
135
- global $wpdb;
136
  $link_data = $this->getLinks();
137
  $content .= '<div class="mads-block">';
138
  if (count($link_data) > 0) {
@@ -217,10 +217,12 @@ if (!class_exists('MagenetLinkAutoinstall')) {
217
  }
218
  update_option("magenet_links_last_update", time());
219
  }
220
- $site_url = str_replace("'", "\'", get_option("siteurl"));
221
- $page_url = str_replace("'", "\'", $_SERVER["REQUEST_URI"]);
222
- $link_data = $wpdb->get_results("SELECT * FROM `" . $this->tbl_magenet_links . "` WHERE page_url='".$page_url."' OR page_url='".$site_url.$page_url."'", ARRAY_A);
223
- return $link_data;
 
 
224
  }
225
  return false;
226
  }
@@ -238,13 +240,13 @@ if (!class_exists('MagenetLinkAutoinstall')) {
238
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
239
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
240
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
241
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
242
  curl_setopt($ch, CURLOPT_ENCODING, "gzip,deflate");
243
  curl_setopt($ch, CURLOPT_POST, TRUE);
244
  curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
245
  $curl_result = curl_exec($ch);
246
 
247
- $this -> lastError = curl_errno($ch);
248
  if (!$this -> lastError) {
249
  $result = $curl_result;
250
  } else {
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://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.12
6
  Author: MageNet.com
7
  Author URI: http://magenet.com
8
  */
128
  global $post;
129
  $link_count = 1;
130
  $is_active_plugin = $this->getSeoPluginParam();
131
+ if($is_active_plugin=='on' && ($post->post_type == 'page' OR $post->post_type == 'post')) $link_count = 2;
132
 
133
  $this->link_shown++;
134
  if($this->link_shown == $link_count) {
135
+ global $wpdb;
136
  $link_data = $this->getLinks();
137
  $content .= '<div class="mads-block">';
138
  if (count($link_data) > 0) {
217
  }
218
  update_option("magenet_links_last_update", time());
219
  }
220
+ $check_page_without_last_slash_query = "";
221
+ if($page_url[strlen($page_url)-1] == "/") {
222
+ $check_page_without_last_slash_query = " OR page_url='" . $site_url . substr($page_url, 0, -1) . "'";
223
+ }
224
+ $link_data = $wpdb->get_results("SELECT * FROM `" . $this->tbl_magenet_links . "` WHERE page_url='". $site_url . $page_url ."'" . $check_page_without_last_slash_query, ARRAY_A);
225
+ return $link_data;
226
  }
227
  return false;
228
  }
240
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
241
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
242
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
243
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
244
  curl_setopt($ch, CURLOPT_ENCODING, "gzip,deflate");
245
  curl_setopt($ch, CURLOPT_POST, TRUE);
246
  curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
247
  $curl_result = curl_exec($ch);
248
 
249
+ $this -> lastError = curl_errno($ch);
250
  if (!$this -> lastError) {
251
  $result = $curl_result;
252
  } else {
readme.txt CHANGED
@@ -84,6 +84,10 @@ MageNet crawler will index your sites the same way Google does. It will “read
84
  3. "Pages options" menu
85
 
86
  == Changelog ==
 
 
 
 
87
  = 1.0.11 =
88
  * Fix problems with host security
89
 
84
  3. "Pages options" menu
85
 
86
  == Changelog ==
87
+ = 1.0.12 =
88
+ * Fixed the issue with installing links at the homepages
89
+ * Fix some other small bugs
90
+
91
  = 1.0.11 =
92
  * Fix problems with host security
93