Commit inicial - WordPress Análisis de Precios Unitarios

- WordPress core y plugins
- Tema Twenty Twenty-Four configurado
- Plugin allow-unfiltered-html.php simplificado
- .gitignore configurado para excluir wp-config.php y uploads

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-11-03 21:04:30 -06:00
commit a22573bf0b
24068 changed files with 4993111 additions and 0 deletions

View File

@@ -0,0 +1,114 @@
<?php
final class BWFAN_Integrately_Send_Data extends BWFAN_Action {
private static $ins = null;
public $required_fields = array( 'url', 'custom_fields' );
private function __construct() {
$this->action_name = __( 'Send Data To Integrately', 'wp-marketing-automations-pro' );
$this->action_desc = __( 'This action sends key/ value pair data to the Integrately', 'wp-marketing-automations-pro' );
$this->support_v2 = true;
$this->support_v1 = false;
}
public static function get_instance() {
if ( null === self::$ins ) {
self::$ins = new self();
}
return self::$ins;
}
/**
* Make all the data which is required by the current action.
* This data will be used while executing the task of this action.
*
* @param $automation_data
* @param $step_data
*
* @return array
*/
public function make_v2_data( $automation_data, $step_data ) {
$data_to_set = array();
$data_to_set['email'] = $automation_data['global']['email'];
$data_to_set['url'] = BWFAN_Common::decode_merge_tags( $step_data['url'] );
$fields = $step_data['custom_fields'];
$custom_fields = array();
foreach ( $fields as $field ) {
$custom_fields[ $field['field'] ] = BWFAN_Common::decode_merge_tags( $field['field_value'] );
}
$data_to_set['custom_fields'] = $custom_fields;
return $data_to_set;
}
/**
* Process and do the actual processing for the current action.
* This function is present in every action class.
*/
public function process_v2() {
$endpoint_url = $this->data['url'];
$params_data = $this->data['custom_fields'];
$this->make_wp_requests( $endpoint_url, $params_data, array(), BWF_CO::$POST );
return $this->success_message( __( 'Data sent successfully.', 'wp-marketing-automations-pro' ) );
}
public function get_fields_schema() {
return [
[
'id' => 'url',
'type' => 'textarea',
'label' => __( 'Enter URL', 'wp-marketing-automations-pro' ),
'placeholder' => __( 'Webhook URL', 'wp-marketing-automations-pro' ),
'tip' => __( "Enter a URL where data will be sent.", 'wp-marketing-automations-pro' ),
"description" => "",
"required" => true,
],
[
'id' => 'custom_fields',
'type' => 'repeater',
'label' => __( 'Data', 'wp-marketing-automations-pro' ),
"fields" => [
[
'id' => 'field',
'label' => "",
'type' => 'text',
'placeholder' => __( 'Key', 'wp-marketing-automations-pro' ),
"class" => 'bwfan-input-wrapper',
'tip' => "",
"description" => "",
"required" => false,
],
[
"id" => 'field_value',
"label" => "",
"type" => 'text',
'placeholder' => __( 'Value', 'wp-marketing-automations-pro' ),
"class" => 'bwfan-input-wrapper',
"description" => "",
"required" => false,
]
]
],
[
'id' => 'send_test_data',
'type' => 'send_data',
'label' => __( 'Send test data via HTTP Post', 'wp-marketing-automations-pro' ),
'send_action' => 'bwf_send_test_http_post',
'send_field' => [
'url' => 'url',
'http_method' => 'http_method',
'headers' => 'headers',
'custom_fields' => 'custom_fields',
],
"hint" => __( "This will POST the key value pairs with dummy data to Integrately Webhook URL", 'wp-marketing-automations-pro' )
],
];
}
}
return 'BWFAN_Integrately_Send_Data';

View File

@@ -0,0 +1,3 @@
<?php
//silence is golden

View File

@@ -0,0 +1,75 @@
<?php
class BWFAN_Integrately_Integration extends BWFAN_Integration {
private static $ins = null;
public function __construct() {
$this->action_dir = __DIR__;
$this->nice_name = __( 'Integrately', 'wp-marketing-automations-pro' );
$this->group_name = __( 'Send Data', 'wp-marketing-automations-pro' );
$this->group_slug = 'send_data';
$this->priority = 85;
}
public static function get_instance() {
if ( null === self::$ins ) {
self::$ins = new self();
}
return self::$ins;
}
/**
* Handle the responses for all the actions of this connector.
* Return 0 for try again, 2 for action halt, 3 for successful execution , 4 for permanent failure.
*
* @param $result
* @param $connector_slug
* @param $action_call_class_slug
*
* @return array
*/
public function handle_response( $result, $connector_slug, $action_call_class_slug, $action_data = null ) {
// Required field missing error
if ( isset( $result['bwfan_response'] ) ) {
return array(
'status' => 4,
'message' => $result['bwfan_response'],
);
}
// Curl error
if ( isset( $result['response'] ) && 500 === $result['response'] ) {
return array(
'status' => 0,
'message' => $result['body'],
);
}
// Rate limit exceeded error
if ( false === $result ) {
return array(
'status' => 2,
'message' => __( 'Time Out', 'wp-marketing-automations-pro' ),
);
}
if ( ( isset( $result['response'] ) && 200 === $result['response'] ) && ( isset( $result['body'] ) && ! empty( $result['body'] ) ) ) {
return array(
'status' => 3,
);
}
return array(
'status' => 4,
'message' => __( 'Webhook not active in integrately.', 'wp-marketing-automations-pro' ),
);
}
}
/**
* Register this class as an integration.
*/
BWFAN_Load_Integrations::register( 'BWFAN_Integrately_Integration' );

View File

@@ -0,0 +1,3 @@
<?php
//silence is golden