Skip to content

Commit 4a7e056

Browse files
Fixed some style tests.
1 parent 699beeb commit 4a7e056

4 files changed

Lines changed: 19 additions & 14 deletions

File tree

src/class-tiny-image.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ public static function get_optimization_statistics( $settings, $result = null )
416416
GROUP BY unique_attachment_name
417417
ORDER BY ID DESC";
418418

419-
$result = $wpdb->get_results( $query, ARRAY_A );
419+
$result = $wpdb->get_results( $query, ARRAY_A ); // WPCS: unprepared SQL OK.
420420
}
421421

422422
$stats = array();
@@ -454,7 +454,10 @@ public static function get_optimization_statistics( $settings, $result = null )
454454
}
455455

456456
if ( 0 != $stats['unoptimized-library-size'] ) {
457-
$stats['display-percentage'] = round( 100 - ( $stats['optimized-library-size'] / $stats['unoptimized-library-size'] * 100 ), 1 );
457+
$stats['display-percentage'] = round(
458+
100 -
459+
( $stats['optimized-library-size'] / $stats['unoptimized-library-size'] * 100 ), 1
460+
);
458461
} else {
459462
$stats['display-percentage'] = 0;
460463
}

src/class-tiny-plugin.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public function enqueue_scripts( $hook ) {
216216
array(), self::version()
217217
);
218218

219-
wp_enqueue_style( self::NAME .'_chart',
219+
wp_enqueue_style( self::NAME . '_chart',
220220
plugins_url( '/css/chart.css', __FILE__ ),
221221
array(), self::version()
222222
);
@@ -445,22 +445,22 @@ public function render_bulk_optimization_page() {
445445
}
446446

447447
public function add_dashboard_widget() {
448-
wp_enqueue_style( self::NAME .'_chart',
448+
wp_enqueue_style( self::NAME . '_chart',
449449
plugins_url( '/css/chart.css', __FILE__ ),
450450
array(), self::version()
451451
);
452452

453-
wp_enqueue_style( self::NAME .'_dashboard_widget',
453+
wp_enqueue_style( self::NAME . '_dashboard_widget',
454454
plugins_url( '/css/dashboard-widget.css', __FILE__ ),
455455
array(), self::version()
456456
);
457457

458-
wp_register_script( self::NAME .'_dashboard_widget',
458+
wp_register_script( self::NAME . '_dashboard_widget',
459459
plugins_url( '/js/dashboard-widget.js', __FILE__ ),
460460
array(), self::version(), true
461461
);
462462

463-
wp_enqueue_script( self::NAME .'_dashboard_widget' );
463+
wp_enqueue_script( self::NAME . '_dashboard_widget' );
464464

465465
wp_add_dashboard_widget(
466466
$this->get_prefixed_name( 'dashboard_widget' ),

src/class-tiny-settings.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ public function admin_init() {
7979
} else {
8080
$details .= ' without curl';
8181
}
82-
$message = esc_html__(
83-
'You are using an outdated platform (' . $details .
84-
') – some features are disabled', 'tiny-compress-images'
82+
$message = printf(
83+
esc_html__(
84+
'You are using an outdated platform (%s) – some features are disabled',
85+
'tiny-compress-images'
86+
), $details
8587
);
8688
$this->notices->show( 'deprecated', $message, 'notice-warning', false );
8789
}
@@ -423,8 +425,8 @@ public function render_image_sizes_notice(
423425
Tiny_Config::MONTHLY_FREE_COMPRESSIONS / $active_sizes_count
424426
);
425427
printf( wp_kses( __(
426-
'With these settings you can compress ' .
427-
'<strong> at least %s images </strong> for free each month.',
428+
'With these settings you can compress
429+
<strong> at least %s images </strong> for free each month.',
428430
'tiny-compress-images'
429431
), array( 'strong' => array() ) ), $free_images_per_month );
430432

src/views/bulk-optimization.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
printf( esc_html__( '%s, you are doing good.', 'tiny-compress-images' ), $this->friendly_user_name() );
6262
}
6363
echo ' ';
64-
printf( esc_html__( '%d%% of your image library is optimized.', 'tiny-compress-images' ), $percentage_of_files );
64+
printf( esc_html__( '%1$d %2$s of your image library is optimized.', 'tiny-compress-images' ), $percentage_of_files, '%' );
6565
echo ' ';
6666
printf( esc_html__( 'Start the %s to optimize the remainder of your library.', 'tiny-compress-images' ), esc_html__( 'bulk optimization', 'tiny-compress-images' ) );
6767
} else {
@@ -97,7 +97,7 @@
9797
<?php if ( $stats['uploaded-images'] > 0 && sizeof( $active_tinify_sizes ) > 0 && $stats['available-unoptimised-sizes'] > 0 ) { ?>
9898
<p>
9999
<?php
100-
printf( esc_html__( 'With your current settings you can still optimize %s image sizes from your %s uploaded JPEG and PNG images.',
100+
printf( esc_html__( 'With your current settings you can still optimize %1$s image sizes from your %2$s uploaded JPEG and PNG images.',
101101
'tiny-compress-images'), $stats['available-unoptimised-sizes'], $stats['uploaded-images'] );
102102
?>
103103
</p>

0 commit comments

Comments
 (0)