//downloads.wordpress.org/plugin/surecart.zip', 'siteurl' => 'https://surecart.com/', 'isFree' => true, 'slug' => 'surecart', 'status' => self::get_plugin_status( 'surecart/surecart.php' ), 'settings_url' => admin_url( 'admin.php?page=sc-getting-started' ), ], 'sureforms/sureforms.php' => [ 'icon' => $images_url . 'sureforms.svg', 'type' => 'plugin', 'name' => esc_html__( 'Build Powerful Forms in Minutes with SureForms!', 'header-footer-elementor' ), 'desc' => esc_html__( 'Build powerful forms in minutes without complexity. SureForms lets you create contact forms, payment forms, and surveys using an AI-assisted, clean interface with conversational layouts, conditional logic, payment collection, and mobile optimization for a seamless experience.', 'header-footer-elementor' ), 'wporg' => 'https://wordpress.org/plugins/sureforms/', 'url' => 'https://downloads.wordpress.org/plugin/sureforms.zip', 'siteurl' => 'https://sureforms.com/', 'slug' => 'sureforms', 'isFree' => true, 'status' => self::get_plugin_status( 'sureforms/sureforms.php' ), 'settings_url' => admin_url( 'admin.php?page=sureforms_menu' ), ], 'presto-player/presto-player.php' => [ 'icon' => $images_url . 'pplayer.svg', 'type' => 'plugin', 'name' => esc_html__( 'Add Engaging Videos Seamlessly with Presto Player!', 'header-footer-elementor' ), 'desc' => html_entity_decode( esc_html__( 'Add engaging videos seamlessly in minutes without complexity. Presto Player lets you enhance your website with videos using branding, chapters, and call-to-actions while providing fast load times, detailed analytics, and user-friendly controls for a seamless viewing experience.', 'header-footer-elementor' ) ), 'wporg' => 'https://wordpress.org/plugins/presto-player/', 'url' => 'https://downloads.wordpress.org/plugin/presto-player.zip', 'siteurl' => 'https://prestoplayer.com/', 'slug' => 'presto-player', 'isFree' => true, 'status' => self::get_plugin_status( 'presto-player/presto-player.php' ), 'settings_url' => admin_url( 'edit.php?post_type=pp_video_block' ), ], 'suretriggers/suretriggers.php' => [ 'icon' => $images_url . 'OttoKit-Symbol-Primary.svg', 'type' => 'plugin', 'name' => esc_html__( 'Automate Your Workflows Easily with Ottokit!', 'header-footer-elementor' ), 'desc' => esc_html__( 'Automate workflows effortlessly in minutes without complexity. Ottokit lets you connect your WordPress site with web apps to automate tasks, sync data, and run actions using a clean visual builder with scheduling, filters, conditions, and webhooks for a seamless experience.', 'header-footer-elementor' ), 'wporg' => 'https://wordpress.org/plugins/suretriggers/', 'url' => 'https://downloads.wordpress.org/plugin/suretriggers.zip', 'siteurl' => 'https://ottokit.com/', 'slug' => 'suretriggers', 'isFree' => true, 'status' => self::get_plugin_status( 'suretriggers/suretriggers.php' ), 'settings_url' => admin_url( 'admin.php?page=suretriggers' ), ], ]; foreach ( $plugins as $key => $plugin ) { // Check if it's a plugin and is active. if ( 'plugin' === $plugin['type'] && is_plugin_active( $key ) ) { unset( $plugins[ $key ] ); } if ( 'plugin' === $plugin['type'] && 'astra-sites/astra-sites.php' === $key ) { $st_pro_status = self::get_plugin_status( 'astra-pro-sites/astra-pro-sites.php' ); if ( 'Installed' === $st_pro_status || 'Activated' === $st_pro_status ) { unset( $plugins[ $key ] ); } } if ( 'theme' === $plugin['type'] ) { $current_theme = wp_get_theme(); if ( $current_theme->get_stylesheet() === $plugin['slug'] ) { unset( $plugins[ $key ] ); } } } return $plugins; } /** * List of plugins that we propose to install. * * @since 1.6.0 * * @return array */ public static function get_recommended_bsf_plugins() { $white_labels = self::get_white_label(); $images_url = HFE_URL . 'assets/images/settings/'; $recommended_plugins = [ 'astra-sites/astra-sites.php' => [ 'icon' => $images_url . 'stemplates.svg', 'type' => 'plugin', 'name' => esc_html__( 'Starter Templates', 'header-footer-elementor' ), 'desc' => esc_html__( 'Quickly launch websites with 300+ professionally designed Elementor templates.', 'header-footer-elementor' ), 'wporg' => 'https://wordpress.org/plugins/astra-sites/', 'url' => 'https://downloads.wordpress.org/plugin/astra-sites.zip', 'siteurl' => 'https://startertemplates.com/', 'slug' => 'astra-sites', 'isFree' => true, 'status' => self::get_plugin_status( 'astra-sites/astra-sites.php' ), 'settings_url' => admin_url( 'admin.php?page=starter-templates' ), ], 'surerank/surerank.php' => [ 'icon' => $images_url . 'surerank_extend.svg', 'type' => 'plugin', 'name' => esc_html__( 'SureRank', 'header-footer-elementor' ), 'desc' => esc_html__( 'Powerful, lightweight SEO plugin to manage search and social previews', 'header-footer-elementor' ), 'wporg' => 'https://wordpress.org/plugins/surerank/', 'url' => 'https://downloads.wordpress.org/plugin/surerank.zip', 'siteurl' => 'https://surerank.com/', 'isFree' => true, 'slug' => 'surerank', 'status' => self::get_plugin_status( 'surerank/surerank.php' ), 'settings_url' => admin_url( 'admin.php?page=surerank_onboarding' ), ], 'sureforms/sureforms.php' => [ 'icon' => $images_url . 'sureforms_extend.svg', 'type' => 'plugin', 'name' => esc_html__( 'SureForms', 'header-footer-elementor' ), 'desc' => esc_html__( 'Create high-converting forms with ease.', 'header-footer-elementor' ), 'wporg' => 'https://wordpress.org/plugins/sureforms/', 'url' => 'https://downloads.wordpress.org/plugin/sureforms.zip', 'siteurl' => 'https://sureforms.com/', 'slug' => 'sureforms', 'isFree' => true, 'status' => self::get_plugin_status( 'sureforms/sureforms.php' ), 'settings_url' => admin_url( 'admin.php?page=sureforms_menu' ), ], 'suretriggers/suretriggers.php' => [ 'icon' => $images_url . 'ottokit.svg', 'type' => 'plugin', 'name' => esc_html__( 'OttoKit', 'header-footer-elementor' ), 'desc' => esc_html__( 'Automate WordPress tasks effortlessly.', 'header-footer-elementor' ), 'wporg' => 'https://wordpress.org/plugins/suretriggers/', 'url' => 'https://downloads.wordpress.org/plugin/suretriggers.zip', 'siteurl' => 'https://ottokit.com/', 'slug' => 'suretriggers', 'isFree' => true, 'status' => self::get_plugin_status( 'suretriggers/suretriggers.php' ), 'settings_url' => admin_url( 'admin.php?page=suretriggers' ), ], ]; foreach ( $recommended_plugins as $key => $plugin ) { // Check if it's a plugin and is active. if ( 'plugin' === $plugin['type'] && is_plugin_active( $key ) ) { unset( $recommended_plugins[ $key ] ); } if ( 'plugin' === $plugin['type'] && 'astra-sites/astra-sites.php' === $key ) { $st_pro_status = self::get_plugin_status( 'astra-pro-sites/astra-pro-sites.php' ); if ( 'Installed' === $st_pro_status || 'Activated' === $st_pro_status ) { unset( $recommended_plugins[ $key ] ); } } if ( 'theme' === $plugin['type'] ) { $current_theme = wp_get_theme(); if ( $current_theme->get_stylesheet() === $plugin['slug'] ) { unset( $recommended_plugins[ $key ] ); } } } return $recommended_plugins; } /** * Get plugin status * * @since 0.0.1 * * @param string $plugin_init_file Plugin init file. * @return string */ public static function get_plugin_status( $plugin_init_file ) { $installed_plugins = get_plugins(); if ( ! isset( $installed_plugins[ $plugin_init_file ] ) ) { return 'Install'; } elseif ( is_plugin_active( $plugin_init_file ) ) { return 'Activated'; } else { return 'Installed'; } } /** * Get the status of a theme. * * @param string $theme_slug The slug of the theme. * @return string The theme status: 'Activated', 'Installed', or 'Install'. * * @since 0.0.1 */ public static function get_theme_status( $theme_slug ) { $installed_themes = wp_get_themes(); // Check if the theme is installed. if ( isset( $installed_themes[ $theme_slug ] ) ) { $current_theme = wp_get_theme(); // Check if the current theme slug matches the provided theme slug. if ( $current_theme->get_stylesheet() === $theme_slug ) { return 'Activated'; // Theme is active. } else { return 'Installed'; // Theme is installed but not active. } } else { return 'Install'; // Theme is not installed at all. } } }