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,90 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-dashboard
*/
namespace TVE\Dashboard\Automator;
use Thrive\Automator\Items\Action_Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class Api_Fields extends Action_Field {
public static function get_name() {
return 'Field mapping';
}
public static function get_description() {
return 'Field mapping lets you add more contact information to your email service. If the name field receives two names separated by a space, they will automatically be split and saved as a first and last name.';
}
public static function get_placeholder() {
return 'Field mapping';
}
public static function get_id() {
return 'api_fields';
}
public static function get_type() {
return 'mapping_pair';
}
public static function get_preview_template() {
return '';
}
/**
* For multiple option inputs, name of the callback function called through ajax to get the options
*/
public static function get_options_callback( $action_id, $action_data ) {
$values = array(
0 => array(
'id' => 'name',
'label' => __( 'Name', 'thrive-dash' ),
),
1 => array(
'id' => 'phone',
'label' => __( 'Phone', 'thrive-dash' ),
),
);
if ( ! empty( $action_data ) ) {
if ( is_string( $action_data ) ) {
$api = $action_data;
} else if ( property_exists( $action_data, 'autoresponder' ) ) {
$api = $action_data->autoresponder->value;
}
}
if ( ! empty( $api ) ) {
$api_instance = \Thrive_Dash_List_Manager::connection_instance( $api );
if ( $api_instance && $api_instance->is_connected() && $api_instance->has_custom_fields() ) {
$mailing_list = empty( $action_data->autoresponder->subfield->mailing_list->value ) ? '' : $action_data->autoresponder->subfield->mailing_list->value;
$custom_fields = $api_instance->get_custom_fields_by_list( $mailing_list );
foreach ( $custom_fields as $key => $field ) {
array_push( $values, array(
'id' => $field['id'],
'label' => $field['label'] ?: $field['name'],
) );
}
}
}
return array_reverse( $values, true );
}
public static function get_validators() {
return array( 'key_value_pair' );
}
public static function allow_dynamic_data() {
return true;
}
}

View File

@@ -0,0 +1,102 @@
<?php
namespace TVE\Dashboard\Automator;
use Thrive\Automator\Items\Action_Field;
use Thrive_Dash_List_Manager;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class Autoresponder_Field
*/
class Autoresponder_Field extends Action_Field {
/**
* Field name
*/
public static function get_name() {
return 'Autoresponder';
}
/**
* Field description
*/
public static function get_description() {
return static::get_placeholder();
}
/**
* Field input placeholder
*/
public static function get_placeholder() {
return __( 'Choose service from your list of registered APIs to use', 'thrive-dash' );
}
/**
* $$value will be replaced by field value
* $$length will be replaced by value length
*
*
* @return string
*/
public static function get_preview_template() {
return 'Autoresponder: $$value';
}
/**
* For multiple option inputs, name of the callback function called through ajax to get the options
*/
public static function get_options_callback( $action_id, $action_data ) {
$is_tag_action = $action_id === Tag_User::get_id();
$apis = Thrive_Dash_List_Manager::get_available_apis( true, [
'exclude_types' => [
'email',
'webinar',
'other',
'recaptcha',
'social',
'sellings',
'integrations',
'storage',
'collaboration',
'testimonial',
],
] );
$values = array();
foreach ( $apis as $api ) {
//email is seen as autoresponder
$allow_tags = true;
if ( $is_tag_action ) {
$allow_tags = $api->has_tags();
}
if ( $allow_tags && ! in_array( $api->get_key(), array( 'email', 'wordpress' ) ) ) {
$values[ $api->get_key() ] = array(
'id' => $api->get_key(),
'label' => $api->get_title(),
);
}
}
return $values;
}
public static function get_id() {
return 'autoresponder';
}
public static function get_type() {
return 'select';
}
public static function is_ajax_field() {
return true;
}
public static function get_validators() {
return array( 'required' );
}
}

View File

