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
abstract class BWFAN_DB_Tables_Base {
public $table_name = '';
public $db_errors = '';
public $max_index_length = 191;
public $collation = null;
/**
* Checking table exists or not
*
* @return bool
*/
public function is_exists() {
global $wpdb;
return ! empty( $wpdb->query( "SHOW TABLES LIKE '{$wpdb->prefix}$this->table_name'" ) ); //phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
}
/**
* Check missing columns and return missing ones only
*
* @return array
*/
public function check_missing_columns() {
global $wpdb;
/** Get defined columns */
$columns = $this->get_columns();
/** Get columns from db */
$db_columns = $wpdb->get_results( "DESCRIBE {$wpdb->prefix}$this->table_name", ARRAY_A ); //phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
$result = array_diff( $columns, array_column( $db_columns, 'Field' ) );
sort( $result );
return $result;
}
public function get_columns() {
return [];
}
/**
* Create table
*
* @return void
*/
public function create_table() {
global $wpdb;
$sql = $this->get_create_table_query();
if ( empty( $sql ) ) {
return;
}
dbDelta( $sql );
if ( ! empty( $wpdb->last_error ) ) {
$this->db_errors = $this->table_name . ' create table method triggered an error - ' . $wpdb->last_error;
}
}
public function get_create_table_query() {
return '';
}
public function get_collation() {
if ( ! is_null( $this->collation ) ) {
return $this->collation;
}
global $wpdb;
$collate = '';
if ( $wpdb->has_cap( 'collation' ) ) {
$collate = $wpdb->get_charset_collate();
}
$this->collation = $collate;
return $collate;
}
}

View File

@@ -0,0 +1,74 @@
<?php
class BWFAN_DB_Table_AbandonedCarts extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_abandonedcarts';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"email",
"status",
"user_id",
"last_modified",
"created_time",
"items",
"coupons",
"fees",
"shipping_tax_total",
"shipping_total",
"total",
"total_base",
"token",
"currency",
"cookie_key",
"checkout_data",
"order_id",
"checkout_page_id",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`email` varchar(100) NOT NULL,
`status` int(1) NOT NULL default 0,
`user_id` bigint(20) NOT NULL default 0,
`last_modified` datetime NOT NULL,
`created_time` datetime NOT NULL,
`items` longtext,
`coupons` longtext,
`fees` longtext,
`shipping_tax_total` varchar(32),
`shipping_total` varchar(32),
`total` varchar(32),
`total_base` varchar(32),
`token` varchar(32) NOT NULL,
`currency` varchar(8) NOT NULL,
`cookie_key` varchar(32) NOT NULL,
`checkout_data` longtext,
`order_id` bigint(20) NOT NULL,
`checkout_page_id` bigint(20) NOT NULL,
PRIMARY KEY (`ID`),
KEY `ID` (`ID`),
KEY `status` (`status`),
KEY `user_id` (`user_id`),
KEY `email` (`email`),
KEY `last_modified` (`last_modified`),
KEY `token` (`token`),
KEY `cookie_key` (`cookie_key`)
) $collate;";
}
}

View File

@@ -0,0 +1,50 @@
<?php
class BWFAN_DB_Table_Automation_Complete_Contact extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_automation_complete_contact';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"cid",
"aid",
"event",
"s_date",
"c_date",
"data",
"trail",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`cid` bigint(20) unsigned NOT NULL,
`aid` bigint(10) unsigned NOT NULL,
`event` varchar(120) NOT NULL,
`s_date` datetime NOT NULL default '0000-00-00 00:00:00' COMMENT 'Start Date',
`c_date` datetime NOT NULL default '0000-00-00 00:00:00' COMMENT 'Completion Date',
`data` longtext,
`trail` varchar(40) NULL COMMENT 'Trail ID',
PRIMARY KEY (`ID`),
KEY `ID` (`ID`),
KEY `cid` (`cid`),
KEY `aid` (`aid`),
KEY `c_date` (`c_date`),
UNIQUE KEY `trail` (`trail`)
) $collate;";
}
}

