'error|warning|success|info', 'message' => '...' ]. $notice = get_transient( 'bongoto_shop_demo_notice' ); $notice_type = 'info'; $notice_msg = ''; if ( $notice ) { delete_transient( 'bongoto_shop_demo_notice' ); if ( is_array( $notice ) ) { $notice_type = isset( $notice['type'] ) ? sanitize_key( (string) $notice['type'] ) : 'info'; $notice_msg = isset( $notice['message'] ) ? (string) $notice['message'] : ''; } else { $notice_msg = (string) $notice; } $allowed = array( 'error', 'warning', 'success', 'info' ); if ( ! in_array( $notice_type, $allowed, true ) ) { $notice_type = 'info'; } } $elementor_ok = class_exists( '\\Elementor\\Plugin' ); $woocommerce_ok = class_exists( 'WooCommerce' ) || function_exists( 'WC' ); $plugins_ok = $elementor_ok && $woocommerce_ok; $active = function_exists( 'bongoto_is_premium_active' ) ? bongoto_is_premium_active() : (bool) get_option( 'bongoto_premium_active', false ); $last_error = (string) get_option( 'bongoto_premium_last_error', '' ); $license_url = admin_url( 'admin.php?page=bongoto-shop' ); $setup_url = admin_url( 'admin.php?page=bongoto-shop-setup' ); $free_home_id = (int) get_option( 'bongoto_shop_free_home_id', 0 ); $pro_imported = (bool) get_option( 'bongoto_shop_pro_assets_imported', false ); $last_created_home_id = (int) get_option( 'bongoto_shop_last_created_home_id', 0 ); $home_view_url = ''; if ( $last_created_home_id > 0 ) { $home_view_url = get_permalink( $last_created_home_id ); } ?>
'elementor', 'file' => 'elementor/elementor.php', 'name' => 'Elementor', 'active' => $elementor_ok, ], [ 'slug' => 'woocommerce', 'file' => 'woocommerce/woocommerce.php', 'name' => 'WooCommerce', 'active' => $woocommerce_ok, ], ]; foreach ( $plugins as $p ) : $slug = (string) $p['slug']; $file = (string) $p['file']; $name = (string) $p['name']; $installed = file_exists( WP_PLUGIN_DIR . '/' . $file ); $is_active = $installed && function_exists( 'is_plugin_active' ) ? is_plugin_active( $file ) : false; $status_text = $is_active ? __( 'Active', 'bongoto-shop' ) : ( $installed ? __( 'Installed (Inactive)', 'bongoto-shop' ) : __( 'Not Installed', 'bongoto-shop' ) ); $badge_class = $is_active ? 'ok' : 'no'; // Primary action button $action_label = ''; $action_url = ''; $action_class = 'button button-secondary'; if ( ! $installed ) { if ( current_user_can( 'install_plugins' ) ) { $action_label = sprintf( __( 'Install %s', 'bongoto-shop' ), $name ); $action_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $slug ), 'install-plugin_' . $slug ); $action_class = 'button button-primary'; } else { $action_label = __( 'Open Plugins', 'bongoto-shop' ); $action_url = admin_url( 'plugin-install.php?tab=search&s=' . rawurlencode( $name ) ); } } elseif ( ! $is_active ) { if ( current_user_can( 'activate_plugins' ) ) { $action_label = sprintf( __( 'Activate %s', 'bongoto-shop' ), $name ); $action_url = wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=' . rawurlencode( $file ) ), 'activate-plugin_' . $file ); $action_class = 'button button-primary'; } else { $action_label = __( 'Open Plugins', 'bongoto-shop' ); $action_url = admin_url( 'plugins.php' ); } } else { $action_label = __( 'Installed', 'bongoto-shop' ); $action_url = admin_url( 'plugins.php' ); } ?>