PluginProbe
Elementor Website Builder – more than just a page builder / 3.34.1
Elementor Website Builder – more than just a page builder v3.34.1
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | includes/controls/gallery.php +14 -43 4.2.0-dev23.34.1 View file →
@@ -138,64 +138,35 @@
138 138 <?php
139 139 }
140 140
141 141 private function maybe_display_io_hints() {
142 - $plugin_slug = 'image-optimization';
143 -
144 - if ( ! Hints::should_display_hint( $plugin_slug ) ) {
142 + if ( Hints::should_display_hint( 'image-optimization' ) ) {
143 + $content_text = esc_html__( 'Optimize your images to enhance site performance by using Image Optimizer.', 'elementor' );
144 + $button_text = Hints::is_plugin_installed( 'image-optimization' ) ? esc_html__( 'Activate Plugin', 'elementor' ) : esc_html__( 'Install Plugin', 'elementor' );
145 + $action_url = Hints::get_plugin_action_url( 'image-optimization' );
146 + } elseif ( Hints::should_display_hint( 'image-optimization-connect' ) ) {
147 + $content_text = esc_html__( "This image isn't optimized. You need to connect your Image Optimizer account first.", 'elementor' );
148 + $button_text = esc_html__( 'Connect Now', 'elementor' );
149 + $action_url = admin_url( 'admin.php?page=image-optimization-settings' );
150 + } else {
145 151 return;
146 152 }
147 153
148 - $one_subscription = Hints::is_plugin_connected_to_one_subscription();
149 - $is_installed = Hints::is_plugin_installed( 'image-optimization' );
150 - $is_active = Hints::is_plugin_active( 'image-optimization' );
151 -
152 - if ( $is_active ) {
153 - return;
154 - }
155 -
156 - if ( $one_subscription ) {
157 - if ( ! $is_installed ) {
158 - $content = esc_html__( 'Optimize your images to improve site speed and performance. Image Optimization is included in your ONE subscription.', 'elementor' );
159 - $button_text = esc_html__( 'Install now', 'elementor' );
160 - $button_url = Hints::get_plugin_install_url( $plugin_slug );
161 - $source = 'io-editor-gallery-one-install';
162 - } elseif ( ! $is_active ) {
163 - $content = esc_html__( 'Image Optimization is installed and included in your ONE subscription. Activate it to optimize images and improve site performance.', 'elementor' );
164 - $button_text = esc_html__( 'Activate now', 'elementor' );
165 - $button_url = Hints::get_plugin_activate_url( $plugin_slug );
166 - $source = 'io-editor-gallery-one-activate';
167 - }
168 - } else {
169 - $content = esc_html__( 'Optimize your images to enhance site performance by using Image Optimization.', 'elementor' );
170 - if ( ! $is_installed ) {
171 - $button_text = esc_html__( 'Install now', 'elementor' );
172 - $button_url = Hints::get_plugin_install_url( $plugin_slug );
173 - $source = 'io-editor-gallery-install';
174 - } elseif ( ! $is_active ) {
175 - $button_text = esc_html__( 'Activate now', 'elementor' );
176 - $button_url = Hints::get_plugin_activate_url( $plugin_slug );
177 - $source = 'io-editor-gallery-activate';
178 - }
179 - }
180 154 ?>
181 - <div class="elementor-control-media__promotions" role="alert">
155 + <div class="elementor-control-media__promotions" role="alert" style="display: none;">
182 156 <?php
183 157 Hints::get_notice_template( [
184 - 'display' => ! Hints::is_dismissed( $plugin_slug ),
158 + 'display' => ! Hints::is_dismissed( 'image-optimization' ),
185 159 'type' => 'info',
160 + 'content' => $content_text,
186 161 'icon' => true,
187 - 'heading' => '',
188 - 'content' => $content,
189 162 'dismissible' => 'image_optimizer_hint',
190 163 'button_text' => $button_text,
191 164 'button_event' => 'image_optimizer_hint',
192 165 'button_data' => [
193 - 'action_url' => $button_url,
194 - 'source' => $source,
166 + 'action_url' => $action_url,
195 167 ],
196 - ] );
197 - ?>
168 + ] ); ?>
198 169 </div>
199 170 <?php
200 171 }
201 172