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,103 @@
<?php
namespace TVE\Dashboard\Automator;
use Thrive\Automator\Items\Data_Object;
use Thrive\Automator\Items\Form_Email_Data_Field;
use Thrive\Automator\Items\Form_Name_Data_Field;
use Thrive\Automator\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class Elementor_Form_Data
*/
class Elementor_Form_Data extends Data_Object {
/**
* Get the data-object identifier
*
* @return string
*/
public static function get_id() {
return 'elementor_form_data';
}
public static function get_nice_name() {
return __( 'Elementor form data', 'thrive-dash' );
}
/**
* Array of field object keys that are contained by this data-object
*
* @return array
*/
public static function get_fields() {
return [
Form_Email_Data_Field::get_id(),
Form_Name_Data_Field::get_id(),
];
}
public static function create_object( $param ) {
$post_data = [];
if ( is_array( $param ) ) {
$allowed_keys = [
'name',
'email',
'message',
'url',
];
/**
* Fields that can be set for WP connection
*/
$extra_mapped_keys = [ 'nickname', 'description', 'user_url', 'url' ];
$extra_keys_regex = implode( '|', $extra_mapped_keys );
foreach ( $param as $key => $value ) {
if ( in_array( $key, $allowed_keys, true ) || strpos( $key, 'field_' ) !== false || preg_match( "/^($extra_keys_regex)/", $key ) ) {
$post_data[ $key ] = $value;
}
}
} elseif ( is_email( $param ) ) {
$post_data['email'] = $param;
}
return $post_data;
}
public function replace_dynamic_data( $value ) {
$value = parent::replace_dynamic_data( $value );
$value = Utils::replace_additional_data_shortcodes( $value, $this->data );
// replace shortcodes if values are not provided by the form
if ( is_array( $value ) ) {
foreach ( $value as &$field ) {
if ( $field['value'] ) {
preg_match_all( '/%+field_[a-zA-Z0-9]{7}%/', $field['value'], $matches );
foreach ( $matches as $shortcode ) {
$field['value'] = str_replace( $shortcode, '', $field['value'] );
}
}
}
}
return $value;
}
public function can_provide_email() {
return true;
}
public function get_provided_email() {
return $this->get_value( 'email' );
}
}

View File

@@ -0,0 +1,166 @@
<?php
namespace TVE\Dashboard\Automator;
use Exception;
use Thrive\Automator\Items\Data_Object;
use function wc_get_order;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class Woo_Order_Data
*/
class Woo_Order_Data extends Data_Object {
/**
* Get the data-object identifier
*
* @return string
*/
public static function get_id() {
return 'woo_order_data';
}
public static function get_nice_name() {
return 'WooCommerce order';
}
/**
* Array of field object keys that are contained by this data-object
*
* @return array
*/
public static function get_fields() {
return array(
'woo_order_id',
'order_number',
'order_key',
'customer_id',
'billing_first_name',
'billing_last_name',
'billing_company',
'billing_address_1',
'billing_address_2',
'billing_city',
'billing_state',
'billing_postcode',
'billing_country',
'billing_email',
'billing_phone',
'shipping_first_name',
'shipping_last_name',
'shipping_company',
'shipping_address_1',
'shipping_address_2',
'shipping_city',
'shipping_state',
'shipping_postcode',
'shipping_country',
'payment_method',
'payment_method_title',
'transaction_id',
'customer_ip_address',
'customer_user_agent',
'created_via',
'customer_note',
'date_completed',
'date_paid',
'cart_hash',
'get_parent_id',
'order_currency',
'order_version',
'prices_include_tax',
'date_created',
'date_modified',
'order_status',
'discount_total',
'shipping_total',
'shipping_tax',
'cart_tax',
'grand_total',
'total_tax',
'coupon_used',
'item_count',
'has_free_item',
);
}
public static function create_object( $param ) {
if ( empty( $param ) ) {
throw new Exception( 'No parameter provided for Woo_Order_Data object' );
}
$order = null;
if ( is_a( $param, 'WC_Order' ) ) {
$order = $param;
} elseif ( is_numeric( $param ) ) {
$order = wc_get_order( $param );
}
if ( $order ) {
return array(
'woo_order_id' => $order->get_id(),
'order_number' => $order->get_order_number(),
'order_key' => $order->get_order_key(),
'customer_id' => $order->get_customer_id(),
'billing_first_name' => $order->get_billing_first_name(),
'billing_last_name' => $order->get_billing_last_name(),
'billing_company' => $order->get_billing_company(),
'billing_address_1' => $order->get_billing_address_1(),
'billing_address_2' => $order->get_billing_address_2(),
'billing_city' => $order->get_billing_city(),
'billing_state' => $order->get_billing_state(),
'billing_postcode' => $order->get_billing_postcode(),
'billing_country' => $order->get_billing_country(),
'billing_email' => $order->get_billing_email(),
'billing_phone' => $order->get_billing_phone(),
'shipping_first_name' => $order->get_shipping_first_name(),
'shipping_last_name' => $order->get_shipping_last_name(),
'shipping_company' => $order->get_shipping_company(),
'shipping_address_1' => $order->get_shipping_address_1(),
'shipping_address_2' => $order->get_shipping_address_2(),
'shipping_city' => $order->get_shipping_city(),
'shipping_state' => $order->get_shipping_state(),
'shipping_postcode' => $order->get_shipping_postcode(),
'shipping_country' => $order->get_shipping_country(),
'payment_method' => $order->get_payment_method(),
'payment_method_title' => $order->get_payment_method_title(),
'transaction_id' => $order->get_transaction_id(),
'customer_ip_address' => $order->get_customer_ip_address(),
'customer_user_agent' => $order->get_customer_user_agent(),
'created_via' => $order->get_created_via(),
'customer_note' => $order->get_customer_note(),
'date_completed' => $order->get_date_completed(),
'date_paid' => $order->get_date_paid(),
'cart_hash' => $order->get_cart_hash(),
'parent_id' => $order->get_parent_id(),
'order_currency' => $order->get_currency(),
'order_version' => $order->get_version(),
'prices_include_tax' => $order->get_prices_include_tax(),
'date_created' => $order->get_date_created(),
'date_modified' => $order->get_date_modified(),
'order_status' => $order->get_status(),
'discount_total' => $order->get_discount_total(),
'shipping_total' => $order->get_shipping_total(),
'shipping_tax' => $order->get_shipping_tax(),
'cart_tax' => $order->get_cart_tax(),
'grand_total' => $order->get_total(),
'total_tax' => $order->get_total_tax(),
'coupon_used' => $order->get_coupon_codes(),
'item_count' => $order->get_item_count(),
'has_free_item' => $order->has_free_item(),
);
}
return $order;
}
}

