PluginProbe
Image Optimizer – Compress Images and Convert to WebP or AVIF / trunk
Image Optimizer – Compress Images and Convert to WebP or AVIF vtrunk
1.7.7 1.7.6 1.7.5 1.7.4 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 All 33 releases
← All changes | modules/core/module.php +19 -3 1.7.4 → trunk View file →
@@ -48,8 +48,9 @@
48 48 'User_Feedback',
49 49 'Not_Connected',
50 50 'Not_Connected_Modal',
51 51 'Renewal_Notice',
52 + 'Notificator',
52 53 ];
53 54 }
54 55
55 56 private function render_top_bar() {
@@ -186,11 +187,15 @@
186 187 </div>
187 188 <?php
188 189 }
189 190
190 - public function add_plugin_links( $links, $plugin_file_name ): array {
191 + public function add_plugin_links( $links, $plugin_file_name ) {
192 + if ( ! is_array( $links ) ) {
193 + return $links;
194 + }
195 +
191 196 if ( ! str_ends_with( $plugin_file_name, '/image-optimization.php' ) ) {
192 - return (array) $links;
197 + return $links;
193 198 }
194 199
195 200 $custom_links = [
196 201 'settings' => sprintf(
@@ -280,8 +285,10 @@
280 285 [
281 286 'isConnectOnFly' => self::is_connect_on_fly(),
282 287 'isConnected' => $module->connect_instance->is_connected(),
283 288 'isElementorOne' => self::is_elementor_one(),
289 + 'hasElementorOneSubscription' => self::has_elementor_one_subscription(),
290 + 'isMigrationPopupDismissed' => (bool) Settings::get( Settings::MIGRATION_POPUP_DISMISSED ),
284 291 'currentPage' => get_current_screen()->base,
285 292 'isActivated' => $module->connect_instance->is_activated(),
286 293 'isUrlMismatch' => ! $module->connect_instance->is_valid_home_url(),
287 294 'planData' => $module->connect_instance->is_activated() ? $module->connect_instance->get_connect_status() : null,
@@ -337,8 +344,17 @@
337 344
338 345 return Connect_Module::get_connect()->get_config( 'app_type' ) !== Config::APP_TYPE;
339 346 }
340 347
348 + /**
349 + * Check if user generally has an active Elementor One subscription.
350 + * @return bool
351 + */
352 + public static function has_elementor_one_subscription(): bool {
353 + $one_facade = \ElementorOne\Admin\Helpers\Utils::get_one_connect();
354 + return $one_facade && $one_facade->utils()->is_connected();
355 + }
356 +
341 357 public static function on_deactivation(): void {
342 358 $optimization_query = ( new Operation_Query() )
343 359 ->set_queue( Async_Operation_Queue::OPTIMIZE )
344 360 ->set_status( [ Async_Operation::OPERATION_STATUS_PENDING, Async_Operation::OPERATION_STATUS_RUNNING ] )
@@ -417,9 +433,9 @@
417 433 const link = document.createElement('a');
418 434
419 435 link.href = '<?php echo esc_js( $page_url ); ?>';
420 436 link.innerText = '<?php echo esc_js( __( 'Bulk Optimization', 'image-optimization' ) ); ?>';
421 - link.className = 'button is-primary image-optimizer__button image-optimizer__button--pink';
437 + link.className = 'button button-compact is-primary image-optimizer__button image-optimizer__button--pink';
422 438
423 439 targetButton.insertAdjacentElement( 'afterend', link );
424 440 }
425 441 }, 100 )