SEO Smart Links - Version 1.1

Version Description

Download this release

Release Info

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

Code changes from version 1.0 to 1.1

Files changed (2) hide show
  1. readme.txt +4 -1
  2. seo-links.php +7 -7
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.networkforgood.org/donation/MakeDonation.aspx?ORGID2=52
4
  Tags: Post, posts, comments, links, seo, google, automatic
5
  Requires at least: 2.3
6
  Tested up to: 2.5.1
7
- Stable tag: 1.0
8
 
9
  SEO Smart Links can automatically link keywords and phrases in your posts and comments with corresponding posts, pages, categories and tags.
10
 
@@ -18,6 +18,9 @@ It also give your visitors an opportunity to visit other sections of your site t
18
 
19
  Everything happens completely transparent, and you can edit the options from the administration settings panel.
20
 
 
 
 
21
  v1.0:
22
  - Initial release
23
 
4
  Tags: Post, posts, comments, links, seo, google, automatic
5
  Requires at least: 2.3
6
  Tested up to: 2.5.1
7
+ Stable tag: trunk
8
 
9
  SEO Smart Links can automatically link keywords and phrases in your posts and comments with corresponding posts, pages, categories and tags.
10
 
18
 
19
  Everything happens completely transparent, and you can edit the options from the administration settings panel.
20
 
21
+ v1.1:
22
+ - Fixed preg_replace() problem
23
+
24
  v1.0:
25
  - Initial release
26
 
seo-links.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  /*
4
  Plugin Name: SEO Smart Links
5
- Version: 1.0
6
  Plugin URI: http://www.prelovac.com/vladimir/wordpress-plugins/seo-smart-links
7
  Author: Vladimir Prelovac
8
  Author URI: http://www.prelovac.com
@@ -68,13 +68,13 @@ if ($options['lposts'] || $options['lpages'])
68
 
69
  foreach ($posts as $postitem)
70
  {
71
- $name = $postitem->post_title;
72
 
73
  if (!in_array( strtolower($name), $arrignore))
74
  if ( ($options['lposts'] && $postitem->post_type=='post') || ($options['lpages'] && $postitem->post_type=='page') )
75
  {
76
 
77
- $url = get_permalink($postitem->ID);
78
 
79
  $regexp="/(?!(?:[^<]+>|[^>]+<\/a>))\b($name)\b/imsU";
80
  $replace="<a href=\"$url\">$1</a>";
@@ -89,10 +89,10 @@ if ($options['lcats'])
89
  $categories = $wpdb->get_results($query);
90
  foreach ($categories as $cat)
91
  {
92
- $name= $cat->name;
93
  if (!in_array( strtolower($name), $arrignore))
94
  {
95
- $url = get_category_link($cat->term_id);
96
  $regexp="/(?!(?:[^<]+>|[^>]+<\/a>))\b($name)\b/imsU";
97
  $replace="<a href=\"$url\">$1</a>";
98
  $text = preg_replace($regexp, $replace, $text);
@@ -107,10 +107,10 @@ if ($options['ltags'])
107
  $tags = $wpdb->get_results($query);
108
  foreach ($tags as $tag)
109
  {
110
- $name = $tag->name;
111
  if (!in_array( strtolower($name), $arrignore))
112
  {
113
- $url = get_tag_link($tag->term_id);
114
  $regexp="/(?!(?:[^<]+>|[^>]+<\/a>))\b($name)\b/imsU";
115
  $replace="<a href=\"$url\">$1</a>";
116
  $text = preg_replace($regexp, $replace, $text);
2
 
3
  /*
4
  Plugin Name: SEO Smart Links
5
+ Version: 1.1
6
  Plugin URI: http://www.prelovac.com/vladimir/wordpress-plugins/seo-smart-links
7
  Author: Vladimir Prelovac
8
  Author URI: http://www.prelovac.com
68
 
69
  foreach ($posts as $postitem)
70
  {
71
+ $name = preg_quote($postitem->post_title, '/');
72
 
73
  if (!in_array( strtolower($name), $arrignore))
74
  if ( ($options['lposts'] && $postitem->post_type=='post') || ($options['lpages'] && $postitem->post_type=='page') )
75
  {
76
 
77
+ $url = (get_permalink($postitem->ID));
78
 
79
  $regexp="/(?!(?:[^<]+>|[^>]+<\/a>))\b($name)\b/imsU";
80
  $replace="<a href=\"$url\">$1</a>";
89
  $categories = $wpdb->get_results($query);
90
  foreach ($categories as $cat)
91
  {
92
+ $name= preg_quote($cat->name, '/');
93
  if (!in_array( strtolower($name), $arrignore))
94
  {
95
+ $url = (get_category_link($cat->term_id));
96
  $regexp="/(?!(?:[^<]+>|[^>]+<\/a>))\b($name)\b/imsU";
97
  $replace="<a href=\"$url\">$1</a>";
98
  $text = preg_replace($regexp, $replace, $text);
107
  $tags = $wpdb->get_results($query);
108
  foreach ($tags as $tag)
109
  {
110
+ $name = preg_quote($tag->name, '/');
111
  if (!in_array( strtolower($name), $arrignore))
112
  {
113
+ $url = (get_tag_link($tag->term_id));
114
  $regexp="/(?!(?:[^<]+>|[^>]+<\/a>))\b($name)\b/imsU";
115
  $replace="<a href=\"$url\">$1</a>";
116
  $text = preg_replace($regexp, $replace, $text);