All in One SEO Pack - Version 1.2.5.5

Version Description

Download this release

Release Info

Developer uberdose
Plugin Icon 128x128 All in One SEO Pack
Version 1.2.5.5
Comparing to
See all releases

Code changes from version 1.2.5.4 to 1.2.5.5

Files changed (1) hide show
  1. all_in_one_seo_pack.php +45 -15
all_in_one_seo_pack.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: All in One SEO Pack
5
  Plugin URI: http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/
6
  Description: Out-of-the-box SEO for your Wordpress blog.
7
- Version: 1.2.5.4
8
  Author: uberdose
9
  Author URI: http://wp.uberdose.com/
10
  */
@@ -28,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
28
 
29
  class All_in_One_SEO_Pack {
30
 
31
- var $version = "1.2.5.4";
32
 
33
  /**
34
  * Number of words to be used (max) for generating an excerpt.
@@ -43,6 +43,8 @@ class All_in_One_SEO_Pack {
43
 
44
  var $table_prefix = "aiosp_";
45
 
 
 
46
  var $db_version = '0.1';
47
 
48
  function template_redirect() {
@@ -58,10 +60,11 @@ class All_in_One_SEO_Pack {
58
  return $this->rewrite_title($content);
59
  }
60
 
61
- function init_textdomain() {
62
  if(function_exists('load_plugin_textdomain')) {
63
  load_plugin_textdomain('all_in_one_seo_pack', 'wp-content/plugins/all-in-one-seo-pack');
64
- }
 
65
  }
66
 
67
  function wp_head() {
@@ -198,6 +201,13 @@ class All_in_One_SEO_Pack {
198
  $title = $new_title;
199
  $title = trim($title);
200
  $header = $this->replace_title($header, $title);
 
 
 
 
 
 
 
201
  }
202
 
203
  return $header;
@@ -271,9 +281,20 @@ class All_in_One_SEO_Pack {
271
 
272
  function db_install() {
273
  global $wpdb;
274
- die("db_install");
275
- $table_categories = $wpdb->prefix . $this->table_prefix . "categories";
276
- if($wpdb->get_var("show tables like '$table_categories'") != $table_categories) {
 
 
 
 
 
 
 
 
 
 
 
277
  }
278
  }
279
 
@@ -306,13 +327,23 @@ class All_in_One_SEO_Pack {
306
  }
307
 
308
  function edit_category($id) {
 
 
309
  $awmp_edit = $_POST["aiosp_edit"];
310
- /*
311
  if (isset($awmp_edit) && !empty($awmp_edit)) {
312
- $keywords = $_POST["aiosp_keywords"];
313
- $description = $_POST["aiosp_description"];
314
- $title = $_POST["aiosp_title"];
315
-
 
 
 
 
 
 
 
 
 
316
  delete_post_meta($id, 'keywords');
317
  delete_post_meta($id, 'description');
318
  delete_post_meta($id, 'title');
@@ -326,8 +357,8 @@ class All_in_One_SEO_Pack {
326
  if (isset($title) && !empty($title)) {
327
  add_post_meta($id, 'title', $title);
328
  }
 
329
  }
330
- */
331
  }
332
 
