Plugin Directory

Changeset 3090331

Timestamp:
05/21/2024 05:06:13 PM (3 months ago)
Author:
RavanH
Message:

fix jetpack_offline_mode failing

Location:
jetpack-module-control/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • jetpack-module-control/trunk/jetpack-module-control.php

    r2365105 r3090331  
    11<?php
    2 /*
     2/*
    33 * Plugin Name: Module Control for Jetpack
    44 * Plugin URI: https://status301.net/wordpress-plugins/jetpack-module-control/
     
    66 * Author: RavanH
    77 * Author URI: https://status301.net/
     8
    89 * Network: true
    910 * Text Domain: jetpack-module-control
    1011 * License: GPL2+
    11  * Version: 1.6
     12 * Version: 1.7-alpha2
     13 *
     14 * @package Module Control for Jetpack
    1215 */
    1316
     
    1922 * finer grained "Select which modules to auto-activate"
    2023 * see http://jeremy.hu/customize-the-list-of-modules-available-in-jetpack/
    21  *  function jeherve_auto_activate_stats() {
     24 * function jeherve_auto_activate_stats() {
    2225        return array( 'stats' );
    2326    }
     
    4245 * Jetpack Module Control Class
    4346 *
    44  * since 0.1
     47 * ince 0.1
    4548 */
    4649class Jetpack_Module_Control {
     
    4851    /**
    4952     * The single instance.
    50      * @var     object
    51      * @access  private
    52      * @since   0.1
     53     *
     54     * @var object
     55     * @access private
     56     * @since 0.1
    5357     */
    5458    private static $instance = null;
     
    5660    /**
    5761     * The plugins basename.
    58      * @var     string
    59      * @access  private
    60      * @since   0.1
     62     *
     63     * @var string
     64     * @access private
     65     * @since 0.1
    6166     */
    6267    private static $plugin_basename = null;
     
    6469    /**
    6570     * Current plugin version.
     71
    6672     * @since 0.1
    6773     * @var string
     
    7177    /**
    7278     * Available modules array
     79
    7380     * @since 0.1
    7481     * @access  private
     
    7986    /**
    8087     * Know modules array with names
     88
    8189     * @since 0.2
    8290     * @access  private
     
    8492     */
    8593    private static $known_modules = array(
    86                     'wordads'       => array( 'name'    => 'Ads',
    87                                 'requires_connection'   => true ),
    88 //                  'after-the-deadline'    => array( 'name'    => 'Spelling and Grammar',
    89 //                              'requires_connection'   => true ),
    90                     'carousel'      => array( 'name'    => 'Carousel',
    91                                 'requires_connection'   => false ),
    92                     'comments'      => array( 'name'    => 'Comments',
    93                                 'requires_connection'   => true ),
    94                     'comment-likes'         => array( 'name'    => 'Comment Likes',
    95                                 'requires_connection'   => true ),
    96                     'contact-form'      => array( 'name'    => 'Contact Form',
    97                                 'requires_connection'   => false ),
    98                     'copy-post'         => array( 'name'    => 'Copy Post',
    99                                 'requires_connection'   => false ),
    100                     'custom-content-types'  => array( 'name'    => 'Custom content types',
    101                                 'requires_connection'   => false ),
    102                     'custom-css'        => array( 'name'    => 'Custom CSS',
    103                                 'requires_connection'   => false ),
    104                     'enhanced-distribution' => array( 'name'    => 'Enhanced Distribution',
    105                                 'requires_connection'    => true ),
    106                     'google-analytics'  => array( 'name'    => 'Google Analytics',
    107                                 'requires_connection'   => true ),
    108                     'gravatar-hovercards'   => array( 'name'    => 'Gravatar Hovercards',
    109                                 'requires_connection'   => false ),
    110                     'infinite-scroll'   => array( 'name'    => 'Infinite Scroll',
    111                                 'requires_connection'   => false ),
    112                     'json-api'      => array( 'name'    => 'JSON API',
    113                                 'requires_connection'   => true ),
    114                     'latex'         => array( 'name'    => 'Beautiful Math',
    115                                 'requires_connection'   => false ),
    116                     'lazy-images'       => array( 'name'    => 'Lazy Images',
    117                                 'requires_connection'   => false ),
    118                     'likes'         => array( 'name'    => 'Likes',
    119                                 'requires_connection'   => true ),
    120 //                  'manage'        => array( 'name'    => 'Manage',
    121 //                              'requires_connection'   => true ),
    122                     'markdown'      => array( 'name'    => 'Markdown',
    123                                 'requires_connection'   => false ),
    124 //                  'minileven'         => array( 'name'    => 'Mobile Theme',
    125 //                              'requires_connection'   => false ),
    126                     'monitor'       => array( 'name'    => 'Monitor',
    127                                 'requires_connection'   => true ),
    128                     'notes'         => array( 'name'    => 'Notifications',
    129                                 'requires_connection'   => true ),
    130 //                  'omnisearch'        => array( 'name'    => 'Omnisearch',
    131 //                              'requires_connection'   => false ),
    132                     'photon'        => array( 'name'    => 'Image CDN',
    133                                 'requires_connection'   => true ),
    134                     'photon-cdn'        => array( 'name'    => 'Asset CDN',
    135                                 'requires_connection'   => true ),
    136                     'post-by-email'     => array( 'name'    => 'Post by Email',
    137                                 'requires_connection'   => true ),
    138                     'protect'       => array( 'name'    => 'Protect',
    139                                 'requires_connection'   => true ),
    140                     'publicize'         => array( 'name'    => 'Publicize',
    141                                 'requires_connection'   => true ),
    142                     'related-posts'     => array( 'name'    => 'Related Posts',
    143                                 'requires_connection'   => true ),
    144                     'search'        => array( 'name'    => 'Search',
    145                                 'requires_connection'   => true ),
    146                     'seo-tools'         => array( 'name'    => 'SEO Tools',
    147                                 'requires_connection'   => true ),
    148                     'sharedaddy'        => array( 'name'    => 'Sharing',
    149                                 'requires_connection'   => false ),
    150                     'shortcodes'        => array( 'name'    => 'Shortcode Embeds',
    151                                 'requires_connection'   => false ),
    152                     'shortlinks'        => array( 'name'    => 'WP.me Shortlinks',
    153                                 'requires_connection'   => true ),
    154 //                  'site-icon'         => array( 'name'    => 'Site Icon',
    155 //                              'requires_connection'   => false ),
    156                     'sitemaps'      => array( 'name'    => 'Sitemaps',
    157                                 'requires_connection'   => false ),
    158                     'sso'           => array( 'name'    => 'Secure Sign On',
    159                                 'requires_connection'   => true ),
    160                     'stats'         => array( 'name'    => 'Site Stats',
    161                                 'requires_connection'   => true ),
    162                     'subscriptions'     => array( 'name'    => 'Subscriptions',
    163                                 'requires_connection'   => true ),
    164                     'tiled-gallery'     => array( 'name'    => 'Tiled Galleries',
    165                                 'requires_connection'   => false ),
    166                     'vaultpress'        => array( 'name'    => 'Backups and Scanning',
    167                                 'requires_connection'   => false ),
    168                     'verification-tools'    => array( 'name'    => 'Site Verification',
    169                                 'requires_connection'   => false ),
    170                     'videopress'        => array( 'name'    => 'VideoPress',
    171                                 'requires_connection'   => true ),
    172                     'widget-visibility'     => array( 'name'    => 'Widget Visibility',
    173                                 'requires_connection'   => false ),
    174                     'widgets'       => array( 'name'    => 'Extra Sidebar Widgets',
    175                                 'requires_connection'   => false ),
    176                     'woocommerce-analytics'         => array( 'name'    => 'WooCommerce Analytics',
    177                                 'requires_connection'   => true ),
    178                     'masterbar'         => array( 'name'    => 'WordPress.com Toolbar',
    179                                 'requires_connection'   => true )
    180                     );
     94        'wordads'               => array(
     95            'name'                => 'Ads',
     96            'requires_connection' => true,
     97        ),
     98        'carousel'              => array(
     99            'name'                => 'Carousel',
     100            'requires_connection' => false,
     101        ),
     102        'comments'              => array(
     103            'name'                => 'Comments',
     104            'requires_connection' => true,
     105        ),
     106        'comment-likes'         => array(
     107            'name'                => 'Comment Likes',
     108            'requires_connection' => true,
     109        ),
     110        'contact-form'          => array(
     111            'name'                => 'Contact Form',
     112            'requires_connection' => false,
     113        ),
     114        'copy-post'             => array(
     115            'name'                => 'Copy Post',
     116            'requires_connection' => false,
     117        ),
     118        'custom-content-types'  => array(
     119            'name'                => 'Custom content types',
     120            'requires_connection' => false,
     121        ),
     122        'custom-css'            => array(
     123            'name'                => 'Custom CSS',
     124            'requires_connection' => false,
     125        ),
     126        'enhanced-distribution' => array(
     127            'name'                => 'Enhanced Distribution',
     128            'requires_connection' => true,
     129        ),
     130        'google-analytics'      => array(
     131            'name'                => 'Google Analytics',
     132            'requires_connection' => true,
     133        ),
     134        'gravatar-hovercards'   => array(
     135            'name'                => 'Gravatar Hovercards',
     136            'requires_connection' => false,
     137        ),
     138        'infinite-scroll'       => array(
     139            'name'                => 'Infinite Scroll',
     140            'requires_connection' => false,
     141        ),
     142        'json-api'              => array(
     143            'name'                => 'JSON API',
     144            'requires_connection' => true,
     145        ),
     146        'latex'                 => array(
     147            'name'                => 'Beautiful Math',
     148            'requires_connection' => false,
     149        ),
     150        'lazy-images'           => array(
     151            'name'                => 'Lazy Images',
     152            'requires_connection' => false,
     153        ),
     154        'likes'                 => array(
     155            'name'                => 'Likes',
     156            'requires_connection' => true,
     157        ),
     158        'markdown'              => array(
     159            'name'                => 'Markdown',
     160            'requires_connection' => false,
     161        ),
     162        'monitor'               => array(
     163            'name'                => 'Monitor',
     164            'requires_connection' => true,
     165        ),
     166        'notes'                 => array(
     167            'name'                => 'Notifications',
     168            'requires_connection' => true,
     169        ),
     170        'photon'                => array(
     171            'name'                => 'Image CDN',
     172            'requires_connection' => true,
     173        ),
     174        'photon-cdn'            => array(
     175            'name'                => 'Asset CDN',
     176            'requires_connection' => true,
     177        ),
     178        'post-by-email'         => array(
     179            'name'                => 'Post by Email',
     180            'requires_connection' => true,
     181        ),
     182        'protect'               => array(
     183            'name'                => 'Protect',
     184            'requires_connection' => true,
     185        ),
     186        'publicize'             => array(
     187            'name'                => 'Publicize',
     188            'requires_connection' => true,
     189        ),
     190        'related-posts'         => array(
     191            'name'                => 'Related Posts',
     192            'requires_connection' => true,
     193        ),
     194        'search'                => array(
     195            'name'                => 'Search',
     196            'requires_connection' => true,
     197        ),
     198        'seo-tools'             => array(
     199            'name'                => 'SEO Tools',
     200            'requires_connection' => true,
     201        ),
     202        'sharedaddy'            => array(
     203            'name'                => 'Sharing',
     204            'requires_connection' => false,
     205        ),
     206        'shortcodes'            => array(
     207            'name'                => 'Shortcode Embeds',
     208            'requires_connection' => false,
     209        ),
     210        'shortlinks'            => array(
     211            'name'                => 'WP.me Shortlinks',
     212            'requires_connection' => true,
     213        ),
     214        'sitemaps'              => array(
     215            'name'                => 'Sitemaps',
     216            'requires_connection' => false,
     217        ),
     218        'sso'                   => array(
     219            'name'                => 'Secure Sign On',
     220            'requires_connection' => true,
     221        ),
     222        'stats'                 => array(
     223            'name'                => 'Site Stats',
     224            'requires_connection' => true,
     225        ),
     226        'subscriptions'         => array(
     227            'name'                => 'Subscriptions',
     228            'requires_connection' => true,
     229        ),
     230        'tiled-gallery'         => array(
     231            'name'                => 'Tiled Galleries',
     232            'requires_connection' => false,
     233        ),
     234        'vaultpress'            => array(
     235            'name'                => 'Backups and Scanning',
     236            'requires_connection' => false,
     237        ),
     238        'verification-tools'    => array(
     239            'name'                => 'Site Verification',
     240            'requires_connection' => false,
     241        ),
     242        'videopress'            => array(
     243            'name'                => 'VideoPress',
     244            'requires_connection' => true,
     245        ),
     246        'widget-visibility'     => array(
     247            'name'                => 'Widget Visibility',
     248            'requires_connection' => false,
     249        ),
     250        'widgets'               => array(
     251            'name'                => 'Extra Sidebar Widgets',
     252            'requires_connection' => false,
     253        ),
     254        'woocommerce-analytics' => array(
     255            'name'                => 'WooCommerce Analytics',
     256            'requires_connection' => true,
     257        ),
     258        'masterbar'             => array(
     259            'name'                => 'WordPress.com Toolbar',
     260            'requires_connection' => true,
     261        ),
     262    );
    181263
    182264    /**
     
    189271     */
    190272    private static $known_modules_icons = array(
    191                         'wordads'       => 'megaphone',
    192                         'after-the-deadline'    => 'edit',
    193                         'carousel'      => 'camera',
    194                         'comments'      => 'format-chat',
    195                         'comment-likes'         => 'star-filled',
    196                         'contact-form'      => 'feedback',
    197                         'copy-post'     => 'admin-page',
    198                         'custom-content-types'  => 'media-default',
    199                         'custom-css'        => 'admin-appearance',
    200                         'enhanced-distribution' => 'share',
    201                         'google-analytics'  => 'chart-line',
    202                         'gravatar-hovercards'   => 'id', // not available
    203                         'infinite-scroll'       => 'star-filled',
    204                         'json-api'      => 'share-alt',
    205                         'latex'         => 'star-filled',
    206                         'likes'         => 'star-filled',
    207                         'lazy-images'   => 'images-alt',
    208                         'manage'        => 'wordpress-alt',
    209                         'markdown'      => 'editor-code',
    210                         'minileven'         => 'smartphone',
    211                         'monitor'       => 'flag',
    212                         'notes'         => 'admin-comments',
    213                         'omnisearch'        => 'search',
    214                         'photon'        => 'visibility',
    215                         'photon-cdn'        => 'visibility',
    216                         'post-by-email'     => 'email',
    217                         'protect'       => 'lock',
    218                         'publicize'         => 'share',
    219                         'related-posts'     => 'update',
    220                         'search'    => 'search',
    221                         'seo-tools'         => 'chart-bar',
    222                         'sharedaddy'        => 'share-alt',
    223                         'shortcodes'        => 'text',
    224                         'shortlinks'        => 'admin-links',
    225                         'site-icon'         => 'admin-site',
    226                         'sitemaps'      => 'networking',
    227                         'sso'           => 'wordpress-alt',
    228                         'stats'         => 'chart-area',
    229                         'subscriptions'     => 'email',
    230                         'tiled-gallery'     => 'layout',
    231                         'vaultpress'        => 'shield-alt', // not availabe
    232                         'verification-tools'    => 'clipboard', // maybe yes
    233                         'videopress'        => 'embed-video',
    234                         'widget-visibility'     => 'welcome-widgets-menus',
    235                         'widgets'       => 'welcome-widgets-menus',
    236                         'woocommerce-analytics' => 'cart',
    237                         'masterbar' => 'wordpress',
    238                     );
     273        => 'megaphone',
     274        => 'edit',
     275        => 'camera',
     276        => 'format-chat',
     277        => 'star-filled',
     278        => 'feedback',
     279        => 'admin-page',
     280        => 'media-default',
     281        => 'admin-appearance',
     282        => 'share',
     283        => 'chart-line',
     284       
     285        => 'star-filled',
     286        => 'share-alt',
     287        => 'star-filled',
     288        => 'star-filled',
     289        => 'images-alt',
     290        => 'wordpress-alt',
     291        => 'editor-code',
     292        => 'smartphone',
     293        => 'flag',
     294        => 'admin-comments',
     295        => 'search',
     296        => 'visibility',
     297        => 'visibility',
     298        => 'email',
     299        => 'lock',
     300        => 'share',
     301        => 'update',
     302        => 'search',
     303        => 'chart-bar',
     304        => 'share-alt',
     305        => 'text',
     306        => 'admin-links',
     307        => 'admin-site',
     308        => 'networking',
     309        => 'wordpress-alt',
     310        => 'chart-area',
     311        => 'email',
     312        => 'layout',
     313       
     314       
     315        => 'embed-video',
     316        => 'welcome-widgets-menus',
     317        => 'welcome-widgets-menus',
     318        => 'cart',
     319        => 'wordpress',
     320    );
    239321
    240322    /**
    241323     * Default dashicon
     324
    242325     * @since 1.0
    243326     * @access  private
     
    248331    /**
    249332     * Return Jetpack available modules
     333
    250334     * @since 0.1
    251335     * @return array
     
    253337    private function get_available_modules() {
    254338        if ( null === self::$modules ) {
    255             if ( class_exists('Jetpack') ) {
    256                 remove_filter( 'jetpack_get_available_modules', array($this, 'blacklist') );
     339            if ( class_exists() ) {
     340                remove_filter( 'jetpack_get_available_modules', array() );
    257341                $modules = array();
    258342                foreach ( Jetpack::get_available_modules() as $slug ) {
    259343                    $module = Jetpack::get_module( $slug );
    260                     if ( $module )
    261                         $modules[$slug] = $module;
     344                    if ( $module ) {
     345                        $modules[ $slug ] = $module;
     346                    }
    262347                }
    263348                self::$modules = $modules;
    264                 add_filter( 'jetpack_get_available_modules', array($this, 'blacklist') );
     349                add_filter( 'jetpack_get_available_modules', array() );
    265350            } else {
    266351                self::$modules = self::$known_modules;
     
    298383    public function subsite_override_settings() {
    299384
    300         if( is_network_admin() ) {
    301             $option = get_site_option('jetpack_mc_subsite_override');
     385        if( is_network_admin() ) {
     386            $option = get_site_option();
    302387        }
    303388        $disabled = false;
     
    307392            <?php checked( $option, '1' ); ?>
    308393            <?php disabled( $disabled ); ?>>
    309             <?php _e('Allow individual site administrators to manage their own settings for Jetpack Module Control','jetpack-module-control'); ?>
     394            <?php ); ?>
    310395        </label>
    311396
     
    322407
    323408        if ( is_multisite() ) {
    324             $option = get_site_option('jetpack_mc_subsite_override');
     409            $option = get_site_option();
    325410        } else {
    326             //Always return true if not multisite
     411            //
    327412            $option = true;
    328413        }
    329414
    330415        return $option;
    331 
    332416    } // END subsite_override()
    333417
     
    350434
    351435        if ( is_network_admin() ) {
    352             // we're in network admin: retrieve network settings
    353             $disabled = is_plugin_active_for_network('manual-control/manual-control.php');
    354             $option = $disabled ? '1' : get_site_option('jetpack_mc_manual_control');
     436            // we're in network admin: retrieve network settings.
     437            $disabled = is_plugin_active_for_network( 'manual-control/manual-control.php' );
     438            $option   = $disabled ? '1' : get_site_option( 'jetpack_mc_manual_control' );
     439        } elseif ( is_plugin_active( 'manual-control/manual-control.php' ) ) {
     440            $option   = '1';
     441            $disabled = true;
    355442        } else {
    356             // we're in site admin
    357             if ( is_plugin_active('manual-control/manual-control.php') ) {
    358                 $option = '1';
    359                 $disabled = true;
     443            //
     444            if ( ) ) {
     445               
     446                $;
    360447            } else {
    361                 // check if subsite override allowed
    362                 if( $this->subsite_override() ) {
    363                     // retrieve site setting
    364                     $option = get_option('jetpack_mc_manual_control');
    365                 } else {
    366                     $option = false;
    367                 }
    368                 // fall back on network settings
    369                 if ( $option === false && is_multisite() ) $option = get_site_option('jetpack_mc_manual_control');
    370                 $disabled = defined('JETPACK_MC_LOCKDOWN') && JETPACK_MC_LOCKDOWN ? true : false;
    371             }
     448                $option = false;
     449            }
     450            // fall back on network settings.
     451            if ( false === $option && is_multisite() ) {
     452                $option = get_site_option( 'jetpack_mc_manual_control' );
     453            }
     454            $disabled = defined( 'JETPACK_MC_LOCKDOWN' ) && JETPACK_MC_LOCKDOWN ? true : false;
    372455        }
    373456
     
    377460            <?php checked( $option, '1' ); ?>
    378461            <?php disabled( $disabled ); ?>>
    379             <?php _e('Prevent Jetpack from auto-activating (new) modules','jetpack-module-control'); ?>
     462            <?php ); ?>
    380463        </label>
    381         <p class="description"><?php echo sprintf( __('Note: The module %s is excepted from this rule.','jetpack-module-control'), translate_with_gettext_context('Protect','Module Name','jetpack') ); ?></p>
     464        <p class="description"><?php ) ); ?></p>
    382465        <?php
    383 
    384466    } // END manual_control_settings()
    385467
     
    391473     * @since 0.1
    392474     * @see add_filter()
     475
    393476     */
    394477    public function manual_control( $modules ) {
    395478
    396         // check if subsite override allowed
    397         if( $this->subsite_override() ) {
    398             $option = get_option('jetpack_mc_manual_control');
     479        // check if subsite override allowed
     480        if( $this->subsite_override() ) {
     481            $option = get_option();
    399482        } else {
    400483            $option = false;
    401484        }
    402         // if false, fall back on network settings
    403         if ( $option === false && is_multisite() ) $option = get_site_option('jetpack_mc_manual_control');
    404 
    405         return !empty($option) ? array() : $modules;
    406 
     485        // if false, fall back on network settings.
     486        if ( false === $option && is_multisite() ) {
     487            $option = get_site_option( 'jetpack_mc_manual_control' );
     488        }
     489
     490        return ! empty( $option ) ? array() : $modules;
    407491    } // END manual_control()
    408492
     
    411495     */
    412496
    413      /**
    414      * Get the Jetpack Without WordPress.com option
    415      *
    416      * @since 1.6
    417      *
    418      * @return bool|string
    419      */
    420     private function get_development_mode() {
    421 
    422         if ( is_network_admin() ) {
    423             // we're in network admin
    424             if ( is_plugin_active_for_network('slimjetpack/slimjetpack.php') || is_plugin_active_for_network('unplug-jetpack/unplug-jetpack.php') ) {
    425                 $option = '1';
    426             } else {
    427                 // retrieve network settings
    428                 $option = get_site_option('jetpack_mc_development_mode');
    429             }
    430         } else {
    431             // we're in site admin
    432             if ( is_plugin_active('slimjetpack/slimjetpack.php') || is_plugin_active('unplug-jetpack/unplug-jetpack.php') ) {
    433                 $option = '1';
    434             } else {
    435                 // check if subsite override allowed
    436                 if( $this->subsite_override() ) {
    437                     //retrieve site setting
    438                     $option = get_option('jetpack_mc_development_mode');
    439                 } else {
    440                     $option = false;
    441                 }
    442                 // fall back on network settings
    443                 if ( $option === false && is_multisite() ) $option = get_site_option('jetpack_mc_development_mode');
    444             }
    445         }
     497    /**
     498     * Get the Jetpack Without WordPress.com option
     499     *
     500     * @since 1.6
     501     *
     502     * @return bool|string
     503     */
     504    private function get_development_mode() {
     505
     506        if ( is_network_admin() ) {
     507            // we're in network admin.
     508            if ( is_plugin_active_for_network( 'slimjetpack/slimjetpack.php' ) || is_plugin_active_for_network( 'unplug-jetpack/unplug-jetpack.php' ) ) {
     509                $option = '1';
     510            } else {
     511                // retrieve network settings.
     512                $option = get_site_option( 'jetpack_mc_development_mode' );
     513            }
     514        } elseif ( is_plugin_active( 'slimjetpack/slimjetpack.php' ) || is_plugin_active( 'unplug-jetpack/unplug-jetpack.php' ) ) {
     515            $option = '1';
     516        } else {
     517            // check if subsite override allowed.
     518            if ( $this->subsite_override() ) {
     519                // retrieve site setting.
     520                $option = get_option( 'jetpack_mc_development_mode' );
     521            } else {
     522                $option = false;
     523            }
     524            // fall back on network settings.
     525            if ( false === $option && is_multisite() ) {
     526                $option = get_site_option( 'jetpack_mc_development_mode' );
     527            }
     528        }
    446529
    447530        return $option;
     
    459542    public function development_mode_settings() {
    460543
    461         $option = $this->get_development_mode();
    462         $disabled = ! is_network_admin() && defined('JETPACK_MC_LOCKDOWN') && JETPACK_MC_LOCKDOWN ? true : false;
    463 
    464         if ( is_network_admin() && ( is_plugin_active_for_network('slimjetpack/slimjetpack.php') || is_plugin_active_for_network('unplug-jetpack/unplug-jetpack.php') ) || is_plugin_active('slimjetpack/slimjetpack.php') || is_plugin_active('unplug-jetpack/unplug-jetpack.php') ) {
     544        $option = $this->get_development_mode();
     545        $disabled = ! is_network_admin() && defined() && JETPACK_MC_LOCKDOWN ? true : false;
     546
     547        if ( is_network_admin() && ( is_plugin_active_for_network() ) {
    465548            $disabled = true;
    466549        }
     
    471554            <?php checked( $option, '1' ); ?>
    472555            <?php disabled( $disabled ); ?>>
    473             <?php _e('Use Jetpack modules without a WordPress.com connection','jetpack-module-control'); ?>
     556            <?php ); ?>
    474557        </label>
    475         <p class="description"><?php _e('By forcing Jetpack into development mode, modules are used without a WordPress.com account. All modules that require a WordPress.com connection will be unavailable. These modules are marked with an asterisk (*) below. The admin message about Jetpack running in development mode will be hidden.','jetpack-module-control'); ?></p>
     558        <p class="description"><?php ); ?></p>
    476559        <?php
    477 
    478560    } // END development_mode_settings()
    479561
     
    486568     */
    487569    public function development_mode() {
    488         // check if subsite override allowed
    489         if( $this->subsite_override() ) {
    490             $option = get_option('jetpack_mc_development_mode');
     570        // check if subsite override allowed
     571        if( $this->subsite_override() ) {
     572            $option = get_option();
    491573        } else {
    492574            $option = false;
    493575        }
    494576
    495         // if false, fall back on network settings
    496         if ( $option === false && is_multisite() ) {
    497             $option = get_site_option('jetpack_mc_development_mode');
    498         }
    499 
    500         return !empty($option) ? true : false;
     577        // if false, fall back on network settings
     578        if ( && is_multisite() ) {
     579            $option = get_site_option();
     580        }
     581
     582        return !) ? true : false;
    501583    }
    502584
     
    512594     */
    513595    private function no_manage_notice() {
    514         // check if subsite override allowed
    515         if( $this->subsite_override() ) {
    516             $blacklist = get_option('jetpack_mc_blacklist');
     596        // check if subsite override allowed
     597        if( $this->subsite_override() ) {
     598            $blacklist = get_option();
    517599        } else {
    518600            $blacklist = false;
    519601        }
    520602
    521         // fall back on network setting
    522         if ( $blacklist === false && is_multisite() ) $blacklist = get_site_option('jetpack_mc_blacklist');
    523 
    524         if ( is_array( $blacklist ) && in_array( 'manage', $blacklist ) ) {
     603        // fall back on network setting.
     604        if ( false === $blacklist && is_multisite() ) {
     605            $blacklist = get_site_option( 'jetpack_mc_blacklist' );
     606        }
     607
     608        if ( is_array( $blacklist ) && in_array( 'manage', $blacklist, true ) ) {
    525609            add_filter( 'can_display_jetpack_manage_notice', '__return_false' );
    526610        }
     
    534618     */
    535619    private function no_dev_notice() {
    536         if ( class_exists('Jetpack') && ( get_option('jetpack_mc_development_mode') || get_site_option('jetpack_mc_development_mode') ) ) {
     620        if ( class_exists() ) ) {
    537621            remove_action( 'jetpack_notices', array( Jetpack::init(), 'show_development_mode_notice' ) );
    538622        }
     
    555639
    556640        if ( is_network_admin() ) {
    557             // in network admin retrieve network settings
     641            // in network admin retrieve network settings
    558642            $blacklist = get_site_option( 'jetpack_mc_blacklist', array() );
    559             $disabled = false;
     643            $disabled = false;
    560644        } else {
    561             // check if subsite override allowed
    562             if( $this->subsite_override() ) {
    563                 // in site admin retrieve site settings
     645            // check if subsite override allowed
     646            if( $this->subsite_override() ) {
     647                // in site admin retrieve site settings
    564648                $blacklist = get_option( 'jetpack_mc_blacklist' );
    565649            } else {
     
    567651            }
    568652
    569             // fall back on network setting
    570             if ( $blacklist === false && is_multisite() ) $blacklist = get_site_option('jetpack_mc_blacklist');
    571             $disabled = defined('JETPACK_MC_LOCKDOWN') && JETPACK_MC_LOCKDOWN ? true : false;
     653            // fall back on network setting.
     654            if ( false === $blacklist && is_multisite() ) {
     655                $blacklist = get_site_option( 'jetpack_mc_blacklist' );
     656            }
     657            $disabled = defined( 'JETPACK_MC_LOCKDOWN' ) && JETPACK_MC_LOCKDOWN ? true : false;
    572658        }
    573659
    574660        $devmode = $this->get_development_mode();
    575661
    576         // blacklist must be an array, if anything else then just make it an empty array
    577         if ( !is_array($blacklist) ) $blacklist = array();
     662        // blacklist must be an array, if anything else then just make it an empty array.
     663        if ( ! is_array( $blacklist ) ) {
     664            $blacklist = array();
     665        }
    578666
    579667        $modules = $this->get_available_modules();
    580         asort($modules);
     668        asort();
    581669
    582670        ?>
    583         <fieldset><legend class="screen-reader-text"><span><?php _e('Blacklist Modules','jetpack-module-control'); ?></span></legend>
     671        <fieldset><legend class="screen-reader-text"><span><?php ); ?></span></legend>
    584672        <?php
    585673        foreach ( $modules as $slug => $module ) {
    586             $icon = isset(self::$known_modules_icons[$slug]) ? self::$known_modules_icons[$slug] : self::$default_icon;
    587             $reqconn = !empty($module['requires_connection']) && true === $module['requires_connection'];
    588             if ( $devmode && $reqconn ) continue;
     674            $icon    = isset( self::$known_modules_icons[ $slug ] ) ? self::$known_modules_icons[ $slug ] : self::$default_icon;
     675            $reqconn = ! empty( $module['requires_connection'] ) && true === $module['requires_connection'];
     676            if ( $devmode && $reqconn ) {
     677                continue;
     678            }
    589679            ?>
    590680            <label>
    591                 <input type='checkbox' name='jetpack_mc_blacklist[]' value='<?php echo $slug; ?>'
    592                 <?php checked( in_array( $slug, $blacklist ) ); ?>
     681                <input type='checkbox' name='jetpack_mc_blacklist[]' value='<?php echo ; ?>'
     682                <?php checked( in_array( $slug, $blacklist ) ); ?>
    593683                <?php disabled( $disabled ); ?>>
    594                 <span class="dashicons dashicons-<?php echo $icon; ?>"></span> <?php echo translate_with_gettext_context( $module['name'], 'Module Name', 'jetpack' ) ?>
    595             </label><?php echo $reqconn ? ' <a href="#jmc-note-1" style="text-decoration:none" title="' . __('Requires a WordPress.com connection','jetpack-module-control') . '">*</a>' : ''; ?><br>
     684                <span class="dashicons dashicons-<?php echo ?>
     685            </label><?php echo $reqconn ? ' <a href="#jmc-note-1" style="text-decoration:none" title="' . ) . '">*</a>' : ''; ?><br>
    596686            <?php
    597687        }
    598         if ( ! $devmode ) echo '<aside role="note" id="jmc-note-1"><p class="description">' . __('*) Modules marked with an asterisk require a WordPress.com connection. They will be unavailable if Jetpack is forced into offline mode.','jetpack-module-control') . '</p></aside>';
     688        if ( ! $devmode ) {
     689            echo '<aside role="note" id="jmc-note-1"><p class="description">' . esc_html__( '*) Modules marked with an asterisk require a WordPress.com connection. They will be unavailable if Jetpack is forced into offline mode.', 'jetpack-module-control' ) . '</p></aside>';
     690        }
    599691        ?>
    600692        </fieldset>
    601693        <?php
    602 
    603694    } // END blacklist_settings()
    604695
     
    608699     *
    609700     * @since 0.1
    610      * @param $modules
     701     * @param
    611702     *
    612703     * @return Array Allowed modules after unsetting blacklisted modules from all modules array
    613704     */
    614     public function blacklist ( $modules ) {
    615 
    616         // check if subsite override allowed
    617         if( $this->subsite_override() ) {
    618             $blacklist = get_option('jetpack_mc_blacklist');
     705    public function blacklist( $modules ) {
     706
     707        // check if subsite override allowed
     708        if( $this->subsite_override() ) {
     709            $blacklist = get_option();
    619710        } else {
    620711            $blacklist = false;
    621712        }
    622713
    623         // fall back on network setting
    624         if ( $blacklist === false && is_multisite() ) $blacklist = get_site_option('jetpack_mc_blacklist');
    625 
    626         foreach ( (array)$blacklist as $mod )
    627             if ( isset( $modules[$mod] ) )
    628                 unset( $modules[$mod] );
     714        // fall back on network setting.
     715        if ( false === $blacklist && is_multisite() ) {
     716            $blacklist = get_site_option( 'jetpack_mc_blacklist' );
     717        }
     718
     719        foreach ( (array) $blacklist as $mod ) {
     720            if ( isset( $modules[ $mod ] ) ) {
     721                unset( $modules[ $mod ] );
     722            }
     723        }
    629724
    630725        return $modules;
    631 
    632726    }
    633727
     
    641735     * @since 0.1
    642736     */
    643     public function admin_init(){
     737    public function admin_init() {
     738
     739        // Admin translations.
     740        load_plugin_textdomain( 'jetpack-module-control' );
    644741
    645742        $this->no_manage_notice();
     
    654751
    655752            // Add settings to Network Settings
    656             // thanks to http://zao.is/2013/07/adding-settings-to-network-settings-for-wordpress-multisite/
     753            // thanks to http://zao.is/2013/07/adding-settings-to-network-settings-for-wordpress-multisite/
    657754            add_filter( 'wpmu_options', array( $this, 'show_network_settings' ) );
    658755            add_action( 'update_wpmu_options', array( $this, 'save_network_settings' ) );
    659756
    660             // Plugin action links
    661             add_filter( 'network_admin_plugin_action_links_' . $this->plugin_basename(), array($this, 'add_action_link') );
    662         }
    663 
    664         // check if subsite override allowed
    665         if($this->subsite_override()) {
    666             // Plugin action links
    667             add_filter( 'plugin_action_links_' . $this->plugin_basename(), array($this, 'add_action_link') );
    668 
    669             // Do regular register/add_settings stuff in 'general' settings on options-general.php
     757            // Plugin action links
     758            add_filter( 'network_admin_plugin_action_links_' . $this->plugin_basename(), array() );
     759        }
     760
     761        // check if subsite override allowed
     762        if) {
     763            // Plugin action links
     764            add_filter( 'plugin_action_links_' . $this->plugin_basename(), array() );
     765
     766            // Do regular register/add_settings stuff in 'general' settings on options-general.php
    670767            $settings = 'general';
    671768
    672             add_settings_section('jetpack-module-control', '<a name="jetpack-mc"></a>' . __('Jetpack Module Control','jetpack-module-control'), array($this, 'add_settings_section'), $settings);
    673 
    674             // register settings
    675             if ( defined('JETPACK_MC_LOCKDOWN') && JETPACK_MC_LOCKDOWN ) {
    676                 // do not register site settings to prevent them being updated
    677             } else {
     769            add_settings_section( 'jetpack-module-control', '<a name="jetpack-mc"></a>' . __( 'Jetpack Module Control', 'jetpack-module-control' ), array( $this, 'add_settings_section' ), $settings );
     770
     771            // register settings.
     772            if ( ! defined( 'JETPACK_MC_LOCKDOWN' ) || ! JETPACK_MC_LOCKDOWN ) {
    678773                register_setting( $settings, 'jetpack_mc_manual_control' ); // sanitize_callback 'boolval' ?
    679774                register_setting( $settings, 'jetpack_mc_development_mode' ); // sanitize_callback 'boolval' ?
    680                 register_setting( $settings, 'jetpack_mc_blacklist', array($this, 'sanitize_blacklist') );
    681             }
    682 
    683             // add settings fields
    684             add_settings_field( 'jetpack_mc_manual_control', __('Manual Control','jetpack-module-control'), array($this, 'manual_control_settings'), $settings, 'jetpack-module-control' ); // array('label_for' => 'elementid')
    685             add_settings_field( 'jetpack_mc_development_mode', __('Offline Mode','jetpack-module-control'), array($this, 'development_mode_settings'), $settings, 'jetpack-module-control' ); // array('label_for' => 'elementid')
    686             add_settings_field( 'jetpack_mc_blacklist', __('Blacklist Modules','jetpack-module-control'), array($this, 'blacklist_settings'), $settings, 'jetpack-module-control' );
    687         }
    688 
     775                register_setting( $settings, 'jetpack_mc_blacklist', array( $this, 'sanitize_blacklist' ) );
     776            }
     777
     778            // add settings fields.
     779            add_settings_field( 'jetpack_mc_manual_control', __( 'Manual Control', 'jetpack-module-control' ), array( $this, 'manual_control_settings' ), $settings, 'jetpack-module-control' );
     780            add_settings_field( 'jetpack_mc_development_mode', __( 'Offline Mode', 'jetpack-module-control' ), array( $this, 'development_mode_settings' ), $settings, 'jetpack-module-control' );
     781            add_settings_field( 'jetpack_mc_blacklist', __( 'Blacklist Modules', 'jetpack-module-control' ), array( $this, 'blacklist_settings' ), $settings, 'jetpack-module-control' );
     782        }
    689783    }
    690784
     
    693787     *
    694788     * @since 1.6
     789
    695790     */
    696791    public function sanitize_blacklist( $options ) {
    697         return is_array($options) ? array_values($options) : $options;
     792        return is_array() : $options;
    698793    }
    699794
     
    704799     */
    705800    public function save_network_settings() {
     801
    706802
    707803        $posted_settings = array(
    708                     'jetpack_mc_manual_control' => '',
    709                     'jetpack_mc_development_mode' => '',
    710                     'jetpack_mc_blacklist' => '',
    711                     'jetpack_mc_subsite_override' => ''
    712                     );
    713 
    714         isset( $_POST['jetpack_mc_subsite_override'] ) && $posted_settings['jetpack_mc_subsite_override'] = '1';
    715 
    716         isset( $_POST['jetpack_mc_manual_control'] ) && $posted_settings['jetpack_mc_manual_control'] = '1';
    717 
    718         isset( $_POST['jetpack_mc_development_mode'] ) && $posted_settings['jetpack_mc_development_mode'] = '1';
    719 
    720         isset( $_POST['jetpack_mc_blacklist'] ) && $posted_settings['jetpack_mc_blacklist'] = $this->sanitize_blacklist( $_POST['jetpack_mc_blacklist'] );
    721 
    722         foreach( $posted_settings as $name => $value ) {
     804            'jetpack_mc_manual_control'   => isset( $_POST['jetpack_mc_manual_control'] ),
     805            'jetpack_mc_development_mode' => isset( $_POST['jetpack_mc_development_mode'] ),
     806            'jetpack_mc_blacklist'        => isset( $_POST['jetpack_mc_blacklist'] ) ? $this->sanitize_blacklist( $_POST['jetpack_mc_blacklist'] ) : false,
     807            'jetpack_mc_subsite_override' => isset( $_POST['jetpack_mc_subsite_override'] ),
     808        );
     809
     810        foreach ( $posted_settings as $name => $value ) {
    723811            update_site_option( $name, $value );
    724812        }
    725 
    726813    }
    727814
     
    733820    public function show_network_settings() {
    734821        ?>
    735         <h3><a name="jetpack-mc"></a><?php _e('Jetpack Module Control','jetpack-module-control'); ?></h3>
     822        <h3><a name="jetpack-mc"></a><?php ); ?></h3>
    736823        <?php
    737             $this->add_settings_section('');
     824);
    738825        ?>
    739826        <table class="form-table">
    740827            <tbody>
    741828                <tr>
    742                     <th scope="row"><?php _e('Sub-site Override','jetpack-module-control'); ?></th>
     829                    <th scope="row"><?php ); ?></th>
    743830                    <td>
    744831                        <?php
     
    749836
    750837                <tr>
    751                     <th scope="row"><?php _e('Manual Control','jetpack-module-control'); ?></th>
     838                    <th scope="row"><?php ); ?></th>
    752839                    <td>
    753840                        <?php
     
    757844                </tr>
    758845                <tr>
    759                     <th scope="row"><?php _e('Development Mode','jetpack-module-control'); ?></th>
     846                    <th scope="row"><?php ); ?></th>
    760847                    <td>
    761848                        <?php
     
    765852                </tr>
    766853                <tr>
    767                     <th scope="row"><?php _e('Blacklist Modules','jetpack-module-control'); ?></th>
     854                    <th scope="row"><?php ); ?></th>
    768855                    <td>
    769856                        <?php
     
    773860                </tr>
    774861            </tbody>
    775             </table>
    776             <?php
    777     }
    778 
    779     /**
     862    </table>
     863    <?php
     864    }
     865
     866    /**
    780867     * Echos a settings section header
    781868     *
    782869     * @since 0.1
    783870     *
    784      * @param $option (unused)
    785871     * @echo Html
    786872     */
    787     public function add_settings_section( $option ) {
     873    public function add_settings_section() {
    788874        echo '<p><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=Jetpack%20Module%20Control&item_number='
    789                 . $this->version
     875                .
    790876                . '&no_shipping=0&tax=0&charset=UTF%2d8&currency_code=EUR" title="'
    791                 . __('Donate to keep plugin development going!','jetpack-module-control')
     877                . )
    792878                . '" target="_blank"><img src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" style="border:none;float:right;margin:5px 0 0 10px" alt="'
    793                 . __('Donate to keep plugin development going!','jetpack-module-control') . '" width="92" height="26" /></a>'
    794                 . sprintf(__('The options in this section are provided by %s.','jetpack-module-control'),'<strong><a href="http://status301.net/wordpress-plugins/jetpack-module-control/">'
    795                 . __('Jetpack Module Control','jetpack-module-control') . ' ' . $this->version . '</a></strong>') . ' '
    796                 . __('This plugin brings additional control over Jetpack modules. You can blacklist / remove individual modules, prevent auto-activation or allow activation without a WordPress.com account.','jetpack-module-control') . ' ';
    797 
    798         if ( !is_multisite() )
    799             echo sprintf(__('These settings can be locked down by adding %s to your wp-config.php file.','jetpack-module-control'),'<code>define(\'JETPACK_MC_LOCKDOWN\', true);</code>');
    800         else if ( is_network_admin() )
    801                 echo '<br><em>' . __('These settings are only visible to you as Super Admin and these settings affect all sites on the network.','jetpack-module-control') . '</em>';
     879                . esc_html__( 'Donate to keep plugin development going!', 'jetpack-module-control' ) . '" width="92" height="26" /></a>'
     880                . sprintf( /* translators: plugin name, linked to plugin home page */
     881                    esc_html__( 'The options in this section are provided by %s.', 'jetpack-module-control' ),
     882                    '<strong><a href="http://status301.net/wordpress-plugins/jetpack-module-control/">'
     883                    . esc_html__( 'Jetpack Module Control', 'jetpack-module-control' ) . ' ' . esc_html( $this->version ) . '</a></strong>'
     884                ) . ' '
     885                . esc_html__( 'This plugin brings additional control over Jetpack modules. You can blacklist / remove individual modules, prevent auto-activation or allow activation without a WordPress.com account.', 'jetpack-module-control' ) . ' ';
     886
     887        if ( ! is_multisite() ) {
     888            printf( /* translators: code snippet */ esc_html__( 'These settings can be locked down by adding %s to your wp-config.php file.', 'jetpack-module-control' ), '<code>define(\'JETPACK_MC_LOCKDOWN\', true);</code>' );
     889        } elseif ( is_network_admin() ) {
     890                echo '<br><em>' . esc_html__( 'These settings are only visible to you as Super Admin and these settings affect all sites on the network.', 'jetpack-module-control' ) . '</em>';
     891        }
    802892
    803893        echo '</p>';
     
    810900     * @see is_plugin_active_for_network(), admin_url(), network_admin_url()
    811901     *
    812      * @param array $links Plugin de/activation and deletion links
    813      * @return array Plugin links plus Settings link
     902     * @param array $links Plugin de/activation and deletion links
     903     * @return array Plugin links plus Settings link
    814904     */
    815905    public function add_action_link( $links ) {
    816906        $settings_link = is_plugin_active_for_network( $this->plugin_basename() ) ?
    817             '<a href="' . network_admin_url('settings.php#jetpack-mc') . '">' . translate('Network Settings') . '</a>' :
    818             '<a href="' . admin_url('options-general.php#jetpack-mc') . '">' . translate('Settings') . '</a>';
     907            '<a href="' . network_admin_url( 'settings.php#jetpack-mc' ) . '">' . esc_html__( 'Network Settings' ) . '</a>' :
     908            '<a href="' . admin_url( 'options-general.php#jetpack-mc' ) . '">' . esc_html__( 'Settings' ) . '</a>';
     909
    819910        return array_merge(
    820911            array( 'settings' => $settings_link ),
    821912            $links
    822913        );
    823         return $links;
    824     }
    825 
    826     /**
    827      * Routines to execute on plugins_loaded
    828      *
    829      * https://github.com/Automattic/jetpack/pull/2027 >> request accepted and fixed
    830      *
    831      * @since 0.1
    832      */
    833     public function plugins_loaded() {
    834         global $pagenow;
    835 
    836         // only need translations on admin page
    837         if ( is_admin() ) {
    838             load_plugin_textdomain( 'jetpack-module-control' );
    839         }
    840 
     914    }
     915
     916    /**
     917     * Getter method for retrieving single object instance.
     918     *
     919     * @since 0.1
     920     *
     921     * @return Jetpack_Module_Control|null instance object
     922     */
     923    public static function instance() {
     924        if ( is_null( self::$instance ) ) {
     925            self::$instance = new self();
     926        }
     927        return self::$instance;
     928    }
     929
     930    /**
     931     * Constructor
     932     *
     933     * @since  0.1
     934     */
     935    private function __construct() {
    841936        add_filter( 'jetpack_get_default_modules', array( $this, 'manual_control' ), 99 );
    842937        add_filter( 'jetpack_offline_mode', array( $this, 'development_mode' ) );
    843938        add_filter( 'jetpack_get_available_modules', array( $this, 'blacklist' ) );
    844     }
    845 
    846     /**
    847      * Getter method for retrieving single object instance.
    848      *
    849      * @since 0.1
    850      *
    851      * @return Jetpack_Module_Control|null instance object
    852      */
    853     public static function instance() {
    854         if(is_null(self::$instance)) {
    855             self::$instance = new self();
    856         }
    857         return self::$instance;
    858     }
    859 
    860     /**
    861      * Constructor
     939
     940        add_action( 'admin_init', array( $this, 'admin_init' ), 11 );
     941    }
     942
     943    /**
     944     * Cloning
    862945     *
    863946     * @since  0.1
    864947     */
    865     private function __construct() {
    866         add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ), 0 );
    867         add_action( 'admin_init', array($this,'admin_init'), 11 );
    868     }
    869 
    870     /**
    871      * Cloning
    872      *
    873      * @since  0.1
    874      */
    875948    private function __clone() { }
    876 
    877949}
    878950
  • jetpack-module-control/trunk/readme.txt

    r2933440 r3090331  
    22Contributors: RavanH
    33Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=Module%20Control%20for%20Jetpack
    4 Tags: Jetpack, jet pack, jetpack light, manual control, blacklist, blacklist jetpack modules, slim jetpack
     4Tags: Jetpack, jet pack, jetpack light, manual control, blacklist, blacklist jetpack modules, slim jetpack
    55Stable tag: 1.6
    66Requires at least: 4.0
    7 Tested up to: 6.2
     7Tested up to: 6.
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    1313== Description ==
    1414
    15 [Jetpack](https://wordpress.org/plugins/jetpack/) adds powerful features... but sometimes we don't want them all. This plugin brings additional control over Jetpack modules.
     15[Jetpack](https://wordpress.org/plugins/jetpack/) adds powerful features.
    1616
    1717= Features =
     
    19191. Blacklist / remove individual Jetpack modules.
    20201. Prevent module auto-activation on connection or after an upgrade.
    21 1. Allow activation of Jetpack modules without a WordPress.com connection.
     211. without a WordPress.com connection.
    22221. Single site and Multisite compatible.
    2323
     
    2626In most use cases, a carefully considered combination of Jetpack modules can be a really good thing. But not always is much consideration being done beforehand. Or site admins just don't know all the implications...
    2727
    28 - Maybe your Nginx web server uses FastCGI caching, making it incompatible with the Mobile Theme module? Blacklist that module to prevent any admin from activating it.
    29 - Do you already a light box provided by your theme or another plugin? Then blacklist the Carousel module to prevent accidental activation.
     28-
     29- Do you already a light box provided by your theme or another plugin? Then blacklist the Carousel module to prevent accidental activation.
    3030- Or you're running a Multisite and do not want any admins monitoring uptime with the Monitor module just to call you every time their site is briefly inaccessible?
    31 - Or you offer your own backup service and do not care much for VaultPress competition?
    32 - You're running a school network and (some) sites are managed by minors who are not allowed to sign up for an account at WordPress.com? Then use the Jetpack Development Mode option to allow usage of modules that do not require a connection.
     31- Offer your own backup service and do not care much for VaultPress competition?
     32- You're running a school network and (some) sites are managed by minors who are not allowed to sign up for an account at WordPress.com? Then use the Jetpack Mode option to allow usage of modules that do not require a connection.
    3333
    3434Any one of Jetpack's modules can bring overlapping or even conflicting functionality. In such cases, being able to prevent (accidental) activation is a good thing.
     
    6666
    6767== Changelog ==
     68
     69
     70
     71
     72
     73
    6874
    6975= 1.6 =
Note: See TracChangeset for help on using the changeset viewer.