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,81 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\Referral;
use TCB\ConditionalDisplay\Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class Category extends Field {
/**
* @return string
*/
public static function get_entity() {
return 'referral_data';
}
/**
* @return string
*/
public static function get_key() {
return 'referral_category_id';
}
public static function get_label() {
return esc_html__( 'Category', 'thrive-cb' );
}
public static function get_conditions() {
return [ 'autocomplete' ];
}
public function get_value( $referral_data ) {
$categories = [];
if ( ! empty( $referral_data['post'] ) ) {
foreach ( get_the_category( $referral_data['post'] ) as $category ) {
$categories[] = $category->term_id;
}
}
return $categories;
}
public static function get_options( $selected_values = [], $searched_keyword = '' ) {
$categories = [];
foreach ( get_categories() as $category ) {
if ( static::filter_options( $category->term_id, $category->name, $selected_values, $searched_keyword ) ) {
$categories[] = [
'value' => (string) $category->term_id,
'label' => $category->name,
];
}
}
return $categories;
}
/**
* @return string
*/
public static function get_placeholder_text() {
return esc_html__( 'Search categories', 'thrive-cb' );
}
/**
* Determines the display order in the modal field select
*
* @return int
*/
public static function get_display_order() {
return 20;
}
}

View File

@@ -0,0 +1,58 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\Referral;
use TCB\ConditionalDisplay\Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class Domain extends Field {
/**
* @return string
*/
public static function get_entity() {
return 'referral_data';
}
/**
* @return string
*/
public static function get_key() {
return 'referral_domain';
}
public static function get_label() {
return esc_html__( 'Domain', 'thrive-cb' );
}
public static function get_conditions() {
return [ 'string_contains' ];
}
public function get_value( $referral_data ) {
return empty( $referral_data['url'] ) ? '' : parse_url( $referral_data['url'], PHP_URL_HOST );
}
/**
* Determines the display order in the modal field select
*
* @return int
*/
public static function get_display_order() {
return 5;
}
/**
* @return string
*/
public static function get_placeholder_text() {
return esc_html__( 'Enter a domain URL', 'thrive-cb' );
}
}

View File

@@ -0,0 +1,49 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\Referral;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
if ( ! class_exists( 'Referral_Post', false ) ) {
require_once __DIR__ . '/class-post.php';
}
class Page extends Post {
/**
* @return string
*/
public static function get_key() {
return 'referral_page_id';
}
public static function get_label() {
return esc_html__( 'Page', 'thrive-cb' );
}
public static function get_post_type() {
return 'page';
}
/**
* @return string
*/
public static function get_placeholder_text() {
return esc_html__( 'Search pages', 'thrive-cb' );
}
/**
* Determines the display order in the modal field select
*
* @return int
*/
public static function get_display_order() {
return 15;
}
}

View File

@@ -0,0 +1,92 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\Referral;
use TCB\ConditionalDisplay\Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class Post extends Field {
/**
* @return string
*/
public static function get_entity() {
return 'referral_data';
}
/**
* @return string
*/
public static function get_key() {
return 'referral_post_id';
}
public static function get_label() {
return esc_html__( 'Post', 'thrive-cb' );
}
public static function get_conditions() {
return [ 'autocomplete' ];
}
public function get_value( $referral_data ) {
return empty( $referral_data['post'] ) ? '' : $referral_data['post']->ID;
}
public static function get_options( $selected_values = [], $searched_keyword = '' ) {
$query = [
'posts_per_page' => empty( $selected_values ) ? min( 100, max( 20, strlen( $searched_keyword ) * 3 ) ) : - 1,
'post_type' => static::get_post_type(),
'orderby' => 'title',
'order' => 'ASC',
];
if ( ! empty( $searched_keyword ) ) {
$query['s'] = $searched_keyword;
}
if ( ! empty( $selected_values ) ) {
$query['include'] = $selected_values;
}
$posts = [];
foreach ( get_posts( $query ) as $post ) {
if ( static::filter_options( $post->ID, $post->post_title, $selected_values, $searched_keyword ) ) {
$posts[] = [
'value' => (string) $post->ID,
'label' => $post->post_title,
];
}
}
return $posts;
}
public static function get_post_type() {
return 'post';
}
/**
* @return string
*/
public static function get_placeholder_text() {
return esc_html__( 'Search posts', 'thrive-cb' );
}
/**
* Determines the display order in the modal field select
*
* @return int
*/
public static function get_display_order() {
return 10;
}
}

View File

