All in One SEO Pack - Version 2.0

Version Description

Download this release

Release Info

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

Code changes from version 1.6.15.3 to 2.0

Files changed (53) hide show
  1. JSON.php +804 -0
  2. aioseop.class.php +0 -2479
  3. aioseop_class.php +1819 -0
  4. aioseop_feature_manager.php +93 -0
  5. aioseop_functions.php +264 -246
  6. aioseop_module-rtl.css +143 -0
  7. aioseop_module.css +656 -0
  8. aioseop_module.js +236 -0
  9. aioseop_module_class.php +1265 -0
  10. aioseop_module_manager.php +107 -0
  11. aioseop_performance.php +248 -0
  12. aioseop_utility.php +1 -1
  13. all_in_one_seo_pack-fa_IR.mo +0 -0
  14. all_in_one_seo_pack-ja.mo +0 -0
  15. all_in_one_seo_pack-ko_KR.mo +0 -0
  16. all_in_one_seo_pack-sk_SK.mo +0 -0
  17. all_in_one_seo_pack.php +73 -48
  18. all_in_one_seo_pack.pot +837 -285
  19. images/Default-BW-Retina.png +0 -0
  20. images/Default-BW-Standard.png +0 -0
  21. images/Default-Color-Retina.png +0 -0
  22. images/Default-Color-Standard.png +0 -0
  23. images/Performance-BW-Retina.png +0 -0
  24. images/Performance-BW-Standard.png +0 -0
  25. images/Performance-Color-Retina.png +0 -0
  26. images/Performance-Color-Standard.png +0 -0
  27. images/accept.png +0 -0
  28. images/activity.gif +0 -0
  29. images/cog_edit.png +0 -0
  30. images/default-user-image.png +0 -0
  31. images/delete.png +0 -0
  32. images/error.png +0 -0
  33. images/facebook-follow-retina.png +0 -0
  34. images/facebook-follow-standard.png +0 -0
  35. images/globe.png +0 -0
  36. images/iblogpro.jpg +0 -0
  37. images/pagelines.jpg +0 -0
  38. images/question.png +0 -0
  39. images/shield-sprite-16.png +0 -0
  40. images/shield-sprite-32.png +0 -0
  41. images/shield32.png +0 -0
  42. images/shield32fade.png +0 -0
  43. images/shield64.png +0 -0
  44. images/stationpro.jpg +0 -0
  45. images/twitter-follow-retina.png +0 -0
  46. images/twitter-follow-standard.png +0 -0
  47. images/twitter.png +0 -0
  48. images/update32.png +0 -0
  49. images/update64.png +0 -0
  50. images/whitehouse.jpg +0 -0
  51. quickedit_functions.js +41 -0
  52. readme.txt +2 -2
  53. wpml-config.xml +25 -0
JSON.php ADDED
@@ -0,0 +1,804 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
3
+
4
+ /**
5
+ * Converts to and from JSON format.
6
+ *
7
+ * JSON (JavaScript Object Notation) is a lightweight data-interchange
8
+ * format. It is easy for humans to read and write. It is easy for machines
9
+ * to parse and generate. It is based on a subset of the JavaScript
10
+ * Programming Language, Standard ECMA-262 3rd Edition - December 1999.
11
+ * This feature can also be found in Python. JSON is a text format that is
12
+ * completely language independent but uses conventions that are familiar
13
+ * to programmers of the C-family of languages, including C, C++, C#, Java,
14
+ * JavaScript, Perl, TCL, and many others. These properties make JSON an
15
+ * ideal data-interchange language.
16
+ *
17
+ * This package provides a simple encoder and decoder for JSON notation. It
18
+ * is intended for use with client-side Javascript applications that make
19
+ * use of HTTPRequest to perform server communication functions - data can
20
+ * be encoded into JSON notation for use in a client-side javascript, or
21
+ * decoded from incoming Javascript requests. JSON format is native to
22
+ * Javascript, and can be directly eval()'ed with no further parsing
23
+ * overhead
24
+ *
25
+ * All strings should be in ASCII or UTF-8 format!
26
+ *
27
+ * LICENSE: Redistribution and use in source and binary forms, with or
28
+ * without modification, are permitted provided that the following
29
+ * conditions are met: Redistributions of source code must retain the
30
+ * above copyright notice, this list of conditions and the following
31
+ * disclaimer. Redistributions in binary form must reproduce the above
32
+ * copyright notice, this list of conditions and the following disclaimer
33
+ * in the documentation and/or other materials provided with the
34
+ * distribution.
35
+ *
36
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
37
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
38
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
39
+ * NO EVENT SHALL CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
40
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
41
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
42
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
43
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
44
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
45
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
46
+ * DAMAGE.
47
+ *
48
+ * @category
49
+ * @package Services_JSON
50
+ * @author Michal Migurski <mike-json@teczno.com>
51
+ * @author Matt Knapp <mdknapp[at]gmail[dot]com>
52
+ * @author Brett Stimmerman <brettstimmerman[at]gmail[dot]com>
53
+ * @copyright 2005 Michal Migurski
54
+ * @version CVS: $Id: JSON.php,v 1.31 2006/06/28 05:54:17 migurski Exp $
55
+ * @license http://www.opensource.org/licenses/bsd-license.php
56
+ * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=198
57
+ */
58
+
59
+ /**
60
+ * Marker constant for Services_JSON::decode(), used to flag stack state
61
+ */
62
+ define('SERVICES_JSON_SLICE', 1);
63
+
64
+ /**
65
+ * Marker constant for Services_JSON::decode(), used to flag stack state
66
+ */
67
+ define('SERVICES_JSON_IN_STR', 2);
68
+
69
+ /**
70
+ * Marker constant for Services_JSON::decode(), used to flag stack state
71
+ */
72
+ define('SERVICES_JSON_IN_ARR', 3);
73
+
74
+ /**
75
+ * Marker constant for Services_JSON::decode(), used to flag stack state
76
+ */
77
+ define('SERVICES_JSON_IN_OBJ', 4);
78
+
79
+ /**
80
+ * Marker constant for Services_JSON::decode(), used to flag stack state
81
+ */
82
+ define('SERVICES_JSON_IN_CMT', 5);
83
+
84
+ /**
85
+ * Behavior switch for Services_JSON::decode()
86
+ */
87
+ define('SERVICES_JSON_LOOSE_TYPE', 16);
88
+
89
+ /**
90
+ * Behavior switch for Services_JSON::decode()
91
+ */
92
+ define('SERVICES_JSON_SUPPRESS_ERRORS', 32);
93
+
94
+ /**
95
+ * Converts to and from JSON format.
96
+ *
97
+ * Brief example of use:
98
+ *
99
+ * <code>
100
+ * // create a new instance of Services_JSON
101
+ * $json = new Services_JSON();
102
+ *
103
+ * // convert a complexe value to JSON notation, and send it to the browser
104
+ * $value = array('foo', 'bar', array(1, 2, 'baz'), array(3, array(4)));
105
+ * $output = $json->encode($value);
106
+ *
107
+ * print($output);
108
+ * // prints: ["foo","bar",[1,2,"baz"],[3,[4]]]
109
+ *
110
+ * // accept incoming POST data, assumed to be in JSON notation
111
+ * $input = file_get_contents('php://input', 1000000);
112
+ * $value = $json->decode($input);
113
+ * </code>
114
+ */
115
+ class Services_JSON
116
+ {
117
+ /**
118
+ * constructs a new JSON instance
119
+ *
120
+ * @param int $use object behavior flags; combine with boolean-OR
121
+ *
122
+ * possible values:
123
+ * - SERVICES_JSON_LOOSE_TYPE: loose typing.
124
+ * "{...}" syntax creates associative arrays
125
+ * instead of objects in decode().
126
+ * - SERVICES_JSON_SUPPRESS_ERRORS: error suppression.
127
+ * Values which can't be encoded (e.g. resources)
128
+ * appear as NULL instead of throwing errors.
129
+ * By default, a deeply-nested resource will
130
+ * bubble up with an error, so all return values
131
+ * from encode() should be checked with isError()
132
+ */
133
+ function Services_JSON($use = 0)
134
+ {
135
+ $this->use = $use;
136
+ }
137
+
138
+ /**
139
+ * convert a string from one UTF-16 char to one UTF-8 char
140
+ *
141
+ * Normally should be handled by mb_convert_encoding, but
142
+ * provides a slower PHP-only method for installations
143
+ * that lack the multibye string extension.
144
+ *
145
+ * @param string $utf16 UTF-16 character
146
+ * @return string UTF-8 character
147
+ * @access private
148
+ */
149
+ function utf162utf8($utf16)
150
+ {
151
+ // oh please oh please oh please oh please oh please
152
+ if(function_exists('mb_convert_encoding')) {
153
+ return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
154
+ }
155
+
156
+ $bytes = (ord($utf16{0}) << 8) | ord($utf16{1});
157
+
158
+ switch(true) {
159
+ case ((0x7F & $bytes) == $bytes):
160
+ // this case should never be reached, because we are in ASCII range
161
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
162
+ return chr(0x7F & $bytes);
163
+
164
+ case (0x07FF & $bytes) == $bytes:
165
+ // return a 2-byte UTF-8 character
166
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
167
+ return chr(0xC0 | (($bytes >> 6) & 0x1F))
168
+ . chr(0x80 | ($bytes & 0x3F));
169
+
170
+ case (0xFFFF & $bytes) == $bytes:
171
+ // return a 3-byte UTF-8 character
172
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
173
+ return chr(0xE0 | (($bytes >> 12) & 0x0F))
174
+ . chr(0x80 | (($bytes >> 6) & 0x3F))
175
+ . chr(0x80 | ($bytes & 0x3F));
176
+ }
177
+
178
+ // ignoring UTF-32 for now, sorry
179
+ return '';
180
+ }
181
+
182
+ /**
183
+ * convert a string from one UTF-8 char to one UTF-16 char
184
+ *
185
+ * Normally should be handled by mb_convert_encoding, but
186
+ * provides a slower PHP-only method for installations
187
+ * that lack the multibye string extension.
188
+ *
189
+ * @param string $utf8 UTF-8 character
190
+ * @return string UTF-16 character
191
+ * @access private
192
+ */
193
+ function utf82utf16($utf8)
194
+ {
195
+ // oh please oh please oh please oh please oh please
196
+ if(function_exists('mb_convert_encoding')) {
197
+ return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8');
198
+ }
199
+
200
+ switch(strlen($utf8)) {
201
+ case 1:
202
+ // this case should never be reached, because we are in ASCII range
203
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
204
+ return $utf8;
205
+
206
+ case 2:
207
+ // return a UTF-16 character from a 2-byte UTF-8 char
208
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
209
+ return chr(0x07 & (ord($utf8{0}) >> 2))
210
+ . chr((0xC0 & (ord($utf8{0}) << 6))
211
+ | (0x3F & ord($utf8{1})));
212
+
213
+ case 3:
214
+ // return a UTF-16 character from a 3-byte UTF-8 char
215
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
216
+ return chr((0xF0 & (ord($utf8{0}) << 4))
217
+ | (0x0F & (ord($utf8{1}) >> 2)))
218
+ . chr((0xC0 & (ord($utf8{1}) << 6))
219
+ | (0x7F & ord($utf8{2})));
220
+ }
221
+
222
+ // ignoring UTF-32 for now, sorry
223
+ return '';
224
+ }
225
+
226
+ /**
227
+ * encodes an arbitrary variable into JSON format
228
+ *
229
+ * @param mixed $var any number, boolean, string, array, or object to be encoded.
230
+ * see argument 1 to Services_JSON() above for array-parsing behavior.
231
+ * if var is a strng, note that encode() always expects it
232
+ * to be in ASCII or UTF-8 format!
233
+ *
234
+ * @return mixed JSON string representation of input var or an error if a problem occurs
235
+ * @access public
236
+ */
237
+ function encode($var)
238
+ {
239
+ switch (gettype($var)) {
240
+ case 'boolean':
241
+ return $var ? 'true' : 'false';
242
+
243
+ case 'NULL':
244
+ return 'null';
245
+
246
+ case 'integer':
247
+ return (int) $var;
248
+
249
+ case 'double':
250
+ case 'float':
251
+ return (float) $var;
252
+
253
+ case 'string':
254
+ // STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT
255
+ $ascii = '';
256
+ $strlen_var = strlen($var);
257
+
258
+ /*
259
+ * Iterate over every character in the string,
260
+ * escaping with a slash or encoding to UTF-8 where necessary
261
+ */
262
+ for ($c = 0; $c < $strlen_var; ++$c) {
263
+
264
+ $ord_var_c = ord($var{$c});
265
+
266
+ switch (true) {
267
+ case $ord_var_c == 0x08:
268
+ $ascii .= '\b';
269
+ break;
270
+ case $ord_var_c == 0x09:
271
+ $ascii .= '\t';
272
+ break;
273
+ case $ord_var_c == 0x0A:
274
+ $ascii .= '\n';
275
+ break;
276
+ case $ord_var_c == 0x0C:
277
+ $ascii .= '\f';
278
+ break;
279
+ case $ord_var_c == 0x0D:
280
+ $ascii .= '\r';
281
+ break;
282
+
283
+ case $ord_var_c == 0x22:
284
+ case $ord_var_c == 0x2F:
285
+ case $ord_var_c == 0x5C:
286
+ // double quote, slash, slosh
287
+ $ascii .= '\\'.$var{$c};
288
+ break;
289
+
290
+ case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
291
+ // characters U-00000000 - U-0000007F (same as ASCII)
292
+ $ascii .= $var{$c};
293
+ break;
294
+
295
+ case (($ord_var_c & 0xE0) == 0xC0):
296
+ // characters U-00000080 - U-000007FF, mask 110XXXXX
297
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
298
+ $char = pack('C*', $ord_var_c, ord($var{$c + 1}));
299
+ $c += 1;
300
+ $utf16 = $this->utf82utf16($char);
301
+ $ascii .= sprintf('\u%04s', bin2hex($utf16));
302
+ break;
303
+
304
+ case (($ord_var_c & 0xF0) == 0xE0):
305
+ // characters U-00000800 - U-0000FFFF, mask 1110XXXX
306
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
307
+ $char = pack('C*', $ord_var_c,
308
+ ord($var{$c + 1}),
309
+ ord($var{$c + 2}));
310
+ $c += 2;
311
+ $utf16 = $this->utf82utf16($char);
312
+ $ascii .= sprintf('\u%04s', bin2hex($utf16));
313
+ break;
314
+
315
+ case (($ord_var_c & 0xF8) == 0xF0):
316
+ // characters U-00010000 - U-001FFFFF, mask 11110XXX
317
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
318
+ $char = pack('C*', $ord_var_c,
319
+ ord($var{$c + 1}),
320
+ ord($var{$c + 2}),
321
+ ord($var{$c + 3}));
322
+ $c += 3;
323
+ $utf16 = $this->utf82utf16($char);
324
+ $ascii .= sprintf('\u%04s', bin2hex($utf16));
325
+ break;
326
+
327
+ case (($ord_var_c & 0xFC) == 0xF8):
328
+ // characters U-00200000 - U-03FFFFFF, mask 111110XX
329
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
330
+ $char = pack('C*', $ord_var_c,
331
+ ord($var{$c + 1}),
332
+ ord($var{$c + 2}),
333
+ ord($var{$c + 3}),
334
+ ord($var{$c + 4}));
335
+ $c += 4;
336
+ $utf16 = $this->utf82utf16($char);
337
+ $ascii .= sprintf('\u%04s', bin2hex($utf16));
338
+ break;
339
+
340
+ case (($ord_var_c & 0xFE) == 0xFC):
341
+ // characters U-04000000 - U-7FFFFFFF, mask 1111110X
342
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
343
+ $char = pack('C*', $ord_var_c,
344
+ ord($var{$c + 1}),
345
+ ord($var{$c + 2}),
346
+ ord($var{$c + 3}),
347
+ ord($var{$c + 4}),
348
+ ord($var{$c + 5}));
349
+ $c += 5;
350
+ $utf16 = $this->utf82utf16($char);
351
+ $ascii .= sprintf('\u%04s', bin2hex($utf16));
352
+ break;
353
+ }
354
+ }
355
+
356
+ return '"'.$ascii.'"';
357
+
358
+ case 'array':
359
+ /*
360
+ * As per JSON spec if any array key is not an integer
361
+ * we must treat the the whole array as an object. We
362
+ * also try to catch a sparsely populated associative
363
+ * array with numeric keys here because some JS engines
364
+ * will create an array with empty indexes up to
365
+ * max_index which can cause memory issues and because
366
+ * the keys, which may be relevant, will be remapped
367
+ * otherwise.
368
+ *
369
+ * As per the ECMA and JSON specification an object may
370
+ * have any string as a property. Unfortunately due to
371
+ * a hole in the ECMA specification if the key is a
372
+ * ECMA reserved word or starts with a digit the
373
+ * parameter is only accessible using ECMAScript's
374
+ * bracket notation.
375
+ */
376
+
377
+ // treat as a JSON object
378
+ if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) {
379
+ $properties = array_map(array($this, 'name_value'),
380
+ array_keys($var),
381
+ array_values($var));
382
+
383
+ foreach($properties as $property) {
384
+ if(Services_JSON::isError($property)) {
385
+ return $property;
386
+ }
387
+ }
388
+
389
+ return '{' . join(',', $properties) . '}';
390
+ }
391
+
392
+ // treat it like a regular array
393
+ $elements = array_map(array($this, 'encode'), $var);
394
+
395
+ foreach($elements as $element) {
396
+ if(Services_JSON::isError($element)) {
397
+ return $element;
398
+ }
399
+ }
400
+
401
+ return '[' . join(',', $elements) . ']';
402
+
403
+ case 'object':
404
+ $vars = get_object_vars($var);
405
+
406
+ $properties = array_map(array($this, 'name_value'),
407
+ array_keys($vars),
408
+ array_values($vars));
409
+
410
+ foreach($properties as $property) {
411
+ if(Services_JSON::isError($property)) {
412
+ return $property;
413
+ }
414
+ }
415
+
416
+ return '{' . join(',', $properties) . '}';
417
+
418
+ default:
419
+ return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS)
420
+ ? 'null'
421
+ : new Services_JSON_Error(gettype($var)." can not be encoded as JSON string");
422
+ }
423
+ }
424
+
425
+ /**
426
+ * array-walking function for use in generating JSON-formatted name-value pairs
427
+ *
428
+ * @param string $name name of key to use
429
+ * @param mixed $value reference to an array element to be encoded
430
+ *
431
+ * @return string JSON-formatted name-value pair, like '"name":value'
432
+ * @access private
433
+ */
434
+ function name_value($name, $value)
435
+ {
436
+ $encoded_value = $this->encode($value);
437
+
438
+ if(Services_JSON::isError($encoded_value)) {
439
+ return $encoded_value;
440
+ }
441
+
442
+ return $this->encode(strval($name)) . ':' . $encoded_value;
443
+ }
444
+
445
+ /**
446
+ * reduce a string by removing leading and trailing comments and whitespace
447
+ *
448
+ * @param $str string string value to strip of comments and whitespace
449
+ *
450
+ * @return string string value stripped of comments and whitespace
451
+ * @access private
452
+ */
453
+ function reduce_string($str)
454
+ {
455
+ $str = preg_replace(array(
456
+
457
+ // eliminate single line comments in '// ...' form
458
+ '#^\s*//(.+)$#m',
459
+
460
+ // eliminate multi-line comments in '/* ... */' form, at start of string
461
+ '#^\s*/\*(.+)\*/#Us',
462
+
463
+ // eliminate multi-line comments in '/* ... */' form, at end of string
464
+ '#/\*(.+)\*/\s*$#Us'
465
+
466
+ ), '', $str);
467
+
468
+ // eliminate extraneous space
469
+ return trim($str);
470
+ }
471
+
472
+ /**
473
+ * decodes a JSON string into appropriate variable
474
+ *
475
+ * @param string $str JSON-formatted string
476
+ *
477
+ * @return mixed number, boolean, string, array, or object
478
+ * corresponding to given JSON input string.
479
+ * See argument 1 to Services_JSON() above for object-output behavior.
480
+ * Note that decode() always returns strings
481
+ * in ASCII or UTF-8 format!
482
+ * @access public
483
+ */
484
+ function decode($str)
485
+ {
486
+ $str = $this->reduce_string($str);
487
+
488
+ switch (strtolower($str)) {
489
+ case 'true':
490
+ return true;
491
+
492
+ case 'false':
493
+ return false;
494
+
495
+ case 'null':
496
+ return null;
497
+
498
+ default:
499
+ $m = array();
500
+
501
+ if (is_numeric($str)) {
502
+ // Lookie-loo, it's a number
503
+
504
+ // This would work on its own, but I'm trying to be
505
+ // good about returning integers where appropriate:
506
+ // return (float)$str;
507
+
508
+ // Return float or int, as appropriate
509
+ return ((float)$str == (integer)$str)
510
+ ? (integer)$str
511
+ : (float)$str;
512
+
513
+ } elseif (preg_match('/^("|\').*(\1)$/s', $str, $m) && $m[1] == $m[2]) {
514
+ // STRINGS RETURNED IN UTF-8 FORMAT
515
+ $delim = substr($str, 0, 1);
516
+ $chrs = substr($str, 1, -1);
517
+ $utf8 = '';
518
+ $strlen_chrs = strlen($chrs);
519
+
520
+ for ($c = 0; $c < $strlen_chrs; ++$c) {
521
+
522
+ $substr_chrs_c_2 = substr($chrs, $c, 2);
523
+ $ord_chrs_c = ord($chrs{$c});
524
+
525
+ switch (true) {
526
+ case $substr_chrs_c_2 == '\b':
527
+ $utf8 .= chr(0x08);
528
+ ++$c;
529
+ break;
530
+ case $substr_chrs_c_2 == '\t':
531
+ $utf8 .= chr(0x09);
532
+ ++$c;
533
+ break;
534
+ case $substr_chrs_c_2 == '\n':
535
+ $utf8 .= chr(0x0A);
536
+ ++$c;
537
+ break;
538
+ case $substr_chrs_c_2 == '\f':
539
+ $utf8 .= chr(0x0C);
540
+ ++$c;
541
+ break;
542
+ case $substr_chrs_c_2 == '\r':
543
+ $utf8 .= chr(0x0D);
544
+ ++$c;
545
+ break;
546
+
547
+ case $substr_chrs_c_2 == '\\"':
548
+ case $substr_chrs_c_2 == '\\\'':
549
+ case $substr_chrs_c_2 == '\\\\':
550
+ case $substr_chrs_c_2 == '\\/':
551
+ if (($delim == '"' && $substr_chrs_c_2 != '\\\'') ||
552
+ ($delim == "'" && $substr_chrs_c_2 != '\\"')) {
553
+ $utf8 .= $chrs{++$c};
554
+ }
555
+ break;
556
+
557
+ case preg_match('/\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)):
558
+ // single, escaped unicode character
559
+ $utf16 = chr(hexdec(substr($chrs, ($c + 2), 2)))
560
+ . chr(hexdec(substr($chrs, ($c + 4), 2)));
561
+ $utf8 .= $this->utf162utf8($utf16);
562
+ $c += 5;
563
+ break;
564
+
565
+ case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):
566
+ $utf8 .= $chrs{$c};
567
+ break;
568
+
569
+ case ($ord_chrs_c & 0xE0) == 0xC0:
570
+ // characters U-00000080 - U-000007FF, mask 110XXXXX
571
+ //see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
572
+ $utf8 .= substr($chrs, $c, 2);
573
+ ++$c;
574
+ break;
575
+
576
+ case ($ord_chrs_c & 0xF0) == 0xE0:
577
+ // characters U-00000800 - U-0000FFFF, mask 1110XXXX
578
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
579
+ $utf8 .= substr($chrs, $c, 3);
580
+ $c += 2;
581
+ break;
582
+
583
+ case ($ord_chrs_c & 0xF8) == 0xF0:
584
+ // characters U-00010000 - U-001FFFFF, mask 11110XXX
585
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
586
+ $utf8 .= substr($chrs, $c, 4);
587
+ $c += 3;
588
+ break;
589
+
590
+ case ($ord_chrs_c & 0xFC) == 0xF8:
591
+ // characters U-00200000 - U-03FFFFFF, mask 111110XX
592
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
593
+ $utf8 .= substr($chrs, $c, 5);
594
+ $c += 4;
595
+ break;
596
+
597
+ case ($ord_chrs_c & 0xFE) == 0xFC:
598
+ // characters U-04000000 - U-7FFFFFFF, mask 1111110X
599
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
600
+ $utf8 .= substr($chrs, $c, 6);
601
+ $c += 5;
602
+ break;
603
+
604
+ }
605
+
606
+ }
607
+
608
+ return $utf8;
609
+
610
+ } elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) {
611
+ // array, or object notation
612
+
613
+ if ($str{0} == '[') {
614
+ $stk = array(SERVICES_JSON_IN_ARR);
615
+ $arr = array();
616
+ } else {
617
+ if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
618
+ $stk = array(SERVICES_JSON_IN_OBJ);
619
+ $obj = array();
620
+ } else {
621
+ $stk = array(SERVICES_JSON_IN_OBJ);
622
+ $obj = new stdClass();
623
+ }
624
+ }
625
+
626
+ array_push($stk, array('what' => SERVICES_JSON_SLICE,
627
+ 'where' => 0,
628
+ 'delim' => false));
629
+
630
+ $chrs = substr($str, 1, -1);
631
+ $chrs = $this->reduce_string($chrs);
632
+
633
+ if ($chrs == '') {
634
+ if (reset($stk) == SERVICES_JSON_IN_ARR) {
635
+ return $arr;
636
+
637
+ } else {
638
+ return $obj;
639
+
640
+ }
641
+ }
642
+
643
+ //print("\nparsing {$chrs}\n");
644
+
645
+ $strlen_chrs = strlen($chrs);
646
+
647
+ for ($c = 0; $c <= $strlen_chrs; ++$c) {
648
+
649
+ $top = end($stk);
650
+ $substr_chrs_c_2 = substr($chrs, $c, 2);
651
+
652
+ if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {
653
+ // found a comma that is not inside a string, array, etc.,
654
+ // OR we've reached the end of the character list
655
+ $slice = substr($chrs, $top['where'], ($c - $top['where']));
656
+ array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false));
657
+ //print("Found split at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
658
+
659
+ if (reset($stk) == SERVICES_JSON_IN_ARR) {
660
+ // we are in an array, so just push an element onto the stack
661
+ array_push($arr, $this->decode($slice));
662
+
663
+ } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
664
+ // we are in an object, so figure
665
+ // out the property name and set an
666
+ // element in an associative array,
667
+ // for now
668
+ $parts = array();
669
+
670
+ if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
671
+ // "name":value pair
672
+ $key = $this->decode($parts[1]);
673
+ $val = $this->decode($parts[2]);
674
+
675
+ if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
676
+ $obj[$key] = $val;
677
+ } else {
678
+ $obj->$key = $val;
679
+ }
680
+ } elseif (preg_match('/^\s*(\w+)\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
681
+ // name:value pair, where name is unquoted
682
+ $key = $parts[1];
683
+ $val = $this->decode($parts[2]);
684
+
685
+ if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
686
+ $obj[$key] = $val;
687
+ } else {
688
+ $obj->$key = $val;
689
+ }
690
+ }
691
+
692
+ }
693
+
694
+ } elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) {
695
+ // found a quote, and we are not inside a string
696
+ array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c}));
697
+ //print("Found start of string at {$c}\n");
698
+
699
+ } elseif (($chrs{$c} == $top['delim']) &&
700
+ ($top['what'] == SERVICES_JSON_IN_STR) &&
701
+ ((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) {
702
+ // found a quote, we're in a string, and it's not escaped
703
+ // we know that it's not escaped becase there is _not_ an
704
+ // odd number of backslashes at the end of the string so far
705
+ array_pop($stk);
706
+ //print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n");
707
+
708
+ } elseif (($chrs{$c} == '[') &&
709
+ in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
710
+ // found a left-bracket, and we are in an array, object, or slice
711
+ array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false));
712
+ //print("Found start of array at {$c}\n");
713
+
714
+ } elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
715
+ // found a right-bracket, and we're in an array
716
+ array_pop($stk);
717
+ //print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
718
+
719
+ } elseif (($chrs{$c} == '{') &&
720
+ in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
721
+ // found a left-brace, and we are in an array, object, or slice
722
+ array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false));
723
+ //print("Found start of object at {$c}\n");
724
+
725
+ } elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
726
+ // found a right-brace, and we're in an object
727
+ array_pop($stk);
728
+ //print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
729
+
730
+ } elseif (($substr_chrs_c_2 == '/*') &&
731
+ in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
732
+ // found a comment start, and we are in an array, object, or slice
733
+ array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false));
734
+ $c++;
735
+ //print("Found start of comment at {$c}\n");
736
+
737
+ } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) {
738
+ // found a comment end, and we're in one now
739
+ array_pop($stk);
740
+ $c++;
741
+
742
+ for ($i = $top['where']; $i <= $c; ++$i)
743
+ $chrs = substr_replace($chrs, ' ', $i, 1);
744
+
745
+ //print("Found end of comment at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
746
+
747
+ }
748
+
749
+ }
750
+
751
+ if (reset($stk) == SERVICES_JSON_IN_ARR) {
752
+ return $arr;
753
+
754
+ } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
755
+ return $obj;
756
+
757
+ }
758
+
759
+ }
760
+ }
761
+ }
762
+
763
+ /**
764
+ * @todo Ultimately, this should just call PEAR::isError()
765
+ */
766
+ function isError($data, $code = null)
767
+ {
768
+ if (class_exists('pear')) {
769
+ return PEAR::isError($data, $code);
770
+ } elseif (is_object($data) && (get_class($data) == 'services_json_error' ||
771
+ is_subclass_of($data, 'services_json_error'))) {
772
+ return true;
773
+ }
774
+
775
+ return false;
776
+ }
777
+ }
778
+
779
+ if (class_exists('PEAR_Error')) {
780
+
781
+ class Services_JSON_Error extends PEAR_Error
782
+ {
783
+ function Services_JSON_Error($message = 'unknown error', $code = null,
784
+ $mode = null, $options = null, $userinfo = null)
785
+ {
786
+ parent::PEAR_Error($message, $code, $mode, $options, $userinfo);
787
+ }
788
+ }
789
+
790
+ } else {
791
+
792
+ /**
793
+ * @todo Ultimately, this class shall be descended from PEAR_Error
794
+ */
795
+ class Services_JSON_Error
796
+ {
797
+ function Services_JSON_Error($message = 'unknown error', $code = null,
798
+ $mode = null, $options = null, $userinfo = null)
799
+ {
800
+
801
+ }
802
+ }
803
+
804
+ }
aioseop.class.php DELETED
@@ -1,2479 +0,0 @@
1
- <?php
2
-
3
- class All_in_One_SEO_Pack {
4
-
5
- var $version = "1.6.15.3";
6
-
7
- /** Max numbers of chars in auto-generated description */
8
- var $maximum_description_length = 160;
9
-
10
- /** Minimum number of chars an excerpt should be so that it can be used
11
- * as description. Touch only if you know what you're doing
12
- */
13
- var $minimum_description_length = 1;
14
-
15
- var $ob_start_detected = false;
16
-
17
- var $title_start = -1;
18
-
19
- var $title_end = -1;
20
-
21
- /** The title before rewriting */
22
- var $orig_title = '';
23
-
24
- /** Temp filename for the latest version. */
25
- // var $upgrade_filename = 'temp.zip';
26
-
27
- /** Where to extract the downloaded newest version. */
28
- // var $upgrade_folder;
29
-
30
- /** Any error in upgrading. */
31
- // var $upgrade_error;
32
-
33
- /** Which zip to download in order to upgrade .*/
34
- // var $upgrade_url = 'http://downloads.wordpress.org/plugin/all-in-one-seo-pack.zip';
35
-
36
- /** Filename of log file. */
37
- var $log_file;
38
-
39
- /** Flag whether there should be logging. */
40
- var $do_log;
41
-
42
- var $wp_version;
43
-
44
- var $aioseop_op;
45
- //var $aioseop_options = get_option('aioseop_options');
46
-
47
- function All_in_One_SEO_Pack() {
48
- global $wp_version;
49
- global $aioseop_options;
50
- $this->wp_version = $wp_version;
51
-
52
- $this->log_file = dirname(__FILE__) . '/all_in_one_seo_pack.log';
53
- if ($aioseop_options['aiosp_do_log']) {
54
- $this->do_log = true;
55
- } else {
56
- $this->do_log = false;
57
- }
58
-
59
- // $this->upgrade_filename = dirname(__FILE__) . '/' . $this->upgrade_filename;
60
- // $this->upgrade_folder = dirname(__FILE__);
61
- }
62
-
63
-
64
- /*** Case conversion; handle non UTF-8 encodings and fallback ***/
65
-
66
- function convert_case( $str, $mode = 'upper' ) {
67
- static $charset = null;
68
- if ($charset == null) $charset = get_bloginfo( 'charset' );
69
- if ( $charset == 'UTF-8' ) {
70
- global $UTF8_TABLES;
71
- include_once( 'aioseop_utility.php' );
72
- }
73
- if ( $charset == 'UTF-8' && is_array($UTF8_TABLES) ) {
74
- if ( $mode == 'upper' ) return strtr( $str, $UTF8_TABLES['strtoupper'] );
75
- if ( $mode == 'lower' ) return strtr( $str, $UTF8_TABLES['strtolower'] );
76
- return $str;
77
- } else {
78
- if ( $mode == 'upper' && function_exists( 'mb_strtoupper' ) ) {
79
- return mb_strtoupper( $str, $charset );
80
- } elseif ( $mode == 'lower' && function_exists( 'mb_strtolower' ) ) {
81
- return mb_strtolower( $str, $charset );
82
- } else {
83
- if ( $mode == 'upper' ) return strtoupper( $str );
84
- if ( $mode == 'lower' ) return strtolower( $str );
85
- return $str;
86
- }
87
- }
88
- }
89
-
90
- /**
91
- * Convert a string to lower case
92
- * Compatible with mb_strtolower(), an UTF-8 friendly replacement for strtolower()
93
- */
94
-
95
- function strtolower( $str ) {
96
- return $this->convert_case( $str, 'lower' );
97
- }
98
-
99
- /**
100
- * Convert a string to upper case
101
- * Compatible with mb_strtoupper(), an UTF-8 friendly replacement for strtoupper()
102
- */
103
- function strtoupper( $str ) {
104
- return $this->convert_case( $str, 'upper' );
105
- }
106
-
107
- function template_redirect() {
108
- global $wp_query;
109
- global $aioseop_options;
110
-
111
- $post = $wp_query->get_queried_object();
112
-
113
- if( $this->aioseop_mrt_exclude_this_page()){
114
- return;
115
- }
116
-
117
- if (is_feed()) {
118
- return;
119
- }
120
-
121
- if (is_single() || is_page()) {
122
- $aiosp_disable = htmlspecialchars(stripcslashes(get_post_meta($post->ID, '_aioseop_disable', true)));
123
- if ($aiosp_disable) {
124
- $aiosp_disable_analytics = htmlspecialchars(stripcslashes( get_post_meta( $post->ID, '_aioseop_disable_analytics', true ) ) );
125
- if ( $aiosp_disable_analytics )
126
- remove_action( 'wp_head', array( $this, 'aiosp_google_analytics' ) );
127
- return;
128
- }
129
- }
130
-
131
- if ($aioseop_options['aiosp_rewrite_titles']) {
132
- ob_start(array($this, 'output_callback_for_title'));
133
- }
134
- }
135
-
136
- function aioseop_mrt_exclude_this_page(){
137
- global $aioseop_options;
138
- $currenturl = trim($_SERVER['REQUEST_URI'],'/');
139
- /* echo "<br /><br />";
140
- echo $aioseop_options['aiosp_ex_pages'];
141
- echo "<br /><br />";
142
- */
143
- if ( !isset( $aioseop_options['aiosp_ex_pages'] ) ) $aioseop_options['aiosp_ex_pages'] = '';
144
- $excludedstuff = explode(',',$aioseop_options['aiosp_ex_pages']);
145
- foreach($excludedstuff as $exedd){
146
- //echo $exedd;
147
- $exedd = trim($exedd);
148
- if($exedd){
149
- if(stristr($currenturl, $exedd)){
150
- return true;
151
- }
152
- }
153
- }
154
- return false;
155
- }
156
-
157
- function output_callback_for_title($content) {
158
- return $this->rewrite_title($content);
159
- }
160
-
161
-
162
-
163
-
164
-
165
-
166
- //
167
- //CHECK IF ARRAY EXISTS IN DB, IF SO, GET ARRAY, ADD EVERYTHING, CHECK FOR ISSET?
168
- //
169
- function init() {
170
- if ( !defined('WP_PLUGIN_DIR') ) {
171
- load_plugin_textdomain('all_in_one_seo_pack', str_replace( ABSPATH, '', dirname(__FILE__)));
172
- } else {
173
- load_plugin_textdomain('all_in_one_seo_pack', false, dirname(plugin_basename(__FILE__)));
174
- }
175
-
176
- /*
177
- if (function_exists('load_plugin_textdomain')) {
178
- load_plugin_textdomain('all_in_one_seo_pack', WP_PLUGIN_DIR . '/all-in-one-seo-pack');
179
- }
180
- */
181
-
182
- }
183
-
184
- function is_static_front_page() {
185
- global $wp_query;
186
- global $aioseop_options;
187
- $post = $wp_query->get_queried_object();
188
- return get_option('show_on_front') == 'page' && is_page() && $post->ID == get_option('page_on_front');
189
- }
190
-
191
- function is_static_posts_page() {
192
- global $wp_query;
193
- $post = $wp_query->get_queried_object();
194
- return get_option('show_on_front') == 'page' && is_home() && $post->ID == get_option('page_for_posts');
195
- }
196
-
197
- function get_base() {
198
- return '/'.end(explode('/', str_replace(array('\\','/all_in_one_seo_pack.php'),array('/',''),__FILE__)));
199
- }
200
-
201
- function seo_mrt_admin_head() {
202
- $home = get_settings('siteurl');
203
- $stylesheet = AIOSEOP_PLUGIN_URL . 'style.css';
204
- echo '<link rel="stylesheet" href="' . $stylesheet . '" type="text/css" media="screen" />';
205
- }
206
-
207
-
208
- function wp_head() {
209
- if (is_feed()) {
210
- return;
211
- }
212
-
213
- global $wp_query;
214
- global $aioseop_options;
215
- $post = $wp_query->get_queried_object();
216
- $meta_string = null;
217
- if($this->is_static_posts_page()){
218
- $title = strip_tags( apply_filters( 'single_post_title', $post->post_title ) );
219
-
220
- }
221
- //echo("wp_head() " . wp_title('', false) . " is_home() => " . is_home() . ", is_page() => " . is_page() . ", is_single() => " . is_single() . ", is_static_front_page() => " . $this->is_static_front_page() . ", is_static_posts_page() => " . $this->is_static_posts_page());
222
-
223
- if (is_single() || is_page()) {
224
- $aiosp_disable = htmlspecialchars(stripcslashes(get_post_meta($post->ID, '_aioseop_disable', true)));
225
- if ($aiosp_disable) {
226
- $aiosp_disable_analytics = htmlspecialchars(stripcslashes( get_post_meta( $post->ID, '_aioseop_disable_analytics', true ) ) );
227
- if ( $aiosp_disable_analytics )
228
- remove_action( 'wp_head', array( $this, 'aiosp_google_analytics' ) );
229
- return;
230
- }
231
- }
232
-
233
- if( $this->aioseop_mrt_exclude_this_page()==TRUE ) return;
234
-
235
- if ($aioseop_options['aiosp_rewrite_titles']) {
236
- // make the title rewrite as short as possible
237
- if (function_exists('ob_list_handlers')) {
238
- $active_handlers = ob_list_handlers();
239
- } else {
240
- $active_handlers = array();
241
- }
242
- if (sizeof($active_handlers) > 0 &&
243
- strtolower($active_handlers[sizeof($active_handlers) - 1]) ==
244
- strtolower('All_in_One_SEO_Pack::output_callback_for_title')) {
245
- ob_end_flush();
246
- } else {
247
- $this->log("another plugin interfering?");
248
- // if we get here there *could* be trouble with another plugin :(
249
- $this->ob_start_detected = true;
250
- if (function_exists('ob_list_handlers')) {
251
- foreach (ob_list_handlers() as $handler) {
252
- $this->log("detected output handler $handler");
253
- }
254
- }
255
- }
256
- }
257
-
258
- echo "\n<!-- All in One SEO Pack $this->version by Michael Torbert of Semper Fi Web Design";
259
- if ($this->ob_start_detected) {
260
- echo "ob_start_detected ";
261
- }
262
- echo "[$this->title_start,$this->title_end] ";
263
- echo "-->\n";
264
- $is_front_page = ( ( is_home() && $aioseop_options['aiosp_home_keywords'] && !$this->is_static_posts_page() ) || $this->is_static_front_page() );
265
- if ( $is_front_page ) {
266
- $keywords = trim($this->internationalize($aioseop_options['aiosp_home_keywords']));
267
- } elseif($this->is_static_posts_page() && !$aioseop_options['aiosp_dynamic_postspage_keywords']){ // and if option = use page set keywords instead of keywords from recent posts
268
- //$keywords = "posts keyyysss" . stripcslashes(get_post_meta($post->ID,'keywords',true));
269
- $keywords = stripcslashes($this->internationalize(get_post_meta($post->ID, "_aioseop_keywords", true)));
270
-
271
- // $keywords = $this->get_unique_keywords($keywords);
272
-
273
- } else {
274
- $keywords = $this->get_all_keywords();
275
- }
276
- if (is_single() || is_page() || $this->is_static_posts_page()) {
277
- if ($this->is_static_front_page()) {
278
- $description = trim(stripcslashes($this->internationalize($aioseop_options['aiosp_home_description'])));
279
- } else {
280
- $description = $this->get_post_description($post);
281
- $description = apply_filters('aioseop_description',$description);
282
- }
283
- } else if (is_home()) {
284
- $description = trim(stripcslashes($this->internationalize($aioseop_options['aiosp_home_description'])));
285
- } else if (is_category()) {
286
- $description = $this->internationalize(category_description());
287
- }
288
-
289
- if (isset($description) && (strlen($description) > $this->minimum_description_length) && !(is_home() && is_paged())) {
290
- $description = trim(strip_tags($description));
291
- $description = str_replace('"', '', $description);
292
-
293
- // replace newlines on mac / windows?
294
- $description = str_replace("\r\n", ' ', $description);
295
-
296
- // maybe linux uses this alone
297
- $description = str_replace("\n", ' ', $description);
298
-
299
- if (isset($meta_string)) {
300
- //$meta_string .= "\n";
301
- } else {
302
- $meta_string = '';
303
- }
304
-
305
- // description format
306
- $description_format = $aioseop_options['aiosp_description_format'];
307
- if (!isset($description_format) || empty($description_format)) {
308
- $description_format = "%description%";
309
- }
310
- $description = str_replace('%description%', apply_filters('aioseop_description_override', $description), $description_format);
311
- $description = str_replace('%blog_title%', get_bloginfo('name'), $description);
312
- $description = str_replace('%blog_description%', get_bloginfo('description'), $description);
313
- $description = str_replace('%wp_title%', $this->get_original_title(), $description);
314
- //$description = html_entity_decode($description, ENT_COMPAT, get_bloginfo('charset'));
315
- if($aioseop_options['aiosp_can'] && is_attachment()){
316
- $url = $this->aiosp_mrt_get_url($wp_query);
317
- if ($url) {
318
- preg_match_all('/(\d+)/', $url, $matches);
319
- if (is_array($matches)){
320
- $uniqueDesc = join('',$matches[0]);
321
- }
322
- }
323
- $description .= ' ' . $uniqueDesc;
324
- }
325
- $meta_string .= sprintf("<meta name=\"description\" content=\"%s\" />", $description);
326
- }
327
- $keywords = apply_filters('aioseop_keywords',$keywords);
328
- if (isset ($keywords) && !empty($keywords) && !(is_home() && is_paged())) {
329
- if (isset($meta_string)) {
330
- $meta_string .= "\n";
331
- }
332
- $keywords = str_replace('"','',$keywords);
333
- $meta_string .= sprintf("<meta name=\"keywords\" content=\"%s\" />", $keywords);
334
- }
335
-
336
- $is_tag = is_tag();
337
-
338
- if ((is_category() && $aioseop_options['aiosp_category_noindex']) || (!is_category() && is_archive() &&!$is_tag && $aioseop_options['aiosp_archive_noindex']) || ($aioseop_options['aiosp_tags_noindex'] && $is_tag)) {
339
- if (isset($meta_string)) {
340
- $meta_string .= "\n";
341
- }
342
- $meta_string .= '<meta name="robots" content="noindex,follow" />';
343
- }
344
-
345
- $page_meta = stripcslashes($aioseop_options['aiosp_page_meta_tags']);
346
- $post_meta = stripcslashes($aioseop_options['aiosp_post_meta_tags']);
347
- $home_meta = stripcslashes($aioseop_options['aiosp_home_meta_tags']);
348
- $front_meta = isset( $aioseop_options['aiosp_front_meta_tags'] ) ? '' : stripcslashes( $aioseop_options['aiosp_front_meta_tags'] );
349
-
350
- if ( is_page() && isset( $page_meta ) && !empty( $page_meta ) && ( !$is_front_page || empty( $front_meta ) ) ) {
351
- if ( isset( $meta_string ) ) $meta_string .= "\n";
352
- $meta_string .= $page_meta;
353
- }
354
-
355
- if (is_single() && isset($post_meta) && !empty($post_meta)) {
356
- if (isset($meta_string)) {
357
- $meta_string .= "\n";
358
- }
359
- $meta_string .= "$post_meta";
360
- }
361
-
362
- if ( !empty( $post ) && isset( $post->post_author ) )
363
- $googleplus = get_the_author_meta( 'googleplus', $post->post_author );
364
-
365
- if ( empty( $googleplus ) && !empty( $aioseop_options['aiosp_google_publisher'] ) )
366
- $googleplus = $aioseop_options['aiosp_google_publisher'];
367
-
368
- if ( is_singular() && ( $googleplus ) ) {
369
- $meta_string = '<link rel="author" href="' . $googleplus . '" />' . "\n" . $meta_string;
370
- } else if ( !is_home() && !empty( $aioseop_options['aiosp_google_publisher'] ) ) {
371
- $meta_string = '<link rel="author" href="' . $aioseop_options['aiosp_google_publisher'] . '" />' . "\n" . $meta_string;
372
- }
373
-
374
- if ( is_home() && !empty( $aioseop_options['aiosp_google_publisher'] ) )
375
- $meta_string = '<link rel="publisher" href="' . $aioseop_options['aiosp_google_publisher'] . '" />' . "\n" . $meta_string;
376
-
377
- if ( $is_front_page && !empty( $front_meta ) ) {
378
- if ( isset( $meta_string ) ) $meta_string .= "\n";
379
- $meta_string .= $front_meta;
380
- } else {
381
- if ( is_home() && !empty( $home_meta ) ) {
382
- if ( isset( $meta_string ) ) $meta_string .= "\n";
383
- $meta_string .= $home_meta;
384
- }
385
- }
386
-
387
- if ($meta_string != null) {
388
- echo "$meta_string\n";
389
- }
390
-
391
- if($aioseop_options['aiosp_can']){
392
- $url = $this->aiosp_mrt_get_url($wp_query);
393
- if ($url) {
394
- $url = apply_filters('aioseop_canonical_url',$url);
395
-
396
- echo "".'<link rel="canonical" href="'.$url.'" />'."\n";
397
- }
398
-
399
- }
400
-
401
- echo "<!-- /all in one seo pack -->\n";
402
- }
403
-
404
- function aiosp_google_analytics(){
405
- global $aioseop_options;
406
- ?>
407
- <script type="text/javascript">
408
-
409
- var _gaq = _gaq || [];
410
- _gaq.push(['_setAccount', '<?php echo $aioseop_options['aiosp_google_analytics_id']; ?>']);
411
- <?php if ( !empty( $aioseop_options['aiosp_ga_multi_domain'] ) ) {
412
- ?> _gaq.push(['_setAllowLinker', true]);
413
- <?php }
414
-
415
- if ( !empty( $aioseop_options['aiosp_ga_domain'] ) ) {
416
- ?> _gaq.push(['_setDomainName', '<?php echo $aioseop_options['aiosp_ga_domain']; ?>']);
417
- <?php } ?>
418
- _gaq.push(['_trackPageview']);
419
-
420
- (function() {
421
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
422
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
423
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
424
- })();
425
-
426
- </script>
427
- <?php
428
- if ($aioseop_options['aiosp_ga_track_outbound_links']) {
429
- ?>
430
- <script type="text/javascript">
431
- function recordOutboundLink(link, category, action) {
432
- _gat._getTrackerByName()._trackEvent(category, action);
433
- if ( link.target == '_blank' ) return true;
434
- setTimeout('document.location = "' + link.href + '"', 100);
435
- return false;
436
- }
437
- /* use regular Javascript for this */
438
- function getAttr(ele, attr) {
439
- var result = (ele.getAttribute && ele.getAttribute(attr)) || null;
440
- if( !result ) {
441
- var attrs = ele.attributes;
442
- var length = attrs.length;
443
- for(var i = 0; i < length; i++)
444
- if(attr[i].nodeName === attr) result = attr[i].nodeValue;
445
- }
446
- return result;
447
- }
448
-
449
- window.onload = function () {
450
- var links = document.getElementsByTagName('a');
451
- for (var x=0; x < links.length; x++) {
452
- if (typeof links[x] == 'undefined') continue;
453
- if (typeof links[x].onclick != 'undefined') continue;
454
- links[x].onclick = function () {
455
- var mydomain = new RegExp(document.domain, 'i');
456
- href = getAttr(this, 'href');
457
- if(href && href.toLowerCase().indexOf('http') === 0 && !mydomain.test(href)) {
458
- recordOutboundLink(this, 'Outbound Links', href);
459
- }
460
- }
461
- }
462
- };
463
- </script>
464
-
465
- <?php
466
-
467
- }}
468
-
469
- // Thank you, Yoast de Valk, for much of this code.
470
-
471
- function aiosp_mrt_get_url($query) {
472
- global $aioseop_options;
473
- if ($query->is_404 || $query->is_search) {
474
- return false;
475
- }
476
- $haspost = count($query->posts) > 0;
477
- $has_ut = function_exists('user_trailingslashit');
478
-
479
- if (get_query_var('m')) {
480
- $m = preg_replace('/[^0-9]/', '', get_query_var('m'));
481
- switch (strlen($m)) {
482
- case 4:
483
- $link = get_year_link($m);
484
- break;
485
- case 6:
486
- $link = get_month_link(substr($m, 0, 4), substr($m, 4, 2));
487
- break;
488
- case 8:
489
- $link = get_day_link(substr($m, 0, 4), substr($m, 4, 2), substr($m, 6, 2));
490
- break;
491
- default:
492
- return false;
493
- }
494
- } elseif (($query->is_single || $query->is_page) && $haspost) {
495
- $post = $query->posts[0];
496
- $link = get_permalink($post->ID);
497
- $link = $this->yoast_get_paged($link);
498
- } elseif (($query->is_single || $query->is_page) && $haspost) {
499
- $post = $query->posts[0];
500
- $link = get_permalink($post->ID);
501
- $link = $this->yoast_get_paged($link);
502
- } elseif ($query->is_author && $haspost) {
503
- global $wp_version;
504
- if ($wp_version >= '2') {
505
- $author = get_userdata(get_query_var('author'));
506
- if ($author === false)
507
- return false;
508
- $link = get_author_link(false, $author->ID, $author->user_nicename);
509
- } else {
510
- global $cache_userdata;
511
- $userid = get_query_var('author');
512
- $link = get_author_link(false, $userid, $cache_userdata[$userid]->user_nicename);
513
- }
514
- } elseif ($query->is_category && $haspost) {
515
- $link = get_category_link(get_query_var('cat'));
516
- $link = $this->yoast_get_paged($link);
517
- } else if ($query->is_tag && $haspost) {
518
- $tag = get_term_by('slug',get_query_var('tag'),'post_tag');
519
- if (!empty($tag->term_id)) {
520
- $link = get_tag_link($tag->term_id);
521
- }
522
- $link = $this->yoast_get_paged($link);
523
- } elseif ($query->is_day && $haspost) {
524
- $link = get_day_link(get_query_var('year'),
525
- get_query_var('monthnum'),
526
- get_query_var('day'));
527
- } elseif ($query->is_month && $haspost) {
528
- $link = get_month_link(get_query_var('year'),
529
- get_query_var('monthnum'));
530
- } elseif ($query->is_year && $haspost) {
531
- $link = get_year_link(get_query_var('year'));
532
- } elseif ($query->is_home) {
533
- if ((get_option('show_on_front') == 'page') &&
534
- ($pageid = get_option('page_for_posts'))) {
535
- $link = get_permalink($pageid);
536
- $link = $this->yoast_get_paged($link);
537
- $link = trailingslashit($link);
538
- } else {
539
- if ( function_exists( 'icl_get_home_url' ) ) {
540
- $link = icl_get_home_url();
541
- } else {
542
- $link = get_option( 'home' );
543
- }
544
- $link = $this->yoast_get_paged($link);
545
- $link = trailingslashit($link);
546
- }
547
- } elseif ($query->is_tax && $haspost ) {
548
- $taxonomy = get_query_var( 'taxonomy' );
549
- $term = get_query_var( 'term' );
550
- $link = get_term_link( $term, $taxonomy );
551
- $link = $this->yoast_get_paged( $link );
552
- } elseif ( $query->is_archive && function_exists( 'get_post_type_archive_link' ) && ( $post_type = get_query_var( 'post_type' ) ) ) {
553
- $link = get_post_type_archive_link( $post_type );
554
- } else {
555
- return false;
556
- }
557
-
558
- return $link;
559
-
560
- }
561
-
562
-
563
- function yoast_get_paged($link) {
564
- $page = get_query_var('paged');
565
- if ($page && $page > 1) {
566
- $link = trailingslashit($link) ."page/". "$page";
567
- if ($has_ut) {
568
- $link = user_trailingslashit($link, 'paged');
569
- } else {
570
- $link .= '/';
571
- }
572
- }
573
- return $link;
574
- }
575
-
576
-
577
- function get_post_description($post) {
578
- global $aioseop_options;
579
- $description = trim(stripcslashes($this->internationalize(get_post_meta($post->ID, "_aioseop_description", true))));
580
- if (!$description) {
581
- $description = $this->trim_excerpt_without_filters_full_length($this->internationalize($post->post_excerpt));
582
- if (!$description && $aioseop_options["aiosp_generate_descriptions"]) {
583
- $description = $this->trim_excerpt_without_filters($this->internationalize($post->post_content));
584
- }
585
- }
586
-
587
- // "internal whitespace trim"
588
- $description = preg_replace("/\s\s+/u", " ", $description);
589
-
590
- return $description;
591
- }
592
-
593
- function replace_title($content, $title) {
594
- $title = trim(strip_tags($title));
595
-
596
- $title_tag_start = "<title>";
597
- $title_tag_end = "</title>";
598
- $len_start = strlen($title_tag_start);
599
- $len_end = strlen($title_tag_end);
600
- $title = stripcslashes(trim($title));
601
- $start = strpos($content, $title_tag_start);
602
- $end = strpos($content, $title_tag_end);
603
-
604
- $this->title_start = $start;
605
- $this->title_end = $end;
606
- $this->orig_title = $title;
607
-
608
- if ($start && $end) {
609
- $header = substr($content, 0, $start + $len_start) . $title . substr($content, $end);
610
- } else {
611
- // this breaks some sitemap plugins (like wpg2)
612
- //$header = $content . "<title>$title</title>";
613
-
614
- $header = $content;
615
- }
616
-
617
- return $header;
618
- }
619
-
620
- function internationalize($in) {
621
- if (function_exists('langswitch_filter_langs_with_message')) {
622
- $in = langswitch_filter_langs_with_message($in);
623
- }
624
- if (function_exists('polyglot_filter')) {
625
- $in = polyglot_filter($in);
626
- }
627
- if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
628
- $in = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($in);
629
- }
630
- $in = apply_filters('localization', $in);
631
- return $in;
632
- }
633
-
634
- /** @return The original title as delivered by WP (well, in most cases) */
635
- function get_original_title() {
636
- global $wp_query;
637
- global $aioseop_options;
638
- if (!$wp_query) {
639
- return null;
640
- }
641
-
642
- $post = $wp_query->get_queried_object();
643
-
644
- // the_search_query() is not suitable, it cannot just return
645
- global $s;
646
-
647
- $title = null;
648
-
649
- if (is_home()) {
650
- $title = get_option('blogname');
651
- } else if (is_single()) {
652
- $title = $this->internationalize(wp_title('', false));
653
- } else if (is_search() && isset($s) && !empty($s)) {
654
- $search = esc_attr(stripcslashes($s));
655
- $search = $this->capitalize($search);
656
- $title = $search;
657
- } else if (is_category() && !is_feed()) {
658
- $category_description = $this->internationalize(category_description());
659
- $category_name = ucwords($this->internationalize(single_cat_title('', false)));
660
- $title = $category_name;
661
- } else if (is_page()) {
662
- $title = $this->internationalize(wp_title('', false));
663
- } else if (is_tag()) {
664
- global $utw;
665
- if ($utw) {
666
- $tags = $utw->GetCurrentTagSet();
667
- $tag = $tags[0]->tag;
668
- $tag = str_replace('-', ' ', $tag);
669
- } else {
670
- // wordpress > 2.3
671
- $tag = $this->internationalize(wp_title('', false));
672
- }
673
- if ($tag) {
674
- $title = $tag;
675
- }
676
- } else if (is_archive()) {
677
- $title = $this->internationalize(wp_title('', false));
678
- } else if (is_404()) {
679
- $title_format = $aioseop_options['aiosp_404_title_format'];
680
- $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
681
- $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
682
- $new_title = str_replace('%request_url%', $_SERVER['REQUEST_URI'], $new_title);
683
- $new_title = str_replace('%request_words%', $this->request_as_words($_SERVER['REQUEST_URI']), $new_title);
684
- $title = $new_title;
685
- }
686
-
687
- return trim($title);
688
- }
689
-
690
- function paged_title($title) {
691
- // the page number if paged
692
- global $paged;
693
- global $aioseop_options;
694
- // simple tagging support
695
- global $STagging;
696
-
697
- if (is_paged() || (isset($STagging) && $STagging->is_tag_view() && $paged)) {
698
- $part = $this->internationalize($aioseop_options['aiosp_paged_format']);
699
- if (isset($part) || !empty($part)) {
700
- $part = " " . trim($part);
701
- $part = str_replace('%page%', $paged, $part);
702
- $this->log("paged_title() [$title] [$part]");
703
- $title .= $part;
704
- }
705
- }
706
- return $title;
707
- }
708
-
709
- function rewrite_title($header) {
710
- global $aioseop_options;
711
- global $wp_query;
712
- if (!$wp_query) {
713
- $header .= "<!-- no wp_query found! -->\n";
714
- return $header;
715
- }
716
-
717
- $post = $wp_query->get_queried_object();
718
-
719
- // the_search_query() is not suitable, it cannot just return
720
- global $s;
721
-
722
- global $STagging;
723
-
724
- if (is_home() && !$this->is_static_posts_page()) {
725
- $title = $this->internationalize($aioseop_options['aiosp_home_title']);
726
- if (empty($title)) {
727
- $title = $this->internationalize(get_option('blogname'));
728
- }
729
- $title = $this->paged_title($title);
730
- $header = $this->replace_title($header, $title);
731
- } else if (is_attachment()) {
732
- $title = get_the_title($post->post_parent).' '.$post->post_title.' – '.get_option('blogname');
733
- $header = $this->replace_title($header,$title);
734
- } else if (is_single()) {
735
- // we're not in the loop :(
736
- $authordata = get_userdata($post->post_author);
737
- $categories = get_the_category();
738
- $category = '';
739
- if (count($categories) > 0) {
740
- $category = $categories[0]->cat_name;
741
- }
742
- $title = $this->internationalize(get_post_meta($post->ID, "_aioseop_title", true));
743
- if (!$title) {
744
- $title = $this->internationalize(get_post_meta($post->ID, "title_tag", true));
745
- if (!$title) {
746
- $title = $this->internationalize(wp_title('', false));
747
- }
748
- }
749
- $title_format = $aioseop_options['aiosp_post_title_format'];
750
- /*
751
- $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
752
- $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
753
- $new_title = str_replace('%post_title%', $title, $new_title);
754
- $new_title = str_replace('%category%', $category, $new_title);
755
- $new_title = str_replace('%category_title%', $category, $new_title);
756
- $new_title = str_replace('%post_author_login%', $authordata->user_login, $new_title);
757
- $new_title = str_replace('%post_author_nicename%', $authordata->user_nicename, $new_title);
758
- $new_title = str_replace('%post_author_firstname%', ucwords($authordata->first_name), $new_title);
759
- $new_title = str_replace('%post_author_lastname%', ucwords($authordata->last_name), $new_title);
760
- */
761
- $r_title = array('%blog_title%','%blog_description%','%post_title%','%category%','%category_title%','%post_author_login%','%post_author_nicename%','%post_author_firstname%','%post_author_lastname%');
762
- $d_title = array($this->internationalize(get_bloginfo('name')),$this->internationalize(get_bloginfo('description')),$title, $category, $category, $authordata->user_login, $authordata->user_nicename, ucwords($authordata->first_name), ucwords($authordata->last_name));
763
- $title = trim(str_replace($r_title, $d_title, $title_format));
764
-
765
- // $title = $new_title;
766
- // $title = trim($title);
767
- $title = apply_filters('aioseop_title_single',$title);
768
- $header = $this->replace_title($header, $title);
769
- } else if (is_search() && isset($s) && !empty($s)) {
770
- $search = esc_attr(stripcslashes($s));
771
- $search = $this->capitalize($search);
772
- $title_format = $aioseop_options['aiosp_search_title_format'];
773
- $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
774
- $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);
775
- $title = str_replace('%search%', $search, $title);
776
- $header = $this->replace_title($header, $title);
777
- } else if (is_category() && !is_feed()) {
778
- $category_description = $this->internationalize(category_description());
779
- if($aioseop_options['aiosp_cap_cats']){
780
- $category_name = ucwords($this->internationalize(single_cat_title('', false)));
781
- }else{
782
- $category_name = $this->internationalize(single_cat_title('', false));
783
- }
784
- //$category_name = ucwords($this->internationalize(single_cat_title('', false)));
785
- $title_format = $aioseop_options['aiosp_category_title_format'];
786
- $title = str_replace('%category_title%', $category_name, $title_format);
787
- $title = str_replace('%category_description%', $category_description, $title);
788
- $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title);
789
- $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);
790
- $title = $this->paged_title($title);
791
- $header = $this->replace_title($header, $title);
792
- } else if (is_page() || $this->is_static_posts_page()) {
793
- // we're not in the loop :(
794
- $authordata = get_userdata($post->post_author);
795
- if ($this->is_static_front_page()) {
796
- if ($this->internationalize($aioseop_options['aiosp_home_title'])) {
797
-
798
- //home title filter
799
- $home_title = $this->internationalize($aioseop_options['aiosp_home_title']);
800
- $home_title = apply_filters('aioseop_home_page_title',$home_title);
801
- $header = $this->replace_title($header, $home_title);
802
-
803
- }
804
- } else {
805
- $title = $this->internationalize(get_post_meta($post->ID, "_aioseop_title", true));
806
- if (!$title) {
807
- $title = $this->internationalize(wp_title('', false));
808
- }
809
- $title_format = $aioseop_options['aiosp_page_title_format'];
810
- $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
811
- $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
812
- $new_title = str_replace('%page_title%', $title, $new_title);
813
- $new_title = str_replace('%page_author_login%', $authordata->user_login, $new_title);
814
- $new_title = str_replace('%page_author_nicename%', $authordata->user_nicename, $new_title);
815
- $new_title = str_replace('%page_author_firstname%', ucwords($authordata->first_name), $new_title);
816
- $new_title = str_replace('%page_author_lastname%', ucwords($authordata->last_name), $new_title);
817
- $title = trim($new_title);
818
- $title = $this->paged_title($title);
819
- $title = apply_filters('aioseop_title_page',$title);
820
- $header = $this->replace_title($header, $title);
821
- }
822
- } else if (is_tag()) {
823
- global $utw;
824
- if ($utw) {
825
- $tags = $utw->GetCurrentTagSet();
826
- $tag = $tags[0]->tag;
827
- $tag = str_replace('-', ' ', $tag);
828
- } else {
829
- // wordpress > 2.3
830
- $tag = $this->internationalize(wp_title('', false));
831
- }
832
- if ($tag) {
833
- $tag = $this->capitalize($tag);
834
- $title_format = $aioseop_options['aiosp_tag_title_format'];
835
- $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
836
- $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);
837
- $title = str_replace('%tag%', $tag, $title);
838
- $title = $this->paged_title($title);
839
- $header = $this->replace_title($header, $title);
840
- }
841
- } else if (isset($STagging) && $STagging->is_tag_view()) { // simple tagging support
842
- $tag = $STagging->search_tag;
843
- if ($tag) {
844
- $tag = $this->capitalize($tag);
845
- $title_format = $aioseop_options['aiosp_tag_title_format'];
846
- $title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
847
- $title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $title);
848
- $title = str_replace('%tag%', $tag, $title);
849
- $title = $this->paged_title($title);
850
- $header = $this->replace_title($header, $title);
851
- }
852
- } else if (is_archive()) {
853
- $date = $this->internationalize(wp_title('', false));
854
- $title_format = $aioseop_options['aiosp_archive_title_format'];
855
- $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
856
- $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
857
- $new_title = str_replace('%date%', $date, $new_title);
858
- $title = trim($new_title);
859
- $title = $this->paged_title($title);
860
- $header = $this->replace_title($header, $title);
861
- } else if (is_404()) {
862
- $title_format = $aioseop_options['aiosp_404_title_format'];
863
- $new_title = str_replace('%blog_title%', $this->internationalize(get_bloginfo('name')), $title_format);
864
- $new_title = str_replace('%blog_description%', $this->internationalize(get_bloginfo('description')), $new_title);
865
- $new_title = str_replace('%request_url%', $_SERVER['REQUEST_URI'], $new_title);
866
- $new_title = str_replace('%request_words%', $this->request_as_words($_SERVER['REQUEST_URI']), $new_title);
867
- $new_title = str_replace('%404_title%', $this->internationalize(wp_title('', false)), $new_title);
868
- $header = $this->replace_title($header, $new_title);
869
- }
870
-
871
- return $header;
872
-
873
- }
874
-
875
- /**
876
- * @return User-readable nice words for a given request.
877
- */
878
- function request_as_words($request) {
879
- $request = htmlspecialchars($request);
880
- $request = str_replace('.html', ' ', $request);
881
- $request = str_replace('.htm', ' ', $request);
882
- $request = str_replace('.', ' ', $request);
883
- $request = str_replace('/', ' ', $request);
884
- $request_a = explode(' ', $request);
885
- $request_new = array();
886
- foreach ($request_a as $token) {
887
- $request_new[] = ucwords(trim($token));
888
- }
889
- $request = implode(' ', $request_new);
890
- return $request;
891
- }
892
-
893
- function capitalize($s) {
894
- $s = trim($s);
895
- $tokens = explode(' ', $s);
896
- while (list($key, $val) = each($tokens)) {
897
- $tokens[$key] = trim($tokens[$key]);
898
- $tokens[$key] = strtoupper(substr($tokens[$key], 0, 1)) . substr($tokens[$key], 1);
899
- }
900
- $s = implode(' ', $tokens);
901
- return $s;
902
- }
903
-
904
- function trim_excerpt_without_filters($text) {
905
- $text = str_replace(']]>', ']]&gt;', $text);
906
- $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
907
- $text = strip_tags($text);
908
- $max = $this->maximum_description_length;
909
-
910
- if ($max < strlen($text)) {
911
- while($text[$max] != ' ' && $max > $this->minimum_description_length) {
912
- $max--;
913
- }
914
- }
915
- $text = substr($text, 0, $max);
916
- return trim(stripcslashes($text));
917
- }
918
-
919
- function trim_excerpt_without_filters_full_length($text) {
920
- $text = str_replace(']]>', ']]&gt;', $text);
921
- $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
922
- $text = strip_tags($text);
923
- return trim(stripcslashes($text));
924
- }
925
-
926
- /**
927
- * @return comma-separated list of unique keywords
928
- */
929
- function get_all_keywords() {
930
- global $posts;
931
- global $aioseop_options;
932
-
933
- if (is_404()) {
934
- return null;
935
- }
936
-
937
- // if we are on synthetic pages
938
- if (!is_home() && !is_page() && !is_single() &&!$this->is_static_front_page() && !$this->is_static_posts_page()) {
939
- return null;
940
- }
941
-
942
- $keywords = array();
943
- if (is_array($posts)) {
944
- foreach ($posts as $post) {
945
- if ($post) {
946
-
947
- // custom field keywords
948
- $keywords_a = $keywords_i = null;
949
- $description_a = $description_i = null;
950
-
951
- $id = (is_attachment())?($post->post_parent):($post->ID); // if attachment then use parent post id
952
- $keywords_i = stripcslashes($this->internationalize(get_post_meta($id, "_aioseop_keywords", true)));
953
- //$id = $post->ID;
954
- //$keywords_i = stripcslashes($this->internationalize(get_post_meta($post->ID, "_aioseop_keywords", true)));
955
- $keywords_i = str_replace('"', '', $keywords_i);
956
- if (isset($keywords_i) && !empty($keywords_i)) {
957
- $traverse = explode(',', $keywords_i);
958
- foreach ($traverse as $keyword) {
959
- $keywords[] = $keyword;
960
- }
961
- }
962
-
963
- // WP 2.3 tags
964
- if ($aioseop_options['aiosp_use_tags_as_keywords']){
965
- if (function_exists('get_the_tags')) {
966
- //$tags = get_the_tags($post->ID);
967
- $tags = get_the_tags($id);
968
- if ($tags && is_array($tags)) {
969
- foreach ($tags as $tag) {
970
- $keywords[] = $this->internationalize($tag->name);
971
- }
972
- }
973
- }
974
- }
975
- // Ultimate Tag Warrior integration
976
- global $utw;
977
- if ($utw) {
978
- $tags = $utw->GetTagsForPost($post);
979
- if (is_array($tags)) {
980
- foreach ($tags as $tag) {
981
- $tag = $tag->tag;
982
- $tag = str_replace('_',' ', $tag);
983
- $tag = str_replace('-',' ',$tag);
984
- $tag = stripcslashes($tag);
985
- $keywords[] = $tag;
986
- }
987
- }
988
- }
989
-
990
- // autometa
991
- $autometa = stripcslashes(get_post_meta($id, 'autometa', true));
992
- //$autometa = stripcslashes(get_post_meta($post->ID, "autometa", true));
993
- if (isset($autometa) && !empty($autometa)) {
994
- $autometa_array = explode(' ', $autometa);
995
- foreach ($autometa_array as $e) {
996
- $keywords[] = $e;
997
- }
998
- }
999
-
1000
- if ($aioseop_options['aiosp_use_categories'] && !is_page()) {
1001
- $categories = get_the_category($id);
1002
- //$categories = get_the_category($post->ID);
1003
- foreach ($categories as $category) {
1004
- $keywords[] = $this->internationalize($category->cat_name);
1005
- }
1006
- }
1007
-
1008
- }
1009
- }
1010
- }
1011
-
1012
- return $this->get_unique_keywords($keywords);
1013
- }
1014
-
1015
- function get_meta_keywords() {
1016
- global $posts;
1017
-
1018
- $keywords = array();
1019
- if (is_array($posts)) {
1020
- foreach ($posts as $post) {
1021
- if ($post) {
1022
- // custom field keywords
1023
- $keywords_a = $keywords_i = null;
1024
- $description_a = $description_i = null;
1025
- $id = $post->ID;
1026
- $keywords_i = stripcslashes(get_post_meta($post->ID, "_aioseop_keywords", true));
1027
- $keywords_i = str_replace('"', '', $keywords_i);
1028
- if (isset($keywords_i) && !empty($keywords_i)) {
1029
- $keywords[] = $keywords_i;
1030
- }
1031
- }
1032
- }
1033
- }
1034
-
1035
- return $this->get_unique_keywords($keywords);
1036
- }
1037
-
1038
- function get_unique_keywords($keywords) {
1039
- $small_keywords = array();
1040
- foreach ($keywords as $word) {
1041
- if (function_exists('mb_strtolower'))
1042
- $small_keywords[] = mb_strtolower($word, get_bloginfo('charset'));
1043
- else
1044
- $small_keywords[] = $this->strtolower($word);
1045
- }
1046
- $keywords_ar = array_unique($small_keywords);
1047
- return implode(',', $keywords_ar);
1048
- }
1049
-
1050
- function get_url($url) {
1051
- if (function_exists('file_get_contents')) {
1052
- $file = file_get_contents($url);
1053
- } else {
1054
- $curl = curl_init($url);
1055
- curl_setopt($curl, CURLOPT_HEADER, 0);
1056
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
1057
- $file = curl_exec($curl);
1058
- curl_close($curl);
1059
- }
1060
- return $file;
1061
- }
1062
-
1063
- function log($message) {
1064
- if ($this->do_log) {
1065
- error_log(date('Y-m-d H:i:s') . " " . $message . "\n", 3, $this->log_file);
1066
- }
1067
- }
1068
-
1069
- function download_newest_version() {
1070
- $success = true;
1071
- $file_content = $this->get_url($this->upgrade_url);
1072
- if ($file_content === false) {
1073
- $this->upgrade_error = sprintf(__("Could not download distribution (%s)"), $this->upgrade_url);
1074
- $success = false;
1075
- } else if (strlen($file_content) < 100) {
1076
- $this->upgrade_error = sprintf(__("Could not download distribution (%s): %s"), $this->upgrade_url, $file_content);
1077
- $success = false;
1078
- } else {
1079
- $this->log(sprintf("filesize of download ZIP: %d", strlen($file_content)));
1080
- $fh = @fopen($this->upgrade_filename, 'w');
1081
- $this->log("fh is $fh");
1082
- if (!$fh) {
1083
- $this->upgrade_error = sprintf(__("Could not open %s for writing"), $this->upgrade_filename);
1084
- $this->upgrade_error .= "<br />";
1085
- $this->upgrade_error .= sprintf(__("Please make sure %s is writable"), $this->upgrade_folder);
1086
- $success = false;
1087
- } else {
1088
- $bytes_written = @fwrite($fh, $file_content);
1089
- $this->log("wrote $bytes_written bytes");
1090
- if (!$bytes_written) {
1091
- $this->upgrade_error = sprintf(__("Could not write to %s"), $this->upgrade_filename);
1092
- $success = false;
1093
- }
1094
- }
1095
- if ($success) {
1096
- fclose($fh);
1097
- }
1098
- }
1099
- return $success;
1100
- }
1101
-
1102
- function install_newest_version() {
1103
- $success = $this->download_newest_version();
1104
- if ($success) {
1105
- $success = $this->extract_plugin();
1106
- unlink($this->upgrade_filename);
1107
- }
1108
- return $success;
1109
- }
1110
-
1111
- function extract_plugin() {
1112
- if (!class_exists('PclZip')) {
1113
- require_once ('pclzip.lib.php');
1114
- }
1115
- $archive = new PclZip($this->upgrade_filename);
1116
- $files = $archive->extract(PCLZIP_OPT_STOP_ON_ERROR, PCLZIP_OPT_REPLACE_NEWER, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_PATH, $this->upgrade_folder);
1117
- $this->log("files is $files");
1118
- if (is_array($files)) {
1119
- $num_extracted = sizeof($files);
1120
- $this->log("extracted $num_extracted files to $this->upgrade_folder");
1121
- $this->log(print_r($files, true));
1122
- return true;
1123
- } else {
1124
- $this->upgrade_error = $archive->errorInfo();
1125
- return false;
1126
- }
1127
- }
1128
-
1129
- /** crude approximization of whether current user is an admin */
1130
- function is_admin() {
1131
- return current_user_can('level_8');
1132
- }
1133
-
1134
-
1135
- function is_directory_writable($directory) {
1136
- $filename = $directory . '/' . 'tmp_file_' . time();
1137
- $fh = @fopen($filename, 'w');
1138
- if (!$fh) {
1139
- return false;
1140
- }
1141
-
1142
- $written = fwrite($fh, "test");
1143
- fclose($fh);
1144
- unlink($filename);
1145
- if ($written) {
1146
- return true;
1147
- } else {
1148
- return false;
1149
- }
1150
- }
1151
-
1152
-
1153
- function is_upgrade_directory_writable() {
1154
- //return $this->is_directory_writable($this->upgrade_folder);
1155
- // let's assume it is
1156
- return true;
1157
- }
1158
-
1159
-
1160
- function post_meta_tags($id) {
1161
- $awmp_edit = isset( $_POST["aiosp_edit"] ) ? $_POST["aiosp_edit"] : null;
1162
- $nonce = isset( $_POST['nonce-aioseop-edit'] ) ? $_POST['nonce-aioseop-edit'] : null;
1163
- // if (!wp_verify_nonce($nonce, 'edit-aioseop-nonce')) die ( 'Security Check - If you receive this in error, log out and back in to WordPress');
1164
- if (isset($awmp_edit) && !empty($awmp_edit) && wp_verify_nonce($nonce, 'edit-aioseop-nonce')) {
1165
-
1166
- foreach (Array('keywords', 'description', 'title', 'meta', 'disable', 'disable_analytics', 'titleatr', 'menulabel', 'togglekeywords') as $f) {
1167
- $field = "aiosp_$f";
1168
- if ( isset( $_POST[$field] ) ) $$field = $_POST[$field];
1169
- }
1170
- if ( isset( $aiosp_keywords ) ) $keywords = $aiosp_keywords;
1171
- if ( isset( $aiosp_description ) ) $description = $aiosp_description;
1172
- if ( isset( $aiosp_title ) ) $title = $aiosp_title;
1173
-
1174
- delete_post_meta($id, '_aioseop_keywords');
1175
- delete_post_meta($id, '_aioseop_description');
1176
- delete_post_meta($id, '_aioseop_title');
1177
- delete_post_meta($id, '_aioseop_titleatr');
1178
- delete_post_meta($id, '_aioseop_menulabel');
1179
-
1180
-
1181
- if ($this->is_admin()) {
1182
- delete_post_meta($id, '_aioseop_disable');
1183
- delete_post_meta($id, '_aioseop_disable_analytics');
1184
- }
1185
- //delete_post_meta($id, 'aiosp_meta');
1186
-
1187
- if (isset($keywords) && !empty($keywords)) {
1188
- add_post_meta($id, '_aioseop_keywords', $keywords);
1189
- }
1190
- if (isset($description) && !empty($description)) {
1191
- add_post_meta($id, '_aioseop_description', $description);
1192
- }
1193
- if (isset($title) && !empty($title)) {
1194
- add_post_meta($id, '_aioseop_title', $title);
1195
- }
1196
- if (isset($aiosp_titleatr) && !empty($aiosp_titleatr)) {
1197
- add_post_meta($id, '_aioseop_titleatr', $aiosp_titleatr);
1198
- }
1199
- if (isset($aiosp_menulabel) && !empty($aiosp_menulabel)) {
1200
- add_post_meta($id, '_aioseop_menulabel', $aiosp_menulabel);
1201
- }
1202
- if (isset($aiosp_disable) && !empty($aiosp_disable) && $this->is_admin()) {
1203
- add_post_meta($id, '_aioseop_disable', $aiosp_disable);
1204
- }
1205
- if (isset($aiosp_disable_analytics) && !empty($aiosp_disable_analytics) && $this->is_admin()) {
1206
- add_post_meta($id, '_aioseop_disable_analytics', $aiosp_disable_analytics);
1207
- }
1208
- /*
1209
- if (isset($aiosp_meta) && !empty($aiosp_meta)) {
1210
- add_post_meta($id, 'aiosp_meta', $aiosp_meta);
1211
- }
1212
- */
1213
- }
1214
- }
1215
-
1216
- function edit_category($id) {
1217
- global $wpdb;
1218
- $id = $wpdb->escape($id);
1219
- $awmp_edit = $_POST["aiosp_edit"];
1220
- if (isset($awmp_edit) && !empty($awmp_edit)) {
1221
- $keywords = $wpdb->escape($_POST["aiosp_keywords"]);
1222
- $title = $wpdb->escape($_POST["aiosp_title"]);
1223
- $old_category = $wpdb->get_row("select * from $this->table_categories where category_id=$id", OBJECT);
1224
- if ($old_category) {
1225
- $wpdb->query($wpdb->prepare("update $this->table_categories
1226
- set meta_title='$title', meta_keywords='$keywords'
1227
- where category_id=$id"));
1228
- } else {
1229
- $wpdb->query($wpdb->prepare("insert into $this->table_categories(meta_title, meta_keywords, category_id)
1230
- values ('$title', '$keywords', $id"));
1231
- }
1232
- //$wpdb->query($wpdb->prepare("insert into $this->table_categories"))
1233
- /*
1234
- delete_post_meta($id, 'keywords');
1235
- delete_post_meta($id, 'description');
1236
- delete_post_meta($id, 'title');
1237
-
1238
- if (isset($keywords) && !empty($keywords)) {
1239
- add_post_meta($id, 'keywords', $keywords);
1240
- }
1241
- if (isset($description) && !empty($description)) {
1242
- add_post_meta($id, 'description', $description);
1243
- }
1244
- if (isset($title) && !empty($title)) {
1245
- add_post_meta($id, 'title', $title);
1246
- }
1247
- */
1248
- }
1249
- }
1250
-
1251
- /**
1252
- * @deprecated This was for the feature of dedicated meta tags for categories which never went mainstream.
1253
- */
1254
- function edit_category_form() {
1255
- global $post;
1256
- $keywords = stripcslashes(get_post_meta($post->ID, '_aioseop_keywords', true));
1257
- $title = stripcslashes(get_post_meta($post->ID, '_aioseop_title', true));
1258
- $description = stripcslashes(get_post_meta($post->ID, '_aioseop_description', true));
1259
- ?>
1260
- <input value="aiosp_edit" type="hidden" name="aiosp_edit" />
1261
- <table class="editform" width="100%" cellspacing="2" cellpadding="5">
1262
- <tr>
1263
- <th width="33%" scope="row" valign="top">
1264
- <a href="http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/"><?php _e('All in One SEO Pack', 'all_in_one_seo_pack') ?></a>
1265
- </th>
1266
- </tr>
1267
- <tr>
1268
- <th width="33%" scope="row" valign="top"><label for="aiosp_title"><?php _e('Title:', 'all_in_one_seo_pack') ?></label></th>
1269
- <td><input value="<?php echo $title ?>" type="text" name="aiosp_title" size="70"/></td>
1270
- </tr>
1271
- <tr>
1272
- <th width="33%" scope="row" valign="top"><label for="aiosp_keywords"><?php _e('Keywords (comma separated):', 'all_in_one_seo_pack') ?></label></th>
1273
- <td><input value="<?php echo $keywords ?>" type="text" name="aiosp_keywords" size="70"/></td>
1274
- </tr>
1275
- </table>
1276
- <?php
1277
- }
1278
-
1279
- function add_meta_tags_textinput() {
1280
- global $post;
1281
- $post_id = $post;
1282
- if (is_object($post_id)) {
1283
- $post_id = $post_id->ID;
1284
- }
1285
- $keywords = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_keywords', true)));
1286
- $title = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_title', true)));
1287
- $description = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_description', true)));
1288
- $aiosp_meta = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_meta', true)));
1289
- $aiosp_disable = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_disable', true)));
1290
- $aiosp_disable_analytics = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_disable_analytics', true)));
1291
- $aiosp_titleatr = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_titleatr', true)));
1292
- $aiosp_menulabel = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_menulabel', true)));
1293
-
1294
- ?>
1295
- <SCRIPT LANGUAGE="JavaScript">
1296
- <!-- Begin
1297
- function countChars(field,cntfield) {
1298
- cntfield.value = field.value.length;
1299
- }
1300
- // End -->
1301
- </script>
1302
-
1303
- <div id="postaiosp" class="postbox closed">
1304
- <h3><?php _e('All in One SEO Pack', 'all_in_one_seo_pack') ?></h3>
1305
- <div class="inside">
1306
- <div id="postaiosp">
1307
-
1308
- <a target="__blank" href="http://semperfiwebdesign.com/portfolio/wordpress/wordpress-plugins/all-in-one-seo-pack/"><?php _e('Click here for Support', 'all_in_one_seo_pack') ?></a>
1309
- <input value="aiosp_edit" type="hidden" name="aiosp_edit" />
1310
- <table style="margin-bottom:40px">
1311
- <tr>
1312
- <th style="text-align:left;" colspan="2">
1313
- </th>
1314
- </tr>
1315
- <tr>
1316
- <th scope="row" style="text-align:right;"><?php _e('Title:', 'all_in_one_seo_pack') ?></th>
1317
- <td><input value="<?php echo $title ?>" type="text" name="aiosp_title" size="62"/></td>
1318
- </tr>
1319
- <tr>
1320
- <th scope="row" style="text-align:right;"><?php _e('Description:', 'all_in_one_seo_pack') ?></th>
1321
- <td><textarea name="aiosp_description" rows="1" cols="60" onKeyDown="countChars(document.post.aiosp_description,document.post.length1)" onKeyUp="countChars(document.post.aiosp_description,document.post.length1)"><?php echo $description ?>
1322
- </textarea><br />
1323
- <input readonly type="text" name="length1" size="3" maxlength="3" value="<?php echo strlen($description);?>" />
1324
- <?php _e(' characters. Most search engines use a maximum of 160 chars for the description.', 'all_in_one_seo_pack') ?>
1325
- </td>
1326
- </tr>
1327
- <tr>
1328
- <th scope="row" style="text-align:right;"><?php _e('Keywords (comma separated):', 'all_in_one_seo_pack') ?></th>
1329
- <td><input value="<?php echo $keywords ?>" type="text" name="aiosp_keywords" size="62"/></td>
1330
- </tr>
1331
- <input type="hidden" name="nonce-aioseop-edit" value="<?php echo wp_create_nonce('edit-aioseop-nonce'); ?>" />
1332
- <?php if ($this->is_admin()) { ?>
1333
- <tr>
1334
- <th scope="row" style="text-align:right; vertical-align:top;">
1335
- <?php _e('Disable on this page/post:', 'all_in_one_seo_pack')?>
1336
- </th>
1337
- <td>
1338
- <input type="checkbox" name="aiosp_disable" <?php if ($aiosp_disable) echo "checked=\"1\""; ?>/>
1339
- </td>
1340
- </tr>
1341
- <?php if ( $aiosp_disable ) { ?>
1342
- <tr>
1343
- <th scope="row" style="text-align:right; vertical-align:top;">
1344
- <?php _e('Disable Google Analytics:', 'all_in_one_seo_pack')?>
1345
- </th>
1346
- <td>
1347
- <input type="checkbox" name="aiosp_disable_analytics" <?php if ($aiosp_disable_analytics) echo "checked=\"1\""; ?>/>
1348
- </td>
1349
- </tr>
1350
- <?php } ?>
1351
- <tr>
1352
- <th scope="row" style="text-align:right;"><?php _e('Title Attribute:', 'all_in_one_seo_pack') ?></th>
1353
- <td><input value="<?php echo $aiosp_titleatr ?>" type="text" name="aiosp_titleatr" size="62"/></td>
1354
- </tr>
1355
- <tr>
1356
- <th scope="row" style="text-align:right;"><?php _e('Menu Label:', 'all_in_one_seo_pack') ?></th>
1357
- <td><input value="<?php echo $aiosp_menulabel ?>" type="text" name="aiosp_menulabel" size="62"/></td>
1358
- </tr>
1359
- <?php } ?>
1360
- </table>
1361
-
1362
- </div>
1363
- </div>
1364
- </div>
1365
-
1366
- <?php
1367
- }
1368
-
1369
- function admin_menu() {
1370
- $file = __FILE__;
1371
-
1372
- //add_management_page(__('All in One SEO Title', 'all_in_one_seo_pack'), __('All in One SEO', 'all_in_one_seo_pack'), 10, $file, array($this, 'management_panel'));
1373
- add_submenu_page('options-general.php', __('All in One SEO', 'all_in_one_seo_pack'), __('All in One SEO', 'all_in_one_seo_pack'), 'manage_options', $file, array($this, 'options_panel'));
1374
- }
1375
-
1376
- function management_panel() {
1377
- $message = null;
1378
- $base_url = "edit.php?page=" . __FILE__;
1379
- //echo($base_url);
1380
- $type = $_REQUEST['type'];
1381
- if (!isset($type)) {
1382
- $type = "posts";
1383
- }
1384
- ?>
1385
-
1386
- <ul class="aiosp_menu">
1387
- <li><a href="<?php echo $base_url ?>&type=posts">Posts</a>
1388
- </li>
1389
- <li><a href="<?php echo $base_url ?>&type=pages">Pages</a>
1390
- </li>
1391
- </ul>
1392
-
1393
- <?php
1394
-
1395
- if ($type == "posts") {
1396
- echo("posts");
1397
- } elseif ($type == "pages") {
1398
- echo("pages");
1399
- }
1400
- }
1401
-
1402
- function options_panel() {
1403
- $message = null;
1404
- //$message_updated = __("All in One SEO Options Updated.", 'all_in_one_seo_pack');
1405
- global $aioseop_options;
1406
-
1407
- if(!$aioseop_options['aiosp_cap_cats']) {
1408
- $aioseop_options['aiosp_cap_cats'] = '1';
1409
- }
1410
-
1411
-
1412
- if (isset($_POST['action']) && $_POST['action'] == 'aiosp_update' && isset($_POST['Submit_Default'])) {
1413
- $nonce = $_POST['nonce-aioseop'];
1414
- if (!wp_verify_nonce($nonce, 'aioseop-nonce')) die ( 'Security Check - If you receive this in error, log out and back in to WordPress');
1415
- $message = __("All in One SEO Options Reset.", 'all_in_one_seo_pack');
1416
- delete_option('aioseop_options');
1417
- $res_aioseop_options = array(
1418
- "aiosp_can"=>1,
1419
- "aiosp_donate"=>0,
1420
- "aiosp_home_title"=>null,
1421
- "aiosp_home_description"=>'',
1422
- "aiosp_home_keywords"=>null,
1423
- "aiosp_max_words_excerpt"=>'something',
1424
- "aiosp_rewrite_titles"=>1,
1425
- "aiosp_post_title_format"=>'%post_title% | %blog_title%',
1426
- "aiosp_page_title_format"=>'%page_title% | %blog_title%',
1427
- "aiosp_category_title_format"=>'%category_title% | %blog_title%',
1428
- "aiosp_archive_title_format"=>'%date% | %blog_title%',
1429
- "aiosp_tag_title_format"=>'%tag% | %blog_title%',
1430
- "aiosp_search_title_format"=>'%search% | %blog_title%',
1431
- "aiosp_description_format"=>'%description%',
1432
- "aiosp_404_title_format"=>'Nothing found for %request_words%',
1433
- "aiosp_paged_format"=>' - Part %page%',
1434
- "aiosp_google_analytics_id"=>null,
1435
- "aiosp_ga_domain"=>'',
1436
- "aiosp_ga_multi_domain"=>0,
1437
- "aiosp_ga_track_outbound_links"=>0,
1438
- "aiosp_google_publisher"=>'',
1439
- "aiosp_use_categories"=>0,
1440
- "aiosp_dynamic_postspage_keywords"=>1,
1441
- "aiosp_category_noindex"=>1,
1442
- "aiosp_archive_noindex"=>1,
1443
- "aiosp_tags_noindex"=>0,
1444
- "aiosp_cap_cats"=>1,
1445
- "aiosp_generate_descriptions"=>1,
1446
- "aiosp_debug_info"=>null,
1447
- "aiosp_post_meta_tags"=>'',
1448
- "aiosp_enablecpost"=>'0',
1449
- "aiosp_page_meta_tags"=>'',
1450
- "aiosp_home_meta_tags"=>'',
1451
- "aiosp_front_meta_tags"=>'',
1452
- "aiosp_enabled" =>0,
1453
- "aiosp_use_tags_as_keywords" =>1,
1454
- "aiosp_seopostcol" => 1,
1455
- "aiosp_seocustptcol" => 0,
1456
- "aiosp_posttypecolumns" => array('post','page'),
1457
- "aiosp_do_log"=>null);
1458
- update_option('aioseop_options', $res_aioseop_options);
1459
- }
1460
-
1461
-
1462
- // update options
1463
- if(isset($_POST['action'])){
1464
- if ($_POST['action'] && $_POST['action'] == 'aiosp_update' && !empty( $_POST['Submit'] ) ) {
1465
- $nonce = $_POST['nonce-aioseop'];
1466
- if (!wp_verify_nonce($nonce, 'aioseop-nonce')) die ( 'Security Check - If you receive this in error, log out and back in to WordPress');
1467
- $message = __("All in One SEO Options Updated.", 'all_in_one_seo_pack');
1468
-
1469
- $options = Array( "aiosp_can", "aiosp_donate", "aiosp_home_title", "aiosp_home_description", "aiosp_home_keywords", "aiosp_max_words_excerpt",
1470
- "aiosp_rewrite_titles", "aiosp_post_title_format", "aiosp_page_title_format", "aiosp_category_title_format",
1471
- "aiosp_archive_title_format", "aiosp_tag_title_format", "aiosp_search_title_format", "aiosp_description_format",
1472
- "aiosp_404_title_format", "aiosp_paged_format", "aiosp_google_publisher", "aiosp_google_analytics_id", "aiosp_ga_domain", "aiosp_ga_multi_domain", "aiosp_ga_track_outbound_links",
1473
- "aiosp_use_categories", "aiosp_dynamic_postspage_keywords", "aiosp_category_noindex", "aiosp_archive_noindex",
1474
- "aiosp_tags_noindex", "aiosp_generate_descriptions", "aiosp_cap_cats", "aiosp_enablecpost", "aiosp_debug_info",
1475
- "aiosp_post_meta_tags", "aiosp_page_meta_tags", "aiosp_home_meta_tags", "aiosp_front_meta_tags", "aiosp_ex_pages", "aiosp_do_log",
1476
- "aiosp_enabled", "aiosp_use_tags_as_keywords", "aiosp_seopostcol", "aiosp_seocustptcol", "aiosp_posttypecolumns");
1477
-
1478
- $esc_options = Array( "aiosp_home_title", "aiosp_home_description", "aiosp_google_analytics_id", "aiosp_ga_domain", "aiosp_google_publisher", "aiosp_google_analytics_id" );
1479
-
1480
- foreach( $options as $o ) {
1481
- $aioseop_options[$o] = '';
1482
- if ( in_array( $o, $esc_options ) ) {
1483
- if ( isset( $_POST[$o] ) ) $aioseop_options[$o] = esc_attr( $_POST[$o] );
1484
- } else {
1485
- if ( isset( $_POST[$o] ) ) $aioseop_options[$o] = $_POST[$o];
1486
- }
1487
- }
1488
-
1489
- update_option('aioseop_options', $aioseop_options);
1490
-
1491
- wp_cache_flush();
1492
- }
1493
- } /*elseif ($_POST['aiosp_upgrade']) {
1494
- $message = __("Upgraded to newest version. Please revisit the options page to make sure you see the newest version.", 'all_in_one_seo_pack');
1495
- $success = $this->install_newest_version();
1496
- if (!$success) {
1497
- $message = __("Upgrade failed", 'all_in_one_seo_pack');
1498
- if (isset($this->upgrade_error) && !empty($this->upgrade_error)) {
1499
- $message .= ": " . $this->upgrade_error;
1500
- } else {
1501
- $message .= ".";
1502
- }
1503
- }
1504
- }*/
1505
-
1506
- if ($message){
1507
- echo "<div id=\"message\" class=\"updated fade\"><p>$message</p></div>";
1508
- }
1509
- ?>
1510
- <div id="dropmessage" class="updated" style="display:none;"></div>
1511
- <div class="wrap">
1512
-
1513
- <h2><?php _e('All in One SEO Plugin Options', 'all_in_one_seo_pack'); ?></h2>
1514
- by <strong>Michael Torbert</strong> of <strong>Semper Fi Web Design</strong>
1515
- <p>
1516
- <div style="float:left;">
1517
-
1518
- <?php //_e("This is version ", 'all_in_one_seo_pack') ?><?php //_e("$this->version ", 'all_in_one_seo_pack') ?>
1519
- &nbsp;<a target="_blank" title="<?php _e('All in One SEO Plugin Support Forum', 'all_in_one_seo_pack') ?>"
1520
- href="http://semperplugins.com/support/"><?php _e('Support', 'all_in_one_seo_pack') ?></a>
1521
- | <a target="_blank" title="<?php _e('All in One SEO Plugin Translations', 'all_in_one_seo_pack') ?>"
1522
- href="http://semperfiwebdesign.com/documentation/all-in-one-seo-pack/translations-for-all-in-one-seo-pack/"><?php _e('Translations', 'all_in_one_seo_pack') ?></a>
1523
- | <strong><a target="_blank" title="<?php _e('Pro Version', 'all_in_one_seo_pack') ?>"
1524
- href="http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/"><?php _e('UPGRADE TO PRO VERSION', 'all_in_one_seo_pack') ?></a></strong>
1525
- </div>
1526
-
1527
- <div style="width:600px;margin-top:40px;">
1528
- <form action="http://semperfiwebdesign.us1.list-manage.com/subscribe/post?u=794674d3d54fdd912f961ef14&amp;id=af0a96d3d9" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank">
1529
- <span>Join our mailing list for tips, tricks, and WordPress secrets.<br /><em><strong>Sign up today and receive a free copy of the e-book 5 SEO Tips for WordPress</strong></em> ($39 value).</span>
1530
- <div>
1531
- <label for="mce-EMAIL">Email Address </label>
1532
- <input type="text" value="" name="EMAIL" class="required email" id="mce-EMAIL">
1533
-
1534
-
1535
- <input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="btn">
1536
- </div>
1537
- </form>
1538
- </div>
1539
- <div style="clear:both;">
1540
-
1541
- <br />
1542
- </p>
1543
-
1544
- <div style="width:905px;">
1545
- <div style="float:left;background-color:white;padding: 10px;margin-right:15px;border: 1px solid #ddd;height:200px;margin-bottom:2px;">
1546
- <div style="width:423px;height:130px;">
1547
- <h3>Donate</h3>
1548
- <em>If you like this plugin and find it useful, help keep this plugin free and actively developed by clicking the <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtorbert%40gmail%2ecom&item_name=All%20In%20One%20SEO%20Pack&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8" target="_blank"><strong>donate</strong></a> button or send me a gift from my <a href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web" target="_blank"><strong>Amazon wishlist</strong></a>. Also, don't forget to follow me on <a href="http://twitter.com/michaeltorbert/" target="_blank"><strong>Twitter</strong></a>.</em>
1549
- </div>
1550
- <a target="_blank" title="<?php echo 'Donate' ?>"
1551
- href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtorbert%40gmail%2ecom&item_name=All%20In%20One%20SEO%20Pack&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8">
1552
- <img src="<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>donate.jpg" alt="<?php _e('Donate with Paypal', 'all_in_one_seo_pack') ?>" /> </a>
1553
- <a target="_blank" title="Amazon Wish List" href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web">
1554
- <img src="<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>amazon.jpg" alt="<?php _e('My Amazon Wish List', 'all_in_one_seo_pack') ?>" /> </a>
1555
- <a target="_blank" title="<?php _e('Follow us on Twitter', 'all_in_one_seo_pack') ?>" href="http://twitter.com/michaeltorbert/">
1556
- <img src="<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>twitter.jpg" alt="<?php _e('Follow Us on Twitter', 'all_in_one_seo_pack') ?>" /> </a>
1557
- </div>
1558
-
1559
- <div style="float:left;background-color:white;padding:10px;border:1px solid #ddd;height:200px;">
1560
- <div style="width:423px;height:130px">
1561
- <h3>Drag and Drop WordPress Design</h3>
1562
- <p><a href="http://semperfiwebdesign.com/headwayaio/" target="_blank">Headway Themes</a> allows you to easily create your own stunning website designs! Stop using premade themes start making your own design with Headway's easy to use Drag and Drop interface. All in One SEO Pack users have an exclusive discount by using coupon code <strong>SEMPERFI30</strong> at checkout.</p>
1563
- </div>
1564
- <a href="http://semperfiwebdesign.com/headwayaio/" target="_blank"><img src="<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>headwaybanner.png"></a>
1565
- </div>
1566
- </div>
1567
-
1568
- <!--
1569
- <div style="float:left;background-color:white;padding: 10px 10px 10px 10px;border: 1px solid #ddd;">
1570
- <div style="width:365px;height:130px;">
1571
-
1572
- <form action="http://semperfiwebdesign.us1.list-manage.com/subscribe/post?u=794674d3d54fdd912f961ef14&amp;id=af0a96d3d9" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank">
1573
- <span>Join our mailing list for tips, tricks, and WordPress secrets. Also receive discounts on top commercial plugins and themes.<br /><em><strong>Sign up today and receive a free copy of the e-book 5 SEO Tips for WordPress</strong></em>.</span>
1574
- <div class="mc-field-group">
1575
- <label for="mce-EMAIL">Email Address </label>
1576
- <input type="text" value="" name="EMAIL" class="required email" id="mce-EMAIL">
1577
- </div>
1578
-
1579
- <div><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="btn"></div>
1580
- </form>
1581
- </div>
1582
- </div>
1583
- -->
1584
- </div>
1585
- <div style="clear:both";></div>
1586
- <!--
1587
- <p>
1588
- <?php
1589
- //$canwrite = $this->is_upgrade_directory_writable();
1590
- //$canwrite = false;
1591
- ?>
1592
- <form class="form-table" name="dofollow" action="" method="post">
1593
- <p class="submit">
1594
- <input type="submit" <?php //if (!$canwrite) echo(' disabled="disabled" ');?> name="aiosp_upgrade" value="<?php //_e('One Click Upgrade', 'all_in_one_seo_pack')?> &raquo;" />
1595
- <strong><?php //_e("(Remember: Backup early, backup often!)", 'all_in_one_seo_pack') ?></strong>
1596
- </form>
1597
- </p>
1598
- <p></p>
1599
-
1600
-
1601
- <?php //if (!$canwrite) {
1602
- //echo("<p><strong>"); echo(sprintf(__("Please make sure that %s is writable.", 'all_in_one_seo_pack'), $this->upgrade_folder)); echo("</p></strong>");
1603
- // } ?>
1604
- </p>
1605
- -->
1606
-
1607
- <script type="text/javascript">
1608
- <!--
1609
- function toggleVisibility(id) {
1610
- var e = document.getElementById(id);
1611
- if(e.style.display == 'block')
1612
- e.style.display = 'none';
1613
- else
1614
- e.style.display = 'block';
1615
- }
1616
- //-->
1617
- </script>
1618
-
1619
- <h3><?php _e('Click on option titles to get help!', 'all_in_one_seo_pack') ?></h3>
1620
-
1621
- <?php
1622
- function aioseop_mrt_df(){
1623
-
1624
- if(function_exists('fetch_feed')){
1625
- // start new feed
1626
- echo "Highest Donations";
1627
- // Get RSS Feed(s)
1628
- include_once(ABSPATH . WPINC . '/feed.php');
1629
-
1630
- // Get a SimplePie feed object from the specified feed source.
1631
- $rss = fetch_feed('feed://donations.semperfiwebdesign.com/category/highest-donations/feed/');
1632
-
1633
- // Figure out how many total items there are, but limit it to 5.
1634
- $maxitems = $rss->get_item_quantity(3);
1635
-
1636
- // Build an array of all the items, starting with element 0 (first element).
1637
- $rss_items = $rss->get_items(0, $maxitems);
1638
- ?>
1639
-
1640
- <ul>
1641
- <?php if ($maxitems == 0) echo '<li>No items.</li>';
1642
- else
1643
- // Loop through each feed item and display each item as a hyperlink.
1644
- foreach ( $rss_items as $item ) : ?>
1645
- <li>
1646
- <a href='<?php echo $item->get_permalink(); ?>'
1647
- title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>'>
1648
- <?php echo $item->get_title(); ?></a>
1649
- </li>
1650
- <?php endforeach; ?>
1651
- </ul>
1652
-
1653
- <?php echo "Latest Donations"; ?>
1654
- <?php // Get RSS Feed(s)
1655
- include_once(ABSPATH . WPINC . '/feed.php');
1656
-
1657
- // Get a SimplePie feed object from the specified feed source.
1658
- $rss = fetch_feed('feed://donations.semperfiwebdesign.com/category/all-in-one-seo-pack/feed/');
1659
-
1660
- // Figure out how many total items there are, but limit it to 5.
1661
- $maxitems = $rss->get_item_quantity(3);
1662
-
1663
- // Build an array of all the items, starting with element 0 (first element).
1664
- $rss_items = $rss->get_items(0, $maxitems);
1665
- ?>
1666
-
1667
- <ul>
1668
- <?php if ($maxitems == 0) echo '<li>No items.</li>';
1669
- else
1670
- // Loop through each feed item and display each item as a hyperlink.
1671
- foreach ( $rss_items as $item ) : ?>
1672
- <li>
1673
- <a href='<?php echo $item->get_permalink(); ?>'
1674
- title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>'>
1675
- <?php echo $item->get_title(); ?></a>
1676
- </li>
1677
- <?php endforeach; ?>
1678
- </ul>
1679
-
1680
-
1681
- <?php // end new feed
1682
- }else{
1683
-
1684
- $uri = "feed://donations.semperfiwebdesign.com/category/highest-donations/feed/";
1685
- include_once(ABSPATH . WPINC . '/rss.php');
1686
- $rss = fetch_rss($uri);
1687
- if($rss){
1688
- echo "Highest Donations";
1689
- $maxitems = 5;
1690
- if(is_array($rss->items)){
1691
- $items = array_slice($rss->items, 0, $maxitems);
1692
- ?>
1693
- <ul>
1694
- <?php if (empty($items)) echo '<li>No items</li>';
1695
- else
1696
- foreach ( $items as $item ) : ?>
1697
- <li><a href='<?php echo $item['description']; ?>'
1698
- title='<?php echo $item['title']; ?>'>
1699
- <?php echo $item['title']; ?>
1700
- </a></li>
1701
- <?php endforeach; ?>
1702
- </ul>
1703
- <?php } }else{
1704
- //do something else for feed here
1705
- }
1706
-
1707
-
1708
- ?>
1709
-
1710
- <?php
1711
- $uri = "feed://donations.semperfiwebdesign.com/category/all-in-one-seo-pack/feed/";
1712
- include_once(ABSPATH . WPINC . '/rss.php');
1713
- $rss = fetch_rss($uri);
1714
- if($rss){
1715
- echo "Latest Donations";
1716
- $maxitems = 5;
1717
- if(is_array($rss->items)){
1718
- $items = array_slice($rss->items, 0, $maxitems);
1719
- ?>
1720
- <ul>
1721
- <?php if (empty($items)) echo '<li>No items</li>';
1722
- else
1723
- foreach ( $items as $item ) : ?>
1724
- <li><a href='<?php echo $item['link']; ?>'
1725
- title='<?php echo $item['title']; ?>'>
1726
- <?php echo $item['title']; ?>
1727
- </a></li>
1728
- <?php endforeach; ?>
1729
- </ul>
1730
- <?php } }else{
1731
- //fall back on something else for feed here
1732
- }
1733
- }
1734
- }
1735
-
1736
- //aioseop_mrt_df();
1737
-
1738
- ?>
1739
-
1740
-
1741
-
1742
- <?php
1743
- global $wpdb;
1744
- $somecount = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = 'keywords'");
1745
- $somecount = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = 'title'") + $somecount;
1746
- $somecount = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = 'description'") + $somecount;
1747
- $somecount = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = 'aiosp_meta'") + $somecount;
1748
- $somecount = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = 'aiosp_disable'") + $somecount;
1749
- if($somecount > 0){
1750
- echo "<div class='error' style='text-align:center;'><p><strong>Your database meta needs to be updated. " . $somecount . " old fields remaining</strong> <em>(Back up your database before updating.)</em>
1751
- <FORM action='' method='post' name='aioseop-migrate'>
1752
- <input type='hidden' name='nonce-aioseop-migrate' value='" . wp_create_nonce('aioseop-migrate-nonce') . "' />
1753
- <input type='submit' name='aioseop_migrate' class='button-primary' value='Update Database'>
1754
- </FORM>
1755
- </p></div>";
1756
- }
1757
-
1758
- if(!get_option('aioseop_options')){
1759
- echo "<div class='error' style='text-align:center;'><p><strong>Your database options need to be updated.</strong><em>(Back up your database before updating.)</em>
1760
- <FORM action='' method='post' name='aioseop-migrate-options'>
1761
- <input type='hidden' name='nonce-aioseop-migrate-options' value='" . wp_create_nonce('aioseop-migrate-nonce-options') . "' />
1762
- <input type='submit' name='aioseop_migrate_options' class='button-primary' value='Update Database Options'>
1763
- </FORM>
1764
- </p></div>";
1765
-
1766
- }
1767
-
1768
- ?>
1769
-
1770
-
1771
- <form name="dofollow" action="" method="post">
1772
- <table class="form-table">
1773
- <?php $aioseop_options = get_option('aioseop_options'); ?>
1774
- <?php if (!$aioseop_options['aiosp_donate']){?>
1775
- <tr>
1776
- <th scope="row" style="text-align:right; vertical-align:top;">
1777
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_donate_tip');">
1778
- <?php _e('I enjoy this plugin and have made a donation:', 'all_in_one_seo_pack'); ?>
1779
- </a>
1780
- </td>
1781
- <td>
1782
- <input type="checkbox" name="aiosp_donate" <?php if ($aioseop_options['aiosp_donate']) echo "checked=\"1\""; ?>/>
1783
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_donate_tip">
1784
- <?php
1785
- _e('All donations support continued development of this free software.', 'all_in_one_seo_pack');
1786
- ?>
1787
- </div>
1788
- </td>
1789
- </tr>
1790
- <?php } ?>
1791
-
1792
- <tr>
1793
- <th scope="row" style="text-align:right; vertical-align:top;">
1794
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack'); ?>" onclick="toggleVisibility('aiosp_enabled_tip');">
1795
- <?php _e('Plugin Status:', 'all_in_one_seo_pack')?>
1796
- </a>
1797
- </td>
1798
- <td>
1799
- <input type="radio" name="aiosp_enabled" value="1" <?php if($aioseop_options['aiosp_enabled']) echo "checked"?> > <?php _e('Enabled', 'all_in_one_seo_pack'); ?><br>
1800
- <input type="radio" name="aiosp_enabled" value="0" <?php if(!$aioseop_options['aiosp_enabled']) echo "checked"?>> <?php _e('Disabled', 'all_in_one_seo_pack'); ?>
1801
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_enabled_tip">
1802
- <?php
1803
- _e('All in One SEO Pack must be enabled for use.', 'all_in_one_seo_pack');
1804
- ?>
1805
- </div>
1806
- </td>
1807
- </tr>
1808
-
1809
- <tr>
1810
- <th scope="row" style="text-align:right; vertical-align:top;">
1811
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_home_title_tip');">
1812
- <?php _e('Home Title:', 'all_in_one_seo_pack')?>
1813
- </a>
1814
- </td>
1815
- <td>
1816
- <textarea cols="57" rows="2" name="aiosp_home_title"><?php echo stripcslashes($aioseop_options['aiosp_home_title']); ?></textarea>
1817
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_home_title_tip">
1818
- <?php
1819
- _e('As the name implies, this will be the title of your homepage. This is independent of any other option. If not set, the default blog title will get used.', 'all_in_one_seo_pack');
1820
- ?>
1821
- </div>
1822
- </td>
1823
- </tr>
1824
-
1825
- <tr>
1826
- <th scope="row" style="text-align:right; vertical-align:top;">
1827
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_home_description_tip');">
1828
- <?php _e('Home Description:', 'all_in_one_seo_pack')?>
1829
- </a>
1830
- </td>
1831
- <td>
1832
- <textarea cols="57" rows="2" name="aiosp_home_description"><?php echo stripcslashes($aioseop_options['aiosp_home_description']); ?></textarea>
1833
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_home_description_tip">
1834
- <?php
1835
- _e('The META description for your homepage. Independent of any other options, the default is no META description at all if this is not set.', 'all_in_one_seo_pack');
1836
- ?>
1837
- </div>
1838
- </td>
1839
- </tr>
1840
-
1841
- <tr>
1842
- <th scope="row" style="text-align:right; vertical-align:top;">
1843
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_home_keywords_tip');">
1844
- <?php _e('Home Keywords (comma separated):', 'all_in_one_seo_pack')?>
1845
- </a>
1846
- </td>
1847
- <td>
1848
- <textarea cols="57" rows="2" name="aiosp_home_keywords"><?php echo stripcslashes($aioseop_options['aiosp_home_keywords']); ?></textarea>
1849
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_home_keywords_tip">
1850
- <?php
1851
- _e("A comma separated list of your most important keywords for your site that will be written as META keywords on your homepage. Don't stuff everything in here.", 'all_in_one_seo_pack');
1852
- ?>
1853
- </div>
1854
- </td>
1855
- </tr>
1856
-
1857
- <tr>
1858
- <th scope="row" style="text-align:right; vertical-align:top;">
1859
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_can_tip');">
1860
- <?php _e('Canonical URLs:', 'all_in_one_seo_pack')?>
1861
- </a>
1862
- </td>
1863
- <td>
1864
- <input type="checkbox" name="aiosp_can" <?php if ($aioseop_options['aiosp_can']) echo "checked=\"1\""; ?>/>
1865
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_can_tip">
1866
- <?php
1867
- _e("This option will automatically generate Canonical URLS for your entire WordPress installation. This will help to prevent duplicate content penalties by <a href='http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html' target='_blank'>Google</a>.", 'all_in_one_seo_pack');
1868
- ?>
1869
- </div>
1870
- </td>
1871
- </tr>
1872
-
1873
- <tr>
1874
- <th scope="row" style="text-align:right; vertical-align:top;">
1875
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_rewrite_titles_tip');">
1876
- <?php _e('Rewrite Titles:', 'all_in_one_seo_pack')?>
1877
- </a>
1878
- </td>
1879
- <td>
1880
- <input type="checkbox" name="aiosp_rewrite_titles" <?php if ($aioseop_options['aiosp_rewrite_titles']) echo "checked=\"1\""; ?>/>
1881
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_rewrite_titles_tip">
1882
- <?php
1883
- _e("Note that this is all about the title tag. This is what you see in your browser's window title bar. This is NOT visible on a page, only in the window title bar and of course in the source. If set, all page, post, category, search and archive page titles get rewritten. You can specify the format for most of them. For example: The default templates puts the title tag of posts like this: “Blog Archive >> Blog Name >> Post Title” (maybe I've overdone slightly). This is far from optimal. With the default post title format, Rewrite Title rewrites this to “Post Title | Blog Name”. If you have manually defined a title (in one of the text fields for All in One SEO Plugin input) this will become the title of your post in the format string.", 'all_in_one_seo_pack');
1884
- ?>
1885
- </div>
1886
- </td>
1887
- </tr>
1888
-
1889
- <tr>
1890
- <th scope="row" style="text-align:right; vertical-align:top;">
1891
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_post_title_format_tip');">
1892
- <?php _e('Post Title Format:', 'all_in_one_seo_pack')?>
1893
- </a>
1894
- </td>
1895
- <td>
1896
- <input size="59" name="aiosp_post_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_post_title_format']); ?>"/>
1897
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_post_title_format_tip">
1898
- <?php
1899
- _e('The following macros are supported:', 'all_in_one_seo_pack');
1900
- echo('<ul>');
1901
- echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1902
- echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1903
- echo('<li>'); _e('%post_title% - The original title of the post', 'all_in_one_seo_pack'); echo('</li>');
1904
- echo('<li>'); _e('%category_title% - The (main) category of the post', 'all_in_one_seo_pack'); echo('</li>');
1905
- echo('<li>'); _e('%category% - Alias for %category_title%', 'all_in_one_seo_pack'); echo('</li>');
1906
- echo('<li>'); _e("%post_author_login% - This post's author' login", 'all_in_one_seo_pack'); echo('</li>');
1907
- echo('<li>'); _e("%post_author_nicename% - This post's author' nicename", 'all_in_one_seo_pack'); echo('</li>');
1908
- echo('<li>'); _e("%post_author_firstname% - This post's author' first name (capitalized)", 'all_in_one_seo_pack'); echo('</li>');
1909
- echo('<li>'); _e("%post_author_lastname% - This post's author' last name (capitalized)", 'all_in_one_seo_pack'); echo('</li>');
1910
- echo('</ul>');
1911
- ?>
1912
- </div>
1913
- </td>
1914
- </tr>
1915
-
1916
- <tr>
1917
- <th scope="row" style="text-align:right; vertical-align:top;">
1918
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_page_title_format_tip');">
1919
- <?php _e('Page Title Format:', 'all_in_one_seo_pack')?>
1920
- </a>
1921
- </td>
1922
- <td>
1923
- <input size="59" name="aiosp_page_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_page_title_format']); ?>"/>
1924
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_page_title_format_tip">
1925
- <?php
1926
- _e('The following macros are supported:', 'all_in_one_seo_pack');
1927
- echo('<ul>');
1928
- echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1929
- echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1930
- echo('<li>'); _e('%page_title% - The original title of the page', 'all_in_one_seo_pack'); echo('</li>');
1931
- echo('<li>'); _e("%page_author_login% - This page's author' login", 'all_in_one_seo_pack'); echo('</li>');
1932
- echo('<li>'); _e("%page_author_nicename% - This page's author' nicename", 'all_in_one_seo_pack'); echo('</li>');
1933
- echo('<li>'); _e("%page_author_firstname% - This page's author' first name (capitalized)", 'all_in_one_seo_pack'); echo('</li>');
1934
- echo('<li>'); _e("%page_author_lastname% - This page's author' last name (capitalized)", 'all_in_one_seo_pack'); echo('</li>');
1935
- echo('</ul>');
1936
- ?>
1937
- </div>
1938
- </td>
1939
- </tr>
1940
-
1941
- <tr>
1942
- <th scope="row" style="text-align:right; vertical-align:top;">
1943
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_category_title_format_tip');">
1944
- <?php _e('Category Title Format:', 'all_in_one_seo_pack')?>
1945
- </a>
1946
- </td>
1947
- <td>
1948
- <input size="59" name="aiosp_category_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_category_title_format']); ?>"/>
1949
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_category_title_format_tip">
1950
- <?php
1951
- _e('The following macros are supported:', 'all_in_one_seo_pack');
1952
- echo('<ul>');
1953
- echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1954
- echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1955
- echo('<li>'); _e('%category_title% - The original title of the category', 'all_in_one_seo_pack'); echo('</li>');
1956
- echo('<li>'); _e('%category_description% - The description of the category', 'all_in_one_seo_pack'); echo('</li>');
1957
- echo('</ul>');
1958
- ?>
1959
- </div>
1960
- </td>
1961
- </tr>
1962
-
1963
- <tr>
1964
- <th scope="row" style="text-align:right; vertical-align:top;">
1965
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_archive_title_format_tip');">
1966
- <?php _e('Archive Title Format:', 'all_in_one_seo_pack')?>
1967
- </a>
1968
- </td>
1969
- <td>
1970
- <input size="59" name="aiosp_archive_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_archive_title_format']); ?>"/>
1971
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_archive_title_format_tip">
1972
- <?php
1973
- _e('The following macros are supported:', 'all_in_one_seo_pack');
1974
- echo('<ul>');
1975
- echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1976
- echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1977
- echo('<li>'); _e('%date% - The original archive title given by wordpress, e.g. "2007" or "2007 August"', 'all_in_one_seo_pack'); echo('</li>');
1978
- echo('</ul>');
1979
- ?>
1980
- </div>
1981
- </td>
1982
- </tr>
1983
-
1984
- <tr>
1985
- <th scope="row" style="text-align:right; vertical-align:top;">
1986
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_tag_title_format_tip');">
1987
- <?php _e('Tag Title Format:', 'all_in_one_seo_pack')?>
1988
- </a>
1989
- </td>
1990
- <td>
1991
- <input size="59" name="aiosp_tag_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_tag_title_format']); ?>"/>
1992
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_tag_title_format_tip">
1993
- <?php
1994
- _e('The following macros are supported:', 'all_in_one_seo_pack');
1995
- echo('<ul>');
1996
- echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
1997
- echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
1998
- echo('<li>'); _e('%tag% - The name of the tag', 'all_in_one_seo_pack'); echo('</li>');
1999
- echo('</ul>');
2000
- ?>
2001
- </div>
2002
- </td>
2003
- </tr>
2004
-
2005
- <tr>
2006
- <th scope="row" style="text-align:right; vertical-align:top;">
2007
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_search_title_format_tip');">
2008
- <?php _e('Search Title Format:', 'all_in_one_seo_pack')?>
2009
- </a>
2010
- </td>
2011
- <td>
2012
- <input size="59" name="aiosp_search_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_search_title_format']); ?>"/>
2013
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_search_title_format_tip">
2014
- <?php
2015
- _e('The following macros are supported:', 'all_in_one_seo_pack');
2016
- echo('<ul>');
2017
- echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
2018
- echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
2019
- echo('<li>'); _e('%search% - What was searched for', 'all_in_one_seo_pack'); echo('</li>');
2020
- echo('</ul>');
2021
- ?>
2022
- </div>
2023
- </td>
2024
- </tr>
2025
-
2026
- <tr>
2027
- <th scope="row" style="text-align:right; vertical-align:top;">
2028
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_description_format_tip');">
2029
- <?php _e('Description Format:', 'all_in_one_seo_pack')?>
2030
- </a>
2031
- </td>
2032
- <td>
2033
- <input size="59" name="aiosp_description_format" value="<?php echo stripcslashes($aioseop_options['aiosp_description_format']); ?>"/>
2034
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_description_format_tip">
2035
- <?php
2036
- _e('The following macros are supported:', 'all_in_one_seo_pack');
2037
- echo('<ul>');
2038
- echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
2039
- echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
2040
- echo('<li>'); _e('%description% - The original description as determined by the plugin, e.g. the excerpt if one is set or an auto-generated one if that option is set', 'all_in_one_seo_pack'); echo('</li>');
2041
- echo('<li>'); _e('%wp_title% - The original wordpress title, e.g. post_title for posts', 'all_in_one_seo_pack'); echo('</li>');
2042
- echo('</ul>');
2043
- ?>
2044
- </div>
2045
- </td>
2046
- </tr>
2047
-
2048
- <tr>
2049
- <th scope="row" style="text-align:right; vertical-align:top;">
2050
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_404_title_format_tip');">
2051
- <?php _e('404 Title Format:', 'all_in_one_seo_pack')?>
2052
- </a>
2053
- </td>
2054
- <td>
2055
- <input size="59" name="aiosp_404_title_format" value="<?php echo stripcslashes($aioseop_options['aiosp_404_title_format']); ?>"/>
2056
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_404_title_format_tip">
2057
- <?php
2058
- _e('The following macros are supported:', 'all_in_one_seo_pack');
2059
- echo('<ul>');
2060
- echo('<li>'); _e('%blog_title% - Your blog title', 'all_in_one_seo_pack'); echo('</li>');
2061
- echo('<li>'); _e('%blog_description% - Your blog description', 'all_in_one_seo_pack'); echo('</li>');
2062
- echo('<li>'); _e('%request_url% - The original URL path, like "/url-that-does-not-exist/"', 'all_in_one_seo_pack'); echo('</li>');
2063
- echo('<li>'); _e('%request_words% - The URL path in human readable form, like "Url That Does Not Exist"', 'all_in_one_seo_pack'); echo('</li>');
2064
- echo('<li>'); _e('%404_title% - Additional 404 title input"', 'all_in_one_seo_pack'); echo('</li>');
2065
- echo('</ul>');
2066
- ?>
2067
- </div>
2068
- </td>
2069
- </tr>
2070
-
2071
- <tr>
2072
- <th scope="row" style="text-align:right; vertical-align:top;">
2073
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_paged_format_tip');">
2074
- <?php _e('Paged Format:', 'all_in_one_seo_pack')?>
2075
- </a>
2076
- </td>
2077
- <td>
2078
- <input size="59" name="aiosp_paged_format" value="<?php echo stripcslashes($aioseop_options['aiosp_paged_format']); ?>"/>
2079
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_paged_format_tip">
2080
- <?php
2081
- _e('This string gets appended/prepended to titles when they are for paged index pages (like home or archive pages).', 'all_in_one_seo_pack');
2082
- _e('The following macros are supported:', 'all_in_one_seo_pack');
2083
- echo('<ul>');
2084
- echo('<li>'); _e('%page% - The page number', 'all_in_one_seo_pack'); echo('</li>');
2085
- echo('</ul>');
2086
- ?>
2087
- </div>
2088
- </td>
2089
- </tr>
2090
-
2091
- <tr>
2092
- <th scope="row" style="text-align:right; vertical-align:top;">
2093
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_enablecpost_tip');">
2094
- <?php _e('SEO for Custom Post Types:', 'all_in_one_seo_pack')?>
2095
- </td>
2096
- <td>
2097
- <input type="checkbox" name="aiosp_enablecpost" <?php if ($aioseop_options['aiosp_enablecpost']) echo "checked=\"1\""; ?>/>
2098
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_enablecpost_tip">
2099
- <?php
2100
- _e('Check this if you want your enable AIOSEOP support for Custom Post Types on this site.', 'all_in_one_seo_pack');
2101
- ?>
2102
- </div>
2103
- </td>
2104
- </tr>
2105
- <tr>
2106
- <th scope="row" style="text-align:right; vertical-align:top;">
2107
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('123_tip');">
2108
- <?php _e('Custom Post Types for SEO Column Support:', 'all_in_one_seo_pack')?>
2109
- </td>
2110
- <td><select name="aiosp_posttypecolumns[]" MULTIPLE style="height:70px;width:300px;">
2111
- <?php
2112
- $typeswehave = array('post,revision'); //$aioseop_options['aiosp_posttypecolumns'];
2113
- $post_types=get_post_types('','names');
2114
- $rempost = array('attachment','revision','nav_menu_item');
2115
- $post_types = array_diff($post_types,$rempost);
2116
- foreach ($post_types as $post_type ) {
2117
- echo "<option ";
2118
- if(is_array($aioseop_options['aiosp_posttypecolumns']) && in_array($post_type,$aioseop_options['aiosp_posttypecolumns'])) echo "selected ";
2119
- echo "name=\"aiosp_posttypecolumns\">$post_type";
2120
- }
2121
-
2122
- ?>
2123
- </select>
2124
-
2125
- <div style="max-width:500px; text-align:left; display:none" id="123_tip">
2126
- <?php
2127
- _e('Choose which post types you want to have SEO columns on the edit.php screen. You can select as many as you like.', 'all_in_one_seo_pack');
2128
- ?>
2129
- </div>
2130
- </td>
2131
- </tr>
2132
- <tr>
2133
- <th scope="row" style="text-align:right; vertical-align:top;">
2134
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_google_publisher_tip');">
2135
- <?php _e('Google Plus Profile Sitewide Default:', 'all_in_one_seo_pack')?>
2136
- </td>
2137
- <td>
2138
- <input type="text" name="aiosp_google_publisher" value="<?php if ( !empty( $aioseop_options['aiosp_google_publisher'] ) ) echo $aioseop_options['aiosp_google_publisher']; ?>" size="38"/>
2139
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_google_publisher_tip">
2140
- <?php
2141
- _e('Enter your Google Plus Profile URL here to link your site\'s pages to Google Plus.', 'all_in_one_seo_pack');
2142
- ?>
2143
- </div>
2144
- </td>
2145
- </tr>
2146
- <tr>
2147
- <th scope="row" style="text-align:right; vertical-align:top;">
2148
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_google_analytics_id_tip');">
2149
- <?php _e('Google Analytics ID:', 'all_in_one_seo_pack')?>
2150
- </td>
2151
- <td>
2152
- <input type="text" name="aiosp_google_analytics_id" value="<?php echo $aioseop_options['aiosp_google_analytics_id']; ?>" size="38"/>
2153
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_google_analytics_id_tip">
2154
- <?php
2155
- _e('Enter your Google Analytics ID here to track your site with Google Analytics.', 'all_in_one_seo_pack');
2156
- ?>
2157
- </div>
2158
- </td>
2159
- </tr>
2160
- <?php
2161
- if ( isset( $aioseop_options['aiosp_google_analytics_id'] ) && $aioseop_options['aiosp_google_analytics_id'] ) {
2162
- ?>
2163
- <tr>
2164
- <th scope="row" style="text-align:right; vertical-align:top;">
2165
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_ga_domain_tip');">
2166
- <?php _e('Tracking Domain:', 'all_in_one_seo_pack')?>
2167
- </td>
2168
- <td>
2169
- <input type="text" name="aiosp_ga_domain" value="<?php echo $aioseop_options['aiosp_ga_domain']; ?>" size="38"/>
2170
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_ga_domain_tip">
2171
- <?php
2172
- _e('Enter domain name for tracking with Google Analytics.', 'all_in_one_seo_pack');
2173
- ?>
2174
- </div>
2175
- </td>
2176
- </tr>
2177
-
2178
- <tr>
2179
- <th scope="row" style="text-align:right; vertical-align:top;">
2180
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_ga_multi_domain_tip');">
2181
- <?php _e('Track Multiple Domains:', 'all_in_one_seo_pack')?>
2182
- </td>
2183
- <td>
2184
- <input type="checkbox" name="aiosp_ga_multi_domain" <?php if ($aioseop_options['aiosp_ga_multi_domain']) echo "checked=\"1\""; ?>"/>
2185
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_ga_multi_domain_tip">
2186
- <?php
2187
- _e('Enable multi-domain tracking for Google Analytics.', 'all_in_one_seo_pack');
2188
- ?>
2189
- </div>
2190
- </td>
2191
- </tr>
2192
-
2193
- <tr>
2194
- <th scope="row" style="text-align:right; vertical-align:top;">
2195
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_ga_track_outbound_links_tip');">
2196
- <?php _e('Track Outbound Links:', 'all_in_one_seo_pack')?>
2197
- </td>
2198
- <td>
2199
- <input type="checkbox" name="aiosp_ga_track_outbound_links" <?php if ($aioseop_options['aiosp_ga_track_outbound_links']) echo "checked=\"1\""; ?>/>
2200
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_ga_track_outbound_links_tip">
2201
- <?php
2202
- _e('Add functionality to track outbound links with Google Analytics.', 'all_in_one_seo_pack');
2203
- ?>
2204
- </div>
2205
- </td>
2206
- </tr>
2207
-
2208
- <?php
2209
- }
2210
- ?>
2211
-
2212
- <tr>
2213
- <th scope="row" style="text-align:right; vertical-align:top;">
2214
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_use_categories_tip');">
2215
- <?php _e('Use Categories for META keywords:', 'all_in_one_seo_pack')?>
2216
- </td>
2217
- <td>
2218
- <input type="checkbox" name="aiosp_use_categories" <?php if ($aioseop_options['aiosp_use_categories']) echo "checked=\"1\""; ?>/>
2219
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_use_categories_tip">
2220
- <?php
2221
- _e('Check this if you want your categories for a given post used as the META keywords for this post (in addition to any keywords and tags you specify on the post edit page).', 'all_in_one_seo_pack');
2222
- ?>
2223
- </div>
2224
- </td>
2225
- </tr>
2226
-
2227
- <tr>
2228
- <th scope="row" style="text-align:right; vertical-align:top;">
2229
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_use_tags_as_keywords_tip');">
2230
- <?php _e('Use Tags for META keywords:', 'all_in_one_seo_pack')?>
2231
- </td>
2232
- <td>
2233
- <input type="checkbox" name="aiosp_use_tags_as_keywords" <?php if ($aioseop_options['aiosp_use_tags_as_keywords']) echo "checked=\"1\""; ?>/>
2234
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_use_tags_as_keywords_tip">
2235
- <?php
2236
- _e('Check this if you want your tags for a given post used as the META keywords for this post (in addition to any keywords you specify on the post edit page).', 'all_in_one_seo_pack');
2237
- ?>
2238
- </div>
2239
- </td>
2240
- </tr>
2241
-
2242
-
2243
-
2244
-
2245
- <tr>
2246
- <th scope="row" style="text-align:right; vertical-align:top;">
2247
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_dynamic_postspage_keywords_tip');">
2248
- <?php _e('Dynamically Generate Keywords for Posts Page:', 'all_in_one_seo_pack')?>
2249
- </td>
2250
- <td>
2251
- <input type="checkbox" name="aiosp_dynamic_postspage_keywords" <?php if ($aioseop_options['aiosp_dynamic_postspage_keywords']) echo "checked=\"1\""; ?>/>
2252
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_dynamic_postspage_keywords_tip">
2253
- <?php
2254
- _e('Check this if you want your keywords on a custom posts page (set it in options->reading) to be dynamically generated from the keywords of the posts showing on that page. If unchecked, it will use the keywords set in the edit page screen for the posts page.', 'all_in_one_seo_pack');
2255
- ?>
2256
- </div>
2257
- </td>
2258
- </tr>
2259
-
2260
- <tr>
2261
- <th scope="row" style="text-align:right; vertical-align:top;">
2262
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_category_noindex_tip');">
2263
- <?php _e('Use noindex for Categories:', 'all_in_one_seo_pack')?>
2264
- </a>
2265
- </td>
2266
- <td>
2267
- <input type="checkbox" name="aiosp_category_noindex" <?php if ($aioseop_options['aiosp_category_noindex']) echo "checked=\"1\""; ?>/>
2268
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_category_noindex_tip">
2269
- <?php
2270
- _e('Check this for excluding category pages from being crawled. Useful for avoiding duplicate content.', 'all_in_one_seo_pack');
2271
- ?>
2272
- </div>
2273
- </td>
2274
- </tr>
2275
-
2276
- <tr>
2277
- <th scope="row" style="text-align:right; vertical-align:top;">
2278
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_archive_noindex_tip');">
2279
- <?php _e('Use noindex for Archives:', 'all_in_one_seo_pack')?>
2280
- </a>
2281
- </td>
2282
- <td>
2283
- <input type="checkbox" name="aiosp_archive_noindex" <?php if ($aioseop_options['aiosp_archive_noindex']) echo "checked=\"1\""; ?>/>
2284
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_archive_noindex_tip">
2285
- <?php
2286
- _e('Check this for excluding archive pages from being crawled. Useful for avoiding duplicate content.', 'all_in_one_seo_pack');
2287
- ?>
2288
- </div>
2289
- </td>
2290
- </tr>
2291
-
2292
- <tr>
2293
- <th scope="row" style="text-align:right; vertical-align:top;">
2294
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_tags_noindex_tip');">
2295
- <?php _e('Use noindex for Tag Archives:', 'all_in_one_seo_pack')?>
2296
- </a>
2297
- </td>
2298
- <td>
2299
- <input type="checkbox" name="aiosp_tags_noindex" <?php if ($aioseop_options['aiosp_tags_noindex']) echo "checked=\"1\""; ?>/>
2300
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_tags_noindex_tip">
2301
- <?php
2302
- _e('Check this for excluding tag pages from being crawled. Useful for avoiding duplicate content.', 'all_in_one_seo_pack');
2303
- ?>
2304
- </div>
2305
- </td>
2306
- </tr>
2307
-
2308
- <tr>
2309
- <th scope="row" style="text-align:right; vertical-align:top;">
2310
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_generate_descriptions_tip');">
2311
- <?php _e('Autogenerate Descriptions:', 'all_in_one_seo_pack')?>
2312
- </a>
2313
- </td>
2314
- <td>
2315
- <input type="checkbox" name="aiosp_generate_descriptions" <?php if ($aioseop_options['aiosp_generate_descriptions']) echo "checked=\"1\""; ?>/>
2316
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_generate_descriptions_tip">
2317
- <?php
2318
- _e("Check this and your META descriptions will get autogenerated if there's no excerpt.", 'all_in_one_seo_pack');
2319
- ?>
2320
- </div>
2321
- </td>
2322
- </tr>
2323
-
2324
- <tr>
2325
- <th scope="row" style="text-align:right; vertical-align:top;">
2326
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_cap_cats_tip');">
2327
- <?php _e('Capitalize Category Titles:', 'all_in_one_seo_pack')?>
2328
- </a>
2329
- </td>
2330
- <td>
2331
- <input type="checkbox" name="aiosp_cap_cats" <?php if ($aioseop_options['aiosp_cap_cats']) echo "checked=\"1\""; ?>/>
2332
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_cap_cats_tip">
2333
- <?php
2334
- _e("Check this and Category Titles will have the first letter of each word capitalized.", 'all_in_one_seo_pack');
2335
- ?>
2336
- </div>
2337
- </td>
2338
- </tr>
2339
-
2340
- <!-- new crap start -->
2341
- <tr>
2342
- <th scope="row" style="text-align:right; vertical-align:top;">
2343
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_ex_pages_tip');">
2344
- <?php _e('Exclude Pages:', 'all_in_one_seo_pack')?>
2345
- </a>
2346
- </td>
2347
- <td>
2348
- <textarea cols="57" rows="2" name="aiosp_ex_pages"><?php
2349
- if ( !isset( $aioseop_options['aiosp_ex_pages'] ) ) $aioseop_options['aiosp_ex_pages'] = '';
2350
- echo stripcslashes($aioseop_options['aiosp_ex_pages']); ?></textarea>
2351
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_ex_pages_tip">
2352
- <?php
2353
- _e("Enter any comma separated pages here to be excluded by All in One SEO Pack. This is helpful when using plugins which generate their own non-WordPress dynamic pages. Ex: <em>/forum/,/contact/</em> For instance, if you want to exclude the virtual pages generated by a forum plugin, all you have to do is give forum or /forum or /forum/ or and any URL with the word \"forum\" in it, such as http://mysite.com/forum or http://mysite.com/forum/someforumpage will be excluded from All in One SEO Pack.", 'all_in_one_seo_pack');
2354
- ?>
2355
- </div>
2356
- </td>
2357
- </tr>
2358
- <!-- new crap end -->
2359
-
2360
- <tr>
2361
- <th scope="row" style="text-align:right; vertical-align:top;">
2362
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_post_meta_tags_tip');">
2363
- <?php _e('Additional Post Headers:', 'all_in_one_seo_pack')?>
2364
- </a>
2365
- </td>
2366
- <td>
2367
- <textarea cols="57" rows="2" name="aiosp_post_meta_tags"><?php echo stripcslashes($aioseop_options['aiosp_post_meta_tags']); ?></textarea>
2368
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_post_meta_tags_tip">
2369
- <?php
2370
- _e('What you enter here will be copied verbatim to your header on post pages. You can enter whatever additional headers you want here, even references to stylesheets.', 'all_in_one_seo_pack');
2371
- ?>
2372
- </div>
2373
- </td>
2374
- </tr>
2375
-
2376
- <tr>
2377
- <th scope="row" style="text-align:right; vertical-align:top;">
2378
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_page_meta_tags_tip');">
2379
- <?php _e('Additional Page Headers:', 'all_in_one_seo_pack')?>
2380
- </a>
2381
- </td>
2382
- <td>
2383
- <textarea cols="57" rows="2" name="aiosp_page_meta_tags"><?php echo stripcslashes($aioseop_options['aiosp_page_meta_tags']); ?></textarea>
2384
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_page_meta_tags_tip">
2385
- <?php
2386
- _e('What you enter here will be copied verbatim to your header on pages. You can enter whatever additional headers you want here, even references to stylesheets.', 'all_in_one_seo_pack');
2387
- ?>
2388
- </div>
2389
- </td>
2390
- </tr>
2391
-
2392
- <tr>
2393
- <th scope="row" style="text-align:right; vertical-align:top;">
2394
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_home_meta_tags_tip');">
2395
- <?php _e('Additional Home Headers:', 'all_in_one_seo_pack')?>
2396
- </a>
2397
- </td>
2398
- <td>
2399
- <textarea cols="57" rows="2" name="aiosp_home_meta_tags"><?php echo stripcslashes($aioseop_options['aiosp_home_meta_tags']); ?></textarea>
2400
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_home_meta_tags_tip">
2401
- <?php
2402
- _e('What you enter here will be copied verbatim to your header on the home page. You can enter whatever additional headers you want here, even references to stylesheets.', 'all_in_one_seo_pack');
2403
- ?>
2404
- </div>
2405
- </td>
2406
- </tr>
2407
-
2408
- <tr>
2409
- <th scope="row" style="text-align:right; vertical-align:top;">
2410
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_front_meta_tags_tip');">
2411
- <?php _e('Additional Front Page Headers:', 'all_in_one_seo_pack')?>
2412
- </a>
2413
- </td>
2414
- <td>
2415
- <textarea cols="57" rows="2" name="aiosp_front_meta_tags"><?php if ( isset( $aioseop_options['aiosp_front_meta_tags'] ) ) echo stripcslashes($aioseop_options['aiosp_front_meta_tags']); ?></textarea>
2416
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_front_meta_tags_tip">
2417
- <?php
2418
- _e('What you enter here will be copied verbatim to your header on the front page. You can enter whatever additional headers you want here, even references to stylesheets.', 'all_in_one_seo_pack');
2419
- ?>
2420
- </div>
2421
- </td>
2422
- </tr>
2423
-
2424
- <tr>
2425
- <th scope="row" style="text-align:right; vertical-align:top;">
2426
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'auto_social')?>" onclick="toggleVisibility('aiosp_do_log_tip');">
2427
- <?php _e('Log important events:', 'all_in_one_seo_pack')?>
2428
- </a>
2429
- </td>
2430
- <td>
2431
- <input type="checkbox" name="aiosp_do_log" <?php if ($aioseop_options['aiosp_do_log']) echo "checked=\"1\""; ?>/>
2432
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_do_log_tip">
2433
- <?php
2434
- _e('Check this and SEO pack will create a log of important events (all_in_one_seo_pack.log) in its plugin directory which might help debugging it. Make sure this directory is writable.', 'all_in_one_seo_pack');
2435
- ?>
2436
- </div>
2437
- </td>
2438
- </tr>
2439
-
2440
- <?php if ($aioseop_options['aiosp_donate']){?>
2441
- <tr>
2442
- <th scope="row" style="text-align:right; vertical-align:top;">
2443
- <a style="cursor:pointer;" title="<?php _e('Click for Help!', 'all_in_one_seo_pack')?>" onclick="toggleVisibility('aiosp_donate_tip');">
2444
- <?php _e('Thank you for your donation:', 'all_in_one_seo_pack')?>
2445
- </a>
2446
- </td>
2447
- <td>
2448
- <input type="checkbox" name="aiosp_donate" <?php if ($aioseop_options['aiosp_donate']) echo "checked=\"1\""; ?>/>
2449
- <div style="max-width:500px; text-align:left; display:none" id="aiosp_donate_tip">
2450
- <?php _e('All donations support continued development of this free software.', 'all_in_one_seo_pack'); ?>
2451
- </div>
2452
- </td>
2453
- </tr>
2454
- <?php } ?>
2455
-
2456
- </table>
2457
- <p class="submit">
2458
- <?php if($aioseop_options) { ?>
2459
-
2460
- <input type="hidden" name="action" value="aiosp_update" />
2461
- <input type="hidden" name="nonce-aioseop" value="<?php echo wp_create_nonce('aioseop-nonce'); ?>" />
2462
- <input type="hidden" name="page_options" value="aiosp_home_description" />
2463
- <input type="submit" class='button-primary' name="Submit" value="<?php _e('Update Options', 'all_in_one_seo_pack')?> &raquo;" />
2464
- <input type="submit" class='button-primary' name="Submit_Default" value="<?php _e('Reset Settings to Defaults', 'all_in_one_seo_pack')?> &raquo;" />
2465
- </p>
2466
- <?php } ?>
2467
-
2468
- <p><br />
2469
- <strong><?php _e('Check out these other great plugins!','all_in_one_seo_pack'); ?></strong><br />
2470
- <a href="http://semperfiwebdesign.com/custom-applications/sms-text-message/" title="SMS Text Message WordPress plugin">SMS Text Message</a> - <?php _e('sends SMS updates to your readers','all_in_one_seo_pack'); ?><br />
2471
- <a href="http://semperfiwebdesign.com/custom-applications/wp-security-scan/" title="WordPress Security">WordPress Security Scan</a> - <?php _e('provides vital security for your WordPress site','all_in_one_seo_pack'); ?>
2472
- </p>
2473
- </form>
2474
- </div>
2475
- <?php
2476
-
2477
- } // options_panel
2478
-
2479
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
aioseop_class.php ADDED
@@ -0,0 +1,1819 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package All-in-One-SEO-Pack
4
+ */
5
+ /**
6
+ * Include the module base class.
7
+ */
8
+ require_once( 'aioseop_module_class.php' );
9
+ /**
10
+ * The main class.
11
+ */
12
+ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
13
+
14
+ /** The current version of the plugin. **/
15
+ var $version = AIOSEOP_VERSION;
16
+
17
+ /** Max numbers of chars in auto-generated description */
18
+ var $maximum_description_length = 160;
19
+
20
+ /** Minimum number of chars an excerpt should be so that it can be used
21
+ * as description. Touch only if you know what you're doing
22
+ */
23
+ var $minimum_description_length = 1;
24
+
25
+ /** Whether output buffering is already being used during forced title rewrites. **/
26
+ var $ob_start_detected = false;
27
+
28
+ /** The start of the title text in the head section for forced title rewrites. **/
29
+ var $title_start = -1;
30
+
31
+ /** The end of the title text in the head section for forced title rewrites. **/
32
+ var $title_end = -1;
33
+
34
+ /** The title before rewriting */
35
+ var $orig_title = '';
36
+
37
+ /** Filename of log file. */
38
+ var $log_file;
39
+
40
+ /** Flag whether there should be logging. */
41
+ var $do_log;
42
+
43
+ function All_in_One_SEO_Pack() {
44
+ global $aioseop_options;
45
+ $this->log_file = dirname( __FILE__ ) . '/all_in_one_seo_pack.log';
46
+ if ( $aioseop_options['aiosp_do_log'] )
47
+ $this->do_log = true;
48
+ else
49
+ $this->do_log = false;
50
+
51
+ $this->init();
52
+ global $aioseop_plugin_name;
53
+ $aioseop_plugin_name = __( 'All in One SEO Pack', 'all_in_one_seo_pack' );
54
+ if ( ! defined( 'AIOSEOP_PLUGIN_NAME' ) )
55
+ define( 'AIOSEOP_PLUGIN_NAME', $aioseop_plugin_name );
56
+ $this->name = sprintf( __( '%s Plugin Options', 'all_in_one_seo_pack' ), AIOSEOP_PLUGIN_NAME );
57
+ $this->menu_name = __( 'General Settings', 'all_in_one_seo_pack' );
58
+
59
+ $this->prefix = 'aiosp_'; // option prefix
60
+ $this->option_name = 'aioseop_options';
61
+ $this->store_option = true;
62
+ $this->file = __FILE__; // the current file
63
+ parent::__construct();
64
+ $this->default_options = array(
65
+ "donate"=> Array(
66
+ 'name' => __( 'I enjoy this plugin and have made a donation:', 'all_in_one_seo_pack' ),
67
+ 'help_text' => __( 'All donations support continued development of this free software.', 'all_in_one_seo_pack' ),
68
+ 'default' => 0),
69
+ "home_title"=> Array(
70
+ 'name' => __( 'Home Title:', 'all_in_one_seo_pack' ),
71
+ 'help_text' => __( 'As the name implies, this will be the title of your homepage. This is independent of any other option. If not set, the default blog title will get used.', 'all_in_one_seo_pack' ),
72
+ 'default' => null, 'type' => 'textarea', 'sanitize' => 'text' ),
73
+ "home_description"=> Array(
74
+ 'name' => __( 'Home Description:', 'all_in_one_seo_pack' ),
75
+ 'help_text' => __( 'The META description for your homepage. Independent of any other options, the default is no META description at all if this is not set.', 'all_in_one_seo_pack' ),
76
+ 'default' => '', 'type' => 'textarea', 'sanitize' => 'text' ),
77
+ "togglekeywords" => Array(
78
+ 'name' => __( 'Use Keywords:', 'all_in_one_seo_pack' ),
79
+ 'help_text' => __( 'This option allows you to toggle the use of meta keywords throughout the whole of the site.', 'all_in_one_seo_pack' ),
80
+ 'default' => 0,
81
+ 'type' => 'radio',
82
+ 'initial_options' => Array( 0 => __( 'Enabled', 'all_in_one_seo_pack' ),
83
+ 1 => __( 'Disabled', 'all_in_one_seo_pack' ) )
84
+ ),
85
+ "home_keywords"=> Array(
86
+ 'name' => __( 'Home Keywords (comma separated):', 'all_in_one_seo_pack' ),
87
+ 'help_text' => __( 'A comma separated list of your most important keywords for your site that will be written as META keywords on your homepage. Don\'t stuff everything in here.', 'all_in_one_seo_pack' ),
88
+ 'default' => null, 'type' => 'textarea', 'sanitize' => 'text',
89
+ 'condshow' => Array( "aiosp_togglekeywords" => 0 ) ),
90
+ "can"=> Array(
91
+ 'name' => __( 'Canonical URLs:', 'all_in_one_seo_pack' ),
92
+ 'help_text' => __( "This option will automatically generate Canonical URLS for your entire WordPress installation. This will help to prevent duplicate content penalties by <a href='http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html' target='_blank'>Google</a>.", 'all_in_one_seo_pack' ),
93
+ 'default' => 1),
94
+ "rewrite_titles"=> Array(
95
+ 'name' => __( 'Rewrite Titles:', 'all_in_one_seo_pack' ),
96
+ 'help_text' => __( "Note that this is all about the title tag. This is what you see in your browser's window title bar. This is NOT visible on a page, only in the window title bar and of course in the source. If set, all page, post, category, search and archive page titles get rewritten. You can specify the format for most of them. For example: The default templates puts the title tag of posts like this: “Blog Archive >> Blog Name >> Post Title” (maybe I've overdone slightly). This is far from optimal. With the default post title format, Rewrite Title rewrites this to “Post Title | Blog Name”. If you have manually defined a title (in one of the text fields for All in One SEO Plugin input) this will become the title of your post in the format string.", 'all_in_one_seo_pack' ),
97
+ 'default' => 1,
98
+ 'type' => 'radio',
99
+ 'initial_options' => Array( 1 => __( 'Enabled', 'all_in_one_seo_pack' ),
100
+ 0 => __( 'Disabled', 'all_in_one_seo_pack' ) )
101
+ ),
102
+ "force_rewrites"=> Array(
103
+ 'name' => __( 'Force Rewrites:', 'all_in_one_seo_pack' ),
104
+ 'help_text' => __( "Use output buffering to ensure that the title gets rewritten.", 'all_in_one_seo_pack' ),
105
+ 'default' => 1,
106
+ 'type' => 'hidden',
107
+ 'prefix' => $this->prefix,
108
+ 'initial_options' => Array( 1 => __( 'Enabled', 'all_in_one_seo_pack' ),
109
+ 0 => __( 'Disabled', 'all_in_one_seo_pack' ) )
110
+ ),
111
+ "use_original_title"=> Array(
112
+ 'name' => __( 'Use Original Title:', 'all_in_one_seo_pack' ),
113
+ 'help_text' => __( "Use wp_title to set the title; disable this option if you run into conflicts with the title being set by your theme or another plugin.", 'all_in_one_seo_pack' ),
114
+ 'type' => 'radio',
115
+ 'default' => 0,
116
+ 'initial_options' => Array( 1 => __( 'Enabled', 'all_in_one_seo_pack' ),
117
+ 0 => __( 'Disabled', 'all_in_one_seo_pack' ) )
118
+ ),
119
+ "cap_titles"=> Array(
120
+ 'name' => __( 'Capitalize Titles:', 'all_in_one_seo_pack' ),
121
+ 'help_text' => __( "Check this and Search Page Titles and Tag Page Titles will have the first letter of each word capitalized.", 'all_in_one_seo_pack' ),
122
+ 'default' => 1),
123
+ "cap_cats"=> Array(
124
+ 'name' => __( 'Capitalize Category Titles:', 'all_in_one_seo_pack' ),
125
+ 'help_text' => __( "Check this and Category Titles will have the first letter of each word capitalized.", 'all_in_one_seo_pack' ),
126
+ 'default' => 1),
127
+ "page_title_format"=> Array(
128
+ 'name' => __( 'Page Title Format:', 'all_in_one_seo_pack' ),
129
+ 'help_text' =>
130
+ __( 'The following macros are supported:', 'all_in_one_seo_pack' )
131
+ . '<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
132
+ __( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
133
+ __( '%page_title% - The original title of the page', 'all_in_one_seo_pack' ) . '</li><li>' .
134
+ __( '%category_title% - The (main) category of the page', 'all_in_one_seo_pack' ) . '</li><li>' .
135
+ __( '%category% - Alias for %category_title%', 'all_in_one_seo_pack' ) . '</li><li>' .
136
+ __( "%page_author_login% - This page's author' login", 'all_in_one_seo_pack' ) . '</li><li>' .
137
+ __( "%page_author_nicename% - This page's author' nicename", 'all_in_one_seo_pack' ) . '</li><li>' .
138
+ __( "%page_author_firstname% - This page's author' first name (capitalized)", 'all_in_one_seo_pack' ) . '</li><li>' .
139
+ __( "%page_author_lastname% - This page's author' last name (capitalized)", 'all_in_one_seo_pack' ) . '</li>' .
140
+ '</ul>',
141
+ 'type' => 'text',
142
+ 'default' => '%page_title% | %blog_title%',
143
+ 'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
144
+ "post_title_format"=> Array(
145
+ 'name' => __( 'Post Title Format:', 'all_in_one_seo_pack' ),
146
+ 'help_text' =>
147
+ __( 'The following macros are supported:', 'all_in_one_seo_pack' )
148
+ . '<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
149
+ __( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
150
+ __( '%post_title% - The original title of the post', 'all_in_one_seo_pack' ) . '</li><li>' .
151
+ __( '%category_title% - The (main) category of the post', 'all_in_one_seo_pack' ) . '</li><li>' .
152
+ __( '%category% - Alias for %category_title%', 'all_in_one_seo_pack' ) . '</li><li>' .
153
+ __( "%post_author_login% - This post's author' login", 'all_in_one_seo_pack' ) . '</li><li>' .
154
+ __( "%post_author_nicename% - This post's author' nicename", 'all_in_one_seo_pack' ) . '</li><li>' .
155
+ __( "%post_author_firstname% - This post's author' first name (capitalized)", 'all_in_one_seo_pack' ) . '</li><li>' .
156
+ __( "%post_author_lastname% - This post's author' last name (capitalized)", 'all_in_one_seo_pack' ) . '</li>' .
157
+ '</ul>',
158
+ 'type' => 'text',
159
+ 'default' => '%post_title% | %blog_title%',
160
+ 'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
161
+ "category_title_format"=> Array(
162
+ 'name' => __( 'Category Title Format:', 'all_in_one_seo_pack' ),
163
+ 'help_text' =>
164
+ __( 'The following macros are supported:', 'all_in_one_seo_pack' ) .
165
+ '<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
166
+ __( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
167
+ __( '%category_title% - The original title of the category', 'all_in_one_seo_pack' ) . '</li><li>' .
168
+ __( '%category_description% - The description of the category', 'all_in_one_seo_pack' ) . '</li></ul>',
169
+ 'type' => 'text',
170
+ 'default' => '%category_title% | %blog_title%',
171
+ 'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
172
+ "archive_title_format"=> Array(
173
+ 'name' => __( 'Archive Title Format:', 'all_in_one_seo_pack' ),
174
+ 'help_text' =>
175
+ __( 'The following macros are supported:', 'all_in_one_seo_pack' ) .
176
+ '<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
177
+ __( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
178
+ __( '%date% - The original archive title given by wordpress, e.g. "2007" or "2007 August"', 'all_in_one_seo_pack' ) . '</li></ul>',
179
+ 'type' => 'text',
180
+ 'default' => '%date% | %blog_title%',
181
+ 'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
182
+ "tag_title_format"=> Array(
183
+ 'name' => __( 'Tag Title Format:', 'all_in_one_seo_pack' ),
184
+ 'help_text' =>
185
+ __( 'The following macros are supported:', 'all_in_one_seo_pack' ) .
186
+ '<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
187
+ __( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
188
+ __( '%tag% - The name of the tag', 'all_in_one_seo_pack' ) . '</li></ul>',
189
+ 'type' => 'text',
190
+ 'default' => '%tag% | %blog_title%',
191
+ 'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
192
+ "search_title_format"=> Array(
193
+ 'name' => __( 'Search Title Format:', 'all_in_one_seo_pack' ),
194
+ 'help_text' =>
195
+ __( 'The following macros are supported:', 'all_in_one_seo_pack' ) .
196
+ '<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
197
+ __( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
198
+ __( '%search% - What was searched for', 'all_in_one_seo_pack' ) . '</li></ul>',
199
+ 'type' => 'text',
200
+ 'default' => '%search% | %blog_title%',
201
+ 'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
202
+ "description_format"=> Array(
203
+ 'name' => __( 'Description Format', 'all_in_one_seo_pack' ),
204
+ 'help_text' => __( 'The following macros are supported:', 'all_in_one_seo_pack' ) .
205
+ '<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
206
+ __( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
207
+ __( '%description% - The original description as determined by the plugin, e.g. the excerpt if one is set or an auto-generated one if that option is set', 'all_in_one_seo_pack' ) . '</li><li>' .
208
+ __( '%wp_title% - The original wordpress title, e.g. post_title for posts', 'all_in_one_seo_pack' ) . '</li></ul>',
209
+ 'type' => 'text',
210
+ 'default' => '%description%',
211
+ 'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
212
+ "404_title_format"=> Array(
213
+ 'name' => __( '404 Title Format:', 'all_in_one_seo_pack' ),
214
+ 'help_text' => __( 'The following macros are supported:', 'all_in_one_seo_pack' ) .
215
+ '<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
216
+ __( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
217
+ __( '%request_url% - The original URL path, like "/url-that-does-not-exist/"', 'all_in_one_seo_pack' ) . '</li><li>' .
218
+ __( '%request_words% - The URL path in human readable form, like "Url That Does Not Exist"', 'all_in_one_seo_pack' ) . '</li><li>' .
219
+ __( '%404_title% - Additional 404 title input"', 'all_in_one_seo_pack' ) . '</li></ul>',
220
+ 'type' => 'text',
221
+ 'default' => 'Nothing found for %request_words%',
222
+ 'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
223
+ "paged_format"=> Array(
224
+ 'name' => __( 'Paged Format:', 'all_in_one_seo_pack' ),
225
+ 'help_text' => __( 'This string gets appended/prepended to titles when they are for paged index pages (like home or archive pages).', 'all_in_one_seo_pack' )
226
+ . __( 'The following macros are supported:', 'all_in_one_seo_pack' )
227
+ . '<ul><li>' . __( '%page% - The page number', 'all_in_one_seo_pack' ) . '</li></ul>',
228
+ 'type' => 'text',
229
+ 'default' => ' - Part %page%',
230
+ 'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
231
+ "enablecpost"=> Array(
232
+ 'name' => __( 'SEO for Custom Post Types:', 'all_in_one_seo_pack' ),
233
+ 'help_text' => __( 'Check this if you want your enable AIOSEOP support for Custom Post Types on this site.', 'all_in_one_seo_pack' ),
234
+ 'default' => 'on',
235
+ 'type' => 'radio',
236
+ 'initial_options' => Array( 'on' => __( 'Enabled', 'all_in_one_seo_pack' ),
237
+ 0 => __( 'Disabled', 'all_in_one_seo_pack' ) )
238
+ ),
239
+ "cpostadvanced" => Array(
240
+ 'name' => __( 'Enable Advanced Options:', 'all_in_one_seo_pack' ),
241
+ 'help_text' => __( 'This allows you to do more with your custom post types.', 'all_in_one_seo_pack' ),
242
+ 'default' => 0,
243
+ 'type' => 'radio',
244
+ 'initial_options' => Array( 'on' => __( 'Enabled', 'all_in_one_seo_pack' ),
245
+ 0 => __( 'Disabled', 'all_in_one_seo_pack' ) ),
246
+ 'label' => null,
247
+ 'condshow' => Array( "aiosp_enablecpost" => 'on' )
248
+ ),
249
+ "cpostactive" => Array(
250
+ 'name' => __( 'SEO on only these post types:', 'all_in_one_seo_pack' ),
251
+ 'help_text' => __( 'Select specific custom post types for AIOSEOP support.', 'all_in_one_seo_pack' ),
252
+ 'type' => 'multicheckbox',
253
+ 'default' => array('post', 'page'),
254
+ 'condshow' => Array( 'aiosp_enablecpost' => 'on', 'aiosp_cpostadvanced' => 'on' )
255
+ ),
256
+ "cposttitles" => Array(
257
+ 'name' => __( 'Custom titles:', 'all_in_one_seo_pack' ),
258
+ 'help_text' => __( 'Allows setting specific custom titles for all post types.', 'all_in_one_seo_pack' ),
259
+ 'type' => 'checkbox',
260
+ 'default' => 0,
261
+ 'condshow' => Array( 'aiosp_enablecpost' => 'on', 'aiosp_cpostadvanced' => 'on' )
262
+ ),
263
+ "posttypecolumns" => Array(
264
+ 'name' => __( 'Show Column Labels for Custom Post Types:', 'all_in_one_seo_pack' ),
265
+ 'help_text' => __( 'Choose which post types you want to have SEO columns on the edit.php screen. You can select as many as you like.', 'all_in_one_seo_pack' ),
266
+ 'type' => 'multicheckbox',
267
+ 'default' => array('post', 'page') ),
268
+ "admin_bar" => Array(
269
+ 'name' => __( 'Display Menu In Admin Bar:', 'all_in_one_seo_pack' ),
270
+ 'help_text' => __( 'Check this for easy access to settings from the admin menu bar.', 'all_in_one_seo_pack' ),
271
+ 'default' => 'on',
272
+ ),
273
+ "google_verify" => Array(
274
+ 'name' => __( 'Google Webmaster Tools:', 'all_in_one_seo_pack' ),
275
+ 'help_text' => __( 'Enter your verification code here to add a meta tag to your homepage to verify your site.', 'all_in_one_seo_pack' ),
276
+ 'default' => '', 'type' => 'text' ),
277
+ "bing_verify" => Array(
278
+ 'name' => __( 'Bing Webmaster Center:', 'all_in_one_seo_pack' ),
279
+ 'help_text' => __( 'Enter your verification code here to add a meta tag to your homepage to verify your site.', 'all_in_one_seo_pack' ),
280
+ 'default' => '', 'type' => 'text' ),
281
+ "pinterest_verify" => Array(
282
+ 'name' => __( 'Pinterest Site Verification:', 'all_in_one_seo_pack' ),
283
+ 'help_text' => __( 'Enter your verification code here to add a meta tag to your homepage to verify your site.', 'all_in_one_seo_pack' ),
284
+ 'default' => '', 'type' => 'text' ),
285
+ "google_publisher"=> Array(
286
+ 'name' => __( 'Google Plus Default Profile:', 'all_in_one_seo_pack' ),
287
+ 'help_text' => __( 'Enter your Google Plus Profile URL here to link your site\'s pages to Google Plus.', 'all_in_one_seo_pack' ),
288
+ 'default' => '', 'type' => 'text' ),
289
+ "google_analytics_id"=> Array(
290
+ 'name' => __( 'Google Analytics ID:', 'all_in_one_seo_pack' ),
291
+ 'help_text' => __( 'Enter your Google Analytics ID here to track your site with Google Analytics.', 'all_in_one_seo_pack' ),
292
+ 'default' => null, 'type' => 'text' ),
293
+ "ga_domain"=> Array(
294
+ 'name' => __( 'Tracking Domain:', 'all_in_one_seo_pack' ),
295
+ 'type' => 'text',
296
+ 'help_text' => __( 'Enter domain name for tracking with Google Analytics.', 'all_in_one_seo_pack' ),
297
+ 'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ) ) ),
298
+ "ga_multi_domain"=> Array(
299
+ 'name' => __( 'Track Multiple Domains:', 'all_in_one_seo_pack' ),
300
+ 'help_text' => __( 'Enable multi-domain tracking for Google Analytics.', 'all_in_one_seo_pack' ),
301
+ 'default' => 0,
302
+ 'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ) ) ),
303
+ "ga_track_outbound_links"=> Array(
304
+ 'name' => __( 'Track Outbound Links:', 'all_in_one_seo_pack' ),
305
+ 'help_text' => __( 'Add functionality to track outbound links with Google Analytics.', 'all_in_one_seo_pack' ),
306
+ 'default' => 0,
307
+ 'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ) ) ),
308
+ "use_categories"=> Array(
309
+ 'name' => __( 'Use Categories for META keywords:', 'all_in_one_seo_pack' ),
310
+ 'help_text' => __( 'Check this if you want your categories for a given post used as the META keywords for this post (in addition to any keywords and tags you specify on the post edit page).', 'all_in_one_seo_pack' ),
311
+ 'default' => 0,
312
+ 'condshow' => Array( "aiosp_togglekeywords" => 0 ) ),
313
+ "use_tags_as_keywords" => Array(
314
+ 'name' => __( 'Use Tags for META keywords:', 'all_in_one_seo_pack' ),
315
+ 'help_text' => __( 'Check this if you want your tags for a given post used as the META keywords for this post (in addition to any keywords you specify on the post edit page).', 'all_in_one_seo_pack' ),
316
+ 'default' => 1,
317
+ 'condshow' => Array( "aiosp_togglekeywords" => 0 ) ),
318
+ "dynamic_postspage_keywords"=> Array(
319
+ 'name' => __( 'Dynamically Generate Keywords for Posts Page:', 'all_in_one_seo_pack' ),
320
+ 'help_text' => __( 'Check this if you want your keywords on a custom posts page (set it in options->reading) to be dynamically generated from the keywords of the posts showing on that page. If unchecked, it will use the keywords set in the edit page screen for the posts page.', 'all_in_one_seo_pack' ),
321
+ 'default' => 1,
322
+ 'condshow' => Array( "aiosp_togglekeywords" => 0 ) ),
323
+ "category_noindex"=> Array(
324
+ 'name' => __( 'Use noindex for Categories:', 'all_in_one_seo_pack' ),
325
+ 'help_text' => __( 'Check this for excluding category pages from being crawled. Useful for avoiding duplicate content.', 'all_in_one_seo_pack' ),
326
+ 'default' => 1),
327
+ "archive_noindex"=> Array(
328
+ 'name' => __( 'Use noindex for Archives:', 'all_in_one_seo_pack' ),
329
+ 'help_text' => __( 'Check this for excluding archive pages from being crawled. Useful for avoiding duplicate content.', 'all_in_one_seo_pack' ),
330
+ 'default' => 1),
331
+ "tags_noindex"=> Array(
332
+ 'name' => __( 'Use noindex for Tag Archives:', 'all_in_one_seo_pack' ),
333
+ 'help_text' => __( 'Check this for excluding tag pages from being crawled. Useful for avoiding duplicate content.', 'all_in_one_seo_pack' ),
334
+ 'default' => 0),
335
+ "generate_descriptions"=> Array(
336
+ 'name' => __( 'Autogenerate Descriptions:', 'all_in_one_seo_pack' ),
337
+ 'help_text' => __( "Check this and your META descriptions will get autogenerated if there's no excerpt.", 'all_in_one_seo_pack' ),
338
+ 'default' => 1),
339
+ "unprotect_meta"=> Array(
340
+ 'name' => __( 'Unprotect Post Meta Fields:', 'all_in_one_seo_pack' ),
341
+ 'help_text' => __( "Unprotect internal postmeta fields for use with XMLRPC -- if you don't know what that is, leave it unchecked.", 'all_in_one_seo_pack' ),
342
+ 'default' => 0),
343
+ "ex_pages" => Array(
344
+ 'name' => __( 'Exclude Pages:', 'all_in_one_seo_pack' ),
345
+ 'help_text' => __( "Enter any comma separated pages here to be excluded by All in One SEO Pack. This is helpful when using plugins which generate their own non-WordPress dynamic pages. Ex: <em>/forum/,/contact/</em> For instance, if you want to exclude the virtual pages generated by a forum plugin, all you have to do is give forum or /forum or /forum/ or and any URL with the word \"forum\" in it, such as http://mysite.com/forum or http://mysite.com/forum/someforumpage will be excluded from All in One SEO Pack.", 'all_in_one_seo_pack' ),
346
+ 'type' => 'textarea', 'default' => '' ),
347
+ "post_meta_tags"=> Array(
348
+ 'name' => __( 'Additional Post Headers:', 'all_in_one_seo_pack' ),
349
+ 'help_text' => __( 'What you enter here will be copied verbatim to your header on posts.', 'all_in_one_seo_pack' ) . ' ' . __( 'You can enter whatever additional headers you want here, even references to stylesheets.', 'all_in_one_seo_pack' ),
350
+ 'type' => 'textarea', 'default' => '', 'sanitize' => 'default' ),
351
+ "page_meta_tags"=> Array(
352
+ 'name' => __( 'Additional Page Headers:', 'all_in_one_seo_pack' ),
353
+ 'help_text' => __( 'What you enter here will be copied verbatim to your header on pages.', 'all_in_one_seo_pack' ) . ' ' . __( 'You can enter whatever additional headers you want here, even references to stylesheets.', 'all_in_one_seo_pack' ),
354
+ 'type' => 'textarea', 'default' => '', 'sanitize' => 'default' ),
355
+ "front_meta_tags"=> Array(
356
+ 'name' => __( 'Additional Front Page Headers:', 'all_in_one_seo_pack' ),
357
+ 'help_text' => __( 'What you enter here will be copied verbatim to your header on the front page if you have a static page set in Settings, Reading.', 'all_in_one_seo_pack' ) . ' ' . __( 'You can enter whatever additional headers you want here, even references to stylesheets.', 'all_in_one_seo_pack' ) . ' ' . __( 'This will fall back to using Additional Page Headers if you have them set and nothing is entered here.', 'all_in_one_seo_pack' ),
358
+ 'type' => 'textarea', 'default' => '', 'sanitize' => 'default' ),
359
+ "home_meta_tags"=> Array(
360
+ 'name' => __( 'Additional Blog Page Headers:', 'all_in_one_seo_pack' ),
361
+ 'help_text' => __( 'What you enter here will be copied verbatim to your header on the home page if you have Front page displays your latest posts selected in Settings, Reading.  It will also be copied verbatim to your header on the Posts page if you have one set in Settings, Reading.', 'all_in_one_seo_pack' ) . ' ' . __( 'You can enter whatever additional headers you want here, even references to stylesheets.', 'all_in_one_seo_pack' ),
362
+ 'type' => 'textarea', 'default' => '', 'sanitize' => 'default' ),
363
+ "do_log"=> Array(
364
+ 'name' => __( 'Log important events:', 'all_in_one_seo_pack' ),
365
+ 'help_text' => __( 'Check this and SEO pack will create a log of important events (all_in_one_seo_pack.log) in its plugin directory which might help debugging it. Make sure this directory is writable.', 'all_in_one_seo_pack' ),
366
+ 'default' => null ),
367
+ );
368
+
369
+ $this->locations = Array(
370
+ 'default' => Array( 'name' => $this->name, 'prefix' => 'aiosp_', 'type' => 'settings', 'options' => null ),
371
+ 'aiosp' => Array( 'name' => $this->plugin_name, 'type' => 'metabox', 'prefix' => '',
372
+ 'options' => Array( 'edit', 'nonce-aioseop-edit', 'upgrade', 'snippet', 'title', 'description', 'keywords', 'noindex', 'nofollow', 'titleatr', 'menulabel', 'disable', 'disable_analytics' ),
373
+ 'default_options' => Array(
374
+ 'edit' => Array( 'type' => 'hidden', 'default' => 'aiosp_edit', 'prefix' => true, 'nowrap' => 1 ),
375
+ 'nonce-aioseop-edit' => Array( 'type' => 'hidden', 'default' => null, 'prefix' => false, 'nowrap' => 1 ),
376
+ 'upgrade' => Array( 'type' => 'html', 'label' => 'none',
377
+ 'default' => '<a target="__blank" href="http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/">'
378
+ . __( 'Upgrade to All in One SEO Pack Pro Version', 'all_in_one_seo_pack' ) . '</a>'
379
+ ),
380
+ 'snippet' => Array( 'name' => __( 'Preview Snippet', 'all_in_one_seo_pack' ), 'type' => 'custom', 'help_text' => __( 'A preview of what this page might look like in search engine results.', 'all_in_one_seo_pack' ), 'label' => 'top', 'default' => '<div class="preview_snippet"><div id="aioseop_snippet"><h3><a>%s</a></h3><div><div><cite>%s</cite></div><span>%s</span></div></div></div>' ),
381
+ 'title' => Array( 'name' => __( 'Title', 'all_in_one_seo_pack' ), 'type' => 'text', 'help_text' => __( 'A custom title that shows up in the title tag for this page.', 'all_in_one_seo_pack' ), 'count' => true, 'size' => 60 ),
382
+ 'description' => Array( 'name' => __( 'Description', 'all_in_one_seo_pack' ), 'type' => 'textarea', 'help_text' => __( 'The META description for this page. This will override any autogenerated descriptions.', 'all_in_one_seo_pack' ), 'count' => true, 'cols' => 80, 'rows' => 2 ),
383
+ 'keywords' => Array( 'name' => __( 'Keywords (comma separated)', 'all_in_one_seo_pack' ), 'type' => 'text', 'help_text' => __( 'A comma separated list of your most important keywords for this page that will be written as META keywords.', 'all_in_one_seo_pack' ) ),
384
+ 'noindex' => Array( 'name' => __( "Robots Meta NOINDEX", 'all_in_one_seo_pack' ), 'help_text' => __( 'Check this box to ask search engines not to index this page.', 'all_in_one_seo_pack' ) ),
385
+ 'nofollow' => Array( 'name' => __( "Robots Meta NOFOLLOW", 'all_in_one_seo_pack' ), 'help_text' => __( 'Check this box to ask search engines not to follow links from this page.', 'all_in_one_seo_pack' ) ),
386
+ 'titleatr' => Array( 'name' => __( 'Title Attribute', 'all_in_one_seo_pack' ), 'type' => 'text', 'help_text' => __( 'Set the title attribute for menu links.', 'all_in_one_seo_pack' ), 'size' => 60 ),
387
+ 'menulabel' => Array( 'name' => __( 'Menu Label', 'all_in_one_seo_pack' ), 'type' => 'text', 'help_text' => __( 'Set the label for this page menu item.', 'all_in_one_seo_pack' ), 'size' => 60 ),
388
+ 'disable' => Array( 'name' => __( 'Disable on this page/post', 'all_in_one_seo_pack' ), 'help_text' => __( 'Disable SEO on this page.', 'all_in_one_seo_pack' ) ),
389
+ 'disable_analytics' => Array( 'name' => __( 'Disable Google Analytics', 'all_in_one_seo_pack' ), 'help_text' => __( 'Disable Google Analytics on this page.', 'all_in_one_seo_pack' ), 'condshow' => Array( 'aiosp_disable' => 'on' ) ) ),
390
+ 'display' => null )
391
+ );
392
+
393
+ $this->layout = Array(
394
+ 'default' => Array(
395
+ 'name' => __( 'General Settings', 'all_in_one_seo_pack' ),
396
+ 'options' => Array() // this is set below, to the remaining options -- pdb
397
+ ),
398
+ 'home' => Array(
399
+ 'name' => __( 'Home Page Settings', 'all_in_one_seo_pack' ),
400
+ 'options' => Array( 'home_title', 'home_description', 'home_keywords' )
401
+ ),
402
+ 'keywords' => Array(
403
+ 'name' => __( 'Keyword Settings', 'all_in_one_seo_pack' ),
404
+ 'options' => Array( "togglekeywords", "use_categories", "use_tags_as_keywords", "dynamic_postspage_keywords" )
405
+ ),
406
+ 'title' => Array(
407
+ 'name' => __( 'Title Settings', 'all_in_one_seo_pack' ),
408
+ 'options' => Array( "rewrite_titles", "force_rewrites", "cap_titles", "cap_cats", "page_title_format", "post_title_format", "category_title_format", "archive_title_format",
409
+ "tag_title_format", "search_title_format", "description_format", "404_title_format", "paged_format" )
410
+ ),
411
+ 'cpt' => Array(
412
+ 'name' => __( 'Custom Post Type Settings', 'all_in_one_seo_pack' ),
413
+ 'options' => Array( "enablecpost", "cpostadvanced", "cpostactive", "cposttitles" )
414
+ ),
415
+ 'display' => Array(
416
+ 'name' => __( 'Display Settings', 'all_in_one_seo_pack' ),
417
+ 'options' => Array( "posttypecolumns", "admin_bar" )
418
+ ),
419
+ 'webmaster' => Array(
420
+ 'name' => __( 'Webmaster Verification', 'all_in_one_seo_pack' ),
421
+ 'options' => Array( "google_verify", "bing_verify", "pinterest_verify" )
422
+ ),
423
+ 'google' => Array(
424
+ 'name' => __( 'Google Settings', 'all_in_one_seo_pack' ),
425
+ 'options' => Array( "google_publisher", "google_analytics_id", "ga_domain", "ga_multi_domain", "ga_track_outbound_links" )
426
+ ),
427
+ 'noindex' => Array(
428
+ 'name' => __( 'Noindex Settings', 'all_in_one_seo_pack' ),
429
+ 'options' => Array( 'category_noindex', 'archive_noindex', 'tags_noindex' )
430
+ ),
431
+ 'advanced' => Array(
432
+ 'name' => __( 'Advanced Settings', 'all_in_one_seo_pack' ),
433
+ 'options' => Array( 'generate_descriptions', 'unprotect_meta', 'ex_pages', 'post_meta_tags', 'page_meta_tags', 'front_meta_tags', 'home_meta_tags' )
434
+ )
435
+ );
436
+
437
+ $other_options = Array();
438
+ foreach( $this->layout as $k => $v )
439
+ $other_options = array_merge( $other_options, $v['options'] );
440
+
441
+ $this->layout['default']['options'] = array_diff( array_keys( $this->default_options ), $other_options );
442
+
443
+ add_action( "aioseop_global_settings_header", Array( $this, 'display_right_sidebar' ) );
444
+ add_action( "aioseop_global_settings_footer", Array( $this, 'display_settings_footer' ) );
445
+ add_action( "output_option", Array( $this, 'custom_output_option' ), 10, 2 );
446
+ }
447
+
448
+ /*** Use custom callback for outputting snippet ***/
449
+ function custom_output_option( $buf, $args ) {
450
+ if ( $args['name'] == 'aiosp_snippet' ) {
451
+ global $post, $aioseop_options, $wp_query;
452
+ if ( is_object( $post ) ) {
453
+ $post_id = $post->ID;
454
+ $p = $post; $w = $wp_query;
455
+ $wp_query = new WP_Query( array( 'p' => $post_id, 'post_type' => $post->post_type ) );
456
+ if ( $post->post_type == 'page' ) $wp_query->is_page = true;
457
+
458
+ $args['options']['type'] = 'html';
459
+ $args['options']['nowrap'] = false;
460
+ $args['options']['save'] = false;
461
+
462
+ $title = false;
463
+ $title = $this->wp_title();
464
+ if ( !$title ) $title = $post->post_title;
465
+
466
+ if ( ( $aioseop_options['aiosp_can'] ) && ( $url = $this->aiosp_mrt_get_url( $wp_query ) ) )
467
+ $url = apply_filters( 'aioseop_canonical_url',$url );
468
+ if ( !$url ) $url = get_permalink();
469
+
470
+ $description = $this->get_post_description( $post );
471
+
472
+ if ( strlen( $title ) > 70 ) $title = $this->trim_excerpt_without_filters( $title, 70 ) . '...';
473
+ if ( strlen( $description ) > 156 ) $description = $this->trim_excerpt_without_filters( $description, 156 ) . '...';
474
+
475
+ $args['value'] = sprintf( $args['value'], $title, $url, $description );
476
+ $buf = $this->get_option_row( $args['name'], $args['options'], $args );
477
+
478
+ wp_reset_postdata();
479
+ $wp_query = $w; $post = $p;
480
+ }
481
+ }
482
+ return $buf;
483
+ }
484
+
485
+ function add_page_hooks() {
486
+ $post_objs = get_post_types( '', 'objects' );
487
+ $pt = array_keys( $post_objs );
488
+ $rempost = array( 'attachment', 'revision', 'nav_menu_item' );
489
+ $pt = array_diff( $pt, $rempost );
490
+ $post_types = Array();
491
+ foreach ( $pt as $p ) {
492
+ if ( !empty( $post_objs[$p]->label ) )
493
+ $post_types[$p] = $post_objs[$p]->label;
494
+ else
495
+ $post_types[$p] = $p;
496
+ }
497
+ $this->default_options["posttypecolumns"]['initial_options'] = $post_types;
498
+ $this->default_options["cpostactive"]['initial_options'] = $post_types;
499
+ foreach ( $post_types as $p => $pt ) {
500
+ $field = $p . "_title_format";
501
+ $name = $post_objs[$p]->labels->singular_name;
502
+ if ( !isset( $this->default_options[$field] ) ) {
503
+ $this->default_options[$field] = Array (
504
+ 'name' => "$name " . __( 'Title Format:', 'all_in_one_seo_pack' ) . "<br />($p)",
505
+ 'help_text' =>
506
+ __( 'The following macros are supported:', 'all_in_one_seo_pack' )
507
+ . '<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
508
+ __( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
509
+ __( '%post_title% - The original title of the post', 'all_in_one_seo_pack' ) . '</li><li>' .
510
+ __( '%category_title% - The (main) category of the post', 'all_in_one_seo_pack' ) . '</li><li>' .
511
+ __( '%category% - Alias for %category_title%', 'all_in_one_seo_pack' ) . '</li><li>' .
512
+ __( "%post_author_login% - This post's author' login", 'all_in_one_seo_pack' ) . '</li><li>' .
513
+ __( "%post_author_nicename% - This post's author' nicename", 'all_in_one_seo_pack' ) . '</li><li>' .
514
+ __( "%post_author_firstname% - This post's author' first name (capitalized)", 'all_in_one_seo_pack' ) . '</li><li>' .
515
+ __( "%post_author_lastname% - This post's author' last name (capitalized)", 'all_in_one_seo_pack' ) . '</li>' .
516
+ '</ul>',
517
+ 'type' => 'text',
518
+ 'default' => '%post_title% | %blog_title%',
519
+ 'condshow' => Array( 'aiosp_enablecpost' => 'on', 'aiosp_cpostadvanced' => 'on', 'aiosp_cposttitles' => 'on' )
520
+ );
521
+ $this->layout['cpt']['options'][] = $field;
522
+ }
523
+ }
524
+
525
+ $this->pointers['aioseop_welcome'] = Array( 'pointer_target' => '#aiosp_settings_form',
526
+ 'pointer_text' => '<h3>' . sprintf( __( 'Welcome to Version %s!', 'all_in_one_seo_pack' ), AIOSEOP_VERSION )
527
+ . '</h3><p>' . __( 'Thank you for running the latest and greatest All in One SEO Pack ever! New in 2.0: manage your performance with our Performance module; enable it from our new feature manager! And please review your settings, we have added some new ones!', 'all_in_one_seo_pack' ) . '</p>'
528
+ );
529
+
530
+ $this->setting_options();
531
+ add_filter( "{$this->prefix}display_options", Array( $this, 'filter_options' ), 10, 3 );
532
+ parent::add_page_hooks();
533
+ }
534
+
535
+ function settings_page_init() {
536
+ add_filter( "{$this->prefix}submit_options", Array( $this, 'filter_submit' ) );
537
+ }
538
+
539
+ function enqueue_scripts() {
540
+ add_filter( "{$this->prefix}display_settings", Array( $this, 'filter_settings' ), 10, 3 );
541
+ parent::enqueue_scripts();
542
+ }
543
+
544
+ function filter_submit( $submit ) {
545
+ $submit['Submit_Default']['value'] = __( 'Reset General Settings to Defaults', 'all_in_one_seo_pack' ) . ' &raquo;';
546
+ $submit['Submit_All_Default'] = Array( 'type' => 'submit', 'class' => 'button-primary', 'value' => __( 'Reset ALL Settings to Defaults', 'all_in_one_seo_pack' ) . ' &raquo;' );
547
+ return $submit;
548
+ }
549
+
550
+ /**
551
+ * Handle resetting options to defaults.
552
+ */
553
+ function reset_options( $location = null, $delete = false ) {
554
+ if ( $delete === true ) {
555
+ $this->delete_class_option( $delete );
556
+ $this->options = Array();
557
+ }
558
+ $default_options = $this->default_options( $location );
559
+ foreach ( $default_options as $k => $v )
560
+ $this->options[$k] = $v;
561
+ $this->update_class_option( $this->options );
562
+ }
563
+
564
+ function get_current_options( $opts = Array(), $location = null, $defaults = null ) {
565
+ if ( ( $location === 'aiosp' ) && ( $this->locations[$location]['type'] == 'metabox' ) ) {
566
+ global $post;
567
+ $post_id = $post;
568
+ if ( is_object( $post_id ) )
569
+ $post_id = $post_id->ID;
570
+ $get_opts = $this->default_options( $location );
571
+ foreach ( Array( 'keywords', 'description', 'title', 'disable', 'disable_analytics', 'noindex', 'nofollow', 'titleatr', 'menulabel' ) as $f ) {
572
+ $field = "aiosp_$f";
573
+ $get_opts[$field] = htmlspecialchars( stripcslashes( get_post_meta( $post_id, '_aioseop_' . $f, true ) ) );
574
+ }
575
+ $opts = wp_parse_args( $opts, $get_opts );
576
+ return $opts;
577
+ } else {
578
+ $options = parent::get_current_options( $opts, $location, $defaults );
579
+ return $options;
580
+ }
581
+ }
582
+
583
+ function filter_settings( $settings, $location, $current ) {
584
+ if ( $location == null ) {
585
+ $prefix = $this->prefix;
586
+
587
+ foreach ( Array( 'seopostcol', 'seocustptcol', 'debug_info', 'max_words_excerpt' ) as $opt )
588
+ unset( $settings["{$prefix}$opt"] );
589
+
590
+ } elseif ( $location == 'aiosp' ) {
591
+ global $post;
592
+ $prefix = $this->get_prefix( $location ) . $location . '_';
593
+ if ( is_object( $post ) ) {
594
+ if ( $post->post_type != 'page' ) {
595
+ unset( $settings["{$prefix}titleatr"] );
596
+ unset( $settings["{$prefix}menulabel"] );
597
+ }
598
+ }
599
+ if ( !empty( $this->options[$this->prefix . 'togglekeywords'] ) ) {
600
+ unset( $settings["{$prefix}keywords"] );
601
+ unset( $settings["{$prefix}togglekeywords"] );
602
+ } elseif ( !empty( $current["{$prefix}togglekeywords"] ) ) {
603
+ unset( $settings["{$prefix}keywords"] );
604
+ }
605
+ }
606
+ return $settings;
607
+ }
608
+
609
+ function filter_options( $options, $location ) {
610
+ if ( $location == null ) {
611
+ $prefix = $this->prefix;
612
+ if ( isset( $options["{$prefix}rewrite_titles"] ) && ( !empty( $options["{$prefix}rewrite_titles"] ) ) )
613
+ $options["{$prefix}rewrite_titles"] = 1;
614
+ if ( ( isset( $options["{$prefix}enablecpost"] ) ) && ( $options["{$prefix}enablecpost"] === '' ) )
615
+ $options["{$prefix}enablecpost"] = 0;
616
+ if ( ( isset( $options["{$prefix}use_original_title"] ) ) && ( $options["{$prefix}use_original_title"] === '' ) )
617
+ $options["{$prefix}use_original_title"] = 0;
618
+ }
619
+ return $options;
620
+ }
621
+
622
+ function display_side_metaboxes( $add, $meta ) {
623
+ echo "<div class='aioseop_metabox_wrapper' >";
624
+ switch ( $meta['id'] ) {
625
+ case "aioseop-about":
626
+ ?><div class="aioseop_metabox_text">
627
+ <p><h2 style="display:inline;"><?php echo AIOSEOP_PLUGIN_NAME; ?></h2> by Michael Torbert of <a target="_blank" title="Semper Fi Web Design"
628
+ href="http://semperfiwebdesign.com/">Semper Fi Web Design</a>.</p>
629
+ <p>
630
+ <a target="_blank" title="<?php _e('All in One SEO Plugin Support Forum', 'all_in_one_seo_pack' ); ?>"
631
+ href="http://semperplugins.com/support/"><?php _e('Support Forum', 'all_in_one_seo_pack' ); ?></a>
632
+ | <strong><a target="_blank" title="<?php _e('Pro Version', 'all_in_one_seo_pack' ); ?>"
633
+ href="http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/">
634
+ <?php _e('UPGRADE TO PRO VERSION', 'all_in_one_seo_pack' ); ?></a></strong></p>
635
+ <form action="http://semperfiwebdesign.us1.list-manage.com/subscribe/post?u=794674d3d54fdd912f961ef14&amp;id=af0a96d3d9"
636
+ method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank">
637
+ <h2>Join our mailing list for tips, tricks, and WordPress secrets.</h2>
638
+ <p><i>Sign up today and receive a free copy of the e-book 5 SEO Tips for WordPress ($39 value).</i></p>
639
+ <p><input type="text" value="" name="EMAIL" class="required email" id="mce-EMAIL" placeholder="Email Address">
640
+ <input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="btn"></p>
641
+ </form>
642
+ </div>
643
+ <?php
644
+ case "aioseop-donate":
645
+ ?>
646
+ <div>
647
+ <div class="aioseop_metabox_text">
648
+ <p>If you like this plugin and find it useful, help keep this plugin free and actively developed by clicking the <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtorbert%40gmail%2ecom&item_name=All%20In%20One%20SEO%20Pack&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8"
649
+ target="_blank"><strong>donate</strong></a> button or send me a gift from my <a
650
+ href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web" target="_blank">
651
+ <strong>Amazon wishlist</strong></a>. Also, don't forget to follow me on <a
652
+ href="http://twitter.com/michaeltorbert/" target="_blank"><strong>Twitter</strong></a>.</p>
653
+ </div>
654
+
655
+ <div class="aioseop_metabox_feature">
656
+ <a target="_blank" title="<?php _e( 'Donate', 'all_in_one_seo_pack' ); ?>"
657
+ href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtorbert%40gmail%2ecom&item_name=All%20In%20One%20SEO%20Pack&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8">
658
+ <img src="<?php echo AIOSEOP_PLUGIN_URL; ?>images/donate.jpg" alt="<?php _e('Donate with Paypal', 'all_in_one_seo_pack' ); ?>" /> </a>
659
+ <a target="_blank" title="Amazon Wish List" href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web">
660
+ <img src="<?php echo AIOSEOP_PLUGIN_URL; ?>images/amazon.jpg" alt="<?php _e('My Amazon Wish List', 'all_in_one_seo_pack' ); ?>" /> </a>
661
+ <a target="_blank" title="<?php _e( 'Follow us on Facebook', 'all_in_one_seo_pack' ); ?>" href="http://www.facebook.com/pages/Semper-Fi-Web-Design/121878784498475"><span class="aioseop_follow_button aioseop_facebook_follow"></span></a>
662
+ <a target="_blank" title="<?php _e( 'Follow us on Twitter', 'all_in_one_seo_pack' ); ?>" href="http://twitter.com/semperfidev/"><span class="aioseop_follow_button aioseop_twitter_follow"></span></a>
663
+ </div>
664
+
665
+ </div>
666
+ <?php
667
+ break;
668
+ case "aioseop-support":
669
+ ?><div class="aioseop_metabox_text">
670
+ <p><?php _e( 'For support please visit the Semper Plugins Support Forum at http://semperplugins.com/support/', 'all_in_one_seo_pack' ); ?></p>
671
+ </div>
672
+ <?php
673
+ break;
674
+ }
675
+ echo "</div>";
676
+ }
677
+
678
+ function get_queried_object() {
679
+ static $p = null;
680
+ global $wp_query, $post;
681
+ if ( $p !== null ) return $p;
682
+ if ( is_object( $post ) )
683
+ $p = $post;
684
+ else {
685
+ if ( !$wp_query ) return null;
686
+ $p = $wp_query->get_queried_object();
687
+ }
688
+ return $p;
689
+ }
690
+
691
+ function template_redirect() {
692
+ global $aioseop_options;
693
+
694
+ $post = $this->get_queried_object();
695
+
696
+ if( aioseop_mrt_exclude_this_page() ) return;
697
+
698
+ if ( is_feed() ) return;
699
+
700
+ if ( is_single() || is_page() ) {
701
+ $aiosp_disable = htmlspecialchars(stripcslashes( get_post_meta( $post->ID, '_aioseop_disable', true ) ) );
702
+ if ( $aiosp_disable ) {
703
+ $aiosp_disable_analytics = htmlspecialchars(stripcslashes( get_post_meta( $post->ID, '_aioseop_disable_analytics', true ) ) );
704
+ if ( !$aiosp_disable_analytics ) {
705
+ if ( aioseop_option_isset( 'aiosp_google_analytics_id' ) ) {
706
+ remove_action( 'aioseop_modules_wp_head', array( $this, 'aiosp_google_analytics' ) );
707
+ add_action( 'wp_head', array( $this, 'aiosp_google_analytics' ) );
708
+ }
709
+ }
710
+ return;
711
+ }
712
+
713
+ if ( !empty( $aioseop_options['aiosp_cpostadvanced'] ) ) {
714
+ $wp_post_types = $aioseop_options['aiosp_cpostactive'];
715
+ if ( empty( $aioseop_options['aiosp_cpostactive'] ) ) return;
716
+ if( !is_singular( $wp_post_types ) ) return;
717
+ }
718
+ }
719
+
720
+ if ( !empty( $aioseop_options['aiosp_rewrite_titles'] ) ) {
721
+ $force_rewrites = 1;
722
+ if ( isset( $aioseop_options['aiosp_force_rewrites'] ) )
723
+ $force_rewrites = $aioseop_options['aiosp_force_rewrites'];
724
+ if ( $force_rewrites )
725
+ ob_start( array( $this, 'output_callback_for_title' ) );
726
+ else
727
+ add_filter( 'wp_title', array( $this, 'wp_title' ) );
728
+ }
729
+ }
730
+
731
+ function output_callback_for_title( $content ) {
732
+ return $this->rewrite_title( $content );
733
+ }
734
+
735
+ function init() {
736
+ if ( !defined( 'WP_PLUGIN_DIR' ) ) {
737
+ load_plugin_textdomain( 'all_in_one_seo_pack', str_replace( ABSPATH, '', dirname( __FILE__ ) ) );
738
+ } else {
739
+ load_plugin_textdomain( 'all_in_one_seo_pack', false, AIOSEOP_PLUGIN_DIRNAME );
740
+ }
741
+ }
742
+
743
+ function add_hooks() {
744
+ global $aioseop_options;
745
+ aioseop_update_settings_check();
746
+ add_filter( 'user_contactmethods', 'aioseop_add_contactmethods' );
747
+ if ( is_user_logged_in() && function_exists( 'is_admin_bar_showing' ) && is_admin_bar_showing() && current_user_can( 'manage_options' ) )
748
+ add_action( 'admin_bar_menu', array( $this, 'admin_bar_menu' ), 1000 );
749
+
750
+ if ( is_admin() ) {
751
+ add_action( 'admin_menu', array( $this, 'admin_menu' ) );
752
+ add_action( 'admin_head', 'aioseop_option_page_icon' );
753
+ add_action( 'admin_init', 'aioseop_addmycolumns', 1 );
754
+ } else {
755
+ if ( $aioseop_options['aiosp_can'] == '1' || $aioseop_options['aiosp_can'] == 'on' )
756
+ remove_action( 'wp_head', 'rel_canonical' );
757
+ ////analytics
758
+ if ( aioseop_option_isset( 'aiosp_google_analytics_id' ) )
759
+ add_action( 'aioseop_modules_wp_head', array( $this, 'aiosp_google_analytics' ) );
760
+ add_filter( 'wp_list_pages', 'aioseop_list_pages' );
761
+ add_action( 'wp_head', array( $this, 'wp_head') );
762
+ add_action( 'template_redirect', array( $this, 'template_redirect' ) );
763
+ add_filter( 'wp_list_pages_excludes', 'aioseop_get_pages_start' );
764
+ add_filter( 'get_pages', 'aioseop_get_pages' );
765
+ }
766
+
767
+ }
768
+
769
+ function is_static_front_page() {
770
+ static $is_front_page = null;
771
+ if ( $is_front_page !== null ) return $is_front_page;
772
+ $post = $this->get_queried_object();
773
+ $is_front_page = ( get_option( 'show_on_front' ) == 'page' && is_page() && $post->ID == get_option( 'page_on_front' ) );
774
+ return $is_front_page;
775
+ }
776
+
777
+ function is_static_posts_page() {
778
+ static $is_posts_page = null;
779
+ if ( $is_posts_page !== null ) return $is_posts_page;
780
+ $post = $this->get_queried_object();
781
+ $is_posts_page = ( get_option( 'show_on_front' ) == 'page' && is_home() && $post->ID == get_option( 'page_for_posts' ) );
782
+ return $is_posts_page;
783
+ }
784
+
785
+ function wp_head() {
786
+ if ( is_feed() ) return;
787
+
788
+ if( aioseop_mrt_exclude_this_page() ) return;
789
+
790
+ global $wp_query;
791
+ global $aioseop_options;
792
+ $post = $this->get_queried_object();
793
+ $meta_string = null;
794
+
795
+ if ( is_single() || is_page() ) {
796
+ $aiosp_disable = htmlspecialchars( stripcslashes( get_post_meta( $post->ID, '_aioseop_disable', true ) ) );
797
+ if ( $aiosp_disable ) return;
798
+ if( empty( $aioseop_options['aiosp_enablecpost'] ) ) {
799
+ $wp_post_types = get_post_types( Array( '_builtin' => true ) ); // don't display meta if SEO isn't enabled on custom post types -- pdb
800
+ if( !is_singular( $wp_post_types ) ) return;
801
+ } else {
802
+ if ( !empty( $aioseop_options['aiosp_cpostadvanced'] ) ) {
803
+ $wp_post_types = $aioseop_options['aiosp_cpostactive'];
804
+ if ( empty( $aioseop_options['aiosp_cpostactive'] ) ) return;
805
+ if( !is_singular( $wp_post_types ) ) return;
806
+ }
807
+ }
808
+ }
809
+
810
+ $force_rewrites = 1;
811
+ if ( isset( $aioseop_options['aiosp_force_rewrites'] ) )
812
+ $force_rewrites = $aioseop_options['aiosp_force_rewrites'];
813
+
814
+ if ( !empty( $aioseop_options['aiosp_rewrite_titles'] ) && $force_rewrites ) {
815
+ // make the title rewrite as short as possible
816
+ if (function_exists( 'ob_list_handlers' ) ) {
817
+ $active_handlers = ob_list_handlers();
818
+ } else {
819
+ $active_handlers = array();
820
+ }
821
+ if (sizeof($active_handlers) > 0 &&
822
+ strtolower( $active_handlers[sizeof( $active_handlers ) - 1] ) ==
823
+ strtolower( 'All_in_One_SEO_Pack::output_callback_for_title' ) ) {
824
+ ob_end_flush();
825
+ } else {
826
+ $this->log( "another plugin interfering?" );
827
+ // if we get here there *could* be trouble with another plugin :(
828
+ $this->ob_start_detected = true;
829
+ if ( function_exists( 'ob_list_handlers' ) ) {
830
+ foreach ( ob_list_handlers() as $handler ) {
831
+ $this->log( "detected output handler $handler" );
832
+ }
833
+ }
834
+ }
835
+ }
836
+
837
+ echo "\n<!-- All in One SEO Pack $this->version by Michael Torbert of Semper Fi Web Design";
838
+ if ( $this->ob_start_detected )
839
+ echo "ob_start_detected ";
840
+ echo "[$this->title_start,$this->title_end] ";
841
+ echo "-->\n";
842
+
843
+ $is_front_page = is_front_page();
844
+
845
+ $is_front_page_keywords = ( ( is_home() && $aioseop_options['aiosp_home_keywords'] && !$this->is_static_posts_page() ) || $this->is_static_front_page() );
846
+
847
+ if ( $is_front_page_keywords ) {
848
+ $keywords = trim( $this->internationalize( $aioseop_options['aiosp_home_keywords'] ) );
849
+ } elseif ( $this->is_static_posts_page() && !$aioseop_options['aiosp_dynamic_postspage_keywords'] ) { // and if option = use page set keywords instead of keywords from recent posts
850
+ $keywords = stripcslashes( $this->internationalize( get_post_meta( $post->ID, "_aioseop_keywords", true ) ) );
851
+ } else {
852
+ $keywords = $this->get_all_keywords();
853
+ }
854
+ if ( is_single() || is_page() || $this->is_static_posts_page() ) {
855
+ if ( $this->is_static_front_page() ) {
856
+ $description = trim( stripcslashes( $this->internationalize( $aioseop_options['aiosp_home_description'] ) ) );
857
+ } else {
858
+ $description = $this->get_post_description( $post );
859
+ $description = apply_filters( 'aioseop_description', $description );
860
+ }
861
+ } else if ( is_home() ) {
862
+ $description = trim( stripcslashes( $this->internationalize( $aioseop_options['aiosp_home_description'] ) ) );
863
+ } else if ( is_category() ) {
864
+ $description = $this->internationalize( category_description() );
865
+ }
866
+
867
+ if ( isset($description) && (strlen($description) > $this->minimum_description_length ) && !( is_home() && is_paged() ) ) {
868
+ $description = trim( strip_tags( $description ) );
869
+ $description = str_replace( '"', '', $description );
870
+
871
+ // replace newlines on mac / windows?
872
+ $description = str_replace( "\r\n", ' ', $description );
873
+
874
+ // maybe linux uses this alone
875
+ $description = str_replace( "\n", ' ', $description );
876
+
877
+ if ( !isset( $meta_string) ) {
878
+ $meta_string = '';
879
+ }
880
+
881
+ // description format
882
+ $description_format = $aioseop_options['aiosp_description_format'];
883
+ if ( !isset( $description_format ) || empty( $description_format ) ) {
884
+ $description_format = "%description%";
885
+ }
886
+ $description = str_replace( '%description%', apply_filters( 'aioseop_description_override', $description ), $description_format );
887
+ $description = str_replace( '%blog_title%', get_bloginfo( 'name' ), $description );
888
+ $description = str_replace( '%blog_description%', get_bloginfo( 'description' ), $description );
889
+ $description = str_replace( '%wp_title%', $this->get_original_title(), $description );
890
+ if( $aioseop_options['aiosp_can'] && is_attachment() ) {
891
+ $url = $this->aiosp_mrt_get_url( $wp_query );
892
+ if ( $url ) {
893
+ $matches = Array();
894
+ preg_match_all( '/(\d+)/', $url, $matches );
895
+ if ( is_array( $matches ) ){
896
+ $uniqueDesc = join( '', $matches[0] );
897
+ }
898
+ }
899
+ $description .= ' ' . $uniqueDesc;
900
+ }
901
+ $meta_string .= sprintf( "<meta name=\"description\" content=\"%s\" />\n", $description );
902
+ }
903
+
904
+ $keywords = apply_filters( 'aioseop_keywords', $keywords );
905
+
906
+ if ( isset( $aioseop_options['aiosp_togglekeywords'] ) )
907
+ $togglekeywords = $aioseop_options['aiosp_togglekeywords'];
908
+ else
909
+ $togglekeywords = 0;
910
+
911
+ if ( isset( $keywords ) && $togglekeywords == 0 && !empty( $keywords ) && !( is_home() && is_paged() ) ) {
912
+ if ( isset( $meta_string ) ) $meta_string .= "\n";
913
+ $keywords = str_replace( '"', '', $keywords );
914
+ $meta_string .= sprintf( "<meta name=\"keywords\" content=\"%s\" />\n", $keywords );
915
+ }
916
+
917
+ $is_tag = is_tag();
918
+
919
+ if ( ( is_category() && $aioseop_options['aiosp_category_noindex'] ) || ( !is_category() && is_archive() &&!$is_tag && $aioseop_options['aiosp_archive_noindex'] ) || ( $aioseop_options['aiosp_tags_noindex'] && $is_tag ) ) {
920
+ $meta_string .= '<meta name="robots" content="noindex,follow" />' . "\n";
921
+ } else {
922
+ if ( is_single() || is_page() ) {
923
+ $aiosp_noindex = htmlspecialchars( stripcslashes( get_post_meta( $post->ID, '_aioseop_noindex', true ) ) );
924
+ $aiosp_nofollow = htmlspecialchars( stripcslashes( get_post_meta( $post->ID, '_aioseop_nofollow', true ) ) );
925
+ if ( $aiosp_noindex || $aiosp_nofollow ) {
926
+ $noindex = "index";
927
+ $nofollow = "follow";
928
+ if ( $aiosp_noindex ) $noindex = "no" . $noindex;
929
+ if ( $aiosp_nofollow ) $nofollow = "no" . $nofollow;
930
+ $meta_string .= '<meta name="robots" content="' . $noindex . ',' . $nofollow . '" />' . "\n";
931
+ }
932
+ }
933
+ }
934
+
935
+ if ( $is_front_page )
936
+ foreach( Array( 'google' => 'google-site-verification', 'bing' => 'msvalidate.01', 'pinterest' => 'p:domain_verify' ) as $k => $v )
937
+ if ( !empty( $aioseop_options["aiosp_{$k}_verify"] ) )
938
+ $meta_string .= '<meta name="' . $v . '" content="' . trim( strip_tags( $aioseop_options["aiosp_{$k}_verify"] ) ) . '" />' . "\n";
939
+
940
+ foreach( Array( 'page_meta', 'post_meta', 'home_meta', 'front_meta' ) as $meta ) {
941
+ if ( !empty( $aioseop_options["aiosp_{$meta}_tags" ] ) )
942
+ $$meta = html_entity_decode( stripcslashes( $aioseop_options["aiosp_{$meta}_tags" ] ) );
943
+ else
944
+ $$meta = '';
945
+ }
946
+
947
+ if ( is_page() && isset( $page_meta ) && !empty( $page_meta ) && ( !$is_front_page || empty( $front_meta ) ) ) {
948
+ if ( isset( $meta_string ) ) $meta_string .= "\n";
949
+ $meta_string .= $page_meta;
950
+ }
951
+
952
+ if ( is_single() && isset( $post_meta ) && !empty( $post_meta ) ) {
953
+ if ( isset( $meta_string ) ) $meta_string .= "\n";
954
+ $meta_string .= $post_meta;
955
+ }
956
+
957
+ if ( !empty( $post ) && isset( $post->post_author ) )
958
+ $googleplus = get_the_author_meta( 'googleplus', $post->post_author );
959
+
960
+ if ( empty( $googleplus ) && !empty( $aioseop_options['aiosp_google_publisher'] ) )
961
+ $googleplus = $aioseop_options['aiosp_google_publisher'];
962
+
963
+ if ( is_singular() && ( $googleplus ) ) {
964
+ $meta_string = '<link rel="author" href="' . $googleplus . '" />' . "\n" . $meta_string;
965
+ } else if ( !is_home() && !empty( $aioseop_options['aiosp_google_publisher'] ) ) {
966
+ $meta_string = '<link rel="author" href="' . $aioseop_options['aiosp_google_publisher'] . '" />' . "\n" . $meta_string;
967
+ }
968
+
969
+ if ( $is_front_page && !empty( $front_meta ) ) {
970
+ if ( isset( $meta_string ) ) $meta_string .= "\n";
971
+ $meta_string .= $front_meta;
972
+ } else {
973
+ if ( is_home() && !empty( $home_meta ) ) {
974
+ if ( isset( $meta_string ) ) $meta_string .= "\n";
975
+ $meta_string .= $home_meta;
976
+ }
977
+ }
978
+
979
+ if ( $meta_string != null ) echo "$meta_string\n";
980
+
981
+ if ( ( $aioseop_options['aiosp_can'] ) && ( $url = $this->aiosp_mrt_get_url( $wp_query ) ) ) {
982
+ $url = apply_filters( 'aioseop_canonical_url',$url );
983
+ echo "".'<link rel="canonical" href="'.$url.'" />'."\n";
984
+ }
985
+ do_action( 'aioseop_modules_wp_head' );
986
+ echo "<!-- /all in one seo pack -->\n";
987
+ }
988
+
989
+ function aiosp_google_analytics() {
990
+ global $aioseop_options;
991
+ ?>
992
+ <script type="text/javascript">
993
+
994
+ var _gaq = _gaq || [];
995
+ _gaq.push(['_setAccount', '<?php echo $aioseop_options['aiosp_google_analytics_id']; ?>']);
996
+ <?php if ( !empty( $aioseop_options['aiosp_ga_multi_domain'] ) ) {
997
+ ?> _gaq.push(['_setAllowLinker', true]);
998
+ <?php
999
+ }
1000
+ ?>
1001
+ <?php if ( !empty( $aioseop_options['aiosp_ga_domain'] ) ) {
1002
+ ?> _gaq.push(['_setDomainName', '<?php echo $aioseop_options['aiosp_ga_domain']; ?>']);
1003
+ <?php
1004
+ }
1005
+ ?> _gaq.push(['_trackPageview']);
1006
+ (function() {
1007
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
1008
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
1009
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
1010
+ })();
1011
+
1012
+ </script>
1013
+ <?php
1014
+ if ( $aioseop_options['aiosp_ga_track_outbound_links'] ) {
1015
+ ?>
1016
+ <script type="text/javascript">
1017
+ function recordOutboundLink(link, category, action) {
1018
+ _gat._getTrackerByName()._trackEvent(category, action);
1019
+ if ( link.target == '_blank' ) return true;
1020
+ setTimeout('document.location = "' + link.href + '"', 100);
1021
+ return false;
1022
+ }
1023
+ /* use regular Javascript for this */
1024
+ function getAttr(ele, attr) {
1025
+ var result = (ele.getAttribute && ele.getAttribute(attr)) || null;
1026
+ if( !result ) {
1027
+ var attrs = ele.attributes;
1028
+ var length = attrs.length;
1029
+ for(var i = 0; i < length; i++)
1030
+ if(attr[i].nodeName === attr) result = attr[i].nodeValue;
1031
+ }
1032
+ return result;
1033
+ }
1034
+
1035
+ window.onload = function () {
1036
+ var links = document.getElementsByTagName('a');
1037
+ for (var x=0; x < links.length; x++) {
1038
+ if (typeof links[x] == 'undefined') continue;
1039
+ if (typeof links[x].onclick != 'undefined') continue;
1040
+ links[x].onclick = function () {
1041
+ var mydomain = new RegExp(document.domain, 'i');
1042
+ href = getAttr(this, 'href');
1043
+ if(href && href.toLowerCase().indexOf('http') === 0 && !mydomain.test(href)) {
1044
+ recordOutboundLink(this, 'Outbound Links', href);
1045
+ }
1046
+ }
1047
+ }
1048
+ };
1049
+ </script>
1050
+ <?php
1051
+ }
1052
+ }
1053
+
1054
+ // Thank you, Yoast de Valk, for much of this code.
1055
+
1056
+ function aiosp_mrt_get_url( $query ) {
1057
+ if ( $query->is_404 || $query->is_search ) {
1058
+ return false;
1059
+ }
1060
+ $haspost = count( $query->posts ) > 0;
1061
+
1062
+ if ( get_query_var( 'm' ) ) {
1063
+ $m = preg_replace( '/[^0-9]/', '', get_query_var( 'm' ) );
1064
+ switch ( strlen( $m ) ) {
1065
+ case 4: $link = get_year_link( $m ); break;
1066
+ case 6: $link = get_month_link( substr( $m, 0, 4), substr($m, 4, 2 ) ); break;
1067
+ case 8: $link = get_day_link( substr( $m, 0, 4 ), substr( $m, 4, 2 ), substr( $m, 6, 2 ) ); break;
1068
+ default:
1069
+ return false;
1070
+ }
1071
+ } elseif ( ( $query->is_single || $query->is_page ) && $haspost ) {
1072
+ $post = $query->posts[0];
1073
+ $link = get_permalink( $post->ID );
1074
+ $link = $this->yoast_get_paged( $link );
1075
+ } elseif ( $query->is_author && $haspost ) {
1076
+ $author = get_userdata( get_query_var( 'author' ) );
1077
+ if ($author === false) return false;
1078
+ $link = get_author_posts_url( $author->ID, $author->user_nicename );
1079
+ } elseif ( $query->is_category && $haspost ) {
1080
+ $link = get_category_link( get_query_var( 'cat' ) );
1081
+ $link = $this->yoast_get_paged( $link );
1082
+ } else if ( $query->is_tag && $haspost ) {
1083
+ $tag = get_term_by( 'slug', get_query_var( 'tag' ), 'post_tag' );
1084
+ if ( !empty( $tag->term_id ) ) {
1085
+ $link = get_tag_link( $tag->term_id );
1086
+ }
1087
+ $link = $this->yoast_get_paged( $link );
1088
+ } elseif ( $query->is_day && $haspost ) {
1089
+ $link = get_day_link( get_query_var( 'year' ),
1090
+ get_query_var( 'monthnum' ),
1091
+ get_query_var( 'day' ) );
1092
+ } elseif ( $query->is_month && $haspost ) {
1093
+ $link = get_month_link( get_query_var( 'year' ),
1094
+ get_query_var( 'monthnum' ) );
1095
+ } elseif ( $query->is_year && $haspost ) {
1096
+ $link = get_year_link( get_query_var( 'year' ) );
1097
+ } elseif ( $query->is_home ) {
1098
+ if ( (get_option( 'show_on_front' ) == 'page' ) &&
1099
+ ( $pageid = get_option( 'page_for_posts' ) ) ) {
1100
+ $link = get_permalink( $pageid );
1101
+ $link = $this->yoast_get_paged( $link );
1102
+ $link = trailingslashit( $link );
1103
+ } else {
1104
+ if ( function_exists( 'icl_get_home_url' ) ) {
1105
+ $link = icl_get_home_url();
1106
+ } else {
1107
+ $link = get_option( 'home' );
1108
+ }
1109
+ $link = $this->yoast_get_paged( $link );
1110
+ $link = trailingslashit( $link );
1111
+ }
1112
+ } elseif ( $query->is_tax && $haspost ) {
1113
+ $taxonomy = get_query_var( 'taxonomy' );
1114
+ $term = get_query_var( 'term' );
1115
+ $link = get_term_link( $term, $taxonomy );
1116
+ $link = $this->yoast_get_paged( $link );
1117
+ } elseif ( $query->is_archive && function_exists( 'get_post_type_archive_link' ) && ( $post_type = get_query_var( 'post_type' ) ) ) {
1118
+ $link = get_post_type_archive_link( $post_type );
1119
+ } else {
1120
+ return false;
1121
+ }
1122
+
1123
+ return $link;
1124
+ }
1125
+
1126
+ function yoast_get_paged( $link ) {
1127
+ $page = get_query_var( 'paged' );
1128
+ if ( $page && $page > 1 ) {
1129
+ $link = trailingslashit( $link ) ."page/". "$page";
1130
+ $link = user_trailingslashit( $link, 'paged' );
1131
+ }
1132
+ return $link;
1133
+ }
1134
+
1135
+ function get_post_description( $post ) {
1136
+ global $aioseop_options;
1137
+ $description = trim( stripcslashes( $this->internationalize( get_post_meta( $post->ID, "_aioseop_description", true ) ) ) );
1138
+ if ( !$description ) {
1139
+ $description = $this->trim_excerpt_without_filters_full_length( $this->internationalize( $post->post_excerpt ) );
1140
+ if ( !$description && $aioseop_options["aiosp_generate_descriptions"] )
1141
+ $description = $this->trim_excerpt_without_filters( $this->internationalize( $post->post_content ) );
1142
+ }
1143
+ // "internal whitespace trim"
1144
+ $description = preg_replace( "/\s\s+/u", " ", $description );
1145
+ return $description;
1146
+ }
1147
+
1148
+ function replace_title( $content, $title ) {
1149
+ $title = trim( strip_tags( $title ) );
1150
+ $title_tag_start = "<title>";
1151
+ $title_tag_end = "</title>";
1152
+ $len_start = strlen( $title_tag_start );
1153
+ $title = stripcslashes( trim( $title ) );
1154
+ $start = strpos( $content, $title_tag_start );
1155
+ $end = strpos( $content, $title_tag_end );
1156
+
1157
+ $this->title_start = $start;
1158
+ $this->title_end = $end;
1159
+ $this->orig_title = $title;
1160
+
1161
+ if ( $start && $end )
1162
+ $header = substr( $content, 0, $start + $len_start ) . $title . substr( $content, $end );
1163
+ else
1164
+ $header = $content;
1165
+
1166
+ return $header;
1167
+ }
1168
+
1169
+ function internationalize( $in ) {
1170
+ if ( function_exists( 'langswitch_filter_langs_with_message' ) )
1171
+ $in = langswitch_filter_langs_with_message( $in );
1172
+
1173
+ if ( function_exists( 'polyglot_filter' ) )
1174
+ $in = polyglot_filter( $in );
1175
+
1176
+ if ( function_exists( 'qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage' ) )
1177
+ $in = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage( $in );
1178
+
1179
+ return apply_filters( 'localization', $in );
1180
+ }
1181
+
1182
+ /** @return The original title as delivered by WP (well, in most cases) */
1183
+ function get_original_title( $sep = '', $echo = false, $seplocation = '' ) {
1184
+ global $aioseop_options;
1185
+ if ( !empty( $aioseop_options['aiosp_use_original_title'] ) ) {
1186
+ $has_filter = has_filter( 'wp_title', Array( $this, 'wp_title' ) );
1187
+ if ( $has_filter !== false )
1188
+ remove_filter( 'wp_title', Array( $this, 'wp_title' ), $has_filter );
1189
+ $title = wp_title( $sep, $echo, $seplocation );
1190
+ if ( $has_filter !== false )
1191
+ add_filter( 'wp_title', Array( $this, 'wp_title' ), $has_filter );
1192
+ if ( $title && ( $title = trim( $title ) ) )
1193
+ return trim( $title );
1194
+ }
1195
+
1196
+ // the_search_query() is not suitable, it cannot just return
1197
+ global $s;
1198
+
1199
+ $title = null;
1200
+
1201
+ if ( is_home() ) {
1202
+ $title = get_option( 'blogname' );
1203
+ } else if ( is_single() ) {
1204
+ $title = $this->internationalize( single_post_title( '', false ) );
1205
+ } else if ( is_search() && isset($s) && !empty($s) ) {
1206
+ $search = esc_attr( stripcslashes($s) );
1207
+ if ( !empty( $aioseop_options['aiosp_cap_titles'] ) )
1208
+ $search = $this->capitalize( $search );
1209
+ $title = $search;
1210
+ } else if ( ( is_tax() || is_category() ) && !is_feed() ) {
1211
+ $category_name = ucwords($this->internationalize( single_cat_title( '', false ) ) );
1212
+ $title = $category_name;
1213
+ } else if ( is_page() ) {
1214
+ $title = $this->internationalize( single_post_title( '', false ) );
1215
+ } else if ( is_tag() ) {
1216
+ global $utw;
1217
+ if ( $utw ) {
1218
+ $tags = $utw->GetCurrentTagSet();
1219
+ $tag = $tags[0]->tag;
1220
+ $tag = str_replace('-', ' ', $tag);
1221
+ } else {
1222
+ // wordpress > 2.3
1223
+ $tag = $this->internationalize( single_term_title( '', false ) );
1224
+ }
1225
+ if ( $tag ) $title = $tag;
1226
+ } else if ( is_archive() ) {
1227
+ $title = $this->internationalize( post_type_archive_title( '', false) );
1228
+ } else if ( is_404() ) {
1229
+ $title_format = $aioseop_options['aiosp_404_title_format'];
1230
+ $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
1231
+ $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
1232
+ $new_title = str_replace( '%request_url%', $_SERVER['REQUEST_URI'], $new_title);
1233
+ $new_title = str_replace( '%request_words%', $this->request_as_words( $_SERVER['REQUEST_URI'] ), $new_title );
1234
+ $title = $new_title;
1235
+ }
1236
+ return trim( $title );
1237
+ }
1238
+
1239
+ function paged_title( $title ) {
1240
+ // the page number if paged
1241
+ global $paged;
1242
+ global $aioseop_options;
1243
+ // simple tagging support
1244
+ global $STagging;
1245
+
1246
+ if ( is_paged() || ( isset($STagging) && $STagging->is_tag_view() && $paged ) ) {
1247
+ $part = $this->internationalize( $aioseop_options['aiosp_paged_format'] );
1248
+ if ( isset( $part ) || !empty( $part ) ) {
1249
+ $part = " " . trim( $part );
1250
+ $part = str_replace( '%page%', $paged, $part );
1251
+ $this->log( "paged_title() [$title] [$part]" );
1252
+ $title .= $part;
1253
+ }
1254
+ }
1255
+ return $title;
1256
+ }
1257
+
1258
+ /*** Gets the title that will be used by AIOSEOP for title rewrites or returns false. ***/
1259
+ function get_aioseop_title( $post ) {
1260
+ global $aioseop_options;
1261
+
1262
+ // the_search_query() is not suitable, it cannot just return
1263
+ global $s, $STagging;
1264
+ if ( is_home() && !$this->is_static_posts_page() ) {
1265
+ $title = $this->internationalize( $aioseop_options['aiosp_home_title'] );
1266
+ if (empty( $title ) )
1267
+ $title = $this->internationalize( get_option( 'blogname' ) );
1268
+
1269
+ return $this->paged_title( $title );
1270
+ } else if ( is_attachment() ) {
1271
+ if ( $post === null ) return false;
1272
+ return get_the_title( $post->post_parent ) . ' ' . $post->post_title . ' – ' . get_option( 'blogname' );
1273
+ } else if ( is_page() || $this->is_static_posts_page() ) {
1274
+ if ( $post === null ) return false;
1275
+ // we're not in the loop :(
1276
+ $authordata = get_userdata( $post->post_author );
1277
+ if ( ( $this->is_static_front_page() ) && ( $home_title = $this->internationalize( $aioseop_options['aiosp_home_title'] ) ) ) {
1278
+ //home title filter
1279
+ return apply_filters( 'aioseop_home_page_title', $home_title );
1280
+ } else {
1281
+ $title = $this->internationalize( get_post_meta( $post->ID, "_aioseop_title", true ) );
1282
+ if ( !$title )
1283
+ $title = $this->internationalize( $this->get_original_title( '', false ) );
1284
+ $title_format = $aioseop_options['aiosp_page_title_format'];
1285
+ $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
1286
+ $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
1287
+ $new_title = str_replace( '%page_title%', $title, $new_title );
1288
+ $new_title = str_replace( '%page_author_login%', $authordata->user_login, $new_title );
1289
+ $new_title = str_replace( '%page_author_nicename%', $authordata->user_nicename, $new_title );
1290
+ $new_title = str_replace( '%page_author_firstname%', ucwords($authordata->first_name ), $new_title );
1291
+ $new_title = str_replace( '%page_author_lastname%', ucwords($authordata->last_name ), $new_title );
1292
+ $title = trim( $new_title );
1293
+ $title = $this->paged_title( $title );
1294
+ $title = apply_filters( 'aioseop_title_page', $title );
1295
+ if ( $this->is_static_posts_page() )
1296
+ $title = apply_filters( 'single_post_title', $title );
1297
+ return $title;
1298
+ }
1299
+ } else if ( is_single() ) {
1300
+ // we're not in the loop :(
1301
+ if ( $post === null ) return false;
1302
+ $authordata = get_userdata( $post->post_author );
1303
+ $categories = get_the_category();
1304
+ $category = '';
1305
+ if ( count( $categories ) > 0 ) {
1306
+ $category = $categories[0]->cat_name;
1307
+ }
1308
+ $title = $this->internationalize( get_post_meta( $post->ID, "_aioseop_title", true ) );
1309
+ if ( !$title ) {
1310
+ $title = $this->internationalize( get_post_meta( $post->ID, "title_tag", true ) );
1311
+ if ( !$title ) $title = $this->internationalize($this->get_original_title( '', false ) );
1312
+ }
1313
+ $title_format = $aioseop_options['aiosp_post_title_format'];
1314
+ if( !empty( $aioseop_options['aiosp_enablecpost'] ) && !empty( $aioseop_options['aiosp_cpostadvanced'] ) && !empty( $aioseop_options['aiosp_cpostactive'] ) ) {
1315
+ $wp_post_types = $aioseop_options['aiosp_cpostactive'];
1316
+ if ( is_singular( $wp_post_types ) && !empty( $aioseop_options["aiosp_cposttitles"] ) ) {
1317
+ $post_type = get_post_type();
1318
+ if ( !empty( $aioseop_options["aiosp_{$post_type}_title_format"] ) )
1319
+ $title_format = $aioseop_options["aiosp_{$post_type}_title_format"];
1320
+ }
1321
+ }
1322
+ $r_title = array( '%blog_title%', '%blog_description%', '%post_title%', '%category%', '%category_title%', '%post_author_login%', '%post_author_nicename%', '%post_author_firstname%', '%post_author_lastname%' );
1323
+ $d_title = array( $this->internationalize( get_bloginfo('name') ), $this->internationalize( get_bloginfo( 'description' ) ), $title, $category, $category, $authordata->user_login, $authordata->user_nicename, ucwords( $authordata->first_name ), ucwords( $authordata->last_name ) );
1324
+ $title = trim( str_replace( $r_title, $d_title, $title_format ) );
1325
+ return apply_filters( 'aioseop_title_single', $title );
1326
+ } else if ( is_search() && isset( $s ) && !empty( $s ) ) {
1327
+ $search = esc_attr( stripcslashes( $s ) );
1328
+ if ( !empty( $aioseop_options['aiosp_cap_titles'] ) )
1329
+ $search = $this->capitalize( $search );
1330
+ $title_format = $aioseop_options['aiosp_search_title_format'];
1331
+ $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
1332
+ $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
1333
+ $title = str_replace( '%search%', $search, $title);
1334
+ return $title;
1335
+ } else if ( ( is_tax() || is_category() ) && !is_feed() ) {
1336
+ $category_description = $this->internationalize( category_description() );
1337
+ if( !empty( $aioseop_options['aiosp_cap_cats'] ) ) {
1338
+ $category_name = ucwords( $this->internationalize( single_cat_title( '', false ) ) );
1339
+ } else {
1340
+ $category_name = $this->internationalize( single_cat_title( '', false ) );
1341
+ }
1342
+ $title_format = $aioseop_options['aiosp_category_title_format'];
1343
+ $title = str_replace( '%category_title%', $category_name, $title_format );
1344
+ $title = str_replace( '%category_description%', $category_description, $title );
1345
+ $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title );
1346
+ $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
1347
+ $title = $this->paged_title( $title );
1348
+ return $title;
1349
+ } else if ( is_tag() ) {
1350
+ global $utw;
1351
+ if ( $utw ) {
1352
+ $tags = $utw->GetCurrentTagSet();
1353
+ $tag = $tags[0]->tag;
1354
+ $tag = str_replace('-', ' ', $tag);
1355
+ } else {
1356
+ // wordpress > 2.3
1357
+ $tag = $this->internationalize( $this->get_original_title( '', false ) );
1358
+ }
1359
+ if ($tag) {
1360
+ if ( !empty( $aioseop_options['aiosp_cap_titles'] ) )
1361
+ $tag = $this->capitalize( $tag );
1362
+ $title_format = $aioseop_options['aiosp_tag_title_format'];
1363
+ $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo('name') ), $title_format );
1364
+ $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description') ), $title );
1365
+ $title = str_replace( '%tag%', $tag, $title );
1366
+ $title = $this->paged_title( $title );
1367
+ return $title;
1368
+ }
1369
+ } else if ( isset( $STagging ) && $STagging->is_tag_view() ) { // simple tagging support
1370
+ $tag = $STagging->search_tag;
1371
+ if ( $tag ) {
1372
+ if ( !empty( $aioseop_options['aiosp_cap_titles'] ) )
1373
+ $tag = $this->capitalize($tag);
1374
+ $title_format = $aioseop_options['aiosp_tag_title_format'];
1375
+ $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name') ), $title_format);
1376
+ $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description') ), $title);
1377
+ $title = str_replace( '%tag%', $tag, $title );
1378
+ $title = $this->paged_title( $title );
1379
+ return $title;
1380
+ }
1381
+ } else if ( is_archive() ) {
1382
+ $date = $this->internationalize( $this->get_original_title( '', false ) );
1383
+ $title_format = $aioseop_options['aiosp_archive_title_format'];
1384
+ $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
1385
+ $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
1386
+ $new_title = str_replace( '%date%', $date, $new_title );
1387
+ $title = trim( $new_title );
1388
+ $title = $this->paged_title( $title );
1389
+ return $title;
1390
+ } else if ( is_404() ) {
1391
+ $title_format = $aioseop_options['aiosp_404_title_format'];
1392
+ $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name') ), $title_format );
1393
+ $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
1394
+ $new_title = str_replace( '%request_url%', $_SERVER['REQUEST_URI'], $new_title );
1395
+ $new_title = str_replace( '%request_words%', $this->request_as_words( $_SERVER['REQUEST_URI'] ), $new_title );
1396
+ $new_title = str_replace( '%404_title%', $this->internationalize( $this->get_original_title( '', false ) ), $new_title );
1397
+ return $new_title;
1398
+ }
1399
+ return false;
1400
+ }
1401
+
1402
+ /*** Used to filter wp_title(), get our title. ***/
1403
+ function wp_title() {
1404
+ $title = false;
1405
+ $post = $this->get_queried_object();
1406
+ $title = $this->get_aioseop_title( $post );
1407
+ if ( $title === false )
1408
+ $title = $this->get_original_title();
1409
+ return apply_filters( 'aioseop_title', $title );
1410
+ }
1411
+
1412
+ /*** Used for forcing title rewrites. ***/
1413
+ function rewrite_title($header) {
1414
+ global $wp_query;
1415
+ if (!$wp_query) {
1416
+ $header .= "<!-- no wp_query found! -->\n";
1417
+ return $header;
1418
+ }
1419
+ $title = $this->wp_title();
1420
+ $header = $this->replace_title( $header, $title );
1421
+ return $header;
1422
+ }
1423
+
1424
+ /**
1425
+ * @return User-readable nice words for a given request.
1426
+ */
1427
+ function request_as_words( $request ) {
1428
+ $request = htmlspecialchars( $request );
1429
+ $request = str_replace( '.html', ' ', $request );
1430
+ $request = str_replace( '.htm', ' ', $request );
1431
+ $request = str_replace( '.', ' ', $request );
1432
+ $request = str_replace( '/', ' ', $request );
1433
+ $request_a = explode( ' ', $request );
1434
+ $request_new = array();
1435
+ foreach ( $request_a as $token ) {
1436
+ $request_new[] = ucwords( trim( $token ) );
1437
+ }
1438
+ $request = implode( ' ', $request_new );
1439
+ return $request;
1440
+ }
1441
+
1442
+ function capitalize( $s ) {
1443
+ $s = trim( $s );
1444
+ $tokens = explode( ' ', $s );
1445
+ while ( list( $key, $val ) = each( $tokens ) ) {
1446
+ $tokens[ $key ] = trim( $tokens[ $key ] );
1447
+ $tokens[ $key ] = $this->strtoupper( substr( $tokens[$key], 0, 1 ) ) . substr( $tokens[$key], 1 );
1448
+ }
1449
+ $s = implode( ' ', $tokens );
1450
+ return $s;
1451
+ }
1452
+
1453
+ function trim_excerpt_without_filters( $text, $max = 0 ) {
1454
+ $text = str_replace( ']]>', ']]&gt;', $text );
1455
+ $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
1456
+ $text = strip_tags( $text );
1457
+ if ( !$max ) $max = $this->maximum_description_length;
1458
+
1459
+ if ( $max < strlen( $text ) ) {
1460
+ while( $text[$max] != ' ' && $max > $this->minimum_description_length ) {
1461
+ $max--;
1462
+ }
1463
+ }
1464
+ $text = substr( $text, 0, $max );
1465
+ return trim( stripcslashes( $text ) );
1466
+ }
1467
+
1468
+ function trim_excerpt_without_filters_full_length( $text ) {
1469
+ $text = str_replace( ']]>', ']]&gt;', $text );
1470
+ $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
1471
+ $text = strip_tags( $text );
1472
+ return trim( stripcslashes( $text ) );
1473
+ }
1474
+
1475
+ /**
1476
+ * @return comma-separated list of unique keywords
1477
+ */
1478
+ function get_all_keywords() {
1479
+ global $posts;
1480
+ global $aioseop_options;
1481
+
1482
+ if ( is_404() ) return null;
1483
+
1484
+ // if we are on synthetic pages
1485
+ if ( !is_home() && !is_page() && !is_single() && !$this->is_static_front_page() && !$this->is_static_posts_page() )
1486
+ return null;
1487
+
1488
+ $keywords = array();
1489
+ if ( is_array( $posts ) ) {
1490
+ foreach ( $posts as $post ) {
1491
+ if ( $post ) {
1492
+ // custom field keywords
1493
+ $keywords_i = null;
1494
+
1495
+ $id = ( is_attachment() ) ? ( $post->post_parent ) : ( $post->ID ); // if attachment then use parent post id
1496
+ $keywords_i = stripcslashes( $this->internationalize( get_post_meta( $id, "_aioseop_keywords", true ) ) );
1497
+ $keywords_i = str_replace( '"', '', $keywords_i );
1498
+ if (isset( $keywords_i ) && !empty( $keywords_i ) ) {
1499
+ $traverse = explode( ',', $keywords_i );
1500
+ foreach ( $traverse as $keyword ) $keywords[] = $keyword;
1501
+ }
1502
+
1503
+ // WP 2.3 tags
1504
+ if ( !empty( $aioseop_options['aiosp_use_tags_as_keywords'] ) && function_exists( 'get_the_tags' ) ) {
1505
+ $tags = get_the_tags( $id );
1506
+ if ( $tags && is_array( $tags) )
1507
+ foreach ( $tags as $tag )
1508
+ $keywords[] = $this->internationalize( $tag->name );
1509
+ }
1510
+ // Ultimate Tag Warrior integration
1511
+ global $utw;
1512
+ if ( $utw ) {
1513
+ $tags = $utw->GetTagsForPost( $post );
1514
+ if ( is_array( $tags ) )
1515
+ foreach ( $tags as $tag ) {
1516
+ $tag = $tag->tag;
1517
+ $tag = str_replace( '_', ' ', $tag );
1518
+ $tag = str_replace( '-', ' ', $tag );
1519
+ $tag = stripcslashes( $tag );
1520
+ $keywords[] = $tag;
1521
+ }
1522
+ }
1523
+
1524
+ // autometa
1525
+ $autometa = stripcslashes( get_post_meta( $id, 'autometa', true ) );
1526
+ if ( isset( $autometa ) && !empty( $autometa ) ) {
1527
+ $autometa_array = explode( ' ', $autometa );
1528
+ foreach ( $autometa_array as $e )
1529
+ $keywords[] = $e;
1530
+ }
1531
+
1532
+ if ( $aioseop_options['aiosp_use_categories'] && !is_page() ) {
1533
+ $categories = get_the_category( $id );
1534
+ foreach ( $categories as $category )
1535
+ $keywords[] = $this->internationalize( $category->cat_name );
1536
+ }
1537
+ }
1538
+ }
1539
+ }
1540
+ return $this->get_unique_keywords($keywords);
1541
+ }
1542
+
1543
+ function get_meta_keywords() {
1544
+ global $posts;
1545
+
1546
+ $keywords = array();
1547
+ if (is_array( $posts) ) {
1548
+ foreach ( $posts as $post ) {
1549
+ if ( $post ) {
1550
+ // custom field keywords
1551
+ $keywords_i = null;
1552
+ $keywords_i = stripcslashes( get_post_meta( $post->ID, "_aioseop_keywords", true ) );
1553
+ $keywords_i = str_replace( '"', '', $keywords_i );
1554
+ if ( isset( $keywords_i) && !empty( $keywords_i ) )
1555
+ $keywords[] = $keywords_i;
1556
+ }
1557
+ }
1558
+ }
1559
+ return $this->get_unique_keywords( $keywords );
1560
+ }
1561
+
1562
+ function get_unique_keywords($keywords) {
1563
+ $small_keywords = array();
1564
+ foreach ( $keywords as $word )
1565
+ $small_keywords[] = $this->strtolower( $word );
1566
+
1567
+ $keywords_ar = array_unique( $small_keywords );
1568
+ return implode( ',', $keywords_ar );
1569
+ }
1570
+
1571
+ function log( $message ) {
1572
+ if ( $this->do_log ) {
1573
+ @error_log( date( 'Y-m-d H:i:s' ) . " " . $message . "\n", 3, $this->log_file );
1574
+ }
1575
+ }
1576
+
1577
+ function save_post_data( $id ) {
1578
+ $awmp_edit = $nonce = null;
1579
+ if ( isset( $_POST[ 'aiosp_edit' ] ) ) $awmp_edit = $_POST['aiosp_edit'];
1580
+ if ( isset( $_POST[ 'nonce-aioseop-edit' ] ) ) $nonce = $_POST['nonce-aioseop-edit'];
1581
+
1582
+ if ( isset($awmp_edit) && !empty($awmp_edit) && wp_verify_nonce($nonce, 'edit-aioseop-nonce') ) {
1583
+
1584
+ foreach ( Array( 'keywords', 'description', 'title', 'disable', 'disable_analytics', 'noindex', 'nofollow', 'titleatr', 'menulabel' ) as $f ) {
1585
+ $field = "aiosp_$f";
1586
+ if ( isset( $_POST[$field] ) ) $$field = $_POST[$field];
1587
+ }
1588
+
1589
+ delete_post_meta( $id, '_aioseop_keywords' );
1590
+ delete_post_meta( $id, '_aioseop_description' );
1591
+ delete_post_meta( $id, '_aioseop_noindex' );
1592
+ delete_post_meta( $id, '_aioseop_nofollow' );
1593
+ delete_post_meta( $id, '_aioseop_title' );
1594
+ delete_post_meta( $id, '_aioseop_titleatr' );
1595
+ delete_post_meta( $id, '_aioseop_menulabel' );
1596
+
1597
+ if ( $this->is_admin() ) {
1598
+ delete_post_meta($id, '_aioseop_disable' );
1599
+ delete_post_meta($id, '_aioseop_disable_analytics' );
1600
+ }
1601
+
1602
+ foreach ( Array( 'keywords', 'description', 'title', 'noindex', 'nofollow', 'titleatr', 'menulabel' ) as $f ) {
1603
+ $var = "aiosp_$f";
1604
+ $field = "_aioseop_$f";
1605
+ if ( isset( $$var ) && !empty( $$var ) )
1606
+ add_post_meta( $id, $field, $$var );
1607
+ }
1608
+
1609
+ if (isset( $aiosp_disable ) && !empty( $aiosp_disable ) && $this->is_admin() ) {
1610
+ add_post_meta( $id, '_aioseop_disable', $aiosp_disable );
1611
+ if (isset( $aiosp_disable_analytics ) && !empty( $aiosp_disable_analytics ) )
1612
+ add_post_meta( $id, '_aioseop_disable_analytics', $aiosp_disable_analytics );
1613
+ }
1614
+ }
1615
+ }
1616
+
1617
+ function display_tabbed_metabox( $post, $metabox ) {
1618
+ $tabs = $metabox['args'];
1619
+ echo '<div class="aioseop_tabs">';
1620
+ $header = $this->get_metabox_header( $tabs );
1621
+ echo $header;
1622
+ $active = "";
1623
+ foreach( $tabs as $m ) {
1624
+ echo '<div id="'.$m['id'].'" class="aioseop_tab"' . $active . '>';
1625
+ if ( !$active ) $active = ' style="display:none;"';
1626
+ $m['args'] = $m['callback_args'];
1627
+ $m['callback'][0]->{$m['callback'][1]}( $post, $m );
1628
+ echo '</div>';
1629
+ }
1630
+ echo '</div>';
1631
+ }
1632
+
1633
+ function admin_bar_menu() {
1634
+ global $wp_admin_bar, $aioseop_admin_menu, $aioseop_options;
1635
+ if ( !empty( $aioseop_options['aiosp_admin_bar'] ) ) {
1636
+ $menu_slug = plugin_basename( __FILE__ );
1637
+ if ( function_exists( 'menu_page_url' ) )
1638
+ $url = menu_page_url( $menu_slug, 0 );
1639
+ else
1640
+ $url = esc_url( admin_url( 'admin.php?page=' . $menu_slug ) );
1641
+ $wp_admin_bar->add_menu( array( 'id' => AIOSEOP_PLUGIN_DIRNAME, 'title' => __( 'AIOSEOP', 'all_in_one_seo_pack' ), 'href' => $url ) );
1642
+ $aioseop_admin_menu = 1;
1643
+ }
1644
+ }
1645
+
1646
+ function menu_order() {
1647
+ return 5;
1648
+ }
1649
+
1650
+ function admin_menu() {
1651
+ $file = plugin_basename( __FILE__ );
1652
+ $menu_name = __( 'All in One SEO', 'all_in_one_seo_pack' );
1653
+ add_menu_page( $menu_name, $menu_name, 'manage_options', $file, Array( $this, 'display_settings_page' ) );
1654
+ add_meta_box('aioseop-about', "About <span style='float:right;'>Version <b>" . AIOSEOP_VERSION . "</b></span>", array( $this, 'display_side_metaboxes'), 'aioseop_metaboxes', 'side', 'core');
1655
+ add_filter( 'custom_menu_order', '__return_true' );
1656
+ add_filter( 'menu_order', array( $this, 'set_menu_order' ) );
1657
+
1658
+ $this->locations['aiosp']['default_options']['nonce-aioseop-edit']['default'] = wp_create_nonce('edit-aioseop-nonce');
1659
+
1660
+ $this->update_options( );
1661
+
1662
+ $donated = false;
1663
+ if ( ( isset( $_POST ) ) && ( isset( $_POST['nonce-aioseop'] ) ) && ( wp_verify_nonce( $_POST['nonce-aioseop'], 'aioseop-nonce' ) ) ) {
1664
+ if ( isset( $_POST["aiosp_donate"] ) )
1665
+ $donated = $_POST["aiosp_donate"];
1666
+ } elseif ( isset( $this->options["aiosp_donate"] ) ) {
1667
+ $donated = $this->options["aiosp_donate"];
1668
+ }
1669
+
1670
+ if ( $donated ) {
1671
+ // Thank you for your donation
1672
+ $this->pointers['aioseop_donate'] = Array( 'pointer_target' => '#aiosp_donate_wrapper',
1673
+ 'pointer_text' => '<h3>' . __( 'Thank you!', 'all_in_one_seo_pack' )
1674
+ . '</h3><p>' . __( 'Thank you for your donation, it helps keep this plugin free and actively developed!', 'all_in_one_seo_pack' ) . '</p>'
1675
+ );
1676
+ }
1677
+
1678
+ if ( $this->options['aiosp_enablecpost'] ) {
1679
+ if ( !empty( $this->options['aiosp_cpostadvanced'] ) ) {
1680
+ $this->locations['aiosp']['display'] = $this->options['aiosp_cpostactive'];
1681
+ } else {
1682
+ $this->locations['aiosp']['display'] = get_post_types( '', 'names' );
1683
+ }
1684
+ } else {
1685
+ $this->locations['aiosp']['display'] = Array( 'post', 'page' );
1686
+ }
1687
+ add_action( 'aioseop_modules_add_menus', Array( $this, 'add_menu' ), 5 );
1688
+ do_action( 'aioseop_modules_add_menus', $file );
1689
+
1690
+ $metaboxes = apply_filters( 'aioseop_add_post_metabox', Array() );
1691
+
1692
+ if ( !empty( $metaboxes ) ) {
1693
+ if ( $this->tabbed_metaboxes ) {
1694
+ $tabs = Array();
1695
+ $tab_num = 0;
1696
+ foreach ( $metaboxes as $m ) {
1697
+ if ( !isset( $tabs[ $m['post_type'] ] ) ) $tabs[ $m['post_type'] ] = Array();
1698
+ $tabs[ $m['post_type'] ][] = $m;
1699
+ }
1700
+
1701
+ if ( !empty( $tabs ) ) {
1702
+ foreach( $tabs as $p => $m ) {
1703
+ $tab_num = count( $m );
1704
+ $title = $m[0]['title'];
1705
+ if ( $title != $this->plugin_name ) $title = $this->plugin_name . ' - ' . $title;
1706
+ if ( $tab_num == 1 ) {
1707
+ add_meta_box( $m[0]['id'], $title, $m[0]['callback'], $m[0]['post_type'], $m[0]['context'], $m[0]['priority'], $m[0]['callback_args'] );
1708
+ } elseif ( $tab_num > 1 ) {
1709
+ add_meta_box( $m[0]['id'] . '_tabbed', $title, Array( $this, 'display_tabbed_metabox' ), $m[0]['post_type'], $m[0]['context'], $m[0]['priority'], $m );
1710
+ }
1711
+ }
1712
+ }
1713
+ } else {
1714
+ foreach ( $metaboxes as $m ) {
1715
+ $title = $m['title'];
1716
+ if ( $title != $this->plugin_name ) $title = $this->plugin_name . ' - ' . $title;
1717
+ add_meta_box( $m['id'], $title, $m['callback'], $m['post_type'], $m['context'], $m['priority'], $m['callback_args'] );
1718
+ }
1719
+ }
1720
+ }
1721
+ }
1722
+
1723
+ function get_metabox_header( $tabs ) {
1724
+ $header = '<ul class="aioseop_header_tabs hide">';
1725
+ $active = ' active';
1726
+ foreach( $tabs as $t ) {
1727
+ if ( $active )
1728
+ $title = __( 'Main Settings', 'all_in_one_seo_pack' );
1729
+ else
1730
+ $title = $t['title'];
1731
+ $header .= '<li><label class="aioseop_header_nav"><a class="aioseop_header_tab' . $active . '" href="#'. $t['id'] .'">'.$title.'</a></label></li>';
1732
+ $active = '';
1733
+ }
1734
+ $header .= '</ul>';
1735
+ return $header;
1736
+ }
1737
+
1738
+ function set_menu_order( $menu_order ) {
1739
+ $order = array();
1740
+ $file = plugin_basename( __FILE__ );
1741
+ foreach ( $menu_order as $index => $item ) {
1742
+ if ( $item != $file ) $order[] = $item;
1743
+ if ( $index == 0 ) $order[] = $file;
1744
+ }
1745
+ return $order;
1746
+ }
1747
+
1748
+ function display_settings_header() { ?>
1749
+ <?php
1750
+ }
1751
+ function display_settings_footer( ) {
1752
+ }
1753
+
1754
+ function display_right_sidebar( ) { ?>
1755
+
1756
+ <?php
1757
+ /* <label class="aioseop_generic_label"><?php _e('Click on option titles to get help!', 'all_in_one_seo_pack' ); ?></label> */
1758
+ global $wpdb;
1759
+
1760
+ $somecount = $wpdb->get_var( "SELECT COUNT(1) FROM $wpdb->postmeta WHERE meta_key IN ('keywords', 'title', 'description', 'aiosp_meta', 'aiosp_disable' )" );
1761
+
1762
+ if( $somecount > 0) {
1763
+ echo "<div class='error' style='text-align:center;'>
1764
+ <p><strong>Your database meta needs to be updated. " . $somecount . " old fields remaining</strong> <em>(Back up your database before updating.)</em>
1765
+ <FORM action='' method='post' name='aioseop-migrate'>
1766
+ <input type='hidden' name='nonce-aioseop-migrate' value='" . wp_create_nonce('aioseop-migrate-nonce') . "' />
1767
+ <input type='submit' name='aioseop_migrate' class='button-primary' value='Update Database'>
1768
+ </FORM>
1769
+ </p></div>";
1770
+ }
1771
+
1772
+ if( !get_option( 'aioseop_options' ) ) {
1773
+ echo "<div class='error' style='text-align:center;'>
1774
+ <p><strong>Your database options need to be updated.</strong><em>(Back up your database before updating.)</em>
1775
+ <FORM action='' method='post' name='aioseop-migrate-options'>
1776
+ <input type='hidden' name='nonce-aioseop-migrate-options' value='" . wp_create_nonce( 'aioseop-migrate-nonce-options' ) . "' />
1777
+ <input type='submit' name='aioseop_migrate_options' class='button-primary' value='Update Database Options'>
1778
+ </FORM>
1779
+ </p></div>";
1780
+ }
1781
+
1782
+ ?>
1783
+ <style>
1784
+ #wpbody-content {
1785
+ min-width: 900px;
1786
+ }
1787
+ </style>
1788
+ <div class="aioseop_right_sidebar aioseop_options_wrapper">
1789
+
1790
+ <div class="aioseop_sidebar">
1791
+ <?php
1792
+ do_meta_boxes( 'aioseop_metaboxes', 'side', Array( 'test' ) );
1793
+ ?>
1794
+ <script type="text/javascript">
1795
+ //<![CDATA[
1796
+ jQuery(document).ready( function($) {
1797
+ // close postboxes that should be closed
1798
+ $('.if-js-closed').removeClass('if-js-closed').addClass('closed');
1799
+ // postboxes setup
1800
+ postboxes.add_postbox_toggles('<?php echo $this->pagehook; ?>');
1801
+ $('.meta-box-sortables').removeClass('meta-box-sortables');
1802
+ });
1803
+ //]]>
1804
+ </script>
1805
+
1806
+ <!-- Headway Themes-->
1807
+ <div class="aioseop_advert">
1808
+ <div>
1809
+ <h3>Drag and Drop WordPress Design</h3>
1810
+ <p><a href="http://semperfiwebdesign.com/headwayaio/" target="_blank">Headway Themes</a> allows you to easily create your own stunning website designs! Stop using premade themes start making your own design with Headway's easy to use Drag and Drop interface. All in One SEO Pack users have an exclusive discount by using coupon code <strong>SEMPERFI30</strong> at checkout.</p>
1811
+ </div>
1812
+ <a href="http://semperfiwebdesign.com/headwayaio/" target="_blank"><img src="<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>headwaybanner.png"></a>
1813
+ </div>
1814
+ </div>
1815
+ </div>
1816
+ <?php
1817
+ }
1818
+ }
1819
+
aioseop_feature_manager.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package All-in-One-SEO-Pack
4
+ */
5
+ /**
6
+ * The Feature Manager class.
7
+ */
8
+ if ( !class_exists( 'All_in_One_SEO_Pack_Feature_Manager' ) ) {
9
+ class All_in_One_SEO_Pack_Feature_Manager extends All_in_One_SEO_Pack_Module {
10
+
11
+ protected $module_info = Array( );
12
+
13
+ function All_in_One_SEO_Pack_Feature_Manager( $mod ) {
14
+ $this->name = __('Feature Manager', 'all_in_one_seo_pack'); // Human-readable name of the plugin
15
+ $this->prefix = 'aiosp_feature_manager_'; // option prefix
16
+ $this->file = __FILE__; // the current file
17
+ parent::__construct();
18
+ $this->module_info = Array( 'performance' => Array( 'name' => __( 'Performance', 'all_in_one_seo_pack' ),
19
+ 'description' => __( 'Optimize performance related to SEO and check your system status.', 'all_in_one_seo_pack' ),
20
+ 'default' => 'on'),
21
+ 'coming_soon' => Array( 'name' => __( 'Coming Soon...', 'all_in_one_seo_pack' ),
22
+ 'description' => __( 'XML Sitemaps', 'all_in_one_seo_pack' ),
23
+ 'save' => false ) );
24
+
25
+ // Set up default settings fields
26
+ // name - Human-readable name of the setting
27
+ // help_text - Inline documentation for the setting
28
+ // type - Type of field; this defaults to checkbox; currently supported types are checkbox, text, select, multiselect
29
+ // default - Default value of the field
30
+ // initial_options - Initial option list used for selects and multiselects
31
+ // Other supported options: class, id, style -- allows you to set these HTML attributes on the field
32
+
33
+ $this->default_options = array();
34
+ $this->module_info = apply_filters( 'aioseop_module_info', $this->module_info );
35
+ $mod[] = 'coming_soon';
36
+
37
+ foreach ( $mod as $m ) {
38
+ $module_name = ucwords( strtr( $m, '_', ' ' ) );
39
+ $this->default_options["enable_$m"] = Array( 'name' => $this->module_info[$m]['name'],
40
+ 'help_text' => $this->module_info[$m]['description'],
41
+ 'type' => 'custom',
42
+ 'class' => 'aioseop_feature',
43
+ 'id' => "aioseop_$m",
44
+ 'save' => true );
45
+
46
+ if ( !empty( $this->module_info[$m]['image'] ) )
47
+ $this->default_options["enable_$m"]['image'] = $this->module_info[$m]['image'];
48
+ if ( !empty( $this->module_info[$m] ) )
49
+ foreach( Array( 'save', 'default' ) as $option )
50
+ if ( isset( $this->module_info[$m][$option] ) )
51
+ $this->default_options["enable_$m"][$option] = $this->module_info[$m][$option];
52
+ }
53
+
54
+ // load initial options / set defaults
55
+ $this->update_options( );
56
+ add_filter( $this->prefix . 'output_option', Array( $this, 'display_option_div' ), 10, 2 );
57
+ add_filter( $this->prefix . 'submit_options', Array( $this, 'filter_submit' ) );
58
+ }
59
+
60
+ function menu_order() {
61
+ return 20;
62
+ }
63
+
64
+ function filter_submit( $submit, $location = null ) {
65
+ $submit['Submit']['value'] = __( 'Update Features', 'all_in_one_seo_pack' ) . ' &raquo;';
66
+ $submit['Submit']['class'] .= " hidden";
67
+ $submit['Submit_Default']['value'] = __( 'Reset Features', 'all_in_one_seo_pack' ) . ' &raquo;';
68
+ return $submit;
69
+ }
70
+
71
+ function display_option_div( $buf, $args ) {
72
+ $name = $img = $desc = $checkbox = $class = '';
73
+ if ( isset( $args['options']['help_text'] ) && !empty( $args['options']['help_text'] ) )
74
+ $desc .= '<p class="aioseop_desc">' . $args['options']['help_text'] . '</p>';
75
+ if ($args['value']) $class = ' active';
76
+ if ( isset( $args['options']['image'] ) && !empty( $args['options']['image'] ) )
77
+ $img .= '<p><img src="' . AIOSEOP_PLUGIN_IMAGES_URL . $args['options']['image'] . '"></p>';
78
+ else
79
+ $img .= '<p><span class="aioseop_featured_image' . $class . '"></span></p>';
80
+
81
+ if ( $args['options']['save'] ) {
82
+ $name = "<h3>{$args['options']['name']}</h3>";
83
+ $checkbox .= '<input type="checkbox" onchange="jQuery(\'#' . $args["options"]["id"] . ' .aioseop_featured_image, #' . $args["options"]["id"] . ' .feature_button\').toggleClass(\'active\', this.checked);jQuery(\'input[name=Submit]\').trigger(\'click\');" style="display:none;" id="' . $args['name'] . '" name="' . $args['name'] . '"';
84
+ if ($args['value']) $checkbox .= " CHECKED";
85
+ $checkbox .= '><span class="button-primary feature_button' . $class . '"></span>';
86
+ } else {
87
+ $name = "<b>{$args['options']['name']}</b>";
88
+ }
89
+ if ( !empty( $args['options']['id'] ) ) $args['attr'] .= " id='{$args['options']['id']}'";
90
+ return $buf . "<div {$args['attr']}><label for='{$args['name']}'>{$name}{$img}{$desc}{$checkbox}</label></div>";
91
+ }
92
+ }
93
+ }
aioseop_functions.php CHANGED
@@ -1,192 +1,206 @@
1
  <?php
2
  /**
3
- * @package All-in-One-SEO-Pack
4
  */
 
 
 
 
 
 
 
 
 
 
 
5
 
6
- /** Ajax callback functions for quickedit functionality */
7
- //add_action( 'wp_ajax_aioseop_ajax_save_meta', 'aioseop_ajax_save_meta');
8
-
9
- if (!function_exists('aioseop_activate')) {
10
  function aioseop_activate() {
11
  global $aiosp_activation;
12
  $aiosp_activation = true;
13
  }
14
  }
15
 
16
- if (!function_exists('aioseop_update_settings_check')) {
 
 
 
17
  function aioseop_update_settings_check() {
18
- if(isset($_POST['aioseop_migrate'])) aioseop_mrt_fix_meta();
 
19
  if ( ( isset( $_POST['aioseop_migrate_options'] ) ) ||
20
- ( !get_option( 'aiosp_post_title_format' ) && !get_option('aioseop_options') ) ) {
21
  aioseop_mrt_mkarry();
22
  }
 
 
23
  }
24
  }
25
 
26
- if (!function_exists('aioseop_class_defined_error')) {
27
- function aioseop_class_defined_error() {
28
- $aioseop_class_error = "The All in One SEO Pack class is already defined";
29
- if ( class_exists( 'ReflectionClass' ) ) {
30
- $r = new ReflectionClass( 'All_in_One_SEO_Pack' );
31
- $aioseop_class_error .= " in " . $r->getFileName();
32
- }
33
- $aioseop_class_error .= ", preventing All in One SEO Pack from loading.";
34
- echo "<div class='error'>$aioseop_class_error</div>";
35
- }
36
- }
37
-
38
- if (!function_exists('aioseop_mrt_fix_meta')) {
39
- function aioseop_mrt_fix_meta(){
40
  global $wpdb, $aiosp_activation;
41
- $wpdb->query("UPDATE $wpdb->postmeta SET meta_key = '_aioseop_keywords' WHERE meta_key = 'keywords'");
42
- $wpdb->query("UPDATE $wpdb->postmeta SET meta_key = '_aioseop_title' WHERE meta_key = 'title'");
43
- $wpdb->query("UPDATE $wpdb->postmeta SET meta_key = '_aioseop_description' WHERE meta_key = 'description'");
44
- $wpdb->query("UPDATE $wpdb->postmeta SET meta_key = '_aioseop_meta' WHERE meta_key = 'aiosp_meta'");
45
- $wpdb->query("UPDATE $wpdb->postmeta SET meta_key = '_aioseop_disable' WHERE meta_key = 'aiosp_disable'");
46
  if ( !$aiosp_activation ) // don't echo on initial plugin activation
47
  echo "<div class='updated fade' style='background-color:green;border-color:green;'><p><strong>" . __( "Updating SEO post meta in database.", 'all_in_one_seo_pack' ) . "</strong></p></div>";
48
  }
49
  }
50
 
51
- if (!function_exists('aioseop_mrt_mkarry')) {
 
 
 
52
  function aioseop_mrt_mkarry() {
53
  global $aiosp;
54
- $naioseop_options = array(
55
- "aiosp_can"=>1,
56
- "aiosp_donate"=>0,
57
- "aiosp_home_title"=>null,
58
- "aiosp_home_description"=>'',
59
- "aiosp_home_keywords"=>null,
60
- "aiosp_max_words_excerpt"=>'something',
61
- "aiosp_rewrite_titles"=>1,
62
- "aiosp_post_title_format"=>'%post_title% | %blog_title%',
63
- "aiosp_page_title_format"=>'%page_title% | %blog_title%',
64
- "aiosp_category_title_format"=>'%category_title% | %blog_title%',
65
- "aiosp_archive_title_format"=>'%date% | %blog_title%',
66
- "aiosp_tag_title_format"=>'%tag% | %blog_title%',
67
- "aiosp_search_title_format"=>'%search% | %blog_title%',
68
- "aiosp_description_format"=>'%description%',
69
- "aiosp_404_title_format"=>'Nothing found for %request_words%',
70
- "aiosp_paged_format"=>' - Part %page%',
71
- "aiosp_google_analytics_id"=>null,
72
- "aiosp_ga_track_outbound_links"=>0,
73
- "aiosp_use_categories"=>0,
74
- "aiosp_dynamic_postspage_keywords"=>1,
75
- "aiosp_category_noindex"=>0,
76
- "aiosp_archive_noindex"=>0,
77
- "aiosp_tags_noindex"=>0,
78
- "aiosp_cap_cats"=>1,
79
- "aiosp_generate_descriptions"=>0,
80
- "aiosp_debug_info"=>null,
81
- "aiosp_post_meta_tags"=>'',
82
- "aiosp_page_meta_tags"=>'',
83
- "aiosp_home_meta_tags"=>'',
84
- "aiosp_enabled" =>0,
85
- "aiosp_enablecpost" => 0,
86
- "aiosp_use_tags_as_keywords" =>1,
87
- "aiosp_seopostcol" =>1,
88
- "aiosp_seocustptcol" => 0,
89
- "aiosp_posttypecolumns" => array('post','page'),
90
- "aiosp_do_log"=>null);
91
-
92
- if(get_option('aiosp_post_title_format')){
93
  foreach( $naioseop_options as $aioseop_opt_name => $value ) {
94
- if( $aioseop_oldval = get_option($aioseop_opt_name) ) {
95
  $naioseop_options[$aioseop_opt_name] = $aioseop_oldval;
96
  }
97
- if( $aioseop_oldval == '') {
98
  $naioseop_options[$aioseop_opt_name] = '';
99
  }
100
- delete_option($aioseop_opt_name);
101
  }
102
  }
103
-
104
- add_option('aioseop_options',$naioseop_options);
105
- }
106
- }
107
-
108
- if (!function_exists('aioseop_activation_notice')) {
109
- function aioseop_activation_notice() {
110
- global $aioseop_options;
111
- echo '<div class="error fade"><p><strong>' . __('All in One SEO Pack must be configured.', 'all_in_one_seo_pack' )
112
- . ' ' . sprintf( __('Go to %s to enable and configure the plugin.', 'all_in_one_seo_pack' ), '<a href="'
113
- . admin_url( 'options-general.php?page=' . AIOSEOP_PLUGIN_DIRNAME . '/aioseop.class.php' ) . '">'
114
- . __('the admin page', 'all_in_one_seo_pack') . '</a>' ) . '</strong><br />'
115
- . __( 'All in One SEO Pack now supports Custom Post Types and Google Analytics.', 'all_in_one_seo_pack' ) . '</p></div>';
116
  }
117
  }
118
 
119
- if (!function_exists('aioseop_activate_pl')) {
120
- function aioseop_activate_pl(){
121
- if(get_option('aioseop_options')){
122
- $aioseop_options = get_option('aioseop_options');
123
  $aioseop_options['aiosp_enabled'] = "0";
124
 
125
- if(!$aioseop_options['aiosp_posttypecolumns']){
126
  $aioseop_options['aiosp_posttypecolumns'] = array('post','page');
127
  }
128
 
129
- update_option('aioseop_options',$aioseop_options);
130
  }
131
  }
132
  }
133
 
134
- if (!function_exists('aioseop_get_version')) {
135
- function aioseop_get_version(){
136
  return AIOSEOP_VERSION;
137
  }
138
  }
139
 
140
- if (!function_exists('aioseop_add_plugin_row')) {
141
- function aioseop_add_plugin_row($links, $file) {
142
- echo '<td colspan="5" style="background-color:yellow;">';
143
- echo wp_remote_fopen('http://aioseoppro.semperfiwebdesign.com/');
144
- echo '</td>';
145
- }
146
- }
147
-
148
- if (!function_exists('aioseop_option_isset')) {
149
  function aioseop_option_isset( $option ) {
150
  global $aioseop_options;
151
  return ( ( isset( $aioseop_options[$option] ) ) && $aioseop_options[$option] );
152
  }
153
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
 
155
- if (!function_exists('aioseop_addmycolumns')) {
156
- function aioseop_addmycolumns(){
157
- $aioseop_options = get_option('aioseop_options');
158
  $aiosp_posttypecolumns = $aioseop_options['aiosp_posttypecolumns'];
159
 
160
- if ( !isset($_GET['post_type']) )
161
  $post_type = 'post';
162
- else $post_type = $_GET['post_type'];
163
- add_action( 'admin_head', 'aioseop_admin_head');
 
164
 
165
- if(is_array($aiosp_posttypecolumns) && in_array($post_type,$aiosp_posttypecolumns)) {
166
- if($post_type == 'page'){
167
- add_action('manage_pages_custom_column', 'aioseop_mrt_pccolumn', 10, 2);
168
- add_filter('manage_pages_columns', 'aioseop_mrt_pcolumns');
169
- } else {
170
- add_action('manage_posts_custom_column', 'aioseop_mrt_pccolumn', 10, 2);
171
- add_filter('manage_posts_columns', 'aioseop_mrt_pcolumns');
172
- }
 
173
  }
174
  }
175
  }
176
 
177
- if (!function_exists('aioseop_mrt_pcolumns')) {
178
- function aioseop_mrt_pcolumns($aioseopc) {
179
  global $aioseop_options;
180
- $aioseopc['seotitle'] = __('SEO Title');
181
- $aioseopc['seokeywords'] = __('SEO Keywords');
182
- $aioseopc['seodesc'] = __('SEO Description');
183
- return $aioseopc;
184
  }
185
  }
186
 
187
- if (!function_exists('aioseop_admin_head')) {
188
  function aioseop_admin_head() {
189
- // echo '<script type="text/javascript" src="' . AIOSEOP_PLUGIN_URL . 'quickedit_functions.js" ></script>';
190
  ?><style>
191
  .aioseop_edit_button {
192
  margin: 0 0 0 5px;
@@ -216,10 +230,10 @@ if (!function_exists('aioseop_admin_head')) {
216
  pluginPath: "<?php print AIOSEOP_PLUGIN_DIR; ?>",
217
  pluginUrl: "<?php print AIOSEOP_PLUGIN_URL; ?>",
218
  requestUrl: "<?php print WP_ADMIN_URL . '/admin-ajax.php' ?>",
219
- imgUrl: "<?php print AIOSEOP_PLUGIN_IMAGES_URL; ?>",
220
- Edit: "Edit", Post: "Post", Save: "Save", Cancel: "Cancel", postType: "post",
221
- pleaseWait: "Please wait...", slugEmpty: "Slug may not be empty!",
222
- Revisions: "Post Revisions", Time: "Insert time"
223
  }
224
  //]]>
225
  </script>
@@ -227,15 +241,16 @@ if (!function_exists('aioseop_admin_head')) {
227
  }
228
  }
229
 
230
- if (!function_exists('aioseop_ajax_save_meta')) {
231
  function aioseop_ajax_save_meta() {
 
232
  $post_id = intval( $_POST['post_id'] );
233
  $new_meta = $_POST['new_meta'];
234
  $target = $_POST['target_meta'];
235
- update_post_meta( $post_id, '_aioseop_' . $target, $new_meta );
236
  $result = get_post_meta( $post_id, '_aioseop_' . $target, true );
237
  if( $result != '' ): $label = $result;
238
- else: $label = ''; $result = '<strong><i>No ' . $target . '</i></strong>' ; endif;
239
  $output = $result . '<a id="' . $target . 'editlink' . $post_id . '" href="javascript:void(0);"';
240
  $output .= 'onclick="aioseop_ajax_edit_meta_form(' . $post_id . ', \'' . $label . '\', \'' . $target . '\');return false;" title="' . __('Edit') . '">';
241
  $output .= '<img class="aioseop_edit_button" id="aioseop_edit_id" src="' . AIOSEOP_PLUGIN_IMAGES_URL . '/cog_edit.png" /></a>';
@@ -245,17 +260,45 @@ if (!function_exists('aioseop_ajax_save_meta')) {
245
  }
246
  }
247
 
248
- if (!function_exists('aioseop_mrt_pccolumn')) {
249
- function aioseop_mrt_pccolumn($aioseopcn, $aioseoppi) {
250
- if( $aioseopcn == 'seotitle' ) {
251
- echo htmlspecialchars(stripcslashes(get_post_meta($aioseoppi,'_aioseop_title',TRUE)));
252
- }
253
- if( $aioseopcn == 'seokeywords' ) {
254
- echo htmlspecialchars(stripcslashes(get_post_meta($aioseoppi,'_aioseop_keywords',TRUE)));
255
- }
256
- if( $aioseopcn == 'seodesc' ) {
257
- echo htmlspecialchars(stripcslashes(get_post_meta($aioseoppi,'_aioseop_description',TRUE)));
258
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
  }
260
  }
261
 
@@ -266,22 +309,59 @@ if ( !function_exists( 'aioseop_unprotect_meta' ) ) {
266
  }
267
  }
268
 
269
- if (!function_exists('aioseop_get_pages_start')) {
270
- function aioseop_get_pages_start($excludes) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
271
  global $aioseop_get_pages_start;
272
  $aioseop_get_pages_start = 1;
273
  return $excludes;
274
  }
275
  }
276
 
277
- if (!function_exists('aioseop_get_pages')) {
278
- function aioseop_get_pages($pages) {
279
  global $aioseop_get_pages_start;
280
- if (!$aioseop_get_pages_start) return $pages;
281
- foreach ($pages as $k => $v) {
282
  $postID = $v->ID;
283
- $menulabel = stripslashes(get_post_meta($postID, '_aioseop_menulabel', true));
284
- if ($menulabel) $pages[$k]->post_title = $menulabel;
285
  }
286
  $aioseop_get_pages_start = 0;
287
  return $pages;
@@ -289,7 +369,7 @@ if (!function_exists('aioseop_get_pages')) {
289
  }
290
 
291
  // The following two functions are GPLed from Sarah G's Page Menu Editor, http://wordpress.org/extend/plugins/page-menu-editor/.
292
- if (!function_exists('aioseop_list_pages')) {
293
  function aioseop_list_pages( $content ) {
294
  global $wp_version;
295
  $matches = array();
@@ -307,9 +387,8 @@ if (!function_exists('aioseop_list_pages')) {
307
  }
308
  }
309
 
310
- if (!function_exists('aioseop_filter_callback')) {
311
  function aioseop_filter_callback( $matches ) {
312
- global $wpdb;
313
  if ( $matches[1] && !empty( $matches[1] ) ) $postID = $matches[1];
314
  if ( empty( $postID ) ) $postID = get_option( "page_on_front" );
315
  $title_attrib = stripslashes( get_post_meta($postID, '_aioseop_titleatr', true ) );
@@ -319,111 +398,50 @@ if (!function_exists('aioseop_filter_callback')) {
319
  }
320
  }
321
 
322
- if ( !function_exists('aioseop_add_contactmethods' ) ) {
323
  function aioseop_add_contactmethods( $contactmethods ) {
324
- $contactmethods['googleplus'] = 'Google+';
325
  return $contactmethods;
326
  }
327
  }
328
 
329
- if (!function_exists('aioseop_meta_box_add')) {
330
- function aioseop_meta_box_add() {
331
- $mrt_aioseop_pts=get_post_types('','names');
332
- $aioseop_options = get_option('aioseop_options');
333
- $aioseop_mrt_cpt = $aioseop_options['aiosp_enablecpost'];
334
- foreach ($mrt_aioseop_pts as $mrt_aioseop_pt) {
335
- if($mrt_aioseop_pt == 'post' || $mrt_aioseop_pt == 'page' || $aioseop_mrt_cpt){
336
- add_meta_box('aiosp',__('All in One SEO Pack', 'all_in_one_seo_pack'),'aiosp_meta',$mrt_aioseop_pt);
337
- }
338
- }
 
339
  }
340
  }
341
 
342
- if (!function_exists('aiosp_meta')) {
343
- function aiosp_meta() {
344
- global $post;
345
- $post_id = $post;
346
- if (is_object($post_id)) $post_id = $post_id->ID;
347
- $keywords = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_keywords', true)));
348
- $title = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_title', true)));
349
- $description = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_description', true)));
350
- $aiosp_meta = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aiosp_meta', true)));
351
- $aiosp_disable = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_disable', true)));
352
- $aiosp_disable_analytics = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_disable_analytics', true)));
353
- $aiosp_titleatr = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_titleatr', true)));
354
- $aiosp_menulabel = htmlspecialchars(stripcslashes(get_post_meta($post_id, '_aioseop_menulabel', true)));
355
- ?>
356
- <SCRIPT LANGUAGE="JavaScript">
357
- <!-- Begin
358
- function countChars(field,cntfield) {
359
- cntfield.value = field.value.length;
360
- }
361
- // End -->
362
- </script>
363
- <input value="aiosp_edit" type="hidden" name="aiosp_edit" />
364
-
365
- <a target="__blank" href="http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/"><?php _e('Upgrade to All in One SEO Pack Pro Version', 'all_in_one_seo_pack') ?></a>
366
- <table style="margin-bottom:40px">
367
- <tr>
368
- <th style="text-align:left;" colspan="2">
369
- </th>
370
- </tr>
371
-
372
- <tr>
373
- <th scope="row" style="text-align:right;"><?php _e('Title:', 'all_in_one_seo_pack') ?></th>
374
- <td><input value="<?php echo $title ?>" type="text" name="aiosp_title" size="62" onKeyDown="countChars(document.post.aiosp_title,document.post.lengthT)" onKeyUp="countChars(document.post.aiosp_title,document.post.lengthT)"/><br />
375
- <input readonly type="text" name="lengthT" size="3" maxlength="3" style="text-align:center;" value="<?php echo strlen($title);?>" />
376
- <?php _e(' characters. Most search engines use a maximum of 60 chars for the title.', 'all_in_one_seo_pack') ?>
377
- </td>
378
- </tr>
379
-
380
- <tr>
381
- <th scope="row" style="text-align:right;"><?php _e('Description:', 'all_in_one_seo_pack') ?></th>
382
- <td><textarea name="aiosp_description" rows="3" cols="60"
383
- onKeyDown="countChars(document.post.aiosp_description,document.post.length1)"
384
- onKeyUp="countChars(document.post.aiosp_description,document.post.length1)"><?php echo $description ?></textarea><br />
385
- <input readonly type="text" name="length1" size="3" maxlength="3" value="<?php echo strlen($description);?>" />
386
- <?php _e(' characters. Most search engines use a maximum of 160 chars for the description.', 'all_in_one_seo_pack') ?>
387
- </td>
388
- </tr>
389
-
390
- <tr>
391
- <th scope="row" style="text-align:right;"><?php _e('Keywords (comma separated):', 'all_in_one_seo_pack') ?></th>
392
- <td><input value="<?php echo $keywords ?>" type="text" name="aiosp_keywords" size="62"/></td>
393
- </tr>
394
- <input type="hidden" name="nonce-aioseop-edit" value="<?php echo wp_create_nonce('edit-aioseop-nonce') ?>" />
395
- <?php if($post->post_type=='page'){ ?>
396
- <tr>
397
- <th scope="row" style="text-align:right;"><?php _e('Title Attribute:', 'all_in_one_seo_pack') ?></th>
398
- <td><input value="<?php echo $aiosp_titleatr ?>" type="text" name="aiosp_titleatr" size="62"/></td>
399
- </tr>
400
-
401
- <tr>
402
- <th scope="row" style="text-align:right;"><?php _e('Menu Label:', 'all_in_one_seo_pack') ?></th>
403
- <td><input value="<?php echo $aiosp_menulabel ?>" type="text" name="aiosp_menulabel" size="62"/></td>
404
- </tr>
405
- <?php } ?>
406
- <tr>
407
- <th scope="row" style="text-align:right; vertical-align:top;">
408
- <?php _e('Disable on this page/post:', 'all_in_one_seo_pack')?>
409
- </th>
410
- <td>
411
- <input type="checkbox" name="aiosp_disable" <?php if ($aiosp_disable) echo "checked=\"1\""; ?>/>
412
- </td>
413
- </tr>
414
 
415
- <?php if ( $aiosp_disable ) { ?>
416
- <tr>
417
- <th scope="row" style="text-align:right; vertical-align:top;">
418
- <?php _e('Disable Google Analytics:', 'all_in_one_seo_pack')?>
419
- </th>
420
- <td>
421
- <input type="checkbox" name="aiosp_disable_analytics" <?php if ($aiosp_disable_analytics) echo "checked=\"1\""; ?>/>
422
- </td>
423
- </tr>
424
- <?php } ?>
425
 
426
- </table>
427
- <?php
 
 
428
  }
429
  }
1
  <?php
2
  /**
3
+ * @package All-in-One-SEO-Pack
4
  */
5
+ /**
6
+ * Load the module manager.
7
+ */
8
+ if (!function_exists('aioseop_load_modules')) {
9
+ function aioseop_load_modules() {
10
+ global $aioseop_modules, $aioseop_module_list;
11
+ require_once( AIOSEOP_PLUGIN_DIR . 'aioseop_module_manager.php' );
12
+ $aioseop_modules = new All_in_One_SEO_Pack_Module_Manager( apply_filters( 'aioseop_module_list', $aioseop_module_list ) );
13
+ $aioseop_modules->load_modules();
14
+ }
15
+ }
16
 
17
+ /**
18
+ * Check if we just got activated.
19
+ */
20
+ if ( !function_exists( 'aioseop_activate' ) ) {
21
  function aioseop_activate() {
22
  global $aiosp_activation;
23
  $aiosp_activation = true;
24
  }
25
  }
26
 
27
+ /**
28
+ * Check if settings need to be updated / migrated from old version.
29
+ */
30
+ if ( !function_exists( 'aioseop_update_settings_check' ) ) {
31
  function aioseop_update_settings_check() {
32
+ global $aioseop_options;
33
+ if ( isset( $_POST['aioseop_migrate'] ) ) aioseop_mrt_fix_meta();
34
  if ( ( isset( $_POST['aioseop_migrate_options'] ) ) ||
35
+ ( empty( $aioseop_options ) ) ) {
36
  aioseop_mrt_mkarry();
37
  }
38
+ // WPML has now attached to filters, read settings again so they can be translated
39
+ $aioseop_options = get_option( 'aioseop_options' );
40
  }
41
  }
42
 
43
+ /**
44
+ * Update old settings to current format.
45
+ */
46
+ if ( !function_exists( 'aioseop_mrt_fix_meta' ) ) {
47
+ function aioseop_mrt_fix_meta() {
 
 
 
 
 
 
 
 
 
48
  global $wpdb, $aiosp_activation;
49
+ $wpdb->query( "UPDATE $wpdb->postmeta SET meta_key = '_aioseop_keywords' WHERE meta_key = 'keywords'" );
50
+ $wpdb->query( "UPDATE $wpdb->postmeta SET meta_key = '_aioseop_title' WHERE meta_key = 'title'" );
51
+ $wpdb->query( "UPDATE $wpdb->postmeta SET meta_key = '_aioseop_description' WHERE meta_key = 'description'" );
52
+ $wpdb->query( "UPDATE $wpdb->postmeta SET meta_key = '_aioseop_meta' WHERE meta_key = 'aiosp_meta'" );
53
+ $wpdb->query( "UPDATE $wpdb->postmeta SET meta_key = '_aioseop_disable' WHERE meta_key = 'aiosp_disable'" );
54
  if ( !$aiosp_activation ) // don't echo on initial plugin activation
55
  echo "<div class='updated fade' style='background-color:green;border-color:green;'><p><strong>" . __( "Updating SEO post meta in database.", 'all_in_one_seo_pack' ) . "</strong></p></div>";
56
  }
57
  }
58
 
59
+ /**
60
+ * Initialize settings to defaults.
61
+ */
62
+ if ( !function_exists( 'aioseop_mrt_mkarry' ) ) {
63
  function aioseop_mrt_mkarry() {
64
  global $aiosp;
65
+ global $aioseop_options;
66
+ $naioseop_options = $aiosp->default_options();
67
+
68
+ if( get_option( 'aiosp_post_title_format' ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  foreach( $naioseop_options as $aioseop_opt_name => $value ) {
70
+ if( $aioseop_oldval = get_option( $aioseop_opt_name ) ) {
71
  $naioseop_options[$aioseop_opt_name] = $aioseop_oldval;
72
  }
73
+ if( $aioseop_oldval == '' ) {
74
  $naioseop_options[$aioseop_opt_name] = '';
75
  }
76
+ delete_option( $aioseop_opt_name );
77
  }
78
  }
79
+ add_option( 'aioseop_options', $naioseop_options );
80
+ $aioseop_options = $naioseop_options;
 
 
 
 
 
 
 
 
 
 
 
81
  }
82
  }
83
 
84
+ if ( !function_exists( 'aioseop_activate_pl' ) ) {
85
+ function aioseop_activate_pl() {
86
+ if( $aioseop_options = get_option( 'aioseop_options' ) ) {
 
87
  $aioseop_options['aiosp_enabled'] = "0";
88
 
89
+ if( empty( $aioseop_options['aiosp_posttypecolumns'] ) ) {
90
  $aioseop_options['aiosp_posttypecolumns'] = array('post','page');
91
  }
92
 
93
+ update_option('aioseop_options', $aioseop_options);
94
  }
95
  }
96
  }
97
 
98
+ if ( !function_exists( 'aioseop_get_version' ) ) {
99
+ function aioseop_get_version() {
100
  return AIOSEOP_VERSION;
101
  }
102
  }
103
 
104
+ if ( !function_exists( 'aioseop_option_isset' ) ) {
 
 
 
 
 
 
 
 
105
  function aioseop_option_isset( $option ) {
106
  global $aioseop_options;
107
  return ( ( isset( $aioseop_options[$option] ) ) && $aioseop_options[$option] );
108
  }
109
  }
110
+ if ( !function_exists( 'aioseop_option_page_icon' ) ) {
111
+ function aioseop_option_page_icon() { ?>
112
+ <style>
113
+ #toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image {
114
+ background: url(<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>shield-sprite-16.png) no-repeat 6px 6px !important;
115
+ }
116
+ #toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image img {
117
+ display: none;
118
+ }
119
+ #toplevel_page_all-in-one-seo-pack-aioseop_class:hover .wp-menu-image, #toplevel_page_all-in-one-seo-pack-aioseop_class.wp-has-current-submenu .wp-menu-image {
120
+ background-position: 6px -26px !important;
121
+ }
122
+ #icon-aioseop.icon32 {
123
+ background: url(<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>shield32.png) no-repeat left top !important;
124
+ }
125
+ #aioseop_settings_header #message {
126
+ padding: 5px 0px 5px 50px;
127
+ background-image: url(<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>update32.png);
128
+ background-repeat: no-repeat;
129
+ background-position: 10px;
130
+ font-size: 14px;
131
+ min-height: 32px;
132
+ }
133
+
134
+ @media
135
+ only screen and (-webkit-min-device-pixel-ratio: 1.5),
136
+ only screen and ( min--moz-device-pixel-ratio: 1.5),
137
+ only screen and ( -o-min-device-pixel-ratio: 3/2),
138
+ only screen and ( min-device-pixel-ratio: 1.5),
139
+ only screen and ( min-resolution: 1.5dppx) {
140
+
141
+ #toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image {
142
+ background-image: url('<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>shield-sprite-32.png') !important;
143
+ -webkit-background-size: 16px 48px !important;
144
+ -moz-background-size: 16px 48px !important;
145
+ background-size: 16px 48px !important;
146
+ }
147
+
148
+ #icon-aioseop.icon32 {
149
+ background-image: url('<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>shield64.png') !important;
150
+ -webkit-background-size: 32px 32px !important;
151
+ -moz-background-size: 32px 32px !important;
152
+ background-size: 32px 32px !important;
153
+ }
154
+
155
+ #aioseop_settings_header #message {
156
+ background-image: url(<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>update64.png) !important;
157
+ -webkit-background-size: 32px 32px !important;
158
+ -moz-background-size: 32px 32px !important;
159
+ background-size: 32px 32px !important;
160
+ }
161
+ }
162
+ </style>
163
+ <?php
164
+ }
165
+ }
166
 
167
+ if ( !function_exists( 'aioseop_addmycolumns' ) ) {
168
+ function aioseop_addmycolumns() {
169
+ global $aioseop_options;
170
  $aiosp_posttypecolumns = $aioseop_options['aiosp_posttypecolumns'];
171
 
172
+ if ( !isset( $_GET['post_type'] ) )
173
  $post_type = 'post';
174
+ else
175
+ $post_type = $_GET['post_type'];
176
+ add_action( 'admin_head', 'aioseop_admin_head' );
177
 
178
+ if( is_array( $aiosp_posttypecolumns ) && in_array( $post_type, $aiosp_posttypecolumns ) ) {
179
+ if ( $post_type == 'page' )
180
+ add_filter( 'manage_pages_columns', 'aioseop_mrt_pcolumns' );
181
+ else
182
+ add_filter( 'manage_posts_columns', 'aioseop_mrt_pcolumns' );
183
+ if( is_post_type_hierarchical( $post_type ) )
184
+ add_action( 'manage_pages_custom_column', 'aioseop_mrt_pccolumn', 10, 2 );
185
+ else
186
+ add_action( 'manage_posts_custom_column', 'aioseop_mrt_pccolumn', 10, 2 );
187
  }
188
  }
189
  }
190
 
191
+ if ( !function_exists( 'aioseop_mrt_pcolumns' ) ) {
192
+ function aioseop_mrt_pcolumns( $aioseopc ) {
193
  global $aioseop_options;
194
+ $aioseopc['seotitle'] = __( 'SEO Title', 'all_in_one_seo_pack' );
195
+ if ($aioseop_options['aiosp_togglekeywords'] == 0) $aioseopc['seokeywords'] = __( 'SEO Keywords', 'all_in_one_seo_pack' );
196
+ $aioseopc['seodesc'] = __( 'SEO Description', 'all_in_one_seo_pack' );
197
+ return $aioseopc;
198
  }
199
  }
200
 
201
+ if ( !function_exists( 'aioseop_admin_head' ) ) {
202
  function aioseop_admin_head() {
203
+ echo '<script type="text/javascript" src="' . AIOSEOP_PLUGIN_URL . 'quickedit_functions.js" ></script>';
204
  ?><style>
205
  .aioseop_edit_button {
206
  margin: 0 0 0 5px;
230
  pluginPath: "<?php print AIOSEOP_PLUGIN_DIR; ?>",
231
  pluginUrl: "<?php print AIOSEOP_PLUGIN_URL; ?>",
232
  requestUrl: "<?php print WP_ADMIN_URL . '/admin-ajax.php' ?>",
233
+ imgUrl: "<?php print AIOSEOP_PLUGIN_IMAGES_URL; ?>",
234
+ Edit: "<?php _e( 'Edit', 'all_in_one_seo_pack'); ?>", Post: "<?php _e( 'Post', 'all_in_one_seo_pack'); ?>", Save: "<?php _e( 'Save', 'all_in_one_seo_pack'); ?>", Cancel: "<?php _e( 'Cancel', 'all_in_one_seo_pack'); ?>", postType: "post",
235
+ pleaseWait: "<?php _e( 'Please wait...', 'all_in_one_seo_pack'); ?>", slugEmpty: "<?php _e( 'Slug may not be empty!', 'all_in_one_seo_pack'); ?>",
236
+ Revisions: "<?php _e( 'Revisions', 'all_in_one_seo_pack'); ?>", Time: "<?php _e( 'Insert time', 'all_in_one_seo_pack'); ?>"
237
  }
238
  //]]>
239
  </script>
241
  }
242
  }
243
 
244
+ if ( !function_exists( 'aioseop_ajax_save_meta' ) ) {
245
  function aioseop_ajax_save_meta() {
246
+ check_ajax_referer( 'inlineeditnonce', '_inline_edit' );
247
  $post_id = intval( $_POST['post_id'] );
248
  $new_meta = $_POST['new_meta'];
249
  $target = $_POST['target_meta'];
250
+ update_post_meta( $post_id, '_aioseop_' . $target, esc_attr( $new_meta ) );
251
  $result = get_post_meta( $post_id, '_aioseop_' . $target, true );
252
  if( $result != '' ): $label = $result;
253
+ else: $label = ''; $result = '<strong><i>' . __( 'No', 'all_in_one_seo_pack' ) . ' ' . $target . '</i></strong>' ; endif;
254
  $output = $result . '<a id="' . $target . 'editlink' . $post_id . '" href="javascript:void(0);"';
255
  $output .= 'onclick="aioseop_ajax_edit_meta_form(' . $post_id . ', \'' . $label . '\', \'' . $target . '\');return false;" title="' . __('Edit') . '">';
256
  $output .= '<img class="aioseop_edit_button" id="aioseop_edit_id" src="' . AIOSEOP_PLUGIN_IMAGES_URL . '/cog_edit.png" /></a>';
260
  }
261
  }
262
 
263
+ if ( !function_exists( 'aioseop_ajax_init' ) ) {
264
+ function aioseop_ajax_init() {
265
+ if ( !empty( $_POST ) && !empty( $_POST['settings'] ) && !empty( $_POST['nonce-aioseop']) && !empty( $_POST['options'] ) ) {
266
+ $_POST = stripslashes_deep( $_POST );
267
+ $settings = esc_attr( $_POST['settings'] );
268
+ if ( ! defined( 'AIOSEOP_AJAX_MSG_TMPL' ) )
269
+ define( 'AIOSEOP_AJAX_MSG_TMPL', "jQuery('div#aiosp_$settings').fadeOut('fast', function(){jQuery('div#aiosp_$settings').html('%s').fadeIn('fast');});" );
270
+ if ( !wp_verify_nonce($_POST['nonce-aioseop'], 'aioseop-nonce') ) die( sprintf( AIOSEOP_AJAX_MSG_TMPL, __( "Unauthorized access; try reloading the page.", 'all_in_one_seo_pack' ) ) );
271
+ } else {
272
+ die(0);
273
  }
274
+ }
275
+ }
276
+
277
+ if ( !function_exists( 'aioseop_mrt_pccolumn' ) ) {
278
+ function aioseop_mrt_pccolumn($aioseopcn, $aioseoppi) {
279
+ $id = $aioseoppi;
280
+ $target = null;
281
+ if( $aioseopcn == 'seotitle' ) $target = 'title';
282
+ if( $aioseopcn == 'seokeywords' ) $target = 'keywords';
283
+ if( $aioseopcn == 'seodesc' ) $target = 'description';
284
+ if ( !$target ) return;
285
+ if( current_user_can( 'edit_post', $id ) ) { ?>
286
+ <div class="aioseop_mpc_admin_meta_container">
287
+ <div class="aioseop_mpc_admin_meta_options"
288
+ id="aioseop_<?php print $target; ?>_<?php echo $id; ?>"
289
+ style="float:left;">
290
+ <?php $content = htmlspecialchars( stripcslashes( get_post_meta( $id, "_aioseop_" . $target, TRUE ) ) );
291
+ if( !empty($content) ): $label = str_replace( "'", "\'", $content );
292
+ else: $label = ''; $content = '<strong><i>No ' . $target . '</i></strong>' ; endif;
293
+ print $content . '<a id="' . $target . 'editlink' . $id . '" href="javascript:void(0);" onclick="aioseop_ajax_edit_meta_form(' .
294
+ $id . ', \'' . $label . '\', \'' . $target . '\');return false;" title="' . __('Edit') . '">';
295
+ print "<img class='aioseop_edit_button'
296
+ id='aioseop_edit_id'
297
+ src='" . AIOSEOP_PLUGIN_IMAGES_URL . "cog_edit.png' /></a>";
298
+ ?>
299
+ </div>
300
+ </div>
301
+ <?php }
302
  }
303
  }
304
 
309
  }
310
  }
311
 
312
+ if ( !function_exists( 'aioseop_mrt_exclude_this_page' ) ) {
313
+ function aioseop_mrt_exclude_this_page( $url = null ) {
314
+ static $excluded = false;
315
+ if ( $excluded === false ) {
316
+ global $aioseop_options;
317
+ $ex_pages = '';
318
+ if ( isset( $aioseop_options['aiosp_ex_pages'] ) )
319
+ $ex_pages = trim( $aioseop_options['aiosp_ex_pages'] );
320
+ if ( !empty( $ex_pages ) ) {
321
+ $excluded = explode( ',', $ex_pages );
322
+ if ( !empty( $excluded ) )
323
+ foreach( $excluded as $k => $v ) {
324
+ $excluded[$k] = trim( $v );
325
+ if ( empty( $excluded[$k] ) ) unset( $excluded[$k] );
326
+ }
327
+ if ( empty( $excluded ) ) $excluded = null;
328
+ }
329
+ }
330
+ if ( !empty( $excluded ) ) {
331
+ if ( $url === null )
332
+ $url = $_SERVER['REQUEST_URI'];
333
+ else {
334
+ $url = parse_url( $url );
335
+ if ( !empty( $url['path'] ) )
336
+ $url = $url['path'];
337
+ else
338
+ return false;
339
+ }
340
+ if ( !empty( $url ) )
341
+ foreach( $excluded as $exedd )
342
+ if ( ( $exedd ) && ( stripos( $url, $exedd ) !== FALSE ) )
343
+ return true;
344
+ }
345
+ return false;
346
+ }
347
+ }
348
+
349
+ if ( !function_exists( 'aioseop_get_pages_start' ) ) {
350
+ function aioseop_get_pages_start( $excludes ) {
351
  global $aioseop_get_pages_start;
352
  $aioseop_get_pages_start = 1;
353
  return $excludes;
354
  }
355
  }
356
 
357
+ if ( !function_exists( 'aioseop_get_pages' ) ) {
358
+ function aioseop_get_pages( $pages ) {
359
  global $aioseop_get_pages_start;
360
+ if ( !$aioseop_get_pages_start ) return $pages;
361
+ foreach ( $pages as $k => $v ) {
362
  $postID = $v->ID;
363
+ $menulabel = stripslashes( get_post_meta( $postID, '_aioseop_menulabel', true ) );
364
+ if ( $menulabel ) $pages[$k]->post_title = $menulabel;
365
  }
366
  $aioseop_get_pages_start = 0;
367
  return $pages;
369
  }
370
 
371
  // The following two functions are GPLed from Sarah G's Page Menu Editor, http://wordpress.org/extend/plugins/page-menu-editor/.
372
+ if ( !function_exists( 'aioseop_list_pages' ) ) {
373
  function aioseop_list_pages( $content ) {
374
  global $wp_version;
375
  $matches = array();
387
  }
388
  }
389
 
390
+ if ( !function_exists( 'aioseop_filter_callback' ) ) {
391
  function aioseop_filter_callback( $matches ) {
 
392
  if ( $matches[1] && !empty( $matches[1] ) ) $postID = $matches[1];
393
  if ( empty( $postID ) ) $postID = get_option( "page_on_front" );
394
  $title_attrib = stripslashes( get_post_meta($postID, '_aioseop_titleatr', true ) );
398
  }
399
  }
400
 
401
+ if ( !function_exists( 'aioseop_add_contactmethods' ) ) {
402
  function aioseop_add_contactmethods( $contactmethods ) {
403
+ $contactmethods['googleplus'] = __( 'Google+', 'all_in_one_seo_pack' );
404
  return $contactmethods;
405
  }
406
  }
407
 
408
+ /***
409
+ * Backwards compatibility - see http://php.net/manual/en/function.str-getcsv.php
410
+ */
411
+ if( !function_exists( 'str_getcsv' ) ) {
412
+ function str_getcsv( $input, $delimiter = ",", $enclosure = '"', $escape = "\\" ) {
413
+ $fp = fopen( "php://memory", 'r+' );
414
+ fputs( $fp, $input );
415
+ rewind( $fp );
416
+ $data = fgetcsv( $fp, null, $delimiter, $enclosure ); // $escape only got added in 5.3.0
417
+ fclose( $fp );
418
+ return $data;
419
  }
420
  }
421
 
422
+ /***
423
+ * JSON support for PHP < 5.2
424
+ */
425
+ if ( !function_exists( 'aioseop_load_json_services' ) ) {
426
+ function aioseop_load_json_services() {
427
+ static $services_json = null;
428
+ if ( $services_json ) return $services_json;
429
+ if ( !class_exists( 'Services_JSON' ) ) require_once( 'JSON.php' );
430
+ if ( !$services_json ) $services_json = new Services_JSON();
431
+ return $services_json;
432
+ }
433
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
434
 
435
+ if ( !function_exists( 'json_encode' ) ) {
436
+ function json_encode( $arg ) {
437
+ $services_json = aioseop_load_json_services();
438
+ return $services_json->encode( $arg );
439
+ }
440
+ }
 
 
 
 
441
 
442
+ if ( !function_exists( 'json_decode' ) ) {
443
+ function json_decode( $arg ) {
444
+ $services_json = aioseop_load_json_services();
445
+ return $services_json->decode( $arg );
446
  }
447
  }
aioseop_module-rtl.css ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .form-table.aioseop th {
2
+ padding: 10px 9px 12px 0;
3
+ }
4
+ .aioseop_help_text_link, .aioseop_help_text_link:active {
5
+ text-align: right;
6
+ float: right;
7
+ background: url('images/question.png') no-repeat top right;
8
+ }
9
+ .aioseop_help_text_link img {
10
+ float: right;
11
+ }
12
+ .aioseop_label {
13
+ padding-right: 50px;
14
+ padding-left: 10px;
15
+ text-align: right;
16
+ }
17
+ .aioseop input[type="text"] {
18
+ padding: 10px 10px 10px 0px;
19
+ }
20
+ .aioseop textarea {
21
+ padding: 10px 10px 0px 0px;
22
+ }
23
+ .aioseop_help_text_div {
24
+ text-align:right;
25
+ margin: 10px 0px 10px 0px;
26
+ }
27
+ .aioseop_help_text {
28
+ float: right;
29
+ clear: right;
30
+ font-style: normal;
31
+ }
32
+
33
+ .aioseop_head_nav {
34
+ float: right;
35
+ }
36
+ .aioseop_head_nav_tab {
37
+ margin: 0 15px 0 0;
38
+ border-width: 1px 1px 0;
39
+ border-radius: 4px 0 0px 4px;
40
+ float: right;
41
+ }
42
+
43
+ .aioseop_head_nav_tab:first-child {
44
+ margin-right: 0px;
45
+ margin-left: auto;
46
+ }
47
+ .aioseop_header {
48
+ float: right;
49
+ clear: right;
50
+ }
51
+
52
+ .aioseop_adverts {
53
+ float: left;
54
+ }
55
+ .aioseop_content {
56
+ clear: right;
57
+ }
58
+ #aiosp_feature_manager_metabox.postbox {
59
+ float: right;
60
+ }
61
+ .aioseop_sidebar {
62
+ width: 457px;
63
+ margin-right: 10px;
64
+ margin-left: auto;
65
+ }
66
+ .aioseop_option_label {
67
+ float: right;
68
+ margin: 0px 5px 10px 0;
69
+ }
70
+ .aioseop_settings_left {
71
+ float: right;
72
+ }
73
+
74
+ .aioseop_right_sidebar {
75
+ float: left;
76
+ }
77
+
78
+ .aioseop_input {
79
+ clear: right;
80
+ }
81
+ .aioseop_option_input {
82
+ float: right;
83
+ width: 61%;
84
+ padding-right: 1px;
85
+ padding-left: 0px;
86
+ }
87
+ #aiosp_sitemap_addl_pages {
88
+ clear: right;
89
+ margin-right: 20px;
90
+ margin-left: auto;
91
+ max-width: 1072px;
92
+ }
93
+ #aiosp_sitemap_addl_pages_metabox table.aioseop_table td {
94
+ padding: 3px;
95
+ padding-right: 5%;
96
+ }
97
+ .aioseop_top_label .aioseop_option_input,
98
+ .aioseop_no_label .aioseop_option_input {
99
+ width: 100%;
100
+ }
101
+
102
+ .aioseop_settings_left .postbox {
103
+ float: right;
104
+ }
105
+ .aioseop_option_setting_label {
106
+ padding-right: 1px;
107
+ padding-left: 0px;
108
+ }
109
+ #aiosp_settings_form .aioseop_no_label, .aioseop_no_label {
110
+ float: right;
111
+ margin: 0px 13px 0px 23px;
112
+ }
113
+ .aioseop_module.error.below-h2 {
114
+ padding: 5px 0px;
115
+ margin: 0px 0px 15px 477px !important;
116
+ }
117
+
118
+ #aiosp {
119
+ width: 100%;
120
+ }
121
+
122
+ .aioseop_help_text ul {
123
+ margin: 15px 20px 0 0;
124
+ }
125
+
126
+ .aioseop_header_tabs li a.aioseop_header_tab {
127
+ border: solid 1px #CCC;
128
+ border-right: none;
129
+ padding: 6px 6px 1px 6px;
130
+ }
131
+
132
+ form#aiosp_settings_form, .aioseop_tabs_div {
133
+ padding-left: 477px;
134
+ padding-right: 0px;
135
+ }
136
+ #aiosp_settings_form ul.sfwd_debug_settings li strong {
137
+ float: right;
138
+ text-align: left;
139
+ margin-left: 8px;
140
+ margin-right: auto;
141
+ padding: 1px;
142
+ padding-left: 8px;
143
+ }
aioseop_module.css ADDED
@@ -0,0 +1,656 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .form-table.aioseop {
2
+ clear: none;
3
+ }
4
+ .form-table.aioseop td {
5
+ vertical-align: top;
6
+ padding: 16px 0 10px 0;
7
+ line-height: 20px;
8
+ font-size: 12px;
9
+ }
10
+ .form-table.aioseop th {
11
+ width: 200px;
12
+ padding: 10px 0 12px 9px;
13
+ }
14
+ .aioseop_help_text_link, .aioseop_help_text_link:active {
15
+ text-align: left;
16
+ float: left;
17
+ width: 100%;
18
+ max-width: 300px;
19
+ background: url('images/question.png') no-repeat;
20
+ min-width: 1px;
21
+ min-height: 22px;
22
+ padding-top: 10px;
23
+ border: none;
24
+ outline: none;
25
+ }
26
+ .aioseop_help_text_link img {
27
+ width: 40px;
28
+ float: left;
29
+ }
30
+ .aioseop_label {
31
+ color: #5F5F5F;
32
+ font-weight: bold;
33
+ line-height: 19px;
34
+ padding-left: 50px;
35
+ padding-right: 10px;
36
+ display: inline-block;
37
+ text-align: left;
38
+ }
39
+ .aioseop_option_div {
40
+ max-height: 150px;
41
+ width: 95%;
42
+ overflow-y: auto;
43
+ }
44
+ .aioseop_overflowed {
45
+ border: 1px solid #e1e1e1;
46
+ }
47
+ .aioseop input[type="text"] {
48
+ color: #515151;
49
+ height: 35px;
50
+ padding: 10px 0px 10px 10px;
51
+ font-size: 14px;
52
+ width: 95%;
53
+ max-width: 600px;
54
+ }
55
+ .aioseop textarea {
56
+ color: #515151;
57
+ padding: 10px 0px 0px 10px;
58
+ margin: 0px;
59
+ font-size: 14px;
60
+ line-height: 25px;
61
+ width: 95%;
62
+ max-width: 600px;
63
+ }
64
+ .aioseop_help_text_div {
65
+ text-align:left;
66
+ width:100%;
67
+ margin: 10px 0px 10px 0px;
68
+ }
69
+ .aioseop_help_text {
70
+ font-size: 12px;
71
+ float: left;
72
+ clear: left;
73
+ color: #797979;
74
+ line-height: 15px;
75
+ font-style: italic;
76
+ }
77
+ .aioseop_head_tagline {
78
+ color: #5F5F5F;
79
+ font-size: 13px;
80
+ }
81
+
82
+ .aioseop_head_nav {
83
+ float: left;
84
+ font-size: 18px;
85
+ margin: 0px 0 16px 0;
86
+ font-family: "HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;
87
+ border-bottom: 1px solid #CCC;
88
+ width: 100%;
89
+ }
90
+ .aioseop_head_nav_tab {
91
+ padding: 10px 15px 10px 15px;
92
+ margin: 0 0 0 15px;
93
+ border-width: 1px 1px 0;
94
+ border-radius: 4px 4px 0px 0;
95
+ border-style: solid;
96
+ border-color: #CCC #CCC white;
97
+ float: left;
98
+ opacity: 0.5;
99
+ color: black;
100
+ text-shadow: white 0 1px 0;
101
+ text-decoration: none;
102
+ }
103
+ .aioseop_head_nav_tab.aioseop_head_nav_active {
104
+ opacity: 1;
105
+ margin-bottom: -1px;
106
+ border-width: 1px;
107
+ }
108
+ .aioseop_head_nav_tab:first-child {
109
+ margin-left: 0px;
110
+ }
111
+ .aioseop_head_nav_tab:hover {
112
+ opacity:1;
113
+ }
114
+ .aioseop_header {
115
+ float: left;
116
+ clear: left;
117
+ }
118
+
119
+ .aioseop_advert {
120
+ padding: 10px;
121
+ margin-bottom: 20px;
122
+ border: 1px solid #DDD;
123
+ height: 200px;
124
+ width: 423px;
125
+ }
126
+
127
+ .aioseop_adverts {
128
+ float: right;
129
+ }
130
+ .aioseop_content {
131
+ min-width: 760px;
132
+ clear: left;
133
+ }
134
+ .aioseop_options_wrapper {
135
+ }
136
+ .aioseop_options_wrapper .hndle {
137
+ font-size: 15px;
138
+ font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif;
139
+ font-weight: normal;
140
+ padding: 7px 10px;
141
+ margin: 0;
142
+ line-height: 1;
143
+ }
144
+ #aiosp_feature_manager_metabox.postbox {
145
+ float: left;
146
+ }
147
+ .aioseop_advert p {
148
+ margin: 25px 0 25px 0;
149
+ }
150
+ .widget, #widget-list .widget-top, .postbox, #titlediv, .aioseop_options_wrapper .postarea, .stuffbox {
151
+ border-color: #DFDFDF;
152
+ -moz-box-shadow: inset 0 1px 0 #fff;
153
+ -webkit-box-shadow: inset 0 1px 0 #fff;
154
+ box-shadow: inset 0 1px 0 #fff;
155
+ -moz-border-radius: 3px;
156
+ -khtml-border-radius: 3px;
157
+ -webkit-border-radius: 3px;
158
+ border-radius: 3px;
159
+ }
160
+ .aioseop_advert h3 {
161
+ padding: 0;
162
+ margin-top: 6px;
163
+ }
164
+ .aioseop_metabox_text p {
165
+ margin: 0 0 0px 0;
166
+ width: 101%;
167
+ }
168
+ .aioseop_sidebar {
169
+ width: 457px;
170
+ margin-left: 10px;
171
+ }
172
+ .aioseop_metabox_text {
173
+ margin-bottom: 0px;
174
+ }
175
+ .aioseop_metabox_wrapper {
176
+ padding: 0px;
177
+ }
178
+ .aioseop_metabox_text *:last-child {
179
+ margin: 0;
180
+ }
181
+ .aioseop_metabox_feature {
182
+ margin-top: 20px;
183
+ }
184
+ .aioseop_option_label {
185
+ float: left;
186
+ margin: 0px 0 10px 5px;
187
+ min-width: 150px;
188
+ width: 37%;
189
+ max-width: 270px;
190
+ }
191
+ .aioseop_metabox_text h2 {
192
+ font-size: 14px;
193
+ padding: 0px;
194
+ font-weight: bold;
195
+ line-height: 29px;
196
+ }
197
+ #aioseop-about {
198
+ width: 443px;
199
+ margin-bottom: 20px;
200
+ }
201
+ #aioseop-about .aioseop_metabox_text #mc-embedded-subscribe-form h2 {
202
+ font-size: 13px;
203
+ }
204
+ .aioseop_sidebar #mc-embedded-subscribe-form {
205
+ margin: 0 0 10px 0;
206
+ background: white;
207
+ padding: 10px 10px;
208
+ border: 1px solid #DDD;
209
+ }
210
+ .aioseop input[readonly] {
211
+ background-color: #EEE;
212
+ margin: 5px 0 5px 0 !important;
213
+ }
214
+ .aioseop input[type="button"] {
215
+ border-radius: 5px;
216
+ padding: 10px;
217
+ font-size: 15px;
218
+ }
219
+
220
+ .aioseop_settings_left {
221
+ float: left;
222
+ padding: 0px;
223
+ margin: 0px 0 0 0;
224
+ width: 100%;
225
+ }
226
+
227
+ #aioseop_top_button {
228
+ margin-top: 5px;
229
+ height: 30px;
230
+ }
231
+
232
+ .aioseop_right_sidebar {
233
+ float: right;
234
+ margin-top: 30px;
235
+ }
236
+ /*
237
+ #wpbody-content {
238
+ min-width: 1180px;
239
+ }
240
+ */
241
+ #aiosp_settings_form .button-primary.hidden {
242
+ display: none;
243
+ }
244
+ .All_in_One_SEO_Pack_Feature_Manager > #aiosp_settings_form > #aioseop_top_button {
245
+ height: 5px;
246
+ }
247
+ .All_in_One_SEO_Pack_Feature_Manager > .aioseop_right_sidebar.aioseop_options_wrapper {
248
+ margin-top: 10px;
249
+ }
250
+ div#aiosp_feature_manager_metabox .inside {
251
+ padding: 8px;
252
+ }
253
+ div.aioseop_feature {
254
+ position: relative;
255
+ display: inline-block;
256
+ vertical-align: top;
257
+ width: 240px;
258
+ height: 288px;
259
+ margin: 8px;
260
+ border: 1px solid #DEDEDE;
261
+ -moz-border-radius: 3px;
262
+ -webkit-border-radius: 3px;
263
+ border-radius: 3px;
264
+ background: white;
265
+ padding: 10px 0px 0px;
266
+ -webkit-box-shadow: inset 0 1px 0 #fff, inset 0 0 20px rgba(0,0,0,0.05), 0 1px 2px rgba( 0,0,0,0.1 );
267
+ -moz-box-shadow: inset 0 1px 0 #fff, inset 0 0 20px rgba(0,0,0,0.05), 0 1px 2px rgba( 0,0,0,0.1 );
268
+ box-shadow: inset 0 1px 0 #fff, inset 0 0 20px rgba(0,0,0,0.05), 0 1px 2px rgba( 0,0,0,0.1 );
269
+ -webkit-transition-duration: .4s;
270
+ -moz-transition-duration: .4s;
271
+ }
272
+ .aioseop_feature h3 {
273
+ font-size: 17px;
274
+ margin: 0;
275
+ padding: 0px 10px 5px 10px;
276
+ font-weight: normal;
277
+ font-style: normal;
278
+ font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;
279
+ }
280
+ .aioseop_feature p {
281
+ line-height: 150%;
282
+ font-size: 12px;
283
+ font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif;
284
+ margin-bottom: 20px;
285
+ color: #666;
286
+ padding: 0px 10px;
287
+ }
288
+ .aioseop_feature p.aioseop_desc {
289
+ min-height: 80px;
290
+ }
291
+ .aioseop_feature .feature_button {
292
+ float: right;
293
+ margin-bottom: 10px;
294
+ margin-right: 10px;
295
+ min-width: 80px;
296
+ text-align: center;
297
+ }
298
+ .aioseop_feature .feature_button:before {
299
+ content: "Activate";
300
+ }
301
+ .aioseop_feature .active.feature_button:before {
302
+ content: "Deactivate";
303
+ }
304
+ div.aioseop_feature .aioseop_featured_image {
305
+ min-height: 100px;
306
+ background-repeat: no-repeat;
307
+ display: block;
308
+ margin: 0 auto;
309
+ width: 133px;
310
+ }
311
+ div.aioseop_feature .aioseop_featured_image {
312
+ background-image: url(images/Default-BW-Standard.png);
313
+ }
314
+ div.aioseop_feature .aioseop_featured_image.active {
315
+ background-image: url(images/Default-Color-Standard.png);
316
+ }
317
+ div.aioseop_feature#aioseop_performance .aioseop_featured_image {
318
+ background-image: url(images/Performance-BW-Standard.png);
319
+ }
320
+ div.aioseop_feature#aioseop_performance .aioseop_featured_image.active {
321
+ background-image: url(images/Performance-Color-Standard.png);
322
+ }
323
+ div.aioseop_feature#aioseop_coming_soon .aioseop_featured_image {
324
+ background-image: url(images/Default-Color-Standard.png);
325
+ }
326
+ div.aioseop_feature#aioseop_coming_soon2 .aioseop_featured_image {
327
+ background-image: url(images/Default-Color-Standard.png);
328
+ }
329
+ .aioseop_follow_button {
330
+ min-height: 50px;
331
+ background-repeat: no-repeat;
332
+ display: inline-block;
333
+ width: 100px;
334
+ background-size: auto 50px !important;
335
+ margin-right: 5px;
336
+ }
337
+ .aioseop_facebook_follow {
338
+ background-image: url(images/facebook-follow-standard.png);
339
+ }
340
+ .aioseop_twitter_follow {
341
+ background-image: url(images/twitter-follow-standard.png);
342
+ }
343
+ @media
344
+ only screen and (-webkit-min-device-pixel-ratio: 1.5),
345
+ only screen and ( min--moz-device-pixel-ratio: 1.5),
346
+ only screen and ( -o-min-device-pixel-ratio: 3/2),
347
+ only screen and ( min-device-pixel-ratio: 1.5),
348
+ only screen and ( min-resolution: 1.5dppx) {
349
+ div.aioseop_feature .aioseop_featured_image {
350
+ background-size: auto 100px !important;
351
+ }
352
+ div.aioseop_feature .aioseop_featured_image.active {
353
+ background-image: url(images/Default-Color-Retina.png);
354
+ }
355
+ div.aioseop_feature .aioseop_featured_image {
356
+ background-image: url(images/Default-BW-Retina.png);
357
+ }
358
+ div.aioseop_feature#aioseop_performance .aioseop_featured_image {
359
+ background-image: url(images/Performance-BW-Retina.png);
360
+ }
361
+ div.aioseop_feature#aioseop_performance .aioseop_featured_image.active {
362
+ background-image: url(images/Performance-Color-Retina.png);
363
+ }
364
+ div.aioseop_feature#aioseop_coming_soon .aioseop_featured_image {
365
+ background-image: url(images/Default-BW-Retina.png);
366
+ }
367
+ div.aioseop_feature#aioseop_coming_soon2 .aioseop_featured_image {
368
+ background-image: url(images/Default-BW-Retina.png);
369
+ }
370
+ .aioseop_facebook_follow {
371
+ background-image: url(images/facebook-follow-retina.png);
372
+ }
373
+ .aioseop_twitter_follow {
374
+ background-image: url(images/twitter-follow-retina.png);
375
+ }
376
+ }
377
+
378
+ .aioseop_options {
379
+ width: 100%;
380
+ margin: 18px 0px 10px 0px;
381
+ }
382
+ .aioseop_wrapper {
383
+ width: 100%;
384
+ }
385
+ .aioseop_input {
386
+ clear: left;
387
+ width: 100%;
388
+ padding: 5px;
389
+ }
390
+ .aioseop_option_input {
391
+ float: left;
392
+ width: 61%;
393
+ margin: 0;
394
+ padding-left: 1px;
395
+ min-width: 160px;
396
+ /* max-width: 900px; */
397
+ }
398
+ div.preview_snippet {
399
+ border: 1px solid #ebebeb;
400
+ padding: 15px 15px 20px 7px;
401
+ background-color: #fff;
402
+ }
403
+ div#aioseop_snippet {
404
+ font-family: arial, sans-serif;
405
+ font-size: 13px;
406
+ }
407
+ div#aioseop_snippet > h3 {
408
+ font-size: 16px;
409
+ border: 0px;
410
+ background: inherit;
411
+ }
412
+ div#aioseop_snippet > h3 > a {
413
+ color: #12c;
414
+ text-decoration: none;
415
+ cursor: pointer;
416
+ }
417
+ div#aioseop_snippet > div {
418
+ color: #222;
419
+ max-width: 42em;
420
+ }
421
+ div#aioseop_snippet > div > div {
422
+ display: block;
423
+ margin-bottom: 1px;
424
+ }
425
+ div#aioseop_snippet > div > div > cite {
426
+ color: #093;
427
+ font-style: normal;
428
+ }
429
+ div#aioseop_snippet > div > span {
430
+ margin: 0px;
431
+ padding: 0px;
432
+ border: 0px;
433
+ }
434
+ .aioseop_top_label .aioseop_option_input,
435
+ .aioseop_no_label .aioseop_option_input {
436
+ width: 100%;
437
+ }
438
+
439
+ #aiosp_settings_form .postbox {
440
+ margin: 0px 0px 20px 0px;
441
+ }
442
+
443
+ .aioseop_settings_left .postbox {
444
+ float: left;
445
+ width: 100%;
446
+ }
447
+ .aioseop_option_setting_label {
448
+ min-height: 35px;
449
+ display: inline-block;
450
+ white-space: nowrap;
451
+ overflow: hidden;
452
+ padding-left: 1px;
453
+ max-width: 229px;
454
+ min-width: 160px;
455
+ width: 33%;
456
+ }
457
+ .aioseop_settings_left .postbox .inside {
458
+ padding: 0;
459
+ margin: 0;
460
+ }
461
+ #aiosp_settings_form .aioseop_no_label, .aioseop_no_label {
462
+ float: left;
463
+ width: 92%;
464
+ max-width: 100%;
465
+ margin: 0px 23px 0px 13px;
466
+ }
467
+ .aioseop_top_label {
468
+ width: 96%;
469
+ margin: 0 10px;
470
+ }
471
+ .aioseop_hidden_type {
472
+ margin: 0;
473
+ padding: 0;
474
+ height: 0;
475
+ }
476
+ .aioseop_module.error.below-h2 {
477
+ padding: 5px 0px;
478
+ margin: 0px 477px 15px 0px !important;
479
+ }
480
+
481
+ .aioseop_input input[type="checkbox"],
482
+ .aioseop_input input[type="radio"] {
483
+ vertical-align: text-bottom;
484
+ margin: 15px 0 0 0;
485
+ }
486
+
487
+ #aiosp {
488
+ width: 100%;
489
+ }
490
+
491
+ .aioseop_input.aioseop_top_label .aioseop_option_input {
492
+ margin: 0 0 10px 0;
493
+ }
494
+
495
+ .aioseop_option_docs {
496
+ width: 98%;
497
+ display: none;
498
+ border: 1px solid #D3D3D3;
499
+ margin-top: 20px;
500
+ padding: 1%;
501
+ background-color: #EEE;
502
+ }
503
+ .aioseop_option_docs h3 {
504
+ background:none;
505
+ }
506
+ .aioseop_error_notice {
507
+ color: #f00;
508
+ font-weight: bold;
509
+ }
510
+
511
+ .aioseop_input select {
512
+ margin: 7px 0px;
513
+ }
514
+ .aioseop_help_text ul {
515
+ margin: 15px 0 0 20px;
516
+ }
517
+
518
+ .aioseop_help_text ul li {
519
+ line-height: 20px;
520
+ margin: 0;
521
+ }
522
+ .aioseop_sidebar #side-sortables {
523
+ width: 98%;
524
+ }
525
+
526
+ .aioseop_tabs {
527
+ padding-top: 6px;
528
+ }
529
+ .aioseop_header_tabs li {
530
+ display: inline;
531
+ padding: 0px;
532
+ margin: 0px;
533
+ }
534
+ .aioseop_header_tabs {
535
+ margin: 0px;
536
+ }
537
+ .aioseop_header_nav {
538
+ margin: 0px;
539
+ }
540
+ .aioseop_header_tabs li a.aioseop_header_tab.active {
541
+ background-color: rgb( 255, 255, 255 );
542
+ border-bottom-color: rgba( 255, 255, 255, 0.5 );
543
+ font-weight: bold;
544
+ }
545
+ .aioseop_header_tabs li a.aioseop_header_tab {
546
+ height: 18px;
547
+ font: 13px/18px Arial,Helvetica,sans-serif normal;
548
+ text-decoration: none;
549
+ margin: 5px 5px 0 0;
550
+ padding: 4px 5px 2px;
551
+ cursor: pointer;
552
+ border-width: 1px;
553
+ border-style: solid;
554
+ -webkit-border-top-right-radius: 3px;
555
+ -webkit-border-top-left-radius: 3px;
556
+ border-top-right-radius: 3px;
557
+ border-top-left-radius: 3px;
558
+ background-color: rgb( 255, 255, 255 );
559
+ background-color: rgba( 255, 255, 255, 0.5 );
560
+ border-color: #ccc;
561
+ color: #5F5F5F;
562
+ }
563
+ .aioseop_header_tabs li:first-child a.aioseop_header_tab {
564
+ border-left: solid 1px #CCC;
565
+ margin-left: 5px;
566
+ }
567
+ .aioseop_tab {
568
+ border: solid 1px #CCC;
569
+ background-color: rgb( 255, 255, 255 );
570
+ background-color: rgba( 255, 255, 255, 0.5 );
571
+ }
572
+ .aioseop_loading {
573
+ background-image: url('images/activity.gif');
574
+ display: inline-block;
575
+ width: 24px;
576
+ height: 24px;
577
+ margin: 0px;
578
+ padding: 0px;
579
+ vertical-align: bottom;
580
+ }
581
+ .aiosp_delete_url {
582
+ background-image: url('images/delete.png');
583
+ display: inline-block;
584
+ width: 16px;
585
+ height: 16px;
586
+ margin: 0px;
587
+ padding: 0px;
588
+ vertical-align: bottom;
589
+ }
590
+ form#aiosp_settings_form, .aioseop_tabs_div {
591
+ padding-right: 477px;
592
+ }
593
+ .wrap > h2 {
594
+ padding-bottom: 14px;
595
+ }
596
+ div.wrap > form table.form-table {
597
+ clear: none;
598
+ width: 580px;
599
+ }
600
+ div.wrap > div#message.error {
601
+ max-width: 540px;
602
+ }
603
+ #aiosp_settings_form ul.sfwd_debug_settings li strong {
604
+ display: block;
605
+ float: left;
606
+ text-align: right;
607
+ background-color: #DDD;
608
+ margin-right: 8px;
609
+ padding: 1px;
610
+ padding-right: 8px;
611
+ overflow: auto;
612
+ width: 200px;
613
+ min-height: 16px;
614
+ }
615
+ #aiosp_settings_form ul.sfwd_debug_settings li:nth-child(2n+1) strong {
616
+ background-color: #CCC;
617
+ }
618
+ #aiosp_settings_form ul.sfwd_debug_settings li {
619
+ clear: left;
620
+ padding: 5px;
621
+ margin: 0px;
622
+ padding: 0px;
623
+ background-color: #EEE;
624
+ overflow: auto;
625
+ max-width: 75%;
626
+ min-width: 800px;
627
+ }
628
+ #aiosp_settings_form ul.sfwd_debug_settings li:nth-child(2n) {
629
+ background-color: #DDD;
630
+ }
631
+ div.sfwd_debug_mail_sent {
632
+ background-color: #080;
633
+ border: 1px solid #0A0;
634
+ margin: 10px 0px 10px 0px;
635
+ width: 598px;
636
+ color: #FFF;
637
+ text-align: center;
638
+ }
639
+ div.sfwd_debug_error {
640
+ background-color: #F00;
641
+ color: #FFF;
642
+ border: 1px solid #A00;
643
+ margin: 10px 0px 10px 0px;
644
+ width: 598px;
645
+ text-align: center;
646
+ font-weight: bolder;
647
+ }
648
+ #aiosp_performance_status_wrapper .aioseop_option_div {
649
+ max-height: 420px;
650
+ }
651
+ #aioseop_coming_soon, #aioseop_coming_soon2 {
652
+ padding-top: 40px;
653
+ text-align: center;
654
+ height: 258px;
655
+ font-size: 16px;
656
+ }
aioseop_module.js ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if ( typeof aioseop_data != 'undefined' ) {
2
+ aioseop_data = aioseop_data.json.replace(/&quot;/g, '"');
3
+ aioseop_data = jQuery.parseJSON( aioseop_data );
4
+ }
5
+
6
+ function toggleVisibility(id) {
7
+ var e = document.getElementById(id);
8
+ if (e.style.display == 'block')
9
+ e.style.display = 'none';
10
+ else
11
+ e.style.display = 'block';
12
+ }
13
+
14
+ function countChars(field,cntfield) {
15
+ cntfield.value = field.value.length;
16
+ }
17
+
18
+ function aioseop_get_field_value( field ) {
19
+ cur = jQuery('[name=' + field + ']');
20
+ if ( cur.length == 0 ) return field;
21
+ type = cur.attr('type');
22
+ if ( type == "checkbox" || type == "radio" )
23
+ cur = jQuery('input[name=' + field + ']:checked');
24
+ return cur.val();
25
+ }
26
+
27
+ function aioseop_eval_condshow_logic( statement ) {
28
+ var lhs, rhs;
29
+ if ( ( typeof statement ) == 'object' ) {
30
+ lhs = statement['lhs'];
31
+ rhs = statement['rhs'];
32
+ if ( lhs !== null && ( ( typeof lhs ) == 'object' ) )
33
+ lhs = aioseop_eval_condshow_logic( statement['lhs'] );
34
+ if ( rhs !== null && ( typeof rhs ) == 'object' )
35
+ rhs = aioseop_eval_condshow_logic( statement['rhs'] );
36
+ lhs = aioseop_get_field_value( lhs );
37
+ rhs = aioseop_get_field_value( rhs );
38
+ switch ( statement['op'] ) {
39
+ case 'NOT': return ( ! lhs );
40
+ case 'AND': return ( lhs && rhs );
41
+ case 'OR' : return ( lhs || rhs );
42
+ case '==' : return ( lhs == rhs );
43
+ case '!=' : return ( lhs != rhs );
44
+ default : return null;
45
+ }
46
+ }
47
+ return statement;
48
+ }
49
+
50
+ function aioseop_do_condshow_match( index, value ) {
51
+ if ( typeof value != 'undefined' ) {
52
+ matches = true;
53
+ jQuery.each(value, function(subopt, setting) {
54
+ var statement;
55
+ if ( ( typeof setting ) == 'object' ) {
56
+ statement = aioseop_eval_condshow_logic( setting );
57
+ if ( !statement ) {
58
+ matches = false;
59
+ }
60
+ } else {
61
+ cur = aioseop_get_field_value( subopt );
62
+ if ( cur != setting ) {
63
+ matches = false;
64
+ }
65
+ }
66
+ });
67
+ if ( matches ) {
68
+ jQuery('#' + index + '_wrapper' ).show();
69
+ } else {
70
+ jQuery('#' + index + '_wrapper' ).hide();
71
+ }
72
+ return matches;
73
+ }
74
+ return false;
75
+ }
76
+
77
+ function aioseop_add_condshow_handlers( index, value ) {
78
+ if ( typeof value != 'undefined' ) {
79
+ jQuery.each(value, function(subopt, setting) {
80
+ jQuery('[name=' + subopt + ']').bind( "change keyup", function() {
81
+ aioseop_do_condshow_match( index, value );
82
+ });
83
+ });
84
+ }
85
+ }
86
+
87
+ function aioseop_do_condshow( condshow ) {
88
+ if ( typeof aioseop_data.condshow != 'undefined' ) {
89
+ jQuery.each(aioseop_data.condshow, function(index, value) {
90
+ aioseop_do_condshow_match( index, value );
91
+ aioseop_add_condshow_handlers( index, value );
92
+ });
93
+ }
94
+ }
95
+
96
+ function aioseop_show_pointer( handle, value ) {
97
+ if ( typeof( jQuery( value.pointer_target ).pointer) != 'undefined' ) {
98
+ jQuery(value.pointer_target).pointer({
99
+ content : value.pointer_text,
100
+ close : function() {
101
+ jQuery.post( ajaxurl, {
102
+ pointer: handle,
103
+ action: 'dismiss-wp-pointer'
104
+ });
105
+ }
106
+ }).pointer('open');
107
+ }
108
+ }
109
+
110
+ jQuery(document).ready(function(){
111
+ if (typeof aioseop_data != 'undefined') {
112
+ if ( typeof aioseop_data.condshow != 'undefined' ) {
113
+ aioseop_do_condshow( aioseop_data.condshow );
114
+ }
115
+ }
116
+ });
117
+
118
+ jQuery(document).ready(function() {
119
+ var image_field;
120
+ jQuery('.aioseop_upload_image_button').click(function() {
121
+ window.send_to_editor = aioseopNewSendToEditor;
122
+ image_field = jQuery(this).next();
123
+ formfield = image_field.attr('name');
124
+ tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true');
125
+ return false;
126
+ });
127
+ aioseopStoreSendToEditor = window.send_to_editor;
128
+ aioseopNewSendToEditor = function(html) {
129
+ imgurl = jQuery('img',html).attr('src');
130
+ if ( typeof(imgurl) !== undefined )
131
+ image_field.val(imgurl);
132
+ tb_remove();
133
+ window.send_to_editor = aioseopStoreSendToEditor;
134
+ };
135
+ });
136
+
137
+ // props to commentluv for this fix
138
+ // workaround for bug that causes radio inputs to lose settings when meta box is dragged.
139
+ // http://core.trac.wordpress.org/ticket/16972
140
+ jQuery(document).ready(function(){
141
+ // listen for drag drop of metaboxes , bind mousedown to .hndle so it only fires when starting to drag
142
+ jQuery('.hndle').mousedown(function(){
143
+ // set live event listener for mouse up on the content .wrap and wait a tick to give the dragged div time to settle before firing the reclick function
144
+ jQuery('.wrap').mouseup(function(){store_radio(); setTimeout('reclick_radio();',50);});
145
+ })
146
+ });
147
+ /**
148
+ * stores object of all radio buttons that are checked for entire form
149
+ */
150
+ if(typeof store_radio != 'function') {
151
+ function store_radio(){
152
+ var radioshack = {};
153
+ jQuery('input[type="radio"]').each(function(){
154
+ if(jQuery(this).is(':checked')){
155
+ radioshack[jQuery(this).attr('name')] = jQuery(this).val();
156
+ }
157
+ jQuery(document).data('radioshack',radioshack);
158
+ });
159
+ }
160
+ }
161
+ /**
162
+ * detect mouseup and restore all radio buttons that were checked
163
+ */
164
+ if(typeof reclick_radio != 'function') {
165
+ function reclick_radio(){
166
+ // get object of checked radio button names and values
167
+ var radios = jQuery(document).data('radioshack');
168
+ //step thru each object element and trigger a click on it's corresponding radio button
169
+ for(key in radios){
170
+ jQuery('input[name="'+key+'"]').filter('[value="'+radios[key]+'"]').trigger('click');
171
+ }
172
+ // unbind the event listener on .wrap (prevents clicks on inputs from triggering function)
173
+ jQuery('.wrap').unbind('mouseup');
174
+ }
175
+ }
176
+
177
+ function aioseop_handle_post_url( action, settings, options) {
178
+ jQuery("div#aiosp_"+settings).fadeOut('fast', function() {
179
+ var loading = '<label class="aioseop_loading aioseop_'+settings+'_loading"></label> Please wait...';
180
+ jQuery("div#aiosp_"+settings).fadeIn('fast', function() {
181
+ var aioseop_sack = new sack(ajaxurl);
182
+ aioseop_sack.execute = 1;
183
+ aioseop_sack.method = 'POST';
184
+ aioseop_sack.setVar( "action", action );
185
+ aioseop_sack.setVar( "settings", settings );
186
+ aioseop_sack.setVar( "options", options );
187
+ aioseop_sack.setVar( "nonce-aioseop", jQuery('input[name="nonce-aioseop"]').val() );
188
+ aioseop_sack.onError = function() {alert('Ajax error on saving.'); };
189
+ aioseop_sack.runAJAX();
190
+ });
191
+ jQuery("div#aiosp_"+settings).html(loading);
192
+ })
193
+ };
194
+
195
+ function aioseop_is_overflowed(element) {
196
+ return element.scrollHeight > element.clientHeight || element.scrollWidth > element.clientWidth;
197
+ }
198
+
199
+ function aioseop_overflow_border( el ) {
200
+ if ( aioseop_is_overflowed(el) ) {
201
+ el.className = 'aioseop_option_div aioseop_overflowed';
202
+ } else {
203
+ el.className = 'aioseop_option_div';
204
+ }
205
+ }
206
+
207
+ jQuery(document).ready(function() {
208
+ if ( typeof aioseop_data.pointers != 'undefined' ) {
209
+ jQuery.each(aioseop_data.pointers, function(index, value) {
210
+ if ( value != 'undefined' && value.pointer_text != '' ) {
211
+ aioseop_show_pointer( index, value );
212
+ }
213
+ });
214
+ }
215
+ var selectors = "div.aioseop_multicheckbox_type div.aioseop_option_div, #aiosp_performance_status div.aioseop_option_div";
216
+ jQuery(selectors).each(function() {
217
+ aioseop_overflow_border(this);
218
+ });
219
+ var resizeTimer;
220
+ jQuery(window).resize(function() {
221
+ clearTimeout(resizeTimer);
222
+ resizeTimer = setTimeout(jQuery(selectors).each(function() {
223
+ aioseop_overflow_border(this);
224
+ }), 250);
225
+ });
226
+ jQuery(".aioseop_tab:not(:first)").hide();
227
+ jQuery(".aioseop_tab:first").show();
228
+ jQuery("a.aioseop_header_tab").click(function(){
229
+ var stringref = jQuery(this).attr("href").split('#')[1];
230
+ jQuery('.aioseop_tab:not(#'+stringref+')').hide('slow');
231
+ jQuery('.aioseop_tab#' + stringref).show('slow');
232
+ jQuery('.aioseop_header_tab[href!=#'+stringref+']').removeClass('active');
233
+ jQuery('.aioseop_header_tab[href=#' + stringref+']').addClass('active');
234
+ return false;
235
+ });
236
+ });
aioseop_module_class.php ADDED
@@ -0,0 +1,1265 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package All-in-One-SEO-Pack
4
+ */
5
+ /**
6
+ * The module base class; handles settings, options, menus, metaboxes, etc.
7
+ */
8
+ if ( !class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
9
+ abstract class All_in_One_SEO_Pack_Module {
10
+ public static $instance = null;
11
+ protected $plugin_name;
12
+ protected $name;
13
+ protected $menu_name;
14
+ protected $prefix;
15
+ protected $file;
16
+ protected $options;
17
+ protected $option_name;
18
+ protected $default_options;
19
+ protected $locations = null; // organize settings into settings pages with a menu items and/or metaboxes on post types edit screen; optional
20
+ protected $layout = null; // organize settings on a settings page into multiple, separate metaboxes; optional
21
+ protected $tabs = null; // organize layouts on a settings page into multiple, separate tabs; optional
22
+ protected $current_tab = null; // the current tab
23
+ protected $pagehook = null; // the current page hook
24
+ protected $store_option = false;
25
+ protected $parent_option = 'aioseop_options';
26
+ protected $post_metaboxes = Array();
27
+ protected $tabbed_metaboxes = true;
28
+ protected $credentials = false; // used for WP Filesystem
29
+ protected $script_data = null; // used for passing data to JavaScript
30
+ protected $plugin_path = null;
31
+ protected $pointers = Array();
32
+
33
+ /**
34
+ * Handles calls to display_settings_page_{$location}, does error checking.
35
+ */
36
+ function __call( $name, $arguments ) {
37
+ if ( strpos( $name, "display_settings_page_" ) === 0 )
38
+ return $this->display_settings_page( substr( $name, 22 ) );
39
+ $error = __( sprintf( "Method %s doesn't exist", $name ), 'all_in_one_seo_pack' );
40
+ if ( class_exists( 'BadMethodCallException' ) )
41
+ throw new BadMethodCallException( $error );
42
+ throw new Exception( $error );
43
+ }
44
+
45
+ function __construct() {
46
+ if ( empty( $this->file ) ) $this->file = __FILE__;
47
+ $this->plugin_name = AIOSEOP_PLUGIN_NAME;
48
+ $this->plugin_path = Array();
49
+ $this->plugin_path['dir'] = plugin_dir_path( $this->file );
50
+ $this->plugin_path['basename'] = plugin_basename( $this->file );
51
+ $this->plugin_path['dirname'] = dirname( $this->plugin_path['basename'] );
52
+ $this->plugin_path['url'] = plugin_dir_url( $this->file );
53
+ $this->plugin_path['images_url'] = $this->plugin_path['url'] . 'images';
54
+ $this->script_data['plugin_path'] = $this->plugin_path;
55
+ }
56
+
57
+ /**
58
+ * Get options for module, stored individually or together.
59
+ */
60
+ function get_class_option( ) {
61
+ $option_name = $this->get_option_name();
62
+ if ( $this->store_option || $option_name == $this->parent_option ) {
63
+ return get_option( $option_name );
64
+ } else {
65
+ $option = get_option( $this->parent_option );
66
+ if ( isset( $option['modules'] ) && isset( $option['modules'][$option_name] ) )
67
+ return $option['modules'][$option_name];
68
+ }
69
+ return false;
70
+ }
71
+
72
+ /**
73
+ * Update options for module, stored individually or together.
74
+ */
75
+ function update_class_option( $option_data, $option_name = false ) {
76
+ if ( $option_name == false )
77
+ $option_name = $this->get_option_name();
78
+ if ( $this->store_option || $option_name == $this->parent_option ) {
79
+ return update_option( $option_name, $option_data );
80
+ } else {
81
+ $option = get_option( $this->parent_option );
82
+ if ( !isset( $option['modules'] ) ) $option['modules'] = Array();
83
+ $option['modules'][$option_name] = $option_data;
84
+ return update_option( $this->parent_option, $option );
85
+ }
86
+ }
87
+
88
+ /**
89
+ * Delete options for module, stored individually or together.
90
+ */
91
+ function delete_class_option( $delete = false ) {
92
+ $option_name = $this->get_option_name();
93
+ if ( $this->store_option || $delete ) {
94
+ delete_option( $option_name );
95
+ } else {
96
+ $option = get_option( $this->parent_option );
97
+ if ( isset( $option['modules'] ) && isset( $option['modules'][$option_name] ) ) {
98
+ unset( $option['modules'][$option_name] );
99
+ return update_option( $this->parent_option, $option );
100
+ }
101
+ }
102
+ return false;
103
+ }
104
+
105
+ /**
106
+ * Get the option name with prefix.
107
+ */
108
+ function get_option_name() {
109
+ if ( !isset( $this->option_name ) || empty( $this->option_name ) )
110
+ $this->option_name = $this->prefix . 'options';
111
+ return $this->option_name;
112
+ }
113
+
114
+ /**
115
+ * Convenience function to see if an option is set.
116
+ */
117
+ function option_isset( $option, $location = null ) {
118
+ $prefix = $this->get_prefix( $location );
119
+ $opt = $prefix . $option;
120
+ return ( ( isset( $this->options[$opt] ) ) && $this->options[$opt] );
121
+ }
122
+
123
+ /*** Case conversion; handle non UTF-8 encodings and fallback ***/
124
+
125
+ function convert_case( $str, $mode = 'upper' ) {
126
+ static $charset = null;
127
+ if ( $charset == null ) $charset = get_bloginfo( 'charset' );
128
+
129
+ if ( $mode == 'title' ) {
130
+ if ( function_exists( 'mb_convert_case' ) )
131
+ return mb_convert_case( $str, MB_CASE_TITLE, $charset );
132
+ else
133
+ return ucwords( $str );
134
+ }
135
+
136
+ if ( $charset == 'UTF-8' ) {
137
+ global $UTF8_TABLES;
138
+ include_once( 'aioseop_utility.php' );
139
+ if ( is_array( $UTF8_TABLES ) ) {
140
+ if ( $mode == 'upper' ) return strtr( $str, $UTF8_TABLES['strtoupper'] );
141
+ if ( $mode == 'lower' ) return strtr( $str, $UTF8_TABLES['strtolower'] );
142
+ }
143
+ }
144
+
145
+ if ( $mode == 'upper' ) {
146
+ if ( function_exists( 'mb_strtoupper' ) )
147
+ return mb_strtoupper( $str, $charset );
148
+ else
149
+ return strtoupper( $str );
150
+ }
151
+
152
+ if ( $mode == 'lower' ) {
153
+ if ( function_exists( 'mb_strtolower' ) )
154
+ return mb_strtolower( $str, $charset );
155
+ else
156
+ return strtolower( $str );
157
+ }
158
+
159
+ return $str;
160
+ }
161
+
162
+ /**
163
+ * Convert a string to lower case
164
+ * Compatible with mb_strtolower(), an UTF-8 friendly replacement for strtolower()
165
+ */
166
+ function strtolower( $str ) {
167
+ return $this->convert_case( $str, 'lower' );
168
+ }
169
+
170
+ /**
171
+ * Convert a string to upper case
172
+ * Compatible with mb_strtoupper(), an UTF-8 friendly replacement for strtoupper()
173
+ */
174
+ function strtoupper( $str ) {
175
+ return $this->convert_case( $str, 'upper' );
176
+ }
177
+
178
+ /**
179
+ * Convert a string to title case
180
+ * Compatible with mb_convert_case(), an UTF-8 friendly replacement for ucwords()
181
+ */
182
+ function ucwords( $str ) {
183
+ return $this->convert_case( $str, 'title' );
184
+ }
185
+
186
+ /**
187
+ * convert xml string to php array - useful to get a serializable value
188
+ *
189
+ * @param string $xmlstr
190
+ * @return array
191
+ *
192
+ * @author Adrien aka Gaarf & contributors
193
+ * @see http://gaarf.info/2009/08/13/xml-string-to-php-array/
194
+ */
195
+ function xml_string_to_array( $xmlstr ) {
196
+ $doc = new DOMDocument();
197
+ $doc->loadXML( $xmlstr );
198
+ return $this->domnode_to_array( $doc->documentElement );
199
+ }
200
+
201
+ function domnode_to_array( $node ) {
202
+ switch ( $node->nodeType ) {
203
+ case XML_CDATA_SECTION_NODE:
204
+ case XML_TEXT_NODE:
205
+ return trim( $node->textContent );
206
+ break;
207
+ case XML_ELEMENT_NODE:
208
+ $output = array();
209
+ for ($i=0, $m=$node->childNodes->length; $i<$m; $i++) {
210
+ $child = $node->childNodes->item($i);
211
+ $v = $this->domnode_to_array($child);
212
+ if(isset($child->tagName)) {
213
+ $t = $child->tagName;
214
+ if(!isset($output[$t]))
215
+ $output[$t] = array();
216
+ $output[$t][] = $v;
217
+ }
218
+ elseif($v || $v === '0')
219
+ $output = (string) $v;
220
+ }
221
+ if($node->attributes->length && !is_array($output)) //Has attributes but isn't an array
222
+ $output = array('@content'=>$output); //Change output into an array.
223
+ if(is_array($output)) {
224
+ if($node->attributes->length) {
225
+ $a = array();
226
+ foreach($node->attributes as $attrName => $attrNode)
227
+ $a[$attrName] = (string) $attrNode->value;
228
+ $output['@attributes'] = $a;
229
+ }
230
+ foreach ($output as $t => $v)
231
+ if(is_array($v) && count($v)==1 && $t!='@attributes')
232
+ $output[$t] = $v[0];
233
+ }
234
+ }
235
+ return $output;
236
+ }
237
+
238
+ /**
239
+ * Returns child blogs of parent in a multisite.
240
+ */
241
+ function get_child_blogs() {
242
+ global $wpdb, $blog_id;
243
+ $site_id = $wpdb->siteid;
244
+ if ( is_multisite() ) {
245
+ if ( $site_id != $blog_id ) return false;
246
+ return $wpdb->get_col( "SELECT blog_id FROM {$wpdb->blogs} WHERE site_id = {$blog_id} AND site_id != blog_id" );
247
+ }
248
+ return false;
249
+ }
250
+
251
+ /**
252
+ * Checks if the plugin is active on a given blog by blogid on a multisite.
253
+ */
254
+ function is_aioseop_active_on_blog( $bid = false ) {
255
+ global $blog_id;
256
+ if ( empty( $bid ) || ( $bid == $blog_id ) || !is_multisite() ) return true;
257
+ if ( ! function_exists( 'is_plugin_active_for_network' ) )
258
+ require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
259
+ if ( is_plugin_active_for_network( AIOSEOP_PLUGIN_BASENAME ) ) return true;
260
+ return in_array( AIOSEOP_PLUGIN_BASENAME, (array) get_blog_option( $bid, 'active_plugins', array() ) );
261
+ }
262
+
263
+ /**
264
+ * Displays tabs for tabbed locations on a settings page.
265
+ */
266
+ function display_tabs( $location ) {
267
+ if ( ( $location != null ) && isset( $locations[$location]['tabs'] ) )
268
+ $tabs = $locations['location']['tabs'];
269
+ else
270
+ $tabs = $this->tabs;
271
+ if ( !empty( $tabs ) ) {
272
+ ?><div class="aioseop_tabs_div"><label class="aioseop_head_nav">
273
+ <?php
274
+ foreach ( $tabs as $k => $v ) {
275
+ ?>
276
+ <a class="aioseop_head_nav_tab aioseop_head_nav_<?php if ( $this->current_tab != $k ) echo "in"; ?>active" href="<?php echo add_query_arg( 'tab', $k ); ?>"><?php echo $v['name']; ?></a>
277
+ <?php
278
+ }
279
+ ?>
280
+ </label></div>
281
+ <?php
282
+ }
283
+ }
284
+
285
+ function get_object_labels( $post_objs ) {
286
+ $pt = array_keys( $post_objs );
287
+ $post_types = Array();
288
+ foreach ( $pt as $p )
289
+ if ( !empty( $post_objs[$p]->label ) )
290
+ $post_types[$p] = $post_objs[$p]->label;
291
+ else
292
+ $post_types[$p] = $p;
293
+ return $post_types;
294
+ }
295
+
296
+ function get_term_labels( $post_objs ) {
297
+ $post_types = Array();
298
+ foreach ( $post_objs as $p )
299
+ if ( !empty( $p->name ) )
300
+ $post_types[$p->term_id] = $p->name;
301
+ return $post_types;
302
+ }
303
+
304
+ function get_post_type_titles( $args = Array() ) {
305
+ return $this->get_object_labels( get_post_types( $args, 'objects' ) );
306
+ }
307
+
308
+ function get_taxonomy_titles( $args = Array() ) {
309
+ return $this->get_object_labels( get_taxonomies( $args, 'objects' ) );
310
+ }
311
+
312
+ function get_category_titles( $args = Array() ) {
313
+ return $this->get_term_labels( get_categories( $args ) );
314
+ }
315
+
316
+ /**
317
+ * Handles exporting settings data for a module.
318
+ */
319
+ function settings_export( $buf ) {
320
+ global $aiosp;
321
+ $post_types = null;
322
+ $has_data = null;
323
+ $general_settings = null;
324
+ $exporter_choices = $_REQUEST[ 'aiosp_importer_exporter_export_choices' ];
325
+ if ( !empty( $exporter_choices ) && is_array( $exporter_choices ) ) {
326
+ foreach( $exporter_choices as $ex ) {
327
+ if ( $ex == 1 ) $general_settings = true;
328
+ if ( $ex == 2 ) {
329
+ if ( isset( $_REQUEST[ 'aiosp_importer_exporter_export_post_types' ] ) )
330
+ $post_types = $_REQUEST[ 'aiosp_importer_exporter_export_post_types' ];
331
+ }
332
+ }
333
+ }
334
+ if( $post_types != null ) {
335
+ $posts_query = new WP_Query( Array( 'posts_per_page' => -1, 'post_type' => $post_types ) );
336
+ if ( ( $this === $aiosp ) ) { // || ( $this->locations !== null )
337
+ while ($posts_query->have_posts() ) : $posts_query->the_post();
338
+
339
+ global $post;
340
+ $guid = $post->guid; $type = $post->post_type; $title = $post->post_title; $date = $post->post_date;
341
+ $data = '';
342
+ /* Add Module Meta Data */
343
+ if ( $this === $aiosp ) {
344
+ /* Add Post Field Data */
345
+ $post_custom_fields = get_post_custom( $post->ID );
346
+ $has_data = null;
347
+ if( is_array( $post_custom_fields ) ){
348
+ foreach( $post_custom_fields as $field_name => $field ){
349
+ if( ( substr( $field_name, 1, 7) == 'aioseop' ) && ( $field[0] ) ){
350
+ $has_data = true;
351
+ $data .= $field_name . " = '" . $field[0] . "'\n";
352
+ }
353
+ }
354
+ }
355
+ } elseif ( $this->locations !== null ) {
356
+ foreach( $this->locations as $k => $v ) {
357
+ if ( isset($v['type'] ) && isset($v['options'] ) && ( $v['type'] === 'metabox' ) ) {
358
+ $value = $this->get_prefix($k) . $k;
359
+ $post_meta = get_post_meta( $post->ID, '_' . $value, true );
360
+ if ( $post_meta ) $data .= "$value = '" . str_replace( Array( "'", "\n", "\r" ), Array( "\'", '\n', '\r' ), trim( serialize( $post_meta ) ) ) . "'";
361
+ }
362
+ }
363
+ }
364
+ if ( !empty( $data ) ) $has_data = true;
365
+ /* Print post data to file */
366
+ if( $has_data != null ){
367
+ $post_info = "\n[post_data]\n\n";
368
+ $post_info .= "post_title = '" . $title . "'\n";
369
+ $post_info .= "post_guid = '" . $guid . "'\n";
370
+ $post_info .= "post_date = '" . $date . "'\n";
371
+ $post_info .= "post_type = '" . $type . "'\n";
372
+ if ( $data ) $buf .= $post_info . $data . "\n";
373
+ }
374
+ endwhile;
375
+ wp_reset_postdata();
376
+ }
377
+ }
378
+
379
+ /* Add all active settings to settings file */
380
+ $name = $this->get_option_name();
381
+ $options = $this->get_class_option();
382
+ if( !empty( $options ) && $general_settings != null ) {
383
+ $buf .= "\n[$name]\n\n";
384
+ foreach ( $options as $key => $value ) {
385
+ if ( ( $name == $this->parent_option ) && ( $key == 'modules' ) ) continue; // don't re-export all module settings -- pdb
386
+ if ( is_array($value) )
387
+ $value = "'" . str_replace( Array( "'", "\n", "\r" ), Array( "\'", '\n', '\r' ), trim( serialize( $value ) ) ) . "'";
388
+ else
389
+ $value = str_replace( Array( "\n", "\r" ), Array( '\n', '\r' ), trim( var_export($value, true) ) );
390
+ $buf .= "$key = $value\n";
391
+ }
392
+ }
393
+ return $buf;
394
+ }
395
+
396
+ /**
397
+ * Order for adding the menus for the aioseop_modules_add_menus hook.
398
+ */
399
+ function menu_order() {
400
+ return 10;
401
+ }
402
+
403
+ /**
404
+ * Print a basic error message.
405
+ */
406
+ function output_error( $error ) {
407
+ echo "<div class='aioseop_module error' style='text-align:center;'>$error</div>";
408
+ return FALSE;
409
+ }
410
+
411
+ /***
412
+ * Helper function to convert csv in key/value pair format to an associative array.
413
+ */
414
+ function csv_to_array( $csv ) {
415
+ $args = Array();
416
+ $v = str_getcsv( $csv );
417
+ $size = count( $v );
418
+ if ( is_array( $v ) && isset( $v[0] ) && $size >= 2 )
419
+ for( $i = 0; $i < $size; $i += 2 )
420
+ $args[ $v[ $i ] ] = $v[ $i + 1 ];
421
+ return $args;
422
+ }
423
+
424
+ /** Allow modules to use WP Filesystem if available and desired, fall back to PHP filesystem access otherwise. */
425
+ function use_wp_filesystem( $method = '', $form_fields = Array(), $url = '', $error = false ) {
426
+ $this->credentials = request_filesystem_credentials($url, $method, $error, false, $form_fields);
427
+ return $this->credentials;
428
+ }
429
+
430
+ /**
431
+ * Wrapper function to get filesystem object.
432
+ */
433
+ function get_filesystem_object( ) {
434
+ $cred = get_transient( 'aioseop_fs_credentials' );
435
+ if ( !empty( $cred ) ) $this->credentials = $cred;
436
+ if ( function_exists( 'WP_Filesystem' ) && ( WP_Filesystem( $this->credentials ) ) ) {
437
+ global $wp_filesystem;
438
+ return $wp_filesystem;
439
+ } else {
440
+ require_once( ABSPATH . 'wp-admin/includes/template.php' );
441
+ require_once( ABSPATH . 'wp-admin/includes/screen.php' );
442
+ require_once( ABSPATH . 'wp-admin/includes/file.php' );
443
+
444
+ if ( !WP_Filesystem( $this->credentials ) )
445
+ $this->use_wp_filesystem( '', Array(), '', true );
446
+ set_transient( 'aioseop_fs_credentials', $this->credentials, 10800 );
447
+ global $wp_filesystem;
448
+ if ( is_object( $wp_filesystem ) )
449
+ return $wp_filesystem;
450
+ }
451
+ return false;
452
+ }
453
+
454
+ /**
455
+ * See if a file exists using WP Filesystem.
456
+ */
457
+ function file_exists( $filename ) {
458
+ $wpfs = $this->get_filesystem_object();
459
+ if ( is_object( $wpfs ) )
460
+ return $wpfs->exists( $filename );
461
+ return $wpfs;
462
+ }
463
+
464
+ /**
465
+ * See if the directory entry is a file using WP Filesystem.
466
+ */
467
+ function is_file( $filename ) {
468
+ $wpfs = $this->get_filesystem_object();
469
+ if ( is_object( $wpfs ) )
470
+ return $wpfs->is_file( $filename );
471
+ return $wpfs;
472
+ }
473
+
474
+ /**
475
+ * List files in a directory using WP Filesystem.
476
+ */
477
+ function scandir( $path ) {
478
+ $wpfs = $this->get_filesystem_object();
479
+ if ( is_object( $wpfs ) ) {
480
+ $dirlist = $wpfs->dirlist( $path );
481
+ if ( empty( $dirlist ) ) return $dirlist;
482
+ return array_keys( $dirlist );
483
+ }
484
+ return $wpfs;
485
+ }
486
+
487
+ /**
488
+ * Load a file through WP Filesystem; implement basic support for offset and maxlen.
489
+ */
490
+ function load_file( $filename, $use_include_path = false, $context = null, $offset = -1, $maxlen = -1 ) {
491
+ $wpfs = $this->get_filesystem_object();
492
+ if ( is_object( $wpfs ) ) {
493
+ if ( !$wpfs->exists( $filename ) ) return false;
494
+ if ( ( $offset > 0 ) || ( $maxlen >= 0 ) ) {
495
+ if ( $maxlen === 0 ) return '';
496
+ if ( $offset < 0 ) $offset = 0;
497
+ $file = $wpfs->get_contents( $filename );
498
+ if ( !is_string( $file ) || empty( $file ) ) return $file;
499
+ if ( $maxlen < 0 )
500
+ return substr( $file, $offset );
501
+ else
502
+ return substr( $file, $offset, $maxlen );
503
+ } else {
504
+ return $wpfs->get_contents( $filename );
505
+ }
506
+ }
507
+ return false;
508
+ }
509
+
510
+ /**
511
+ * Save a file through WP Filesystem.
512
+ */
513
+ function save_file( $filename, $contents ) {
514
+ $failed_str = __( sprintf( "Failed to write file %s!\n", $filename ), 'all_in_one_seo_pack' );
515
+ $readonly_str = __( sprintf( "File %s isn't writable!\n", $filename ), 'all_in_one_seo_pack' );
516
+ $wpfs = $this->get_filesystem_object();
517
+ if ( is_object( $wpfs ) ) {
518
+ $file_exists = $wpfs->exists( $filename );
519
+ if ( !$file_exists || $wpfs->is_writable( $filename ) ) {
520
+ if ( $wpfs->put_contents( $filename, $contents ) === FALSE) return $this->output_error( $failed_str );
521
+ } else return $this->output_error( $readonly_str );
522
+ return true;
523
+ }
524
+ return false;
525
+ }
526
+
527
+ /**
528
+ * Delete a file through WP Filesystem.
529
+ */
530
+ function delete_file( $filename ) {
531
+ $wpfs = $this->get_filesystem_object();
532
+ if ( is_object( $wpfs ) ) {
533
+ if ( $wpfs->exists( $filename ) ) {
534
+ if ( $wpfs->delete( $filename ) === FALSE)
535
+ $this->output_error( __( sprintf( "Failed to delete file %s!\n", $filename ), 'all_in_one_seo_pack' ) );
536
+ else
537
+ return true;
538
+ } else $this->output_error( __( sprintf( "File %s doesn't exist!\n", $filename ), 'all_in_one_seo_pack' ) );
539
+ }
540
+ return false;
541
+ }
542
+
543
+ /**
544
+ * Rename a file through WP Filesystem.
545
+ */
546
+ function rename_file( $filename, $newname ) {
547
+ $wpfs = $this->get_filesystem_object();
548
+ if ( is_object( $wpfs ) ) {
549
+ $file_exists = $wpfs->exists( $filename );
550
+ $newfile_exists = $wpfs->exists( $newname );
551
+ if ( $file_exists && !$newfile_exists ) {
552
+ if ( $wpfs->move( $filename, $newname ) === FALSE)
553
+ $this->output_error( __( sprintf( "Failed to rename file %s!\n", $filename ), 'all_in_one_seo_pack' ) );
554
+ else
555
+ return true;
556
+ } else {
557
+ if ( !$file_exists )
558
+ $this->output_error( __( sprintf( "File %s doesn't exist!\n", $filename ), 'all_in_one_seo_pack' ) );
559
+ elseif ( $newfile_exists )
560
+ $this->output_error( __( sprintf( "File %s already exists!\n", $newname ), 'all_in_one_seo_pack' ) );
561
+ }
562
+ }
563
+ return false;
564
+ }
565
+
566
+ /**
567
+ * Load multiple files.
568
+ */
569
+ function load_files( $options, $opts, $prefix ) {
570
+ foreach ( $opts as $opt => $file ) {
571
+ $opt = $prefix . $opt;
572
+ $file = ABSPATH . $file;
573
+ $contents = $this->load_file( $file );
574
+ if ( $contents !== false ) $options[$opt] = $contents;
575
+ }
576
+ return $options;
577
+ }
578
+
579
+ /**
580
+ * Save multiple files.
581
+ */
582
+ function save_files( $opts, $prefix ) {
583
+ foreach ( $opts as $opt => $file ) {
584
+ $opt = $prefix . $opt;
585
+ if ( isset($_POST[$opt] ) ) {
586
+ $output = stripslashes_deep( $_POST[$opt] );
587
+ $file = ABSPATH . $file;
588
+ $this->save_file( $file, $output );
589
+ }
590
+ }
591
+ }
592
+
593
+ /**
594
+ * Delete multiple files.
595
+ */
596
+ function delete_files( $opts ) {
597
+ foreach ( $opts as $opt => $file ) {
598
+ $file = ABSPATH . $file;
599
+ $this->delete_file( $file );
600
+ }
601
+ }
602
+
603
+ /** crude approximization of whether current user is an admin */
604
+ function is_admin() {
605
+ return current_user_can( 'level_8' );
606
+ }
607
+
608
+ /**
609
+ * Load scripts and styles for metaboxes.
610
+ */
611
+ function enqueue_metabox_scripts( ) {
612
+ $screen = get_current_screen();
613
+ if ( empty( $screen ) ) return;
614
+ if ( ( $screen->base != 'post' ) && ( $screen->base != 'toplevel_page_shopp-products' ) ) return;
615
+ foreach( $this->locations as $k => $v ) {
616
+ if ( $v['type'] === 'metabox' ) {
617
+ if ( isset( $v['display'] ) && !empty( $v['display'] ) ) {
618
+ if ( ( ( ( $screen->base == 'toplevel_page_shopp-products' ) && in_array( 'shopp_product', $v['display'] ) ) )
619
+ || in_array( $screen->post_type, $v['display'] ) ) {
620
+ $this->enqueue_scripts();
621
+ $this->enqueue_styles();
622
+ }
623
+ }
624
+ }
625
+ }
626
+ }
627
+
628
+ /**
629
+ * Load styles for module.
630
+ */
631
+ function enqueue_styles( ) {
632
+ wp_enqueue_style( 'thickbox' );
633
+ if ( !empty( $this->pointers ) ) wp_enqueue_style( 'wp-pointer' );
634
+ wp_enqueue_style( 'aioseop-module-style', $this->plugin_path['url'] . 'aioseop_module.css' );
635
+ if ( function_exists( 'is_rtl' ) && is_rtl() )
636
+ wp_enqueue_style( 'aioseop-module-style-rtl', $this->plugin_path['url'] . 'aioseop_module-rtl.css', array('aioseop-module-style') );
637
+ }
638
+
639
+ /**
640
+ * Load scripts for module, can pass data to module script.
641
+ */
642
+ function enqueue_scripts( ) {
643
+ wp_enqueue_script( 'sack' );
644
+ wp_enqueue_script( 'jquery' );
645
+ wp_enqueue_script( 'media-upload' );
646
+ wp_enqueue_script( 'thickbox' );
647
+ wp_enqueue_script( 'common' );
648
+ wp_enqueue_script( 'wp-lists' );
649
+ wp_enqueue_script( 'postbox' );
650
+ if ( !empty( $this->pointers ) ) {
651
+ wp_enqueue_script( 'wp-pointer', false, array( 'jquery' ) );
652
+ $this->script_data['pointers'] = $this->pointers;
653
+ }
654
+ wp_enqueue_script( 'aioseop-module-script', $this->plugin_path['url'] . 'aioseop_module.js' );
655
+ if ( !empty( $this->script_data ) ) {
656
+ $data = Array( 'json' => json_encode( $this->script_data ) );
657
+ wp_localize_script( 'aioseop-module-script', 'aioseop_data', $data );
658
+ }
659
+ }
660
+
661
+ /**
662
+ * Override this to run code at the beginning of the settings page.
663
+ */
664
+ function settings_page_init() {
665
+
666
+ }
667
+
668
+ /**
669
+ * Filter out admin pointers that have already been clicked.
670
+ */
671
+ function filter_pointers() {
672
+ if ( !empty( $this->pointers ) ) {
673
+ $dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
674
+ foreach( $dismissed as $d )
675
+ if ( isset( $this->pointers[$d] ) )
676
+ unset( $this->pointers[$d] );
677
+ }
678
+ }
679
+
680
+ /**
681
+ * Add basic hooks when on the module's page.
682
+ */
683
+ function add_page_hooks() {
684
+ $hookname = current_filter();
685
+ if ( strpos( $hookname, 'load-' ) === 0 )
686
+ $this->pagehook = substr( $hookname, 5 );
687
+ $this->filter_pointers();
688
+ add_action( "admin_print_scripts", Array( $this, 'enqueue_scripts' ) );
689
+ add_action( "admin_print_styles", Array( $this, 'enqueue_styles' ) );
690
+ add_action( $this->prefix . 'settings_header', Array( $this, 'display_tabs' ) );
691
+ }
692
+
693
+ function add_admin_bar_submenu() {
694
+ global $aioseop_admin_menu, $wp_admin_bar;
695
+ if ( $aioseop_admin_menu ) {
696
+ if ( !empty( $this->menu_name ) )
697
+ $name = $this->menu_name;
698
+ else
699
+ $name = $this->name;
700
+
701
+ $hookname = plugin_basename( $this->file );
702
+ if ( function_exists( 'menu_page_url' ) )
703
+ $url = menu_page_url( $hookname, 0 );
704
+ else
705
+ $url = esc_url( admin_url( 'admin.php?page=' . $hookname ) );
706
+
707
+ if ( $this->locations === null )
708
+ $wp_admin_bar->add_menu( array( 'parent' => AIOSEOP_PLUGIN_DIRNAME, 'title' => $name, 'id' => $hookname, 'href' => $url ) );
709
+ else {
710
+ foreach( $this->locations as $k => $v ) {
711
+ if ( $v['type'] === 'settings' ) {
712
+ if ( $k === 'default' ) {
713
+ $wp_admin_bar->add_menu( array( 'parent' => AIOSEOP_PLUGIN_DIRNAME, 'title' => $name, 'id' => $hookname, 'href' => $url ) );
714
+ } else {
715
+ if ( !empty( $v['menu_name'] ) )
716
+ $name = $v['menu_name'];
717
+ else
718
+ $name = $v['name'];
719
+ $wp_admin_bar->add_menu( array( 'parent' => AIOSEOP_PLUGIN_DIRNAME, 'title' => $name, 'id' => $this->get_prefix( $k ) . $k, 'href' => esc_url( admin_url( 'admin.php?page=' . $this->get_prefix( $k ) . $k ) ) ) );
720
+ }
721
+ }
722
+ }
723
+ }
724
+ }
725
+ }
726
+
727
+ /**
728
+ * Collect metabox data together for tabbed metaboxes.
729
+ */
730
+ function filter_return_metaboxes( $args ) {
731
+ return array_merge( $args, $this->post_metaboxes );
732
+ }
733
+
734
+ /** Add submenu for module, call page hooks, set up metaboxes. */
735
+ function add_menu( $parent_slug ) {
736
+ if ( !empty( $this->menu_name ) )
737
+ $name = $this->menu_name;
738
+ else
739
+ $name = $this->name;
740
+ if ( $this->locations === null ) {
741
+ $hookname = add_submenu_page( $parent_slug, $name, $name, 'manage_options', plugin_basename( $this->file ), Array( $this, 'display_settings_page' ) );
742
+ add_action( "load-{$hookname}", Array( $this, 'add_page_hooks' ) );
743
+ return true;
744
+ }
745
+ foreach( $this->locations as $k => $v ) {
746
+ if ( $v['type'] === 'settings' ) {
747
+ if ( $k === 'default' ) {
748
+ if ( !empty( $this->menu_name ) )
749
+ $name = $this->menu_name;
750
+ else
751
+ $name = $this->name;
752
+ $hookname = add_submenu_page( $parent_slug, $name, $name, 'manage_options', plugin_basename( $this->file ), Array( $this, 'display_settings_page' ) );
753
+ } else {
754
+ if ( !empty( $v['menu_name'] ) )
755
+ $name = $v['menu_name'];
756
+ else
757
+ $name = $v['name'];
758
+ $hookname = add_submenu_page( $parent_slug, $name, $name, 'manage_options', $this->get_prefix( $k ) . $k, Array( $this, "display_settings_page_$k" ) );
759
+ }
760
+ add_action( "load-{$hookname}", Array( $this, 'add_page_hooks' ) );
761
+ } elseif ( $v['type'] === 'metabox' ) {
762
+ $this->setting_options( $k ); // hack -- make sure this runs anyhow, for now -- pdb
763
+ add_action( 'edit_post', array( $this, 'save_post_data' ) );
764
+ add_action( 'publish_post', array( $this, 'save_post_data' ) );
765
+ add_action( 'save_post', array( $this, 'save_post_data' ) );
766
+ add_action( 'edit_page_form', array( $this, 'save_post_data' ) );
767
+ if ( isset( $v['display'] ) && !empty( $v['display'] ) ) {
768
+ add_action( "admin_print_scripts", Array( $this, 'enqueue_metabox_scripts' ) );
769
+ if ( $this->tabbed_metaboxes )
770
+ add_filter( 'aioseop_add_post_metabox', Array( $this, 'filter_return_metaboxes' ) );
771
+ foreach ( $v['display'] as $posttype ) {
772
+ $v['location'] = $k;
773
+ $v['posttype'] = $posttype;
774
+ if ( !isset($v['context'] ) ) $v['context'] = 'advanced';
775
+ if ( !isset($v['priority'] ) ) $v['priority'] = 'default';
776
+ if ( $this->tabbed_metaboxes ) {
777
+ $this->post_metaboxes[] = Array( 'id' => $v['prefix'] . $k, 'title' => $v['name'], 'callback' => Array( $this, 'display_metabox' ),
778
+ 'post_type' => $posttype, 'context' => $v['context'], 'priority' => $v['priority'], 'callback_args' => $v );
779
+ } else {
780
+ $title = $v['name'];
781
+ if ( $title != $this->plugin_name ) $title = $this->plugin_name . ' - ' . $title;
782
+ add_meta_box( $v['prefix'] . $k, $title, Array( $this, 'display_metabox' ), $posttype, $v['context'], $v['priority'], $v );
783
+ }
784
+ }
785
+ }
786
+ }
787
+ }
788
+ }
789
+
790
+ /**
791
+ * Update postmeta for metabox.
792
+ */
793
+ function save_post_data( $post_id ) {
794
+ if ( $this->locations !== null ) {
795
+ foreach( $this->locations as $k => $v ) {
796
+ if ( isset($v['type']) && ( $v['type'] === 'metabox' ) ) {
797
+ $opts = $this->default_options( $k );
798
+ $options = Array();
799
+ $update = false;
800
+ foreach ( $opts as $l => $o ) {
801
+ if ( isset($_POST[$l] ) ) {
802
+ $options[$l] = stripslashes_deep( $_POST[$l] );
803
+ $options[$l] = esc_attr( $options[$l] );
804
+ $update = true;
805
+ }
806
+ }
807
+ if ( $update ) update_post_meta( $post_id, '_' . $this->get_prefix($k) . $k, $options );
808
+ }
809
+ }
810
+ }
811
+ }
812
+
813
+ /**
814
+ * Outputs radio buttons, checkboxes, selects, multiselects, handles groups.
815
+ */
816
+ function do_multi_input( $args ) {
817
+ extract( $args );
818
+ $buf1 = '';
819
+ $type = $options['type'];
820
+ if ( ( $type == 'radio' ) || ( $type == 'checkbox' ) ) {
821
+ $strings = Array(
822
+ 'block' => "%s\n",
823
+ 'group' => "\t<b>%s</b><br>\n%s\n",
824
+ 'item' => "\t<label class='aioseop_option_setting_label'><input type='$type' %s name='%s' value='%s' %s> %s</label>\n",
825
+ 'item_args' => Array( 'sel', 'name', 'v', 'attr', 'subopt' ),
826
+ 'selected' => 'checked '
827
+ );
828
+ } else {
829
+ $strings = Array(
830
+ 'block' => "<select name='$name' $attr>%s\n</select>\n",
831
+ 'group' => "\t<optgroup label='%s'>\n%s\t</optgroup>\n",
832
+ 'item' => "\t<option %s value='%s'>%s</option>\n",
833
+ 'item_args' => Array( 'sel', 'v', 'subopt' ),
834
+ 'selected' => 'selected '
835
+ );
836
+ }
837
+ $setsel = $strings['selected'];
838
+ if ( isset($options['initial_options'] ) && is_array($options['initial_options']) ) {
839
+ foreach ( $options['initial_options'] as $l => $option ) {
840
+ $is_group = is_array( $option );
841
+ if ( !$is_group ) $option = Array( $l => $option );
842
+ $buf2 = '';
843
+ foreach ( $option as $v => $subopt ) {
844
+ $sel = '';
845
+ $is_arr = is_array( $value );
846
+ if ( is_string( $v ) || is_string( $value ) )
847
+ $cmp = !strcmp( (string)$v, (string)$value );
848
+ else
849
+ $cmp = ( $value == $v );
850
+ if ( ( !$is_arr && $cmp ) || ( $is_arr && in_array( $v, $value ) ) )
851
+ $sel = $setsel;
852
+ $item_arr = Array();
853
+ foreach( $strings['item_args'] as $arg ) $item_arr[] = $$arg;
854
+ $buf2 .= vsprintf( $strings['item'], $item_arr );
855
+ }
856
+ if ( $is_group )
857
+ $buf1 .= sprintf( $strings['group'], $l, $buf2);
858
+ else
859
+ $buf1 .= $buf2;
860
+ }
861
+ $buf1 = sprintf( $strings['block'], $buf1 );
862
+ }
863
+ return $buf1;
864
+ }
865
+
866
+ /**
867
+ * Outputs a setting item for settings pages and metaboxes.
868
+ */
869
+ function get_option_html( $args ) {
870
+ static $n = 0;
871
+ extract( $args );
872
+ if ( $options['type'] == 'custom' )
873
+ return apply_filters( "{$prefix}output_option", '', $args );
874
+ if ( in_array( $options['type'], Array( 'multiselect', 'select', 'multicheckbox', 'radio', 'checkbox', 'textarea', 'text', 'submit', 'hidden' ) ) )
875
+ $value = esc_attr( $value );
876
+ $buf = '';
877
+ if ( !empty( $options['count'] ) ) {
878
+ $n++;
879
+ $attr .= " onKeyDown='countChars(document.post.$name,document.post.length$n)' onKeyUp='countChars(document.post.$name,document.post.length$n)'";
880
+ }
881
+ if ( isset( $opts['id'] ) ) $attr .= " id=\"{$opts['id']}\" ";
882
+ switch ( $options['type'] ) {
883
+ case 'multiselect': $attr .= ' MULTIPLE';
884
+ $args['attr'] = $attr;
885
+ $args['name'] = $name = "{$name}[]";
886
+ case 'select': $buf .= $this->do_multi_input( $args ); break;
887
+ case 'multicheckbox': $args['name'] = $name = "{$name}[]";
888
+ $args['options']['type'] = $options['type'] = 'checkbox';
889
+ case 'radio': $buf .= $this->do_multi_input( $args ); break;
890
+ case 'checkbox': if ( $value ) $attr .= ' CHECKED';
891
+ $buf .= "<input name='$name' type='{$options['type']}' $attr>\n"; break;
892
+ case 'textarea': $buf .= "<textarea name='$name' $attr>$value</textarea>"; break;
893
+ case 'image': $buf .= "<input class='aioseop_upload_image_button button-primary' type='button' value='Upload Image' style='float:left;' />" .
894
+ "<input class='aioseop_upload_image_label' name='$name' type='text' readonly $attr value='$value' size=57 style='float:left;clear:left;'>\n";
895
+ break;
896
+ case 'html': $buf .= $value; break;
897
+ default: $buf .= "<input name='$name' type='{$options['type']}' $attr value='$value'>\n";
898
+ }
899
+ if ( !empty( $options['count'] ) ) {
900
+ $size = 60;
901
+ if ( isset( $options['size'] ) ) $size = $options['size'];
902
+ elseif ( isset( $options['rows'] ) && isset( $options['cols'] ) ) $size = $options['rows'] * $options['cols'];
903
+ $buf .= "<br /><input readonly type='text' name='length$n' size='3' maxlength='3' style='width:53px;height:23px;margin:0px;padding:0px 0px 0px 10px;' value='" . strlen($value) . "' />"
904
+ . sprintf( __(' characters. Most search engines use a maximum of %s chars for the %s.', 'all_in_one_seo_pack'), $size, strtolower( $options['name'] ) );
905
+ }
906
+ return $buf;
907
+ }
908
+
909
+ const DISPLAY_HELP_START = '<a class="aioseop_help_text_link" style="cursor:pointer;" title="%s" onclick="toggleVisibility(\'%s_tip\');"><label class="aioseop_label textinput">%s</label></a>';
910
+ const DISPLAY_HELP_END = '<div class="aioseop_help_text_div" style="display:none" id="%s_tip"><label class="aioseop_help_text">%s</label></div>';
911
+ const DISPLAY_LABEL_FORMAT = '<span class="aioseop_option_label" style="text-align:%s;vertical-align:top;">%s</span>';
912
+ const DISPLAY_TOP_LABEL = "</div>\n<div class='aioseop_input aioseop_top_label'>\n";
913
+ const DISPLAY_ROW_TEMPLATE = '<div class="aioseop_wrapper%s" id="%s_wrapper"><div class="aioseop_input">%s<span class="aioseop_option_input"><div class="aioseop_option_div" %s>%s</div>%s</span><p style="clear:left"></p></div></div>';
914
+
915
+ /**
916
+ * Format a row for an option on a settings page.
917
+ */
918
+ function get_option_row( $name, $opts, $args ) {
919
+ $label_text = $input_attr = $help_text_2 = $id_attr = '';
920
+ if ( $opts['label'] == 'top' )
921
+ $align = 'left';
922
+ else
923
+ $align = 'right';
924
+ if ( isset( $opts['id'] ) ) $id_attr .= " id=\"{$opts['id']}_div\" ";
925
+ if ( $opts['label'] != 'none' ) {
926
+ if ( isset( $opts['help_text'] ) ) {
927
+ $help_text = sprintf( All_in_One_SEO_Pack_Module::DISPLAY_HELP_START, __( 'Click for Help!', 'all_in_one_seo_pack' ), $name, $opts['name'] );
928
+ $help_text_2 = sprintf( All_in_One_SEO_Pack_Module::DISPLAY_HELP_END, $name, $opts['help_text'] );
929
+ } else $help_text = $opts['name'];
930
+ $label_text = sprintf( All_in_One_SEO_Pack_Module::DISPLAY_LABEL_FORMAT, $align, $help_text );
931
+ } else $input_attr .= ' aioseop_no_label ';
932
+ if ( $opts['label'] == 'top' ) $label_text .= All_in_One_SEO_Pack_Module::DISPLAY_TOP_LABEL;
933
+ $input_attr .= " aioseop_{$opts['type']}_type";
934
+ return sprintf( All_in_One_SEO_Pack_Module::DISPLAY_ROW_TEMPLATE, $input_attr, $name, $label_text, $id_attr, $this->get_option_html( $args ), $help_text_2 );
935
+ }
936
+
937
+ /**
938
+ * Display options for settings pages and metaboxes, allows for filtering settings, custom display options.
939
+ */
940
+ function display_options( $location = null, $meta_args = null ) {
941
+ static $location_settings = Array();
942
+ $defaults = null;
943
+ $prefix = $this->get_prefix( $location );
944
+ if ( is_array( $meta_args['args'] ) && !empty( $meta_args['args']['default_options'] ) )
945
+ $defaults = $meta_args['args']['default_options'];
946
+ if ( !isset( $location_settings[$prefix] ) ) {
947
+ $current_options = apply_filters( "{$this->prefix}display_options", $this->get_current_options( Array(), $location, $defaults ), $location );
948
+ $settings = apply_filters( "{$this->prefix}display_settings", $this->setting_options( $location, $defaults ), $location, $current_options );
949
+ $location_settings[$prefix]['current_options'] = $current_options;
950
+ $location_settings[$prefix]['settings'] = $settings;
951
+ } else {
952
+ $current_options = $location_settings[$prefix]['current_options'];
953
+ $settings = $location_settings[$prefix]['settings'];
954
+ }
955
+ // $opts["snippet"]["default"] = sprintf( $opts["snippet"]["default"], "foo", "bar", "moby" );
956
+ $container = "<div class='aioseop aioseop_options {$this->prefix}settings'>";
957
+ if ( is_array( $meta_args['args'] ) && !empty( $meta_args['args']['options'] ) ) {
958
+ $args = Array();
959
+ $arg_keys = Array();
960
+ foreach ( $meta_args['args']['options'] as $a ) {
961
+ if ( !empty($location) ) {
962
+ $key = $prefix . $location . '_' . $a;
963
+ if ( !isset( $settings[$key] ) ) $key = $a;
964
+ } else $key = $prefix . $a;
965
+ if ( isset( $settings[$key] ) ) $arg_keys[$key] = 1;
966
+ elseif ( isset( $settings[$a] ) ) $arg_keys[$a] = 1;
967
+ }
968
+ $setting_keys = array_keys( $settings );
969
+ foreach ( $setting_keys as $s )
970
+ if ( !empty( $arg_keys[$s] ) ) $args[$s] = $settings[$s];
971
+ } else $args = $settings;
972
+ foreach ( $args as $name => $opts ) {
973
+ $attr_list = Array( 'class', 'style', 'readonly', 'disabled', 'size' );
974
+ if ( $opts['type'] == 'textarea' ) $attr_list = array_merge( $attr_list, Array('rows', 'cols') );
975
+ $attr = '';
976
+ foreach ( $attr_list as $a )
977
+ if ( isset( $opts[$a] ) ) $attr .= " $a=\"{$opts[$a]}\" ";
978
+ $opt = '';
979
+ if ( isset( $current_options[$name] ) ) $opt = $current_options[$name];
980
+ if ( $opts['label'] == 'none' && $opts['type'] == 'submit' && $opts['save'] == false ) $opt = $opts['name'];
981
+ if ( $opts['type'] == 'html' && empty( $opt ) && $opts['save'] == false ) $opt = $opts['default'];
982
+
983
+ $args = Array( 'name' => $name, 'options' => $opts, 'attr' => $attr, 'value' => $opt, 'prefix' => $prefix );
984
+ if ( !empty( $opts['nowrap'] ) )
985
+ echo $this->get_option_html( $args );
986
+ else {
987
+ if ( $container ) {
988
+ echo $container;
989
+ $container = '';
990
+ }
991
+ echo $this->get_option_row( $name, $opts, $args );
992
+ }
993
+ }
994
+ if ( !$container ) echo "</div>";
995
+ }
996
+
997
+ /** Sanitize options */
998
+ function sanitize_options( $location = null ) {
999
+ foreach ( $this->setting_options( $location ) as $k => $v ) {
1000
+ if ( isset( $this->options[$k] ) ) {
1001
+ if ( !empty( $v['sanitize'] ) )
1002
+ $type = $v['sanitize'];
1003
+ else
1004
+ $type = $v['type'];
1005
+ switch ( $type ) {
1006
+ case 'multiselect':
1007
+ case 'multicheckbox': $this->options[$k] = urlencode_deep( $this->options[$k] );
1008
+ break;
1009
+ case 'textarea': $this->options[$k] = wp_kses_post( $this->options[$k] );
1010
+ $this->options[$k] = htmlspecialchars( $this->options[$k], ENT_QUOTES );
1011
+ break;
1012
+ case 'filename': $this->options[$k] = sanitize_file_name( $this->options[$k] );
1013
+ break;
1014
+ case 'text': $this->options[$k] = wp_kses_post( $this->options[$k] );
1015
+ case 'checkbox':
1016
+ case 'radio':
1017
+ case 'select':
1018
+ default: $this->options[$k] = esc_attr( $this->options[$k] );
1019
+ }
1020
+ }
1021
+ }
1022
+ }
1023
+
1024
+ /**
1025
+ * Display metaboxes with display_options()
1026
+ */
1027
+ function display_metabox( $post, $metabox ) {
1028
+ $this->display_options( $metabox['args']['location'], $metabox );
1029
+ }
1030
+
1031
+ /**
1032
+ * Handle resetting options to defaults.
1033
+ */
1034
+ function reset_options( $location = null, $delete = false ) {
1035
+ if ( $delete === true ) {
1036
+ $this->delete_class_option( $delete );
1037
+ $this->options = Array();
1038
+ }
1039
+ $default_options = $this->default_options( $location );
1040
+ foreach ( $default_options as $k => $v ) {
1041
+ $this->options[$k] = $v;
1042
+ }
1043
+ $this->update_class_option( $this->options );
1044
+ }
1045
+
1046
+ /** handle option resetting and updating */
1047
+ function handle_settings_updates( $location = null ) {
1048
+ $message = '';
1049
+ if ( (isset($_POST['action']) && $_POST['action'] == 'aiosp_update_module' &&
1050
+ ( isset( $_POST['Submit_Default'] ) || isset( $_POST['Submit_All_Default'] ) || !empty( $_POST['Submit'] ) ) ) ) {
1051
+ $nonce = $_POST['nonce-aioseop'];
1052
+ if (!wp_verify_nonce($nonce, 'aioseop-nonce')) die ( __( 'Security Check - If you receive this in error, log out and back in to WordPress', 'all_in_one_seo_pack' ) );
1053
+ if ( isset( $_POST['Submit_Default'] ) || isset( $_POST['Submit_All_Default'] ) ) {
1054
+ $message = __( "Options Reset.", 'all_in_one_seo_pack' );
1055
+ if ( isset($_POST['Submit_All_Default']) ) {
1056
+ $this->reset_options( $location, true );
1057
+ do_action( 'aioseop_options_reset' );
1058
+ } else {
1059
+ $this->reset_options( $location );
1060
+ }
1061
+ }
1062
+ if ( !empty( $_POST['Submit'] ) ) {
1063
+ $message = __("All in One SEO Options Updated.", 'all_in_one_seo_pack');
1064
+ $default_options = $this->default_options( $location );
1065
+ foreach( $default_options as $k => $v ) {
1066
+ if ( isset( $_POST[$k] ) )
1067
+ $this->options[$k] = stripslashes_deep( $_POST[$k] );
1068
+ else
1069
+ $this->options[$k] = '';
1070
+ }
1071
+ $this->sanitize_options( $location );
1072
+ $this->options = apply_filters( $this->prefix . 'update_options', $this->options, $location );
1073
+ $this->update_class_option( $this->options );
1074
+ wp_cache_flush();
1075
+ }
1076
+ do_action( $this->prefix . 'settings_update', $this->options, $location );
1077
+ }
1078
+ return $message;
1079
+ }
1080
+
1081
+ /** Update / reset settings, printing options, sanitizing, posting back */
1082
+ function display_settings_page( $location = null ) {
1083
+ if ( $location != null ) $location_info = $this->locations[$location];
1084
+ $name = null;
1085
+ if ( ( $location ) && ( isset( $location_info['name'] ) ) ) $name = $location_info['name'];
1086
+ if ( !$name ) $name = $this->name;
1087
+ $message = $this->handle_settings_updates( $location );
1088
+ $this->settings_page_init();
1089
+ ?>
1090
+ <div class="wrap <?php echo get_class( $this ); ?>">
1091
+ <div id="aioseop_settings_header">
1092
+ <?php if ( !empty( $message ) ) echo "<div id=\"message\" class=\"updated fade\"><p>$message</p></div>"; ?>
1093
+ <div id="icon-aioseop" class="icon32"><br></div><h2><?php echo $name; ?></h2>
1094
+ <div id="dropmessage" class="updated" style="display:none;"></div>
1095
+ </div>
1096
+ <?php
1097
+ do_action( 'aioseop_global_settings_header', $location );
1098
+ do_action( $this->prefix . 'settings_header', $location );
1099
+ ?> <form id="aiosp_settings_form" name="dofollow" enctype="multipart/form-data" action="" method="post">
1100
+ <div id="aioseop_top_button">
1101
+ <?php
1102
+ $submit_options = Array('action' => Array( 'type' => 'hidden', 'value' => 'aiosp_update_module' ),
1103
+ 'module' => Array( 'type' => 'hidden', 'value' => get_class( $this ) ),
1104
+ 'location' => Array( 'type' => 'hidden', 'value' => $location ),
1105
+ 'nonce-aioseop' => Array( 'type' => 'hidden', 'value' => wp_create_nonce('aioseop-nonce') ),
1106
+ 'page_options' => Array( 'type' => 'hidden', 'value' => 'aiosp_home_description' ),
1107
+ 'Submit' => Array( 'type' => 'submit', 'class' => 'button-primary', 'value' => __('Update Options', 'all_in_one_seo_pack') . ' &raquo;' ),
1108
+ 'Submit_Default'=> Array( 'type' => 'submit', 'class' => 'button-primary', 'value' => __( sprintf( 'Reset %s Settings to Defaults', $name ), 'all_in_one_seo_pack') . ' &raquo;' )
1109
+ );
1110
+ $submit_options = apply_filters( "{$this->prefix}submit_options", $submit_options, $location );
1111
+ foreach ( $submit_options as $k => $s ) {
1112
+ if ( $s['type'] == 'submit' && $k != 'Submit' ) continue;
1113
+ $class = '';
1114
+ if ( isset( $s['class'] ) ) $class = " class='{$s['class']}' ";
1115
+ echo $this->get_option_html( Array( 'name' => $k, 'options' => $s, 'attr' => $class, 'value' => $s['value'] ) );
1116
+ }
1117
+ ?>
1118
+ </div>
1119
+ <div class="aioseop_options_wrapper aioseop_settings_left">
1120
+ <?php $opts = $this->get_class_option();
1121
+ if ($opts !== FALSE) $this->options = $opts;
1122
+ if ( is_array( $this->layout ) ) {
1123
+ foreach( $this->layout as $l => $lopts ) {
1124
+ if ( !isset( $lopts['tab'] ) || ( $this->current_tab == $lopts['tab'] ) )
1125
+ add_meta_box( $this->get_prefix( $location ) . $l . "_metabox", $lopts['name'], array($this, 'display_options' ),
1126
+ "{$this->prefix}settings", 'advanced', 'default', $lopts );
1127
+ }
1128
+ } else add_meta_box( $this->get_prefix( $location ) . "metabox", $name, array($this, 'display_options'), "{$this->prefix}settings", 'advanced');
1129
+ do_meta_boxes( "{$this->prefix}settings", 'advanced', $location );
1130
+ ?> <p class="submit" style="clear:both;"><?php
1131
+ foreach( Array( 'action', 'nonce-aioseop', 'page_options' ) as $submit_field )
1132
+ if ( isset( $submit_field ) ) unset( $submit_field );
1133
+ foreach ( $submit_options as $k => $s ) {
1134
+ $class = '';
1135
+ if ( isset( $s['class'] ) ) $class = " class='{$s['class']}' ";
1136
+ echo $this->get_option_html( Array( 'name' => $k, 'options' => $s, 'attr' => $class, 'value' => $s['value'] ) );
1137
+ }
1138
+ ?> </p>
1139
+ </div>
1140
+ </form>
1141
+ <?php do_action( $this->prefix . 'settings_footer', $location );
1142
+ do_action( 'aioseop_global_settings_footer', $location ); ?>
1143
+ </div> <?php
1144
+ }
1145
+
1146
+ /**
1147
+ * Get the prefix used for a given location.
1148
+ */
1149
+ function get_prefix( $location = null ) {
1150
+ if ( ($location != null ) && isset($this->locations[$location]['prefix'] ) )
1151
+ return $this->locations[$location]['prefix'];
1152
+ return $this->prefix;
1153
+ }
1154
+
1155
+ /** Sets up initial settings */
1156
+ function setting_options( $location = null, $defaults = null ) {
1157
+ if ( $defaults === null )
1158
+ $defaults = $this->default_options;
1159
+ $prefix = $this->get_prefix( $location );
1160
+ $opts = Array();
1161
+ if ( $location == null || $this->locations[$location]['options'] === null )
1162
+ $options = $defaults;
1163
+ else {
1164
+ $options = Array();
1165
+ $prefix = "{$prefix}{$location}_";
1166
+ if ( !empty( $this->locations[$location]['default_options'] ) )
1167
+ $options = $this->locations[$location]['default_options'];
1168
+ foreach( $this->locations[$location]['options'] as $opt ) {
1169
+ if ( isset( $defaults[$opt] ) )
1170
+ $options[$opt] = $defaults[$opt];
1171
+ }
1172
+ }
1173
+ if ( !$prefix ) $prefix = $this->prefix;
1174
+ if ( !empty( $options ) )
1175
+ foreach ($options as $k => $v) {
1176
+ if ( !isset( $v['name'] ) ) $v['name'] = ucwords( strtr( $k, '_', ' ' ) );
1177
+ if ( !isset( $v['type'] ) ) $v['type'] = 'checkbox';
1178
+ if ( !isset( $v['default'] ) ) $v['default'] = null;
1179
+ if ( !isset( $v['initial_options'] ) ) $v['initial_options'] = $v['default'];
1180
+ if ( $v['type'] == 'custom' && ( !isset( $v['nowrap'] ) ) ) $v['nowrap'] = true;
1181
+ elseif ( !isset( $v['nowrap'] ) ) $v['nowrap'] = null;
1182
+ if ( isset( $v['condshow'] ) ) {
1183
+ if ( !is_array( $this->script_data ) ) $this->script_data = Array();
1184
+ if ( !isset( $this->script_data['condshow'] ) ) $this->script_data['condshow'] = Array();
1185
+ $this->script_data['condshow'][$prefix . $k] = $v['condshow'];
1186
+ }
1187
+ if ( $v['type'] == 'submit' ) {
1188
+ if ( !isset($v['save'] ) ) $v['save'] = false;
1189
+ if ( !isset($v['label'] ) ) $v['label'] = 'none';
1190
+ if ( !isset($v['prefix'] ) ) $v['prefix'] = false;
1191
+ } else {
1192
+ if ( !isset($v['label'] ) ) $v['label'] = null;
1193
+ }
1194
+ if ( $v['type'] == 'hidden' ) {
1195
+ if ( !isset($v['label']) ) $v['label'] = 'none';
1196
+ if ( !isset($v['prefix']) ) $v['prefix'] = false;
1197
+ }
1198
+ if ( ( $v['type'] == 'text' ) && ( !isset( $v['size'] ) ) ) $v['size'] = 57;
1199
+ if ( $v['type'] == 'textarea' ) {
1200
+ if ( !isset($v['cols'])) $v['cols'] = 57;
1201
+ if ( !isset($v['rows'])) $v['rows'] = 2;
1202
+ }
1203
+ if ( !isset($v['save']) ) $v['save'] = true;
1204
+ if ( !isset($v['prefix']) ) $v['prefix'] = true;
1205
+ if ( $v['prefix'] )
1206
+ $opts[$prefix . $k] = $v;
1207
+ else
1208
+ $opts[$k] = $v;
1209
+ }
1210
+ return $opts;
1211
+ }
1212
+
1213
+ /** Generates just the default option names and values */
1214
+ function default_options( $location = null, $defaults = null ) {
1215
+ $options = $this->setting_options( $location, $defaults );
1216
+ $opts = Array();
1217
+ foreach ( $options as $k => $v ) if ( $v['save'] ) $opts[$k] = $v['default'];
1218
+ return $opts;
1219
+ }
1220
+
1221
+ /** Gets the current options stored for a given location. */
1222
+ function get_current_options( $opts = Array(), $location = null, $defaults = null, $post = null ) {
1223
+ $prefix = $this->get_prefix( $location );
1224
+ $get_opts = '';
1225
+ if ( empty( $location ) )
1226
+ $type = 'settings';
1227
+ else
1228
+ $type = $this->locations[$location]['type'];
1229
+ if ( $type === 'settings' ) {
1230
+ $get_opts = $this->get_class_option();
1231
+ } elseif ( $type == 'metabox' ) {
1232
+ if ( $post == null ) {
1233
+ global $post;
1234
+ }
1235
+ if ( isset( $post ) ) {
1236
+ $get_opts = '_' . $prefix . $location;
1237
+ $get_opts = get_post_meta( $post->ID, $get_opts, true );
1238
+ }
1239
+ }
1240
+ $defs = $this->default_options( $location, $defaults );
1241
+ if ($get_opts == '')
1242
+ $get_opts = $defs;
1243
+ else
1244
+ $get_opts = wp_parse_args( $get_opts, $defs );
1245
+ $opts = wp_parse_args( $opts, $get_opts );
1246
+ return $opts;
1247
+ }
1248
+
1249
+ /** Updates the options array in the module; loads saved settings with get_option() or uses defaults */
1250
+ function update_options( $opts = Array(), $location = null, $defaults = null ) {
1251
+ if ($location === null )
1252
+ $type = 'settings';
1253
+ else
1254
+ $type = $this->locations[$location][$type];
1255
+ if ( $type === 'settings' ) {
1256
+ $get_opts = $this->get_class_option();
1257
+ }
1258
+ if ($get_opts === FALSE)
1259
+ $get_opts = $this->default_options( $location, $defaults );
1260
+ else
1261
+ $this->setting_options( $location, $defaults ); // hack -- make sure this runs anyhow, for now -- pdb
1262
+ $this->options = wp_parse_args( $opts, $get_opts );
1263
+ }
1264
+ }
1265
+ }
aioseop_module_manager.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package All-in-One-SEO-Pack
4
+ */
5
+ /**
6
+ * The Module Manager.
7
+ */
8
+ if ( !class_exists( 'All_in_One_SEO_Pack_Module_Manager' ) ) {
9
+ class All_in_One_SEO_Pack_Module_Manager {
10
+ protected $modules = Array();
11
+ protected $settings_update = false;
12
+ protected $settings_reset = false;
13
+ protected $settings_reset_all = false;
14
+ protected $module_settings_update = false;
15
+ // initialize module list
16
+ function All_in_One_SEO_Pack_Module_Manager( $mod ) {
17
+ $this->modules['feature_manager'] = null;
18
+ foreach ( $mod as $m ) $this->modules[$m] = null;
19
+ $reset = false;
20
+ $reset_all = ( isset( $_POST['Submit_All_Default'] ) && $_POST['Submit_All_Default']!='' );
21
+ $reset = ( ( isset( $_POST['Submit_Default'] ) && $_POST['Submit_Default']!='' ) || $reset_all );
22
+ $update = ( isset($_POST['action']) && $_POST['action']
23
+ && ( ( isset( $_POST['Submit'] ) && $_POST['Submit']!='' ) || $reset )
24
+ );
25
+ if ( $update ) {
26
+ if ( $reset ) $this->settings_reset = true;
27
+ if ( $reset_all ) $this->settings_reset_all = true;
28
+ if ( $_POST['action'] == 'aiosp_update' ) $this->settings_update = true;
29
+ if ( $_POST['action'] == 'aiosp_update_module' ) $this->module_settings_update = true;
30
+ }
31
+ $this->do_load_module( 'feature_manager', $mod );
32
+ }
33
+
34
+ function return_module( $class ) {
35
+ global $aiosp;
36
+ if ( $class == get_class( $aiosp ) ) return $aiosp;
37
+ if ( $class == get_class( $this ) ) return $this;
38
+ foreach( $this->modules as $m )
39
+ if ( $class == get_class( $m ) ) return $m;
40
+ return false;
41
+ }
42
+
43
+ // Module name is used for these automatic settings:
44
+ // The aiosp_enable_$module settings - whether each plugin is active or not
45
+ // The name of the .php file containing the module - aioseop_$module.php
46
+ // The name of the class - All_in_One_SEO_Pack_$Module
47
+ // The global $aioseop_$module
48
+ // $this->modules[$module]
49
+ function do_load_module( $mod, $args = null ) {
50
+ $mod_path = apply_filters( "aioseop_include_$mod", AIOSEOP_PLUGIN_DIR . "aioseop_$mod.php" );
51
+ if ( !empty( $mod_path ) )
52
+ require_once( $mod_path );
53
+ $ref = "aioseop_$mod";
54
+ $classname = "All_in_One_SEO_Pack_" . strtr( ucwords( strtr( $mod, '_', ' ' ) ), ' ', '_' );
55
+ $classname = apply_filters( "aioseop_class_$mod", $classname );
56
+ $module_class = new $classname( $args );
57
+ $GLOBALS[$ref] = $module_class;
58
+ $this->modules[$mod] = $module_class;
59
+ if ( is_user_logged_in() && function_exists( 'is_admin_bar_showing' ) && is_admin_bar_showing() && current_user_can( 'manage_options' ) )
60
+ add_action( 'admin_bar_menu', array( $module_class, 'add_admin_bar_submenu' ), 1001 + $module_class->menu_order() );
61
+ if ( is_admin() ) {
62
+ add_action( 'aioseop_modules_add_menus', Array( $module_class, 'add_menu' ), $module_class->menu_order() );
63
+ add_action( 'aiosoep_options_reset', Array( $module_class, 'reset_options' ) );
64
+ add_filter( 'aioseop_export_settings', Array( $module_class, 'settings_export' ) );
65
+ }
66
+ return true;
67
+ }
68
+
69
+ function load_module( $mod ) {
70
+ static $feature_options = null;
71
+ static $feature_prefix = null;
72
+ if ( !is_array( $this->modules ) ) return false;
73
+ $v = $this->modules[ $mod ];
74
+ if ( $v !== null ) return false; // already loaded
75
+ $mod_enable = false;
76
+ $fm_page = ( $this->module_settings_update && wp_verify_nonce( $_POST['nonce-aioseop'], 'aioseop-nonce' ) &&
77
+ isset($_REQUEST['page']) && $_REQUEST['page'] == trailingslashit( AIOSEOP_PLUGIN_DIRNAME ) . 'aioseop_feature_manager.php' );
78
+ if ( $fm_page && !$this->settings_reset ) {
79
+ if ( isset( $_POST["aiosp_feature_manager_enable_$mod"] ) )
80
+ $mod_enable = $_POST["aiosp_feature_manager_enable_$mod"];
81
+ else
82
+ $mod_enable = false;
83
+ } else {
84
+ if ( $feature_prefix == null )
85
+ $feature_prefix = $this->modules['feature_manager']->get_prefix();
86
+ if ( $fm_page && $this->settings_reset )
87
+ $feature_options = $this->modules['feature_manager']->default_options();
88
+ if ( $feature_options == null ) {
89
+ if ( $this->module_settings_update && wp_verify_nonce( $_POST['nonce-aioseop'], 'aioseop-nonce' ) && $this->settings_reset_all )
90
+ $feature_options = $this->modules['feature_manager']->default_options();
91
+ else
92
+ $feature_options = $this->modules['feature_manager']->get_current_options();
93
+ }
94
+ if ( isset( $feature_options["{$feature_prefix}enable_$mod"] ) )
95
+ $mod_enable = $feature_options["{$feature_prefix}enable_$mod"];
96
+ }
97
+ if ( $mod_enable ) return $this->do_load_module( $mod );
98
+ return false;
99
+ }
100
+
101
+ function load_modules() {
102
+ if ( is_array( $this->modules ) )
103
+ foreach( $this->modules as $k => $v )
104
+ $this->load_module( $k );
105
+ }
106
+ }
107
+ }
aioseop_performance.php ADDED
@@ -0,0 +1,248 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package All-in-One-SEO-Pack
4
+ */
5
+ /**
6
+ * The Performance class.
7
+ */
8
+ if ( !class_exists( 'All_in_One_SEO_Pack_Performance' ) ) {
9
+ class All_in_One_SEO_Pack_Performance extends All_in_One_SEO_Pack_Module {
10
+
11
+ protected $module_info = Array( );
12
+
13
+ function All_in_One_SEO_Pack_Performance( $mod ) {
14
+ $this->name = __('Performance', 'all_in_one_seo_pack'); // Human-readable name of the plugin
15
+ $this->prefix = 'aiosp_performance_'; // option prefix
16
+ $this->file = __FILE__; // the current file
17
+ parent::__construct();
18
+ $this->default_options = array(
19
+ 'memory_limit' => Array( 'name' => __( 'Raise memory limit', 'all_in_one_seo_pack' ),
20
+ 'help_text' => __( 'Allows you to raise your PHP memory limit to a reasonable value. Note: WordPress core and other WordPress plugins may also change the value of the memory limit.', 'all_in_one_seo_pack' ),
21
+ 'default' => '256M',
22
+ 'type' => 'select',
23
+ 'initial_options' => Array( 0 => __( "Use the system default", 'all_in_one_seo_pack' ), '32M' => '32MB', '64M' => '64MB', '128M' => '128MB', '256M' => '256MB' ) ),
24
+ 'execution_time' => Array( 'name' => __( 'Raise execution time', 'all_in_one_seo_pack' ),
25
+ 'help_text' => __( 'Allows you to raise your PHP execution time to a reasonable value.', 'all_in_one_seo_pack' ),
26
+ 'default' => '',
27
+ 'type' => 'select',
28
+ 'initial_options' => Array( '' => __( "Use the system default", 'all_in_one_seo_pack' ), 30 => '30s', 60 => '1m', 120 => '2m', 300 => '5m', 0 => __( 'No limit', 'all_in_one_seo_pack' ) ) )
29
+ );
30
+
31
+ global $aiosp, $aioseop_options;
32
+ if ( aioseop_option_isset( 'aiosp_rewrite_titles' ) && $aioseop_options['aiosp_rewrite_titles'] ) {
33
+ $this->default_options['force_rewrites'] = Array(
34
+ 'name' => __( 'Force Rewrites:', 'all_in_one_seo_pack' ),
35
+ 'help_text' => __( "Use output buffering to ensure that the title gets rewritten.", 'all_in_one_seo_pack' ),
36
+ 'default' => 1,
37
+ 'type' => 'radio',
38
+ 'initial_options' => Array( 1 => __( 'Enabled', 'all_in_one_seo_pack' ),
39
+ 0 => __( 'Disabled', 'all_in_one_seo_pack' ) )
40
+ );
41
+ }
42
+
43
+ $this->layout = Array(
44
+ 'default' => Array(
45
+ 'name' => $this->name,
46
+ 'options' => array_keys( $this->default_options )
47
+ )
48
+ );
49
+
50
+ $system_status = Array(
51
+ 'status' => Array( 'default' => '', 'type' => 'html', 'label' => 'none', 'save' => false ),
52
+ );
53
+
54
+ $this->layout['system_status'] = Array(
55
+ 'name' => __( 'System Status', 'all_in_one_seo_pack' ),
56
+ 'options' => array_keys( $system_status )
57
+ );
58
+
59
+ $this->default_options = array_merge( $this->default_options, $system_status );
60
+
61
+ add_filter( $this->prefix . 'display_options', Array( $this, 'display_options_filter' ), 10, 2 );
62
+ add_filter( $this->prefix . 'update_options', Array( $this, 'update_options_filter' ), 10, 2 );
63
+ add_action( $this->prefix . 'settings_update', Array( $this, 'settings_update_action' ), 10, 2 );
64
+ }
65
+
66
+ function update_options_filter( $options, $location ) {
67
+ if ( $location == null ) {
68
+ if ( isset( $options[ $this->prefix . 'force_rewrites' ] ) )
69
+ unset( $options[ $this->prefix . 'force_rewrites' ] );
70
+ }
71
+ return $options;
72
+ }
73
+
74
+ function display_options_filter( $options, $location ) {
75
+ if ( $location == null ) {
76
+ $options[ $this->prefix . 'force_rewrites' ] = 1;
77
+ global $aiosp;
78
+ if ( aioseop_option_isset( 'aiosp_rewrite_titles' ) ) {
79
+ $opts = $aiosp->get_current_options( Array(), null );
80
+ $options[ $this->prefix . 'force_rewrites' ] = $opts['aiosp_force_rewrites'];
81
+ }
82
+ }
83
+ return $options;
84
+ }
85
+
86
+ function settings_update_action( $options, $location ) {
87
+ if ( $location == null ) {
88
+ if ( isset( $_POST[ $this->prefix . 'force_rewrites' ] ) ) {
89
+ $force_rewrites = $_POST[ $this->prefix . 'force_rewrites' ];
90
+ if ( ( $force_rewrites == 0 ) || ( $force_rewrites == 1 ) ) {
91
+ global $aiosp;
92
+ $opts = $aiosp->get_current_options( Array(), null );
93
+ $opts['aiosp_force_rewrites'] = $force_rewrites;
94
+ $aiosp->update_class_option( $opts );
95
+ wp_cache_flush();
96
+ }
97
+ }
98
+ }
99
+ }
100
+
101
+ function add_page_hooks() {
102
+ $memory_usage = memory_get_peak_usage() / 1024 / 1024;
103
+ if ( $memory_usage > 32 ) {
104
+ unset( $this->default_options['memory_limit']['initial_options']['32M'] );
105
+ if ( $memory_usage > 64 ) unset( $this->default_options['memory_limit']['initial_options']['64M'] );
106
+ if ( $memory_usage > 128 ) unset( $this->default_options['memory_limit']['initial_options']['128M'] );
107
+ if ( $memory_usage > 256 ) unset( $this->default_options['memory_limit']['initial_options']['256M'] );
108
+ }
109
+ $this->update_options();
110
+ parent::add_page_hooks();
111
+ }
112
+
113
+ function settings_page_init() {
114
+ $this->default_options['status']['default'] = $this->get_serverinfo();
115
+ }
116
+
117
+ function menu_order() {
118
+ return 7;
119
+ }
120
+
121
+ function get_serverinfo() {
122
+ global $wpdb;
123
+ global $wp_version;
124
+
125
+ $sqlversion = $wpdb->get_var("SELECT VERSION() AS version");
126
+ $mysqlinfo = $wpdb->get_results("SHOW VARIABLES LIKE 'sql_mode'");
127
+ if (is_array($mysqlinfo)) $sql_mode = $mysqlinfo[0]->Value;
128
+ if (empty($sql_mode)) $sql_mode = __('Not set', 'all_in_one_seo_pack' );
129
+ if(ini_get('safe_mode')) $safe_mode = __('On', 'all_in_one_seo_pack' );
130
+ else $safe_mode = __('Off', 'all_in_one_seo_pack' );
131
+ if(ini_get('allow_url_fopen')) $allow_url_fopen = __('On', 'all_in_one_seo_pack' );
132
+ else $allow_url_fopen = __('Off', 'all_in_one_seo_pack' );
133
+ if(ini_get('upload_max_filesize')) $upload_max = ini_get('upload_max_filesize');
134
+ else $upload_max = __('N/A', 'all_in_one_seo_pack' );
135
+ if(ini_get('post_max_size')) $post_max = ini_get('post_max_size');
136
+ else $post_max = __('N/A', 'all_in_one_seo_pack' );
137
+ if(ini_get('max_execution_time')) $max_execute = ini_get('max_execution_time');
138
+ else $max_execute = __('N/A', 'all_in_one_seo_pack' );
139
+ if(ini_get('memory_limit')) $memory_limit = ini_get('memory_limit');
140
+ else $memory_limit = __('N/A', 'all_in_one_seo_pack' );
141
+ if (function_exists('memory_get_usage')) $memory_usage = round(memory_get_usage() / 1024 / 1024, 2) . __(' MByte', 'all_in_one_seo_pack' );
142
+ else $memory_usage = __('N/A', 'all_in_one_seo_pack' );
143
+ if (is_callable('exif_read_data')) $exif = __('Yes', 'all_in_one_seo_pack' ). " ( V" . substr(phpversion('exif'),0,4) . ")" ;
144
+ else $exif = __('No', 'all_in_one_seo_pack' );
145
+ if (is_callable('iptcparse')) $iptc = __('Yes', 'all_in_one_seo_pack' );
146
+ else $iptc = __('No', 'all_in_one_seo_pack' );
147
+ if (is_callable('xml_parser_create')) $xml = __('Yes', 'all_in_one_seo_pack' );
148
+ else $xml = __('No', 'all_in_one_seo_pack' );
149
+
150
+ if ( function_exists( 'wp_get_theme' ) ) {
151
+ $theme = wp_get_theme();
152
+ } else {
153
+ $theme = get_theme( get_current_theme() );
154
+ }
155
+
156
+
157
+ if ( function_exists( 'is_multisite' ) ) {
158
+ if ( is_multisite() ) {
159
+ $ms = __('Yes', 'all_in_one_seo_pack' );
160
+ } else {
161
+ $ms = __('No', 'all_in_one_seo_pack' );
162
+ }
163
+
164
+ } else $ms = __('N/A', 'all_in_one_seo_pack' );
165
+
166
+ $siteurl = get_option('siteurl');
167
+ $homeurl = get_option('home');
168
+ $db_version = get_option('db_version');
169
+
170
+ $debug_info = Array(
171
+ __('Operating System', 'all_in_one_seo_pack' ) => PHP_OS,
172
+ __('Server', 'all_in_one_seo_pack' ) => $_SERVER["SERVER_SOFTWARE"],
173
+ __('Memory usage', 'all_in_one_seo_pack' ) => $memory_usage,
174
+ __('MYSQL Version', 'all_in_one_seo_pack' ) => $sqlversion,
175
+ __('SQL Mode', 'all_in_one_seo_pack' ) => $sql_mode,
176
+ __('PHP Version', 'all_in_one_seo_pack' ) => PHP_VERSION,
177
+ __('PHP Safe Mode', 'all_in_one_seo_pack' ) => $safe_mode,
178
+ __('PHP Allow URL fopen', 'all_in_one_seo_pack' ) => $allow_url_fopen,
179
+ __('PHP Memory Limit', 'all_in_one_seo_pack' ) => $memory_limit,
180
+ __('PHP Max Upload Size', 'all_in_one_seo_pack' ) => $upload_max,
181
+ __('PHP Max Post Size', 'all_in_one_seo_pack' ) => $post_max,
182
+ __('PHP Max Script Execute Time', 'all_in_one_seo_pack' ) => $max_execute,
183
+ __('PHP Exif support', 'all_in_one_seo_pack' ) => $exif,
184
+ __('PHP IPTC support', 'all_in_one_seo_pack' ) => $iptc,
185
+ __('PHP XML support', 'all_in_one_seo_pack' ) => $xml,
186
+ __('Site URL', 'all_in_one_seo_pack' ) => $siteurl,
187
+ __('Home URL', 'all_in_one_seo_pack' ) => $homeurl,
188
+ __('WordPress Version', 'all_in_one_seo_pack' ) => $wp_version,
189
+ __('WordPress DB Version', 'all_in_one_seo_pack' ) => $db_version,
190
+ __('Multisite', 'all_in_one_seo_pack' ) => $ms,
191
+ __('Active Theme', 'all_in_one_seo_pack' ) => $theme['Name'].' '.$theme['Version']
192
+ );
193
+ $debug_info['Active Plugins'] = null;
194
+ $active_plugins = $inactive_plugins = Array();
195
+ $plugins = get_plugins();
196
+ foreach ($plugins as $path => $plugin) {
197
+ if ( is_plugin_active( $path ) ) {
198
+ $debug_info[$plugin['Name']] = $plugin['Version'];
199
+ } else {
200
+ $inactive_plugins[$plugin['Name']] = $plugin['Version'];
201
+ }
202
+ }
203
+ $debug_info['Inactive Plugins'] = null;
204
+ $debug_info = array_merge( $debug_info, (array)$inactive_plugins );
205
+
206
+ $mail_text = __( "All in One SEO Pack Pro Debug Info", 'all_in_one_seo_pack' ) . "\r\n------------------\r\n\r\n";
207
+ $page_text = "";
208
+ if ( !empty( $debug_info ) )
209
+ foreach($debug_info as $name => $value) {
210
+ if ($value !== null) {
211
+ $page_text .= "<li><strong>$name</strong> $value</li>";
212
+ $mail_text .= "$name: $value\r\n";
213
+ } else {
214
+ $page_text .= "</ul><h2>$name</h2><ul class='sfwd_debug_settings'>";
215
+ $mail_text .= "\r\n$name\r\n----------\r\n";
216
+ }
217
+ }
218
+
219
+ do if ( !empty( $_REQUEST['sfwd_debug_submit'] ) || !empty( $_REQUEST['sfwd_update_check'] ) ) {
220
+ $nonce=$_REQUEST['sfwd_debug_nonce'];
221
+ if (! wp_verify_nonce($nonce, 'sfwd-debug-nonce') ) {
222
+ echo "<div class='sfwd_debug_error'>" . __( "Form submission error: verification check failed.", 'all_in_one_seo_pack' ) . "</div>";
223
+ break;
224
+ }
225
+ if ( $_REQUEST['sfwd_update_check'] ) {
226
+ global $aioseop_update_checker;
227
+ $aioseop_update_checker->checkForUpdates();
228
+ echo "<div class='sfwd_debug_mail_sent'>" . sprintf( __( "%s has checked for updates.", 'all_in_one_seo_pack' ), AIOSEOP_PLUGIN_NAME ) . "</div>";
229
+ break;
230
+ }
231
+ if ($_REQUEST['sfwd_debug_send_email']) {
232
+ if (wp_mail($_REQUEST['sfwd_debug_send_email'], sprintf( __( "SFWD Debug Mail From Site %s.", 'all_in_one_seo_pack'), $siteurl), $mail_text ) ) {
233
+ echo "<div class='sfwd_debug_mail_sent'>" . sprintf( __( "Sent to %s.", 'all_in_one_seo_pack' ), $_REQUEST['sfwd_debug_send_email'] ) . "</div>";
234
+ } else {
235
+ echo "<div class='sfwd_debug_error'>" . sprintf( __( "Failed to send to %s.", 'all_in_one_seo_pack' ), $_REQUEST['sfwd_debug_send_email'] ) . "</div>";
236
+ }
237
+ } else {
238
+ echo "<div class='sfwd_debug_error'>" . __( 'Error: please enter an e-mail address before submitting.', 'all_in_one_seo_pack' ) . "</div>";
239
+ }
240
+ } while(0); // control structure for use with break
241
+ $nonce = wp_create_nonce('sfwd-debug-nonce');
242
+ $buf = "<ul class='sfwd_debug_settings'>\n{$page_text}\n</ul>\n<p>\n" .
243
+ '<input name="sfwd_debug_send_email" type="text" value="" placeholder="' . __( "E-mail debug information", 'all_in_one_seo_pack' ) . '"><input name="sfwd_debug_nonce" type="hidden" value="' .
244
+ $nonce . '"><input name="sfwd_debug_submit" type="submit" value="' . __( 'Submit', 'all_in_one_seo_pack' ) . '" class="button-primary"><p><input name="sfwd_update_check" type="submit" value="' . __( 'Check For Updates', 'all_in_one_seo_pack' ) . '" class="button-primary">';
245
+ return $buf;
246
+ }
247
+ }
248
+ }
aioseop_utility.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * @package All-in-One-SEO-Pack
4
  */
5
  $UTF8_TABLES = Array();
6
 
1
  <?php
2
  /**
3
+ * @package All-in-One-SEO-Pack
4
  */
5
  $UTF8_TABLES = Array();
6
 
all_in_one_seo_pack-fa_IR.mo ADDED
Binary file
all_in_one_seo_pack-ja.mo CHANGED
Binary file
all_in_one_seo_pack-ko_KR.mo ADDED
Binary file
all_in_one_seo_pack-sk_SK.mo ADDED
Binary file
all_in_one_seo_pack.php CHANGED
@@ -1,15 +1,15 @@
1
  <?php
2
  /*
3
- Plugin Name: All in One SEO Pack
4
  Plugin URI: http://semperfiwebdesign.com
5
- Description: Out-of-the-box SEO for your WordPress blog. <a href="options-general.php?page=all-in-one-seo-pack/aioseop.class.php">Options configuration panel</a> | <a href="http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/">Upgrade to Pro Version</a> | <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtorbert%40gmail%2ecom&item_name=All%20In%20One%20SEO%20Pack&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8">Donate</a> | <a href="http://semperfiwebdesign.com/forum/" >Support</a> | <a href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web" target="_blank" title="Amazon Wish List">Amazon Wishlist</a>
6
- Version: 1.6.15.3
7
  Author: Michael Torbert
8
  Author URI: http://michaeltorbert.com
9
  */
10
 
11
  /*
12
- Copyright (C) 2008-2012 Michael Torbert, semperfiwebdesign.com (michael AT semperfiwebdesign DOT com)
13
  Original code by uberdose of uberdose.com
14
 
15
  This program is free software; you can redistribute it and/or modify
@@ -30,14 +30,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
30
 
31
  /**
32
  * @package All-in-One-SEO-Pack
33
- * @version 1.6.15.3
34
  */
35
 
36
  if ( ! defined( 'AIOSEOP_VERSION' ) )
37
- define( 'AIOSEOP_VERSION', '1.6.15.3' );
38
 
39
- if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) )
40
  define( 'AIOSEOP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
 
 
 
 
 
 
41
 
42
  if ( ! defined( 'AIOSEOP_PLUGIN_BASENAME' ) )
43
  define( 'AIOSEOP_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
@@ -51,6 +57,9 @@ if ( ! defined( 'AIOSEOP_PLUGIN_URL' ) )
51
  if ( ! defined( 'AIOSEOP_PLUGIN_IMAGES_URL' ) )
52
  define( 'AIOSEOP_PLUGIN_IMAGES_URL', AIOSEOP_PLUGIN_URL . 'images/' );
53
 
 
 
 
54
  if ( ! defined( 'WP_CONTENT_URL' ) )
55
  define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' );
56
  if ( ! defined( 'WP_ADMIN_URL' ) )
@@ -62,61 +71,77 @@ if ( ! defined( 'WP_PLUGIN_URL' ) )
62
  if ( ! defined( 'WP_PLUGIN_DIR' ) )
63
  define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
64
 
65
- if ( class_exists( 'All_in_One_SEO_Pack' ) ) {
66
- add_action( 'activation_notice', 'aioseop_class_defined_error' );
67
- return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  }
69
 
70
- require_once( plugin_dir_path( __FILE__ ) . 'aioseop.class.php');
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
- global $aiosp, $aioseop_options, $aiosp_activation;
 
 
 
 
 
73
 
74
  $aiosp_activation = false;
75
- $aioseop_options = get_option('aioseop_options');
76
- $aioseopcc = 0;
77
- $aiosp = new All_in_One_SEO_Pack();
78
 
79
- require_once( AIOSEOP_PLUGIN_DIR . 'aioseop_functions.php');
 
 
 
 
 
80
 
81
- ////checking to see if things need to be updated
82
 
83
- register_activation_hook( __FILE__, 'aioseop_activate' );
84
 
85
- add_action( 'init', 'aioseop_update_settings_check' );
86
 
87
- ////end checking to see if things need to be updated
88
 
89
- if ( $aioseop_options['aiosp_can'] == '1' || $aioseop_options['aiosp_can'] == 'on' )
90
- remove_action( 'wp_head', 'rel_canonical' );
91
 
92
- add_action( 'load-edit.php', 'aioseop_addmycolumns', 1 );
93
- add_filter( 'user_contactmethods', 'aioseop_add_contactmethods' );
94
- add_filter( 'wp_list_pages', 'aioseop_list_pages' );
95
- add_action( 'edit_post', array( $aiosp, 'post_meta_tags') );
96
- add_action( 'publish_post', array( $aiosp, 'post_meta_tags') );
97
- add_action( 'save_post', array( $aiosp, 'post_meta_tags') );
98
- add_action( 'add_attachment', array( $aiosp, 'post_meta_tags') );
99
- add_action( 'edit_attachment', array( $aiosp, 'post_meta_tags') );
100
- add_action( 'edit_page_form', array( $aiosp, 'post_meta_tags') );
101
- add_action( 'init', array( $aiosp, 'init' ), 5 );
102
- add_action( 'wp_head', array( $aiosp, 'wp_head') );
103
- add_action( 'template_redirect', array( $aiosp, 'template_redirect') );
104
- add_action( 'admin_menu', array( $aiosp, 'admin_menu') );
105
- add_action( 'admin_menu', 'aioseop_meta_box_add' );
106
 
107
- ////analytics
108
- if ( aioseop_option_isset( 'aiosp_google_analytics_id' ) )
109
- add_action( 'wp_head', array( $aiosp, 'aiosp_google_analytics') );
110
 
111
  if ( aioseop_option_isset( 'aiosp_unprotect_meta' ) )
112
  add_filter( 'is_protected_meta', 'aioseop_unprotect_meta', 10, 3 );
113
 
114
- if ( ( !isset($_POST['aiosp_enabled']) || $_POST['aiosp_enabled'] == null ) &&
115
- ( !isset($aioseop_options['aiosp_enabled']) || $aioseop_options['aiosp_enabled']!='1' ) ||
116
- ( isset($_POST['aiosp_enabled']) && $_POST['aiosp_enabled']=='0' ) )
117
- add_action( 'admin_notices', 'aioseop_activation_notice');
118
-
119
- global $aioseop_get_pages_start;
120
- $aioseop_get_pages_start = 0;
121
- add_filter( 'wp_list_pages_excludes', 'aioseop_get_pages_start');
122
- add_filter( 'get_pages', 'aioseop_get_pages' );
1
  <?php
2
  /*
3
+ Plugin Name: All In One SEO Pack
4
  Plugin URI: http://semperfiwebdesign.com
5
+ Description: Out-of-the-box SEO for your WordPress blog. <a href="admin.php?page=all-in-one-seo-pack/aioseop_class.php">Options configuration panel</a> | <a href="http://semperplugins.com/plugins/">Upgrade to Pro Version</a> | <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtorbert%40gmail%2ecom&item_name=All%20In%20One%20SEO%20Pack&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8">Donate</a> | <a href="http://semperplugins.com/support/" >Support</a> | <a href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web" target="_blank" title="Amazon Wish List">Amazon Wishlist</a>
6
+ Version: 2.0
7
  Author: Michael Torbert
8
  Author URI: http://michaeltorbert.com
9
  */
10
 
11
  /*
12
+ Copyright (C) 2008-2013 Michael Torbert, semperfiwebdesign.com (michael AT semperfiwebdesign DOT com)
13
  Original code by uberdose of uberdose.com
14
 
15
  This program is free software; you can redistribute it and/or modify
30
 
31
  /**
32
  * @package All-in-One-SEO-Pack
33
+ * @version 2.0
34
  */
35
 
36
  if ( ! defined( 'AIOSEOP_VERSION' ) )
37
+ define( 'AIOSEOP_VERSION', '2.0' );
38
 
39
+ if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) {
40
  define( 'AIOSEOP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
41
+ } elseif ( AIOSEOP_PLUGIN_DIR != plugin_dir_path( __FILE__ ) ) {
42
+ add_action( 'admin_notices', create_function( '', 'echo "' . "<div class='error'>" . sprintf(
43
+ __( "%s detected a conflict; please deactivate the plugin located in %s.", 'all_in_one_seo_pack' ),
44
+ $aioseop_plugin_name, AIOSEOP_PLUGIN_DIR ) . "</div>" . '";' ) );
45
+ return;
46
+ }
47
 
48
  if ( ! defined( 'AIOSEOP_PLUGIN_BASENAME' ) )
49
  define( 'AIOSEOP_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
57
  if ( ! defined( 'AIOSEOP_PLUGIN_IMAGES_URL' ) )
58
  define( 'AIOSEOP_PLUGIN_IMAGES_URL', AIOSEOP_PLUGIN_URL . 'images/' );
59
 
60
+ if ( ! defined( 'AIOSEOP_BASELINE_MEM_LIMIT' ) )
61
+ define( 'AIOSEOP_BASELINE_MEM_LIMIT', 268435456 ); // 256MB
62
+
63
  if ( ! defined( 'WP_CONTENT_URL' ) )
64
  define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' );
65
  if ( ! defined( 'WP_ADMIN_URL' ) )
71
  if ( ! defined( 'WP_PLUGIN_DIR' ) )
72
  define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
73
 
74
+ global $aiosp, $aioseop_options, $aioseop_modules, $aioseop_module_list, $aiosp_activation, $aioseop_mem_limit, $aioseop_get_pages_start, $aioseop_admin_menu;
75
+ $aioseop_get_pages_start = $aioseop_admin_menu = 0;
76
+
77
+ $aioseop_options = get_option( 'aioseop_options' );
78
+
79
+ $aioseop_mem_limit = @ini_get( 'memory_limit' );
80
+
81
+ if ( !function_exists( 'aioseop_convert_bytestring' ) ) {
82
+ function aioseop_convert_bytestring( $byteString ) {
83
+ preg_match( '/^\s*([0-9.]+)\s*([KMGTPE])B?\s*$/i', $byteString, $matches );
84
+ $num = ( float )$matches[1];
85
+ switch ( strtoupper( $matches[2] ) ) {
86
+ case 'E': $num = $num * 1024;
87
+ case 'P': $num = $num * 1024;
88
+ case 'T': $num = $num * 1024;
89
+ case 'G': $num = $num * 1024;
90
+ case 'M': $num = $num * 1024;
91
+ case 'K': $num = $num * 1024;
92
+ }
93
+ return intval( $num );
94
+ }
95
  }
96
 
97
+ if ( is_array( $aioseop_options ) && isset( $aioseop_options['modules'] ) && isset( $aioseop_options['modules']['aiosp_performance_options'] ) ) {
98
+ $perf_opts = $aioseop_options['modules']['aiosp_performance_options'];
99
+ if ( isset( $perf_opts['aiosp_performance_memory_limit'] ) )
100
+ $aioseop_mem_limit = $perf_opts['aiosp_performance_memory_limit'];
101
+ if ( isset( $perf_opts['aiosp_performance_execution_time'] ) && ( $perf_opts['aiosp_performance_execution_time'] !== '' ) ) {
102
+ @ini_set( 'max_execution_time', (int)$perf_opts['aiosp_performance_execution_time'] );
103
+ @set_time_limit( (int)$perf_opts['aiosp_performance_execution_time'] );
104
+ }
105
+ } else {
106
+ $aioseop_mem_limit = aioseop_convert_bytestring( $aioseop_mem_limit );
107
+ if ( ( $aioseop_mem_limit > 0 ) && ( $aioseop_mem_limit < AIOSEOP_BASELINE_MEM_LIMIT ) )
108
+ $aioseop_mem_limit = AIOSEOP_BASELINE_MEM_LIMIT;
109
+ }
110
 
111
+ if ( !empty( $aioseop_mem_limit ) ) {
112
+ if ( !is_int( $aioseop_mem_limit ) )
113
+ $aioseop_mem_limit = aioseop_convert_bytestring( $aioseop_mem_limit );
114
+ if ( ( $aioseop_mem_limit > 0 ) && ( $aioseop_mem_limit <= AIOSEOP_BASELINE_MEM_LIMIT ) )
115
+ @ini_set( 'memory_limit', $aioseop_mem_limit );
116
+ }
117
 
118
  $aiosp_activation = false;
119
+ $aioseop_module_list = Array( 'performance' ); // list all available modules here
 
 
120
 
121
+ if ( class_exists( 'All_in_One_SEO_Pack' ) ) {
122
+ add_action( 'admin_notices', create_function( '', 'echo "<div class=\'error\'>The All In One SEO Pack class is already defined";'
123
+ . "if ( class_exists( 'ReflectionClass' ) ) { \$r = new ReflectionClass( 'All_in_One_SEO_Pack' ); echo ' in ' . \$r->getFileName(); } "
124
+ . ' echo ", preventing All In One SEO Pack from loading.</div>";' ) );
125
+ return;
126
+ }
127
 
128
+ require_once( AIOSEOP_PLUGIN_DIR . 'aioseop_functions.php' );
129
 
130
+ require_once( AIOSEOP_PLUGIN_DIR . 'aioseop_class.php' );
131
 
132
+ $aiosp = new All_in_One_SEO_Pack();
133
 
134
+ register_activation_hook( __FILE__, 'aioseop_activate' );
135
 
136
+ add_action( 'plugins_loaded', 'aioseop_load_modules' );
 
137
 
138
+ add_action( 'init', array( $aiosp, 'add_hooks' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
139
 
140
+ if ( is_admin() ) {
141
+ add_action( 'wp_ajax_aioseop_ajax_save_meta', 'aioseop_ajax_save_meta' );
142
+ }
143
 
144
  if ( aioseop_option_isset( 'aiosp_unprotect_meta' ) )
145
  add_filter( 'is_protected_meta', 'aioseop_unprotect_meta', 10, 3 );
146
 
147
+ add_action( 'init', array( $aiosp, 'add_hooks' ) );
 
 
 
 
 
 
 
 
all_in_one_seo_pack.pot CHANGED
@@ -1,459 +1,464 @@
1
- # Translation of the WordPress plugin by .
2
- # Copyright (C) 2010
3
- # This file is distributed under the same license as the package.
4
- # FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
5
- #
6
- #, fuzzy
7
  msgid ""
8
  msgstr ""
9
- "Project-Id-Version: \n"
10
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/all-in-one-seo-pack\n"
11
- "POT-Creation-Date: 2010-07-21 00:26+0000\n"
12
- "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
13
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
- "Language-Team: LANGUAGE <LL@li.org>\n"
15
  "MIME-Version: 1.0\n"
16
  "Content-Type: text/plain; charset=UTF-8\n"
17
  "Content-Transfer-Encoding: 8bit\n"
 
 
 
18
 
19
- #: aioseop.class.php:994
20
- #, php-format
21
- msgid "Could not download distribution (%s)"
22
  msgstr ""
23
 
24
- #: aioseop.class.php:997
25
- #, php-format
26
- msgid "Could not download distribution (%s): %s"
27
  msgstr ""
28
 
29
- #: aioseop.class.php:1004
30
- #, php-format
31
- msgid "Could not open %s for writing"
32
  msgstr ""
33
 
34
- #: aioseop.class.php:1006
35
- #, php-format
36
- msgid "Please make sure %s is writable"
37
  msgstr ""
38
 
39
- #: aioseop.class.php:1012
40
- #, php-format
41
- msgid "Could not write to %s"
42
  msgstr ""
43
 
44
- #: aioseop.class.php:1180 aioseop.class.php:1220 aioseop.class.php:1227
45
- #: all_in_one_seo_pack.php:733 all_in_one_seo_pack.php:737
46
- #: all_in_one_seo_pack.php:738
47
- msgid "All in One SEO Pack"
48
  msgstr ""
49
 
50
- #: aioseop.class.php:1184 aioseop.class.php:1241 all_in_one_seo_pack.php:776
51
- msgid "Title:"
 
 
 
52
  msgstr ""
53
 
54
- #: aioseop.class.php:1188 aioseop.class.php:1253 all_in_one_seo_pack.php:794
55
- msgid "Keywords (comma separated):"
56
  msgstr ""
57
 
58
- #: aioseop.class.php:1233 all_in_one_seo_pack.php:768
59
- msgid "Click here for Support"
 
 
60
  msgstr ""
61
 
62
- #: aioseop.class.php:1245 all_in_one_seo_pack.php:784
63
- msgid "Description:"
64
  msgstr ""
65
 
66
- #: aioseop.class.php:1249 all_in_one_seo_pack.php:789
67
  msgid ""
68
- " characters. Most search engines use a maximum of 160 chars for the "
69
- "description."
70
  msgstr ""
71
 
72
- #: aioseop.class.php:1260 all_in_one_seo_pack.php:811
73
- msgid "Disable on this page/post:"
 
 
74
  msgstr ""
75
 
76
- #: aioseop.class.php:1268 all_in_one_seo_pack.php:800
77
- msgid "Title Attribute:"
 
 
78
  msgstr ""
79
 
80
- #: aioseop.class.php:1272 all_in_one_seo_pack.php:805
81
- msgid "Menu Label:"
82
  msgstr ""
83
 
84
- #: aioseop.class.php:1299
85
- msgid "All in One SEO"
 
 
 
86
  msgstr ""
87
 
88
- #: aioseop.class.php:1341
89
- msgid "All in One SEO Options Reset."
90
  msgstr ""
91
 
92
- #: aioseop.class.php:1384
93
- msgid "All in One SEO Options Updated."
 
 
 
 
94
  msgstr ""
95
 
96
- #: aioseop.class.php:1443
97
- msgid "All in One SEO Plugin Options"
98
  msgstr ""
99
 
100
- #: aioseop.class.php:1447
101
- msgid "All in One SEO Plugin Release History"
 
 
 
 
 
 
 
 
 
 
 
102
  msgstr ""
103
 
104
- #: aioseop.class.php:1448
105
- msgid "Changelog"
106
  msgstr ""
107
 
108
- #: aioseop.class.php:1450 aioseop.class.php:1451
109
- msgid "FAQ"
110
  msgstr ""
111
 
112
- #: aioseop.class.php:1452
113
- msgid "All in One SEO Plugin Support Forum"
114
  msgstr ""
115
 
116
- #: aioseop.class.php:1453
117
- msgid "Support"
 
 
118
  msgstr ""
119
 
120
- #: aioseop.class.php:1454
121
- msgid "All in One SEO Plugin Translations"
122
  msgstr ""
123
 
124
- #: aioseop.class.php:1455
125
- msgid "Translations"
 
 
126
  msgstr ""
127
 
128
- #: aioseop.class.php:1456
129
- msgid "Pro Version"
130
  msgstr ""
131
 
132
- #: aioseop.class.php:1457
133
- msgid "UPGRADE TO PRO VERSION"
 
 
134
  msgstr ""
135
 
136
- #: aioseop.class.php:1481
137
- msgid "Donate with Paypal"
138
  msgstr ""
139
 
140
- #: aioseop.class.php:1483
141
- msgid "My Amazon Wish List"
 
 
 
142
  msgstr ""
143
 
144
- #: aioseop.class.php:1484
145
- msgid "Follow us on Twitter"
 
 
146
  msgstr ""
147
 
148
- #: aioseop.class.php:1485
149
- msgid "Follow Us on Twitter"
 
 
150
  msgstr ""
151
 
152
- #: aioseop.class.php:1493
153
- msgid "iBlogPro theme"
154
  msgstr ""
155
 
156
- #: aioseop.class.php:1494
157
- msgid "Pagelines Themes"
158
  msgstr ""
159
 
160
- #: aioseop.class.php:1495
161
- msgid "WhiteHouse theme"
162
  msgstr ""
163
 
164
- #: aioseop.class.php:1532
165
- msgid "Click on option titles to get help!"
166
  msgstr ""
167
 
168
- #: aioseop.class.php:1690 aioseop.class.php:1707 aioseop.class.php:1724
169
- #: aioseop.class.php:1740 aioseop.class.php:1756 aioseop.class.php:1772
170
- #: aioseop.class.php:1788 aioseop.class.php:1804 aioseop.class.php:1831
171
- #: aioseop.class.php:1856 aioseop.class.php:1878 aioseop.class.php:1899
172
- #: aioseop.class.php:1920 aioseop.class.php:1941 aioseop.class.php:1963
173
- #: aioseop.class.php:1986 aioseop.class.php:2006 aioseop.class.php:2022
174
- #: aioseop.class.php:2037 aioseop.class.php:2055 aioseop.class.php:2070
175
- #: aioseop.class.php:2086 aioseop.class.php:2102 aioseop.class.php:2118
176
- #: aioseop.class.php:2134 aioseop.class.php:2151 aioseop.class.php:2168
177
- #: aioseop.class.php:2184 aioseop.class.php:2200 aioseop.class.php:2216
178
- #: aioseop.class.php:2233
179
- msgid "Click for Help!"
180
  msgstr ""
181
 
182
- #: aioseop.class.php:1691
183
- msgid "I enjoy this plugin and have made a donation:"
184
  msgstr ""
185
 
186
- #: aioseop.class.php:1698 aioseop.class.php:2241
187
- msgid "All donations support continued development of this free software."
188
  msgstr ""
189
 
190
- #: aioseop.class.php:1708
191
- msgid "Plugin Status:"
192
  msgstr ""
193
 
194
- #: aioseop.class.php:1716
195
- msgid "All in One SEO Pack must be enabled for use."
196
  msgstr ""
197
 
198
- #: aioseop.class.php:1725
199
- msgid "Home Title:"
200
  msgstr ""
201
 
202
- #: aioseop.class.php:1732
203
- msgid ""
204
- "As the name implies, this will be the title of your homepage. This is "
205
- "independent of any other option. If not set, the default blog title will get "
206
- "used."
207
  msgstr ""
208
 
209
- #: aioseop.class.php:1741
210
- msgid "Home Description:"
211
  msgstr ""
212
 
213
- #: aioseop.class.php:1748
214
- msgid ""
215
- "The META description for your homepage. Independent of any other options, "
216
- "the default is no META description at all if this is not set."
217
  msgstr ""
218
 
219
- #: aioseop.class.php:1757
220
- msgid "Home Keywords (comma separated):"
221
  msgstr ""
222
 
223
- #: aioseop.class.php:1764
224
- msgid ""
225
- "A comma separated list of your most important keywords for your site that "
226
- "will be written as META keywords on your homepage. Don't stuff everything in "
227
- "here."
228
  msgstr ""
229
 
230
- #: aioseop.class.php:1773
231
- msgid "Canonical URLs:"
232
  msgstr ""
233
 
234
- #: aioseop.class.php:1780
235
- msgid ""
236
- "This option will automatically generate Canonical URLS for your entire "
237
- "WordPress installation. This will help to prevent duplicate content "
238
- "penalties by <a href='http://googlewebmastercentral.blogspot.com/2009/02/"
239
- "specify-your-canonical.html' target='_blank'>Google</a>."
240
  msgstr ""
241
 
242
- #: aioseop.class.php:1789
243
- msgid "Rewrite Titles:"
244
  msgstr ""
245
 
246
- #: aioseop.class.php:1796
247
  msgid ""
248
- "Note that this is all about the title tag. This is what you see in your "
249
- "browser's window title bar. This is NOT visible on a page, only in the "
250
- "window title bar and of course in the source. If set, all page, post, "
251
- "category, search and archive page titles get rewritten. You can specify the "
252
- "format for most of them. For example: The default templates puts the title "
253
- "tag of posts like this: “Blog Archive >> Blog Name >> Post Title” (maybe "
254
- "I've overdone slightly). This is far from optimal. With the default post "
255
- "title format, Rewrite Title rewrites this to “Post Title | Blog Name”. "
256
- "If you have manually defined a title (in one of the text fields for All in "
257
- "One SEO Plugin input) this will become the title of your post in the format "
258
- "string."
259
  msgstr ""
260
 
261
- #: aioseop.class.php:1805
262
- msgid "Post Title Format:"
263
  msgstr ""
264
 
265
- #: aioseop.class.php:1812 aioseop.class.php:1839 aioseop.class.php:1864
266
- #: aioseop.class.php:1886 aioseop.class.php:1907 aioseop.class.php:1928
267
- #: aioseop.class.php:1949 aioseop.class.php:1971 aioseop.class.php:1995
268
- msgid "The following macros are supported:"
269
  msgstr ""
270
 
271
- #: aioseop.class.php:1814 aioseop.class.php:1841 aioseop.class.php:1866
272
- #: aioseop.class.php:1888 aioseop.class.php:1909 aioseop.class.php:1930
273
- #: aioseop.class.php:1951 aioseop.class.php:1973
274
- msgid "%blog_title% - Your blog title"
275
  msgstr ""
276
 
277
- #: aioseop.class.php:1815 aioseop.class.php:1842 aioseop.class.php:1867
278
- #: aioseop.class.php:1889 aioseop.class.php:1910 aioseop.class.php:1931
279
- #: aioseop.class.php:1952 aioseop.class.php:1974
280
- msgid "%blog_description% - Your blog description"
281
  msgstr ""
282
 
283
- #: aioseop.class.php:1816
284
- msgid "%post_title% - The original title of the post"
285
  msgstr ""
286
 
287
- #: aioseop.class.php:1817
288
- msgid "%category_title% - The (main) category of the post"
 
 
289
  msgstr ""
290
 
291
- #: aioseop.class.php:1818
292
- msgid "%category% - Alias for %category_title%"
293
  msgstr ""
294
 
295
- #: aioseop.class.php:1819
296
- msgid "%post_author_login% - This post's author' login"
297
  msgstr ""
298
 
299
- #: aioseop.class.php:1820
300
- msgid "%post_author_nicename% - This post's author' nicename"
 
301
  msgstr ""
302
 
303
- #: aioseop.class.php:1821
304
- msgid "%post_author_firstname% - This post's author' first name (capitalized)"
 
 
305
  msgstr ""
306
 
307
- #: aioseop.class.php:1822
308
- msgid "%post_author_lastname% - This post's author' last name (capitalized)"
309
  msgstr ""
310
 
311
- #: aioseop.class.php:1832
312
- msgid "Page Title Format:"
313
  msgstr ""
314
 
315
- #: aioseop.class.php:1843
316
- msgid "%page_title% - The original title of the page"
 
 
317
  msgstr ""
318
 
319
- #: aioseop.class.php:1844
320
- msgid "%page_author_login% - This page's author' login"
321
  msgstr ""
322
 
323
- #: aioseop.class.php:1845
324
- msgid "%page_author_nicename% - This page's author' nicename"
325
  msgstr ""
326
 
327
- #: aioseop.class.php:1846
328
- msgid "%page_author_firstname% - This page's author' first name (capitalized)"
 
 
329
  msgstr ""
330
 
331
- #: aioseop.class.php:1847
332
- msgid "%page_author_lastname% - This page's author' last name (capitalized)"
333
  msgstr ""
334
 
335
- #: aioseop.class.php:1857
336
- msgid "Category Title Format:"
337
  msgstr ""
338
 
339
- #: aioseop.class.php:1868
340
- msgid "%category_title% - The original title of the category"
341
  msgstr ""
342
 
343
- #: aioseop.class.php:1869
344
- msgid "%category_description% - The description of the category"
345
  msgstr ""
346
 
347
- #: aioseop.class.php:1879
348
- msgid "Archive Title Format:"
349
  msgstr ""
350
 
351
- #: aioseop.class.php:1890
352
- msgid ""
353
- "%date% - The original archive title given by wordpress, e.g. \"2007\" or "
354
- "\"2007 August\""
355
  msgstr ""
356
 
357
- #: aioseop.class.php:1900
358
- msgid "Tag Title Format:"
359
  msgstr ""
360
 
361
- #: aioseop.class.php:1911
362
- msgid "%tag% - The name of the tag"
 
 
363
  msgstr ""
364
 
365
- #: aioseop.class.php:1921
366
- msgid "Search Title Format:"
367
  msgstr ""
368
 
369
- #: aioseop.class.php:1932
370
- msgid "%search% - What was searched for"
371
  msgstr ""
372
 
373
- #: aioseop.class.php:1942
374
- msgid "Description Format:"
375
  msgstr ""
376
 
377
- #: aioseop.class.php:1953
378
  msgid ""
379
- "%description% - The original description as determined by the plugin, e.g. "
380
- "the excerpt if one is set or an auto-generated one if that option is set"
381
  msgstr ""
382
 
383
- #: aioseop.class.php:1954
384
- msgid "%wp_title% - The original wordpress title, e.g. post_title for posts"
385
  msgstr ""
386
 
387
- #: aioseop.class.php:1964
388
- msgid "404 Title Format:"
 
 
 
 
389
  msgstr ""
390
 
391
- #: aioseop.class.php:1975
392
  msgid ""
393
- "%request_url% - The original URL path, like \"/url-that-does-not-exist/\""
 
394
  msgstr ""
395
 
396
- #: aioseop.class.php:1976
 
 
 
 
397
  msgid ""
398
- "%request_words% - The URL path in human readable form, like \"Url That Does "
399
- "Not Exist\""
400
  msgstr ""
401
 
402
- #: aioseop.class.php:1977
403
- msgid "%404_title% - Additional 404 title input\""
404
  msgstr ""
405
 
406
- #: aioseop.class.php:1987
407
- msgid "Paged Format:"
408
  msgstr ""
409
 
410
- #: aioseop.class.php:1994
411
- msgid ""
412
- "This string gets appended/prepended to titles when they are for paged index "
413
- "pages (like home or archive pages)."
414
  msgstr ""
415
 
416
- #: aioseop.class.php:1997
417
- msgid "%page% - The page number"
418
  msgstr ""
419
 
420
- #: aioseop.class.php:2007
421
- msgid "SEO for Custom Post Types:"
422
  msgstr ""
423
 
424
- #: aioseop.class.php:2013
425
- msgid ""
426
- "Check this if you want your enable AIOSEOP support for Custom Post Types on "
427
- "this site."
428
  msgstr ""
429
 
430
- #: aioseop.class.php:2023
431
  msgid "Use Categories for META keywords:"
432
  msgstr ""
433
 
434
- #: aioseop.class.php:2029
435
  msgid ""
436
  "Check this if you want your categories for a given post used as the META "
437
  "keywords for this post (in addition to any keywords and tags you specify on "
438
  "the post edit page)."
439
  msgstr ""
440
 
441
- #: aioseop.class.php:2038
442
  msgid "Use Tags for META keywords:"
443
  msgstr ""
444
 
445
- #: aioseop.class.php:2044
446
  msgid ""
447
  "Check this if you want your tags for a given post used as the META keywords "
448
  "for this post (in addition to any keywords you specify on the post edit "
449
  "page)."
450
  msgstr ""
451
 
452
- #: aioseop.class.php:2056
453
  msgid "Dynamically Generate Keywords for Posts Page:"
454
  msgstr ""
455
 
456
- #: aioseop.class.php:2062
457
  msgid ""
458
  "Check this if you want your keywords on a custom posts page (set it in "
459
  "options->reading) to be dynamically generated from the keywords of the posts "
@@ -461,61 +466,61 @@ msgid ""
461
  "edit page screen for the posts page."
462
  msgstr ""
463
 
464
- #: aioseop.class.php:2071
465
  msgid "Use noindex for Categories:"
466
  msgstr ""
467
 
468
- #: aioseop.class.php:2078
469
  msgid ""
470
  "Check this for excluding category pages from being crawled. Useful for "
471
  "avoiding duplicate content."
472
  msgstr ""
473
 
474
- #: aioseop.class.php:2087
475
  msgid "Use noindex for Archives:"
476
  msgstr ""
477
 
478
- #: aioseop.class.php:2094
479
  msgid ""
480
  "Check this for excluding archive pages from being crawled. Useful for "
481
  "avoiding duplicate content."
482
  msgstr ""
483
 
484
- #: aioseop.class.php:2103
485
  msgid "Use noindex for Tag Archives:"
486
  msgstr ""
487
 
488
- #: aioseop.class.php:2110
489
  msgid ""
490
  "Check this for excluding tag pages from being crawled. Useful for avoiding "
491
  "duplicate content."
492
  msgstr ""
493
 
494
- #: aioseop.class.php:2119
495
  msgid "Autogenerate Descriptions:"
496
  msgstr ""
497
 
498
- #: aioseop.class.php:2126
499
  msgid ""
500
  "Check this and your META descriptions will get autogenerated if there's no "
501
  "excerpt."
502
  msgstr ""
503
 
504
- #: aioseop.class.php:2135
505
- msgid "Capitalize Category Titles:"
506
  msgstr ""
507
 
508
- #: aioseop.class.php:2142
509
  msgid ""
510
- "Check this and Category Titles will have the first letter of each word "
511
- "capitalized."
512
  msgstr ""
513
 
514
- #: aioseop.class.php:2152
515
  msgid "Exclude Pages:"
516
  msgstr ""
517
 
518
- #: aioseop.class.php:2159
519
  msgid ""
520
  "Enter any comma separated pages here to be excluded by All in One SEO Pack. "
521
  "This is helpful when using plugins which generate their own non-WordPress "
@@ -526,63 +531,610 @@ msgid ""
526
  "will be excluded from All in One SEO Pack."
527
  msgstr ""
528
 
529
- #: aioseop.class.php:2169
530
  msgid "Additional Post Headers:"
531
  msgstr ""
532
 
533
- #: aioseop.class.php:2176
 
 
 
 
 
534
  msgid ""
535
- "What you enter here will be copied verbatim to your header on post pages. "
536
  "You can enter whatever additional headers you want here, even references to "
537
  "stylesheets."
538
  msgstr ""
539
 
540
- #: aioseop.class.php:2185
541
  msgid "Additional Page Headers:"
542
  msgstr ""
543
 
544
- #: aioseop.class.php:2192
 
 
 
 
 
 
 
 
545
  msgid ""
546
- "What you enter here will be copied verbatim to your header on pages. You can "
547
- "enter whatever additional headers you want here, even references to "
548
- "stylesheets."
 
 
 
 
 
549
  msgstr ""
550
 
551
- #: aioseop.class.php:2201
552
- msgid "Additional Home Headers:"
553
  msgstr ""
554
 
555
- #: aioseop.class.php:2208
556
  msgid ""
557
- "What you enter here will be copied verbatim to your header on the home page. "
558
- "You can enter whatever additional headers you want here, even references to "
559
- "stylesheets."
 
560
  msgstr ""
561
 
562
- #: aioseop.class.php:2217
563
  msgid "Log important events:"
564
  msgstr ""
565
 
566
- #: aioseop.class.php:2224
567
  msgid ""
568
  "Check this and SEO pack will create a log of important events "
569
  "(all_in_one_seo_pack.log) in its plugin directory which might help debugging "
570
  "it. Make sure this directory is writable."
571
  msgstr ""
572
 
573
- #: aioseop.class.php:2234
574
- msgid "Thank you for your donation:"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
575
  msgstr ""
576
 
577
- #: aioseop.class.php:2255
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
578
  msgid "Update Options"
579
  msgstr ""
580
 
581
- #: aioseop.class.php:2256
582
- msgid "Reset Settings to Defaults"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
583
  msgstr ""
584
 
585
- #: all_in_one_seo_pack.php:779
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
586
  msgid ""
587
- " characters. Most search engines use a maximum of 60 chars for the title."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
588
  msgstr ""
1
+ # Copyright (C) 2013 Semper Fi Web Design
2
+ # This file is distributed under the same license as the All In One SEO Pack package.
 
 
 
 
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: All In One SEO Pack 2.0\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/all-in-one-seo-pack\n"
7
+ "POT-Creation-Date: 2013-04-19 19:02:09+00:00\n"
 
 
 
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2013-MO-DA HO:MI+ZONE\n"
12
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
+ #: aioseop_class.php:53
16
+ msgid "All in One SEO Pack"
 
17
  msgstr ""
18
 
19
+ #: aioseop_class.php:56
20
+ msgid "%s Plugin Options"
 
21
  msgstr ""
22
 
23
+ #: aioseop_class.php:57 aioseop_class.php:395
24
+ msgid "General Settings"
 
25
  msgstr ""
26
 
27
+ #: aioseop_class.php:66
28
+ msgid "I enjoy this plugin and have made a donation:"
 
29
  msgstr ""
30
 
31
+ #: aioseop_class.php:67
32
+ msgid "All donations support continued development of this free software."
 
33
  msgstr ""
34
 
35
+ #: aioseop_class.php:70
36
+ msgid "Home Title:"
 
 
37
  msgstr ""
38
 
39
+ #: aioseop_class.php:71
40
+ msgid ""
41
+ "As the name implies, this will be the title of your homepage. This is "
42
+ "independent of any other option. If not set, the default blog title will get "
43
+ "used."
44
  msgstr ""
45
 
46
+ #: aioseop_class.php:74
47
+ msgid "Home Description:"
48
  msgstr ""
49
 
50
+ #: aioseop_class.php:75
51
+ msgid ""
52
+ "The META description for your homepage. Independent of any other options, "
53
+ "the default is no META description at all if this is not set."
54
  msgstr ""
55
 
56
+ #: aioseop_class.php:78
57
+ msgid "Use Keywords:"
58
  msgstr ""
59
 
60
+ #: aioseop_class.php:79
61
  msgid ""
62
+ "This option allows you to toggle the use of meta keywords throughout the "
63
+ "whole of the site."
64
  msgstr ""
65
 
66
+ #: aioseop_class.php:82 aioseop_class.php:99 aioseop_class.php:108
67
+ #: aioseop_class.php:116 aioseop_class.php:236 aioseop_class.php:244
68
+ #: aioseop_performance.php:38
69
+ msgid "Enabled"
70
  msgstr ""
71
 
72
+ #: aioseop_class.php:83 aioseop_class.php:100 aioseop_class.php:109
73
+ #: aioseop_class.php:117 aioseop_class.php:237 aioseop_class.php:245
74
+ #: aioseop_performance.php:39
75
+ msgid "Disabled"
76
  msgstr ""
77
 
78
+ #: aioseop_class.php:86
79
+ msgid "Home Keywords (comma separated):"
80
  msgstr ""
81
 
82
+ #: aioseop_class.php:87
83
+ msgid ""
84
+ "A comma separated list of your most important keywords for your site that "
85
+ "will be written as META keywords on your homepage. Don't stuff everything in "
86
+ "here."
87
  msgstr ""
88
 
89
+ #: aioseop_class.php:91
90
+ msgid "Canonical URLs:"
91
  msgstr ""
92
 
93
+ #: aioseop_class.php:92
94
+ msgid ""
95
+ "This option will automatically generate Canonical URLS for your entire "
96
+ "WordPress installation. This will help to prevent duplicate content "
97
+ "penalties by <a href='http://googlewebmastercentral.blogspot.com/2009/02/"
98
+ "specify-your-canonical.html' target='_blank'>Google</a>."
99
  msgstr ""
100
 
101
+ #: aioseop_class.php:95
102
+ msgid "Rewrite Titles:"
103
  msgstr ""
104
 
105
+ #: aioseop_class.php:96
106
+ msgid ""
107
+ "Note that this is all about the title tag. This is what you see in your "
108
+ "browser's window title bar. This is NOT visible on a page, only in the "
109
+ "window title bar and of course in the source. If set, all page, post, "
110
+ "category, search and archive page titles get rewritten. You can specify the "
111
+ "format for most of them. For example: The default templates puts the title "
112
+ "tag of posts like this: “Blog Archive >> Blog Name >> Post Title” (maybe "
113
+ "I've overdone slightly). This is far from optimal. With the default post "
114
+ "title format, Rewrite Title rewrites this to “Post Title | Blog Name”. "
115
+ "If you have manually defined a title (in one of the text fields for All in "
116
+ "One SEO Plugin input) this will become the title of your post in the format "
117
+ "string."
118
  msgstr ""
119
 
120
+ #: aioseop_class.php:103 aioseop_performance.php:34
121
+ msgid "Force Rewrites:"
122
  msgstr ""
123
 
124
+ #: aioseop_class.php:104 aioseop_performance.php:35
125
+ msgid "Use output buffering to ensure that the title gets rewritten."
126
  msgstr ""
127
 
128
+ #: aioseop_class.php:112
129
+ msgid "Use Original Title:"
130
  msgstr ""
131
 
132
+ #: aioseop_class.php:113
133
+ msgid ""
134
+ "Use wp_title to set the title; disable this option if you run into conflicts "
135
+ "with the title being set by your theme or another plugin."
136
  msgstr ""
137
 
138
+ #: aioseop_class.php:120
139
+ msgid "Capitalize Titles:"
140
  msgstr ""
141
 
142
+ #: aioseop_class.php:121
143
+ msgid ""
144
+ "Check this and Search Page Titles and Tag Page Titles will have the first "
145
+ "letter of each word capitalized."
146
  msgstr ""
147
 
148
+ #: aioseop_class.php:124
149
+ msgid "Capitalize Category Titles:"
150
  msgstr ""
151
 
152
+ #: aioseop_class.php:125
153
+ msgid ""
154
+ "Check this and Category Titles will have the first letter of each word "
155
+ "capitalized."
156
  msgstr ""
157
 
158
+ #: aioseop_class.php:128
159
+ msgid "Page Title Format:"
160
  msgstr ""
161
 
162
+ #: aioseop_class.php:130 aioseop_class.php:147 aioseop_class.php:164
163
+ #: aioseop_class.php:175 aioseop_class.php:185 aioseop_class.php:195
164
+ #: aioseop_class.php:204 aioseop_class.php:214 aioseop_class.php:226
165
+ #: aioseop_class.php:506
166
+ msgid "The following macros are supported:"
167
  msgstr ""
168
 
169
+ #: aioseop_class.php:131 aioseop_class.php:148 aioseop_class.php:165
170
+ #: aioseop_class.php:176 aioseop_class.php:186 aioseop_class.php:196
171
+ #: aioseop_class.php:205 aioseop_class.php:215 aioseop_class.php:507
172
+ msgid "%blog_title% - Your blog title"
173
  msgstr ""
174
 
175
+ #: aioseop_class.php:132 aioseop_class.php:149 aioseop_class.php:166
176
+ #: aioseop_class.php:177 aioseop_class.php:187 aioseop_class.php:197
177
+ #: aioseop_class.php:206 aioseop_class.php:216 aioseop_class.php:508
178
+ msgid "%blog_description% - Your blog description"
179
  msgstr ""
180
 
181
+ #: aioseop_class.php:133
182
+ msgid "%page_title% - The original title of the page"
183
  msgstr ""
184
 
185
+ #: aioseop_class.php:134
186
+ msgid "%category_title% - The (main) category of the page"
187
  msgstr ""
188
 
189
+ #: aioseop_class.php:135 aioseop_class.php:152 aioseop_class.php:511
190
+ msgid "%category% - Alias for %category_title%"
191
  msgstr ""
192
 
193
+ #: aioseop_class.php:136
194
+ msgid "%page_author_login% - This page's author' login"
195
  msgstr ""
196
 
197
+ #: aioseop_class.php:137
198
+ msgid "%page_author_nicename% - This page's author' nicename"
 
 
 
 
 
 
 
 
 
 
199
  msgstr ""
200
 
201
+ #: aioseop_class.php:138
202
+ msgid "%page_author_firstname% - This page's author' first name (capitalized)"
203
  msgstr ""
204
 
205
+ #: aioseop_class.php:139
206
+ msgid "%page_author_lastname% - This page's author' last name (capitalized)"
207
  msgstr ""
208
 
209
+ #: aioseop_class.php:145
210
+ msgid "Post Title Format:"
211
  msgstr ""
212
 
213
+ #: aioseop_class.php:150 aioseop_class.php:509
214
+ msgid "%post_title% - The original title of the post"
215
  msgstr ""
216
 
217
+ #: aioseop_class.php:151 aioseop_class.php:510
218
+ msgid "%category_title% - The (main) category of the post"
219
  msgstr ""
220
 
221
+ #: aioseop_class.php:153 aioseop_class.php:512
222
+ msgid "%post_author_login% - This post's author' login"
 
 
 
223
  msgstr ""
224
 
225
+ #: aioseop_class.php:154 aioseop_class.php:513
226
+ msgid "%post_author_nicename% - This post's author' nicename"
227
  msgstr ""
228
 
229
+ #: aioseop_class.php:155 aioseop_class.php:514
230
+ msgid "%post_author_firstname% - This post's author' first name (capitalized)"
 
 
231
  msgstr ""
232
 
233
+ #: aioseop_class.php:156 aioseop_class.php:515
234
+ msgid "%post_author_lastname% - This post's author' last name (capitalized)"
235
  msgstr ""
236
 
237
+ #: aioseop_class.php:162
238
+ msgid "Category Title Format:"
 
 
 
239
  msgstr ""
240
 
241
+ #: aioseop_class.php:167
242
+ msgid "%category_title% - The original title of the category"
243
  msgstr ""
244
 
245
+ #: aioseop_class.php:168
246
+ msgid "%category_description% - The description of the category"
 
 
 
 
247
  msgstr ""
248
 
249
+ #: aioseop_class.php:173
250
+ msgid "Archive Title Format:"
251
  msgstr ""
252
 
253
+ #: aioseop_class.php:178
254
  msgid ""
255
+ "%date% - The original archive title given by wordpress, e.g. \"2007\" or "
256
+ "\"2007 August\""
 
 
 
 
 
 
 
 
 
257
  msgstr ""
258
 
259
+ #: aioseop_class.php:183
260
+ msgid "Tag Title Format:"
261
  msgstr ""
262
 
263
+ #: aioseop_class.php:188
264
+ msgid "%tag% - The name of the tag"
 
 
265
  msgstr ""
266
 
267
+ #: aioseop_class.php:193
268
+ msgid "Search Title Format:"
 
 
269
  msgstr ""
270
 
271
+ #: aioseop_class.php:198
272
+ msgid "%search% - What was searched for"
 
 
273
  msgstr ""
274
 
275
+ #: aioseop_class.php:203
276
+ msgid "Description Format"
277
  msgstr ""
278
 
279
+ #: aioseop_class.php:207
280
+ msgid ""
281
+ "%description% - The original description as determined by the plugin, e.g. "
282
+ "the excerpt if one is set or an auto-generated one if that option is set"
283
  msgstr ""
284
 
285
+ #: aioseop_class.php:208
286
+ msgid "%wp_title% - The original wordpress title, e.g. post_title for posts"
287
  msgstr ""
288
 
289
+ #: aioseop_class.php:213
290
+ msgid "404 Title Format:"
291
  msgstr ""
292
 
293
+ #: aioseop_class.php:217
294
+ msgid ""
295
+ "%request_url% - The original URL path, like \"/url-that-does-not-exist/\""
296
  msgstr ""
297
 
298
+ #: aioseop_class.php:218
299
+ msgid ""
300
+ "%request_words% - The URL path in human readable form, like \"Url That Does "
301
+ "Not Exist\""
302
  msgstr ""
303
 
304
+ #: aioseop_class.php:219
305
+ msgid "%404_title% - Additional 404 title input\""
306
  msgstr ""
307
 
308
+ #: aioseop_class.php:224
309
+ msgid "Paged Format:"
310
  msgstr ""
311
 
312
+ #: aioseop_class.php:225
313
+ msgid ""
314
+ "This string gets appended/prepended to titles when they are for paged index "
315
+ "pages (like home or archive pages)."
316
  msgstr ""
317
 
318
+ #: aioseop_class.php:227
319
+ msgid "%page% - The page number"
320
  msgstr ""
321
 
322
+ #: aioseop_class.php:232
323
+ msgid "SEO for Custom Post Types:"
324
  msgstr ""
325
 
326
+ #: aioseop_class.php:233
327
+ msgid ""
328
+ "Check this if you want your enable AIOSEOP support for Custom Post Types on "
329
+ "this site."
330
  msgstr ""
331
 
332
+ #: aioseop_class.php:240
333
+ msgid "Enable Advanced Options:"
334
  msgstr ""
335
 
336
+ #: aioseop_class.php:241
337
+ msgid "This allows you to do more with your custom post types."
338
  msgstr ""
339
 
340
+ #: aioseop_class.php:250
341
+ msgid "SEO on only these post types:"
342
  msgstr ""
343
 
344
+ #: aioseop_class.php:251
345
+ msgid "Select specific custom post types for AIOSEOP support."
346
  msgstr ""
347
 
348
+ #: aioseop_class.php:257
349
+ msgid "Custom titles:"
350
  msgstr ""
351
 
352
+ #: aioseop_class.php:258
353
+ msgid "Allows setting specific custom titles for all post types."
 
 
354
  msgstr ""
355
 
356
+ #: aioseop_class.php:264
357
+ msgid "Show Column Labels for Custom Post Types:"
358
  msgstr ""
359
 
360
+ #: aioseop_class.php:265
361
+ msgid ""
362
+ "Choose which post types you want to have SEO columns on the edit.php screen. "
363
+ "You can select as many as you like."
364
  msgstr ""
365
 
366
+ #: aioseop_class.php:269
367
+ msgid "Display Menu In Admin Bar:"
368
  msgstr ""
369
 
370
+ #: aioseop_class.php:270
371
+ msgid "Check this for easy access to settings from the admin menu bar."
372
  msgstr ""
373
 
374
+ #: aioseop_class.php:274
375
+ msgid "Google Webmaster Tools:"
376
  msgstr ""
377
 
378
+ #: aioseop_class.php:275 aioseop_class.php:279 aioseop_class.php:283
379
  msgid ""
380
+ "Enter your verification code here to add a meta tag to your homepage to "
381
+ "verify your site."
382
  msgstr ""
383
 
384
+ #: aioseop_class.php:278
385
+ msgid "Bing Webmaster Center:"
386
  msgstr ""
387
 
388
+ #: aioseop_class.php:282
389
+ msgid "Pinterest Site Verification:"
390
+ msgstr ""
391
+
392
+ #: aioseop_class.php:286
393
+ msgid "Google Plus Default Profile:"
394
  msgstr ""
395
 
396
+ #: aioseop_class.php:287
397
  msgid ""
398
+ "Enter your Google Plus Profile URL here to link your site's pages to Google "
399
+ "Plus."
400
  msgstr ""
401
 
402
+ #: aioseop_class.php:290
403
+ msgid "Google Analytics ID:"
404
+ msgstr ""
405
+
406
+ #: aioseop_class.php:291
407
  msgid ""
408
+ "Enter your Google Analytics ID here to track your site with Google Analytics."
 
409
  msgstr ""
410
 
411
+ #: aioseop_class.php:294
412
+ msgid "Tracking Domain:"
413
  msgstr ""
414
 
415
+ #: aioseop_class.php:296
416
+ msgid "Enter domain name for tracking with Google Analytics."
417
  msgstr ""
418
 
419
+ #: aioseop_class.php:299
420
+ msgid "Track Multiple Domains:"
 
 
421
  msgstr ""
422
 
423
+ #: aioseop_class.php:300
424
+ msgid "Enable multi-domain tracking for Google Analytics."
425
  msgstr ""
426
 
427
+ #: aioseop_class.php:304
428
+ msgid "Track Outbound Links:"
429
  msgstr ""
430
 
431
+ #: aioseop_class.php:305
432
+ msgid "Add functionality to track outbound links with Google Analytics."
 
 
433
  msgstr ""
434
 
435
+ #: aioseop_class.php:309
436
  msgid "Use Categories for META keywords:"
437
  msgstr ""
438
 
439
+ #: aioseop_class.php:310
440
  msgid ""
441
  "Check this if you want your categories for a given post used as the META "
442
  "keywords for this post (in addition to any keywords and tags you specify on "
443
  "the post edit page)."
444
  msgstr ""
445
 
446
+ #: aioseop_class.php:314
447
  msgid "Use Tags for META keywords:"
448
  msgstr ""
449
 
450
+ #: aioseop_class.php:315
451
  msgid ""
452
  "Check this if you want your tags for a given post used as the META keywords "
453
  "for this post (in addition to any keywords you specify on the post edit "
454
  "page)."
455
  msgstr ""
456
 
457
+ #: aioseop_class.php:319
458
  msgid "Dynamically Generate Keywords for Posts Page:"
459
  msgstr ""
460
 
461
+ #: aioseop_class.php:320
462
  msgid ""
463
  "Check this if you want your keywords on a custom posts page (set it in "
464
  "options->reading) to be dynamically generated from the keywords of the posts "
466
  "edit page screen for the posts page."
467
  msgstr ""
468
 
469
+ #: aioseop_class.php:324
470
  msgid "Use noindex for Categories:"
471
  msgstr ""
472
 
473
+ #: aioseop_class.php:325
474
  msgid ""
475
  "Check this for excluding category pages from being crawled. Useful for "
476
  "avoiding duplicate content."
477
  msgstr ""
478
 
479
+ #: aioseop_class.php:328
480
  msgid "Use noindex for Archives:"
481
  msgstr ""
482
 
483
+ #: aioseop_class.php:329
484
  msgid ""
485
  "Check this for excluding archive pages from being crawled. Useful for "
486
  "avoiding duplicate content."
487
  msgstr ""
488
 
489
+ #: aioseop_class.php:332
490
  msgid "Use noindex for Tag Archives:"
491
  msgstr ""
492
 
493
+ #: aioseop_class.php:333
494
  msgid ""
495
  "Check this for excluding tag pages from being crawled. Useful for avoiding "
496
  "duplicate content."
497
  msgstr ""
498
 
499
+ #: aioseop_class.php:336
500
  msgid "Autogenerate Descriptions:"
501
  msgstr ""
502
 
503
+ #: aioseop_class.php:337
504
  msgid ""
505
  "Check this and your META descriptions will get autogenerated if there's no "
506
  "excerpt."
507
  msgstr ""
508
 
509
+ #: aioseop_class.php:340
510
+ msgid "Unprotect Post Meta Fields:"
511
  msgstr ""
512
 
513
+ #: aioseop_class.php:341
514
  msgid ""
515
+ "Unprotect internal postmeta fields for use with XMLRPC -- if you don't know "
516
+ "what that is, leave it unchecked."
517
  msgstr ""
518
 
519
+ #: aioseop_class.php:344
520
  msgid "Exclude Pages:"
521
  msgstr ""
522
 
523
+ #: aioseop_class.php:345
524
  msgid ""
525
  "Enter any comma separated pages here to be excluded by All in One SEO Pack. "
526
  "This is helpful when using plugins which generate their own non-WordPress "
531
  "will be excluded from All in One SEO Pack."
532
  msgstr ""
533
 
534
+ #: aioseop_class.php:348
535
  msgid "Additional Post Headers:"
536
  msgstr ""
537
 
538
+ #: aioseop_class.php:349
539
+ msgid "What you enter here will be copied verbatim to your header on posts."
540
+ msgstr ""
541
+
542
+ #: aioseop_class.php:349 aioseop_class.php:353 aioseop_class.php:357
543
+ #: aioseop_class.php:361
544
  msgid ""
 
545
  "You can enter whatever additional headers you want here, even references to "
546
  "stylesheets."
547
  msgstr ""
548
 
549
+ #: aioseop_class.php:352
550
  msgid "Additional Page Headers:"
551
  msgstr ""
552
 
553
+ #: aioseop_class.php:353
554
+ msgid "What you enter here will be copied verbatim to your header on pages."
555
+ msgstr ""
556
+
557
+ #: aioseop_class.php:356
558
+ msgid "Additional Front Page Headers:"
559
+ msgstr ""
560
+
561
+ #: aioseop_class.php:357
562
  msgid ""
563
+ "What you enter here will be copied verbatim to your header on the front page "
564
+ "if you have a static page set in Settings, Reading."
565
+ msgstr ""
566
+
567
+ #: aioseop_class.php:357
568
+ msgid ""
569
+ "This will fall back to using Additional Page Headers if you have them set "
570
+ "and nothing is entered here."
571
  msgstr ""
572
 
573
+ #: aioseop_class.php:360
574
+ msgid "Additional Blog Page Headers:"
575
  msgstr ""
576
 
577
+ #: aioseop_class.php:361
578
  msgid ""
579
+ "What you enter here will be copied verbatim to your header on the home page "
580
+ "if you have Front page displays your latest posts selected in Settings, "
581
+ "Reading.  It will also be copied verbatim to your header on the Posts page "
582
+ "if you have one set in Settings, Reading."
583
  msgstr ""
584
 
585
+ #: aioseop_class.php:364
586
  msgid "Log important events:"
587
  msgstr ""
588
 
589
+ #: aioseop_class.php:365
590
  msgid ""
591
  "Check this and SEO pack will create a log of important events "
592
  "(all_in_one_seo_pack.log) in its plugin directory which might help debugging "
593
  "it. Make sure this directory is writable."
594
  msgstr ""
595
 
596
+ #: aioseop_class.php:378
597
+ msgid "Upgrade to All in One SEO Pack Pro Version"
598
+ msgstr ""
599
+
600
+ #: aioseop_class.php:380
601
+ msgid "Preview Snippet"
602
+ msgstr ""
603
+
604
+ #: aioseop_class.php:380
605
+ msgid "A preview of what this page might look like in search engine results."
606
+ msgstr ""
607
+
608
+ #: aioseop_class.php:381
609
+ msgid "Title"
610
+ msgstr ""
611
+
612
+ #: aioseop_class.php:381
613
+ msgid "A custom title that shows up in the title tag for this page."
614
+ msgstr ""
615
+
616
+ #: aioseop_class.php:382
617
+ msgid "Description"
618
+ msgstr ""
619
+
620
+ #: aioseop_class.php:382
621
+ msgid ""
622
+ "The META description for this page. This will override any autogenerated "
623
+ "descriptions."
624
+ msgstr ""
625
+
626
+ #: aioseop_class.php:383
627
+ msgid "Keywords (comma separated)"
628
+ msgstr ""
629
+
630
+ #: aioseop_class.php:383
631
+ msgid ""
632
+ "A comma separated list of your most important keywords for this page that "
633
+ "will be written as META keywords."
634
  msgstr ""
635
 
636
+ #: aioseop_class.php:384
637
+ msgid "Robots Meta NOINDEX"
638
+ msgstr ""
639
+
640
+ #: aioseop_class.php:384
641
+ msgid "Check this box to ask search engines not to index this page."
642
+ msgstr ""
643
+
644
+ #: aioseop_class.php:385
645
+ msgid "Robots Meta NOFOLLOW"
646
+ msgstr ""
647
+
648
+ #: aioseop_class.php:385
649
+ msgid ""
650
+ "Check this box to ask search engines not to follow links from this page."
651
+ msgstr ""
652
+
653
+ #: aioseop_class.php:386
654
+ msgid "Title Attribute"
655
+ msgstr ""
656
+
657
+ #: aioseop_class.php:386
658
+ msgid "Set the title attribute for menu links."
659
+ msgstr ""
660
+
661
+ #: aioseop_class.php:387
662
+ msgid "Menu Label"
663
+ msgstr ""
664
+
665
+ #: aioseop_class.php:387
666
+ msgid "Set the label for this page menu item."
667
+ msgstr ""
668
+
669
+ #: aioseop_class.php:388
670
+ msgid "Disable on this page/post"
671
+ msgstr ""
672
+
673
+ #: aioseop_class.php:388
674
+ msgid "Disable SEO on this page."
675
+ msgstr ""
676
+
677
+ #: aioseop_class.php:389
678
+ msgid "Disable Google Analytics"
679
+ msgstr ""
680
+
681
+ #: aioseop_class.php:389
682
+ msgid "Disable Google Analytics on this page."
683
+ msgstr ""
684
+
685
+ #: aioseop_class.php:399
686
+ msgid "Home Page Settings"
687
+ msgstr ""
688
+
689
+ #: aioseop_class.php:403
690
+ msgid "Keyword Settings"
691
+ msgstr ""
692
+
693
+ #: aioseop_class.php:407
694
+ msgid "Title Settings"
695
+ msgstr ""
696
+
697
+ #: aioseop_class.php:412
698
+ msgid "Custom Post Type Settings"
699
+ msgstr ""
700
+
701
+ #: aioseop_class.php:416
702
+ msgid "Display Settings"
703
+ msgstr ""
704
+
705
+ #: aioseop_class.php:420
706
+ msgid "Webmaster Verification"
707
+ msgstr ""
708
+
709
+ #: aioseop_class.php:424
710
+ msgid "Google Settings"
711
+ msgstr ""
712
+
713
+ #: aioseop_class.php:428
714
+ msgid "Noindex Settings"
715
+ msgstr ""
716
+
717
+ #: aioseop_class.php:432
718
+ msgid "Advanced Settings"
719
+ msgstr ""
720
+
721
+ #: aioseop_class.php:504
722
+ msgid "Title Format:"
723
+ msgstr ""
724
+
725
+ #: aioseop_class.php:526
726
+ msgid "Welcome to Version %s!"
727
+ msgstr ""
728
+
729
+ #: aioseop_class.php:527
730
+ msgid ""
731
+ "Thank you for running the latest and greatest All in One SEO Pack ever! New "
732
+ "in 2.0: manage your performance with our Performance module; enable it from "
733
+ "our new feature manager! And please review your settings, we have added some "
734
+ "new ones!"
735
+ msgstr ""
736
+
737
+ #: aioseop_class.php:545
738
+ msgid "Reset General Settings to Defaults"
739
+ msgstr ""
740
+
741
+ #: aioseop_class.php:546
742
+ msgid "Reset ALL Settings to Defaults"
743
+ msgstr ""
744
+
745
+ #: aioseop_class.php:630
746
+ msgid "All in One SEO Plugin Support Forum"
747
+ msgstr ""
748
+
749
+ #: aioseop_class.php:631
750
+ msgid "Support Forum"
751
+ msgstr ""
752
+
753
+ #: aioseop_class.php:632
754
+ msgid "Pro Version"
755
+ msgstr ""
756
+
757
+ #: aioseop_class.php:634
758
+ msgid "UPGRADE TO PRO VERSION"
759
+ msgstr ""
760
+
761
+ #: aioseop_class.php:656
762
+ msgid "Donate"
763
+ msgstr ""
764
+
765
+ #: aioseop_class.php:658
766
+ msgid "Donate with Paypal"
767
+ msgstr ""
768
+
769
+ #: aioseop_class.php:660
770
+ msgid "My Amazon Wish List"
771
+ msgstr ""
772
+
773
+ #: aioseop_class.php:661
774
+ msgid "Follow us on Facebook"
775
+ msgstr ""
776
+
777
+ #: aioseop_class.php:662
778
+ msgid "Follow us on Twitter"
779
+ msgstr ""
780
+
781
+ #: aioseop_class.php:670
782
+ msgid ""
783
+ "For support please visit the Semper Plugins Support Forum at http://"
784
+ "semperplugins.com/support/"
785
+ msgstr ""
786
+
787
+ #: aioseop_class.php:1641
788
+ msgid "AIOSEOP"
789
+ msgstr ""
790
+
791
+ #: aioseop_class.php:1652
792
+ msgid "All in One SEO"
793
+ msgstr ""
794
+
795
+ #: aioseop_class.php:1673
796
+ msgid "Thank you!"
797
+ msgstr ""
798
+
799
+ #: aioseop_class.php:1674
800
+ msgid ""
801
+ "Thank you for your donation, it helps keep this plugin free and actively "
802
+ "developed!"
803
+ msgstr ""
804
+
805
+ #: aioseop_class.php:1728
806
+ msgid "Main Settings"
807
+ msgstr ""
808
+
809
+ #: aioseop_feature_manager.php:14
810
+ msgid "Feature Manager"
811
+ msgstr ""
812
+
813
+ #: aioseop_feature_manager.php:18 aioseop_performance.php:14
814
+ msgid "Performance"
815
+ msgstr ""
816
+
817
+ #: aioseop_feature_manager.php:19
818
+ msgid "Optimize performance related to SEO and check your system status."
819
+ msgstr ""
820
+
821
+ #: aioseop_feature_manager.php:21
822
+ msgid "Coming Soon..."
823
+ msgstr ""
824
+
825
+ #: aioseop_feature_manager.php:22
826
+ msgid "XML Sitemaps"
827
+ msgstr ""
828
+
829
+ #: aioseop_feature_manager.php:65
830
+ msgid "Update Features"
831
+ msgstr ""
832
+
833
+ #: aioseop_feature_manager.php:67
834
+ msgid "Reset Features"
835
+ msgstr ""
836
+
837
+ #: aioseop_functions.php:55
838
+ msgid "Updating SEO post meta in database."
839
+ msgstr ""
840
+
841
+ #: aioseop_functions.php:194
842
+ msgid "SEO Title"
843
+ msgstr ""
844
+
845
+ #: aioseop_functions.php:195
846
+ msgid "SEO Keywords"
847
+ msgstr ""
848
+
849
+ #: aioseop_functions.php:196
850
+ msgid "SEO Description"
851
+ msgstr ""
852
+
853
+ #: aioseop_functions.php:234 aioseop_functions.php:255
854
+ #: aioseop_functions.php:294
855
+ msgid "Edit"
856
+ msgstr ""
857
+
858
+ #: aioseop_functions.php:234
859
+ msgid "Post"
860
+ msgstr ""
861
+
862
+ #: aioseop_functions.php:234
863
+ msgid "Save"
864
+ msgstr ""
865
+
866
+ #: aioseop_functions.php:234
867
+ msgid "Cancel"
868
+ msgstr ""
869
+
870
+ #: aioseop_functions.php:235
871
+ msgid "Please wait..."
872
+ msgstr ""
873
+
874
+ #: aioseop_functions.php:235
875
+ msgid "Slug may not be empty!"
876
+ msgstr ""
877
+
878
+ #: aioseop_functions.php:236
879
+ msgid "Revisions"
880
+ msgstr ""
881
+
882
+ #: aioseop_functions.php:236
883
+ msgid "Insert time"
884
+ msgstr ""
885
+
886
+ #: aioseop_functions.php:253 aioseop_performance.php:144
887
+ #: aioseop_performance.php:146 aioseop_performance.php:148
888
+ #: aioseop_performance.php:161
889
+ msgid "No"
890
+ msgstr ""
891
+
892
+ #: aioseop_functions.php:270
893
+ msgid "Unauthorized access; try reloading the page."
894
+ msgstr ""
895
+
896
+ #: aioseop_functions.php:403
897
+ msgid "Google+"
898
+ msgstr ""
899
+
900
+ #: aioseop_module_class.php:904
901
+ msgid " characters. Most search engines use a maximum of %s chars for the %s."
902
+ msgstr ""
903
+
904
+ #: aioseop_module_class.php:927
905
+ msgid "Click for Help!"
906
+ msgstr ""
907
+
908
+ #: aioseop_module_class.php:1052
909
+ msgid ""
910
+ "Security Check - If you receive this in error, log out and back in to "
911
+ "WordPress"
912
+ msgstr ""
913
+
914
+ #: aioseop_module_class.php:1054
915
+ msgid "Options Reset."
916
+ msgstr ""
917
+
918
+ #: aioseop_module_class.php:1063
919
+ msgid "All in One SEO Options Updated."
920
+ msgstr ""
921
+
922
+ #: aioseop_module_class.php:1107
923
  msgid "Update Options"
924
  msgstr ""
925
 
926
+ #: aioseop_performance.php:19
927
+ msgid "Raise memory limit"
928
+ msgstr ""
929
+
930
+ #: aioseop_performance.php:20
931
+ msgid ""
932
+ "Allows you to raise your PHP memory limit to a reasonable value. Note: "
933
+ "WordPress core and other WordPress plugins may also change the value of the "
934
+ "memory limit."
935
+ msgstr ""
936
+
937
+ #: aioseop_performance.php:23 aioseop_performance.php:28
938
+ msgid "Use the system default"
939
+ msgstr ""
940
+
941
+ #: aioseop_performance.php:24
942
+ msgid "Raise execution time"
943
+ msgstr ""
944
+
945
+ #: aioseop_performance.php:25
946
+ msgid "Allows you to raise your PHP execution time to a reasonable value."
947
+ msgstr ""
948
+
949
+ #: aioseop_performance.php:28
950
+ msgid "No limit"
951
+ msgstr ""
952
+
953
+ #: aioseop_performance.php:55
954
+ msgid "System Status"
955
+ msgstr ""
956
+
957
+ #: aioseop_performance.php:128
958
+ msgid "Not set"
959
+ msgstr ""
960
+
961
+ #: aioseop_performance.php:129 aioseop_performance.php:131
962
+ msgid "On"
963
+ msgstr ""
964
+
965
+ #: aioseop_performance.php:130 aioseop_performance.php:132
966
+ msgid "Off"
967
+ msgstr ""
968
+
969
+ #: aioseop_performance.php:134 aioseop_performance.php:136
970
+ #: aioseop_performance.php:138 aioseop_performance.php:140
971
+ #: aioseop_performance.php:142 aioseop_performance.php:164
972
+ msgid "N/A"
973
+ msgstr ""
974
+
975
+ #: aioseop_performance.php:141
976
+ msgid " MByte"
977
+ msgstr ""
978
+
979
+ #: aioseop_performance.php:143 aioseop_performance.php:145
980
+ #: aioseop_performance.php:147 aioseop_performance.php:159
981
+ msgid "Yes"
982
+ msgstr ""
983
+
984
+ #: aioseop_performance.php:171
985
+ msgid "Operating System"
986
+ msgstr ""
987
+
988
+ #: aioseop_performance.php:172
989
+ msgid "Server"
990
+ msgstr ""
991
+
992
+ #: aioseop_performance.php:173
993
+ msgid "Memory usage"
994
+ msgstr ""
995
+
996
+ #: aioseop_performance.php:174
997
+ msgid "MYSQL Version"
998
+ msgstr ""
999
+
1000
+ #: aioseop_performance.php:175
1001
+ msgid "SQL Mode"
1002
+ msgstr ""
1003
+
1004
+ #: aioseop_performance.php:176
1005
+ msgid "PHP Version"
1006
+ msgstr ""
1007
+
1008
+ #: aioseop_performance.php:177
1009
+ msgid "PHP Safe Mode"
1010
  msgstr ""
1011
 
1012
+ #: aioseop_performance.php:178
1013
+ msgid "PHP Allow URL fopen"
1014
+ msgstr ""
1015
+
1016
+ #: aioseop_performance.php:179
1017
+ msgid "PHP Memory Limit"
1018
+ msgstr ""
1019
+
1020
+ #: aioseop_performance.php:180
1021
+ msgid "PHP Max Upload Size"
1022
+ msgstr ""
1023
+
1024
+ #: aioseop_performance.php:181
1025
+ msgid "PHP Max Post Size"
1026
+ msgstr ""
1027
+
1028
+ #: aioseop_performance.php:182
1029
+ msgid "PHP Max Script Execute Time"
1030
+ msgstr ""
1031
+
1032
+ #: aioseop_performance.php:183
1033
+ msgid "PHP Exif support"
1034
+ msgstr ""
1035
+
1036
+ #: aioseop_performance.php:184
1037
+ msgid "PHP IPTC support"
1038
+ msgstr ""
1039
+
1040
+ #: aioseop_performance.php:185
1041
+ msgid "PHP XML support"
1042
+ msgstr ""
1043
+
1044
+ #: aioseop_performance.php:186
1045
+ msgid "Site URL"
1046
+ msgstr ""
1047
+
1048
+ #: aioseop_performance.php:187
1049
+ msgid "Home URL"
1050
+ msgstr ""
1051
+
1052
+ #: aioseop_performance.php:188
1053
+ msgid "WordPress Version"
1054
+ msgstr ""
1055
+
1056
+ #: aioseop_performance.php:189
1057
+ msgid "WordPress DB Version"
1058
+ msgstr ""
1059
+
1060
+ #: aioseop_performance.php:190
1061
+ msgid "Multisite"
1062
+ msgstr ""
1063
+
1064
+ #: aioseop_performance.php:191
1065
+ msgid "Active Theme"
1066
+ msgstr ""
1067
+
1068
+ #: aioseop_performance.php:206
1069
+ msgid "All in One SEO Pack Pro Debug Info"
1070
+ msgstr ""
1071
+
1072
+ #: aioseop_performance.php:222
1073
+ msgid "Form submission error: verification check failed."
1074
+ msgstr ""
1075
+
1076
+ #: aioseop_performance.php:228
1077
+ msgid "%s has checked for updates."
1078
+ msgstr ""
1079
+
1080
+ #: aioseop_performance.php:232
1081
+ msgid "SFWD Debug Mail From Site %s."
1082
+ msgstr ""
1083
+
1084
+ #: aioseop_performance.php:233
1085
+ msgid "Sent to %s."
1086
+ msgstr ""
1087
+
1088
+ #: aioseop_performance.php:235
1089
+ msgid "Failed to send to %s."
1090
+ msgstr ""
1091
+
1092
+ #: aioseop_performance.php:238
1093
+ msgid "Error: please enter an e-mail address before submitting."
1094
+ msgstr ""
1095
+
1096
+ #: aioseop_performance.php:243
1097
+ msgid "E-mail debug information"
1098
+ msgstr ""
1099
+
1100
+ #: aioseop_performance.php:244
1101
+ msgid "Submit"
1102
+ msgstr ""
1103
+
1104
+ #: aioseop_performance.php:244
1105
+ msgid "Check For Updates"
1106
+ msgstr ""
1107
+
1108
+ #: all_in_one_seo_pack.php:43
1109
+ msgid "%s detected a conflict; please deactivate the plugin located in %s."
1110
+ msgstr ""
1111
+
1112
+ #. Plugin Name of the plugin/theme
1113
+ msgid "All In One SEO Pack"
1114
+ msgstr ""
1115
+
1116
+ #. Plugin URI of the plugin/theme
1117
+ msgid "http://semperfiwebdesign.com"
1118
+ msgstr ""
1119
+
1120
+ #. Description of the plugin/theme
1121
  msgid ""
1122
+ "Out-of-the-box SEO for your WordPress blog. <a href=\"admin.php?page=all-in-"
1123
+ "one-seo-pack/aioseop_class.php\">Options configuration panel</a> | <a href="
1124
+ "\"http://semperplugins.com/plugins/\">Upgrade to Pro Version</a> | <a href="
1125
+ "\"https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtorbert"
1126
+ "%40gmail%2ecom&item_name=All%20In%20One%20SEO%20Pack&item_number=Support"
1127
+ "%20Open%20Source&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP"
1128
+ "%2dDonationsBF&charset=UTF%2d8\">Donate</a> | <a href=\"http://semperplugins."
1129
+ "com/support/\" >Support</a> | <a href=\"https://www.amazon.com/"
1130
+ "wishlist/1NFQ133FNCOOA/ref=wl_web\" target=\"_blank\" title=\"Amazon Wish "
1131
+ "List\">Amazon Wishlist</a>"
1132
+ msgstr ""
1133
+
1134
+ #. Author of the plugin/theme
1135
+ msgid "Michael Torbert"
1136
+ msgstr ""
1137
+
1138
+ #. Author URI of the plugin/theme
1139
+ msgid "http://michaeltorbert.com"
1140
  msgstr ""
images/Default-BW-Retina.png ADDED
Binary file
images/Default-BW-Standard.png ADDED
Binary file
images/Default-Color-Retina.png ADDED
Binary file
images/Default-Color-Standard.png ADDED
Binary file
images/Performance-BW-Retina.png ADDED
Binary file
images/Performance-BW-Standard.png ADDED
Binary file
images/Performance-Color-Retina.png ADDED
Binary file
images/Performance-Color-Standard.png ADDED
Binary file
images/accept.png ADDED
Binary file
images/activity.gif ADDED
Binary file
images/cog_edit.png ADDED
Binary file
images/default-user-image.png ADDED
Binary file
images/delete.png ADDED
Binary file
images/error.png DELETED
Binary file
images/facebook-follow-retina.png ADDED
Binary file
images/facebook-follow-standard.png ADDED
Binary file
images/globe.png DELETED
Binary file
images/iblogpro.jpg DELETED
Binary file
images/pagelines.jpg DELETED
Binary file
images/question.png ADDED
Binary file
images/shield-sprite-16.png ADDED
Binary file
images/shield-sprite-32.png ADDED
Binary file
images/shield32.png ADDED
Binary file
images/shield32fade.png ADDED
Binary file
images/shield64.png ADDED
Binary file
images/stationpro.jpg DELETED
Binary file
images/twitter-follow-retina.png ADDED
Binary file
images/twitter-follow-standard.png ADDED
Binary file
images/twitter.png DELETED
Binary file
images/update32.png ADDED
Binary file
images/update64.png ADDED
Binary file
images/whitehouse.jpg DELETED
Binary file
quickedit_functions.js ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function aioseop_ajax_edit_meta_form( post_id, post_title, meta ) {
2
+ var uform = jQuery('#aioseop_'+meta+'_' + post_id);
3
+ var element = uform.html(); var input;
4
+ input = '<input type="text" id="aioseop_new_'+meta+'_' + post_id + '" value="' + post_title + '" style="font-size:10px;width:65%;float:left" />';
5
+ input += '<label style="float:left">';
6
+ input += '<a class="aioseop_mpc_SEO_admin_options_edit" href="javascript:void(0);" id="aioseop_'+meta+'_save_' + post_id + '" >';
7
+ input += '<img src="' + aioseopadmin.imgUrl+'accept.png" border="0" alt="" title="'+meta+'" /></a>';
8
+ input += '<a class="aioseop_mpc_SEO_admin_options_edit" href="javascript:void(0);" id="aioseop_'+meta+'_cancel_' + post_id + '" >';
9
+ input += '<img src="' + aioseopadmin.imgUrl+'delete.png" border="0" alt="" title="'+meta+'" /></a>';
10
+ input += '</label>';
11
+ uform.html( input );
12
+ jQuery('#aioseop_'+meta+'_cancel_' + post_id).click(function() {
13
+ uform.html( element );
14
+ });
15
+ jQuery('#aioseop_'+meta+'_save_' + post_id).click(function() {
16
+ var new_meta = jQuery( 'input#aioseop_new_'+meta+'_' + post_id ).val();
17
+ handle_post_meta( post_id, new_meta, meta );
18
+ });
19
+ }
20
+
21
+ function handle_post_meta( p, t, m ) {
22
+ jQuery("div#aioseop_"+m+"_"+p).fadeOut('fast', function() {
23
+ var loading = '<label class="aioseop_'+m+'_loading">';
24
+ loading += '<img style="width:20px;margin-right:5px;float:left" align="absmiddle" ';
25
+ loading += 'src="'+aioseopadmin.imgUrl+'activity.gif" border="0" alt="" title="'+m+'" /></a>';
26
+ loading += '</label><div style="float:left">Please wait…</div>';
27
+ jQuery("div#aioseop_"+m+"_"+p).fadeIn('fast', function() {
28
+ var aioseop_sack = new sack(aioseopadmin.requestUrl);
29
+ aioseop_sack.execute = 1;
30
+ aioseop_sack.method = 'POST';
31
+ aioseop_sack.setVar( "action", "aioseop_ajax_save_meta");
32
+ aioseop_sack.setVar( "post_id", p );
33
+ aioseop_sack.setVar( "new_meta", t );
34
+ aioseop_sack.setVar( "target_meta", m );
35
+ aioseop_sack.setVar( "_inline_edit", jQuery('input#_inline_edit').val() );
36
+ aioseop_sack.onError = function() {alert('Ajax error on saving title'); };
37
+ aioseop_sack.runAJAX();
38
+ })
39
+ jQuery("div#aioseop_"+m+"_"+p).html(loading);
40
+ })
41
+ };
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: hallsofmontezuma
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtorbert%40gmail%2ecom&item_name=All%20In%20One%20SEO%20Pack&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8
4
  Tags: seo, search engine optimization, google
5
  Requires at least: 3.0
6
- Tested up to: 3.5
7
  Stable tag: trunk
8
 
9
  WordPress SEO plugin to automatically optimize your Wordpress blog for Search Engines.
@@ -14,7 +14,7 @@ WordPress SEO plugin to automatically optimize your Wordpress blog for Search En
14
 
15
  **[Upgrade to Pro Version](http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/)**
16
 
17
- [Support](http://semperplugins.com/support/) |
18
  [Change Log](http://semperfiwebdesign.com/documentation/all-in-one-seo-pack/all-in-one-seo-pack-release-history/) |
19
  [FAQ](http://semperfiwebdesign.com/documentation/all-in-one-seo-pack/all-in-one-seo-faq/)|
20
  [Translations](http://semperfiwebdesign.com/documentation/all-in-one-seo-pack/translations-for-all-in-one-seo-pack/)
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtorbert%40gmail%2ecom&item_name=All%20In%20One%20SEO%20Pack&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8
4
  Tags: seo, search engine optimization, google
5
  Requires at least: 3.0
6
+ Tested up to: 3.5.1
7
  Stable tag: trunk
8
 
9
  WordPress SEO plugin to automatically optimize your Wordpress blog for Search Engines.
14
 
15
  **[Upgrade to Pro Version](http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/)**
16
 
17
+ [Support](http://semperfiwebdesign.com/forum/) |
18
  [Change Log](http://semperfiwebdesign.com/documentation/all-in-one-seo-pack/all-in-one-seo-pack-release-history/) |
19
  [FAQ](http://semperfiwebdesign.com/documentation/all-in-one-seo-pack/all-in-one-seo-faq/)|
20
  [Translations](http://semperfiwebdesign.com/documentation/all-in-one-seo-pack/translations-for-all-in-one-seo-pack/)
wpml-config.xml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <wpml-config>
2
+ <custom-fields>
3
+ <custom-field action="translate">_aioseop_title</custom-field>
4
+ <custom-field action="translate">_aioseop_description</custom-field>
5
+ <custom-field action="translate">_aioseop_keywords</custom-field>
6
+ </custom-fields>
7
+ <admin-texts>
8
+ <key name="aioseop_options">
9
+ <key name="aiosp_home_title" />
10
+ <key name="aiosp_home_description" />
11
+ <key name="aiosp_home_keywords" />
12
+ <key name="aiosp_post_title_format" />
13
+ <key name="aiosp_page_title_format" />
14
+ <key name="aiosp_category_title_format" />
15
+ <key name="aiosp_archive_title_format" />
16
+ <key name="aiosp_tag_title_format" />
17
+ <key name="aiosp_search_title_format" />
18
+ <key name="aiosp_description_format" />
19
+ <key name="aiosp_404_title_format" />
20
+ <key name="aiosp_paged_format" />
21
+ </key>
22
+ </admin-texts>
23
+ </wpml-config>
24
+
25
+