get_charset_collate(); dbDelta("CREATE TABLE {$wpdb->prefix}bsh_pages ( id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, user_id BIGINT UNSIGNED NOT NULL, username VARCHAR(90) NOT NULL, page_name VARCHAR(180) DEFAULT 'My Page', display_name VARCHAR(180) DEFAULT '', title VARCHAR(220) DEFAULT '', bio TEXT NULL, avatar_url TEXT NULL, page_type VARCHAR(80) DEFAULT 'creator', theme VARCHAR(60) DEFAULT 'dark_purple', contact_enabled TINYINT(1) DEFAULT 1, status VARCHAR(30) DEFAULT 'published', branding TINYINT(1) DEFAULT 1, is_default TINYINT(1) DEFAULT 1, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id), UNIQUE KEY username (username), KEY user_id (user_id) ) $charset;"); dbDelta("CREATE TABLE {$wpdb->prefix}bsh_links ( id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, page_id BIGINT UNSIGNED NOT NULL, label VARCHAR(220) NOT NULL, url TEXT NOT NULL, icon VARCHAR(80) DEFAULT 'link', sort_order INT DEFAULT 10, is_active TINYINT(1) DEFAULT 1, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id), KEY page_id (page_id) ) $charset;"); dbDelta("CREATE TABLE {$wpdb->prefix}bsh_clicks ( id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, page_id BIGINT UNSIGNED NOT NULL, link_id BIGINT UNSIGNED DEFAULT 0, ip_hash VARCHAR(140) DEFAULT '', user_agent TEXT NULL, referrer TEXT NULL, clicked_at DATETIME DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id), KEY page_id (page_id), KEY link_id (link_id) ) $charset;"); dbDelta("CREATE TABLE {$wpdb->prefix}bsh_leads ( id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, page_id BIGINT UNSIGNED NOT NULL, name VARCHAR(180) DEFAULT '', email VARCHAR(220) DEFAULT '', message TEXT NULL, is_read TINYINT(1) DEFAULT 0, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id), KEY page_id (page_id) ) $charset;"); $pages = [ 'home' => ['Home', '[bsh_home]'], 'login' => ['Login', '[bsh_login]'], 'register' => ['Register', '[bsh_register]'], 'setup' => ['Setup', '[bsh_setup]'], 'dashboard' => ['Dashboard', '[bsh_dashboard]'], 'my-pages' => ['My Pages', '[bsh_pages]'], 'editor' => ['Editor', '[bsh_editor]'], 'links' => ['Links', '[bsh_links]'], 'analytics' => ['Analytics', '[bsh_analytics]'], 'leads' => ['Leads', '[bsh_leads]'], 'themes' => ['Themes', '[bsh_themes]'], 'free-plan' => ['Free Plan', '[bsh_free_plan]'], 'settings' => ['Settings', '[bsh_settings]'], 'features' => ['Features', '[bsh_features]'], 'control-centre' => ['Control Centre', '[bsh_admin]'], ]; foreach ($pages as $slug => $data) { $existing = get_page_by_path($slug); if (!$existing) { wp_insert_post([ 'post_title' => $data[0], 'post_name' => $slug, 'post_status' => 'publish', 'post_type' => 'page', 'post_content' => $data[1], ]); } else { wp_update_post([ 'ID' => $existing->ID, 'post_status' => 'publish', 'post_content' => $data[1], ]); } } $home = get_page_by_path('home'); if ($home) { update_option('show_on_front', 'page'); update_option('page_on_front', $home->ID); } if (!get_option('bsh_routes_flushed_v4')) { flush_rewrite_rules(false); update_option('bsh_routes_flushed_v4', 1); } } /* ========================================================= HELPERS ========================================================= */ function bsh_url($slug = '') { return home_url('/' . trim($slug, '/') . '/'); } function bsh_tbl($name) { global $wpdb; return $wpdb->prefix . 'bsh_' . $name; } function bsh_clean_username($username) { $username = strtolower(sanitize_title($username)); return trim(preg_replace('/[^a-z0-9\-]/', '', $username), '-'); } function bsh_redirect($url) { wp_safe_redirect($url); exit; } function bsh_auth_required() { if (!is_user_logged_in()) bsh_redirect(bsh_url('login')); } function bsh_app_pages() { return [ 'home','login','register','setup','dashboard','my-pages','editor','links', 'analytics','leads','themes','free-plan','settings','features','control-centre' ]; } function bsh_is_app_page() { return is_page(bsh_app_pages()) || get_query_var('bsh_profile'); } function bsh_unique_username($base, $ignore_id = 0) { global $wpdb; $base = bsh_clean_username($base); if (!$base) $base = 'page'; $username = $base; $i = 2; while (true) { $exists = $wpdb->get_var($wpdb->prepare( "SELECT id FROM " . bsh_tbl('pages') . " WHERE username=%s AND id!=%d", $username, $ignore_id )); if (!$exists) return $username; $username = $base . '-' . $i; $i++; } } function bsh_current_page() { if (!is_user_logged_in()) return null; global $wpdb; $page = $wpdb->get_row($wpdb->prepare( "SELECT * FROM " . bsh_tbl('pages') . " WHERE user_id=%d AND is_default=1 ORDER BY id ASC LIMIT 1", get_current_user_id() )); if (!$page) { $user = wp_get_current_user(); $username = bsh_unique_username($user->user_login ?: 'user'); $wpdb->insert(bsh_tbl('pages'), [ 'user_id' => get_current_user_id(), 'username' => $username, 'page_name' => 'Main Page', 'display_name' => $user->display_name ?: $username, 'title' => 'Creator | Business | Services', 'bio' => 'Welcome to my official BioSparkHub page.', 'page_type' => 'creator', 'theme' => 'dark_purple', 'status' => 'published', 'is_default' => 1, ]); $page_id = $wpdb->insert_id; bsh_seed_links($page_id, 'creator'); $page = $wpdb->get_row($wpdb->prepare( "SELECT * FROM " . bsh_tbl('pages') . " WHERE id=%d", $page_id )); } return $page; } function bsh_icons() { return [ 'link' => '🔗', 'website' => '🌐', 'instagram' => '📸', 'tiktok' => '🎶', 'youtube' => '▶️', 'x' => '𝕏', 'facebook' => 'f', 'linkedin' => 'in', 'snapchat' => '👻', 'whatsapp' => '💬', 'telegram' => '✈️', 'email' => '✉️', 'phone' => '📞', 'booking' => '📅', 'shop' => '🛒', 'music' => '🎵', 'spotify' => '🎧', 'apple_music' => '', 'soundcloud' => '☁️', 'twitch' => '🟣', 'discord' => '🎮', 'training' => '🏋️', 'food' => '🍎', 'gallery' => '🖼️', 'star' => '⭐', ]; } function bsh_icon($icon) { $icons = bsh_icons(); return $icons[$icon] ?? '🔗'; } function bsh_starter_links($type) { $sets = [ 'business' => [ ['View Our Services', 'https://example.com', 'website'], ['Book A Consultation', 'https://example.com', 'booking'], ['WhatsApp Us', 'https://wa.me/440000000000', 'whatsapp'], ['Follow On X', 'https://x.com', 'x'], ], 'music' => [ ['Listen On Spotify', 'https://spotify.com', 'spotify'], ['Watch On YouTube', 'https://youtube.com', 'youtube'], ['Follow On TikTok', 'https://tiktok.com', 'tiktok'], ['Book Me', 'https://example.com', 'booking'], ], 'fitness' => [ ['Book A Training Session', 'https://example.com', 'booking'], ['View Programmes', 'https://example.com', 'training'], ['Client Transformations', 'https://example.com', 'gallery'], ['WhatsApp Me', 'https://wa.me/440000000000', 'whatsapp'], ], 'beauty' => [ ['Book An Appointment', 'https://example.com', 'booking'], ['View Services', 'https://example.com', 'shop'], ['Instagram Gallery', 'https://instagram.com', 'instagram'], ['WhatsApp Me', 'https://wa.me/440000000000', 'whatsapp'], ], 'shop' => [ ['Shop Now', 'https://example.com', 'shop'], ['Best Sellers', 'https://example.com', 'star'], ['Customer Reviews', 'https://example.com', 'star'], ['Contact Us', 'mailto:hello@example.com', 'email'], ], 'creator' => [ ['My Website', 'https://example.com', 'website'], ['Follow On Instagram', 'https://instagram.com', 'instagram'], ['Follow On X', 'https://x.com', 'x'], ['Contact Me', 'mailto:hello@example.com', 'email'], ], ]; return $sets[$type] ?? $sets['creator']; } function bsh_seed_links($page_id, $type = 'creator') { global $wpdb; $count = (int) $wpdb->get_var($wpdb->prepare( "SELECT COUNT(*) FROM " . bsh_tbl('links') . " WHERE page_id=%d", $page_id )); if ($count > 0) return; foreach (bsh_starter_links($type) as $i => $link) { $wpdb->insert(bsh_tbl('links'), [ 'page_id' => $page_id, 'label' => $link[0], 'url' => $link[1], 'icon' => $link[2], 'sort_order' => $i + 1, 'is_active' => 1, ]); } } function bsh_upload_image($field) { if (empty($_FILES[$field]['name'])) return ''; require_once ABSPATH . 'wp-admin/includes/file.php'; $file = $_FILES[$field]; $allowed = ['image/jpeg', 'image/png', 'image/webp']; if (!in_array($file['type'], $allowed, true)) return ''; if ($file['size'] > 3 * 1024 * 1024) return ''; $upload = wp_handle_upload($file, ['test_form' => false]); return !empty($upload['url']) ? esc_url_raw($upload['url']) : ''; } /* ========================================================= LOCK WORDPRESS FOR NORMAL USERS ========================================================= */ add_filter('show_admin_bar', function ($show) { return current_user_can('manage_options') ? $show : false; }); add_action('admin_init', function () { if (current_user_can('manage_options')) return; if (wp_doing_ajax()) return; bsh_redirect(bsh_url('dashboard')); }); /* ========================================================= CSS ========================================================= */ add_filter('body_class', function ($classes) { if (bsh_is_app_page()) $classes[] = 'bsh-page'; return $classes; }, 999); add_action('wp_head', function () { if (!bsh_is_app_page()) return; ?>

Still there?

You have been inactive. You will be signed out in 60 seconds.

Preview Edit Links Sign Out Features Dashboard Login Start Free
['Dashboard','dashboard'], 'pages' => ['My Pages','my-pages'], 'links' => ['Links','links'], 'analytics' => ['Analytics','analytics'], 'leads' => ['Leads','leads'], 'themes' => ['Themes','themes'], 'plan' => ['Free Plan','free-plan'], 'settings' => ['Settings','settings'], ]; ob_start(); ?>
Free link-in-bio builder

One smart page for all your links.

Create a beautiful free page for your brand, business, content, bookings, products and services in minutes.

Create Your Free Page See Features

Your Brand

Creator | Business | Services 🌐 My Website 📅 Book Me 📸 Instagram 𝕏 Follow On X
Powered by BioSparkHub
Security check failed.'; } else { $name = sanitize_text_field($_POST['name'] ?? ''); $email = sanitize_email($_POST['email'] ?? ''); $username = bsh_clean_username($_POST['username'] ?? ''); $password = $_POST['password'] ?? ''; if (!$name || !$email || !$username || !$password) { $msg = '
Please complete all fields.
'; } elseif (username_exists($username) || email_exists($email)) { $msg = '
Username or email already exists.
'; } else { $user_id = wp_create_user($username, $password, $email); if (is_wp_error($user_id)) { $msg = '
' . esc_html($user_id->get_error_message()) . '
'; } else { wp_update_user(['ID' => $user_id, 'display_name' => $name]); wp_set_current_user($user_id); wp_set_auth_cookie($user_id); bsh_redirect(bsh_url('setup')); } } } } return bsh_auth_screen('Create Your Free Page', 'Set up your BioSparkHub page in under two minutes.', 'register', $msg); }); add_shortcode('bsh_login', function () { if (is_user_logged_in()) bsh_redirect(bsh_url('dashboard')); $msg = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['bsh_login_nonce'])) { if (!wp_verify_nonce($_POST['bsh_login_nonce'], 'bsh_login')) { $msg = '
Security check failed.
'; } else { $user = wp_signon([ 'user_login' => sanitize_text_field($_POST['login'] ?? ''), 'user_password' => $_POST['password'] ?? '', 'remember' => true, ], false); if (is_wp_error($user)) { $msg = '
Login failed. Please check your details.
'; } else { bsh_redirect(bsh_url('dashboard')); } } } return bsh_auth_screen('Welcome Back', 'Login to manage your BioSparkHub page.', 'login', $msg); }); function bsh_auth_screen($title, $subtitle, $type, $msg) { ob_start(); ?>

user_login); $avatar = bsh_upload_image('avatar_file'); $wpdb->insert(bsh_tbl('pages'), [ 'user_id' => get_current_user_id(), 'username' => $username, 'page_name' => 'Main Page', 'display_name' => sanitize_text_field($_POST['display_name'] ?? $user->display_name), 'title' => sanitize_text_field($_POST['title'] ?? 'Creator | Business | Services'), 'bio' => sanitize_textarea_field($_POST['bio'] ?? 'Welcome to my BioSparkHub page.'), 'avatar_url' => $avatar, 'page_type' => $type, 'theme' => sanitize_text_field($_POST['theme'] ?? 'dark_purple'), 'status' => 'published', 'is_default' => 1, ]); bsh_seed_links($wpdb->insert_id, $type); bsh_redirect(bsh_url('dashboard')); } ob_start(); ?>

