Plugin Directory

Changeset 1681536


Ignore:
Timestamp:
06/19/2017 10:49:28 PM (9 years ago)
Author:
WebTechGlobal
Message:

Added a maintenance mode tool for displaying "Under Construction" notice.

Location:
multitool
Files:
200 added
17 edited

Legend:

Unmodified
Added
Removed
  • multitool/trunk/assets/js/admin/multitool_admin.js

    r1662640 r1681536  
    22
    33/**
    4  * Multitool Admin JS
     4 * Multitool Configuration Tools show/hide Functionality
    55 */
    66jQuery( function ( $ ) {
    77
    8     // Demo store notice
    9     $( 'input#woocommerce_demo_store' ).change(function() {
    10         if ( $( this ).is( ':checked' ) ) {
    11             $( '#woocommerce_demo_store_notice' ).closest( 'tr' ).show();
    12         } else {
    13             $( '#woocommerce_demo_store_notice' ).closest( 'tr' ).hide();
    14         }
    15     }).change();
    16    
    178    // Administration Accounts Cap
    189    $( 'input#adminaccountscap_activate' ).change(function() {
     
    2920    }).change();   
    3021
     22    // Maintenace Mode
     23    $( 'input#multitool_maintenancemode_activate' ).change(function() {
     24        if ( $( this ).is( ':checked' ) ) {
     25            $( '#multitool_maintenancemode_timelimit' ).closest( 'tr' ).show();
     26        } else {
     27            $( '#multitool_maintenancemode_timelimit' ).closest( 'tr' ).hide();
     28        }
     29    }).change();   
     30   
    3131});
  • multitool/trunk/includes/admin/class.multitool-admin-help.php

    r1662640 r1681536  
    4747            '<p><a href="' . MULTITOOL_SKYPE . '" class="button button-primary">' . __( 'Skype', 'multitool' ) .
    4848            '</a> <a href="' . MULTITOOL_AUTHOR_SLACK .'" class="button button-primary">' . __( 'Slack', 'multitool' ) .
    49             '</a> <a href="' . MULTITOOL_TRELLO . '" class="button button-primary">' . __( 'Trello', 'multitool' ) .
    5049            '</a> <a href="' . MULTITOOL_GITHUB . '/issues" class="button button-primary">' . __( 'Bugs', 'multitool' ) . '</a> </p>',
    5150        ) );
  • multitool/trunk/includes/admin/class.multitool-admin-main-views.php

    r1662640 r1681536  
    11<?php
    22/**
    3  * Multitool Admin Reports
     3 * Multitool Main Admin Views
    44 *
    55 * @author      Multitool
    66 * @category    Admin
    7  * @package     Multitool/Admin/Reports
     7 * @package     Multitool/Admin
    88 * @version     1.0.0
    99 */
     
    2121
    2222    /**
    23      * Handles output of the reports page in admin.
     23     * Handles output of the main tables page in admin.
    2424     */
    2525    public static function output() {       
     
    3333
    3434    /**
    35      * Returns the definitions for the reports to show in admin.
     35     * Returns the definitions for custom views within the main table view.
    3636     *
    3737     * @return array
     
    7777
    7878    /**
    79      * Get a report from our reports subfolder.
     79     * Get a report from our table view from the subfolder.
    8080     */
    8181    public static function get_maintabview( $name_presan ) {     
  • multitool/trunk/includes/admin/class.multitool-admin-notices.php

    r1662640 r1681536  
    316316        include( 'notices/install.php' );
    317317    }
     318   
     319    public static function notice( $type, $title, $description, $dismissible = false ) {
     320        self::$type( $title, $description, $dismissible );   
     321    }
     322   
     323    public static function error( $title, $desc, $dismissible = false ) {
     324        $d = ''; if( $dismissible ){ $d = ' is-dismissible'; }
     325        ?><div class="notice notice-error<?php echo $d; ?>>"><p><?php echo '<strong>' . $title . ': </strong>' . $desc; ?>.</p></div><?php     
     326    }
     327   
     328    public static function warning( $title, $desc, $dismissible = false ) {
     329        $d = ''; if( $dismissible ){ $d = ' is-dismissible'; }
     330        ?><div class="notice notice-warning<?php echo $d; ?>"><p><?php echo '<strong>' . $title . ': </strong>' . $desc; ?>.</p></div><?php     
     331    }
     332   
     333    public static function success( $title, $desc, $dismissible = false ) {
     334        $d = ''; if( $dismissible ){ $d = ' is-dismissible'; }
     335        ?><div class="notice notice-success<?php echo $d; ?>"><p><?php echo '<strong>' . $title . ': </strong>' . $desc; ?>.</p></div><?php     
     336    }
     337   
     338    public static function info( $title, $desc, $dismissible = false ) {
     339        $d = ''; if( $dismissible ){ $d = ' is-dismissible'; }
     340        ?><div class="notice notice-info<?php echo $d; ?>"><p><?php echo '<strong>' . $title . ': </strong>' . $desc; ?>.</p></div><?php     
     341    }
    318342}
    319343
  • multitool/trunk/includes/admin/class.multitool-admin-quicktools.php

    r1662640 r1681536  
    1010 * @category    Admin
    1111 * @package     Multitool/Admin
    12  * @version     1.0.0
     12 * @version     1.0.1
    1313 */
    1414
     
    3838    * Mainly for hooks.
    3939    */
    40     public static function init() {           
    41         add_action( 'admin_init', array( __CLASS__, 'listener' )  );     
     40    public static function init() {               
     41        add_action( 'admin_init', array( __CLASS__, 'admin_request_listener' )  );     
     42    }
     43   
     44    /**
     45    * Just a template tool. Replace "templatetool_" in method name
     46    * with "tool_".
     47    *
     48    * @version 1.0
     49    */
     50    public function templatetool_go_to_latest_publication() {
     51        /**
     52        * Description of values.
     53        *
     54        * title       - give the tool a name.
     55        * description - describe what the tool does.
     56        * version     - tools must be versioned to give users warning
     57        * author      - we have to know who to come to for help with a tool
     58        * url         - link to a tutorial or other documentation
     59        * category    - a way to group tools
     60        * capability  - apply security using a core or custom capability
     61        * option      - add option name if configuration required to use tool
     62        */
     63        $tool_info = array(
     64            'title'       => __( 'Tool Title', 'multitool' ),
     65            'description' => __( 'This is the tool description.', 'multitool' ),
     66            'version'     => '1.1',
     67            'author'      => 'Ryan Bayne',
     68            'url'         => '',
     69            'category'    => 'users',
     70            'capability'  => 'activate_plugins',
     71            'option'      => null
     72        );
     73       
     74        if( $this->return_tool_info ){ return $tool_info; }     
     75       
     76        if( !current_user_can( $tool_info['capability'] ) ) { return; }
     77       
     78        /*
     79            Your tools unique code goes here. Make it do something!
     80        */
    4281    }
    4382   
     
    5190    * every tools security checks and validation.
    5291    *
    53     * @version 1.0
    54     */
    55     public static function listener() {   
     92    * @version 1.1
     93    */
     94    public static function admin_request_listener() {   
    5695        if( !isset( $_REQUEST['_wpnonce'] ) ) {
    5796            return;
     
    65104            return;
    66105        }
    67         $tool_name = $_GET['toolname'];
     106        $tool_name = multitool_clean( $_GET['toolname'] );
    68107             
    69108        if( !method_exists( __CLASS__, $tool_name ) ) {       
    70109            return;
    71110        }   
    72        
    73         $QuickTools = new Multitool_QuickTools();                 
    74         $QuickTools->return_tool_info = true;
    75        
    76         eval( '$tool_info = $QuickTools->$tool_name();');
    77        
    78         if( !isset( $tool_info['capability'] ) ) {
    79             return;
    80         }
    81        
    82         if( !current_user_can( $tool_info['capability'] ) ) {
    83             return;
    84         }
    85111       
    86112        // Ensure the request is attempting to use an actual tool!
     
    88114            return;
    89115        }
     116               
     117        $QuickTools = new Multitool_QuickTools();                 
     118        $QuickTools->return_tool_info = true;
     119       
     120        // Prepare an array for passing to the tool method.
     121        $tool_parameters_array = array();
     122       
     123        // Get the requested tools information for performing validation.
     124        eval( '$tool_info = $QuickTools->$tool_name( $tool_parameters_array );');
     125       
     126        if( !isset( $tool_info['capability'] ) ) {
     127            return;
     128        }
     129       
     130        if( !current_user_can( $tool_info['capability'] ) ) {
     131            return;
     132        }
     133       
     134        // Is this a tool with multiple possible actions?
     135        if( isset( $tool_info['actions'] ) && is_array( $tool_info['actions'] ) ) {
     136            $action = multitool_clean( $_GET['action'] );
     137            if( !isset( $tool_info['actions'][ $action ] ) ) {
     138                return false;
     139            }   
     140           
     141            // Pass the specific action to the tools method.
     142            $tool_parameters_array['action'] = $action;
     143        }
    90144       
    91145        $QuickTools->return_tool_info = false;
    92         $QuickTools->$tool_name();
     146        $QuickTools->$tool_name( $tool_parameters_array );
    93147    }
    94148   
     
    100154    * Display a list of the latest subscribers. A maximum of 100.
    101155    *
    102     * @version 1.0
     156    * @version 1.1
    103157    */
    104158    public function tool_display_latest_subscribers() {
     
    106160            'title'       => 'Display Latest Subscribers',
    107161            'description' => __( 'Displays usernames and email addresses for the latest registered users.', 'multitool' ),
    108             'version'     => '1.0',
     162            'version'     => '1.1',
    109163            'author'      => 'Ryan Bayne',
    110164            'url'         => '',
    111165            'category'    => 'users',
    112             'capability'  => 'activate_plugins'
     166            'capability'  => 'activate_plugins',
     167            'option'      => null,
    113168        );
    114169       
     
    126181    * Sends the user to the latest wp_post (post,page,custom post types).
    127182    *
    128     * @version 1.0
     183    * @version 1.1
    129184    */
    130185    public function tool_go_to_latest_publication() {
     
    132187            'title'       => 'View Latest Publication',
    133188            'description' => __( 'Display information about the latest authored post including pages and custom post-types.', 'multitool' ),
    134             'version'     => '1.0',
     189            'version'     => '1.1',
    135190            'author'      => 'Ryan Bayne',
    136191            'url'         => '',
    137192            'category'    => 'users',
    138             'capability'  => 'activate_plugins'
     193            'capability'  => 'activate_plugins',
     194            'option'      => null
    139195        );
    140196       
     
    142198       
    143199        if( !current_user_can( $tool_info['capability'] ) ) { return; }
    144        
     200
    145201        $args = array(
    146202            'numberposts' => 1,
     
    157213        var_dump( $recent_posts );
    158214        echo '</pre>';       
    159     } 
     215    }
     216   
     217    /**
     218    * Enable/Disabled error display.
     219    *
     220    * @version 1.0
     221    */
     222    public function tool_plugin_displayerrors( $tool_parameters_array ) {
     223
     224        $tool_info = array(
     225            'title'       => __( 'Display Errors', 'multitool' ),
     226            'description' => __( 'A tool for developers that will display errors.', 'multitool' ),
     227            'version'     => '1.0',
     228            'author'      => 'Ryan Bayne',
     229            'url'         => '',
     230            'category'    => 'developers',
     231            'capability'  => 'activate_plugins',
     232            'option'      => 'displayerrors_activate',
     233            'actions'     => array(
     234                'displayerrors'    => array( 'title' => __( 'Display Errors', 'multitool' ) ),
     235                'hideerrors' => array( 'title' => __( 'Hide Errors', 'multitool' ) ),
     236            ),
     237        );
     238             
     239        if( $this->return_tool_info ){ return $tool_info; }     
     240             
     241        if( !current_user_can( $tool_info['capability'] ) ) { return; }
     242             
     243        if( !isset( $tool_parameters_array['action'] ) ) { return; }
     244                                       
     245        if( $tool_parameters_array['action'] == 'displayerrors' ) {     
     246            update_option( 'multitool_displayerrors', 'yes', true );
     247            Multitool_Admin_Notices::add_custom_notice( 'displayerrorsyes', 'Error display has been activated by the Multitool Display Errors tool. You can reverse this by going to the Tools menu, select Quick Tools, search for "Display Errors" and click on the Hide Errors button.', 'multitool' );
     248            wp_safe_redirect( admin_url( 'tools.php?page=multitool-quick' ) );
     249        } elseif( $tool_parameters_array['action'] == 'hideerrors' ) {                 
     250            delete_option( 'multitool_displayerrors' );
     251            wp_safe_redirect( admin_url( 'tools.php?page=multitool-quick' ) );
     252        }
     253    }
     254   
     255    /**
     256    * Maintenance Mode
     257    *
     258    * Maintenance activate/disable tool. Requires configuration tool to be
     259    * used first.
     260    *
     261    * @version 1.0
     262    */
     263    public function tool_maintenancemode( $tool_parameters_array ) {
     264
     265        $tool_info = array(
     266            'title'       => __( 'Maintenance Mode', 'multitool' ),
     267            'description' => __( 'Display a maintenance notice to all visitors for a set period of time.', 'multitool' ),
     268            'version'     => '1.1',
     269            'author'      => 'Ryan Bayne',
     270            'url'         => '',
     271            'category'    => 'developers',
     272            'capability'  => 'activate_plugins',
     273            'option'      => null,
     274            'actions'     => array(
     275                'maintenanceon'    => array( 'title' => __( 'Maintenance On', 'multitool' ) ),
     276                'maintenanceoff' => array( 'title' => __( 'Maintenance Off', 'multitool' ) ),
     277            ),           
     278        );
     279       
     280        if( $this->return_tool_info ){ return $tool_info; }     
     281       
     282        if( !current_user_can( $tool_info['capability'] ) ) { return; }
     283       
     284        // Include the tools own class, this automatically runs init().
     285        include_once( MULTITOOL_PLUGIN_DIR_PATH . 'includes/tools/class.multitool-maintenance-tool.php' );
     286       
     287        // What action has been clicked on?     
     288        if( $tool_parameters_array['action'] == 'maintenanceon' ) {     
     289
     290            // Run the tools activation method in its own class.
     291            Multitool_Maintenance_Mode_Tool::activate();
     292           
     293            Multitool_Admin_Notices::add_custom_notice( 'maintenancemodeactivate', __( 'You have activated Maintenance Mode. None of your visitors will be able to see your sites pages or theme until your switch it off manually.', 'multitool' ) );
     294            wp_safe_redirect( admin_url( 'tools.php?page=multitool-quick' ) );           
     295           
     296        } elseif( $tool_parameters_array['action'] == 'maintenanceoff' ) {                 
     297            Multitool_Maintenance_Mode_Tool::disable();
     298        }
     299   
     300    }       
    160301}
    161302
  • multitool/trunk/includes/admin/class.multitool-admin-settings.php

    r1662640 r1681536  
    5858
    5959            $settings[] = include( 'settings/class.multitool-security-tools.php' );
     60            //$settings[] = include( 'settings/class.multitool-plugin-tools.php' );
     61            $settings[] = include( 'settings/class.multitool-developer-tools.php' );
    6062            $settings[] = include( 'settings/class.multitool-plugin-settings.php' );
     63           
    6164           
    6265            self::$settings = apply_filters( 'multitool_get_settings_pages', $settings );
  • multitool/trunk/includes/admin/mainviews/class.multitool-listtable-quicktools.php

    r1662640 r1681536  
    5151        $quick_tools = new Multitool_QuickTools();
    5252        $quick_tools->return_tool_info = true;
    53        
    5453        $tools_info_array = array();
     54        $tool_parameters_array = array();
    5555       
    5656        foreach( get_class_methods( 'Multitool_QuickTools' ) as $tool ) {
    5757            if( substr( $tool, 0, 5 ) !== "tool_" ) { continue; }
    58             eval( '$tool_info = $quick_tools->$tool();');
     58            eval( '$tool_info = $quick_tools->$tool( $tool_parameters_array );');
    5959           
    6060            // Capability check.
     
    9595    public function output_result() {
    9696        $this->prepare_items();
    97         echo '<div id="poststuff" class="multitool-reports-wide">';
     97        echo '<div id="poststuff" class="multitool-tables-wide">';
    9898        echo '<form id="multitool-list-table-form-quicktools" method="post">';
    9999        $this->display();
     
    131131           
    132132                $nonce = wp_create_nonce( 'quicktool_action' );
    133                 $url   = self_admin_url( 'tools.php?page=multitool-quick&_wpnonce=' . $nonce . '&toolname=' . $item['name'] );   
    134                 echo '<a href="' . $url . '" class="button button-primary">' . __( 'Run Tool', 'multitool' ) . '</a>';
    135                    
     133               
     134                // Establish single (default) or multiple action tools.
     135                if( !isset( $item['actions'] ) || !is_array( $item['actions'] ) ) {
     136                    $url   = self_admin_url( 'tools.php?page=multitool-quick&_wpnonce=' . $nonce . '&toolname=' . $item['name'] );   
     137                    echo '<a href="' . $url . '" class="button button-primary">' . __( 'Run Tool', 'multitool' ) . '</a>';
     138                } else {
     139                    $i = 0;
     140                    foreach( $item['actions'] as $action => $attributes ) {
     141                        if( $i > 0 ) { echo '<br><br>'; }
     142                        $url   = self_admin_url( 'tools.php?page=multitool-quick&_wpnonce=' . $nonce . '&toolname=' . $item['name'] . '&action=' . $action );   
     143                        echo '<a href="' . $url . '" class="button button-primary">' . $attributes['title'] . '</a>'; 
     144                        ++$i;
     145                    }   
     146                }
     147               
    136148            break;
    137149
  • multitool/trunk/includes/admin/mainviews/class.multitool-quicktools-all.php

    r1662640 r1681536  
    1313 * @author      Ryan Bayne
    1414 * @category    Admin
    15  * @package     Multitool/Admin/Reports
     15 * @package     Multitool/Admin
    1616 * @version     1.0.0
    1717 */
  • multitool/trunk/includes/admin/mainviews/class.multitool-quicktools-new.php

    r1662640 r1681536  
    1313 * @author      Ryan Bayne
    1414 * @category    Admin
    15  * @package     Multitool/Admin/Reports
     15 * @package     Multitool/Admin
    1616 * @version     1.0.0
    1717 */
  • multitool/trunk/includes/admin/mainviews/class.multitool-quicktools-updated.php

    r1662640 r1681536  
    1313 * @author      Ryan Bayne
    1414 * @category    Admin
    15  * @package     Multitool/Admin/Reports
     15 * @package     Multitool/Admin
    1616 * @version     1.0.0
    1717 */
  • multitool/trunk/includes/admin/settings/class.multitool-plugin-settings.php

    r1662640 r1681536  
    102102            ));
    103103        } else {
    104             $settings = apply_filters( 'multitool_checkboxesexamples_general_settings', array(
     104            $settings = apply_filters( 'multitool_general_settings', array(
    105105 
    106106                array(
     
    146146                ),
    147147
     148                array(
     149                    'title' => __( 'Listener Controls', 'multitool' ),
     150                    'type'     => 'title',
     151                    'desc'     => __( 'Listeners are parts of the plugin that decide what tools to run anytime a page is loaded. Switching listeners off will switch off any tools that depend on them. Those are tools that are automated.', 'multitool' ),
     152                    'id'     => 'multitool_listener_control_settings',
     153                ),
     154
     155                array(
     156                    'title'           => __( 'Listener Switches', 'multitool' ),
     157                    'desc'            => __( 'Main Listener Switch', 'multitool' ),
     158                    'id'              => 'multitool_main_listener_switch',
     159                    'default'         => 'yes',
     160                    'type'            => 'checkbox',
     161                    'checkboxgroup'   => 'start',
     162                    'show_if_checked' => 'option',
     163                    'autoload'        => true,
     164                ),
     165
     166                array(
     167                    'desc'            => __( 'Public Listener Switch', 'multitool' ),
     168                    'id'              => 'multitool_public_listener_switch',
     169                    'default'         => 'yes',
     170                    'type'            => 'checkbox',
     171                    'checkboxgroup'   => '',
     172                    'show_if_checked' => 'yes',
     173                    'autoload'        => true,
     174                ),
     175
     176                array(
     177                    'desc'            => __( 'Admin Listener Switch', 'multitool' ),
     178                    'id'              => 'multitool_admin_listener_switch',
     179                    'default'         => 'yes',
     180                    'type'            => 'checkbox',
     181                    'checkboxgroup'   => 'end',
     182                    'show_if_checked' => 'yes',
     183                    'autoload'        => true,
     184                ),
     185                                   
     186                array(
     187                    'type'     => 'sectionend',
     188                    'id'     => 'multitool_listener_control_settings'
     189                ),               
    148190            ));
    149191        }
  • multitool/trunk/includes/admin/settings/class.multitool-security-tools.php

    r1662640 r1681536  
    1616
    1717/**
    18  * Multitool_Settings_Example.
     18 * Multitool_Security_Tools.
    1919 */
    2020class Multitool_Security_Tools extends Multitool_Settings_Page {
     
    4040    public function get_settings() {
    4141
    42         $settings = apply_filters( 'multitool_example_settings', array(
     42        $settings = apply_filters( 'multitool_security_tools_settings', array(
    4343
    4444            array( 'title' => __( 'Administrator Accounts Cap', 'multitool' ),
     
    8585            ),
    8686                                   
    87             array( 'type' => 'sectionend', 'id' => 'multitool_configtool_adminaccountscap'),
     87            array(
     88                'type' => 'sectionend',
     89                'id' => 'multitool_configtool_adminaccountscap'),
    8890           
    8991        ) );
  • multitool/trunk/includes/class.multitool-logger.php

    r1662640 r1681536  
    33 * Multitool - Primary Logging Interface
    44 *
    5  * This class is not final. There is a task in the projects Trello for
     5 * This class is not final. There is a task in the projects GitHub issues for
    66 * version 2.0 which details a far better log and trace system.
    77 *
  • multitool/trunk/includes/class.multitool-options.php

    r1662640 r1681536  
    1010 * by the main installation class and so we will visit this class later, removing
    1111 * any redundent code.
    12  *
    13  * @todo Once WP Seed is released, consider removing installation related methods. 
    14  *
     12 * \
    1513 * @author   Ryan Bayne
    1614 * @category Configuration
  • multitool/trunk/includes/functions.multitool-core.php

    r1662640 r1681536  
    112112
    113113    return '<span class="multitool-help-tip" data-tip="' . $tip . '"></span>';
    114 }
     114}                 
    115115
    116116/**
     
    166166    return $userIDs;
    167167}
     168
     169/**
     170 * What type of request is this?
     171 *
     172 * Functions and constants are WordPress core. This function will allow
     173 * you to avoid large operations or output at the wrong time.
     174 *
     175 * @param  string $type admin, ajax, cron or frontend.
     176 * @return bool
     177 */
     178function multitool_is_request( $type ) {
     179    switch ( $type ) {
     180        case 'admin' :
     181            return is_admin();
     182        case 'ajax' :
     183            return defined( 'DOING_AJAX' );
     184        case 'cron' :
     185            return defined( 'DOING_CRON' );
     186        case 'frontend' :
     187            return ( ! is_admin() || defined( 'DOING_AJAX' ) ) && ! defined( 'DOING_CRON' );
     188    }
     189}
  • multitool/trunk/multitool.php

    r1662640 r1681536  
    55 * Github URI: https://github.com/ryanbayne/multitool
    66 * Description: The Swiss-Army-Plugin for WordPress.
    7  * Version: 1.2.0
     7 * Version: 1.2.1
    88 * Author: Ryan Bayne
    99 * Author URI: https://multitool.wordpress.com/
    1010 * Requires at least: 4.4
    11  * Tested up to: 4.7
     11 * Tested up to: 4.8
    1212 * License: GPL3
    1313 * License URI: http://www.gnu.org/licenses/gpl-3.0.txt
     
    3939     * @var string
    4040     */
    41     public $version = '1.2.0';
     41    public $version = '1.2.1';
    4242
    4343    /**
     
    153153        if ( ! defined( 'MULTITOOL_FORUM' ) ) { define( 'MULTITOOL_FORUM', 'https://multitool.slack.com/' ); }
    154154        if ( ! defined( 'MULTITOOL_TWITTER' ) ) { define( 'MULTITOOL_TWITTER', false ); }
    155         if ( ! defined( 'MULTITOOL_TRELLO' ) ) { define( 'MULTITOOL_TRELLO', 'https://trello.com/b/aFGDfb8T/wp-multitool' ); }
    156155        if ( ! defined( 'MULTITOOL_DONATE' ) ) { define( 'MULTITOOL_DONATE', 'https://www.patreon.com/ryanbayne' ); }
    157156        if ( ! defined( 'MULTITOOL_SKYPE' ) ) { define( 'MULTITOOL_SKYPE', 'https://join.skype.com/bVtDaGHd9Nnl' ); }
     
    166165        if ( ! defined( 'MULTITOOL_AUTHOR_FORUM' ) ) { define( 'MULTITOOL_AUTHOR_FORUM', false ); }
    167166        if ( ! defined( 'MULTITOOL_AUTHOR_TWITTER' ) ) { define( 'MULTITOOL_AUTHOR_TWITTER', 'http://www.twitter.com/Ryan_R_Bayne' ); }
    168         if ( ! defined( 'MULTITOOL_AUTHOR_TRELLO' ) ) { define( 'MULTITOOL_AUTHOR_TRELLO', 'https://trello.com/ryanrbayne1' ); }
    169167        if ( ! defined( 'MULTITOOL_AUTHOR_FACEBOOK' ) ) { define( 'MULTITOOL_AUTHOR_FACEBOOK', 'https://www.facebook.com/ryanrbayne' ); }
    170168        if ( ! defined( 'MULTITOOL_AUTHOR_DONATE' ) ) { define( 'MULTITOOL_AUTHOR_DONATE', 'https://www.patreon.com/ryanbayne' ); }
     
    189187        include_once( 'includes/class.multitool-configurationtools.php' );
    190188       
    191         if ( $this->is_request( 'admin' ) ) {
     189        if ( multitool_is_request( 'admin' ) ) {
    192190            include_once( 'includes/admin/class.multitool-admin.php' );
    193191        }
    194192
    195         if ( $this->is_request( 'frontend' ) ) {
     193        if ( multitool_is_request( 'frontend' ) ) {
    196194            $this->frontend_includes();
    197195        }
     196
     197        // Create listener objects if switches are set to 'yes'.
     198        if( get_option( 'multitool_main_listener_switch' ) == 'yes' ) {         
     199            include_once( 'includes/class.multitool-listener.php' );       
     200        }
    198201    }
    199202
     
    211214        // Before init action.
    212215        do_action( 'before_multitool_init' );
    213 
     216           
    214217        // Init action.
    215218        do_action( 'multitool_init' );
     
    238241    public function ajax_url() {               
    239242        return admin_url( 'admin-ajax.php', 'relative' );
    240     }
    241 
    242     /**
    243      * What type of request is this?
    244      *
    245      * Functions and constants are WordPress core. This function will allow
    246      * you to avoid large operations or output at the wrong time.
    247      *
    248      * @param  string $type admin, ajax, cron or frontend.
    249      * @return bool
    250      */
    251     private function is_request( $type ) {
    252         switch ( $type ) {
    253             case 'admin' :
    254                 return is_admin();
    255             case 'ajax' :
    256                 return defined( 'DOING_AJAX' );
    257             case 'cron' :
    258                 return defined( 'DOING_CRON' );
    259             case 'frontend' :
    260                 return ( ! is_admin() || defined( 'DOING_AJAX' ) ) && ! defined( 'DOING_CRON' );
    261         }
    262     }   
     243    }
    263244}
    264 
     245       
    265246endif;
    266247
     
    280261    // Global for backwards compatibility.
    281262    $GLOBALS['multitool'] = GlobalMultitool();
    282    
    283     //$multitool_debug = new Multitool_Debug();
    284     //$multitool_debug->debugmode();   
    285263}
    286264
  • multitool/trunk/readme.txt

    r1662640 r1681536  
    66Tags: Seed, Grow, Template Plugin, Extensions, Core Plugin, Extendable, Extend
    77Requires at least: 4.2
    8 Tested up to: 4.7
    9 Stable tag: 1.2.0   
     8Tested up to: 4.8
     9Stable tag: 1.2.1   
    1010               
    1111Multitool is the Swiss-Army-Plugin for WordPress.
     
    3535= Support =
    3636
    37 This project is supported.
     37This project is supported with live chat, forums, community patrons with monthly donations and free development.
    3838
    3939- [GitHub](https://github.com/ryanbayne/multitool)
     
    4141- [Discord Live Chat](https://discord.gg/xBNYA7Q)
    4242- [Report Issues](https://github.com/RyanBayne/Multitool/issues)
    43 - [Submit Ideas](https://trello.com/b/PEkkYDAJ/multitool)
    44 - [View Roadmap](https://trello.com/b/PEkkYDAJ/multitool)
    4543- [Blog](https://multitool.wordpress.com/)
    46                                                                                          
    47 = Contribute =
    48 
    49 Please become a Patreon(.com) to support this project and increase the rate of updates.
    50 
    51 * <a href="https://www.patreon.com/ryanbayne" title="">Patreon (preffered)</a>         
    52 
    53 = Social & Professional Networking =
    54 
    55 Connect with Ryan on any website you need more contacts on. If it's not in this list just ask for the link.
    56                                      
    57 - [LinkedIn](https://www.linkedin.com/in/ryanrbayne/)
    58 - [Facebook](https://facebook.com/ryanrbayne)
    59 - [Twitter](https://twitter.com/ryanrbayne)
     44- [Donate](https://www.patreon.com/ryanbayne/)                 
     45- [Authors LinkedIn](https://www.linkedin.com/in/ryanrbayne/)
     46- [Authors Facebook](https://facebook.com/ryanrbayne)
     47- [Authors Twitter](https://twitter.com/ryanrbayne)
    6048
    6149== Installation ==
     
    6856
    6957= Can I hire you to customize the plugin for me? =
    70 Yes, you can hire me for urgent work otherwise post your request in the projects Trello board or GitHub.
     58Yes, you can hire me for a very small fee because I know the plugin well and can upgrade it quicker than anyone else.
    7159
    7260== Screenshots ==
     
    8674== Changelog ==
    8775
    88 = 1.2.0 on TBC =
     76= 1.2.1 released 19th June 2017 =
     77* GEN -> All use of Trello removed.
     78* GEN -> multitool_example_settings renamed to multitool_security_tools_settings
     79* NEW -> Display Error tool added to Quick Tools
     80* NEW -> Maintenance Mode tool added, display the old "Under Construction" to all visitors.
     81* DEV -> New methods in notice class: notice(), error(), warning(), success(), info()
     82* DEV -> Tools can now exist on both Quick Tools and Configuration Tools views.
     83
     84= 1.2.0 =
    8985* NEW -> Plugin re-built from scratch.
    9086* NEW -> Quick Tools table (more tools coming soon)
     
    10399* M. Alsup
    104100* Amir-Hossein Sobhi
     101* Thomas Griffin
     102* Gary Jones
     103* Juliette Reinders Folmer
    105104
    106105== Version Numbers Explained ==
Note: See TracChangeset for help on using the changeset viewer.