SEO Smart Links - Version 2.7.5

Version Description

  • Load Custom keywords periodically from a URL (thanks to Luke Crouch)
Download this release

Release Info

Developer freediver
Plugin Icon 128x128 SEO Smart Links
Version 2.7.5
Comparing to
See all releases

Code changes from version 2.7.4 to 2.7.5

Files changed (2) hide show
  1. readme.txt +4 -1
  2. seo-links.php +28 -4
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: freediver
3
  Donate link: https://www.networkforgood.org/donation/MakeDonation.aspx?ORGID2=520781390
4
  Tags: Post, posts, comments, links, seo, google, automatic, affiliate
5
  Requires at least: 2.3
6
- Tested up to: 3.3
7
  Stable tag: trunk
8
 
9
  SEO Smart Links provides automatic SEO benefits for your site in addition to custom keyword lists, nofollow and much more.
@@ -27,6 +27,9 @@ Plugin by Vladimir Prelovac, a <a href="http://www.prelovac.com/vladimir/service
27
 
28
  == Changelog ==
29
 
 
 
 
30
  = 2.7.3 =
31
  * Fixed a few bugs
32
 
3
  Donate link: https://www.networkforgood.org/donation/MakeDonation.aspx?ORGID2=520781390
4
  Tags: Post, posts, comments, links, seo, google, automatic, affiliate
5
  Requires at least: 2.3
6
+ Tested up to: 3.4.1
7
  Stable tag: trunk
8
 
9
  SEO Smart Links provides automatic SEO benefits for your site in addition to custom keyword lists, nofollow and much more.
27
 
28
  == Changelog ==
29
 
30
+ = 2.7.5 =
31
+ * Load Custom keywords periodically from a URL (thanks to Luke Crouch)
32
+
33
  = 2.7.3 =
34
  * Fixed a few bugs
35
 
