Plugin Directory

Changeset 1189487


Ignore:
Timestamp:
06/29/2015 11:27:44 AM (11 years ago)
Author:
samface
Message:

Release 0.8

Location:
angry-creative-logger
Files:
2 added
2 deleted
20 edited
1 copied

Legend:

Unmodified
Added
Removed
  • angry-creative-logger/tags/0.8/classes/inspector.php

    r1171849 r1189487  
    22/*
    33Class name: AC Inspector
    4 Version: 0.6
     4Version: 0.7
    55Author: Sammy Nordström, Angry Creative AB
    66*/
     
    323323                }
    324324
     325                if ( $args['success'] ) {
     326                    $log_level = "success";
     327                }
     328
     329                if ( $args['error'] ) {
     330                    $log_level = "error";
     331                }
     332
    325333                $output = '['.date("d M, Y H:i:s").'] ['.__CLASS__.'] [ ' .strtoupper($log_level). ' ] - ';
    326334
  • angry-creative-logger/tags/0.8/classes/routine_handler.php

    r1171849 r1189487  
    22/*
    33Class name: ACI Routine Handler
    4 Version: 0.3.2
    5 Depends: AC Inspector 0.5.x
     4Version: 0.4
     5Depends: AC Inspector 0.5.x or newer
    66Author: Sammy Nordström, Angry Creative AB
    77*/
     
    195195                self::$force_enabled = array_merge( self::$force_enabled, array( $routine ) );
    196196            }
     197
     198        }
     199
     200        public static function release_tier_aware() {
     201
     202            if ( defined( 'SITE_RELEASE_TIER' ) ) {
     203                return true;
     204            }
     205
     206            return false;
     207
     208        }
     209
     210        public static function get_release_tier() {
     211
     212            if ( defined( 'SITE_RELEASE_TIER' ) && in_array( SITE_RELEASE_TIER, array( 'local', 'development', 'integration', 'test', 'stage', 'production' ) ) ) {
     213                return SITE_RELEASE_TIER;
     214            }
     215
     216            return false;
     217
     218        }
     219
     220        public static function is_release_tier( $tier ) {
     221
     222            if ( defined( 'SITE_RELEASE_TIER' ) && !empty( $tier ) && $tier == SITE_RELEASE_TIER ) {
     223                return true;
     224            }
     225
     226            return false;
    197227
    198228        }
  • angry-creative-logger/tags/0.8/classes/settings.php

    r1125402 r1189487  
    33Class name: ACI Settings
    44Version: 0.3.2
    5 Depends: AC Inspector 0.5.x
     5Depends: AC Inspector 0.5.x or newer
    66Author: Sammy Nordström, Angry Creative AB
    77*/
  • angry-creative-logger/tags/0.8/classes/wp_cli.php

    r1171849 r1189487  
    33/*
    44Class name: Angry Inspector Command
    5 Version: 0.1
    6 Depends: AC Inspector 0.6
     5Version: 0.2
     6Depends: AC Inspector 0.7, ACI Routine Handler 0.4
    77Author: Sammy Nordström, Angry Creative AB
    88*/
     
    2020     * ## EXAMPLES
    2121     *
    22      *     wp angry-inspector inspect write-permissions
     22     *     wp angry-inspector inspect file-permissions
    2323     *
    2424     * @synopsis [--force] [<routine>] [<other-routine>]
     
    9393                }
    9494
     95        if ( AC_Inspector::$error_count ) {
     96                    AC_Inspector::$error_count = 0;
     97                    continue;
     98                }
     99
    95100                $routine_log_count = AC_Inspector::$log_count - $total_log_count;
    96101
    97                 WP_CLI::success( "Inspected $routine with $routine_log_count remark(s).\n" );
     102            WP_CLI::success( "Inspected $routine with $routine_log_count remark(s).\n" );
     103
     104                if ( $routine_log_count > 0 ) {
     105
     106                    $repair_method = ACI_Routine_Handler::get_repair_method( $all_routines[$routine_key], $routine_options );
     107                    if ( !empty( $repair_method ) ) {
     108
     109                        WP_CLI::confirm( "Routine $routine has a repair method that may or may not fix the problem for you.\n" .
     110                                         "Have you made a backup of your website's entire source code, uploaded files and database\n" .
     111                                         "and want me to try and run the repair method with the risk of me messing everything up?" );
     112
     113                        $total_log_count = AC_Inspector::$log_count;
     114                        $total_error_count = AC_Inspector::$error_count;
     115                        $total_success_count = AC_Inspector::$success_count;
     116
     117                        call_user_func( $repair_method );
     118
     119                        $routine_log_count = AC_Inspector::$log_count - $total_log_count;
     120                        $routine_error_count = AC_Inspector::$error_count - $total_error_count;
     121                        $routine_success_count = AC_Inspector::$success_count - $total_success_count;
     122
     123                        if ( $routine_error_count > 0 ) {
     124                            WP_CLI::error( "Repair method for routine '$routine' yielded $routine_error_count error(s).\n" );
     125                        } else if ( $routine_success_count > 0 || $routine_log_count > 0 ) {
     126                            WP_CLI::success( "Successfully performed repair method for routine '$routine' with no errors.\n" );
     127                        } else {
     128                            WP_CLI::success( "Nothing seems broken. If it ain't broke, don't fix it.\n" );
     129                        }
     130
     131                    }
     132
     133                }
    98134
    99135            } else {
     
    117153     * ## EXAMPLES
    118154     *
    119      *     wp angry-inspector repair write-permissions
     155     *     wp angry-inspector repair file-permissions
    120156     *
    121157     * @synopsis [--force] [<routine>] [<other-routine>]
     
    217253
    218254WP_CLI::add_command( 'angry-inspector', 'Angry_Inspector_Command' );
     255
  • angry-creative-logger/tags/0.8/functions.php

    r839003 r1189487  
    1212
    1313}
     14
     15function aci_release_tier_aware() {
     16
     17    return ACI_Routine_Handler::release_tier_aware();
     18
     19}
     20
     21function aci_get_release_tier() {
     22
     23    return ACI_Routine_Handler::get_release_tier();
     24
     25}
     26
     27function aci_is_release_tier( $tier ) {
     28
     29    return ACI_Routine_Handler::is_release_tier( $tier );
     30
     31}
  • angry-creative-logger/tags/0.8/plugin.php

    r1171849 r1189487  
    44Plugin URI: http://angrycreative.se
    55Description: Inspects and logs possible issues with your Wordpress installation.
    6 Version: 0.7
     6Version: 0.8
    77Author: Robin Björklund, Sammy Nordström, Angry Creative AB
    88*/
    99
    10 define( 'ACI_PLUGIN_VERSION', '0.7' );
     10define( 'ACI_PLUGIN_VERSION', '0.8' );
    1111
    1212define( 'ACI_PLUGIN_DIR', dirname( __FILE__ ) );
  • angry-creative-logger/tags/0.8/readme.txt

    r1171849 r1189487  
    44Requires at least: 4.0
    55Tested up to: 4.2.2
    6 Stable tag: 0.7
     6Stable tag: 0.8
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2121
    2222== Changelog ==
     23
     24= 0.8.x =
     25* WP CLI interactivity for running possible repair method when inspection yields errors
     26* Completely rewritten and much improved file permissions inspection routine
     27* Added the abilitiy to define HTTPD_USER (http daemon user name) in wp-config.php
     28* Added the abilitiy to define FS_USER (file owner user name) in wp-config.php
     29* Added repair method to file permissions routine using HTTPD_USER and FS_USER for setting ownerships
     30* Added the abilitiy to define SITE_RELEASE_TIER (local/development/test/integration/stage/production) in wp-config.php
     31* Added repair method to site visibility routine using SITE_RELEASE_TIER for making the site public or private
    2332
    2433= 0.7.x =
  • angry-creative-logger/tags/0.8/routines/db_collations.php

    r1171849 r1189487  
    8787
    8888        if ( $proper_db_collation != $default_db_collation ) {
    89             if ( $wpdb->query( $wpdb->prepare( "ALTER DATABASE ".DB_NAME." CHARACTER SET %s COLLATE %s", $proper_charset, $proper_db_collation ) ) ) {
     89            if ( $wpdb->query( $wpdb->prepare( "ALTER DATABASE `".DB_NAME."` CHARACTER SET %s COLLATE %s", $proper_charset, $proper_db_collation ) ) ) {
    9090                AC_Inspector::log( "Converted default table collation from $default_db_collation to $proper_db_collation.", __CLASS__, array( 'success' => true ) );
    9191            } else {
     
    105105
    106106                if ( $proper_db_collation != $tbl_collation ) {
    107                     if ( $wpdb->query( $wpdb->prepare( "ALTER TABLE ".$tbl_name." CONVERT TO CHARACTER SET %s COLLATE %s", $proper_charset, $proper_db_collation ) ) ) {
     107                    if ( $wpdb->query( $wpdb->prepare( "ALTER TABLE `".$tbl_name."` CONVERT TO CHARACTER SET %s COLLATE %s", $proper_charset, $proper_db_collation ) ) ) {
    108108                        AC_Inspector::log( "Converted collation for $tbl_name from $tbl_collation to $proper_db_collation.", __CLASS__, array( 'success' => true ) );
    109109                    } else {
     
    122122                    if ( $column->Collation ) {
    123123                        if ( $proper_db_collation !== $column->Collation ) {
    124                             if ( $wpdb->query( $wpdb->prepare( "ALTER TABLE ".$tbl_name." CONVERT TO CHARACTER SET %s COLLATE %s", $proper_charset, $proper_db_collation ) ) ) {
     124                            if ( $wpdb->query( $wpdb->prepare( "ALTER TABLE `".$tbl_name."` CONVERT TO CHARACTER SET %s COLLATE %s", $proper_charset, $proper_db_collation ) ) ) {
    125125                                AC_Inspector::log( "Converted collation for $tbl_name from $tbl_collation to $proper_db_collation.", __CLASS__, array( 'success' => true ) );
    126126                            } else {
  • angry-creative-logger/tags/0.8/routines/git_status.php

    r1125422 r1189487  
    1111        const DESCRIPTION = "Detects uncommited file changes in the site's Git-repository.";
    1212
    13         private static $_default_ignore_files = array('wp-content/uploads/*');
     13        private static $_default_ignore_files = array(
     14            'wp-content/uploads/*',
     15            'wp-content/blogs.dir/*',
     16            'wp-content/cache/*',
     17            'wp-content/avatars/*',
     18            'wp-content/*/LC_MESSAGES/*'
     19        );
    1420
    1521        public static function register() {
  • angry-creative-logger/tags/0.8/routines/site_visibility.php

    r1171849 r1189487  
    22
    33/*
    4  *  Checks site visibility
     4 *  Checks and repairs site visibility
    55 */
    66
     
    6060    }
    6161
     62    public static function repair() {
     63
     64        if ( !aci_release_tier_aware() ) {
     65            AC_Inspector::log( 'Unable to determine the appropriate site visibility setting, please define SITE_RELEASE_TIER in your wp-config.php.', __CLASS__, array( 'error' => true ) );
     66            return;
     67        }
     68
     69        $release_tier = aci_get_release_tier();
     70
     71        if ( is_multisite() && is_plugin_active_for_network( ACI_PLUGIN_BASENAME ) ) {
     72
     73            global $wpdb;
     74            $site_blog_ids = $wpdb->get_col("SELECT blog_id FROM ".$wpdb->prefix."blogs");
     75
     76            if (is_array($site_blog_ids)) {
     77                foreach( $site_blog_ids AS $site_blog_id ) {
     78
     79                    if (intval($site_blog_id) > 0) {
     80
     81                        $visible = get_blog_details( $site_blog_id )->public;
     82
     83                        if ( ( !$visible && $release_tier == 'production' ) || ( $visible && $release_tier != 'production' ) ) {
     84
     85                            $visible = $visible ? 0 : 1;
     86
     87                            switch_to_blog( $site_blog_id );
     88                            update_option( 'blog_public', $visible );
     89                            restore_current_blog();
     90
     91                            AC_Inspector::log( 'The site visibility setting for ' . get_blog_details( $site_blog_id, true )->blogname .' is now ' . ( ( $visible ) ? ' public' : ' private' )  . '.', __CLASS__, array( 'success' => true ) );
     92
     93                        } else {
     94
     95                            AC_Inspector::log( 'The site visibility setting for ' . get_blog_details( $site_blog_id, true )->blogname .' seems correct, no action taken.', __CLASS__, array( 'log_level' => 'notice' ) );
     96
     97                        }
     98                    }
     99
     100                }
     101            }
     102
     103        } else {
     104
     105            $visible = get_option('blog_public');
     106
     107            if ( ( !$visible && $release_tier == 'production' ) || ( $visible && $release_tier != 'production' ) ) {
     108
     109                $visible = $visible ? 0 : 1;
     110                update_option( 'blog_public', $visible );
     111
     112                AC_Inspector::log( 'The site visibility setting is now ' . ( ( $visible ) ? ' public' : ' private' )  . '.', __CLASS__, array( 'success' => true ) );
     113
     114            } else {
     115
     116                AC_Inspector::log( 'The site visibility setting seems correct, no action taken.', __CLASS__, array( 'log_level' => 'notice' ) );
     117
     118            }
     119
     120        }
     121
     122    }
     123
    62124}
    63125
  • angry-creative-logger/trunk/classes/inspector.php

    r1171849 r1189487  
    22/*
    33Class name: AC Inspector
    4 Version: 0.6
     4Version: 0.7
    55Author: Sammy Nordström, Angry Creative AB
    66*/
     
    323323                }
    324324
     325                if ( $args['success'] ) {
     326                    $log_level = "success";
     327                }
     328
     329                if ( $args['error'] ) {
     330                    $log_level = "error";
     331                }
     332
    325333                $output = '['.date("d M, Y H:i:s").'] ['.__CLASS__.'] [ ' .strtoupper($log_level). ' ] - ';
    326334
  • angry-creative-logger/trunk/classes/routine_handler.php

    r1171849 r1189487  
    22/*
    33Class name: ACI Routine Handler
    4 Version: 0.3.2
    5 Depends: AC Inspector 0.5.x
     4Version: 0.4
     5Depends: AC Inspector 0.5.x or newer
    66Author: Sammy Nordström, Angry Creative AB
    77*/
     
    195195                self::$force_enabled = array_merge( self::$force_enabled, array( $routine ) );
    196196            }
     197
     198        }
     199
     200        public static function release_tier_aware() {
     201
     202            if ( defined( 'SITE_RELEASE_TIER' ) ) {
     203                return true;
     204            }
     205
     206            return false;
     207
     208        }
     209
     210        public static function get_release_tier() {
     211
     212            if ( defined( 'SITE_RELEASE_TIER' ) && in_array( SITE_RELEASE_TIER, array( 'local', 'development', 'integration', 'test', 'stage', 'production' ) ) ) {
     213                return SITE_RELEASE_TIER;
     214            }
     215
     216            return false;
     217
     218        }
     219
     220        public static function is_release_tier( $tier ) {
     221
     222            if ( defined( 'SITE_RELEASE_TIER' ) && !empty( $tier ) && $tier == SITE_RELEASE_TIER ) {
     223                return true;
     224            }
     225
     226            return false;
    197227
    198228        }
  • angry-creative-logger/trunk/classes/settings.php

    r1125402 r1189487  
    33Class name: ACI Settings
    44Version: 0.3.2
    5 Depends: AC Inspector 0.5.x
     5Depends: AC Inspector 0.5.x or newer
    66Author: Sammy Nordström, Angry Creative AB
    77*/
  • angry-creative-logger/trunk/classes/wp_cli.php

    r1171849 r1189487  
    33/*
    44Class name: Angry Inspector Command
    5 Version: 0.1
    6 Depends: AC Inspector 0.6
     5Version: 0.2
     6Depends: AC Inspector 0.7, ACI Routine Handler 0.4
    77Author: Sammy Nordström, Angry Creative AB
    88*/
     
    2020     * ## EXAMPLES
    2121     *
    22      *     wp angry-inspector inspect write-permissions
     22     *     wp angry-inspector inspect file-permissions
    2323     *
    2424     * @synopsis [--force] [<routine>] [<other-routine>]
     
    9393                }
    9494
     95        if ( AC_Inspector::$error_count ) {
     96                    AC_Inspector::$error_count = 0;
     97                    continue;
     98                }
     99
    95100                $routine_log_count = AC_Inspector::$log_count - $total_log_count;
    96101
    97                 WP_CLI::success( "Inspected $routine with $routine_log_count remark(s).\n" );
     102            WP_CLI::success( "Inspected $routine with $routine_log_count remark(s).\n" );
     103
     104                if ( $routine_log_count > 0 ) {
     105
     106                    $repair_method = ACI_Routine_Handler::get_repair_method( $all_routines[$routine_key], $routine_options );
     107                    if ( !empty( $repair_method ) ) {
     108
     109                        WP_CLI::confirm( "Routine $routine has a repair method that may or may not fix the problem for you.\n" .
     110                                         "Have you made a backup of your website's entire source code, uploaded files and database\n" .
     111                                         "and want me to try and run the repair method with the risk of me messing everything up?" );
     112
     113                        $total_log_count = AC_Inspector::$log_count;
     114                        $total_error_count = AC_Inspector::$error_count;
     115                        $total_success_count = AC_Inspector::$success_count;
     116
     117                        call_user_func( $repair_method );
     118
     119                        $routine_log_count = AC_Inspector::$log_count - $total_log_count;
     120                        $routine_error_count = AC_Inspector::$error_count - $total_error_count;
     121                        $routine_success_count = AC_Inspector::$success_count - $total_success_count;
     122
     123                        if ( $routine_error_count > 0 ) {
     124                            WP_CLI::error( "Repair method for routine '$routine' yielded $routine_error_count error(s).\n" );
     125                        } else if ( $routine_success_count > 0 || $routine_log_count > 0 ) {
     126                            WP_CLI::success( "Successfully performed repair method for routine '$routine' with no errors.\n" );
     127                        } else {
     128                            WP_CLI::success( "Nothing seems broken. If it ain't broke, don't fix it.\n" );
     129                        }
     130
     131                    }
     132
     133                }
    98134
    99135            } else {
     
    117153     * ## EXAMPLES
    118154     *
    119      *     wp angry-inspector repair write-permissions
     155     *     wp angry-inspector repair file-permissions
    120156     *
    121157     * @synopsis [--force] [<routine>] [<other-routine>]
     
    217253
    218254WP_CLI::add_command( 'angry-inspector', 'Angry_Inspector_Command' );
     255
  • angry-creative-logger/trunk/functions.php

    r839003 r1189487  
    1212
    1313}
     14
     15function aci_release_tier_aware() {
     16
     17    return ACI_Routine_Handler::release_tier_aware();
     18
     19}
     20
     21function aci_get_release_tier() {
     22
     23    return ACI_Routine_Handler::get_release_tier();
     24
     25}
     26
     27function aci_is_release_tier( $tier ) {
     28
     29    return ACI_Routine_Handler::is_release_tier( $tier );
     30
     31}
  • angry-creative-logger/trunk/plugin.php

    r1171849 r1189487  
    44Plugin URI: http://angrycreative.se
    55Description: Inspects and logs possible issues with your Wordpress installation.
    6 Version: 0.7
     6Version: 0.8
    77Author: Robin Björklund, Sammy Nordström, Angry Creative AB
    88*/
    99
    10 define( 'ACI_PLUGIN_VERSION', '0.7' );
     10define( 'ACI_PLUGIN_VERSION', '0.8' );
    1111
    1212define( 'ACI_PLUGIN_DIR', dirname( __FILE__ ) );
  • angry-creative-logger/trunk/readme.txt

    r1171849 r1189487  
    44Requires at least: 4.0
    55Tested up to: 4.2.2
    6 Stable tag: 0.7
     6Stable tag: 0.8
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2121
    2222== Changelog ==
     23
     24= 0.8.x =
     25* WP CLI interactivity for running possible repair method when inspection yields errors
     26* Completely rewritten and much improved file permissions inspection routine
     27* Added the abilitiy to define HTTPD_USER (http daemon user name) in wp-config.php
     28* Added the abilitiy to define FS_USER (file owner user name) in wp-config.php
     29* Added repair method to file permissions routine using HTTPD_USER and FS_USER for setting ownerships
     30* Added the abilitiy to define SITE_RELEASE_TIER (local/development/test/integration/stage/production) in wp-config.php
     31* Added repair method to site visibility routine using SITE_RELEASE_TIER for making the site public or private
    2332
    2433= 0.7.x =
  • angry-creative-logger/trunk/routines/db_collations.php

    r1171849 r1189487  
    8787
    8888        if ( $proper_db_collation != $default_db_collation ) {
    89             if ( $wpdb->query( $wpdb->prepare( "ALTER DATABASE ".DB_NAME." CHARACTER SET %s COLLATE %s", $proper_charset, $proper_db_collation ) ) ) {
     89            if ( $wpdb->query( $wpdb->prepare( "ALTER DATABASE `".DB_NAME."` CHARACTER SET %s COLLATE %s", $proper_charset, $proper_db_collation ) ) ) {
    9090                AC_Inspector::log( "Converted default table collation from $default_db_collation to $proper_db_collation.", __CLASS__, array( 'success' => true ) );
    9191            } else {
     
    105105
    106106                if ( $proper_db_collation != $tbl_collation ) {
    107                     if ( $wpdb->query( $wpdb->prepare( "ALTER TABLE ".$tbl_name." CONVERT TO CHARACTER SET %s COLLATE %s", $proper_charset, $proper_db_collation ) ) ) {
     107                    if ( $wpdb->query( $wpdb->prepare( "ALTER TABLE `".$tbl_name."` CONVERT TO CHARACTER SET %s COLLATE %s", $proper_charset, $proper_db_collation ) ) ) {
    108108                        AC_Inspector::log( "Converted collation for $tbl_name from $tbl_collation to $proper_db_collation.", __CLASS__, array( 'success' => true ) );
    109109                    } else {
     
    122122                    if ( $column->Collation ) {
    123123                        if ( $proper_db_collation !== $column->Collation ) {
    124                             if ( $wpdb->query( $wpdb->prepare( "ALTER TABLE ".$tbl_name." CONVERT TO CHARACTER SET %s COLLATE %s", $proper_charset, $proper_db_collation ) ) ) {
     124                            if ( $wpdb->query( $wpdb->prepare( "ALTER TABLE `".$tbl_name."` CONVERT TO CHARACTER SET %s COLLATE %s", $proper_charset, $proper_db_collation ) ) ) {
    125125                                AC_Inspector::log( "Converted collation for $tbl_name from $tbl_collation to $proper_db_collation.", __CLASS__, array( 'success' => true ) );
    126126                            } else {
  • angry-creative-logger/trunk/routines/git_status.php

    r1125422 r1189487  
    1111        const DESCRIPTION = "Detects uncommited file changes in the site's Git-repository.";
    1212
    13         private static $_default_ignore_files = array('wp-content/uploads/*');
     13        private static $_default_ignore_files = array(
     14            'wp-content/uploads/*',
     15            'wp-content/blogs.dir/*',
     16            'wp-content/cache/*',
     17            'wp-content/avatars/*',
     18            'wp-content/*/LC_MESSAGES/*'
     19        );
    1420
    1521        public static function register() {
  • angry-creative-logger/trunk/routines/site_visibility.php

    r1171849 r1189487  
    22
    33/*
    4  *  Checks site visibility
     4 *  Checks and repairs site visibility
    55 */
    66
     
    6060    }
    6161
     62    public static function repair() {
     63
     64        if ( !aci_release_tier_aware() ) {
     65            AC_Inspector::log( 'Unable to determine the appropriate site visibility setting, please define SITE_RELEASE_TIER in your wp-config.php.', __CLASS__, array( 'error' => true ) );
     66            return;
     67        }
     68
     69        $release_tier = aci_get_release_tier();
     70
     71        if ( is_multisite() && is_plugin_active_for_network( ACI_PLUGIN_BASENAME ) ) {
     72
     73            global $wpdb;
     74            $site_blog_ids = $wpdb->get_col("SELECT blog_id FROM ".$wpdb->prefix."blogs");
     75
     76            if (is_array($site_blog_ids)) {
     77                foreach( $site_blog_ids AS $site_blog_id ) {
     78
     79                    if (intval($site_blog_id) > 0) {
     80
     81                        $visible = get_blog_details( $site_blog_id )->public;
     82
     83                        if ( ( !$visible && $release_tier == 'production' ) || ( $visible && $release_tier != 'production' ) ) {
     84
     85                            $visible = $visible ? 0 : 1;
     86
     87                            switch_to_blog( $site_blog_id );
     88                            update_option( 'blog_public', $visible );
     89                            restore_current_blog();
     90
     91                            AC_Inspector::log( 'The site visibility setting for ' . get_blog_details( $site_blog_id, true )->blogname .' is now ' . ( ( $visible ) ? ' public' : ' private' )  . '.', __CLASS__, array( 'success' => true ) );
     92
     93                        } else {
     94
     95                            AC_Inspector::log( 'The site visibility setting for ' . get_blog_details( $site_blog_id, true )->blogname .' seems correct, no action taken.', __CLASS__, array( 'log_level' => 'notice' ) );
     96
     97                        }
     98                    }
     99
     100                }
     101            }
     102
     103        } else {
     104
     105            $visible = get_option('blog_public');
     106
     107            if ( ( !$visible && $release_tier == 'production' ) || ( $visible && $release_tier != 'production' ) ) {
     108
     109                $visible = $visible ? 0 : 1;
     110                update_option( 'blog_public', $visible );
     111
     112                AC_Inspector::log( 'The site visibility setting is now ' . ( ( $visible ) ? ' public' : ' private' )  . '.', __CLASS__, array( 'success' => true ) );
     113
     114            } else {
     115
     116                AC_Inspector::log( 'The site visibility setting seems correct, no action taken.', __CLASS__, array( 'log_level' => 'notice' ) );
     117
     118            }
     119
     120        }
     121
     122    }
     123
    62124}
    63125
Note: See TracChangeset for help on using the changeset viewer.