Changeset 829676
- Timestamp:
- 12/29/2013 07:10:24 AM (11 years ago)
- Location:
- wp-resized-image-quality/trunk
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-resized-image-quality/trunk/readme.txt
r826421 r829676 4 4 Requires at least: 3.1 5 5 Tested up to: 3.8.0 6 Stable tag: 2.1 6 Stable tag: 2.1 7 7 8 8 Get better uploaded quality or save bandwidth: Change the JPEG compression-level of uploaded images and thumbnails. … … 39 39 40 40 41 = What about PNG and GIF images? =41 = What about PNG and GIF images? = 42 42 43 43 WordPress doesn't currently support PNG compression internally (none at all). There are other image-handling plugins that compress PNGs and GIFs, but they either require server-side tools or a 3rd-party service. For a Plugin using server-side tools, try 'EWWW Image Optimizer'. For a Plugin using a 3rd-party service, try 'WP Smush.it'. … … 54 54 55 55 56 = Does this plugin compress PNG files? =57 58 No, it doesn't. All the PNG compression tools I've found aren't standard on most servers. You would need root access and a more-complicated plugin to get PNG compression working.59 60 61 56 62 57 == Screenshots == … … 66 61 67 62 == Changelog == 63 64 65 68 66 69 67 = 2.1 = -
wp-resized-image-quality/trunk/wp-resized-image-quality.php
r826421 r829676 4 4 Plugin URI: http://www.etchsoftware.com/#how-do-i-get-in-touch 5 5 Description: Change the compression-level of uploaded images and thumbnails. Get better image quality or save bandwidth. 6 Version: 2.1 6 Version: 2.1 7 7 Author: Mike Bijon, Etch Software 8 Author URI: http://www.mbijon.com /about8 Author URI: http://www.mbijon.com 9 9 License: GPLv2 10 10 … … 50 50 * Version # of WP-Resized-Image-Quality 51 51 */ 52 const RIQ_PLUGIN_VERSION = '2. 0';52 const RIQ_PLUGIN_VERSION = '2.'; 53 53 54 54 /** … … 128 128 129 129 if ( $hook == 'options-media.php' || $hook == 'settings_page_riq-admin' ) { 130 130 131 // JS 131 132 wp_enqueue_script( 'jquery-ui-slider' ); … … 148 149 149 150 // Security: Check WP nonce to prevent external use 150 if ( ! empty( $_POST['riq-integer'] ) && check_admin_referer( 'riq_update_admin_options', 'riq_admin_nonce' ) ) { 151 if ( ! empty( $_POST['riq-defaults'] ) && 'Reset to Default' == $_POST['riq-defaults'] ) 151 if ( isset( $_POST['riq-integer'] ) && check_admin_referer( 'riq_update_admin_options', 'riq_admin_nonce' ) ) { 152 153 if ( ! empty( $_POST['riq-defaults'] ) && 'Reset to Default' == $_POST['riq-defaults'] ) { 154 152 155 $confirm_update = $this->update_plugin_settings( (int)90 ); 153 else 156 157 } else { 158 159 if ( (string)$jpeg_quality == '0' ) // WordPress core does this to avoid empty images 160 $jpeg_quality = 1; 161 154 162 $confirm_update = $this->update_plugin_settings( $_POST['riq-integer'] ); 155 156 } elseif ( ! empty( $_POST['riq-integer'] ) ) { 163 164 } 165 166 } elseif ( isset( $_POST['riq-integer'] ) ) { 167 157 168 wp_die( __( 'Invalid: Update without permissions. Please check your login and try again.', 'wp-resized-image-quality' ) ); 158 169 … … 161 172 // Get the whole reason this plugin exists 162 173 if ( false === ( $jpeg_quality = get_transient( 'riq_jpeg_quality' ) ) ) { 174 163 175 $this->riq_options = get_option( 'riq_options' ); 164 176 … … 176 188 // Include admin page/HTML output from separate file 177 189 require_once( dirname( __file__ ) . '/templates/riq-admin-page-template.php' ); 190 178 191 } 179 192 … … 194 207 // Get the whole reason this plugin exists 195 208 if ( false === ( $jpeg_quality = get_transient( 'riq_jpeg_quality' ) ) ) { 209 196 210 $this->riq_options = get_option( 'riq_options' ); 197 211 … … 216 230 public function sanitize_riq_media_option( $riq_options ) { 217 231 218 if ( ! empty( $_POST['riq-integer'] ) ) {232 if ( ( $_POST['riq-integer'] ) ) { 219 233 220 234 $valid = array(); … … 231 245 'JPEG Quality', 232 246 'riq_numeric_error', 233 //'Invalid %, must be a number', 234 print_r($riq_options), 235 //$riq_options, 247 'Invalid JPEG compression %: The setting must be a number', 248 //print_r($riq_options), 236 249 'error' 237 250 ); … … 263 276 public function update_plugin_settings( $jpeg_quality = 90 ) { 264 277 278 279 280 265 281 $this->riq_options['jpeg_quality'] = intval( $jpeg_quality ); 266 282 update_option( 'riq_options', $this->riq_options );
Note: See TracChangeset
for help on using the changeset viewer.