@@ -0,0 +1,85 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\Referral;
use TCB\ConditionalDisplay\Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class Tag extends Field {
/**
* @return string
*/
public static function get_entity() {
return 'referral_data';
}
/**
* @return string
*/
public static function get_key() {
return 'referral_tag_id';
}
public static function get_label() {
return esc_html__( 'Tag', 'thrive-cb' );
}
public static function get_conditions() {
return [ 'autocomplete' ];
}
public function get_value( $referral_data ) {
$tags = [];
if ( ! empty( $referral_data['post'] ) ) {
$post_tags = get_the_tags( $referral_data['post'] );
if ( ! empty( $post_tags ) ) {
foreach ( $post_tags as $tag ) {
$tags[] = $tag->term_id;
}
}
}
return $tags;
}
public static function get_options( $selected_values = [], $searched_keyword = '' ) {
$tags = [];
foreach ( get_tags() as $tag ) {
if ( static::filter_options( $tag->term_id, $tag->name, $selected_values, $searched_keyword ) ) {
$tags[] = [
'value' => (string) $tag->term_id,
'label' => $tag->name,
];
}
}
return $tags;
}
/**
* @return string
*/
public static function get_placeholder_text() {
return esc_html__( 'Search tags', 'thrive-cb' );
}
/**
* Determines the display order in the modal field select
*
* @return int
*/
public static function get_display_order() {
return 25;
}
}

View File

@@ -0,0 +1,58 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\Referral;
use TCB\ConditionalDisplay\Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class Url extends Field {
/**
* @return string
*/
public static function get_entity() {
return 'referral_data';
}
/**
* @return string
*/
public static function get_key() {
return 'referral_url';
}
public static function get_label() {
return esc_html__( 'URL', 'thrive-cb' );
}
public static function get_conditions() {
return [ 'url_comparison' ];
}
public function get_value( $referral_data ) {
return empty( $referral_data['url'] ) ? '' : $referral_data['url'];
}
/**
* Determines the display order in the modal field select
*
* @return int
*/
public static function get_display_order() {
return 0;
}
/**
* @return string
*/
public static function get_placeholder_text() {
return esc_html__( 'Enter a URL. Use an asterisk as a wildcard', 'thrive-cb' );
}
}

View File

@@ -0,0 +1,42 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\Request;
use TCB\ConditionalDisplay\Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class Cookie extends Field {
/**
* @return string
*/
public static function get_entity() {
return 'request_data';
}
/**
* @return string
*/
public static function get_key() {
return 'cookie';
}
public static function get_label() {
return esc_html__( 'Cookie', 'thrive-cb' );
}
public static function get_conditions() {
return [ 'string_comparison' ];
}
public function get_value( $request_data ) {
return $_COOKIE;
}
}

View File

@@ -0,0 +1,42 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\Request;
use TCB\ConditionalDisplay\Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class Post_Variable extends Field {
/**
* @return string
*/
public static function get_entity() {
return 'request_data';
}
/**
* @return string
*/
public static function get_key() {
return 'post_variable';
}
public static function get_label() {
return esc_html__( 'POST variable ', 'thrive-cb' );
}
public static function get_conditions() {
return [ 'string_comparison' ];
}
public function get_value( $request_data ) {
return wp_doing_ajax() && isset( $_GET['post_variables'] ) ? $_GET['post_variables'] : $_POST;
}
}

View File

@@ -0,0 +1,42 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\Request;
use TCB\ConditionalDisplay\Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class Url_Query_String extends Field {
/**
* @return string
*/
public static function get_entity() {
return 'request_data';
}
/**
* @return string
*/
public static function get_key() {
return 'url_query_string';
}
public static function get_label() {
return esc_html__( 'URL Query String', 'thrive-cb' );
}
public static function get_conditions() {
return [ 'string_comparison' ];
}
public function get_value( $request_data ) {
return wp_doing_ajax() && isset( $_GET['query_strings'] ) ? $_GET['query_strings'] : $_GET;
}
}

View File

@@ -0,0 +1,49 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\Time;
use TCB\ConditionalDisplay\Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class Current_Date extends Field {
/**
* @return string
*/
public static function get_entity() {
return 'time_data';
}
/**
* @return string
*/
public static function get_key() {
return 'current_date';
}
public static function get_label() {
return esc_html__( 'Date', 'thrive-cb' );
}
public static function get_conditions() {
return [ 'date' ];
}
public function get_value( $data ) {
return current_time( 'Y/m/d H:i' );
}
/**
* @return int
*/
public static function get_display_order() {
return 0;
}
}

View File

@@ -0,0 +1,49 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\Time;
use TCB\ConditionalDisplay\Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class Current_Time extends Field {
/**
* @return string
*/
public static function get_entity() {
return 'time_data';
}
/**
* @return string
*/
public static function get_key() {
return 'current_time';
}
public static function get_label() {
return esc_html__( 'Time', 'thrive-cb' );
}
public static function get_conditions() {
return [ 'time' ];
}
public function get_value( $data ) {
return current_time( 'H:i' );
}
/**
* @return int
*/
public static function get_display_order() {
return 5;
}
}