@@ -0,0 +1,49 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-dashboard
*/
namespace TVE\Dashboard\Automator;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
use Thrive\Automator\Items\Action_Field;
class Facebook_Custom_Options_Field extends Action_Field {
public static function get_id() {
return 'fb/custom_options';
}
public static function get_name() {
return __( 'Facebook custom options', 'thrive-dash' );
}
public static function get_description() {
return '';
}
public static function get_placeholder() {
return '';
}
public static function get_type() {
return 'key_value_pair';
}
public static function get_preview_template() {
return '';
}
public static function allow_dynamic_data() {
return true;
}
public static function get_validators() {
return [ 'key_value_pair' ];
}
}

View File

@@ -0,0 +1,49 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-dashboard
*/
namespace TVE\Dashboard\Automator;
use Thrive\Automator\Items\Action_Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class Facebook_Event_Field extends Action_Field {
public static function get_name() {
return __( 'Event', 'thrive-dash' );
}
public static function get_description() {
return '';
}
public static function get_placeholder() {
return __( 'Choose a standard event name', 'thrive-dash' );
}
public static function get_id() {
return 'fb/event';
}
public static function get_type() {
return 'select';
}
public static function get_field_values( $filters = [] ) {
return Facebook::get_event_types();
}
public static function get_preview_template() {
return 'Event: $$value';
}
public static function get_validators() {
return [ 'required' ];
}
}

View File

@@ -0,0 +1,49 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-dashboard
*/
namespace TVE\Dashboard\Automator;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
use Thrive\Automator\Items\Action_Field;
class Facebook_Event_Name_Field extends Action_Field {
public static function get_id() {
return 'fb/event_name';
}
public static function get_name() {
return __( 'Custom event name', 'thrive-dash' );
}
public static function get_description() {
return '';
}
public static function get_placeholder() {
return __( 'Enter a name for your custom event', 'thrive-dash' );
}
public static function get_validators() {
return [ 'required' ];
}
public static function allow_dynamic_data() {
return true;
}
public static function get_type() {
return 'input';
}
public static function get_preview_template() {
return __( 'Custom event name: ', 'thrive-dash' ) . '$$value';
}
}

View File

@@ -0,0 +1,53 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-dashboard
*/
namespace TVE\Dashboard\Automator;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
use Thrive\Automator\Items\Action_Field;
class Facebook_Standard_Options_Field extends Action_Field {
public static function get_id() {
return 'fb/standard_options';
}
public static function get_name() {
return __( 'Facebook standard options', 'thrive-dash' );
}
public static function get_description() {
return '';
}
public static function get_placeholder() {
return '';
}
public static function get_type() {
return 'mapping_pair';
}
public static function get_field_values( $filters = [] ) {
return array_merge( Facebook::get_standard_options(), Facebook::get_event_options(), Facebook::get_user_options() );
}
public static function allow_dynamic_data() {
return true;
}
public static function get_preview_template() {
return '';
}
public static function get_validators() {
return [ 'key_value_pair' ];
}
}

View File

@@ -0,0 +1,78 @@
<?php
namespace TVE\Dashboard\Automator;
use Thrive\Automator\Items\Action_Field;
use Thrive_Dash_List_Manager;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class Form_List_Field
*/
class Form_List_Field extends Action_Field {
/**
* Field name
*/
public static function get_name() {
return __( 'Select the form', 'thrive-dash' );
}
/**
* Field description
*/
public static function get_description() {
return static::get_placeholder();
}
/**
* Field input placeholder
*/
public static function get_placeholder() {
return __( 'Choose the form you want to use', 'thrive-dash' );
}
/**
* $$value will be replaced by field value
* $$length will be replaced by value length
*
*
* @return string
*/
public static function get_preview_template() {
return '';
}
public static function get_id() {
return 'form_list';
}
public static function get_type() {
return 'select';
}
public static function get_options_callback( $action_id, $action_data ) {
$values = array();
if ( ! empty( $action_data ) ) {
if ( is_string( $action_data ) ) {
$api = $action_data;
} else if ( property_exists( $action_data, 'autoresponder' ) ) {
$api = $action_data->autoresponder->value;
}
}
if ( ! empty( $api ) ) {
$api_instance = Thrive_Dash_List_Manager::connection_instance( $api );
if ( $api_instance && $api_instance->is_connected() && $api_instance->has_forms() ) {
$forms = $api_instance->get_forms();
if ( ! empty( $forms[ $action_data->autoresponder->subfield->mailing_list->value ] ) ) {
$values = $forms[ $action_data->autoresponder->subfield->mailing_list->value ];
}
}
}
return $values;
}
}