Quick Setup

Choose what you do and BioSparkHub will create starter links for you.

get_var($wpdb->prepare("SELECT COUNT(*) FROM ".bsh_tbl('clicks')." WHERE page_id=%d", $page->id)); $today = (int)$wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM ".bsh_tbl('clicks')." WHERE page_id=%d AND DATE(clicked_at)=CURDATE()", $page->id)); $links = (int)$wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM ".bsh_tbl('links')." WHERE page_id=%d", $page->id)); $leads = (int)$wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM ".bsh_tbl('leads')." WHERE page_id=%d", $page->id)); $public = home_url('/b/' . $page->username); $qr = 'https://api.qrserver.com/v1/create-qr-code/?size=260x260&data=' . rawurlencode($public); ob_start(); ?>
Total Clicks
Today
Links
Leads

Your Free Page Is Live

Open Public Page Manage Links

QR Code

Quick Actions

Edit Profile

Add Link

Free Launch

BioSparkHub is free first. Share your page and grow your audience.

@font-face{font-family:DMSans;font-style:normal;font-weight:400;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/DMSans-Regular.ttf') format('truetype');} @font-face{font-family:DMSans;font-style:italic;font-weight:400;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/DMSans-Italic.ttf') format('truetype');} @font-face{font-family:DMSans;font-style:normal;font-weight:500;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/DMSans-Medium.ttf') format('truetype');} @font-face{font-family:DMSans;font-style:italic;font-weight:500;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/DMSans-MediumItalic.ttf') format('truetype');} @font-face{font-family:DMSans;font-style:normal;font-weight:700;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/DMSans-Bold.ttf') format('truetype');} @font-face{font-family:DMSans;font-style:italic;font-weight:700;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/DMSans-BoldItalic.ttf') format('truetype');} @font-face{font-family:Caudex;font-style:normal;font-weight:400;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/Caudex-Regular.ttf') format('truetype');} @font-face{font-family:Cormorant;font-style:normal;font-weight:400;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/Cormorant-Regular.ttf') format('truetype');} @font-face{font-family:DMSerifDisplay;font-style:normal;font-weight:400;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/DMSerifDisplay-Regular.ttf') format('truetype');} @font-face{font-family:FiraSans;font-style:normal;font-weight:400;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/FiraSans-Regular.ttf') format('truetype');} @font-face{font-family:Gruppo;font-style:normal;font-weight:400;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/Gruppo-Regular.ttf') format('truetype');} @font-face{font-family:Junge;font-style:normal;font-weight:400;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/Junge-Regular.ttf') format('truetype');} @font-face{font-family:Montserrat;font-style:normal;font-weight:400;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/Montserrat-Regular.ttf') format('truetype');} @font-face{font-family:NunitoSans;font-style:normal;font-weight:variable;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/NunitoSans-Variable.ttf') format('truetype');} @font-face{font-family:PlayfairDisplay;font-style:normal;font-weight:400;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/PlayfairDisplay-Regular.ttf') format('truetype');} @font-face{font-family:Poppins;font-style:normal;font-weight:400;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/Poppins-Regular.ttf') format('truetype');} @font-face{font-family:Prompt;font-style:normal;font-weight:400;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/Prompt-Regular.ttf') format('truetype');} @font-face{font-family:ProstoOne;font-style:normal;font-weight:400;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/ProstoOne-Regular.ttf') format('truetype');} @font-face{font-family:Roboto;font-style:normal;font-weight:400;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/Roboto-Regular.ttf') format('truetype');} @font-face{font-family:TitilliumWeb;font-style:normal;font-weight:400;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/TitilliumWeb-Regular.ttf') format('truetype');} @font-face{font-family:Trirong;font-style:normal;font-weight:400;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/Trirong-Regular.ttf') format('truetype');} @font-face{font-family:Lato;font-style:normal;font-weight:400;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/Lato-Regular.ttf') format('truetype');} @font-face{font-family:"IBM Plex Mono";font-style:normal;font-weight:400;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/IBMPlexMono-Regular.ttf') format('truetype');} @font-face{font-family:Prata;font-style:normal;font-weight:400;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/Prata-Regular.ttf') format('truetype');} @font-face{font-family:Catamaran;font-style:normal;font-weight:variable;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/Catamaran-Variable.ttf') format('truetype');} @font-face{font-family:"Open Sans";font-style:normal;font-weight:variable;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/OpenSans-Variable.ttf') format('truetype');} @font-face{font-family:Manrope;font-style:normal;font-weight:variable;font-display:fallback;src:url('https://biosparkhub.com/wp-content/themes/hostinger-ai-theme/assets/fonts/Manrope-Variable.ttf') format('truetype');}

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!