plugin updates
This commit is contained in:
@@ -1,72 +0,0 @@
|
||||
### 2.1.0 | 2024-03-14
|
||||
- Updated the additional contact field settings to use the generic field map instead of the deprecated dynamic field map field type.
|
||||
- Updated to use the v3 Owners API before v2 is sunset in August 2024.
|
||||
- Updated the minimum Gravity Forms version to 2.7.1.
|
||||
- Fixed a JavaScript error on the feed configuration page with Gravity Forms 2.8+.
|
||||
|
||||
### 2.0.0 | 2023-11-01
|
||||
- Fixed a bug where feeds can't be created or edited due to an invalid_lifecycle_stage error.
|
||||
|
||||
|
||||
### 1.9 | 2023-04-06
|
||||
- Added support for async (background) feed processing to improve form submission performance.
|
||||
- Fixed an issue where auth token refresh requests continue to occur after the app is uninstalled from within the connected HubSpot account.
|
||||
- Fixed an issue where unnecessary auth token refresh requests can occur during feed processing.
|
||||
- Fixed an issue where the connect button is displayed on the settings page when API requests are being rate limited.
|
||||
- Fixed an issue that causes the API to initialize on all front-end pages containing forms and all admin pages.
|
||||
- Fixed an issue where multiple auth token refresh requests can occur around the same time.
|
||||
- Fixed an issue where HubSpot forms are recreated when reconnecting to the same HubSpot account.
|
||||
- Fixed a fatal error that can occur when attempting to reconnect the add-on during an API outage.
|
||||
|
||||
|
||||
### 1.8 | 2022-11-3
|
||||
- Fixed an issue with lifecycle stages which causes feeds to error when being saved or updated.
|
||||
- Fixed a typo in the "clear cache" setting description.
|
||||
|
||||
|
||||
### 1.7 | 2021-11-10
|
||||
- Updated the styling for the disconnect alert messaging.
|
||||
- Fixed an issue where the disconnect from HubSpot button doesn't show when used with Gravity Forms 2.4.
|
||||
- Fixed an issue where the lead status and lifecycle stage fields are missing from the feed configuration page.
|
||||
- Fixed an issue where the add-on is disconnected after HubSpot reduced auth token lifespan from 6 hours to 30 minutes.
|
||||
|
||||
|
||||
### 1.6 | 2021-10-12
|
||||
- Added a button in the add-on settings page to manually clear the contact custom properties cache.
|
||||
- Added support for mapping single checkbox, multiple checkboxes, dropdown select, and radio select type HubSpot properties.
|
||||
- Added security enhancements.
|
||||
- Fixed an issue where a notice appears on the feed settings edit page.
|
||||
- Fixed fatal errors that can occur when the Hubspot API returns an error while updating feed settings.
|
||||
- Fixed an issue where authentication may not complete after attempting a connection with HubSpot.
|
||||
- Fixed issue where conditional Contact Owner feed settings are not getting saved.
|
||||
|
||||
|
||||
### 1.5 | 2020-09-23
|
||||
- Added support for Gravity Forms 2.5.
|
||||
- Fixed PHP warnings and notices which occur when the request to the HubSpot API to get the contact properties fails.
|
||||
|
||||
|
||||
### 1.4 | 2020-07-14
|
||||
- Added security enhancements.
|
||||
|
||||
|
||||
### 1.3 | 2020-05-18
|
||||
- Added translations for Hebrew, Hindi, Japanese, and Turkish.
|
||||
- Added support for feed duplication.
|
||||
- Fixed a PHP 7.4 notice which can occur when generating the HubSpot form for a feed outside the Form Settings area.
|
||||
- Fixed an issue with the position in the Form Settings menu when multiple add-ons are installed.
|
||||
|
||||
|
||||
### 1.2 | 2019-10-23
|
||||
- Updated the text in the add-on settings.
|
||||
- Updated the submission process to always send the IP address to Hubspot unless saving of the submitter IP is disabled in a form's personal data settings.
|
||||
- Fixed an issue where references to the add-on would appear as "Gravity Forms HubSpot Add-On Add-On."
|
||||
- Fixed an issue where HubSpot users without names display as empty labels when assigning contact owner(s) for a feed.
|
||||
|
||||
|
||||
### 1.1 | 2019-08-07
|
||||
- Added security enhancements.
|
||||
|
||||
|
||||
### 1.0 | 2019-07-18
|
||||
- All new!
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,96 +0,0 @@
|
||||
|
||||
.gform-routing-row{
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#assignees,
|
||||
#editable_fields{
|
||||
position: absolute;
|
||||
left: -9999px;
|
||||
}
|
||||
|
||||
.rtl #assignees,
|
||||
.rtl #editable_fields{
|
||||
right: -9999px;
|
||||
left: auto;
|
||||
}
|
||||
|
||||
table.gforms_form_settings th{
|
||||
border-left: 0;
|
||||
padding-left: 0!important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
table.gform-routings thead th{
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
table.gform-routings tr.gform-routing-row td{
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
table.gform-routings tr.gform-routing-row td .repeater-buttons{
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.repeater-buttons{
|
||||
display:inline-block;
|
||||
}
|
||||
.gform-routing-owners,
|
||||
.gform-routing-field{
|
||||
width:100%;
|
||||
min-width:150px;
|
||||
}
|
||||
.gform-routing-operator{
|
||||
width:120px;
|
||||
}
|
||||
.gform-routing-value{
|
||||
width:190px;
|
||||
}
|
||||
|
||||
html:not([dir="rtl"]) .gform-routings__heading {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
html[dir="rtl"] .gform-routings__heading {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#gaddon-setting-row-additional_fields > th, #gaddon-setting-row-contact_owner_conditional > th {
|
||||
display:none !important;
|
||||
}
|
||||
|
||||
.contact_owner_section {
|
||||
display:none;
|
||||
}
|
||||
|
||||
.add-item {
|
||||
margin-left: 6px;
|
||||
}
|
||||
.add-item, .remove-item {
|
||||
position: relative;
|
||||
color: #444;
|
||||
top: 3px;
|
||||
}
|
||||
|
||||
#feed_condition_conditional_logic_container {
|
||||
margin-top:10px;
|
||||
}
|
||||
|
||||
.gform-routings-field__buttons {
|
||||
position: relative;
|
||||
vertical-align: middle;
|
||||
width: 40px;
|
||||
}
|
||||
|
||||
.gform-routings-field__buttons .repeater-buttons {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex: 1 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
.gform-routing-row{vertical-align:top}#assignees,#editable_fields{left:-9999px;position:absolute}.rtl #assignees,.rtl #editable_fields{left:auto;right:-9999px}table.gforms_form_settings th{border-left:0;padding-left:0!important}table.gform-routings thead th{padding:0}table.gform-routings tr.gform-routing-row td{vertical-align:top}table.gform-routings tr.gform-routing-row td .repeater-buttons{white-space:nowrap}.repeater-buttons{display:inline-block}.gform-routing-field,.gform-routing-owners{min-width:150px;width:100%}.gform-routing-operator{width:120px}.gform-routing-value{width:190px}html:not([dir=rtl]) .gform-routings__heading{text-align:left}html[dir=rtl] .gform-routings__heading{text-align:right}#gaddon-setting-row-additional_fields>th,#gaddon-setting-row-contact_owner_conditional>th{display:none!important}.contact_owner_section{display:none}.add-item{margin-left:6px}.add-item,.remove-item{color:#444;position:relative;top:3px}#feed_condition_conditional_logic_container{margin-top:10px}.gform-routings-field__buttons{position:relative;vertical-align:middle;width:40px}.gform-routings-field__buttons .repeater-buttons{align-items:center;bottom:0;display:flex;flex:1 0;height:100%;position:absolute;top:0;width:100%}
|
||||
@@ -1,31 +0,0 @@
|
||||
#deauth_scope {
|
||||
display: none;
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
.deauth_button {
|
||||
margin-top: 0.5em !important;
|
||||
}
|
||||
|
||||
#gform_hubspot_deauth_button {
|
||||
border: 1px solid #9E0B0F;
|
||||
background: #9E0B0F;
|
||||
color: #FFF;
|
||||
-webkit-box-shadow: inset 0 2px 5px -3px rgba( 173, 12, 17, 0.5 );
|
||||
box-shadow: inset 0 2px 5px -3px rgba( 173, 12, 17, 0.5 );
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
#tab_gravityformshubspot table.gforms_form_settings > tbody > tr > th {
|
||||
padding: 0;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
#tab_gravityformshubspot table.gforms_form_settings #gform-settings-save,
|
||||
#tab_gravityformshubspot .gform-settings-save-container {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#last_cache_clearance {
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
#deauth_scope{display:none;margin-top:18px}.deauth_button{margin-top:.5em!important}#gform_hubspot_deauth_button{background:#9e0b0f;border:1px solid #9e0b0f;box-shadow:inset 0 2px 5px -3px rgba(173,12,17,.5);color:#fff;text-shadow:none}#tab_gravityformshubspot table.gforms_form_settings>tbody>tr>th{padding:0;width:0}#tab_gravityformshubspot .gform-settings-save-container,#tab_gravityformshubspot table.gforms_form_settings #gform-settings-save{display:none}#last_cache_clearance{font-size:.75rem}
|
||||
@@ -1,75 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: Gravity Forms HubSpot Add-On
|
||||
Plugin URI: https://gravityforms.com
|
||||
Description: Integrates Gravity Forms with HubSpot, allowing form submissions to be automatically sent to your HubSpot account.
|
||||
Version: 2.1.0
|
||||
Author: Gravity Forms
|
||||
Author URI: https://gravityforms.com
|
||||
License: GPL-3.0+
|
||||
Text Domain: gravityformshubspot
|
||||
Domain Path: /languages
|
||||
|
||||
------------------------------------------------------------------------
|
||||
Copyright 2019-2024 Rocketgenius, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see http://www.gnu.org/licenses.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
// Defines the current version of the Gravity Forms HubSpot Add-On.
|
||||
define( 'GF_HSPOT_VERSION', '2.1.0' );
|
||||
|
||||
define( 'GF_HSPOT_MIN_GF_VERSION', '2.7.1' );
|
||||
|
||||
// After GF is loaded, load the add-on.
|
||||
add_action( 'gform_loaded', array( 'GF_HSpot_Bootstrap', 'load_addon' ), 5 );
|
||||
|
||||
|
||||
/**
|
||||
* Loads the Gravity Forms HubSpot Add-On.
|
||||
*
|
||||
* Includes the main class and registers it with GFAddOn.
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
class GF_HSpot_Bootstrap {
|
||||
|
||||
/**
|
||||
* Loads the required files.
|
||||
*
|
||||
* @since 1.0
|
||||
* @access public
|
||||
* @static
|
||||
*/
|
||||
public static function load_addon() {
|
||||
|
||||
// Requires the class file.
|
||||
require_once plugin_dir_path( __FILE__ ) . '/class-gf-hubspot.php';
|
||||
|
||||
// Registers the class name with GFAddOn.
|
||||
GFAddOn::register( 'GF_HubSpot' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an instance of the GF_HubSpot class
|
||||
*
|
||||
* @since 1.0
|
||||
* @return GF_HubSpot An instance of the GF_HubSpot class
|
||||
*/
|
||||
function gf_hspot() {
|
||||
return GF_HubSpot::get_instance();
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M20.3215 10.0344C19.8536 9.22941 19.1954 8.58406 18.3726 8.09821C17.7577 7.74025 17.1201 7.51306 16.4016 7.41549V4.85763C17.1201 4.55256 17.566 3.87731 17.566 3.08955C17.566 2.01582 16.705 1.14572 15.6321 1.14572C14.5584 1.14572 13.6822 2.01582 13.6822 3.08955C13.6822 3.87731 14.1024 4.55256 14.8209 4.85763V7.41664C14.2461 7.4997 13.65 7.67889 13.1057 7.95422C11.9939 7.10984 8.34823 4.33974 6.21558 2.72182C6.26616 2.53946 6.30511 2.35151 6.30511 2.1532C6.30511 0.963939 5.34203 0 4.15234 0C2.96265 0 2 0.963939 2 2.1532C2 3.34232 2.96365 4.30654 4.15335 4.30654C4.55915 4.30654 4.93449 4.18785 5.25839 3.9927L5.70846 4.33413L11.8927 8.78998C11.5658 9.09017 11.2613 9.4316 11.0177 9.8147C10.5241 10.5957 10.2225 11.455 10.2225 12.3924V12.588C10.2225 13.246 10.3475 13.8672 10.5605 14.4507C10.748 14.9603 11.0222 15.4236 11.3618 15.8425L9.30929 17.9C9.01184 17.7893 8.6888 17.7665 8.37878 17.8345C8.06876 17.9025 7.78487 18.0583 7.56104 18.2834C7.40607 18.4376 7.28324 18.621 7.19967 18.823C7.1161 19.025 7.07345 19.2416 7.07419 19.4603C7.07433 19.9047 7.24749 20.3225 7.5619 20.6367C7.71601 20.7918 7.89937 20.9148 8.10134 20.9985C8.30331 21.0822 8.51989 21.125 8.73852 21.1245C8.95722 21.125 9.17385 21.0822 9.37589 20.9985C9.57793 20.9148 9.76136 20.7918 9.91557 20.6367C10.0704 20.4825 10.1932 20.2992 10.2768 20.0972C10.3605 19.8953 10.4032 19.6788 10.4027 19.4603C10.4027 19.2883 10.3761 19.1204 10.3261 18.9609L12.4476 16.8392C12.7384 17.0401 13.0525 17.2092 13.3902 17.3551C14.0563 17.643 14.7914 17.8185 15.596 17.8185H15.7435C16.633 17.8185 17.472 17.6096 18.2608 17.1822C19.092 16.7305 19.7425 16.1129 20.2339 15.3244C20.728 14.5338 21 13.6603 21 12.6992V12.6512C21 11.7058 20.7811 10.8335 20.3215 10.0344ZM17.7294 14.4852C17.1536 15.1251 16.4917 15.5193 15.7435 15.5193H15.6202C15.1928 15.5193 14.7748 15.4012 14.3655 15.1863C13.9042 14.9498 13.5536 14.6124 13.2666 14.1852C12.97 13.7659 12.8091 13.308 12.8091 12.8226V12.6752C12.8091 12.198 12.9006 11.7455 13.1314 11.3181C13.3782 10.8509 13.7114 10.4876 14.1546 10.1988C14.5897 9.91199 15.0544 9.77131 15.572 9.77131H15.6202C16.0895 9.77131 16.5338 9.86385 16.9531 10.0784C17.3803 10.3072 17.7294 10.6197 18 11.0308C18.2628 11.4421 18.4192 11.8857 18.4694 12.369C18.4774 12.4694 18.4814 12.5723 18.4814 12.6706C18.4814 13.3264 18.2308 13.9339 17.7294 14.4852Z" fill="#242748"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.4 KiB |
@@ -1,362 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Gravity Forms HubSpot API Library.
|
||||
*
|
||||
* @since 1.0
|
||||
* @package GravityForms
|
||||
* @author Rocketgenius
|
||||
* @copyright Copyright (c) 2019, Rocketgenius
|
||||
*/
|
||||
class GF_HubSpot_API {
|
||||
|
||||
/**
|
||||
* HubSpot API URL.
|
||||
*
|
||||
* @since 1.0
|
||||
* @var string $api_url HubSpot API URL.
|
||||
*/
|
||||
protected $api_url = 'https://api.hubapi.com/';
|
||||
|
||||
/**
|
||||
* HubSpot authentication data.
|
||||
*
|
||||
* @since 1.0
|
||||
* @var array $auth_data HubSpot authentication data.
|
||||
*/
|
||||
protected $auth_data = null;
|
||||
|
||||
/**
|
||||
* Initialize API library.
|
||||
*
|
||||
* @since 1.0
|
||||
*
|
||||
* @param array $auth_data HubSpot authentication data.
|
||||
*/
|
||||
public function __construct( $auth_data = null ) {
|
||||
$this->auth_data = $auth_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make API request.
|
||||
*
|
||||
* @since 1.0
|
||||
*
|
||||
* @param string $path Request path.
|
||||
* @param array $options Request options.
|
||||
* @param string $method Request method. Defaults to GET.
|
||||
* @param string $return_key Array key from response to return. Defaults to null (return full response).
|
||||
* @param int|array $response_code Expected HTTP response code.
|
||||
*
|
||||
* @return array|WP_Error
|
||||
*/
|
||||
public function make_request( $path = '', $options = array(), $method = 'GET', $return_key = null, $response_code = 200 ) {
|
||||
|
||||
// Log API call succeed.
|
||||
gf_hspot()->log_debug( __METHOD__ . '(): Making request to: ' . $path );
|
||||
|
||||
// Get authentication data.
|
||||
$auth_data = $this->auth_data;
|
||||
|
||||
// Build request URL.
|
||||
if ( $path === 'token/revoke' ) {
|
||||
$request_url = 'https://api.hubapi.com/oauth/v1/refresh-tokens/' . $options['token'];
|
||||
|
||||
// Execute request.
|
||||
$response = wp_remote_request( $request_url, array( 'method' => $method ) );
|
||||
} else {
|
||||
$request_url = strpos( $path, 'https://' ) === 0 ? $path : $this->api_url . $path;
|
||||
|
||||
// Add options if this is a GET request.
|
||||
if ( 'GET' === $method ) {
|
||||
$request_url = add_query_arg( $options, $request_url );
|
||||
}
|
||||
|
||||
// Prepare request arguments.
|
||||
$args = array(
|
||||
'method' => $method,
|
||||
'headers' => array(
|
||||
'Accept' => 'application/json',
|
||||
'Authorization' => 'Bearer ' . $auth_data['access_token'],
|
||||
'Content-Type' => 'application/json',
|
||||
),
|
||||
);
|
||||
|
||||
// Add request arguments to body.
|
||||
if ( in_array( $method, array( 'POST', 'PUT' ) ) ) {
|
||||
$args['body'] = json_encode( $options );
|
||||
}
|
||||
|
||||
// Execute API request.
|
||||
$response = wp_remote_request( $request_url, $args );
|
||||
}
|
||||
|
||||
if ( is_wp_error( $response ) ) {
|
||||
gf_hspot()->log_error( __METHOD__ . '(): HTTP request failed; ' . $response->get_error_message() );
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
// If an incorrect response code was returned, return WP_Error.
|
||||
$retrieved_response_code = wp_remote_retrieve_response_code( $response );
|
||||
if ( is_int( $response_code ) ) {
|
||||
$response_code = array( $response_code );
|
||||
}
|
||||
if ( ! in_array( $retrieved_response_code, $response_code, true ) ) {
|
||||
$response_code = implode( ', ', $response_code );
|
||||
$error_message = "Expected response code: {$response_code}. Returned response code: {$retrieved_response_code}.";
|
||||
$json_body = gf_hspot()->maybe_decode_json( $response['body'] );
|
||||
|
||||
$error_data = array( 'status' => $retrieved_response_code );
|
||||
if ( ! rgempty( 'message', $json_body ) ) {
|
||||
$error_message = $json_body['message'];
|
||||
}
|
||||
if ( ! rgempty( rgars( $json_body, 'errors' ) ) ) {
|
||||
$error_data['data'] = rgars( $json_body, 'errors' );
|
||||
}
|
||||
|
||||
// 401 Unauthorized - Returned when the authentication provided is invalid.
|
||||
if ( $retrieved_response_code === 401 ) {
|
||||
$log = 'API credentials are invalid;';
|
||||
} else {
|
||||
$log = 'API errors returned;';
|
||||
}
|
||||
|
||||
gf_hspot()->log_error( __METHOD__ . "(): $log " . $error_message . '; error data: ' . print_r( $error_data, true ) );
|
||||
|
||||
return new WP_Error( 'hubspot_api_error', $error_message, $error_data );
|
||||
}
|
||||
|
||||
// Convert JSON response to array.
|
||||
$response = gf_hspot()->maybe_decode_json( $response['body'] );
|
||||
|
||||
// If a return key is defined and array item exists, return it.
|
||||
if ( ! empty( $return_key ) && rgar( $response, $return_key ) ) {
|
||||
return rgar( $response, $return_key );
|
||||
}
|
||||
|
||||
return $response;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh access tokens.
|
||||
*
|
||||
* @since 1.0
|
||||
*
|
||||
* @return array|WP_Error
|
||||
*/
|
||||
public function refresh_token() {
|
||||
// Get authentication data.
|
||||
$auth_data = $this->auth_data;
|
||||
|
||||
// If refresh token is not provided, throw exception.
|
||||
if ( ! rgar( $auth_data, 'refresh_token' ) ) {
|
||||
return new WP_Error( 'hubspot_refresh_token_error', esc_html__( 'Refresh token must be provided.', 'gravityformshubspot' ) );
|
||||
}
|
||||
|
||||
$args = array(
|
||||
'body' => array(
|
||||
'refresh_token' => $auth_data['refresh_token'],
|
||||
'state' => wp_create_nonce( gf_hspot()->get_authentication_state_action() ),
|
||||
),
|
||||
);
|
||||
|
||||
$response = wp_remote_post( gf_hspot()->get_gravity_api_url( '/auth/hubspot/refresh' ), $args );
|
||||
$response_code = wp_remote_retrieve_response_code( $response );
|
||||
$message = wp_remote_retrieve_response_message( $response );
|
||||
|
||||
if ( $response_code === 200 ) {
|
||||
$auth_payload = json_decode( wp_remote_retrieve_body( $response ), true );
|
||||
$auth_payload = json_decode( $auth_payload['auth_payload'], true );
|
||||
|
||||
if ( isset( $auth_payload['access_token'] ) && wp_verify_nonce( $auth_payload['state'], gf_hspot()->get_authentication_state_action() ) ) {
|
||||
$auth_data['access_token'] = $auth_payload['access_token'];
|
||||
$auth_data['refresh_token'] = $auth_payload['refresh_token'];
|
||||
$auth_data['expires_in'] = $auth_payload['expires_in'];
|
||||
|
||||
$this->auth_data = $auth_data;
|
||||
|
||||
return $auth_data;
|
||||
}
|
||||
|
||||
if ( isset( $auth_payload['error'] ) ) {
|
||||
$message = $auth_payload['error'];
|
||||
} elseif ( isset( $auth_payload['status'] ) ) {
|
||||
$message = $auth_payload['status'];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return new WP_Error( 'hubspot_refresh_token_error', $message, array( 'status' => $response_code ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Revoke authentication token.
|
||||
*
|
||||
* @since 1.0
|
||||
*
|
||||
* @return array|WP_Error
|
||||
*/
|
||||
public function revoke_token() {
|
||||
|
||||
// Get authentication data.
|
||||
$auth_data = $this->auth_data;
|
||||
|
||||
// If refresh token is not provided, throw exception.
|
||||
if ( ! rgar( $auth_data, 'refresh_token' ) ) {
|
||||
return new WP_Error( 'hubspot_revoke_token_error', esc_html__( 'Refresh token must be provided.', 'gravityformshubspot' ) );
|
||||
}
|
||||
|
||||
return $this->make_request( 'token/revoke', array( 'token' => $auth_data['refresh_token'] ), 'DELETE', null, 204 );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get available users.
|
||||
*
|
||||
* @since 1.0
|
||||
*
|
||||
* @return array|WP_Error
|
||||
*/
|
||||
public function get_contacts() {
|
||||
static $contacts;
|
||||
|
||||
if ( ! isset( $contacts ) ) {
|
||||
$contacts = $this->make_request( 'contacts/v1/lists/all/contacts/all', array(), 'GET', 'users' );
|
||||
}
|
||||
|
||||
return $contacts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get contact properties.
|
||||
*
|
||||
* @since 1.0
|
||||
*
|
||||
* @return array|WP_Error
|
||||
*/
|
||||
public function get_contact_properties() {
|
||||
|
||||
$properties = $this->make_request( 'properties/v1/contacts/groups/?includeProperties=true', array(), 'GET' );
|
||||
|
||||
return $properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update contact properties by email.
|
||||
*
|
||||
* @since 1.0
|
||||
*
|
||||
* @param string $email Email.
|
||||
* @param array $data Contact data.
|
||||
*
|
||||
* @return array|WP_Error
|
||||
*/
|
||||
public function update_contact_by_email( $email, $data ) {
|
||||
return $this->make_request( "contacts/v1/contact/createOrUpdate/email/{$email}/", $data, 'POST' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new form.
|
||||
*
|
||||
* @since 1.0
|
||||
*
|
||||
* @param array $form The form options array.
|
||||
*
|
||||
* @return array|WP_Error
|
||||
*/
|
||||
public function create_form( $form ) {
|
||||
return $this->make_request( 'forms/v2/forms', $form, 'POST' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get form by guid.
|
||||
*
|
||||
* @since 1.0
|
||||
*
|
||||
* @param string $guid GUID of the form.
|
||||
*
|
||||
* @return array|WP_Error
|
||||
*/
|
||||
public function get_form( $guid ) {
|
||||
return $this->make_request( "forms/v2/forms/{$guid}" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all forms.
|
||||
*
|
||||
* @since 1.0
|
||||
*
|
||||
* @return array|WP_Error Returns an array of forms
|
||||
*/
|
||||
public function get_forms() {
|
||||
return $this->make_request( 'forms/v2/forms' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the form.
|
||||
*
|
||||
* @since 1.0
|
||||
*
|
||||
* @param string $guid GUID of the form.
|
||||
* @param array $form The form options array.
|
||||
*
|
||||
* @return array|WP_Error
|
||||
*/
|
||||
public function update_form( $guid, $form ) {
|
||||
|
||||
gf_hspot()->log_debug( 'Updating Form. GUID: ' . $guid );
|
||||
gf_hspot()->log_debug( 'Payload: ' . print_r( $form, true ) );
|
||||
|
||||
return $this->make_request( "forms/v2/forms/{$guid}", $form, 'POST' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete form.
|
||||
*
|
||||
* @since 1.0
|
||||
*
|
||||
* @param string $guid GUID of the form.
|
||||
*
|
||||
* @return array|WP_Error
|
||||
*/
|
||||
public function delete_form( $guid ) {
|
||||
return $this->make_request( "forms/v2/forms/{$guid}", array(), 'DELETE', null, 204 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get contact owners from HubSpot.
|
||||
*
|
||||
* @since 1.0
|
||||
* @since 2.1 Updated to use the v3 endpoint.
|
||||
*
|
||||
* @return array|WP_Error
|
||||
*/
|
||||
public function get_owners() {
|
||||
return $this->make_request( 'crm/v3/owners', array( 'limit' => 500 ), 'GET', 'results' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Submit form data to HubSpot.
|
||||
*
|
||||
* @since 1.0
|
||||
*
|
||||
* @param string $portal_id HubSpot portal ID.
|
||||
* @param string $form_guid HubSpot form GUID.
|
||||
* @param array $submission Form submission data.
|
||||
*
|
||||
* @return array|WP_Error
|
||||
*/
|
||||
public function submit_form( $portal_id, $form_guid, $submission ) {
|
||||
|
||||
// Submit HubSpot form.
|
||||
$url = "https://api.hsforms.com/submissions/v3/integration/submit/{$portal_id}/{$form_guid}";
|
||||
|
||||
gf_hspot()->log_debug( 'Submitting Form. URL:' . $url );
|
||||
gf_hspot()->log_debug( 'Payload: ' . print_r( $submission, true ) );
|
||||
|
||||
return $this->make_request( $url, $submission, 'POST' );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,310 +0,0 @@
|
||||
/* global jQuery, gform_hubspot_owner_settings_strings, gf_vars */
|
||||
/* eslint-disable no-var */
|
||||
|
||||
jQuery(document).ready( function() {
|
||||
|
||||
new GFOwnerSetting();
|
||||
|
||||
} );
|
||||
|
||||
var legacyUI = gform_hubspot_owner_settings_strings.legacy_ui;
|
||||
var prefix = {
|
||||
input: legacyUI ? '_gaddon_setting_' : '_gform_setting_',
|
||||
field: legacyUI ? 'gaddon-setting-row-' : 'gform_setting_',
|
||||
};
|
||||
|
||||
function GFOwnerSetting() {
|
||||
var $ = jQuery;
|
||||
|
||||
/**
|
||||
* Initializes the Contact Owner module in the HubSpot feed settings.
|
||||
*/
|
||||
this.init = function() {
|
||||
this.initOwner();
|
||||
new GFConditionsSetting();
|
||||
};
|
||||
|
||||
/**
|
||||
* Binds event listeners to the contact owner inputs and initializes the state.
|
||||
*/
|
||||
this.initOwner = function() {
|
||||
var t = this;
|
||||
|
||||
$( '#contact_owner0, #contact_owner1, #contact_owner2' ).on( 'change', function() {
|
||||
t.toggleOwner( true );
|
||||
} );
|
||||
|
||||
this.toggleOwner( false );
|
||||
};
|
||||
|
||||
/**
|
||||
* Toggles the active owner inputs.
|
||||
*
|
||||
* @param {boolean} doSlide
|
||||
*/
|
||||
this.toggleOwner = function( doSlide ) {
|
||||
var ownerRadioIds = [
|
||||
'#' + prefix.field + 'contact_owner_select',
|
||||
'#' + prefix.field + 'contact_owner_conditional',
|
||||
];
|
||||
var $section = $( '.contact_owner_section' );
|
||||
var $selectedOption = $( 'input[name="' + prefix.input + 'contact_owner"]:checked' );
|
||||
var selection = $selectedOption.val();
|
||||
|
||||
$( ownerRadioIds.join( ', ' ) ).hide();
|
||||
|
||||
// No contact owner selected. Hide and exit.
|
||||
if ( selection === 'none' ) {
|
||||
if ( doSlide && legacyUI ) {
|
||||
$section.slideUp();
|
||||
} else {
|
||||
$section.hide();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Show the contact owner section and the selected option.
|
||||
if ( $section.is( ':hidden' ) ) {
|
||||
if ( doSlide && legacyUI ) {
|
||||
$section.slideDown();
|
||||
} else {
|
||||
$section.show();
|
||||
}
|
||||
}
|
||||
|
||||
$( '#' + prefix.field + 'contact_owner_' + selection ).show();
|
||||
};
|
||||
|
||||
//Initializes this class
|
||||
this.init();
|
||||
}
|
||||
|
||||
function GFConditionsSetting() {
|
||||
var $ = jQuery;
|
||||
|
||||
//Instantiating conditions repeater
|
||||
this.$element = jQuery('#gform_conditions_setting');
|
||||
this.fieldId = 'conditions';
|
||||
this.fieldName = prefix.input + 'conditions';
|
||||
this.options = null;
|
||||
|
||||
this.init = function() {
|
||||
|
||||
var t = this;
|
||||
|
||||
this.options = {
|
||||
fieldName: this.fieldName,
|
||||
fieldId: this.fieldId,
|
||||
fields: gform_hubspot_owner_settings_strings['fields'],// [{'id': '1', 'label':'Name'}, {'id':'2', 'label': 'Email'} ],// gf_routing_setting_strings['fields'],
|
||||
owners: gform_hubspot_owner_settings_strings['owners'],
|
||||
imagesURL: gf_vars.baseUrl + "/images",
|
||||
items: this.getItems(),
|
||||
operatorStrings: {"is":"is","isnot":"isNot", ">":"greaterThan", "<":"lessThan", "contains":"contains", "starts_with":"startsWith", "ends_with":"endsWith"},
|
||||
};
|
||||
|
||||
var routingsMarkup, headerMarkup;
|
||||
headerMarkup = '<thead><tr><th class="gform-routings__heading gform-routings__heading--assign">{0}</th>';
|
||||
headerMarkup += '<th class="gform-routings__heading gform-routings__heading--condition" colspan="3">{1}</th>';
|
||||
headerMarkup += '</tr></thead>';
|
||||
|
||||
headerMarkup = headerMarkup.gformFormat( gform_hubspot_owner_settings_strings.assign_to, gform_hubspot_owner_settings_strings.condition );
|
||||
routingsMarkup = '<table class="gform-routings">{0}<tbody class="repeater">{1}</tbody></table>'.gformFormat(headerMarkup, this.getNewRow());
|
||||
|
||||
var $routings = $(routingsMarkup);
|
||||
|
||||
$routings.find('.repeater').repeater({
|
||||
|
||||
limit : 0,
|
||||
items : this.options.items,
|
||||
addButtonMarkup : '<i class="gficon-add"></i>',
|
||||
removeButtonMarkup: '<i class="gficon-subtract"></i>',
|
||||
callbacks : {
|
||||
save : function (obj, data) {
|
||||
$('#' + t.options.fieldId).val($.toJSON(data));
|
||||
},
|
||||
beforeAdd: function (obj, $elem, item) {
|
||||
if ( item.owner ) {
|
||||
$elem.find('.gform-routing-owners').val(item.owner);
|
||||
}
|
||||
|
||||
var $field = $elem.find('.gform-routing-field').first();
|
||||
$field.value = item.fieldId;
|
||||
t.changeField($field);
|
||||
|
||||
var $operator = $elem.find('.gform-routing-operator').first();
|
||||
$operator.value = item.operator;
|
||||
|
||||
t.changeOperator($operator);
|
||||
|
||||
var $value = $elem.find('.gform-routing-value');
|
||||
$value.val(item.value);
|
||||
|
||||
},
|
||||
}
|
||||
})
|
||||
.on('change', '.gform-routing-field', function (e) {
|
||||
t.changeField(this);
|
||||
})
|
||||
.on('change', '.gform-routing-operator', function () {
|
||||
t.changeOperator(this);
|
||||
})
|
||||
|
||||
this.$element.append($routings);
|
||||
}
|
||||
|
||||
this.getNewRow = function () {
|
||||
var r = [];
|
||||
|
||||
r.push( '<td>{0}</td>'.gformFormat( this.getOwners() ) );
|
||||
r.push( '<td>{0}</td>'.gformFormat( this.getFields() ) );
|
||||
r.push( '<td>{0}</td>'.gformFormat( this.getOperators( this.options.fields[0] ) ) );
|
||||
r.push( '<td>{0}</td>'.gformFormat( this.getValues() ) );
|
||||
r.push( '<td class="gform-routings-field gform-routings-field__buttons">{buttons}</td>' );
|
||||
|
||||
return '<tr class="gform-routing-row">{0}</tr>'.gformFormat( r.join('') );
|
||||
},
|
||||
|
||||
this.getOwners = function () {
|
||||
|
||||
var i, n, account,
|
||||
owners = this.options.owners,
|
||||
str = '<select class="gform-routing-owners owner_{i}">';
|
||||
|
||||
for (i = 0; i < owners.length; i++) {
|
||||
str += '<option value="{0}">{1}</option>'.gformFormat( owners[i].value, owners[i].label );
|
||||
}
|
||||
|
||||
str += "</select>";
|
||||
return str;
|
||||
},
|
||||
|
||||
this.getFields = function () {
|
||||
var i, j, key, val, label, groupLabel, options, numRows,
|
||||
select = [],
|
||||
settings = this.options.fields;
|
||||
select.push('<select class="gform-routing-field fieldId_{i}" >');
|
||||
for (i = 0; i < settings.length; i++) {
|
||||
key = settings[i].key;
|
||||
if (settings[i].group) {
|
||||
groupLabel = settings[i].text;
|
||||
numRows = settings[i].filters.length;
|
||||
options = [];
|
||||
for (j = 0; j < numRows; j++) {
|
||||
label = settings[i].filters[j].text;
|
||||
val = settings[i].filters[j].key;
|
||||
options.push('<option value="{0}">{1}</option>'.gformFormat(val, label));
|
||||
}
|
||||
select.push('<optgroup label="{0}">{1}</optgroup>'.gformFormat(groupLabel, options.join('')));
|
||||
} else {
|
||||
label = settings[i].text;
|
||||
select.push('<option value="{0}">{1}</option>'.gformFormat(key, label));
|
||||
}
|
||||
|
||||
}
|
||||
select.push("</select>");
|
||||
return select.join('');
|
||||
},
|
||||
|
||||
this.changeOperator = function (operatorSelect) {
|
||||
var $select = $(operatorSelect),
|
||||
$buttons = $select.closest('tr').find('.repeater-buttons');
|
||||
var index = $buttons.find('.add-item ').data('index');
|
||||
var $fieldSelect = $select.closest('tr').find('.gform-routing-field');
|
||||
var filter = this.getFilter($fieldSelect.value);
|
||||
if (filter) {
|
||||
$select.closest('tr').find(".gform-routing-value").replaceWith(this.getValues(filter, operatorSelect.value, index));
|
||||
}
|
||||
},
|
||||
|
||||
this.changeField = function (fieldSelect) {
|
||||
var filter = this.getFilter(fieldSelect.value);
|
||||
if (filter) {
|
||||
var $select = $(fieldSelect),
|
||||
$buttons = $select.closest('tr').find('.repeater-buttons');
|
||||
var index = $buttons.find('.add-item ').data('index');
|
||||
$select.closest('tr').find(".gform-routing-value").replaceWith(this.getValues(filter, null, index));
|
||||
$select.closest('tr').find(".gform-filter-type").val(filter.type).change();
|
||||
var $newOperators = $(this.getOperators(filter, index));
|
||||
$select.closest('tr').find(".gform-routing-operator").replaceWith($newOperators);
|
||||
$select.closest('tr').find(".gform-routing-operator").change();
|
||||
}
|
||||
},
|
||||
|
||||
this.getOperators = function (filter, index) {
|
||||
if ( typeof index == 'undefined' || index === null ){
|
||||
index = '{i}';
|
||||
}
|
||||
var i, operator,
|
||||
operatorStrings = this.options.operatorStrings,
|
||||
str = '<select class="gform-routing-operator operator_{0}">'.gformFormat(index);
|
||||
|
||||
if (filter) {
|
||||
for (i = 0; i < filter.operators.length; i++) {
|
||||
operator = filter.operators[i];
|
||||
str += '<option value="{0}">{1}</option>'.gformFormat(operator, gf_vars[operatorStrings[operator]] );
|
||||
}
|
||||
}
|
||||
str += "</select>";
|
||||
return str;
|
||||
},
|
||||
|
||||
this.getValues = function (filter, selectedOperator, index) {
|
||||
var i, val, text, str, options = "";
|
||||
|
||||
if ( typeof index == 'undefined' || index === null ){
|
||||
index = '{i}';
|
||||
}
|
||||
|
||||
if ( filter && filter.values && selectedOperator != 'contains' ) {
|
||||
for (i = 0; i < filter.values.length; i++) {
|
||||
val = filter.values[i].value;
|
||||
text = filter.values[i].text;
|
||||
options += '<option value="{0}">{1}</option>'.gformFormat(val, text);
|
||||
}
|
||||
str = '<select class="gform-routing-value value_{0}">{1}</select>'.gformFormat(index, options);
|
||||
} else {
|
||||
str = '<input type="text" value="" class="gform-routing-value value_{0}" />'.gformFormat(index);
|
||||
}
|
||||
|
||||
return str;
|
||||
},
|
||||
|
||||
this.getFilter = function (key) {
|
||||
var fields = this.options.fields;
|
||||
if (!key)
|
||||
return;
|
||||
for (var i = 0; i < fields.length; i++) {
|
||||
if (key == fields[i].key)
|
||||
return fields[i];
|
||||
if (fields[i].group) {
|
||||
for (var j = 0; j < fields[i].filters.length; j++) {
|
||||
if (key == fields[i].filters[j].key)
|
||||
return fields[i].filters[j];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
this.selected = function (selected, current){
|
||||
return selected == current ? 'selected="selected"' : "";
|
||||
}
|
||||
|
||||
this.getItems = function () {
|
||||
var json = $('#' + this.fieldId ).val();
|
||||
var default_items = [ {owner: '', fieldId: '0', operator: 'is', value: ''} ];
|
||||
var items = json ? $.parseJSON(json) : default_items;
|
||||
return items;
|
||||
}
|
||||
|
||||
this.init();
|
||||
|
||||
String.prototype.format = function () {
|
||||
var args = arguments;
|
||||
return this.replace(/{(\d+)}/g, function (match, number) {
|
||||
return typeof args[number] != 'undefined' ? args[number] : match;
|
||||
});
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,105 +0,0 @@
|
||||
/* global gform_hubspot_pluginsettings_strings */
|
||||
window.GFHubSpotSettings = null;
|
||||
|
||||
(function ($) {
|
||||
GFHubSpotSettings = function () {
|
||||
var self = this;
|
||||
|
||||
this.init = function () {
|
||||
this.pageURL = gform_hubspot_pluginsettings_strings.settings_url;
|
||||
|
||||
this.deauthActionable = false;
|
||||
|
||||
this.bindDeauthorize();
|
||||
this.bindClearCache();
|
||||
}
|
||||
|
||||
this.bindDeauthorize = function () {
|
||||
// De-Authorize Zoho CRM.
|
||||
$('.gform_hubspot_deauth_button').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Get button.
|
||||
var deauthButton = $('#gform_hubspot_deauth_button'),
|
||||
deauthScope = $('#deauth_scope'),
|
||||
disconnectMessage = gform_hubspot_pluginsettings_strings.disconnect;
|
||||
|
||||
if (!self.deauthActionable) {
|
||||
$('.gform_hubspot_deauth_button').eq(0).hide();
|
||||
|
||||
deauthScope.show(0, function(){
|
||||
self.deauthActionable = true;
|
||||
});
|
||||
} else {
|
||||
var deauthScopeVal = $('#deauth_scope0').is(':checked') ? 'site' : 'account';
|
||||
// Confirm deletion.
|
||||
if (!confirm(disconnectMessage[deauthScopeVal])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set disabled state.
|
||||
deauthButton.attr('disabled', 'disabled');
|
||||
|
||||
// De-Authorize.
|
||||
$.ajax({
|
||||
async: false,
|
||||
url: ajaxurl,
|
||||
dataType: 'json',
|
||||
method: 'POST',
|
||||
data: {action: 'gfhubspot_deauthorize', scope: deauthScopeVal, nonce: gform_hubspot_pluginsettings_strings.deauth_nonce},
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
window.location.href = self.pageURL;
|
||||
} else {
|
||||
alert(response.data.message);
|
||||
}
|
||||
|
||||
deauthButton.removeAttr('disabled');
|
||||
}
|
||||
}).fail(function(jqXHR, textStatus, error) {
|
||||
alert(error);
|
||||
deauthButton.removeAttr('disabled');
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
this.bindClearCache = function() {
|
||||
$( '#clear_hubspot_cache' ).on( 'click', function ( e ) {
|
||||
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
|
||||
var $button = $( this );
|
||||
$button.attr( 'disabled', true );
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: ajaxurl,
|
||||
data: {
|
||||
action: 'gf_hubspot_clear_cache',
|
||||
nonce: gform_hubspot_pluginsettings_strings.clear_cache_nonce,
|
||||
},
|
||||
success: function( response ) {
|
||||
if ( 'last_clearance' in response.data ) {
|
||||
jQuery('.success-alert-container').fadeIn();
|
||||
$( '#last_cache_clearance .time' ).text( response.data.last_clearance );
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
jQuery('.error-alert-container').fadeIn();
|
||||
},
|
||||
complete: function () {
|
||||
$button.attr( 'disabled', false );
|
||||
setTimeout( function () { jQuery('.alert-container').fadeOut(); }, 10000 );
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
this.init();
|
||||
};
|
||||
|
||||
$(document).ready( GFHubSpotSettings );
|
||||
})(jQuery);
|
||||
@@ -1 +0,0 @@
|
||||
window.GFHubSpotSettings=null,function(o){GFHubSpotSettings=function(){var i=this;this.init=function(){this.pageURL=gform_hubspot_pluginsettings_strings.settings_url,this.deauthActionable=!1,this.bindDeauthorize(),this.bindClearCache()},this.bindDeauthorize=function(){o(".gform_hubspot_deauth_button").on("click",function(t){t.preventDefault();var a=o("#gform_hubspot_deauth_button"),t=o("#deauth_scope"),e=gform_hubspot_pluginsettings_strings.disconnect;if(i.deauthActionable){var n=o("#deauth_scope0").is(":checked")?"site":"account";if(!confirm(e[n]))return!1;a.attr("disabled","disabled"),o.ajax({async:!1,url:ajaxurl,dataType:"json",method:"POST",data:{action:"gfhubspot_deauthorize",scope:n,nonce:gform_hubspot_pluginsettings_strings.deauth_nonce},success:function(t){t.success?window.location.href=i.pageURL:alert(t.data.message),a.removeAttr("disabled")}}).fail(function(t,e,n){alert(n),a.removeAttr("disabled")})}else o(".gform_hubspot_deauth_button").eq(0).hide(),t.show(0,function(){i.deauthActionable=!0})})},this.bindClearCache=function(){o("#clear_hubspot_cache").on("click",function(t){t.preventDefault(),t.stopImmediatePropagation();var e=o(this);e.attr("disabled",!0),o.ajax({method:"POST",url:ajaxurl,data:{action:"gf_hubspot_clear_cache",nonce:gform_hubspot_pluginsettings_strings.clear_cache_nonce},success:function(t){"last_clearance"in t.data&&(jQuery(".success-alert-container").fadeIn(),o("#last_cache_clearance .time").text(t.data.last_clearance))},error:function(){jQuery(".error-alert-container").fadeIn()},complete:function(){e.attr("disabled",!1),setTimeout(function(){jQuery(".alert-container").fadeOut()},1e4)}})})},this.init()},o(document).ready(GFHubSpotSettings)}(jQuery);
|
||||
@@ -1,266 +0,0 @@
|
||||
# Copyright (C) 2024 Gravity Forms
|
||||
# This file is distributed under the GPL-3.0+.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gravity Forms HubSpot Add-On 2.1.0\n"
|
||||
"Report-Msgid-Bugs-To: https://gravityforms.com/support\n"
|
||||
"Last-Translator: Gravity Forms <support@gravityforms.com>\n"
|
||||
"Language-Team: Gravity Forms <support@gravityforms.com>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"POT-Creation-Date: 2024-03-14T17:07:42+00:00\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"X-Generator: WP-CLI 2.8.1\n"
|
||||
"X-Domain: gravityformshubspot\n"
|
||||
|
||||
#. Plugin Name of the plugin
|
||||
msgid "Gravity Forms HubSpot Add-On"
|
||||
msgstr ""
|
||||
|
||||
#. Plugin URI of the plugin
|
||||
#. Author URI of the plugin
|
||||
msgid "https://gravityforms.com"
|
||||
msgstr ""
|
||||
|
||||
#. Description of the plugin
|
||||
msgid "Integrates Gravity Forms with HubSpot, allowing form submissions to be automatically sent to your HubSpot account."
|
||||
msgstr ""
|
||||
|
||||
#. Author of the plugin
|
||||
msgid "Gravity Forms"
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:255
|
||||
#: class-gf-hubspot.php:1086
|
||||
#: class-gf-hubspot.php:1091
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:285
|
||||
msgid "Create record in HubSpot only when payment is received."
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:338
|
||||
msgid "Are you sure you want to disconnect from HubSpot for this website?"
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:339
|
||||
msgid "Are you sure you want to disconnect all Gravity Forms sites connected to this HubSpot account?"
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:484
|
||||
msgid "Unable to connect your HubSpot account due to mismatched state."
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:504
|
||||
msgid "HubSpot settings have been updated."
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:516
|
||||
msgid "Unable to connect your HubSpot account."
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:617
|
||||
msgid "HubSpot is an all-in-one CRM, Sales, Marketing, and Customer Service platform."
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:620
|
||||
msgid "The Gravity Forms HubSpot Add-On connects the power of the world’s leading growth platform - HubSpot - with Gravity Forms so your business can grow better."
|
||||
msgstr ""
|
||||
|
||||
#. translators: 1: Open link tag 2: Close link tag
|
||||
#: class-gf-hubspot.php:625
|
||||
msgid "If you don't have a HubSpot account, you can %1$ssign up for your free HubSpot account here%2$s."
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:646
|
||||
msgid "Clear Custom Contact Properties Cache"
|
||||
msgstr ""
|
||||
|
||||
#. translators: 1: Open link tag 2: Close link tag
|
||||
#: class-gf-hubspot.php:722
|
||||
msgid "There is a problem communicating with HubSpot right now, please check back later. If this issue persists for more than a day, please %1$sopen a support ticket%2$s."
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:763
|
||||
msgid "Click here to connect your HubSpot account"
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:768
|
||||
msgid "SSL Certificate Required"
|
||||
msgstr ""
|
||||
|
||||
#. translators: 1: Open link tag 2: Close link tag
|
||||
#: class-gf-hubspot.php:770
|
||||
msgid "Make sure you have an SSL certificate installed and enabled, then %1$sclick here to continue%2$s."
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:783
|
||||
msgid "Signed into HubSpot."
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:787
|
||||
#: class-gf-hubspot.php:793
|
||||
msgid "Disconnect your HubSpot account"
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:791
|
||||
msgid "De-authorize this site only"
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:792
|
||||
msgid "Disconnect all Gravity Forms sites connected to this HubSpot account"
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:822
|
||||
msgid "Cache was cleared successfully."
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:830
|
||||
msgid "The cache could not be cleared at the moment."
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:835
|
||||
msgid "Due to HubSpot's daily API usage limits, Gravity Forms stores HubSpot custom contact properties data for one hour. If you added new custom properties or made a change to them, you might not see it reflected immediately due to this data caching. To manually clear the custom contact properties cache, click the button below."
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:837
|
||||
msgid "Clear Custom Fields Cache"
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:842
|
||||
msgid "never cleared manually before"
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:843
|
||||
msgid "Last time the cache was cleared manually: "
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:997
|
||||
msgid "Access denied."
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:1091
|
||||
msgid "Enter a feed name to uniquely identify this feed."
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:1095
|
||||
msgid "Feed Type"
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:1099
|
||||
msgid "Create Contact"
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:1108
|
||||
#: class-gf-hubspot.php:1114
|
||||
msgid "HubSpot Form Name"
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:1115
|
||||
msgid "Enter the name for the form that will be automatically created in your HubSpot account to work in conjunction with this feed. This HubSpot form will be configured to match your mapped fields below and is required. Once created, please don't remove or edit it."
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:1140
|
||||
#: class-gf-hubspot.php:1163
|
||||
msgid "Contact Owner"
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:1146
|
||||
msgid "None "
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:1150
|
||||
msgid "Select Owner "
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:1154
|
||||
msgid "Assign Conditionally"
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:1158
|
||||
msgid "Select a HubSpot user that will be assigned as the owner of the newly created Contact."
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:1177
|
||||
msgid "Select Owner"
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:1214
|
||||
msgid "Add Additional Contact Fields"
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:1234
|
||||
msgid "Additional Options"
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:1331
|
||||
msgid "There was an error connecting to Hubspot."
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:1338
|
||||
msgid "There was an error validating the form name. Please try saving again"
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:1343
|
||||
msgid "This form name is already in use in HubSpot. Please enter a unique form name."
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:1352
|
||||
msgid "edit"
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:1352
|
||||
msgid "add"
|
||||
msgstr ""
|
||||
|
||||
#. translators: Action to perform on the form.
|
||||
#: class-gf-hubspot.php:1354
|
||||
msgid "Could not %s HubSpot form. Please try again later."
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:2000
|
||||
msgid "Error retrieving HubSpot owners"
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:2016
|
||||
msgid "No Name"
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:2067
|
||||
msgid "Select a Contact Property"
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:2111
|
||||
msgid "Select an Option"
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:2172
|
||||
msgid "<h6>Lead Status</h6>Select the lead status value the newly added contact should be set to."
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:2173
|
||||
msgid "<h6>Lifecycle Stage</h6>Select the lifecycle stage value the newly added contact should be set to."
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:2241
|
||||
msgid "Feed was not processed because the submission object was empty."
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:2250
|
||||
msgid "Feed was not processed because API was not initialized."
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:2258
|
||||
msgid "There was an error when creating the contact in HubSpot. %s"
|
||||
msgstr ""
|
||||
|
||||
#: class-gf-hubspot.php:2347
|
||||
msgid "Do not delete or edit"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class-gf-hubspot-api.php:155
|
||||
#: includes/class-gf-hubspot-api.php:208
|
||||
msgid "Refresh token must be provided."
|
||||
msgstr ""
|
||||
Reference in New Issue
Block a user