| @@ -332,64 +332,35 @@ | ||
| 332 | 332 | <?php |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | private function maybe_display_io_hints() { |
| 336 | - $plugin_slug = 'image-optimization'; | |
| 337 | - | |
| 338 | - if ( ! Hints::should_display_hint( $plugin_slug ) ) { | |
| 336 | + if ( Hints::should_display_hint( 'image-optimization' ) ) { | |
| 337 | + $content_text = esc_html__( 'Optimize your images to enhance site performance by using Image Optimizer.', 'elementor' ); | |
| 338 | + $button_text = Hints::is_plugin_installed( 'image-optimization' ) ? esc_html__( 'Activate Plugin', 'elementor' ) : esc_html__( 'Install Plugin', 'elementor' ); | |
| 339 | + $action_url = Hints::get_plugin_action_url( 'image-optimization' ); | |
| 340 | + } elseif ( Hints::should_display_hint( 'image-optimization-connect' ) ) { | |
| 341 | + $content_text = esc_html__( "This image isn't optimized. You need to connect your Image Optimizer account first.", 'elementor' ); | |
| 342 | + $button_text = esc_html__( 'Connect Now', 'elementor' ); | |
| 343 | + $action_url = admin_url( 'admin.php?page=image-optimization-settings' ); | |
| 344 | + } else { | |
| 339 | 345 | return; |
| 340 | 346 | } |
| 341 | 347 | |
| 342 | - $one_subscription = Hints::is_plugin_connected_to_one_subscription(); | |
| 343 | - $is_installed = Hints::is_plugin_installed( $plugin_slug ); | |
| 344 | - $is_active = Hints::is_plugin_active( $plugin_slug ); | |
| 345 | - | |
| 346 | - if ( $is_active ) { | |
| 347 | - return; | |
| 348 | - } | |
| 349 | - | |
| 350 | - if ( $one_subscription ) { | |
| 351 | - if ( ! $is_installed ) { | |
| 352 | - $content = esc_html__( 'Optimize your images to improve site speed and performance. Image Optimization is included in your ONE subscription.', 'elementor' ); | |
| 353 | - $button_text = esc_html__( 'Install now', 'elementor' ); | |
| 354 | - $button_url = Hints::get_plugin_install_url( $plugin_slug ); | |
| 355 | - $source = 'io-editor-image-one-install'; | |
| 356 | - } elseif ( ! $is_active ) { | |
| 357 | - $content = esc_html__( 'Your ONE subscription includes Image Optimization. Activate it to optimize images and improve site performance.', 'elementor' ); | |
| 358 | - $button_text = esc_html__( 'Activate now', 'elementor' ); | |
| 359 | - $button_url = Hints::get_plugin_activate_url( $plugin_slug ); | |
| 360 | - $source = 'io-editor-image-one-activate'; | |
| 361 | - } | |
| 362 | - } else { | |
| 363 | - $content = esc_html__( 'Optimize your images to enhance site performance by using Image Optimization.', 'elementor' ); | |
| 364 | - if ( ! $is_installed ) { | |
| 365 | - $button_text = esc_html__( 'Install now', 'elementor' ); | |
| 366 | - $button_url = Hints::get_plugin_install_url( $plugin_slug ); | |
| 367 | - $source = 'io-editor-image-install'; | |
| 368 | - } elseif ( ! $is_active ) { | |
| 369 | - $button_text = esc_html__( 'Activate now', 'elementor' ); | |
| 370 | - $button_url = Hints::get_plugin_activate_url( $plugin_slug ); | |
| 371 | - $source = 'io-editor-image-activate'; | |
| 372 | - } | |
| 373 | - } | |
| 374 | 348 | ?> |
| 375 | - <div class="elementor-control-media__promotions" role="alert"> | |
| 349 | + <div class="elementor-control-media__promotions" role="alert" style="display: none;"> | |
| 376 | 350 | <?php |
| 377 | 351 | Hints::get_notice_template( [ |
| 378 | - 'display' => ! Hints::is_dismissed( $plugin_slug ), | |
| 352 | + 'display' => ! Hints::is_dismissed( 'image-optimization' ), | |
| 379 | 353 | 'type' => 'info', |
| 354 | + 'content' => $content_text, | |
| 380 | 355 | 'icon' => true, |
| 381 | - 'heading' => '', | |
| 382 | - 'content' => $content, | |
| 383 | 356 | 'dismissible' => 'image_optimizer_hint', |
| 384 | 357 | 'button_text' => $button_text, |
| 385 | 358 | 'button_event' => 'image_optimizer_hint', |
| 386 | 359 | 'button_data' => [ |
| 387 | - 'action_url' => $button_url, | |
| 388 | - 'source' => $source, | |
| 360 | + 'action_url' => $action_url, | |
| 389 | 361 | ], |
| 390 | - ] ); | |
| 391 | - ?> | |
| 362 | + ] ); ?> | |
| 392 | 363 | </div> |
| 393 | 364 | <?php |
| 394 | 365 | } |
| 395 | 366 | |