Plugin Directory

Changeset 3484915


Ignore:
Timestamp:
03/17/2026 03:51:56 PM (2 weeks ago)
Author:
yourplugins
Message:

Release 1.1.0

Location:
yps-bundle/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • yps-bundle/trunk/includes/class-yps-admin.php

    r3484054 r3484915  
    6868        if ( $connection['is_connected'] && ! empty( $connection['token'] ) ) {
    6969            foreach ( $embeddables as $widget_slug => $widget ) {
    70                 if ( 'slotflow' !== $widget_slug ) {
     70                if ( ! $this->widget_requires_form_selection( $widget ) ) {
    7171                    continue;
    7272                }
     
    7878                }
    7979
    80                 $forms_result = $this->api->get_slotflow_forms( $connection['token'], $tenant['endpoint'] );
     80                $forms_result = $this->api->get_widget_forms( $connection['token'], $tenant['endpoint'] );
    8181
    8282                if ( ! empty( $forms_result['success'] ) ) {
     
    212212                                        <code><?php echo esc_html( $widget['shortcode_label'] ); ?></code>
    213213                                    </div>
    214                                     <?php if ( 'slotflow' === $widget_slug ) : ?>
     214                                    <?php if ( $this->widget_requires_form_selection( $widget ) ) : ?>
    215215                                        <div class="yps-widget-meta">
    216216                                            <span>Form slug</span>
     
    272272                                            <?php echo esc_html( $field['label'] ); ?>
    273273                                        </label>
    274                                         <?php if ( 'slotflow' === $widget_slug && 'form_slug' === $field['key'] ) : ?>
    275                                             <?php $slotflow_forms = $widget_forms[ $widget_slug ] ?? array(); ?>
     274                                        <?php if ( 'form_slug' === $field['key'] && $this->widget_requires_form_selection( $widget ) ) : ?>
     275                                            <?php $available_forms = $widget_forms[ $widget_slug ] ?? array(); ?>
    276276                                            <select
    277277                                                id="yps-field-<?php echo esc_attr( $widget_slug . '-' . $field['key'] ); ?>"
     
    281281                                            >
    282282                                                <option value="">Select a form</option>
    283                                                 <?php foreach ( $slotflow_forms as $form ) : ?>
     283                                                <?php foreach ( $available_forms as $form ) : ?>
    284284                                                    <option value="<?php echo esc_attr( $form['slug'] ); ?>" <?php selected( $settings[ $field['key'] ] ?? '', $form['slug'] ); ?>>
    285285                                                        <?php echo esc_html( $form['name'] . ' (' . $form['slug'] . ')' ); ?>
     
    300300                                            <p class="description"><?php echo esc_html( $field['description'] ); ?></p>
    301301                                        <?php endif; ?>
    302                                         <?php if ( 'slotflow' === $widget_slug && 'form_slug' === $field['key'] && empty( $slotflow_forms ) ) : ?>
    303                                             <p class="description">No Slotflow forms found yet. Create a form in the Slotflow dashboard first.</p>
     302                                        <?php if ( 'form_slug' === $field['key'] && $this->widget_requires_form_selection( $widget ) && empty( $available_forms ) ) : ?>
     303                                            <p class="description"><?php echo esc_html( sprintf( 'No %s forms found yet. Create a form in the dashboard first.', $widget['name'] ) ); ?></p>
    304304                                        <?php endif; ?>
    305305                                    </div>
     
    311311                                        Insert <?php echo esc_html( $widget['shortcode_label'] ); ?> wherever you want the widget to appear.
    312312                                    </p>
    313                                     <?php if ( 'slotflow' === $widget_slug ) : ?>
     313                                    <?php if ( $this->widget_requires_form_selection( $widget ) ) : ?>
    314314                                        <p>
    315315                                            You can also override the configured form on a specific page with
    316                                             <code>[jinkosoft-slotflow form="your-form-slug"]</code>.
     316                                            <code>[<?php echo esc_html( $widget['shortcode_tag'] ); ?> form="your-form-slug"]</code>.
    317317                                        </p>
    318318                                    <?php endif; ?>
     
    528528        return $sanitized;
    529529    }
     530
     531    private function widget_requires_form_selection( $widget ) {
     532        if ( empty( $widget['fields'] ) || ! is_array( $widget['fields'] ) ) {
     533            return false;
     534        }
     535
     536        foreach ( $widget['fields'] as $field ) {
     537            if ( ! empty( $field['key'] ) && 'form_slug' === $field['key'] ) {
     538                return true;
     539            }
     540        }
     541
     542        return false;
     543    }
     544
    530545    private function render_widget_icon( $icon ) {
    531546        if ( 'calendar' === $icon ) {
     
    533548        }
    534549
     550        if ( 'lead' === $icon ) {
     551            return '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3a5 5 0 0 1 5 5c0 1.43-.6 2.72-1.57 3.63A6 6 0 0 1 20 17v2a1 1 0 1 1-2 0v-2a4 4 0 0 0-4-4h-4a4 4 0 0 0-4 4v2a1 1 0 1 1-2 0v-2a6 6 0 0 1 4.57-5.82A4.98 4.98 0 0 1 7 8a5 5 0 0 1 5-5Zm0 2a3 3 0 1 0 0 6 3 3 0 0 0 0-6Z"/></svg>';
     552        }
     553
    535554        return '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2a7 7 0 0 1 7 7c0 4.3-4.74 10.34-6.24 12.13a1 1 0 0 1-1.52 0C9.74 19.34 5 13.3 5 9a7 7 0 0 1 7-7Zm0 9.5A2.5 2.5 0 1 0 12 6a2.5 2.5 0 0 0 0 5.5Z"/></svg>';
    536555    }
  • yps-bundle/trunk/includes/class-yps-api.php

    r3484054 r3484915  
    161161    }
    162162
    163     public function get_slotflow_forms( $token, $tenant_endpoint ) {
     163    public function get_widget_forms( $token, $tenant_endpoint ) {
    164164        $query = <<<'GRAPHQL'
    165 query YpsBundleSlotflowForms {
     165query YpsBundleWidgetForms {
    166166  customEntitiesPaginated(entityType: "form", first: 100, orderBy: { column: "created_at", order: DESC }) {
    167167    data {
     
    196196            return array(
    197197                'success' => false,
    198                 'error'   => $this->parse_error_message( $data, 'Unable to load Slotflow forms.' ),
     198                'error'   => $this->parse_error_message( $data, 'Unable to load forms.' ),
    199199                'code'    => $code,
    200200            );
  • yps-bundle/trunk/includes/class-yps-frontend.php

    r3484054 r3484915  
    4545        $overrides = array();
    4646
    47         if ( 'slotflow' === $widget['slug'] ) {
     47        if ( $this->widget_supports_form_slug( $widget ) ) {
    4848            $form_slug = trim( (string) ( $atts['form'] ?: $atts['form_slug'] ) );
    4949
     
    8181        $api_url = yps_bundle_get_api_url() . '/' . $tenant['endpoint'] . '/graphql';
    8282
    83         if ( 'slotflow' === $widget_slug ) {
     83        if ( $this->widget_supports_form_slug( $widget ) ) {
    8484            $form_slug = trim( (string) ( $overrides['form_slug'] ?? ( $settings['form_slug'] ?? '' ) ) );
    8585
     
    8989
    9090            return sprintf(
    91                 '<slotflow-booking api-url="%1$s" form-slug="%2$s"></slotflow-booking>',
     91                '<%1$s api-url="%2$s" form-slug="%3$s"></%1$s>',
     92                esc_attr( $widget['tag_name'] ),
    9293                esc_attr( $api_url ),
    9394                esc_attr( $form_slug )
     
    9697
    9798        return sprintf(
    98             '<locate-my-store api-url="%1$s"></locate-my-store>',
     99            '<%1$s api-url="%2$s"></%1$s>',
     100            esc_attr( $widget['tag_name'] ),
    99101            esc_attr( $api_url )
    100102        );
     
    110112        return null;
    111113    }
     114
     115    private function widget_supports_form_slug( $widget ) {
     116        if ( empty( $widget['fields'] ) || ! is_array( $widget['fields'] ) ) {
     117            return false;
     118        }
     119
     120        foreach ( $widget['fields'] as $field ) {
     121            if ( ! empty( $field['key'] ) && 'form_slug' === $field['key'] ) {
     122                return true;
     123            }
     124        }
     125
     126        return false;
     127    }
    112128}
  • yps-bundle/trunk/readme.txt

    r3484054 r3484915  
    11=== Jinkosoft ===
    22Contributors: jinkosoft
    3 Tags: widgets, booking, store locator, embeddable, shortcode
     3Tags: widgets, booking, store locator, lead capture, embeddable, shortcode
    44Requires at least: 5.0
    55Tested up to: 6.7
     
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 Connect your Jinkosoft account and embed booking and store locator widgets in WordPress without adding heavy app logic to your site.
     11Connect your Jinkosoft account and embed booking, lead capture, and store locator widgets in WordPress without adding heavy app logic to your site.
    1212
    1313== Description ==
     
    2020
    2121* Slotflow: an embeddable booking widget for appointments and calls
     22* Lead Capture Widget: an embeddable popup widget for collecting leads and contact requests
    2223* Locate My Store: an embeddable store locator that points visitors to the right location
    2324
     
    3738For more information, visit:
    3839
    39 * `https://jinkosoft.com/en/embeddable-widgets/slotflow`
     40* [https://jinkosoft.com/en/embeddable-widgets/slotflow](https://jinkosoft.com/en/embeddable-widgets/slotflow)
     41
     42= Lead Capture Widget =
     43
     44Lead Capture Widget helps you collect leads directly from your website with a lightweight popup experience.
     45
     46Visitors can:
     47
     48* open or receive a popup form on the page
     49* submit contact details or a short message
     50* complete a lead capture flow without leaving the website
     51
     52Lead Capture Widget is designed for contact requests, sales inquiries, newsletter interest, early-access lists, and similar lead generation flows. Depending on your Jinkosoft workspace setup, it can also support configurable popup timing, branding rules, field selection, and form-specific embed flows managed from the external Jinkosoft dashboard.
     53
     54For more information, visit:
     55
     56* [https://jinkosoft.com/en/embeddable-widgets/leadcapture](https://jinkosoft.com/en/embeddable-widgets/leadcapture)
    4057
    4158= Locate My Store =
     
    5471For more information, visit:
    5572
    56 * `https://jinkosoft.com/en/embeddable-widgets/locatemystore`
     73* [https://jinkosoft.com/en/embeddable-widgets/locatemystore](https://jinkosoft.com/en/embeddable-widgets/locatemystore)
    5774
    5875= Why site owners use Jinkosoft =
     
    6178* Enable the widgets you need from one plugin page
    6279* Insert widgets with shortcode exactly where you want them
    63 * Manage widget-specific settings such as the Slotflow form slug
     80* Manage widget-specific settings such as form slug selection for Slotflow and Lead Capture Widget
    6481* Open the related Jinkosoft dashboard directly from WordPress
    6582
     
    6885* Add a booking form to a sales page or contact page
    6986* Use different Slotflow forms on different pages with shortcode attributes
    70 * Show a store locator across the whole website
    71 * Restrict a widget to selected landing pages only
     87* Add a popup lead capture form to landing pages or campaign pages
     88* Show a store locator on location or visit-us pages
    7289
    7390== Screenshots ==
     
    841015. Click `Try` or `Configure` on the widget you want to use
    851026. Copy the shortcode and place it in the page, post, or block where the widget should appear
    86 7. For Slotflow, select the form you want to display
     1037. For Slotflow and Lead Capture Widget, select the form you want to display
    87104
    88105== Frequently Asked Questions ==
     
    99116* choose the exact page position where the widget should appear
    100117
    101 For Slotflow, you can also use different forms on different pages with shortcode attributes such as:
     118For Slotflow and Lead Capture Widget, you can also use different forms on different pages with shortcode attributes such as:
    102119
    103120`[jinkosoft-slotflow form="demo-booking"]`
    104121
     122`[jinkosoft-lead-capture form="newsletter-popup"]`
     123
    105124= Will this plugin slow down my WordPress site? =
    106125
    107 The plugin is designed to stay lightweight on the WordPress side. It does not ship a large internal booking or locator application inside WordPress. Instead, it relies on the external Jinkosoft services and only loads the required embeddable widget scripts when the widget is actually used.
     126The plugin is designed to stay lightweight on the WordPress side. It does not ship a large internal booking, lead capture, or locator application inside WordPress. Instead, it relies on the external Jinkosoft services and only loads the required embeddable widget scripts when the widget is actually used.
    108127
    109128= Does this plugin use third-party services? =
     
    115134= Jinkosoft API =
    116135
    117 The plugin communicates with the Jinkosoft API to register or log in administrators, load the list of active workspaces, create widget workspaces, and serve widget data to embeddable components.
     136The plugin communicates with the Jinkosoft API to create or log in administrator accounts, load active workspaces, provision widget workspaces, and serve widget data to the embeddable components.
    118137
    119 * Service URL: `https://server.jinkosoft.com`
    120 * Used for: account creation, authentication, workspace provisioning, and widget data delivery
    121 * Data sent: administrator name, email, password, and widget configuration requests; visitors may send booking or store locator data through the embeddable widgets
    122 * Terms of Service: `https://jinkosoft.com/en/terms-and-conditions`
    123 * Privacy Policy: `https://jinkosoft.com/en/privacy-policy`
     138* Service: [Jinkosoft API](https://server.jinkosoft.com)
     139* Data sent: administrator name, email, password, workspace configuration requests, and visitor-submitted booking, lead capture, or store locator data when the widgets are used
     140* Terms of Service: [https://jinkosoft.com/en/terms-and-conditions](https://jinkosoft.com/en/terms-and-conditions)
     141* Privacy Policy: [https://jinkosoft.com/en/privacy-policy](https://jinkosoft.com/en/privacy-policy)
    124142
    125143= Jinkosoft Widget CDN =
     
    127145The plugin loads the widget scripts from the Jinkosoft CDN when the widgets are used on the website.
    128146
    129 * Service URL: `https://cdn-widgets.jinkosoft.com`
     147* Service: [Jinkosoft Widget CDN](https://cdn-widgets.jinkosoft.com)
    130148* Used for: delivering the embeddable widget scripts to visitors' browsers
    131 * Services loaded:
    132 ** `https://cdn-widgets.jinkosoft.com/widgets.iife.js`
    133 * Terms of Service: `https://jinkosoft.com/en/terms-and-conditions`
    134 * Privacy Policy: `https://jinkosoft.com/en/privacy-policy`
     149* Script loaded: [https://cdn-widgets.jinkosoft.com/widgets.iife.js](https://cdn-widgets.jinkosoft.com/widgets.iife.js)
     150* Terms of Service: [https://jinkosoft.com/en/terms-and-conditions](https://jinkosoft.com/en/terms-and-conditions)
     151* Privacy Policy: [https://jinkosoft.com/en/privacy-policy](https://jinkosoft.com/en/privacy-policy)
    135152
    136153== Changelog ==
    137154
     155= 1.0.1 =
     156Adding Lead Capture Widget
     157
    138158= 1.0.0 =
    139 * Initial release
     159* Initial release: Locate My Store, Slotflow
  • yps-bundle/trunk/yps-bundle.php

    r3484054 r3484915  
    33 * Plugin Name: Jinkosoft
    44 * Description: Connect your Jinkosoft account and configure embeddable widgets like Locate My Store and Slotflow.
    5  * Version: 1.0.0
     5 * Version: 1.1.0
    66 * Author: JinkoSoft
    77 * Text Domain: yps-bundle
     
    112112            ),
    113113        ),
     114        'leadcapture' => array(
     115            'slug'            => 'leadcapture',
     116            'name'            => 'Lead Capture Widget',
     117            'tenant_type'     => 'lead_capture',
     118            'default_plan'    => 'free',
     119            'shortcode_tag'   => 'jinkosoft-lead-capture',
     120            'shortcode_label' => '[jinkosoft-lead-capture]',
     121            'tag_name'        => 'lead-capture-widget',
     122            'script_name'     => 'widgets.iife.js',
     123            'description'     => 'Capture leads with a popup-first widget managed from Jinkosoft.',
     124            'icon'            => 'lead',
     125            'fields'          => array(
     126                array(
     127                    'key'         => 'form_slug',
     128                    'label'       => 'Form slug',
     129                    'type'        => 'text',
     130                    'required'    => true,
     131                    'description' => 'Choose the lead capture form you want to display in the popup widget.',
     132                ),
     133            ),
     134        ),
    114135    );
    115136
Note: See TracChangeset for help on using the changeset viewer.