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,128 @@
<?php
namespace BWFCRM\Actions\Autonami;
use BWFCRM\Actions\Base;
use BWFCRM\Calls\Autonami as Calls;
use WP_Error;
/**
* Add lists action class
*/
class Add_To_Lists extends Base {
/**
* Class constructor
*/
public function __construct() {
$this->slug = 'add_to_lists';
$this->nice_name = __( 'Add Lists', 'wp-marketing-automations-pro' );
$this->group = 'autonami';
$this->group_label = __( 'FunnelKit Automations', 'wp-marketing-automations-pro' );
$this->priority = 10;
$this->support = [ 1, 2 ];
$this->event_slug = 'crm_assigned_list';
}
/**
* Add list field schema
*
* @return array
*/
public function get_action_schema() {
return [
'type' => 'search',
'meta' => [
'autocompleter' => 'list',
'addnew' => true,
]
];
}
/**
* process action
*
* @param $contact \BWFCRM_Contact
* @param $lists
*
* @return array|false
*/
public function handle_action( $contact, $lists ) {
$lists = array_column( $lists, 'id' );
if ( empty( $lists ) ) {
return 'skip';
}
/**
* Check if call exists
*/
if ( ! class_exists( 'BWFCRM\Calls\Autonami\Add_To_Lists' ) ) {
return false;
}
$call_obj = new Calls\Add_To_Lists();
/**
* Process call
*/
$lists_added = $call_obj->process_call( $contact, $lists );
return $this->get_response( $lists, $lists_added );
}
public function get_response( $lists, $lists_added ) {
$message = array();
if ( $lists_added instanceof WP_Error ) {
$message[] = __( 'List(s) Add Failed: ', 'wp-marketing-automations-pro' ) . array_reduce( $lists, function ( $carry, $item ) {
$name = $item['value'];
if ( empty( $carry ) ) {
return $name;
}
return ! empty( $name ) ? $carry . ', ' . $name : $carry;
}, '' );
$message[] = __( 'List(s) Add Failed. Error: ', 'wp-marketing-automations-pro' ) . $lists_added->get_error_message();
return array(
'status' => self::$RESPONSE_FAILED,
'message' => $message,
);
}
if ( isset( $lists_added['skipped'] ) && count( $lists_added['skipped'] ) > 0 ) {
$message[] = __( 'List(s) Add Skipped: ', 'wp-marketing-automations-pro' ) . array_reduce( array_filter( $lists_added['skipped'] ), function ( $carry, $item ) {
$name = $item->get_name();
if ( empty( $carry ) ) {
return $name;
}
return ! empty( $name ) ? $carry . ', ' . $name : $carry;
}, '' );
}
if ( isset( $lists_added['assigned'] ) && count( $lists_added['assigned'] ) > 0 ) {
$message[] = __( 'List(s) Added: ', 'wp-marketing-automations-pro' ) . array_reduce( array_filter( $lists_added['assigned'] ), function ( $carry, $item ) {
$name = $item->get_name();
if ( empty( $carry ) ) {
return $name;
}
return ! empty( $name ) ? $carry . ', ' . $name : $carry;
}, '' );
}
return array(
'status' => self::$RESPONSE_SUCCESS,
'message' => $message,
);
}
}
/**
* Register action
*/
/**
* Register action
*/
BWFCRM_Core()->actions->register_action( 'add_to_lists', 'BWFCRM\Actions\Autonami\Add_To_Lists', __( 'Add Lists', 'wp-marketing-automations-pro' ), 'autonami', __( 'FunnelKit Automations', 'wp-marketing-automations-pro' ) );

View File