View File

@@ -0,0 +1,107 @@
<?php
namespace TVE\Dashboard\Automator;
use Thrive\Automator\Items\Action_Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class Mailing_List_Field
*/
class Mailing_List_Field extends Action_Field {
/**
* Field name
*/
public static function get_name() {
return 'Add the user to the following list';
}
/**
* Field description
*/
public static function get_description() {
return static::get_placeholder();
}
/**
* Field input placeholder
*/
public static function get_placeholder() {
return __( 'Select an autoresponder mailing list to add the user to', 'thrive-dash' );
}
/**
* $$value will be replaced by field value
* $$length will be replaced by value length
*
*
* @return string
*/
public static function get_preview_template() {
return 'List: $$value';
}
/**
* For multiple option inputs, name of the callback function called through ajax to get the options
*/
public static function get_options_callback( $action_id, $action_data ) {
$lists = [];
if ( ! empty( $action_data ) ) {
if ( is_string( $action_data ) ) {
$api = $action_data;
} else if ( property_exists( $action_data, 'autoresponder' ) ) {
$api = $action_data->autoresponder->value;
}
}
if ( ! empty( $api ) ) {
$api_instance = \Thrive_Dash_List_Manager::connection_instance( $api );
if ( $api_instance && $api_instance->is_connected() ) {
$lists = $api_instance->get_lists( false );
if ( $api_instance->has_forms() ) {
$lists = static::add_form_data( $lists, $api_instance->get_forms() );
}
}
}
return $lists;
}
public static function get_id() {
return 'mailing_list';
}
public static function get_type() {
return 'select';
}
public static function is_ajax_field() {
return true;
}
public static function get_validators() {
return array( 'required' );
}
/**
* @param array $lists
* @param array $forms
*
* @return array
*/
public static function add_form_data( $lists, $forms ) {
foreach ( $lists as $key => $list ) {
if ( is_array( $list ) ) {
$lists[ $key ]['values'] = $forms[ $list['id'] ];
} else {
$lists[ $key ]->values = $forms[ $list->id ];
}
}
return $lists;
}
}

View File

@@ -0,0 +1,68 @@
<?php
namespace TVE\Dashboard\Automator;
use Thrive\Automator\Items\Action_Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class Autoresponder_Field
*/
class Optin_Type_Field extends Action_Field {
/**
* Field name
*/
public static function get_name() {
return 'Optin';
}
/**
* Field description
*/
public static function get_description() {
return 'Choose the type of optin you would like. Double optin means your subscribers will need to confirm their email address before being added to your list';
}
/**
* Field input placeholder
*/
public static function get_placeholder() {
return 'Choose autoresponder';
}
/**
* For multiple option inputs, name of the callback function called through ajax to get the options
*/
public static function get_options_callback( $action_id, $action_data ) {
return array(
's' => array(
'id' => 's',
'name' => 'Single',
),
'd' => array(
'id' => 'd',
'name' => 'Double',
),
);
}
public static function get_id() {
return 'optin';
}
public static function get_type() {
return 'select';
}
public static function is_ajax_field() {
return true;
}
public static function get_validators() {
return array( 'required' );
}
}

View File

