Plugin Directory

Changeset 3245589


Ignore:
Timestamp:
02/24/2025 09:55:11 AM (14 months ago)
Author:
bytesroute
Message:

update to v2.0

Location:
bytes-route-digital-adoption-platform
Files:
12 added
2 edited

Legend:

Unmodified
Added
Removed
  • bytes-route-digital-adoption-platform/trunk/README.txt

    r3101604 r3245589  
    44Tags: product tours, onboarding, tooltip, user onboarding, walkthrough
    55Requires at least: 4.9.0
    6 Tested up to: 6.5.4
    7 Stable tag: 1.0.0
     6Tested up to: 6.7.2
     7Stable tag: 2.0.0
    88Requires PHP: 7.4
    99License: GPLv2
  • bytes-route-digital-adoption-platform/trunk/bytes-route.php

    r2902102 r3245589  
    99 *
    1010 * @link              https://www.bytesroute.com/
    11  * @since             1.0.0
     11 * @since             2.0.0
    1212 * @package           bytes-route
    1313 *
     
    1616 * Plugin URI:        https://www.bytesroute.com/
    1717 * Description:       Bytes Route is a Digital Adoption Platform that assists businesses in increasing user engagement, encouraging product adoption, and lowering churn rates.
    18  * Version:           1.0.0
     18 * Version:           2.0.0
    1919 * Author:            Bytes Route
    2020 * Author URI:        https://www.bytesroute.com/contact.html
     
    102102        }
    103103    }
     104   
     105        // Get Submitted Form Values wplogin
     106    if ($_POST['bytes_route_submit_wplogin'] == 1) {
     107        $error_wplogin = false;
     108        $js_code_wplogin = wp_kses_no_null($_POST['bytes_route_js_code_wplogin']);
     109       
     110        // Checking if js code exists
     111        if (empty($js_code_wplogin)) {
     112            $error_wplogin = false;
     113            $error_wplogin_message = 'Please enter Wplogin Bytes Route Code Snippet.';
     114        } else if(!strpos($js_code_wplogin, 'https://app.bytesroute.com') !== false) {
     115            $error_wplogin = true;
     116            $error_wplogin_message = 'Invalid wplogin Bytes Route Code Snippet.';       
     117        }
     118       
     119        // If no error_wplogin, save option
     120        if (!$error_wplogin) {
     121            update_option('bytes_route_js_code_wplogin', $js_code_wplogin);
     122            $success_wplogin = true;
     123            $success_wplogin_message = 'Wplogin Bytes Route Code Snippet successfully saved.';     
     124        }
     125    }
     126   
    104127
    105128    $js_code = stripslashes(get_option('bytes_route_js_code'));
    106129    $js_code_backend = stripslashes(get_option('bytes_route_js_code_backend'));
     130    $js_code_wplogin = stripslashes(get_option('bytes_route_js_code_wplogin'));
    107131
    108132    $page_content = '<div class="wrap">';
     
    138162    $page_content.= '</form>';
    139163
     164
     165    if ($error_wplogin) {
     166        $page_content .= '<p class="error" style="color:red;">'.esc_html($error_wplogin_message).'</p>';
     167    }
     168    if ($success_wplogin) {
     169        $page_content .= '<p class="success" style="color:green;">'.esc_html($success_wplogin_message).'</p>';
     170    }
     171
     172    $page_content.= '<form method="post" action="" ><input type="hidden" value="1" name="bytes_route_submit_wplogin">';
     173    $page_content.= '<table class="form-table" role="presentation"><tbody><tr><th scope="row"><label for="blogname">Wplogin Bytes Route Code Snippet</label></th><td><textarea name="bytes_route_js_code_wplogin" rows="4" cols="60" id="moderation_keys" class="code">'.esc_textarea($js_code_wplogin).'</textarea></td></tr></tbody></table>';
     174    $page_content.= '<p class="submit"><input type="submit" value="Save" name="submit" class="button button-primary"></p>';
     175    $page_content.= '</form>';
     176
     177
     178
    140179    $page_content.= '</div>';
    141180    echo wp_kses_no_null($page_content);
     
    169208}
    170209add_action( 'admin_head', 'bytesroutedotcom_js_code_display_backend' );
     210
     211
     212// Display on wplogin
     213if ( ! function_exists( 'bytesroutedotcom_js_code_display_wplogin' ) ) {
     214    function bytesroutedotcom_js_code_display_wplogin() {
     215
     216        $js_code_wplogin = stripslashes(get_option('bytes_route_js_code_wplogin'));
     217        if ($js_code_wplogin) {
     218            echo  wp_kses_no_null($js_code_wplogin);
     219
     220        }
     221    }
     222}
     223add_action( 'login_footer', 'bytesroutedotcom_js_code_display_wplogin' );
Note: See TracChangeset for help on using the changeset viewer.