333
  function edit_category_form() {
@@ -603,11 +634,10 @@ add_option("aiosp_post_title_format", '%post_title% | %blog_title%', __('All in
603
  add_option("aiosp_page_title_format", '%page_title% | %blog_title%', __('All in One SEO Plugin Page Title Format', 'all_in_one_seo_pack'), 'yes');
604
 
605
  $aiosp = new All_in_One_SEO_Pack();
606
- //add_action('activate_all-in-one-seo-pack/all_in_one_seo_pack.php', array($aiosp, 'db_install'));
607
  add_action('wp_head', array($aiosp, 'wp_head'));
608
  add_action('template_redirect', array($aiosp, 'template_redirect'));
609
 
610
- add_action('init', array($aiosp, 'init_textdomain'));
611
 
612
  add_action('simple_edit_form', array($aiosp, 'add_meta_tags_textinput'));
613
  add_action('edit_form_advanced', array($aiosp, 'add_meta_tags_textinput'));
4
  Plugin Name: All in One SEO Pack
5
  Plugin URI: http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/
6
  Description: Out-of-the-box SEO for your Wordpress blog.
7
+ Version: 1.2.5.5
8
  Author: uberdose
9
  Author URI: http://wp.uberdose.com/
10
  */
28
 
29
  class All_in_One_SEO_Pack {
30
 
31
+ var $version = "1.2.5.5";
32
 
33
  /**
34
  * Number of words to be used (max) for generating an excerpt.
43
 
44
  var $table_prefix = "aiosp_";
45
 
46
+ var $table_categries;
47
+
48
  var $db_version = '0.1';
49
 
50
  function template_redirect() {
60
  return $this->rewrite_title($content);
61
  }
62
 
63
+ function init() {
64
  if(function_exists('load_plugin_textdomain')) {
65
  load_plugin_textdomain('all_in_one_seo_pack', 'wp-content/plugins/all-in-one-seo-pack');
66
+ }
67
+ //$this->db_install();
68
  }
69
 
70
  function wp_head() {
201
  $title = $new_title;
202
  $title = trim($title);
203
  $header = $this->replace_title($header, $title);
204
+ } else if (function_exists('is_tag') && is_tag()) {
205
+ global $utw;
206
+ if ($utw) {
207
+ $tags = $utw->GetCurrentTagSet();
208
+ $tag = $tags[0]->tag;
209
+ $header = $this->replace_title($header, $tag);
210
+ }
211
  }
212
 
213
  return $header;
281
 
282
  function db_install() {
283
  global $wpdb;
284
+ $this->table_categories = $wpdb->prefix . $this->table_prefix . "categories";
285
+ if(get_option('aiosp_db_version') != $this->db_version) {
286
+ $sql = "CREATE TABLE $this->table_categories (
287
+ ID bigint(20) NOT NULL auto_increment,
288
+ category_id bigint(20) NOT NULL default '0',
289
+ meta_title text NOT NULL,
290
+ meta_description text NOT NULL,
291
+ meta_keywords text NOT NULL,
292
+ PRIMARY KEY (ID),
293
+ KEY category_id (category_id));";
294
+
295
+ require_once(ABSPATH . 'wp-admin/upgrade-functions.php');
296
+ dbDelta($sql);
297
+ update_option('aiosp_db_version', $this->db_version);
298
  }
299
  }
300
 
327
  }
328
 
329
  function edit_category($id) {
330
+ global $wpdb;
331
+ $id = $wpdb->escape($id);
332
  $awmp_edit = $_POST["aiosp_edit"];
 
333
  if (isset($awmp_edit) && !empty($awmp_edit)) {
334
+ $keywords = $wpdb->escape($_POST["aiosp_keywords"]);
335
+ $title = $wpdb->escape($_POST["aiosp_title"]);
336
+ $old_category = $wpdb->get_row("select * from $this->table_categories where category_id=$id", OBJECT);
337
+ if ($old_category) {
338
+ $wpdb->query("update $this->table_categories
339
+ set meta_title='$title', meta_keywords='$keywords'
340
+ where category_id=$id");
341
+ } else {
342
+ $wpdb->query("insert into $this->table_categories(meta_title, meta_keywords, category_id)
343
+ values ('$title', '$keywords', $id");
344
+ }
345
+ //$wpdb->query("insert into $this->table_categories")
346
+ /*
347
  delete_post_meta($id, 'keywords');
348
  delete_post_meta($id, 'description');
349
  delete_post_meta($id, 'title');
357
  if (isset($title) && !empty($title)) {
358
  add_post_meta($id, 'title', $title);
359
  }
360
+ */
361
  }
 
362
  }
363
 
364
  function edit_category_form() {
634
  add_option("aiosp_page_title_format", '%page_title% | %blog_title%', __('All in One SEO Plugin Page Title Format', 'all_in_one_seo_pack'), 'yes');
635
 
636
  $aiosp = new All_in_One_SEO_Pack();
 
637
  add_action('wp_head', array($aiosp, 'wp_head'));
638
  add_action('template_redirect', array($aiosp, 'template_redirect'));
639
 
640
+ add_action('init', array($aiosp, 'init'));
641
 
642
  add_action('simple_edit_form', array($aiosp, 'add_meta_tags_textinput'));
643
  add_action('edit_form_advanced', array($aiosp, 'add_meta_tags_textinput'));