Website Monetization by MageNet - Version 1.0.10

Version Description

Download this release

Release Info

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

Code changes from version 1.0.8 to 1.0.10

Files changed (3) hide show
  1. monetization-by-magenet.php +38 -10
  2. readme.txt +3 -0
  3. view-settings.php +7 -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.8
6
  Author: MageNet.com
7
  Author URI: http://magenet.com
8
  */
@@ -25,8 +25,9 @@ if (!class_exists('MagenetLinkAutoinstall')) {
25
  private $api_host = "http://api.magenet.com";
26
  private $api_get = "/wordpress/get";
27
  private $api_test = "/wordpress/test";
28
- private $key = false;
29
- private $link_shown = false;
 
30
  private $lastError = 0;
31
 
32
  public function MagenetLinkAutoinstall() {
@@ -51,13 +52,23 @@ if (!class_exists('MagenetLinkAutoinstall')) {
51
  }
52
  }
53
 
54
- public function getKey() {
 
 
 
 
 
 
 
 
 
 
 
55
  if (!$this->key) {
56
  $this->key = get_option("magenet_links_autoinstall_key");
57
  }
58
  return $this->key;
59
- }
60
-
61
  public function setKey($key) {
62
  update_option("magenet_links_autoinstall_key", $key);
63
  $this->key = $key;
@@ -115,8 +126,13 @@ if (!class_exists('MagenetLinkAutoinstall')) {
115
  }
116
 
117
  public function add_magenet_links($content) {
118
- if(!$this->link_shown) {
119
- //$this->link_shown = true;
 
 
 
 
 
120
  global $wpdb;
121
  $link_data = $this->getLinks();
122
  $content .= '<div class="mads-block">';
@@ -126,14 +142,26 @@ if (!class_exists('MagenetLinkAutoinstall')) {
126
  }
127
  }
128
  $content .='</div>';
129
- }
 
130
 
131
  return $content;
132
  }
133
-
134
  public function admin_magenet_settings() {
135
  global $wpdb;
136
  $magenet_key = $this->getKey();
 
 
 
 
 
 
 
 
 
 
 
137
  if (isset($_POST['key']) && !empty($_POST['key'])) {
138
  $magenet_key = $_POST['key'];
139
  $test_key = $this->testKey($magenet_key);
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.10
6
  Author: MageNet.com
7
  Author URI: http://magenet.com
8
  */
25
  private $api_host = "http://api.magenet.com";
26
  private $api_get = "/wordpress/get";
27
  private $api_test = "/wordpress/test";
28
+ private $is_active_seo_plugin = false;
29
+ private $key = false;
30
+ private $link_shown = 0;
31
  private $lastError = 0;
32
 
33
  public function MagenetLinkAutoinstall() {
52
  }
53
  }
54
 
55
+ public function getSeoPluginParam() {
56
+ if (!$this->is_active_seo_plugin) {
57
+ $this->is_active_seo_plugin = get_option("magenet_is_active_seo_plugin");
58
+ }
59
+ return $this->is_active_seo_plugin;
60
+ }
61
+ public function setSeoPluginParam($seoparam) {
62
+ update_option("magenet_is_active_seo_plugin", $seoparam);
63
+ $this->is_active_seo_plugin = $seoparam;
64
+ }
65
+
66
+ public function getKey() {
67
  if (!$this->key) {
68
  $this->key = get_option("magenet_links_autoinstall_key");
69
  }
70
  return $this->key;
71
+ }
 
72
  public function setKey($key) {
73
  update_option("magenet_links_autoinstall_key", $key);
74
  $this->key = $key;
126
  }
127
 
128
  public function add_magenet_links($content) {
129
+ global $post;
130
+ $link_count = 1;
131
+ $is_active_plugin = $this->getSeoPluginParam();
132
+ if($is_active_plugin=='on' && $post->post_type == 'page') $link_count = 2;
133
+
134
+ $this->link_shown++;
135
+ if($this->link_shown == $link_count) {
136
  global $wpdb;
137
  $link_data = $this->getLinks();
138
  $content .= '<div class="mads-block">';
142
  }
143
  }
144
  $content .='</div>';
145
+ }
146
+
147
 
148
  return $content;
149
  }
150
+
151
  public function admin_magenet_settings() {
152
  global $wpdb;
153
  $magenet_key = $this->getKey();
154
+ $is_active_seo_plugin = $this->getSeoPluginParam();
155
+ $plugin_result_text = '';
156
+ if(isset($_POST['seoplugin']) && !empty($_POST['seoplugin'])) {
157
+ if (isset($_POST['seoparam']) && !empty($_POST['seoparam'])) {
158
+ $this->setSeoPluginParam($_POST['seoparam']);
159
+ } else {
160
+ $this->setSeoPluginParam('off');
161
+ }
162
+ $is_active_seo_plugin = $this->getSeoPluginParam();
163
+ $plugin_result_text = "<span style=\"color: #009900;\">Saved</span>";
164
+ }
165
  if (isset($_POST['key']) && !empty($_POST['key'])) {
166
  $magenet_key = $_POST['key'];
167
  $test_key = $this->testKey($magenet_key);
readme.txt CHANGED
@@ -84,6 +84,9 @@ 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.8 =
88
  * Fix some bugs and problems
89
  * Plugin optimization
84
  3. "Pages options" menu
85
 
86
  == Changelog ==
87
+ = 1.0.9 =
88
+ * Fix some bugs and problems
89
+
90
  = 1.0.8 =
91
  * Fix some bugs and problems
92
  * Plugin optimization
view-settings.php CHANGED
@@ -2,6 +2,13 @@
2
  <h2>Website Monetization by MageNet</h2>
3
  <p>By installing WordPress plugin, you allow MageNet to display paid contextual ads on pages where where you grant permission via Pages options.</p>
4
  <p>Ad placement and removal process takes 3 hours. Please be patient.</p>
 
 
 
 
 
 
 
5
  <div class="tool-box">
6
  <h2 class="title">MageNet Key:</h2>
7
  <form method="post" action="">
2
  <h2>Website Monetization by MageNet</h2>
3
  <p>By installing WordPress plugin, you allow MageNet to display paid contextual ads on pages where where you grant permission via Pages options.</p>
4
  <p>Ad placement and removal process takes 3 hours. Please be patient.</p>
5
+ <div class="tool-box">
6
+ <form id="form-id" method="post" action="">
7
+ <input type="hidden" name="seoplugin" id="seoplugin" value="1">
8
+ <input type="checkbox" name="seoparam" id="seoparam" onClick="document.getElementById('form-id').submit();" <?php if ($is_active_seo_plugin=='on') echo "CHECKED"; ?> ><span>I have "Wordpress SEO" plugin by Yoast activated on my website. Note: check this box to avoid errors of MageNet Monetization plugin caused by this SEO plugin.</span>
9
+ <?php echo $plugin_result_text; ?>
10
+ </form>
11
+ </div>
12
  <div class="tool-box">
13
  <h2 class="title">MageNet Key:</h2>
14
  <form method="post" action="">