View File

@@ -0,0 +1,59 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\Time;
use TCB\ConditionalDisplay\Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class Day_Of_Month extends Field {
/**
* @return string
*/
public static function get_entity() {
return 'time_data';
}
/**
* @return string
*/
public static function get_key() {
return 'day_of_month';
}
public static function get_label() {
return esc_html__( 'Day of month', 'thrive-cb' );
}
public static function get_conditions() {
return [ 'number_equals' ];
}
public function get_value( $data ) {
return (int) date( 'd' );
}
/**
* @return array
*/
public static function get_validation_data() {
return [
'min' => 1,
'max' => 31,
];
}
/**
* @return int
*/
public static function get_display_order() {
return 15;
}
}

View File

@@ -0,0 +1,82 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\Time;
use TCB\ConditionalDisplay\Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class Day_Of_Week extends Field {
/**
* @return string
*/
public static function get_entity() {
return 'time_data';
}
/**
* @return string
*/
public static function get_key() {
return 'day_of_week';
}
public static function get_label() {
return esc_html__( 'Day of week', 'thrive-cb' );
}
public static function get_conditions() {
return [ 'checkbox' ];
}
public function get_value( $data ) {
return strtolower( date( 'l' ) );
}
public static function get_options( $selected_values = [], $search = '' ) {
return [
[
'value' => 'monday',
'label' => __( 'Monday' ),
],
[
'value' => 'tuesday',
'label' => __( 'Tuesday' ),
],
[
'value' => 'wednesday',
'label' => __( 'Wednesday' ),
],
[
'value' => 'thursday',
'label' => __( 'Thursday' ),
],
[
'value' => 'friday',
'label' => __( 'Friday' ),
],
[
'value' => 'saturday',
'label' => __( 'Saturday' ),
],
[
'value' => 'sunday',
'label' => __( 'Sunday' ),
],
];
}
/**
* @return int
*/
public static function get_display_order() {
return 10;
}
}

View File

@@ -0,0 +1,102 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\Time;
use TCB\ConditionalDisplay\Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class Month extends Field {
/**
* @return string
*/
public static function get_entity() {
return 'time_data';
}
/**
* @return string
*/
public static function get_key() {
return 'month';
}
public static function get_label() {
return esc_html__( 'Month', 'thrive-cb' );
}
public static function get_conditions() {
return [ 'checkbox' ];
}
public function get_value( $data ) {
return (int) date( 'n' );
}
public static function get_options( $selected_values = [], $search = '' ) {
return [
[
'value' => '1',
'label' => __( 'January' ),
],
[
'value' => '2',
'label' => __( 'February' ),
],
[
'value' => '3',
'label' => __( 'March' ),
],
[
'value' => '4',
'label' => __( 'April' ),
],
[
'value' => '5',
'label' => __( 'May' ),
],
[
'value' => '6',
'label' => __( 'June' ),
],
[
'value' => '7',
'label' => __( 'July' ),
],
[
'value' => '8',
'label' => __( 'August' ),
],
[
'value' => '9',
'label' => __( 'September' ),
],
[
'value' => '10',
'label' => __( 'October' ),
],
[
'value' => '11',
'label' => __( 'November' ),
],
[
'value' => '12',
'label' => __( 'December' ),
],
];
}
/**
* @return int
*/
public static function get_display_order() {
return 20;
}
}

View File

@@ -0,0 +1,61 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\User;
use TCB\ConditionalDisplay\Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class Last_Logged_In extends Field {
/**
* @return string
*/
public static function get_entity() {
return 'user_data';
}
/**
* @return string
*/
public static function get_key() {
return 'last_logged_in';
}
public static function get_label() {
return esc_html__( 'Last logged in', 'thrive-cb' );
}
public static function get_conditions() {
return [ 'date_and_time_with_intervals' ];
}
public function get_value( $user_data ) {
$last_logged_in = '';
if ( $user_data ) {
$user_meta = get_user_meta( $user_data->ID );
if ( isset( $user_meta['tve_last_login'] ) && is_array( $user_meta['tve_last_login'] ) ) {
$last_logged_in = date( 'Y-m-d H:i:s', (int) $user_meta['tve_last_login'][0] );
}
}
return $last_logged_in;
}
/**
* Determines the display order in the modal field select
*
* @return int
*/
public static function get_display_order() {
return 10;
}
}

View File

