Version Description
Download this release
Release Info
Developer | SEO Design Solutions |
Plugin | SEO Ultimate |
Version | 0.2 |
Comparing to | |
See all releases |
Code changes from version 0.1.1 to 0.2
- modules/meta.php +176 -0
- modules/noindex.php +2 -2
- modules/sds-blog.php +1 -1
- modules/settings.php +1 -1
- modules/titles.php +4 -3
- readme.txt +21 -5
- screenshot-1.png +0 -0
- screenshot-3.png +0 -0
- seo-ultimate.css +5 -0
- seo-ultimate.php +135 -39
- seo-ultimate.pot +0 -119
modules/meta.php
ADDED
@@ -0,0 +1,176 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Meta Editor Module
|
4 |
+
*
|
5 |
+
* @version 1.0
|
6 |
+
* @since 0.3
|
7 |
+
*/
|
8 |
+
|
9 |
+
if (class_exists('SU_Module')) {
|
10 |
+
|
11 |
+
class SU_Meta extends SU_Module {
|
12 |
+
|
13 |
+
function get_menu_title() { return __('Meta Editor', 'seo-ultimate'); }
|
14 |
+
|
15 |
+
function init() {
|
16 |
+
add_filter('su_meta_robots', array($this, 'meta_robots'));
|
17 |
+
add_action('su_head', array($this, 'head_tag_output'));
|
18 |
+
add_filter('su_postmeta_help', array($this, 'postmeta_help'), 20);
|
19 |
+
}
|
20 |
+
|
21 |
+
function get_default_settings() {
|
22 |
+
return array(
|
23 |
+
'home_description_tagline_default' => true
|
24 |
+
);
|
25 |
+
}
|
26 |
+
|
27 |
+
function admin_page_contents() {
|
28 |
+
$this->admin_form_start();
|
29 |
+
$this->textareas(array(
|
30 |
+
'home_description' => __("Blog Homepage Meta Description", 'seo-ultimate')
|
31 |
+
, 'home_keywords' => __("Blog Homepage Meta Keywords", 'seo-ultimate')
|
32 |
+
), 3);
|
33 |
+
$this->checkboxes(array(
|
34 |
+
'home_description_tagline_default' => __("Use this blog’s tagline as the default homepage description.", 'seo-ultimate')
|
35 |
+
), __("Default Values", 'seo-ultimate'));
|
36 |
+
$this->checkboxes(array(
|
37 |
+
'noodp' => __("Don’t use this site’s Open Directory description in search results.", 'seo-ultimate')
|
38 |
+
, 'noydir' => __("Don’t use this site’s Yahoo! Directory description in search results.", 'seo-ultimate')
|
39 |
+
, 'noarchive' => __("Don’t cache or archive this site.", 'seo-ultimate')
|
40 |
+
), __("Spider Instructions", 'seo-ultimate'));
|
41 |
+
$this->textboxes(array(
|
42 |
+
'google_verify' => __("Google Webmaster Tools:", 'seo-ultimate')
|
43 |
+
, 'yahoo_verify' => __("Yahoo! Site Explorer:", 'seo-ultimate')
|
44 |
+
, 'microsoft_verify' => __("Bing Webmaster Center:", 'seo-ultimate')
|
45 |
+
), array(), __("Verification Codes", 'seo-ultimate'));
|
46 |
+
$this->textarea('custom_html', __("Custom <head> HTML", 'seo-ultimate'));
|
47 |
+
$this->admin_form_end();
|
48 |
+
}
|
49 |
+
|
50 |
+
function postmeta_fields($fields) {
|
51 |
+
$id = "_su_description";
|
52 |
+
$value = attribute_escape($this->get_postmeta('description'));
|
53 |
+
|
54 |
+
$fields['20-meta'] =
|
55 |
+
"<tr class='textarea'>\n<th scope='row'><label for='$id'>".__("Description:", 'seo-ultimate')."</label></th>\n"
|
56 |
+
. "<td><textarea name='$id' id='$id' type='text' class='regular-text' cols='60' rows='3'"
|
57 |
+
. " onkeyup=\"javascript:textbox_char_count('_su_description', 'su_meta_description_charcount')\">$value</textarea>"
|
58 |
+
. "<br />".sprintf(__("You’ve entered %s characters. Most search engines use up to 160.", 'seo-ultimate'), "<strong id='su_meta_description_charcount'>".strlen($value)."</strong>")
|
59 |
+
. "</td>\n</tr>\n"
|
60 |
+
. $this->get_postmeta_textbox('keywords', __('Keywords:<br /><em>(separate with commas)', 'seo-ultimate'))
|
61 |
+
;
|
62 |
+
|
63 |
+
return $fields;
|
64 |
+
}
|
65 |
+
|
66 |
+
function meta_robots($commands) {
|
67 |
+
|
68 |
+
$tags = array('noodp', 'noydir', 'noarchive');
|
69 |
+
|
70 |
+
foreach ($tags as $tag) {
|
71 |
+
if ($this->get_setting($tag)) $commands[] = $tag;
|
72 |
+
}
|
73 |
+
|
74 |
+
return $commands;
|
75 |
+
}
|
76 |
+
|
77 |
+
function head_tag_output() {
|
78 |
+
|
79 |
+
$desc = false;
|
80 |
+
$kw = false;
|
81 |
+
|
82 |
+
if (is_home()) {
|
83 |
+
$desc = $this->get_setting('home_description');
|
84 |
+
if (!$desc && $this->get_setting('home_description_tagline_default')) $desc = get_bloginfo('description');
|
85 |
+
$kw = $this->get_setting('home_keywords');
|
86 |
+
} elseif (is_singular()) {
|
87 |
+
$desc = $this->get_postmeta('description');
|
88 |
+
$kw = $this->get_postmeta('keywords');
|
89 |
+
}
|
90 |
+
|
91 |
+
if ($desc) {
|
92 |
+
$desc = attribute_escape($desc);
|
93 |
+
echo "\t<meta name=\"description\" content=\"$desc\" />\n";
|
94 |
+
}
|
95 |
+
|
96 |
+
if ($kw) {
|
97 |
+
$kw = attribute_escape($kw);
|
98 |
+
echo "\t<meta name=\"keywords\" content=\"$kw\" />\n";
|
99 |
+
}
|
100 |
+
|
101 |
+
$verify = array(
|
102 |
+
'google' => 'verify-v1'
|
103 |
+
, 'yahoo' => 'y_key'
|
104 |
+
, 'microsoft' => 'msvalidate.01'
|
105 |
+
);
|
106 |
+
|
107 |
+
foreach ($verify as $site => $name) {
|
108 |
+
if ($value = $this->get_setting($site.'_verify')) {
|
109 |
+
$value = attribute_escape($value);
|
110 |
+
echo "\t<meta name=\"$name\" content=\"$value\" />\n";
|
111 |
+
}
|
112 |
+
}
|
113 |
+
|
114 |
+
if ($custom = $this->get_setting('custom_html')) {
|
115 |
+
|
116 |
+
$mark_code = $this->get_setting('mark_code', false, 'settings');
|
117 |
+
$desc = __('Custom Header Code', 'seo-ultimate');
|
118 |
+
|
119 |
+
echo "\n";
|
120 |
+
if ($mark_code) echo "\t<!-- $desc -->\n";
|
121 |
+
echo $custom;
|
122 |
+
if ($mark_code) echo "\n\t<!-- /$desc -->";
|
123 |
+
echo "\n\n";
|
124 |
+
}
|
125 |
+
|
126 |
+
}
|
127 |
+
|
128 |
+
function admin_help() {
|
129 |
+
return __(<<<STR
|
130 |
+
<p>The Meta Editor lets you customize a wide variety of settings known as “meta data.”</p>
|
131 |
+
<p>Here’s information on the various settings:</p>
|
132 |
+
<ul>
|
133 |
+
<li><p><strong>Blog Homepage Meta Description</strong> — When your blog homepage appears in search results, it’ll have a title and a description.
|
134 |
+
When you insert content into the description field below, the Meta Editor will add code to your blog homepage (the <code><meta name="description" /></code> tag)
|
135 |
+
that asks search engines to use what you’ve entered as the homepage’s search results description.</p></li>
|
136 |
+
<li><p><strong>Blog Homepage Meta Keywords</strong> — Here you can enter keywords that describe the overall subject matter of your entire blog. Use commas to separate keywords.
|
137 |
+
Your keywords will be put in the <code><meta name="keywords" /></code> tag on your blog homepage.</p></li>
|
138 |
+
<li><p><strong>Default Values</strong></p>
|
139 |
+
<ul>
|
140 |
+
<li><p><strong>Use this blog’s tagline as the default homepage description.</strong> —
|
141 |
+
If this box is checked and if the Blog Homepage Meta Description field is empty,
|
142 |
+
Meta Editor will use your blog’s <a href="options-general.php" target="_blank">tagline</a> as the meta description.</p></li>
|
143 |
+
</ul>
|
144 |
+
</li>
|
145 |
+
<li><p><strong>Spider Instructions</strong></p>
|
146 |
+
<ul>
|
147 |
+
<li><p><strong>Don’t use this site’s Open Directory / Yahoo! Directory description in search results.</strong> —
|
148 |
+
If your site is listed in the <a href="http://www.dmoz.org/" target="_blank">Open Directory (DMOZ)</a> or
|
149 |
+
the <a href="http://dir.yahoo.com/" target="_blank">Yahoo! Directory</a>,
|
150 |
+
some search engines may use your directory listing as the meta description.
|
151 |
+
These boxes tell search engines not to do that and will give you full control over your meta descriptions.
|
152 |
+
These settings have no effect if your site isn’t listed in the Open Directory or Yahoo! Directory respectively.</p></li>
|
153 |
+
<li><p><strong>Don’t cache or archive this site.</strong> —
|
154 |
+
When you check this box, Meta Editor will ask search engines (Google, Yahoo!, Bing, etc.) and archivers (Archive.org, etc.)
|
155 |
+
to <em>not</em> make cached or archived “copies” of your site.</p></li>
|
156 |
+
</ul>
|
157 |
+
</li>
|
158 |
+
<li><p><strong>Verification Codes</strong> — This section lets you enter in verification codes for the webmaster portals of the 3 leading search engines.</p></li>
|
159 |
+
<li><p><strong>Custom <head> HTML</strong> — Just enter in raw HTML code here, and it’ll be entered into the <head> tag across your entire site.</p></li>
|
160 |
+
</ul>
|
161 |
+
STR
|
162 |
+
, 'seo-ultimate');
|
163 |
+
}
|
164 |
+
|
165 |
+
function postmeta_help($help) {
|
166 |
+
$help[] = __("<strong>Description:</strong> — The value of the meta description tag. The description will often appear underneath the title in search engine results. ".
|
167 |
+
"Writing an accurate, attention-grabbing description for every post is important to ensuring a good search results clickthrough rate.", 'seo-ultimate');
|
168 |
+
$help[] = __("<strong>Keywords:</strong> — The value of the meta keywords tag. The keywords list gives search engines a hint as to what this post/page is about. ".
|
169 |
+
"Be sure to separate keywords with commas, like so: <samp>one,two,three</samp>.", 'seo-ultimate');
|
170 |
+
return $help;
|
171 |
+
}
|
172 |
+
|
173 |
+
}
|
174 |
+
|
175 |
+
}
|
176 |
+
?>
|
modules/noindex.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Noindex Manager Module
|
4 |
*
|
5 |
-
* @version 1.0
|
6 |
* @since 0.1
|
7 |
*/
|
8 |
|
@@ -33,7 +33,7 @@ class SU_Noindex extends SU_Module {
|
|
33 |
__("Note: The current <a href='options-privacy.php'>privacy settings</a> will block indexing of the entire site, regardless of which options are set below.", 'seo-ultimate') );
|
34 |
|
35 |
$this->admin_form_start();
|
36 |
-
|
37 |
$this->checkboxes(array('noindex_admin' => __('Administration back-end pages', 'seo-ultimate')
|
38 |
, 'noindex_author' => __('Author archives', 'seo-ultimate')
|
39 |
, 'noindex_search' => __('Blog search pages', 'seo-ultimate')
|
2 |
/**
|
3 |
* Noindex Manager Module
|
4 |
*
|
5 |
+
* @version 1.0.1
|
6 |
* @since 0.1
|
7 |
*/
|
8 |
|
33 |
__("Note: The current <a href='options-privacy.php'>privacy settings</a> will block indexing of the entire site, regardless of which options are set below.", 'seo-ultimate') );
|
34 |
|
35 |
$this->admin_form_start();
|
36 |
+
$this->admin_form_subheader(__('Prevent indexing of...', 'seo-ultimate'));
|
37 |
$this->checkboxes(array('noindex_admin' => __('Administration back-end pages', 'seo-ultimate')
|
38 |
, 'noindex_author' => __('Author archives', 'seo-ultimate')
|
39 |
, 'noindex_search' => __('Blog search pages', 'seo-ultimate')
|
modules/sds-blog.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* SEO Design Solutions Whitepapers Module
|
4 |
*
|
5 |
* @version 1.0
|
6 |
-
* @since 0.
|
7 |
*/
|
8 |
|
9 |
if (class_exists('SU_Module')) {
|
3 |
* SEO Design Solutions Whitepapers Module
|
4 |
*
|
5 |
* @version 1.0
|
6 |
+
* @since 0.1
|
7 |
*/
|
8 |
|
9 |
if (class_exists('SU_Module')) {
|
modules/settings.php
CHANGED
@@ -23,7 +23,7 @@ class SU_Settings extends SU_Module {
|
|
23 |
}
|
24 |
|
25 |
function init() {
|
26 |
-
|
27 |
if ($this->is_action('export')) {
|
28 |
header('Content-Type: application/octet-stream');
|
29 |
header('Content-Disposition: attachment; filename="SEO Ultimate Settings ('.date('Y-m-d').').dat"');
|
23 |
}
|
24 |
|
25 |
function init() {
|
26 |
+
|
27 |
if ($this->is_action('export')) {
|
28 |
header('Content-Type: application/octet-stream');
|
29 |
header('Content-Disposition: attachment; filename="SEO Ultimate Settings ('.date('Y-m-d').').dat"');
|
modules/titles.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Title Rewriter Module
|
4 |
*
|
5 |
-
* @version 1.0.
|
6 |
* @since 0.1
|
7 |
*/
|
8 |
|
@@ -120,7 +120,8 @@ class SU_Titles extends SU_Module {
|
|
120 |
$format = $this->get_title_format();
|
121 |
|
122 |
//Custom post/page title?
|
123 |
-
if ($post_title = $this->get_postmeta('title'))
|
|
|
124 |
|
125 |
//Load post/page titles
|
126 |
$post_title = '';
|
@@ -167,7 +168,7 @@ class SU_Titles extends SU_Module {
|
|
167 |
, '{ucquery}' => attribute_escape(ucwords(get_search_query()))
|
168 |
);
|
169 |
|
170 |
-
$title =
|
171 |
|
172 |
return $this->get_title_paged($title);
|
173 |
}
|
2 |
/**
|
3 |
* Title Rewriter Module
|
4 |
*
|
5 |
+
* @version 1.0.2
|
6 |
* @since 0.1
|
7 |
*/
|
8 |
|
120 |
$format = $this->get_title_format();
|
121 |
|
122 |
//Custom post/page title?
|
123 |
+
if ($post_title = $this->get_postmeta('title'))
|
124 |
+
return htmlspecialchars($this->get_title_paged($post_title));
|
125 |
|
126 |
//Load post/page titles
|
127 |
$post_title = '';
|
168 |
, '{ucquery}' => attribute_escape(ucwords(get_search_query()))
|
169 |
);
|
170 |
|
171 |
+
$title = str_replace(array_keys($variables), array_values($variables), htmlspecialchars($format));
|
172 |
|
173 |
return $this->get_title_paged($title);
|
174 |
}
|
readme.txt
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
=== SEO Ultimate ===
|
2 |
Contributors: SEO Design Solutions
|
3 |
-
Tags: google,
|
4 |
Requires at least: 2.7
|
5 |
-
Tested up to: 2.
|
6 |
-
Stable tag: 0.
|
7 |
|
8 |
-
This all-in-one SEO plugin can rewrite title tags
|
9 |
|
10 |
== Description ==
|
11 |
|
@@ -15,6 +15,8 @@ SEO Ultimate is an all-in-one [SEO](http://www.seodesignsolutions.com/) plugin w
|
|
15 |
|
16 |
* **Noindex Manager** - Lets you add the `noindex` meta robots instruction to archives, comment feeds, the login page, and more.
|
17 |
|
|
|
|
|
18 |
SEO Ultimate was developed with WordPress plugin "best practices" in mind:
|
19 |
|
20 |
* Integration with WordPress's contextual help system
|
@@ -23,7 +25,7 @@ SEO Ultimate was developed with WordPress plugin "best practices" in mind:
|
|
23 |
* An uninstall routine
|
24 |
* Integration with the new WordPress 2.7 menu
|
25 |
|
26 |
-
**NOTE:** This plugin is in beta, which means it's very feature-incomplete. We have many more features that we're working on finetuning before release, including
|
27 |
|
28 |
If you install the plugin now, you can have these new features delivered to you on a regular basis via WordPress's automatic plugin upgrader.
|
29 |
|
@@ -62,14 +64,28 @@ Here are some troubleshooting ideas:
|
|
62 |
1. Try disabling other SEO plugins (they may be conflicting with SEO Ultimate).
|
63 |
2. Check to make sure your theme is [plugin-friendly](http://wordpress.jdwebdev.com/blog/theme-plugin-hooks/).
|
64 |
|
|
|
|
|
|
|
|
|
65 |
|
66 |
== Screenshots ==
|
67 |
|
68 |
1. The Title Rewriter module
|
69 |
2. The Noindex Manager module
|
|
|
70 |
|
71 |
|
72 |
== Release History ==
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
= Version 0.1 (May 22, 2009) =
|
75 |
* Initial release
|
1 |
=== SEO Ultimate ===
|
2 |
Contributors: SEO Design Solutions
|
3 |
+
Tags: seo, title, meta, noindex, google, yahoo, admin, post, page
|
4 |
Requires at least: 2.7
|
5 |
+
Tested up to: 2.8 Beta 2
|
6 |
+
Stable tag: 0.2
|
7 |
|
8 |
+
This all-in-one SEO plugin can rewrite title tags, noindex archives, and customize meta data (with many more features coming soon).
|
9 |
|
10 |
== Description ==
|
11 |
|
15 |
|
16 |
* **Noindex Manager** - Lets you add the `noindex` meta robots instruction to archives, comment feeds, the login page, and more.
|
17 |
|
18 |
+
* **Meta Editor** - Lets you edit the meta descriptions/keywords for your posts, pages, and homepage. Also lets you enter verification meta codes and give code instructions to search engine spiders.
|
19 |
+
|
20 |
SEO Ultimate was developed with WordPress plugin "best practices" in mind:
|
21 |
|
22 |
* Integration with WordPress's contextual help system
|
25 |
* An uninstall routine
|
26 |
* Integration with the new WordPress 2.7 menu
|
27 |
|
28 |
+
**NOTE:** This plugin is in beta, which means it's very feature-incomplete. We have many more features that we're working on finetuning before release, including 404 monitoring, canonical tag insertion, PageRank sculpting, and more.
|
29 |
|
30 |
If you install the plugin now, you can have these new features delivered to you on a regular basis via WordPress's automatic plugin upgrader.
|
31 |
|
64 |
1. Try disabling other SEO plugins (they may be conflicting with SEO Ultimate).
|
65 |
2. Check to make sure your theme is [plugin-friendly](http://wordpress.jdwebdev.com/blog/theme-plugin-hooks/).
|
66 |
|
67 |
+
= How do I remove the attribution link? =
|
68 |
+
|
69 |
+
Because of the tremendous effort put into this plugin, we ask that you please leave the link enabled. If you must disable it, you can do so under `Settings > SEO Ultimate`.
|
70 |
+
|
71 |
|
72 |
== Screenshots ==
|
73 |
|
74 |
1. The Title Rewriter module
|
75 |
2. The Noindex Manager module
|
76 |
+
3. The Meta Editor module
|
77 |
|
78 |
|
79 |
== Release History ==
|
80 |
|
81 |
+
= Version 0.2 (June 4, 2009) =
|
82 |
+
* Added the Meta Editor module
|
83 |
+
* Fixed a double-escaping bug in the Title Rewriter
|
84 |
+
* Fixed a bug that caused the Modules list to display twice on some installations
|
85 |
+
|
86 |
+
= Version 0.1.1 (May 28, 2009) =
|
87 |
+
* Fixed a bug that surfaced when other SEO plugins were installed
|
88 |
+
* Fixed a bug that appeared on certain PHP setups
|
89 |
+
|
90 |
= Version 0.1 (May 22, 2009) =
|
91 |
* Initial release
|
screenshot-1.png
CHANGED
Binary file
|
screenshot-3.png
ADDED
Binary file
|
seo-ultimate.css
CHANGED
@@ -56,6 +56,11 @@ div.su-module .su-message .su-error {
|
|
56 |
border-color: #FF0000;
|
57 |
}
|
58 |
|
|
|
|
|
|
|
|
|
|
|
59 |
div.su-module .su-message .su-info {
|
60 |
background-color: #DFEEFF;
|
61 |
border-color: #8F93FF;
|
56 |
border-color: #FF0000;
|
57 |
}
|
58 |
|
59 |
+
div.su-module .su-message .su-warning {
|
60 |
+
background-color: #FFFFE0;
|
61 |
+
border-color: orange;
|
62 |
+
}
|
63 |
+
|
64 |
div.su-module .su-message .su-info {
|
65 |
background-color: #DFEEFF;
|
66 |
border-color: #8F93FF;
|
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 can rewrite title tags and add noindex to pages (with many more features coming soon).
|
6 |
-
Version: 0.
|
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 0.
|
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 |
|
39 |
define("SU_PLUGIN_NAME", "SEO Ultimate");
|
40 |
define("SU_PLUGIN_URI", "http://www.seodesignsolutions.com/wordpress-seo/");
|
41 |
-
define("SU_VERSION", "0.
|
42 |
define("SU_AUTHOR", "SEO Design Solutions");
|
43 |
define("SU_AUTHOR_URI", "http://www.seodesignsolutions.com/");
|
44 |
-
define("SU_USER_AGENT", "SeoUltimate/0.
|
45 |
|
46 |
|
47 |
/********** CLASSES **********/
|
@@ -113,6 +113,14 @@ class SEO_Ultimate {
|
|
113 |
*/
|
114 |
var $plugin_dir_url;
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
|
117 |
/********** CLASS CONSTRUCTORS **********/
|
118 |
|
@@ -121,10 +129,10 @@ class SEO_Ultimate {
|
|
121 |
* PHP5-style constructor.
|
122 |
*
|
123 |
* @since 0.1
|
|
|
124 |
* @uses SU_VERSION
|
125 |
* @uses install()
|
126 |
* @uses upgrade()
|
127 |
-
* @uses load_plugin_data()
|
128 |
* @uses load_modules()
|
129 |
* @uses activate() Registered with WordPress as the activation hook.
|
130 |
* @uses init() Hooked into WordPress's "init" action.
|
@@ -133,10 +141,17 @@ class SEO_Ultimate {
|
|
133 |
* @uses admin_includes() Hooked into WordPress's "admin_head" action.
|
134 |
* @uses plugin_page_notices() Hooked into WordPress's "admin_head" action.
|
135 |
* @uses admin_help() Hooked into WordPress's "contextual_help" action.
|
|
|
136 |
* @uses log_hit() Hooked into WordPress's "status_header" action.
|
137 |
*/
|
138 |
function __construct() {
|
139 |
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
/********** VERSION CHECKING **********/
|
141 |
|
142 |
//Get the current version, and the version when the plugin last ran
|
@@ -158,9 +173,6 @@ class SEO_Ultimate {
|
|
158 |
|
159 |
/********** INITIALIZATION **********/
|
160 |
|
161 |
-
//Load data about the plugin file itself
|
162 |
-
$this->load_plugin_data();
|
163 |
-
|
164 |
//Load plugin modules. Must be called *after* load_plugin_data()
|
165 |
$this->load_modules();
|
166 |
|
@@ -179,7 +191,7 @@ class SEO_Ultimate {
|
|
179 |
|
180 |
/********** ACTION & FILTER HOOKS **********/
|
181 |
|
182 |
-
//Initializes modules at
|
183 |
add_action('init', array($this, 'init'));
|
184 |
|
185 |
//Hook to output all <head> code
|
@@ -208,6 +220,7 @@ class SEO_Ultimate {
|
|
208 |
add_action('in_plugin_update_message-'.plugin_basename(__FILE__), array($this, 'plugin_update_info'), 10, 2);
|
209 |
|
210 |
//Log this visitor!
|
|
|
211 |
add_filter('status_header', array($this, 'log_hit'), 10, 2);
|
212 |
}
|
213 |
|
@@ -231,9 +244,15 @@ class SEO_Ultimate {
|
|
231 |
* @since 0.1
|
232 |
*/
|
233 |
function install() {
|
234 |
-
|
235 |
//Add the database table
|
236 |
$this->db_setup();
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
}
|
238 |
|
239 |
/**
|
@@ -458,6 +477,7 @@ class SEO_Ultimate {
|
|
458 |
ip_address VARCHAR(255) NOT NULL,
|
459 |
user_agent VARCHAR(255) NOT NULL,
|
460 |
url TEXT NOT NULL,
|
|
|
461 |
status_code SMALLINT(3) NOT NULL,
|
462 |
is_new BOOL NOT NULL,
|
463 |
PRIMARY KEY (id)
|
@@ -488,12 +508,14 @@ class SEO_Ultimate {
|
|
488 |
*
|
489 |
* @since 0.1
|
490 |
* @uses get_current_url()
|
|
|
491 |
*
|
492 |
* @param string $status_header The full HTTP status header. Unused and returned as-is.
|
493 |
* @param int $status_code The numeric HTTP status code.
|
|
|
494 |
* @return string Returns the $status_header variable unchanged.
|
495 |
*/
|
496 |
-
function log_hit($status_header, $status_code) {
|
497 |
if (!is_user_logged_in()) {
|
498 |
global $wpdb;
|
499 |
|
@@ -501,15 +523,47 @@ class SEO_Ultimate {
|
|
501 |
$url = $this->get_current_url();
|
502 |
$is_new = (count($wpdb->get_results($wpdb->prepare("SELECT url FROM $table WHERE url = %s AND is_new = 0", $url))) == 0);
|
503 |
|
504 |
-
$
|
505 |
-
|
506 |
-
|
|
|
|
|
|
|
|
|
|
|
507 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
508 |
}
|
509 |
|
510 |
return $status_header;
|
511 |
}
|
512 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
513 |
|
514 |
/********** ADMIN MENU FUNCTIONS **********/
|
515 |
|
@@ -536,8 +590,7 @@ class SEO_Ultimate {
|
|
536 |
$count_code = $this->get_menu_count_code($count);
|
537 |
|
538 |
//Add the "SEO" menu item!
|
539 |
-
|
540 |
-
add_utility_page(__('SEO Ultimate', 'seo-ultimate'), __('SEO', 'seo-ultimate').$count_code, 'manage_options', 'seo', array($this->modules[$primarykey], 'admin_page'), 'div');
|
541 |
|
542 |
//Translations and count codes will mess up the admin page hook, so we need to fix it manually.
|
543 |
global $admin_page_hooks;
|
@@ -1040,6 +1093,27 @@ class SEO_Ultimate {
|
|
1040 |
else
|
1041 |
return $url.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
|
1042 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1043 |
}
|
1044 |
|
1045 |
/**
|
@@ -1197,7 +1271,7 @@ class SU_Module {
|
|
1197 |
*
|
1198 |
* @since 0.1
|
1199 |
*
|
1200 |
-
* @return
|
1201 |
*/
|
1202 |
function admin_help() { return false; }
|
1203 |
|
@@ -1226,7 +1300,7 @@ class SU_Module {
|
|
1226 |
function init_pre() {
|
1227 |
$defaults = $this->get_default_settings();
|
1228 |
foreach ($defaults as $setting => $default) {
|
1229 |
-
if ($this->get_setting($setting, "
|
1230 |
$this->update_setting($setting, $default);
|
1231 |
}
|
1232 |
|
@@ -1275,17 +1349,19 @@ class SU_Module {
|
|
1275 |
* @uses get_module_key()
|
1276 |
*
|
1277 |
* @param string $key The name of the setting to retrieve.
|
1278 |
-
* @param
|
1279 |
-
* @param string $module The module to which the setting belongs. Defaults to the current module. Optional.
|
1280 |
* @return mixed The value of the setting, or the $default variable.
|
1281 |
*/
|
1282 |
function get_setting($key, $default=null, $module=null) {
|
1283 |
if (!$module) $module = $this->get_module_key();
|
1284 |
$settings = maybe_unserialize(get_option('su_settings'));
|
1285 |
if (isset($settings[$module][$key]))
|
1286 |
-
|
1287 |
else
|
1288 |
-
|
|
|
|
|
1289 |
}
|
1290 |
|
1291 |
/**
|
@@ -1296,12 +1372,17 @@ class SU_Module {
|
|
1296 |
*
|
1297 |
* @param string $key The key of the setting to be changed.
|
1298 |
* @param string $value The new value to assign to the setting.
|
|
|
1299 |
*/
|
1300 |
-
function update_setting($key, $value) {
|
1301 |
-
$
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
|
|
|
|
|
|
|
|
1305 |
}
|
1306 |
|
1307 |
/**
|
@@ -1617,8 +1698,10 @@ class SU_Module {
|
|
1617 |
* @uses get_setting()
|
1618 |
*
|
1619 |
* @param array $textareas An array of textareas. (Field/setting IDs are the keys, and descriptions are the values.)
|
|
|
|
|
1620 |
*/
|
1621 |
-
function textareas($textareas) {
|
1622 |
|
1623 |
if ($this->is_action('update')) {
|
1624 |
foreach ($textareas as $id => $title) {
|
@@ -1628,11 +1711,11 @@ class SU_Module {
|
|
1628 |
|
1629 |
foreach ($textareas as $id => $title) {
|
1630 |
register_setting($this->get_module_key(), $id);
|
1631 |
-
$value =
|
1632 |
$id = attribute_escape($id);
|
1633 |
|
1634 |
echo "<tr valign='top'>\n<th scope='row'><label for='$id'>$title</label></th>\n";
|
1635 |
-
echo "<td><textarea name='$id' id='$id' type='text' class='regular-text' cols='
|
1636 |
echo "</td>\n</tr>\n";
|
1637 |
}
|
1638 |
}
|
@@ -1645,10 +1728,12 @@ class SU_Module {
|
|
1645 |
*
|
1646 |
* @param string $id The field/setting ID.
|
1647 |
* @param string $title The label of the HTML element.
|
|
|
|
|
1648 |
* @return string The HTML that would render the textarea.
|
1649 |
*/
|
1650 |
-
function textarea($id, $title) {
|
1651 |
-
$this->textareas(array($id => $title));
|
1652 |
}
|
1653 |
|
1654 |
/********** ADMIN SECURITY FUNCTIONS **********/
|
@@ -1897,7 +1982,16 @@ class SU_Module {
|
|
1897 |
|
1898 |
/********** HITS LOG FUNCTIONS **********/
|
1899 |
|
1900 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1901 |
global $wpdb;
|
1902 |
$mk = $this->get_module_key();
|
1903 |
|
@@ -1911,17 +2005,18 @@ class SU_Module {
|
|
1911 |
'time' => __("Date", 'seo-ultimate')
|
1912 |
, 'ip_address' => __("IP Address", 'seo-ultimate')
|
1913 |
, 'user_agent' => __("Browser", 'seo-ultimate')
|
1914 |
-
, 'url' => __("URL", 'seo-ultimate')
|
|
|
1915 |
, 'status_code' => __("Status Code", 'seo-ultimate')
|
1916 |
);
|
1917 |
|
1918 |
$fields = array();
|
1919 |
|
1920 |
foreach ($allfields as $col => $title) {
|
1921 |
-
if (strpos($where, $col) === false) $fields[$col] = $title;
|
1922 |
}
|
1923 |
|
1924 |
-
|
1925 |
|
1926 |
echo "<table class='widefat' cellspacing='0'>\n\t<thead><tr>\n";
|
1927 |
|
@@ -1934,7 +2029,7 @@ class SU_Module {
|
|
1934 |
|
1935 |
foreach ($result as $row) {
|
1936 |
|
1937 |
-
if ($row['is_new']) $class = ' class="new-hit"'; else $class='';
|
1938 |
echo "\t\t<tr$class>\n";
|
1939 |
|
1940 |
foreach ($fields as $col => $title) {
|
@@ -1953,19 +2048,20 @@ class SU_Module {
|
|
1953 |
case 'url':
|
1954 |
if ($actions_callback) {
|
1955 |
$actions = call_user_func(array($this, $actions_callback), $row);
|
1956 |
-
$actions = apply_filters("
|
1957 |
$cell = $this->hover_row($cell, $actions);
|
1958 |
}
|
1959 |
break;
|
1960 |
}
|
1961 |
|
|
|
|
|
1962 |
$class = str_replace(' ', '-', strtolower($title));
|
1963 |
echo "\t\t\t<td class='hit-$class'>$cell</td>\n";
|
1964 |
}
|
1965 |
echo "\t\t</tr>\n";
|
1966 |
|
1967 |
$wpdb->update($table, array('is_new' => 0), array('id' => $row['id']));
|
1968 |
-
//$wpdb->query($wpdb->prepare("UPDATE $table SET is_new=0 WHERE id = %d", $row['id']));
|
1969 |
}
|
1970 |
|
1971 |
echo "\t</tbody>\n</table>\n";
|
3 |
Plugin Name: SEO Ultimate
|
4 |
Plugin URI: http://www.seodesignsolutions.com/wordpress-seo/
|
5 |
Description: This all-in-one SEO plugin can rewrite title tags and add noindex to pages (with many more features coming soon).
|
6 |
+
Version: 0.2
|
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 0.2
|
16 |
* @link http://www.seodesignsolutions.com/wordpress-seo/ SEO Ultimate Homepage
|
17 |
*/
|
18 |
|
38 |
|
39 |
define("SU_PLUGIN_NAME", "SEO Ultimate");
|
40 |
define("SU_PLUGIN_URI", "http://www.seodesignsolutions.com/wordpress-seo/");
|
41 |
+
define("SU_VERSION", "0.2");
|
42 |
define("SU_AUTHOR", "SEO Design Solutions");
|
43 |
define("SU_AUTHOR_URI", "http://www.seodesignsolutions.com/");
|
44 |
+
define("SU_USER_AGENT", "SeoUltimate/0.2");
|
45 |
|
46 |
|
47 |
/********** CLASSES **********/
|
113 |
*/
|
114 |
var $plugin_dir_url;
|
115 |
|
116 |
+
/**
|
117 |
+
* The database ID of the current hit.
|
118 |
+
*
|
119 |
+
* @since 0.2
|
120 |
+
* @var int
|
121 |
+
*/
|
122 |
+
var $hit_id = 0;
|
123 |
+
|
124 |
|
125 |
/********** CLASS CONSTRUCTORS **********/
|
126 |
|
129 |
* PHP5-style constructor.
|
130 |
*
|
131 |
* @since 0.1
|
132 |
+
* @uses load_plugin_data()
|
133 |
* @uses SU_VERSION
|
134 |
* @uses install()
|
135 |
* @uses upgrade()
|
|
|
136 |
* @uses load_modules()
|
137 |
* @uses activate() Registered with WordPress as the activation hook.
|
138 |
* @uses init() Hooked into WordPress's "init" action.
|
141 |
* @uses admin_includes() Hooked into WordPress's "admin_head" action.
|
142 |
* @uses plugin_page_notices() Hooked into WordPress's "admin_head" action.
|
143 |
* @uses admin_help() Hooked into WordPress's "contextual_help" action.
|
144 |
+
* @uses log_redirect() Hooked into WordPress's "wp_redirect" action.
|
145 |
* @uses log_hit() Hooked into WordPress's "status_header" action.
|
146 |
*/
|
147 |
function __construct() {
|
148 |
|
149 |
+
/********** CLASS CONSTRUCTION **********/
|
150 |
+
|
151 |
+
//Load data about the plugin file itself into the class
|
152 |
+
$this->load_plugin_data();
|
153 |
+
|
154 |
+
|
155 |
/********** VERSION CHECKING **********/
|
156 |
|
157 |
//Get the current version, and the version when the plugin last ran
|
173 |
|
174 |
/********** INITIALIZATION **********/
|
175 |
|
|
|
|
|
|
|
176 |
//Load plugin modules. Must be called *after* load_plugin_data()
|
177 |
$this->load_modules();
|
178 |
|
191 |
|
192 |
/********** ACTION & FILTER HOOKS **********/
|
193 |
|
194 |
+
//Initializes modules at WordPress initialization
|
195 |
add_action('init', array($this, 'init'));
|
196 |
|
197 |
//Hook to output all <head> code
|
220 |
add_action('in_plugin_update_message-'.plugin_basename(__FILE__), array($this, 'plugin_update_info'), 10, 2);
|
221 |
|
222 |
//Log this visitor!
|
223 |
+
add_filter('wp_redirect', array($this, 'log_redirect'), 10, 2);
|
224 |
add_filter('status_header', array($this, 'log_hit'), 10, 2);
|
225 |
}
|
226 |
|
244 |
* @since 0.1
|
245 |
*/
|
246 |
function install() {
|
247 |
+
|
248 |
//Add the database table
|
249 |
$this->db_setup();
|
250 |
+
|
251 |
+
//Load settings file if present
|
252 |
+
if (get_option('su_settings') === false && is_readable($settingsfile = $this->plugin_dir_path.'settings.txt')) {
|
253 |
+
$import = base64_decode(file_get_contents($settingsfile));
|
254 |
+
if (is_serialized($import)) update_option('su_settings', $import);
|
255 |
+
}
|
256 |
}
|
257 |
|
258 |
/**
|
477 |
ip_address VARCHAR(255) NOT NULL,
|
478 |
user_agent VARCHAR(255) NOT NULL,
|
479 |
url TEXT NOT NULL,
|
480 |
+
redirect_url TEXT NOT NULL,
|
481 |
status_code SMALLINT(3) NOT NULL,
|
482 |
is_new BOOL NOT NULL,
|
483 |
PRIMARY KEY (id)
|
508 |
*
|
509 |
* @since 0.1
|
510 |
* @uses get_current_url()
|
511 |
+
* @uses $hit_id
|
512 |
*
|
513 |
* @param string $status_header The full HTTP status header. Unused and returned as-is.
|
514 |
* @param int $status_code The numeric HTTP status code.
|
515 |
+
* @param string $redirect_url The URL to which the visitor is being redirected. Optional.
|
516 |
* @return string Returns the $status_header variable unchanged.
|
517 |
*/
|
518 |
+
function log_hit($status_header, $status_code, $redirect_url = '') {
|
519 |
if (!is_user_logged_in()) {
|
520 |
global $wpdb;
|
521 |
|
523 |
$url = $this->get_current_url();
|
524 |
$is_new = (count($wpdb->get_results($wpdb->prepare("SELECT url FROM $table WHERE url = %s AND is_new = 0", $url))) == 0);
|
525 |
|
526 |
+
$data = array(
|
527 |
+
'time' => time()
|
528 |
+
, 'ip_address' => $_SERVER['REMOTE_ADDR']
|
529 |
+
, 'user_agent' => $_SERVER['HTTP_USER_AGENT']
|
530 |
+
, 'url' => $url
|
531 |
+
, 'redirect_url' => $redirect_url
|
532 |
+
, 'status_code' => $status_code
|
533 |
+
, 'is_new' => $is_new
|
534 |
);
|
535 |
+
|
536 |
+
if ($this->hit_id > 0) {
|
537 |
+
|
538 |
+
//We don't want to overwrite a redirect URL if it's already been logged
|
539 |
+
if (!strlen($data['redirect_url'])) unset($data['redirect_url']);
|
540 |
+
|
541 |
+
//Update the existing hit record
|
542 |
+
$wpdb->update($table, $data, array('id' => $this->hit_id));
|
543 |
+
} else {
|
544 |
+
$wpdb->insert($table, $data);
|
545 |
+
$this->hit_id = $wpdb->insert_id;
|
546 |
+
}
|
547 |
}
|
548 |
|
549 |
return $status_header;
|
550 |
}
|
551 |
|
552 |
+
/**
|
553 |
+
* A wp_redirect WordPress filter that logs the current hit.
|
554 |
+
*
|
555 |
+
* @since 0.2
|
556 |
+
* @uses log_hit()
|
557 |
+
*
|
558 |
+
* @param string $redirect_url The URL to which the visitor is being redirected.
|
559 |
+
* @param int $status_code The numeric HTTP status code.
|
560 |
+
* @return string The unchanged $redirect_url parameter.
|
561 |
+
*/
|
562 |
+
function log_redirect($redirect_url, $status_code) {
|
563 |
+
$this->log_hit(null, $status_code, $redirect_url);
|
564 |
+
return $redirect_url;
|
565 |
+
}
|
566 |
+
|
567 |
|
568 |
/********** ADMIN MENU FUNCTIONS **********/
|
569 |
|
590 |
$count_code = $this->get_menu_count_code($count);
|
591 |
|
592 |
//Add the "SEO" menu item!
|
593 |
+
add_utility_page(__('SEO Ultimate', 'seo-ultimate'), __('SEO', 'seo-ultimate').$count_code, 'manage_options', 'seo', array(), 'div');
|
|
|
594 |
|
595 |
//Translations and count codes will mess up the admin page hook, so we need to fix it manually.
|
596 |
global $admin_page_hooks;
|
1093 |
else
|
1094 |
return $url.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
|
1095 |
}
|
1096 |
+
|
1097 |
+
/**
|
1098 |
+
* Determines the ID of the current post.
|
1099 |
+
* Works in the admin as well as the front-end.
|
1100 |
+
*
|
1101 |
+
* @since 0.2
|
1102 |
+
*
|
1103 |
+
* @return int|false The ID of the current post, or false on failure.
|
1104 |
+
*/
|
1105 |
+
function get_post_id() {
|
1106 |
+
if (is_admin())
|
1107 |
+
return intval($_REQUEST['post']);
|
1108 |
+
elseif (in_the_loop())
|
1109 |
+
return intval(get_the_ID());
|
1110 |
+
elseif (is_singular()) {
|
1111 |
+
global $wp_query;
|
1112 |
+
return $wp_query->get_queried_object_id();
|
1113 |
+
}
|
1114 |
+
|
1115 |
+
return false;
|
1116 |
+
}
|
1117 |
}
|
1118 |
|
1119 |
/**
|
1271 |
*
|
1272 |
* @since 0.1
|
1273 |
*
|
1274 |
+
* @return string|false The help text, or false if no custom help is available.
|
1275 |
*/
|
1276 |
function admin_help() { return false; }
|
1277 |
|
1300 |
function init_pre() {
|
1301 |
$defaults = $this->get_default_settings();
|
1302 |
foreach ($defaults as $setting => $default) {
|
1303 |
+
if ($this->get_setting($setting, "{reset}") === "{reset}")
|
1304 |
$this->update_setting($setting, $default);
|
1305 |
}
|
1306 |
|
1349 |
* @uses get_module_key()
|
1350 |
*
|
1351 |
* @param string $key The name of the setting to retrieve.
|
1352 |
+
* @param mixed $default What should be returned if the setting does not exist. Optional.
|
1353 |
+
* @param string|null $module The module to which the setting belongs. Defaults to the current module. Optional.
|
1354 |
* @return mixed The value of the setting, or the $default variable.
|
1355 |
*/
|
1356 |
function get_setting($key, $default=null, $module=null) {
|
1357 |
if (!$module) $module = $this->get_module_key();
|
1358 |
$settings = maybe_unserialize(get_option('su_settings'));
|
1359 |
if (isset($settings[$module][$key]))
|
1360 |
+
$setting = $settings[$module][$key];
|
1361 |
else
|
1362 |
+
$setting = $default;
|
1363 |
+
|
1364 |
+
return apply_filters("su_get_setting-$module-$key", $setting);
|
1365 |
}
|
1366 |
|
1367 |
/**
|
1372 |
*
|
1373 |
* @param string $key The key of the setting to be changed.
|
1374 |
* @param string $value The new value to assign to the setting.
|
1375 |
+
* @param string|null $module The module to which the setting belongs. Defaults to the current module. Optional.
|
1376 |
*/
|
1377 |
+
function update_setting($key, $value, $module=null) {
|
1378 |
+
if (!$module) $module = $this->get_module_key();
|
1379 |
+
|
1380 |
+
if (!apply_filters("su_custom_update_setting-$module-$key", false, $value)) {
|
1381 |
+
$settings = maybe_unserialize(get_option('su_settings'));
|
1382 |
+
if (!$settings) $settings = array();
|
1383 |
+
$settings[$module][$key] = $value;
|
1384 |
+
update_option('su_settings', serialize($settings));
|
1385 |
+
}
|
1386 |
}
|
1387 |
|
1388 |
/**
|
1698 |
* @uses get_setting()
|
1699 |
*
|
1700 |
* @param array $textareas An array of textareas. (Field/setting IDs are the keys, and descriptions are the values.)
|
1701 |
+
* @param int $rows The value of the textareas' rows attribute.
|
1702 |
+
* @param int $cols The value of the textareas' cols attribute.
|
1703 |
*/
|
1704 |
+
function textareas($textareas, $rows = 5, $cols = 30) {
|
1705 |
|
1706 |
if ($this->is_action('update')) {
|
1707 |
foreach ($textareas as $id => $title) {
|
1711 |
|
1712 |
foreach ($textareas as $id => $title) {
|
1713 |
register_setting($this->get_module_key(), $id);
|
1714 |
+
$value = wp_specialchars($this->get_setting($id), ENT_QUOTES, false, true);
|
1715 |
$id = attribute_escape($id);
|
1716 |
|
1717 |
echo "<tr valign='top'>\n<th scope='row'><label for='$id'>$title</label></th>\n";
|
1718 |
+
echo "<td><textarea name='$id' id='$id' type='text' class='regular-text' cols='$cols' rows='$rows'>$value</textarea>";
|
1719 |
echo "</td>\n</tr>\n";
|
1720 |
}
|
1721 |
}
|
1728 |
*
|
1729 |
* @param string $id The field/setting ID.
|
1730 |
* @param string $title The label of the HTML element.
|
1731 |
+
* @param int $rows The value of the textarea's rows attribute.
|
1732 |
+
* @param int $cols The value of the textarea's cols attribute.
|
1733 |
* @return string The HTML that would render the textarea.
|
1734 |
*/
|
1735 |
+
function textarea($id, $title, $rows = 5, $cols = 30) {
|
1736 |
+
$this->textareas(array($id => $title), $rows, $cols);
|
1737 |
}
|
1738 |
|
1739 |
/********** ADMIN SECURITY FUNCTIONS **********/
|
1982 |
|
1983 |
/********** HITS LOG FUNCTIONS **********/
|
1984 |
|
1985 |
+
/**
|
1986 |
+
* Lists logged hits in an administration table.
|
1987 |
+
*
|
1988 |
+
* @since 0.1
|
1989 |
+
*
|
1990 |
+
* @param string|false $where The WHERE portion of the SQL query to execute.
|
1991 |
+
* @param string|false $actions_callback The name of the module-child function from which to obtain a return value of URL-cell action link HTML.
|
1992 |
+
* @param bool $highlight_new Whether or not to highlight new rows. Optional.
|
1993 |
+
*/
|
1994 |
+
function hits_table($where = false, $actions_callback = false, $highlight_new = true) {
|
1995 |
global $wpdb;
|
1996 |
$mk = $this->get_module_key();
|
1997 |
|
2005 |
'time' => __("Date", 'seo-ultimate')
|
2006 |
, 'ip_address' => __("IP Address", 'seo-ultimate')
|
2007 |
, 'user_agent' => __("Browser", 'seo-ultimate')
|
2008 |
+
, 'url' => __("URL Requested", 'seo-ultimate')
|
2009 |
+
, 'redirect_url' => __("Redirected To", 'seo-ultimate')
|
2010 |
, 'status_code' => __("Status Code", 'seo-ultimate')
|
2011 |
);
|
2012 |
|
2013 |
$fields = array();
|
2014 |
|
2015 |
foreach ($allfields as $col => $title) {
|
2016 |
+
if (strpos($where, $col.'=') === false) $fields[$col] = $title;
|
2017 |
}
|
2018 |
|
2019 |
+
$fields = apply_filters("su_{$mk}_hits_table_columns", $fields);
|
2020 |
|
2021 |
echo "<table class='widefat' cellspacing='0'>\n\t<thead><tr>\n";
|
2022 |
|
2029 |
|
2030 |
foreach ($result as $row) {
|
2031 |
|
2032 |
+
if ($highlight_new && $row['is_new']) $class = ' class="new-hit"'; else $class='';
|
2033 |
echo "\t\t<tr$class>\n";
|
2034 |
|
2035 |
foreach ($fields as $col => $title) {
|
2048 |
case 'url':
|
2049 |
if ($actions_callback) {
|
2050 |
$actions = call_user_func(array($this, $actions_callback), $row);
|
2051 |
+
$actions = apply_filters("su_{$mk}_hits_table_actions", $actions, $row);
|
2052 |
$cell = $this->hover_row($cell, $actions);
|
2053 |
}
|
2054 |
break;
|
2055 |
}
|
2056 |
|
2057 |
+
$cell = apply_filters("su_{$mk}_hits_table_{$col}_cell", $cell, $row);
|
2058 |
+
|
2059 |
$class = str_replace(' ', '-', strtolower($title));
|
2060 |
echo "\t\t\t<td class='hit-$class'>$cell</td>\n";
|
2061 |
}
|
2062 |
echo "\t\t</tr>\n";
|
2063 |
|
2064 |
$wpdb->update($table, array('is_new' => 0), array('id' => $row['id']));
|
|
|
2065 |
}
|
2066 |
|
2067 |
echo "\t</tbody>\n</table>\n";
|
seo-ultimate.pot
DELETED
@@ -1,119 +0,0 @@
|
|
1 |
-
# SEO Ultimate
|
2 |
-
# Copyright (C) 2009 SEO Design Solutions
|
3 |
-
# This file is distributed under the same license as the SEO Ultimate package.
|
4 |
-
#
|
5 |
-
#, fuzzy
|
6 |
-
msgid ""
|
7 |
-
msgstr ""
|
8 |
-
"Project-Id-Version: 0.1\n"
|
9 |
-
"Report-Msgid-Bugs-To: http://wordpress.org/tag/seo-ultimate\n"
|
10 |
-
"POT-Creation-Date: 2009-05-22 15:59+0000\n"
|
11 |
-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
12 |
-
"Language-Team: LANGUAGE <LL@li.org>\n"
|
13 |
-
"MIME-Version: 1.0\n"
|
14 |
-
"Content-Type: text/plain; charset=CHARSET\n"
|
15 |
-
"Content-Transfer-Encoding: 8bit\n"
|
16 |
-
|
17 |
-
#. #-#-#-#-# plugin.pot (PACKAGE VERSION) #-#-#-#-#
|
18 |
-
#. Plugin Name of an extension
|
19 |
-
#: seo-ultimate.php:540
|
20 |
-
msgid "SEO Ultimate"
|
21 |
-
msgstr ""
|
22 |
-
|
23 |
-
#: seo-ultimate.php:540
|
24 |
-
msgid "SEO"
|
25 |
-
msgstr ""
|
26 |
-
|
27 |
-
#: seo-ultimate.php:726
|
28 |
-
#, php-format
|
29 |
-
msgid "%s Help"
|
30 |
-
msgstr ""
|
31 |
-
|
32 |
-
#: seo-ultimate.php:746
|
33 |
-
msgid "SEO Settings Help"
|
34 |
-
msgstr ""
|
35 |
-
|
36 |
-
#: seo-ultimate.php:748
|
37 |
-
msgid "The SEO Settings box lets you customize these settings:"
|
38 |
-
msgstr ""
|
39 |
-
|
40 |
-
#: seo-ultimate.php:750
|
41 |
-
msgid "(The SEO Settings box is part of the SEO Ultimate plugin.)"
|
42 |
-
msgstr ""
|
43 |
-
|
44 |
-
#: seo-ultimate.php:794
|
45 |
-
#, php-format
|
46 |
-
msgid ""
|
47 |
-
"SEO Ultimate includes the functionality of %1$s. You may want to deactivate %"
|
48 |
-
"1$s to avoid plugin conflicts."
|
49 |
-
msgstr ""
|
50 |
-
|
51 |
-
#: seo-ultimate.php:862
|
52 |
-
msgid "SEO Settings"
|
53 |
-
msgstr ""
|
54 |
-
|
55 |
-
#: seo-ultimate.php:1425
|
56 |
-
#, php-format
|
57 |
-
msgid "%1$s | %2$s %3$s by %4$s"
|
58 |
-
msgstr ""
|
59 |
-
|
60 |
-
#: seo-ultimate.php:1457
|
61 |
-
msgid "Settings updated."
|
62 |
-
msgstr ""
|
63 |
-
|
64 |
-
#: seo-ultimate.php:1477
|
65 |
-
msgid "Save Changes"
|
66 |
-
msgstr ""
|
67 |
-
|
68 |
-
#: seo-ultimate.php:1566
|
69 |
-
msgid ""
|
70 |
-
"Are you sure you want to replace the textbox contents with this default "
|
71 |
-
"value?"
|
72 |
-
msgstr ""
|
73 |
-
|
74 |
-
#: seo-ultimate.php:1579
|
75 |
-
msgid "Reset"
|
76 |
-
msgstr ""
|
77 |
-
|
78 |
-
#: seo-ultimate.php:1911
|
79 |
-
msgid "Date"
|
80 |
-
msgstr ""
|
81 |
-
|
82 |
-
#: seo-ultimate.php:1912
|
83 |
-
msgid "IP Address"
|
84 |
-
msgstr ""
|
85 |
-
|
86 |
-
#: seo-ultimate.php:1913
|
87 |
-
msgid "Browser"
|
88 |
-
msgstr ""
|
89 |
-
|
90 |
-
#: seo-ultimate.php:1914
|
91 |
-
msgid "URL"
|
92 |
-
msgstr ""
|
93 |
-
|
94 |
-
#: seo-ultimate.php:1915
|
95 |
-
msgid "Status Code"
|
96 |
-
msgstr ""
|
97 |
-
|
98 |
-
#: seo-ultimate.php:1947
|
99 |
-
#, php-format
|
100 |
-
msgid "%1$s<br />%2$s"
|
101 |
-
msgstr ""
|
102 |
-
|
103 |
-
#. Plugin URI of an extension
|
104 |
-
msgid "http://www.seodesignsolutions.com/wordpress-seo/"
|
105 |
-
msgstr ""
|
106 |
-
|
107 |
-
#. Description of an extension
|
108 |
-
msgid ""
|
109 |
-
"This all-in-one SEO plugin can rewrite title tags and add noindex to pages "
|
110 |
-
"(with many more features coming soon)."
|
111 |
-
msgstr ""
|
112 |
-
|
113 |
-
#. Author of an extension
|
114 |
-
msgid "SEO Design Solutions"
|
115 |
-
msgstr ""
|
116 |
-
|
117 |
-
#. Author URI of an extension
|
118 |
-
msgid "http://www.seodesignsolutions.com/"
|
119 |
-
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|