Plugin Directory

Changeset 3174601


Ignore:
Timestamp:
10/23/2024 08:15:16 PM (16 months ago)
Author:
bonboarding
Message:

Sample user data in Settings page

Location:
bonboarding
Files:
4 edited
5 copied

Legend:

Unmodified
Added
Removed
  • bonboarding/tags/1.0.5/README.txt

    r3116068 r3174601  
    55Tested up to: 6.6
    66Requires PHP: 8.0
    7 Stable tag: 1.0.4
     7Stable tag: 1.0.5
    88
    99License: GPLv2 or later
     
    4949
    5050== Changelog ==
     51= 1.0.5 - 2024-10-23 =
     52- Added example user data to the settings page.
     53
    5154= 1.0.3 - 2024-05-09 =
    5255- Added an option to only show tours to logged-in users.
  • bonboarding/tags/1.0.5/bonboarding.php

    r3116068 r3174601  
    55 * Description: Create stunning <strong>product tours</strong> to enhance user adoption and engagement with Bonboarding. <strong>No coding required</strong> – design interactive guides, highlight new features, and analyze user interactions to continuously improve the user experience, on any of your WordPress pages.
    66 * License: GPLv2 or later
    7  * Version: 1.0.4
     7 * Version: 1.0.5
    88 * Author: Bonboarding
    99 * Author URI: https://bonboarding.com/
  • bonboarding/tags/1.0.5/integration.php

    r3083902 r3174601  
    44    exit;
    55}
     6
     7require_once(plugin_dir_path(__FILE__) . 'identify.php');
    68
    79/**
     
    5254        return;
    5355    }
    54     $user_id = $current_user->ID;
    55     $first_name = $current_user->user_firstname ? $current_user->user_firstname : $current_user->user_nicename;
    56     $last_name = $current_user->user_lastname ? $current_user->user_lastname : '';
    57     $email = $current_user->user_email;
    58     $sign_up_date = $current_user->user_registered;
    5956
    60     $identifyData = array(
    61         "uniqueID" => $user_id,
    62         "email" => $email,
    63         "signUpDate" => $sign_up_date,
    64     );
    65 
    66     if (!empty($first_name)) {
    67         $identifyData["firstName"] = $first_name;
    68     }
    69 
    70     if (!empty($last_name)) {
    71         $identifyData["lastName"] = $last_name;
    72     }
    73 
     57    $identifyData = get_identify_data();
    7458    $identifyJson = wp_json_encode($identifyData, JSON_UNESCAPED_SLASHES);
    7559
  • bonboarding/tags/1.0.5/settings.php

    r3083902 r3174601  
    44    exit;
    55}
     6
     7require_once(plugin_dir_path(__FILE__) . 'identify.php');
    68
    79add_action('admin_menu', 'bonboarding_menu');
     
    175177        }
    176178
     179        .bonboarding-settings .user-data {
     180            width: fit-content;
     181            margin-top: 10px;
     182            border-radius: 3px;
     183            background-color: rgba(255, 255, 255, 0.8);
     184            box-shadow: 0 10px 15px -3px rgb(0 0 0/0.1),0 4px 6px -4px rgb(0 0 0/0.1);
     185            padding: 10px 20px;
     186            display: grid;
     187            grid-template-columns: 1fr 1fr;
     188        }
     189
     190        .bonboarding-settings .user-data-title {
     191            font-weight: bold;
     192            margin-bottom: 5px;
     193        }
     194
    177195        .logo-circle {
    178196            position: absolute;
     
    349367        'bonboarding-settings',
    350368        'bonboarding-settings-section'
     369    );
     370
     371    // add a HTML block
     372    add_settings_section(
     373        'bonboarding-settings-section-example-user',
     374        'Example User Data',
     375        'bonboarding_example_user_callback',
     376        'bonboarding-settings'
    351377    );
    352378}
     
    426452}
    427453
     454function bonboarding_example_user_callback()
     455{
     456    $current_user = wp_get_current_user();
     457    if (!$current_user->exists()) {
     458        echo '';
     459    }
     460
     461    $identifyData = get_identify_data();
     462
     463    echo "<p class='description'>Example user data, that is sent to Bonboarding about your logged-in users.</p>";
     464    echo "<p class='description'>You can use it for targeting users for specific flows in Bonboarding.</p>";
     465    echo "<div class='user-data'>";
     466    foreach ($identifyData as $key => $value) {
     467        echo "<div class='user-data-title'>$key:</div><div class='user-data-value'>$value</div>";
     468    }
     469    echo '</div>';
     470}
     471
    428472function bonboarding_enqueue_scripts()
    429473{
  • bonboarding/trunk/README.txt

    r3116068 r3174601  
    55Tested up to: 6.6
    66Requires PHP: 8.0
    7 Stable tag: 1.0.4
     7Stable tag: 1.0.5
    88
    99License: GPLv2 or later
     
    4949
    5050== Changelog ==
     51= 1.0.5 - 2024-10-23 =
     52- Added example user data to the settings page.
     53
    5154= 1.0.3 - 2024-05-09 =
    5255- Added an option to only show tours to logged-in users.
  • bonboarding/trunk/bonboarding.php

    r3116068 r3174601  
    55 * Description: Create stunning <strong>product tours</strong> to enhance user adoption and engagement with Bonboarding. <strong>No coding required</strong> – design interactive guides, highlight new features, and analyze user interactions to continuously improve the user experience, on any of your WordPress pages.
    66 * License: GPLv2 or later
    7  * Version: 1.0.4
     7 * Version: 1.0.5
    88 * Author: Bonboarding
    99 * Author URI: https://bonboarding.com/
  • bonboarding/trunk/integration.php

    r3083902 r3174601  
    44    exit;
    55}
     6
     7require_once(plugin_dir_path(__FILE__) . 'identify.php');
    68
    79/**
     
    5254        return;
    5355    }
    54     $user_id = $current_user->ID;
    55     $first_name = $current_user->user_firstname ? $current_user->user_firstname : $current_user->user_nicename;
    56     $last_name = $current_user->user_lastname ? $current_user->user_lastname : '';
    57     $email = $current_user->user_email;
    58     $sign_up_date = $current_user->user_registered;
    5956
    60     $identifyData = array(
    61         "uniqueID" => $user_id,
    62         "email" => $email,
    63         "signUpDate" => $sign_up_date,
    64     );
    65 
    66     if (!empty($first_name)) {
    67         $identifyData["firstName"] = $first_name;
    68     }
    69 
    70     if (!empty($last_name)) {
    71         $identifyData["lastName"] = $last_name;
    72     }
    73 
     57    $identifyData = get_identify_data();
    7458    $identifyJson = wp_json_encode($identifyData, JSON_UNESCAPED_SLASHES);
    7559
  • bonboarding/trunk/settings.php

    r3083902 r3174601  
    44    exit;
    55}
     6
     7require_once(plugin_dir_path(__FILE__) . 'identify.php');
    68
    79add_action('admin_menu', 'bonboarding_menu');
     
    175177        }
    176178
     179        .bonboarding-settings .user-data {
     180            width: fit-content;
     181            margin-top: 10px;
     182            border-radius: 3px;
     183            background-color: rgba(255, 255, 255, 0.8);
     184            box-shadow: 0 10px 15px -3px rgb(0 0 0/0.1),0 4px 6px -4px rgb(0 0 0/0.1);
     185            padding: 10px 20px;
     186            display: grid;
     187            grid-template-columns: 1fr 1fr;
     188        }
     189
     190        .bonboarding-settings .user-data-title {
     191            font-weight: bold;
     192            margin-bottom: 5px;
     193        }
     194
    177195        .logo-circle {
    178196            position: absolute;
     
    349367        'bonboarding-settings',
    350368        'bonboarding-settings-section'
     369    );
     370
     371    // add a HTML block
     372    add_settings_section(
     373        'bonboarding-settings-section-example-user',
     374        'Example User Data',
     375        'bonboarding_example_user_callback',
     376        'bonboarding-settings'
    351377    );
    352378}
     
    426452}
    427453
     454function bonboarding_example_user_callback()
     455{
     456    $current_user = wp_get_current_user();
     457    if (!$current_user->exists()) {
     458        echo '';
     459    }
     460
     461    $identifyData = get_identify_data();
     462
     463    echo "<p class='description'>Example user data, that is sent to Bonboarding about your logged-in users.</p>";
     464    echo "<p class='description'>You can use it for targeting users for specific flows in Bonboarding.</p>";
     465    echo "<div class='user-data'>";
     466    foreach ($identifyData as $key => $value) {
     467        echo "<div class='user-data-title'>$key:</div><div class='user-data-value'>$value</div>";
     468    }
     469    echo '</div>';
     470}
     471
    428472function bonboarding_enqueue_scripts()
    429473{
Note: See TracChangeset for help on using the changeset viewer.