@@ -0,0 +1,67 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\User;
use TCB\ConditionalDisplay\Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class Number_Of_Comments extends Field {
/**
* @return string
*/
public static function get_entity() {
return 'user_data';
}
/**
* @return string
*/
public static function get_key() {
return 'number_of_comments';
}
public static function get_label() {
return esc_html__( 'Number of comments', 'thrive-cb' );
}
public static function get_conditions() {
return [ 'number_comparison' ];
}
public function get_value( $user_data ) {
$comments_count = 0;
if ( ! empty( $user_data ) ) {
$args = [
'author_email' => $user_data->user_email,
'no_found_rows' => false,
'number' => 10,
'status' => 'all,spam,trash',
];
$query = new \WP_Comment_Query;
$query->query( $args );
$comments_count = (int) $query->found_comments;
}
return $comments_count;
}
/**
* Determines the display order in the modal field select
*
* @return int
*/
public static function get_display_order() {
return 25;
}
}

View File

@@ -0,0 +1,73 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\User;
use TCB\ConditionalDisplay\Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class User_Id extends Field {
/**
* @return string
*/
public static function get_entity() {
return 'user_data';
}
/**
* @return string
*/
public static function get_key() {
return 'user_id';
}
public static function get_label() {
return esc_html__( 'Username', 'thrive-cb' );
}
public static function get_conditions() {
return [ 'autocomplete' ];
}
public function get_value( $user_data ) {
return empty( $user_data ) ? '' : $user_data->ID;
}
public static function get_options( $selected_values = [], $searched_keyword = '' ) {
$users = [];
foreach ( get_users() as $user ) {
if ( static::filter_options( $user->ID, $user->data->user_login, $selected_values, $searched_keyword ) ) {
$users[] = [
'value' => (string) $user->ID,
'label' => $user->data->user_login,
];
}
}
return $users;
}
/**
* @return string
*/
public static function get_placeholder_text() {
return esc_html__( 'Search users', 'thrive-cb' );
}
/**
* Determines the display order in the modal field select
*
* @return int
*/
public static function get_display_order() {
return 20;
}
}

View File

@@ -0,0 +1,55 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\User;
use TCB\ConditionalDisplay\Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class User_Is_Logged_In extends Field {
/**
* @return string
*/
public static function get_entity() {
return 'user_data';
}
/**
* @return string
*/
public static function get_key() {
return 'is_logged_in';
}
public static function get_label() {
return esc_html__( 'Is logged in', 'thrive-cb' );
}
public static function get_conditions() {
return [];
}
public function get_value( $user_data ) {
return ! empty( $user_data );
}
public static function is_boolean() {
return true;
}
/**
* Determines the display order in the modal field select
*
* @return int
*/
public static function get_display_order() {
return 0;
}
}

View File

@@ -0,0 +1,45 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\User;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class User_Is_Not_Logged_In extends User_Is_Logged_In {
/**
* @return string
*/
public static function get_entity() {
return 'user_data';
}
/**
* @return string
*/
public static function get_key() {
return 'is_not_logged_in';
}
public static function get_label() {
return esc_html__( 'Is not logged in', 'thrive-cb' );
}
public function get_value( $user_data ) {
return empty( $user_data );
}
/**
* Determines the display order in the modal field select
*
* @return int
*/
public static function get_display_order() {
return 1;
}
}

View File

@@ -0,0 +1,51 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\User;
use TCB\ConditionalDisplay\Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class User_Registration_Date extends Field {
/**
* @return string
*/
public static function get_entity() {
return 'user_data';
}
/**
* @return string
*/
public static function get_key() {
return 'user_registration_date';
}
public static function get_label() {
return esc_html__( 'Registration date', 'thrive-cb' );
}
public static function get_conditions() {
return [ 'date_and_time_with_intervals' ];
}
public function get_value( $user_data ) {
return empty( $user_data ) ? '' : $user_data->user_registered;
}
/**
* Determines the display order in the modal field select
*
* @return int
*/
public static function get_display_order() {
return 15;
}
}

View File

@@ -0,0 +1,67 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\User;
use TCB\ConditionalDisplay\Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class User_Role extends Field {
/**
* @return string
*/
public static function get_entity() {
return 'user_data';
}
/**
* @return string
*/
public static function get_key() {
return 'user_role';
}
public static function get_label() {
return esc_html__( 'Role', 'thrive-cb' );
}
public static function get_conditions() {
return [ 'checkbox' ];
}
public function get_value( $user_data ) {
return empty( $user_data ) ? '' : $user_data->roles;
}
public static function get_options( $selected_values = [], $search = '' ) {
$roles = [];
if ( ! function_exists( 'get_editable_roles' ) ) {
require_once ABSPATH . '/wp-admin/includes/user.php';
}
foreach ( get_editable_roles() as $key => $role ) {
$roles[ $key ] = [
'label' => $role['name'],
'value' => $key,
];
}
return $roles;
}
/**
* Determines the display order in the modal field select
*
* @return int
*/
public static function get_display_order() {
return 5;
}
}