diff -r 2f6f6f7551ca -r 32102edaa81b web/wp-content/plugins/google-sitemap-generator/sitemap.php --- a/web/wp-content/plugins/google-sitemap-generator/sitemap.php Thu Sep 16 15:45:36 2010 +0000 +++ b/web/wp-content/plugins/google-sitemap-generator/sitemap.php Mon Nov 19 18:26:13 2012 +0100 @@ -1,7 +1,7 @@ Configuration Page - Version: 3.2 + Description: This plugin will generate a special XML sitemap which will help search engines like Google, Yahoo, Bing and Ask.com to better index your blog. + Version: 3.2.8 Author: Arne Brachhold Author URI: http://www.arnebrachhold.de/ + Text Domain: sitemap + Domain Path: /lang/ + */ /** @@ -44,6 +47,15 @@ * If the sm_command and sm_key GET params are given, the function will init the generator to rebuild the sitemap. */ function Enable() { + + //Check for 3.0 multisite, NOT supported yet! + if((defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE) || (function_exists('is_multisite') && is_multisite())) { + if(function_exists('is_super_admin') && is_super_admin()) { + add_action('admin_notices', array('GoogleSitemapGeneratorLoader', 'AddMultisiteWarning')); + } + + return; + } //Register the sitemap creator to wordpress... add_action('admin_menu', array('GoogleSitemapGeneratorLoader', 'RegisterAdminPage')); @@ -85,6 +97,13 @@ GoogleSitemapGeneratorLoader::CallShowPingResult(); } } + + /** + * Outputs the warning bar if multisite mode is activated + */ + function AddMultisiteWarning() { + echo "

".__('This version of Google XML Sitemaps is not multisite compatible.','sitemap')."
".sprintf(__('Unfortunately this version of the Google XML Sitemaps plugin was not tested with the multisite feature of WordPress 3.0 yet.
The plugin will not be active until you disable the multisite mode.
Or you can try the new beta which supports all the new WordPress features!','sitemap'), "http://www.arnebrachhold.de/redir/sitemap-info-beta/")."