View File

@@ -0,0 +1,33 @@
<?php
class BWFAN_DB_Table_Automation_Contact_Claim extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_automation_contact_claim';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"created_at",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` bigint(20) UNSIGNED NOT NULL auto_increment,
`created_at` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`ID`)
) $collate;";
}
}

View File

@@ -0,0 +1,50 @@
<?php
class BWFAN_DB_Table_Automation_Contact_Trail extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_automation_contact_trail';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"tid",
"cid",
"aid",
"sid",
"c_time",
"status",
"data",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` bigint(20) UNSIGNED NOT NULL auto_increment,
`tid` varchar(40) NOT NULL COMMENT 'Trail ID',
`cid` bigint(12) UNSIGNED NOT NULL COMMENT 'Contact ID',
`aid` bigint(10) UNSIGNED NOT NULL COMMENT 'Automation ID',
`sid` bigint(10) UNSIGNED NOT NULL COMMENT 'Step ID',
`c_time` bigint(12) UNSIGNED NOT NULL,
`status` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '1 - Success | 2 - Wait | 3 - Failed | 4 - Skipped',
`data` varchar(255) NULL,
PRIMARY KEY (`ID`),
KEY `ID` (`ID`),
KEY `tid` (`tid`(40)),
KEY `cid` (`cid`),
KEY `sid` (`sid`),
KEY `status` (`status`)
) $collate;";
}
}

View File

@@ -0,0 +1,62 @@
<?php
class BWFAN_DB_Table_Automation_Contact extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_automation_contact';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"cid",
"aid",
"event",
"c_date",
"e_time",
"status",
"last",
"last_time",
"data",
"claim_id",
"attempts",
"trail",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`cid` bigint(20) unsigned NOT NULL,
`aid` bigint(10) unsigned NOT NULL,
`event` varchar(120) NOT NULL,
`c_date` datetime NOT NULL default '0000-00-00 00:00:00' COMMENT 'Start Date',
`e_time` bigint(12) unsigned NOT NULL,
`status` tinyint(1) UNSIGNED NOT NULL default 1 COMMENT '1 - Active | 2 - Failed | 3 - Paused | 4 - Waiting | 5 - Terminate | 6 - Retry',
`last` bigint(10) UNSIGNED NOT NULL default 0,
`last_time` bigint(12) UNSIGNED NOT NULL,
`data` longtext,
`claim_id` bigint(20) UNSIGNED NOT NULL default 0,
`attempts` tinyint(1) UNSIGNED NOT NULL default 0,
`trail` varchar(40) NULL COMMENT 'Trail ID',
PRIMARY KEY (`ID`),
KEY `ID` (`ID`),
KEY `cid` (`cid`),
KEY `aid` (`aid`),
KEY `e_time` (`e_time`),
KEY `status` (`status`),
KEY `claim_id` (`claim_id`),
UNIQUE KEY `trail` (`trail`)
) $collate;";
}
}

View File

@@ -0,0 +1,39 @@
<?php
class BWFAN_DB_Table_Automation_Events extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_automation_events';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"creation_time",
"execution_time",
"args",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`creation_time` datetime NOT NULL,
`execution_time` bigint(12) unsigned NOT NULL,
`args` longtext,
PRIMARY KEY (`ID`),
KEY `ID` (`ID`),
KEY `execution_time` (`execution_time`)
) $collate;";
}
}

View File

@@ -0,0 +1,47 @@
<?php
class BWFAN_DB_Table_Automation_Step extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_automation_step';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"aid",
"type",
"action",
"status",
"data",
"created_at",
"updated_at",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` bigint(10) UNSIGNED NOT NULL auto_increment,
`aid` bigint(10) UNSIGNED NOT NULL ,
`type` tinyint(1) UNSIGNED NOT NULL default 1 COMMENT '1 - Wait | 2 - Action | 3 - Goal | 4 - Conditional | 5 - Exit',
`action` varchar(255) NULL,
`status` tinyint(1) NOT NULL default 0 COMMENT '1 - Active | 2 - Draft | 3 - Deleted',
`data` longtext,
`created_at` datetime NOT NULL default '0000-00-00 00:00:00',
`updated_at` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`ID`),
KEY `aid` (`aid`),
KEY `type` (`type`)
) $collate;";
}
}