@@ -0,0 +1,125 @@
<?php
namespace BWFCRM\Actions\Autonami;
use BWFCRM\Actions\Base;
use BWFCRM\Calls\Autonami as Calls;
use WP_Error;
/**
* Add tags action class
*/
class Add_Tags extends Base {
/**
* Class constructor
*/
public function __construct() {
$this->slug = 'add_tags';
$this->nice_name = __( 'Add Tags', 'wp-marketing-automations-pro' );
$this->group = 'autonami';
$this->group_label = __( 'FunnelKit Automations', 'wp-marketing-automations-pro' );
$this->priority = 10;
$this->support = [ 1, 2 ];
$this->event_slug = 'crm_assigned_tag';
}
/**
* Returns action field schema
*
* @return array
*/
public function get_action_schema() {
return [
'type' => 'search',
'meta' => [
'autocompleter' => 'tag',
'addnew' => true,
]
];
}
/**
* process action
*
* @param $contact \BWFCRM_Contact
* @param $tags
*
* @return array|false
*/
public function handle_action( $contact, $tags ) {
$tags = array_column( $tags, 'id' );
if ( empty( $tags ) ) {
return 'skip';
}
/**
* Check if call exists
*/
if ( ! class_exists( 'BWFCRM\Calls\Autonami\Add_Tags' ) ) {
return false;
}
$call_obj = new Calls\Add_Tags;
/**
* Process call
*/
$tags_added = $call_obj->process_call( $contact, $tags );
return $this->get_response( $tags, $tags_added );
}
public function get_response( $tags, $tags_added ) {
$message = array();
if ( $tags_added instanceof WP_Error ) {
$message[] = __( 'Tag(s) Add Failed: ', 'wp-marketing-automations-pro' ) . array_reduce( $tags, function ( $carry, $item ) {
$name = $item['value'];
if ( empty( $carry ) ) {
return $name;
}
return ! empty( $name ) ? $carry . ', ' . $name : $carry;
}, '' );
$message[] = __( 'Tag(s) Add Failed. Error: ', 'wp-marketing-automations-pro' ) . $tags_added->get_error_message();
return array(
'status' => self::$RESPONSE_FAILED,
'message' => $message,
);
}
if ( isset( $tags_added['skipped'] ) && count( $tags_added['skipped'] ) > 0 ) {
$message[] = __( 'Tag(s) Add Skipped: ', 'wp-marketing-automations-pro' ) . array_reduce( array_filter( $tags_added['skipped'] ), function ( $carry, $item ) {
$name = $item->get_name();
if ( empty( $carry ) ) {
return $name;
}
return ! empty( $name ) ? $carry . ', ' . $name : $carry;
}, '' );
}
if ( isset( $tags_added['assigned'] ) && count( $tags_added['assigned'] ) > 0 ) {
$message[] = __( 'Tag(s) Added: ', 'wp-marketing-automations-pro' ) . array_reduce( array_filter( $tags_added['assigned'] ), function ( $carry, $item ) {
$name = $item->get_name();
if ( empty( $carry ) ) {
return $name;
}
return ! empty( $name ) ? $carry . ', ' . $name : $carry;
}, '' );
}
return array(
'status' => self::$RESPONSE_SUCCESS,
'message' => $message,
);
}
}
/**
* Register action
*/
BWFCRM_Core()->actions->register_action( 'add_tags', 'BWFCRM\Actions\Autonami\Add_Tags', __( 'Add Tags', 'wp-marketing-automations-pro' ), 'autonami', __( 'FunnelKit Automations', 'wp-marketing-automations-pro' ) );

View File

