Gglstmp_Settings_Tabs

The Google Sitemap by BestWebSoft Gglstmp Settings Tabs class.

Defined (1)

The class is defined in the following location(s).

/includes/class-gglstmp-settings.php  
  1. class Gglstmp_Settings_Tabs extends Bws_Settings_Tabs { 
  2. public $htaccess_options = false,  
  3. $htaccess_active = false,  
  4. $robots, $htaccess, $client, $blog_prefix,  
  5. $manage_info = ''; 
  6. /** 
  7. * Constructor. 
  8. * @access public 
  9. * @see Bws_Settings_Tabs::__construct() for more information on default arguments. 
  10. * @param string $plugin_basename 
  11. */ 
  12. public function __construct( $plugin_basename ) { 
  13. global $gglstmp_options, $gglstmp_plugin_info; 
  14.  
  15. $tabs = array( 
  16. 'settings' => array( 'label' => __( 'Settings', 'google-sitemap-plugin' ) ),  
  17. 'display' => array( 'label' => __( 'Structure', 'google-sitemap-plugin' ) ),  
  18. 'misc' => array( 'label' => __( 'Misc', 'google-sitemap-plugin' ) ),  
  19. 'license' => array( 'label' => __( 'License Key', 'google-sitemap-plugin' ) ) 
  20. ); 
  21.  
  22. parent::__construct( array( 
  23. 'plugin_basename' => $plugin_basename,  
  24. 'plugins_info' => $gglstmp_plugin_info,  
  25. 'prefix' => 'gglstmp',  
  26. 'default_options' => gglstmp_get_options_default(),  
  27. 'options' => $gglstmp_options,  
  28. 'tabs' => $tabs,  
  29. 'wp_slug' => 'google-sitemap-plugin',  
  30. 'pro_page' => 'admin.php?page=google-sitemap-pro.php',  
  31. 'bws_license_plugin' => 'google-sitemap-pro/google-sitemap-pro.php',  
  32. 'link_key' => '28d4cf0b4ab6f56e703f46f60d34d039',  
  33. 'link_pn' => '83' 
  34. ) ); 
  35.  
  36. if ( ! $this->is_multisite ) 
  37. $this->robots = get_option( 'gglstmp_robots' ); 
  38.  
  39. /** Check htaccess plugin */ 
  40. if ( $this->is_multisite && ! is_subdomain_install() ) { 
  41. $all_plugins = get_plugins(); 
  42. $this->htaccess = gglstmp_plugin_status( array( 'htaccess/htaccess.php', 'htaccess-pro/htaccess-pro.php' ), $all_plugins, false ); 
  43. $this->htaccess_options = false; 
  44. if ( $this->htaccess['status'] == 'actived' ) { 
  45. global $htccss_options; 
  46. register_htccss_settings(); 
  47. $this->htaccess_options = &$htccss_options; 
  48. $this->htaccess_active = true; 
  49. if ( function_exists( 'htccss_check_xml_access' ) ) { 
  50. $htaccess_check = htccss_check_xml_access(); 
  51. if ( $htaccess_check != $this->htaccess_options['allow_xml'] ) { 
  52. $this->htaccess_options['allow_xml'] = $htaccess_check; 
  53. update_site_option( 'htccss_options', $this->htaccess_options ); 
  54.  
  55. if ( function_exists( 'curl_init' ) ) { 
  56. $this->client = gglstmp_client(); 
  57. $this->blog_prefix = '_' . get_current_blog_id(); 
  58. if ( ! isset( $_SESSION[ 'gglstmp_authorization_code' . $this->blog_prefix ] ) && isset( $this->options['authorization_code'] ) ) { 
  59. $_SESSION[ 'gglstmp_authorization_code' . $this->blog_prefix ] = $this->options['authorization_code']; 
  60. if ( isset( $_SESSION[ 'gglstmp_authorization_code' . $this->blog_prefix ] ) ) { 
  61. $this->client->setAccessToken( $_SESSION[ 'gglstmp_authorization_code' . $this->blog_prefix ] ); 
  62.  
  63. add_filter( get_parent_class( $this ) . '_additional_restore_options', array( $this, 'additional_restore_options' ) ); 
  64. add_filter( get_parent_class( $this ) . '_display_custom_messages', array( $this, 'display_custom_messages' ) ); 
  65.  
  66. /** 
  67. * Save plugin options to the database 
  68. * @access public 
  69. * @param void 
  70. * @return array The action results 
  71. */ 
  72. public function save_options() { 
  73. global $wpdb; 
  74.  
  75. if ( isset( $_POST['gglstmp_logout'] ) ) { 
  76. unset( $_SESSION[ 'gglstmp_authorization_code' . $this->blog_prefix ], $this->options['authorization_code'] ); 
  77. update_option( 'gglstmp_options', $this->options ); 
  78. } elseif ( isset( $_POST['gglstmp_authorize'] ) && ! empty( $_POST['gglstmp_authorization_code'] ) ) { 
  79. try { 
  80. $this->client->authenticate( $_POST['gglstmp_authorization_code'] ); 
  81. $this->options['authorization_code'] = $_SESSION[ 'gglstmp_authorization_code' . $this->blog_prefix ] = $this->client->getAccessToken(); 
  82. update_option( 'gglstmp_options', $this->options ); 
  83. } catch ( Exception $e ) {} 
  84. } elseif ( isset( $_POST['gglstmp_menu_add'] ) || isset( $_POST['gglstmp_menu_delete'] ) || isset( $_POST['gglstmp_menu_info'] ) ) { 
  85. if ( $this->client->getAccessToken() ) { 
  86. $webmasters = new Google_Service_Webmasters( $this->client ); 
  87. $site_verification = new Google_Service_SiteVerification( $this->client ); 
  88. if ( isset( $_POST['gglstmp_menu_info'] ) ) { 
  89. $this->manage_info .= gglstmp_info_site( $webmasters, $site_verification ); 
  90. } elseif ( isset( $_POST['gglstmp_menu_add'] ) ) { 
  91. $this->manage_info .= gglstmp_add_site( $webmasters, $site_verification ); 
  92. } else { 
  93. $this->manage_info .= gglstmp_del_site( $webmasters, $site_verification ); 
  94. } else { 
  95.  
  96. if ( $this->htaccess_active && $this->htaccess_options && function_exists( 'htccss_generate_htaccess' ) ) { 
  97. $gglstmp_allow_xml = ( isset( $_POST[ 'gglstmp_allow_xml' ] ) && $_POST[ 'gglstmp_allow_xml' ] == 1 ) ? 1 : 0; 
  98. if ( $gglstmp_allow_xml != $this->htaccess_options['allow_xml'] ) { 
  99. $this->htaccess_options['allow_xml'] = $gglstmp_allow_xml; 
  100. update_site_option( 'htccss_options', $this->htaccess_options ); 
  101. htccss_generate_htaccess(); 
  102.  
  103. $post_types = isset( $_REQUEST['gglstmp_post_types'] ) ? $_REQUEST['gglstmp_post_types'] : array(); 
  104. $taxonomys = isset( $_REQUEST['gglstmp_taxonomies'] ) ? $_REQUEST['gglstmp_taxonomies'] : array(); 
  105. if ( $this->options['post_type'] != $post_types || $this->options['taxonomy'] != $taxonomys ) 
  106. $sitemapcreate = true; 
  107.  
  108. $this->options['post_type'] = $post_types; 
  109. $this->options['taxonomy'] = $taxonomys; 
  110.  
  111. update_option( 'gglstmp_options', $this->options ); 
  112.  
  113. if ( isset( $sitemapcreate ) ) 
  114. gglstmp_sitemapcreate(); 
  115.  
  116. /**============================ Adding location of sitemap file to the robots.txt =============*/ 
  117. if ( ! $this->is_multisite ) { 
  118. $robots_flag = isset( $_POST['gglstmp_checkbox'] ) ? 1 : 0; 
  119. $url_robot = ABSPATH . 'robots.txt'; 
  120. if ( file_exists( $url_robot ) ) { 
  121. if ( ! is_writable( $url_robot ) ) 
  122. @chmod( $url_robot, 0755 ); 
  123. if ( is_writable( $url_robot ) ) { 
  124. $file_content = file_get_contents( $url_robot ); 
  125. if ( isset( $_POST['gglstmp_checkbox'] ) && ! preg_match( '|Sitemap: ' . $gglstmp_url_home . 'sitemap.xml|', $file_content ) ) { 
  126. file_put_contents( $url_robot, $file_content . "\nSitemap: " . $gglstmp_url_home . "sitemap.xml" ); 
  127. } elseif ( preg_match( "|Sitemap: " . $gglstmp_url_home . "sitemap.xml|", $file_content ) && ! isset( $_POST['gglstmp_checkbox'] ) ) { 
  128. $file_content = preg_replace( "|\nSitemap: " . $gglstmp_url_home . "sitemap.xml|", '', $file_content ); 
  129. file_put_contents( $url_robot, $file_content ); 
  130. } else { 
  131. $error = __( 'Cannot edit "robots.txt". Check your permissions', 'google-sitemap-plugin' ); 
  132. $robots_flag = 0; 
  133.  
  134. if ( false === get_option( 'gglstmp_robots' ) ) 
  135. add_option( 'gglstmp_robots', $robots_flag ); 
  136. else 
  137. update_option( 'gglstmp_robots', $robots_flag ); 
  138. $this->robots = get_option( 'gglstmp_robots' ); 
  139.  
  140. $message = __( 'Settings saved.', 'google-sitemap-plugin' ); 
  141.  
  142. return compact( 'message', 'notice', 'error' ); 
  143.  
  144. /** 
  145. */ 
  146. public function tab_settings() { ?> 
  147. <h3 class="bws_tab_label"><?php _e( 'Google Sitemap Settings', 'google-sitemap-plugin' ); ?></h3> 
  148. <?php $this->help_phrase(); ?> 
  149. <hr>  
  150. <table class="form-table gglstmp_settings_form"> 
  151. <?php if ( ! $this->is_multisite ) { 
  152. $disabled = ''; 
  153. $checked = 1 == $this->robots ? ' checked="checked"' : ''; 
  154. /** for robots.txt we need to use site_url instead home_url ! */ 
  155. $link = '<a href="' . site_url( '/' ) . 'robots.txt" target="_blank">robots.txt</a>'; 
  156. $notice = ''; 
  157. } else { 
  158. $disabled = ' disabled="disabled"'; 
  159. $checked = ''; 
  160. $link = 'robots.txt'; 
  161. $notice = '<p style="color:red">' . sprintf( __( 'Since you are using multisiting, the plugin does not allow to add a sitemap to %s.', 'google-sitemap-plugin' ), '"robots.txt"' ) . '</p>'; 
  162. } ?> 
  163. <tr> 
  164. <th>Robots.txt</th> 
  165. <td> 
  166. <input type='checkbox'<?php echo $disabled; ?> name='gglstmp_checkbox' value="1"<?php echo $checked; ?> />  
  167. <span class="bws_info"><?php printf( __( "Enable to add a sitemap file path to the %s file.", 'google-sitemap-plugin' ), $link ); ?></span> 
  168. <?php echo $notice; ?> 
  169. </td> 
  170. </tr> 
  171. <?php if ( $this->is_multisite && ! is_subdomain_install() ) { 
  172. $attr_checked = $attr_disabled = ''; 
  173. $htaccess_plugin_notice = __( 'This option will be applied to all websites in the network.', 'google-sitemap-plugin' ); 
  174. if ( 'deactivated' == $this->htaccess['status'] ) { 
  175. $attr_disabled = 'disabled="disabled"'; 
  176. $htaccess_plugin_notice = '<a href="' . network_admin_url( '/plugins.php' ) . '">' . __( 'Activate', 'google-sitemap-plugin' ) . '</a>'; 
  177. } elseif ( 'not_installed' == $this->htaccess['status'] ) { 
  178. global $wp_version; 
  179. $attr_disabled = 'disabled="disabled"'; 
  180. $htaccess_plugin_notice = '<a href="https://bestwebsoft.com/products/wordpress/plugins/htaccess/?k=bc745b0c9d4b19ba95ae2c861418e0df&pn=106&v=' . $this->plugins_info["Version"] . '&wp_v=' . $wp_version . '">' . __( 'Install Now', 'google-sitemap-plugin' ) . '</a>'; 
  181. if ( '' != $this->change_permission_attr ) { 
  182. $attr_disabled = 'disabled="disabled"'; 
  183. if ( '1' == $this->htaccess_options['allow_xml'] && $attr_disabled == '' ) { 
  184. $attr_checked = 'checked="checked"'; 
  185. } ?> 
  186. <tr id="gglstmp_allow_xml_block"> 
  187. <th><?php printf( __( '%s Plugin', 'google-sitemap-plugin' ), 'Htaccess' ); ?></th> 
  188. <td> 
  189. <input <?php printf( "%s %s", $attr_checked, $attr_disabled ); ?> type="checkbox" name="gglstmp_allow_xml" value="1" /> <span class="bws_info"><?php printf( __( 'Enable to allow XML files access using %s plugin.', 'google-sitemap-plugin' ), 'Htaccess' ); ?> <?php echo $htaccess_plugin_notice; ?></span> 
  190. <?php echo bws_add_help_box( __( 'The following string will be added to your .htaccess file', 'google-sitemap-plugin' ) . ': <code>RewriteRule ([^/]+\.xml)$ $1 [L]</code>' ); ?> 
  191. </td> 
  192. </tr> 
  193. <?php } ?> 
  194. </table> 
  195. <?php if ( ! $this->hide_pro_tabs ) { ?> 
  196. <div class="bws_pro_version_bloc"> 
  197. <div class="bws_pro_version_table_bloc"> 
  198. <button type="submit" name="bws_hide_premium_options" class="notice-dismiss bws_hide_premium_options" title="<?php _e( 'Close', 'google-sitemap-plugin' ); ?>"></button> 
  199. <div class="bws_table_bg"></div> 
  200. <table class="form-table bws_pro_version"> 
  201. <?php gglstmp_frequency_block(); ?> 
  202. </table> 
  203. </div> 
  204. <?php $this->bws_pro_block_links(); ?> 
  205. </div> 
  206. <?php } ?> 
  207. <table class="form-table gglstmp_settings_form"> 
  208. <tr> 
  209. <th><?php _e( 'Google Webmaster Tools', 'google-sitemap-plugin' ); ?></th> 
  210. <td> 
  211. <?php if ( ! $this->client ) { ?>  
  212. <?php _e( "This hosting does not support *URL, so you cannot add a sitemap file automatically.", 'google-sitemap-plugin' ); ?> 
  213. <?php } else { ?> 
  214. <?php if ( ! isset( $_POST['gglstmp_logout'] ) && $this->client->getAccessToken() ) { ?> 
  215. <input <?php echo $this->change_permission_attr; ?> class="button-secondary bws_no_bind_notice" name="gglstmp_logout" type="submit" value="<?php _e( 'Logout from Google Webmaster Tools', 'google-sitemap-plugin' ); ?>" /> 
  216. </td> 
  217. </tr> 
  218. <tr> 
  219. <th><?php _e( 'Manage Website with Google Webmaster Tools', 'google-sitemap-plugin' ); ?></th> 
  220. <td> 
  221. <input<?php echo $this->change_permission_attr; ?> class="button-secondary bws_no_bind_notice" type='submit' name='gglstmp_menu_add' value="<?php _e( 'Add', 'google-sitemap-plugin' ); ?>" /> 
  222. <input<?php echo $this->change_permission_attr; ?> class="button-secondary bws_no_bind_notice" type='submit' name='gglstmp_menu_delete' value="<?php _e( 'Delete', 'google-sitemap-plugin' ); ?>" /> 
  223. <input<?php echo $this->change_permission_attr; ?> class="button-secondary bws_no_bind_notice" type='submit' name='gglstmp_menu_info' value="<?php _e( 'Get Info', 'google-sitemap-plugin' ); ?>" /> 
  224. <div class="bws_info"> 
  225. <?php _e( "Add, delete or get info about this website using your Google Webmaster Tools account.", 'google-sitemap-plugin' ); ?> 
  226. </div> 
  227. <?php echo $this->manage_info; 
  228. } else { 
  229. $gglstmp_state = mt_rand(); 
  230. $this->client->setState( $gglstmp_state ); 
  231. $_SESSION[ 'gglstmp_state' . $this->blog_prefix ] = $this->client; 
  232. $gglstmp_auth_url = $this->client->createAuthUrl(); ?> 
  233. <a <?php echo $this->change_permission_attr; ?> id="gglstmp_authorization_button" class="button-secondary button" href="<?php echo $gglstmp_auth_url; ?>" target="_blank" onclick="window.open(this.href, '', 'top='+(screen.height/2-560/2)+', left='+(screen.width/2-640/2)+', width=640, height=560, resizable=0, scrollbars=0, menubar=0, toolbar=0, status=1, location=0').focus(); return false;"><?php _e( 'Get Authorization Code', 'google-sitemap-plugin' ); ?></a> 
  234. <div id="gglstmp_authorization_form"> 
  235. <input <?php echo $this->change_permission_attr; ?> id="gglstmp_authorization_code" class="bws_no_bind_notice" name="gglstmp_authorization_code" type="text" maxlength="100" autocomplete="off" /> 
  236. <input <?php echo $this->change_permission_attr; ?> id="gglstmp_authorize" class="button-secondary button bws_no_bind_notice" name="gglstmp_authorize" type="submit" value="<?php _e( 'Authorize', 'google-sitemap-plugin' ); ?>" /> 
  237. </div> 
  238. <?php if ( isset( $_POST['gglstmp_authorization_code'] ) && isset( $_POST['gglstmp_authorize'] ) && check_admin_referer( plugin_basename( __FILE__ ), 'gglstmp_nonce_name' ) ) { ?> 
  239. <div id="gglstmp_authorize_error"><?php _e( 'Invalid authorization code. Please try again.', 'google-sitemap-plugin' ); ?></div> 
  240. <?php } 
  241. } ?> 
  242. <div class="bws_info"> 
  243. <?php _e( 'You can also add your sitemap to Google Webmaster Tools manually.', 'google-sitemap-plugin' ); ?> <a target="_blank" href="https://docs.google.com/document/d/1VOJx_OaasVskCqi9fsAbUmxfsckoagPU5Py97yjha9w/"><?php _e( 'Read the instruction', 'google-sitemap-plugin' ); ?></a> 
  244. </div> 
  245. </td> 
  246. </tr> 
  247. </table> 
  248. <?php } 
  249.  
  250. /** 
  251. */ 
  252. public function tab_display() {  
  253. $post_types = get_post_types( '', 'names' ); 
  254. unset( $post_types['revision'], $post_types['attachment'], $post_types['nav_menu_item'] ); 
  255.  
  256. $taxonomies = array( 
  257. 'category' => __( 'Post category', 'google-sitemap-plugin' ),  
  258. 'post_tag' => __( 'Post tag', 'google-sitemap-plugin' ) 
  259. ); ?> 
  260. <h3 class="bws_tab_label"><?php _e( 'Sitemap Structure', 'google-sitemap-plugin' ); ?></h3> 
  261. <?php $this->help_phrase(); ?> 
  262. <hr> 
  263. <table class="form-table gglstmp_settings_form"> 
  264. <tr> 
  265. <th><?php _e( 'Post Types', 'google-sitemap-plugin' ); ?></th> 
  266. <td> 
  267. <fieldset> 
  268. <?php foreach ( $post_types as $value ) { ?> 
  269. <label><input type="checkbox" <?php if ( in_array( $value, $this->options['post_type'] ) ) echo 'checked="checked"'; ?> name="gglstmp_post_types[]" value="<?php echo $value; ?>"/><span style="text-transform: capitalize; padding-left: 5px;"><?php echo $value; ?></span></label><br /> 
  270. <?php } ?> 
  271. </fieldset> 
  272. <span class="bws_info"><?php _e( 'Enable to add post type links to the sitemap.', 'google-sitemap-plugin' ); ?></span> 
  273. </td> 
  274. </tr> 
  275. <tr> 
  276. <th><?php _e( 'Taxonomies', 'google-sitemap-plugin' ); ?></th> 
  277. <td> 
  278. <fieldset> 
  279. <?php foreach ( $taxonomies as $key => $value ) { ?> 
  280. <label><input type="checkbox" <?php if ( in_array( $key, $this->options['taxonomy'] ) ) echo 'checked="checked"'; ?> name="gglstmp_taxonomies[]" value="<?php echo $key; ?>"/><span style="padding-left: 5px;"><?php echo $value; ?></span></label><br /> 
  281. <?php } ?> 
  282. </fieldset> 
  283. <span class="bws_info"><?php _e( 'Enable to taxonomy links to the sitemap.', 'google-sitemap-plugin' ); ?></span> 
  284. </td> 
  285. </tr> 
  286. </table> 
  287. <?php if ( ! $this->hide_pro_tabs ) { ?> 
  288. <div class="bws_pro_version_bloc"> 
  289. <div class="bws_pro_version_table_bloc"> 
  290. <button type="submit" name="bws_hide_premium_options" class="notice-dismiss bws_hide_premium_options" title="<?php _e( 'Close', 'google-sitemap-plugin' ); ?>"></button> 
  291. <div class="bws_table_bg"></div> 
  292. <?php gglstmp_extra_block(); ?> 
  293. </div> 
  294. <?php $this->bws_pro_block_links(); ?> 
  295. </div> 
  296. <?php } 
  297.  
  298. /** 
  299. * Custom functions for "Restore plugin options to defaults" 
  300. * @access public 
  301. */ 
  302. public function additional_restore_options( $default_options ) { 
  303. $url_robot = ABSPATH . 'robots.txt'; 
  304. /** remove sitemap.xml */ 
  305. if ( $this->is_multisite ) { 
  306. $home_url = preg_replace( "/[^a-zA-Z*-**-*0-9\s]/", "_", str_replace( 'http://', '', str_replace( 'https://', '', site_url() ) ) ); 
  307. @unlink( ABSPATH . "sitemap_" . $home_url . ".xml" ); 
  308. } else { 
  309. @unlink( ABSPATH . "sitemap.xml" ); 
  310.  
  311. /** clear robots.txt */ 
  312. if ( file_exists( $url_robot ) ) { 
  313. if ( ! is_writable( $url_robot ) ) 
  314. @chmod( $url_robot, 0755 ); 
  315. if ( is_writable( $url_robot ) ) { 
  316. $file_content = file_get_contents( $url_robot ); 
  317. if ( preg_match( "|Sitemap: " . $gglstmp_url_home . "sitemap.xml|", $file_content ) ) { 
  318. $file_content = preg_replace( "|\nSitemap: " . $gglstmp_url_home . "sitemap.xml|", '', $file_content ); 
  319. file_put_contents( $url_robot, $file_content ); 
  320. } else { 
  321. $error = __( 'Cannot edit "robot.txt". Check your permissions', 'google-sitemap-plugin' ); 
  322. if ( false === get_option( 'gglstmp_robots' ) ) 
  323. add_option( 'gglstmp_robots', 0 ); 
  324. else 
  325. update_option( 'gglstmp_robots', 0 ); 
  326.  
  327. return $default_options; 
  328.  
  329.  
  330. public function display_custom_messages( $save_results ) { 
  331. /**=============================== Creating sitemap file ====================================*/ 
  332. if ( $this->is_multisite ) { 
  333. $xml_file = 'sitemap_' . preg_replace( "/[^a-zA-Z*-**-*0-9\s]/", "_", str_replace( 'http://', '', str_replace( 'https://', '', site_url() ) ) ) . '.xml'; 
  334. $xml_url = site_url( '/' ) . $xml_file; 
  335. $site_id = get_current_blog_id(); 
  336. $xml_is_deleted_from_network = isset( $gglstmp_network_options['removed_sitemaps'] ) ? in_array( $site_id, $gglstmp_network_options['removed_sitemaps'] ) : false; 
  337. } else { 
  338. $xml_file = 'sitemap.xml'; 
  339. $xml_url = site_url( '/' ) . $xml_file; 
  340. $xml_is_deleted_from_network = false; 
  341.  
  342. if ( file_exists( ABSPATH . $xml_file ) ) { 
  343. $xml_is_created = true; 
  344. } else { 
  345. if ( $xml_is_deleted_from_network ) { 
  346. $xml_is_created = false; 
  347. } else { 
  348. gglstmp_sitemapcreate(); 
  349. $xml_is_created = true; 
  350.  
  351. echo 
  352. $xml_is_created 
  353. '<div class="updated bws-notice inline"><p><strong>' . sprintf( __( "%s is in the site root directory.", 'google-sitemap-plugin' ), '<a href="' . $xml_url . '" target="_blank">' . __( 'The Sitemap file', 'google-sitemap-plugin' ) . '</a>' ) . '</strong></p></div>' 
  354. '<div class="error inline"><p><strong>' . __( 'The Sitemap file for this site has been deleted by network admin.', 'google-sitemap-plugin' ) . '</strong></p></div>'; 
  355.  
  356. if ( $this->is_multisite && ! is_subdomain_install() && count( glob( ABSPATH . "sitemap*.xml" ) ) > 0 && ( ! $this->htaccess_active || $this->htaccess_options['allow_xml'] == 0 ) ) { 
  357. if ( $this->options['sitemap'] && file_exists( $this->options['sitemap']['path'] ) ) { 
  358. $status = gglstmp_check_sitemap( $this->options['sitemap']['loc'] );  
  359. if ( '200' != $status['code'] ) { ?> 
  360. <div class="error below-h2"> 
  361. <p> 
  362. <strong><?php _e( 'Error', 'google-sitemap-plugin' ); ?>:</strong> <?php  
  363. printf( __( "Can't access XML files on subsites. Add the following rule %s to your %s file in %s after %s or install, activate and enable %s plugin option to resolve this error.", 'google-sitemap-plugin' ),  
  364. '<code>RewriteRule ([^/]+\.xml)$ $1 [L]</code>',  
  365. '<strong>.htaccess</strong>',  
  366. sprintf( '<strong>"%s"</strong>', ABSPATH ),  
  367. '<strong>"RewriteBase"</strong>',  
  368. 'Htaccess' 
  369. ); ?> 
  370. </p> 
  371. </div> 
  372. <?php } 
  373. }