View File

@@ -0,0 +1,39 @@
<?php
class BWFAN_DB_Table_Automationmeta extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_automationmeta';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"bwfan_automation_id",
"meta_key",
"meta_value",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`bwfan_automation_id` bigint(20) unsigned NOT NULL default '0',
`meta_key` varchar(255) NULL,
`meta_value` longtext,
PRIMARY KEY (`ID`),
KEY `bwfan_automation_id` (`bwfan_automation_id`),
KEY `meta_key` (`meta_key`($this->max_index_length))
) $collate;";
}
}

View File

@@ -0,0 +1,49 @@
<?php
class BWFAN_DB_Table_Automations extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_automations';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"source",
"event",
"status",
"priority",
"start",
"v",
"benchmark",
"title",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`source` varchar(60) NOT NULL,
`event` varchar(60) NOT NULL,
`status` tinyint(1) NOT NULL default 0 COMMENT '1 - Active 2 - Inactive',
`priority` tinyint(3) NOT NULL default 0,
`start` bigint(10) UNSIGNED NOT NULL,
`v` tinyint(1) UNSIGNED NOT NULL default 1,
`benchmark` longtext,
`title` varchar(255) NULL,
PRIMARY KEY (`ID`),
KEY `ID` (`ID`),
KEY `status` (`status`)
) $collate;";
}
}

View File

@@ -0,0 +1,39 @@
<?php
class BWFAN_DB_Table_Contact_Automations extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_contact_automations';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"contact_id",
"automation_id",
"time",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`contact_id` bigint(20) NOT NULL,
`automation_id` bigint(20) NOT NULL,
`time` bigint(12) NOT NULL,
PRIMARY KEY (`ID`),
KEY `contact_id` (`contact_id`),
KEY `automation_id` (`automation_id`)
) $collate;";
}
}

View File

@@ -0,0 +1,41 @@
<?php
/**
* bwf_contact_fields table class
*
*/
if ( ! class_exists( 'BWFAN_DB_Table_Contact_Fields' ) && BWFAN_Common::is_pro_3_0() ) {
class BWFAN_DB_Table_Contact_Fields extends BWFAN_DB_Tables_Base {
public $table_name = 'bwf_contact_fields';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"cid",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`cid` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`ID`),
UNIQUE KEY `cid` (`cid`)
) $collate;";
}
}
}

View File

@@ -0,0 +1,58 @@
<?php
/**
* bwfan_contact_note table class
*
*/
if ( ! class_exists( 'BWFAN_DB_Table_Contact_Note' ) && BWFAN_Common::is_pro_3_0() ) {
class BWFAN_DB_Table_Contact_Note extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_contact_note';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"id",
"cid",
"type",
"created_by",
"created_date",
"private",
"title",
"body",
"modified_by",
"modified_date",
"date_time",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`id` bigint(20) unsigned NOT NULL auto_increment,
`cid` bigint(20) unsigned NOT NULL,
`type` varchar(255) NOT NULL,
`created_by` bigint(20),
`created_date` datetime,
`private` tinyint(1) unsigned not null default 0,
`title` varchar(255),
`body` longtext,
`modified_by` bigint(20) default null,
`modified_date` datetime default null,
`date_time` datetime default null,
PRIMARY KEY (`id`),
KEY `cid` (`cid`)
) $collate;";
}
}
}

View File

