parent_file ) && 'plugins.php' === $screen->parent_file && 'update' === $screen->id ) { return; } $plugin = 'elementor/elementor.php'; if ( _is_elementor_installed() ) { if ( ! current_user_can( 'activate_plugins' ) ) { return; } $activation_url = wp_nonce_url( 'plugins.php?action=activate&plugin=' . $plugin . '&plugin_status=all&paged=1&s', 'activate-plugin_' . $plugin ); $admin_message = '

' . esc_html__( 'Ops! Addonse not working because you need to activate the Elementor plugin first.', 'addonse' ) . '

'; $admin_message .= '

' . sprintf( '%s', $activation_url, esc_html__( 'Activate Elementor Now', 'addonse' ) ) . '

'; } else { if ( ! current_user_can( 'install_plugins' ) ) { return; } $install_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=elementor' ), 'install-plugin_elementor' ); $admin_message = '

' . esc_html__( 'Ops! Addonse not working because you need to install the Elementor plugin', 'addonse' ) . '

'; $admin_message .= '

' . sprintf( '%s', $install_url, esc_html__( 'Install Elementor Now', 'addonse' ) ) . '

'; } echo '
' . $admin_message . '
'; } if ( ! function_exists( '_is_elementor_installed' ) ) { function _is_elementor_installed() { $file_path = 'elementor/elementor.php'; $installed_plugins = get_plugins(); return isset( $installed_plugins[ $file_path ] ); } }