= count( $homes ) ) { $selected_home_index = 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-woocommerce' ) : ( $installed ? __( 'Installed (Inactive)', 'bongoto-woocommerce' ) : __( 'Not Installed', 'bongoto-woocommerce' ) ); $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-woocommerce' ), $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-woocommerce' ); $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-woocommerce' ), $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-woocommerce' ); $action_url = admin_url( 'plugins.php' ); } } else { $action_label = __( 'Installed', 'bongoto-woocommerce' ); $action_url = admin_url( 'plugins.php' ); } ?>