@@ -0,0 +1,57 @@
<?php
/**
* bwfan_conversions table class
*
*/
if ( ! class_exists( 'BWFAN_DB_Table_Conversions' ) && BWFAN_Common::is_pro_3_0() ) {
class BWFAN_DB_Table_Conversions extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_conversions';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"wcid",
"cid",
"trackid",
"oid",
"otype",
"wctotal",
"date",
];
}
/**
* Get a query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`wcid` bigint(20) unsigned NOT NULL,
`cid` bigint(20) unsigned NOT NULL,
`trackid` bigint(20) unsigned NOT NULL,
`oid` bigint(20) unsigned NOT NULL,
`otype` tinyint(2) unsigned not null COMMENT '1 - Automation 2 - Campaign 3 - Note 4 - Email 5 - SMS',
`wctotal` varchar(32),
`date` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`ID`),
KEY `cid` (`cid`),
KEY `oid` (`oid`),
KEY `trackid` (`trackid`),
KEY `otype` (`otype`),
KEY `date` (`date`)
) $collate;";
}
}
}

View File

@@ -0,0 +1,91 @@
<?php
/**
* bwfan_engagement_tracking table class
*
*/
if ( ! class_exists( 'BWFAN_DB_Table_Engagement_Tracking' ) && BWFAN_Common::is_pro_3_0() ) {
class BWFAN_DB_Table_Engagement_Tracking extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_engagement_tracking';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"cid",
"hash_code",
"created_at",
"updated_at",
"mode",
"send_to",
"type",
"open",
"click",
"oid",
"sid",
"author_id",
"tid",
"o_interaction",
"f_open",
"c_interaction",
"f_click",
"c_status",
"day",
"hour",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`cid` bigint(20) unsigned NOT NULL default 0,
`hash_code` varchar(60) NOT NULL,
`created_at` datetime NOT NULL default '0000-00-00 00:00:00',
`updated_at` datetime default NULL,
`mode` tinyint(1) unsigned not null default 1 COMMENT '1 - Email 2 - SMS',
`send_to` varchar(255) NOT NULL,
`type` tinyint(2) unsigned not null default 1 COMMENT '1 - Automation 2 - Broadcast 3 - Note 4 - Email 5 - SMS',
`open` smallint(3) unsigned NOT NULL default 0,
`click` smallint(3) unsigned NOT NULL default 0,
`oid` bigint(20) unsigned NOT NULL,
`sid` bigint(20) unsigned NOT NULL default 0 COMMENT 'Step ID',
`author_id` bigint(10) unsigned NOT NULL default 1,
`tid` int(20) unsigned NOT NULL default 0 COMMENT 'Template ID',
`o_interaction` varchar(255),
`f_open` datetime default NULL,
`c_interaction` varchar(255),
`f_click` datetime default NULL,
`c_status` tinyint(2) unsigned default 1 COMMENT '1 - Draft 2 - Send 3 - Error 4 - Bounced',
`day` tinyint(1) unsigned default NUll,
`hour` tinyint(2) unsigned default NUll,
PRIMARY KEY (`ID`),
KEY `cid` (`cid`),
KEY `created_at` (`created_at`),
KEY `mode` (`mode`),
KEY `type` (`type`),
KEY `oid` (`oid`),
KEY `sid` (`sid`),
KEY `tid` (`tid`),
KEY `f_open` (`f_open`),
KEY `f_click` (`f_click`),
KEY `day` (`day`),
KEY `hour` (`hour`),
KEY `c_status` (`c_status`),
UNIQUE KEY `hash_code` (`hash_code`)
) $collate;";
}
}
}

View File

@@ -0,0 +1,45 @@
<?php
/**
* bwfan_engagement_trackingmeta table class
*
*/
if ( ! class_exists( 'BWFAN_DB_Table_Engagement_Trackingmeta' ) && BWFAN_Common::is_pro_3_0() ) {
class BWFAN_DB_Table_Engagement_Trackingmeta extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_engagement_trackingmeta';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"eid",
"meta_key",
"meta_value",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`eid` bigint(20) unsigned NOT NULL,
`meta_key` varchar(255) default NULL,
`meta_value` longtext,
PRIMARY KEY (`ID`),
KEY `eid` (`eid`)
) $collate;";
}
}
}

