Plugin Directory

Changeset 3337325


Ignore:
Timestamp:
07/31/2025 01:54:36 PM (8 months ago)
Author:
bestwebsoft
Message:

menu fix

Location:
bws-login-register/trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • bws-login-register/trunk/bws-login-register.php

    r3301452 r3337325  
    3838     */
    3939    function add_lgnrgstrfrm_admin_menu() {
    40         global $wp_version, $lgnrgstrfrm_plugin_info;
     40        global $wp_version, $lgnrgstrfrm_plugin_info, $submenu;
    4141
    4242        if ( is_multisite() && ! is_network_admin() ) {
     
    5050            'login-register-form.php',
    5151            'lgnrgstrfrm_settings_page',
    52             'none'
     52            'dashicons-admin-network'
    5353        );
    5454
     
    7171        );
    7272
     73        if ( isset( $submenu['login-register-form.php'] ) ) {
     74            $submenu['login-register-form.php'][] = array(
     75                '<span style="color:#d86463"> ' . __( 'Upgrade to Pro', 'bws-login-register' ) . '</span>',
     76                'manage_options',
     77                'https://bestwebsoft.com/products/wordpress/plugins/bws-login-register/?k=c37eed44c2fe607f3400914345cbdc8a&pn=1085&v=' . $lgnrgstrfrm_plugin_info['Version'] . '&wp_v=' . $wp_version,
     78            );
     79        }
     80
    7381        add_action( 'load-' . $settings, 'lgnrgstrfrm_add_tabs' );
    7482    }
     
    92100        }
    93101        /* Function check if plugin is compatible with current WP version */
    94         lgnrgstrfrm_wp_min_version_check( plugin_basename( __FILE__ ), $lgnrgstrfrm_plugin_info, '5.6' );
     102        bws_wp_min_version_check( plugin_basename( __FILE__ ), $lgnrgstrfrm_plugin_info, '5.6' );
    95103
    96104        $lgnrgstrfrm_options = ( is_multisite() ) ? get_site_option( 'lgnrgstrfrm_options' ) : get_option( 'lgnrgstrfrm_options' );
     
    147155        if ( empty( $bws_plugin_info ) ) {
    148156            $bws_plugin_info = array(
    149                 'id'      => '110',
     157                'id'      => '1085',
    150158                'version' => $lgnrgstrfrm_plugin_info['Version'],
    151159            );
     
    154162        if ( isset( $_GET['page'] ) && ( 'login-register-form.php' === sanitize_text_field( wp_unslash( $_GET['page'] ) ) ) ) {
    155163            register_lgnrgstrfrm_settings();
     164        }
     165
     166        if ( 'plugins.php' === $pagenow && ( ( is_multisite() && is_network_admin() ) || ! is_multisite() ) ) {
     167            if ( function_exists( 'bws_plugin_banner_go_pro' ) ) {
     168                if ( empty( $lgnrgstrfrm_options ) ) {
     169                    $lgnrgstrfrm_options = ( is_multisite() ) ? get_site_option( 'lgnrgstrfrm_options' ) : get_option( 'lgnrgstrfrm_options' );
     170                }
     171                bws_plugin_banner_go_pro( $lgnrgstrfrm_options, $lgnrgstrfrm_plugin_info, 'bws-login-register', 'bws-login-register', '46c885de521ab07c0c9a8e02c49a4e54', '1085', 'bws-login-register' );
     172            }
    156173        }
    157174    }
     
    476493        .lgnrgstrfrm-form-register-content .form-row input[type="password"],
    477494        .lgnrgstrfrm-form-register-content .form-row input[type="email"],
     495        .lgnrgstrfrm-form-register-content .form-row input[type="number"],
     496        .lgnrgstrfrm-form-register-content .form-row select,
     497        .lgnrgstrfrm-form-register-content .form-row textarea,
    478498        .lgnrgstrfrm-form-forgot-content .form-row input[type="text"] {
    479499            border-color: ' . $lgnrgstrfrm_options['accent_color'] . ';
     
    650670    function lgnrgstrfrm_login() {
    651671        global $lgnrgstrfrm_options;
     672        $response = array();
    652673        if ( wp_doing_ajax() ) {
    653674            check_ajax_referer( plugin_basename( __FILE__ ), 'lgnrgstrfrm_ajax_nonce_field' );
    654         } elseif ( ! isset( $_POST['lgnrgstrfrm_login'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['lgnrgstrfrm_login'] ) ), 'lgnrgstrfrm_login_action' ) ) {
    655             print esc_html__( 'Sorry, your nonce did not verify.', 'bws-login-register' );
    656             exit;
    657         }
     675        }
     676        $response['error'] = apply_filters( 'lgnrgstrfrm_check_field', 'login' );
    658677        if ( ( ! empty( $_POST['name'] ) && ! empty( $_POST['password'] ) ) || ( ! empty( $_POST['username'] ) && ! empty( $_POST['password'] ) ) ) {
    659678            $user_name = isset( $_POST['name'] ) ? sanitize_text_field( wp_unslash( $_POST['name'] ) ) : sanitize_text_field( wp_unslash( $_POST['username'] ) );
     
    666685            }
    667686
    668             if ( false !== $user ) {
     687            if ( false !== $user && empty( $response['error'] ) ) {
    669688                $secure_cookie = '';
    670689                if ( get_user_option( 'use_ssl', $user->ID ) ) {
     
    682701            }
    683702            if ( ! is_a( $user, 'WP_User' ) ) {
    684                 $response['error'] = __( 'Invalid login info', 'bws-login-register' );
    685             } else {
     703                $response['error'] .= __( 'Invalid login info', 'bws-login-register' );
     704            } elseif( empty( $response['error'] ) ) {
    686705                $response['is_logged_in'] = true;
    687706                if ( 1 === $lgnrgstrfrm_options['login_menu_display_welcome'] ) {
     
    692711            }
    693712        } elseif ( empty( $_POST['name'] ) || empty( $_POST['username'] ) ) {
    694                 $response['error'] = __( 'Required User Name field is missing', 'bws-login-register' );
     713            $response['error'] .= __( 'Required User Name field is missing', 'bws-login-register' );
    695714        } elseif ( empty( $_POST['password'] ) ) {
    696             $response['error'] = __( 'Required Password field is missing', 'bws-login-register' );
     715            $response['error'] .= __( 'Required Password field is missing', 'bws-login-register' );
    697716        }
    698717        if ( wp_doing_ajax() ) {
     
    712731    function lgnrgstrfrm_register() {
    713732        global $lgnrgstrfrm_options;
     733        $response = array();
    714734        if ( wp_doing_ajax() ) {
    715735            check_ajax_referer( plugin_basename( __FILE__ ), 'lgnrgstrfrm_ajax_nonce_field' );
    716         } elseif ( ! isset( $_POST['lgnrgstrfrm_register'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['lgnrgstrfrm_register'] ) ), 'lgnrgstrfrm_register_action' ) ) {
    717             print esc_html__( 'Sorry, your nonce did not verify.', 'bws-login-register' );
    718             exit;
    719         }
     736        }
     737        $response['error'] = apply_filters( 'lgnrgstrfrm_check_field', 'register' );
    720738        if ( ( ! empty( $_POST['name'] ) && ! empty( $_POST['email'] ) ) || ( ! empty( $_POST['username'] ) && ! empty( $_POST['email'] ) ) ) {
    721739            $user_name = isset( $_POST['name'] ) ? sanitize_text_field( wp_unslash( $_POST['name'] ) ) : sanitize_text_field( wp_unslash( $_POST['username'] ) );
     
    724742
    725743            if ( 6 > strlen( $user_name ) ) {
    726                 $response['error'] = __( 'Username too short. At least 6 characters is required', 'bws-login-register' );
     744                $response['error'] .= __( 'Username too short. At least 6 characters is required', 'bws-login-register' );
    727745            }
    728746            if ( username_exists( $user_name ) ) {
    729                 $response['error'] = __( 'The username you entered already exists!', 'bws-login-register' );
     747                $response['error'] .= __( 'The username you entered already exists!', 'bws-login-register' );
    730748            } elseif ( ! validate_username( $user_name ) ) {
    731                 $response['error'] = __( 'The username you entered is not valid!', 'bws-login-register' );
     749                $response['error'] .= __( 'The username you entered is not valid!', 'bws-login-register' );
    732750            }
    733751            if ( ! is_email( $email ) ) {
    734                 $response['error'] = __( 'Email is not valid!', 'bws-login-register' );
     752                $response['error'] .= __( 'Email is not valid!', 'bws-login-register' );
    735753            } elseif ( email_exists( $email ) ) {
    736                 $response['error'] = __( 'Email already exist!', 'bws-login-register' );
     754                $response['error'] .= __( 'Email already exist!', 'bws-login-register' );
    737755            }
    738756            if ( ! empty( $password ) && 5 > strlen( $password ) ) {
    739                 $response['error'] = __( 'Password length must be greater than 5!', 'bws-login-register' );
     757                $response['error'] .= __( 'Password length must be greater than 5!', 'bws-login-register' );
    740758            }
    741759            if ( empty( $response['error'] ) ) {
     
    748766
    749767                if ( ! is_wp_error( $user_id ) ) {
     768                    if ( function_exists( 'prflxtrflds_save_data_from_registration_form' ) ) {
     769                        prflxtrflds_save_data_from_registration_form( $user_id );
     770                    }
    750771                    $response['is_registered'] = true;
    751772                    wp_new_user_notification( $user_id, null, 'both' );
    752773                } else {
    753                     $response['error'] = $user_id->get_error_message();
     774                    $response['error'] .= $user_id->get_error_message();
    754775                }
    755776            }
    756777        } elseif ( empty( $_POST['name'] ) ) {
    757                 $response['error'] = __( 'Required User Name field is missing', 'bws-login-register' );
     778                $response['error'] .= __( 'Required User Name field is missing', 'bws-login-register' );
    758779        } elseif ( empty( $_POST['email'] ) ) {
    759             $response['error'] = __( 'Required Email field is missing', 'bws-login-register' );
     780            $response['error'] .= __( 'Required Email field is missing', 'bws-login-register' );
    760781        }
    761782        /* wp_set_password() */
     
    776797    function lgnrgstrfrm_forgot() {
    777798        global $lgnrgstrfrm_options;
     799        $response = array();
    778800        if ( wp_doing_ajax() ) {
    779801            check_ajax_referer( plugin_basename( __FILE__ ), 'lgnrgstrfrm_ajax_nonce_field' );
    780         } elseif ( ! isset( $_POST['lgnrgstrfrm_forgot'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['lgnrgstrfrm_forgot'] ) ), 'lgnrgstrfrm_forgot_action' ) ) {
    781             print esc_html__( 'Sorry, your nonce did not verify.', 'bws-login-register' );
    782             exit;
    783         }
    784         if ( ! empty( $_POST['login'] ) || ! empty( $_POST['userlogin'] ) ) {
     802        }
     803        $response['error'] = apply_filters( 'lgnrgstrfrm_check_field', 'forgot_pass' );
     804        if ( ( ! empty( $_POST['login'] ) || ! empty( $_POST['userlogin'] ) ) && empty( $response['error'] ) ) {
    785805            $user_login = isset( $_POST['login'] ) ? sanitize_text_field( wp_unslash( $_POST['login'] ) ) : sanitize_text_field( wp_unslash( $_POST['userlogin'] ) );
    786806            $result     = retrieve_password( $user_login );
    787807            if ( is_wp_error( $result ) ) {
    788                 $response['error'] = $result->get_error_message();
     808                $response['error'] .= $result->get_error_message();
    789809            } else {
    790810                $response['is_forgot_send_email'] = true;
    791811            }
    792812        } elseif ( empty( $_POST['login'] ) && empty( $_POST['userlogin'] ) ) {
    793                 $response['error'] = __( 'Required User Login field is missing', 'bws-login-register' );
     813                $response['error'] .= __( 'Required User Login field is missing', 'bws-login-register' );
    794814        }
    795815        if ( wp_doing_ajax() ) {
     
    811831        $args   = array(
    812832            'id'      => 'bws-login-register',
    813             'section' => '200538709',
     833            'section' => '29160262397469',
    814834        );
    815         lgnrgstrfrm_help_tab( $screen, $args );
     835        bws_help_tab( $screen, $args );
    816836    }
    817837}
     
    855875                $links[] = '<a href="admin.php?page=login-register-form.php">' . __( 'Settings', 'bws-login-register' ) . '</a>';
    856876            }
    857             $links[] = '<a href="https://support.bestwebsoft.com/hc/en-us/sections/200538709" target="_blank">' . __( 'FAQ', 'bws-login-register' ) . '</a>';
     877            $links[] = '<a href="https://support.bestwebsoft.com/hc/en-us/sections/29160262397469" target="_blank">' . __( 'FAQ', 'bws-login-register' ) . '</a>';
    858878            $links[] = '<a href="https://support.bestwebsoft.com" target="_blank">' . __( 'Support', 'bws-login-register' ) . '</a>';
    859879        }
     
    875895            wp_enqueue_script( 'lgnrgstrfrm_admin_script', plugins_url( 'js/admin-script.js', __FILE__ ), array( 'jquery', 'wp-color-picker' ), $lgnrgstrfrm_plugin_info['Version'], true );
    876896            wp_enqueue_style( 'lgnrgstrfrm_stylesheet', plugins_url( 'css/style.css', __FILE__ ), array( 'wp-color-picker' ), $lgnrgstrfrm_plugin_info['Version'] );
    877             lgnrgstrfrm_enqueue_settings_scripts();
     897            bws_enqueue_settings_scripts();
     898
    878899        }
    879900
     
    906927            )
    907928        );
     929    }
     930}
     931
     932if ( ! function_exists( 'lgnrgstrfrm_plugin_banner' ) ) {
     933    /**
     934     * Display banner
     935     */
     936    function lgnrgstrfrm_plugin_banner() {
     937        global $hook_suffix, $lgnrgstrfrm_plugin_info;
     938        if ( 'plugins.php' === $hook_suffix ) {
     939            if ( ( is_multisite() && is_network_admin() ) || ! is_multisite() ) {
     940                bws_plugin_banner_to_settings( $lgnrgstrfrm_plugin_info, 'lgnrgstrfrm_options', 'bws-login-register', 'admin.php?page=login-register-form.php' );
     941            }
     942            if ( is_multisite() && ! is_network_admin() && is_admin() ) {
     943                ?>
     944                <div class="update-nag"><strong><?php esc_html_e( 'Notice:', 'bws-login-register' ); ?></strong>
     945                    <?php
     946                    if ( is_plugin_active_for_network( plugin_basename( __FILE__ ) ) ) {
     947                        esc_html_e( 'Due to the peculiarities of the multisite work, Login Register Form plugin has only', 'bws-login-register' );
     948                        ?>
     949                        <a target="_blank" href="<?php echo esc_url( network_admin_url( 'admin.php?page=login-register-form.php' ) ); ?>"><?php esc_html_e( 'Network settings page', 'bws-login-register' ); ?></a>
     950                        <?php
     951                    } else {
     952                        esc_html_e( 'Due to the peculiarities of the multisite work, Login Register Form plugin has the network settings page only and it should be Network Activated. Please', 'bws-login-register' );
     953                        ?>
     954                        <a target="_blank" href="<?php echo esc_url( network_admin_url( 'plugins.php' ) ); ?>"><?php esc_html_e( 'Activate Login Register Form for Network', 'bws-login-register' ); ?></a>
     955                    <?php } ?>
     956                </div>
     957                <?php
     958            }
     959        }
     960        if ( isset( $_REQUEST['page'] ) && 'login-register-form.php' === sanitize_text_field( wp_unslash( $_REQUEST['page'] ) ) ) {
     961            bws_plugin_suggest_feature_banner( $lgnrgstrfrm_plugin_info, 'lgnrgstrfrm_options', 'bws-login-register' );
     962        }
    908963    }
    909964}
     
    9601015            $content .= '<div class="text-right lgnrgstrfrm-forgot' . ( 1 !== $lgnrgstrfrm_options['login_form_display_remember'] ? 'w-100' : '' ) . '"><a href="javascript:void();" data-action="lgnrgstrfrm-form-forgot">' . esc_html__( 'Forgot password?', 'bws-login-register' ) . '</a></div>';
    9611016        }
     1017        $content = apply_filters( 'lgnrgstrfrm_add_field', $content, 'login' );
    9621018        $content .= '</div>
    9631019        <div class="form-row form-row-button">
     
    9731029                </div>';
    9741030        }
    975         $content .= wp_nonce_field( 'lgnrgstrfrm_login_action', 'lgnrgstrfrm_login', true, false );
    9761031        $content .= '</form></div>';
    9771032        return $content;
     
    10331088                     <label>' . esc_html__( 'Repeat Password', 'bws-login-register' ) . '</label>
    10341089                     <input class="lgnrgstrfrm-password" name="repeat-password" type="password" placeholder="Password" /> <span class="password-toggle-icon"><i class="fas fa-eye"></i></span>
    1035                 </div>-->
    1036                 <div class="form-row form-row-button">
     1090                </div>-->';
     1091                $content = apply_filters( 'lgnrgstrfrm_add_field', $content, 'register' );
     1092                $content .= '<div class="form-row form-row-button">
    10371093                     <input type="submit" class="lgnrgstrfrm-register button" value="' . esc_html__( 'Register', 'bws-login-register' ) . '" /> <img class="lgnrgstrfrm-register-loading" src="' . esc_url( plugins_url( 'images/ajax-loader.gif', __FILE__ ) ) . '" alt="' . __( 'Loading', 'bws-login-register' ) . '" />
    10381094                     <input type="hidden" name="lgnrgstrfrm_register_submit" value="1" />
     
    10461102                    </div>';
    10471103            }
    1048             $content .= wp_nonce_field( 'lgnrgstrfrm_register_action', 'lgnrgstrfrm_register', true, false );
    10491104            $content .= '</form></div>';
    10501105        }
     
    10941149                     <label>' . esc_html__( 'User Name or Email Address', 'bws-login-register' ) . ' <span>*</span></label>
    10951150                     <input class="lgnrgstrfrm-username" name="userlogin" type="text" placeholder="User Name or Email Address" required="required" value="" />
    1096                 </div>
    1097                 <div class="form-row form-row-button">
     1151                </div>';
     1152            $content = apply_filters( 'lgnrgstrfrm_add_field', $content, 'forgot_password' );
     1153            $content .= '<div class="form-row form-row-button">
    10981154                    <input type="submit" class="lgnrgstrfrm-forgot button" value="' . esc_html__( 'Get New Password', 'bws-login-register' ) . '" /> <img class="lgnrgstrfrm-forgot-loading" src="' . esc_url( plugins_url( 'images/ajax-loader.gif', __FILE__ ) ) . '" alt="' . __( 'Loading', 'bws-login-register' ) . '" />
    10991155                    <input type="hidden" name="lgnrgstrfrm_forgot_submit" value="1" />
     
    11091165                    </div>';
    11101166            }
    1111             $content .= wp_nonce_field( 'lgnrgstrfrm_forgot_action', 'lgnrgstrfrm_forgot', true, false );
    11121167            $content .= '</form></div>';
    11131168        }
     
    11761231}
    11771232
    1178 add_action( 'init', 'lgnrgstrfrm_init' );
     1233add_action( 'init', 'lgnrgstrfrm_init', 11 );
    11791234add_action( 'admin_init', 'lgnrgstrfrm_plugin_admin_init' );
    11801235
    11811236add_action( 'admin_enqueue_scripts', 'lgnrgstrfrm_admin_head' );
    11821237add_action( 'enqueue_block_editor_assets', 'lgnrgstrfrm_custom_block_enqueue' );
     1238add_action( 'admin_notices', 'lgnrgstrfrm_plugin_banner' );
     1239add_action( 'network_admin_notices', 'lgnrgstrfrm_plugin_banner' );
    11831240
    11841241add_action( 'wp_enqueue_scripts', 'lgnrgstrfrm_wp_head' );
     
    11881245add_shortcode( 'bws-login-register', 'lgnrgstrfrm_display_login_register' );
    11891246
    1190 add_action( 'wp_ajax_nopriv_lgnrgstrfrm_login', 'lgnrgstrfrm_login' );
    1191 add_action( 'wp_ajax_nopriv_lgnrgstrfrm_register', 'lgnrgstrfrm_register' );
    1192 add_action( 'wp_ajax_nopriv_lgnrgstrfrm_forgot', 'lgnrgstrfrm_forgot' );
     1247add_action( 'wp_ajax_nopriv_lgnrgstrfrm_login', 'lgnrgstrfrm_login', 11 );
     1248add_action( 'wp_ajax_nopriv_lgnrgstrfrm_register', 'lgnrgstrfrm_register', 11 );
     1249add_action( 'wp_ajax_nopriv_lgnrgstrfrm_forgot', 'lgnrgstrfrm_forgot', 11 );
    11931250
    11941251/* Adds "Settings" link to the plugin action page */
  • bws-login-register/trunk/bws_menu/bws_functions.php

    r3301452 r3337325  
    22/**
    33 * @package BWS Menu
    4  * @version 2.4.3
     4 * @version 2.4.4
    55 * Main functions
    66 */
     
    1313 * General functions for BestWebSoft plugins
    1414 */
    15 
    16 if ( ! function_exists( 'lgnrgstrfrm_menu_url' ) ) {
     15require dirname( __FILE__ ) . '/deprecated.php';
     16require_once dirname( __FILE__ ) . '/deactivation-form.php';
     17
     18
     19if ( ! function_exists( 'bws_get_mofile' ) ) {
     20    /**
     21     * Function to add 'bestwebsoft' slug for BWS_Menu MO file if BWS_Menu loaded from theme.
     22     *
     23     * @since 1.9.7
     24     * @param string $mofile Mo file name.
     25     * @param string $domain Domain name.
     26     */
     27    function bws_get_mofile( $mofile, $domain ) {
     28        if ( 'bestwebsoft' === $domain ) {
     29            $locale = get_locale();
     30            return str_replace( $locale, "bestwebsoft-{$locale}", $mofile );
     31        }
     32
     33        return $mofile;
     34    }
     35}
     36
     37/**
     38 * Internationalization, first(!)
     39 *
     40 * @since 1.9.7
     41 */
     42if ( isset( $bws_menu_source ) && 'themes' === $bws_menu_source ) {
     43    add_filter( 'load_textdomain_mofile', 'bws_get_mofile', 10, 2 );
     44    load_theme_textdomain( 'bestwebsoft', get_stylesheet_directory() . '/inc/bws_menu/languages' );
     45    remove_filter( 'load_textdomain_mofile', 'bws_get_mofile' );
     46} else {
     47    load_plugin_textdomain( 'bestwebsoft', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
     48}
     49
     50if ( ! function_exists( 'bws_menu_url' ) ) {
    1751    /**
    1852     * Function to getting url to current BWS_Menu.
     
    2256     */
    2357    if ( ! isset( $bws_menu_source ) || 'plugins' === $bws_menu_source ) {
    24         function lgnrgstrfrm_menu_url( $path = '' ) {
     58        function bws_menu_url( $path = '' ) {
    2559            return plugins_url( $path, __FILE__ );
    2660        }
    2761    } else {
    28         function lgnrgstrfrm_menu_url( $path = '' ) {
     62        function bws_menu_url( $path = '' ) {
    2963            $bws_menu_current_dir = str_replace( '\\', '/', dirname( __FILE__ ) );
    3064            $bws_menu_abspath     = str_replace( '\\', '/', ABSPATH );
     
    3670}
    3771
    38 if ( ! function_exists( 'lgnrgstrfrm_wp_min_version_check(' ) ) {
     72if ( ! function_exists( 'bws_wp_min_version_check' ) ) {
    3973    /**
    4074     * Function check if plugin is compatible with current WP version
     
    4579     * @param string $min_wp (Optional) Flag for min WP version.
    4680     */
    47     function lgnrgstrfrm_wp_min_version_check( $plugin_basename, $plugin_info, $require_wp, $min_wp = false ) {
     81    function bws_wp_min_version_check( $plugin_basename, $plugin_info, $require_wp, $min_wp = false ) {
    4882        global $wp_version, $bws_versions_notice_array;
    4983        if ( false === $min_wp ) {
     
    5387            include_once ABSPATH . 'wp-admin/includes/plugin.php';
    5488            if ( is_plugin_active( $plugin_basename ) ) {
     89                deactivate_plugins( $plugin_basename );
    5590                $admin_url = ( function_exists( 'get_admin_url' ) ) ? get_admin_url( null, 'plugins.php' ) : esc_url( '/wp-admin/plugins.php' );
    5691                wp_die(
     
    5893                        "<strong>%s</strong> %s <strong>WordPress %s</strong> %s <br /><br />%s <a href='%s'>%s</a>.",
    5994                        esc_html( $plugin_info['Name'] ),
    60                         esc_html__( 'requires', 'bws-login-register' ),
     95                        esc_html__( 'requires', 'bestwebsoft' ),
    6196                        esc_html( $require_wp ),
    62                         esc_html__( 'or higher, that is why it has been deactivated! Please upgrade WordPress and try again.', 'bws-login-register' ),
    63                         esc_html__( 'Back to the WordPress', 'bws-login-register' ),
     97                        esc_html__( 'or higher, that is why it has been deactivated! Please upgrade WordPress and try again.', 'bestwebsoft' ),
     98                        esc_html__( 'Back to the WordPress', 'bestwebsoft' ),
    6499                        esc_url( $admin_url ),
    65                         esc_html__( 'Plugins page', 'bws-login-register' )
     100                        esc_html__( 'Plugins page', 'bestwebsoft' )
    66101                    )
    67102                );
     
    76111}
    77112
    78 if ( ! function_exists( 'lgnrgstrfrm_show_settings_notice' ) ) {
     113if ( ! function_exists( 'bws_plugin_reviews_block' ) ) {
     114    /**
     115     * Function display review block
     116     *
     117     * @param string $plugin_name Plugin name.
     118     * @param string $plugin_slug Plugin slug.
     119     * @echo string
     120     */
     121    function bws_plugin_reviews_block( $plugin_name, $plugin_slug ) { ?>
     122        <div class="bws-plugin-reviews">
     123            <div class="bws-plugin-reviews-rate">
     124                <?php esc_html_e( 'Like the plugin?', 'bestwebsoft' ); ?>
     125                <a href="https://wordpress.org/support/view/plugin-reviews/<?php echo esc_attr( $plugin_slug ); ?>?filter=5" target="_blank" title="<?php printf( esc_html__( '%s reviews', 'bestwebsoft' ), esc_html( sanitize_text_field( $plugin_name ) ) ); ?>">
     126                    <?php esc_html_e( 'Rate it', 'bestwebsoft' ); ?>
     127                    <span class="dashicons dashicons-star-filled"></span>
     128                    <span class="dashicons dashicons-star-filled"></span>
     129                    <span class="dashicons dashicons-star-filled"></span>
     130                    <span class="dashicons dashicons-star-filled"></span>
     131                    <span class="dashicons dashicons-star-filled"></span>
     132                </a>
     133            </div>
     134            <div class="bws-plugin-reviews-support">
     135                <?php esc_html_e( 'Need help?', 'bestwebsoft' ); ?>
     136                <a href="https://support.bestwebsoft.com"><?php esc_html_e( 'Visit Help Center', 'bestwebsoft' ); ?></a>
     137            </div>
     138            <div class="bws-plugin-reviews-donate">
     139                <?php esc_html_e( 'Want to support the plugin?', 'bestwebsoft' ); ?>
     140                <a href="https://bestwebsoft.com/donate/"><?php esc_html_e( 'Donate', 'bestwebsoft' ); ?></a>
     141            </div>
     142        </div>
     143        <?php
     144    }
     145}
     146
     147if ( ! function_exists( 'bws_plugin_update_row' ) ) {
     148    /**
     149     * Function display license notification
     150     *
     151     * @param string $plugin_key       Plugin key.
     152     * @param string $link_slug        (Optional) Link slug.
     153     * @param string $free_plugin_name (Optional) Free version plugin name.
     154     * @echo string
     155     */
     156    function bws_plugin_update_row( $plugin_key, $link_slug = false, $free_plugin_name = false ) {
     157        global $bstwbsftwppdtplgns_options, $wp_version;
     158        $wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
     159        if ( isset( $bstwbsftwppdtplgns_options['wrong_license_key'][ $plugin_key ] ) ) {
     160            $explode_plugin_key = explode( '/', $plugin_key );
     161            $class              = ( $wp_version >= 4.6 ) ? 'active' : '';
     162            $style              = ( $wp_version < 4.6 ) ? ' style="background-color: #FFEBE8;border-color: #CC0000;"' : '';
     163            $div_class          = ( $wp_version >= 4.6 ) ? ' notice inline notice-warning notice-alt' : '';
     164            echo '<tr class="bws-plugin-update-tr plugin-update-tr ' . esc_attr( $class ) . '" id="' . esc_attr( $explode_plugin_key[0] ) . '-update" data-slug="' . esc_attr( $explode_plugin_key[0] ) . '" data-plugin="' . esc_attr( $plugin_key ) . '">
     165                    <td colspan="' . esc_attr( $wp_list_table->get_column_count() ) . '" class="plugin-update colspanchange">
     166                        <div class="update-message' . esc_attr( $div_class ) . '"' . wp_kses_post( $style ) . '>';
     167            if ( $wp_version >= 4.6 ) {
     168                echo '<p>';
     169            }
     170                        echo '<strong>' . esc_html__( 'WARNING: Illegal use notification', 'bestwebsoft' ) . '.</strong> ' . esc_html__( 'You can use one license of the Pro plugin for one domain only. Please check and edit your license or domain if necessary using your personal Client Area. We strongly recommend you to solve the problem within 24 hours, otherwise the Pro plugin will be deactivated.', 'bestwebsoft' ) . ' <a target="_blank" href="https://support.bestwebsoft.com/hc/en-us/articles/204240089">' . esc_html__( 'Learn More', 'bestwebsoft' ) . '</a>';
     171            if ( $wp_version >= 4.6 ) {
     172                echo '</p>';
     173            }
     174                        echo '</div>
     175                    </td>
     176                </tr>';
     177        } elseif ( isset( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) && strtotime( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) < strtotime( gmdate( 'm/d/Y' ) ) ) {
     178            $explode_plugin_key = explode( '/', $plugin_key );
     179            $class              = ( $wp_version >= 4.6 ) ? 'active' : '';
     180            $style              = ( $wp_version < 4.6 ) ? ' style="color: #8C0000;"' : '';
     181            $div_class          = ( $wp_version >= 4.6 ) ? ' notice inline notice-warning notice-alt' : '';
     182            echo '<tr class="bws-plugin-update-tr plugin-update-tr ' . esc_attr( $class ) . '" id="' . esc_attr( $explode_plugin_key[0] ) . '-update" data-slug="' . esc_attr( $explode_plugin_key[0] ) . '" data-plugin="' . esc_attr( $plugin_key ) . '">
     183                    <td colspan="' . esc_attr( $wp_list_table->get_column_count() ) . '" class="plugin-update colspanchange">
     184                        <div class="update-message' . esc_attr( $div_class ) . '"' . wp_kses_post( $style ) . '>';
     185            if ( $wp_version >= 4.6 ) {
     186                echo '<p>';
     187            }
     188            if ( isset( $bstwbsftwppdtplgns_options['trial'][ $plugin_key ] ) && false !== $link_slug ) {
     189                echo esc_html__( 'Notice: Your Pro Trial license has expired. To continue using the plugin, you should buy a Pro license', 'bestwebsoft' ) . ' - <a href="https://bestwebsoft.com/products/wordpress/plugins/' . esc_attr( $link_slug ) . '/">https://bestwebsoft.com/products/wordpress/plugins/' . esc_attr( $link_slug ) . '/</a>';
     190            } else {
     191                echo esc_html__( 'Your license has expired. To continue getting top-priority support and plugin updates, you should extend it.', 'bestwebsoft' ) . ' <a target="_new" href="https://support.bestwebsoft.com/entries/53487136">' . esc_html__( 'Learn more', 'bestwebsoft' ) . '</a>';
     192            }
     193            if ( $wp_version >= 4.6 ) {
     194                echo '</p>';
     195            }
     196                        echo '</div>
     197                    </td>
     198                </tr>';
     199        } elseif ( isset( $bstwbsftwppdtplgns_options['trial'][ $plugin_key ] ) ) {
     200            $explode_plugin_key = explode( '/', $plugin_key );
     201            $class              = ( $wp_version >= 4.6 ) ? 'active' : '';
     202            $style              = ( $wp_version < 4.6 ) ? ' style="color: #8C0000;"' : '';
     203            $div_class          = ( $wp_version >= 4.6 ) ? ' notice inline notice-warning notice-alt' : '';
     204            echo '<tr class="bws-plugin-update-tr plugin-update-tr ' . esc_attr( $class ) . '" id="' . esc_attr( $explode_plugin_key[0] ) . '-update" data-slug="' . esc_attr( $explode_plugin_key[0] ) . '" data-plugin="' . esc_attr( $plugin_key ) . '">
     205                    <td colspan="' . esc_attr( $wp_list_table->get_column_count() ) . '" class="plugin-update colspanchange">
     206                        <div class="update-message' . esc_attr( $div_class ) . '"' . wp_kses_post( $style ) . '>';
     207            if ( $wp_version >= 4.6 ) {
     208                echo '<p>';
     209            }
     210            if ( false !== $free_plugin_name ) {
     211                printf( esc_html__( 'Notice: You are using the Pro Trial license of %s plugin.', 'bestwebsoft' ), esc_html( $free_plugin_name ) );
     212            } else {
     213                esc_html_e( 'Notice: You are using the Pro Trial license of plugin.', 'bestwebsoft' );
     214            }
     215            if ( isset( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) ) {
     216                echo ' ' . esc_html__( 'The Pro Trial license will expire on', 'bestwebsoft' ) . ' ' . esc_html( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) . '.';
     217            }
     218            if ( $wp_version >= 4.6 ) {
     219                echo '</p>';
     220            }
     221                    echo '</div>
     222                    </td>
     223                </tr>';
     224        }
     225    }
     226}
     227
     228if ( ! function_exists( 'bws_admin_notices' ) ) {
     229    /**
     230     * Function display admin notices
     231     *
     232     * @echo string
     233     */
     234    function bws_admin_notices() {
     235        global $bws_versions_notice_array, $bws_plugin_banner_to_settings, $bstwbsftwppdtplgns_options, $bws_plugin_banner_go_pro, $bstwbsftwppdtplgns_banner_array, $bws_plugin_banner_timeout;
     236
     237        /* bws_plugin_banner_go_pro */
     238        if ( ! empty( $bws_plugin_banner_go_pro ) ) {
     239            /* get $bws_plugins */
     240            require dirname( __FILE__ ) . '/product_list.php';
     241
     242            foreach ( $bstwbsftwppdtplgns_banner_array as $value ) {
     243                if ( isset( $bws_plugin_banner_go_pro[ $value[0] ] ) && ! isset( $_COOKIE[ $value[0] ] ) ) {
     244
     245                    if ( isset( $bws_plugins[ $value[1] ]['pro_version'] ) && is_plugin_active( $bws_plugins[ $value[1] ]['pro_version'] ) ) {
     246                        continue;
     247                    }
     248
     249                    $single_banner_value = $bws_plugin_banner_go_pro[ $value[0] ];
     250                    ?>
     251                    <div class="updated" style="padding: 0; margin: 0; border: none; background: none;">
     252                        <div class="<?php echo esc_attr( $single_banner_value['prefix'] ); ?>_message bws_banner_on_plugin_page bws_go_pro_banner" style="display: none;">
     253                            <button class="<?php echo esc_attr( $single_banner_value['prefix'] ); ?>_close_icon close_icon notice-dismiss bws_hide_settings_notice" title="<?php esc_html_e( 'Close notice', 'bestwebsoft' ); ?>"></button>
     254                            <div class="icon">
     255                                <img title="" src="<?php echo esc_attr( $single_banner_value['banner_url'] ); ?>" alt="" />
     256                            </div>
     257                            <div class="text">
     258                                <?php esc_html_e( 'It’s time to upgrade your', 'bestwebsoft' ); ?> <strong><?php echo esc_html( $single_banner_value['plugin_info']['Name'] ); ?> plugin</strong> <?php esc_html_e( 'to', 'bestwebsoft' ); ?> <strong>Pro</strong> <?php esc_html_e( 'version!', 'bestwebsoft' ); ?><br />
     259                                <span><?php esc_html_e( 'Extend standard plugin functionality with new great options.', 'bestwebsoft' ); ?></span>
     260                            </div>
     261                            <div class="button_div">
     262                                <a class="button" target="_blank" href="<?php echo esc_url( $single_banner_value['bws_link'] ); ?>"><?php esc_html_e( 'Learn More', 'bestwebsoft' ); ?></a>
     263                            </div>
     264                        </div>
     265                    </div>
     266                    <?php
     267                    break;
     268                }
     269            }
     270        }
     271
     272        /* $bws_plugin_banner_timeout */
     273        if ( ! empty( $bws_plugin_banner_timeout ) ) {
     274            foreach ( $bws_plugin_banner_timeout as $banner_value ) {
     275                ?>
     276                <div class="updated" style="padding: 0; margin: 0; border: none; background: none;">
     277                    <div class="<?php echo esc_attr( $banner_value['prefix'] ); ?>_message_timeout bws_banner_on_plugin_page bws_banner_timeout" style="display:none;">
     278                        <button class="<?php echo esc_attr( $banner_value['prefix'] ); ?>_close_icon close_icon notice-dismiss bws_hide_settings_notice" title="<?php esc_html_e( 'Close notice', 'bestwebsoft' ); ?>"></button>
     279                        <div class="icon">
     280                            <img title="" src="<?php echo esc_url( $banner_value['banner_url'] ); ?>" alt="" />
     281                        </div>
     282                        <div class="text"><?php printf( esc_html__( "Your license key for %1\$s expires on %2\$s and you won't be granted TOP-PRIORITY SUPPORT or UPDATES.", 'bestwebsoft' ), '<strong>' . esc_html( $banner_value['plugin_name'] ) . '</strong>', esc_html( $bstwbsftwppdtplgns_options['time_out'][ $banner_value['plugin_key'] ] ) ); ?> <a target="_new" href="https://support.bestwebsoft.com/entries/53487136"><?php esc_html_e( 'Learn more', 'bestwebsoft' ); ?></a></div>
     283                    </div>
     284                </div>
     285                <?php
     286            }
     287        }
     288
     289        /*  versions notice */
     290        if ( ! empty( $bws_versions_notice_array ) ) {
     291            foreach ( $bws_versions_notice_array as $key => $value ) {
     292                ?>
     293                <div class="update-nag">
     294                    <?php
     295                    printf(
     296                        '<strong>%s</strong> %s <strong>WordPress %s</strong> %s',
     297                        esc_html( $value['name'] ),
     298                        esc_html__( 'requires', 'bestwebsoft' ),
     299                        esc_html( $value['version'] ),
     300                        esc_html__( 'or higher! We do not guarantee that our plugin will work correctly. Please upgrade to WordPress latest version.', 'bestwebsoft' )
     301                    );
     302                    ?>
     303                </div>
     304                <?php
     305            }
     306        }
     307
     308        /*  banner_to_settings notice */
     309        if ( ! empty( $bws_plugin_banner_to_settings ) ) {
     310            if ( 1 === count( $bws_plugin_banner_to_settings ) ) {
     311                ?>
     312                <div class="updated" style="padding: 0; margin: 0; border: none; background: none;">
     313                    <div class="bws_banner_on_plugin_page bws_banner_to_settings">
     314                        <div class="icon">
     315                            <img title="" src="<?php echo esc_url( $bws_plugin_banner_to_settings[0]['banner_url'] ); ?>" alt="" />
     316                        </div>
     317                        <div class="text">
     318                            <strong><?php printf( esc_html__( 'Thank you for installing %s plugin!', 'bestwebsoft' ), esc_html( $bws_plugin_banner_to_settings[0]['plugin_info']['Name'] ) ); ?></strong>
     319                            <br />
     320                            <?php esc_html_e( "Let's get started", 'bestwebsoft' ); ?>:
     321                            <a href="<?php echo esc_url( self_admin_url( $bws_plugin_banner_to_settings[0]['settings_url'] ) ); ?>"><?php esc_html_e( 'Settings', 'bestwebsoft' ); ?></a>
     322                            <?php if ( false !== $bws_plugin_banner_to_settings[0]['post_type_url'] ) { ?>
     323                                <?php esc_html_e( 'or', 'bestwebsoft' ); ?>
     324                                <a href="<?php echo esc_url( self_admin_url( $bws_plugin_banner_to_settings[0]['post_type_url'] ) ); ?>"><?php esc_html_e( 'Add New', 'bestwebsoft' ); ?></a>
     325                            <?php } ?>
     326                        </div>
     327                        <form action="" method="post">
     328                            <button class="notice-dismiss bws_hide_settings_notice" title="<?php esc_html_e( 'Close notice', 'bestwebsoft' ); ?>"></button>
     329                            <input type="hidden" name="bws_hide_settings_notice_<?php echo esc_html( $bws_plugin_banner_to_settings[0]['plugin_options_name'] ); ?>" value="hide" />
     330                            <?php wp_nonce_field( plugin_basename( __FILE__ ), 'bws_settings_nonce_name' ); ?>
     331                        </form>
     332                    </div>
     333                </div>
     334            <?php } else { ?>
     335                <div class="updated" style="padding: 0; margin: 0; border: none; background: none;">
     336                    <div class="bws_banner_on_plugin_page bws_banner_to_settings_joint">
     337                        <form action="" method="post">
     338                            <button class="notice-dismiss bws_hide_settings_notice" title="<?php esc_html_e( 'Close notice', 'bestwebsoft' ); ?>"></button>
     339                            <div class="bws-text">
     340                                <div class="icon">
     341                                    <span class="dashicons dashicons-admin-plugins"></span>
     342                                </div>
     343                                <strong><?php esc_html_e( 'Thank you for installing plugins by BestWebSoft!', 'bestwebsoft' ); ?></strong>
     344                                <div class="hide-if-no-js bws-more-links">
     345                                    <a href="#" class="bws-more"><?php esc_html_e( 'More Details', 'bestwebsoft' ); ?></a>
     346                                    <a href="#" class="bws-less hidden"><?php esc_html_e( 'Less Details', 'bestwebsoft' ); ?></a>
     347                                </div>
     348                                <?php wp_nonce_field( plugin_basename( __FILE__ ), 'bws_settings_nonce_name' ); ?>
     349                                <div class="clear"></div>
     350                            </div>
     351                            <div class="bws-details hide-if-js">
     352                                <?php foreach ( $bws_plugin_banner_to_settings as $value ) { ?>
     353                                    <div>
     354                                        <strong><?php echo esc_html( str_replace( ' by BestWebSoft', '', $value['plugin_info']['Name'] ) ); ?></strong>&ensp;<a href="<?php echo esc_url( self_admin_url( $value['settings_url'] ) ); ?>"><?php esc_html_e( 'Settings', 'bestwebsoft' ); ?></a>
     355                                        <?php if ( false !== $value['post_type_url'] ) { ?>
     356                                            &ensp;|&ensp;<a target="_blank" href="<?php echo esc_url( self_admin_url( $value['post_type_url'] ) ); ?>"><?php esc_html_e( 'Add New', 'bestwebsoft' ); ?></a>
     357                                        <?php } ?>
     358                                        <input type="hidden" name="bws_hide_settings_notice_<?php echo esc_html( $value['plugin_options_name'] ); ?>" value="hide" />
     359                                    </div>
     360                                <?php } ?>
     361                            </div>
     362                        </div>
     363                    </form>
     364                </div>
     365                <?php
     366            }
     367        }
     368
     369        /**
     370         * Show notices about deprecated_function
     371         *
     372         * @since 1.9.8
     373        */
     374        if ( ! empty( $bstwbsftwppdtplgns_options['deprecated_function'] ) ) {
     375            ?>
     376            <div class="update-nag">
     377                <strong><?php esc_html_e( 'Deprecated function(-s) is used on the site here:', 'bestwebsoft' ); ?></strong>
     378                <?php
     379                $i = 1;
     380                foreach ( $bstwbsftwppdtplgns_options['deprecated_function'] as $function_name => $attr ) {
     381                    if ( 1 !== $i ) {
     382                        echo ' ,';
     383                    }
     384                    if ( ! empty( $attr['product-name'] ) ) {
     385                        echo esc_html( $attr['product-name'] );
     386                    } elseif ( ! empty( $attr['file'] ) ) {
     387                        echo esc_url( $attr['file'] );
     388                    }
     389                    unset( $bstwbsftwppdtplgns_options['deprecated_function'][ $function_name ] );
     390                    $i++;
     391                }
     392                ?>
     393                .
     394                <br/>
     395                <?php esc_html_e( 'This function(-s) will be removed over time. Please update the product(-s).', 'bestwebsoft' ); ?>
     396            </div>
     397            <?php
     398            if ( is_multisite() ) {
     399                update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     400            } else {
     401                update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     402            }
     403        }
     404    }
     405}
     406
     407if ( ! function_exists( 'bws_plugin_banner_go_pro' ) ) {
     408    /**
     409     * Function display banner
     410     *
     411     * @param array  $plugin_options     Plugin options array.
     412     * @param array  $plugin_info        Plugin info array.
     413     * @param string $this_banner_prefix Banner prefix.
     414     * @param string $bws_link_slug      Slug for link.
     415     * @param string $link_key           Key for plugin.
     416     * @param string $link_pn            PN for plugin.
     417     * @param string $banner_url_or_slug Url or slug for icon.
     418     * @return array
     419     */
     420    function bws_plugin_banner_go_pro( $plugin_options, $plugin_info, $this_banner_prefix, $bws_link_slug, $link_key, $link_pn, $banner_url_or_slug ) {
     421        global $bws_plugin_banner_go_pro, $wp_version, $bstwbsftwppdtplgns_banner_array;
     422
     423        if ( ! isset( $plugin_options['first_install'] ) || strtotime( '-1 week' ) < $plugin_options['first_install'] ) {
     424            return;
     425        }
     426
     427        $bws_link = esc_url( 'https://bestwebsoft.com/products/wordpress/plugins/' . $bws_link_slug . '/?k=' . $link_key . '&pn=' . $link_pn . '&v=' . $plugin_info['Version'] . '&wp_v=' . $wp_version );
     428
     429        if ( false === strrpos( $banner_url_or_slug, '/' ) ) {
     430            $banner_url_or_slug = '//ps.w.org/' . $banner_url_or_slug . '/assets/icon-256x256.png';
     431        }
     432
     433        $bws_plugin_banner_go_pro[ $this_banner_prefix . '_hide_banner_on_plugin_page' ] = array(
     434            'plugin_info' => $plugin_info,
     435            'prefix'      => $this_banner_prefix,
     436            'bws_link'    => $bws_link,
     437            'banner_url'  => $banner_url_or_slug,
     438        );
     439
     440        if ( empty( $bstwbsftwppdtplgns_banner_array ) ) {
     441            if ( ! function_exists( 'bws_get_banner_array' ) ) {
     442                require_once dirname( __FILE__ ) . '/bws_menu.php';
     443            }
     444            bws_get_banner_array();
     445        }
     446    }
     447}
     448
     449if ( ! function_exists( 'bws_add_plugin_banner_timeout' ) ) {
     450    /**
     451     * Function update banner params
     452     *
     453     * @param string $plugin_key         Plugin key.
     454     * @param string $plugin_prefix      Plugin prefix.
     455     * @param string $plugin_name        Plugin name.
     456     * @param string $banner_url_or_slug Url or slug for icon.
     457     */
     458    function bws_add_plugin_banner_timeout( $plugin_key, $plugin_prefix, $plugin_name, $banner_url_or_slug ) {
     459        global $bws_plugin_banner_timeout;
     460
     461        if ( isset( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) && ( strtotime( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) < strtotime( gmdate( 'm/d/Y' ) . '+1 month' ) ) && ( strtotime( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) > strtotime( gmdate( 'm/d/Y' ) ) ) ) {
     462
     463            if ( false === strrpos( $banner_url_or_slug, '/' ) ) {
     464                $banner_url_or_slug = '//ps.w.org/' . $banner_url_or_slug . '/assets/icon-256x256.png';
     465            }
     466
     467            $bws_plugin_banner_timeout[] = array(
     468                'plugin_key'  => $plugin_key,
     469                'prefix'      => $plugin_prefix,
     470                'plugin_name' => $plugin_name,
     471                'banner_url'  => $banner_url_or_slug,
     472            );
     473        }
     474    }
     475}
     476
     477if ( ! function_exists( 'bws_plugin_banner_to_settings' ) ) {
     478    /**
     479     * Function settings for banner
     480     *
     481     * @param array $plugin_info              Plugin info.
     482     * @param array $plugin_options_name      Plugin option name.
     483     * @param array $banner_url_or_slug       Url or slug for icon.
     484     * @param array $settings_url             Url for settings.
     485     * @param array $post_type_url (Optional) Url for banner.
     486     * @return global array
     487     */
     488    function bws_plugin_banner_to_settings( $plugin_info, $plugin_options_name, $banner_url_or_slug, $settings_url, $post_type_url = false ) {
     489        global $bws_plugin_banner_to_settings;
     490
     491        $is_network_admin = is_network_admin();
     492
     493        $plugin_options = $is_network_admin ? get_site_option( $plugin_options_name ) : get_option( $plugin_options_name );
     494
     495        if ( isset( $plugin_options['display_settings_notice'] ) && 0 === $plugin_options['display_settings_notice'] ) {
     496            return;
     497        }
     498
     499        if ( isset( $_POST[ 'bws_hide_settings_notice_' . $plugin_options_name ] ) && check_admin_referer( plugin_basename( __FILE__ ), 'bws_settings_nonce_name' ) ) {
     500            $plugin_options['display_settings_notice'] = 0;
     501            if ( $is_network_admin ) {
     502                update_site_option( $plugin_options_name, $plugin_options );
     503            } else {
     504                update_option( $plugin_options_name, $plugin_options );
     505            }
     506            return;
     507        }
     508
     509        if ( false === strrpos( $banner_url_or_slug, '/' ) ) {
     510            $banner_url_or_slug = '//ps.w.org/' . $banner_url_or_slug . '/assets/icon-256x256.png';
     511        }
     512
     513        $bws_plugin_banner_to_settings[] = array(
     514            'plugin_info'         => $plugin_info,
     515            'plugin_options_name' => $plugin_options_name,
     516            'banner_url'          => $banner_url_or_slug,
     517            'settings_url'        => $settings_url,
     518            'post_type_url'       => $post_type_url,
     519        );
     520    }
     521}
     522
     523if ( ! function_exists( 'bws_plugin_suggest_feature_banner' ) ) {
     524    /**
     525     * Function display for feature banner
     526     *
     527     * @param array $plugin_info              Plugin info.
     528     * @param array $plugin_options_name      Plugin option name.
     529     * @param array $banner_url_or_slug       Url or slug for icon.
     530     * @echo string
     531     */
     532    function bws_plugin_suggest_feature_banner( $plugin_info, $plugin_options_name, $banner_url_or_slug ) {
     533        $is_network_admin = is_network_admin();
     534
     535        $plugin_options = $is_network_admin ? get_site_option( $plugin_options_name ) : get_option( $plugin_options_name );
     536
     537        if ( isset( $plugin_options['display_suggest_feature_banner'] ) && 0 === $plugin_options['display_suggest_feature_banner'] ) {
     538            return;
     539        }
     540
     541        if ( ! isset( $plugin_options['first_install'] ) ) {
     542            $plugin_options['first_install'] = strtotime( 'now' );
     543            $update_option                   = true;
     544            $return                          = true;
     545        } elseif ( strtotime( '-2 week' ) < $plugin_options['first_install'] ) {
     546            $return = true;
     547        }
     548
     549        if ( ! isset( $plugin_options['go_settings_counter'] ) ) {
     550            $plugin_options['go_settings_counter'] = 1;
     551            $update_option                         = true;
     552            $return                                = true;
     553        } elseif ( 20 > $plugin_options['go_settings_counter'] ) {
     554            $plugin_options['go_settings_counter'] = $plugin_options['go_settings_counter'] + 1;
     555            $update_option                         = true;
     556            $return                                = true;
     557        }
     558
     559        if ( isset( $update_option ) ) {
     560            if ( $is_network_admin ) {
     561                update_site_option( $plugin_options_name, $plugin_options );
     562            } else {
     563                update_option( $plugin_options_name, $plugin_options );
     564            }
     565        }
     566
     567        if ( isset( $return ) ) {
     568            return;
     569        }
     570
     571        if ( isset( $_POST[ 'bws_hide_suggest_feature_banner_' . $plugin_options_name ] ) && check_admin_referer( $plugin_info['Name'], 'bws_settings_nonce_name' ) ) {
     572            $plugin_options['display_suggest_feature_banner'] = 0;
     573            if ( $is_network_admin ) {
     574                update_site_option( $plugin_options_name, $plugin_options );
     575            } else {
     576                update_option( $plugin_options_name, $plugin_options );
     577            }
     578            return;
     579        }
     580
     581        if ( false === strrpos( $banner_url_or_slug, '/' ) ) {
     582            $banner_url_or_slug = '//ps.w.org/' . $banner_url_or_slug . '/assets/icon-256x256.png';
     583        }
     584        ?>
     585        <div class="updated" style="padding: 0; margin: 0; border: none; background: none;">
     586            <div class="bws_banner_on_plugin_page bws_suggest_feature_banner">
     587                <div class="icon">
     588                    <img title="" src="<?php echo esc_url( $banner_url_or_slug ); ?>" alt="" />
     589                </div>
     590                <div class="text">
     591                    <strong><?php printf( esc_html__( 'Thank you for choosing %s plugin!', 'bestwebsoft' ), esc_html( $plugin_info['Name'] ) ); ?></strong><br />
     592                    <?php esc_html_e( "If you have a feature, suggestion or idea you'd like to see in the plugin, we'd love to hear about it!", 'bestwebsoft' ); ?>
     593                    <a target="_blank" href="https://support.bestwebsoft.com/hc/en-us/requests/new"><?php esc_html_e( 'Suggest a Feature', 'bestwebsoft' ); ?></a>
     594                </div>
     595                <form action="" method="post">
     596                    <button class="notice-dismiss bws_hide_settings_notice" title="<?php esc_html_e( 'Close notice', 'bestwebsoft' ); ?>"></button>
     597                    <input type="hidden" name="bws_hide_suggest_feature_banner_<?php echo esc_html( $plugin_options_name ); ?>" value="hide" />
     598                    <?php wp_nonce_field( $plugin_info['Name'], 'bws_settings_nonce_name' ); ?>
     599                </form>
     600            </div>
     601        </div>
     602        <?php
     603    }
     604}
     605
     606if ( ! function_exists( 'bws_affiliate_postbox' ) ) {
     607    /**
     608     * Function display affiliate postbox
     609     *
     610     * @echo string
     611     */
     612    function bws_affiliate_postbox() {
     613
     614        $dismissed = get_user_meta( get_current_user_id(), '_bws_affiliate_postbox_dismissed', true );
     615
     616        if ( ! empty( $dismissed ) && strtotime( '-3 month' ) < $dismissed ) {
     617            return;
     618        }
     619
     620        if ( isset( $_POST['bws_hide_affiliate_banner'] ) && check_admin_referer( 'bws_affiliate_postbox', 'bws_settings_nonce_name' ) ) {
     621            update_user_meta( get_current_user_id(), '_bws_affiliate_postbox_dismissed', strtotime( 'now' ) );
     622            return;
     623        }
     624
     625        $bws_link = esc_url( 'https://bestwebsoft.com/affiliate/?utm_source=plugin&utm_medium=settings&utm_campaign=affiliate_program' );
     626        ?>
     627        <div id="bws-affiliate-postbox" class="postbox">
     628            <form action="" method="post">
     629                <button class="notice-dismiss bws_hide_settings_notice" title="<?php esc_html_e( 'Close notice', 'bestwebsoft' ); ?>"></button>
     630                <input type="hidden" name="bws_hide_affiliate_banner" value="hide" />
     631                <?php wp_nonce_field( 'bws_affiliate_postbox', 'bws_settings_nonce_name' ); ?>
     632            </form>
     633            <p>BESTWEBSOFT</p> 
     634            <h3><?php esc_html_e( 'Affiliate Program', 'bestwebsoft' ); ?></h3>
     635            <div class="bws-affiliate-get"><?php printf( esc_html__( 'Get %s', 'bestwebsoft' ), '20%' ); ?></div>
     636            <div><?php esc_html_e( 'from each BestWebSoft plugin and theme sale you refer', 'bestwebsoft' ); ?></div>
     637            <div class="bws-row">
     638                <div class="bws-cell">
     639                    <img src="<?php echo esc_url( bws_menu_url( 'images/join-icon.svg' ) ); ?>" alt="" />
     640                    <div><?php esc_html_e( 'Join affiliate program', 'bestwebsoft' ); ?></div>
     641                </div>
     642                <div class="bws-cell">
     643                    <img src="<?php echo esc_url( bws_menu_url( 'images/promote-icon.svg' ) ); ?>" alt="" />
     644                    <div><?php esc_html_e( 'Promote and sell products', 'bestwebsoft' ); ?></div>
     645                </div>
     646                <div class="bws-cell">
     647                    <img src="<?php echo esc_url( bws_menu_url( 'images/earn-icon.svg' ) ); ?>" alt="" />
     648                    <div><?php esc_html_e( 'Get commission!', 'bestwebsoft' ); ?></div>
     649                </div>
     650            </div>
     651            <div class="clear"></div>
     652            <p>
     653                <a class="button" href="<?php echo esc_url( $bws_link ); ?>" target="_blank"><?php esc_html_e( 'Start Now', 'bestwebsoft' ); ?></a>
     654            </p>
     655        </div>
     656        <?php
     657    }
     658}
     659
     660if ( ! function_exists( 'bws_show_settings_notice' ) ) {
    79661    /**
    80662     * Function display settings notice
     
    82664     * @echo string
    83665     */
    84     function lgnrgstrfrm_show_settings_notice() {
     666    function bws_show_settings_notice() {
    85667        ?>
    86668        <div id="bws_save_settings_notice" class="updated fade below-h2" style="display:none;">
    87669            <p>
    88                 <strong><?php esc_html_e( 'Notice', 'bws-login-register' ); ?></strong>: <?php esc_html_e( "The plugin's settings have been changed.", 'bws-login-register' ); ?>
    89                 <a class="bws_save_anchor" href="#bws-submit-button"><?php esc_html_e( 'Save Changes', 'bws-login-register' ); ?></a>
     670                <strong><?php esc_html_e( 'Notice', 'bestwebsoft' ); ?></strong>: <?php esc_html_e( "The plugin's settings have been changed.", 'bestwebsoft' ); ?>
     671                <a class="bws_save_anchor" href="#bws-submit-button"><?php esc_html_e( 'Save Changes', 'bestwebsoft' ); ?></a>
    90672            </p>
    91673        </div>
     
    94676}
    95677
    96 if ( ! function_exists( 'lgnrgstrfrm_enqueue_settings_scripts' ) ) {
     678if ( ! function_exists( 'bws_hide_premium_options' ) ) {
     679    /**
     680     * Function for hide premium options
     681     *
     682     * @param array $options Plugin options.
     683     * @echo string
     684     */
     685    function bws_hide_premium_options( $options ) {
     686        if ( ! isset( $options['hide_premium_options'] ) || ! is_array( $options['hide_premium_options'] ) ) {
     687            $options['hide_premium_options'] = array();
     688        }
     689
     690        $options['hide_premium_options'][] = get_current_user_id();
     691
     692        return array(
     693            'message' => esc_html__( 'You can always look at premium options by checking the "Pro Options" in the "Misc" tab.', 'bestwebsoft' ),
     694            'options' => $options,
     695        );
     696    }
     697}
     698
     699if ( ! function_exists( 'bws_hide_premium_options_check' ) ) {
     700    /**
     701     * Function for check checkbox for hide premium options
     702     *
     703     * @param array $options Plugin options.
     704     * @return bool
     705     */
     706    function bws_hide_premium_options_check( $options ) {
     707        if ( ! empty( $options['hide_premium_options'] ) && in_array( get_current_user_id(), $options['hide_premium_options'] ) ) {
     708            return true;
     709        } else {
     710            return false;
     711        }
     712    }
     713}
     714
     715if ( ! function_exists( 'bws_plugins_admin_init' ) ) {
     716    /**
     717     * Function init fir dashboard
     718     */
     719    function bws_plugins_admin_init() {
     720        $page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
     721        if ( isset( $_GET['bws_activate_plugin'] ) && check_admin_referer( 'bws_activate_plugin' . sanitize_text_field( wp_unslash( $_GET['bws_activate_plugin'] ) ) ) ) {
     722
     723            $plugin = isset( $_GET['bws_activate_plugin'] ) ? sanitize_text_field( wp_unslash( $_GET['bws_activate_plugin'] ) ) : '';
     724            $result = activate_plugin( $plugin, '', is_network_admin() );
     725            if ( is_wp_error( $result ) ) {
     726                if ( 'unexpected_output' === $result->get_error_code() ) {
     727                    $redirect = self_admin_url( 'admin.php?page=bws_panel&error=true&charsout=' . strlen( $result->get_error_data() ) . '&plugin=' . $plugin );
     728                    wp_safe_redirect( add_query_arg( '_error_nonce', wp_create_nonce( 'plugin-activation-error_' . $plugin ), $redirect ) );
     729                    exit();
     730                } else {
     731                    wp_die( esc_html( $result ) );
     732                }
     733            }
     734
     735            if ( ! is_network_admin() ) {
     736                $recent = (array) get_option( 'recently_activated' );
     737                unset( $recent[ $plugin ] );
     738                update_option( 'recently_activated', $recent );
     739            } else {
     740                $recent = (array) get_site_option( 'recently_activated' );
     741                unset( $recent[ $plugin ] );
     742                update_site_option( 'recently_activated', $recent );
     743            }
     744            /**
     745            * @deprecated 1.9.8 (15.12.2016)
     746            */
     747            $is_main_page = in_array( $page, array( 'bws_panel', 'bws_themes', 'bws_system_status' ) );
     748            $tab          = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : '';
     749
     750            if ( $is_main_page ) {
     751                $current_page = 'admin.php?page=' . $page;
     752            } else {
     753                $current_page = isset( $_GET['tab'] ) ? 'admin.php?page=' . $page . '&tab=' . $tab : 'admin.php?page=' . $page;
     754            }
     755            /*end deprecated */
     756
     757            wp_safe_redirect( self_admin_url( esc_url( $current_page . '&activate=true' ) ) );
     758            exit();
     759        }
     760
     761        if ( 'bws_panel' === $page || strpos( $page, '-bws-panel' ) ) {
     762            if ( ! session_id() ) {
     763                @session_start();
     764            }
     765        }
     766
     767        bws_add_editor_buttons();
     768    }
     769}
     770
     771if ( ! function_exists( 'bws_admin_enqueue_scripts' ) ) {
     772    /**
     773     * Function add scripts ans syles for dashboard
     774     */
     775    function bws_admin_enqueue_scripts() {
     776        global $wp_scripts,
     777            $hook_suffix,
     778            $post_type,
     779            $bws_plugin_banner_go_pro, $bws_plugin_banner_timeout, $bstwbsftwppdtplgns_banner_array,
     780            $bws_shortcode_list,
     781            $wp_filesystem,
     782            $bws_plugins,
     783            $pagenow;
     784
     785        $page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
     786
     787        wp_enqueue_style( 'bws-admin-css', bws_menu_url( 'css/general_style.css' ), array(), '2.4.2' );
     788        wp_enqueue_script( 'bws-admin-scripts', bws_menu_url( 'js/general_script.js' ), array( 'jquery', 'jquery-ui-tooltip' ) );
     789
     790        $plugin_dir  = explode( '/', plugin_basename( __FILE__ ) )[0];
     791        $plugin_file = array_keys( get_plugins( "/$plugin_dir" ) )[0];
     792
     793        $include_jquery_ui = false;
     794        if ( ! empty( $bws_plugins ) ) {
     795            $admin_page_free = $pagenow . '?page=' . str_replace( '-pro', '', $page );
     796
     797            foreach ( $bws_plugins as $bws_plugin ) {
     798                if ( $admin_page_free === $bws_plugin['settings'] ) {
     799                    $include_jquery_ui = true;
     800                    break;
     801                }
     802            }
     803        }
     804
     805        if ( in_array( $page, array( 'bws_panel', 'bws_themes', 'bws_system_status', $plugin_file ) ) || $include_jquery_ui || strpos( $page, '-bws-panel' ) ) {
     806            $jquery_ui_version = isset( $wp_scripts->registered['jquery-ui-core']->ver ) ? $wp_scripts->registered['jquery-ui-core']->ver : '1.12.1';
     807            WP_Filesystem();
     808            if ( ! $wp_filesystem->exists( dirname( __FILE__ ) . '/css/jquery-ui-styles/' . $jquery_ui_version . '/' ) ) {
     809                $jquery_ui_version = '1.12.1';
     810            }
     811            wp_enqueue_style( 'jquery-ui-style', bws_menu_url( 'css/jquery-ui-styles/' . $jquery_ui_version . '/jquery-ui.css', array(), $jquery_ui_version ) );
     812            wp_enqueue_style( 'bws_menu_style', bws_menu_url( 'css/style.css' ), array(), '2.4.2' );
     813            wp_enqueue_script( 'bws_menu_script', bws_menu_url( 'js/bws_menu.js' ), array(), '2.4.2', true );
     814            wp_enqueue_script( 'theme-install' );
     815            add_thickbox();
     816            wp_enqueue_script( 'plugin-install' );
     817        }
     818
     819        if ( 'plugins.php' === $hook_suffix ) {
     820            if ( ! empty( $bws_plugin_banner_go_pro ) || ! empty( $bws_plugin_banner_timeout ) ) {
     821                wp_enqueue_script( 'bws_menu_cookie', bws_menu_url( 'js/c_o_o_k_i_e.js' ) );
     822
     823                if ( ! empty( $bws_plugin_banner_go_pro ) ) {
     824
     825                    foreach ( $bstwbsftwppdtplgns_banner_array as $value ) {
     826                        if ( isset( $bws_plugin_banner_go_pro[ $value[0] ] ) && ! isset( $_COOKIE[ $value[0] ] ) ) {
     827                            $prefix = $bws_plugin_banner_go_pro[ $value[0] ]['prefix'];
     828
     829                            $script = "(function($) {
     830                                $(document).ready( function() {
     831                                    var hide_message = $.cookie( '" . $prefix . "_hide_banner_on_plugin_page' );
     832                                    if ( hide_message === 'true' ) {
     833                                        $( '." . $prefix . "_message' ).css( 'display', 'none' );
     834                                    } else {
     835                                        $( '." . $prefix . "_message' ).css( 'display', 'block' );
     836                                    };
     837                                    $( '." . $prefix . "_close_icon' ).click( function() {
     838                                        $( '." . $prefix . "_message' ).css( 'display', 'none' );
     839                                        $.cookie( '" . $prefix . "_hide_banner_on_plugin_page', 'true', { expires: 32, secure: true } );
     840                                    });
     841                                });
     842                            })(jQuery);";
     843
     844                            wp_register_script( $prefix . '_hide_banner_on_plugin_page', '' );
     845                            wp_enqueue_script( $prefix . '_hide_banner_on_plugin_page' );
     846                            wp_add_inline_script( $prefix . '_hide_banner_on_plugin_page', sprintf( $script ) );
     847                            break;
     848                        }
     849                    }
     850                }
     851
     852                if ( ! empty( $bws_plugin_banner_timeout ) ) {
     853                    $script = '(function($) {
     854                            $(document).ready( function() {';
     855
     856                    foreach ( $bws_plugin_banner_timeout as $banner_value ) {
     857                        $script .= "var hide_message = $.cookie( '" . $banner_value['prefix'] . "_timeout_hide_banner_on_plugin_page' );
     858                            if ( hide_message === 'true' ) {
     859                                $( '." . $banner_value['prefix'] . "_message_timeout' ).css( 'display', 'none' );
     860                            } else {
     861                                $( '." . $banner_value['prefix'] . "_message_timeout' ).css( 'display', 'block' );
     862                            }
     863                            $( '." . $banner_value['prefix'] . "_close_icon' ).click( function() {
     864                                $( '." . $banner_value['prefix'] . "_message_timeout' ).css( 'display', 'none' );
     865                                $.cookie( '" . $banner_value['prefix'] . "_timeout_hide_banner_on_plugin_page', 'true', { expires: 30, secure: true } );
     866                            });";
     867                    }
     868
     869                    $script .= '});
     870                        })(jQuery);';
     871
     872                    wp_register_script( 'plugin_banner_timeout_hide', '' );
     873                    wp_enqueue_script( 'plugin_banner_timeout_hide' );
     874                    wp_add_inline_script( 'plugin_banner_timeout_hide', sprintf( $script ) );
     875                }
     876            }
     877
     878            if ( ! defined( 'DOING_AJAX' ) ) {
     879                wp_enqueue_style( 'bws-modal-css', bws_menu_url( 'css/modal.css' ) );
     880
     881                bws_add_deactivation_feedback_dialog_box();
     882            }
     883        }
     884
     885        if ( 'multilanguage-languages.php' === $page ) {
     886            wp_enqueue_style( 'bws-modal-css', bws_menu_url( 'css/modal.css' ) );
     887        }
     888
     889        if ( ! empty( $bws_shortcode_list ) ) {
     890            /* TinyMCE Shortcode Plugin */
     891            $script = "var bws_shortcode_button = {
     892                    'label': '" . esc_attr__( 'Add BWS Shortcode', 'bestwebsoft' ) . "',
     893                    'title': '" . esc_attr__( 'Add BWS Plugins Shortcode', 'bestwebsoft' ) . "',
     894                    'function_name': [";
     895            foreach ( $bws_shortcode_list as $value ) {
     896                if ( isset( $value['js_function'] ) ) {
     897                    $script .= "'" . $value['js_function'] . "',";
     898                }
     899            }
     900            $script .= ']
     901                };';
     902            wp_register_script( 'bws_shortcode_button', '' );
     903            wp_enqueue_script( 'bws_shortcode_button' );
     904            wp_add_inline_script( 'bws_shortcode_button', sprintf( $script ) );
     905
     906            /* TinyMCE Shortcode Plugin */
     907            if ( isset( $post_type ) && in_array( $post_type, array( 'post', 'page' ) ) ) {
     908                $tooltip_args = array(
     909                    'tooltip_id'   => 'bws_shortcode_button_tooltip',
     910                    'css_selector' => '.mce-bws_shortcode_button',
     911                    'actions'      => array(
     912                        'click'  => false,
     913                        'onload' => true,
     914                    ),
     915                    'content'      => '<h3>' . esc_html__( 'Add shortcode', 'bestwebsoft' ) . '</h3><p>' . esc_html__( "Add BestWebSoft plugins' shortcodes using this button.", 'bestwebsoft' ) . '</p>',
     916                    'position'     => array(
     917                        'edge' => 'right',
     918                    ),
     919                    'set_timeout'  => 2000,
     920                );
     921                bws_add_tooltip_in_admin( $tooltip_args );
     922            }
     923        }
     924    }
     925}
     926
     927if ( ! function_exists( 'bws_enqueue_settings_scripts' ) ) {
    97928    /**
    98929     * Add styles and scripts for Bws_Settings_Tabs
     
    100931     * @since 1.9.8
    101932     */
    102     function lgnrgstrfrm_enqueue_settings_scripts() {
     933    function bws_enqueue_settings_scripts() {
    103934        wp_enqueue_script( 'jquery-ui-resizable' );
    104935        wp_enqueue_script( 'jquery-ui-tabs' );
    105         wp_enqueue_style( 'lgnrgstrfrm-modal-css', lgnrgstrfrm_menu_url( 'css/modal.css' ), array(), '2.4.2' );
    106     }
    107 }
    108 
    109 if ( ! function_exists( 'lgnrgstrfrm_add_tooltip_in_admin' ) ) {
     936        wp_enqueue_style( 'bws-modal-css', bws_menu_url( 'css/modal.css' ), array(), '2.4.2' );
     937    }
     938}
     939
     940if ( ! function_exists( 'bws_plugins_admin_head' ) ) {
     941    /**
     942     * Function add syles into admin head
     943     *
     944     * @since 1.9.8
     945     */
     946    function bws_plugins_admin_head() {
     947        $page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
     948
     949        if ( 'bws_panel' === $page ) {
     950            ?>
     951            <noscript>
     952                <style type="text/css">
     953                    .bws_product_button {
     954                        display: inline-block;
     955                    }
     956                </style>
     957            </noscript>
     958            <?php
     959        }
     960    }
     961}
     962
     963if ( ! function_exists( 'bws_plugins_admin_footer' ) ) {
     964    /**
     965     * Function add syles into admin footer
     966     *
     967     * @since 1.9.8
     968     */
     969    function bws_plugins_admin_footer() {
     970        $screen = get_current_screen();
     971        if ( 'edit' === $screen->parent_base ) {
     972            bws_shortcode_media_button_popup();
     973        }
     974    }
     975}
     976
     977if ( ! function_exists( 'bws_plugins_include_codemirror' ) ) {
     978    /**
     979     * Function add style and scripts for older version
     980     *
     981     * @since 1.9.8
     982     */
     983    function bws_plugins_include_codemirror() {
     984        global $wp_version;
     985        if ( version_compare( $wp_version, '4.9.0', '>=' ) ) {
     986            wp_enqueue_style( 'wp-codemirror' );
     987            wp_enqueue_script( 'wp-codemirror' );
     988        }
     989    }
     990}
     991
     992if ( ! function_exists( 'bws_add_tooltip_in_admin' ) ) {
    110993    /**
    111994     * Tooltip block
     
    113996     * @param array $tooltip_args Args for tooltip.
    114997     */
    115     function lgnrgstrfrm_add_tooltip_in_admin( $tooltip_args = array() ) {
    116         new Lgnrgstrfrm_Admin_Tooltip( $tooltip_args );
    117     }
    118 }
    119 
    120 if ( ! class_exists( 'Lgnrgstrfrm_Admin_Tooltip' ) ) {
     998    function bws_add_tooltip_in_admin( $tooltip_args = array() ) {
     999        new BWS_Admin_Tooltip( $tooltip_args );
     1000    }
     1001}
     1002
     1003if ( ! class_exists( 'BWS_Admin_Tooltip' ) ) {
    1211004    /**
    1221005     * Class for Tooltip
     
    1241007     * @since 1.9.8
    1251008     */
    126     class Lgnrgstrfrm_Admin_Tooltip {
     1009    class BWS_Admin_Tooltip {
    1271010        private $tooltip_args;
    1281011
     
    1461029                    'close' => array(
    1471030                        'type' => 'dismiss',
    148                         'text' => esc_html__( 'Close', 'bws-login-register' ),
     1031                        'text' => esc_html__( 'Close', 'bestwebsoft' ),
    1491032                    ),
    1501033                ),
     
    2121095            /* add script that displays our tooltip */
    2131096            if ( ! isset( $bstwbsftwppdtplgns_tooltip_script_add ) ) {
    214                 wp_enqueue_script( 'lgnrgstrfrm-tooltip-script', lgnrgstrfrm_menu_url( 'js/bws_tooltip.js' ), array(), '2.4.2' );
     1097                wp_enqueue_script( 'bws-tooltip-script', bws_menu_url( 'js/bws_tooltip.js' ), array(), '2.4.2' );
    2151098                $bstwbsftwppdtplgns_tooltip_script_add = true;
    2161099            }
     
    2221105                    })
    2231106                })(jQuery);';
    224             wp_register_script( 'lgnrgstrfrm-tooltip-script-single-' . $this->tooltip_args['tooltip_id'], '' );
    225             wp_enqueue_script( 'lgnrgstrfrm-tooltip-script-single-' . $this->tooltip_args['tooltip_id'] );
    226             wp_add_inline_script( 'lgnrgstrfrm-tooltip-script-single-' . $this->tooltip_args['tooltip_id'], sprintf( $script ) );
    227         }
    228     }
    229 }
    230 
    231 if ( ! function_exists( 'lgnrgstrfrm_form_restore_default_confirm' ) ) {
     1107            wp_register_script( 'bws-tooltip-script-single-' . $this->tooltip_args['tooltip_id'], '' );
     1108            wp_enqueue_script( 'bws-tooltip-script-single-' . $this->tooltip_args['tooltip_id'] );
     1109            wp_add_inline_script( 'bws-tooltip-script-single-' . $this->tooltip_args['tooltip_id'], sprintf( $script ) );
     1110        }
     1111    }
     1112}
     1113
     1114if ( ! function_exists( 'bws_form_restore_default_confirm' ) ) {
    2321115    /**
    2331116     * Function display confirm
     
    2361119     * @param string $plugin_basename Plugin basename.
    2371120     */
    238     function lgnrgstrfrm_form_restore_default_confirm( $plugin_basename ) {
     1121    function bws_form_restore_default_confirm( $plugin_basename ) {
    2391122        ?>
    2401123        <div>
    241             <p><?php esc_html_e( 'Are you sure you want to restore default settings?', 'bws-login-register' ); ?></p>
     1124            <p><?php esc_html_e( 'Are you sure you want to restore default settings?', 'bestwebsoft' ); ?></p>
    2421125            <form method="post" action="">
    2431126                <p>
    244                     <button class="button button-primary" name="bws_restore_confirm"><?php esc_html_e( 'Yes, restore all settings', 'bws-login-register' ); ?></button>
    245                     <button class="button" name="bws_restore_deny"><?php esc_html_e( 'No, go back to the settings page', 'bws-login-register' ); ?></button>
     1127                    <button class="button button-primary" name="bws_restore_confirm"><?php esc_html_e( 'Yes, restore all settings', 'bestwebsoft' ); ?></button>
     1128                    <button class="button" name="bws_restore_deny"><?php esc_html_e( 'No, go back to the settings page', 'bestwebsoft' ); ?></button>
    2461129                    <?php wp_nonce_field( $plugin_basename, 'bws_settings_nonce_name' ); ?>
    2471130                </p>
     
    2521135}
    2531136
    254 /**
    255  * Output shortcode in a special block
    256  *
    257  * @since 1.9.8
    258  */
    259 if ( ! function_exists( 'lgnrgstrfrm_shortcode_output' ) ) {
    260     function lgnrgstrfrm_shortcode_output( $shortcode ) {
     1137if ( ! function_exists( 'bws_add_editor_buttons' ) ) {
     1138    /**
     1139     * Function for shortcode
     1140     *
     1141     * @since 1.9.8
     1142     */
     1143    function bws_add_editor_buttons() {
     1144        global $bws_shortcode_list;
     1145        if ( ! empty( $bws_shortcode_list ) && current_user_can( 'edit_posts' ) && current_user_can( 'edit_pages' ) ) {
     1146            add_filter( 'mce_external_plugins', 'bws_add_buttons' );
     1147            add_filter( 'mce_buttons', 'bws_register_buttons' );
     1148        }
     1149    }
     1150}
     1151
     1152if ( ! function_exists( 'bws_add_buttons' ) ) {
     1153    /**
     1154     * Function add button for editor
     1155     *
     1156     * @since 1.9.8
     1157     * @param array $plugin_array Editor scripts.
     1158     */
     1159    function bws_add_buttons( $plugin_array ) {
     1160        $plugin_array['add_bws_shortcode'] = bws_menu_url( 'js/shortcode-button.js' );
     1161        return $plugin_array;
     1162    }
     1163}
     1164
     1165if ( ! function_exists( 'bws_register_buttons' ) ) {
     1166    /**
     1167     * Function register button for editor
     1168     *
     1169     * @since 1.9.8
     1170     * @param array $buttons Editor buttons.
     1171     */
     1172    function bws_register_buttons( $buttons ) {
     1173        array_push( $buttons, 'add_bws_shortcode' ); /* dropcap', 'recentposts */
     1174        return $buttons;
     1175    }
     1176}
     1177
     1178if ( ! function_exists( 'bws_shortcode_media_button_popup' ) ) {
     1179    /**
     1180     * Function Generate inline content for the popup window when the "bws shortcode" button is clicked
     1181     *
     1182     * @since 1.9.8
     1183     */
     1184    function bws_shortcode_media_button_popup() {
     1185        global $bws_shortcode_list;
     1186
     1187        if ( ! empty( $bws_shortcode_list ) ) {
     1188            ?>
     1189            <div id="bws_shortcode_popup" style="display:none;">
     1190                <div id="bws_shortcode_popup_block">
     1191                    <div id="bws_shortcode_select_plugin">
     1192                        <h4><?php esc_html_e( 'Plugin', 'bestwebsoft' ); ?></h4>
     1193                        <select name="bws_shortcode_select" id="bws_shortcode_select">
     1194                            <?php foreach ( $bws_shortcode_list as $key => $value ) { ?>
     1195                                <option value="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $value['name'] ); ?></option>
     1196                            <?php } ?>
     1197                        </select>
     1198                    </div>
     1199                    <div class="clear"></div>
     1200                    <div id="bws_shortcode_content">
     1201                        <h4><?php esc_html_e( 'Shortcode settings', 'bestwebsoft' ); ?></h4>
     1202                        <?php
     1203                        $ws_shortcode_button_content = apply_filters( 'bws_shortcode_button_content', '' );
     1204                        if ( ! empty( $ws_shortcode_button_content ) ) {
     1205                            echo wp_kses_post( $ws_shortcode_button_content );
     1206                        }
     1207                        ?>
     1208                    </div>
     1209                    <div class="clear"></div>
     1210                    <div id="bws_shortcode_content_bottom">
     1211                        <p><?php esc_html_e( 'The shortcode will be inserted', 'bestwebsoft' ); ?></p>
     1212                        <div id="bws_shortcode_block"><div id="bws_shortcode_display"></div></div>
     1213                    </div>
     1214                </div>
     1215            </div>
     1216            <?php
     1217        }
     1218    }
     1219}
     1220
     1221if ( ! function_exists( 'bws_shortcode_output' ) ) {
     1222    /**
     1223     * Output shortcode in a special block
     1224     *
     1225     * @since 1.9.8
     1226     * @param string $shortcode Shortcode string.
     1227     */
     1228    function bws_shortcode_output( $shortcode ) {
    2611229        ?>
    262         <span class="lgnrgstrfrm_shortcode_output"><input type="text" onfocus="this.select();" readonly="readonly" value="<?php echo esc_attr( $shortcode ); ?>" class="large-text bws_no_bind_notice"></span>
     1230        <span class="bws_shortcode_output"><input type="text" onfocus="this.select();" readonly="readonly" value="<?php echo esc_attr( $shortcode ); ?>" class="large-text bws_no_bind_notice"></span>
    2631231        <?php
    2641232    }
    2651233}
    2661234
    267 if ( ! function_exists( 'lgnrgstrfrm_add_help_box' ) ) {
     1235if ( ! function_exists( 'bws_add_help_box' ) ) {
    2681236    /**
    2691237     * Output tooltip
     
    2731241     * @param string $class   Can be standart "bws-hide-for-mobile" (tooltip will be hidden in 782px) and "bws-auto-width" (need for img) or some custom class.
    2741242     */
    275     function lgnrgstrfrm_add_help_box( $content, $class = '' ) {
     1243    function bws_add_help_box( $content, $class = '' ) {
    2761244        return '<span class="bws_help_box dashicons dashicons-editor-help ' . $class . ' hide-if-no-js">
    2771245            <span class="bws_hidden_help_text">' . $content . '</span>
     
    2801248}
    2811249
    282 if ( ! function_exists( 'lgnrgstrfrm_help_tab' ) ) {
     1250if ( ! function_exists( 'bws_help_tab' ) ) {
    2831251    /**
    2841252     * Function add help tab
     
    2881256     * @param array  $args   Args for screen.
    2891257     */
    290     function lgnrgstrfrm_help_tab( $screen, $args ) {
     1258    function bws_help_tab( $screen, $args ) {
    2911259        $url = ( ! empty( $args['section'] ) ) ? 'https://support.bestwebsoft.com/hc/en-us/sections/' . $args['section'] : 'https://support.bestwebsoft.com/';
    2921260
    293         $content = '<p><a href="' . esc_url( $url ) . '" target="_blank">' . __( 'Visit Help Center', 'bws-login-register' ) . '</a></p>';
     1261        $content = '<p><a href="' . esc_url( $url ) . '" target="_blank">' . __( 'Visit Help Center', 'bestwebsoft' ) . '</a></p>';
    2941262
    2951263        $screen->add_help_tab(
    2961264            array(
    2971265                'id'      => $args['id'] . '_help_tab',
    298                 'title'   => esc_html__( 'FAQ', 'bws-login-register' ),
     1266                'title'   => esc_html__( 'FAQ', 'bestwebsoft' ),
    2991267                'content' => wp_kses_post( $content ),
    3001268            )
     
    3021270
    3031271        $screen->set_help_sidebar(
    304             '<p><strong>' . esc_html__( 'For more information:', 'bws-login-register' ) . '</strong></p>' .
    305             '<p><a href="https://bestwebsoft.com/documentation/" target="_blank">' . esc_html__( 'Documentation', 'bws-login-register' ) . '</a></p>' .
    306             '<p><a href="https://www.youtube.com/user/bestwebsoft/playlists?flow=grid&sort=da&view=1" target="_blank">' . esc_html__( 'Video Instructions', 'bws-login-register' ) . '</a></p>' .
    307             '<p><a href="https://support.bestwebsoft.com/hc/en-us/requests/new" target="_blank">' . esc_html__( 'Submit a Request', 'bws-login-register' ) . '</a></p>'
     1272            '<p><strong>' . esc_html__( 'For more information:', 'bestwebsoft' ) . '</strong></p>' .
     1273            '<p><a href="https://bestwebsoft.com/documentation/" target="_blank">' . esc_html__( 'Documentation', 'bestwebsoft' ) . '</a></p>' .
     1274            '<p><a href="https://www.youtube.com/user/bestwebsoft/playlists?flow=grid&sort=da&view=1" target="_blank">' . esc_html__( 'Video Instructions', 'bestwebsoft' ) . '</a></p>' .
     1275            '<p><a href="https://support.bestwebsoft.com/hc/en-us/requests/new" target="_blank">' . esc_html__( 'Submit a Request', 'bestwebsoft' ) . '</a></p>'
    3081276        );
    3091277    }
    3101278}
    311 if ( ! function_exists( 'lgnrgstrfrm_admin_enqueue_scripts' ) ) {
    312     /**
    313      * Function add scripts ans syles for dashboard
    314      */
    315     function lgnrgstrfrm_admin_enqueue_scripts() {
    316         global $wp_scripts,
    317             $hook_suffix,
    318             $post_type,
    319             $bws_plugin_banner_go_pro, $bws_plugin_banner_timeout, $bstwbsftwppdtplgns_banner_array,
    320             $bws_shortcode_list,
    321             $wp_filesystem,
    322             $bws_plugins,
    323             $pagenow;
    324 
    325         $page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
    326 
    327         wp_enqueue_style( 'lgnrgstrfrm-admin-css', lgnrgstrfrm_menu_url( 'css/general_style.css' ), array(), '2.4.2' );
    328         wp_enqueue_script( 'lgnrgstrfrm-admin-scripts', lgnrgstrfrm_menu_url( 'js/general_script.js' ), array( 'jquery', 'jquery-ui-tooltip', 'jquery-ui-resizable', 'jquery-ui-tabs' ), '2' );
    329 
    330         $plugin_dir  = explode( '/', plugin_basename( __FILE__ ) )[0];
    331         $plugin_file = array_keys( get_plugins( "/$plugin_dir" ) )[0];
    332 
    333         $include_jquery_ui = false;
    334         if ( ! empty( $bws_plugins ) ) {
    335             $admin_page_free = $pagenow . '?page=' . str_replace( '-pro', '', $page );
    336 
    337             foreach ( $bws_plugins as $bws_plugin ) {
    338                 if ( $admin_page_free === $bws_plugin['settings'] ) {
    339                     $include_jquery_ui = true;
    340                     break;
    341                 }
    342             }
    343         }
    344 
    345         if ( in_array( $page, array( 'bws_panel', 'bws_themes', 'bws_system_status', $plugin_file ) ) || $include_jquery_ui || strpos( $page, '-bws-panel' ) ) {
    346             $jquery_ui_version = isset( $wp_scripts->registered['jquery-ui-core']->ver ) ? $wp_scripts->registered['jquery-ui-core']->ver : '1.12.1';
    347             WP_Filesystem();
    348             if ( ! $wp_filesystem->exists( dirname( __FILE__ ) . '/css/jquery-ui-styles/' . $jquery_ui_version . '/' ) ) {
    349                 $jquery_ui_version = '1.12.1';
    350             }
    351             wp_enqueue_style( 'jquery-ui-style', lgnrgstrfrm_menu_url( 'css/jquery-ui-styles/' . $jquery_ui_version . '/jquery-ui.css', array(), $jquery_ui_version ) );
    352             wp_enqueue_style( 'bws_menu_style', lgnrgstrfrm_menu_url( 'css/style.css' ), array(), '2.4.2' );
    353             wp_enqueue_script( 'bws_menu_script', lgnrgstrfrm_menu_url( 'js/bws_menu.js' ), array(), '2.4.2', true );
    354             wp_enqueue_script( 'theme-install' );
    355             add_thickbox();
    356             wp_enqueue_script( 'plugin-install' );
    357         }
    358 
    359         if ( 'plugins.php' === $hook_suffix ) {
    360             if ( ! empty( $bws_plugin_banner_go_pro ) || ! empty( $bws_plugin_banner_timeout ) ) {
    361                 wp_enqueue_script( 'bws_menu_cookie', lgnrgstrfrm_menu_url( 'js/c_o_o_k_i_e.js' ) );
    362 
    363                 if ( ! empty( $bws_plugin_banner_go_pro ) ) {
    364 
    365                     foreach ( $bstwbsftwppdtplgns_banner_array as $value ) {
    366                         if ( isset( $bws_plugin_banner_go_pro[ $value[0] ] ) && ! isset( $_COOKIE[ $value[0] ] ) ) {
    367                             $prefix = $bws_plugin_banner_go_pro[ $value[0] ]['prefix'];
    368 
    369                             $script = "(function($) {
    370                                 $(document).ready( function() {
    371                                     var hide_message = $.cookie( '" . $prefix . "_hide_banner_on_plugin_page' );
    372                                     if ( hide_message === 'true' ) {
    373                                         $( '." . $prefix . "_message' ).css( 'display', 'none' );
    374                                     } else {
    375                                         $( '." . $prefix . "_message' ).css( 'display', 'block' );
    376                                     };
    377                                     $( '." . $prefix . "_close_icon' ).click( function() {
    378                                         $( '." . $prefix . "_message' ).css( 'display', 'none' );
    379                                         $.cookie( '" . $prefix . "_hide_banner_on_plugin_page', 'true', { expires: 32, secure: true } );
    380                                     });
    381                                 });
    382                             })(jQuery);";
    383 
    384                             wp_register_script( $prefix . '_hide_banner_on_plugin_page', '' );
    385                             wp_enqueue_script( $prefix . '_hide_banner_on_plugin_page' );
    386                             wp_add_inline_script( $prefix . '_hide_banner_on_plugin_page', sprintf( $script ) );
    387                             break;
    388                         }
     1279
     1280if ( ! function_exists( 'bws_enqueue_custom_code_css_js' ) ) {
     1281    /**
     1282     * Function add css and js
     1283     *
     1284     * @since 1.9.8
     1285     */
     1286    function bws_enqueue_custom_code_css_js() {
     1287        global $bstwbsftwppdtplgns_options;
     1288
     1289        if ( ! isset( $bstwbsftwppdtplgns_options ) ) {
     1290            $bstwbsftwppdtplgns_options = ( function_exists( 'is_multisite' ) && is_multisite() ) ? get_site_option( 'bstwbsftwppdtplgns_options' ) : get_option( 'bstwbsftwppdtplgns_options' );
     1291        }
     1292
     1293        if ( ! empty( $bstwbsftwppdtplgns_options['custom_code'] ) ) {
     1294            $is_multisite = is_multisite();
     1295            if ( $is_multisite ) {
     1296                $blog_id = get_current_blog_id();
     1297            }
     1298
     1299            if ( ! $is_multisite && ! empty( $bstwbsftwppdtplgns_options['custom_code']['bws-custom-code.css'] ) ) {
     1300                wp_enqueue_style( 'bws-custom-style', $bstwbsftwppdtplgns_options['custom_code']['bws-custom-code.css'], array(), '2.4.2' );
     1301            } elseif ( $is_multisite && ! empty( $bstwbsftwppdtplgns_options['custom_code'][ $blog_id ]['bws-custom-code.css'] ) ) {
     1302                wp_enqueue_style( 'bws-custom-style', $bstwbsftwppdtplgns_options['custom_code'][ $blog_id ]['bws-custom-code.css'], array(), '2.4.2' );
     1303            }
     1304
     1305            if ( ! $is_multisite && ! empty( $bstwbsftwppdtplgns_options['custom_code']['bws-custom-code.js'] ) ) {
     1306                wp_enqueue_script( 'bws-custom-style', $bstwbsftwppdtplgns_options['custom_code']['bws-custom-code.js'], array(), '2.4.2' );
     1307            } elseif ( $is_multisite && ! empty( $bstwbsftwppdtplgns_options['custom_code'][ $blog_id ]['bws-custom-code.js'] ) ) {
     1308                wp_enqueue_script( 'bws-custom-style', $bstwbsftwppdtplgns_options['custom_code'][ $blog_id ]['bws-custom-code.js'], array(), '2.4.2' );
     1309            }
     1310        }
     1311    }
     1312}
     1313
     1314if ( ! function_exists( 'bws_enqueue_custom_code_php' ) ) {
     1315    /**
     1316     * Function add custom php code
     1317     *
     1318     * @since 1.9.8
     1319     */
     1320    function bws_enqueue_custom_code_php() {
     1321        if ( is_admin() ) {
     1322            return;
     1323        }
     1324
     1325        global $bstwbsftwppdtplgns_options;
     1326
     1327        if ( ! isset( $bstwbsftwppdtplgns_options ) ) {
     1328            $bstwbsftwppdtplgns_options = ( function_exists( 'is_multisite' ) && is_multisite() ) ? get_site_option( 'bstwbsftwppdtplgns_options' ) : get_option( 'bstwbsftwppdtplgns_options' );
     1329        }
     1330
     1331        if ( ! empty( $bstwbsftwppdtplgns_options['custom_code'] ) ) {
     1332
     1333            $is_multisite = is_multisite();
     1334            if ( $is_multisite ) {
     1335                $blog_id = get_current_blog_id();
     1336            }
     1337
     1338            if ( ! $is_multisite && ! empty( $bstwbsftwppdtplgns_options['custom_code']['bws-custom-code.php'] ) ) {
     1339                if ( file_exists( $bstwbsftwppdtplgns_options['custom_code']['bws-custom-code.php'] ) ) {
     1340                    if ( ! defined( 'BWS_GLOBAL' ) ) {
     1341                        define( 'BWS_GLOBAL', true );
     1342                    }
     1343                    require_once $bstwbsftwppdtplgns_options['custom_code']['bws-custom-code.php'];
     1344                } else {
     1345                    unset( $bstwbsftwppdtplgns_options['custom_code']['bws-custom-code.php'] );
     1346                    if ( $is_multisite ) {
     1347                        update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     1348                    } else {
     1349                        update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
    3891350                    }
    3901351                }
    391 
    392                 if ( ! empty( $bws_plugin_banner_timeout ) ) {
    393                     $script = '(function($) {
    394                             $(document).ready( function() {';
    395 
    396                     foreach ( $bws_plugin_banner_timeout as $banner_value ) {
    397                         $script .= "var hide_message = $.cookie( '" . $banner_value['prefix'] . "_timeout_hide_banner_on_plugin_page' );
    398                             if ( hide_message === 'true' ) {
    399                                 $( '." . $banner_value['prefix'] . "_message_timeout' ).css( 'display', 'none' );
    400                             } else {
    401                                 $( '." . $banner_value['prefix'] . "_message_timeout' ).css( 'display', 'block' );
    402                             }
    403                             $( '." . $banner_value['prefix'] . "_close_icon' ).click( function() {
    404                                 $( '." . $banner_value['prefix'] . "_message_timeout' ).css( 'display', 'none' );
    405                                 $.cookie( '" . $banner_value['prefix'] . "_timeout_hide_banner_on_plugin_page', 'true', { expires: 30, secure: true } );
    406                             });";
     1352            } elseif ( $is_multisite && ! empty( $bstwbsftwppdtplgns_options['custom_code'][ $blog_id ]['bws-custom-code.php'] ) ) {
     1353                if ( file_exists( $bstwbsftwppdtplgns_options['custom_code'][ $blog_id ]['bws-custom-code.php'] ) ) {
     1354                    if ( ! defined( 'BWS_GLOBAL' ) ) {
     1355                        define( 'BWS_GLOBAL', true );
    4071356                    }
    408 
    409                     $script .= '});
    410                         })(jQuery);';
    411 
    412                     wp_register_script( 'plugin_banner_timeout_hide', '' );
    413                     wp_enqueue_script( 'plugin_banner_timeout_hide' );
    414                     wp_add_inline_script( 'plugin_banner_timeout_hide', sprintf( $script ) );
     1357                    require_once $bstwbsftwppdtplgns_options['custom_code'][ $blog_id ]['bws-custom-code.php'];
     1358                } else {
     1359                    unset( $bstwbsftwppdtplgns_options['custom_code'][ $blog_id ]['bws-custom-code.php'] );
     1360                    if ( $is_multisite ) {
     1361                        update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     1362                    } else {
     1363                        update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     1364                    }
    4151365                }
    4161366            }
    417 
    418             if ( ! defined( 'DOING_AJAX' ) ) {
    419                 wp_enqueue_style( 'lgnrgstrfrm-modal-css', lgnrgstrfrm_menu_url( 'css/modal.css' ) );
    420             }
    421         }
    422 
    423         if ( 'multilanguage-languages.php' === $page ) {
    424             wp_enqueue_style( 'lgnrgstrfrm-modal-css', lgnrgstrfrm_menu_url( 'css/modal.css' ) );
    425         }
    426 
    427         if ( ! empty( $bws_shortcode_list ) ) {
    428             /* TinyMCE Shortcode Plugin */
    429             $script = "var bws_shortcode_button = {
    430                     'label': '" . esc_attr__( 'Add BWS Shortcode', 'bws-login-register' ) . "',
    431                     'title': '" . esc_attr__( 'Add BWS Plugins Shortcode', 'bws-login-register' ) . "',
    432                     'function_name': [";
    433             foreach ( $bws_shortcode_list as $value ) {
    434                 if ( isset( $value['js_function'] ) ) {
    435                     $script .= "'" . $value['js_function'] . "',";
     1367        }
     1368    }
     1369}
     1370
     1371if ( ! function_exists( 'bws_delete_plugin' ) ) {
     1372    /**
     1373     * Function delete plugin
     1374     *
     1375     * @since 1.9.8
     1376     * @param string $basename Plugin basename.
     1377     */
     1378    function bws_delete_plugin( $basename ) {
     1379        global $bstwbsftwppdtplgns_options;
     1380
     1381        $is_multisite = is_multisite();
     1382        if ( $is_multisite ) {
     1383            $blog_id = get_current_blog_id();
     1384        }
     1385
     1386        if ( ! isset( $bstwbsftwppdtplgns_options ) ) {
     1387            $bstwbsftwppdtplgns_options = ( $is_multisite ) ? get_site_option( 'bstwbsftwppdtplgns_options' ) : get_option( 'bstwbsftwppdtplgns_options' );
     1388        }
     1389
     1390        /* remove bws_menu versions */
     1391        unset( $bstwbsftwppdtplgns_options['bws_menu']['version'][ $basename ] );
     1392        /* remove track usage data */
     1393        if ( isset( $bstwbsftwppdtplgns_options['bws_menu']['track_usage']['products'][ $basename ] ) ) {
     1394            unset( $bstwbsftwppdtplgns_options['bws_menu']['track_usage']['products'][ $basename ] );
     1395        }
     1396        /* if empty ['bws_menu']['version'] - there is no other bws plugins - delete all */
     1397        if ( empty( $bstwbsftwppdtplgns_options['bws_menu']['version'] ) ) {
     1398            /* remove options */
     1399            if ( $is_multisite ) {
     1400                delete_site_option( 'bstwbsftwppdtplgns_options' );
     1401            } else {
     1402                delete_option( 'bstwbsftwppdtplgns_options' );
     1403            }
     1404
     1405            /* remove custom_code */
     1406            if ( $is_multisite ) {
     1407                global $wpdb;
     1408                $old_blog = $wpdb->blogid;
     1409                /* Get all blog ids */
     1410                $blogids = $wpdb->get_col( "SELECT `blog_id` FROM $wpdb->blogs" );
     1411                foreach ( $blogids as $blog_id ) {
     1412                    switch_to_blog( $blog_id );
     1413                    $upload_dir = wp_upload_dir();
     1414                    $folder     = $upload_dir['basedir'] . '/bws-custom-code';
     1415                    if ( file_exists( $folder ) && is_dir( $folder ) ) {
     1416                        array_map( 'unlink', glob( "$folder/*" ) );
     1417                        rmdir( $folder );
     1418                    }
    4361419                }
    437             }
    438             $script .= ']
    439                 };';
    440             wp_register_script( 'bws_shortcode_button', '' );
    441             wp_enqueue_script( 'bws_shortcode_button' );
    442             wp_add_inline_script( 'bws_shortcode_button', sprintf( $script ) );
    443 
    444             /* TinyMCE Shortcode Plugin */
    445             if ( isset( $post_type ) && in_array( $post_type, array( 'post', 'page' ) ) ) {
    446                 $tooltip_args = array(
    447                     'tooltip_id'   => 'bws_shortcode_button_tooltip',
    448                     'css_selector' => '.mce-bws_shortcode_button',
    449                     'actions'      => array(
    450                         'click'  => false,
    451                         'onload' => true,
    452                     ),
    453                     'content'      => '<h3>' . esc_html__( 'Add shortcode', 'bws-login-register' ) . '</h3><p>' . esc_html__( "Add BestWebSoft plugins' shortcodes using this button.", 'bws-login-register' ) . '</p>',
    454                     'position'     => array(
    455                         'edge' => 'right',
    456                     ),
    457                     'set_timeout'  => 2000,
    458                 );
    459                 lgnrgstrfrm_add_tooltip_in_admin( $tooltip_args );
    460             }
    461         }
    462     }
    463 }
    464 add_action( 'admin_enqueue_scripts', 'lgnrgstrfrm_admin_enqueue_scripts' );
     1420                switch_to_blog( $old_blog );
     1421            } else {
     1422                $upload_dir = wp_upload_dir();
     1423                $folder     = $upload_dir['basedir'] . '/bws-custom-code';
     1424                if ( file_exists( $folder ) && is_dir( $folder ) ) {
     1425                    array_map( 'unlink', glob( "$folder/*" ) );
     1426                    rmdir( $folder );
     1427                }
     1428            }
     1429        }
     1430    }
     1431}
     1432
     1433add_action( 'admin_init', 'bws_plugins_admin_init' );
     1434add_action( 'admin_enqueue_scripts', 'bws_admin_enqueue_scripts' );
     1435add_action( 'admin_head', 'bws_plugins_admin_head' );
     1436add_action( 'admin_footer', 'bws_plugins_admin_footer' );
     1437
     1438add_action( 'admin_notices', 'bws_admin_notices', 30 );
     1439
     1440add_action( 'wp_enqueue_scripts', 'bws_enqueue_custom_code_css_js', 20 );
     1441
     1442bws_enqueue_custom_code_php();
  • bws-login-register/trunk/bws_menu/bws_include.php

    r3301452 r3337325  
    1212     */
    1313    function bws_include_init( $base, $bws_menu_source = 'plugins' ) {
    14         require_once dirname( __FILE__ ) . '/bws_menu.php';
    15         require_once dirname( __FILE__ ) . '/bws_functions.php';
    16         require_once dirname( __FILE__ ) . '/class-bws-settings.php';
     14        global $bstwbsftwppdtplgns_options, $bstwbsftwppdtplgns_added_menu, $bstwbsftwppdtplgns_active_plugins;
     15        if ( ! function_exists( 'get_plugin_data' ) ) {
     16            require_once ABSPATH . 'wp-admin/includes/plugin.php';
     17        }
     18
     19        $wp_content_dir = defined( 'WP_CONTENT_DIR' ) ? WP_CONTENT_DIR : ABSPATH . 'wp-content';
     20        $wp_plugins_dir = defined( 'WP_PLUGIN_DIR' ) ? WP_PLUGIN_DIR : $wp_content_dir . '/plugins';
     21
     22        if ( 'plugins' === $bws_menu_source ) {
     23            $bws_menu_dir                               = $wp_plugins_dir . '/' . dirname( $base ) . '/bws_menu/bws_menu.php';
     24            $bstwbsftwppdtplgns_active_plugins[ $base ] = get_plugin_data( $wp_plugins_dir . '/' . $base );
     25        } else {
     26            $bws_menu_dir = $wp_content_dir . '/themes/' . $base . '/inc/bws_menu/bws_menu.php';
     27        }
     28
     29        $bws_menu_info = get_plugin_data( $bws_menu_dir );
     30
     31        $is_pro_bws_menu  = ( strpos( $bws_menu_info['Version'], 'pro' ) !== false );
     32        $bws_menu_version = str_replace( '-pro', '', $bws_menu_info['Version'] );
     33
     34        if ( ! isset( $bstwbsftwppdtplgns_options ) ) {
     35            if ( function_exists( 'is_multisite' ) && is_multisite() ) {
     36                if ( ! get_site_option( 'bstwbsftwppdtplgns_options' ) ) {
     37                    add_site_option( 'bstwbsftwppdtplgns_options', array() );
     38                }
     39                $bstwbsftwppdtplgns_options = get_site_option( 'bstwbsftwppdtplgns_options' );
     40            } else {
     41                if ( ! get_option( 'bstwbsftwppdtplgns_options' ) ) {
     42                    add_option( 'bstwbsftwppdtplgns_options', array() );
     43                }
     44                $bstwbsftwppdtplgns_options = get_option( 'bstwbsftwppdtplgns_options' );
     45            }
     46        }
     47
     48        if ( isset( $bstwbsftwppdtplgns_options['bws_menu_version'] ) ) {
     49            $bstwbsftwppdtplgns_options['bws_menu']['version'][ $base ] = $bws_menu_version;
     50            unset( $bstwbsftwppdtplgns_options['bws_menu_version'] );
     51            if ( function_exists( 'is_multisite' ) && is_multisite() ) {
     52                update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     53            } else {
     54                update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     55            }
     56            require_once dirname( __FILE__ ) . '/bws_menu.php';
     57            require_once dirname( __FILE__ ) . '/bws_functions.php';
     58            require_once dirname( __FILE__ ) . '/class-bws-settings.php';
     59        } elseif ( ! $is_pro_bws_menu && ( ! isset( $bstwbsftwppdtplgns_options['bws_menu']['version'][ $base ] ) || $bstwbsftwppdtplgns_options['bws_menu']['version'][ $base ] !== $bws_menu_version ) ) {
     60            $bstwbsftwppdtplgns_options['bws_menu']['version'][ $base ] = $bws_menu_version;
     61            if ( function_exists( 'is_multisite' ) && is_multisite() ) {
     62                update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     63            } else {
     64                update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     65            }
     66            require_once dirname( __FILE__ ) . '/bws_menu.php';
     67            require_once dirname( __FILE__ ) . '/bws_functions.php';
     68            require_once dirname( __FILE__ ) . '/class-bws-settings.php';
     69        } elseif ( $is_pro_bws_menu && ( ! isset( $bstwbsftwppdtplgns_options['bws_menu']['version_pro'][ $base ] ) || $bstwbsftwppdtplgns_options['bws_menu']['version_pro'][ $base ] !== $bws_menu_version ) ) {
     70            $bstwbsftwppdtplgns_options['bws_menu']['version_pro'][ $base ] = $bws_menu_version;
     71
     72            if ( isset( $bstwbsftwppdtplgns_options['bws_menu']['version'][ $base ] ) ) {
     73                unset( $bstwbsftwppdtplgns_options['bws_menu']['version'][ $base ] );
     74            }
     75
     76            if ( function_exists( 'is_multisite' ) && is_multisite() ) {
     77                update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     78            } else {
     79                update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     80            }
     81            require_once dirname( __FILE__ ) . '/bws_menu.php';
     82            require_once dirname( __FILE__ ) . '/bws_functions.php';
     83            require_once dirname( __FILE__ ) . '/class-bws-settings.php';
     84        } elseif ( ! isset( $bstwbsftwppdtplgns_added_menu ) ) {
     85
     86            $all_plugins = get_plugins();
     87            $all_themes  = wp_get_themes();
     88
     89            if ( ! empty( $bstwbsftwppdtplgns_options['bws_menu']['version_pro'] ) ) {
     90                foreach ( $bstwbsftwppdtplgns_options['bws_menu']['version_pro'] as $key => $value ) {
     91                    if ( array_key_exists( $key, $all_plugins ) || array_key_exists( $key, $all_themes ) ) {
     92                        if ( $bws_menu_version <= $value && ( is_plugin_active( $key ) || preg_match( '|' . $key . '$|', get_template_directory() ) ) ) {
     93                            if ( ! isset( $product_with_newer_menu ) ) {
     94                                $product_with_newer_menu = $key;
     95                            } elseif ( $bstwbsftwppdtplgns_options['bws_menu']['version_pro'][ $product_with_newer_menu ] <= $bstwbsftwppdtplgns_options['bws_menu']['version_pro'][ $key ] ) {
     96                                $product_with_newer_menu = $key;
     97                            }
     98                        }
     99                    } else {
     100                        unset( $bstwbsftwppdtplgns_options['bws_menu']['version_pro'][ $key ] );
     101                        if ( function_exists( 'is_multisite' ) && is_multisite() ) {
     102                            update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     103                        } else {
     104                            update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     105                        }
     106                    }
     107                }
     108            }
     109
     110            if ( ! isset( $product_with_newer_menu ) ) {
     111                if ( $is_pro_bws_menu ) {
     112                    $product_with_newer_menu = $base;
     113                } else {
     114                    foreach ( $bstwbsftwppdtplgns_options['bws_menu']['version'] as $key => $value ) {
     115                        if ( array_key_exists( $key, $all_plugins ) || array_key_exists( $key, $all_themes ) ) {
     116                            if ( $bws_menu_version <= $value && ( is_plugin_active( $key ) || preg_match( '|' . $key . '$|', get_template_directory() ) ) ) {
     117                                if ( ! isset( $product_with_newer_menu ) ) {
     118                                    $product_with_newer_menu = $key;
     119                                } elseif ( $bstwbsftwppdtplgns_options['bws_menu']['version'][ $product_with_newer_menu ] <= $bstwbsftwppdtplgns_options['bws_menu']['version'][ $key ] ) {
     120                                    $product_with_newer_menu = $key;
     121                                }
     122                            }
     123                        } else {
     124                            unset( $bstwbsftwppdtplgns_options['bws_menu']['version'][ $key ] );
     125                            if ( function_exists( 'is_multisite' ) && is_multisite() ) {
     126                                update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     127                            } else {
     128                                update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     129                            }
     130                        }
     131                    }
     132                }
     133            }
     134
     135            if ( ! isset( $product_with_newer_menu ) ) {
     136                $product_with_newer_menu = $base;
     137            }
     138
     139            $folder_with_newer_menu = explode( '/', $product_with_newer_menu );
     140
     141            if ( array_key_exists( $product_with_newer_menu, $all_plugins ) ) {
     142                $bws_menu_source  = 'plugins';
     143                $bws_menu_new_dir = $wp_plugins_dir . '/' . $folder_with_newer_menu[0];
     144            } elseif ( array_key_exists( $product_with_newer_menu, $all_themes ) ) {
     145                $bws_menu_source  = 'themes';
     146                $bws_menu_new_dir = $wp_content_dir . '/themes/' . $folder_with_newer_menu[0] . '/inc';
     147            } else {
     148                $bws_menu_new_dir = '';
     149            }
     150
     151            if ( file_exists( $bws_menu_new_dir . '/bws_menu/bws_functions.php' ) ) {
     152                require_once $bws_menu_new_dir . '/bws_menu/bws_functions.php';
     153                require_once $bws_menu_new_dir . '/bws_menu/bws_menu.php';
     154                require_once $bws_menu_new_dir . '/bws_menu/class-bws-settings.php';
     155            } else {
     156                require_once dirname( __FILE__ ) . '/bws_menu.php';
     157                require_once dirname( __FILE__ ) . '/bws_functions.php';
     158                require_once dirname( __FILE__ ) . '/class-bws-settings.php';
     159            }
     160
     161            $bstwbsftwppdtplgns_added_menu = true;
     162        }
    17163    }
    18164}
  • bws-login-register/trunk/bws_menu/bws_menu.php

    r3301452 r3337325  
    66/**
    77 * Function for displaying BestWebSoft menu
    8  * Version: 2.4.3
     8 * Version: 2.4.4
    99 */
    10 if ( ! function_exists( 'lgnrgstrfrm_admin_enqueue_scripts' ) ) {
     10if ( ! function_exists( 'bws_admin_enqueue_scripts' ) ) {
    1111    require_once dirname( __FILE__ ) . '/bws_functions.php';
    1212}
     
    9292                }
    9393            }
     94
     95            /*** Membership */
     96            $bws_license_plugin     = 'bws_get_list_for_membership';
     97            $bws_license_key        = isset( $bstwbsftwppdtplgns_options[ $bws_license_plugin ] ) ? $bstwbsftwppdtplgns_options[ $bws_license_plugin ] : '';
     98            $update_membership_list = true;
     99
     100            if ( isset( $_POST['bws_license_key'] ) ) {
     101                $bws_license_key = sanitize_text_field( wp_unslash( $_POST['bws_license_key'] ) );
     102            }
     103
     104            if ( isset( $_SESSION['bws_membership_time_check'] ) && isset( $_SESSION['bws_membership_list'] ) && $_SESSION['bws_membership_time_check'] < strtotime( '+12 hours' ) ) {
     105                $update_membership_list = false;
     106                $plugins_array          = $_SESSION['bws_membership_list'];
     107                foreach ( $plugins_array as $plugins_key => $plugins_value ) {
     108                    if ( is_array( $plugins_value ) ) {
     109                        $plugins_array[ $plugins_key ] = array_map( 'sanitize_text_field', array_map( 'wp_unslash', $plugins_value ) );
     110                    } elseif ( is_object( $plugins_value ) ) {
     111                        foreach ( $plugins_value as $plugins_key2 => $plugins_value2 ) {
     112                            $plugins_value->$plugins_key2 = sanitize_text_field( wp_unslash( $plugins_value2 ) );
     113                        }
     114                        $plugins_array[ $plugins_key ] = $plugins_value;
     115                    } else {
     116                        $plugins_array[ $plugins_key ] = sanitize_text_field( wp_unslash( $plugins_value ) );
     117                    }
     118                }
     119            }
     120
     121            if ( ( $update_membership_list && ! empty( $bws_license_key ) ) || ( isset( $_POST['bws_license_submit'] ) && check_admin_referer( plugin_basename( __FILE__ ), 'bws_license_nonce_name' ) ) ) {
     122
     123                if ( '' !== $bws_license_key ) {
     124                    if ( 18 !== strlen( $bws_license_key ) ) {
     125                        $error = __( 'Wrong license key', 'bestwebsoft' );
     126                    } else {
     127
     128                        if ( isset( $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] ) && $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time'] > ( time() - ( 24 * 60 * 60 ) ) ) {
     129                            $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] = $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] + 1;
     130                        } else {
     131                            $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] = 1;
     132                            $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time']  = time();
     133                        }
     134
     135                        /* get Pro list */
     136                        $to_send                                   = array();
     137                        $to_send['plugins'][ $bws_license_plugin ] = array();
     138                        $to_send['plugins'][ $bws_license_plugin ]['bws_license_key'] = $bws_license_key;
     139                        $options      = array(
     140                            'timeout'    => ( ( defined( 'DOING_CRON' ) && DOING_CRON ) ? 30 : 3 ),
     141                            'body'       => array( 'plugins' => serialize( $to_send ) ),
     142                            'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ),
     143                        );
     144                        $raw_response = wp_remote_post( 'https://bestwebsoft.com/wp-content/plugins/paid-products/plugins/pro-license-check/1.0/', $options );
     145
     146                        if ( is_wp_error( $raw_response ) || 200 !== wp_remote_retrieve_response_code( $raw_response ) ) {
     147                            $error = __( 'Something went wrong. Please try again later. If the error appears again, please contact us', 'bestwebsoft' ) . ' <a href="https://support.bestwebsoft.com">BestWebSoft</a>. ' . __( 'We are sorry for inconvenience.', 'bestwebsoft' );
     148                        } else {
     149                            $response = maybe_unserialize( wp_remote_retrieve_body( $raw_response ) );
     150
     151                            if ( is_array( $response ) && ! empty( $response ) ) {
     152                                foreach ( $response as $key => $value ) {
     153                                    if ( 'wrong_license_key' === $value->package ) {
     154                                        $error = __( 'Wrong license key.', 'bestwebsoft' );
     155                                    } elseif ( 'wrong_domain' === $value->package ) {
     156                                        $error = __( 'This license key is bound to another site. Change it via personal Client Area.', 'bestwebsoft' ) . '<a target="_blank" href="https://bestwebsoft.com/client-area">' . __( 'Log in', 'bestwebsoft' ) . '</a>';
     157                                    } elseif ( 'you_are_banned' === $value->package ) {
     158                                        $error = __( 'Unfortunately, you have exceeded the number of available tries per day.', 'bestwebsoft' );
     159                                    } elseif ( 'time_out' === $value->package ) {
     160                                        $error = sprintf( __( 'Unfortunately, Your license has expired. To continue getting top-priority support and plugin updates, you should extend it in your %s', 'bestwebsoft' ), ' <a href="https://bestwebsoft.com/client-area">Client Area</a>' );
     161                                    } elseif ( 'duplicate_domen_for_trial' === $value->package ) {
     162                                        $error = __( 'Unfortunately, the Pro licence was already installed to this domain. The Pro Trial license can be installed only once.', 'bestwebsoft' );
     163                                    } elseif ( is_array( $value->package ) && ! empty( $value->package ) ) {
     164                                        $plugins_array                         = $_SESSION['bws_membership_list'] = $value->package;
     165                                        $_SESSION['bws_membership_time_check'] = strtotime( 'now' );
     166
     167                                        if ( isset( $bstwbsftwppdtplgns_options[ $bws_license_plugin ] ) && $bws_license_key === $bstwbsftwppdtplgns_options[ $bws_license_plugin ] ) {
     168                                            $message = __( 'The license key is valid.', 'bestwebsoft' );
     169                                            if ( isset( $value->time_out ) && '' !== $value->time_out ) {
     170                                                $message .= ' ' . __( 'Your license will expire on', 'bestwebsoft' ) . ' ' . $value->time_out . '.';
     171                                            }
     172                                        } else {
     173                                            $message = __( 'Congratulations! Pro Membership license is activated successfully.', 'bestwebsoft' );
     174                                        }
     175
     176                                        $bstwbsftwppdtplgns_options[ $bws_license_plugin ] = $bws_license_key;
     177                                    }
     178                                }
     179                            } else {
     180                                $error = __( 'Something went wrong. Try again later or upload the plugin manually. We are sorry for inconvenience.', 'bestwebsoft' );
     181                            }
     182                        }
     183
     184                        if ( is_multisite() ) {
     185                            update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     186                        } else {
     187                            update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     188                        }
     189                    }
     190                } else {
     191                    $error = __( 'Please enter your license key.', 'bestwebsoft' );
     192                }
     193            }
    94194        } elseif ( 'bws_system_status' === $page || 'system-status' === $tab ) {
    95195
     
    101201            }
    102202            if ( empty( $sql_mode ) ) {
    103                 $sql_mode = __( 'Not set', 'bws-login-register' );
     203                $sql_mode = __( 'Not set', 'bestwebsoft' );
    104204            }
    105205
    106             $allow_url_fopen     = ( ini_get( 'allow_url_fopen' ) ) ? __( 'On', 'bws-login-register' ) : __( 'Off', 'bws-login-register' );
    107             $upload_max_filesize = ( ini_get( 'upload_max_filesize' ) ) ? ini_get( 'upload_max_filesize' ) : __( 'N/A', 'bws-login-register' );
    108             $post_max_size       = ( ini_get( 'post_max_size' ) ) ? ini_get( 'post_max_size' ) : __( 'N/A', 'bws-login-register' );
    109             $max_execution_time  = ( ini_get( 'max_execution_time' ) ) ? ini_get( 'max_execution_time' ) : __( 'N/A', 'bws-login-register' );
    110             $memory_limit        = ( ini_get( 'memory_limit' ) ) ? ini_get( 'memory_limit' ) : __( 'N/A', 'bws-login-register' );
    111             $wp_memory_limit     = ( defined( 'WP_MEMORY_LIMIT' ) ) ? WP_MEMORY_LIMIT : __( 'N/A', 'bws-login-register' );
    112             $memory_usage        = ( function_exists( 'memory_get_usage' ) ) ? round( memory_get_usage() / 1024 / 1024, 2 ) . ' ' . __( 'Mb', 'bws-login-register' ) : __( 'N/A', 'bws-login-register' );
    113             $exif_read_data      = ( is_callable( 'exif_read_data' ) ) ? __( 'Yes', 'bws-login-register' ) . ' ( V' . substr( phpversion( 'exif' ), 0, 4 ) . ')' : __( 'No', 'bws-login-register' );
    114             $iptcparse           = ( is_callable( 'iptcparse' ) ) ? __( 'Yes', 'bws-login-register' ) : __( 'No', 'bws-login-register' );
    115             $xml_parser_create   = ( is_callable( 'xml_parser_create' ) ) ? __( 'Yes', 'bws-login-register' ) : __( 'No', 'bws-login-register' );
     206            $allow_url_fopen     = ( ini_get( 'allow_url_fopen' ) ) ? __( 'On', 'bestwebsoft' ) : __( 'Off', 'bestwebsoft' );
     207            $upload_max_filesize = ( ini_get( 'upload_max_filesize' ) ) ? ini_get( 'upload_max_filesize' ) : __( 'N/A', 'bestwebsoft' );
     208            $post_max_size       = ( ini_get( 'post_max_size' ) ) ? ini_get( 'post_max_size' ) : __( 'N/A', 'bestwebsoft' );
     209            $max_execution_time  = ( ini_get( 'max_execution_time' ) ) ? ini_get( 'max_execution_time' ) : __( 'N/A', 'bestwebsoft' );
     210            $memory_limit        = ( ini_get( 'memory_limit' ) ) ? ini_get( 'memory_limit' ) : __( 'N/A', 'bestwebsoft' );
     211            $wp_memory_limit     = ( defined( 'WP_MEMORY_LIMIT' ) ) ? WP_MEMORY_LIMIT : __( 'N/A', 'bestwebsoft' );
     212            $memory_usage        = ( function_exists( 'memory_get_usage' ) ) ? round( memory_get_usage() / 1024 / 1024, 2 ) . ' ' . __( 'Mb', 'bestwebsoft' ) : __( 'N/A', 'bestwebsoft' );
     213            $exif_read_data      = ( is_callable( 'exif_read_data' ) ) ? __( 'Yes', 'bestwebsoft' ) . ' ( V' . substr( phpversion( 'exif' ), 0, 4 ) . ')' : __( 'No', 'bestwebsoft' );
     214            $iptcparse           = ( is_callable( 'iptcparse' ) ) ? __( 'Yes', 'bestwebsoft' ) : __( 'No', 'bestwebsoft' );
     215            $xml_parser_create   = ( is_callable( 'xml_parser_create' ) ) ? __( 'Yes', 'bestwebsoft' ) : __( 'No', 'bestwebsoft' );
    116216            $theme               = wp_get_theme();
    117217
    118218            if ( function_exists( 'is_multisite' ) ) {
    119                 $multisite = is_multisite() ? __( 'Yes', 'bws-login-register' ) : __( 'No', 'bws-login-register' );
     219                $multisite = is_multisite() ? __( 'Yes', 'bestwebsoft' ) : __( 'No', 'bestwebsoft' );
    120220            } else {
    121                 $multisite = __( 'N/A', 'bws-login-register' );
     221                $multisite = __( 'N/A', 'bestwebsoft' );
    122222            }
    123223
    124224            $system_info = array(
    125225                'wp_environment'     => array(
    126                     'name' => __( 'WordPress Environment', 'bws-login-register' ),
     226                    'name' => __( 'WordPress Environment', 'bestwebsoft' ),
    127227                    'data' => array(
    128                         __( 'Home URL', 'bws-login-register' )    => home_url(),
    129                         __( 'Website URL', 'bws-login-register' ) => get_option( 'siteurl' ),
    130                         __( 'WP Version', 'bws-login-register' )  => $wp_version,
    131                         __( 'WP Multisite', 'bws-login-register' ) => $multisite,
    132                         __( 'WP Memory Limit', 'bws-login-register' ) => $wp_memory_limit,
    133                         __( 'Active Theme', 'bws-login-register' ) => $theme['Name'] . ' ' . $theme['Version'] . ' (' . sprintf( __( 'by %s', 'bws-login-register' ), $theme['Author'] ) . ')',
     228                        __( 'Home URL', 'bestwebsoft' )    => home_url(),
     229                        __( 'Website URL', 'bestwebsoft' ) => get_option( 'siteurl' ),
     230                        __( 'WP Version', 'bestwebsoft' )  => $wp_version,
     231                        __( 'WP Multisite', 'bestwebsoft' ) => $multisite,
     232                        __( 'WP Memory Limit', 'bestwebsoft' ) => $wp_memory_limit,
     233                        __( 'Active Theme', 'bestwebsoft' ) => $theme['Name'] . ' ' . $theme['Version'] . ' (' . sprintf( __( 'by %s', 'bestwebsoft' ), $theme['Author'] ) . ')',
    134234                    ),
    135235                ),
    136236                'server_environment' => array(
    137                     'name' => __( 'Server Environment', 'bws-login-register' ),
     237                    'name' => __( 'Server Environment', 'bestwebsoft' ),
    138238                    'data' => array(
    139                         __( 'Operating System', 'bws-login-register' ) => PHP_OS,
    140                         __( 'Server', 'bws-login-register' )      => isset( $_SERVER['SERVER_SOFTWARE'] ) ? sanitize_email( wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) ) : '',
    141                         __( 'PHP Version', 'bws-login-register' ) => PHP_VERSION,
    142                         __( 'PHP Allow URL fopen', 'bws-login-register' ) => $allow_url_fopen,
    143                         __( 'PHP Memory Limit', 'bws-login-register' ) => $memory_limit,
    144                         __( 'Memory Usage', 'bws-login-register' ) => $memory_usage,
    145                         __( 'PHP Max Upload Size', 'bws-login-register' ) => $upload_max_filesize,
    146                         __( 'PHP Max Post Size', 'bws-login-register' ) => $post_max_size,
    147                         __( 'PHP Max Script Execute Time', 'bws-login-register' ) => $max_execution_time,
    148                         __( 'PHP Exif support', 'bws-login-register' ) => $exif_read_data,
    149                         __( 'PHP IPTC support', 'bws-login-register' ) => $iptcparse,
    150                         __( 'PHP XML support', 'bws-login-register' ) => $xml_parser_create,
     239                        __( 'Operating System', 'bestwebsoft' ) => PHP_OS,
     240                        __( 'Server', 'bestwebsoft' )      => isset( $_SERVER['SERVER_SOFTWARE'] ) ? sanitize_email( wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) ) : '',
     241                        __( 'PHP Version', 'bestwebsoft' ) => PHP_VERSION,
     242                        __( 'PHP Allow URL fopen', 'bestwebsoft' ) => $allow_url_fopen,
     243                        __( 'PHP Memory Limit', 'bestwebsoft' ) => $memory_limit,
     244                        __( 'Memory Usage', 'bestwebsoft' ) => $memory_usage,
     245                        __( 'PHP Max Upload Size', 'bestwebsoft' ) => $upload_max_filesize,
     246                        __( 'PHP Max Post Size', 'bestwebsoft' ) => $post_max_size,
     247                        __( 'PHP Max Script Execute Time', 'bestwebsoft' ) => $max_execution_time,
     248                        __( 'PHP Exif support', 'bestwebsoft' ) => $exif_read_data,
     249                        __( 'PHP IPTC support', 'bestwebsoft' ) => $iptcparse,
     250                        __( 'PHP XML support', 'bestwebsoft' ) => $xml_parser_create,
    151251                        '$_SERVER[HTTP_HOST]'              => isset( $_SERVER['HTTP_HOST'] ) ? sanitize_email( wp_unslash( $_SERVER['HTTP_HOST'] ) ) : '',
    152252                        '$_SERVER[SERVER_NAME]'            => isset( $_SERVER['SERVER_NAME'] ) ? sanitize_email( wp_unslash( $_SERVER['SERVER_NAME'] ) ) : '',
     
    154254                ),
    155255                'db'                 => array(
    156                     'name' => __( 'Database', 'bws-login-register' ),
     256                    'name' => __( 'Database', 'bestwebsoft' ),
    157257                    'data' => array(
    158                         __( 'WP DB version', 'bws-login-register' ) => get_option( 'db_version' ),
    159                         __( 'MySQL version', 'bws-login-register' ) => $wpdb->get_var( 'SELECT VERSION() AS version' ),
    160                         __( 'SQL Mode', 'bws-login-register' ) => $sql_mode,
     258                        __( 'WP DB version', 'bestwebsoft' ) => get_option( 'db_version' ),
     259                        __( 'MySQL version', 'bestwebsoft' ) => $wpdb->get_var( 'SELECT VERSION() AS version' ),
     260                        __( 'SQL Mode', 'bestwebsoft' ) => $sql_mode,
    161261                    ),
    162262                ),
    163263                'active_plugins'     => array(
    164                     'name'  => __( 'Active Plugins', 'bws-login-register' ),
     264                    'name'  => __( 'Active Plugins', 'bestwebsoft' ),
    165265                    'data'  => array(),
    166266                    'count' => 0,
    167267                ),
    168268                'inactive_plugins'   => array(
    169                     'name'  => __( 'Inactive Plugins', 'bws-login-register' ),
     269                    'name'  => __( 'Inactive Plugins', 'bestwebsoft' ),
    170270                    'data'  => array(),
    171271                    'count' => 0,
     
    176276                $name = str_replace( 'by BestWebSoft', '', $plugin['Name'] );
    177277                if ( is_plugin_active( $path ) ) {
    178                     $system_info['active_plugins']['data'][ $name ] = sprintf( __( 'by %s', 'bws-login-register' ), $plugin['Author'] ) . ' - ' . $plugin['Version'];
     278                    $system_info['active_plugins']['data'][ $name ] = sprintf( __( 'by %s', 'bestwebsoft' ), $plugin['Author'] ) . ' - ' . $plugin['Version'];
    179279                    $system_info['active_plugins']['count']         = $system_info['active_plugins']['count'] + 1;
    180280                } else {
    181                     $system_info['inactive_plugins']['data'][ $name ] = sprintf( __( 'by %s', 'bws-login-register' ), $plugin['Author'] ) . ' - ' . $plugin['Version'];
     281                    $system_info['inactive_plugins']['data'][ $name ] = sprintf( __( 'by %s', 'bestwebsoft' ), $plugin['Author'] ) . ' - ' . $plugin['Version'];
    182282                    $system_info['inactive_plugins']['count']         = $system_info['inactive_plugins']['count'] + 1;
    183283                }
     
    188288                    $email = sanitize_email( wp_unslash( $_REQUEST['bwsmn_form_email'] ) );
    189289                    if ( '' === $email ) {
    190                         $error = __( 'Please enter a valid email address.', 'bws-login-register' );
     290                        $error = __( 'Please enter a valid email address.', 'bestwebsoft' );
    191291                    } else {
    192                         $message = sprintf( __( 'Email with system info is sent to %s.', 'bws-login-register' ), $email );
     292                        $message = sprintf( __( 'Email with system info is sent to %s.', 'bestwebsoft' ), $email );
    193293                    }
    194294                } else {
    195295                    $email   = 'plugin_system_status@bestwebsoft.com';
    196                     $message = __( 'Thank you for contacting us.', 'bws-login-register' );
     296                    $message = __( 'Thank you for contacting us.', 'bestwebsoft' );
    197297                }
    198298
     
    218318                    $result        = wp_mail( $email, 'System Info From ' . esc_url( home_url() ), wp_kses( $message_text ), $headers );
    219319                    if ( true !== $result ) {
    220                         $error = __( 'Sorry, email message could not be delivered.', 'bws-login-register' );
     320                        $error = __( 'Sorry, email message could not be delivered.', 'bestwebsoft' );
    221321                    }
    222322                }
     
    243343                        " href="<?php echo esc_url( self_admin_url( 'admin.php?page=bws_panel' ) ); ?>">
    244344                            <?php
    245                             esc_html_e( 'Plugins', 'bws-login-register' );
     345                            esc_html_e( 'Plugins', 'bestwebsoft' );
    246346                            ?>
    247347                        </a>
     
    253353                        }
    254354                        ?>
    255                         " href="<?php echo esc_url( self_admin_url( 'admin.php?page=bws_themes' ) ); ?>"><?php esc_html_e( 'Themes', 'bws-login-register' ); ?></a>
     355                        " href="<?php echo esc_url( self_admin_url( 'admin.php?page=bws_themes' ) ); ?>"><?php esc_html_e( 'Themes', 'bestwebsoft' ); ?></a>
    256356                        <a class="bws-nav-tab
    257357                        <?php
     
    262362                        " href="<?php echo esc_url( self_admin_url( 'admin.php?page=bws_system_status' ) ); ?>">
    263363                            <?php
    264                             esc_html_e( 'System status', 'bws-login-register' );
     364                            esc_html_e( 'System status', 'bestwebsoft' );
    265365                            ?>
    266366                        </a>
     
    274374                        " href="<?php echo esc_url( self_admin_url( 'admin.php?page=' . $page ) ); ?>">
    275375                            <?php
    276                             esc_html_e( 'Plugins', 'bws-login-register' );
     376                            esc_html_e( 'Plugins', 'bestwebsoft' );
    277377                            ?>
    278378                        </a>
     
    285385                        " href="<?php echo esc_url( self_admin_url( 'admin.php?page=' . $page . '&tab=themes' ) ); ?>">
    286386                            <?php
    287                             esc_html_e( 'Themes', 'bws-login-register' );
     387                            esc_html_e( 'Themes', 'bestwebsoft' );
    288388                            ?>
    289389                        </a>
     
    296396                        " href="<?php echo esc_url( self_admin_url( 'admin.php?page=' . $page . '&tab=system-status' ) ); ?>">
    297397                            <?php
    298                             esc_html_e( 'System status', 'bws-login-register' );
     398                            esc_html_e( 'System status', 'bestwebsoft' );
    299399                            ?>
    300400                        </a>
     
    303403                <!-- pls -->
    304404                <div class="bws-help-links-wrapper">
    305                     <a href="https://support.bestwebsoft.com" target="_blank"><?php esc_html_e( 'Support', 'bws-login-register' ); ?></a>
    306                     <a href="https://bestwebsoft.com/client-area" target="_blank" title="<?php esc_html_e( 'Manage purchased licenses & subscriptions', 'bws-login-register' ); ?>">Client Area</a>
     405                    <a href="https://support.bestwebsoft.com" target="_blank"><?php esc_html_e( 'Support', 'bestwebsoft' ); ?></a>
     406                    <a href="https://bestwebsoft.com/client-area" target="_blank" title="<?php esc_html_e( 'Manage purchased licenses & subscriptions', 'bestwebsoft' ); ?>">Client Area</a>
    307407                </div>
    308408                <!-- end pls -->
    309409                <div class="clear"></div>
    310410            </div>
     411            <?php if ( ( 'bws_panel' === $page || ( ! isset( $_GET['tab'] ) && ! $is_main_page ) ) && ! isset( $_POST['bws_plugin_action_submit'] ) ) { ?>
     412                <div class="bws-membership-wrap">
     413                    <div class="bws-membership-backround"></div>
     414                    <div class="bws-membership">
     415                        <div class="bws-membership-title"><?php printf( esc_html__( 'Get Access to %s+ Premium Plugins', 'bestwebsoft' ), '30' ); ?></div>
     416                        <form class="bws-membership-form" method="post" action="">
     417                            <span class="bws-membership-link"><a target="_blank" href="https://bestwebsoft.com/membership/"><?php esc_html_e( 'Subscribe to Pro Membership', 'bestwebsoft' ); ?></a> <?php esc_html_e( 'or', 'bestwebsoft' ); ?></span>
     418                            <?php
     419                            if ( isset( $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] ) &&
     420                                '5' < $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] &&
     421                                $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time'] > ( time() - ( 24 * 60 * 60 ) ) ) {
     422                                ?>
     423                                <div class="bws_form_input_wrap">
     424                                    <input disabled="disabled" type="text" name="bws_license_key" value="<?php echo esc_attr( $bws_license_key ); ?>" />
     425                                    <div class="bws_error"><?php esc_html_e( 'Unfortunately, you have exceeded the number of available tries per day.', 'bestwebsoft' ); ?></div>
     426                                </div>
     427                                <input disabled="disabled" type="submit" class="bws-button" value="<?php esc_html_e( 'Check license key', 'bestwebsoft' ); ?>" />
     428                            <?php } else { ?>
     429                                <div class="bws_form_input_wrap">
     430                                    <input
     431                                    <?php
     432                                    if ( '' !== $error ) {
     433                                        echo 'class="bws_input_error"';
     434                                    }
     435                                    ?>
     436                                        type="text" placeholder="<?php esc_html_e( 'Enter your license key', 'bestwebsoft' ); ?>" maxlength="100" name="bws_license_key" value="<?php echo esc_attr( $bws_license_key ); ?>" />
     437                                    <div class="bws_error"
     438                                    <?php
     439                                    if ( '' === $error ) {
     440                                        echo 'style="display:none"';
     441                                    }
     442                                    ?>
     443                                    ><?php echo esc_html( $error ); ?></div>
     444                                </div>
     445                                <input type="hidden" name="bws_license_plugin" value="<?php echo esc_attr( $bws_license_plugin ); ?>" />
     446                                <input type="hidden" name="bws_license_submit" value="submit" />
     447                                <?php if ( empty( $plugins_array ) ) { ?>
     448                                    <input type="submit" class="bws-button" value="<?php esc_html_e( 'Activate', 'bestwebsoft' ); ?>" />
     449                                <?php } else { ?>
     450                                    <input type="submit" class="bws-button" value="<?php esc_html_e( 'Check license key', 'bestwebsoft' ); ?>" />
     451                                <?php } ?>
     452                                <?php wp_nonce_field( plugin_basename( __FILE__ ), 'bws_license_nonce_name' ); ?>
     453                            <?php } ?>
     454                        </form>
     455                        <div class="clear"></div>
     456                    </div>
     457                </div>
     458            <?php } ?>
    311459            <!-- end pls -->
    312460            <div class="bws-wrap-content wrap">
     
    320468                    ><p><?php echo esc_html( $message ); ?></p></div>
    321469                    <h1>
    322                         <?php esc_html_e( 'Plugins', 'bws-login-register' ); ?>
    323                         <a href="<?php echo esc_url( self_admin_url( 'plugin-install.php?tab=upload' ) ); ?>" class="upload page-title-action add-new-h2"><?php esc_html_e( 'Upload Plugin', 'bws-login-register' ); ?></a>
     470                        <?php esc_html_e( 'Plugins', 'bestwebsoft' ); ?>
     471                        <a href="<?php echo esc_url( self_admin_url( 'plugin-install.php?tab=upload' ) ); ?>" class="upload page-title-action add-new-h2"><?php esc_html_e( 'Upload Plugin', 'bestwebsoft' ); ?></a>
    324472                    </h1>
    325473                    <?php
    326                     if ( isset( $_GET['activate'] ) ) { ?>
    327                         <div id="message" class="updated notice is-dismissible"><p><?php esc_html_e( 'Plugin <strong>activated</strong>.', 'bws-login-register' ); ?></p></div>
     474                    if ( isset( $_GET['error'] ) ) {
     475                        if ( isset( $_GET['charsout'] ) ) {
     476                            $errmsg = sprintf( __( 'The plugin generated %d characters of <strong>unexpected output</strong> during activation. If you notice &#8220;headers already sent&#8221; messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.' ), intval( $_GET['charsout'] ) );
     477                        } else {
     478                            $errmsg = __( 'Plugin could not be activated because it triggered a <strong>fatal error</strong>.' );
     479                        }
     480                        ?>
     481                        <div id="message" class="error is-dismissible"><p><?php echo wp_kses( $errmsg ); ?></p></div>
     482                    <?php } elseif ( isset( $_GET['activate'] ) ) { ?>
     483                        <div id="message" class="updated notice is-dismissible"><p><?php esc_html_e( 'Plugin <strong>activated</strong>.' ); ?></p></div>
    328484                        <?php
    329485                    }
    330486
    331                     $category_href = $current_page;
    332                     if ( 'all' !== $plugin_category ) {
    333                         $category_href .= '&category=' . $plugin_category;
    334                     }
    335                     ?>
    336                     <ul class="subsubsub">
    337                         <li>
    338                             <a
     487                    if ( isset( $_POST['bws_plugin_action_submit'] ) && isset( $_POST['bws_install_plugin'] ) && check_admin_referer( plugin_basename( __FILE__ ), 'bws_license_install_nonce_name' ) ) {
     488
     489                        $bws_license_plugin = sanitize_text_field( wp_unslash( $_POST['bws_install_plugin'] ) );
     490
     491                        $bstwbsftwppdtplgns_options[ $bws_license_plugin ] = $bws_license_key;
     492                        if ( is_multisite() ) {
     493                            update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     494                        } else {
     495                            update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     496                        }
     497
     498                        $url = $plugins_array[ $bws_license_plugin ]['link'] . '&download_from=5';
     499                        ?>
     500                        <h2><?php esc_html_e( 'Download Pro Plugin', 'bestwebsoft' ); ?></h2>       
     501                        <p>
     502                            <strong><?php esc_html_e( 'Your Pro plugin is ready', 'bestwebsoft' ); ?></strong>
     503                            <br>
     504                            <?php esc_html_e( 'Your plugin has been zipped, and now is ready to download.', 'bestwebsoft' ); ?>
     505                        </p>
     506                        <p>
     507                            <a class="button button-secondary" target="_parent" href="<?php echo esc_url( $url ); ?>"><?php esc_html_e( 'Download Now', 'bestwebsoft' ); ?></a>
     508                        </p>
     509                        <br>
     510                        <p>
     511                            <strong><?php esc_html_e( 'Need help installing the plugin?', 'bestwebsoft' ); ?></strong>
     512                            <br>
     513                            <a target="_blank" href="https://bestwebsoft.com/documentation/how-to-install-a-wordpress-product/how-to-install-a-wordpress-plugin/"><?php esc_html_e( 'How to install WordPress plugin from your admin Dashboard (ZIP archive)', 'bestwebsoft' ); ?></a>
     514                        </p>                       
     515                        <p>
     516                            <strong><?php esc_html_e( 'Get Started', 'bestwebsoft' ); ?></strong>
     517                            <br>
     518                            <a target="_blank" href="https://bestwebsoft.com/documentation/"><?php esc_html_e( 'Documentation', 'bestwebsoft' ); ?></a>
     519                            <br>
     520                            <a target="_blank" href="https://www.youtube.com/user/bestwebsoft"><?php esc_html_e( 'Video Instructions', 'bestwebsoft' ); ?></a>
     521                            <br>
     522                            <a target="_blank" href="https://support.bestwebsoft.com"><?php esc_html_e( 'Knowledge Base', 'bestwebsoft' ); ?></a>
     523                        </p>
     524                        <p>
     525                            <strong><?php esc_html_e( 'Licenses & Domains', 'bestwebsoft' ); ?></strong>
     526                            <br>
    339527                            <?php
    340                             if ( ! isset( $_GET['sub'] ) ) {
    341                                 echo 'class="current" ';
    342                             }
     528                            printf(
     529                                'Manage your license(-s) and change domain names using the %s at BestWebSoft.',
     530                                '<a target="_blank" href="https://bestwebsoft.com/client-area">' . esc_html__( 'Client Area', 'bestwebsoft' ) . '</a>'
     531                            );
    343532                            ?>
    344                             href="<?php echo esc_url( self_admin_url( $category_href ) ); ?>"><?php esc_html_e( 'All', 'bws-login-register' ); ?></a>
    345                         </li> |
    346                         <li>
    347                             <a
    348                             <?php
    349                             if ( isset( $_GET['sub'] ) && 'installed' === sanitize_text_field( wp_unslash( $_GET['sub'] ) ) ) {
    350                                 echo 'class="current" ';
    351                             }
    352                             ?>
    353                             href="<?php echo esc_url( self_admin_url( $category_href . '&sub=installed' ) ); ?>"><?php esc_html_e( 'Installed', 'bws-login-register' ); ?></a>
    354                         </li> |
    355                         <li>
    356                             <a
    357                             <?php
    358                             if ( isset( $_GET['sub'] ) && 'not_installed' === sanitize_text_field( wp_unslash( $_GET['sub'] ) ) ) {
    359                                 echo 'class="current" ';
    360                             }
    361                             ?>
    362                             href="<?php echo esc_url( self_admin_url( $category_href . '&sub=not_installed' ) ); ?>"><?php esc_html_e( 'Not Installed', 'bws-login-register' ); ?></a>
    363                         </li>
    364                     </ul>
    365                     <div class="clear"></div>
    366                     <div class="bws-filter-top">
    367                         <h2>
    368                             <span class="bws-toggle-indicator"></span>
    369                                                         <?php esc_html_e( 'Filter results', 'bws-login-register' ); ?>
    370                         </h2>
    371                         <div class="bws-filter-top-inside">
    372                             <div class="bws-filter-title"><?php esc_html_e( 'Category', 'bws-login-register' ); ?></div>
    373                             <ul class="bws-category">
    374                                 <li>
    375                                     <?php $sub_in_url = ( isset( $_GET['sub'] ) && in_array( sanitize_text_field( wp_unslash( $_GET['sub'] ) ), array( 'installed', 'not_installed' ) ) ) ? '&sub=' . sanitize_text_field( wp_unslash( $_GET['sub'] ) ) : ''; ?>
    376                                     <a
    377                                     <?php
    378                                     if ( 'all' === $plugin_category ) {
    379                                         echo ' class="bws-active"';
    380                                     }
    381                                     ?>
    382                                         href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url ) ); ?>"><?php esc_html_e( 'All', 'bws-login-register' ); ?>
    383                                             <span>(<?php echo count( $bws_plugins ); ?>)</span>
    384                                     </a>
    385                                 </li>
    386                                 <?php foreach ( $bws_plugins_category as $category_key => $category_value ) { ?>
     533                        </p>
     534                        <p><a href="<?php echo esc_url( self_admin_url( $current_page ) ); ?>" target="_parent"><?php esc_html_e( 'Return to BestWebSoft Panel', 'bestwebsoft' ); ?></a></p>
     535                        <?php
     536                    } else {
     537                        $category_href = $current_page;
     538                        if ( 'all' !== $plugin_category ) {
     539                            $category_href .= '&category=' . $plugin_category;
     540                        }
     541                        ?>
     542                        <ul class="subsubsub">
     543                            <li>
     544                                <a
     545                                <?php
     546                                if ( ! isset( $_GET['sub'] ) ) {
     547                                    echo 'class="current" ';
     548                                }
     549                                ?>
     550                                href="<?php echo esc_url( self_admin_url( $category_href ) ); ?>"><?php esc_html_e( 'All', 'bestwebsoft' ); ?></a>
     551                            </li> |
     552                            <li>
     553                                <a
     554                                <?php
     555                                if ( isset( $_GET['sub'] ) && 'installed' === sanitize_text_field( wp_unslash( $_GET['sub'] ) ) ) {
     556                                    echo 'class="current" ';
     557                                }
     558                                ?>
     559                                href="<?php echo esc_url( self_admin_url( $category_href . '&sub=installed' ) ); ?>"><?php esc_html_e( 'Installed', 'bestwebsoft' ); ?></a>
     560                            </li> |
     561                            <li>
     562                                <a
     563                                <?php
     564                                if ( isset( $_GET['sub'] ) && 'not_installed' === sanitize_text_field( wp_unslash( $_GET['sub'] ) ) ) {
     565                                    echo 'class="current" ';
     566                                }
     567                                ?>
     568                                href="<?php echo esc_url( self_admin_url( $category_href . '&sub=not_installed' ) ); ?>"><?php esc_html_e( 'Not Installed', 'bestwebsoft' ); ?></a>
     569                            </li>
     570                        </ul>
     571                        <div class="clear"></div>
     572                        <div class="bws-filter-top">
     573                            <h2>
     574                                <span class="bws-toggle-indicator"></span>
     575                                                            <?php esc_html_e( 'Filter results', 'bestwebsoft' ); ?>
     576                            </h2>
     577                            <div class="bws-filter-top-inside">
     578                                <div class="bws-filter-title"><?php esc_html_e( 'Category', 'bestwebsoft' ); ?></div>
     579                                <ul class="bws-category">
    387580                                    <li>
     581                                        <?php $sub_in_url = ( isset( $_GET['sub'] ) && in_array( sanitize_text_field( wp_unslash( $_GET['sub'] ) ), array( 'installed', 'not_installed' ) ) ) ? '&sub=' . sanitize_text_field( wp_unslash( $_GET['sub'] ) ) : ''; ?>
    388582                                        <a
    389583                                        <?php
    390                                         if ( $category_key === $plugin_category ) {
     584                                        if ( 'all' === $plugin_category ) {
    391585                                            echo ' class="bws-active"';
    392586                                        }
    393587                                        ?>
    394                                             href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url . '&category=' . $category_key ) ); ?>"><?php echo esc_html( $category_value['name'] ); ?>
    395                                                 <span>(<?php echo absint( $category_value['count'] ); ?>)</span>
     588                                            href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url ) ); ?>"><?php esc_html_e( 'All', 'bestwebsoft' ); ?>
     589                                                <span>(<?php echo count( $bws_plugins ); ?>)</span>
    396590                                        </a>
    397591                                    </li>
    398                                 <?php } ?>
    399                             </ul>
    400                         </div>
    401                     </div>
    402                     <div class="bws-products">
    403                         <?php
    404                         $nothing_found = true;
    405                         foreach ( $bws_plugins as $key_plugin => $value_plugin ) {
    406 
    407                             if ( 'all' !== $plugin_category && isset( $bws_plugins_category[ $plugin_category ] ) && ! in_array( $plugin_category, $value_plugin['category'] ) ) {
    408                                 continue;
    409                             }
    410 
    411                             $key_plugin_explode = explode( '/', $key_plugin );
    412                             if ( in_array( $key_plugin_explode[0], array( 'car-rental', 'contact-form-multi', 'custom-admin-page', 'adsense-plugin', 'zendesk-help-center', 'bws-adsense' ) ) ) {
    413                                 $icon = isset( $value_plugin['icon'] ) ? $value_plugin['icon'] : '//ps.w.org/' . $key_plugin_explode[0] . '/assets/icon-256x256.png';
    414                             } else {
    415                                 $icon = isset( $value_plugin['icon'] ) ? $value_plugin['icon'] : '//ps.w.org/' . $key_plugin_explode[0] . '/assets/icon-256x256.gif';
    416                             }
    417 
    418                             $is_pro_isset = isset( $value_plugin['pro_version'] );
    419                             $is_installed = array_key_exists( $key_plugin, $all_plugins );
    420                             $is_active    = in_array( $key_plugin, $active_plugins ) || isset( $sitewide_active_plugins[ $key_plugin ] );
    421 
    422                             $is_pro_installed = $is_pro_active = false;
    423                             if ( $is_pro_isset ) {
    424                                 $is_pro_installed = array_key_exists( $value_plugin['pro_version'], $all_plugins );
    425                                 $is_pro_active    = in_array( $value_plugin['pro_version'], $active_plugins ) || isset( $sitewide_active_plugins[ $value_plugin['pro_version'] ] );
    426                             }
    427 
    428                             if ( ( isset( $_GET['sub'] ) && 'installed' === sanitize_text_field( wp_unslash( $_GET['sub'] ) ) && ! $is_pro_installed && ! $is_installed ) ||
    429                                 ( isset( $_GET['sub'] ) && 'not_installed' === sanitize_text_field( wp_unslash( $_GET['sub'] ) ) && ( $is_pro_installed || $is_installed ) ) ) {
    430                                 continue;
    431                             }
    432 
    433                             if ( is_multisite() ) {
    434                                 $link_attr = isset( $value_plugin['install_url'] ) ? 'href="' . esc_url( $value_plugin['install_url'] ) . '" target="_blank"' : 'href="' . esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $key_plugin_explode[0] . '&from=import&TB_iframe=true&width=600&height=550' ) ) . '" class="thickbox open-plugin-details-modal"';
    435                             } else {
    436                                 $link_attr = isset( $value_plugin['install_url'] ) ? 'href="' . esc_url( $value_plugin['install_url'] ) . '" target="_blank"' : 'href="' . esc_url( self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $key_plugin_explode[0] . '&from=import&TB_iframe=true&width=600&height=550' ) ) . '" class="thickbox open-plugin-details-modal"';
    437                             }
    438 
    439                             $nothing_found = false;
    440                             ?>
    441                                 <div class="bws_product_box
    442                                 <?php
    443                                 if ( $is_active || $is_pro_active ) {
    444                                     echo esc_attr( ' bws_product_active' );
    445                                 }
    446                                 ?>
    447                                 ">
    448                                     <div class="bws_product_image">
    449                                         <a <?php echo wp_kses_data( $link_attr ); ?>><img src="<?php echo esc_url( $icon ); ?>"/></a>
    450                                     </div>
    451                                 <div class="bws_product_content">
    452                                     <div class="bws_product_title"><a <?php echo wp_kses_data( $link_attr ); ?>><?php echo esc_html( $value_plugin['name'] ); ?></a></div>
    453                                         <div class="bws-version">
     592                                    <?php foreach ( $bws_plugins_category as $category_key => $category_value ) { ?>
     593                                        <li>
     594                                            <a
    454595                                            <?php
    455                                             if ( $is_pro_installed ) {
    456                                                 echo '<span';
    457                                                 if ( ! empty( $value_plugin['expired'] ) || ! empty( $value_plugin['update_availible'] ) ) {
    458                                                     echo ' class="bws-update-available"';
    459                                                 }
    460                                                 echo '>v ' . esc_attr( $all_plugins[ $value_plugin['pro_version'] ]['Version'] ) . '</span>';
    461                                             } elseif ( $is_installed ) {
    462                                                 echo '<span';
    463                                                 if ( ! empty( $value_plugin['expired'] ) || ! empty( $value_plugin['update_availible'] ) ) {
    464                                                     echo ' class="bws-update-available"';
    465                                                 }
    466                                                 echo '>v ' . esc_attr( $all_plugins[ $key_plugin ]['Version'] ) . '</span>';
    467                                             } else {
    468                                                 echo '<span>' . esc_html__( 'Not installed', 'bws-login-register' ) . '</span>';
    469                                             }
    470 
    471                                             if ( ! empty( $value_plugin['expired'] ) ) {
    472                                                 echo ' - <a class="bws-update-now" href="https://support.bestwebsoft.com/hc/en-us/articles/202356359" target="_blank">' . esc_html__( 'Renew to get updates', 'bws-login-register' ) . '</a>';
    473                                             } elseif ( ! empty( $value_plugin['update_availible'] ) ) {
    474                                                 $r = $update_availible_all->response[ $value_plugin['update_availible'] ];
    475                                                 echo ' - <a class="bws-update-now" href="' . esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' . $value_plugin['update_availible'] ), 'upgrade-plugin_' . $value_plugin['update_availible'] ) ) . '" class="update-link" aria-label="' . sprintf( esc_html__( 'Update to v %s', 'bws-login-register' ), esc_attr( $r->new_version ) ) . '">' . sprintf( esc_html__( 'Update to v %s', 'bws-login-register' ), esc_html( $r->new_version ) ) . '</a>';
     596                                            if ( $category_key === $plugin_category ) {
     597                                                echo ' class="bws-active"';
    476598                                            }
    477599                                            ?>
    478                                         </div>
    479                                         <div class="bws_product_description">
    480                                             <?php echo esc_html( strlen( $value_plugin['description'] ) > 100 ? mb_substr( $value_plugin['description'], 0, 100 ) . '...' : $value_plugin['description'] ); ?>
    481                                         </div>
    482                                         <div class="bws_product_links">
    483                                             <?php
    484                                             if ( $is_active || $is_pro_active ) {
    485                                                 ?>
    486                                                 <a class="bws_donate" href="https://bestwebsoft.com/donate/" target="_blank"><?php esc_html_e( 'Donate', 'bws-login-register' ); ?></a> <span>|</span>
    487                                                 <a class="bws_settings" href="<?php echo esc_url( self_admin_url( $bws_plugins[ $key_plugin ]['settings'] ) ); ?>"><?php esc_html_e( 'Settings', 'bws-login-register' ); ?></a>
    488                                                 <?php
    489                                             } else {
    490                                                 if ( $is_pro_installed ) {
    491                                                     ?>
    492                                                     <a class="button button-secondary" href="<?php echo esc_url( wp_nonce_url( self_admin_url( $current_page . '&bws_activate_plugin=' . $value_plugin['pro_version'] ), 'bws_activate_plugin' . $value_plugin['pro_version'] ) ); ?>" title="<?php esc_html_e( 'Activate this plugin', 'bws-login-register' ); ?>"><?php esc_html_e( 'Activate', 'bws-login-register' ); ?></a>
    493                                                 <?php } elseif ( ! empty( $plugins_array ) && isset( $value_plugin['pro_version'] ) && array_key_exists( $value_plugin['pro_version'], $plugins_array ) ) { ?>
    494                                                     <form method="post" action="">
    495                                                         <input type="submit" class="button button-secondary" value="<?php esc_html_e( 'Get Pro', 'bws-login-register' ); ?>" />
    496                                                         <input type="hidden" name="bws_plugin_action_submit" value="submit" />
    497                                                         <input type="hidden" name="bws_install_plugin" value="<?php echo esc_url( $value_plugin['pro_version'] ); ?>" />
    498                                                         <?php wp_nonce_field( plugin_basename( __FILE__ ), 'bws_license_install_nonce_name' ); ?>
    499                                                     </form>
    500                                                 <?php } elseif ( $is_installed ) { ?>
    501                                                     <a class="button button-secondary" href="<?php echo esc_url( wp_nonce_url( self_admin_url( $current_page . '&bws_activate_plugin=' . $key_plugin ), 'bws_activate_plugin' . $key_plugin ) ); ?>" title="<?php esc_html_e( 'Activate this plugin', 'bws-login-register' ); ?>"><?php esc_html_e( 'Activate', 'bws-login-register' ); ?></a>
    502                                                     <?php
    503                                                 } else {
    504                                                     $install_url = isset( $value_plugin['install_url'] ) ? $value_plugin['install_url'] : network_admin_url( 'plugin-install.php?tab=search&type=term&s=' . str_replace( array( ' ', '-' ), '+', str_replace( '&', '', $value_plugin['name'] ) ) . '+BestWebSoft&plugin-search-input=Search+Plugins' );
    505                                                     ?>
    506                                                     <a class="button button-secondary" href="<?php echo esc_url( $install_url ); ?>" title="<?php esc_html_e( 'Install this plugin', 'bws-login-register' ); ?>" target="_blank"><?php esc_html_e( 'Install Now', 'bws-login-register' ); ?></a>
    507                                                     <?php
    508                                                 }
    509                                             }
    510                                             ?>
    511                                         </div>
    512                                     </div>
    513                                 <div class="clear"></div>
     600                                                href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url . '&category=' . $category_key ) ); ?>"><?php echo esc_html( $category_value['name'] ); ?>
     601                                                    <span>(<?php echo absint( $category_value['count'] ); ?>)</span>
     602                                            </a>
     603                                        </li>
     604                                    <?php } ?>
     605                                </ul>
    514606                            </div>
     607                        </div>
     608                        <div class="bws-products">
    515609                            <?php
    516                         }
    517                         if ( $nothing_found ) {
    518                             ?>
    519                             <p class="description"><?php esc_html_e( 'Nothing found. Try another criteria.', 'bws-login-register' ); ?></p>
    520                         <?php } ?>
    521                     </div>
    522                     <div id="bws-filter-wrapper">
    523                         <div class="bws-filter">
    524                             <div class="bws-filter-title"><?php esc_html_e( 'Category', 'bws-login-register' ); ?></div>
    525                             <ul class="bws-category">
    526                                 <li>
    527                                     <?php $sub_in_url = ( isset( $_GET['sub'] ) && in_array( sanitize_text_field( wp_unslash( $_GET['sub'] ) ), array( 'installed', 'not_installed' ) ) ) ? '&sub=' . sanitize_text_field( wp_unslash( $_GET['sub'] ) ) : ''; ?>
    528                                     <a
     610                            $nothing_found = true;
     611                            foreach ( $bws_plugins as $key_plugin => $value_plugin ) {
     612
     613                                if ( 'all' !== $plugin_category && isset( $bws_plugins_category[ $plugin_category ] ) && ! in_array( $plugin_category, $value_plugin['category'] ) ) {
     614                                    continue;
     615                                }
     616
     617                                $key_plugin_explode = explode( '/', $key_plugin );
     618                                if ( in_array( $key_plugin_explode[0], array( 'car-rental', 'contact-form-multi', 'custom-admin-page', 'adsense-plugin', 'zendesk-help-center', 'bws-adsense' ) ) ) {
     619                                    $icon = isset( $value_plugin['icon'] ) ? $value_plugin['icon'] : '//ps.w.org/' . $key_plugin_explode[0] . '/assets/icon-256x256.png';
     620                                } else {
     621                                    $icon = isset( $value_plugin['icon'] ) ? $value_plugin['icon'] : '//ps.w.org/' . $key_plugin_explode[0] . '/assets/icon-256x256.gif';
     622                                }
     623
     624                                $is_pro_isset = isset( $value_plugin['pro_version'] );
     625                                $is_installed = array_key_exists( $key_plugin, $all_plugins );
     626                                $is_active    = in_array( $key_plugin, $active_plugins ) || isset( $sitewide_active_plugins[ $key_plugin ] );
     627
     628                                $is_pro_installed = $is_pro_active = false;
     629                                if ( $is_pro_isset ) {
     630                                    $is_pro_installed = array_key_exists( $value_plugin['pro_version'], $all_plugins );
     631                                    $is_pro_active    = in_array( $value_plugin['pro_version'], $active_plugins ) || isset( $sitewide_active_plugins[ $value_plugin['pro_version'] ] );
     632                                }
     633
     634                                if ( ( isset( $_GET['sub'] ) && 'installed' === sanitize_text_field( wp_unslash( $_GET['sub'] ) ) && ! $is_pro_installed && ! $is_installed ) ||
     635                                    ( isset( $_GET['sub'] ) && 'not_installed' === sanitize_text_field( wp_unslash( $_GET['sub'] ) ) && ( $is_pro_installed || $is_installed ) ) ) {
     636                                    continue;
     637                                }
     638
     639                                if ( is_multisite() ) {
     640                                    $link_attr = isset( $value_plugin['install_url'] ) ? 'href="' . esc_url( $value_plugin['install_url'] ) . '" target="_blank"' : 'href="' . esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $key_plugin_explode[0] . '&from=import&TB_iframe=true&width=600&height=550' ) ) . '" class="thickbox open-plugin-details-modal"';
     641                                } else {
     642                                    $link_attr = isset( $value_plugin['install_url'] ) ? 'href="' . esc_url( $value_plugin['install_url'] ) . '" target="_blank"' : 'href="' . esc_url( self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $key_plugin_explode[0] . '&from=import&TB_iframe=true&width=600&height=550' ) ) . '" class="thickbox open-plugin-details-modal"';
     643                                }
     644
     645                                $nothing_found = false;
     646                                ?>
     647                                    <div class="bws_product_box
    529648                                    <?php
    530                                     if ( 'all' === $plugin_category ) {
    531                                         echo ' class="bws-active"';
     649                                    if ( $is_active || $is_pro_active ) {
     650                                        echo esc_attr( ' bws_product_active' );
    532651                                    }
    533652                                    ?>
    534                                         href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url ) ); ?>"><?php esc_html_e( 'All', 'bws-login-register' ); ?>
    535                                         <span>(<?php echo count( $bws_plugins ); ?>)</span>
    536                                     </a>
    537                                 </li>
    538                                 <?php foreach ( $bws_plugins_category as $category_key => $category_value ) { ?>
     653                                    ">
     654                                        <div class="bws_product_image">
     655                                            <a <?php echo wp_kses_data( $link_attr ); ?>><img src="<?php echo esc_url( $icon ); ?>"/></a>
     656                                        </div>
     657                                    <div class="bws_product_content">
     658                                        <div class="bws_product_title"><a <?php echo wp_kses_data( $link_attr ); ?>><?php echo esc_html( $value_plugin['name'] ); ?></a></div>
     659                                            <div class="bws-version">
     660                                                <?php
     661                                                if ( $is_pro_installed ) {
     662                                                    echo '<span';
     663                                                    if ( ! empty( $value_plugin['expired'] ) || ! empty( $value_plugin['update_availible'] ) ) {
     664                                                        echo ' class="bws-update-available"';
     665                                                    }
     666                                                    echo '>v ' . esc_attr( $all_plugins[ $value_plugin['pro_version'] ]['Version'] ) . '</span>';
     667                                                } elseif ( $is_installed ) {
     668                                                    echo '<span';
     669                                                    if ( ! empty( $value_plugin['expired'] ) || ! empty( $value_plugin['update_availible'] ) ) {
     670                                                        echo ' class="bws-update-available"';
     671                                                    }
     672                                                    echo '>v ' . esc_attr( $all_plugins[ $key_plugin ]['Version'] ) . '</span>';
     673                                                } else {
     674                                                    echo '<span>' . esc_html__( 'Not installed', 'bestwebsoft' ) . '</span>';
     675                                                }
     676
     677                                                if ( ! empty( $value_plugin['expired'] ) ) {
     678                                                    echo ' - <a class="bws-update-now" href="https://support.bestwebsoft.com/hc/en-us/articles/202356359" target="_blank">' . esc_html__( 'Renew to get updates', 'bestwebsoft' ) . '</a>';
     679                                                } elseif ( ! empty( $value_plugin['update_availible'] ) ) {
     680                                                    $r = $update_availible_all->response[ $value_plugin['update_availible'] ];
     681                                                    echo ' - <a class="bws-update-now" href="' . esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' . $value_plugin['update_availible'] ), 'upgrade-plugin_' . $value_plugin['update_availible'] ) ) . '" class="update-link" aria-label="' . sprintf( esc_html__( 'Update to v %s', 'bestwebsoft' ), esc_attr( $r->new_version ) ) . '">' . sprintf( esc_html__( 'Update to v %s', 'bestwebsoft' ), esc_html( $r->new_version ) ) . '</a>';
     682                                                }
     683                                                ?>
     684                                            </div>
     685                                            <div class="bws_product_description">
     686                                                <?php echo esc_html( strlen( $value_plugin['description'] ) > 100 ? mb_substr( $value_plugin['description'], 0, 100 ) . '...' : $value_plugin['description'] ); ?>
     687                                            </div>
     688                                            <div class="bws_product_links">
     689                                                <?php
     690                                                if ( $is_active || $is_pro_active ) {
     691                                                    if ( $is_pro_isset ) {
     692                                                        if ( ! $is_pro_installed ) {
     693                                                            if ( ! empty( $plugins_array ) && array_key_exists( $value_plugin['pro_version'], $plugins_array ) ) {
     694                                                                ?>
     695                                                                <form method="post" action="">
     696                                                                    <input type="submit" class="button button-secondary" value="<?php esc_html_e( 'Get Pro', 'bestwebsoft' ); ?>" />
     697                                                                    <input type="hidden" name="bws_plugin_action_submit" value="submit" />
     698                                                                    <input type="hidden" name="bws_install_plugin" value="<?php echo esc_attr( $value_plugin['pro_version'] ); ?>" />
     699                                                                    <?php wp_nonce_field( plugin_basename( __FILE__ ), 'bws_license_install_nonce_name' ); ?>
     700                                                                </form>
     701                                                            <?php } else { ?>
     702                                                                <a class="button button-secondary bws_upgrade_button" href="<?php echo esc_url( $bws_plugins[ $key_plugin ]['purchase'] ); ?>" target="_blank"><?php esc_html_e( 'Upgrade to Pro', 'bestwebsoft' ); ?></a>
     703                                                                <?php
     704                                                            }
     705                                                        }
     706                                                    } else {
     707                                                        ?>
     708                                                        <a class="bws_donate" href="https://bestwebsoft.com/donate/" target="_blank"><?php esc_html_e( 'Donate', 'bestwebsoft' ); ?></a> <span>|</span>
     709                                                        <?php
     710                                                    }
     711
     712                                                    if ( $is_pro_active ) {
     713                                                        ?>
     714                                                        <a class="bws_settings" href="<?php echo esc_url( self_admin_url( $bws_plugins[ $key_plugin ]['pro_settings'] ) ); ?>"><?php esc_html_e( 'Settings', 'bestwebsoft' ); ?></a>
     715                                                    <?php } else { ?>
     716                                                        <a class="bws_settings" href="<?php echo esc_url( self_admin_url( $bws_plugins[ $key_plugin ]['settings'] ) ); ?>"><?php esc_html_e( 'Settings', 'bestwebsoft' ); ?></a>
     717                                                        <?php
     718                                                    }
     719                                                } else {
     720                                                    if ( $is_pro_installed ) {
     721                                                        ?>
     722                                                        <a class="button button-secondary" href="<?php echo esc_url( wp_nonce_url( self_admin_url( $current_page . '&bws_activate_plugin=' . $value_plugin['pro_version'] ), 'bws_activate_plugin' . $value_plugin['pro_version'] ) ); ?>" title="<?php esc_html_e( 'Activate this plugin', 'bestwebsoft' ); ?>"><?php esc_html_e( 'Activate', 'bestwebsoft' ); ?></a>
     723                                                    <?php } elseif ( ! empty( $plugins_array ) && isset( $value_plugin['pro_version'] ) && array_key_exists( $value_plugin['pro_version'], $plugins_array ) ) { ?>
     724                                                        <form method="post" action="">
     725                                                            <input type="submit" class="button button-secondary" value="<?php esc_html_e( 'Get Pro', 'bestwebsoft' ); ?>" />
     726                                                            <input type="hidden" name="bws_plugin_action_submit" value="submit" />
     727                                                            <input type="hidden" name="bws_install_plugin" value="<?php echo esc_url( $value_plugin['pro_version'] ); ?>" />
     728                                                            <?php wp_nonce_field( plugin_basename( __FILE__ ), 'bws_license_install_nonce_name' ); ?>
     729                                                        </form>
     730                                                    <?php } elseif ( $is_installed ) { ?>
     731                                                        <a class="button button-secondary" href="<?php echo esc_url( wp_nonce_url( self_admin_url( $current_page . '&bws_activate_plugin=' . $key_plugin ), 'bws_activate_plugin' . $key_plugin ) ); ?>" title="<?php esc_html_e( 'Activate this plugin', 'bestwebsoft' ); ?>"><?php esc_html_e( 'Activate', 'bestwebsoft' ); ?></a>
     732                                                        <?php
     733                                                    } else {
     734                                                        $install_url = isset( $value_plugin['install_url'] ) ? $value_plugin['install_url'] : network_admin_url( 'plugin-install.php?tab=search&type=term&s=' . str_replace( array( ' ', '-' ), '+', str_replace( '&', '', $value_plugin['name'] ) ) . '+BestWebSoft&plugin-search-input=Search+Plugins' );
     735                                                        ?>
     736                                                        <a class="button button-secondary" href="<?php echo esc_url( $install_url ); ?>" title="<?php esc_html_e( 'Install this plugin', 'bestwebsoft' ); ?>" target="_blank"><?php esc_html_e( 'Install Now', 'bestwebsoft' ); ?></a>
     737                                                        <?php
     738                                                    }
     739                                                }
     740                                                ?>
     741                                            </div>
     742                                        </div>
     743                                    <div class="clear"></div>
     744                                </div>
     745                                <?php
     746                            }
     747                            if ( $nothing_found ) {
     748                                ?>
     749                                <p class="description"><?php esc_html_e( 'Nothing found. Try another criteria.', 'bestwebsoft' ); ?></p>
     750                            <?php } ?>
     751                        </div>
     752                        <div id="bws-filter-wrapper">
     753                            <div class="bws-filter">
     754                                <div class="bws-filter-title"><?php esc_html_e( 'Category', 'bestwebsoft' ); ?></div>
     755                                <ul class="bws-category">
    539756                                    <li>
     757                                        <?php $sub_in_url = ( isset( $_GET['sub'] ) && in_array( sanitize_text_field( wp_unslash( $_GET['sub'] ) ), array( 'installed', 'not_installed' ) ) ) ? '&sub=' . sanitize_text_field( wp_unslash( $_GET['sub'] ) ) : ''; ?>
    540758                                        <a
    541759                                        <?php
    542                                         if ( $category_key === $plugin_category ) {
     760                                        if ( 'all' === $plugin_category ) {
    543761                                            echo ' class="bws-active"';
    544762                                        }
    545763                                        ?>
    546                                             href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url . '&category=' . $category_key ) ); ?>"><?php echo esc_html( $category_value['name'] ); ?>
    547                                             <span>(<?php echo absint( $category_value['count'] ); ?>)</span>
     764                                            href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url ) ); ?>"><?php esc_html_e( 'All', 'bestwebsoft' ); ?>
     765                                            <span>(<?php echo count( $bws_plugins ); ?>)</span>
    548766                                        </a>
    549767                                    </li>
    550                                 <?php } ?>
    551                             </ul>
    552                         </div>
    553                     </div><!-- #bws-filter-wrapper -->
    554                     <div class="clear"></div>
    555                     <?php
     768                                    <?php foreach ( $bws_plugins_category as $category_key => $category_value ) { ?>
     769                                        <li>
     770                                            <a
     771                                            <?php
     772                                            if ( $category_key === $plugin_category ) {
     773                                                echo ' class="bws-active"';
     774                                            }
     775                                            ?>
     776                                                href="<?php echo esc_url( self_admin_url( $current_page . $sub_in_url . '&category=' . $category_key ) ); ?>"><?php echo esc_html( $category_value['name'] ); ?>
     777                                                <span>(<?php echo absint( $category_value['count'] ); ?>)</span>
     778                                            </a>
     779                                        </li>
     780                                    <?php } ?>
     781                                </ul>
     782                            </div>
     783                        </div><!-- #bws-filter-wrapper -->
     784                        <div class="clear"></div>
     785                        <?php
     786                    }
    556787                } elseif ( 'bws_themes' === $page || 'themes' === $tab ) {
    557788                    require dirname( __FILE__ ) . '/product_list.php';
    558789                    ?>
    559                     <h1><?php esc_html_e( 'Themes', 'bws-login-register' ); ?></h1>
     790                    <h1><?php esc_html_e( 'Themes', 'bestwebsoft' ); ?></h1>
    560791                    <div id="availablethemes" class="bws-availablethemes">
    561792                        <div class="theme-browser content-filterable rendered">
     
    567798                                    <div class="theme" tabindex="0">
    568799                                        <div class="theme-screenshot">
    569                                             <img src="<?php echo esc_url( lgnrgstrfrm_menu_url( 'icons/themes/' ) . $theme->slug . '.png' ); ?>" alt="" />
     800                                            <img src="<?php echo esc_url( bws_menu_url( 'icons/themes/' ) . $theme->slug . '.png' ); ?>" alt="" />
    570801                                        </div>
    571                                         <div class="theme-author"><?php printf( esc_html__( 'By %s', 'bws-login-register' ), 'bws-login-register' ); ?></div>
     802                                        <div class="theme-author"><?php printf( esc_html__( 'By %s', 'bestwebsoft' ), 'BestWebSoft' ); ?></div>
    572803                                        <h3 class="theme-name"><?php echo esc_html( $theme->name ); ?></h3>
    573804                                        <div class="theme-actions">
    574                                             <a class="button button-secondary preview install-theme-preview" href="<?php echo esc_url( $theme->href ); ?>" target="_blank"><?php esc_html_e( 'Learn More', 'bws-login-register' ); ?></a>
     805                                            <a class="button button-secondary preview install-theme-preview" href="<?php echo esc_url( $theme->href ); ?>" target="_blank"><?php esc_html_e( 'Learn More', 'bestwebsoft' ); ?></a>
    575806                                        </div>
    576807                                        <?php
     
    578809                                            if ( $wp_version < '4.6' ) {
    579810                                                ?>
    580                                                 <div class="theme-installed"><?php esc_html_e( 'Already Installed', 'bws-login-register' ); ?></div>
     811                                                <div class="theme-installed"><?php esc_html_e( 'Already Installed', 'bestwebsoft' ); ?></div>
    581812                                            <?php } else { ?>
    582                                                 <div class="notice notice-success notice-alt inline"><p><?php esc_html_e( 'Installed', 'bws-login-register' ); ?></p></div>
     813                                                <div class="notice notice-success notice-alt inline"><p><?php esc_html_e( 'Installed', 'bestwebsoft' ); ?></p></div>
    583814                                                <?php
    584815                                            }
     
    590821                            </div>
    591822                        </div>
    592                         <p><a class="bws_browse_link" href="https://bestwebsoft.com/products/wordpress/themes/" target="_blank"><?php esc_html_e( 'Browse More WordPress Themes', 'bws-login-register' ); ?> <span class="dashicons dashicons-arrow-right-alt2"></span></a></p>
     823                        <p><a class="bws_browse_link" href="https://bestwebsoft.com/products/wordpress/themes/" target="_blank"><?php esc_html_e( 'Browse More WordPress Themes', 'bestwebsoft' ); ?> <span class="dashicons dashicons-arrow-right-alt2"></span></a></p>
    593824                    </div>
    594825                <?php } elseif ( 'bws_system_status' === $page || 'system-status' === $tab ) { ?>
    595                     <h1><?php esc_html_e( 'System status', 'bws-login-register' ); ?></h1>
     826                    <h1><?php esc_html_e( 'System status', 'bestwebsoft' ); ?></h1>
    596827                    <div class="updated fade notice is-dismissible inline"
    597828                    <?php
     
    611842                        <p>
    612843                            <input type="hidden" name="bwsmn_form_submit" value="submit" />
    613                             <input type="submit" class="button-primary" value="<?php esc_html_e( 'Send to support', 'bws-login-register' ); ?>" />
     844                            <input type="submit" class="button-primary" value="<?php esc_html_e( 'Send to support', 'bestwebsoft' ); ?>" />
    614845                            <?php wp_nonce_field( plugin_basename( __FILE__ ), 'bwsmn_nonce_submit' ); ?>
    615846                        </p>
     
    618849                        <p>
    619850                            <input type="hidden" name="bwsmn_form_submit_custom_email" value="submit" />
    620                             <input type="submit" class="button" value="<?php esc_html_e( 'Send to custom email &#187;', 'bws-login-register' ); ?>" />
     851                            <input type="submit" class="button" value="<?php esc_html_e( 'Send to custom email &#187;', 'bestwebsoft' ); ?>" />
    621852                            <input type="text" maxlength="250" value="" name="bwsmn_form_email" />
    622853                            <?php wp_nonce_field( plugin_basename( __FILE__ ), 'bwsmn_nonce_submit_custom_email' ); ?>
     
    657888    }
    658889}
     890
     891if ( ! function_exists( 'bws_get_banner_array' ) ) {
     892    /**
     893     * Get banner array
     894     */
     895    function bws_get_banner_array() {
     896        global $bstwbsftwppdtplgns_banner_array;
     897        $bstwbsftwppdtplgns_banner_array = array(
     898            array( 'gglstpvrfctn_hide_banner_on_plugin_page', 'bws-google-2-step-verification/bws-google-2-step-verification.php', '1.0.0' ),
     899            array( 'sclbttns_hide_banner_on_plugin_page', 'social-buttons-pack/social-buttons-pack.php', '1.1.0' ),
     900            array( 'tmsht_hide_banner_on_plugin_page', 'timesheet/timesheet.php', '0.1.3' ),
     901            array( 'pgntn_hide_banner_on_plugin_page', 'pagination/pagination.php', '1.0.6' ),
     902            array( 'crrntl_hide_banner_on_plugin_page', 'car-rental/car-rental.php', '1.0.0' ),
     903            array( 'lnkdn_hide_banner_on_plugin_page', 'bws-linkedin/bws-linkedin.php', '1.0.1' ),
     904            array( 'pntrst_hide_banner_on_plugin_page', 'bws-pinterest/bws-pinterest.php', '1.0.1' ),
     905            array( 'zndskhc_hide_banner_on_plugin_page', 'zendesk-help-center/zendesk-help-center.php', '1.0.0' ),
     906            array( 'gglcptch_hide_banner_on_plugin_page', 'google-captcha/google-captcha.php', '1.18' ),
     907            array( 'mltlngg_hide_banner_on_plugin_page', 'multilanguage/multilanguage.php', '1.1.1' ),
     908            array( 'adsns_hide_banner_on_plugin_page', 'bws-adsense/bws-adsense.php', '1.36' ),
     909            array( 'vstrsnln_hide_banner_on_plugin_page', 'visitors-online/visitors-online.php', '0.2' ),
     910            array( 'cstmsrch_hide_banner_on_plugin_page', 'custom-search-plugin/custom-search-plugin.php', '1.28' ),
     911            array( 'prtfl_hide_banner_on_plugin_page', 'portfolio/portfolio.php', '2.33' ),
     912            array( 'rlt_hide_banner_on_plugin_page', 'realty/realty.php', '1.0.0' ),
     913            array( 'prmbr_hide_banner_on_plugin_page', 'promobar/promobar.php', '1.0.0' ),
     914            array( 'gglnltcs_hide_banner_on_plugin_page', 'bws-google-analytics/bws-google-analytics.php', '1.6.2' ),
     915            array( 'htccss_hide_banner_on_plugin_page', 'htaccess/htaccess.php', '1.6.3' ),
     916            array( 'sbscrbr_hide_banner_on_plugin_page', 'subscriber/subscriber.php', '1.1.8' ),
     917            array( 'lmtttmpts_hide_banner_on_plugin_page', 'limit-attempts/limit-attempts.php', '1.0.2' ),
     918            array( 'sndr_hide_banner_on_plugin_page', 'sender/sender.php', '0.5' ),
     919            array( 'srrl_hide_banner_on_plugin_page', 'user-role/user-role.php', '1.4' ),
     920            array( 'pdtr_hide_banner_on_plugin_page', 'updater/updater.php', '1.12' ),
     921            array( 'cntctfrmtdb_hide_banner_on_plugin_page', 'contact-form-to-db/contact_form_to_db.php', '1.2' ),
     922            array( 'cntctfrmmlt_hide_banner_on_plugin_page', 'contact-form-multi/contact-form-multi.php', '1.0.7' ),
     923            array( 'gglmps_hide_banner_on_plugin_page', 'bws-google-maps/bws-google-maps.php', '1.2' ),
     924            array( 'fcbkbttn_hide_banner_on_plugin_page', 'facebook-button-plugin/facebook-button-plugin.php', '2.29' ),
     925            array( 'twttr_hide_banner_on_plugin_page', 'twitter-plugin/twitter.php', '2.34' ),
     926            array( 'pdfprnt_hide_banner_on_plugin_page', 'pdf-print/pdf-print.php', '1.7.1' ),
     927            array( 'gglstmp_hide_banner_on_plugin_page', 'google-sitemap-plugin/google-sitemap-plugin.php', '2.8.4' ),
     928            array( 'cntctfrmpr_for_ctfrmtdb_hide_banner_on_plugin_page', 'contact-form-pro/contact_form_pro.php', '1.14' ),
     929            array( 'cntctfrm_hide_banner_on_plugin_page', 'contact-form-plugin/contact_form.php', '3.47' ),
     930            array( 'cptch_hide_banner_on_plugin_page', 'captcha-bws/captcha-bws.php', '3.8.4' ),
     931            array( 'gllr_hide_banner_on_plugin_page', 'gallery-plugin/gallery-plugin.php', '3.9.1' ),
     932            array( 'cntctfrm_for_ctfrmtdb_hide_banner_on_plugin_page', 'contact-form-plugin/contact_form.php', '3.62' ),
     933            array( 'bwscrrntl_hide_banner_on_plugin_page', 'bws-car-rental/bws-car-rental.php', '0.0.1' ),
     934            array( 'rtng_hide_banner_on_plugin_page', 'rating-bws/rating-bws.php', '1.0.0' ),
     935            array( 'prflxtrflds_hide_banner_on_plugin_page', 'profile-extra-fields/profile-extra-fields.php', '1.1.3' ),
     936            array( 'psttcsv_hide_banner_on_plugin_page', 'post-to-csv/post-to-csv.php', '1.3.4' ),
     937            array( 'cstmdmnpg_hide_banner_on_plugin_page', 'custom-admin-page/custom-admin-page.php', '1.0.0' ),
     938        );
     939    }
     940}
  • bws-login-register/trunk/bws_menu/class-bws-settings.php

    r3301452 r3337325  
    104104            $this->link_pn    = $args['link_pn'];
    105105            $this->trial_days = $args['trial_days'];
     106            $this->licenses   = $args['licenses'];
    106107
    107108            $this->pro_page           = '';
     
    122123            }
    123124
     125            $this->hide_pro_tabs = bws_hide_premium_options_check( $this->options );
    124126            $this->version       = '1.0.0';
    125127            $this->is_multisite  = is_multisite();
    126128
     129            if ( empty( $this->pro_page ) && array_key_exists( 'license', $this->tabs ) ) {
     130                $this->is_pro                                        = true;
     131                $this->licenses[ $this->plugins_info['TextDomain'] ] = array(
     132                    'name'     => $this->plugins_info['Name'],
     133                    'slug'     => $this->plugins_info['TextDomain'],
     134                    'basename' => $this->plugin_basename,
     135                );
     136            } else {
     137                $this->licenses[ $this->plugins_info['TextDomain'] ] = array(
     138                    'name'         => $this->plugins_info['Name'],
     139                    'slug'         => $this->plugins_info['TextDomain'],
     140                    'pro_slug'     => substr( $this->bws_license_plugin, 0, stripos( $this->bws_license_plugin, '/' ) ),
     141                    'basename'     => $this->plugin_basename,
     142                    'pro_basename' => $this->bws_license_plugin,
     143                );
     144            }
    127145        }
    128146
     
    145163            $this->display_messages( $save_results );
    146164            if ( isset( $_REQUEST['bws_restore_default'] ) && check_admin_referer( $this->plugin_basename, 'bws_nonce_name' ) ) {
    147                 lgnrgstrfrm_form_restore_default_confirm( $this->plugin_basename );
     165                bws_form_restore_default_confirm( $this->plugin_basename );
     166            } elseif ( isset( $_POST['bws_handle_demo'] ) && check_admin_referer( $this->plugin_basename, 'bws_nonce_name' ) ) {
     167                $this->demo_data->bws_demo_confirm();
    148168            } else {
    149                 lgnrgstrfrm_show_settings_notice(); ?>
     169                bws_show_settings_notice(); ?>
    150170                <form class="bws_form" method="post" action="" enctype="multipart/form-data">
    151171                    <div id="poststuff">
     
    157177                                <div class="meta-box-sortables ui-sortable">
    158178                                    <div id="submitdiv" class="postbox">
    159                                         <h3 class="hndle"><?php esc_html_e( 'Information', 'bws-login-register' ); ?></h3>
     179                                        <h3 class="hndle"><?php esc_html_e( 'Information', 'bestwebsoft' ); ?></h3>
    160180                                        <div class="inside">
    161181                                            <div class="submitbox" id="submitpost">
     
    172192                                                            if ( isset( $bstwbsftwppdtplgns_options['wrong_license_key'][ $this->plugin_basename ] ) || empty( $bstwbsftwppdtplgns_options['time_out'] ) || ! array_key_exists( $this->plugin_basename, $bstwbsftwppdtplgns_options['time_out'] ) ) {
    173193                                                                $license_type   = 'Pro';
    174                                                                 $license_status = __( 'Inactive', 'bws-login-register' ) . ' <a href="#' . $this->prefix . '_license_tab" class="bws_trigger_tab_click">' . __( 'Learn More', 'bws-login-register' ) . '</a>';
     194                                                                $license_status = __( 'Inactive', 'bestwebsoft' ) . ' <a href="#' . $this->prefix . '_license_tab" class="bws_trigger_tab_click">' . __( 'Learn More', 'bestwebsoft' ) . '</a>';
    175195                                                            } else {
    176196                                                                $finish = strtotime( $bstwbsftwppdtplgns_options['time_out'][ $this->plugin_basename ] );
     
    180200
    181201                                                                    if ( $finish < $today ) {
    182                                                                         $license_status = __( 'Expired', 'bws-login-register' );
     202                                                                        $license_status = __( 'Expired', 'bestwebsoft' );
    183203                                                                    } else {
    184204                                                                        $daysleft       = floor( ( $finish - $today ) / ( 60 * 60 * 24 ) );
    185                                                                         $license_status = sprintf( __( '%s day(-s) left', 'bws-login-register' ), $daysleft );
     205                                                                        $license_status = sprintf( __( '%s day(-s) left', 'bestwebsoft' ), $daysleft );
    186206                                                                    }
    187                                                                     $license_status .= '. <a target="_blank" href="' . esc_url( $this->plugins_info['PluginURI'] ) . '">' . __( 'Upgrade to Pro', 'bws-login-register' ) . '</a>';
     207                                                                    $license_status .= '. <a target="_blank" href="' . esc_url( $this->plugins_info['PluginURI'] ) . '">' . __( 'Upgrade to Pro', 'bestwebsoft' ) . '</a>';
    188208                                                                } else {
    189209                                                                    $license_type = isset( $bstwbsftwppdtplgns_options['nonprofit'][ $this->plugin_basename ] ) ? 'Nonprofit Pro' : 'Pro';
    190210                                                                    if ( ! empty( $bstwbsftwppdtplgns_options['time_out'][ $this->plugin_basename ] ) && $finish < $today ) {
    191                                                                         $license_status = sprintf( __( 'Expired on %s', 'bws-login-register' ), $bstwbsftwppdtplgns_options['time_out'][ $this->plugin_basename ] ) . '. <a target="_blank" href="https://support.bestwebsoft.com/entries/53487136">' . __( 'Renew Now', 'bws-login-register' ) . '</a>';
     211                                                                        $license_status = sprintf( __( 'Expired on %s', 'bestwebsoft' ), $bstwbsftwppdtplgns_options['time_out'][ $this->plugin_basename ] ) . '. <a target="_blank" href="https://support.bestwebsoft.com/entries/53487136">' . __( 'Renew Now', 'bestwebsoft' ) . '</a>';
    192212                                                                    } else {
    193                                                                         $license_status = __( 'Active', 'bws-login-register' );
     213                                                                        $license_status = __( 'Active', 'bestwebsoft' );
    194214                                                                    }
    195215                                                                }
     
    197217                                                            ?>
    198218                                                            <div class="misc-pub-section">
    199                                                                 <strong><?php esc_html_e( 'License', 'bws-login-register' ); ?>:</strong> <?php echo esc_attr( $license_type ); ?>
     219                                                                <strong><?php esc_html_e( 'License', 'bestwebsoft' ); ?>:</strong> <?php echo esc_attr( $license_type ); ?>
    200220                                                            </div>
    201221                                                            <div class="misc-pub-section">
    202                                                                 <strong><?php esc_html_e( 'Status', 'bws-login-register' ); ?>:</strong> <?php echo wp_kses_post( $license_status ); ?>
     222                                                                <strong><?php esc_html_e( 'Status', 'bestwebsoft' ); ?>:</strong> <?php echo wp_kses_post( $license_status ); ?>
    203223                                                            </div><!-- .misc-pub-section -->
    204224                                                        <?php } ?>
    205225                                                        <div class="misc-pub-section">
    206                                                             <strong><?php esc_html_e( 'Version', 'bws-login-register' ); ?>:</strong> <?php echo esc_attr( $this->plugins_info['Version'] ); ?>
     226                                                            <strong><?php esc_html_e( 'Version', 'bestwebsoft' ); ?>:</strong> <?php echo esc_attr( $this->plugins_info['Version'] ); ?>
    207227                                                        </div><!-- .misc-pub-section -->
    208228                                                        <?php
     
    218238                                                    <div id="publishing-action">
    219239                                                        <input type="hidden" name="<?php echo esc_attr( $this->prefix ); ?>_form_submit" value="submit" />
    220                                                         <input id="bws-submit-button" type="submit" class="button button-primary button-large" value="<?php esc_html_e( 'Save Changes', 'bws-login-register' ); ?>" />
     240                                                        <input id="bws-submit-button" type="submit" class="button button-primary button-large" value="<?php esc_html_e( 'Save Changes', 'bestwebsoft' ); ?>" />
    221241                                                        <?php wp_nonce_field( $this->plugin_basename, 'bws_nonce_name' ); ?>
    222242                                                    </div>
     
    246266                                ?>
    247267                                <div class="submit">
    248                                     <input type="submit" class="button button-primary button-large" value="<?php esc_html_e( 'Save Changes', 'bws-login-register' ); ?>" />
     268                                    <input type="submit" class="button button-primary button-large" value="<?php esc_html_e( 'Save Changes', 'bestwebsoft' ); ?>" />
    249269                                    <?php wp_nonce_field( $this->plugin_basename, 'bws_nonce_name' ); ?>
    250270                                </div>
     271                                <?php
     272                                if ( ! empty( $this->wp_slug ) ) {
     273                                    bws_plugin_reviews_block( $this->plugins_info['Name'], $this->wp_slug );
     274                                }
     275                                ?>
    251276                            </div>
    252277                        </div>
     
    289314        private function display_tabs_list() {
    290315            foreach ( $this->tabs as $tab_slug => $data ) {
     316                if ( ! empty( $data['is_pro'] ) && $this->hide_pro_tabs ) {
     317                    continue;
     318                }
    291319                $tab_class = 'bws-tab-' . $tab_slug;
     320                if ( ! empty( $data['is_pro'] ) ) {
     321                    $tab_class .= ' bws_pro_tab';
     322                }
    292323                if ( ! empty( $data['class'] ) ) {
    293324                    $tab_class .= ' ' . $data['class'];
     
    310341        public function display_tabs_content() {
    311342            foreach ( $this->tabs as $tab_slug => $data ) {
     343                if ( ! empty( $data['is_pro'] ) && $this->hide_pro_tabs ) {
     344                    continue;
     345                }
    312346                ?>
    313347                <div class="bws_tab ui-tabs-panel ui-widget-content ui-corner-bottom" id="<?php echo esc_attr( $this->prefix . '_' . $tab_slug . '_tab' ); ?>" aria-labelledby="ui-id-2" role="tabpanel" aria-hidden="false" style="display: block;">
     
    337371            if ( isset( $_POST['bws_restore_confirm'] ) && check_admin_referer( $this->plugin_basename, 'bws_settings_nonce_name' ) ) {
    338372                $this->restore_options();
    339                 $message = __( 'All plugin settings were restored.', 'bws-login-register' );
    340             } elseif ( ! isset( $_REQUEST['bws_restore_default'] ) && isset( $_REQUEST[ $this->prefix . '_form_submit' ] ) && check_admin_referer( $this->plugin_basename, 'bws_nonce_name' ) ) {
    341                 /* save tabs */
    342                 $result = $this->save_options();
     373                $message = __( 'All plugin settings were restored.', 'bestwebsoft' );
     374                /* Go Pro - check license key */
     375            } elseif ( isset( $_POST['bws_license_submit'] ) && check_admin_referer( $this->plugin_basename, 'bws_nonce_name' ) ) {
     376                $result = $this->save_options_license_key();
     377                if ( ! empty( $result['empty_field_error'] ) ) {
     378                    $error = $result['empty_field_error'];
     379                }
    343380                if ( ! empty( $result['error'] ) ) {
    344381                    $error = $result['error'];
     
    349386                if ( ! empty( $result['notice'] ) ) {
    350387                    $notice = $result['notice'];
     388                }
     389                /* check demo data */
     390            } else {
     391                $demo_result = ! empty( $this->demo_data ) ? $this->demo_data->bws_handle_demo_data() : false;
     392                if ( false !== $demo_result ) {
     393                    if ( ! empty( $demo_result ) && is_array( $demo_result ) ) {
     394                        $error   = $demo_result['error'];
     395                        $message = $demo_result['done'];
     396                        if ( ! empty( $demo_result['done'] ) && ! empty( $demo_result['options'] ) ) {
     397                            $this->options = $demo_result['options'];
     398                        }
     399                    }
     400                    /* Save options */
     401                } elseif ( ! isset( $_REQUEST['bws_restore_default'] ) && ! isset( $_POST['bws_handle_demo'] ) && isset( $_REQUEST[ $this->prefix . '_form_submit' ] ) && check_admin_referer( $this->plugin_basename, 'bws_nonce_name' ) ) {
     402                    /* save tabs */
     403                    $result = $this->save_options();
     404                    if ( ! empty( $result['error'] ) ) {
     405                        $error = $result['error'];
     406                    }
     407                    if ( ! empty( $result['message'] ) ) {
     408                        $message = $result['message'];
     409                    }
     410                    if ( ! empty( $result['notice'] ) ) {
     411                        $notice = $result['notice'];
     412                    }
     413
     414                    if ( '' === $this->change_permission_attr ) {
     415                        /* save `misc` tab */
     416                        $result = $this->save_options_misc();
     417                        if ( ! empty( $result['notice'] ) ) {
     418                            $notice .= $result['notice'];
     419                        }
     420                    }
    351421                }
    352422            }
     
    404474
    405475        /**
     476         * Get 'custom_code' status and content
     477         *
     478         * @access private
     479         */
     480        private function get_custom_code() {
     481            global $bstwbsftwppdtplgns_options, $wp_filesystem;
     482
     483            $this->custom_code_args = array(
     484                'is_css_active' => false,
     485                'content_css'   => '',
     486                'css_writeable' => false,
     487                'is_php_active' => false,
     488                'content_php'   => '',
     489                'php_writeable' => false,
     490                'is_js_active'  => false,
     491                'content_js'    => '',
     492                'js_writeable'  => false,
     493            );
     494
     495            if ( ! $this->upload_dir ) {
     496                $this->upload_dir = wp_upload_dir();
     497            }
     498
     499            $folder = $this->upload_dir['basedir'] . '/bws-custom-code';
     500
     501            if ( $this->is_multisite ) {
     502                $this->custom_code_args['blog_id'] = get_current_blog_id();
     503            }
     504
     505            WP_Filesystem();
     506
     507            foreach ( array( 'css', 'php', 'js' ) as $extension ) {
     508                $file      = 'bws-custom-code.' . $extension;
     509                $real_file = $folder . '/' . $file;
     510
     511                if ( $wp_filesystem->exists( $real_file ) ) {
     512                    update_recently_edited( $real_file );
     513                    $this->custom_code_args[ "content_{$extension}" ] = $wp_filesystem->get_contents( $real_file );
     514                    if ( ( $this->is_multisite && isset( $bstwbsftwppdtplgns_options['custom_code'][ $this->custom_code_args['blog_id'] ][ $file ] ) ) ||
     515                        ( ! $this->is_multisite && isset( $bstwbsftwppdtplgns_options['custom_code'][ $file ] ) ) ) {
     516                        $this->custom_code_args[ "is_{$extension}_active" ] = true;
     517                    }
     518                    if ( is_writeable( $real_file ) ) {
     519                        $this->custom_code_args[ "{$extension}_writeable" ] = true;
     520                    }
     521                } else {
     522                    $this->custom_code_args[ "{$extension}_writeable" ] = true;
     523                    if ( 'php' === $extension ) {
     524                        $this->custom_code_args[ "content_{$extension}" ] = '<?php' . "\n" . "if ( ! defined( 'ABSPATH' ) ) exit;" . "\n" . "if ( ! defined( 'BWS_GLOBAL' ) ) exit;" . "\n\n" . '/* Start your code here */' . "\n";
     525                    }
     526                }
     527            }
     528        }
     529
     530        /**
     531         * Display 'custom_code' tab
     532         *
     533         * @access private
     534         */
     535        private function tab_custom_code() {
     536            global $bstwbsftwppdtplgns_options, $wp_version;
     537            ?>
     538            <h3 class="bws_tab_label"><?php esc_html_e( 'Custom Code', 'bestwebsoft' ); ?></h3>
     539            <?php
     540            $this->help_phrase();
     541            $bws_hide_premium = bws_hide_premium_options_check( $bstwbsftwppdtplgns_options );
     542            ?>
     543            <hr>
     544            <h4><?php esc_html_e( 'The ability to add custom code is available in the Pro version. If the Pro version is not available please contact us via Help Center', 'bestwebsoft' ); ?> (<a href="<?php echo esc_url( 'https://support.bestwebsoft.com/hc/en-us/requests/new' ); ?>"><?php echo esc_url( 'https://support.bestwebsoft.com/hc/en-us/requests/new' ); ?></a>)</h4>
     545            <?php
     546            if ( ! $bws_hide_premium ) {
     547                ?>
     548                <div class="bws_pro_version_bloc pdfprnt-pro-feature">
     549                    <div class="bws_pro_version_table_bloc">
     550                        <button type="submit" name="bws_hide_premium_options" class="notice-dismiss bws_hide_premium_options" title="Close"></button>
     551                        <div class="bws_table_bg"></div>
     552                        <div class="bws_pro_version">
     553                            <?php
     554                            if ( ! current_user_can( 'edit_plugins' ) ) {
     555                                echo '<p>' . esc_html__( 'You do not have sufficient permissions to edit plugins for this site.', 'bestwebsoft' ) . '</p>';
     556                                return;
     557                            }
     558
     559                            $list = array(
     560                                'css' => array(
     561                                    'description'     => __( 'These styles will be added to the header on all pages of your site.', 'bestwebsoft' ),
     562                                    'learn_more_link' => 'https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_started',
     563                                ),
     564                                'php' => array(
     565                                    'description'     => sprintf( __( 'This PHP code will be hooked to the %s Action and will be printed on front end only.', 'bestwebsoft' ), '<a href="https://codex.wordpress.org/Plugin_API/Action_Reference/init" target="_blank"><code>init</code></a>' ),
     566                                    'learn_more_link' => 'https://php.net/',
     567                                ),
     568                                'js'  => array(
     569                                    'description'     => __( 'These code will be added to the header on all pages of your site.', 'bestwebsoft' ),
     570                                    'learn_more_link' => 'https://developer.mozilla.org/en-US/docs/Web/JavaScript',
     571                                ),
     572                            );
     573
     574                            foreach ( $list as $extension => $extension_data ) {
     575                                $name = 'js' === $extension ? 'JavaScript' : strtoupper( $extension );
     576                                ?>
     577                                <p><big>
     578                                        <strong><?php echo esc_html( $name ); ?></strong>
     579                                        <?php
     580                                        if ( ! $this->custom_code_args[ "{$extension}_writeable" ] ) {
     581                                            echo '(' . esc_html__( 'Browsing', 'bestwebsoft' ) . ')';
     582                                        }
     583                                        ?>
     584                                    </big>
     585                                </p>
     586                                <p class="bws_info">
     587                                    <label>
     588                                        <input type="checkbox" value="1"
     589                                            <?php
     590                                            if ( $this->custom_code_args[ "is_{$extension}_active" ] ) {
     591                                                echo 'checked';
     592                                            }
     593                                            ?>
     594                                         />
     595                                        <?php printf( esc_html__( 'Activate custom %s code.', 'bestwebsoft' ), esc_html( $name ) ); ?>
     596                                    </label>
     597                                </p>
     598                                <textarea cols="70" rows="25" id="bws_newcontent_<?php echo esc_attr( $extension ); ?>" disabled="disabled"><?php
     599                                if ( isset( $this->custom_code_args[ "content_{$extension}" ] ) ) {
     600                                    echo esc_html( stripslashes_deep( $this->custom_code_args[ "content_{$extension}" ] ) ); }
     601                                ?></textarea>
     602                                <p class="bws_info">
     603                                    <?php echo wp_kses_post( $extension_data['description'] ); ?>
     604                                    <br>
     605                                    <a href="<?php echo esc_url( $extension_data['learn_more_link'] ); ?>" target="_blank">
     606                                        <?php printf( esc_html__( 'Learn more about %s', 'bestwebsoft' ), esc_html( $name ) ); ?>
     607                                    </a>
     608                                </p>
     609                                <?php
     610                            }
     611                            ?>
     612                        </div>
     613                    </div>
     614                    <div class="bws_pro_version_tooltip">
     615                        <a class="bws_button" href="<?php echo esc_url( $this->plugins_info['PluginURI'] ); ?>?k=<?php echo esc_attr( $this->link_key ); ?>&amp;pn=<?php echo esc_attr( $this->link_pn ); ?>&amp;v=<?php echo esc_attr( $this->plugins_info['Version'] ); ?>&amp;wp_v=<?php echo esc_attr( $wp_version ); ?>" target="_blank" title="<?php echo esc_html( $this->plugins_info['Name'] ); ?>">Upgrade to Pro</a>
     616                        <div class="clear"></div>
     617                    </div>
     618                </div>
     619                <?php
     620            } else {
     621                ?>
     622                <div class="bws_pro_version_tooltip">
     623                    <a class="bws_button" href="<?php echo esc_url( $this->plugins_info['PluginURI'] ); ?>?k=<?php echo esc_attr( $this->link_key ); ?>&amp;pn=<?php echo esc_attr( $this->link_pn ); ?>&amp;v=<?php echo esc_attr( $this->plugins_info['Version'] ); ?>&amp;wp_v=<?php echo esc_attr( $wp_version ); ?>" target="_blank" title="<?php echo esc_html( $this->plugins_info['Name'] ); ?>">Upgrade to Pro</a>
     624                    <div class="clear"></div>
     625                </div>
     626                <?php
     627            }
     628        }
     629
     630        /**
    406631         * Display 'misc' tab
    407632         *
     
    411636            global $bstwbsftwppdtplgns_options;
    412637            ?>
    413             <h3 class="bws_tab_label"><?php esc_html_e( 'Miscellaneous Settings', 'bws-login-register' ); ?></h3>
     638            <h3 class="bws_tab_label"><?php esc_html_e( 'Miscellaneous Settings', 'bestwebsoft' ); ?></h3>
    414639            <?php $this->help_phrase(); ?>
    415640            <hr>
     
    419644             */
    420645            do_action( __CLASS__ . '_additional_misc_options' );
    421             ?>
    422             <table class="form-table">
     646
     647            if ( ! $this->forbid_view && ! empty( $this->change_permission_attr ) ) {
     648                ?>
     649                <div class="error inline bws_visible"><p><strong><?php esc_html_e( 'Notice', 'bestwebsoft' ); ?>:</strong> <strong><?php printf( esc_html__( 'It is prohibited to change %1$s settings on this site in the %2$s network settings.', 'bestwebsoft' ), esc_html( $this->plugins_info['Name'] ), esc_html( $this->plugins_info['Name'] ) ); ?></strong></p></div>
    423650                <?php
    424                 /**
    425                  * Action - Display custom options on the 'misc' tab
    426                  */
    427                 do_action( __CLASS__ . '_additional_misc_options_affected' );
     651            }
     652            if ( $this->forbid_view ) {
    428653                ?>
    429                 <tr>
    430                     <th scope="row"><?php esc_html_e( 'Default Settings', 'bws-login-register' ); ?></th>
    431                     <td>
    432                         <input<?php echo esc_attr( wp_kses_data( $this->change_permission_attr ) ); ?> name="bws_restore_default" type="submit" class="button" value="<?php esc_html_e( 'Restore Settings', 'bws-login-register' ); ?>" />
    433                         <div class="bws_info"><?php esc_html_e( 'This will restore plugin settings to defaults.', 'bws-login-register' ); ?></div>
    434                     </td>
    435                 </tr>
    436             </table>
    437             <?php
     654                <div class="error inline bws_visible"><p><strong><?php esc_html_e( 'Notice', 'bestwebsoft' ); ?>:</strong> <strong><?php printf( esc_html__( 'It is prohibited to view %1$s settings on this site in the %2$s network settings.', 'bestwebsoft' ), esc_html( $this->plugins_info['Name'] ), esc_html( $this->plugins_info['Name'] ) ); ?></strong></p></div>
     655            <?php } else { ?>
     656                <table class="form-table">
     657                    <?php
     658                    /**
     659                     * Action - Display custom options on the 'misc' tab
     660                     */
     661                    do_action( __CLASS__ . '_additional_misc_options_affected' );
     662                    if ( ! empty( $this->pro_page ) && $this->bws_hide_pro_option_exist ) {
     663                        ?>
     664                        <tr>
     665                            <th scope="row"><?php esc_html_e( 'Pro Options', 'bestwebsoft' ); ?></th>
     666                            <td>
     667                                <label>
     668                                    <input <?php echo esc_attr( wp_kses_data( $this->change_permission_attr ) ); ?> name="bws_hide_premium_options_submit" type="checkbox" value="1"
     669                                        <?php
     670                                        if ( ! $this->hide_pro_tabs ) {
     671                                            echo 'checked="checked "';
     672                                        }
     673                                        ?>
     674                                    />
     675                                    <span class="bws_info"><?php esc_html_e( 'Enable to display plugin Pro options.', 'bestwebsoft' ); ?></span>
     676                                </label>
     677                            </td>
     678                        </tr>
     679                    <?php } ?>
     680                    <tr>
     681                        <th scope="row"><?php esc_html_e( 'Track Usage', 'bestwebsoft' ); ?></th>
     682                        <td>
     683                            <label>
     684                                <input <?php echo esc_attr( wp_kses_data( $this->change_permission_attr ) ); ?> name="bws_track_usage" type="checkbox" value="1"
     685                                    <?php
     686                                    if ( ! empty( $bstwbsftwppdtplgns_options['track_usage']['products'][ $this->plugin_basename ] ) ) {
     687                                        echo 'checked="checked "';
     688                                    }
     689                                    ?>
     690                                />
     691                                <span class="bws_info"><?php esc_html_e( 'Enable to allow tracking plugin usage anonymously in order to make it better.', 'bestwebsoft' ); ?></span>
     692                            </label>
     693                        </td>
     694                    </tr>
     695                    <tr>
     696                        <th scope="row"><?php esc_html_e( 'Default Settings', 'bestwebsoft' ); ?></th>
     697                        <td>
     698                            <input<?php echo esc_attr( wp_kses_data( $this->change_permission_attr ) ); ?> name="bws_restore_default" type="submit" class="button" value="<?php esc_html_e( 'Restore Settings', 'bestwebsoft' ); ?>" />
     699                            <div class="bws_info"><?php esc_html_e( 'This will restore plugin settings to defaults.', 'bestwebsoft' ); ?></div>
     700                        </td>
     701                    </tr>
     702                </table>
     703                <?php
     704            }
    438705        }
    439706
     
    445712        public function tab_import_export() {
    446713            ?>
    447             <h3 class="bws_tab_label"><?php esc_html_e( 'Import / Export', 'bws-login-register' ); ?></h3>
     714            <h3 class="bws_tab_label"><?php esc_html_e( 'Import / Export', 'bestwebsoft' ); ?></h3>
    448715            <?php $this->help_phrase(); ?>
    449716            <hr>
     
    456723            if ( ! $this->forbid_view && ! empty( $this->change_permission_attr ) ) {
    457724                ?>
    458                 <div class="error inline bws_visible"><p><strong><?php esc_html_e( 'Notice', 'bws-login-register' ); ?>:</strong> <strong><?php printf( esc_html__( 'It is prohibited to change %1$s settings on this site in the %2$s network settings.', 'bws-login-register' ), esc_html( $this->plugins_info['Name'] ), esc_html( $this->plugins_info['Name'] ) ); ?></strong></p></div>
     725                <div class="error inline bws_visible"><p><strong><?php esc_html_e( 'Notice', 'bestwebsoft' ); ?>:</strong> <strong><?php printf( esc_html__( 'It is prohibited to change %1$s settings on this site in the %2$s network settings.', 'bestwebsoft' ), esc_html( $this->plugins_info['Name'] ), esc_html( $this->plugins_info['Name'] ) ); ?></strong></p></div>
    459726                <?php
    460727            }
    461728            if ( $this->forbid_view ) {
    462729                ?>
    463                 <div class="error inline bws_visible"><p><strong><?php esc_html_e( 'Notice', 'bws-login-register' ); ?>:</strong> <strong><?php printf( esc_html__( 'It is prohibited to view %1$s settings on this site in the %2$s network settings.', 'bws-login-register' ), esc_html( $this->plugins_info['Name'] ), esc_html( $this->plugins_info['Name'] ) ); ?></strong></p></div>
     730                <div class="error inline bws_visible"><p><strong><?php esc_html_e( 'Notice', 'bestwebsoft' ); ?>:</strong> <strong><?php printf( esc_html__( 'It is prohibited to view %1$s settings on this site in the %2$s network settings.', 'bestwebsoft' ), esc_html( $this->plugins_info['Name'] ), esc_html( $this->plugins_info['Name'] ) ); ?></strong></p></div>
    464731            <?php } else { ?>
    465732                <table class="form-table">
     
    481748         */
    482749        private function save_options_misc() {
     750            global $bstwbsftwppdtplgns_options, $wp_version;
    483751            $notice = '';
    484752
     753            /* hide premium options */
     754            if ( ! empty( $this->pro_page ) ) {
     755                if ( isset( $_POST['bws_hide_premium_options'] ) && check_admin_referer( $this->plugin_basename, 'bws_nonce_name' ) ) {
     756                    $hide_result         = bws_hide_premium_options( $this->options );
     757                    $this->hide_pro_tabs = true;
     758                    $this->options       = $hide_result['options'];
     759                    if ( ! empty( $hide_result['message'] ) ) {
     760                        $notice = $hide_result['message'];
     761                    }
     762                    if ( $this->is_network_options ) {
     763                        update_site_option( $this->prefix . '_options', $this->options );
     764                    } else {
     765                        update_option( $this->prefix . '_options', $this->options );
     766                    }
     767                } elseif ( isset( $_POST['bws_hide_premium_options_submit'] ) && check_admin_referer( $this->plugin_basename, 'bws_nonce_name' ) ) {
     768                    if ( ! empty( $this->options['hide_premium_options'] ) ) {
     769                        $key = array_search( get_current_user_id(), $this->options['hide_premium_options'] );
     770                        if ( false !== $key ) {
     771                            unset( $this->options['hide_premium_options'][ $key ] );
     772                        }
     773                        if ( $this->is_network_options ) {
     774                            update_site_option( $this->prefix . '_options', $this->options );
     775                        } else {
     776                            update_option( $this->prefix . '_options', $this->options );
     777                        }
     778                    }
     779                    $this->hide_pro_tabs = false;
     780                } else {
     781                    if ( empty( $this->options['hide_premium_options'] ) ) {
     782                        $this->options['hide_premium_options'][] = get_current_user_id();
     783                        if ( $this->is_network_options ) {
     784                            update_site_option( $this->prefix . '_options', $this->options );
     785                        } else {
     786                            update_option( $this->prefix . '_options', $this->options );
     787                        }
     788                    }
     789                    $this->hide_pro_tabs = true;
     790                }
     791            }
     792            /* Save 'Track Usage' option */
     793            if ( isset( $_POST['bws_track_usage'] ) && check_admin_referer( $this->plugin_basename, 'bws_nonce_name' ) ) {
     794                if ( empty( $bstwbsftwppdtplgns_options['track_usage']['products'][ $this->plugin_basename ] ) ) {
     795                    $bstwbsftwppdtplgns_options['track_usage']['products'][ $this->plugin_basename ] = true;
     796                    $track_usage = true;
     797                }
     798            } else {
     799                if ( ! empty( $bstwbsftwppdtplgns_options['track_usage']['products'][ $this->plugin_basename ] ) ) {
     800                    unset( $bstwbsftwppdtplgns_options['track_usage']['products'][ $this->plugin_basename ] );
     801                    false;
     802                    $track_usage = false;
     803                }
     804            }
     805            if ( isset( $track_usage ) ) {
     806                $usage_id = ! empty( $bstwbsftwppdtplgns_options['track_usage']['usage_id'] ) ? $bstwbsftwppdtplgns_options['track_usage']['usage_id'] : false;
     807                /* send data */
     808                $options      = array(
     809                    'timeout'    => 3,
     810                    'body'       => array(
     811                        'url'        => get_bloginfo( 'url' ),
     812                        'wp_version' => $wp_version,
     813                        'is_active'  => $track_usage,
     814                        'product'    => $this->plugin_basename,
     815                        'version'    => $this->plugins_info['Version'],
     816                        'usage_id'   => $usage_id,
     817                    ),
     818                    'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ),
     819                );
     820                $raw_response = wp_remote_post( 'https://bestwebsoft.com/wp-content/plugins/products-statistics/track-usage/', $options );
     821
     822                if ( ! is_wp_error( $raw_response ) && 200 === intval( wp_remote_retrieve_response_code( $raw_response ) ) ) {
     823                    $response = maybe_unserialize( wp_remote_retrieve_body( $raw_response ) );
     824
     825                    if ( is_array( $response ) &&
     826                        ! empty( $response['usage_id'] ) &&
     827                        $response['usage_id'] !== $usage_id ) {
     828                        $bstwbsftwppdtplgns_options['track_usage']['usage_id'] = $response['usage_id'];
     829                    }
     830                }
     831
     832                if ( $this->is_multisite ) {
     833                    update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     834                } else {
     835                    update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     836                }
     837            }
     838
    485839            return compact( 'notice' );
     840        }
     841
     842        /**
     843         *
     844         */
     845        public function tab_license() {
     846            global $wp_version, $bstwbsftwppdtplgns_options;
     847            ?>
     848            <h3 class="bws_tab_label"><?php esc_html_e( 'License Key', 'bestwebsoft' ); ?></h3>
     849            <?php $this->help_phrase(); ?>
     850            <hr>
     851            <?php
     852            foreach ( $this->licenses as $single_license ) {
     853                $pro_plugin_name = ( strpos( $single_license['name'], 'Pro' ) ) ? $single_license['name'] : $single_license['name'] . ' Pro';
     854                if ( ! empty( $this->pro_page ) || ! empty( $single_license['pro_basename'] ) ) {
     855
     856                    if ( $this->pro_plugin_is_activated && ( empty( $single_license['pro_basename'] ) || isset( $this->bws_license_plugin ) ) ) {
     857                        $url = 'https://bestwebsoft.com/wp-content/plugins/paid-products/plugins/downloads/?bws_first_download=' . $this->bws_license_plugin . '&bws_license_key=' . $bstwbsftwppdtplgns_options[ $this->bws_license_plugin ] . '&download_from=5';
     858                        ?>
     859                        <table class="form-table">
     860                            <tr>
     861                                <th scope="row"><?php echo wp_kses_data( $pro_plugin_name ) . ' License'; ?></th>
     862                                <td>
     863                                    <p>
     864                                        <strong><?php esc_html_e( 'Your Pro plugin is ready', 'bestwebsoft' ); ?></strong>
     865                                        <br>
     866                                        <?php esc_html_e( 'Your plugin has been zipped, and now is ready to download.', 'bestwebsoft' ); ?>
     867                                    </p>
     868                                    <p>
     869                                        <a class="button button-secondary" target="_parent" href="<?php echo esc_url( $url ); ?>"><?php esc_html_e( 'Download Now', 'bestwebsoft' ); ?></a>
     870                                    </p>
     871                                    <br>
     872                                    <p>
     873                                        <strong><?php esc_html_e( 'Need help installing the plugin?', 'bestwebsoft' ); ?></strong>
     874                                        <br>
     875                                        <a target="_blank" href="https://bestwebsoft.com/documentation/how-to-install-a-wordpress-product/how-to-install-a-wordpress-plugin/"><?php esc_html_e( 'How to install WordPress plugin from your admin Dashboard (ZIP archive)', 'bestwebsoft' ); ?></a>
     876                                    </p>
     877                                    <br>                   
     878                                    <p>
     879                                        <strong><?php esc_html_e( 'Get Started', 'bestwebsoft' ); ?></strong>
     880                                        <br>
     881                                        <a target="_blank" href="https://bestwebsoft.com/documentation/"><?php esc_html_e( 'Documentation', 'bestwebsoft' ); ?></a>
     882                                        <br>
     883                                        <a target="_blank" href="https://www.youtube.com/user/bestwebsoft"><?php esc_html_e( 'Video Instructions', 'bestwebsoft' ); ?></a>
     884                                        <br>
     885                                        <a target="_blank" href="https://support.bestwebsoft.com"><?php esc_html_e( 'Knowledge Base', 'bestwebsoft' ); ?></a>
     886                                    </p>
     887                                </td>
     888                            </tr>
     889                        </table>
     890                        <?php
     891                    } else {
     892                        $attr        = '';
     893                        $license_key = '';
     894                        if ( isset( $bstwbsftwppdtplgns_options['go_pro'][ $this->bws_license_plugin ]['count'] ) &&
     895                            '5' < $bstwbsftwppdtplgns_options['go_pro'][ $this->bws_license_plugin ]['count'] &&
     896                            $bstwbsftwppdtplgns_options['go_pro'][ $this->bws_license_plugin ]['time'] > ( time() - ( 24 * 60 * 60 ) ) ) {
     897                            $attr = 'disabled="disabled"';
     898                        }
     899
     900                        if ( ! empty( $single_license['pro_basename'] ) ) {
     901                            $license_key = ! empty( $bstwbsftwppdtplgns_options[ $single_license['pro_basename'] ] ) ? $bstwbsftwppdtplgns_options[ $single_license['pro_basename'] ] : '';
     902                        }
     903                        ?>
     904                        <table class="form-table">
     905                            <tr>
     906                                <th scope="row"><?php echo esc_html( $pro_plugin_name ) . ' License'; ?></th>
     907                                <td>
     908                                    <input <?php echo wp_kses_data( $attr ); ?> type="text" name="bws_license_key_<?php echo esc_attr( ( ! empty( $single_license['pro_slug'] ) ) ? $single_license['pro_slug'] : $single_license['slug'] ); ?>" value="<?php echo esc_attr( $license_key ); ?>" />
     909                                    <input <?php echo wp_kses_data( $attr ); ?> type="hidden" name="bws_license_plugin_<?php echo esc_attr( ( ! empty( $single_license['pro_slug'] ) ) ? $single_license['pro_slug'] : $single_license['slug'] ); ?>" value="<?php echo esc_attr( ( ! empty( $single_license['pro_slug'] ) ) ? $single_license['pro_slug'] : $single_license['slug'] ); ?>" />
     910                                    <input <?php echo wp_kses_data( $attr ); ?> type="submit" class="button button-secondary" name="bws_license_submit" value="<?php esc_html_e( 'Activate', 'bestwebsoft' ); ?>" />
     911                                    <input type="hidden" name="_wpnonce" value="<?php echo esc_attr( wp_create_nonce( 'bws_license_key_nonce' ) ); ?>" />
     912                                    <div class="bws_info">
     913                                        <?php printf( esc_html__( 'Enter your license key to activate %s and get premium plugin features.', 'bestwebsoft' ), '<a href="' . esc_url( $this->bws_plugin_link ) . '" target="_blank" title="' . esc_html( $pro_plugin_name ) . '">' . esc_html( $pro_plugin_name ) . '</a>' ); ?>
     914                                    </div>
     915                                    <?php if ( '' !== $attr ) { ?>
     916                                        <p><?php esc_html_e( 'Unfortunately, you have exceeded the number of available tries per day. Please, upload the plugin manually.', 'bestwebsoft' ); ?></p>
     917                                        <?php
     918                                    }
     919                                    if ( false !== $this->trial_days ) {
     920                                        echo '<p>' . esc_html__( 'or', 'bestwebsoft' ) . ' <a href="' . esc_url( $this->plugins_info['PluginURI'] . 'trial/?k=' . $this->link_key . '&pn=' . $this->link_pn . '&v=' . $this->plugins_info['Version'] . '&wp_v=' . $wp_version ) . '" target="_blank">' . sprintf( esc_html__( 'Start Your Free %s-Day Trial Now', 'bestwebsoft' ), esc_attr( $this->trial_days ) ) . '</a></p>';
     921                                    }
     922                                    ?>
     923                                </td>
     924                            </tr>
     925                        </table>
     926                        <?php
     927                    }
     928                } else {
     929                    global $bstwbsftwppdtplgns_options;
     930                    $license_key = ( isset( $bstwbsftwppdtplgns_options[ $single_license['basename'] ] ) ) ? $bstwbsftwppdtplgns_options[ $single_license['basename'] ] : '';
     931                    ?>
     932                    <table class="form-table">
     933                        <tr>
     934                            <th scope="row"><?php echo esc_html( $pro_plugin_name ) . ' License'; ?></th>
     935                            <td>
     936                                <input type="text" maxlength="100" name="bws_license_key_<?php echo esc_attr( $single_license['slug'] ); ?>" value="<?php echo esc_attr( $license_key ); ?>" />
     937                                <input type="submit" class="button button-secondary" name="bws_license_submit" value="<?php esc_html_e( 'Check license key', 'bestwebsoft' ); ?>" />
     938                                <div class="bws_info">
     939                                    <?php esc_html_e( 'If necessary, you can check if the license key is correct or reenter it in the field below.', 'bestwebsoft' ); ?>
     940                                </div>
     941                            </td>
     942                        </tr>
     943                    </table>
     944                    <?php
     945                }
     946            }
     947            ?>
     948            <table class="form-table">
     949                <tr>
     950                    <th scope="row"><?php esc_html_e( 'Manage License Settings', 'bestwebsoft' ); ?></th>
     951                    <td>
     952                        <a class="button button-secondary" href="https://bestwebsoft.com/client-area" target="_blank"><?php esc_html_e( 'Login to Client Area', 'bestwebsoft' ); ?></a>
     953                        <div class="bws_info">
     954                            <?php esc_html_e( 'Manage active licenses, download BWS products, and view your payment history using BestWebSoft Client Area.', 'bestwebsoft' ); ?>
     955                        </div>
     956                    </td>
     957                </tr>
     958            </table>
     959            <?php
     960        }
     961
     962        /**
     963         * Save plugin options to the database
     964         *
     965         * @access private
     966         * @param  ab
     967         * @return array    The Action results
     968         */
     969        private function save_options_license_key() {
     970            global $wp_version, $bstwbsftwppdtplgns_options, $wp_filesystem;
     971            /*$empty_field_error - added to avoid error when 1 field is empty while another field contains license key*/
     972
     973            $error             = '';
     974            $message           = '';
     975            $empty_field_error = '';
     976
     977            if ( ! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ), 'bws_license_key_nonce' ) ) {
     978                    die( esc_html__( 'Security check', 'bestwebsoft' ) );
     979            } else {
     980
     981                foreach ( $this->licenses as $single_license ) {
     982                    $bws_license_key = ( isset( $_POST[ ( ! empty( $single_license['pro_slug'] ) ) ? 'bws_license_key_' . $single_license['pro_slug'] : 'bws_license_key_' . $single_license['slug'] ] ) ) ? sanitize_text_field( wp_unslash( $_POST[ ( ! empty( $single_license['pro_slug'] ) ) ? 'bws_license_key_' . $single_license['pro_slug'] : 'bws_license_key_' . $single_license['slug'] ] ) ) : '';
     983                    if ( '' !== $bws_license_key ) {
     984                        if ( strlen( $bws_license_key ) !== 18 ) {
     985                            $error = __( 'Wrong license key', 'bestwebsoft' );
     986                        } else {
     987                            /* CHECK license key */
     988                            if ( $this->is_pro && empty( $single_license['pro_basename'] ) ) {
     989                                delete_transient( 'bws_plugins_update' );
     990                                if ( ! $this->all_plugins ) {
     991                                    if ( ! function_exists( 'get_plugins' ) ) {
     992                                        require_once ABSPATH . 'wp-admin/includes/plugin.php';
     993                                    }
     994                                    $this->all_plugins = get_plugins();
     995                                }
     996                                $current = get_site_transient( 'update_plugins' );
     997
     998                                if ( ! empty( $this->all_plugins ) && ! empty( $current ) && isset( $current->response ) && is_array( $current->response ) ) {
     999                                    $to_send = array();
     1000                                    $to_send['plugins'][ $single_license['basename'] ]                       = $this->all_plugins[ $single_license['basename'] ];
     1001                                    $to_send['plugins'][ $single_license['basename'] ]['bws_license_key']    = $bws_license_key;
     1002                                    $to_send['plugins'][ $single_license['basename'] ]['bws_illegal_client'] = true;
     1003                                    $options      = array(
     1004                                        'timeout'    => ( ( defined( 'DOING_CRON' ) && DOING_CRON ) ? 30 : 3 ),
     1005                                        'body'       => array( 'plugins' => serialize( $to_send ) ),
     1006                                        'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ),
     1007                                    );
     1008                                    $raw_response = wp_remote_post( 'https://bestwebsoft.com/wp-content/plugins/paid-products/plugins/pro-license-check/1.0/', $options );
     1009
     1010                                    if ( is_wp_error( $raw_response ) || 200 !== intval( wp_remote_retrieve_response_code( $raw_response ) ) ) {
     1011                                        $error = __( 'Something went wrong. Please try again later. If the error appears again, please contact us', 'bestwebsoft' ) . ': <a href=https://support.bestwebsoft.com>BestWebSoft</a>. ' . __( 'We are sorry for inconvenience.', 'bestwebsoft' );
     1012                                    } else {
     1013                                        $response = maybe_unserialize( wp_remote_retrieve_body( $raw_response ) );
     1014                                        if ( is_array( $response ) && ! empty( $response ) ) {
     1015                                            foreach ( $response as $single_response ) {
     1016                                                if ( 'wrong_license_key' === $single_response->package ) {
     1017                                                    $error = __( 'Wrong license key.', 'bestwebsoft' );
     1018                                                } elseif ( 'wrong_domain' === $single_response->package ) {
     1019                                                    $error = __( 'This license key is bound to another site.', 'bestwebsoft' );
     1020                                                } elseif ( 'time_out' === $single_response->package ) {
     1021                                                    $message = __( 'This license key is valid, but Your license has expired. If you want to update our plugin in future, you should extend the license.', 'bestwebsoft' );
     1022                                                } elseif ( 'you_are_banned' === $single_response->package ) {
     1023                                                    $error = __( 'Unfortunately, you have exceeded the number of available tries.', 'bestwebsoft' );
     1024                                                } elseif ( 'duplicate_domen_for_trial' === $single_response->package ) {
     1025                                                    $error = __( 'Unfortunately, the Pro Trial licence was already installed to this domain. The Pro Trial license can be installed only once.', 'bestwebsoft' );
     1026                                                }
     1027                                                if ( empty( $error ) ) {
     1028                                                    if ( empty( $message ) ) {
     1029                                                        if ( isset( $single_response->trial ) ) {
     1030                                                            $message = __( 'The Pro Trial license key is valid.', 'bestwebsoft' );
     1031                                                        } else {
     1032                                                            $message = __( 'The license key is valid.', 'bestwebsoft' );
     1033                                                        }
     1034
     1035                                                        if ( ! empty( $single_response->time_out ) ) {
     1036                                                            $message .= ' ' . __( 'Your license will expire on', 'bestwebsoft' ) . ' ' . $single_response->time_out . '.';
     1037                                                        } else {
     1038                                                            /* lifetime */
     1039                                                            $single_response->time_out = null;
     1040                                                        }
     1041
     1042                                                        if ( isset( $single_response->trial ) && $this->is_trial ) {
     1043                                                            $message .= ' ' . sprintf( __( 'In order to continue using the plugin it is necessary to buy a %s license.', 'bestwebsoft' ), '<a href="' . esc_url( $this->plugins_info['PluginURI'] . '?k=' . $this->link_key . '&pn=' . $this->link_pn . '&v=' . $this->plugins_info['Version'] . '&wp_v=' . $wp_version ) . '" target="_blank" title="' . $this->plugins_info['Name'] . '">Pro</a>' );
     1044                                                        }
     1045                                                    }
     1046
     1047                                                    if ( isset( $single_response->trial ) ) {
     1048                                                        $bstwbsftwppdtplgns_options['trial'][ $single_license['basename'] ] = 1;
     1049                                                    } else {
     1050                                                        unset( $bstwbsftwppdtplgns_options['trial'][ $single_license['basename'] ] );
     1051                                                    }
     1052
     1053                                                    if ( isset( $single_response->nonprofit ) ) {
     1054                                                        $bstwbsftwppdtplgns_options['nonprofit'][ $single_license['basename'] ] = 1;
     1055                                                    } else {
     1056                                                        unset( $bstwbsftwppdtplgns_options['nonprofit'][ $single_license['basename'] ] );
     1057                                                    }
     1058
     1059                                                    if ( ! isset( $bstwbsftwppdtplgns_options[ $single_license['basename'] ] ) || $bstwbsftwppdtplgns_options[ $single_license['basename'] ] !== $bws_license_key ) {
     1060                                                        $bstwbsftwppdtplgns_options[ $single_license['basename'] ] = $bws_license_key;
     1061
     1062                                                        WP_Filesystem();
     1063                                                        if ( $wp_filesystem->put_contents( dirname( dirname( __FILE__ ) ) . '/license_key.txt', $bws_license_key, 0755 ) ) {
     1064                                                            $update_option = true;
     1065                                                        }
     1066                                                    }
     1067
     1068                                                    if ( isset( $bstwbsftwppdtplgns_options['wrong_license_key'][ $single_license['basename'] ] ) ) {
     1069                                                        unset( $bstwbsftwppdtplgns_options['wrong_license_key'][ $single_license['basename'] ] );
     1070                                                        $update_option = true;
     1071                                                    }
     1072
     1073                                                    if ( ! isset( $bstwbsftwppdtplgns_options['time_out'][ $single_license['basename'] ] ) || $bstwbsftwppdtplgns_options['time_out'][ $single_license['basename'] ] !== $single_response->time_out ) {
     1074                                                        $bstwbsftwppdtplgns_options['time_out'][ $single_license['basename'] ] = $single_response->time_out;
     1075                                                        $update_option = true;
     1076                                                    }
     1077
     1078                                                    if ( isset( $update_option ) ) {
     1079                                                        if ( $this->is_multisite ) {
     1080                                                            update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     1081                                                        } else {
     1082                                                            update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     1083                                                        }
     1084                                                    }
     1085                                                }
     1086                                            }
     1087                                        } else {
     1088                                            $error = __( 'Something went wrong. Please try again later. If the error appears again, please contact us', 'bestwebsoft' ) . ' <a href=https://support.bestwebsoft.com>BestWebSoft</a>. ' . __( 'We are sorry for inconvenience.', 'bestwebsoft' );
     1089                                        }
     1090                                    }
     1091                                }
     1092                                /* Go Pro */
     1093                            } else {
     1094                                $slug = ! empty( $single_license['pro_slug'] ) ? 'bws_license_plugin_' . $single_license['pro_slug'] : 'bws_license_plugin_' . $single_license['slug'];
     1095
     1096                                $bws_license_plugin = isset( $_POST[ $slug ] ) ? sanitize_text_field( wp_unslash( $_POST[ $slug ] ) ) : '';
     1097                                if ( isset( $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] ) && $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time'] > ( time() - ( 24 * 60 * 60 ) ) ) {
     1098                                    $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] = $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] + 1;
     1099                                } else {
     1100                                    $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['count'] = 1;
     1101                                    $bstwbsftwppdtplgns_options['go_pro'][ $bws_license_plugin ]['time']  = time();
     1102                                }
     1103
     1104                                /* download Pro */
     1105                                if ( ! $this->all_plugins ) {
     1106                                    if ( ! function_exists( 'get_plugins' ) ) {
     1107                                        require_once ABSPATH . 'wp-admin/includes/plugin.php';
     1108                                    }
     1109                                    $this->all_plugins = get_plugins();
     1110                                }
     1111
     1112                                if ( ! array_key_exists( $bws_license_plugin, $this->all_plugins ) ) {
     1113                                    $current = get_site_transient( 'update_plugins' );
     1114                                    if ( ! empty( $current ) && isset( $current->response ) && is_array( $current->response ) ) {
     1115                                        $to_send                                   = array();
     1116                                        $to_send['plugins'][ $bws_license_plugin ] = array();
     1117                                        $to_send['plugins'][ $bws_license_plugin ]['bws_license_key']    = $bws_license_key;
     1118                                        $to_send['plugins'][ $bws_license_plugin ]['bws_illegal_client'] = true;
     1119                                        $options      = array(
     1120                                            'timeout'    => ( ( defined( 'DOING_CRON' ) && DOING_CRON ) ? 30 : 3 ),
     1121                                            'body'       => array( 'plugins' => serialize( $to_send ) ),
     1122                                            'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ),
     1123                                        );
     1124                                        $raw_response = wp_remote_post( 'https://bestwebsoft.com/wp-content/plugins/paid-products/plugins/pro-license-check/1.0/', $options );
     1125
     1126                                        if ( is_wp_error( $raw_response ) || 200 !== intval( wp_remote_retrieve_response_code( $raw_response ) ) ) {
     1127                                            $error = __( 'Something went wrong. Please try again later. If the error appears again, please contact us', 'bestwebsoft' ) . ': <a href="https://support.bestwebsoft.com">BestWebSoft</a>. ' . __( 'We are sorry for inconvenience.', 'bestwebsoft' );
     1128                                        } else {
     1129                                            $response = maybe_unserialize( wp_remote_retrieve_body( $raw_response ) );
     1130                                            if ( is_array( $response ) && ! empty( $response ) ) {
     1131                                                foreach ( $response as $single_response ) {
     1132                                                    if ( 'wrong_license_key' === $single_response->package ) {
     1133                                                        $error = __( 'Wrong license key.', 'bestwebsoft' );
     1134                                                    } elseif ( 'wrong_domain' === $single_response->package ) {
     1135                                                        $error = __( 'This license key is bound to another site.', 'bestwebsoft' );
     1136                                                    } elseif ( 'you_are_banned' === $single_response->package ) {
     1137                                                        $error = __( 'Unfortunately, you have exceeded the number of available tries per day. Please, upload the plugin manually.', 'bestwebsoft' );
     1138                                                    } elseif ( 'time_out' === $single_response->package ) {
     1139                                                        $error = sprintf( __( 'Unfortunately, Your license has expired. To continue getting top-priority support and plugin updates, you should extend it in your %s.', 'bestwebsoft' ), ' <a href="https://bestwebsoft.com/client-area">Client Area</a>' );
     1140                                                    } elseif ( 'duplicate_domen_for_trial' === $single_response->package ) {
     1141                                                        $error = __( 'Unfortunately, the Pro licence was already installed to this domain. The Pro Trial license can be installed only once.', 'bestwebsoft' );
     1142                                                    }
     1143                                                }
     1144                                                if ( empty( $error ) ) {
     1145                                                    $bws_license_plugin = ( ! empty( $single_license['pro_basename'] ) ) ? $single_license['pro_basename'] : $single_license['basename'];
     1146
     1147                                                    $bstwbsftwppdtplgns_options[ $bws_license_plugin ] = $bws_license_key;
     1148                                                    $this->pro_plugin_is_activated                     = true;
     1149                                                }
     1150                                            } else {
     1151                                                $error = __( 'Something went wrong. Try again later or upload the plugin manually. We are sorry for inconvenience.', 'bestwebsoft' );
     1152                                            }
     1153                                        }
     1154                                    }
     1155                                } else {
     1156                                    $bstwbsftwppdtplgns_options[ $bws_license_plugin ] = $bws_license_key;
     1157                                    /* activate Pro */
     1158                                    if ( ! is_plugin_active( $bws_license_plugin ) ) {
     1159                                        if ( $this->is_multisite && is_plugin_active_for_network( ( ! empty( $single_license['pro_basename'] ) ) ? $single_license['pro_basename'] : $single_license['basename'] ) ) {
     1160                                            /* if multisite and free plugin is network activated */
     1161                                            $network_wide = true;
     1162                                        } else {
     1163                                            /* activate on a single blog */
     1164                                            $network_wide = false;
     1165                                        }
     1166                                        activate_plugin( $bws_license_plugin, null, $network_wide );
     1167                                        $this->pro_plugin_is_activated = true;
     1168                                    }
     1169                                }
     1170                                /* add 'track_usage' for Pro version */
     1171                                if ( ! empty( $bstwbsftwppdtplgns_options['track_usage'][ ( ! empty( $single_license['pro_basename'] ) ) ? $single_license['pro_basename'] : $single_license['basename'] ] ) &&
     1172                                    empty( $bstwbsftwppdtplgns_options['track_usage'][ $bws_license_plugin ] ) ) {
     1173                                    $bstwbsftwppdtplgns_options['track_usage'][ $bws_license_plugin ] = $bstwbsftwppdtplgns_options['track_usage'][ ( ! empty( $single_license['pro_basename'] ) ) ? $single_license['pro_basename'] : $single_license['basename'] ];
     1174                                }
     1175
     1176                                if ( $this->is_multisite ) {
     1177                                    update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     1178                                } else {
     1179                                    update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     1180                                }
     1181
     1182                                if ( $this->pro_plugin_is_activated ) {
     1183                                    delete_transient( 'bws_plugins_update' );
     1184                                }
     1185                            }
     1186                        }
     1187                    } else {
     1188                        $empty_field_error = __( 'Please, enter Your license key', 'bestwebsoft' );
     1189                    }
     1190                }
     1191            }
     1192            return compact( 'error', 'message', 'empty_field_error' );
    4861193        }
    4871194
     
    4941201        public function help_phrase() {
    4951202            /*pls */
    496             echo '<div class="bws_tab_description">' . esc_html__( 'Need Help?', 'bws-login-register' ) . ' ';
     1203            echo '<div class="bws_tab_description">' . esc_html__( 'Need Help?', 'bestwebsoft' ) . ' ';
    4971204            if ( '' !== $this->doc_link ) {
    498                 echo '<a href="' . esc_url( $this->doc_link ) . '" target="_blank">' . esc_html__( 'Read the Instruction', 'bws-login-register' );
     1205                echo '<a href="' . esc_url( $this->doc_link ) . '" target="_blank">' . esc_html__( 'Read the Instruction', 'bestwebsoft' );
    4991206            } else {
    500                 echo '<a href="https://support.bestwebsoft.com/hc/en-us/" target="_blank">' . esc_html__( 'Visit Help Center', 'bws-login-register' );
     1207                echo '<a href="https://support.bestwebsoft.com/hc/en-us/" target="_blank">' . esc_html__( 'Visit Help Center', 'bestwebsoft' );
    5011208            }
    5021209            if ( '' !== $this->doc_video_link ) {
    503                 echo '</a> ' . esc_html__( 'or', 'bws-login-register' ) . ' <a href="' . esc_url( $this->doc_video_link ) . '" target="_blank">' . esc_html__( 'Watch the Video', 'bws-login-register' );
     1210                echo '</a> ' . esc_html__( 'or', 'bestwebsoft' ) . ' <a href="' . esc_url( $this->doc_video_link ) . '" target="_blank">' . esc_html__( 'Watch the Video', 'bestwebsoft' );
    5041211            }
    5051212            echo '</a></div>';
    5061213            /* pls*/
     1214        }
     1215
     1216        public function bws_pro_block_links() {
     1217            global $wp_version;
     1218            ?>
     1219            <div class="bws_pro_version_tooltip">
     1220                <a class="bws_button" href="<?php echo esc_url( $this->plugins_info['PluginURI'] ); ?>?k=<?php echo esc_attr( $this->link_key ); ?>&amp;pn=<?php echo esc_attr( $this->link_pn ); ?>&amp;v=<?php echo esc_attr( $this->plugins_info['Version'] ); ?>&amp;wp_v=<?php echo esc_attr( $wp_version ); ?>" target="_blank" title="<?php echo esc_html( $this->plugins_info['Name'] ); ?>"><?php esc_html_e( 'Upgrade to Pro', 'bestwebsoft' ); ?></a>
     1221                <?php if ( false !== $this->trial_days ) { ?>
     1222                    <span class="bws_trial_info">
     1223                        <?php esc_html_e( 'or', 'bestwebsoft' ); ?>
     1224                        <a href="<?php echo esc_url( $this->plugins_info['PluginURI'] . '?k=' . $this->link_key . '&pn=' . $this->link_pn . '&v=' . $this->plugins_info['Version'] . '&wp_v=' . $wp_version ); ?>" target="_blank" title="<?php echo esc_html( $this->plugins_info['Name'] ); ?>"><?php esc_html_e( 'Start Your Free Trial', 'bestwebsoft' ); ?></a>
     1225                    </span>
     1226                <?php } ?>
     1227                <div class="clear"></div>
     1228            </div>
     1229            <?php
    5071230        }
    5081231
     
    5241247             */
    5251248            $this->options = apply_filters( __CLASS__ . '_additional_restore_options', $this->default_options );
    526             update_option( $this->prefix . '_options', $this->options );
    527         }
    528 
     1249            if ( $this->is_network_options ) {
     1250                $this->options['network_apply']  = 'default';
     1251                $this->options['network_view']   = '1';
     1252                $this->options['network_change'] = '1';
     1253                update_site_option( $this->prefix . '_options', $this->options );
     1254            } else {
     1255                update_option( $this->prefix . '_options', $this->options );
     1256            }
     1257        }
     1258
     1259        public function add_request_feature() {
     1260            ?>
     1261            <div id="bws_request_feature" class="widget-access-link">
     1262                <button type="button" class="button" ><?php esc_html_e( 'Request a Feature', 'bestwebsoft' ); ?></button>
     1263            </div>
     1264            <?php
     1265            $modal_html = '<div class="bws-modal bws-modal-deactivation-feedback bws-modal-request-feature">
     1266                <div class="bws-modal-dialog">
     1267                    <div class="bws-modal-body">
     1268                        <h2>' . sprintf( esc_html__( 'How can we improve %s?', 'bestwebsoft' ), $this->plugins_info['Name'] ) . '</h2>
     1269                        <div class="bws-modal-panel active">
     1270                            <p>' . esc_html__( 'We look forward to hear your ideas.', 'bestwebsoft' ) . '</p>
     1271                            <p>
     1272                                <textarea placeholder="' . esc_html__( 'Describe your idea', 'bestwebsoft' ) . '..."></textarea>
     1273                            </p>
     1274                            <label class="bws-modal-anonymous-label">
     1275                                <input type="checkbox" /> ' . esc_html__( 'Send website data and allow to contact me back', 'bestwebsoft' ) . '
     1276                            </label>
     1277                        </div>
     1278                    </div>
     1279                    <div class="bws-modal-footer">
     1280                        <a href="#" class="button disabled bws-modal-button button-primary">' . esc_html__( 'Submit', 'bestwebsoft' ) . '</a>
     1281                        <span class="bws-modal-processing hidden">' . esc_html__( 'Processing', 'bestwebsoft' ) . '...</span>
     1282                        <span class="bws-modal-thank-you hidden">' . esc_html__( 'Thank you!', 'bestwebsoft' ) . '</span>
     1283                        <div class="clear"></div>
     1284                    </div>
     1285                </div>
     1286            </div>';
     1287
     1288            $script = '(function($) {
     1289                var modalHtml = ' . wp_json_encode( $modal_html ) . ",
     1290                    \$modal = $( modalHtml );
     1291               
     1292                \$modal.appendTo( $( 'body' ) );
     1293
     1294                $( '#bws_request_feature .button' ).on( 'click', function() {
     1295                    /* Display the dialog box.*/
     1296                    \$modal.addClass( 'active' );
     1297                    $( 'body' ).addClass( 'has-bws-modal' );               
     1298                });
     1299
     1300                \$modal.on( 'keypress', 'textarea', function( evt ) {
     1301                    BwsModalEnableButton();
     1302                });
     1303
     1304                \$modal.on( 'click', '.bws-modal-footer .button', function( evt ) {
     1305                    evt.preventDefault();
     1306
     1307                    if ( $( this ).hasClass( 'disabled' ) ) {
     1308                        return;
     1309                    }
     1310                    var info = \$modal.find( 'textarea' ).val();
     1311
     1312                    if ( info.length == 0 ) {
     1313                        return;
     1314                    }
     1315
     1316                    var _parent = $( this ).parents( '.bws-modal:first' ),
     1317                        _this =  $( this );
     1318
     1319                    var is_anonymous = ( \$modal.find( '.bws-modal-anonymous-label' ).find( 'input' ).is( ':checked' ) ) ? 0 : 1;
     1320
     1321                    $.ajax({
     1322                        url    : ajaxurl,
     1323                        method  : 'POST',
     1324                        data      : {
     1325                            'Action'            : 'bws_submit_request_feature_action',
     1326                            'plugin'            : '" . $this->plugin_basename . "',
     1327                            'info'              : info,
     1328                            'is_anonymous'      : is_anonymous,
     1329                            'bws_ajax_nonce'    : '" . wp_create_nonce( 'bws_ajax_nonce' ) . "'
     1330                        },
     1331                        beforeSend: function() {
     1332                            _parent.find( '.bws-modal-footer .bws-modal-button' ).hide();
     1333                            _parent.find( '.bws-modal-footer .bws-modal-processing' ).show();
     1334                            _parent.find( 'textarea, input' ).attr( 'disabled', 'disabled' );
     1335                        },
     1336                        complete  : function( message ) {
     1337                            _parent.find( '.bws-modal-footer .bws-modal-processing' ).hide();
     1338                            _parent.find( '.bws-modal-footer .bws-modal-thank-you' ).show();
     1339                        }
     1340                    });
     1341                });
     1342
     1343                /* If the user has clicked outside the window, cancel it. */
     1344                \$modal.on( 'click', function( evt ) {
     1345                    var \$target = $( evt.target );
     1346
     1347                    /* If the user has clicked anywhere in the modal dialog, just return. */
     1348                    if ( \$target.hasClass( 'bws-modal-body' ) || \$target.hasClass( 'bws-modal-footer' ) ) {
     1349                        return;
     1350                    }
     1351
     1352                    /* If the user has not clicked the close button and the clicked element is inside the modal dialog, just return. */
     1353                    if ( ! \$target.hasClass( 'bws-modal-button-close' ) && ( \$target.parents( '.bws-modal-body' ).length > 0 || \$target.parents( '.bws-modal-footer' ).length > 0 ) ) {
     1354                        return;
     1355                    }
     1356
     1357                    /* Close the modal dialog */
     1358                    \$modal.removeClass( 'active' );
     1359                    $( 'body' ).removeClass( 'has-bws-modal' );
     1360
     1361                    return false;
     1362                });
     1363
     1364                function BwsModalEnableButton() {
     1365                    \$modal.find( '.bws-modal-button' ).removeClass( 'disabled' ).show();
     1366                    \$modal.find( '.bws-modal-processing' ).hide();
     1367                }
     1368
     1369                function BwsModalDisableButton() {
     1370                    \$modal.find( '.bws-modal-button' ).addClass( 'disabled' );
     1371                }
     1372
     1373                function BwsModalShowPanel() {
     1374                    \$modal.find( '.bws-modal-panel' ).addClass( 'active' );
     1375                }
     1376            })(jQuery);";
     1377
     1378            /* add script in FOOTER */
     1379            wp_register_script( 'bws-request-feature-dialog', '', array( 'jquery' ), '2.4.2', true );
     1380            wp_enqueue_script( 'bws-request-feature-dialog' );
     1381            wp_add_inline_script( 'bws-request-feature-dialog', sprintf( $script ) );
     1382        }
    5291383    }
    5301384}
     1385
     1386if ( ! function_exists( 'bws_submit_request_feature_action' ) ) {
     1387    /**
     1388     * Called after the user has submitted his reason for deactivating the plugin.
     1389     *
     1390     * @since  2.1.3
     1391     */
     1392    function bws_submit_request_feature_action() {
     1393        global $bstwbsftwppdtplgns_options, $wp_version, $bstwbsftwppdtplgns_active_plugins, $current_user;
     1394
     1395        if ( isset( $_REQUEST['bws_ajax_nonce'] ) ) {
     1396
     1397            check_ajax_referer( 'bws_ajax_nonce', sanitize_text_field( wp_unslash( $_REQUEST['bws_ajax_nonce'] ) ) );
     1398
     1399            $basename = isset( $_REQUEST['plugin'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['plugin'] ) ) : '';
     1400            $info     = isset( $_REQUEST['info'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['info'] ) ) : '';
     1401
     1402            if ( empty( $info ) || empty( $basename ) ) {
     1403                exit;
     1404            }
     1405
     1406            $info         = substr( $info, 0, 255 );
     1407            $is_anonymous = isset( $_REQUEST['is_anonymous'] ) && 1 === intval( $_REQUEST['is_anonymous'] );
     1408
     1409            $options = array(
     1410                'product' => $basename,
     1411                'info'    => $info,
     1412            );
     1413
     1414            if ( ! $is_anonymous ) {
     1415                if ( ! isset( $bstwbsftwppdtplgns_options ) ) {
     1416                    $bstwbsftwppdtplgns_options = ( is_multisite() ) ? get_site_option( 'bstwbsftwppdtplgns_options' ) : get_option( 'bstwbsftwppdtplgns_options' );
     1417                }
     1418
     1419                if ( ! empty( $bstwbsftwppdtplgns_options['track_usage']['usage_id'] ) ) {
     1420                    $options['usage_id'] = $bstwbsftwppdtplgns_options['track_usage']['usage_id'];
     1421                } else {
     1422                    $options['usage_id']   = false;
     1423                    $options['url']        = get_bloginfo( 'url' );
     1424                    $options['wp_version'] = $wp_version;
     1425                    $options['is_active']  = false;
     1426                    $options['version']    = $bstwbsftwppdtplgns_active_plugins[ $basename ]['Version'];
     1427                }
     1428
     1429                $options['email'] = $current_user->data->user_email;
     1430            }
     1431
     1432            /* send data */
     1433            $raw_response = wp_remote_post(
     1434                'https://bestwebsoft.com/wp-content/plugins/products-statistics/request-feature/',
     1435                array(
     1436                    'method'  => 'POST',
     1437                    'body'    => $options,
     1438                    'timeout' => 15,
     1439                )
     1440            );
     1441
     1442            if ( ! is_wp_error( $raw_response ) && 200 === intval( wp_remote_retrieve_response_code( $raw_response ) ) ) {
     1443                if ( ! $is_anonymous ) {
     1444                    $response = maybe_unserialize( wp_remote_retrieve_body( $raw_response ) );
     1445
     1446                    if ( is_array( $response ) && ! empty( $response['usage_id'] ) && $response['usage_id'] !== $options['usage_id'] ) {
     1447                        $bstwbsftwppdtplgns_options['track_usage']['usage_id'] = $response['usage_id'];
     1448
     1449                        if ( is_multisite() ) {
     1450                            update_site_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     1451                        } else {
     1452                            update_option( 'bstwbsftwppdtplgns_options', $bstwbsftwppdtplgns_options );
     1453                        }
     1454                    }
     1455                }
     1456
     1457                echo 'done';
     1458            } else {
     1459                echo wp_kses_data( $response->get_error_code() ) . ': ' . wp_kses_data( $response->get_error_message() );
     1460            }
     1461        }
     1462        exit;
     1463    }
     1464}
     1465
     1466add_action( 'wp_ajax_bws_submit_request_feature_action', 'bws_submit_request_feature_action' );
  • bws-login-register/trunk/bws_menu/css/general_style.css

    r3301452 r3337325  
    535535    -webkit-box-shadow: 0 0 3px #555;
    536536    -moz-box-shadow: 0 0 3px #555;
    537     max-width: 300px;
    538     position: absolute;
    539     z-index: 2;
    540537}
    541538.bws-tooltip-content a {
     
    912909    }
    913910}
    914 /* Promo banner */
    915 .bws_promo_banner {
    916     background: radial-gradient(74% 10281.6% at 33.47% 26%, rgba(64, 128, 255, 0.92) 0%, #566fef 100%);
    917     text-align: center;
    918     display: flex;
    919     color: #fff;
    920     padding: 23px 75px 20px;
    921     justify-content: space-between;
    922     align-items: center;
    923 }
    924 .promo-banner-left {
    925     display: flex;
    926 }
    927 .promo-banner-upgrade {
    928     font-size: 48px;
    929     position: relative;
    930     padding-right: 30px;
    931     text-transform: uppercase;
    932     font-weight: 700;
    933     line-height: 36px;
    934 }
    935 .promo-banner-upgrade:after{
    936     display: table;
    937     position: absolute;
    938     width: 4px;
    939     height: 42px;
    940     background-color: #fff;
    941     content: '';
    942     right: 0;
    943     top: 0;
    944 }
    945 .promo-banner-off {
    946     position: relative;
    947     font-size: 30px;
    948     background-color: #ffbb01;
    949     padding: 18px 10px 20px;
    950     margin-left: 30px;
    951     margin-top: -4px;
    952     font-weight: 700;
    953 }
    954 .promo-banner-text {
    955     font-size: 22px;
    956     line-height: 26px;
    957 }
    958 .promo-banner-text-bottom span {
    959     color: #ffbb01;
    960 }
    961 .promo-banner-get-pro {
    962     border: 3px solid #ffc411f7;
    963     font-size: 27px;
    964     padding: 1px 15px 5px;
    965     line-height: 29px;
    966     font-weight: 600;
    967 }
    968 .bws_hide_promo_notice::before {
    969     color: #fff;
    970 }
    971 .promo-banner-link {
    972     position: absolute;
    973     left: 0;
    974     right: 0;
    975     top: 0;
    976     bottom: 0;
    977 }
    978 @media screen and (max-width: 1700px) {
    979     .bws_promo_banner {
    980         padding: 23px 25px 20px;
    981     }
    982 }
    983 @media screen and (max-width: 1580px) {
    984     .bws_promo_banner {
    985         flex-wrap: wrap;
    986     }
    987     .promo-banner-left {
    988         width: 100%;
    989         justify-content: center;
    990         padding-bottom: 15px;
    991     }
    992 }
    993 @media screen and (max-width: 835px) {
    994     .bws_promo_banner {
    995         justify-content: center;
    996     }
    997     .promo-banner-text {
    998         width: 100%;
    999     }
    1000 }
    1001 @media screen and (max-width: 835px) {
    1002     .bws_promo_banner {
    1003         justify-content: center;
    1004     }
    1005     .promo-banner-left {
    1006         padding-bottom: 10px;
    1007     }
    1008     .promo-banner-text {
    1009         width: 100%;
    1010         padding-bottom: 15px;
    1011     }
    1012 }
    1013 @media screen and (max-width: 768px) {
    1014     .promo-banner-upgrade {
    1015         font-size: 34px;
    1016     }
    1017     .promo-banner-upgrade:after {
    1018         padding-right: 10px;
    1019         display: none;
    1020     }
    1021     .promo-banner-off {
    1022         padding: 10px;
    1023         margin-top: 0;
    1024         margin-left: 0;
    1025         font-size: 28px;
    1026     }
    1027 }
    1028 @media screen and (max-width: 560px) {
    1029     .promo-banner-upgrade {
    1030         letter-spacing: -1px;
    1031         padding-right: 10px;
    1032         font-size: 28px;
    1033     }
    1034     .promo-banner-text-top {
    1035         display: none;
    1036     }
    1037     .promo-banner-text-bottom {
    1038         font-size: 16px;
    1039     }
    1040     .promo-banner-off {
    1041         font-size: 24px;
    1042     }
    1043     .promo-banner-get-pro {
    1044         font-size: 18px;
    1045     }
    1046 }
    1047 @media screen and (max-width: 450px) {
    1048     .bws_promo_banner {
    1049         padding: 14px 10px;
    1050     }
    1051     .promo-banner-upgrade {
    1052         font-size: 24px;
    1053     }
    1054     .promo-banner-off {
    1055         font-size: 20px;
    1056     }
    1057     .promo-banner-get-pro {
    1058         font-size: 16px;
    1059     }
    1060 }
    1061 @media screen and (max-width: 365px) {
    1062     .promo-banner-left {
    1063         display: block;
    1064         text-align: center;
    1065     }
    1066     .promo-banner-upgrade {
    1067         padding-bottom: 10px;
    1068     }
    1069     .promo-banner-get-pro {
    1070         width: 100%;
    1071     }
    1072 }
  • bws-login-register/trunk/bws_menu/fonts/bwsicons.svg

    r3301452 r3337325  
    66<![CDATA[
    77{
    8     "fontFamily": "bwsicons",
     8    "fontFamily": "icomoon",
    99    "majorVersion": 1,
    1010    "minorVersion": 0,
    1111    "version": "Version 1.0",
    12     "fontId": "bwsicons",
    13     "psName": "bwsicons",
     12    "fontId": "icomoon",
     13    "psName": "icomoon",
    1414    "subFamily": "Regular",
    15     "fullName": "bwsicons",
     15    "fullName": "icomoon",
    1616    "description": "Font generated by IcoMoon."
    1717}
     
    2020</metadata>
    2121<defs>
    22 <font id="bwsicons" horiz-adv-x="1024">
     22<font id="icomoon" horiz-adv-x="1024">
    2323<font-face units-per-em="1024" ascent="960" descent="-64" />
    2424<missing-glyph horiz-adv-x="1024" />
     
    8686<glyph unicode="&#xe992;" glyph-name="Columns" data-tags="Columns" d="M249.6 817.2v-738.4h-128v738.4h128zM467.2 817.2v-738.4h-128v738.4h128zM684.8 817.2v-738.4h-128v738.4h128zM902.4 817.2v-738.4h-128v738.4h128z" />
    8787<glyph unicode="&#xe993;" glyph-name="GPTAi" data-tags="GPT Ai" d="M409.919 184.994l329.81-142.572h-659.627l329.81 142.572zM409.919 737.754l400.483-702.805-400.483 173.731-400.483-173.731 400.483 702.805zM809.819 784.196l102.953 103.537 101.792-102.365-102.953-103.537-101.792 102.365zM810.403 753.518l102.088-97.994 102.088 97.994v-718.601h-204.17v718.601z" />
    88 <glyph unicode="&#xe994;" glyph-name="AdBock-Detector" data-tags="AdBock Detector" d="M463.97 833.512c-12.177-12.091-17.25-21.663-17.25-32.747v-15.114l-25.368 3.023c-28.92 3.527-45.156-4.534-60.884-30.228-9.133-14.61-10.148-25.693-10.148-118.392v-102.774l-17.25 10.58c-23.847 14.61-41.605 13.602-59.362-4.534l-15.221-15.114 1.522-134.514c2.537-151.641 4.566-163.731 39.068-216.631 23.846-36.779 60.884-67.007 100.459-82.621 26.89-10.583 39.068-12.094 137.499-13.605 105.532-1.511 108.067-1.511 134.452 10.578 30.949 14.107 55.808 37.282 71.029 65.998 11.165 20.152 11.165 25.192 12.686 272.553 1.014 165.246 0 257.944-3.554 270.035-3.042 9.572-11.16 23.175-18.77 30.228-10.653 10.076-17.756 12.091-42.62 11.587l-29.428-0.504-2.535 25.189c-2.028 20.656-5.075 28.213-18.775 40.304-15.221 13.602-19.277 14.61-44.648 12.595-26.887-2.519-29.428-1.511-45.155 14.61-14.714 14.61-20.291 16.625-42.615 16.625-22.834 0-27.907-2.015-43.129-17.129zM524.855 814.871l13.193-10.076 1.014-152.146 1.521-152.146h25.366l2.54 138.543c1.521 76.073 4.563 141.567 6.596 145.093 7.103 10.076 43.127 7.557 49.212-3.527 3.047-6.046 5.075-63.982 5.075-153.657 0-78.592 1.521-146.604 3.042-151.139 3.554-8.564 19.789-11.084 24.864-3.526 1.521 2.519 3.042 46.349 3.042 97.232 0 97.233 4.061 133.506 15.221 140.559 13.193 8.565 37.038 3.023 43.634-10.58 8.117-15.618 9.639-486.162 1.521-513.87-6.596-23.681-31.963-53.402-56.822-65.998-18.775-9.574-27.399-10.076-127.354-8.565-97.92 1.511-109.589 3.022-131.914 12.596-52.259 24.183-95.386 79.599-110.099 142.068-7.103 28.717-9.133 246.861-2.537 256.937 8.625 14.61 37.546-4.030 52.766-33.25 3.044-6.046 5.581-37.279 5.581-73.049 0-65.496 3.044-76.576 18.265-73.554 9.133 1.511 9.64 11.080 12.177 202.021 2.537 191.442 3.044 201.014 12.177 208.067 12.684 9.068 28.92 9.068 41.604 0 9.133-6.549 9.64-15.114 11.162-136.529 1.522-111.842 2.537-129.475 9.64-131.994 19.28-7.557 21.31 8.564 21.817 168.771 0 84.134 1.522 155.673 3.044 158.192 3.044 4.534 20.297 13.099 27.907 13.603 2.028 0.504 9.131-4.030 16.742-10.076zM463.761 714.725c-100.293-22.541-179.13-97.678-204.578-195.356-9.98-39.071-9.48-108.7 0.499-143.263 8.981-30.556 28.94-72.629 40.916-86.155 6.986-8.013 6.986-9.519 0-16.528-6.486-6.512-9.98-7.014-18.961-2.003-10.479 5.508-17.464 0-109.275-92.17l-97.798-98.18v-25.043c0-21.539 2.495-27.051 16.466-41.074 13.971-14.028 19.46-16.533 40.916-16.533h24.948l97.798 98.18c86.821 87.159 97.299 99.179 92.31 108.196-3.992 7.516-3.493 12.522 1.497 19.536 6.486 8.515 7.983 9.017 16.466 1.501 13.472-12.522 55.385-32.559 85.823-41.571 34.429-10.021 103.788-10.523 142.705-0.502 94.805 25.043 171.147 104.692 194.6 203.368 45.404 194.355-129.735 371.177-324.332 327.598zM585.012 682.667c45.404-12.022 76.343-30.055 110.771-65.62 59.874-61.111 81.831-140.756 62.37-224.909-20.455-87.159-91.812-159.292-179.627-181.333-13.471-3.504-43.411-5.006-71.854-3.504-42.911 2.003-52.89 4.509-86.321 20.54-51.893 25.043-91.811 65.118-116.759 117.213-17.464 35.562-18.961 43.078-20.957 91.663-1.497 44.583-0.499 57.607 8.982 85.157 41.913 125.228 167.155 194.354 293.396 160.793zM326.045 243.364c-2.994-3.504-7.485-5.508-10.478-4.007-2.495 1.506-1.996 6.010 1.497 10.021 2.994 3.504 7.485 5.508 10.479 4.007 2.494-1.506 1.996-6.010-1.497-10.021zM323.525 914.532h391.863l277.216-273.236v-386.593l-277.216-273.234h-391.863l-277.215 273.234v386.593l277.215 273.236zM333.716 889.677l-262.551-258.782v-365.794l262.55-258.779h371.483l262.552 258.779v365.794l-262.552 258.782h-371.482z" />
    8988</font></defs></svg>
  • bws-login-register/trunk/bws_menu/js/general_script.js

    r3301452 r3337325  
    1111    $( document ).ready(
    1212        function() {
    13             /**
    14             * add notice about changing on the settings page
    15             */
    16             $( '.bws_form input, .bws_form textarea, .bws_form select' ).on(
    17                 "change paste select",
    18                 function( e ) {
    19                     if ( $( this ).attr( 'type' ) != 'submit' && ! $( this ).hasClass( 'bws_no_bind_notice' ) && typeof ( e.originalEvent ) != 'undefined' ) {
    20                         bws_show_settings_notice();
    21                     };
    22                 }
    23             );
    24             $( '.bws_save_anchor' ).on(
    25                 "click",
    26                 function( event ) {
    27                     event.preventDefault();
    28                     $( '.bws_form #bws-submit-button' ).click();
    29                 }
    30             );
    31 
    32             /* custom code */
     13                /**
     14                * add notice about changing on the settings page
     15                */
     16                $( '.bws_form input, .bws_form textarea, .bws_form select' ).on(
     17                    "change paste select",
     18                    function( e ) {
     19                        if ( $( this ).attr( 'type' ) != 'submit' && ! $( this ).hasClass( 'bws_no_bind_notice' ) && typeof ( e.originalEvent ) != 'undefined' ) {
     20                            bws_show_settings_notice();
     21                        };
     22                    }
     23                );
     24                $( '.bws_save_anchor' ).on(
     25                    "click",
     26                    function( event ) {
     27                        event.preventDefault();
     28                        $( '.bws_form #bws-submit-button' ).click();
     29                    }
     30                );
     31
     32                /* custom code */
    3333
    3434            if ( 'function' == typeof wp.CodeMirror || 'function' == typeof CodeMirror ) {
     
    140140            }
    141141
    142             /**
    143             * Handle the styling of the "Settings" tab on the plugin settings page
    144             */
    145             var tabs = $( '#bws_settings_tabs_wrapper' );
     142                /**
     143                * Handle the styling of the "Settings" tab on the plugin settings page
     144                */
     145                var tabs = $( '#bws_settings_tabs_wrapper' );
    146146            if ( tabs.length ) {
    147147                var current_tab_field = $( 'input[name="bws_active_tab"]' ),
     
    154154                }
    155155
    156                 $( '.bws_tab' ).css( 'min-height', $( '#bws_settings_tabs' ).css( 'height' ) );
    157 
    158                 /* jQuery tabs initialization */
    159                 tabs.tabs(
    160                     {
    161                         active: active_tab_index
    162                     }
    163                 ).on(
    164                     "tabsactivate",
    165                     function( event, ui ) {
    166                         if ( ! prevent_tabs_change ) {
    167                             active_tab = ui.newTab.data( 'slug' );
    168                             current_tab_field.val( active_tab );
    169                         }
    170                         prevent_tabs_change = false;
    171                     }
    172                 );
     156                        $( '.bws_tab' ).css( 'min-height', $( '#bws_settings_tabs' ).css( 'height' ) );
     157
     158                        /* jQuery tabs initialization */
     159                        tabs.tabs(
     160                            {
     161                                active: active_tab_index
     162                            }
     163                        ).on(
     164                            "tabsactivate",
     165                            function( event, ui ) {
     166                                if ( ! prevent_tabs_change ) {
     167                                    active_tab = ui.newTab.data( 'slug' );
     168                                    current_tab_field.val( active_tab );
     169                                }
     170                                prevent_tabs_change = false;
     171                            }
     172                        );
    173173                $( '.bws_trigger_tab_click' ).on(
    174174                    'click',
     
    178178                );
    179179            }
    180             /**
    181             * Hide content for options on the plugin settings page
    182             */
    183             var options = $( '.bws_option_affect' );
     180                /**
     181                * Hide content for options on the plugin settings page
     182                */
     183                var options = $( '.bws_option_affect' );
    184184            if ( options.length ) {
    185185                options.each(
  • bws-login-register/trunk/bws_menu/product_list.php

    r3301452 r3337325  
    1111
    1212$bws_plugins_category = array(
    13     'admin-tools' => array( 'name' => __( 'Admin Tools', 'bws-login-register' ) ),
    14     'content'     => array( 'name' => __( 'Content', 'bws-login-register' ) ),
    15     'ecommerce'   => array( 'name' => __( 'eCommerce', 'bws-login-register' ) ),
    16     'marketing'   => array( 'name' => __( 'Marketing', 'bws-login-register' ) ),
    17     'navigation'  => array( 'name' => __( 'Navigation', 'bws-login-register' ) ),
    18     'recommended' => array( 'name' => __( 'Recommended', 'bws-login-register' ) ),
    19     'security'    => array( 'name' => __( 'Security', 'bws-login-register' ) ),
    20     'seo'         => array( 'name' => __( 'SEO', 'bws-login-register' ) ),
    21     'smm'         => array( 'name' => __( 'SMM', 'bws-login-register' ) ),
     13    'admin-tools' => array( 'name' => __( 'Admin Tools', 'bestwebsoft' ) ),
     14    'content'     => array( 'name' => __( 'Content', 'bestwebsoft' ) ),
     15    'ecommerce'   => array( 'name' => __( 'eCommerce', 'bestwebsoft' ) ),
     16    'marketing'   => array( 'name' => __( 'Marketing', 'bestwebsoft' ) ),
     17    'navigation'  => array( 'name' => __( 'Navigation', 'bestwebsoft' ) ),
     18    'recommended' => array( 'name' => __( 'Recommended', 'bestwebsoft' ) ),
     19    'security'    => array( 'name' => __( 'Security', 'bestwebsoft' ) ),
     20    'seo'         => array( 'name' => __( 'SEO', 'bestwebsoft' ) ),
    2221);
    2322
     
    2625        'category'     => array( 'ecommerce' ),
    2726        'name'         => 'Bike Rental',
    28         'description'  => __( 'Give a birth for your bike rental and booking WordPress website.', 'bws-login-register' ),
     27        'description'  => __( 'Give a birth for your bike rental and booking WordPress website.', 'bestwebsoft' ),
    2928        'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/bike-rental/?k=04387cfc31fc8b9553e4741392762231&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    3029        'settings'     => 'edit.php?post_type=bws_bike&page=bkng_general_settings',
     
    3231        'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/bike-rental/buy/?k=9b3222b005340035eaead38a7a495a0d&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    3332        'pro_settings' => 'edit.php?post_type=bws_bike&page=bkrntl_bws_bike_settings',
    34         'icon'         => lgnrgstrfrm_menu_url( 'icons/plugins/' ) . 'bike-rental.png',
     33        'icon'         => bws_menu_url( 'icons/plugins/' ) . 'bike-rental.png',
    3534        'install_url'  => 'https://bestwebsoft.com/products/wordpress/plugins/bike-rental/',
    3635    ),
     
    3837        'category'     => array( 'security', 'recommended' ),
    3938        'name'         => 'Captcha',
    40         'description'  => __( 'Best secure captcha plugin to protect your WordPress forms.', 'bws-login-register' ),
     39        'description'  => __( 'Best secure captcha plugin to protect your WordPress forms.', 'bestwebsoft' ),
    4140        'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/captcha/?k=d678516c0990e781edfb6a6c874f0b8a&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    4241        'settings'     => 'admin.php?page=captcha.php',
     
    4544        'pro_settings' => 'admin.php?page=captcha_pro.php',
    4645    ),
    47     'bws-car-rental/bws-car-rental.php'                 => array(
    48         'category'     => array( 'ecommerce' ),
    49         'name'         => 'Car Rental V2',
    50         'description'  => __( 'Create your own rental website for car renting and booking.', 'bws-login-register' ),
    51         'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/car-rental-v2/?k=ca43df54beefae7128a7005bce0ec651&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    52         'settings'     => 'admin.php?page=bws-car-rental-settings',
    53         'pro_version'  => 'bws-car-rental-pro/bws-car-rental-pro.php',
    54         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/car-rental-v2/buy/?k=63cac1b736047a3f5a2f5a7c5336f3c4&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    55         'pro_settings' => 'edit.php?post_type=bws_bkng_products&page=bws-car-rental-pro-settings',
    56         'icon'         => '//ps.w.org/car-rental/assets/icon-128x128.png',
    57         'install_url'  => 'https://bestwebsoft.com/products/wordpress/plugins/car-rental-v2/',
    58     ),
    59     'columns-bws/columns-bws.php'                       => array(
    60         'category'    => array( 'content' ),
    61         'name'        => 'Columns',
    62         'description' => __( 'Add columns with custom content to WordPress website pages, posts, widgets, etc.', 'bws-login-register' ),
    63         'link'        => 'https://bestwebsoft.com/products/wordpress/plugins/columns/?k=6d2cddc059a04e4d528cec14de47fb1e&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    64         'settings'    => 'admin.php?page=columns-settings.php',
    65     ),
    6646    'contact-form-plugin/contact_form.php'              => array(
    6747        'category'     => array( 'marketing', 'recommended' ),
    6848        'name'         => 'Contact Form',
    69         'description'  => __( 'Allow customers to reach you using secure contact form plugin any website must have.', 'bws-login-register' ),
     49        'description'  => __( 'Allow customers to reach you using secure contact form plugin any website must have.', 'bestwebsoft' ),
    7050        'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/contact-form/?k=012327ef413e5b527883e031d43b088b&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    7151        'settings'     => 'admin.php?page=contact_form.php',
     
    7454        'pro_settings' => 'admin.php?page=contact_form_pro.php',
    7555    ),
    76     'contact-form-multi/contact-form-multi.php'         => array(
    77         'category'     => array( 'marketing', 'recommended' ),
    78         'name'         => 'Contact Form Multi',
    79         'description'  => __( 'Add unlimited number of contact forms to WordPress website.', 'bws-login-register' ),
    80         'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/contact-form-multi/?k=83cdd9e72a9f4061122ad28a67293c72&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    81         'settings'     => '',
    82         'pro_version'  => 'contact-form-multi-pro/contact-form-multi-pro.php',
    83         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/contact-form-multi/buy/?k=fde3a18581c143654f060c398b07e8ac&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    84         'pro_settings' => '',
    85     ),
    86     'contact-form-to-db/contact_form_to_db.php'         => array(
    87         'category'     => array( 'admin-tools', 'recommended' ),
    88         'name'         => 'Contact Form to DB',
    89         'description'  => __( 'Save and manage Contact Form messages. Never lose important data.', 'bws-login-register' ),
    90         'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/contact-form-to-db/?k=ba3747d317c2692e4136ca096a8989d6&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    91         'settings'     => 'admin.php?page=contact_form_to_db.php',
    92         'pro_version'  => 'contact-form-to-db-pro/contact_form_to_db_pro.php',
    93         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/contact-form-to-db/buy/?k=6ce5f4a9006ec906e4db643669246c6a&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    94         'pro_settings' => 'admin.php?page=contact_form_to_db_pro.php',
    95     ),
    96     'custom-admin-page/custom-admin-page.php'           => array(
    97         'category'     => array( 'admin-tools' ),
    98         'name'         => 'Custom Admin Page',
    99         'description'  => __( 'Add unlimited custom pages to WordPress admin dashboard.', 'bws-login-register' ),
    100         'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/custom-admin-page/?k=9ac03f16c25e845e8e055a221c3e1467&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    101         'settings'     => 'edit.php?post_type=bws-admin_page&page=custom-admin-page.php',
    102         'pro_version'  => 'custom-admin-page-pro/custom-admin-page-pro.php',
    103         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/custom-admin-page/buy/?k=b986f456dba092b537f1a7755a363be9&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    104         'pro_settings' => 'edit.php?post_type=bws-admin_page&page=custom-admin-page-pro.php',
    105     ),
    10656    'custom-search-plugin/custom-search-plugin.php'     => array(
    10757        'category'     => array( 'navigation' ),
    10858        'name'         => 'Custom Search',
    109         'description'  => __( 'Add custom post types and taxonomies to WordPress website search results.', 'bws-login-register' ),
     59        'description'  => __( 'Add custom post types and taxonomies to WordPress website search results.', 'bestwebsoft' ),
    11060        'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/custom-search/?k=933be8f3a8b8719d95d1079d15443e29&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    11161        'settings'     => 'admin.php?page=custom_search.php',
     
    11464        'pro_settings' => 'admin.php?page=custom_search_pro.php',
    11565    ),
    116     'donate-button/donate.php'                          => array(
    117         'category'    => array( 'ecommerce' ),
    118         'name'        => 'Donate',
    119         'description' => __( 'Add PayPal and 2CO donate buttons to receive charity payments.', 'bws-login-register' ),
    120         'link'        => 'https://bestwebsoft.com/products/wordpress/plugins/donate/?k=a8b2e2a56914fb1765dd20297c26401b&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    121         'settings'    => 'admin.php?page=donate.php',
    122     ),
    12366    'error-log-viewer/error-log-viewer.php'             => array(
    12467        'category'    => array( 'admin-tools' ),
    12568        'name'        => 'Error Log Viewer',
    126         'description' => __( 'Get latest error log messages to diagnose website problems. Define and fix issues faster.', 'bws-login-register' ),
     69        'description' => __( 'Get latest error log messages to diagnose website problems. Define and fix issues faster.', 'bestwebsoft' ),
    12770        'link'        => 'https://bestwebsoft.com/products/wordpress/plugins/error-log-viewer/?k=da0de8bd2c7a0b2fea5df64d55a368b3&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    12871        'settings'    => 'admin.php?page=rrrlgvwr.php&tab=settings',
    129     ),
    130     'facebook-button-plugin/facebook-button-plugin.php' => array(
    131         'category'     => array( 'smm' ),
    132         'name'         => 'Like & Share',
    133         'description'  => __( 'Add Facebook Follow, Like, and Share buttons to WordPress posts, pages, and widgets.', 'bws-login-register' ),
    134         'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/facebook-like-button/?k=05ec4f12327f55848335802581467d55&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    135         'settings'     => 'admin.php?page=facebook-button-plugin.php',
    136         'pro_version'  => 'facebook-button-pro/facebook-button-pro.php',
    137         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/facebook-like-button/buy/?k=8da168e60a831cfb3525417c333ad275&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    138         'pro_settings' => 'admin.php?page=facebook-button-pro.php',
    13972    ),
    14073    'gallery-plugin/gallery-plugin.php'                 => array(
    14174        'category'     => array( 'content', 'recommended' ),
    14275        'name'         => 'Gallery',
    143         'description'  => __( 'Add beautiful galleries, albums & images to your WordPress website in a few clicks.', 'bws-login-register' ),
     76        'description'  => __( 'Add beautiful galleries, albums & images to your WordPress website in a few clicks.', 'bestwebsoft' ),
    14477        'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/gallery/?k=2da21c0a64eec7ebf16337fa134c5f78&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    14578        'settings'     => 'admin.php?page=gallery-plugin.php',
     
    15184        'category'     => array( 'security' ),
    15285        'name'         => '2-Step Verification',
    153         'description'  => __( 'Stronger security solution which protects your WordPress website from hacks and unauthorized login attempts.', 'bws-login-register' ),
     86        'description'  => __( 'Stronger security solution which protects your WordPress website from hacks and unauthorized login attempts.', 'bestwebsoft' ),
    15487        'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/google-2-step-verification/?k=78de1a525f968d56e39f7325908aa98e&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    15588        'settings'     => 'admin.php?page=google-2-step-verification.php',
     
    15891        'pro_settings' => 'admin.php?page=google-2-step-verification-pro.php',
    15992    ),
    160     'bws-adsense/bws-adsense.php'                       => array(
    161         'category'     => array( 'marketing' ),
    162         'name'         => 'AdS',
    163         'description'  => __( 'Add Adsense ads to WordPress website pages, posts, custom posts, search results, categories, tags, and widgets.', 'bws-login-register' ),
    164         'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/google-adsense/?k=9d719e415eee289845b00843e8847bc9&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    165         'settings'     => 'admin.php?page=bws-adsense.php',
    166         'pro_version'  => 'adsense-pro/adsense-pro.php',
    167         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/google-adsense/buy/?k=60e3979921e354feb0347e88e7d7b73d&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    168         'pro_settings' => 'admin.php?page=adsense-pro.php',
    169     ),
    170     'bws-google-analytics/bws-google-analytics.php'     => array(
    171         'category'     => array( 'admin-tools' ),
    172         'name'         => 'Analytics',
    173         'description'  => __( 'Add Google Analytics code to WordPress website and track basic stats.', 'bws-login-register' ),
    174         'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/bws-google-analytics/?k=261c74cad753fb279cdf5a5db63fbd43&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    175         'settings'     => 'admin.php?page=bws-google-analytics.php',
    176         'pro_version'  => 'bws-google-analytics-pro/bws-google-analytics-pro.php',
    177         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/bws-google-analytics/buy/?k=83796e84fec3f70ecfcc8894a73a6c4a&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    178         'pro_settings' => 'admin.php?page=bws-google-analytics-pro.php',
    179     ),
    18093    'google-captcha/google-captcha.php'                 => array(
    18194        'category'     => array( 'security', 'recommended' ),
    18295        'name'         => 'reCaptcha',
    183         'description'  => __( 'Protect WordPress website forms from spam entries with reCaptcha.', 'bws-login-register' ),
     96        'description'  => __( 'Protect WordPress website forms from spam entries with reCaptcha.', 'bestwebsoft' ),
    18497        'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/google-captcha/?k=7b59fbe542acf950b29f3e020d5ad735&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    18598        'settings'     => 'admin.php?page=google-captcha.php',
     
    188101        'pro_settings' => 'admin.php?page=google-captcha-pro.php',
    189102    ),
    190     'bws-google-maps/bws-google-maps.php'               => array(
    191         'category'     => array( 'content' ),
    192         'name'         => 'Maps',
    193         'description'  => __( 'Add customized Google maps to WordPress posts, pages and widgets.', 'bws-login-register' ),
    194         'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/bws-google-maps/?k=d8fac412d7359ebaa4ff53b46572f9f7&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    195         'settings'     => 'admin.php?page=bws-google-maps.php',
    196         'pro_version'  => 'bws-google-maps-pro/bws-google-maps-pro.php',
    197         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/bws-google-maps/buy/?k=117c3f9fc17f2c83ef430a8a9dc06f56&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    198         'pro_settings' => 'admin.php?page=bws-google-maps-pro.php',
    199     ),
    200103    'google-sitemap-plugin/google-sitemap-plugin.php'   => array(
    201104        'category'     => array( 'seo', 'recommended' ),
    202105        'name'         => 'Sitemap',
    203         'description'  => __( 'Generate and add XML sitemap to WordPress website. Help search engines index your blog.', 'bws-login-register' ),
     106        'description'  => __( 'Generate and add XML sitemap to WordPress website. Help search engines index your blog.', 'bestwebsoft' ),
    204107        'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/google-sitemap/?k=5202b2f5ce2cf85daee5e5f79a51d806&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    205108        'settings'     => 'admin.php?page=google-sitemap-plugin.php',
     
    208111        'pro_settings' => 'admin.php?page=google-sitemap-pro.php',
    209112    ),
    210     'google-shortlink/google-shortlink.php'             => array(
    211         'category'    => array( 'seo' ),
    212         'name'        => 'Shortlink',
    213         'description' => __( 'Replace external WordPress website links with Google shortlinks and track click stats.', 'bws-login-register' ),
    214         'link'        => 'https://bestwebsoft.com/products/wordpress/plugins/google-shortlink/?k=afcf3eaed021bbbbeea1090e16bc22db&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    215         'settings'    => 'admin.php?page=gglshrtlnk_options',
    216     ),
    217     'gpt-ai-content-creator-by-bestwebsoft/gpt-ai-content-creator-by-bestwebsoft.php' => array(
    218         'category'     => array( 'content', 'recommended' ),
    219         'name'         => 'GPT AI Content Creator',
    220         'description'  => __( 'Create Content with GPT.', 'bws-login-register' ),
    221         'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/gpt-ai-content-creator/?k=f1ef1b7d7d05f93c570b940cc9acfe15&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    222         'settings'     => 'admin.php?page=gpt-ai-content-creator.php',
    223         'icon'         => lgnrgstrfrm_menu_url( 'icons/plugins/' ) . 'gpt-ai-content-creator.png',
    224         'pro_version'  => 'gpt-ai-content-creator-pro-by-bestwebsoft/gpt-ai-content-creator-pro-by-bestwebsoft.php',
    225         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/gpt-ai-content-creator/buy/?k=8b19619d4a36f8b42c5d4fbcbd9775bb&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    226         'pro_settings' => 'admin.php?page=gpt-ai-content-creator-pro.php',
    227     ),
    228     'htaccess/htaccess.php'                             => array(
     113    'htaccess/htaccess.php'                            => array(
    229114        'category'     => array( 'security' ),
    230115        'name'         => 'Htaccess',
    231         'description'  => __( 'Protect WordPress website – allow and deny access for certain IP addresses, hostnames, etc.', 'bws-login-register' ),
     116        'description'  => __( 'Protect WordPress website – allow and deny access for certain IP addresses, hostnames, etc.', 'bestwebsoft' ),
    232117        'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/htaccess/?k=2b865fcd56a935d22c5c4f1bba52ed46&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    233118        'settings'     => 'admin.php?page=htaccess.php',
     
    236121        'pro_settings' => 'admin.php?page=htaccess-pro.php',
    237122    ),
    238     'job-board/job-board.php'                           => array(
    239         'category'    => array( 'ecommerce' ),
    240         'name'        => 'Job Board',
    241         'description' => __( 'Create your personal job board and listing WordPress website. Search jobs, submit CV/resumes, choose candidates.', 'bws-login-register' ),
    242         'link'        => 'https://bestwebsoft.com/products/wordpress/plugins/job-board/?k=b0c504c9ce6edd6692e04222af3fed6f&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    243         'settings'    => 'admin.php?page=job-board.php',
    244     ),
    245123    'limit-attempts/limit-attempts.php'                 => array(
    246124        'category'     => array( 'security', 'recommended' ),
    247125        'name'         => 'Limit Attempts',
    248         'description'  => __( 'Protect WordPress website against brute force attacks. Limit rate of login attempts.', 'bws-login-register' ),
     126        'description'  => __( 'Protect WordPress website against brute force attacks. Limit rate of login attempts.', 'bestwebsoft' ),
    249127        'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/limit-attempts/?k=b14e1697ee4d008abcd4bd34d492573a&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    250128        'settings'     => 'admin.php?page=limit-attempts.php',
     
    253131        'pro_settings' => 'admin.php?page=limit-attempts-pro.php',
    254132    ),
    255     'bws-linkedin/bws-linkedin.php'                     => array(
    256         'category'     => array( 'smm' ),
    257         'name'         => 'LinkedIn',
    258         'description'  => __( 'Add LinkedIn Share and Follow buttons to WordPress posts, pages and widgets. 5 plugins included – profile, insider, etc.', 'bws-login-register' ),
    259         'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/linkedin/?k=d63c7319622ccc5f589dd2d545c1d77c&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    260         'settings'     => 'admin.php?page=linkedin.php',
    261         'pro_version'  => 'bws-linkedin-pro/bws-linkedin-pro.php',
    262         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/linkedin/buy/?k=41dcc36192994408d24b103a02134567&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    263         'pro_settings' => 'admin.php?page=linkedin-pro.php',
    264     ),
    265133    'bws-login-register/bws-login-register.php'         => array(
    266         'category'     => array( 'smm' ),
     134        'category'     => array( 'admin-tools', 'navigation' ),
    267135        'name'         => 'Login & Register Form',
    268         'description'  => __( 'Add LinkedIn Share and Follow buttons to WordPress posts, pages and widgets. 5 plugins included – profile, insider, etc.', 'bws-login-register' ),
    269         'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/linkedin/?k=d63c7319622ccc5f589dd2d545c1d77c&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
     136        'description'  => __( 'Add LinkedIn Share and Follow buttons to WordPress posts, pages and widgets. 5 plugins included – profile, insider, etc.', 'bestwebsoft' ),
     137        'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/login-and-register/?k=7d503ba164eca02ddf5b2c4942cbb953&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    270138        'settings'     => 'admin.php?page=login-register-form.php',
    271         'pro_version'  => 'bws-linkedin-pro/bws-linkedin-pro.php',
    272         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/linkedin/buy/?k=41dcc36192994408d24b103a02134567&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    273         'pro_settings' => 'admin.php?page=linkedin-pro.php',
     139        'pro_version'  => 'bws-login-register-pro/bws-login-register-pro.php',
     140        'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/login-and-register/buy/?k=df2a23c0abf357439d325bf3953deaf8&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
     141        'pro_settings' => 'admin.php?page=bws-login-register-pro.php',
    274142    ),
    275143    'multilanguage/multilanguage.php'                   => array(
    276144        'category'     => array( 'content', 'recommended' ),
    277145        'name'         => 'Multilanguage',
    278         'description'  => __( 'Translate WordPress website content to other languages manually. Create multilingual pages, posts, widgets, menus, etc.', 'bws-login-register' ),
     146        'description'  => __( 'Translate WordPress website content to other languages manually. Create multilingual pages, posts, widgets, menus, etc.', 'bestwebsoft' ),
    279147        'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/multilanguage/?k=7d68c7bfec2486dc350c67fff57ad433&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    280148        'settings'     => 'admin.php?page=mltlngg_settings',
     
    286154        'category'     => array( 'navigation' ),
    287155        'name'         => 'Pagination',
    288         'description'  => __( 'Add customizable pagination to WordPress website. Split long content to multiple pages for better navigation.', 'bws-login-register' ),
     156        'description'  => __( 'Add customizable pagination to WordPress website. Split long content to multiple pages for better navigation.', 'bestwebsoft' ),
    289157        'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/pagination/?k=22adb940256f149559ba8fedcd728ac8&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    290158        'settings'     => 'admin.php?page=pagination.php',
     
    296164        'category'     => array( 'content' ),
    297165        'name'         => 'PDF & Print',
    298         'description'  => __( 'Generate PDF files and print WordPress posts/pages. Customize document header/footer styles and appearance.', 'bws-login-register' ),
     166        'description'  => __( 'Generate PDF files and print WordPress posts/pages. Customize document header/footer styles and appearance.', 'bestwebsoft' ),
    299167        'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/pdf-print/?k=bfefdfb522a4c0ff0141daa3f271840c&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    300168        'settings'     => 'admin.php?page=pdf-print.php',
     
    303171        'pro_settings' => 'admin.php?page=pdf-print-pro.php',
    304172    ),
    305     'bws-pinterest/bws-pinterest.php'                   => array(
    306         'category'     => array( 'smm' ),
    307         'name'         => 'Pinterest',
    308         'description'  => __( 'Add Pinterest Follow, Pin It buttons and profile widgets (Pin, Board, Profile) to WordPress posts, pages and widgets.', 'bws-login-register' ),
    309         'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/pinterest/?k=504107b6213f247a67fe7ffb94e97c78&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    310         'settings'     => 'admin.php?page=pinterest.php',
    311         'pro_version'  => 'bws-pinterest-pro/bws-pinterest-pro.php',
    312         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/pinterest/buy/?k=ab0069edd1914a3ca8f541bfd88bb0bb&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    313         'pro_settings' => 'admin.php?page=pinterest-pro.php',
    314     ),
    315     'portfolio/portfolio.php'                           => array(
    316         'category'     => array( 'content', 'recommended' ),
    317         'name'         => 'Portfolio',
    318         'description'  => __( 'Create your personal portfolio WordPress website. Manage and showcase past projects to get more clients.', 'bws-login-register' ),
    319         'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/portfolio/?k=1249a890c5b7bba6bda3f528a94f768b&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    320         'settings'     => 'admin.php?page=portfolio.php',
    321         'pro_version'  => 'portfolio-pro/portfolio-pro.php',
    322         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/portfolio/buy/?k=2cc716026197d36538a414b728e49fdd&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    323         'pro_settings' => 'admin.php?page=portfolio-pro.php',
    324     ),
    325     'post-to-csv/post-to-csv.php'                       => array(
    326         'category'     => array( 'admin-tools' ),
    327         'name'         => 'Post to CSV',
    328         'description'  => __( 'Export WordPress posts to CSV file format easily. Configure data order.', 'bws-login-register' ),
    329         'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/post-to-csv/?k=653aa55518ae17409293a7a894268b8f&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    330         'settings'     => 'admin.php?page=post-to-csv.php',
    331         'pro_version'  => 'post-to-csv-pro/post-to-csv-pro.php',
    332         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/post-to-csv/buy/?k=b6521601d1579ed9c556ba98234f2d8f&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    333         'pro_settings' => 'admin.php?page=post-to-csv-pro.php',
    334     ),
    335173    'profile-extra-fields/profile-extra-fields.php'     => array(
    336174        'category'     => array( 'admin-tools' ),
    337175        'name'         => 'Profile Extra Fields',
    338         'description'  => __( 'Add extra fields to default WordPress user profile. The easiest way to create and manage additional custom values.', 'bws-login-register' ),
     176        'description'  => __( 'Add extra fields to default WordPress user profile. The easiest way to create and manage additional custom values.', 'bestwebsoft' ),
    339177        'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/profile-extra-fields/?k=fe3b6c3dbc80bd4b1cf9a27a2f339820&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    340178        'settings'     => 'admin.php?page=profile-extra-fields.php',
     
    343181        'pro_settings' => 'admin.php?page=profile-extra-fields-pro.php',
    344182    ),
    345     'promobar/promobar.php'                             => array(
    346         'category'     => array( 'marketing' ),
    347         'name'         => 'PromoBar',
    348         'description'  => __( 'Add and display HTML advertisement banner on WordPress website. Customize bar styles and appearance.', 'bws-login-register' ),
    349         'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/promobar/?k=619eac2232d9cfa382c4e678c3b14766&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    350         'settings'     => 'admin.php?page=promobar.php',
    351         'pro_version'  => 'promobar-pro/promobar-pro.php',
    352         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/promobar/buy/?k=a9b09708502f12a1483532ba12fe2103&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    353         'pro_settings' => 'admin.php?page=promobar-pro.php',
    354     ),
    355183    'quotes-and-tips/quotes-and-tips.php'               => array(
    356184        'category'    => array( 'content' ),
    357185        'name'        => 'Quotes and Tips',
    358         'description' => __( 'Add customizable quotes and tips blocks to WordPress posts, pages and widgets.', 'bws-login-register' ),
     186        'description' => __( 'Add customizable quotes and tips blocks to WordPress posts, pages and widgets.', 'bestwebsoft' ),
    359187        'link'        => 'https://bestwebsoft.com/products/wordpress/plugins/quotes-and-tips/?k=5738a4e85a798c4a5162240c6515098d&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    360188        'settings'    => 'admin.php?page=quotes-and-tips.php',
    361         'pro_version'  => 'quotes-and-tips-pro/quotes-and-tips-pro.php',
    362         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/quotes-and-tips/buy/?k=75347ac9699d9e965a81673fbbb80876&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    363         'pro_settings' => 'admin.php?page=quotes-and-tips-pro.php',
    364     ),
    365     'rating-bws/rating-bws.php'                         => array(
    366         'category'     => array( 'marketing' ),
    367         'name'         => 'Rating',
    368         'description'  => __( 'Add rating plugin to your WordPress website to receive feedback from your customers.', 'bws-login-register' ),
    369         'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/rating/?k=c00e0824bb999735a3224616ef51f4c5&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    370         'settings'     => 'admin.php?page=rating.php',
    371         'pro_version'  => 'rating-bws-pro/rating-bws-pro.php',
    372         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/rating/buy/?k=ba459f3115edb7be610e8d6f8e05df6c&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    373         'pro_settings' => 'admin.php?page=rating-bws-pro.php',
    374     ),
    375     'realty/realty.php'                                 => array(
    376         'category'     => array( 'ecommerce' ),
    377         'name'         => 'Realty',
    378         'description'  => __( 'Create your personal real estate WordPress website. Sell, rent and buy properties. Add, search and browse listings easily.', 'bws-login-register' ),
    379         'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/realty/?k=d55de979dbbbb7af0b2ff1d7f43884fa&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    380         'settings'     => 'admin.php?page=realty_settings',
    381         'pro_version'  => 'realty-pro/realty-pro.php',
    382         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/realty/buy/?k=c7791f0a72acfb36f564a614dbccb474&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    383         'pro_settings' => 'admin.php?page=realty_pro_settings',
    384     ),
    385     'relevant/related-posts-plugin.php'                 => array(
    386         'category'    => array( 'marketing', 'recommended' ),
    387         'name'        => 'Relevant - Related, Featured, Latest, and Popular Posts',
    388         'description' => __( 'Add related, featured, latest, and popular posts to your WordPress website. Connect your blog readers with a relevant content.', 'bws-login-register' ),
    389         'link'        => 'https://bestwebsoft.com/products/wordpress/plugins/related-posts/?k=73fb737037f7141e66415ec259f7e426&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    390         'settings'    => 'admin.php?page=related-posts-plugin.php',
    391         'pro_version'  => 'relevant-pro/related-posts-pro.php',
    392         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/related-posts/buy/?k=16368e8d55909c4852dd0fe39f89ed556&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    393         'pro_settings' => 'admin.php?page=related-posts-pro.php',
    394     ),
    395     'sender/sender.php'                                 => array(
    396         'category'     => array( 'marketing', 'recommended' ),
    397         'name'         => 'Sender',
    398         'description'  => __( 'Send bulk email messages to WordPress users. Custom templates, advanced settings and detailed reports.', 'bws-login-register' ),
    399         'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/sender/?k=89c297d14ba85a8417a0f2fc05e089c7&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    400         'settings'     => 'admin.php?page=sndr_settings',
    401         'pro_version'  => 'sender-pro/sender-pro.php',
    402         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/sender/buy/?k=dc5d1a87bdc8aeab2de40ffb99b38054&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    403         'pro_settings' => 'admin.php?page=sndrpr_settings',
    404     ),
    405     'slider-bws/slider-bws.php'                         => array(
    406         'category'    => array( 'content' ),
    407         'name'        => 'Slider',
    408         'description' => __( 'The best responsive slider plugin for your WordPress website. Create beautifully animated slides just in a few clicks.', 'bws-login-register' ),
    409         'link'        => 'https://bestwebsoft.com/products/wordpress/plugins/slider/?k=02acebf8531b2995e7de8474ae28e290&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    410         'settings'    => 'admin.php?page=slider-settings.php',
    411     ),
    412     'bws-smtp/bws-smtp.php'                             => array(
    413         'category'    => array( 'admin-tools' ),
    414         'name'        => 'SMTP',
    415         'description' => __( 'Configure SMTP server to receive email messages from WordPress to Gmail, Yahoo, Hotmail and other services.', 'bws-login-register' ),
    416         'link'        => 'https://bestwebsoft.com/products/wordpress/plugins/smtp/?k=0546419f962704429ad2d9b88567752f&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    417         'settings'    => 'admin.php?page=bwssmtp_settings',
    418     ),
    419     'social-buttons-pack/social-buttons-pack.php'       => array(
    420         'category'     => array( 'smm', 'recommended' ),
    421         'name'         => 'Social Buttons Pack',
    422         'description'  => __( 'Add social media buttons and widgets to WordPress posts, pages and widgets. FB, Twitter, Pinterest, LinkedIn.', 'bws-login-register' ),
    423         'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/social-buttons-pack/?k=b6440fad9f54274429e536b0c61b42da&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    424         'settings'     => 'admin.php?page=social-buttons.php',
    425         'pro_version'  => 'social-buttons-pack-pro/social-buttons-pack-pro.php',
    426         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/social-buttons-pack/buy/?k=e7059cacde0d275b224a5d995c9160fd&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    427         'pro_settings' => 'admin.php?page=social-buttons-pro.php',
    428     ),
    429     'social-login-bws/social-login-bws.php'             => array(
    430         'category'    => array( 'smm' ),
    431         'name'        => 'Social Login',
    432         'description' => __( 'Add social media login, registration, and commenting to your WordPress website.', 'bws-login-register' ),
    433         'link'        => 'https://bestwebsoft.com/products/wordpress/plugins/social-login/?k=62817c9c94f24129e40894e1d9c3f49d&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    434         'settings'    => 'admin.php?page=social-login.php',
    435     ),
    436     'subscriber/subscriber.php'                         => array(
    437         'category'     => array( 'marketing', 'recommended' ),
    438         'name'         => 'Subscriber',
    439         'description'  => __( 'Add email newsletter sign up form to WordPress posts, pages and widgets. Collect data and subscribe your users.', 'bws-login-register' ),
    440         'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/subscriber/?k=a4ecc1b7800bae7329fbe8b4b04e9c88&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    441         'settings'     => 'admin.php?page=subscriber.php',
    442         'pro_version'  => 'subscriber-pro/subscriber-pro.php',
    443         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/subscriber/buy/?k=02dbb8b549925d9b74e70adc2a7282e4&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    444         'pro_settings' => 'admin.php?page=subscriber-pro.php',
    445     ),
    446     'bws-testimonials/bws-testimonials.php'             => array(
    447         'category'    => array( 'marketing', 'recommended' ),
    448         'name'        => 'Testimonials',
    449         'description' => __( 'Add testimonials and feedbacks from your customers to WordPress website posts, pages, and widgets.', 'bws-login-register' ),
    450         'link'        => 'https://bestwebsoft.com/products/wordpress/plugins/testimonials/?k=3fe4bb89dc901c98e43a113e08f8db73&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    451         'settings'    => 'admin.php?page=testimonials.php',
    452         'pro_version'  => 'bws-testimonials-pro/bws-testimonials-pro.php',
    453         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/testimonials/buy/?k=3fe4bb89dc901c98e43a113e08f8db73&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    454         'pro_settings' => 'edit.php?post_type=bws-testimonial&page=testimonials-ro.php',
    455     ),
    456     'timesheet/timesheet.php'                           => array(
    457         'category'     => array( 'admin-tools' ),
    458         'name'         => 'Timesheet',
    459         'description'  => __( 'Best timesheet plugin for WordPress. Track employee time, streamline attendance and generate reports.', 'bws-login-register' ),
    460         'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/timesheet/?k=06a58bb78c17a43df01825925f05a5c1&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    461         'settings'     => 'admin.php?page=timesheet_settings',
    462         'pro_version'  => 'timesheet-pro/timesheet-pro.php',
    463         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/timesheet/buy/?k=a448ce4cab0d365b7774c9bc3903b851&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    464         'pro_settings' => 'admin.php?page=timesheet_pro_settings',
    465     ),
    466     'twitter-plugin/twitter.php'                        => array(
    467         'category'     => array( 'smm' ),
    468         'name'         => 'Twitter',
    469         'description'  => __( 'Add Twitter Follow, Tweet, Hashtag, and Mention buttons to WordPress posts and pages.', 'bws-login-register' ),
    470         'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/twitter/?k=f8cb514e25bd7ec4974d64435c5eb333&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    471         'settings'     => 'admin.php?page=twitter.php',
    472         'pro_version'  => 'twitter-pro/twitter-pro.php',
    473         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/twitter/buy/?k=63ecbf0cc9cebf060b5a3c9362299700&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    474         'pro_settings' => 'admin.php?page=twitter-pro.php',
    475189    ),
    476190    'updater/updater.php'                               => array(
    477191        'category'     => array( 'admin-tools', 'recommended' ),
    478192        'name'         => 'Updater',
    479         'description'  => __( 'Automatically check and update WordPress website core with all installed plugins and themes to the latest versions.', 'bws-login-register' ),
     193        'description'  => __( 'Automatically check and update WordPress website core with all installed plugins and themes to the latest versions.', 'bestwebsoft' ),
    480194        'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/updater/?k=66f3ecd4c1912009d395c4bb30f779d1&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    481195        'settings'     => 'admin.php?page=updater-options',
     
    487201        'category'     => array( 'admin-tools' ),
    488202        'name'         => 'User Role',
    489         'description'  => __( 'Powerful user role management plugin for WordPress website. Create, edit, copy, and delete user roles.', 'bws-login-register' ),
     203        'description'  => __( 'Powerful user role management plugin for WordPress website. Create, edit, copy, and delete user roles.', 'bestwebsoft' ),
    490204        'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/user-role/?k=dfe2244835c6fbf601523964b3f34ccc&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    491205        'settings'     => 'admin.php?page=user-role.php',
     
    494208        'pro_settings' => 'admin.php?page=user-role-pro.php',
    495209    ),
    496     'visitors-online/visitors-online.php'               => array(
    497         'category'     => array( 'admin-tools' ),
    498         'name'         => 'Visitors Online',
    499         'description'  => __( 'Display live count of online visitors who are currently browsing your WordPress website.', 'bws-login-register' ),
    500         'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/visitors-online/?k=93c28013a4f830671b3bba9502ed5177&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    501         'settings'     => 'admin.php?page=visitors-online.php',
    502         'pro_version'  => 'visitors-online-pro/visitors-online-pro.php',
    503         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/visitors-online/buy/?k=f9a746075ff8a0a6cb192cb46526afd2&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    504         'pro_settings' => 'admin.php?page=visitors-online-pro.php',
    505     ),
    506     'zendesk-help-center/zendesk-help-center.php'       => array(
    507         'category'     => array( 'admin-tools' ),
    508         'name'         => 'Help Center',
    509         'description'  => __( 'Backup and export Zendesk Help Center content automatically to your WordPress website database.', 'bws-login-register' ),
    510         'link'         => 'https://bestwebsoft.com/products/wordpress/plugins/zendesk-help-center/?k=2a5fd2f4b2f4bde46f2ca44b8d15846d&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    511         'settings'     => 'admin.php?page=zendesk_hc.php',
    512         'pro_version'  => 'zendesk-help-center-pro/zendesk-help-center-pro.php',
    513         'purchase'     => 'https://bestwebsoft.com/products/wordpress/plugins/zendesk-help-center/buy/?k=45199e4538b5befe4d9566868a61a3aa&pn=' . $bws_plugin_info['id'] . '&v=' . $bws_plugin_info['version'] . '&wp_v=' . $wp_version,
    514         'pro_settings' => 'admin.php?page=zendesk_hc_pro.php',
    515     ),
    516210);
    517211
  • bws-login-register/trunk/css/style.css

    r3301452 r3337325  
    7171    display: block;
    7272}
     73.lgnrgstrfrm-form-login-register-wrapper .prflxtrflds-field {
     74    display: inline-block;
     75    padding-left: 5px;
     76}
     77.lgnrgstrfrm-form-login-register-wrapper .gfield_radio,
     78.lgnrgstrfrm-form-login-register-wrapper .gfield_checkbox {
     79    list-style: none;
     80    padding-left: 0;
     81    margin: 0;
     82}
    7383.lgnrgstrfrm-form-login-close,
    7484.lgnrgstrfrm-form-register-close,
     
    182192.lgnrgstrfrm-design-standard input[type="password"],
    183193.lgnrgstrfrm-design-standard input[type="email"],
     194.lgnrgstrfrm-design-standard input[type="number"],
    184195.lgnrgstrfrm-design-standard select,
    185196.lgnrgstrfrm-design-standard textarea,
     
    217228    font-size: 19px;
    218229}
    219 .lgnrgstrfrm-design-rounded label {
     230.lgnrgstrfrm-design-rounded label:not(.prflxtrflds-field) {
    220231    display: none;
    221232}
    222233.lgnrgstrfrm-design-rounded input[type="text"],
    223234.lgnrgstrfrm-design-rounded input[type="password"],
    224 .lgnrgstrfrm-design-rounded input[type="email"] {
     235.lgnrgstrfrm-design-rounded input[type="email"],
     236.lgnrgstrfrm-design-rounded select,
     237.lgnrgstrfrm-design-rounded textarea,
     238.lgnrgstrfrm-design-rounded input[type="number"] {
    225239    padding-top: 0;
    226240    padding-bottom: 1px;
     
    230244.lgnrgstrfrm-design-rounded input[type="password"],
    231245.lgnrgstrfrm-design-rounded input[type="email"],
     246.lgnrgstrfrm-design-rounded input[type="number"],
    232247.lgnrgstrfrm-design-rounded select,
    233248.lgnrgstrfrm-design-rounded textarea,
  • bws-login-register/trunk/includes/class-lgnrgstrfrm-settings.php

    r3301452 r3337325  
    3232                'register_form' => array( 'label' => __( 'Register form', 'bws-login-register' ) ),
    3333                'forgot_form'   => array( 'label' => __( 'Forgot Password form', 'bws-login-register' ) ),
     34                'license'       => array( 'label' => __( 'License Key', 'bws-login-register' ) ),
    3435                'misc'          => array( 'label' => __( 'Misc', 'bws-login-register' ) )
    3536            );
     
    4546                    'tabs'               => $tabs,
    4647                    'wp_slug'            => 'bws-login-register',
    47                     'link_key'           => 'ac1e1061bf4e95ba51406b4cc32f61fa',
    48                     'link_pn'            => '110',
     48                    'link_key'           => 'e2846e391e7d7500bc0e7144de889f36',
     49                    'link_pn'            => '1085',
    4950                    'doc_link'           => 'https://bestwebsoft.com/documentation/login-register-form/',
    5051                )
     
    160161                    <th scope="row"><?php esc_html_e( 'Design', 'bws-login-register' ); ?></th>
    161162                    <td>
    162                         <label><input type="radio" name="lgnrgstrfrm_design" value="standard" <?php checked( $this->options['design'], 'standard' ); ?> /> <?php esc_html_e( 'Standard', 'bws-login-register' ); ?> <?php echo wp_kses_post( lgnrgstrfrm_add_help_box( '<img src="' . plugins_url( 'images/login_standard.jpg', __DIR__ ) . '" width="471" />', 'bws-hide-for-mobile bws-auto-width lgnrgstrfrm-standard' ) ); ?></label><br />
    163                         <label><input type="radio" name="lgnrgstrfrm_design" value="rounded" <?php checked( $this->options['design'], 'rounded' ); ?> /> <?php esc_html_e( 'Rounded', 'bws-login-register' ); ?>  <?php echo wp_kses_post( lgnrgstrfrm_add_help_box( '<img src="' . plugins_url( 'images/login_rounded.jpg', __DIR__ ) . '" width="408" />', 'bws-hide-for-mobile bws-auto-width lgnrgstrfrm-rounded' ) ); ?></label><br />
     163                        <label><input type="radio" name="lgnrgstrfrm_design" value="standard" <?php checked( $this->options['design'], 'standard' ); ?> /> <?php esc_html_e( 'Standard', 'bws-login-register' ); ?> <?php echo wp_kses_post( bws_add_help_box( '<img src="' . plugins_url( 'images/login_standard.jpg', __DIR__ ) . '" width="471" />', 'bws-hide-for-mobile bws-auto-width lgnrgstrfrm-standard' ) ); ?></label><br />
     164                        <label><input type="radio" name="lgnrgstrfrm_design" value="rounded" <?php checked( $this->options['design'], 'rounded' ); ?> /> <?php esc_html_e( 'Rounded', 'bws-login-register' ); ?>  <?php echo wp_kses_post( bws_add_help_box( '<img src="' . plugins_url( 'images/login_rounded.jpg', __DIR__ ) . '" width="408" />', 'bws-hide-for-mobile bws-auto-width lgnrgstrfrm-rounded' ) ); ?></label><br />
    164165                    </td>
    165166                </tr>
     
    300301                                <label><input type="checkbox" name="lgnrgstrfrm_login_form_display_reg_link" value="1" <?php checked( $this->options['login_form_display_reg_link'] ); ?> /> <?php esc_html_e( 'Register link', 'bws-login-register' ); ?></label><br />
    301302                            </div>
     303                            <div style="clear: both; white-space: nowrap;">
     304                                <?php
     305                                if ( array_key_exists( 'captcha-bws/captcha-bws.php', $all_plugins ) || array_key_exists( 'captcha-plus/captcha-plus.php', $all_plugins ) || array_key_exists( 'captcha-pro/captcha_pro.php', $all_plugins ) ) {
     306                                    if ( array_key_exists( 'captcha', $lgnrgstrfrm_related_plugins ) ) {
     307                                        $captcha_enabled = ! empty( $lgnrgstrfrm_related_plugins['captcha']['options']['forms']['bws_login']['enable'] ) ? true : false;
     308                                        $display_captcha = ! empty( $this->options['login_form_display_captcha'] ) ? true : false;
     309
     310                                        $captcha_enabled = true;
     311
     312                                        if ( $captcha_enabled ) {
     313                                            ?>
     314                                            <label><input type="checkbox" name="lgnrgstrfrm_login_form_display_captcha" value="1" <?php checked( $display_captcha ); ?> /> Captcha by BestWebSoft </label>
     315                                            <?php
     316                                        } else {
     317                                            ?>
     318                                            <label>
     319                                                <input type="checkbox" name="lgnrgstrfrm_login_form_display_captcha" value="1" disabled="disabled" <?php checked( $display_captcha ); ?> /> Captcha by BestWebSoft
     320                                                <span class="bws_info">&nbsp;(<?php esc_html_e( 'Please activate the appropriate option on', 'bws-login-register' ); ?>&nbsp;
     321                                                    <?php
     322                                                    printf(
     323                                                        '<a href="%s" target="_blank"> Captcha %s</a>&nbsp;)',
     324                                                        esc_url( self_admin_url( '/admin.php?page=' . $lgnrgstrfrm_related_plugins['captcha']['settings_page'] ) ),
     325                                                        esc_html__( 'settings page', 'bws-login-register' )
     326                                                    );
     327                                                    ?>
     328                                                </span>
     329                                            </label>
     330                                            <?php
     331                                        }
     332                                    } else {
     333                                        ?>
     334                                        <label><input disabled="disabled" type="checkbox" name="lgnrgstrfrm_login_form_display_captcha" value="1" /> Captcha by BestWebSoft</label>
     335                                        <span class="bws_info">
     336                                            <?php printf( '<a href="%s" target="_blank">%s Captcha</a>', esc_url( self_admin_url( 'plugins.php' ) ), esc_html__( 'Activate', 'bws-login-register' ) ); ?>
     337                                        </span>
     338                                        <?php
     339                                    }
     340                                } else {
     341                                    ?>
     342                                    <label><input disabled="disabled" type="checkbox" name="lgnrgstrfrm_login_form_display_captcha" value="1" /> Captcha by BestWebSoft</label>
     343                                    <span class="bws_info">
     344                                        <?php printf( '<a href="https://bestwebsoft.com/products/wordpress/plugins/captcha/?k=19ac1e9b23bea947cfc4a9b8e3326c03&amp;pn=77&amp;v=%s&amp;wp_v=%s" target="_blank">%s Captcha</a>', esc_attr( $lgnrgstrfrm_plugin_info['Version'] ), esc_attr( $wp_version ), esc_html__( 'Download', 'bws-login-register' ) ); ?>
     345                                    </span>
     346                                <?php } ?>
     347                            </div>
     348                            <div style="clear: both; white-space: nowrap;">
     349                                <?php
     350                                if ( array_key_exists( 'google-captcha/google-captcha.php', $all_plugins ) || array_key_exists( 'google-captcha-pro/google-captcha-pro.php', $all_plugins ) || array_key_exists( 'google-captcha-plus/google-captcha-plus.php', $all_plugins ) ) {
     351                                    if ( array_key_exists( 'google-captcha', $lgnrgstrfrm_related_plugins ) ) {
     352                                        $google_captcha_enabled = ! empty( $lgnrgstrfrm_related_plugins['google-captcha']['options']['bws_login'] ) ? true : false;
     353                                        $display_recaptcha      = ! empty( $this->options['login_form_display_recaptcha'] ) ? true : false;
     354
     355                                        if ( $google_captcha_enabled ) {
     356                                            ?>
     357                                            <label><input type="checkbox" name="lgnrgstrfrm_login_form_display_recaptcha" value="1" <?php checked( $display_recaptcha ); ?> /> reCaptcha by BestWebSoft</label>
     358                                        <?php } else { ?>
     359                                            <label>
     360                                                <input type="checkbox" name="lgnrgstrfrm_login_form_display_recaptcha" value="1" disabled="disabled" <?php checked( $display_recaptcha ); ?> /> reCaptcha by BestWebSoft
     361                                                <span class="bws_info">&nbsp;(<?php esc_html_e( 'Please activate the appropriate option on', 'bws-login-register' ); ?>&nbsp;
     362                                                    <?php
     363                                                    printf(
     364                                                        '<a href="%s" target="_blank"> reCaptcha by BestWebSoft %s</a>&nbsp;)',
     365                                                        esc_url( self_admin_url( '/admin.php?page=' . $lgnrgstrfrm_related_plugins['google-captcha']['settings_page'] ) ),
     366                                                        esc_html__( 'settings page', 'bws-login-register' )
     367                                                    );
     368                                                    ?>
     369                                                </span>
     370                                            </label>
     371                                            <?php
     372                                        }
     373                                    } else {
     374                                        ?>
     375                                        <label><input disabled="disabled" type="checkbox" name="lgnrgstrfrm_login_form_display_recaptcha" value="1" /> reCaptcha by BestWebSoft</label>
     376                                        <span class="bws_info">
     377                                            <?php printf( '<a href="%s" target="_blank">%s reCaptcha</a>', esc_url( self_admin_url( 'plugins.php' ) ), esc_html__( 'Activate', 'bws-login-register' ) ); ?>
     378                                        </span>
     379                                        <?php
     380                                    }
     381                                } else {
     382                                    ?>
     383                                    <label><input disabled="disabled" type="checkbox" name="lgnrgstrfrm_login_form_display_recaptcha" value="1" /> reCaptcha by BestWebSoft</label> <span class="bws_info">
     384                                        <?php printf( '<a href="https://bestwebsoft.com/products/wordpress/plugins/google-captcha/?k=7d74e61dd1cea23d0e9bf2fa88b5b117&amp;pn=77&amp;v=%s&amp;wp_v=%s" target="_blank">%s reCaptcha</a>', esc_attr( $lgnrgstrfrm_plugin_info['Version'] ), esc_attr( $wp_version ), esc_html__( 'Download', 'bws-login-register' ) ); ?>
     385                                        </span>
     386                                <?php } ?>
     387                            </div>
    302388                        </fieldset>
    303389                    </td>
     
    363449                                </span>
    364450                            </div>
     451                            <div style="clear: both; white-space: nowrap;">
     452                                <?php
     453                                if ( array_key_exists( 'captcha-bws/captcha-bws.php', $all_plugins ) || array_key_exists( 'captcha-plus/captcha-plus.php', $all_plugins ) || array_key_exists( 'captcha-pro/captcha_pro.php', $all_plugins ) ) {
     454                                    if ( array_key_exists( 'captcha', $lgnrgstrfrm_related_plugins ) ) {
     455                                        $captcha_enabled = ! empty( $lgnrgstrfrm_related_plugins['captcha']['options']['forms']['bws_register']['enable'] ) ? true : false;
     456                                        $display_captcha = ! empty( $this->options['register_form_display_captcha'] ) ? true : false;
     457
     458                                        $captcha_enabled = true;
     459
     460                                        if ( $captcha_enabled ) {
     461                                            ?>
     462                                            <label><input type="checkbox" name="lgnrgstrfrm_register_form_display_captcha" value="1" <?php checked( $display_captcha ); ?> /> Captcha by BestWebSoft </label>
     463                                            <?php
     464                                        } else {
     465                                            ?>
     466                                            <label>
     467                                                <input type="checkbox" name="lgnrgstrfrm_register_form_display_captcha" value="1" disabled="disabled" <?php checked( $display_captcha ); ?> /> Captcha by BestWebSoft
     468                                                <span class="bws_info">&nbsp;(<?php esc_html_e( 'Please activate the appropriate option on', 'bws-login-register' ); ?>&nbsp;
     469                                                    <?php
     470                                                    printf(
     471                                                        '<a href="%s" target="_blank"> Captcha %s</a>&nbsp;)',
     472                                                        esc_url( self_admin_url( '/admin.php?page=' . $lgnrgstrfrm_related_plugins['captcha']['settings_page'] ) ),
     473                                                        esc_html__( 'settings page', 'bws-login-register' )
     474                                                    );
     475                                                    ?>
     476                                                </span>
     477                                            </label>
     478                                            <?php
     479                                        }
     480                                    } else {
     481                                        ?>
     482                                        <label><input disabled="disabled" type="checkbox" name="lgnrgstrfrm_register_form_display_captcha" value="1" /> Captcha by BestWebSoft</label>
     483                                        <span class="bws_info">
     484                                            <?php printf( '<a href="%s" target="_blank">%s Captcha</a>', esc_url( self_admin_url( 'plugins.php' ) ), esc_html__( 'Activate', 'bws-login-register' ) ); ?>
     485                                        </span>
     486                                        <?php
     487                                    }
     488                                } else {
     489                                    ?>
     490                                    <label><input disabled="disabled" type="checkbox" name="lgnrgstrfrm_register_form_display_captcha" value="1" /> Captcha by BestWebSoft</label>
     491                                    <span class="bws_info">
     492                                        <?php printf( '<a href="https://bestwebsoft.com/products/wordpress/plugins/captcha/?k=19ac1e9b23bea947cfc4a9b8e3326c03&amp;pn=77&amp;v=%s&amp;wp_v=%s" target="_blank">%s Captcha</a>', esc_attr( $lgnrgstrfrm_plugin_info['Version'] ), esc_attr( $wp_version ), esc_html__( 'Download', 'bws-login-register' ) ); ?>
     493                                    </span>
     494                                <?php } ?>
     495                            </div>
     496                            <div style="clear: both; white-space: nowrap;">
     497                                <?php
     498                                if ( array_key_exists( 'google-captcha/google-captcha.php', $all_plugins ) || array_key_exists( 'google-captcha-pro/google-captcha-pro.php', $all_plugins ) || array_key_exists( 'google-captcha-plus/google-captcha-plus.php', $all_plugins ) ) {
     499                                    if ( array_key_exists( 'google-captcha', $lgnrgstrfrm_related_plugins ) ) {
     500                                        $google_captcha_enabled = ! empty( $lgnrgstrfrm_related_plugins['google-captcha']['options']['bws_register'] ) ? true : false;
     501                                        $display_recaptcha      = ! empty( $this->options['register_form_display_recaptcha'] ) ? true : false;
     502
     503                                        if ( $google_captcha_enabled ) {
     504                                            ?>
     505                                            <label><input type="checkbox" name="lgnrgstrfrm_register_form_display_recaptcha" value="1" <?php checked( $display_recaptcha ); ?> /> reCaptcha by BestWebSoft</label>
     506                                        <?php } else { ?>
     507                                            <label>
     508                                                <input type="checkbox" name="lgnrgstrfrm_register_form_display_recaptcha" value="1" disabled="disabled" <?php checked( $display_recaptcha ); ?> /> reCaptcha by BestWebSoft
     509                                                <span class="bws_info">&nbsp;(<?php esc_html_e( 'Please activate the appropriate option on', 'bws-login-register' ); ?>&nbsp;
     510                                                    <?php
     511                                                    printf(
     512                                                        '<a href="%s" target="_blank"> reCaptcha by BestWebSoft %s</a>&nbsp;)',
     513                                                        esc_url( self_admin_url( '/admin.php?page=' . $lgnrgstrfrm_related_plugins['google-captcha']['settings_page'] ) ),
     514                                                        esc_html__( 'settings page', 'bws-login-register' )
     515                                                    );
     516                                                    ?>
     517                                                </span>
     518                                            </label>
     519                                            <?php
     520                                        }
     521                                    } else {
     522                                        ?>
     523                                        <label><input disabled="disabled" type="checkbox" name="lgnrgstrfrm_register_form_display_recaptcha" value="1" /> reCaptcha by BestWebSoft</label>
     524                                        <span class="bws_info">
     525                                            <?php printf( '<a href="%s" target="_blank">%s reCaptcha</a>', esc_url( self_admin_url( 'plugins.php' ) ), esc_html__( 'Activate', 'bws-login-register' ) ); ?>
     526                                        </span>
     527                                        <?php
     528                                    }
     529                                } else {
     530                                    ?>
     531                                    <label><input disabled="disabled" type="checkbox" name="lgnrgstrfrm_register_form_display_recaptcha" value="1" /> reCaptcha by BestWebSoft</label> <span class="bws_info">
     532                                        <?php printf( '<a href="https://bestwebsoft.com/products/wordpress/plugins/google-captcha/?k=7d74e61dd1cea23d0e9bf2fa88b5b117&amp;pn=77&amp;v=%s&amp;wp_v=%s" target="_blank">%s reCaptcha</a>', esc_attr( $lgnrgstrfrm_plugin_info['Version'] ), esc_attr( $wp_version ), esc_html__( 'Download', 'bws-login-register' ) ); ?>
     533                                        </span>
     534                                <?php } ?>
     535                            </div>
    365536                        </fieldset>
    366537                    </td>
     
    428599                                <label><input type="checkbox" name="lgnrgstrfrm_forgot_form_display_reg_link" value="1" <?php checked( $this->options['forgot_form_display_reg_link'] ); ?> /> <?php esc_html_e( 'Register link', 'bws-login-register' ); ?></label><br />
    429600                            </div>
     601                            <div style="clear: both; white-space: nowrap;">
     602                                <?php
     603                                if ( array_key_exists( 'captcha-bws/captcha-bws.php', $all_plugins ) || array_key_exists( 'captcha-plus/captcha-plus.php', $all_plugins ) || array_key_exists( 'captcha-pro/captcha_pro.php', $all_plugins ) ) {
     604                                    if ( array_key_exists( 'captcha', $lgnrgstrfrm_related_plugins ) ) {
     605                                        $captcha_enabled = ! empty( $lgnrgstrfrm_related_plugins['captcha']['options']['forms']['bws_forgot']['enable'] ) ? true : false;
     606                                        $display_captcha = ! empty( $this->options['forgot_form_display_captcha'] ) ? true : false;
     607
     608                                        $captcha_enabled = true;
     609
     610                                        if ( $captcha_enabled ) {
     611                                            ?>
     612                                            <label><input type="checkbox" name="lgnrgstrfrm_forgot_form_display_captcha" value="1" <?php checked( $display_captcha ); ?> /> Captcha by BestWebSoft </label>
     613                                            <?php
     614                                        } else {
     615                                            ?>
     616                                            <label>
     617                                                <input type="checkbox" name="lgnrgstrfrm_forgot_form_display_captcha" value="1" disabled="disabled" <?php checked( $display_captcha ); ?> /> Captcha by BestWebSoft
     618                                                <span class="bws_info">&nbsp;(<?php esc_html_e( 'Please activate the appropriate option on', 'bws-login-register' ); ?>&nbsp;
     619                                                    <?php
     620                                                    printf(
     621                                                        '<a href="%s" target="_blank"> Captcha %s</a>&nbsp;)',
     622                                                        esc_url( self_admin_url( '/admin.php?page=' . $lgnrgstrfrm_related_plugins['captcha']['settings_page'] ) ),
     623                                                        esc_html__( 'settings page', 'bws-login-register' )
     624                                                    );
     625                                                    ?>
     626                                                </span>
     627                                            </label>
     628                                            <?php
     629                                        }
     630                                    } else {
     631                                        ?>
     632                                        <label><input disabled="disabled" type="checkbox" name="lgnrgstrfrm_forgot_form_display_captcha" value="1" /> Captcha by BestWebSoft</label>
     633                                        <span class="bws_info">
     634                                            <?php printf( '<a href="%s" target="_blank">%s Captcha</a>', esc_url( self_admin_url( 'plugins.php' ) ), esc_html__( 'Activate', 'bws-login-register' ) ); ?>
     635                                        </span>
     636                                        <?php
     637                                    }
     638                                } else {
     639                                    ?>
     640                                    <label><input disabled="disabled" type="checkbox" name="lgnrgstrfrm_forgot_form_display_captcha" value="1" /> Captcha by BestWebSoft</label>
     641                                    <span class="bws_info">
     642                                        <?php printf( '<a href="https://bestwebsoft.com/products/wordpress/plugins/captcha/?k=19ac1e9b23bea947cfc4a9b8e3326c03&amp;pn=77&amp;v=%s&amp;wp_v=%s" target="_blank">%s Captcha</a>', esc_attr( $lgnrgstrfrm_plugin_info['Version'] ), esc_attr( $wp_version ), esc_html__( 'Download', 'bws-login-register' ) ); ?>
     643                                    </span>
     644                                <?php } ?>
     645                            </div>
     646                            <div style="clear: both; white-space: nowrap;">
     647                                <?php
     648                                if ( array_key_exists( 'google-captcha/google-captcha.php', $all_plugins ) || array_key_exists( 'google-captcha-pro/google-captcha-pro.php', $all_plugins ) || array_key_exists( 'google-captcha-plus/google-captcha-plus.php', $all_plugins ) ) {
     649                                    if ( array_key_exists( 'google-captcha', $lgnrgstrfrm_related_plugins ) ) {
     650                                        $google_captcha_enabled = ! empty( $lgnrgstrfrm_related_plugins['google-captcha']['options']['bws_forgot'] ) ? true : false;
     651                                        $display_recaptcha      = ! empty( $this->options['forgot_form_display_recaptcha'] ) ? true : false;
     652
     653                                        if ( $google_captcha_enabled ) {
     654                                            ?>
     655                                            <label><input type="checkbox" name="lgnrgstrfrm_forgot_form_display_recaptcha" value="1" <?php checked( $display_recaptcha ); ?> /> reCaptcha by BestWebSoft</label>
     656                                        <?php } else { ?>
     657                                            <label>
     658                                                <input type="checkbox" name="lgnrgstrfrm_forgot_form_display_recaptcha" value="1" disabled="disabled" <?php checked( $display_recaptcha ); ?> /> reCaptcha by BestWebSoft
     659                                                <span class="bws_info">&nbsp;(<?php esc_html_e( 'Please activate the appropriate option on', 'bws-login-register' ); ?>&nbsp;
     660                                                    <?php
     661                                                    printf(
     662                                                        '<a href="%s" target="_blank"> reCaptcha by BestWebSoft %s</a>&nbsp;)',
     663                                                        esc_url( self_admin_url( '/admin.php?page=' . $lgnrgstrfrm_related_plugins['google-captcha']['settings_page'] ) ),
     664                                                        esc_html__( 'settings page', 'bws-login-register' )
     665                                                    );
     666                                                    ?>
     667                                                </span>
     668                                            </label>
     669                                            <?php
     670                                        }
     671                                    } else {
     672                                        ?>
     673                                        <label><input disabled="disabled" type="checkbox" name="lgnrgstrfrm_forgot_form_display_recaptcha" value="1" /> reCaptcha by BestWebSoft</label>
     674                                        <span class="bws_info">
     675                                            <?php printf( '<a href="%s" target="_blank">%s reCaptcha</a>', esc_url( self_admin_url( 'plugins.php' ) ), esc_html__( 'Activate', 'bws-login-register' ) ); ?>
     676                                        </span>
     677                                        <?php
     678                                    }
     679                                } else {
     680                                    ?>
     681                                    <label><input disabled="disabled" type="checkbox" name="lgnrgstrfrm_forgot_form_display_recaptcha" value="1" /> reCaptcha by BestWebSoft</label> <span class="bws_info">
     682                                        <?php printf( '<a href="https://bestwebsoft.com/products/wordpress/plugins/google-captcha/?k=7d74e61dd1cea23d0e9bf2fa88b5b117&amp;pn=77&amp;v=%s&amp;wp_v=%s" target="_blank">%s reCaptcha</a>', esc_attr( $lgnrgstrfrm_plugin_info['Version'] ), esc_attr( $wp_version ), esc_html__( 'Download', 'bws-login-register' ) ); ?>
     683                                        </span>
     684                                <?php } ?>
     685                            </div>
    430686                        </fieldset>
    431687                    </td>
     
    492748                    <?php esc_html_e( 'Login & Register Form Shortcode', 'bws-login-register' ); ?>
    493749                </h3>
     750                <!--<div class="inside">
     751                    <?php
     752                    esc_html_e( 'Add Login Form to your page or post using the following shortcode:', 'bws-login-register' );
     753                    bws_shortcode_output( '[bws-login]' );
     754                    ?>
     755                </div>
     756                <div class="inside">
     757                    <?php
     758                    esc_html_e( 'Add Register Form to your page or post using the following shortcode:', 'bws-login-register' );
     759                    bws_shortcode_output( '[bws-register]' );
     760                    ?>
     761                </div>-->
    494762                <div class="inside">
    495763                    <?php
    496764                    esc_html_e( 'Add Login and Register Form to your page or post using the following shortcode:', 'bws-login-register' );
    497                     lgnrgstrfrm_shortcode_output( '[bws-login-register]' );
     765                    bws_shortcode_output( '[bws-login-register]' );
    498766                    ?>
    499767                </div>
  • bws-login-register/trunk/js/admin-script.js

    r3301452 r3337325  
    11( function( $ ) {
    22    $( document ).ready( function() {
    3         console.log('document');
     3
    44        lgnrgstrfrmCheckRadio( '.lgnrgstrfrm-hide-menu-display-welcome', '.lgnrgstrfrm-display-welcome-block', 'display' );
    55        lgnrgstrfrmChangeRadio( '.lgnrgstrfrm-hide-menu-display-welcome', '.lgnrgstrfrm-display-welcome-block', 'display' );
     
    4141
    4242function lgnrgstrfrmCheckRadio( element, block, value = '' ){
    43     console.log('lgnrgstrfrmCheckRadio');
    4443    ( function( $ ) {
    4544        if ( ( '' != value && $( element ).is( ':checked' ) && value == $( element + ':checked' ).val() ) || ( '' == value && $( element ).is( ':checked' ) ) ) {
  • bws-login-register/trunk/readme.txt

    r3301452 r3337325  
    1 === Login & Register Form by BestWebSoft ===
     1=== Login & Register Form by BestWebSoft - WordPress Website Access Control Plugin ===
    22Contributors: bestwebsoft
    33Donate link: https://bestwebsoft.com/donate/
    44Tags: login form, register form, user login, user registration, custom login, custom register, authentication, form plugin, user access
    55Requires at least: 5.7
    6 Tested up to: 6.8
     6Tested up to: 6.7
    77Stable tag: 1.0
    88License: GPLv2 or later
Note: See TracChangeset for help on using the changeset viewer.