@@ -0,0 +1,80 @@
<?php
namespace BWFCRM\Actions\Autonami;
use BWFCRM\Actions\Base;
use BWFCRM\Calls\Autonami as Calls;
/**
* Delete contacts action class
*/
class Delete_Contacts extends Base {
/**
* Class constructor
*/
public function __construct() {
$this->slug = 'delete_contacts';
$this->nice_name = __( 'Delete Contacts', 'wp-marketing-automations-pro' );
$this->group = 'autonami';
$this->group_label = __( 'FunnelKit Automations', 'wp-marketing-automations-pro' );
$this->priority = 10;
$this->support = [ 1, 2 ];
}
/**
* Returns action field schema
*
* @return array
*/
public function get_action_schema() {
return [];
}
/**
* process action
*
* @param $contact \BWFCRM_Contact
* @param $data
*
* @return array|false|string
*/
public function handle_action( $contact, $data ) {
// skip if contact doesn't exist
if ( ! $contact->is_contact_exists() ) {
return 'skip';
}
/**
* Check if call exists
*/
if ( ! class_exists( 'BWFCRM\Calls\Autonami\Delete_Contacts' ) ) {
return false;
}
$call_obj = new Calls\Delete_Contacts;
/**
* Process call
*/
$contact_deleted = $call_obj->process_call( $contact, $data );
if ( true === $contact_deleted ) {
return array(
'status' => self::$RESPONSE_SUCCESS,
'message' => __( 'Contact(s) Deleted: ', 'wp-marketing-automations-pro' ),
);
}
return array(
'status' => self::$RESPONSE_FAILED,
'message' => __( 'Contact(s) Deleted Failed: ', 'wp-marketing-automations-pro' ),
);
}
}
/**
* Register action
*/
BWFCRM_Core()->actions->register_action( 'delete_contacts', 'BWFCRM\Actions\Autonami\Delete_Contacts', __( 'Delete Contacts', 'wp-marketing-automations-pro' ), 'autonami', __( 'FunnelKit Automations', 'wp-marketing-automations-pro' ) );

View File

@@ -0,0 +1,71 @@
<?php
namespace BWFCRM\Actions\Autonami;
use BWFCRM\Actions\Base;
use BWFCRM\Calls\Autonami as Calls;
/**
* End Automation action
*/
class End_Automation extends Base {
/**
* Class constructor
*/
public function __construct() {
$this->slug = 'end_automation';
$this->nice_name = __( 'End Automation', 'wp-marketing-automations-pro' );
$this->group = 'autonami';
$this->group_label = __( 'FunnelKit Automations', 'wp-marketing-automations-pro' );
$this->priority = 10;
$this->support = [ 1, 2 ];
}
/**
* Returns action field schema
*
* @return array
*/
public function get_action_schema() {
return [
'type' => 'search',
'meta' => [
'autocompleter' => 'automation',
'addnew' => false,
]
];
}
/**
* process action
*
* @param $contact
* @param $data
*
* @return array|mixed
*/
public function handle_action( $contact, $data ) {
/**
* Check if call exists
*/
if ( ! class_exists( 'BWFCRM\Calls\Autonami\End_Automation' ) ) {
return array(
'status' => self::$RESPONSE_FAILED,
'message' => __( 'End Automation: Call not found', 'wp-marketing-automations-pro' ),
);
}
$call_obj = new Calls\End_Automation;
/**
* Process call
*/
return $call_obj->process_call( $contact, $data );
}
}
/**
* Register Action
*/
BWFCRM_Core()->actions->register_action( 'end_automation', 'BWFCRM\Actions\Autonami\End_Automation', __( 'End Automation', 'wp-marketing-automations-pro' ), 'autonami', __( 'FunnelKit Automations', 'wp-marketing-automations-pro' ) );

View File

