Plugin Directory

Changeset 3378252


Ignore:
Timestamp:
10/14/2025 02:42:54 PM (6 months ago)
Author:
closemarketing
Message:

Update to version 4.0.4 from GitHub

Location:
formscrm
Files:
2 added
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • formscrm/tags/4.0.4/formscrm.php

    r3324829 r3378252  
    44 * Plugin URI:  https://close.technology/wordpress-plugins/formscrm/
    55 * Description: Connects Forms with CRM, ERP and Email Marketing.
    6  * Version:     4.0.3
     6 * Version:     4.0.4
    77 * Author:      CloseTechnology
    88 * Author URI:  https://close.technology
     
    2424defined( 'ABSPATH' ) || die( 'No script kiddies please!' );
    2525
    26 define( 'FORMSCRM_VERSION', '4.0.3' );
     26define( 'FORMSCRM_VERSION', '4.0.4' );
    2727define( 'FORMSCRM_PLUGIN', __FILE__ );
    2828define( 'FORMSCRM_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
  • formscrm/tags/4.0.4/includes/admin/class-admin-updater.php

    r3118314 r3378252  
    5656    private $wc_am_software_version            = '';
    5757
    58     public function __construct( $file, $product_id, $software_version, $plugin_or_theme, $api_url, $software_title = '', $text_domain = '' ) {
     58    /**
     59     * Constructor method for initializing the class.
     60     *
     61     * @param string     $file             The file path of the plugin or theme.
     62     * @param string|int $product_id       The product ID used for API requests. Can be a string (pre 2.0) or an integer (>= 2.0).
     63     * @param string     $software_version The version of the software.
     64     * @param string     $plugin_or_theme  Specifies whether it is a plugin or theme.
     65     * @param string     $api_url          The URL for the API endpoint.
     66     * @param string     $software_title   (Optional) The title of the software.
     67     * @param string     $text_domain      (Optional) The text domain for translation and localization.
     68     *
     69     * @return void
     70     */
     71    public function __construct( $file, $product_id, $software_version, $plugin_or_theme, $api_url, $software_title = '', $text_domain = '' ) {
    5972        $this->no_product_id   = empty( $product_id );
    6073        $this->plugin_or_theme = esc_attr( strtolower( $plugin_or_theme ) );
     
    120133            $this->wc_am_deactivation_tab_key        = $this->data_key . '_deactivation';
    121134            $this->wc_am_auto_update_key             = $this->data_key . '_auto_update';
    122             $this->wc_am_settings_menu_title         = $this->software_title . esc_html__( ' Activation', 'formscrm' );
    123             $this->wc_am_settings_title              = $this->software_title . esc_html__( ' License Activation', 'formscrm' );
     135            /* translators: %s: software title */
     136            $this->wc_am_settings_menu_title         = sprintf( esc_html__( '%s Activation', 'formscrm' ), $this->software_title );
     137            /* translators: %s: software title */
     138            $this->wc_am_settings_title              = sprintf( esc_html__( '%s License Activation', 'formscrm' ), $this->software_title );
    124139            $this->wc_am_menu_tab_activation_title   = esc_html__( 'License Activation', 'formscrm' );
    125140            $this->wc_am_menu_tab_deactivation_title = esc_html__( 'License Deactivation', 'formscrm' );
     
    272287                if ( $plugin_data[ 'auto-update-forced' ] ) {
    273288                    // Forced on.
    274                     $text = __( 'Auto-updates enabled' );
     289                    $text = __( 'Auto-updates enabled', 'formscrm' );
    275290                } else {
    276                     $text = __( 'Auto-updates disabled' );
     291                    $text = __( 'Auto-updates disabled', 'formscrm' );
    277292                }
    278293
     
    280295                $time_class = ' hidden';
    281296            } elseif ( in_array( $plugin_file, $auto_updates, true ) ) {
    282                 $text       = __( 'Disable auto-updates' );
     297                $text       = __( 'Disable auto-updates', 'formscrm' );
    283298                $action     = 'disable';
    284299                $time_class = '';
    285300            } else {
    286                 $text       = __( 'Enable auto-updates' );
     301                $text       = __( 'Enable auto-updates', 'formscrm' );
    287302                $action     = 'enable';
    288303                $time_class = ' hidden';
  • formscrm/tags/4.0.4/includes/crm-library/class-crmlib-clientify.php

    r3324829 r3378252  
    777777        $deal              = array();
    778778        $deal_product_skus = '';
     779        $last_module       = 'contact';
    779780
    780781        $module = sanitize_title( $module );
     
    894895                    $this->request( 'deals/' . $result['data']['id'] . '/products/', $res_products['data'], $apikey, 'PUT' );
    895896                }
     897                $last_module = 'deal';
    896898            }
    897899        } else {
     
    904906            );
    905907        }
     908
     909        $response_result['module'] = $last_module;
    906910        return $response_result;
    907911    }
  • formscrm/tags/4.0.4/includes/formscrm-library/class-gravityforms-widget.php

    r3104373 r3378252  
    6060                $html .= '<li>';
    6161                $html .= sprintf(
     62                    // translators: %s is the name of the feed.
    6263                    __( 'Feed: %s', 'formscrm' ),
    6364                    isset( $feed['meta']['feedName'] ) ? $feed['meta']['feedName'] : $feed['id'],
     
    7778                $html .= '<li>';
    7879                $html .= sprintf(
     80                    // translators: %s is the name of the feed.
    7981                    __( 'Feed: %s', 'formscrm' ),
    8082                    isset( $feed['meta']['feedName'] ) ? $feed['meta']['feedName'] : $feed['id'],
  • formscrm/tags/4.0.4/includes/formscrm-library/class-gravityforms.php

    r3290078 r3378252  
    279279                                'class'    => 'medium',
    280280                                'onchange' => 'jQuery(this).parents("form").submit();',
    281                                 'choices'  =>
    282                                 array_merge(
     281                                'choices'  => array_merge(
    283282                                    array(
     283                                        // translators: %s is the name of the CRM as defined in settings.
    284284                                        array(
    285285                                            'label' => sprintf(
     286                                                // translators: %s is the name of the CRM as defined in settings.
    286287                                                __( 'Use default CRM defined in Settings: %s', 'formscrm' ),
    287288                                                ucfirst( $settings_crm )
    288289                                            ),
    289290                                            'value' => 'no',
    290                                         ), 
     291                                        ),
    291292                                    ),
    292293                                    formscrm_get_choices()
     
    296297                        $this->get_crm_fields( false, $settings ),
    297298                        $this->get_crm_feed_fields( $settings ),
     299                        array(
     300                            array(
     301                                'name'        => 'fc_crm_webhook',
     302                                'label'       => __( 'FormsCRM webhook', 'formscrm' ),
     303                                'type'        => 'text',
     304                                'class'       => 'medium',
     305                                'input_type'  => 'url',
     306                                'placeholder' => __( 'https://your-webhook-url.com', 'formscrm' ),
     307                                'tooltip'     => '<h6>' . __( 'FormsCRM webhook', 'formscrm' ) . '</h6>' . __( 'Enter a URL to send a webhook form data received from CRM.', 'formscrm' ),
     308                            ),
     309                        )
    298310                    ),
    299311                ),
     
    576588        } else {
    577589            $response_message = sprintf(
    578                 // translators: %1$s CRM name %2$s ID number of entry created.
    579                 __( 'Success creating %1$s Entry ID: %2$s', 'formscrm' ),
     590                // translators: %1$s CRM name %2$s CRM type %3$s ID number of entry created.
     591                __( 'Success creating %1$s (%2$s) Entry ID: %3$s', 'formscrm' ),
     592                isset( $settings['fc_crm_name'] ) ? esc_html( $settings['fc_crm_name'] ) : '',
    580593                esc_html( $settings['fc_crm_type'] ),
    581594                $response_result['id']
     
    583596            $this->add_note( $entry['id'], $response_message, 'success' );
    584597            formscrm_debug_message( $response_result['id'] );
     598            formscrm_send_webhook( $settings, $response_result );
    585599            gform_add_meta( $entry['id'], $settings['fc_crm_type'], $response_result['id'], $form['id'] );
    586600        }
  • formscrm/tags/4.0.4/includes/formscrm-library/helpers-functions.php

    r2836306 r3378252  
    127127    }
    128128}
     129
     130if ( ! function_exists( 'formscrm_send_webhook' ) ) {
     131    /**
     132     * Sends webhook
     133     *
     134     * @param string $settings Settings.
     135     * @param array  $response Response from CRM.
     136     * @return void
     137     */
     138    function formscrm_send_webhook( $settings, $response ) {
     139        $webhook_url = isset( $settings['fc_crm_webhook'] ) ? $settings['fc_crm_webhook'] : '';
     140        if ( empty( $webhook_url ) ) {
     141            return;
     142        }
     143        $module   = isset( $response['module'] ) ? $response['module'] : '';
     144        $ids      = isset( $response['id'] ) ? $response['id'] : '';
     145        $ids      = explode( '|', $ids );
     146        $entry_id = end( $ids );
     147
     148        $body     = array(
     149            'hook' => array(
     150                'event'  => $module . '.saved',
     151                'target' => $webhook_url,
     152            ),
     153            'data' => array(
     154                'id' => $entry_id,
     155            ),
     156        );
     157        $response = wp_remote_post( $webhook_url, array( 'body' => wp_json_encode( $body ) ) );
     158        return array(
     159            'response' => $response,
     160            'request'  => $body,
     161        );
     162    }
     163}
  • formscrm/tags/4.0.4/readme.txt

    r3324829 r3378252  
    55Requires at least: 5.5
    66Tested up to: 6.8
    7 Stable tag: 4.0.3
    8 Version: 4.0.3
     7Stable tag: 4.0.4
     8Version: 4.0.4
    99License: GPL2
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    7474Field that applies the autoassignment to the contact. You can add a string with the list of usernames (property emails) separated by comma (,) to apply the autoassignment.
    7575
     76**Webhook in GravityForms**
     77You can add a new field that fits with the Webhook in GravityForms. This field is optional, and you need to add the webhook url. The plugin will send the form data received from CRM to the webhook url.
     78
    7679== Installation ==
    7780
     
    8386
    8487== Changelog ==
     88
     89= 4.0.4 =
     90*  Added: Webhook to send form data received from CRM in GravityForms.
     91*  Added: Automatic tests for robust testing and quality code.
     92
    8593= 4.0.3 =
    8694*  Enhaced: Add Pipeline name to improve Clientify pipeline implementation in Forms.
  • formscrm/trunk/formscrm.php

    r3324829 r3378252  
    44 * Plugin URI:  https://close.technology/wordpress-plugins/formscrm/
    55 * Description: Connects Forms with CRM, ERP and Email Marketing.
    6  * Version:     4.0.3
     6 * Version:     4.0.4
    77 * Author:      CloseTechnology
    88 * Author URI:  https://close.technology
     
    2424defined( 'ABSPATH' ) || die( 'No script kiddies please!' );
    2525
    26 define( 'FORMSCRM_VERSION', '4.0.3' );
     26define( 'FORMSCRM_VERSION', '4.0.4' );
    2727define( 'FORMSCRM_PLUGIN', __FILE__ );
    2828define( 'FORMSCRM_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
  • formscrm/trunk/includes/admin/class-admin-updater.php

    r3118314 r3378252  
    5656    private $wc_am_software_version            = '';
    5757
    58     public function __construct( $file, $product_id, $software_version, $plugin_or_theme, $api_url, $software_title = '', $text_domain = '' ) {
     58    /**
     59     * Constructor method for initializing the class.
     60     *
     61     * @param string     $file             The file path of the plugin or theme.
     62     * @param string|int $product_id       The product ID used for API requests. Can be a string (pre 2.0) or an integer (>= 2.0).
     63     * @param string     $software_version The version of the software.
     64     * @param string     $plugin_or_theme  Specifies whether it is a plugin or theme.
     65     * @param string     $api_url          The URL for the API endpoint.
     66     * @param string     $software_title   (Optional) The title of the software.
     67     * @param string     $text_domain      (Optional) The text domain for translation and localization.
     68     *
     69     * @return void
     70     */
     71    public function __construct( $file, $product_id, $software_version, $plugin_or_theme, $api_url, $software_title = '', $text_domain = '' ) {
    5972        $this->no_product_id   = empty( $product_id );
    6073        $this->plugin_or_theme = esc_attr( strtolower( $plugin_or_theme ) );
     
    120133            $this->wc_am_deactivation_tab_key        = $this->data_key . '_deactivation';
    121134            $this->wc_am_auto_update_key             = $this->data_key . '_auto_update';
    122             $this->wc_am_settings_menu_title         = $this->software_title . esc_html__( ' Activation', 'formscrm' );
    123             $this->wc_am_settings_title              = $this->software_title . esc_html__( ' License Activation', 'formscrm' );
     135            /* translators: %s: software title */
     136            $this->wc_am_settings_menu_title         = sprintf( esc_html__( '%s Activation', 'formscrm' ), $this->software_title );
     137            /* translators: %s: software title */
     138            $this->wc_am_settings_title              = sprintf( esc_html__( '%s License Activation', 'formscrm' ), $this->software_title );
    124139            $this->wc_am_menu_tab_activation_title   = esc_html__( 'License Activation', 'formscrm' );
    125140            $this->wc_am_menu_tab_deactivation_title = esc_html__( 'License Deactivation', 'formscrm' );
     
    272287                if ( $plugin_data[ 'auto-update-forced' ] ) {
    273288                    // Forced on.
    274                     $text = __( 'Auto-updates enabled' );
     289                    $text = __( 'Auto-updates enabled', 'formscrm' );
    275290                } else {
    276                     $text = __( 'Auto-updates disabled' );
     291                    $text = __( 'Auto-updates disabled', 'formscrm' );
    277292                }
    278293
     
    280295                $time_class = ' hidden';
    281296            } elseif ( in_array( $plugin_file, $auto_updates, true ) ) {
    282                 $text       = __( 'Disable auto-updates' );
     297                $text       = __( 'Disable auto-updates', 'formscrm' );
    283298                $action     = 'disable';
    284299                $time_class = '';
    285300            } else {
    286                 $text       = __( 'Enable auto-updates' );
     301                $text       = __( 'Enable auto-updates', 'formscrm' );
    287302                $action     = 'enable';
    288303                $time_class = ' hidden';
  • formscrm/trunk/includes/crm-library/class-crmlib-clientify.php

    r3324829 r3378252  
    777777        $deal              = array();
    778778        $deal_product_skus = '';
     779        $last_module       = 'contact';
    779780
    780781        $module = sanitize_title( $module );
     
    894895                    $this->request( 'deals/' . $result['data']['id'] . '/products/', $res_products['data'], $apikey, 'PUT' );
    895896                }
     897                $last_module = 'deal';
    896898            }
    897899        } else {
     
    904906            );
    905907        }
     908
     909        $response_result['module'] = $last_module;
    906910        return $response_result;
    907911    }
  • formscrm/trunk/includes/formscrm-library/class-gravityforms-widget.php

    r3104373 r3378252  
    6060                $html .= '<li>';
    6161                $html .= sprintf(
     62                    // translators: %s is the name of the feed.
    6263                    __( 'Feed: %s', 'formscrm' ),
    6364                    isset( $feed['meta']['feedName'] ) ? $feed['meta']['feedName'] : $feed['id'],
     
    7778                $html .= '<li>';
    7879                $html .= sprintf(
     80                    // translators: %s is the name of the feed.
    7981                    __( 'Feed: %s', 'formscrm' ),
    8082                    isset( $feed['meta']['feedName'] ) ? $feed['meta']['feedName'] : $feed['id'],
  • formscrm/trunk/includes/formscrm-library/class-gravityforms.php

    r3290078 r3378252  
    279279                                'class'    => 'medium',
    280280                                'onchange' => 'jQuery(this).parents("form").submit();',
    281                                 'choices'  =>
    282                                 array_merge(
     281                                'choices'  => array_merge(
    283282                                    array(
     283                                        // translators: %s is the name of the CRM as defined in settings.
    284284                                        array(
    285285                                            'label' => sprintf(
     286                                                // translators: %s is the name of the CRM as defined in settings.
    286287                                                __( 'Use default CRM defined in Settings: %s', 'formscrm' ),
    287288                                                ucfirst( $settings_crm )
    288289                                            ),
    289290                                            'value' => 'no',
    290                                         ), 
     291                                        ),
    291292                                    ),
    292293                                    formscrm_get_choices()
     
    296297                        $this->get_crm_fields( false, $settings ),
    297298                        $this->get_crm_feed_fields( $settings ),
     299                        array(
     300                            array(
     301                                'name'        => 'fc_crm_webhook',
     302                                'label'       => __( 'FormsCRM webhook', 'formscrm' ),
     303                                'type'        => 'text',
     304                                'class'       => 'medium',
     305                                'input_type'  => 'url',
     306                                'placeholder' => __( 'https://your-webhook-url.com', 'formscrm' ),
     307                                'tooltip'     => '<h6>' . __( 'FormsCRM webhook', 'formscrm' ) . '</h6>' . __( 'Enter a URL to send a webhook form data received from CRM.', 'formscrm' ),
     308                            ),
     309                        )
    298310                    ),
    299311                ),
     
    576588        } else {
    577589            $response_message = sprintf(
    578                 // translators: %1$s CRM name %2$s ID number of entry created.
    579                 __( 'Success creating %1$s Entry ID: %2$s', 'formscrm' ),
     590                // translators: %1$s CRM name %2$s CRM type %3$s ID number of entry created.
     591                __( 'Success creating %1$s (%2$s) Entry ID: %3$s', 'formscrm' ),
     592                isset( $settings['fc_crm_name'] ) ? esc_html( $settings['fc_crm_name'] ) : '',
    580593                esc_html( $settings['fc_crm_type'] ),
    581594                $response_result['id']
     
    583596            $this->add_note( $entry['id'], $response_message, 'success' );
    584597            formscrm_debug_message( $response_result['id'] );
     598            formscrm_send_webhook( $settings, $response_result );
    585599            gform_add_meta( $entry['id'], $settings['fc_crm_type'], $response_result['id'], $form['id'] );
    586600        }
  • formscrm/trunk/includes/formscrm-library/helpers-functions.php

    r2836306 r3378252  
    127127    }
    128128}
     129
     130if ( ! function_exists( 'formscrm_send_webhook' ) ) {
     131    /**
     132     * Sends webhook
     133     *
     134     * @param string $settings Settings.
     135     * @param array  $response Response from CRM.
     136     * @return void
     137     */
     138    function formscrm_send_webhook( $settings, $response ) {
     139        $webhook_url = isset( $settings['fc_crm_webhook'] ) ? $settings['fc_crm_webhook'] : '';
     140        if ( empty( $webhook_url ) ) {
     141            return;
     142        }
     143        $module   = isset( $response['module'] ) ? $response['module'] : '';
     144        $ids      = isset( $response['id'] ) ? $response['id'] : '';
     145        $ids      = explode( '|', $ids );
     146        $entry_id = end( $ids );
     147
     148        $body     = array(
     149            'hook' => array(
     150                'event'  => $module . '.saved',
     151                'target' => $webhook_url,
     152            ),
     153            'data' => array(
     154                'id' => $entry_id,
     155            ),
     156        );
     157        $response = wp_remote_post( $webhook_url, array( 'body' => wp_json_encode( $body ) ) );
     158        return array(
     159            'response' => $response,
     160            'request'  => $body,
     161        );
     162    }
     163}
  • formscrm/trunk/readme.txt

    r3324829 r3378252  
    55Requires at least: 5.5
    66Tested up to: 6.8
    7 Stable tag: 4.0.3
    8 Version: 4.0.3
     7Stable tag: 4.0.4
     8Version: 4.0.4
    99License: GPL2
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    7474Field that applies the autoassignment to the contact. You can add a string with the list of usernames (property emails) separated by comma (,) to apply the autoassignment.
    7575
     76**Webhook in GravityForms**
     77You can add a new field that fits with the Webhook in GravityForms. This field is optional, and you need to add the webhook url. The plugin will send the form data received from CRM to the webhook url.
     78
    7679== Installation ==
    7780
     
    8386
    8487== Changelog ==
     88
     89= 4.0.4 =
     90*  Added: Webhook to send form data received from CRM in GravityForms.
     91*  Added: Automatic tests for robust testing and quality code.
     92
    8593= 4.0.3 =
    8694*  Enhaced: Add Pipeline name to improve Clientify pipeline implementation in Forms.
Note: See TracChangeset for help on using the changeset viewer.