Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/smart-phone-field-for-gravity-forms/admin/class-admin.php
+++ b/smart-phone-field-for-gravity-forms/admin/class-admin.php
@@ -0,0 +1,199 @@
+<?php
+if (!defined('ABSPATH')) {
+ exit;
+}
+
+class SPF_Admin_Menu {
+ public function __construct() {
+ add_filter('admin_footer_text', [$this, 'admin_footer'], 1, 2);
+ add_action('admin_menu', [$this, 'add_menu']);
+ add_action('admin_enqueue_scripts', [$this, 'admin_scripts']);
+
+ add_action('admin_notices', [$this, 'review_request']);
+ add_action('wp_ajax_plc_review_dismiss', [$this, 'review_dismiss']);
+ }
+
+ public function admin_scripts() {
+ $current_screen = get_current_screen();
+ if (strpos($current_screen->base, 'smart-phone-field-for-gravity-forms') === false) {
+ return;
+ }
+
+ wp_enqueue_style('spf_admin_menu', GF_SMART_PHONE_FIELD_URL . 'assets/css/spf_admin.css', array(), GF_SMART_PHONE_FIELD_VERSION_NUM);
+ wp_enqueue_script('spf_admin_menu', GF_SMART_PHONE_FIELD_URL . 'assets/js/spf_admin_script.js', array('jquery'), GF_SMART_PHONE_FIELD_VERSION_NUM, true);
+ }
+
+ public function add_menu() {
+ add_submenu_page(
+ 'options-general.php',
+ 'Smart Phone Field Gravity Forms',
+ 'Smart Phone Field',
+ 'administrator',
+ 'smart-phone-field-for-gravity-forms-pro',
+ [$this, 'spf_admin_page']
+ );
+ }
+
+ public function spf_admin_page() {
+ echo '<div class="pcafe_spf_dashboard">';
+ include_once __DIR__ . '/template/header.php';
+
+ echo '<div id="pcafe_tab_box" class="pcafe_container">';
+ include_once __DIR__ . '/template/introduction.php';
+ include_once __DIR__ . '/template/usage.php';
+ include_once __DIR__ . '/template/help.php';
+ include_once __DIR__ . '/template/pro.php';
+ include_once __DIR__ . '/template/other-plugins.php';
+ echo '</div>';
+ echo '</div>';
+ }
+
+ public function admin_footer($text) {
+ global $current_screen;
+
+ if (! empty($current_screen->id) && strpos($current_screen->id, 'smart-phone-field-for-gravity-forms') !== false) {
+ $url = 'https://wordpress.org/support/plugin/smart-phone-field-for-gravity-forms/reviews/?filter=5#new-post';
+ $text = sprintf(
+ wp_kses(
+ /* translators: $1$s - WPForms plugin name; $2$s - WP.org review link; $3$s - WP.org review link. */
+ __('Thank you for using %1$s. Please rate us <a href="%2$s" target="_blank" rel="noopener noreferrer">★★★★★</a> on <a href="%3$s" target="_blank" rel="noopener">WordPress.org</a> to boost our motivation.', 'smart-phone-field-for-gravity-forms'),
+ array(
+ 'a' => array(
+ 'href' => array(),
+ 'target' => array(),
+ 'rel' => array(),
+ ),
+ )
+ ),
+ '<strong>Smart Phone Field For Gravity Forms</strong>',
+ $url,
+ $url
+ );
+ }
+
+ return $text;
+ }
+
+ public function review_request() {
+ if (! is_super_admin()) {
+ return;
+ }
+
+ $time = time();
+ $load = false;
+
+ $review = get_option('pcafe_spf_review_status');
+
+ if (! $review) {
+ $review_time = strtotime("+15 days", time());
+ update_option('pcafe_spf_review_status', $review_time);
+ } else {
+ if (! empty($review) && $time > $review) {
+ $load = true;
+ }
+ }
+ if (! $load) {
+ return;
+ }
+
+ $this->review();
+ }
+
+ public function review() {
+ $current_user = wp_get_current_user();
+?>
+ <div class="notice notice-info is-dismissible pcafe_spf_review_notice">
+ <p>
+ <?php
+ echo sprintf(
+ /* translators: 1: User display name, 2: Plugin name */
+ esc_html__(
+ 'Hey %1$s 👋, I noticed you are using <strong>%2$s</strong> for a few days — that's Awesome! If you feel <strong>%2$s</strong> is helping your business to grow in any way, could you please do us a BIG favor and give it a 5-star rating on WordPress to boost our motivation?',
+ 'smart-phone-field-for-gravity-forms'
+ ),
+ esc_html($current_user->display_name),
+ 'Smart Phone Field For Gravity Forms'
+ );
+ ?>
+ </p>
+
+ <ul style="margin-bottom: 5px">
+ <li style="display: inline-block">
+ <a style="padding: 5px 5px 5px 0; text-decoration: none;" target="_blank" href="<?php echo esc_url('https://wordpress.org/support/plugin/smart-phone-field-for-gravity-forms/reviews/?filter=5#new-post') ?>">
+ <span class="dashicons dashicons-external"></span><?php esc_html_e(' Ok, you deserve it!', 'smart-phone-field-for-gravity-forms') ?>
+ </a>
+ </li>
+ <li style="display: inline-block">
+ <a style="padding: 5px; text-decoration: none;" href="#" class="already_done" data-status="already">
+ <span class="dashicons dashicons-smiley"></span>
+ <?php esc_html_e('I already did', 'smart-phone-field-for-gravity-forms') ?>
+ </a>
+ </li>
+ <li style="display: inline-block">
+ <a style="padding: 5px; text-decoration: none;" href="#" class="later" data-status="later">
+ <span class="dashicons dashicons-calendar-alt"></span>
+ <?php esc_html_e('Maybe Later', 'smart-phone-field-for-gravity-forms') ?>
+ </a>
+ </li>
+ <li style="display: inline-block">
+ <a style="padding: 5px; text-decoration: none;" target="_blank" href="<?php echo esc_url('https://pluginscafe.com/support/') ?>">
+ <span class="dashicons dashicons-sos"></span>
+ <?php esc_html_e('I need help', 'smart-phone-field-for-gravity-forms') ?>
+ </a>
+ </li>
+ <li style="display: inline-block">
+ <a style="padding: 5px; text-decoration: none;" href="#" class="never" data-status="never">
+ <span class="dashicons dashicons-dismiss"></span>
+ <?php esc_html_e('Never show again', 'smart-phone-field-for-gravity-forms') ?>
+ </a>
+ </li>
+ </ul>
+ </div>
+ <script>
+ jQuery(document).ready(function($) {
+ $(document).on('click', '.already_done, .later, .never, .notice-dismiss', function(event) {
+ event.preventDefault();
+ var $this = $(this);
+ var status = $this.attr('data-status');
+ data = {
+ action: 'plc_review_dismiss',
+ status: status,
+ };
+ $.ajax({
+ url: ajaxurl,
+ type: 'post',
+ data: data,
+ success: function(data) {
+ $('.pcafe_spf_review_notice').remove();
+ },
+ error: function(data) {}
+ });
+ });
+ });
+ </script>
+<?php
+ }
+
+ public function review_dismiss() {
+ $status = $_POST['status'];
+
+ if ($status == 'already' || $status == 'never') {
+ $next_try = strtotime("+30 days", time());
+ update_option('pcafe_spf_review_status', $next_try);
+ } else if ($status == 'later') {
+ $next_try = strtotime("+10 days", time());
+ update_option('pcafe_spf_review_status', $next_try);
+ }
+ wp_die();
+ }
+
+ public function is_active_gravityforms() {
+ if (!method_exists('GFForms', 'include_payment_addon_framework')) {
+ return false;
+ }
+ return true;
+ }
+}
+
+
+new SPF_Admin_Menu();
--- a/smart-phone-field-for-gravity-forms/admin/template/header.php
+++ b/smart-phone-field-for-gravity-forms/admin/template/header.php
@@ -0,0 +1,66 @@
+<div class="pcafe_header">
+ <div class="pcafe_container">
+ <div class="pcafe_header_content">
+ <div class="header_logo">
+ <img src="<?php echo esc_url(GF_SMART_PHONE_FIELD_URL . 'admin/images/logo.svg'); ?>">
+ <span>Smart Phone Field For Gravity Forms</span>
+ </div>
+ <p><?php esc_html_e('Elevate your Phone field experience in the gravity forms', 'smart-phone-field-for-gravity-forms'); ?></p>
+ </div>
+ </div>
+</div>
+
+<div class="pcafe_menu">
+ <div class="pcafe_menu_content">
+ <ul class="pcafe_menu_wrap">
+ <li class="active">
+ <a href="#introduction">
+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" width="24px" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18v-2.25Z"></path>
+ </svg>
+ <span><?php esc_html_e('Introduction', 'smart-phone-field-for-gravity-forms'); ?></span>
+ </a>
+ </li>
+ <li>
+ <a href="#usage">
+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" width="24px" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25ZM6.75 12h.008v.008H6.75V12Zm0 3h.008v.008H6.75V15Zm0 3h.008v.008H6.75V18Z" />
+ </svg>
+ <span><?php esc_html_e('Basic Usage', 'smart-phone-field-for-gravity-forms'); ?></span>
+ </a>
+ </li>
+ <li>
+ <a href="#help">
+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" width="24px" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z" />
+ </svg>
+ <span><?php esc_html_e('Help', 'smart-phone-field-for-gravity-forms'); ?></span>
+ </a>
+ </li>
+ <li>
+ <a href="#pro">
+ <svg xmlns="http://www.w3.org/2000/svg" height="22px" width="22px" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M16.5 18.75h-9m9 0a3 3 0 0 1 3 3h-15a3 3 0 0 1 3-3m9 0v-3.375c0-.621-.503-1.125-1.125-1.125h-.871M7.5 18.75v-3.375c0-.621.504-1.125 1.125-1.125h.872m5.007 0H9.497m5.007 0a7.454 7.454 0 0 1-.982-3.172M9.497 14.25a7.454 7.454 0 0 0 .981-3.172M5.25 4.236c-.982.143-1.954.317-2.916.52A6.003 6.003 0 0 0 7.73 9.728M5.25 4.236V4.5c0 2.108.966 3.99 2.48 5.228M5.25 4.236V2.721C7.456 2.41 9.71 2.25 12 2.25c2.291 0 4.545.16 6.75.47v1.516M7.73 9.728a6.726 6.726 0 0 0 2.748 1.35m8.272-6.842V4.5c0 2.108-.966 3.99-2.48 5.228m2.48-5.492a46.32 46.32 0 0 1 2.916.52 6.003 6.003 0 0 1-5.395 4.972m0 0a6.726 6.726 0 0 1-2.749 1.35m0 0a6.772 6.772 0 0 1-3.044 0" />
+ </svg>
+ <span><?php esc_html_e('Get Pro', 'smart-phone-field-for-gravity-forms'); ?></span>
+ </a>
+ </li>
+ <li>
+ <a href="#otherplugins">
+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" width="24px" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z" />
+ </svg>
+ <span><?php esc_html_e('Other Plugins', 'smart-phone-field-for-gravity-forms'); ?></span>
+ </a>
+ </li>
+ <li>
+ <a target="_blank" href="https://demo.pluginscafe.com/smart-phone-field-for-gravity-forms/" class="demo_btn">
+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" width="24px" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M3 8.25V18a2.25 2.25 0 0 0 2.25 2.25h13.5A2.25 2.25 0 0 0 21 18V8.25m-18 0V6a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 6v2.25m-18 0h18M5.25 6h.008v.008H5.25V6ZM7.5 6h.008v.008H7.5V6Zm2.25 0h.008v.008H9.75V6Z" />
+ </svg>
+ <span><?php esc_html_e('Live Demo', 'smart-phone-field-for-gravity-forms'); ?></span>
+ </a>
+ </li>
+ </ul>
+ </div>
+</div>
No newline at end of file
--- a/smart-phone-field-for-gravity-forms/admin/template/help.php
+++ b/smart-phone-field-for-gravity-forms/admin/template/help.php
@@ -0,0 +1,76 @@
+<?php
+
+$faqs = [
+ [
+ 'question' => __('Is this plugin captcha country code?', 'smart-phone-field-for-gravity-forms'),
+ 'answer' => __('Yes, It captures the country code with a phone number and is supported with multistep.', 'smart-phone-field-for-gravity-forms'),
+ ],
+ [
+ 'question' => __('Is it working with the auto-detect country flag?', 'smart-phone-field-for-gravity-forms'),
+ 'answer' => __('Yes, It will work in all popular browsers.', 'smart-phone-field-for-gravity-forms'),
+ ],
+ [
+ 'question' => __('Is it working with popup with elementor popup builder?', 'smart-phone-field-for-gravity-forms'),
+ 'answer' => __('Yes, it does support.', 'smart-phone-field-for-gravity-forms'),
+ ],
+ [
+ 'question' => __('Is there any way to disable letters on phone field?', 'smart-phone-field-for-gravity-forms'),
+ 'answer' => __('Yes, You can easily prevent letters from being entered in the smartphone field by enabling Strict Mode. This setting is available in the Global Settings.', 'smart-phone-field-for-gravity-forms'),
+ ],
+ [
+ 'question' => __('Can the dropdown list of countries be translated?', 'smart-phone-field-for-gravity-forms'),
+ 'answer' => __('Yes, Go to the Global Settings page, where you’ll find a language selection dropdown. Over 30 languages are available—simply choose your preferred one.', 'smart-phone-field-for-gravity-forms'),
+ ]
+];
+
+?>
+
+
+<div id="help" class="help_introduction tab_item">
+ <div class="content_heading">
+ <h2><?php esc_html_e('Frequently Asked Questions', 'smart-phone-field-for-gravity-forms'); ?></h2>
+ </div>
+
+ <section class="section_faq">
+ <?php foreach ($faqs as $key => $faq) : ?>
+ <div class="faq_item">
+ <input type="checkbox" name="accordion-1" id="faq<?php echo esc_attr($key); ?>">
+ <label for="faq<?php echo esc_attr($key); ?>" class="faq__header">
+ <?php echo esc_html($faq['question']); ?>
+ <i class="dashicons dashicons-arrow-down-alt2"></i>
+ </label>
+ <div class="faq__body">
+ <p><?php echo esc_html($faq['answer']); ?></p>
+ </div>
+ </div>
+ <?php endforeach; ?>
+ </section>
+
+ <div class="content_heading">
+ <h2><?php esc_html_e('Need Help?', 'smart-phone-field-for-gravity-forms'); ?></h2>
+ <p><?php esc_html_e('If you have any questions or need help, please feel free to contact us.', 'smart-phone-field-for-gravity-forms'); ?></p>
+ </div>
+
+ <div class="help_docs">
+ <section class="help_box section_half">
+ <div class="help_box__img">
+ <img src="<?php echo esc_url(GF_SMART_PHONE_FIELD_URL . 'admin/images/docs.svg'); ?>">
+ </div>
+ <div class="help_box__content">
+ <h3><?php esc_html_e('Documentation', 'smart-phone-field-for-gravity-forms'); ?></h3>
+ <p><?php esc_html_e('Check out our detailed online documentation and video tutorials to find out more about what you can do.', 'smart-phone-field-for-gravity-forms'); ?></p>
+ <a target="_blank" href="https://pluginscafe.com/docs/smart-phone-field-for-gravity-forms-pro/" class="pcafe_btn"><?php esc_html_e('Documentation', 'smart-phone-field-for-gravity-forms'); ?></a>
+ </div>
+ </section>
+ <section class="help_box section_half">
+ <div class="help_box__img">
+ <img src="<?php echo esc_url(GF_SMART_PHONE_FIELD_URL . 'admin/images/service247.svg'); ?>">
+ </div>
+ <div class="help_box__content">
+ <h3><?php esc_html_e('Support', 'smart-phone-field-for-gravity-forms'); ?></h3>
+ <p><?php esc_html_e('We have dedicated support team to provide you fast, friendly & top-notch customer support.', 'smart-phone-field-for-gravity-forms'); ?></p>
+ <a target="_blank" href="https://wordpress.org/support/plugin/smart-phone-field-for-gravity-forms/" class="pcafe_btn"><?php esc_html_e('Get Support', 'smart-phone-field-for-gravity-forms'); ?></a>
+ </div>
+ </section>
+ </div>
+</div>
No newline at end of file
--- a/smart-phone-field-for-gravity-forms/admin/template/introduction.php
+++ b/smart-phone-field-for-gravity-forms/admin/template/introduction.php
@@ -0,0 +1,127 @@
+<div id="introduction" class="content-introduction active tab_item">
+ <section class="section_full background_free full_width">
+ <div class="col_description">
+ <h2><?php esc_html_e('Quick Overview', 'smart-phone-field-for-gravity-forms'); ?></h2>
+ <p><?php esc_html_e('Elevate your Phone field experience with automatic country code selection, real number validation, and stylish visuals. It is easy to use, smooth, lightweight, customizable and unrivaled performance on both mobile and desktop platforms across all major browsers.', 'smart-phone-field-for-gravity-forms'); ?></p>
+ </div>
+ </section>
+
+ <div class="content_heading">
+ <h2><?php esc_html_e('Never miss a valuable features', 'smart-phone-field-for-gravity-forms'); ?></h2>
+ <p><?php esc_html_e('Let's explore the awesome features of the plugin', 'smart-phone-field-for-gravity-forms'); ?></p>
+ </div>
+
+ <div class="section_wrap">
+ <!-- Slider Variation -->
+ <section class="section_half">
+ <div class="col_description">
+ <h3><?php esc_html_e('Live Validation', 'smart-phone-field-for-gravity-forms'); ?></h3>
+ <p>
+ <?php
+ esc_html_e('Smart Phone field verifies the validity of the phone number, activating when the user finishes typing or exits the phone field. It displays a message/icon when validation is triggered.', 'smart-phone-field-for-gravity-forms');
+ ?>
+ </p>
+ </div>
+ <div class="col_image">
+ <img src="<?php echo esc_url(GF_SMART_PHONE_FIELD_URL . 'admin/images/live_validation.webp'); ?>">
+ </div>
+ </section>
+ <section class="section_half">
+ <div class="col_description">
+ <h3><?php esc_html_e('Phone meta', 'smart-phone-field-for-gravity-forms'); ?></h3>
+ <p>
+ <?php
+ esc_html_e('Within the phone metadata, you can retrieve the phone number dial code, country code, and country name in the different text field.', 'smart-phone-field-for-gravity-forms');
+ ?>
+ </p>
+ </div>
+ <div class="col_image">
+ <img src="<?php echo esc_url(GF_SMART_PHONE_FIELD_URL . 'admin/images/meta.webp'); ?>">
+ </div>
+ </section>
+ <!-- Single and dual handle slider -->
+ <section class="section_half">
+ <div class="col_description">
+ <h3><?php esc_html_e('Global Settings', 'smart-phone-field-for-gravity-forms'); ?></h3>
+ <p>
+ <?php
+ esc_html_e('In the Global Settings, you can manage all configurations related to the Smart Phone Field. While some options can be modified directly from the Phone Field tab, features like Strict Mode, RTL support, language selection, and other advanced settings are only available in the Global Settings panel.', 'smart-phone-field-for-gravity-forms');
+ ?>
+ </p>
+ </div>
+ <div class="col_image">
+ <img src="<?php echo esc_url(GF_SMART_PHONE_FIELD_URL . 'admin/images/settings.webp'); ?>">
+ </div>
+ </section>
+ <!-- Default min & max value -->
+ <section class="section_half">
+ <div class="col_description">
+ <h3><?php esc_html_e('Ensure valid number submission', 'smart-phone-field-for-gravity-forms'); ?></h3>
+ <p>
+ <?php
+ esc_html_e('Smart phone field will ensure that submitted phone numbers are real/valid numbers. Client-side validation can be bypassed. So it always performs validation on the server side to ensure data validity. There is an option to enable and disable wrong submissions from the backend field editor.', 'smart-phone-field-for-gravity-forms');
+ ?>
+ </p>
+ </div>
+ <div class="col_image">
+ <img src="<?php echo esc_url(GF_SMART_PHONE_FIELD_URL . 'admin/images/invalid_submission.gif'); ?>">
+ </div>
+ </section>
+ <!-- Prefix & postfix -->
+ <section class="section_half">
+ <div class="col_description">
+ <h3><?php esc_html_e('Get user IP information', 'smart-phone-field-for-gravity-forms'); ?></h3>
+ <p>
+ <?php
+ esc_html_e('This plugin allows you to access user IP-related details such as city, state, zip code, and more. You can easily incorporate this information into any field using merge tags.', 'smart-phone-field-for-gravity-forms');
+ ?>
+ </p>
+ </div>
+ <div class="col_image">
+ <img src="<?php echo esc_url(GF_SMART_PHONE_FIELD_URL . 'admin/images/merge.webp'); ?>">
+ </div>
+ </section>
+ <!-- Tooltip & Pips -->
+ <section class="section_half">
+ <div class="col_description">
+ <h3><?php esc_html_e('Multiple number format', 'smart-phone-field-for-gravity-forms'); ?></h3>
+ <p>
+ <?php
+ esc_html_e('It generates four types of number formats that can be received in notifications and sent via any API. By default, the number will be sent in the notification with the raw format.', 'smart-phone-field-for-gravity-forms');
+ ?>
+ </p>
+ </div>
+ <div class="col_image">
+ <img src="<?php echo esc_url(GF_SMART_PHONE_FIELD_URL . 'admin/images/notification.webp'); ?>">
+ </div>
+ </section>
+ <!-- RTL support -->
+ <section class="section_half">
+ <div class="col_description">
+ <h3><?php esc_html_e('RTL support', 'smart-phone-field-for-gravity-forms'); ?></h3>
+ <p>
+ <?php
+ esc_html_e('RTL (Right to Left) is a key feature for certain languages and countries. You can enable RTL using a checkbox, which is available in the pro version.', 'smart-phone-field-for-gravity-forms');
+ ?>
+ </p>
+ </div>
+ <div class="col_image">
+ <img src="<?php echo esc_url(GF_SMART_PHONE_FIELD_URL . 'admin/images/rtl.webp'); ?>">
+ </div>
+ </section>
+ <!-- Calculation Support -->
+ <section class="section_half">
+ <div class="col_description">
+ <h3><?php esc_html_e('Language support', 'smart-phone-field-for-gravity-forms'); ?></h3>
+ <p>
+ <?php
+ esc_html_e('Over 30 languages are available in the Global Settings for easy selection. If your preferred language or specific text is not available, you can fully customize or modify all text using filter hooks.', 'smart-phone-field-for-gravity-forms');
+ ?>
+ </p>
+ </div>
+ <div class="col_image">
+ <img src="<?php echo esc_url(GF_SMART_PHONE_FIELD_URL . 'admin/images/rtl.webp'); ?>">
+ </div>
+ </section>
+ </div>
+</div>
No newline at end of file
--- a/smart-phone-field-for-gravity-forms/admin/template/other-plugins.php
+++ b/smart-phone-field-for-gravity-forms/admin/template/other-plugins.php
@@ -0,0 +1,182 @@
+<?php
+
+$GFRS_Plugins = [
+ [
+ 'name' => 'Smart phone field for Gravity Forms',
+ 'slug' => 'smart-phone-field-for-gravity-forms',
+ 'path' => 'smart-phone-field-for-gravity-forms/gravityforms-smart-phone-field.php',
+ 'desc' => __('A simple and nice plugin to get auto country flag from user ip address on gravity form phone field. It will help you to get the country flag on the phone field.', 'smart-phone-field-for-gravity-forms'),
+ 'demo' => 'https://demo.pluginscafe.com/smart-phone-field-for-gravity-forms/',
+ 'img' => 'spf.svg'
+ ],
+ [
+ 'name' => 'Range Slider Addon for Gravity Forms',
+ 'slug' => 'smart-phone-field-for-gravity-forms',
+ 'path' => 'range-slider-addon-for-gravity-forms/gf-range-slider.php',
+ 'desc' => __('A sleek, lightweight, and customizable range slider designed for selecting numbers or data within Gravity Forms', 'smart-phone-field-for-gravity-forms'),
+ 'demo' => '',
+ 'img' => 'range.svg'
+ ],
+ [
+ 'name' => 'Real Time Validation For Gravity Forms',
+ 'slug' => 'gf-real-time-validation',
+ 'path' => 'gf-real-time-validation/real-time-validation.php',
+ 'desc' => __('This plugin adds an awesome feature that provides instant feedback and guidance in each field, helps prevent errors.', 'smart-phone-field-for-gravity-forms'),
+ 'demo' => '',
+ 'img' => 'imp.svg'
+ ],
+ [
+ 'name' => 'Image Picker For Gravity Forms',
+ 'slug' => 'gf-real-time-validation',
+ 'path' => 'image-choices-for-gravity-forms/gf-img-choices.php',
+ 'desc' => __('A lightweight and user-friendly plugin for effortlessly adding images to Gravity Forms radio and checkbox fields. With just a few clicks, you can upload and assign images to these fields seamlessly.', 'smart-phone-field-for-gravity-forms'),
+ 'demo' => '',
+ 'img' => 'imp.svg',
+ ],
+ [
+ 'name' => 'Easy Integration with Google Calendar',
+ 'slug' => 'easy-integration-with-google-calendar',
+ 'path' => 'easy-integration-with-google-calendar/easy-integration-with-google-calendar.php',
+ 'desc' => __('Easily integrate Google Calendar with your WordPress site in just few minutes using your forms.', 'smart-phone-field-for-gravity-forms'),
+ 'img' => 'imp.svg',
+ ],
+ [
+ 'name' => 'Advanced Data Table for Elementor',
+ 'slug' => 'advanced-data-table-for-elementor',
+ 'path' => 'advanced-data-table-for-elementor/advanced-data-table.php',
+ 'desc' => __('Advanced Data Table for Elementor is an essential plugin for Elementor users who want to easily create visually appealing and functional tables on their WordPress websites.', 'smart-phone-field-for-gravity-forms'),
+ 'demo' => 'https://demo.pluginscafe.com/advanced-data-table-for-elementor/',
+ 'img' => 'imp.svg',
+ ],
+ [
+ 'name' => 'Restrict Dates Addon For Gravity Forms',
+ 'slug' => 'restrict-dates-add-on-for-gravity-forms',
+ 'path' => 'restrict-dates-add-on-for-gravity-forms/restrict-dates.php',
+ 'desc' => __('Restrict which dates are not selectable in your Gravity Forms date picker field. It helps to provide accurate services to your users.', 'smart-phone-field-for-gravity-forms'),
+ 'demo' => 'https://demo.pluginscafe.com/restrict-dates-for-gravity-forms/',
+ 'img' => 'red.svg',
+ ],
+ [
+ 'name' => 'Formico – Elementor Form Extensions, Fields & Integrations',
+ 'slug' => 'formico',
+ 'path' => 'formico/formico.php',
+ 'desc' => __('The easiest and lightweight elementor pro form extensions bundle. Take your Elementor form building capabilities to the next level with our Form Extensions plugin!', 'smart-phone-field-for-gravity-forms'),
+ 'demo' => '',
+ 'img' => 'formico.svg',
+ ],
+ [
+ 'name' => 'Address Autocomplete via Google for Gravity Forms',
+ 'slug' => 'gf-google-address-autocomplete',
+ 'path' => 'gf-google-address-autocomplete/gf-auto-address-complete.php',
+ 'desc' => __('A lightweight and user-friendly plugin that enables Google Places API auto-suggestions in Gravity Forms address fields.', 'smart-phone-field-for-gravity-forms'),
+ 'demo' => '',
+ 'img' => 'aac.svg',
+ ],
+ [
+ 'name' => 'Smart Phone Field For WPForms, Contact Form 7, Fluent Forms, Elementor Form',
+ 'slug' => 'smart-phone-field-for-wp-forms',
+ 'path' => 'smart-phone-field-for-wp-forms/smart-phone-field.php',
+ 'desc' => __('Instruct your visitors to choose their country code when entering their mobile number to ensure accurate and correctly formatted data submissions.', 'smart-phone-field-for-gravity-forms'),
+ 'demo' => 'https://pluginscafe.com/demo/smart-phone-field/',
+ 'img' => 'spf.svg',
+ ],
+ [
+ 'name' => 'PDF Invoices for Gravity Forms',
+ 'slug' => 'pdf-invoices-for-gravity-forms',
+ 'path' => 'pdf-invoices-for-gravity-forms/pdf-invoices.php',
+ 'desc' => __('Automatically generate PDF invoices and attach them to every form submission in Gravity Forms.', 'smart-phone-field-for-gravity-forms'),
+ 'demo' => '',
+ 'img' => 'pdfi.svg',
+ ],
+ [
+ 'name' => 'Advanced Date Time Field',
+ 'slug' => 'advanced-date-time-field',
+ 'path' => 'advanced-date-time-field/advanced-date-time-field.php',
+ 'desc' => __('This plugin is a lightweight yet powerful date and time picker designed for popular form builder plugins.', 'smart-phone-field-for-gravity-forms'),
+ 'demo' => '',
+ 'img' => 'imp.svg',
+ ],
+ [
+ 'name' => 'Connect Brevo With Gravity Forms',
+ 'slug' => 'connect-brevo-gravity-forms',
+ 'path' => 'connect-brevo-gravity-forms/gf-brevo.php',
+ 'desc' => __('When someone submits a form on your site, it sends form submissions from Gravity Forms to the relationship marketing platform Brevo (ex Sendinblue).', 'smart-phone-field-for-gravity-forms'),
+ 'demo' => '',
+ 'img' => 'brevo.svg',
+ ],
+ [
+ 'name' => 'Klaviyo for Gravity Forms',
+ 'slug' => 'klaviyo-for-gravity-forms',
+ 'path' => 'klaviyo-for-gravity-forms/gf-klaviyo.php',
+ 'desc' => __('When someone submits a form on your site, it sends form submissions from Gravity Forms to the relationship marketing platform Klaviyo.', 'smart-phone-field-for-gravity-forms'),
+ 'demo' => '',
+ 'img' => 'klaviyo.svg',
+ ],
+ [
+ 'name' => 'Easy Integration With Google Sheets',
+ 'slug' => 'easy-integration-with-google-sheets',
+ 'path' => 'easy-integration-with-google-sheets/easy-integration-with-google-sheets.php',
+ 'desc' => __('Easily integrate Google sheets with your WordPress site in just minutes using your forms.', 'smart-phone-field-for-gravity-forms'),
+ 'demo' => '',
+ 'img' => 'klaviyo.svg',
+ ]
+];
+
+
+?>
+
+<div id="otherplugins" class="other_plugins_content tab_item">
+ <div class="content_heading">
+ <h2><?php esc_html_e('Try out our recommended plugins', 'smart-phone-field-for-gravity-forms'); ?></h2>
+ </div>
+
+ <div class="pcafe_plugin_wrap">
+ <?php foreach ($GFRS_Plugins as $key => $plugin) :
+ $plugin_path = WP_PLUGIN_DIR . '/' . $plugin['path'];
+ $plugin_file = $plugin['slug'];
+ $path = $plugin['path'];
+
+ if (file_exists(WP_PLUGIN_DIR . '/' . $plugin_file)) {
+ $url = admin_url("plugins.php?action=activate&plugin=$path");
+ $url = wp_nonce_url($url, "activate-plugin_{$path}");
+ $btn_text = esc_html__('Activate', 'smart-phone-field-for-gravity-forms');
+ $css_class = 'p__activate';
+ } else {
+ $url = admin_url("update.php?action=install-plugin&plugin=$plugin_file");
+ $url = wp_nonce_url($url, "install-plugin_$plugin_file");
+ $btn_text = esc_html__('Install', 'smart-phone-field-for-gravity-forms');
+ $css_class = 'p__install';
+ }
+ ?>
+ <div class="single_plugin">
+ <div class="p__name">
+ <img src="<?php echo esc_url(plugin_dir_url(__FILE__) . 'img/' . $plugin['img']); ?>">
+ <h4><?php echo esc_attr($plugin['name']); ?></h4>
+ </div>
+ <div class="p__content">
+ <div class="p__desc">
+ <?php echo esc_html($plugin['desc']); ?>
+ </div>
+ <div class="p__btns">
+ <?php if (is_plugin_active($plugin['path'])) : ?>
+ <p class="p__activated">
+ <?php esc_html_e('Activated', 'smart-phone-field-for-gravity-forms'); ?>
+ <svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" viewBox="0 0 24 24" fill="currentColor" class="size-6">
+ <path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z" clip-rule="evenodd" />
+ </svg>
+ </p>
+ <?php else : ?>
+ <a href="<?php echo esc_url($url); ?>" class="install_btn <?php echo esc_attr($css_class); ?>">
+ <span class="p_btn_text"><?php echo esc_html($btn_text); ?></span>
+ <span class="loader"></span>
+ </a>
+ <?php endif; ?>
+ <?php if (!empty($plugin['demo'])) : ?>
+ <a href="<?php echo esc_url($plugin['demo']); ?>" class="p__demo" target="_blank"><?php esc_html_e('Demo', 'smart-phone-field-for-gravity-forms'); ?></a>
+ <?php endif; ?>
+ </div>
+ </div>
+ </div>
+ <?php endforeach; ?>
+ </div>
+</div>
No newline at end of file
--- a/smart-phone-field-for-gravity-forms/admin/template/pro.php
+++ b/smart-phone-field-for-gravity-forms/admin/template/pro.php
@@ -0,0 +1,142 @@
+<?php
+
+$features = [
+ [
+ 'feature' => __('Live validation', 'smart-phone-field-for-gravity-forms'),
+ 'pro' => 0
+ ],
+ [
+ 'feature' => __('Automatic country select with ip address (GeoIP)', 'smart-phone-field-for-gravity-forms'),
+ 'pro' => 0
+ ],
+ [
+ 'feature' => __('Default country selection', 'smart-phone-field-for-gravity-forms'),
+ 'pro' => 0
+ ],
+ [
+ 'feature' => __('Exclude/Include countries', 'smart-phone-field-for-gravity-forms'),
+ 'pro' => 0
+ ],
+ [
+ 'feature' => __('Multi step support', 'smart-phone-field-for-gravity-forms'),
+ 'pro' => 0
+ ],
+ [
+ 'feature' => __('Multiple phone field', 'smart-phone-field-for-gravity-forms'),
+ 'pro' => 0
+ ],
+ [
+ 'feature' => __('Three flag option', 'smart-phone-field-for-gravity-forms'),
+ 'pro' => 0
+ ],
+ [
+ 'feature' => __('Add country code with notification/entries', 'smart-phone-field-for-gravity-forms'),
+ 'pro' => true
+ ],
+ [
+ 'feature' => __('Prevent form submission on invalid phone number', 'smart-phone-field-for-gravity-forms'),
+ 'pro' => true
+ ],
+ [
+ 'feature' => __('Phone number format with typing', 'smart-phone-field-for-gravity-forms'),
+ 'pro' => true
+ ],
+ [
+ 'feature' => __('Get city, zip code, country and more based on IP address via merge tag', 'smart-phone-field-for-gravity-forms'),
+ 'pro' => true
+ ],
+ [
+ 'feature' => __('RTL support', 'smart-phone-field-for-gravity-forms'),
+ 'pro' => true
+ ],
+ [
+ 'feature' => __('30+ language support', 'smart-phone-field-for-gravity-forms'),
+ 'pro' => true
+ ],
+ [
+ 'feature' => __('Phone number format in 4 different types. Ex: E.164 and more.', 'smart-phone-field-for-gravity-forms'),
+ 'pro' => true
+ ],
+ [
+ 'feature' => __('Add country code automatically', 'smart-phone-field-for-gravity-forms'),
+ 'pro' => true
+ ],
+ [
+ 'feature' => __('Get country code, name, dial code separately in text field', 'smart-phone-field-for-gravity-forms'),
+ 'pro' => true
+ ]
+];
+
+?>
+<div id="pro" class="pro_introduction tab_item">
+
+ <?php if (spffgfp_fs()->is_plan('pro', true)) : ?>
+ <div class="content_heading pro_using">
+ <p style="color: darkorange"><?php esc_html_e('Thanks for using Smart Phone For Gravity Forms Pro.', 'smart-phone-field-for-gravity-forms'); ?></p>
+ </div>
+ <?php endif; ?>
+
+ <div class="content_heading">
+ <h2><?php esc_html_e('Unlock the full power of Smart Phone Field For Gravity Forms', 'smart-phone-field-for-gravity-forms'); ?></h2>
+ <p><?php esc_html_e('The amazing PRO features will make your smart phone field even more efficient.', 'smart-phone-field-for-gravity-forms'); ?></p>
+ <?php if (spffgfp_fs()->is_plan('pro', false)) : ?>
+ <a href="<?php echo esc_url(spffgfp_fs()->get_upgrade_url()); ?>" class="pcafe_btn">
+ <?php esc_html_e('Get PRO Now', 'smart-phone-field-for-gravity-forms'); ?>
+ </a>
+ <?php endif; ?>
+ </div>
+
+ <div class="content_heading free_vs_pro">
+ <h2>
+ <span><?php esc_html_e('Free', 'smart-phone-field-for-gravity-forms'); ?></span>
+ <?php esc_html_e('vs', 'smart-phone-field-for-gravity-forms'); ?>
+ <span><?php esc_html_e('Pro', 'smart-phone-field-for-gravity-forms'); ?></span>
+ </h2>
+ </div>
+
+ <div class="features_list">
+ <div class="list_header">
+ <div class="feature_title"><?php esc_html_e('Feature List', 'smart-phone-field-for-gravity-forms'); ?></div>
+ <div class="feature_free"><?php esc_html_e('Free', 'smart-phone-field-for-gravity-forms'); ?></div>
+ <div class="feature_pro"><?php esc_html_e('Pro', 'smart-phone-field-for-gravity-forms'); ?></div>
+ </div>
+ <?php foreach ($features as $feature) : ?>
+ <div class="feature">
+ <div class="feature_title"><?php echo esc_html($feature['feature']); ?></div>
+ <div class="feature_free">
+ <?php if ($feature['pro']) : ?>
+ <i class="dashicons dashicons-no-alt"></i>
+ <?php else : ?>
+ <i class="dashicons dashicons-saved"></i>
+ <?php endif; ?>
+ </div>
+ <div class="feature_pro">
+ <i class="dashicons dashicons-saved"></i>
+ </div>
+ </div>
+ <?php endforeach; ?>
+ </div>
+
+ <?php if (! spffgfp_fs()->is_plan('pro', true)) : ?>
+ <div class="pro-cta background_pro">
+ <div class="cta-content">
+ <h2><?php esc_html_e('Don't waste time, get the PRO version now!', 'smart-phone-field-for-gravity-forms'); ?></h2>
+ <p><?php esc_html_e('Upgrade to the PRO version of the plugin and unlock all the amazing Range Slider features for
+ your website.', 'smart-phone-field-for-gravity-forms'); ?></p>
+ </div>
+ <div class="cta-btn">
+ <a href="<?php echo esc_url(spffgfp_fs()->get_upgrade_url()); ?>" class="pcafe_btn"><?php esc_html_e('Upgrade Now', 'smart-phone-field-for-gravity-forms'); ?></a>
+ </div>
+ </div>
+ <?php endif; ?>
+
+ <div class="pro-cta background_free">
+ <div class="cta-content">
+ <h2><?php esc_html_e('Want to try live demo, before purchase?', 'smart-phone-field-for-gravity-forms'); ?></h2>
+ <p><?php esc_html_e('Try our instant ready-made demo with form submission! If you use an active email address, you'll also receive a notification.', 'smart-phone-field-for-gravity-forms'); ?></p>
+ </div>
+ <div class="cta-btn">
+ <a href="https://demo.pluginscafe.com/smart-phone-field-for-gravity-forms/" target="_blank" class="pcafe_btn"><?php esc_html_e('Try Live Demo', 'smart-phone-field-for-gravity-forms'); ?></a>
+ </div>
+ </div>
+</div>
No newline at end of file
--- a/smart-phone-field-for-gravity-forms/admin/template/usage.php
+++ b/smart-phone-field-for-gravity-forms/admin/template/usage.php
@@ -0,0 +1,54 @@
+<div id="usage" class="content-usage tab_item">
+ <div class="content_heading">
+ <h2><?php esc_html_e('Basic Usage', 'smart-phone-field-for-gravity-forms'); ?></h2>
+ <p><?php esc_html_e('A Beginner's Guide to Efficiently Using the Plugin', 'smart-phone-field-for-gravity-forms'); ?></p>
+ </div>
+
+ <section class="section_full background_free">
+ <div class="col_description">
+ <h2><?php esc_html_e('Basic Usage (Free version)', 'smart-phone-field-for-gravity-forms'); ?></h2>
+ <p><?php esc_html_e('After installing the plugin, add the phone number field from the Advanced tab in Gravity Forms. Simply click on the smart phone field tab in the Gravity Forms field panel to show smart phone field options to your form.', 'smart-phone-field-for-gravity-forms'); ?></p>
+ <p><?php esc_html_e('Now, configure it according to your requirements, as shown in the image on the right.', 'smart-phone-field-for-gravity-forms'); ?></p>
+ </div>
+ <div class="col_image">
+ <img src="<?php echo esc_url(GF_SMART_PHONE_FIELD_URL . 'admin/images/free_options.webp'); ?>">
+ </div>
+ </section>
+
+ <div class="usage_wrap">
+ <section class="section_full background_pro">
+ <div class="col_description">
+ <h2><?php esc_html_e('Basic Usage Smart Phone Field (Pro)', 'smart-phone-field-for-gravity-forms'); ?></h2>
+ <p><?php esc_html_e('After installing the plugin, add the phone number field from the Advanced tab in Gravity Forms. Then, click on the Smart Phone Field tab in the field settings panel to access and configure its options for your form.', 'smart-phone-field-for-gravity-forms'); ?></p>
+ <p><?php esc_html_e('Now, configure it according to your requirements, as shown in the image on the right.', 'smart-phone-field-for-gravity-forms'); ?></p>
+ <ol>
+ <li>
+ <?php esc_html_e('After clicking "Enable Smart Phone Field Options," a configuration selection will appear. Choose Global to use the default settings, or select Custom to personalize specific options for this field.', 'smart-phone-field-for-gravity-forms'); ?>
+ </li>
+ </ol>
+ </div>
+ <div class="col_image">
+ <img src="<?php echo esc_url(GF_SMART_PHONE_FIELD_URL . 'admin/images/pro_options.webp'); ?>">
+ </div>
+ </section>
+ <section class="section_full background_pro">
+ <div class="col_description">
+ <h2><?php esc_html_e('Basic Usage of Global Settings (Pro)', 'smart-phone-field-for-gravity-forms'); ?></h2>
+ <p><?php esc_html_e('After installing the plugin, navigate to the Gravity Forms Settings menu. You'll find a Smart Phone Field section there, where you can access and manage all related options.', 'smart-phone-field-for-gravity-forms'); ?></p>
+ <p><?php esc_html_e('Now, configure it according to your requirements, as shown in the image on the right.', 'smart-phone-field-for-gravity-forms'); ?></p>
+ <ol>
+ <li>
+ <?php esc_html_e('You can set the default country using the dropdown or enable GeoIP detection. Options such as showing flags, country dropdown, phone number validation, number formatting, validation messages, and placeholder visibility can all be customized or overridden from the Phone Field tab.', 'smart-phone-field-for-gravity-forms'); ?>
+ </li>
+ <li><?php esc_html_e('Other options such as Strict Mode, Country Search, RTL support, Language selection, IP merge tag, and the ipinfo.io token are global settings. These features are not available in the Phone Field tab but can be easily modified using hooks.', 'smart-phone-field-for-gravity-forms'); ?></li>
+ </ol>
+ <p><a class="pcafe_btn" target="_blank" href="<?php echo esc_url(admin_url('admin.php?page=gf_settings&subview=smart-phone-field-for-gravity-forms')); ?>">Go to Global Settings</a></p>
+ </div>
+ <div class="col_image">
+ <img src="<?php echo esc_url(GF_SMART_PHONE_FIELD_URL . 'admin/images/settings.webp'); ?>">
+ </div>
+ </section>
+ </div>
+
+
+</div>
No newline at end of file
--- a/smart-phone-field-for-gravity-forms/backend/class-backend.php
+++ b/smart-phone-field-for-gravity-forms/backend/class-backend.php
@@ -1,136 +0,0 @@
-<?php
-
-if (!defined('ABSPATH')) {
- exit;
-}
-
-
-class GF_smart_phone_field_backend {
-
- function __construct() {
- add_action('gform_field_standard_settings', array($this, 'gf_spf_options_settings'), 10, 2);
-
- add_action('gform_editor_js', array($this, 'gf_spf_editor_script'));
- add_filter('gform_tooltips', array($this, 'gf_spf_tooltips'));
- add_action('admin_enqueue_scripts', array($this, 'gf_spf_admin_scripts'));
- }
-
-
- function gf_spf_options_settings($position, $form_id) {
- if ($position == 25) { ?>
- <li class="spf_field_setting field_setting">
- <ul>
- <li>
- <input type="checkbox" id="spf_enable_value" onclick="SetFieldProperty('smartPhoneFieldGField', this.checked);" />
- <label for="spf_enable_value" class="inline"><?php _e("Enable smart phone field", "gravityforms"); ?><?php gform_tooltip("spf_enable_tooltips"); ?></label>
- </li>
- </ul>
-
- <div class="spf_options">
- <ul>
- <li class="spf_flag_setting field_setting">
- <label for="field_admin_label" class="section_label">
- <?php _e("Flag Options", "gravityforms"); ?>
- <?php gform_tooltip("spf_flag_tooltips"); ?>
- </label>
- <select name="spf_country_flag_value" id="spf_country_flag_value" onChange="SetFieldProperty('countryFlagGField', this.value);">
- <option value="">Choose Flag</option>
- <option value="flagdial">Flag with dial code</option>
- <option value="flagcode">Flag separate dial code</option>
- <option value="flag">Flag only</option>
- </select>
- <p style="border: 1px solid #ffbe03; padding: 8px 12px; border-radius: 3px; font-size: 12px;"><?php _e("Choose <strong>Flag separate dial code</strong> for getting country/dial code in notification/entries.", "gravityforms"); ?></p>
- </li>
- <li class="spf_auto_ip_setting field_setting">
- <ul>
- <li>
- <input type="checkbox" id="spf_auto_ip_value" onclick="SetFieldProperty('smartPhoneAutoIpGField', this.checked);" />
- <label for="spf_auto_ip_value" class="inline"><?php _e("Automatically select countries", "gravityforms"); ?><?php gform_tooltip("spf_autoip_tooltips"); ?></label>
- </li>
- </ul>
- </li>
- <li class="spf_default_setting field_setting">
- <label for="field_admin_label" class="section_label">
- <?php _e("Default country", "gravityforms"); ?>
- <?php gform_tooltip("spf_default_tooltips"); ?>
- </label>
- <select name="spf_default_country_value" id="spf_default_country_value" onChange="SetFieldProperty('defaultCountryGField', this.value);">
- <?php
- foreach (GF_SPF_Helper::get_countries() as $value => $name) {
- echo '<option value="' . $value . '">' . $name . '</option>';
- }
- ?>
- </select>
- </li>
- <li class="spf_prefer_setting field_setting">
- <label for="field_admin_label" class="section_label">
- <?php _e("Preferred countries", "gravityforms"); ?>
- <?php gform_tooltip("spf_prefered_tooltips"); ?>
- </label>
- <select style="min-height: 100px" multiple="multiple" name="spf_preferred_countries_value" id="spf_preferred_countries_value" onChange="SetFieldProperty('preferredCountriesGField', jQuery(this).val());">
- <?php
- foreach (GF_SPF_Helper::get_countries() as $value => $name) {
- echo '<option value="' . $value . '">' . $name . '</option>';
- }
- ?>
- </select>
- </li>
- </ul>
-
- </div>
- </li>
-
-
- <?php
- }
- }
-
-
- function gf_spf_editor_script() {
- ?>
- <script type='text/javascript'>
- //adding setting to fields of type "phone"
- fieldSettings.phone += ", .spf_field_setting";
- fieldSettings.phone += ", .spf_auto_ip_setting";
- fieldSettings.phone += ", .spf_prefer_setting";
- fieldSettings.phone += ", .spf_default_setting";
- fieldSettings.phone += ", .spf_multi_setting";
- fieldSettings.phone += ", .spf_flag_setting";
-
- //binding to the load field settings event to initialize the checkbox
- jQuery(document).bind("gform_load_field_settings", function(event, field, form) {
- jQuery("#spf_enable_value").prop('checked', Boolean(rgar(field, 'smartPhoneFieldGField')));
- jQuery("#spf_multi_value").prop('checked', Boolean(rgar(field, 'multiStepGField')));
- jQuery("#spf_auto_ip_value").prop('checked', Boolean(rgar(field, 'smartPhoneAutoIpGField')));
- jQuery("#spf_preferred_countries_value").val(field["preferredCountriesGField"]);
- jQuery("#spf_default_country_value").val(field["defaultCountryGField"]);
- jQuery("#spf_country_flag_value").val(field["countryFlagGField"]);
- });
-
- jQuery('body').on('change', '#spf_enable_value', function(e) {
- if (jQuery(this).is(':checked')) {
- jQuery(this).parent().parent().parent().parent().find('#field_phone_format').val('international').change();
- }
- });
- </script>
-<?php
- }
-
- function gf_spf_tooltips() {
- $tooltips['spf_enable_tooltips'] = "<h6>" . esc_html__("Enable smart phone field", "gravityforms") . "</h6>" . esc_html__("Check this box to show smart phone field", "gravityforms") . "";
- $tooltips['spf_autoip_tooltips'] = esc_html__("Check this box to show ip based country flag.", "gravityforms");
- $tooltips['spf_default_tooltips'] = esc_html__("Select one for showing specific country. Default: US", "gravityforms");
- $tooltips['spf_prefered_tooltips'] = esc_html__("Select multiple country for showing in preferred country suggestion. Default: US, UK", "gravityforms");
- $tooltips['flag_options'] = esc_html__("Select an option for showing flag type in the input field.", "gravityforms");
- $tooltips['spfield_validation'] = esc_html__("Check this box for adding validation on smart phone field.", "gravityforms");
- $tooltips['spf_flag_tooltips'] = esc_html__("Choose flag option for getting flag and dial code in input field.", "gravityforms");
- $tooltips['spf_multi_tooltips'] = esc_html__("Multistep with country code submission is available in pro version. <a href='https://pluginscafe.com/smart-phone-field-pro/' target='_blank'>PRO</a>", "gravityforms");
- return $tooltips;
- }
-
- function gf_spf_admin_scripts() {
- wp_enqueue_script('spf_admin', GF_SMART_PHONE_FIELD_URL . 'backend/js/spf_admin.js', array(), GF_SMART_PHONE_FIELD_VERSION_NUM, true);
- }
-}
-
-new GF_smart_phone_field_backend();
--- a/smart-phone-field-for-gravity-forms/backend/class-helper.php
+++ b/smart-phone-field-for-gravity-forms/backend/class-helper.php
@@ -1,279 +0,0 @@
-<?php
-
-if(!defined('ABSPATH')) {
- exit;
-}
-
-
-class GF_SPF_Helper {
-
- /**
- * Get countries array values.
- *
- * @return [type] [description]
- */
- public static function get_countries() {
-
- $countries = array(
- 'AF' => 'Afghanistan (افغانستان)',
- 'AX' => 'Åland Islands (Åland)',
- 'AL' => 'Albania (Shqipëri)',
- 'DZ' => 'Algeria (الجزائر)',
- 'AS' => 'American Samoa',
- 'AD' => 'Andorra',
- 'AO' => 'Angola',
- 'AI' => 'Anguilla',
- 'AQ' => 'Antarctica',
- 'AG' => 'Antigua and Barbuda',
- 'AR' => 'Argentina',
- 'AM' => 'Armenia (Հայաստան)',
- 'AW' => 'Aruba',
- 'AC' => 'Ascension Island',
- 'AU' => 'Australia',
- 'AT' => 'Austria (Österreich)',
- 'AZ' => 'Azerbaijan (Azərbaycan)',
- 'BS' => 'Bahamas',
- 'BH' => 'Bahrain (البحرين)',
- 'BD' => 'Bangladesh (বাংলাদেশ)',
- 'BB' => 'Barbados',
- 'BY' => 'Belarus (Беларусь)',
- 'BE' => 'Belgium (België)',
- 'BZ' => 'Belize',
- 'BJ' => 'Benin (Bénin)',
- 'BM' => 'Bermuda',
- 'BT' => 'Bhutan (འབྲུག)',
- 'BO' => 'Bolivia',
- 'BA' => 'Bosnia and Herzegovina (Босна и Херцеговина)',
- 'BW' => 'Botswana',
- 'BV' => 'Bouvet Island',
- 'BR' => 'Brazil (Brasil)',
- 'IO' => 'British Indian Ocean Territory',
- 'VG' => 'British Virgin Islands',
- 'BN' => 'Brunei',
- 'BG' => 'Bulgaria (България)',
- 'BF' => 'Burkina Faso',
- 'BI' => 'Burundi (Uburundi)',
- 'KH' => 'Cambodia (កម្ពុជា)',
- 'CM' => 'Cameroon (Cameroun)',
- 'CA' => 'Canada',
- 'IC' => 'Canary Islands (islas Canarias)',
- 'CV' => 'Cape Verde (Kabu Verdi)',
- 'BQ' => 'Caribbean Netherlands',
- 'KY' => 'Cayman Islands',
- 'CF' => 'Central African Republic (République centrafricaine)',
- 'EA' => 'Ceuta and Melilla (Ceuta y Melilla)',
- 'TD' => 'Chad (Tchad)',
- 'CL' => 'Chile',
- 'CN' => 'China (中国)',
- 'CX' => 'Christmas Island',
- 'CP' => 'Clipperton Island',
- 'CC' => 'Cocos (Keeling) Islands (Kepulauan Cocos (Keeling))',
- 'CO' => 'Colombia',
- 'KM' => 'Comoros (جزر القمر)',
- 'CD' => 'Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)',
- 'CG' => 'Congo (Republic) (Congo-Brazzaville)',
- 'CK' => 'Cook Islands',
- 'CR' => 'Costa Rica',
- 'CI' => 'Côte d’Ivoire',
- 'HR' => 'Croatia (Hrvatska)',
- 'CU' => 'Cuba',
- 'CW' => 'Curaçao',
- 'CY' => 'Cyprus (Κύπρος)',
- 'CZ' => 'Czech Republic (Česká republika)',
- 'DK' => 'Denmark (Danmark)',
- 'DG' => 'Diego Garcia',
- 'DJ' => 'Djibouti',
- 'DM' => 'Dominica',
- 'DO' => 'Dominican Republic (República Dominicana)',
- 'EC' => 'Ecuador',
- 'EG' => 'Egypt (مصر)',
- 'SV' => 'El Salvador',
- 'GQ' => 'Equatorial Guinea (Guinea Ecuatorial)',
- 'ER' => 'Eritrea',
- 'EE' => 'Estonia (Eesti)',
- 'ET' => 'Ethiopia',
- 'FK' => 'Falkland Islands (Islas Malvinas)',
- 'FO' => 'Faroe Islands (Føroyar)',
- 'FJ' => 'Fiji',
- 'FI' => 'Finland (Suomi)',
- 'FR' => 'France',
- 'GF' => 'French Guiana (Guyane française)',
- 'PF' => 'French Polynesia (Polynésie française)',
- 'TF' => 'French Southern Territories (Terres australes françaises)',
- 'GA' => 'Gabon',
- 'GM' => 'Gambia',
- 'GE' => 'Georgia (საქართველო)',
- 'DE' => 'Germany (Deutschland)',
- 'GH' => 'Ghana (Gaana)',
- 'GI' => 'Gibraltar',
- 'GR' => 'Greece (Ελλάδα)',
- 'GL' => 'Greenland (Kalaallit Nunaat)',
- 'GD' => 'Grenada',
- 'GP' => 'Guadeloupe',
- 'GU' => 'Guam',
- 'GT' => 'Guatemala',
- 'GG' => 'Guernsey',
- 'GN' => 'Guinea (Guinée)',
- 'GW' => 'Guinea-Bissau (Guiné Bissau)',
- 'GY' => 'Guyana',
- 'HT' => 'Haiti',
- 'HM' => 'Heard & McDonald Islands',
- 'HN' => 'Honduras',
- 'HK' => 'Hong Kong (香港)',
- 'HU' => 'Hungary (Magyarország)',
- 'IS' => 'Iceland (Ísland)'