ACA_VERSION, 'menu_items' => self::get_default_menu_items(), 'dashboard_widgets' => self::get_default_dashboard_widgets(), 'primary_color' => '#5304c1', 'enable_dark_mode' => false, ); if ( ! get_option( 'aca_settings' ) ) { add_option( 'aca_settings', $default_options ); } } /** * Get default menu items. * * @return array */ private static function get_default_menu_items() { return array( array( 'id' => 'dashboard', 'label' => __( 'Dashboard', 'advanced-customer-account' ), 'icon' => 'dashboard', 'endpoint' => 'dashboard', 'visible' => true, 'order' => 1, ), array( 'id' => 'orders', 'label' => __( 'Orders', 'advanced-customer-account' ), 'icon' => 'cart', 'endpoint' => 'orders', 'visible' => true, 'order' => 2, ), array( 'id' => 'addresses', 'label' => __( 'Addresses', 'advanced-customer-account' ), 'icon' => 'location', 'endpoint' => 'addresses', 'visible' => true, 'order' => 3, ), array( 'id' => 'profile', 'label' => __( 'Account Details', 'advanced-customer-account' ), 'icon' => 'admin-users', 'endpoint' => 'profile', 'visible' => true, 'order' => 4, ), array( 'id' => 'downloads', 'label' => __( 'Downloads', 'advanced-customer-account' ), 'icon' => 'download', 'endpoint' => 'downloads', 'visible' => true, 'order' => 5, ), ); } /** * Get default dashboard widgets. * * @return array */ private static function get_default_dashboard_widgets() { return array( 'welcome' => true, 'quick_stats' => true, 'recent_orders' => true, 'quick_actions' => true, ); } /** * Create custom database tables. */ private static function create_tables() { global $wpdb; $charset_collate = $wpdb->get_charset_collate(); // Activity log table. $table_name = $wpdb->prefix . 'aca_activity_log'; $sql = "CREATE TABLE IF NOT EXISTS $table_name ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, user_id bigint(20) unsigned NOT NULL, activity_type varchar(50) NOT NULL, activity_data longtext, created_at datetime DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id), KEY user_id (user_id), KEY created_at (created_at) ) $charset_collate;"; require_once ABSPATH . 'wp-admin/includes/upgrade.php'; dbDelta( $sql ); } }