"; + } /** * Registers the plugin in the admin menu system @@ -92,7 +111,7 @@ function RegisterAdminPage() { if (function_exists('add_options_page')) { - add_options_page(__('XML-Sitemap Generator','sitemap'), __('XML-Sitemap','sitemap'), 10, GoogleSitemapGeneratorLoader::GetBaseName(), array('GoogleSitemapGeneratorLoader','CallHtmlShowOptionsPage')); + add_options_page(__('XML-Sitemap Generator','sitemap'), __('XML-Sitemap','sitemap'), 'level_10', GoogleSitemapGeneratorLoader::GetBaseName(), array('GoogleSitemapGeneratorLoader','CallHtmlShowOptionsPage')); } } @@ -106,10 +125,10 @@ function RegisterPluginLinks($links, $file) { $base = GoogleSitemapGeneratorLoader::GetBaseName(); if ($file == $base) { - $links[] = '' . __('Settings') . ''; - $links[] = '' . __('FAQ') . ''; - $links[] = '' . __('Support') . ''; - $links[] = '' . __('Donate') . ''; + $links[] = '' . __('Settings','sitemap') . ''; + $links[] = '' . __('FAQ','sitemap') . ''; + $links[] = '' . __('Support','sitemap') . ''; + $links[] = '' . __('Donate','sitemap') . ''; } return $links; } @@ -119,7 +138,7 @@ */ function CallHtmlShowOptionsPage() { if(GoogleSitemapGeneratorLoader::LoadPlugin()) { - $gs = GoogleSitemapGenerator::GetInstance(); + $gs = &GoogleSitemapGenerator::GetInstance(); $gs->HtmlShowOptionsPage(); } } @@ -129,7 +148,7 @@ */ function CallCheckForAutoBuild($args) { if(GoogleSitemapGeneratorLoader::LoadPlugin()) { - $gs = GoogleSitemapGenerator::GetInstance(); + $gs = &GoogleSitemapGenerator::GetInstance(); $gs->CheckForAutoBuild($args); } } @@ -139,7 +158,7 @@ */ function CallBuildNowRequest() { if(GoogleSitemapGeneratorLoader::LoadPlugin()) { - $gs = GoogleSitemapGenerator::GetInstance(); + $gs = &GoogleSitemapGenerator::GetInstance(); $gs->BuildNowRequest(); } } @@ -149,7 +168,7 @@ */ function CallBuildSitemap() { if(GoogleSitemapGeneratorLoader::LoadPlugin()) { - $gs = GoogleSitemapGenerator::GetInstance(); + $gs = &GoogleSitemapGenerator::GetInstance(); $gs->BuildSitemap(); } } @@ -159,7 +178,7 @@ */ function CallCheckForManualBuild() { if(GoogleSitemapGeneratorLoader::LoadPlugin()) { - $gs = GoogleSitemapGenerator::GetInstance(); + $gs = &GoogleSitemapGenerator::GetInstance(); $gs->CheckForManualBuild(); } } @@ -169,24 +188,27 @@ */ function CallShowPingResult() { if(GoogleSitemapGeneratorLoader::LoadPlugin()) { - $gs = GoogleSitemapGenerator::GetInstance(); + $gs = &GoogleSitemapGenerator::GetInstance(); $gs->ShowPingResult(); } } function CallHtmlShowHelpList($filterVal,$screen) { - if($screen == "settings_page_sitemap") { + + $id = get_plugin_page_hookname(GoogleSitemapGeneratorLoader::GetBaseName(),'options-general.php'); + + if($screen == $id) { $links = array( __('Plugin Homepage','sitemap')=>'http://www.arnebrachhold.de/redir/sitemap-help-home/', - __('Sitemap FAQ')=>'http://www.arnebrachhold.de/redir/sitemap-help-faq/' + __('My Sitemaps FAQ','sitemap')=>'http://www.arnebrachhold.de/redir/sitemap-help-faq/' ); - $filterVal["settings_page_sitemap"] = ''; + $filterVal[$id] = ''; $i=0; foreach($links AS $text=>$url) { - $filterVal["settings_page_sitemap"].='' . $text . '' . ($i < (count($links)-1)?'
':'') ; + $filterVal[$id].='' . $text . '' . ($i < (count($links)-1)?'
':'') ; $i++; } } @@ -195,7 +217,7 @@ function CallDoRobots() { if(GoogleSitemapGeneratorLoader::LoadPlugin()) { - $gs = GoogleSitemapGenerator::GetInstance(); + $gs = &GoogleSitemapGenerator::GetInstance(); $gs->DoRobots(); } } @@ -208,8 +230,8 @@ function LoadPlugin() { $mem = abs(intval(@ini_get('memory_limit'))); - if($mem && $mem < 32) { - @ini_set('memory_limit', '32M'); + if($mem && $mem < 64) { + @ini_set('memory_limit', '64M'); } $time = abs(intval(@ini_get("max_execution_time"))); @@ -255,16 +277,17 @@ * @return string The version like 3.1.1 */ function GetVersion() { - if(!function_exists('get_plugin_data')) { - if(file_exists(ABSPATH . 'wp-admin/includes/plugin.php')) require_once(ABSPATH . 'wp-admin/includes/plugin.php'); //2.3+ - else if(file_exists(ABSPATH . 'wp-admin/admin-functions.php')) require_once(ABSPATH . 'wp-admin/admin-functions.php'); //2.1 - else return "0.ERROR"; + if(!isset($GLOBALS["sm_version"])) { + if(!function_exists('get_plugin_data')) { + if(file_exists(ABSPATH . 'wp-admin/includes/plugin.php')) require_once(ABSPATH . 'wp-admin/includes/plugin.php'); //2.3+ + else if(file_exists(ABSPATH . 'wp-admin/admin-functions.php')) require_once(ABSPATH . 'wp-admin/admin-functions.php'); //2.1 + else return "0.ERROR"; + } + $data = get_plugin_data(__FILE__, false, false); + $GLOBALS["sm_version"] = $data['Version']; } - $data = get_plugin_data(__FILE__); - return $data['Version']; + return $GLOBALS["sm_version"]; } - - } //Enable the plugin for the init hook, but only if WP is loaded. Calling this php file directly will do nothing.