Skip to content

Commit 2865ddf

Browse files
authored
Merge pull request #5 from Bit-Apps-Pro/niloy-dev
Version updated to 2.0.1
2 parents 21a86fd + 9102b3e commit 2865ddf

File tree

147 files changed

+578
-505
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+578
-505
lines changed

bitwpfi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Plugin Name: Bit Integrations
55
* Plugin URI: https://bitapps.pro/bit-integrations
66
* Description: Bit Integrations is a platform that integrates with over 200+ different platforms to help with various tasks on your WordPress site, like WooCommerce, Form builder, Page builder, LMS, Sales funnels, Bookings, CRM, Webhooks, Email marketing, Social media and Spreadsheets, etc
7-
* Version: 2.0.0
7+
* Version: 2.0.1
88
* Author: Automation & Integration Plugin - Bit Apps
99
* Author URI: https://bitapps.pro
1010
* Text Domain: bit-integrations
@@ -25,7 +25,7 @@
2525
$btcbi_db_version = '1.0';
2626

2727
// Define most essential constants.
28-
define('BTCBI_VERSION', '2.0.0');
28+
define('BTCBI_VERSION', '2.0.1');
2929
define('BTCBI_PLUGIN_MAIN_FILE', __FILE__);
3030

3131
require_once plugin_dir_path(__FILE__) . 'includes/loader.php';
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import MultiSelect from 'react-multiple-select-dropdown-lite'
2+
import 'react-multiple-select-dropdown-lite/dist/index.css'
3+
import { __ } from '../../../Utils/i18nwrap'
4+
import { getFluentFluentBookingFields } from './FluentBookingHelper/FluentBookingCommonFunction'
5+
6+
const FluentBookingHelper = ({ flow, setFlowData }) => {
7+
const id = flow?.triggerData?.formID
8+
9+
const handleChange = (val) => {
10+
setFlowData(val, 'selectedEvent')
11+
if (val) {
12+
getFluentFluentBookingFields(setFlowData, val)
13+
} else {
14+
setFlowData([], 'fields')
15+
}
16+
}
17+
18+
return (
19+
<div>
20+
{id &&
21+
<>
22+
<h4>Select a Event</h4>
23+
<MultiSelect
24+
className="msl-wrp-options"
25+
defaultValue={flow.triggerData?.selectedEvent}
26+
options={flow?.triggerData?.events?.map(event => ({ label: event.title, value: event.id.toString() }))}
27+
onChange={(val) => handleChange(val)}
28+
singleSelect
29+
style={{ width: '100%', minWidth: 300, maxWidth: 400 }}
30+
/>
31+
</>}
32+
</div>
33+
)
34+
}
35+
36+
export default FluentBookingHelper
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import bitsFetch from '../../../../Utils/bitsFetch'
2+
import { __ } from '../../../../Utils/i18nwrap'
3+
4+
export const getFluentFluentBookingFields = (setFlowData, value) => {
5+
const loadTags = bitsFetch(
6+
{ id: value },
7+
'fluentBooking/get/fields',
8+
null,
9+
'POST',
10+
).then((result) => {
11+
if (result && result.success) {
12+
setFlowData(result.data, 'fields')
13+
14+
return 'Fetched fields successfully'
15+
}
16+
17+
return 'Fields fetching failed. please try again'
18+
})
19+
}

frontend-dev/src/components/Triggers/TriggerHelpers/TriggerStateHelper.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ export const FormPluginStateHelper = (val, tmpNewFlow, resp, setNewFlow) => {
5151
UltimateMemberStateFP(val, tmpNewFlow, resp, setNewFlow);
5252
} else if (tmpNewFlow?.triggered_entity === "AcademyLms") {
5353
academylmsStateFP(val, tmpNewFlow, resp, setNewFlow);
54+
} else if (tmpNewFlow?.triggered_entity === 'FluentBooking') {
55+
fluentBookingStateFP(val, tmpNewFlow, resp, setNewFlow)
5456
} else {
5557
setNewFlow(tmpNewFlow);
5658
}
@@ -93,6 +95,13 @@ export const tutorlmsStateFP = (val, tmpNewFlow, resp, setNewFlow) => {
9395
setNewFlow(tmpNewFlow);
9496
};
9597

98+
export const fluentBookingStateFP = (val, tmpNewFlow, resp, setNewFlow) => {
99+
if (val) {
100+
tmpNewFlow.triggerData.events = resp.data.events
101+
}
102+
setNewFlow(tmpNewFlow)
103+
}
104+
96105
export const WooCommerceStateFP = (val, tmpNewFlow, resp, setNewFlow) => {
97106
if (val === "10" || val === "19") {
98107
tmpNewFlow.triggerData.products = resp.data.products;

frontend-dev/src/components/Triggers/TriggerMultiOption.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import MasterStudyLmsHelper from './TriggerHelpers/MasterStudyLmsHelper'
2121
import ThriveApprenticeHelper from './TriggerHelpers/ThriveApprenticeHelper'
2222
import UltimateMemberHelper from './TriggerHelpers/UltimateMemberHelper'
2323
import AcademyLmsHelper from './TriggerHelpers/AcademyLmsHelper'
24+
import FluentBookingHelper from './TriggerHelpers/FluentBookingHelper'
2425

2526
const TriggerMultiOption = ({ flow, setFlowData, edit = false }) => (
2627
<div>
@@ -47,6 +48,7 @@ const TriggerMultiOption = ({ flow, setFlowData, edit = false }) => (
4748
{flow?.triggered_entity === 'ThriveApprentice' && <ThriveApprenticeHelper flow={flow} setFlowData={setFlowData} edit={edit} />}
4849
{flow?.triggered_entity === 'UltimateMember' && <UltimateMemberHelper flow={flow} setFlowData={setFlowData} edit={edit} />}
4950
{flow?.triggered_entity === 'AcademyLms' && <AcademyLmsHelper flow={flow} setFlowData={setFlowData} />}
51+
{flow?.triggered_entity === 'FluentBooking' && <FluentBookingHelper flow={flow} setFlowData={setFlowData} />}
5052
</div>
5153
)
5254

frontend-dev/src/pages/ChangelogToggle.jsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Modal from '../components/Utilities/Modal'
1010
export default function ChangelogToggle() {
1111
const btcbi = useRecoilValue($btcbi)
1212
const [show, setShow] = useState(btcbi.changelogVersion !== btcbi.version)
13-
const version = btcbi.isPro ? '2.0.0' : '2.0.0'
13+
const version = btcbi.isPro ? '2.0.2' : '2.0.1'
1414
return (
1515
<div className="changelog-toggle">
1616
<button
@@ -27,7 +27,7 @@ export default function ChangelogToggle() {
2727
{/* <h4 className='changelog-notif'> From 1.4.1 update,To use pro plugin free version is required. </h4> */}
2828
<div className="flx flx-col flx-center whats-new">
2929
<h3>What's New in {version}?</h3>
30-
<small className='date'> <b>25th April 2024</b></small>
30+
<small className='date'> <b>6th May 2024</b></small>
3131
</div>
3232
<div className='changelog-content'>
3333
{/* <h4>New Integration</h4> */}
@@ -40,7 +40,7 @@ export default function ChangelogToggle() {
4040
</ul>
4141
</div> */}
4242

43-
<span className='new-feature'><b>Compatibility Update:</b></span>
43+
{/* <span className='new-feature'><b>Compatibility Update:</b></span>
4444
4545
<div className='feature-list'>
4646
<ul>
@@ -64,16 +64,16 @@ export default function ChangelogToggle() {
6464
</ul>
6565
</li>
6666
</ul>
67-
</div>
67+
</div> */}
6868

6969

70-
{/* <span className='fixes'><b>Fixed</b></span>
70+
<span className='fixes'><b>Fixed</b></span>
7171

7272
<div className='fixes-list'>
7373
<ul>
74-
<li>MailChimp: Field Mapping visibility </li>
74+
<li> Woocommerce: specific task order change issue </li>
7575
</ul>
76-
</div> */}
76+
</div>
7777
</div>
7878
<div>
7979
<span className='footer'>{__('For more details,')}</span>

includes/Actions/ActionController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ final class ActionController
3737
public function handleRedirect(WP_REST_Request $request)
3838
{
3939
$state = $request->get_param('state');
40-
$parsed_url = parse_url(get_site_url());
40+
$parsed_url = wp_parse_url(get_site_url());
4141
$site_url = $parsed_url['scheme'] . '://' . $parsed_url['host'];
4242
$site_url .= empty($parsed_url['port']) ? null : ':' . $parsed_url['port'];
4343
if (strpos($state, $site_url) === false) {

includes/Actions/ActiveCampaign/RecordApiHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function updateRecord($id, $data, $existContact)
4747

4848
$updateRecordEndpoint = "{$this->_apiEndpoint}/contacts/{$id}";
4949

50-
return HttpHelper::request($updateRecordEndpoint, 'PUT', json_encode($data), $this->_defaultHeader);
50+
return HttpHelper::request($updateRecordEndpoint, 'PUT', wp_json_encode($data), $this->_defaultHeader);
5151
}
5252

5353
public function execute($integrationDetails, $fieldValues, $fieldMap, $actions, $listId, $tags)

includes/Actions/Acumbamail/RecordApiHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ public function execute(
9393
$apiResponse = $this->deleteSubscriber($auth_token, $listId, $finalData);
9494
}
9595
if (property_exists($apiResponse, 'error')) {
96-
LogHandler::save($this->_integrationID, json_encode(['type' => 'contact', 'type_name' => 'add-contact']), 'error', json_encode($apiResponse));
96+
LogHandler::save($this->_integrationID, wp_json_encode(['type' => 'contact', 'type_name' => 'add-contact']), 'error', wp_json_encode($apiResponse));
9797
} else {
98-
LogHandler::save($this->_integrationID, json_encode(['type' => 'record', 'type_name' => 'add-contact']), 'success', json_encode($apiResponse));
98+
LogHandler::save($this->_integrationID, wp_json_encode(['type' => 'record', 'type_name' => 'add-contact']), 'success', wp_json_encode($apiResponse));
9999
}
100100

101101
return $apiResponse;

includes/Actions/Affiliate/RecordApiHelper.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public static function createAffiliateWithSpecificId($affiliateId, $statusId, $r
9999
if ($affiliate_user_id && affwp_is_affiliate($affiliate_user_id)) {
100100
return affwp_add_referral($finalData);
101101
}
102-
LogHandler::save(self::$integrationID, json_encode(['type' => 'group', 'type_name' => 'create-referral']), 'error', json_encode('User are not affiliate'));
102+
LogHandler::save(self::$integrationID, wp_json_encode(['type' => 'group', 'type_name' => 'create-referral']), 'error', wp_json_encode('User are not affiliate'));
103103
}
104104

105105
public static function createAffiliateFortheUser($statusId, $referralId, $finalData)
@@ -151,7 +151,7 @@ public static function createAffiliateFortheUser($statusId, $referralId, $finalD
151151
if ($affiliate_user_id && affwp_is_affiliate($affiliate_user_id)) {
152152
return affwp_add_referral($finalData);
153153
}
154-
LogHandler::save(self::$integrationID, json_encode(['type' => 'referral', 'type_name' => 'create-referral']), 'error', json_encode('User are not affiliate'));
154+
LogHandler::save(self::$integrationID, wp_json_encode(['type' => 'referral', 'type_name' => 'create-referral']), 'error', wp_json_encode('User are not affiliate'));
155155
}
156156

157157
public function execute(
@@ -174,9 +174,9 @@ public function execute(
174174
$finalData
175175
);
176176
if ($apiResponse !== 0) {
177-
LogHandler::save(self::$integrationID, json_encode(['type' => 'referral', 'type_name' => 'create-referral']), 'success', json_encode('Created Referral id ' . $apiResponse));
177+
LogHandler::save(self::$integrationID, wp_json_encode(['type' => 'referral', 'type_name' => 'create-referral']), 'success', wp_json_encode('Created Referral id ' . $apiResponse));
178178
} else {
179-
LogHandler::save(self::$integrationID, json_encode(['type' => 'referral', 'type_name' => 'create-referral']), 'error', json_encode('Error in creating referral'));
179+
LogHandler::save(self::$integrationID, wp_json_encode(['type' => 'referral', 'type_name' => 'create-referral']), 'error', wp_json_encode('Error in creating referral'));
180180
}
181181

182182
return $apiResponse;
@@ -192,9 +192,9 @@ public function execute(
192192
$finalData
193193
);
194194
if ($apiResponse !== 0) {
195-
LogHandler::save(self::$integrationID, json_encode(['type' => 'referral', 'type_name' => 'create-referral']), 'success', json_encode('Created Referral id ' . $apiResponse));
195+
LogHandler::save(self::$integrationID, wp_json_encode(['type' => 'referral', 'type_name' => 'create-referral']), 'success', wp_json_encode('Created Referral id ' . $apiResponse));
196196
} else {
197-
LogHandler::save(self::$integrationID, json_encode(['type' => 'referral', 'type_name' => 'create-referral']), 'error', json_encode('Error in creating referral'));
197+
LogHandler::save(self::$integrationID, wp_json_encode(['type' => 'referral', 'type_name' => 'create-referral']), 'error', wp_json_encode('Error in creating referral'));
198198
}
199199

200200
return $apiResponse;

0 commit comments

Comments
 (0)