Skip to content

Commit

Permalink
Version 1.0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
tribalNerd committed Apr 23, 2017
1 parent 77adfe5 commit d80458c
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 89 deletions.
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Zip Ignore

.gitattributes export-ignore
.gitignore export-ignore
LICENSE export-ignore
Expand Down
43 changes: 1 addition & 42 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,44 +1,3 @@
*~
*.com
*.class
*.db
*.dll
*.exe
*.ini
*.lock
*.log
*.mm
*.o
*.phar
*.so
*.sql
*.sqlite

.cvs
.DS_Store
.DS_Store*
.git
.htaccess
.project
.sass-cache
.settings
.svn
.sync
.Trash
.Trash-*
.travis.yml

psds
psds/
nbproject
nbproject/

copy.sh
access_log
error_log
license.txt
phpunit.xml
readme.html

.sublime-project
.sublime-workspace
psds
13 changes: 5 additions & 8 deletions classes/class-cleaner.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,12 @@ final private function addRewrite()
switch_to_blog( $site->blog_id );

// Get Rewrite Rules
$rules = get_option( 'rewrite_rules' );

// Add Missing Rule
if( ! in_array( "index.php?robots=1", (array) $rules ) ) {
// Set Proper Keys
$rule_key = "robots\.txt$";
$rules[ $rule_key ] = 'index.php?robots=1';
$rewrite_rules = get_option( 'rewrite_rules' );

// Update Rules
// Force Update of Missing Rule
if( ! in_array( "index.php?robots=1", (array) $rewrite_rules ) ) {
$rules = array_merge( $rewrite_rules, array( 'robots\.txt$' => 'index.php?robots=1' ) );
delete_option( 'rewrite_rules' );
update_option( 'rewrite_rules', $rules );

// Flush Rules
Expand Down
4 changes: 2 additions & 2 deletions classes/class-extended.php
Original file line number Diff line number Diff line change
Expand Up @@ -376,13 +376,13 @@ final public function getSitemapUrl( $blogid = false )
final public function getSettings()
{
// Version 4.0.0
if ( defined( 'MSRTM_TEMPLATES' ) && is_plugin_active( MSRTM_PRO ) && file_exists( MSRTM_TEMPLATES . '/settings.php' ) ) {
if ( defined( 'MSRTM_TEMPLATES' ) && is_plugin_active( 'msrtm-pro/msrtm-pro.php' ) && file_exists( MSRTM_TEMPLATES . '/settings.php' ) ) {
$plugincheck = ( ! get_option( 'msrtm_api_form' ) && get_option( 'msrtm_key' ) ) ? true : false;
include_once( MSRTM_TEMPLATES . '/settings.php' );
}

// Plugin Extension: Version 3.0.0
if ( ! defined( 'MSRTM_TEMPLATES' ) && defined( 'MSRTM_PRO' ) && is_plugin_active( MSRTM_PRO ) ) {
if ( ! defined( 'MSRTM_TEMPLATES' ) && defined( 'MSRTM_PRO' ) && is_plugin_active( 'msrtm-pro/msrtm-pro.php' ) ) {
return $this->msrtm->extendSettings();
}
}
Expand Down
15 changes: 11 additions & 4 deletions classes/class-network.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,19 +172,26 @@ final private function updateWebsite()

// Enable For Website
update_option( $this->option_name . 'status', true, 'yes' );


// Get Domain URL Base
$sitemap_url_base = get_option( 'site_url' ) ? get_option( 'site_url' ) : MS_ROBOTSTXT_MANAGER_BASE_URL;

// MSRM PRO: Parse Sitemap Marker
// @version 4.0.1
$network_robotstxt = apply_filters( 'msrtm_parse_sitemap_marker', $this->network_robotstxt, site_url() );

// Append Website Rules to Network Robots.txt File
if ( isset( $append_rules ) ) {
if ( isset( $robotstxt_append_rules ) ) {
// Return Replaced String
$new_robotstxt = str_replace( '{APPEND_WEBSITE_ROBOTSTXT}', $append_rules, $this->network_robotstxt );
$new_robotstxt = str_replace( '{APPEND_WEBSITE_ROBOTSTXT}', $append_rules, $network_robotstxt );

// Update Website Robots.txt File
update_option( $this->option_name . 'robotstxt', array( 'robotstxt' => $new_robotstxt ), 'yes' );

// No Append Rules, Network Robots.txt File Only
} else {
// Return Replaced String
$new_robotstxt = str_replace( '{APPEND_WEBSITE_ROBOTSTXT}', '', $this->network_robotstxt );
$new_robotstxt = str_replace( '{APPEND_WEBSITE_ROBOTSTXT}', '', $network_robotstxt );

// Update Website Robots.txt File
update_option( $this->option_name . 'robotstxt', array( 'robotstxt' => $new_robotstxt ), 'yes' );
Expand Down
2 changes: 0 additions & 2 deletions classes/class-presets.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,6 @@ final private function googleRobotstxt()
$txt .= "Disallow: /wp-content/cache/\n";
$txt .= "Disallow: /wp-content/themes/\n";
$txt .= "Disallow: /wp-content/plugins/\n";
$txt .= "Allow: /wp-content/uploads\n";
$txt .= "Allow: /wp-content/uploads/\n";
$txt .= "Allow: /wp-admin/admin-ajax.php\n";
$txt .= "{APPEND_WEBSITE_ROBOTSTXT}";
$txt .= "\n";
Expand Down
2 changes: 1 addition & 1 deletion classes/class-website.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ final private function saveRules( $append_rules )
if ( get_option( $this->option_name . 'default' ) ) {
$robotstxt = $append_rules;

// Get Network Robots.txt File And Append Rules
} else {
// Get Network Robots.txt File And Append Rules
$robotstxt = ( parent::getNetworkRobotstxt() ) ? str_replace( '{APPEND_WEBSITE_ROBOTSTXT}', $append_rules, parent::getNetworkRobotstxt() ) : $append_rules;
}

Expand Down
34 changes: 17 additions & 17 deletions multisite-robotstxt-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin URI: https://github.com/tribalNerd/multisite-robotstxt-manager
* Description: A Multisite Network Robots.txt Manager. Quickly manage your Network Websites robots.txt files from a single administration area.
* Tags: robotstxt, robots.txt, robots, robot, spiders, virtual, search, google, seo, plugin, network, wpmu, multisite, technerdia, tribalnerd
* Version: 1.0.9
* Version: 1.0.10
* License: GNU GPLv3
* Copyright (c) 2017 Chris Winters
* Author: tribalNerd, Chris Winters
Expand All @@ -22,22 +22,22 @@
{
MsRobotstxtManagerConstants( Array(
'MS_ROBOTSTXT_MANAGER' => true,
'MS_ROBOTSTXT_MANAGER_BASE_URL' => get_bloginfo( 'url' ),
'MS_ROBOTSTXT_MANAGER_VERSION' => '1.0.9',
'MS_ROBOTSTXT_MANAGER_WP_MIN_VERSION' => '3.8',

'MS_ROBOTSTXT_MANAGER_PLUGIN_FILE' => __FILE__,
'MS_ROBOTSTXT_MANAGER_PLUGIN_DIR' => dirname( __FILE__ ),
'MS_ROBOTSTXT_MANAGER_PLUGIN_BASE' => plugin_basename( __FILE__ ),

'MS_ROBOTSTXT_MANAGER_MENU_NAME' => __( 'MS Robots.txt', 'multisite-robotstxt-manager' ),
'MS_ROBOTSTXT_MANAGER_PAGE_NAME' => __( 'Multisite Robots.txt Manager for WordPress', 'multisite-robotstxt-manager' ),
'MS_ROBOTSTXT_MANAGER_PAGE_ABOUT' => __( 'A Multisite Robots.txt Manager Plugin For WordPress.', 'multisite-robotstxt-manager' ),
'MS_ROBOTSTXT_MANAGER_OPTION_NAME' => 'ms_robotstxt_manager_',
'MS_ROBOTSTXT_MANAGER_PLUGIN_NAME' => 'multisite-robotstxt-manager',

'MS_ROBOTSTXT_MANAGER_CLASSES' => dirname( __FILE__ ) .'/classes',
'MS_ROBOTSTXT_MANAGER_TEMPLATES' => dirname( __FILE__ ) .'/templates'
'MS_ROBOTSTXT_MANAGER_BASE_URL' => get_bloginfo( 'url' ),
'MS_ROBOTSTXT_MANAGER_VERSION' => '1.0.10',
'MS_ROBOTSTXT_MANAGER_WP_MIN_VERSION' => '3.8',

'MS_ROBOTSTXT_MANAGER_PLUGIN_FILE' => __FILE__,
'MS_ROBOTSTXT_MANAGER_PLUGIN_DIR' => dirname( __FILE__ ),
'MS_ROBOTSTXT_MANAGER_PLUGIN_BASE' => plugin_basename( __FILE__ ),

'MS_ROBOTSTXT_MANAGER_MENU_NAME' => __( 'MS Robots.txt', 'multisite-robotstxt-manager' ),
'MS_ROBOTSTXT_MANAGER_PAGE_NAME' => __( 'Multisite Robots.txt Manager for WordPress', 'multisite-robotstxt-manager' ),
'MS_ROBOTSTXT_MANAGER_PAGE_ABOUT' => __( 'A Multisite Robots.txt Manager Plugin For WordPress.', 'multisite-robotstxt-manager' ),
'MS_ROBOTSTXT_MANAGER_OPTION_NAME' => 'ms_robotstxt_manager_',
'MS_ROBOTSTXT_MANAGER_PLUGIN_NAME' => 'multisite-robotstxt-manager',

'MS_ROBOTSTXT_MANAGER_CLASSES' => dirname( __FILE__ ) .'/classes',
'MS_ROBOTSTXT_MANAGER_TEMPLATES' => dirname( __FILE__ ) .'/templates'
) );
}

Expand Down
14 changes: 10 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Plugin Name: Multisite Robots.txt Manager | MS Robots.txt
Contributors: tribalNerd, Chris Winters
Tags: robotstxt, robots.txt, robots, robot, spiders, virtual, search, google, seo, plugin, network, mu, multisite, technerdia, tribalnerd
Requires at least: 3.8
Tested up to: 4.7.3
Stable tag: 1.0.9
Tested up to: 4.7.4
Stable tag: 1.0.10
License: GNU GPLv3
License URI: https://github.com/tribalNerd/ptt-manager/blob/master/LICENSE

Expand Down Expand Up @@ -263,15 +263,21 @@ For "real" Multisite HOST Networks, use the WordPress plugin: BWP Google XML Sit

== Changelog ==

= 1.0.10 =
* Tested: Wordpress Version 4.7.4
* Changed: Review/Rating URL within templates/sidebar.php
* Fixed: Cleaner option name checks, using previous version names.
* Fixed: Cleaner rewrite_rule to delete/update the option when missing the robots.txt array.

= 1.0.9 =
* Fixed: Bad method call in class-cleaner.php.
* Fixed: Multiple incorrect update_option formats.
* Fixed: Network Robots.txt now saves when published per GitHub Issue #5.
* Fixed: Network Robots.txt now saves when published | https://github.com/tribalNerd/multisite-robotstxt-manager/issues/5
* Fixed: Removed append marker, if no append rules found.
* Fixed: Wrapped is_writable() check to physical robots.txt removal.
* Change: Option names for cleaner, appended cleaner_.
* Change: Modified update success/fail messages.
* Change: Deleted uninstall.php per GitHub issue #6.
* Change: Deleted uninstall.php | https://github.com/tribalNerd/multisite-robotstxt-manager/issues/6

= 1.0.8 =
* New plugin structure/files, using the same option names.
Expand Down
12 changes: 6 additions & 6 deletions templates/cleaner.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
if ( ! defined( 'ABSPATH' ) ) { exit; }
if ( count( get_included_files() ) == 1 ){ exit(); }?>

<?php if ( ! get_option( $this->option_name . 'old_data' ) ) {?>
<?php if ( ! get_option( $this->option_name . 'cleaner_old_data' ) ) {?>
<h3><?php _e( 'Check For Old Robots.txt File Settings', 'multisite-robotstxt-manager' );?></h3>
<p><?php _e( 'If you are having problems with a websites robots.txt file to displaying properly, it is possible that old robots.txt file data left over from other plugins is conflicting. Click the "scan for old data" button below to scan the network for left over data. If any is found, a notice will display with a new button to automatically clean out the left over data.', 'multisite-robotstxt-manager' );?></p>

Expand All @@ -16,7 +16,7 @@
</form>
<?php }

if ( get_option( $this->option_name . 'old_data' ) ) {?>
if ( get_option( $this->option_name . 'cleaner_old_data' ) ) {?>
<h3><?php _e( 'Old Robots.txt File Settings Found', 'multisite-robotstxt-manager' );?></h3>
<p><?php _e( 'Click the "remove old data" button below to purge the old settings.', 'multisite-robotstxt-manager' );?></p>

Expand All @@ -32,7 +32,7 @@

<br /><hr /><br />

<?php if ( ! get_option( $this->option_name . 'physical' ) ) {?>
<?php if ( ! get_option( $this->option_name . 'cleaner_physical' ) ) {?>
<h3><?php _e( 'Check For Real (physical) Robots.txt File', 'multisite-robotstxt-manager' );?></h3>
<p><?php _e( 'If network/website changes do not appear to override the robots.txt file or if the file is blank, it is possible that a plugin created a physical (hard) robots.txt file. Click the "scan for physical file" button below to check the website for a real robots.txt file. If one is found, a notice will display with a new button allowing you to delete the file.', 'multisite-robotstxt-manager' );?></p>

Expand All @@ -46,7 +46,7 @@
</form>
<?php }

if ( get_option( $this->option_name . 'physical' ) ) {?>
if ( get_option( $this->option_name . 'cleaner_physical' ) ) {?>
<h3><?php _e( 'A Real Robots.txt File Was Found', 'multisite-robotstxt-manager' );?></h3>
<p><?php _e( 'Click the "delete physical file" button below to delete the real robots.txt file.', 'multisite-robotstxt-manager' );?></p>

Expand All @@ -62,7 +62,7 @@

<br /><hr /><br />

<?php if ( ! get_option( $this->option_name . 'rewrite' ) ) {?>
<?php if ( ! get_option( $this->option_name . 'cleaner_rewrite' ) ) {?>
<h3><?php _e( 'Check That All Websites Have The Proper Rewrite Rule', 'multisite-robotstxt-manager' );?></h3>
<p><?php _e( 'If your robots.txt files are blank, it is possible the website is missing the rewrite rule index.php?robots=1. Click the "scan for missing rules" button below to scan the network for the missing rule. If a website is missing the rule, a notice will display with a new button to automatically add the rule for you.', 'multisite-robotstxt-manager' );?></p>

Expand All @@ -76,7 +76,7 @@
</form>
<?php }

if ( get_option( $this->option_name . 'rewrite' ) ) {?>
if ( get_option( $this->option_name . 'cleaner_rewrite' ) ) {?>
<h3><?php _e( 'At Least One Website Is Missing The Rewrite Rule', 'multisite-robotstxt-manager' );?></h3>
<p><?php _e( 'Click the "add missing rule" button below to add the missing rule.', 'multisite-robotstxt-manager' );?></p>

Expand Down
2 changes: 1 addition & 1 deletion templates/network.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<td class="textleft">
<p><input type="radio" name="update" value="network" id="network" /> <label for="network"><?php _e( 'Publish the network robots.txt file to all network websites.', 'multisite-robotstxt-manager' );?></label></p>
<p><input type="radio" name="update" value="member" id="user" /> <label for="user"><?php _e( 'Publish the network robots.txt file to network websites you are a member of.', 'multisite-robotstxt-manager' );?></label></p>
<p><input type="radio" name="update" value="save" id="save" /> <label for="save"><?php _e( 'Save the network robots.txt file / does not publish changes.', 'multisite-robotstxt-manager' );?></label></p>
<p><input type="radio" name="update" value="save" id="save" checked="checked" /> <label for="save"><?php _e( 'Save the network robots.txt file / does not publish changes.', 'multisite-robotstxt-manager' );?></label></p>
</td>
<td class="td30"></td>
</tr>
Expand Down

0 comments on commit d80458c

Please sign in to comment.