Advertisement
keha76

DP Gzip Compression (WordPress Plugin)

Aug 20th, 2012
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.68 KB | None | 0 0
  1. <?php
  2. /*
  3. Plugin Name: DP Gzip Compression
  4. Plugin URI: http://www.designpalatset.se/
  5. Description: Speed up your site with gzip compression. There are no settings for this plugin, just activate it and you're good to go.
  6. Version: 1.0
  7. Author: Kenth 'keha76' Hagström <info@designpalatset.se>
  8. Author URI: http://www.designpalatset.se
  9. License: GPL
  10. Text Domain: dp-gzip
  11. Domain Path: /languages/
  12. */
  13.  
  14. /*
  15.     Copyright 2012 Kenth Hagström (email : info@designpalatset.se)
  16.  
  17.     This program is free software; you can redistribute it and/or modify
  18.     it under the terms of the GNU General Public License, version 2, as
  19.     published by the Free Software Foundation.
  20.  
  21.     This program is distributed in the hope that it will be useful,
  22.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  23.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  24.     GNU General Public License for more details.
  25.  
  26.     You should have received a copy of the GNU General Public License
  27.     along with this program; if not, write to the Free Software
  28.     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  29. */
  30.  
  31. /**
  32.  *    Enable GZIP Compression
  33.  *
  34.  *    @link http://php.net/ob_gzhandler
  35.  *    @return void
  36.  *    @author keha76
  37. **/
  38. function dp_enable_gzip_compression()
  39. {
  40.     ob_start( 'ob_gzhandler' );
  41. }
  42. add_action( 'init', 'dp_enable_gzip_compression' );
  43.  
  44. /**
  45.  *    Load the textdomain used for localization
  46.  *
  47.  *    @return void
  48.  *    @author keha76
  49. **/
  50. function dp_load_textdomain()
  51. {
  52.     load_plugin_textdomain( 'dp-gzip', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
  53. }
  54. add_action( 'plugins_loaded', 'dp_load_textdomain' );
  55. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement