Plugin Directory

Changeset 3361774


Ignore:
Timestamp:
09/15/2025 12:18:24 PM (6 months ago)
Author:
krishaweb
Message:

Translation and minor bug fixes

Location:
lazy-sign-in
Files:
80 added
10 edited

Legend:

Unmodified
Added
Removed
  • lazy-sign-in/trunk/admin/assets/css/plugin.css

    r3345124 r3361774  
    370370    background:none !important;
    371371}
     372#addtag label > span{
     373    font-size: 12px;
     374}
    372375
    373376@media (max-width: 960px) {
  • lazy-sign-in/trunk/admin/assets/js/setting.js

    r3345124 r3361774  
    1 jQuery(document).on('click',".add_field",function(event) {
    2     var row = jQuery(this).parents("div.clone").last().clone({
    3         withDataAndEvents: true
    4     }).insertAfter(".clone:last").find('input').val('');
    5     jQuery("div.clone:last").find('input[type="checkbox"]').removeAttr('checked');
    6     var rowCount = jQuery('.add-new-text-field-wrap .clone').length;
    7     jQuery(".clone").last().find('input[type="checkbox"]').val(rowCount);
    8     jQuery(this).addClass('remove_field').removeClass('add_field').html('Remove');
    9 });
    10 jQuery(document).on('click',".remove_field",function (event) {
    11     jQuery(this).parent().parent().remove();
    12     jQuery.each(jQuery('.clone input[name="require[]"]'), function(i,val){
    13         if((jQuery(this).val()) ){
    14             jQuery(this).val(i+1);
     1jQuery(document).ready(function () {
     2    jQuery(document).on('click',".add_field",function(event) {
     3        var row = jQuery(this).parents("div.clone").last().clone({
     4            withDataAndEvents: true
     5        }).insertAfter(".clone:last").find('input').val('');
     6        jQuery("div.clone:last").find('input[type="checkbox"]').removeAttr('checked');
     7        var rowCount = jQuery('.add-new-text-field-wrap .clone').length;
     8        jQuery(".clone").last().find('input[type="checkbox"]').val(rowCount);
     9        jQuery(this).addClass('remove_field').removeClass('add_field').html('Remove');
     10    });
     11    jQuery(document).on('click',".remove_field",function (event) {
     12        jQuery(this).parent().parent().remove();
     13        jQuery.each(jQuery('.clone input[name="require[]"]'), function(i,val){
     14            if((jQuery(this).val()) ){
     15                jQuery(this).val(i+1);
     16            }
     17        });
     18        jQuery.each(jQuery('.clone input[name="unique[]"]'), function(i,val){
     19            if((jQuery(this).val()) ){
     20                jQuery(this).val(i+1);
     21            }
     22        });
     23    });
     24    jQuery.each( jQuery('.input-group.floating input'), function( i, val ){
     25        var text_val = jQuery(this).val();
     26        if(text_val === "") {
     27          jQuery(this).removeClass('has-value');     
     28        } else {
     29          jQuery(this).addClass('has-value');
    1530        }
    1631    });
    17     jQuery.each(jQuery('.clone input[name="unique[]"]'), function(i,val){
    18         if((jQuery(this).val()) ){
    19             jQuery(this).val(i+1);
     32    jQuery('.input-group.floating input').focusout(function(){
     33        var text_val = jQuery(this).val();
     34        if(text_val === "") {
     35          jQuery(this).removeClass('has-value');     
     36        } else {
     37          jQuery(this).addClass('has-value');
    2038        }
    2139    });
    22 });
    23 jQuery(function(){
    24     jQuery.each( jQuery('.input-group.floating input'), function( i, val ){
    25         var text_val = jQuery(this).val();
    26         if(text_val === "") {
    27           jQuery(this).removeClass('has-value');     
    28         } else {
    29           jQuery(this).addClass('has-value');
    30         }
    31     });
    32     jQuery('.input-group.floating input').focusout(function(){
    33         var text_val = jQuery(this).val();
    34         if(text_val === "") {
    35           jQuery(this).removeClass('has-value');     
    36         } else {
    37           jQuery(this).addClass('has-value');
    38         }
    39     });
    4040    //checkbox auto checked function.
    41     function updatePasswordCheckbox() {
     41    function updatePasswordCheckbox() {
    4242        if (jQuery('#lsi_generate_username').is(':checked')) {
    4343            jQuery('#lsi_generate_password, #lsi_send_user_thankyou').prop('checked', true).attr('checked', 'checked').css('pointer-events', 'none');
     
    7070    });
    7171
    72 
    7372    // On submit stay on same page on admin side
    7473    jQuery('#submit-login').on('click', function() {
  • lazy-sign-in/trunk/admin/form.php

    r3345124 r3361774  
    66 */
    77
     8$post_data = array();
     9
    810if (
    911    isset( $_POST['submit-login'], $_POST['_wpnonce'] ) &&
    1012    wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['_wpnonce'] ) ) )
    1113) {
    12 
    13     // Save login heading text.
    14     if ( isset( $_POST['lsi_login_heading_text'] ) ) {
    15         $login_heading_text = sanitize_text_field( wp_unslash( $_POST['lsi_login_heading_text'] ) );
    16         update_option( 'lsi_login_heading_text', $login_heading_text );
    17     }
    18 
    19     // Save login redirect link.
    20     if ( isset( $_POST['lsi_login_redirect_link'] ) ) {
    21         $login_redirect_url = esc_url_raw( wp_unslash( $_POST['lsi_login_redirect_link'] ) );
    22 
    23         if ( ! empty( $login_redirect_url ) ) {
    24             update_option( 'lsi_login_redirect_link', $login_redirect_url );
    25         } else {
    26             $error_login = 'Invalid redirection link after success: ' . sanitize_text_field( wp_unslash( $_POST['lsi_login_redirect_link'] ) );
    27         }
    28     }
    29 
    30     // Save signup link on the login page.
    31     if ( isset( $_POST['lsi_signup_link'] ) ) {
    32         $signup_link = esc_url_raw( wp_unslash( $_POST['lsi_signup_link'] ) );
    33 
    34         if ( ! empty( $signup_link ) ) {
    35             update_option( 'lsi_signup_link', $signup_link );
    36         } else {
    37             $error_signup = 'Invalid redirection link after success: ' . sanitize_text_field( wp_unslash( $_POST['lsi_signup_link'] ) );
    38         }
    39     }
     14    $post_data['lsi_login_heading_text']  = isset( $_POST['lsi_login_heading_text'] ) ? sanitize_text_field( wp_unslash( $_POST['lsi_login_heading_text'] ) ) : '';
     15    $post_data['lsi_login_redirect_link'] = isset( $_POST['lsi_login_redirect_link'] ) ? esc_url_raw( wp_unslash( $_POST['lsi_login_redirect_link'] ) ) : '';
     16    $post_data['lsi_signup_link']         = isset( $_POST['lsi_signup_link'] ) ? esc_url_raw( wp_unslash( $_POST['lsi_signup_link'] ) ) : '';
    4017}
    4118
     
    4926    wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['_wpnonce'] ) ) )
    5027) {
    51     // Save signup heading text.
    52     if ( isset( $_POST['lsi_signup_heading_text'] ) ) {
    53         update_option(
    54             'lsi_signup_heading_text',
    55             sanitize_text_field( wp_unslash( $_POST['lsi_signup_heading_text'] ) )
    56         );
    57     }
    58 
    59     // Save signup redirect link.
    60     if ( isset( $_POST['lsi_signup_redirect_link'] ) ) {
    61         $signup_redirect_url = esc_url_raw( wp_unslash( $_POST['lsi_signup_redirect_link'] ) );
    62         if ( ! empty( $signup_redirect_url ) ) {
    63             update_option( 'lsi_signup_redirect_link', $signup_redirect_url );
    64         } else {
    65             $error_signup_success = 'Invalid redirection link after success.';
    66         }
    67     }
    68 
    69     // Save login link on signup page.
    70     if ( isset( $_POST['lsi_login_link'] ) ) {
    71         $login_link = esc_url_raw( wp_unslash( $_POST['lsi_login_link'] ) );
    72         if ( ! empty( $login_link ) ) {
    73             update_option( 'lsi_login_link', $login_link );
    74         } else {
    75             $error_login_link = 'Invalid login link: ' . sanitize_text_field( wp_unslash( $_POST['lsi_login_link'] ) );
    76         }
    77     }
    78 
    79     // Save terms and conditions link.
    80     if ( isset( $_POST['lsi_terms_condition_link'] ) ) {
    81         $terms_link = esc_url_raw( wp_unslash( $_POST['lsi_terms_condition_link'] ) );
    82         if ( ! empty( $terms_link ) ) {
    83             update_option( 'lsi_terms_condition_link', $terms_link );
    84         } else {
    85             $error_terms_condition_link = 'Invalid terms and condition link: ' . sanitize_text_field( wp_unslash( $_POST['lsi_terms_condition_link'] ) );
    86         }
    87     }
    88 
    89     // Save signup role.
    90     if ( isset( $_POST['lsi_signup_role'] ) ) {
    91         update_option(
    92             'lsi_signup_role',
    93             sanitize_text_field( wp_unslash( $_POST['lsi_signup_role'] ) )
    94         );
    95     }
    96 
    97     // Save generate username option.
    98     update_option(
    99         'lsi_generate_username',
    100         ! empty( $_POST['lsi_generate_username'] ) ? '1' : '0'
    101     );
    102 
    103     // Save generate password option.
    104     update_option(
    105         'lsi_generate_password',
    106         ! empty( $_POST['lsi_generate_password'] ) ? '1' : '0'
    107     );
    108 
    109     // Send email to user.
    110     update_option(
    111         'lsi_send_user_thankyou',
    112         ! empty( $_POST['lsi_send_user_thankyou'] ) ? '1' : '0'
    113     );
     28    $post_data['lsi_signup_heading_text']  = isset( $_POST['lsi_signup_heading_text'] ) ? sanitize_text_field( wp_unslash( $_POST['lsi_signup_heading_text'] ) ) : '';
     29    $post_data['lsi_signup_redirect_link'] = isset( $_POST['lsi_signup_redirect_link'] ) ? esc_url_raw( wp_unslash( $_POST['lsi_signup_redirect_link'] ) ) : '';
     30    $post_data['lsi_login_link']           = isset( $_POST['lsi_login_link'] ) ? esc_url_raw( wp_unslash( $_POST['lsi_login_link'] ) ) : '';
     31    $post_data['lsi_terms_condition_link'] = isset( $_POST['lsi_terms_condition_link'] ) ? esc_url_raw( wp_unslash( $_POST['lsi_terms_condition_link'] ) ) : '';
     32    $post_data['lsi_signup_role']          = isset( $_POST['lsi_signup_role'] ) ? sanitize_text_field( wp_unslash( $_POST['lsi_signup_role'] ) ) : '';
     33    $post_data['lsi_generate_username']    = isset( $_POST['lsi_generate_username'] ) && 'on' === $_POST['lsi_generate_username'] ? '1' : '0';
     34    $post_data['lsi_generate_password']    = isset( $_POST['lsi_generate_password'] ) && 'on' === $_POST['lsi_generate_password'] ? '1' : '0';
     35    $post_data['lsi_send_user_thankyou']   = isset( $_POST['lsi_send_user_thankyou'] ) && 'on' === $_POST['lsi_send_user_thankyou'] ? '1' : '0';
    11436
    11537    // Handle extra fields.
     
    13557        }
    13658        update_option( 'lsi_extra_fields', $extra_fields );
     59    }
     60}
     61
     62if ( ! empty( $post_data ) ) {
     63    foreach ( $post_data as $key => $value ) {
     64        update_option( $key, $value );
    13765    }
    13866}
     
    15785        <div class="lazy_sign_in_login-sidebar">
    15886        <div class="lazy_sign_in_login-logo">
    159             <img src="<?php echo esc_url( LAZY_SIGN_IN_PLUGIN_URL . 'assets/images/logo.png' ); ?>" class="logo-large" alt=""/>
    160             <img src="<?php echo esc_url( LAZY_SIGN_IN_PLUGIN_URL . 'assets/images/logo-sm.png' ); ?>" class="logo-sm" alt="" />
     87            <img src="<?php echo esc_url( LAZY_SIGN_IN_PLUGIN_URL . 'assets/images/logo.png' ); ?>" class="logo-large" alt="<?php esc_attr_e( 'Lazy Sign In Logo - Large', 'lazy-signin' ); ?>" />
     88            <img src="<?php echo esc_url( LAZY_SIGN_IN_PLUGIN_URL . 'assets/images/logo-sm.png' ); ?>" class="logo-sm" alt="<?php esc_attr_e( 'Lazy Sign In Logo - Small', 'lazy-signin' ); ?>" />
    16189        </div>
    16290        <ul class="nav nav-tabs" role="tablist">
    163             <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab"> <i class="fa fa-lock"></i>Login Settings</a></li>
    164             <li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab"> <i class="fa fa-user-plus"></i> Sign up settings</a></li>
     91            <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab"> <i class="fa fa-lock"></i><?php esc_html_e( 'Login Settings', 'lazy-signin' ); ?></a></li>
     92            <li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab"> <i class="fa fa-user-plus"></i> <?php esc_html_e( 'Sign Up Settings', 'lazy-signin' ); ?></a></li>
    16593        </ul>
    16694        </div>
     
    16997            <div role="tabpanel" class="tab-pane fade in active" id="home">
    17098                <div class="lazy_sign_in_login-content-form">
    171                     <h2>Log In Form Settings</h2>
     99                    <h2><?php esc_html_e( 'Login Settings', 'lazy-signin' ); ?></h2>
    172100                    <form class="validate" method="post" id="addtag" autocomplete="off">
    173101                    <?php wp_nonce_field(); ?>
    174102                    <div class="input-group floating">
    175103                        <input type="text" id="lsi_login_heading_text" class="validate" name="lsi_login_heading_text" value="<?php echo esc_attr( $lsi_login_heading_text ); ?>">
    176                         <label for="lsi_login_heading_text">Page Heading</label>
     104                        <label for="lsi_login_heading_text">
     105                        <?php
     106                        printf(
     107                            // translators: 1: opening span tag, 2: closing span tag.
     108                            esc_html__( 'Page heading %1$sOptional%2$s', 'lazy-signin' ),
     109                            '<span>(',
     110                            ')</span>'
     111                        )
     112                        ?>
     113                        </label>
    177114                    </div>
    178115                    <div class="input-group floating">
    179116                        <input type="text" id="lsi_login_redirect_link" class="validate" name="lsi_login_redirect_link" value="<?php echo esc_attr( $lsi_login_redirect_link ); ?>">
    180                         <label for="lsi_login_redirect_link">Redirection link after success</label>
     117                        <label for="lsi_login_redirect_link">
     118                        <?php
     119                        printf(
     120                            // translators: 1: opening span tag, 2: closing span tag.
     121                            esc_html__( 'Redirection link after success %1$sOptional%2$s', 'lazy-signin' ),
     122                            '<span>(',
     123                            ')</span>'
     124                        )
     125                        ?>
     126                        </label>
    181127                        <?php if ( ! empty( $error_login ) ) : ?>
    182128                            <div class="error"><?php echo esc_html( $error_login ); ?></div>
     
    186132                    <div class="input-group floating">
    187133                        <input type="text" id="lsi_signup_link" class="validate" name="lsi_signup_link" value="<?php echo esc_attr( $lsi_signup_link ); ?>">
    188                         <label for="lsi_signup_link">Add Signup Page link</label>
     134                        <label for="lsi_signup_link">
     135                        <?php
     136                        printf(
     137                            // translators: 1: opening span tag, 2: closing span tag.
     138                            esc_html__( 'Add signup page link %1$sOptional%2$s', 'lazy-signin' ),
     139                            '<span>(',
     140                            ')</span>'
     141                        );
     142                        ?>
     143                        </label>
    189144                        <?php if ( ! empty( $error_signup ) ) : ?>
    190145                            <div class="error"><?php echo esc_html( $error_signup ); ?></div>
     
    201156            <div role="tabpanel" class="tab-pane fade" id="profile">
    202157                <div class="lazy_sign_in_login-content-form">
    203                     <h2>Sign Up Form Fields</h2>
     158                    <h2><?php esc_html_e( 'Signup Settings', 'lazy-signin' ); ?></h2>
    204159                    <form class="validate" method="post" id="addtag" autocomplete="off">
    205160                        <?php wp_nonce_field(); ?>
     
    207162                        <div class="input-group floating">
    208163                            <input type="text" class="validate" value="<?php echo esc_attr( $lsi_signup_heading_text ); ?>" id="lsi_signup_heading_text" name="lsi_signup_heading_text" />
    209                             <label for="lsi_signup_heading_text">Page Heading</label>
     164                            <label for="lsi_signup_heading_text">
     165                            <?php
     166                            printf(
     167                                // translators: 1: opening span tag, 2: closing span tag.
     168                                esc_html__( 'Page heading %1$sOptional%2$s', 'lazy-signin' ),
     169                                '<span>(',
     170                                ')</span>'
     171                            );
     172                            ?>
     173                            </label>
    210174                        </div>
    211175
    212176                        <div class="input-group floating">
    213177                            <input type="text" class="validate" id="lsi_signup_redirect_link" name="lsi_signup_redirect_link" value="<?php echo esc_attr( $lsi_signup_redirect_link ); ?>" />
    214                             <label for="lsi_signup_redirect_link">Redirection link after success</label>
     178                            <label for="lsi_signup_redirect_link">
     179                            <?php
     180                            printf(
     181                                // translators: 1: opening span tag, 2: closing span tag.
     182                                esc_html__( 'Redirection link after success %1$sOptional%2$s', 'lazy-signin' ),
     183                                '<span>(',
     184                                ')</span>'
     185                            );
     186                            ?>
     187                            </label>
    215188                            <?php if ( ! empty( $error_signup_success ) ) : ?>
    216189                                <div class="error"><?php echo esc_html( $error_signup_success ); ?></div>
     
    220193                        <div class="input-group floating">
    221194                            <input type="text" class="validate" id="lsi_login_link" name="lsi_login_link" value="<?php echo esc_attr( $lsi_login_link ); ?>" />
    222                             <label for="lsi_login_link">Login Page Link</label>
     195                            <label for="lsi_login_link">
     196                            <?php
     197                            printf(
     198                                // translators: 1: opening span tag, 2: closing span tag.
     199                                esc_html__( 'Login page link %1$sOptional%2$s', 'lazy-signin' ),
     200                                '<span>(',
     201                                ')</span>'
     202                            );
     203                            ?>
     204                            </label>
    223205                            <?php if ( ! empty( $error_login_link ) ) : ?>
    224206                                <div class="error"><?php echo esc_html( $error_login_link ); ?></div>
     
    228210                        <div class="input-group floating">
    229211                            <input type="text" class="validate" id="lsi_terms_condition_link" name="lsi_terms_condition_link" value="<?php echo esc_attr( $lsi_terms_condition_link ); ?>" />
    230                             <label for="lsi_terms_condition_link">Terms And Condition Link</label>
     212                            <label for="lsi_terms_condition_link">
     213                            <?php
     214                            printf(
     215                                // translators: 1: opening span tag, 2: closing span tag.
     216                                esc_html__( 'Terms and condition link %1$sOptional%2$s', 'lazy-signin' ),
     217                                '<span>(',
     218                                ')</span>'
     219                            );
     220                            ?>
     221                            </label>
    231222                            <?php if ( ! empty( $error_terms_condition_link ) ) : ?>
    232223                                <div class="error"><?php echo esc_html( $error_terms_condition_link ); ?></div>
     
    236227                        <div class="input-group">
    237228                            <select name="lsi_signup_role" id="lsi_signup_role">
    238                                 <option value="">Assign Role</option>
     229                                <option value="">
     230                                <?php
     231                                printf(
     232                                    // translators: 1: opening span tag, 2: closing span tag.
     233                                    esc_html__( 'Assign Role %1$sOptional%2$s', 'lazy-signin' ),
     234                                    '<span>(',
     235                                    ')</span>'
     236                                );
     237                                ?>
     238                            </option>
    239239                                <?php wp_dropdown_roles( $lsi_signup_role ); ?>
    240240                            </select>
     
    245245                                <div class="input-group">
    246246                                    <input type="checkbox" id="lsi_generate_username" name="lsi_generate_username" <?php echo ( '1' === $lsi_generate_username ) ? 'checked="checked"' : ''; ?> />
    247                                     <label>Auto generate username</label>
     247                                    <label><?php esc_html_e( 'Auto generate username', 'lazy-signin' ); ?></label>
    248248                                </div>
    249249                            </div>
     
    263263                                <div class="input-group">
    264264                                    <input type="checkbox" id="lsi_send_user_thankyou" name="lsi_send_user_thankyou" <?php echo ( '1' === $lsi_send_user_thankyou ) ? 'checked="checked"' : ''; ?> />
    265                                     <label><?php esc_html_e( 'Send Thank you email to User', 'lazy-signin' ); ?></label>
     265                                    <label><?php esc_html_e( 'Send thank you email to user', 'lazy-signin' ); ?></label>
    266266                                </div>
    267267                            </div>
     
    271271
    272272                        <div class="add-new-text-field-wrap">
    273                             <h3>Add new text field</h3>
     273                            <h3><?php esc_html_e( 'Add new text field', 'lazy-signin' ); ?></h3>
    274274                            <ul>
    275275                                <?php
     
    283283                                                <tbody>
    284284                                                    <tr>
    285                                                         <th>Field name</th>
     285                                                        <th><?php esc_html_e( 'Field name', 'lazy-signin' ); ?></th>
    286286                                                        <td><?php echo esc_html( $value[0] ); ?></td>
    287287                                                        <input type="hidden" name="field[]" value="<?php echo esc_attr( $value[0] ); ?>" />
    288288                                                    </tr>
    289289                                                    <tr>
    290                                                         <th>Field required?</th>
     290                                                        <th><?php esc_html_e( 'Field required?', 'lazy-signin' ); ?></th>
    291291                                                        <td><?php echo ( ! empty( $value[1] ) ? 'Yes' : 'No' ); ?></td>
    292292                                                        <input type="hidden" name="require[]" value="<?php echo ( '1' === $value[1] ? esc_attr( (string) $i ) : '' ); ?>" />
    293293                                                    </tr>
    294294                                                    <tr>
    295                                                         <th>Field unique?</th>
     295                                                        <th><?php esc_html_e( 'Field unique?', 'lazy-signin' ); ?></th>
    296296                                                        <td><?php echo ( ! empty( $value[2] ) ? 'Yes' : 'No' ); ?></td>
    297297                                                        <input type="hidden" name="unique[]" value="<?php echo ( '1' === $value[2] ? esc_attr( (string) $i ) : '' ); ?>" />
     
    311311                                    <div class="input-group floating">
    312312                                        <input type="text" class="validate" name="field[]" id="field[]" />
    313                                         <label>Field name</label>
     313                                        <label><?php esc_html_e( 'Field name', 'lazy-signin' ); ?></label>
    314314                                    </div>
    315315
     
    318318                                            <div class="input-group">
    319319                                                <input type="checkbox" name="require[]" value="<?php echo esc_attr( (string) $i ); ?>" />
    320                                                 <label>Require field</label>
     320                                                <label><?php esc_html_e( 'Require field', 'lazy-signin' ); ?></label>
    321321                                            </div>
    322322                                        </div>
     
    324324                                            <div class="input-group">
    325325                                                <input type="checkbox" name="unique[]" value="<?php echo esc_attr( (string) $i ); ?>" />
    326                                                 <label>Unique field</label>
     326                                                <label><?php esc_html_e( 'Unique field', 'lazy-signin' ); ?></label>
    327327                                            </div>
    328328                                        </div>
     
    331331
    332332                                <div class="add-new-text-field-extra-btn">
    333                                     <a href="javascript:;" class="add_field">Add</a>
     333                                    <a href="javascript:;" class="add_field"><?php esc_html_e( 'Add', 'lazy-signin' ); ?></a>
    334334                                </div>
    335335                            </div>
  • lazy-sign-in/trunk/assets/css/form.css

    r3345124 r3361774  
    4545#signup_form div.error,
    4646#login_form div.error {
    47     margin-bottom: 0px;
     47    margin-bottom: 15px;
    4848}
    4949.lazy-sign-in-signup .input-group {
  • lazy-sign-in/trunk/assets/js/ajax-js.js

    r3345124 r3361774  
    11jQuery(document).ready(function () {
    2 
    32    // Custom alphanumeric validation for username
    43    jQuery.validator.addMethod("alphanumeric", function (value, element) {
    54        return this.optional(element) || /^[a-z0-9\-_\s]+$/i.test(value);
    6     }, "Username must contain only letters, numbers, dashes or underscores.");
     5    }, string_translate.alphanumeric_message);
    76
    87    // Validate signup form
     
    2019        messages: {
    2120            uname: {
    22                 alphanumeric: "Username format not valid"
     21                alphanumeric: string_translate.alphanumeric_message
    2322            }
    2423        },
     
    4948            if (response.success) {
    5049                form.find('.success').html(response.data);
    51                 window.location.href = success_url.login;
     50                if (!success_url.login || success_url.login.trim() === '') {
     51                    window.location.href = success_url.home;
     52                } else {
     53                    window.location.href = success_url.login;
     54                }
    5255            } else {
    5356                form.find('.error').html(response.data || 'Login failed');
     
    8992            if (response.success) {
    9093                form.find('.success').html(response.data);
    91                 window.location.href = success_url.signup;
     94                form.trigger('reset');
     95                setTimeout(function () {
     96                    window.location.href = success_url.signup;
     97                }, 200);
    9298            } else {
    9399                // For wp_send_json_error({ result: 0, message: 'something' })
  • lazy-sign-in/trunk/include/class-lazy-sign-in.php

    r3345124 r3361774  
    1717     */
    1818    public function __construct() {
    19         add_action( 'login_enqueue_scripts', array( $this, 'frontend_scripts' ) );
    20         add_action( 'wp_enqueue_scripts', array( $this, 'frontend_scripts' ) );
    21 
    2219        $page = filter_input( INPUT_GET, 'page', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
    2320        if ( 'lazy_sign_in_options' === $page ) {
     
    3330        add_action( 'edit_user_profile_update', array( $this, 'save_profile_fields' ) );
    3431
    35         add_action( 'wp_ajax_lazy_sign_in_submit_log_action', array( $this, 'handle_login_ajax' ) );
    3632        add_action( 'wp_ajax_nopriv_lazy_sign_in_submit_log_action', array( $this, 'handle_login_ajax' ) );
    3733
    38         add_action( 'wp_ajax_lazy_sign_up_submit_log_action', array( $this, 'handle_signup_ajax' ) );
    3934        add_action( 'wp_ajax_nopriv_lazy_sign_up_submit_log_action', array( $this, 'handle_signup_ajax' ) );
    4035
     
    5651                'login'  => esc_url( get_option( 'lsi_login_redirect_link' ) ),
    5752                'signup' => esc_url( get_option( 'lsi_signup_redirect_link' ) ),
     53                'home'   => esc_url( home_url() ),
    5854            )
    5955        );
     
    7470            )
    7571        );
     72
     73        wp_localize_script(
     74            'setting-js',
     75            'string_translate',
     76            array(
     77                'alphanumeric_message' => __( 'Username must contain only letters, numbers, dashes or underscores.', 'lazy-signin-pro' ),
     78                'username_message'     => __( 'Username format not valid', 'lazy-signin-pro' ),
     79            )
     80        );
     81
     82        // Inline script only if user not logged in.
     83        if ( ! is_user_logged_in() ) {
     84            $custom_js = "
     85                jQuery(function($){
     86                    $.each($('.input-group.floating input'), function(i, val){
     87                        var text_val = $(this).val();
     88                        if (text_val === '') {
     89                            $(this).removeClass('has-value');
     90                        } else {
     91                            $(this).addClass('has-value');
     92                        }
     93                    });
     94
     95                    $('.input-group.floating input').focusout(function(){
     96                        var text_val = $(this).val();
     97                        if (text_val === '') {
     98                            $(this).removeClass('has-value');
     99                        } else {
     100                            $(this).addClass('has-value');
     101                        }
     102                    });
     103                });
     104            ";
     105            // Attach AFTER your setting-js script.
     106            wp_add_inline_script( 'setting-js', $custom_js );
     107        }
    76108    }
    77109
     
    93125     */
    94126    public function render_login_form() {
     127        $this->load_frontend_scripts();
    95128        ob_start();
    96129        include plugin_dir_path( __FILE__ ) . 'login-form.php';
     
    104137     */
    105138    public function render_signup_form() {
     139        $this->load_frontend_scripts();
    106140        ob_start();
    107141        include plugin_dir_path( __FILE__ ) . 'signup-form.php';
    108142        return ob_get_clean();
     143    }
     144
     145    /**
     146     * Load front scripts when user is not logged in,
     147     */
     148    private function load_frontend_scripts() {
     149        if ( ! is_user_logged_in() ) {
     150            add_action( 'login_enqueue_scripts', array( $this, 'frontend_scripts' ) );
     151            add_action( 'wp_enqueue_scripts', array( $this, 'frontend_scripts' ) );
     152        }
    109153    }
    110154
     
    245289        }
    246290
     291        if ( username_exists( $username ) ) {
     292            wp_send_json_error( __( 'Username already exists. Please choose another.', 'lazy-signin' ) );
     293        }
     294
    247295        // Default role.
    248296        $user_role = get_option( 'lsi_signup_role' );
     
    278326                    if ( ! empty( $users ) ) {
    279327                        // translators: %s: The name of the extra field that must be unique.
    280                         $unique_errors[] = sprintf( __( '"%s" already exists.', 'lazy-signin' ), esc_html( $field[0] ) );
     328                        $unique_errors[] = sprintf( __( '%s already exists.', 'lazy-signin' ), esc_html( $field[0] ) );
    281329
    282330                    }
  • lazy-sign-in/trunk/include/login-form.php

    r3345124 r3361774  
    33 * Log in form template
    44 *
    5  * @package WordPress
     5 * @package Lazy_sign_in
    66 */
    77
     
    1111
    1212if ( ! is_user_logged_in() ) : ?>
    13     <script type="text/javascript">
    14         jQuery(function(){
    15             jQuery.each( jQuery('.input-group.floating input'), function( i, val ){
    16                 var text_val = jQuery(this).val();
    17                 if(text_val === "") {
    18                     jQuery(this).removeClass('has-value');     
    19                 } else {
    20                     jQuery(this).addClass('has-value');
    21                 }
    22             });
    23             jQuery('.input-group.floating input').focusout(function(){
    24                 var text_val = jQuery(this).val();
    25                 if(text_val === "") {
    26                     jQuery(this).removeClass('has-value');     
    27                 } else {
    28                     jQuery(this).addClass('has-value');
    29                 }
    30             });
    31         });
    32     </script>
    3313    <div class="lazy-sign-in-signup">
    3414        <h3><?php echo esc_html( get_option( 'lsi_login_heading_text' ) ); ?></h3>
     
    4222                <div class="input-group floating">
    4323                    <input type="text" class="required" name="username" id="username" required>
    44                     <label for="username"><?php esc_html_e( 'Username or email address*', 'lazy-signin' ); ?></label>
     24                    <label for="username"><?php esc_html_e( 'Username or Email Address*', 'lazy-signin' ); ?></label>
    4525                </div>
    4626
     
    5333                    <div class="remember-me">
    5434                        <input id="rememberme" type="checkbox" value="1" name="rememberme">
    55                         <label for="rememberme" class="inline"><?php esc_html_e( 'Remember me', 'lazy-signin' ); ?></label>
     35                        <label for="rememberme" class="inline"><?php esc_html_e( 'Remember Me', 'lazy-signin' ); ?></label>
    5636                    </div>
    5737
     
    7959        ?>
    8060        <div class="lazy-sign-in-already-account">
    81             Create an account? <a href="<?php echo esc_url( $signup_link ); ?>">Sign UP</a>
     61            <?php esc_attr_e( 'Create an account?', 'lazy-signin' ); ?> <a href="<?php echo esc_url( $signup_link ); ?>"><?php esc_attr_e( 'Sign Up', 'lazy-signin' ); ?></a>
    8262        </div>
    8363    <?php endif; ?>
  • lazy-sign-in/trunk/include/signup-form.php

    r3345124 r3361774  
    1010}
    1111if ( ! is_user_logged_in() ) : ?>
    12     <script type="text/javascript">
    13     jQuery(function(){
    14         jQuery.each( jQuery('.input-group.floating input'), function( i, val ){
    15             var text_val = jQuery(this).val();
    16             if(text_val === "") {
    17                 jQuery(this).removeClass('has-value');     
    18             } else {
    19                 jQuery(this).addClass('has-value');
    20             }
    21         });
    22         jQuery('.input-group.floating input').focusout(function(){
    23             var text_val = jQuery(this).val();
    24             if(text_val === "") {
    25                 jQuery(this).removeClass('has-value');     
    26             } else {
    27                 jQuery(this).addClass('has-value');
    28             }
    29         });
    30     });
    31     </script>
    32 
    3312    <div class="lazy-sign-in-signup">
    3413        <h3><?php echo esc_html( get_option( 'lsi_signup_heading_text' ) ); ?></h3>
     
    4423            <div class="input-group floating">
    4524                <input type="email" class="required email" name="email" id="email" value="" required>
    46                 <label for="email"><?php esc_html_e( 'Email address*', 'lazy-signin' ); ?></label>
     25                <label for="email"><?php esc_html_e( 'Email Address*', 'lazy-signin' ); ?></label>
    4726            </div>
    4827
     
    11695    <?php if ( '' !== get_option( 'lsi_login_link' ) ) : ?>
    11796        <div class="lazy-sign-in-already-account">
    118             Already have an account? <a href="<?php echo esc_url( get_option( 'lsi_login_link' ) ); ?>">Sign In</a>
     97            <?php esc_html_e( 'Already have an account?', 'lazy-signin-pro' ); ?> <a href="<?php echo esc_url( get_option( 'lsi_login_link' ) ); ?>"><?php esc_html_e( 'Sign In', 'lazy-signin-pro' ); ?></a>
    11998        </div>
    12099    <?php endif; ?>
  • lazy-sign-in/trunk/lazy-sign-in.php

    r3345124 r3361774  
    1212 * License: GPLv3 or later
    1313 * License URI: http://www.gnu.org/licenses/gpl-3.0.html
    14  * Version: 2.1
     14 * Version: 2.2
    1515 *
    1616 * @package WordPress
     
    1818
    1919define( 'LAZY_SIGN_IN_VERSION', '2.0' );
    20 define( 'LAZY_SIGN_IN_REQUIRED_WP_VERSION', '4.3' );
     20define( 'LAZY_SIGN_IN_REQUIRED_WP_VERSION', '6.6' );
    2121define( 'LAZY_SIGN_IN', __FILE__ );
    2222define( 'LAZY_SIGN_IN_BASENAME', plugin_basename( LAZY_SIGN_IN ) );
  • lazy-sign-in/trunk/readme.txt

    r3345124 r3361774  
    99Tested up to: 6.8
    1010Requires PHP: 7.4
    11 Stable tag: 2.1
     11Stable tag: 2.2
    1212Copyright: (c) 2012-2025 KrishaWeb Technologies PVT LTD (info@krishaweb.com)
    1313License: GPLv3 or later
     
    1818== Description ==
    1919
    20 Lazy Sign in lets you easily create a login and sign-up page for your website. It also offers the required field and unique field verification features. It powers you to add fully customizable AJAX powered responsive signup and login form for your website.
     20**Lazy Sign-In – The Smarter Way to Handle User Registration & Login**
    2121
    22 Lazy Sign in lets you create custom sign-up and login form with a single installation. You can easily create sign-up and login page using the shortcode [lazy_signin_ajax_signup_form] and [lazy_signin_ajax_login_form]. It also lets you add the custom fields in the sign-up form. You can add n number of sign-up fields and redirect users to specific page after sign-up from the back-end.
     22Tired of complicated login and sign-up setups? Lazy Sign-In makes it effortless to add sleek, responsive, and fully customizable login and registration forms to your website all powered by AJAX for a seamless user experience.
    2323
    24 This plugin also auto-generates the username and password for the users who signup. What you have to do is just tick mark the ‘Auto-generate username’ and ‘Auto generate password’ boxes in the signup setting in the backend. It generates fully responsive sign-up page that uses AJAX.
     24With just one installation, you can create both sign-up and login pages using simple shortcodes:
     25**[lazy_signin_ajax_signup_form]** for sign-up
     26**[lazy_signin_ajax_login_form]** for login
    2527
    26 You can add as many fields as you want in the signup form from the plugin settings. The best feature of the plugin is that you can keep the form fields ‘required’ as well as ‘unique’. Having ‘unique form fields’ is the biggest advantage of LAZY SIGN-IN plugin. Users can also modify the information they have provided while registering from User Meta Information in the profile page. What they need to do is update the information and save it. The system will automatically update the information in the database and consider the latest info from the next interaction.
     28Why Lazy Sign-In?
     29• Unlimited Custom Fields – Add as many fields as you want to your sign-up form.
     30• Smart Validation – Set fields as required or unique to ensure clean, reliable data.
     31• Auto-Generated Credentials – Automatically generate usernames and passwords with one click.
     32• Custom Redirects – Send users to a specific page right after sign-up.
     33• User Profile Management – Let users easily update their own information anytime.
     34• Role Assignment – Automatically assign user roles from the backend.
    2735
    28 You can also assign a specific role from the backend to the users who sign-up. Users will also be able to change their profile information after signing up.
     36The best part? Unique Field Verification. This powerful feature ensures every user detail you collect stays unique, eliminating duplicate entries and strengthening your database integrity.
    2937
    30 Features
     38With Lazy Sign-In, your users enjoy a smooth and intuitive registration process, while you get full control and flexibility on the backend.
     39Bring ease, speed, and reliability to your website’s sign-up and login process with Lazy Sign-In.
     40
     41**Features**
    3142•   Easy installation
    3243•   Separate login and signup pages
Note: See TracChangeset for help on using the changeset viewer.