View File

@@ -0,0 +1,167 @@
<?php
namespace TVE\Dashboard\Automator;
use Exception;
use Thrive\Automator\Items\Data_Object;
use function wc_get_product;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
/**
* Class Woo_Product_Data
*/
class Woo_Product_Data extends Data_Object {
/**
* Get the data-object identifier
*
* @return string
*/
public static function get_id() {
return 'woo_product_data';
}
public static function get_nice_name() {
return 'WooCommerce product';
}
/**
* Array of field object keys that are contained by this data-object
*
* @return array
*/
public static function get_fields() {
return array(
'woo_product_id',
'product_type',
'woo_product_name',
'product_slug',
'product_created_date',
'product_modified_date',
'product_status',
'product_featured',
'product_catalog_visibility',
'product_description',
'product_short_description',
'product_sku',
'product_active_price',
'product_regular_price',
'product_sale_price',
'product_date_on_sale_from',
'product_date_on_sale_to',
'product_total_number_sales',
'product_tax_status',
'product_tax_class',
'product_manage_stock',
'product_sale_quantity',
'product_stock_status',
'product_backorders',
'product_low_stock_amount',
'product_sold_individually',
'product_weight',
'product_length',
'product_width',
'product_height',
'product_upsell_ids',
'product_cross_sell_ids',
'product_parent_id',
'product_reviews_allowed',
'product_purchase_note',
'product_attributes',
'product_default_attributes',
'product_category_ids',
'product_tag_ids',
'product_get_virtual',
'product_gallery_ids',
'product_shipping_class_id',
'product_rating_count',
'product_average_rating',
'product_review_count',
);
}
public static function create_object( $param ) {
if ( empty( $param ) ) {
throw new Exception( 'No parameter provided for Woo_Product_Data object' );
}
$product = null;
if ( is_a( $param, 'WC_Order_Item_Product' ) ) {
$product = $param->get_product();
} elseif ( is_a( $param, 'WC_Product' ) ) {
$product = $param;
} elseif ( is_numeric( $param ) ) {
$product = wc_get_product( $param );
}
if ( $product ) {
return array(
'woo_product_id' => $product->get_id(),
'product_type' => $product->get_type(),
'woo_product_name' => $product->get_name(),
'product_slug' => $product->get_slug(),
'product_created_date' => $product->get_date_created(),
'product_modified_date' => $product->get_date_modified(),
'product_status' => $product->get_status(),
'product_featured' => $product->get_featured(),
'product_catalog_visibility' => $product->get_catalog_visibility(),
'product_description' => $product->get_description(),
'product_short_description' => $product->get_short_description(),
'product_sku' => $product->get_sku(),
'product_active_price' => $product->get_price(),
'product_regular_price' => $product->get_regular_price(),
'product_sale_price' => $product->get_sale_price(),
'product_date_on_sale_from' => $product->get_date_on_sale_from(),
'product_date_on_sale_to' => $product->get_date_on_sale_to(),
'product_total_number_sales' => $product->get_total_sales(),
'product_tax_status' => $product->get_tax_status(),
'product_tax_class' => $product->get_tax_class(),
'product_manage_stock' => $product->get_manage_stock(),
'product_sale_quantity' => $product->get_stock_quantity(),
'product_stock_status' => $product->get_stock_status(),
'product_backorders' => $product->get_backorders(),
'product_low_stock_amount' => $product->get_low_stock_amount(),
'product_sold_individually' => $product->get_sold_individually(),
'product_weight' => $product->get_weight(),
'product_length' => $product->get_length(),
'product_width' => $product->get_width(),
'product_height' => $product->get_height(),
'product_upsell_ids' => $product->get_upsell_ids(),
'product_cross_sell_ids' => $product->get_cross_sell_ids(),
'product_parent_id' => $product->get_parent_id(),
'product_reviews_allowed' => $product->get_reviews_allowed(),
'product_purchase_note' => $product->get_purchase_note(),
'product_attributes' => $product->get_attributes(),
'product_default_attributes' => $product->get_default_attributes(),
'product_category_ids' => $product->get_category_ids(),
'product_tag_ids' => $product->get_tag_ids(),
'product_get_virtual' => $product->get_virtual(),
'product_gallery_ids' => $product->get_gallery_image_ids(),
'product_shipping_class_id' => $product->get_shipping_class_id(),
'product_rating_count' => $product->get_rating_counts(),
'product_average_rating' => $product->get_average_rating(),
'product_review_count' => $product->get_review_count(),
);
}
return $product;
}
public static function get_data_object_options() {
$options = [];
foreach ( Woo::get_products() as $product ) {
$name = $product->get_name();
$id = $product->get_id();
$options[ $id ] = array(
'id' => $id,
'label' => $name,
);
}
return $options;
}
}