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,82 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-dashboard
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
abstract class TD_NM_Trigger_Abstract {
protected $settings;
protected $_types;
public function __construct( $settings ) {
$this->settings = $settings;
}
/**
* Check if item exists in list
*
* @param $list
* @param $id
*
* @return bool
*/
protected function in_list( $list, $id ) {
foreach ( $list as $key => $item ) {
if ( $item['value'] == $id ) {
return true;
}
}
return false;
}
public function get_types() {
if ( ! $this->_types ) {
$types = TD_NM()->get_trigger_types();
foreach ( $types as $type ) {
$this->_types[] = $type['key'];
}
}
return $this->_types;
}
/**
* Check if this trigger is applicable based on its type
* and if the corresponding plugin is loaded
* and if corresponding data is set
*
* @see td_nm_get_notifications()
*
* @return bool
*/
public function is_notification_applicable() {
$types = $this->get_types();
$applicable = false;
if ( is_array( $types ) && in_array( $this->settings['type'], $types ) ) {
$applicable = true;
}
return $applicable;
}
/**
* Check if settings are applicable for that item
*
* @param mixed $item
*
* @return mixed
*/
abstract public function applicable_on_data( $item );
}

View File

@@ -0,0 +1,30 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-dashboard
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
class TD_NM_Trigger_Email_Sign_Up extends TD_NM_Trigger_Abstract {
public function applicable_on_data( $tl_item ) {
if ( $this->in_list( $this->settings['groups'], $tl_item->ID ) ) {
return true;
}
if ( $this->in_list( $this->settings['shortcodes'], $tl_item->ID ) ) {
return true;
}
if ( $this->in_list( $this->settings['thrive_boxes'], $tl_item->ID ) ) {
return true;
}
return false;
}
}

View File

@@ -0,0 +1,40 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-dashboard
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
class TD_NM_Trigger_Factory {
/**
* @param array $trigger
*
* @return TD_NM_Trigger_Abstract
*/
public static function get_instance( $trigger ) {
if ( is_array( $trigger ) && ! empty( $trigger['type'] ) ) {
$class_name = 'TD_NM_Trigger_' . self::prepare_class_name( $trigger['type'] );
}
return isset( $class_name ) && class_exists( $class_name, false ) ? new $class_name( $trigger ) : null;
}
/**
* @param string $type
*
* @return string
*/
private static function prepare_class_name( $type ) {
$chunks = explode( '_', $type );
$chunks = array_map( 'ucfirst', $chunks );
return implode( '_', $chunks );
}
}

View File

@@ -0,0 +1,18 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-dashboard
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
class TD_NM_Trigger_Quiz_Completion extends TD_NM_Trigger_Abstract {
public function applicable_on_data( $quiz ) {
return $this->in_list( $this->settings, $quiz->ID );
}
}

View File

@@ -0,0 +1,71 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-dashboard
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
class TD_NM_Trigger_Split_Test_Ends extends TD_NM_Trigger_Abstract {
public function applicable_on_data( $test_item ) {
$applicable = false;
if ( ! empty( $this->settings['tho'] ) && $this->in_list( $this->settings['tho'], $test_item->id ) ) {
$applicable = true;
} else if ( ! empty( $this->settings['tqb'] ) && $this->in_list( $this->settings['tqb'], $test_item->id ) ) {
$applicable = true;
} else if ( ! empty( $this->settings['tl'] ) && $this->in_list( $this->settings['tl'], $test_item->id ) ) {
$applicable = true;
} else if ( ! empty( $this->settings['tab'] ) && $this->in_list( $this->settings['tab'], $test_item->id ) ) {
$applicable = true;
}
return $applicable;
}
/**
* split_test_ends trigger can be initiated by more plugins (TL, TQB, THO)
* and we need to check if the trigger is applicable for any of the plugin
*
* @return bool
*/
public function is_notification_applicable() {
$applicable = parent::is_notification_applicable();
return $applicable && ( $this->_is_tl_applicable() || $this->_is_tho_applicable() || $this->_is_tqb_applicable() || $this->_is_tab_applicable() );
}
protected function _is_tl_applicable() {
$plugin_active = tve_dash_is_plugin_active( 'thrive-leads' );
return $plugin_active && ! empty( $this->settings['settings']['tl'] );
}
protected function _is_tho_applicable() {
$plugin_active = tve_dash_is_plugin_active( 'thrive-headline-optimizer' );
return $plugin_active && ! empty( $this->settings['settings']['tho'] );
}
protected function _is_tqb_applicable() {
$plugin_active = tve_dash_is_plugin_active( 'thrive-quiz-builder' );
return $plugin_active && ! empty( $this->settings['settings']['tqb'] );
}
protected function _is_tab_applicable() {
$plugin_active = tve_dash_is_plugin_active( 'thrive-ab-page-testing' );
return $plugin_active && ! empty( $this->settings['settings']['tab'] );
}
}

View File

@@ -0,0 +1,23 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-dashboard
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
class TD_NM_Trigger_Testimonial_Submitted extends TD_NM_Trigger_Abstract {
public function applicable_on_data( $testimonial ) {
if ( defined( 'TVO_SOURCE_DIRECT_CAPTURE' ) && ! empty( $testimonial['source'] ) && TVO_SOURCE_DIRECT_CAPTURE == $testimonial['source'] ) {
return true;
}
return false;
}
}