SEO Ultimate - Version 2.8

Version Description

Download this release

Release Info

Developer SEO Design Solutions
Plugin Icon 128x128 SEO Ultimate
Version 2.8
Comparing to
See all releases

Code changes from version 2.7 to 2.8

includes/jlfunctions/arr.php CHANGED
@@ -45,6 +45,33 @@ class suarr {
45
  unset($array[$index]);
46
  }
47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  //Based on recursive array search function from:
49
  //http://www.php.net/manual/en/function.array-search.php#91365
50
  function search_recursive($needle, $haystack) {
@@ -60,10 +87,24 @@ class suarr {
60
  uksort($arr, create_function('$a,$b', 'return strlen($b["'.$valuekey.'"]) - strlen($a["'.$valuekey.'"]);'));
61
  }
62
 
63
- function flatten_values($arr, $value_key = 0) {
 
 
 
 
 
 
64
  if (!is_array($arr) || !count($arr)) return array();
65
  $newarr = array();
66
- foreach ($arr as $key => $array_value) $newarr[$key] = $array_value[$value_key];
 
 
 
 
 
 
 
 
67
  return $newarr;
68
  }
69
  }
45
  unset($array[$index]);
46
  }
47
 
48
+ /**
49
+ * Returns whether or not any of the specified $needles are in the $haystack.
50
+ *
51
+ * @param array $needles
52
+ * @param array $haystack
53
+ * @param bool $ci Whether or not the search should be case-insensitive.
54
+ *
55
+ * @return bool
56
+ */
57
+ function any_in_array($needles, $haystack, $ci = false) {
58
+ if ($ci) {
59
+ array_walk($needles, 'strtolower');
60
+ array_walk($haystack, 'strtolower');
61
+ }
62
+
63
+ foreach ($needles as $needle)
64
+ if (in_array($needle, $haystack)) return true;
65
+
66
+ return false;
67
+ }
68
+
69
+ function explode_lines($lines) {
70
+ $lines = explode("\n", $lines);
71
+ array_walk($lines, 'trim'); //Remove any /r's
72
+ return $lines;
73
+ }
74
+
75
  //Based on recursive array search function from:
76
  //http://www.php.net/manual/en/function.array-search.php#91365
77
  function search_recursive($needle, $haystack) {
87
  uksort($arr, create_function('$a,$b', 'return strlen($b["'.$valuekey.'"]) - strlen($a["'.$valuekey.'"]);'));
88
  }
89
 
90
+ function flatten_values($arr, $value_keys) {
91
+ foreach ((array)$value_keys as $key)
92
+ $arr = suarr::_flatten_values($arr, $key);
93
+ return $arr;
94
+ }
95
+
96
+ function _flatten_values($arr, $value_key = 0) {
97
  if (!is_array($arr) || !count($arr)) return array();
98
  $newarr = array();
99
+ foreach ($arr as $key => $array_value) {
100
+ if (is_array($array_value)) {
101
+ if (isset($array_value[$value_key]))
102
+ $newarr[$key] = $array_value[$value_key];
103
+ } elseif (is_object($array_value)) {
104
+ if (isset($array_value->$value_key))
105
+ $newarr[$key] = $array_value->$value_key;
106
+ }
107
+ }
108
  return $newarr;
109
  }
110
  }
