PluginProbe ʕ •ᴥ•ʔ
TinyPNG – JPEG, PNG & WebP image compression / 2.2.4
TinyPNG – JPEG, PNG & WebP image compression v2.2.4
3.7.0 3.6.14 trunk 1.0.0 1.1.0 1.2.0 1.2.1 1.3.0 1.3.1 1.3.2 1.4.0 1.5.0 1.6.0 1.7.0 1.7.1 1.7.2 2.0.0 2.0.1 2.0.2 2.1.0 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 3.0.0 3.0.1 3.1.0 3.2.0 3.2.1 3.3 3.4 3.4.1 3.4.2 3.4.4 3.4.5 3.4.6 3.5.0 3.5.1 3.5.2 3.6.0 3.6.1 3.6.10 3.6.11 3.6.12 3.6.13 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.6.9
tiny-compress-images / src / views / bulk-optimization-chart.php
tiny-compress-images / src / views Last commit date
account-status-connected.php 8 years ago account-status-create-advanced.php 9 years ago account-status-create-simple.php 8 years ago account-status-loading.php 9 years ago bulk-optimization-chart.php 9 years ago bulk-optimization-form.php 9 years ago bulk-optimization.php 8 years ago compress-details-processing.php 9 years ago compress-details.php 8 years ago dashboard-widget.php 8 years ago
bulk-optimization-chart.php
56 lines
1 <?php
2
3 $chart = array();
4
5 if ( isset( $stats ) ) {
6 $chart['percentage'] = $stats['display-percentage'];
7 } else {
8 $chart['percentage'] = 0;
9 };
10
11 $chart['size'] = 160;
12 $chart['radius'] = $chart['size'] / 2 * 0.9;
13 $chart['main-radius'] = $chart['radius'] * 0.88;
14 $chart['center'] = $chart['size'] / 2;
15 $chart['stroke'] = $chart['radius'] / 2;
16 $chart['dash-stroke'] = $chart['radius'] / 4;
17 $chart['inner-radius'] = $chart['radius'] - $chart['stroke'] / 2;
18 $chart['circle-size'] = 2 * pi() * $chart['main-radius'];
19 $chart['dash-array-size'] = $chart['percentage'] / 100 * $chart['circle-size'];
20
21 ?>
22 <style>
23
24 #optimization-chart svg circle.main {
25 stroke-width: <?php echo $chart['dash-stroke'] ?>;
26 stroke-dasharray: <?php echo $chart['dash-array-size'] . ' ' . $chart['circle-size'] ?>;
27 }
28
29 #optimization-chart div.chart div.value {
30 min-width: <?php echo $chart['size'] ?>px;
31 }
32
33 <?php if ( isset( $stats ) ) { ?>
34 @keyframes shwoosh {
35 from {
36 stroke-dasharray: <?php echo '0' . ' ' . $chart['circle-size'] ?>
37 }
38 to {
39 stroke-dasharray: <?php echo $chart['dash-array-size'] . ' ' . $chart['circle-size'] ?>
40 }
41 }
42 <?php } ?>
43
44 </style>
45
46 <div id="optimization-chart" class="chart" data-full-circle-size="<?php echo $chart['circle-size'] ?>" data-percentage-factor="<?php echo $chart['main-radius'] ?>" >
47 <svg width="<?php echo $chart['size'] ?>" height="<?php echo $chart['size'] ?>">
48 <circle class="main" transform="rotate(-90, <?php echo $chart['center'] ?>, <?php echo $chart['center'] ?>)" r="<?php echo $chart['main-radius'] ?>" cx="<?php echo $chart['center'] ?>" cy="<?php echo $chart['center'] ?>"/>
49 <circle class="inner" r="<?php echo $chart['inner-radius'] ?>" cx="<?php echo $chart['center'] ?>" cy="<?php echo $chart['center'] ?>" />
50 </svg>
51 <div class="value">
52 <div class="percentage" id="savings-percentage"><span><?php echo $chart['percentage'] ?></span>%</div>
53 <div class="label" ><?php echo esc_html__( 'savings', 'tiny-compress-images' ); ?></div>
54 </div>
55 </div>
56