PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 3.2.21
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v3.2.21
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
wp-optimize / vendor / rosell-dk / webp-convert / src / Serve / Report.php

Report.php in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance 3.2.21, at vendor/rosell-dk/webp-convert/src/Serve/Report.php

55 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace WebPConvert\Serve;
3
4 use WebPConvert\Helpers\InputValidator;
5 use WebPConvert\Loggers\EchoLogger;
6 use WebPConvert\WebPConvert;
7
8 /**
9 * Class for generating a HTML report of converting an image.
10 *
11 * @package WebPConvert
12 * @author Bjørn Rosell <[email protected]>
13 * @since Class available since Release 2.0.0
14 */
15 class Report
16 {
17 public static function convertAndReport($source, $destination, $options)
18 {
19 InputValidator::checkSourceAndDestination($source, $destination);
20 ?>
21 <html>
22 <head>
23 <style>td {vertical-align: top} table {color: #666}</style>
24 <script>
25 function showOptions(elToHide) {
26 document.getElementById('options').style.display='block';
27 elToHide.style.display='none';
28 }
29 </script>
30 </head>
31 <body>
32 <table>
33 <tr><td><i>source:</i></td><td><?php echo htmlentities($source) ?></td></tr>
34 <tr><td><i>destination:</i></td><td><?php echo htmlentities($destination) ?><td></tr>
35 </table>
36 <br>
37 <?php
38 try {
39 $echoLogger = new EchoLogger();
40 $options['log-call-arguments'] = true;
41 WebPConvert::convert($source, $destination, $options['convert'], $echoLogger);
42 } catch (\Exception $e) {
43 $msg = $e->getMessage();
44 echo '<b>' . $msg . '</b>';
45
46 //echo '<p>Rethrowing exception for your convenience</p>';
47 //throw ($e);
48 }
49 ?>
50 </body>
51 </html>
52 <?php
53 }
54 }
55