Plugin Directory

Changeset 1890217


Ignore:
Timestamp:
06/09/2018 03:34:09 PM (8 years ago)
Author:
digitalarbyter
Message:

Added feature to disable http-requests

Location:
wp-tweaker/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-tweaker/trunk/readme.txt

    r1889173 r1890217  
    2121- Remove links to adjacent posts
    2222- Limit the stored Post-Revisions to a maximum of 5
     23- Disable automatic http-requests by Plugins & Themes
    2324
    2425All you need to do to control this features/functions is
     
    3940
    4041== Changelog ==
    41 1.0.1 07.06.18: Did some minor bugfixes and improvements
    42 1.0 03.06.18: Initial release
     421.1 09.06.18:
     43- Added feature "disable http-requests"
     441.0.1 07.06.18:
     45- Did some minor bugfixes and improvements
     461.0 03.06.18:
     47- Initial release
  • wp-tweaker/trunk/wp-tweaker.php

    r1889173 r1890217  
    88
    99Description: This slim plugin removes many (unneeded) standard features from WordPress to give your blog the ultimate performance boost! Currently you can disable 8 WordPress functions each with one mouse click.
    10 Version: 1.0.1
     10Version: 1.1
    1111Author: Olli Kluth
    12 Author URI:  https://digitalarbyter.de
     12Author URI:  https://blog-optimierung.de
    1313Plugin URI:  https://wordpress.org/plugins/wp-tweaker/
    1414
     
    24247: Angrenzende Links zu Posts im Header entfernen
    25258: Post-Revisionen auf 5 begrenzen
     269: Block http-requests by plugins/themes
    2627*/
    2728
     
    141142            'Limit Post-Revisions to 5',
    142143            array( $this, 'callback_wptweaker_setting_8' ),
     144            'my-setting-admin',
     145            'wptweaker_setting_section_id'
     146        );
     147        add_settings_field(
     148            'wptweaker_setting_9',
     149            'Disable automatic http-requests by Plugins & Themes',
     150            array( $this, 'callback_wptweaker_setting_9' ),
    143151            'my-setting-admin',
    144152            'wptweaker_setting_section_id'
     
    165173        if( isset( $wptweaker_input['wptweaker_setting_8'] ) )
    166174            $wptweaker_new_input['wptweaker_setting_8'] = absint( $wptweaker_input['wptweaker_setting_8'] );
     175        if( isset( $wptweaker_input['wptweaker_setting_9'] ) )
     176            $wptweaker_new_input['wptweaker_setting_9'] = absint( $wptweaker_input['wptweaker_setting_9'] );
    167177        return $wptweaker_new_input;
    168178    }
     
    266276             '<input type="radio" id="wptweaker_setting_8" name="wptweaker_settings[wptweaker_setting_8]" value="1" %s /> on ',
    267277             $this->wptweaker_options['wptweaker_setting_8'] == 1  ? "checked" : ''
     278             );
     279     }
     280
     281     public function callback_wptweaker_setting_9()
     282     {
     283         printf(
     284             '<input type="radio" id="wptweaker_setting_9" name="wptweaker_settings[wptweaker_setting_9]" value="0" %s /> off ',
     285             $this->wptweaker_options['wptweaker_setting_9'] == 0  ? "checked" : ''
     286             );
     287         printf(
     288             '<input type="radio" id="wptweaker_setting_9" name="wptweaker_settings[wptweaker_setting_9]" value="1" %s /> on ',
     289             $this->wptweaker_options['wptweaker_setting_9'] == 1  ? "checked" : ''
    268290             );
    269291     }
     
    319341}
    320342
     343function wptweaker_setting_9()
     344{
     345  add_filter( 'pre_http_request', '__return_true', 100 );
     346}
     347
    321348//Fire!
    322349$wptweaker_options=get_option('wptweaker_settings');
Note: See TracChangeset for help on using the changeset viewer.