@@ -0,0 +1,100 @@
<?php
namespace BWFCRM\Actions\Autonami;
use BWFCRM\Actions\Base;
use BWFCRM\Calls\Autonami as Calls;
/**
* Remove lists action
*/
class Remove_Lists extends Base {
/**
* Class constructor
*/
public function __construct() {
$this->slug = 'remove_lists';
$this->nice_name = __( 'Remove Lists', 'wp-marketing-automations-pro' );
$this->group = 'autonami';
$this->group_label = __( 'FunnelKit Automations', 'wp-marketing-automations-pro' );
$this->priority = 10;
$this->support = [ 1, 2 ];
$this->event_slug = 'crm_unassigned_list';
}
/**
* Returns action field schema
*
* @return array
*/
public function get_action_schema() {
return array(
'type' => 'search',
'meta' => array(
'autocompleter' => 'list',
'addnew' => false,
),
);
}
/**
* process action
*
* @param $contact
* @param $lists
*
* @return array|string
*/
public function handle_action( $contact, $lists ) {
$contact_lists = $contact->get_lists();
// format list data
$lists = array_filter( array_map( function ( $list ) use ( $contact_lists ) {
return in_array( $list['id'], $contact_lists ) ? $list['id'] : false;
}, $lists ) );
if ( empty( $lists ) ) {
return 'skip';
}
/**
* Check if call exists
*/
if ( ! class_exists( 'BWFCRM\Calls\Autonami\Remove_Lists' ) ) {
return array(
'status' => self::$RESPONSE_FAILED,
'message' => __( 'List(s) Remove Failed: Call not found', 'wp-marketing-automations-pro' ),
);
}
$call_obj = new Calls\Remove_Lists();
/**
* Process call
*/
$removed_lists = $call_obj->process_call( $contact, $lists );
if ( empty( $removed_lists ) ) {
return array(
'status' => self::$RESPONSE_FAILED,
'message' => __( 'List(s) Remove Skipped: Lists were not assigned on the contact', 'wp-marketing-automations-pro' ),
);
}
$removed_lists = \BWFCRM_Lists::get_lists( $removed_lists );
$removed_lists = array_map( function ( $list ) {
return $list['name'];
}, $removed_lists );
return array(
'status' => self::$RESPONSE_SUCCESS,
'message' => __( 'List(s) Removed: ', 'wp-marketing-automations-pro' ) . implode( ',', $removed_lists ),
);
}
}
/**
* Register Action
*/
BWFCRM_Core()->actions->register_action( 'remove_lists', 'BWFCRM\Actions\Autonami\Remove_Lists', __( 'Remove Lists', 'wp-marketing-automations-pro' ), 'autonami', __( 'FunnelKit Automations', 'wp-marketing-automations-pro' ) );

View File

@@ -0,0 +1,98 @@
<?php
namespace BWFCRM\Actions\Autonami;
use BWFCRM\Actions\Base;
use BWFCRM\Calls\Autonami as Calls;
/*
* Remove tags action class
*/
class Remove_Tags extends Base {
/**
* Class constructor
*/
public function __construct() {
$this->slug = 'remove_tags';
$this->nice_name = __( 'Remove Tags', 'wp-marketing-automations-pro' );
$this->group = 'autonami';
$this->group_label = __( 'FunnelKit Automations', 'wp-marketing-automations-pro' );
$this->priority = 10;
$this->support = [ 1, 2 ];
$this->event_slug = 'crm_unassigned_tag';
}
/**
* Returns action field schema
*
* @return array
*/
public function get_action_schema() {
return array(
'type' => 'search',
'meta' => array(
'autocompleter' => 'tag',
'addnew' => false,
),
);
}
/**
* @param $contact \BWFCRM_Contact
* @param $tags
*
* @return array|string
*/
public function handle_action( $contact, $tags ) {
$contact_tags = $contact->get_tags();
// format tag data
$tags = array_filter( array_map( function ( $tag ) use ( $contact_tags ) {
return in_array( $tag['id'], $contact_tags ) ? $tag['id'] : false;
}, $tags ) );
if ( empty( $tags ) ) {
return 'skip';
}
/**
* Check if call exists
*/
if ( ! class_exists( 'BWFCRM\Calls\Autonami\Remove_Tags' ) ) {
return array(
'status' => self::$RESPONSE_FAILED,
'message' => __( 'Tag(s) Remove Failed: Call not found', 'wp-marketing-automations-pro' ),
);
}
$call_obj = new Calls\Remove_Tags();
/**
* Process call
*/
$removed_tags = $call_obj->process_call( $contact, $tags );
if ( empty( $removed_tags ) ) {
return array(
'status' => self::$RESPONSE_FAILED,
'message' => __( 'Tag(s) Remove Skipped: Tags were not present on the contact', 'wp-marketing-automations-pro' ),
);
}
$removed_tags = \BWFCRM_Tag::get_tags( $removed_tags );
$removed_tags = array_map( function ( $tag ) {
return $tag['name'];
}, $removed_tags );
return array(
'status' => self::$RESPONSE_SUCCESS,
'message' => __( 'Tag(s) Removed: ', 'wp-marketing-automations-pro' ) . implode( ',', $removed_tags ),
);
}
}
/**
* Register action
*/
BWFCRM_Core()->actions->register_action( 'remove_tags', 'BWFCRM\Actions\Autonami\Remove_Tags', __( 'Remove Tags', 'wp-marketing-automations-pro' ), 'autonami', __( 'FunnelKit Automations', 'wp-marketing-automations-pro' ) );

