| @@ -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, |
| @@ -335,8 +342,17 @@ | ||
| 335 | 342 | return false; |
| 336 | 343 | } |
| 337 | 344 | |
| 338 | 345 | return Connect_Module::get_connect()->get_config( 'app_type' ) !== Config::APP_TYPE; |
| 346 | + } | |
| 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(); | |
| 339 | 355 | } |
| 340 | 356 | |
| 341 | 357 | public static function on_deactivation(): void { |
| 342 | 358 | $optimization_query = ( new Operation_Query() ) |