modules/titles/titles-posts.php CHANGED
@@ -16,16 +16,22 @@ class SU_TitlesPosts extends SU_Module {
16
  function get_module_title() { return __('Post Title Editor', 'seo-ultimate'); }
17
 
18
  function get_admin_page_tabs() {
19
-
20
- $type_keys = array('post', 'page');
21
 
22
- $type_labels = array(
23
- 'post' => __('Posts')
24
- , 'page' => __('Pages')
25
- , 'attachment' => __('Attachments')
26
- );
 
 
 
 
 
 
 
 
27
 
28
- return $this->parent_module->get_object_subtype_tabs('post', $type_keys, $type_labels, array(&$this, 'admin_page_tab'));
29
  }
30
 
31
  function admin_page_tab($post_type) {
16
  function get_module_title() { return __('Post Title Editor', 'seo-ultimate'); }
17
 
18
  function get_admin_page_tabs() {
 
 
19
 
20
+ $types = array();
21
+
22
+ //Custom post type support - requires WordPress 3.0 or above (won't work with 2.9 custom post types)
23
+ if (function_exists('get_post_types'))
24
+ $types = suarr::flatten_values(get_post_types(array('public' => true), 'objects'), array('labels', 'name'));
25
+
26
+ //Legacy support for WordPress 2.9 and below
27
+ if (!$types)
28
+ $types = array(
29
+ 'post' => __('Posts')
30
+ , 'page' => __('Pages')
31
+ , 'attachment' => __('Attachments')
32
+ );
33
 
34
+ return $this->parent_module->get_object_subtype_tabs('post', array_keys($types), array_values($types), array(&$this, 'admin_page_tab'));
35
  }
36
 
37
  function admin_page_tab($post_type) {
modules/titles/titles.php CHANGED
@@ -274,7 +274,8 @@ class SU_Titles extends SU_Module {
274
 
275
  function get_id_from_settings_key($key) {
276
  $matches = array();
277
- if (preg_match('/([a-z]+)_([0-9]+)_([a-z]+)/', $key, $matches))
 
278
  return (int)$matches[2];
279
 
280
  return false;
@@ -343,17 +344,6 @@ class SU_Titles extends SU_Module {
343
 
344
  $headers = array( __('ID'), __('Name'), __('Title Tag', 'seo-ultimate') );
345
 
346
- echo <<<STR
347
- <table class="widefat fullwidth" cellspacing="0">
348
- <thead><tr>
349
- <!--<th scope="col" class="$object_type-id">{$headers[0]}</th>-->
350
- <th scope="col" class="$object_type-title">{$headers[1]}</th>
351
- <th scope="col" class="$object_type-title-tag">{$headers[2]}</th>
352
- </tr></thead>
353
- <tbody>
354
-
355
- STR;
356
-
357
  /*if (strlen($num_varname) && strlen($offset_varname))
358
  $args = "$num_varname=20&$offset_varname=0";
359
  else
@@ -368,6 +358,22 @@ STR;
368
  $objects = call_user_func_array($function, $args);
369
  //$pagination_total = ceil(count($function()) / 2);
370
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
371
  foreach ($objects as $object) {
372
  $id = $object->$id_varname;
373
  $editlink = call_user_func($edit_link_function, $id, $object_type);
@@ -378,7 +384,8 @@ STR;
378
  }
379
 
380
  echo "\t</tbody>\n</table>\n";
381
-
 
382
  }
383
 
384
  function get_object_subtype_tabs($type, $keys, $labels, $callback) {
274
 
275
  function get_id_from_settings_key($key) {
276
  $matches = array();
277
+ //Custom post/taxonomy types must have alphanumeric names, or else this won't work
278
+ if (preg_match('/([a-z0-9]+)_([0-9]+)_([a-z]+)/', $key, $matches))
279
  return (int)$matches[2];
280
 
281
  return false;
344
 
345
  $headers = array( __('ID'), __('Name'), __('Title Tag', 'seo-ultimate') );
346
 
 
 
 
 
 
 
 
 
 
 
 
347
  /*if (strlen($num_varname) && strlen($offset_varname))
348
  $args = "$num_varname=20&$offset_varname=0";
349
  else
358
  $objects = call_user_func_array($function, $args);
359
  //$pagination_total = ceil(count($function()) / 2);
360
 
361
+ if (!count($objects)) {
362
+ $this->print_message('info', __('Your site currently doesn&#8217;t have any public items of this type.', 'seo-ultimate'));
363
+ return false;
364
+ }
365
+
366
+ echo <<<STR
367
+ <table class="widefat fullwidth" cellspacing="0">
368
+ <thead><tr>
369
+ <!--<th scope="col" class="$object_type-id">{$headers[0]}</th>-->
370
+ <th scope="col" class="$object_type-title">{$headers[1]}</th>
371
+ <th scope="col" class="$object_type-title-tag">{$headers[2]}</th>
372
+ </tr></thead>
373
+ <tbody>
374
+
375
+ STR;
376
+
377
  foreach ($objects as $object) {
378
  $id = $object->$id_varname;
379
  $editlink = call_user_func($edit_link_function, $id, $object_type);
384
  }
385
 
386
  echo "\t</tbody>\n</table>\n";
387
+
388
+ return true;
389
  }
390
 
391
  function get_object_subtype_tabs($type, $keys, $labels, $callback) {
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: SEO Design Solutions
3
  Tags: seo, google, yahoo, bing, search engines, admin, post, page, custom post types, modules, title, meta, robots, noindex, nofollow, canonical, 404, robots.txt, htaccess, slugs, url, anchor, more, link, excerpt, permalink, links, autolinks, code, footer, categories, uninstallable, reinstallable, downgradable
4
  Requires at least: 2.8
5
  Tested up to: 3.0
6
- Stable tag: 2.7
7
 
8
  This all-in-one SEO plugin gives you control over titles, noindex/nofollow, meta tags, slugs, canonical tags, "more" links, 404 errors, and more.
9
 
@@ -11,19 +11,19 @@ This all-in-one SEO plugin gives you control over titles, noindex/nofollow, meta
11
 
12
  = Recent Releases =
13
 
 
14
  * Version 2.7 adds the Code Inserter module
15
  * Version 2.6 adds reinstallation support
16
  * Version 2.5 adds advanced plugin upgrade/downgrade functionality
17
  * Version 2.4 adds a nofollow option for Deeplink Juggernaut links
18
- * Version 2.3 adds per-post noindex/nofollow toggles
19
 
20
  = Features =
21
 
22
  SEO Ultimate is an all-in-one [SEO](http://www.seodesignsolutions.com/) plugin with these powerful features:
23
 
24
- * **Title Rewriter**
25
  * Out-of-the-box functionality puts your post titles at the beginning of the `<title>` tag for improved keyword SEO.
26
- * Easily override the entire `<title>` tag contents for any individual post, page, attachment, category, or post tag on your blog.
27
  * Customize your homepage's `<title>` tag.
28
  * Format the `<title>` tags of posts, pages, categories, tags, archives, search results, and more!
29
 
@@ -192,7 +192,12 @@ Frequently asked questions, settings help, and troubleshooting tips for SEO Ulti
192
 
193
  == Changelog ==
194
 
195
- = Version 2.7 (June 5, 2010) =
 
 
 
 
 
196
  * Feature: Added Code Inserter module
197
  * Change: Meta Editor's "Custom HTML Code" field is now the "`<head>` Tag" field in the new Code Inserter module
198
 
3
  Tags: seo, google, yahoo, bing, search engines, admin, post, page, custom post types, modules, title, meta, robots, noindex, nofollow, canonical, 404, robots.txt, htaccess, slugs, url, anchor, more, link, excerpt, permalink, links, autolinks, code, footer, categories, uninstallable, reinstallable, downgradable
4
  Requires at least: 2.8
5
  Tested up to: 3.0
6
+ Stable tag: 2.8
7
 
8
  This all-in-one SEO plugin gives you control over titles, noindex/nofollow, meta tags, slugs, canonical tags, "more" links, 404 errors, and more.
9
 
11
 
12
  = Recent Releases =
13
 
14
+ * Version 2.8 adds custom post type editor to Title Rewriter
15
  * Version 2.7 adds the Code Inserter module
16
  * Version 2.6 adds reinstallation support
17
  * Version 2.5 adds advanced plugin upgrade/downgrade functionality
18
  * Version 2.4 adds a nofollow option for Deeplink Juggernaut links
 
19
 
20
  = Features =
21
 
22
  SEO Ultimate is an all-in-one [SEO](http://www.seodesignsolutions.com/) plugin with these powerful features:
23
 
24
+ * **Title Rewriter** -- UPDATED in Version 2.8
25
  * Out-of-the-box functionality puts your post titles at the beginning of the `<title>` tag for improved keyword SEO.
26
+ * Easily override the entire `<title>` tag contents for any individual post, page, attachment, category, or post tag on your blog. Also supports custom post types.
27
  * Customize your homepage's `<title>` tag.
28
  * Format the `<title>` tags of posts, pages, categories, tags, archives, search results, and more!
29
 
192
 
193
  == Changelog ==
194
 
195
+ = Version 2.8 (June 8, 2010) =
196
+ * Feature: Title Rewriter now adds mass-editor tabs for custom post types
197
+ * Feature: Title Rewriter can now edit the title tags of attachments
198
+ * Improvement: Title Rewriter's mass-editors no longer display an empty table when no items of a particular type exist
199
+
200
+ = Version 2.7 (June 4, 2010) =
201
  * Feature: Added Code Inserter module
202
  * Change: Meta Editor's "Custom HTML Code" field is now the "`<head>` Tag" field in the new Code Inserter module
203
 
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, slugs, canonical tags, "more" links, 404 errors, and more.
6
- Version: 2.7
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 2.7
16
  * @link http://www.seodesignsolutions.com/wordpress-seo/ SEO Ultimate Homepage
17
  */
18
 
@@ -38,10 +38,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
38
  //Reading plugin info from constants is faster than trying to parse it from the header above.
39
  define("SU_PLUGIN_NAME", "SEO Ultimate");
40
  define("SU_PLUGIN_URI", "http://www.seodesignsolutions.com/wordpress-seo/");
41
- define("SU_VERSION", "2.7");
42
  define("SU_AUTHOR", "SEO Design Solutions");
43
  define("SU_AUTHOR_URI", "http://www.seodesignsolutions.com/");
44
- define("SU_USER_AGENT", "SeoUltimate/2.7");
45
 
46
  /********** INCLUDES **********/
47
 
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, slugs, canonical tags, "more" links, 404 errors, and more.
6
+ Version: 2.8
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 2.8
16
  * @link http://www.seodesignsolutions.com/wordpress-seo/ SEO Ultimate Homepage
17
  */
18
 
38
  //Reading plugin info from constants is faster than trying to parse it from the header above.
39
  define("SU_PLUGIN_NAME", "SEO Ultimate");
40
  define("SU_PLUGIN_URI", "http://www.seodesignsolutions.com/wordpress-seo/");
41
+ define("SU_VERSION", "2.8");
42
  define("SU_AUTHOR", "SEO Design Solutions");
43
  define("SU_AUTHOR_URI", "http://www.seodesignsolutions.com/");
44
+ define("SU_USER_AGENT", "SeoUltimate/2.8");
45
 
46
  /********** INCLUDES **********/
47