C:\xampp\htdocs\landing\wp-content\plugins\imagify\classes\Bulk\AbstractBulk.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
namespace Imagify\Bulk;

defined'ABSPATH' ) || die( 'Cheatin’ uh?' );

/**
 * Abstract class to use for bulk.
 *
 * @since  1.9
 * @author Grégory Viguier
 */
abstract class AbstractBulk implements BulkInterface {

    
/**
     * Filesystem object.
     *
     * @var    \Imagify_Filesystem
     * @since  1.9
     * @access protected
     * @author Grégory Viguier
     */
    
protected $filesystem;

    
/**
     * The constructor.
     *
     * @since  1.9
     * @access public
     * @author Grégory Viguier
     */
    
public function __construct() {
        
$this->filesystem = \Imagify_Filesystem::get_instance();
    }

    
/**
     * Format context data (stats).
     *
     * @since  1.9
     * @access protected
     * @author Grégory Viguier
     *
     * @param  array $data {
     *     The data to format.
     *
     *     @type int    $count-optimized Number of media optimized.
     *     @type int    $count-errors    Number of media having an optimization error.
     *     @type int    $optimized-size  Optimized filesize.
     *     @type int    $original-size   Original filesize.
     *     @type string $errors_url      URL to the page listing the optimization errors.
     * }
     * @return array {
     *     The formated data.
     *
     *     @type string $count-optimized Number of media optimized.
     *     @type string $count-errors    Number of media having an optimization error, with a link to the page listing the optimization errors.
     *     @type string $optimized-size  Optimized filesize.
     *     @type string $original-size   Original filesize.
     * }
     */
    
protected function format_context_data$data ) {
        
/* translators: %s is a formatted number, dont use %d. */
        
$data['count-optimized'] = sprintf_n'%s Media File Optimized''%s Media Files Optimized'$data['count-optimized'], 'imagify' ), '<span>' number_format_i18n$data['count-optimized'] ) . '</span>' );

        if ( 
$data['count-errors'] ) {
            
/* translators: %s is a formatted number, dont use %d. */
            
$data['count-errors']  = sprintf_n'%s Error''%s Errors'$data['count-errors'], 'imagify' ), '<span>' number_format_i18n$data['count-errors'] ) . '</span>' );
            
$data['count-errors'] .= ' <a href="' esc_url$data['errors_url'] ) . '">' __'View Errors''imagify' ) . '</a>';
        } else {
            
$data['count-errors'] = '';
        }

        if ( 
$data['optimized-size'] ) {
            
$data['optimized-size'] = '<span class="imagify-cell-label">' __'Optimized Filesize''imagify' ) . '</span> ' imagify_size_format$data['optimized-size'], );
        } else {
            
$data['optimized'] = '';
        }

        if ( 
$data['original-size'] ) {
            
$data['original-size'] = '<span class="imagify-cell-label">' __'Original Filesize''imagify' ) . '</span> ' imagify_size_format$data['original-size'], );
        } else {
            
$data['original-size'] = '';
        }

        unset( 
$data['errors_url'] );

        return 
$data;
    }
}
x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586