View File

@@ -0,0 +1,41 @@
<?php
/**
* bwfan_field_groups table class
*
*/
if ( ! class_exists( 'BWFAN_DB_Table_Field_Groups' ) && BWFAN_Common::is_pro_3_0() ) {
class BWFAN_DB_Table_Field_Groups extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_field_groups';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"name",
"created_at",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`name` varchar(255) NOT NULL,
`created_at` datetime,
PRIMARY KEY (`ID`)
) $collate;";
}
}
}

View File

@@ -0,0 +1,65 @@
<?php
/**
* bwfan_fields table class
*
*/
if ( ! class_exists( 'BWFAN_DB_Table_Fields' ) && BWFAN_Common::is_pro_3_0() ) {
class BWFAN_DB_Table_Fields extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_fields';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"name",
"slug",
"type",
"gid",
"meta",
"mode",
"vmode",
"search",
"view",
"created_at",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`name` varchar(255) NOT NULL,
`slug` varchar(255) NOT NULL,
`type` tinyint(2) unsigned NOT NULL,
`gid` bigint(20) unsigned NOT NULL,
`meta` text NOT NULL,
`mode` tinyint(2) unsigned NOT NULL default 1 COMMENT '1 - Editable 2 - Non-editable',
`vmode` tinyint(2) unsigned NOT NULL default 1 COMMENT '1 - Editable 2 - Non-editable',
`search` tinyint(1) unsigned NOT NULL default 2 COMMENT '1 - Searchable 2 - Non-searchable',
`view` tinyint(1) unsigned NOT NULL default 1 COMMENT '1 - Viwable 2 - Non-Viwable',
`created_at` datetime,
PRIMARY KEY (`ID`),
KEY `slug` (`slug`($this->max_index_length)),
KEY `gid` (`gid`),
KEY `mode` (`mode`),
KEY `vmode` (`vmode`),
KEY `search` (`search`),
KEY `view` (`view`)
) $collate;";
}
}
}

View File

@@ -0,0 +1,50 @@
<?php
/**
* bwfan_link_metrics table class
*
*/
if ( ! class_exists( 'BWFAN_DB_Table_Link_Metrics' ) ) {
class BWFAN_DB_Table_Link_Metrics extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_link_metrics';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"link_id",
"contact_id",
"ip_address",
"count",
"created_at",
"updated_at"
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`link_id` int(12) unsigned NOT NULL default 0,
`contact_id` bigint(20) unsigned NOT NULL default 0,
`ip_address` varchar(45) NULL,
`count` int(7) unsigned NOT NULL,
`created_at` datetime NOT NULL,
PRIMARY KEY (`ID`),
KEY `link_id` (`link_id`),
KEY `contact_id` (`contact_id`)
) $collate;";
}
}
}

View File

