PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / 2.1.1
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF v2.1.1
2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.9 2.2.8 trunk 1.10 1.3.3 1.3.4 1.3.5 1.3.5.1 1.3.5.2 1.3.6 1.3.6.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 All 103 releases
imagify / views / page-bulk.php

page-bulk.php in Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF 2.1.1, at views/page-bulk.php

238 lines 8.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
3 ?>
4 <div class="wrap imagify-settings imagify-bulk">
5
6 <?php $this->print_template( 'part-bulk-optimization-header' ); ?>
7
8 <div class="imagify-settings-section">
9
10 <div class="imagify-columns">
11 <div class="imagify-col col-overview">
12 <h2 class="imagify-h2-like">
13 <span class="dashicons dashicons-chart-line"></span>
14 <?php esc_html_e( 'Overview', 'imagify' ); ?>
15 </h2>
16
17 <div class="imagify-columns">
18 <div class="imagify-col col-statistics">
19 <h3 class="screen-reader-text"><?php esc_html_e( 'Statistics', 'imagify' ); ?></h3>
20
21 <div class="imagify-number-you-optimized">
22 <p>
23 <span id="imagify-total-optimized-attachments" class="number"><?php echo esc_html( $data['already_optimized_attachments'] ); ?></span>
24 <span class="text">
25 <?php
26 printf(
27 /* translators: you can use %s to include a line break. */
28 esc_html__( 'that\'s the number of original images%s you optimized with Imagify', 'imagify' ),
29 '<br>'
30 );
31 ?>
32 </span>
33 </p>
34 </div>
35
36 <div class="imagify-bars">
37 <p><?php esc_html_e( 'Original size', 'imagify' ); ?></p>
38 <div class="imagify-bar-negative base-transparent right-outside-number">
39 <div id="imagify-original-bar" class="imagify-progress" style="width: 100%"><span class="imagify-barnb"><?php echo esc_html( $data['original_human'] ); ?></span></div>
40 </div>
41
42 <p><?php esc_html_e( 'Optimized size', 'imagify' ); ?></p>
43 <div class="imagify-bar-primary base-transparent right-outside-number">
44 <div id="imagify-optimized-bar" class="imagify-progress" style="width: <?php echo max( 100 - $data['optimized_percent'], 0 ); ?>%"><span class="imagify-barnb"><?php echo esc_html( $data['optimized_human'] ); ?></span></div>
45 </div>
46
47 </div>
48
49 <div class="imagify-number-you-optimized">
50 <p>
51 <span id="imagify-total-optimized-attachments-pct" class="number"><?php echo esc_html( number_format_i18n( $data['optimized_percent'] ) ); ?>%</span>
52 <span class="text">
53 <?php
54 printf(
55 /* translators: %s is a line break. */
56 esc_html__( 'that\'s the size you saved %sby using Imagify', 'imagify' ),
57 '<br>'
58 );
59 ?>
60 </span>
61 </p>
62 </div>
63 </div><!-- .imagify-col.col-statistics -->
64
65 <div class="imagify-col col-chart">
66 <div class="imagify-chart-container imagify-overview-chart-container">
67 <canvas id="imagify-overview-chart" width="180" height="180" data-unoptimized="<?php echo esc_attr( $data['unoptimized_attachments'] ); ?>" data-optimized="<?php echo esc_attr( $data['optimized_attachments'] ); ?>" data-errors="<?php echo esc_attr( $data['errors_attachments'] ); ?>"></canvas>
68 <div id="imagify-overview-chart-percent" class="imagify-chart-percent"><?php echo esc_html( min( $data['optimized_attachments_percent'], 100 ) ); ?><span>%</span></div>
69 </div>
70 <div id="imagify-overview-chart-legend"></div>
71
72 <p class="imagify-global-optim-phrase imagify-clear">
73 <?php
74 printf(
75 /* translators: %s is a percentage. */
76 esc_html__( 'You optimized %s of your website\'s images', 'imagify' ),
77 '<span class="imagify-total-percent">' . esc_html( min( $data['optimized_attachments_percent'], 100 ) ) . '%</span>'
78 );
79 ?>
80 </p>
81 </div><!-- .imagify-col -->
82 </div>
83 </div><!-- .imagify-col.col-overview -->
84
85 <div class="imagify-col imagify-account-info-col">
86
87 <?php
88 if ( ( ! defined( 'IMAGIFY_HIDDEN_ACCOUNT' ) || ! IMAGIFY_HIDDEN_ACCOUNT ) && Imagify_Requirements::is_api_key_valid() ) {
89 $user = new Imagify_User();
90 ?>
91 <div class="imagify-options-title">
92 <div class="imagify-th-titles imagify-flex imagify-vcenter">
93 <span class="dashicons dashicons-admin-users"></span>
94 <p class="imagify-meteo-title">
95 <?php esc_html_e( 'Your Account', 'imagify' ); ?>
96 </p>
97 </div>
98 <a href="<?php echo esc_url( imagify_get_external_url( 'subscription' ) ); ?>" target="_blank"><?php _e( 'View your profile', 'imagify' ); ?></a>
99 </div>
100
101 <?php if ( $user && 1 === $user->plan_id ) { ?>
102 <div class="imagify-col-content">
103 <div class="imagify-flex imagify-vcenter">
104 <span class="imagify-meteo-icon imagify-noshrink"><?php echo $this->get_quota_icon(); ?></span>
105 <div class="imagify-space-left imagify-full-width">
106
107 <p>
108 <?php
109 printf(
110 /* translators: %s is a data quota. */
111 __( 'You have %s space credit left', 'imagify' ),
112 '<span class="imagify-unconsumed-percent">' . $this->get_quota_percent() . '%</span>'
113 );
114 ?>
115 </p>
116
117 <div class="<?php echo $this->get_quota_class(); ?>">
118 <div class="imagify-unconsumed-bar imagify-progress" style="width: <?php echo $this->get_quota_percent() . '%'; ?>;"></div>
119 </div>
120 </div>
121 </div>
122 <?php
123 /**
124 * Filter whether the plan chooser section is displayed.
125 *
126 * @param $show_new bool Default to true: display the section.
127 */
128 if ( apply_filters( 'imagify_show_new_to_imagify', true ) ) {
129 ?>
130 <div class="imagify-block-secondary">
131 <p class="imagify-section-title imagify-h3-like">
132 <?php
133 if ( ! $this->get_quota_percent() ) {
134 esc_html_e( 'Oops, It\'s Over!', 'imagify' );
135 } elseif ( $this->get_quota_percent() <= 20 ) {
136 esc_html_e( 'Oops, It\'s almost over!', 'imagify' );
137 } else {
138 esc_html_e( 'You\'re new to Imagify?', 'imagify' );
139 }
140 ?>
141 </p>
142 <p><?php esc_html_e( 'Let us help you by analyzing your existing images and determine the best plan for you.', 'imagify' ); ?></p>
143
144 <button id="imagify-get-pricing-modal" data-nonce="<?php echo wp_create_nonce( 'imagify_get_pricing_' . get_current_user_id() ); ?>" data-target="#imagify-pricing-modal" type="button" class="imagify-modal-trigger imagify-button imagify-button-light imagify-button-big imagify-full-width">
145 <i class="dashicons dashicons-dashboard" aria-hidden="true"></i>
146 <span class="button-text"><?php _e( 'What plan do I need?', 'imagify' ); ?></span>
147 </button>
148 </div>
149 <?php
150 }
151 ?>
152 </div><!-- .imagify-col-content -->
153 <?php } // End if(). ?>
154 <?php } // End if(). ?>
155
156 </div><!-- .imagify-account-info-col -->
157
158 </div><!-- .imagify-columns -->
159
160 <?php
161 $this->print_template( 'part-bulk-optimization-success' );
162
163 $this->print_template( 'part-bulk-optimization-table', $data );
164
165 // New Feature!
166 if ( ! empty( $data['no-custom-folders'] ) ) {
167 $this->print_template( 'part-bulk-optimization-newbie' );
168 }
169 ?>
170
171 <div class="imagify-bulk-submit imagify-flex imagify-vcenter">
172 <div class="imagify-pr2">
173 <p>
174 <?php wp_nonce_field( 'imagify-bulk-optimize', 'imagifybulkuploadnonce' ); ?>
175 <?php
176 $disabled = '';
177 $class = '';
178
179 if (
180 false !== get_transient( 'imagify_wp_optimize_running' )
181 ||
182 false !== get_transient( 'imagify_custom-folders_optimize_running' )
183 ) {
184 $disabled = 'disabled="disabled"';
185 $class = 'rotate';
186 }
187
188 ?>
189 <button id="imagify-bulk-action" type="button" class="button button-primary" <?php echo $disabled; ?>>
190 <span class="dashicons dashicons-admin-generic <?php echo $class; ?>"></span>
191 <span class="button-text"><?php _e( 'Imagif’em all', 'imagify' ); ?></span>
192 </button>
193 </p>
194 </div>
195 <?php if ( ! is_wp_error( get_imagify_max_image_size() ) ) { ?>
196 <p>
197 <?php
198 printf(
199 /* translators: %s is a file size. */
200 esc_html__( 'All images greater than %s (after resizing, if any) will be optimized when using a paid plan.', 'imagify' ),
201 esc_html( imagify_size_format( get_imagify_max_image_size() ) )
202 );
203 ?>
204 </p>
205 <?php } ?>
206 </div><!-- .imagify-bulk-submit -->
207 </div><!-- .imagify-settings-section -->
208
209 <?php
210 $this->print_template( 'modal-payment' );
211
212 if ( Imagify_Requirements::is_api_key_valid() ) {
213 $display_infos = get_transient( 'imagify_bulk_optimization_infos' );
214
215 ?>
216 <script type="text/html" id="tmpl-imagify-overquota-alert">
217 <?php $this->print_template( 'part-bulk-optimization-overquota-alert' ); ?>
218 </script>
219 <?php
220
221 if ( ! $display_infos ) {
222 ?>
223 <script type="text/html" id="tmpl-imagify-bulk-infos">
224 <?php
225 $this->print_template( 'part-bulk-optimization-infos', array(
226 'quota' => $data['unconsumed_quota'],
227 'quota_class' => $data['quota_class'],
228 'library' => ! empty( $data['groups']['library'] ),
229 ) );
230 ?>
231 </script>
232 <?php
233 }
234 }
235 ?>
236 </div>
237 <?php
238