@@ -0,0 +1,75 @@
<?php
namespace TVE\Dashboard\Automator;
use Thrive\Automator\Items\Action_Field;
use Thrive_Dash_List_Manager;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class Form_List_Field
*/
class Slack_Channel_Field extends Action_Field {
/**
* Field name
*/
public static function get_name() {
return __( 'Slack channel', 'thrive-dash' );
}
/**
* Field description
*/
public static function get_description() {
return __( 'Choose the slack channel you want to use', 'thrive-dash' );
}
/**
* Field input placeholder
*/
public static function get_placeholder() {
return __( 'Select a channel', 'thrive-dash' );
}
/**
* $$value will be replaced by field value
* $$length will be replaced by value length
*
*
* @return string
*/
public static function get_preview_template() {
return '';
}
public static function get_id() {
return 'slack_channel';
}
public static function get_type() {
return 'select';
}
public static function get_options_callback( $action_id, $action_data ) {
$values = array();
$api_instance = Thrive_Dash_List_Manager::connection_instance( 'slack' );
if ( $api_instance && $api_instance->is_connected() ) {
$channels = $api_instance->get_channel_list();
foreach ( $channels as $channel ) {
$values[ $channel->id ] = [ 'name' => $channel->name, 'id' => $channel->id ];
}
}
return $values;
}
public static function get_validators() {
return [ 'required' ];
}
}

View File

@@ -0,0 +1,55 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-automator
*/
namespace TVE\Dashboard\Automator;
use Thrive\Automator\Items\Action_Field;
use Thrive\Automator\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class Slack_Message_Title_Field extends Action_Field {
public static function get_name() {
return __( 'Message title', 'thrive-dash' );
}
public static function get_description() {
return __( 'Message title', 'thrive-dash' );
}
public static function get_placeholder() {
return __( 'Enter the title of your notification', 'thrive-dash' );
}
public static function get_id() {
return 'slack_message_title';
}
public static function get_type() {
return Utils::FIELD_TYPE_TEXT;
}
public static function get_validators() {
return [ 'required' ];
}
public static function is_ajax_field() {
return false;
}
public static function get_preview_template() {
return __( 'Message title:', 'thrive-dash' ) . '$$value';
}
public static function allow_dynamic_data() {
return true;
}
}

View File

@@ -0,0 +1,41 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-automator
*/
namespace TVE\Dashboard\Automator;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
use Thrive\Automator\Items\Connection_Test;
class Slack_Test_Notification_Field extends Connection_Test {
public static function get_name() {
return '';
}
public static function get_description() {
return '';
}
public static function get_placeholder() {
return '';
}
public static function get_id() {
return 'slack_test_notification_button';
}
public static function get_type() {
return 'action_test';
}
public static function get_extra_options() {
return [
'success_message' => __( 'Slack notification sent successfully', 'thrive-automator' ),
];
}
}

View File

@@ -0,0 +1,74 @@
<?php
namespace TVE\Dashboard\Automator;
use Thrive\Automator\Items\Action_Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class Tag_Input_Field
*/
class Tag_Input_Field extends Action_Field {
/**
* Field name
*/
public static function get_name() {
return 'Tags';
}
/**
* Field description
*/
public static function get_description() {
return 'Which tag(s) would you like to apply? Use a comma to add multiple tags. Example:- tag1, tag2';
}
/**
* Field input placeholder
*/
public static function get_placeholder() {
return '';
}
/**
* $$value will be replaced by field value
* $$length will be replaced by value length
*
*
* @return string
*/
public static function get_preview_template() {
return 'Send tags: $$value';
}
public static function get_id() {
return 'tag_input';
}
public static function get_type() {
return 'tags';
}
public static function get_validators() {
return array( 'required' );
}
public static function allow_dynamic_data() {
return true;
}
/**
* An array of extra options to be passed to the field which can affect the display of the field
*
* @return array
*/
public static function get_extra_options() {
return [
'message' => 'Type a tag and press Enter. Use a comma to add multiple tags',
];
}
}

View File

