/includes/class-gglstmp-settings.php

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