@@ -0,0 +1,59 @@
<?php
/**
* bwfan_links table class
*
*/
if ( ! class_exists( 'BWFAN_DB_Table_Links' ) ) {
class BWFAN_DB_Table_Links extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_links';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"url",
"l_hash",
"created_at",
"clean_url",
"oid",
"sid",
"tid",
"type"
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` int(12) unsigned NOT NULL auto_increment,
`url` text NOT NULL,
`l_hash` varchar(40) NOT NULL,
`clean_url` varchar(190) NOT NULL,
`created_at` datetime NOT NULL,
`oid` bigint(20) UNSIGNED NOT NULL default 0 COMMENT 'Object ID',
`sid` int(12) UNSIGNED NOT NULL default 0 COMMENT 'Step ID',
`tid` int(12) UNSIGNED NOT NULL default 0 COMMENT 'Template ID',
`type` tinyint(1) UNSIGNED NOT NULL default 1 COMMENT '1 - Automation | 2 - Broadcast | 3 - Note | 4 - Email | 5 - SMS | 6 - Form | 9 - Transactional',
PRIMARY KEY (`ID`),
UNIQUE KEY `l_hash` (`l_hash`),
KEY `clean_url` (`clean_url`),
KEY `oid` (`oid`),
KEY `sid` (`sid`),
KEY `tid` (`tid`),
KEY `type` (`type`)
) $collate;";
}
}
}

View File

@@ -0,0 +1,39 @@
<?php
class BWFAN_DB_Table_Logmeta extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_logmeta';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"bwfan_log_id",
"meta_key",
"meta_value",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`bwfan_log_id` bigint(20) unsigned NOT NULL default '0',
`meta_key` varchar(255) default NULL,
`meta_value` longtext,
PRIMARY KEY (`ID`),
KEY `bwfan_log_id` (`bwfan_log_id`),
KEY `meta_key` (`meta_key`($this->max_index_length))
) $collate;";
}
}

View File

@@ -0,0 +1,46 @@
<?php
class BWFAN_DB_Table_Logs extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_logs';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"c_date",
"e_date",
"status",
"integration_slug",
"integration_action",
"automation_id",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`c_date` datetime NOT NULL default '0000-00-00 00:00:00',
`e_date` bigint(12) NOT NULL,
`status` int(1) NOT NULL default 0 COMMENT '0 - Failed 1 - Success',
`integration_slug` varchar(50) default NULL,
`integration_action` varchar(100) default NULL,
`automation_id` int(10) NOT NULL,
PRIMARY KEY (`ID`),
KEY `ID` (`ID`),
KEY `status` (`status`),
KEY `automation_id` (`automation_id`)
) $collate;";
}
}

View File

@@ -0,0 +1,50 @@
<?php
class BWFAN_DB_Table_Message_Unsubscribe extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_message_unsubscribe';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"recipient",
"mode",
"c_date",
"automation_id",
"c_type",
"sid",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`recipient` varchar(255) default NULL,
`mode` tinyint(1) NOT NULL COMMENT '1 - Email 2 - SMS' default 1,
`c_date` datetime NOT NULL default '0000-00-00 00:00:00',
`automation_id` bigint(20) unsigned default '0',
`c_type` tinyint(1) NOT NULL default '1' COMMENT '1 - Automation 2 - Broadcast 3 - Manual 4 - Form',
`sid` bigint(20) unsigned NOT NULL default 0 COMMENT 'Step ID',
PRIMARY KEY (`ID`),
KEY `ID` (`ID`),
KEY `recipient` (`recipient`($this->max_index_length)),
KEY `mode` (`mode`),
KEY `c_date` (`c_date`),
KEY `automation_id` (`automation_id`),
KEY `c_type` (`c_type`),
KEY `sid` (`sid`)
) $collate;";
}
}

View File

@@ -0,0 +1,48 @@
<?php
/**
* bwfan_message table class
*
*/
if ( ! class_exists( 'BWFAN_DB_Table_Message' ) && BWFAN_Common::is_pro_3_0() ) {
class BWFAN_DB_Table_Message extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_message';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"track_id",
"sub",
"body",
"date",
"data",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`track_id` bigint(20) unsigned NOT NULL,
`sub` varchar(255) NOT NULL,
`body` longtext,
`date` datetime DEFAULT NULL,
`data` longtext,
PRIMARY KEY (`ID`),
KEY `track_id` (`track_id`)
) $collate;";
}
}
}

View File

@@ -0,0 +1,37 @@
<?php
class BWFAN_DB_Table_Options extends BWFAN_DB_Tables_Base {
public $table_name = 'bwf_options';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"id",
"key",
"value",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`id` bigint(10) unsigned NOT NULL auto_increment,
`key` varchar(150) default NULL,
`value` longtext,
PRIMARY KEY (`id`),
KEY `id` (`id`),
KEY `key` (`key`)
) $collate;";
}
}

View File

@@ -0,0 +1,34 @@
<?php
class BWFAN_DB_Table_Task_Claim extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_task_claim';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"claim_id",
"date_created_gmt",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`claim_id` bigint(20) unsigned NOT NULL auto_increment,
`date_created_gmt` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`claim_id`),
KEY `date_created_gmt` (`date_created_gmt`)
) $collate;";
}
}

View File

@@ -0,0 +1,39 @@
<?php
class BWFAN_DB_Table_Taskmeta extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_taskmeta';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"bwfan_task_id",
"meta_key",
"meta_value",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`bwfan_task_id` bigint(20) unsigned NOT NULL default '0',
`meta_key` varchar(255) NULL,
`meta_value` longtext,
PRIMARY KEY (`ID`),
KEY `bwfan_task_id` (`bwfan_task_id`),
KEY `meta_key` (`meta_key`($this->max_index_length))
) $collate;";
}
}

View File

@@ -0,0 +1,54 @@
<?php
class BWFAN_DB_Table_Tasks extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_tasks';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"c_date",
"e_date",
"automation_id",
"integration_slug",
"integration_action",
"status",
"claim_id",
"attempts",
"priority",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`c_date` datetime NOT NULL default '0000-00-00 00:00:00',
`e_date` bigint(12) NOT NULL,
`automation_id` int(10) NOT NULL,
`integration_slug` varchar(50) NULL,
`integration_action` varchar(100) NULL,
`status` int(1) NOT NULL default 0 COMMENT '0 - Pending 1 - Paused',
`claim_id` bigint(20) unsigned default 0,
`attempts` tinyint(1) unsigned default 0,
`priority` int(5) unsigned default 10,
PRIMARY KEY (`ID`),
KEY `ID` (`ID`),
KEY `e_date` (`e_date`),
KEY `automation_id` (`automation_id`),
KEY `status` (`status`),
KEY `claim_id` (`claim_id`)
) $collate;";
}
}

View File

@@ -0,0 +1,58 @@
<?php
/**
* bwfan_templates table class
*
*/
if ( ! class_exists( 'BWFAN_DB_Table_Templates' ) && BWFAN_Common::is_pro_3_0() ) {
class BWFAN_DB_Table_Templates extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_templates';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"subject",
"template",
"type",
"title",
"mode",
"data",
"canned",
"created_at",
"updated_at",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`subject` varchar(255) default NULL,
`template` longtext,
`type` tinyint(1) unsigned not null default 1 COMMENT '1 - Email 2 - SMS',
`title` varchar(255) default NULL,
`mode` tinyint(1) NOT NULL default 1 COMMENT '1 - text only 2 - wc 3 - raw html 4 - drag and drop',
`data` longtext,
`canned` tinyint(1) default 0,
`created_at` datetime NOT NULL default '0000-00-00 00:00:00',
`updated_at` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`ID`),
KEY `type` (`type`),
KEY `mode` (`mode`),
KEY `canned` (`canned`)
) $collate;";
}
}
}

View File

@@ -0,0 +1,50 @@
<?php
/**
* bwfan_terms table class
*
*/
if ( ! class_exists( 'BWFAN_DB_Table_Terms' ) && BWFAN_Common::is_pro_3_0() ) {
class BWFAN_DB_Table_Terms extends BWFAN_DB_Tables_Base {
public $table_name = 'bwfan_terms';
/**
* Get table's columns
*
* @return string[]
*/
public function get_columns() {
return [
"ID",
"name",
"type",
"data",
"created_at",
"updated_at",
];
}
/**
* Get query for create table
*
* @return string
*/
public function get_create_table_query() {
global $wpdb;
$collate = $this->get_collation();
return "CREATE TABLE {$wpdb->prefix}$this->table_name (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`name` varchar(255) NOT NULL,
`type` tinyint(2) unsigned NOT NULL,
`data` longtext,
`created_at` datetime,
`updated_at` datetime,
PRIMARY KEY (`ID`),
KEY `type` (`type`)
) $collate;";
}
}
}

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden.