Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bitwpfi.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: Bit Integrations
* Plugin URI: https://bitapps.pro/bit-integrations
* 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
* Version: 2.1.4
* Version: 2.1.5
* Author: Automation & Integration Plugin - Bit Apps
* Author URI: https://bitapps.pro
* Text Domain: bit-integrations
Expand All @@ -23,7 +23,7 @@
$btcbi_db_version = '1.0';

// Define most essential constants.
define('BTCBI_VERSION', '2.1.4');
define('BTCBI_VERSION', '2.1.5');
define('BTCBI_PLUGIN_MAIN_FILE', __FILE__);

require_once plugin_dir_path(__FILE__) . 'includes/loader.php';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { $btcbi } from '../../../GlobalStates'

export default function FreshSalesActions({ freshSalesConf, setFreshSalesConf }) {
const btcbi = useRecoilValue($btcbi)
const { isPro } = btcbi
const { isPro, version } = btcbi

const actionHandler = (e, type) => {
const newConf = { ...freshSalesConf }
Expand All @@ -27,7 +27,7 @@ export default function FreshSalesActions({ freshSalesConf, setFreshSalesConf })
return (
<>
<div className="pos-rel d-flx w-8">
{'Product' !== freshSalesConf.moduleData.module && (
{'Product' !== freshSalesConf.moduleData.module && isPro && version > '2.1.0' && (
<TableCheckBox
onChange={(e) => actionHandler(e, 'upsert')}
checked={freshSalesConf?.actions?.upsert || false}
Expand Down
8 changes: 3 additions & 5 deletions frontend-dev/src/pages/ChangelogToggle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default function ChangelogToggle() {
<div className='changelog'>
<div className="flx flx-col flx-center whats-new">
<h3>What's New in {btcbi.version}?</h3>
<small className='date'> <b>8th July 2024</b></small>
<small className='date'>Updated at: <b>11th July 2024</b></small>
</div>
<div className='changelog-content'>
{/* <span className='new-integration' ><b>New Features</b></span>
Expand All @@ -99,13 +99,11 @@ export default function ChangelogToggle() {
</ul>
</div> */}

<span className='new-feature' ><b>New Improvements</b></span>
<span className='new-feature' ><b>New Fixes</b></span>

<div className='integration-list'>
<ul>
<li>WooCommerce: Product create trigger Improved </li>
<li>Salesforce: Case Status action dynamically functioned </li>
<li>Webhook: Fetch Api improved </li>
<li>Webhook: Test Webhook execute issue fixed </li>
</ul>
</div>
<div>
Expand Down
7 changes: 4 additions & 3 deletions includes/Actions/FreshSales/RecordApiHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

namespace BitCode\FI\Actions\FreshSales;

use BitCode\FI\Log\LogHandler;
use BitCode\FI\Core\Util\Common;
use BitCode\FI\Core\Util\Helper;
use BitCode\FI\Core\Util\HttpHelper;
use BitCode\FI\Log\LogHandler;
use BitApps\BTCBI_PRO\Actions\FreshSales\FreshSalesRecordApiHelper;

/**
* Provide functionality for Record insert, upsert
Expand Down Expand Up @@ -65,8 +66,8 @@ public function insertRecord(

public function upsertRecord($module, $finalData)
{
if (Helper::isProActivate()) {
return \BitApps\BTCBI_PRO\Actions\FreshSales\FreshSalesRecordApiHelper::upsertRecord($module, $finalData, $this->_integrationDetails, $this->_defaultHeader, $this->baseUrl);
if (Helper::pro_action_feat_exists('FreshSales', 'upsertRecord')) {
return FreshSalesRecordApiHelper::upsertRecord($module, $finalData, $this->_integrationDetails, $this->_defaultHeader, $this->baseUrl);
}

return $this->insertRecord($module, $finalData);
Expand Down
5 changes: 3 additions & 2 deletions includes/Actions/MailChimp/RecordApiHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use BitCode\FI\Log\LogHandler;
use BitCode\FI\Core\Util\Helper;
use BitCode\FI\Core\Util\HttpHelper;
use BitApps\BTCBI_PRO\Actions\MailChimp\MailChimpRecordHelper;

/**
* Provide functionality for Record insert,upsert
Expand Down Expand Up @@ -38,11 +39,11 @@ public function insertRecord($listId, $data)

public function addRemoveTag($module, $listId, $data)
{
if (Helper::isProActivate()) {
if (Helper::pro_action_feat_exists('MailChimp', 'addRemoveTag')) {
$subscriber_hash = md5(strtolower(trim($data['email_address'])));
$endpoint = $this->_apiEndPoint() . "/lists/{$listId}/members/{$subscriber_hash}/tags";

return \BitApps\BTCBI_PRO\Actions\MailChimp\MailChimpRecordHelper::addRemoveTag($module, $data, $endpoint, $this->_defaultHeader);
return MailChimpRecordHelper::addRemoveTag($module, $data, $endpoint, $this->_defaultHeader);
}
LogHandler::save($this->_integrationID, ['type' => 'record', 'type_name' => $module], 'error', 'Bit Integration Pro plugin is not installed or activate');

Expand Down
4 changes: 2 additions & 2 deletions includes/Actions/WebHooks/WebHooksController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

namespace BitCode\FI\Actions\WebHooks;

use BitCode\FI\Log\LogHandler;
use BitCode\FI\Core\Util\Common;
use BitCode\FI\Core\Util\HttpHelper;
use BitCode\FI\Log\LogHandler;

/**
* Provide functionality for webhooks
Expand All @@ -25,7 +25,7 @@ public static function testWebhook($webhookDetails)
400
);
}
wp_send_json_success(__('webhook executed succcessfully', 'bit-integrations'), 200);
wp_send_json_success(__('Test webhook executed succcessfully', 'bit-integrations'), 200);
}

public static function execute($integrationDetails, $fieldValues)
Expand Down
2 changes: 1 addition & 1 deletion includes/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Config

public const VAR_PREFIX = 'btcbi_';

public const VERSION = '2.1.4';
public const VERSION = '2.1.5';

public const DB_VERSION = '1.0';

Expand Down
16 changes: 16 additions & 0 deletions includes/Core/Util/AllProActionFeat.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace BitCode\FI\Core\Util;

// All Pro Action Features
final class AllProActionFeat
{
public static $features = [
'MailChimp' => [
['feat_name' => 'addRemoveTag', 'class' => '\BitApps\BTCBI_PRO\Actions\MailChimp\MailChimpRecordHelper', 'pro_init_v' => '2.0.9']
],
'FreshSales' => [
['feat_name' => 'upsertRecord', 'class' => '\BitApps\BTCBI_PRO\Actions\FreshSales\FreshSalesRecordApiHelper', 'pro_init_v' => '2.1.1']
]
];
}
33 changes: 31 additions & 2 deletions includes/Core/Util/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace BitCode\FI\Core\Util;

use BitCode\FI\Triggers\TriggerController;
use DateTime;
use Exception;
use stdClass;
use WP_Error;
use Exception;
use BitCode\FI\Triggers\TriggerController;

/**
* bit-integration helper class
Expand Down Expand Up @@ -169,6 +169,35 @@ public static function isProActivate()
return \function_exists('btcbi_pro_activate_plugin');
}

public static function pro_action_feat_exists($keyName, $featName)
{
$feature = static::findFeature($keyName, $featName);

if (empty($feature)) {
return false;
}

return (bool) (!empty($feature) && static::isProActivate() && \defined('BTCBI_PRO_VERSION') && (BTCBI_PRO_VERSION >= $feature['pro_init_v']) && class_exists($feature['class']));
}

public static function findFeature($keyName, $featName)
{
$features = AllProActionFeat::$features;

if (!isset($features[$keyName])) {
return;
}

$featNames = array_column($features[$keyName], 'feat_name');
$index = array_search($featName, $featNames);

if ($index !== false) {
return $features[$keyName][$index];
}

return [];
}

public static function isUserLoggedIn()
{
return is_user_logged_in();
Expand Down
6 changes: 5 additions & 1 deletion includes/Flow/Flow.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,11 @@ public function authorizationStatusChange($data, $status)
'flow_details',
]
);
$integration = $integration = $integrations[0];
if (is_wp_error($integrations)) {
wp_send_json_error($integrations->get_error_message());
}

$integration = $integrations[0];
$flowDetails = json_decode($integration->flow_details);

$flowDetails->isAuthorized = $status;
Expand Down
6 changes: 5 additions & 1 deletion includes/Log/LogHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace BitCode\FI\Log;

use BitCode\FI\Flow\Flow;
use BitCode\FI\Core\Database\LogModel;
use BitCode\FI\Core\Util\Capabilities;
use BitCode\FI\Flow\Flow;

final class LogHandler
{
Expand Down Expand Up @@ -72,6 +72,10 @@ public function get($data)

public static function save($flow_id, $api_type, $response_type, $response_obj)
{
if (empty($flow_id)) {
return;
}

$flow = new Flow();
$flow->authorizationStatusChange($flow_id, $response_type == 'success' ? true : false);

Expand Down
8 changes: 7 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: automation,forms,integration,automator,webhooks
Requires at least: 5.1
Tested up to: 6.5.5
Requires PHP: 7.0
Stable tag: 2.1.4
Stable tag: 2.1.5
License: GPLv2 or later

Automation Plugin for WordPress like Zapier; Integration of 70+ Triggers & 140+ Actions.The #1 highest no-code platform Automator plugin in WordPress
Expand Down Expand Up @@ -974,6 +974,12 @@ Yes, It sends data to other platforms from wordpress site. Suppose someone submi

== Changelog ==

= 2.1.5 =
_Release Date -11th July 2024_

- **New Fixes :**
- Webhook: Test Webhook execute issue fixed

= 2.1.4 =
_Release Date -8th July 2024_

Expand Down