Plugin Directory

Changeset 1521054


Ignore:
Timestamp:
10/24/2016 12:04:16 PM (9 years ago)
Author:
omnisite
Message:

v1.1.0 | added options woo generator + canonical

Location:
remove-wp-overhead/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • remove-wp-overhead/trunk/assets/css/admin.css

    r1500279 r1521054  
     1#remove_wordpress_overhead_settings input[type=checkbox] {
     2    visibility: hidden;
     3}
     4
     5#remove_wordpress_overhead_settings .form-table a {
     6    text-decoration: none;
     7}
     8
     9.remove-wordpress-overhead_slide_selectall {
     10    height: 28px;
     11    margin-bottom: 20px;
     12    position: relative;
     13    line-height: 28px;
     14    padding-left: 10px;
     15}
     16
     17.remove-wordpress-overhead_slide_selectall label {
     18    cursor: pointer;
     19    position: absolute;
     20    width: 20px;
     21    height: 20px;
     22    left: 4px;
     23    top: 4px;
     24
     25    -webkit-box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,1);
     26    -moz-box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,1);
     27    box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,1);
     28
     29    background-color: #dcdada;
     30}
     31
     32.remove-wordpress-overhead_slide_selectall label:after {
     33    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
     34    filter: alpha(opacity=0);
     35    opacity: 0;
     36    content: '';
     37    position: absolute;
     38    width: 9px;
     39    height: 5px;
     40    background: transparent;
     41    top: 4px;
     42    left: 4px;
     43    border: 3px solid #81a919;
     44    border-top: none;
     45    border-right: none;
     46
     47    -webkit-transform: rotate(-45deg);
     48    -moz-transform: rotate(-45deg);
     49    -o-transform: rotate(-45deg);
     50    -ms-transform: rotate(-45deg);
     51    transform: rotate(-45deg);
     52}
     53
     54.remove-wordpress-overhead_slide_selectall label:hover::after {
     55    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";
     56    filter: alpha(opacity=30);
     57    opacity: 0.3;
     58}
     59
     60.remove-wordpress-overhead_slide_selectall input[type=checkbox]:checked + label:after {
     61    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
     62    filter: alpha(opacity=100);
     63    opacity: 1;
     64}
     65
     66.remove-wordpress-overhead_slide_checkbox {
     67    width: 80px;
     68    height: 26px;
     69    background: #dcdada;
     70
     71    -webkit-border-radius: 50px;
     72    -moz-border-radius: 50px;
     73    border-radius: 50px;
     74    position: relative;
     75
     76    -webkit-box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,0.2);
     77    -moz-box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,0.2);
     78    box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,0.2);
     79}
     80
     81.remove-wordpress-overhead_slide_checkbox:after {
     82    content: 'OFF';
     83    font: 12px/26px Arial, sans-serif;
     84    color: #940a0a;
     85    position: absolute;
     86    right: 10px;
     87    z-index: 0;
     88    font-weight: bold;
     89    text-shadow: 1px 1px 0px rgba(255,255,255,.15);
     90}
     91
     92.remove-wordpress-overhead_slide_checkbox:before {
     93    content: 'ON';
     94    font: 12px/26px Arial, sans-serif;
     95    color: #81a919;
     96    position: absolute;
     97    left: 10px;
     98    z-index: 0;
     99    font-weight: bold;
     100}
     101
     102.remove-wordpress-overhead_slide_checkbox label {
     103    display: block;
     104    width: 34px;
     105    height: 20px;
     106
     107    -webkit-border-radius: 50px;
     108    -moz-border-radius: 50px;
     109    border-radius: 50px;
     110
     111    -webkit-transition: all .4s ease;
     112    -moz-transition: all .4s ease;
     113    -o-transition: all .4s ease;
     114    -ms-transition: all .4s ease;
     115    transition: all .4s ease;
     116    cursor: pointer;
     117    position: absolute;
     118    top: 3px;
     119    left: 3px;
     120    z-index: 1;
     121
     122    -webkit-box-shadow: 0px 2px 5px 0px rgba(0,0,0,0.3);
     123    -moz-box-shadow: 0px 2px 5px 0px rgba(0,0,0,0.3);
     124    box-shadow: 0px 2px 5px 0px rgba(0,0,0,0.3);
     125    background: #fcfff4;
     126
     127    background: -webkit-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
     128    background: -moz-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
     129    background: -o-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
     130    background: -ms-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
     131    background: linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
     132    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcfff4', endColorstr='#b3bead',GradientType=0 );
     133}
     134
     135.remove-wordpress-overhead_slide_checkbox input[type=checkbox]:checked + label {
     136    left: 43px;
     137}
  • remove-wp-overhead/trunk/assets/js/admin.js

    r1500279 r1521054  
    11jQuery( document ).ready( function ( e ) {
    2    
     2    var remove_wordpress_overhead_checked_all = false;
     3    jQuery( '#remove_wordpress_overhead_selectall' ).click( function() {
     4        if ( !remove_wordpress_overhead_checked_all ) {
     5            jQuery('#remove_wordpress_overhead_settings td input').prop('checked', true);
     6            remove_wordpress_overhead_checked_all = true;
     7        } else {
     8            jQuery('#remove_wordpress_overhead_settings td input').prop('checked', false);
     9            remove_wordpress_overhead_checked_all = false;
     10        }
     11    } );
    312});
  • remove-wp-overhead/trunk/assets/js/admin.min.js

    r1500279 r1521054  
    1 jQuery(document).ready(function(){});
     1jQuery(document).ready(function(a){var b=!1;jQuery("#remove_wordpress_overhead_selectall").click(function(){b?(jQuery("#remove_wordpress_overhead_settings td input").prop("checked",!1),b=!1):(jQuery("#remove_wordpress_overhead_settings td input").prop("checked",!0),b=!0)})});
  • remove-wp-overhead/trunk/includes/class-remove-wordpress-overhead-settings.php

    r1500279 r1521054  
    11<?php
     2namespace Remove_Wordpress_Overhead;
     3use Remove_Wordpress_Overhead\Remove_Wordpress_Overhead_Settings;
    24
    35if ( ! defined( 'ABSPATH' ) ) exit;
     
    110112        $settings['standard'] = array(
    111113            'title'                 => __( 'Settings', 'remove-wordpress-overhead' ),
    112             'description'           => __( 'Check the boxes to remove stuff and keep your HTML and WP clean.', 'remove-wordpress-overhead' ),
     114            'description'           => __( 'Check the boxes to remove stuff and keep your HTML and WP clean and website fast.', 'remove-wordpress-overhead' ),
    113115            'fields'                => array(
    114116                array(
    115117                    'id'            => 'remove_rsd_link',
    116                     'label'         => __( 'Remove RSD Link', 'remove-wordpress-overhead' ),
     118                    'label'         => __( 'Remove RSD / EditURI Link <a href="https://en.wikipedia.org/wiki/Really_Simple_Discovery" target="_blank"><i class="dashicons dashicons-editor-help"></i></a>', 'remove-wordpress-overhead' ),
    117119                    'description'   => __( '&lt;link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://www.site.com/xmlrpc.php?rsd" /&gt;', 'remove-wordpress-overhead' ),
    118120                    'type'          => 'checkbox',
     
    121123                array(
    122124                    'id'            => 'remove_wlwmanifest_link',
    123                     'label'         => __( 'Remove WLW Manifest Link', 'remove-wordpress-overhead' ),
     125                    'label'         => __( 'Remove WLW Manifest Link <a href="https://msdn.microsoft.com/en-us/library/bb463265.aspx" target="_blank"><i class="dashicons dashicons-editor-help"></i></a>', 'remove-wordpress-overhead' ),
    124126                    'description'   => __( '&lt;link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://www.site.com/wp-includes/wlwmanifest.xml" /&gt;', 'remove-wordpress-overhead' ),
    125127                    'type'          => 'checkbox',
     
    128130                array(
    129131                    'id'            => 'remove_rss_feed_links',
    130                     'label'         => __( 'Remove RSS Feed Links', 'remove-wordpress-overhead' ),
     132                    'label'         => __( 'Remove RSS Feed Links <a href="https://en.wikipedia.org/wiki/RSS" target="_blank"><i class="dashicons dashicons-editor-help"></i></a>', 'remove-wordpress-overhead' ),
    131133                    'description'   => __( '&lt;link rel="alternate" type="application/rss+xml" title="Site name &raquo; (Comments) Feed" href="http://www.site.com/(comments)/feed" /&gt;', 'remove-wordpress-overhead' ),
    132134                    'type'          => 'checkbox',
     
    135137                array(
    136138                    'id'            => 'remove_next_prev_links',
    137                     'label'         => __( 'Remove Next &amp; Prev Post Links', 'remove-wordpress-overhead' ),
     139                    'label'         => __( 'Remove Next &amp; Prev Post Links <a href="https://support.google.com/webmasters/answer/1663744?hl=en" target="_blank"><i class="dashicons dashicons-editor-help"></i></a>', 'remove-wordpress-overhead' ),
    138140                    'description'   => __( '&lt;link rel="prev|prev" title="Some Post Title" href="http://www.site.com/some-slug/" /&gt;', 'remove-wordpress-overhead' ),
    139141                    'type'          => 'checkbox',
     
    142144                array(
    143145                    'id'            => 'remove_shortlink',
    144                     'label'         => __( 'Remove Shortlink URL', 'remove-wordpress-overhead' ),
    145                     'description'   => __( '&lt;link rel="shortlink" href="http://www.site.com/some-slug/" /&gt;', 'remove-wordpress-overhead' ),
    146                     'type'          => 'checkbox',
    147                     'default'       => ''
    148                 ),
    149                 array(
    150                     'id'            => 'remove_shortlink',
    151                     'label'         => __( 'Remove Shortlink URL', 'remove-wordpress-overhead' ),
     146                    'label'         => __( 'Remove Shortlink URL <a href="http://microformats.org/wiki/rel-shortlink" target="_blank"><i class="dashicons dashicons-editor-help"></i></a>', 'remove-wordpress-overhead' ),
    152147                    'description'   => __( '&lt;link rel="shortlink" href="http://www.site.com/some-slug/" /&gt;', 'remove-wordpress-overhead' ),
    153148                    'type'          => 'checkbox',
     
    170165                array(
    171166                    'id'            => 'disable_wp_emojicons',
    172                     'label'         => __( 'Disable WP Emojicons', 'remove-wordpress-overhead' ),
     167                    'label'         => __( 'Disable WP Emoji <a href="https://en.support.wordpress.com/emoji/" target="_blank"><i class="dashicons dashicons-editor-help"></i></a>', 'remove-wordpress-overhead' ),
    173168                    'description'   => __( 'Emoji CSS styles and javascript in header', 'remove-wordpress-overhead' ),
    174169                    'type'          => 'checkbox',
     
    178173                    'id'            => 'disable_json_api',
    179174                    'label'         => __( 'Disable JSON API', 'remove-wordpress-overhead' ),
    180                     'description'   => __( '&lt;link rel="https://api.w.org/" href="http://www.site.com/wp-json/"" /&gt;', 'remove-wordpress-overhead' ),
     175                    'description'   => __( '&lt;link rel="https://api.w.org/" href="http://www.site.com/wp-json/" /&gt;', 'remove-wordpress-overhead' ),
     176                    'type'          => 'checkbox',
     177                    'default'       => ''
     178                ),
     179                array(
     180                    'id'            => 'remove_canonical',
     181                    'label'         => __( 'Remove Canonical URL <a href="https://support.google.com/webmasters/answer/139066?hl=en"><i class="dashicons dashicons-editor-help"></i></a>', 'remove-wordpress-overhead' ),
     182                    'description'   => __( '&lt;link rel="canonical" href="http://www.site.com/some-url" /&gt;', 'remove-wordpress-overhead' ),
     183                    'type'          => 'checkbox',
     184                    'default'       => ''
     185                ),
     186                array(
     187                    'id'            => 'remove_woo_generator',
     188                    'label'         => __( 'Remove WooCommerce Generator Meta', 'remove-wordpress-overhead' ),
     189                    'description'   => __( '&lt;meta name="generator" content="WooCommerce x.x.x" /&gt;', 'remove-wordpress-overhead' ),
    181190                    'type'          => 'checkbox',
    182191                    'default'       => ''
     
    184193                array(
    185194                    'id'            => 'disable_wp_widgets',
    186                     'label'         => __( 'WP Widgets', 'remove-wordpress-overhead' ),
    187                     'description'   => __( '---<br>Check which widgets you want to disable', 'remove-wordpress-overhead' ),
     195                    'label'         => __( 'WP Widgets<br><small>Check which widgets you want to disable</small>', 'remove-wordpress-overhead' ),
     196                    'description'   => __( 'Check which widgets you want to disable', 'remove-wordpress-overhead' ),
    188197                    'type'          => 'checkbox_multi',
    189198                    'options'       => array( 'WP_Widget_Archives' => '1. Archives&nbsp;&nbsp;&nbsp;', 'WP_Widget_Calendar' => '2. Calendar&nbsp;&nbsp;&nbsp;', 'WP_Widget_Categories' => '3. Categories&nbsp;&nbsp;&nbsp;', 'WP_Widget_Links' => '4. Links&nbsp;&nbsp;&nbsp;', 'WP_Widget_Meta' => '5. Meta&nbsp;&nbsp;&nbsp;', 'WP_Nav_Menu_Widget' => '6. Nav Menu&nbsp;&nbsp;&nbsp;', 'WP_Widget_Pages' => '7. Pages&nbsp;&nbsp;&nbsp;', 'WP_Widget_Recent_Comments' => '8. Recent Comments&nbsp;&nbsp;&nbsp;', 'WP_Widget_Recent_Posts' => '9. Recent Posts&nbsp;&nbsp;&nbsp;', 'WP_Widget_RSS' => '10. RSS&nbsp;&nbsp;&nbsp;', 'WP_Widget_Search' => '11. Search&nbsp;&nbsp;&nbsp;', 'WP_Widget_Tag_Cloud' => '12. Tag Cloud&nbsp;&nbsp;&nbsp;', 'WP_Widget_Text' => '13. Text&nbsp;&nbsp;&nbsp;' )
     
    244253    public function settings_section ( $section ) {
    245254        $html = '<p> ' . $this->settings[ $section['id'] ]['description'] . '</p>' . "\n";
     255        $html .= '<div class="remove-wordpress-overhead_slide_selectall"><input type="checkbox" id="' . $this->parent->_token . '_selectall"></input><label for="' . $this->parent->_token . '_selectall"></label> Select all</div>';
    246256        echo $html;
    247257    }
  • remove-wp-overhead/trunk/includes/class-remove-wordpress-overhead.php

    r1500279 r1521054  
    11<?php
     2namespace Remove_Wordpress_Overhead;
     3use Remove_Wordpress_Overhead\Remove_Wordpress_Overhead;
    24
    35if ( ! defined( 'ABSPATH' ) ) exit;
     
    168170     */
    169171    public function admin_enqueue_styles ( $hook = '' ) {
    170         wp_register_style( $this->_token . '-admin', esc_url( $this->assets_url ) . 'css/admin.css', array(), $this->_version );
     172        wp_register_style( $this->_token . '-admin', esc_url( $this->assets_url ) . 'css/admin' . $this->script_suffix . '.css', array(), $this->_version );
    171173        wp_enqueue_style( $this->_token . '-admin' );
    172174    } // End admin_enqueue_styles ()
     
    282284            $options['emojicons'] = get_option( $this->_base . 'disable_wp_emojicons' );
    283285            $options['json_api'] = get_option( $this->_base . 'disable_json_api' );
     286            $options['canonical'] = get_option( $this->_base . 'remove_canonical' );
     287            $options['woo_generator'] = get_option( $this->_base . 'remove_woo_generator' );
    284288            $options['widgets'] = get_option( $this->_base . 'disable_wp_widgets' );
    285289            set_transient( $this->_base . 'transient_settings', $options );
     
    287291
    288292        // remove really simple discovery link
    289         if ( $options['rsd_link'] && 'on' == $options['rsd_link'] ) {
     293        if ( isset( $options['rsd_link'] ) && 'on' == $options['rsd_link'] ) {
    290294            remove_action('wp_head', 'rsd_link');
    291295        }
    292296
    293297        // remove wlwmanifest.xml (needed to support windows live writer)
    294         if ( $options['wlwmanifest'] && 'on' == $options['wlwmanifest'] ) {
     298        if ( isset( $options['wlwmanifest'] ) && 'on' == $options['wlwmanifest'] ) {
    295299            remove_action('wp_head', 'wlwmanifest_link');
    296300        }
    297301
    298302        // remove rss feed and exta feed links (make sure you add them in yourself if you are using as RSS service
    299         if ( $options['feed_links'] && 'on' == $options['feed_links'] ) {
     303        if ( isset( $options['feed_links'] ) && 'on' == $options['feed_links'] ) {
    300304            remove_action('wp_head', 'feed_links', 2);
    301305            remove_action('wp_head', 'feed_links_extra', 3);
     
    303307
    304308        // remove the next and previous post links
    305         if ( $options['next_prev'] && 'on' == $options['next_prev'] ) {
     309        if ( isset( $options['next_prev'] ) && 'on' == $options['next_prev'] ) {
    306310            remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0);
    307311            remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
     
    309313
    310314        // remove the shortlink url from header
    311         if ( $options['shortlink'] && 'on' == $options['shortlink'] ) {
     315        if ( isset( $options['shortlink'] ) && 'on' == $options['shortlink'] ) {
    312316            remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0 );
    313317        }
    314318
    315319        // remove wordpress generator version
    316         if ( $options['wp_generator'] && 'on' == $options['wp_generator'] ) {
    317             function wp_remove_version() {
    318                 return '';
    319             }
    320             add_filter('the_generator', 'wp_remove_version');
     320        if ( isset( $options['wp_generator'] ) && 'on' == $options['wp_generator'] ) {
     321            add_filter( 'the_generator', array( $this, 'wp_remove_version' ) );
    321322        }
    322323
    323324        // remove ver= after style and script links
    324         if ( $options['ver'] && 'on' == $options['ver'] ) {
    325             add_filter( 'style_loader_src', 'remove_ver_css_js', 9999 );
    326             add_filter( 'script_loader_src', 'remove_ver_css_js', 9999 );
    327 
    328             function remove_ver_css_js( $src ) {
    329                 if ( strpos( $src, 'ver=' ) ) {
    330                     $src = remove_query_arg( 'ver', $src );
    331                 }
    332                 return $src;
    333             }
     325        if ( isset( $options['ver'] ) && 'on' == $options['ver'] ) {
     326            add_filter( 'style_loader_src', array( $this, 'remove_ver_css_js' ), 9999 );
     327            add_filter( 'script_loader_src', array( $this, 'remove_ver_css_js' ), 9999 );
    334328        }
    335329
    336330        // remove emoji styles and script from header
    337         if ( $options['emojicons'] && 'on' == $options['emojicons'] ) {
    338             function disable_wp_emojicons() {
    339                 remove_action( 'admin_print_styles', 'print_emoji_styles' );
    340                 remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
    341                 remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
    342                 remove_action( 'wp_print_styles', 'print_emoji_styles' );
    343                 remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
    344                 remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
    345                 remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
    346                 add_filter( 'tiny_mce_plugins', 'disable_emojicons_tinymce' );
    347             }
    348 
    349             function disable_emojicons_tinymce( $plugins ) {
    350                 if ( is_array( $plugins ) ) {
    351                     return array_diff( $plugins, array( 'wpemoji' ) );
    352                 } else {
    353                     return array();
    354                 }
    355             }
    356 
    357             add_action( 'init', 'disable_wp_emojicons' );
     331        if ( isset( $options['emojicons'] ) && 'on' == $options['emojicons'] ) {
     332            add_action( 'init', array( $this, 'disable_wp_emojicons' ) );
    358333        }
    359334
    360335        // disable json api and remove link from header
    361         if ( $options['json_api'] && 'on' == $options['json_api'] ) {
     336        if ( isset( $options['json_api'] ) && 'on' == $options['json_api'] ) {
    362337            add_action( 'after_setup_theme', array( $this, 'remove_json_api' ) );
    363338            add_action( 'after_setup_theme', array( $this, 'disable_json_api' ) );
    364339        }
    365340
     341        // remove canonical link
     342        if ( isset( $options['canonical'] ) && 'on' == $options['canonical'] ) {
     343            remove_action('embed_head', 'rel_canonical');
     344            add_filter( 'wpseo_canonical', '__return_false' );
     345        }
     346
     347        // remove woocommerce generator version
     348        if ( isset( $options['woo_generator'] ) && 'on' == $options['woo_generator'] ) {
     349            remove_action( 'wp_head','wc_generator_tag' );
     350        }
     351
    366352        // disable wp widgets
    367         if ( $options['widgets'] && '' != $options['widgets'] && is_array( $options['widgets'] ) ) {
     353        if ( isset( $options['widgets'] ) && '' != $options['widgets'] && is_array( $options['widgets'] ) ) {
    368354            // unregister widgets
    369355            add_action('widgets_init', array( $this, 'unregister_default_widgets' ), 11);
     
    385371        remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );
    386372        remove_action( 'wp_head', 'wp_oembed_add_host_js' );
     373        remove_action( 'template_redirect', 'rest_output_link_header', 11, 0 );
    387374    }
    388375
     
    425412    }
    426413
     414    /**
     415     * Remove WP generator link
     416     * @access    public
     417     * @since     1.1.0
     418     * @return    void
     419     */
     420    public function wp_remove_version() {
     421        return '';
     422    }
     423
     424    /**
     425     * Remove version numbers at the end of css and js files
     426     * @access    public
     427     * @since     1.1.0
     428     * @return    void
     429     */
     430    public function remove_ver_css_js( $src ) {
     431        if ( strpos( $src, 'ver=' ) ) {
     432            $src = remove_query_arg( 'ver', $src );
     433        }
     434        return $src;
     435    }
     436
     437    /**
     438     * Disable WP emojicons
     439     * @access    public
     440     * @since     1.1.0
     441     * @return    void
     442     */
     443    public function disable_wp_emojicons() {
     444        remove_action( 'admin_print_styles', 'print_emoji_styles' );
     445        remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
     446        remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
     447        remove_action( 'wp_print_styles', 'print_emoji_styles' );
     448        remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
     449        remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
     450        remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
     451        add_filter( 'tiny_mce_plugins', array( $this, 'disable_emojicons_tinymce' ) );
     452    }
     453
     454    /**
     455     * Disable WP emojicons from TinyMCE
     456     * @access    public
     457     * @since     1.1.0
     458     * @return    void
     459     */
     460    public function disable_emojicons_tinymce( $plugins ) {
     461        if ( is_array( $plugins ) ) {
     462            return array_diff( $plugins, array( 'wpemoji' ) );
     463        } else {
     464            return array();
     465        }
     466    }
     467
    427468}
  • remove-wp-overhead/trunk/includes/lib/class-remove-wordpress-overhead-admin-api.php

    r1500279 r1521054  
    11<?php
     2namespace Remove_Wordpress_Overhead;
    23
    34if ( ! defined( 'ABSPATH' ) ) exit;
     
    104105                    $checked = 'checked="checked"';
    105106                }
    106                 $html .= '<input id="' . esc_attr( $field['id'] ) . '" type="' . esc_attr( $field['type'] ) . '" name="' . esc_attr( $option_name ) . '" ' . $checked . '/>' . "\n";
     107                $html .= '<div class="remove-wordpress-overhead_slide_checkbox"><input id="' . esc_attr( $field['id'] ) . '" type="' . esc_attr( $field['type'] ) . '" name="' . esc_attr( $option_name ) . '" ' . $checked . '/><label for="' . esc_attr( $field['id'] ) . '"></label></div>' . "\n";
    107108            break;
    108109
     
    113114                        $checked = true;
    114115                    }
    115                     $html .= '<label for="' . esc_attr( $field['id'] . '_' . $k ) . '" class="checkbox_multi"><input type="checkbox" ' . checked( $checked, true, false ) . ' name="' . esc_attr( $option_name ) . '[]" value="' . esc_attr( $k ) . '" id="' . esc_attr( $field['id'] . '_' . $k ) . '" /> ' . $v . '</label> ';
     116                    $html .= '<div class="remove-wordpress-overhead_slide_selectall"><input type="checkbox" ' . checked( $checked, true, false ) . ' name="' . esc_attr( $option_name ) . '[]" value="' . esc_attr( $k ) . '" id="' . esc_attr( $field['id'] . '_' . $k ) . '" /> ' . $v . '<label for="' . esc_attr( $field['id'] . '_' . $k ) . '"></label></div> ';
    116117                }
    117118            break;
  • remove-wp-overhead/trunk/includes/lib/class-remove-wordpress-overhead-post-type.php

    r1500279 r1521054  
    11<?php
     2namespace Remove_Wordpress_Overhead;
     3use Remove_Wordpress_Overhead\Remove_Wordpress_Overhead_Post_Type;
    24
    35if ( ! defined( 'ABSPATH' ) ) exit;
  • remove-wp-overhead/trunk/includes/lib/class-remove-wordpress-overhead-taxonomy.php

    r1500279 r1521054  
    11<?php
     2namespace Remove_Wordpress_Overhead;
     3use Remove_Wordpress_Overhead\Remove_Wordpress_Overhead_Taxonomy;
    24
    35if ( ! defined( 'ABSPATH' ) ) exit;
  • remove-wp-overhead/trunk/readme.txt

    r1500991 r1521054  
    55Requires at least: 3.9
    66Tested up to: 4.6
    7 Stable tag: 1.0.2
     7Stable tag: 1.1.0
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
    1010
    11 Remove overhead from the <head> HTML and disable widgets you don't use
     11Remove overhead from the <head> HTML, speed up your website and disable widgets you don't use
    1212
    1313== Description ==
    1414
    15 A standard WP installation contains many links in the head of your HTML and has standard widgets you might never use. You can now install this plugin and check the items you want to have removed. The saved options are cached for better performance.
     15A standard WP installation contains many links in the head of your HTML (which slow down your site) and has standard widgets you might never use. You can now install this plugin and check the items you want to have removed. The saved options are cached for better performance.
    1616
    1717Header items you can remove:
    18 * Remove RSD Link
     18* Remove RSD / EditURI Link
    1919* Remove WLW Manifest Link
    2020* Remove RSS Feed Links
     
    2323* Remove WP Generator Meta
    2424* Remove Version Numbers from Style and Script Links
    25 * Disable WP Emojicons
     25* Disable WP Emoji / emoticons
    2626* Disable JSON API
     27* Disable Canonical URL
     28* Remove WooCommerce Generator Meta
    2729
    2830You can disable the following widgets:
     
    5557== Changelog ==
    5658
     59= 1.1.0 =
     60* 2016-10-23
     61* ability to remove canonical url from header
     62* ability to remove WooCommerce generator tag from header
     63* add plugin git URL
     64* add "select all" op settings page
     65* namespace classes to avoid function name collisions
     66* add css sliders and checkboxes on settings page
     67* added info buttons on the settings page
     68
    5769= 1.0.2 =
    5870* 2016-09-23
  • remove-wp-overhead/trunk/remove-wordpress-overhead.php

    r1500996 r1521054  
    22/*
    33 * Plugin Name: Remove Wordpress Overhead
    4  * Version: 1.0.2
    5  * Plugin URI: http://www.omnisite.nl
     4 * Version: 1.1.0
     5 * Plugin URI: https://github.com/omnisite/WP-Plugin-Remove-Wordpress-Overhead
    66 * Description: Remove overhead from the <head> HTML and disable widgets you don't use
    77 * Author: Omnisite
     
    1919
    2020if ( ! defined( 'ABSPATH' ) ) exit;
     21
     22use Remove_Wordpress_Overhead\Remove_Wordpress_Overhead;
     23use Remove_Wordpress_Overhead\Remove_Wordpress_Overhead_Settings;
    2124
    2225// Load plugin class files
Note: See TracChangeset for help on using the changeset viewer.