@@ -0,0 +1,90 @@
<?php
namespace TVE\Dashboard\Automator;
use Thrive\Automator\Items\Action_Field;
use Thrive_Dash_List_Manager;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class Tag_Select_Field
*/
class Tag_Select_Field extends Action_Field {
/**
* Field name
*/
public static function get_name() {
return 'Add the following tags to the user';
}
/**
* Field description
*/
public static function get_description() {
return 'Which tag(s) would you like to apply? Use a comma to add multiple tags. Example:- tag1, tag2';
}
/**
* Field input placeholder
*/
public static function get_placeholder() {
return 'Choose tag';
}
/**
* $$value will be replaced by field value
* $$length will be replaced by value length
*
*
* @return string
*/
public static function get_preview_template() {
return '';
}
/**
* For multiple option inputs, name of the callback function called through ajax to get the options
*/
public static function get_options_callback( $action_id, $action_data ) {
$values = array();
if ( ! empty( $action_data ) ) {
if ( is_string( $action_data ) ) {
$api = $action_data;
} else if ( property_exists( $action_data, 'autoresponder' ) ) {
$api = $action_data->autoresponder->value;
}
}
if ( ! empty( $api ) ) {
$api_instance = Thrive_Dash_List_Manager::connection_instance( $api );
if ( $api_instance && $api_instance->is_connected() ) {
$tags = $api_instance->getTags();
foreach ( $tags as $key => $tag ) {
$values[ $key ] = [ 'name' => $tag, 'id' => $key ];
}
}
}
return $values;
}
public static function get_id() {
return 'tag_select';
}
public static function get_type() {
return 'select';
}
public static function is_ajax_field() {
return true;
}
public static function get_validators() {
return array( 'required' );
}
}

View File

@@ -0,0 +1,79 @@
<?php
namespace TVE\Dashboard\Automator;
use Thrive\Automator\Items\Action_Field;
use function wc_get_order_statuses;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class Woo_Order_Status_Field
*/
class Woo_Order_Status_Field extends Action_Field {
/**
* Field name
*/
public static function get_name() {
return 'Change order to the following status';
}
/**
* Field description
*/
public static function get_description() {
return static::get_placeholder();
}
/**
* Field input placeholder
*/
public static function get_placeholder() {
return __( 'Select a status to set on the order', 'thrive-dash' );
}
/**
* $$value will be replaced by field value
* $$length will be replaced by value length
*
*
* @return string
*/
public static function get_preview_template() {
return 'Status: $$value';
}
/**
* For multiple option inputs, name of the callback function called through ajax to get the options
*/
public static function get_options_callback( $action_id, $action_data ) {
$statuses = array();
foreach ( wc_get_order_statuses() as $key => $status ) {
$statuses[ $key ] = array(
'label' => $status,
'id' => $key,
);
}
return $statuses;
}
public static function get_id() {
return 'woo_order_status';
}
public static function get_type() {
return 'select';
}
public static function is_ajax_field() {
return true;
}
public static function get_validators() {
return array( 'required' );
}
}

View File

@@ -0,0 +1,78 @@
<?php
namespace TVE\Dashboard\Automator;
use Thrive\Automator\Items\Action_Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class Woo_Products_Field
*/
class Woo_Products_Field extends Action_Field {
/**
* Field name
*/
public static function get_name() {
return 'Which product should be added to the order?';
}
/**
* Field description
*/
public static function get_description() {
return static::get_placeholder();
}
/**
* Field input placeholder
*/
public static function get_placeholder() {
return __( 'Select products to add them to the order', 'thrive-dash' );
}
/**
* $$value will be replaced by field value
* $$length will be replaced by value length
*
*
* @return string
*/
public static function get_preview_template() {
return 'Product: $$value';
}
/**
* For multiple option inputs, name of the callback function called through ajax to get the options
*/
public static function get_options_callback( $action_id, $action_data ) {
$products = array();
foreach ( Woo::get_products() as $product ) {
$id = $product->get_id();
$products[ $id ] = array(
'label' => $product->get_name(),
'id' => $id,
);
}
return $products;
}
public static function get_id() {
return 'woo_products';
}
public static function get_type() {
return 'autocomplete';
}
public static function is_ajax_field() {
return true;
}
public static function get_validators() {
return array( 'required' );
}
}