"; _e( "JetPack's Photon module breaks features built in WP Retina 2x (as Photos moves the files away). A common and better alternative to Photon is to use MaxCDN (very popular), CloudFlare or Fastly.", 'wp-retina-2x' ); echo "
"; } } static function activate() { global $wp_rewrite; $wp_rewrite->flush_rules(); } static function deactivate() { remove_filter( 'generate_rewrite_rules', array( 'Meow_WR2X_Admin', 'generate_rewrite_rules' ) ); global $wp_rewrite; $wp_rewrite->flush_rules(); } static function generate_rewrite_rules( $wp_rewrite, $flush = false ) { global $wp_rewrite; $method = get_option( "wr2x_method" ); if ( $method == "Retina-Images" ) { // MODIFICATION: docwhat // get_home_url() -> trailingslashit(site_url()) // REFERENCE: http://wordpress.org/support/topic/plugin-wp-retina-2x-htaccess-generated-with-incorrect-rewriterule // MODIFICATION BY h4ir9 // .*\.(jpg|jpeg|gif|png|bmp) -> (.+.(?:jpe?g|gif|png)) // REFERENCE: http://wordpress.org/support/topic/great-but-needs-a-little-update $handlerurl = str_replace( trailingslashit( site_url()), '', plugins_url( 'wr2x_image.php', __FILE__ ) ); add_rewrite_rule( '(.+.(?:jpe?g|gif|png))', $handlerurl, 'top' ); } if ( $flush == true ) { $wp_rewrite->flush_rules(); } } function common_url( $file ) { return trailingslashit( plugin_dir_url( __FILE__ ) ) . 'common/' . $file; } function app_menu() { // SUBMENU > Settings add_submenu_page( 'meowapps-main-menu', 'Retina', 'Retina', 'manage_options', 'wr2x_settings-menu', array( $this, 'admin_settings' ) ); // SUBMENU > Settings > Basic Settings add_settings_section( 'wr2x_settings', null, null, 'wr2x_settings-menu' ); add_settings_field( 'wr2x_ignore_sizes', __( "Disabled Sizes", 'wp-retina-2x' ), array( $this, 'admin_ignore_sizes_callback' ), 'wr2x_settings-menu', 'wr2x_settings' ); add_settings_field( 'wr2x_method', __( "Method", 'wp-retina-2x' ), array( $this, 'admin_method_callback' ), 'wr2x_settings-menu', 'wr2x_settings' ); add_settings_field( 'wr2x_full_size', __( "Full Size Retina", 'wp-retina-2x' ) . "" . __( "Current method:", 'wp-retina-2x' ) . " " . __( "HTML Rewrite", 'wp-retina-2x' ) . "."; if ( $method == 'retina.js' ) echo "
" . __( "Current method:", 'wp-retina-2x' ) . " " . __( "Retina.js", 'wp-retina-2x' ) . "."; if ( $method == 'Picturefill' ) echo "
" . __( "Current method:", 'wp-retina-2x' ) . " " . __( "PictureFill", 'wp-retina-2x' ) . "."; if ( $method == 'Responsive' ) echo "
" . __( "Current method:", 'wp-retina-2x' ) . " " . __( "Responsive Images", 'wp-retina-2x' ) . "."; if ( $method == 'Retina-Images' ) { echo "
" . __( "Current method:", 'wp-retina-2x' ) . " " . __( "HTML Rewrite", 'wp-retina-2x' ) . "."; if ( defined( 'MULTISITE' ) && MULTISITE == true ) { if ( get_site_option( 'ms_files_rewriting' ) ) { // MODIFICATION: Craig Foster // 'ms_files_rewriting' support echo " " . __( "By the way, you are using a WordPress Multi-Site installation! You must edit your .htaccess manually and add 'RewriteRule ^files/(.+) wp-content/plugins/wp-retina-2x/wr2x_image.php?ms=true&file=$1 [L]' as the first RewriteRule if you want the server-side to work.", 'wp-retina-2x' ) . ""; } else echo " " . __( "By the way, you are using a WordPress Multi-Site installation! You must edit your .htaccess manually and add 'RewriteRule ^(wp-content/.+\.(png|gif|jpg|jpeg|bmp|PNG|GIF|JPG|JPEG|BMP)) wp-content/plugins/wp-retina-2x/wr2x_image.php?ms=true&file=$1 [L]' as the first RewriteRule if you want the server-side to work.", 'wp-retina-2x' ) . ""; } echo "
"; if ( !get_option('permalink_structure') ) echo "" . __( "The permalinks are not enabled. They need to be enabled in order to use the server-side method.", 'wp-retina-2x' ) . ""; } ?>