Version Description
Download this release
Release Info
Developer | SEO Design Solutions |
Plugin | SEO Ultimate |
Version | 4.8.1 |
Comparing to | |
See all releases |
Code changes from version 4.8 to 4.8.1
- includes/jlfunctions/str.php +11 -4
- modules/internal-link-aliases/internal-link-aliases.php +25 -6
- modules/titles/titles.php +4 -3
- readme.txt +7 -3
- seo-ultimate.php +4 -4
includes/jlfunctions/str.php
CHANGED
@@ -159,6 +159,7 @@ class sustr {
|
|
159 |
}
|
160 |
|
161 |
function preg_filter($filter, $str) {
|
|
|
162 |
return preg_replace("/[^{$filter}]/", '', $str);
|
163 |
}
|
164 |
|
@@ -170,16 +171,22 @@ class sustr {
|
|
170 |
return $str;
|
171 |
}
|
172 |
|
173 |
-
function htmlsafe_str_replace($search, $replace, $subject, $limit, &$count) {
|
174 |
$search = sustr::preg_escape($search);
|
175 |
-
return sustr::htmlsafe_preg_replace($search, $replace, $subject, $limit, $count);
|
176 |
}
|
177 |
|
178 |
-
function htmlsafe_preg_replace($search, $replace, $subject, $limit, &$count) {
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
|
180 |
//Special thanks to the GPL-licensed "SEO Smart Links" plugin for the following find/replace regex
|
181 |
//http://www.prelovac.com/vladimir/wordpress-plugins/seo-smart-links
|
182 |
-
$reg = '/(?!(?:[^<\[]+[>\]]|[^>\]]+<\/
|
183 |
|
184 |
$search = str_replace('/', '\/', $search);
|
185 |
$search_regex = str_replace('$name', $search, $reg);
|
159 |
}
|
160 |
|
161 |
function preg_filter($filter, $str) {
|
162 |
+
$filter = str_replace('/', '\\/', $filter);
|
163 |
return preg_replace("/[^{$filter}]/", '', $str);
|
164 |
}
|
165 |
|
171 |
return $str;
|
172 |
}
|
173 |
|
174 |
+
function htmlsafe_str_replace($search, $replace, $subject, $limit, &$count, $exclude_tags = false) {
|
175 |
$search = sustr::preg_escape($search);
|
176 |
+
return sustr::htmlsafe_preg_replace($search, $replace, $subject, $limit, $count, $exclude_tags);
|
177 |
}
|
178 |
|
179 |
+
function htmlsafe_preg_replace($search, $replace, $subject, $limit, &$count, $exclude_tags = false) {
|
180 |
+
|
181 |
+
if (!$exclude_tags || !is_array($exclude_tags)) $exclude_tags = array('a', 'pre', 'code', 'kbd');
|
182 |
+
if (count($exclude_tags) > 1)
|
183 |
+
$exclude_tags = '(?:' . sustr::preg_filter('a-z0-9|', implode('|', $exclude_tags)) . ')';
|
184 |
+
else
|
185 |
+
$exclude_tags = array_shift($exclude_tags);
|
186 |
|
187 |
//Special thanks to the GPL-licensed "SEO Smart Links" plugin for the following find/replace regex
|
188 |
//http://www.prelovac.com/vladimir/wordpress-plugins/seo-smart-links
|
189 |
+
$reg = '/(?!(?:[^<\[]+[>\]]|[^>\]]+<\/' . $exclude_tags . '>))\b($name)\b/imsU';
|
190 |
|
191 |
$search = str_replace('/', '\/', $search);
|
192 |
$search_regex = str_replace('$name', $search, $reg);
|
modules/internal-link-aliases/internal-link-aliases.php
CHANGED
@@ -2,23 +2,36 @@
|
|
2 |
|
3 |
class SU_InternalLinkAliases extends SU_Module {
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
function init() {
|
6 |
add_filter('su_custom_update_postmeta-aliases', array(&$this, 'save_post_aliases'), 10, 4);
|
7 |
-
add_filter('the_content', array(&$this, 'apply_aliases'));
|
8 |
add_action('template_redirect', array(&$this, 'redirect_aliases'), 0);
|
9 |
add_action('do_robotstxt', array(&$this, 'block_aliases_dir'));
|
10 |
add_action('su_do_robotstxt', array(&$this, 'block_aliases_dir'));
|
|
|
11 |
}
|
12 |
|
13 |
function get_module_title() { return __('Link Mask Generator', 'seo-ultimate'); }
|
14 |
function get_menu_title() { return false; }
|
15 |
|
|
|
|
|
|
|
|
|
16 |
function postmeta_fields($fields) {
|
17 |
|
18 |
$post = get_post(suwp::get_post_id());
|
19 |
if (!$post) return;
|
20 |
$content = $post->post_content;
|
21 |
|
|
|
|
|
22 |
if ($content && preg_match_all('@ href=["\']([^"\']+)["\']@', $content, $matches)) {
|
23 |
$urls = $matches[1];
|
24 |
|
@@ -40,7 +53,7 @@ class SU_InternalLinkAliases extends SU_Module {
|
|
40 |
$a_url = esc_attr($url);
|
41 |
$ht_url = esc_html(sustr::truncate($url, 30));
|
42 |
$a_alias = esc_attr($post_aliases[$url]);
|
43 |
-
$html .= "<tr><td><a href='$a_url' title='$a_url' target='_blank'>$ht_url</a></td>\n<td>⇒</td><td
|
44 |
}
|
45 |
|
46 |
$html .= "</tbody>\n</table>\n";
|
@@ -75,12 +88,14 @@ class SU_InternalLinkAliases extends SU_Module {
|
|
75 |
$id = suwp::get_post_id();
|
76 |
$aliases = $this->get_setting('aliases', array());
|
77 |
$aliases = array_reverse($aliases, true); //Just in case we have duplicate aliases, make sure the most recent ones are applied first
|
|
|
|
|
78 |
foreach ($aliases as $alias) {
|
79 |
-
$from = $alias['from'];
|
80 |
$to = $alias['to'];
|
81 |
|
82 |
if (in_array($id, $alias['posts']) && $to) {
|
83 |
-
$
|
|
|
84 |
$content = str_replace(array(" href='$from'", " href=\"$from\""), array(" href='$to'", " href=\"$to\""), $content);
|
85 |
}
|
86 |
}
|
@@ -89,9 +104,11 @@ class SU_InternalLinkAliases extends SU_Module {
|
|
89 |
|
90 |
function redirect_aliases() {
|
91 |
$aliases = $this->get_setting('aliases', array());
|
|
|
|
|
92 |
foreach ($aliases as $alias)
|
93 |
if ($to = $alias['to'])
|
94 |
-
if (suurl::current() == get_bloginfo('url') . "
|
95 |
wp_redirect($alias['from']);
|
96 |
}
|
97 |
|
@@ -103,7 +120,9 @@ class SU_InternalLinkAliases extends SU_Module {
|
|
103 |
$urlinfo = parse_url(get_bloginfo('url'));
|
104 |
$path = $urlinfo['path'];
|
105 |
echo "User-agent: *\n";
|
106 |
-
|
|
|
|
|
107 |
|
108 |
echo '# ';
|
109 |
_e('End LAG', 'seo-ultimate');
|
2 |
|
3 |
class SU_InternalLinkAliases extends SU_Module {
|
4 |
|
5 |
+
function get_default_settings() {
|
6 |
+
return array(
|
7 |
+
'alias_dir' => 'go'
|
8 |
+
);
|
9 |
+
}
|
10 |
+
|
11 |
function init() {
|
12 |
add_filter('su_custom_update_postmeta-aliases', array(&$this, 'save_post_aliases'), 10, 4);
|
13 |
+
add_filter('the_content', array(&$this, 'apply_aliases'), 9); //Run before wp_texturize etc.
|
14 |
add_action('template_redirect', array(&$this, 'redirect_aliases'), 0);
|
15 |
add_action('do_robotstxt', array(&$this, 'block_aliases_dir'));
|
16 |
add_action('su_do_robotstxt', array(&$this, 'block_aliases_dir'));
|
17 |
+
add_filter('su_get_setting-internal-link-aliases-alias_dir', array(&$this, 'filter_alias_dir'));
|
18 |
}
|
19 |
|
20 |
function get_module_title() { return __('Link Mask Generator', 'seo-ultimate'); }
|
21 |
function get_menu_title() { return false; }
|
22 |
|
23 |
+
function filter_alias_dir($alias_dir) {
|
24 |
+
return trim(sustr::preg_filter('a-zA-Z0-9_/', $alias_dir), '/');
|
25 |
+
}
|
26 |
+
|
27 |
function postmeta_fields($fields) {
|
28 |
|
29 |
$post = get_post(suwp::get_post_id());
|
30 |
if (!$post) return;
|
31 |
$content = $post->post_content;
|
32 |
|
33 |
+
$alias_dir = $this->get_setting('alias_dir', 'go');
|
34 |
+
|
35 |
if ($content && preg_match_all('@ href=["\']([^"\']+)["\']@', $content, $matches)) {
|
36 |
$urls = $matches[1];
|
37 |
|
53 |
$a_url = esc_attr($url);
|
54 |
$ht_url = esc_html(sustr::truncate($url, 30));
|
55 |
$a_alias = esc_attr($post_aliases[$url]);
|
56 |
+
$html .= "<tr><td><a href='$a_url' title='$a_url' target='_blank'>$ht_url</a></td>\n<td>⇒</td><td>/$alias_dir/<input type='text' name='_su_aliases[$a_url]' value='$a_alias' /></td></tr>\n";
|
57 |
}
|
58 |
|
59 |
$html .= "</tbody>\n</table>\n";
|
88 |
$id = suwp::get_post_id();
|
89 |
$aliases = $this->get_setting('aliases', array());
|
90 |
$aliases = array_reverse($aliases, true); //Just in case we have duplicate aliases, make sure the most recent ones are applied first
|
91 |
+
$alias_dir = $this->get_setting('alias_dir', 'go');
|
92 |
+
|
93 |
foreach ($aliases as $alias) {
|
|
|
94 |
$to = $alias['to'];
|
95 |
|
96 |
if (in_array($id, $alias['posts']) && $to) {
|
97 |
+
$from = $alias['from'];
|
98 |
+
$to = get_bloginfo('url') . "/$alias_dir/$to/";
|
99 |
$content = str_replace(array(" href='$from'", " href=\"$from\""), array(" href='$to'", " href=\"$to\""), $content);
|
100 |
}
|
101 |
}
|
104 |
|
105 |
function redirect_aliases() {
|
106 |
$aliases = $this->get_setting('aliases', array());
|
107 |
+
$alias_dir = $this->get_setting('alias_dir', 'go');
|
108 |
+
|
109 |
foreach ($aliases as $alias)
|
110 |
if ($to = $alias['to'])
|
111 |
+
if (suurl::current() == get_bloginfo('url') . "/$alias_dir/$to/")
|
112 |
wp_redirect($alias['from']);
|
113 |
}
|
114 |
|
120 |
$urlinfo = parse_url(get_bloginfo('url'));
|
121 |
$path = $urlinfo['path'];
|
122 |
echo "User-agent: *\n";
|
123 |
+
|
124 |
+
$alias_dir = $this->get_setting('alias_dir', 'go');
|
125 |
+
echo "Disallow: $path/$alias_dir/\n";
|
126 |
|
127 |
echo '# ';
|
128 |
_e('End LAG', 'seo-ultimate');
|
modules/titles/titles.php
CHANGED
@@ -130,12 +130,9 @@ class SU_Titles extends SU_Module {
|
|
130 |
}
|
131 |
|
132 |
function get_title() {
|
133 |
-
if (!$this->should_rewrite_title()) return '';
|
134 |
|
135 |
global $wp_query, $wp_locale;
|
136 |
|
137 |
-
$format = $this->get_title_format();
|
138 |
-
|
139 |
//Custom post/page title?
|
140 |
if ($post_title = $this->get_postmeta('title'))
|
141 |
return htmlspecialchars($this->get_title_paged($post_title));
|
@@ -147,6 +144,10 @@ class SU_Titles extends SU_Module {
|
|
147 |
return htmlspecialchars($tax_title);
|
148 |
}
|
149 |
|
|
|
|
|
|
|
|
|
150 |
//Load post/page titles
|
151 |
$post_id = 0;
|
152 |
$post_title = '';
|
130 |
}
|
131 |
|
132 |
function get_title() {
|
|
|
133 |
|
134 |
global $wp_query, $wp_locale;
|
135 |
|
|
|
|
|
136 |
//Custom post/page title?
|
137 |
if ($post_title = $this->get_postmeta('title'))
|
138 |
return htmlspecialchars($this->get_title_paged($post_title));
|
144 |
return htmlspecialchars($tax_title);
|
145 |
}
|
146 |
|
147 |
+
//Get format
|
148 |
+
if (!$this->should_rewrite_title()) return '';
|
149 |
+
$format = $this->get_title_format();
|
150 |
+
|
151 |
//Load post/page titles
|
152 |
$post_id = 0;
|
153 |
$post_title = '';
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: SEO Design Solutions
|
3 |
Tags: seo, SEO Ultimate, suite, google, yahoo, bing, search engines, admin, post, page, custom post types, categories, tags, terms, custom taxonomies, title, meta, robots, noindex, nofollow, canonical, 404, robots.txt, htaccess, slugs, url, anchor, more, link, excerpt, permalink, links, autolinks, code, footer, modules, uninstallable, reinstallable, downgradable, import, export, CSV, affiliate
|
4 |
Requires at least: 2.8
|
5 |
-
Tested up to: 3.
|
6 |
-
Stable tag: 4.8
|
7 |
|
8 |
This all-in-one SEO plugin gives you control over title tags, noindex, meta tags, slugs, canonical, autolinks, 404 errors, rich snippets, and more.
|
9 |
|
@@ -15,7 +15,6 @@ This all-in-one SEO plugin gives you control over title tags, noindex, meta tags
|
|
15 |
* Version 4.7 adds the Link Mask Generator module
|
16 |
* Version 4.6 adds a meta keywords mass-editor
|
17 |
* Version 4.5 adds bugfixes
|
18 |
-
* Version 4.4 adds a new field for entering sitewide meta keywords
|
19 |
|
20 |
= Features =
|
21 |
|
@@ -224,6 +223,11 @@ Frequently asked questions, settings help, and troubleshooting tips for SEO Ulti
|
|
224 |
|
225 |
== Changelog ==
|
226 |
|
|
|
|
|
|
|
|
|
|
|
227 |
= Version 4.8 (February 7, 2011) =
|
228 |
* Feature: Deeplink Juggernaut now lets you limit the number of times per post the same anchor text is linked
|
229 |
* Feature: Deeplink Juggernaut now lets you toggle whether posts can link to themselves
|
2 |
Contributors: SEO Design Solutions
|
3 |
Tags: seo, SEO Ultimate, suite, google, yahoo, bing, search engines, admin, post, page, custom post types, categories, tags, terms, custom taxonomies, title, meta, robots, noindex, nofollow, canonical, 404, robots.txt, htaccess, slugs, url, anchor, more, link, excerpt, permalink, links, autolinks, code, footer, modules, uninstallable, reinstallable, downgradable, import, export, CSV, affiliate
|
4 |
Requires at least: 2.8
|
5 |
+
Tested up to: 3.1
|
6 |
+
Stable tag: 4.8.1
|
7 |
|
8 |
This all-in-one SEO plugin gives you control over title tags, noindex, meta tags, slugs, canonical, autolinks, 404 errors, rich snippets, and more.
|
9 |
|
15 |
* Version 4.7 adds the Link Mask Generator module
|
16 |
* Version 4.6 adds a meta keywords mass-editor
|
17 |
* Version 4.5 adds bugfixes
|
|
|
18 |
|
19 |
= Features =
|
20 |
|
223 |
|
224 |
== Changelog ==
|
225 |
|
226 |
+
= Version 4.8.1 (March 1, 2011) =
|
227 |
+
* Improvement: Deeplink Juggernaut no longer inserts links within `<code>`, `<pre>`, and `<kbd>` elements
|
228 |
+
* Bugfix: Link Mask Generator can now properly mask URLs with ampersands
|
229 |
+
* Bugfix: Title Tag Rewriter now properly rewrites custom taxonomy term pages
|
230 |
+
|
231 |
= Version 4.8 (February 7, 2011) =
|
232 |
* Feature: Deeplink Juggernaut now lets you limit the number of times per post the same anchor text is linked
|
233 |
* Feature: Deeplink Juggernaut now lets you toggle whether posts can link to themselves
|
seo-ultimate.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: SEO Ultimate
|
4 |
Plugin URI: http://www.seodesignsolutions.com/wordpress-seo/
|
5 |
Description: This all-in-one SEO plugin gives you control over title tags, noindex/nofollow, meta tags, rich snippets, slugs, canonical tags, autolinks, 404 errors, rich snippets, and more.
|
6 |
-
Version: 4.8
|
7 |
Author: SEO Design Solutions
|
8 |
Author URI: http://www.seodesignsolutions.com/
|
9 |
Text Domain: seo-ultimate
|
@@ -12,7 +12,7 @@ Text Domain: seo-ultimate
|
|
12 |
/**
|
13 |
* The main SEO Ultimate plugin file.
|
14 |
* @package SeoUltimate
|
15 |
-
* @version 4.8
|
16 |
* @link http://www.seodesignsolutions.com/wordpress-seo/ SEO Ultimate Homepage
|
17 |
*/
|
18 |
|
@@ -47,10 +47,10 @@ define('SU_MINIMUM_WP_VER', '2.8');
|
|
47 |
//Reading plugin info from constants is faster than trying to parse it from the header above.
|
48 |
define('SU_PLUGIN_NAME', 'SEO Ultimate');
|
49 |
define('SU_PLUGIN_URI', 'http://www.seodesignsolutions.com/wordpress-seo/');
|
50 |
-
define('SU_VERSION', '4.8');
|
51 |
define('SU_AUTHOR', 'SEO Design Solutions');
|
52 |
define('SU_AUTHOR_URI', 'http://www.seodesignsolutions.com/');
|
53 |
-
define('SU_USER_AGENT', 'SeoUltimate/4.8');
|
54 |
|
55 |
/********** INCLUDES **********/
|
56 |
|
3 |
Plugin Name: SEO Ultimate
|
4 |
Plugin URI: http://www.seodesignsolutions.com/wordpress-seo/
|
5 |
Description: This all-in-one SEO plugin gives you control over title tags, noindex/nofollow, meta tags, rich snippets, slugs, canonical tags, autolinks, 404 errors, rich snippets, and more.
|
6 |
+
Version: 4.8.1
|
7 |
Author: SEO Design Solutions
|
8 |
Author URI: http://www.seodesignsolutions.com/
|
9 |
Text Domain: seo-ultimate
|
12 |
/**
|
13 |
* The main SEO Ultimate plugin file.
|
14 |
* @package SeoUltimate
|
15 |
+
* @version 4.8.1
|
16 |
* @link http://www.seodesignsolutions.com/wordpress-seo/ SEO Ultimate Homepage
|
17 |
*/
|
18 |
|
47 |
//Reading plugin info from constants is faster than trying to parse it from the header above.
|
48 |
define('SU_PLUGIN_NAME', 'SEO Ultimate');
|
49 |
define('SU_PLUGIN_URI', 'http://www.seodesignsolutions.com/wordpress-seo/');
|
50 |
+
define('SU_VERSION', '4.8.1');
|
51 |
define('SU_AUTHOR', 'SEO Design Solutions');
|
52 |
define('SU_AUTHOR_URI', 'http://www.seodesignsolutions.com/');
|
53 |
+
define('SU_USER_AGENT', 'SeoUltimate/4.8.1');
|
54 |
|
55 |
/********** INCLUDES **********/
|
56 |
|