View File

@@ -0,0 +1,81 @@
<?php
namespace BWFCRM\Actions\Autonami;
use BWFCRM\Actions\Base;
use BWFCRM\Calls\Autonami as Calls;
/**
* Subscribe contacts action class
*/
class Subscribe_Contacts extends Base {
/**
* Class constructor
*/
public function __construct() {
$this->slug = 'subscribe_contacts';
$this->nice_name = __( 'Subscribe Contacts', 'wp-marketing-automations-pro' );
$this->group = 'autonami';
$this->group_label = __( 'FunnelKit Automations', 'wp-marketing-automations-pro' );
$this->priority = 10;
$this->support = [ 1, 2 ];
$this->event_slug = 'crm_contact_subscribed';
}
/**
* Returns action field schema
*
* @return array
*/
public function get_action_schema() {
return [];
}
/**
* process action
*
* @param $contact \BWFCRM_Contact
* @param $data
*
* @return array|false|string
*/
public function handle_action( $contact, $data ) {
// skip if already subscribed
if ( $contact->contact->is_subscribed ) {
return 'skip';
}
/**
* Check if call exists
*/
if ( ! class_exists( 'BWFCRM\Calls\Autonami\Subscribe_Contacts' ) ) {
return false;
}
$call_obj = new Calls\Subscribe_Contacts;
/**
* Process call
*/
$constact_subsribed = $call_obj->process_call( $contact, $data );
if ( true === $constact_subsribed ) {
return array(
'status' => self::$RESPONSE_SUCCESS,
'message' => __( 'Contact(s) Subscribed: ', 'wp-marketing-automations-pro' ),
);
}
return array(
'status' => self::$RESPONSE_FAILED,
'message' => __( 'Contact(s) Subscribed Failed: ', 'wp-marketing-automations-pro' ),
);
}
}
/**
* Register action
*/
BWFCRM_Core()->actions->register_action( 'subscribe_contacts', 'BWFCRM\Actions\Autonami\Subscribe_Contacts', __( 'Subscribe Contacts', 'wp-marketing-automations-pro' ), 'autonami', __( 'FunnelKit Automations', 'wp-marketing-automations-pro' ) );

View File

@@ -0,0 +1,81 @@
<?php
namespace BWFCRM\Actions\Autonami;
use BWFCRM\Actions\Base;
use BWFCRM\Calls\Autonami as Calls;
/**
* Unsubscribe contacts action class
*/
class Unsubscribe_Contacts extends Base {
/**
* Class constructor
*/
public function __construct() {
$this->slug = 'unsubscribe_contacts';
$this->nice_name = __( 'Unsubscribe Contacts', 'wp-marketing-automations-pro' );
$this->group = 'autonami';
$this->group_label = __( 'FunnelKit Automations', 'wp-marketing-automations-pro' );
$this->priority = 10;
$this->support = [ 1, 2 ];
$this->event_slug = 'crm_contact_unsubscribed';
}
/**
* Returns action field schema
*
* @return array
*/
public function get_action_schema() {
return [];
}
/**
* process action
*
* @param $contact \BWFCRM_Contact
* @param $data
*
* @return array|false|string
*/
public function handle_action( $contact, $data ) {
// skip if already unsubscribed
if ( ! empty( $contact->check_contact_unsubscribed() ) ) {
return 'skip';
}
/**
* Check if call exists
*/
if ( ! class_exists( 'BWFCRM\Calls\Autonami\Unsubscribe_Contacts' ) ) {
return false;
}
$call_obj = new Calls\Unsubscribe_Contacts;
/**
* Process call
*/
$contact_unsubscribed = $call_obj->process_call( $contact, $data );
if ( true === $contact_unsubscribed ) {
return array(
'status' => self::$RESPONSE_SUCCESS,
'message' => __( 'Contact(s) Unubscribed: ', 'wp-marketing-automations-pro' ),
);
}
return array(
'status' => self::$RESPONSE_FAILED,
'message' => __( 'Contact(s) Unsubscribed Failed: ', 'wp-marketing-automations-pro' ),
);
}
}
/**
* Register action
*/
BWFCRM_Core()->actions->register_action( 'unsubscribe_contacts', 'BWFCRM\Actions\Autonami\Unsubscribe_Contacts', __( 'Unsubscribe Contacts', 'wp-marketing-automations-pro' ), 'autonami', __( 'FunnelKit Automations', 'wp-marketing-automations-pro' ) );