seo-links.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  /*
4
  Plugin Name: SEO Smart Links
5
- Version: 2.7.4
6
  Plugin URI: http://www.prelovac.com/vladimir/wordpress-plugins/seo-smart-links
7
  Author: Vladimir Prelovac
8
  Author URI: http://www.prelovac.com/vladimir
@@ -116,6 +116,22 @@ function SEOLinks_process_text($text, $mode)
116
 
117
  $text = " $text ";
118
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  // custom keywords
120
  if (!empty($options['customkey']))
121
  {
@@ -127,7 +143,7 @@ function SEOLinks_process_text($text, $mode)
127
 
128
 
129
  if($options['customkey_preventduplicatelink'] == TRUE) { //Prevent duplicate links for grouped custom keywords
130
-
131
  $line = trim($line);
132
  $lastDelimiterPos=strrpos($line, ',');
133
  $url = substr($line, $lastDelimiterPos + 1 );
@@ -371,6 +387,9 @@ function SEOLinks_comment_text_filter($text) {
371
  'minusage' => 1,
372
  'customkey' => '',
373
  'customkey_preventduplicatelink' => FALSE,
 
 
 
374
  'nofoln' =>'',
375
  'nofolo' =>'',
376
  'blankn' =>'',
@@ -439,6 +458,7 @@ function SEOLinks_comment_text_filter($text) {
439
  $options['maxsingleurl']=(int) $_POST['maxsingleurl'];
440
  $options['minusage']=(int) $_POST['minusage']; // credit to Dominik Deobald
441
  $options['customkey']=$_POST['customkey'];
 
442
  $options['customkey_preventduplicatelink']=$_POST['customkey_preventduplicatelink'];
443
  $options['nofoln']=$_POST['nofoln'];
444
  $options['nofolo']=$_POST['nofolo'];
@@ -476,6 +496,7 @@ function SEOLinks_comment_text_filter($text) {
476
  $maxsingleurl=$options['maxsingleurl'];
477
  $minusage=$options['minusage'];
478
  $customkey=stripslashes($options['customkey']);
 
479
  $customkey_preventduplicatelink=$options['customkey_preventduplicatelink'] == TRUE ? 'checked' : '';
480
  $nofoln=$options['nofoln']=='on'?'checked':'';
481
  $nofolo=$options['nofolo']=='on'?'checked':'';
@@ -566,9 +587,12 @@ function SEOLinks_comment_text_filter($text) {
566
  </p>
567
 
568
  <input type="checkbox" name="customkey_preventduplicatelink" $customkey_preventduplicatelink /><label for="customkey_preventduplicatelink"> Prevent Duplicate links for grouped keywords (will link only first of the keywords found in text)</label> <br>
569
-
570
  <textarea name="customkey" id="customkey" rows="10" cols="90" >$customkey</textarea>
571
  <br><br>
 
 
 
572
 
573
  <h4>Limits</h4>
574
  <p>You can limit the maximum number of different links SEO Smart Links will generate per post. Set to 0 for no limit. </p>
@@ -649,4 +673,4 @@ function str2arr($str) {
649
  }
650
  return $chararray;
651
  }
652
- ?>
2
 
3
  /*
4
  Plugin Name: SEO Smart Links
5
+ Version: 2.7.5
6
  Plugin URI: http://www.prelovac.com/vladimir/wordpress-plugins/seo-smart-links
7
  Author: Vladimir Prelovac
8
  Author URI: http://www.prelovac.com/vladimir
116
 
117
  $text = " $text ";
118
 
119
+ if (!empty($options['customkey_url']))
120
+ {
121
+ $now = time();
122
+ if ($options['customkey_url_datetime']){
123
+ $last_update = $options['customkey_url_datetime'];
124
+ } else {
125
+ $last_update = 0;
126
+ }
127
+ if ($now - $last_update > 86400) {
128
+ $body = wp_remote_retrieve_body(wp_remote_get($options['customkey_url']));
129
+ $options['customkey_url_value'] = strip_tags($body);
130
+ $options['customkey_url_datetime'] = $now;
131
+ update_option($this->SEOLinks_DB_option, $options);
132
+ }
133
+ $options['customkey'] = $options['customkey'] . "\n" . $options['customkey_url_value'];
134
+ }
135
  // custom keywords
136
  if (!empty($options['customkey']))
137
  {
143
 
144
 
145
  if($options['customkey_preventduplicatelink'] == TRUE) { //Prevent duplicate links for grouped custom keywords
146
+
147
  $line = trim($line);
148
  $lastDelimiterPos=strrpos($line, ',');
149
  $url = substr($line, $lastDelimiterPos + 1 );
387
  'minusage' => 1,
388
  'customkey' => '',
389
  'customkey_preventduplicatelink' => FALSE,
390
+ 'customkey_url' => '',
391
+ 'customkey_url_value' => '',
392
+ 'customkey_url_datetime' => '',
393
  'nofoln' =>'',
394
  'nofolo' =>'',
395
  'blankn' =>'',
458
  $options['maxsingleurl']=(int) $_POST['maxsingleurl'];
459
  $options['minusage']=(int) $_POST['minusage']; // credit to Dominik Deobald
460
  $options['customkey']=$_POST['customkey'];
461
+ $options['customkey_url']=$_POST['customkey_url'];
462
  $options['customkey_preventduplicatelink']=$_POST['customkey_preventduplicatelink'];
463
  $options['nofoln']=$_POST['nofoln'];
464
  $options['nofolo']=$_POST['nofolo'];
496
  $maxsingleurl=$options['maxsingleurl'];
497
  $minusage=$options['minusage'];
498
  $customkey=stripslashes($options['customkey']);
499
+ $customkey_url=stripslashes($options['customkey_url']);
500
  $customkey_preventduplicatelink=$options['customkey_preventduplicatelink'] == TRUE ? 'checked' : '';
501
  $nofoln=$options['nofoln']=='on'?'checked':'';
502
  $nofolo=$options['nofolo']=='on'?'checked':'';
587
  </p>
588
 
589
  <input type="checkbox" name="customkey_preventduplicatelink" $customkey_preventduplicatelink /><label for="customkey_preventduplicatelink"> Prevent Duplicate links for grouped keywords (will link only first of the keywords found in text)</label> <br>
590
+
591
  <textarea name="customkey" id="customkey" rows="10" cols="90" >$customkey</textarea>
592
  <br><br>
593
+
594
+ <p>Load custom keywords from a URL. (Note: this appends to the list above.)</p>
595
+ <input type="text" name="customkey_url" size="90" value="$customkey_url" />
596
 
597
  <h4>Limits</h4>
598
  <p>You can limit the maximum number of different links SEO Smart Links will generate per post. Set to 0 for no limit. </p>
673
  }
674
  return $chararray;
675
  }
676
+ ?>