Version Description
Download this release
Release Info
Developer | uberdose |
Plugin | All in One SEO Pack |
Version | 1.3.8.9 |
Comparing to | |
See all releases |
Code changes from version 1.3.8.8 to 1.3.8.9
- all_in_one_seo_pack.php +50 -5
all_in_one_seo_pack.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: All in One SEO Pack
|
5 |
Plugin URI: http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/
|
6 |
Description: Out-of-the-box SEO for your Wordpress blog.
|
7 |
-
Version: 1.3.8.
|
8 |
Author: uberdose
|
9 |
Author URI: http://wp.uberdose.com/
|
10 |
*/
|
@@ -28,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
28 |
|
29 |
class All_in_One_SEO_Pack {
|
30 |
|
31 |
-
var $version = "1.3.8.
|
32 |
|
33 |
/** Max numbers of chars in auto-generated description */
|
34 |
var $maximum_description_length = 160;
|
@@ -59,7 +59,20 @@ class All_in_One_SEO_Pack {
|
|
59 |
/** Which zip to download in order to upgrade .*/
|
60 |
var $upgrade_url = 'http://downloads.wordpress.org/plugin/all-in-one-seo-pack.zip';
|
61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
function All_in_One_SEO_Pack() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
$this->upgrade_filename = dirname(__FILE__) . '/' . $this->upgrade_filename;
|
64 |
$this->upgrade_folder = dirname(__FILE__);
|
65 |
}
|
@@ -648,6 +661,12 @@ class All_in_One_SEO_Pack {
|
|
648 |
return $file;
|
649 |
}
|
650 |
|
|
|
|
|
|
|
|
|
|
|
|
|
651 |
function download_newest_version() {
|
652 |
$success = true;
|
653 |
$file_content = $this->get_url($this->upgrade_url);
|
@@ -658,15 +677,21 @@ class All_in_One_SEO_Pack {
|
|
658 |
$this->upgrade_error = sprintf(__("Could not download distribution (%s): %s"), $this->upgrade_url, $file_content);
|
659 |
$success = false;
|
660 |
} else {
|
|
|
661 |
$fh = @fopen($this->upgrade_filename, 'w');
|
|
|
662 |
if (!$fh) {
|
663 |
$this->upgrade_error = sprintf(__("Could not open %s for writing"), $this->upgrade_filename);
|
664 |
$this->upgrade_error .= "<br />";
|
665 |
$this->upgrade_error .= sprintf(__("Please make sure %s is writable"), $this->upgrade_folder);
|
666 |
$success = false;
|
667 |
-
} else
|
668 |
-
$
|
669 |
-
|
|
|
|
|
|
|
|
|
670 |
}
|
671 |
if ($success) {
|
672 |
fclose($fh);
|
@@ -689,7 +714,9 @@ class All_in_One_SEO_Pack {
|
|
689 |
require_once ('pclzip.lib.php');
|
690 |
}
|
691 |
$archive = new PclZip($this->upgrade_filename);
|
|
|
692 |
$files = $archive->extract(PCLZIP_OPT_STOP_ON_ERROR, PCLZIP_OPT_REPLACE_NEWER, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_PATH, $this->upgrade_folder);
|
|
|
693 |
if (is_array($files)) {
|
694 |
return true;
|
695 |
} else {
|
@@ -983,6 +1010,7 @@ class All_in_One_SEO_Pack {
|
|
983 |
update_option('aiosp_debug_info', $_POST['aiosp_debug_info']);
|
984 |
update_option('aiosp_post_meta_tags', $_POST['aiosp_post_meta_tags']);
|
985 |
update_option('aiosp_page_meta_tags', $_POST['aiosp_page_meta_tags']);
|
|
|
986 |
if (function_exists('wp_cache_flush')) {
|
987 |
wp_cache_flush();
|
988 |
}
|
@@ -1396,6 +1424,22 @@ _e('What you enter here will be copied verbatim to your header on pages. You can
|
|
1396 |
</td>
|
1397 |
</tr>
|
1398 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1399 |
</table>
|
1400 |
<p class="submit">
|
1401 |
<input type="hidden" name="action" value="aiosp_update" />
|
@@ -1428,6 +1472,7 @@ add_option("aiosp_description_format", '%description%', 'All in One SEO Plugin D
|
|
1428 |
add_option("aiosp_404_title_format", 'Nothing found for %request_words%', 'All in One SEO Plugin 404 Title Format', 'yes');
|
1429 |
add_option("aiosp_post_meta_tags", '', 'All in One SEO Plugin Additional Post Meta Tags', 'yes');
|
1430 |
add_option("aiosp_page_meta_tags", '', 'All in One SEO Plugin Additional Post Meta Tags', 'yes');
|
|
|
1431 |
|
1432 |
$aiosp = new All_in_One_SEO_Pack();
|
1433 |
add_action('wp_head', array($aiosp, 'wp_head'));
|
4 |
Plugin Name: All in One SEO Pack
|
5 |
Plugin URI: http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/
|
6 |
Description: Out-of-the-box SEO for your Wordpress blog.
|
7 |
+
Version: 1.3.8.9
|
8 |
Author: uberdose
|
9 |
Author URI: http://wp.uberdose.com/
|
10 |
*/
|
28 |
|
29 |
class All_in_One_SEO_Pack {
|
30 |
|
31 |
+
var $version = "1.3.8.9";
|
32 |
|
33 |
/** Max numbers of chars in auto-generated description */
|
34 |
var $maximum_description_length = 160;
|
59 |
/** Which zip to download in order to upgrade .*/
|
60 |
var $upgrade_url = 'http://downloads.wordpress.org/plugin/all-in-one-seo-pack.zip';
|
61 |
|
62 |
+
/** Filename of log file. */
|
63 |
+
var $log_file;
|
64 |
+
|
65 |
+
/** Flag whether there should be logging. */
|
66 |
+
var $do_log;
|
67 |
+
|
68 |
function All_in_One_SEO_Pack() {
|
69 |
+
$this->log_file = dirname(__FILE__) . '/all_in_one_seo_pack.log';
|
70 |
+
if (get_option('aiosp_do_log')) {
|
71 |
+
$this->do_log = true;
|
72 |
+
} else {
|
73 |
+
$this->do_log = false;
|
74 |
+
}
|
75 |
+
|
76 |
$this->upgrade_filename = dirname(__FILE__) . '/' . $this->upgrade_filename;
|
77 |
$this->upgrade_folder = dirname(__FILE__);
|
78 |
}
|
661 |
return $file;
|
662 |
}
|
663 |
|
664 |
+
function log($message) {
|
665 |
+
if ($this->do_log) {
|
666 |
+
error_log(date('Y-m-d H:i:s') . " " . $message . "\n", 3, $this->log_file);
|
667 |
+
}
|
668 |
+
}
|
669 |
+
|
670 |
function download_newest_version() {
|
671 |
$success = true;
|
672 |
$file_content = $this->get_url($this->upgrade_url);
|
677 |
$this->upgrade_error = sprintf(__("Could not download distribution (%s): %s"), $this->upgrade_url, $file_content);
|
678 |
$success = false;
|
679 |
} else {
|
680 |
+
$this->log(sprintf("filesize of download ZIP: %d", strlen($file_content)));
|
681 |
$fh = @fopen($this->upgrade_filename, 'w');
|
682 |
+
$this->log("fh is $fh");
|
683 |
if (!$fh) {
|
684 |
$this->upgrade_error = sprintf(__("Could not open %s for writing"), $this->upgrade_filename);
|
685 |
$this->upgrade_error .= "<br />";
|
686 |
$this->upgrade_error .= sprintf(__("Please make sure %s is writable"), $this->upgrade_folder);
|
687 |
$success = false;
|
688 |
+
} else {
|
689 |
+
$bytes_written = @fwrite($fh, $file_content);
|
690 |
+
$this->log("wrote $bytes_written bytes");
|
691 |
+
if (!$bytes_written) {
|
692 |
+
$this->upgrade_error = sprintf(__("Could not write to %s"), $this->upgrade_filename);
|
693 |
+
$success = false;
|
694 |
+
}
|
695 |
}
|
696 |
if ($success) {
|
697 |
fclose($fh);
|
714 |
require_once ('pclzip.lib.php');
|
715 |
}
|
716 |
$archive = new PclZip($this->upgrade_filename);
|
717 |
+
//$this->log("archive is $archive");
|
718 |
$files = $archive->extract(PCLZIP_OPT_STOP_ON_ERROR, PCLZIP_OPT_REPLACE_NEWER, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_PATH, $this->upgrade_folder);
|
719 |
+
$this->log("files is $files");
|
720 |
if (is_array($files)) {
|
721 |
return true;
|
722 |
} else {
|
1010 |
update_option('aiosp_debug_info', $_POST['aiosp_debug_info']);
|
1011 |
update_option('aiosp_post_meta_tags', $_POST['aiosp_post_meta_tags']);
|
1012 |
update_option('aiosp_page_meta_tags', $_POST['aiosp_page_meta_tags']);
|
1013 |
+
update_option('aiosp_do_log', $_POST['aiosp_do_log']);
|
1014 |
if (function_exists('wp_cache_flush')) {
|
1015 |
wp_cache_flush();
|
1016 |
}
|
1424 |
</td>
|
1425 |
</tr>
|
1426 |
|
1427 |
+
<tr>
|
1428 |
+
<th scope="row" style="text-align:right; vertical-align:top;">
|
1429 |
+
<a style="cursor:pointer;" title="<?php _e('Click for Help!', 'auto_social')?>" onclick="toggleVisibility('aiosp_do_log_tip');">
|
1430 |
+
<?php _e('Log important events:', 'all_in_one_seo_pack')?>
|
1431 |
+
</a>
|
1432 |
+
</td>
|
1433 |
+
<td>
|
1434 |
+
<input type="checkbox" name="aiosp_do_log" <?php if (get_option('aiosp_do_log')) echo "checked=\"1\""; ?>/>
|
1435 |
+
<div style="max-width:500px; text-align:left; display:none" id="aiosp_do_log_tip">
|
1436 |
+
<?php
|
1437 |
+
_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');
|
1438 |
+
?>
|
1439 |
+
</div>
|
1440 |
+
</td>
|
1441 |
+
</tr>
|
1442 |
+
|
1443 |
</table>
|
1444 |
<p class="submit">
|
1445 |
<input type="hidden" name="action" value="aiosp_update" />
|
1472 |
add_option("aiosp_404_title_format", 'Nothing found for %request_words%', 'All in One SEO Plugin 404 Title Format', 'yes');
|
1473 |
add_option("aiosp_post_meta_tags", '', 'All in One SEO Plugin Additional Post Meta Tags', 'yes');
|
1474 |
add_option("aiosp_page_meta_tags", '', 'All in One SEO Plugin Additional Post Meta Tags', 'yes');
|
1475 |
+
add_option("aiosp_do_log", null, 'All in One SEO Plugin write log file', 'yes');
|
1476 |
|
1477 |
$aiosp = new All_in_One_SEO_Pack();
|
1478 |
add_action('wp_head', array($aiosp, 'wp_head'));
|