View File

@@ -0,0 +1,143 @@
<?php
namespace BWFCRM\Actions\Autonami;
use BWFAN_Model_Fields;
use BWFCRM\Actions\Base;
use BWFCRM\Calls\Autonami as Calls;
/**
* Update Custom field action class
*/
class Update_Fields extends Base {
/**
* Class constructor
*/
public function __construct() {
$this->slug = 'update_fields';
$this->nice_name = __( 'Update field', 'wp-marketing-automations-pro' );
$this->group = 'autonami';
$this->group_label = __( 'FunnelKit Automations', 'wp-marketing-automations-pro' );
$this->priority = 10;
$this->support = [ 1, 2 ];
}
/**
* Returns action field schema
*
* @return array
*/
public function get_action_schema() {
return [
'type' => 'bwfupdatefield',
'meta' => [
'fields' => []
]
];
}
/**
* process action
*
* @param $contact
* @param $fields
*
* @return array
*/
public function handle_action( $contact, $fields ) {
$field_data = [];
/** Trim field keys before processing */
$fields = $this->trim_filter_data( $fields );
foreach ( $fields as $key => $value ) {
/** If status is 3 then contact unsubscribe */
if ( 'status' === trim( $key ) && 3 === absint( $value ) ) {
$contact->unsubscribe();
continue;
}
if ( isset( $value ) ) {
$field_data[ trim( $key ) ] = $value;
}
}
/**
* Check if call exists
*/
if ( ! class_exists( 'BWFCRM\Calls\Autonami\Update_Fields' ) ) {
return array(
'status' => self::$RESPONSE_FAILED,
'message' => __( 'Update Fields (Error): Update Fields call not found', 'wp-marketing-automations-pro' ),
);
}
$call_obj = new Calls\Update_Fields();
$result = $call_obj->process_call( $contact, $field_data );
$fields = $this->get_affected_fields( $fields );
if ( true === $result ) {
return array(
'status' => self::$RESPONSE_SUCCESS,
'message' => __( 'Field(s) Updated: ', 'wp-marketing-automations-pro' ) . implode( ', ', $fields ),
);
}
return array(
'status' => self::$RESPONSE_FAILED,
'message' => __( 'Field(s) Update Failed: ', 'wp-marketing-automations-pro' ) . implode( ', ', $fields ),
);
}
/**
* Trim field key data
*
* @param $data
*
* @return array
*/
public function trim_filter_data( $data ) {
if ( empty( $data ) ) {
return [];
}
$result = [];
foreach ( $data as $key => $value ) {
$result[ trim( $key ) ] = $value;
}
return $result;
}
public function get_affected_fields( $fields ) {
$custom_fields = array();
$default_fields = array();
foreach ( array_keys( $fields ) as $id ) {
$id = trim( $id );
if ( is_numeric( $id ) ) {
$custom_fields[] = absint( $id );
continue;
}
$default_fields[] = $id;
}
/** If custom fields not found */
if ( empty( $custom_fields ) ) {
return $default_fields;
}
$custom_fields = BWFAN_Model_Fields::get_multiple_fields( $custom_fields );
$custom_fields = array_map( function ( $field ) {
return $field['name'];
}, $custom_fields );
return array_values( array_merge( $default_fields, $custom_fields ) );
}
}
/**
* Register action
*/
BWFCRM_Core()->actions->register_action( 'update_fields', 'BWFCRM\Actions\Autonami\Update_Fields', __( 'Update Fields', 'wp-marketing-automations-pro' ), 'autonami', __( 'FunnelKit Automations', 'wp-marketing-automations-pro' ) );