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,152 @@
.bwf-c-product-modal-image {
width: 50px;
height: auto;
}
.bwf-c-product-modal-row {
display: flex;
align-items: center;
}
.bwf-c-product-modal-row .bwf-c-product-modal-row-info {
margin-left: 15px;
display: flex;
flex-direction: column;
}
.bwf-c-product-modal-row .bwf-c-product-modal-row-info .bwf-c-product-id {
color: #aaa;
font-size: 12px;
}
table.bwf-c-product-modal-table {
width: 100%;
border-collapse: collapse;
border-spacing: 0 1em;
}
table.bwf-c-product-modal-table .bwf-tag-label {
font-size: 15px;
font-weight: 600;
display: block;
}
table.bwf-c-product-modal-table .bwf-tag-slug {
font-size: 12px;
font-weight: 400;
display: block;
margin-top: 4px;
}
table.bwf-c-product-modal-table .bwf-tag-item-select {
line-height: 45px;
padding: 8px 20px;
background: #007cba;
border-width: 0;
color: #fff;
text-decoration: none;
border-radius: 20px;
cursor: pointer;
}
table.bwf-c-product-modal-table .bwf-button-cell {
text-align: right;
}
table.bwf-c-product-modal-table tr {
border-bottom: 1px solid #eee;
}
table.bwf-c-product-modal-table tr td {
padding: 10px;
}
.bwf-spin-loader {
width: 1.5em;
height: 1.5em;
border: 0.25em solid transparent;
border-radius: 100%;
background-color: transparent !important;
-webkit-animation: bwf-rotate-loading 1.5s linear 0s infinite normal;
animation: bwf-rotate-loading 1.5s linear 0s infinite normal;
border-left-color: #444;
border-right-color: #444;
}
.bwf-spin-loader.bwf-spin-loader-xl {
width: 3em;
height: 3em;
border-width: 0.4em;
}
.bwf-t-center {
text-align: center;
}
.bwf-t-center .bwf-spin-loader {
margin: 0 auto;
}
@-webkit-keyframes bwf-rotate-loading {
0% {
-webkit-transform: rotate(0);
transform: rotate(0);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes bwf-rotate-loading {
0% {
-webkit-transform: rotate(0);
transform: rotate(0);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
.bwf-c-product-modal-pagination .bwf-pagination-page-arrows {
display: flex;
align-items: center;
justify-content: center;
margin-top: 15px;
}
.bwf-c-product-modal-pagination .bwf-pagination-page-arrows-buttons {
margin-left: 10px;
}
.bwf-c-product-modal-pagination .bwf-pagination-link {
width: 32px;
height: 30px;
padding: 0;
cursor: pointer;
}
.bwf-c-product-modal-pagination .bwf-pagination-link:disabled {
cursor: initial;
}
table.bwf-c-product-modal-table .bwf-placeholder-loader {
animation: loading-fade 1.6s ease-in-out infinite;
background-color: #f0f0f0;
color: transparent;
display: inline-block;
height: 16px;
width: 120px;
margin: 0;
}
table.bwf-c-product-modal-table .bwf-placeholder-loader.is-image {
height: 50px;
width: 50px;
}
@keyframes loading-fade {
0% {
opacity: 0.7;
}
50% {
opacity: 1;
}
100% {
opacity: 0.7;
}
}

View File

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

View File

@@ -0,0 +1,486 @@
(function ($) {
class BWFAN_Email_Editor {
formatAmount = null;
productToolEvent = null;
constructor() {
this.registerEvents();
this.initIziModals();
this.token = bwfan_automation_drag_drop.token;
this.initCurrency();
this.initProductToolModal();
}
initCurrency() {
if( typeof wc == 'undefined' || !wc || !wc.currency || !bwfan_automation_drag_drop.currency ) {
return;
}
this.formatAmount = wc.currency.default(bwfan_automation_drag_drop.currency).formatAmount;
}
initIziModals() {
var that = this;
/** iziModal Action For Single Autonami */
if ($('#modal-autonami-product-tool').length > 0) {
$('#modal-autonami-product-tool').iziModal({
width: 786,
radius: 5,
padding: 0,
background: 'rgb(255, 255, 255)',
overlayColor: 'rgba(0, 0, 0, 0.6)',
zindex: 9999999,
transitionIn: 'none',
onOpening: function () {
that.renderProductToolModal();
}
});
}
}
registerEvents() {
const self = this;
this.registerListeners();
const body = $('body');
body.on('click', '#bwf-launch-editor-modal', (e) => {
self.openModal();
e.preventDefault();
});
}
getCurrentDesign() {
const design = $('#bwfan-editor-design').val();
return !!design ? design : '';
}
setDesign(body, json = '') {
!!json && $('#bwfan-editor-design').val(json);
!!body && $('#bwfan-editor-body').val(body);
}
closeModal() {
$('body').removeClass('bwf-c-modal-open');
$('#bwf-modal-editor').removeClass('active');
$('#bwf_email_editor_frame').remove();
}
openModal() {
$('body').addClass('bwf-c-modal-open');
$('#bwf-modal-editor').addClass('active');
const iframeSrc = bwfan_automation_drag_drop.iframe_src.replace(/([^:]\/)\/+/g, "$1");
$('#bwf-modal-editor-inner').append('<iframe style="width:100%;height:100%" src="'+iframeSrc+'" id="bwf_email_editor_frame" ></iframe>');
setTimeout(function () {
$('#bwf-c-editor-modal-close').show();
$('#bwf-c-editor-modal-merge-tags').show();
}, 1000);
}
openMergeTagsModal() {
$('#modal-show-merge-tags').iziModal('open');
}
openLinkTriggerModal() {
$('#modal-autonami-link-trigger-selector').iziModal('open');
}
registerListeners() {
const self = this;
window.addEventListener('message', function (event) {
if (
-1 === event.origin.indexOf('app.getautonami.com') ||
!event.data ||
!event.data.action ||
event.data.token !== self.token
) {
return;
}
switch (event.data.action) {
case 'get_design':
self.getDesignListener(event);
break;
case 'save_design':
self.saveDesignListener(event);
break;
case 'send_test_email':
self.sendTestEmailListener(event);
break;
case 'wp_image_upload':
self.getWPMediaURL(event);
break;
case 'open_merge_tags':
self.openMergeTagsModal();
break;
case 'open_link_trigger':
self.openLinkTriggerModal();
break;
case 'close_editor':
self.closeModal();
break;
case 'select_product_for_tool':
self.productToolEvent = event;
self.selectProduct();
break;
}
});
}
getDesignListener(event) {
const jsonContent = this.getCurrentDesign();
this.sendPostMessage('get_design', {
gotDesign: true,
json: jsonContent,
subject: '',
mergeTags: {},
enableLinkTrigger: true,
}, event.origin);
}
saveDesignListener(event) {
/** Check for required data to send test email */
const {body, design} = event.data.data;
if (!body || !design) {
return;
}
this.setDesign(body, design);
this.saveAutomation();
this.sendPostMessage('save_design', {
isSaved: true,
}, event.origin);
}
saveAutomation() {
$('.wr_tw_save .wr-form-btn').trigger('click');
}
sendPostMessage(action, data, origin) {
const iframe = document.getElementById('bwf_email_editor_frame');
!!iframe && iframe.contentWindow.postMessage(
{
token: this.token,
action,
data,
},
origin
);
}
sendTestEmailListener(event) {
/** Check for required data to send test email */
const {email, body, design} = event.data.data;
if (!email || !body || !design) {
return;
}
this.setDesign(body, design);
this.sendTestEmail(email, event.origin);
}
sendTestEmail(email, origin) {
const self = this;
if ('' === email) {
return;
}
let form_data = $(
'#bwfan-actions-form-container'
).bwfan_serializeAndEncode();
form_data = bwfan_deserialize_obj(form_data);
const group_id = $('.bwfan-selected-action').attr(
'data-group-id'
);
const data_to_send = form_data.bwfan[group_id];
data_to_send.source = BWFAN_Auto.uiDataDetail.trigger.source;
data_to_send.event = BWFAN_Auto.uiDataDetail.trigger.event;
data_to_send._wpnonce = bwfanParams.ajax_nonce;
data_to_send.automation_id =
bwfan_automation_data.automation_id;
data_to_send.email = email;
const ajax = new bwf_ajax();
ajax.ajax('test_email', data_to_send);
ajax.success = (resp) => {
if (resp.status == true) {
self.sendPostMessage('send_test_email', {
isSent: true,
showSnackbar: true
}, origin);
} else {
self.sendPostMessage('send_test_email', {
isSent: false,
showSnackbar: true
}, origin);
}
};
}
getWPMediaURL(event) {
const self = this;
if (!wp || !wp.media) {
return '';
}
if (this.mediaLib) {
this.mediaLib.open();
return;
}
this.mediaLib = wp.media({
title: 'Select or Upload Media',
button: {
text: 'Select Image',
},
multiple: false,
});
this.mediaLib.on('select', function () {
// Get media attachment details from the frame state
const attachment = self.mediaLib
.state()
.get('selection')
.first()
.toJSON();
self.sendPostMessage('wp_image_upload', {
isUploaded: true,
imageURL: attachment.url,
}, event.origin);
});
// Finally, open the modal on click
this.mediaLib.open();
};
//async uploadImageListener(event) {
// const {image} = event.data.data;
// if (!image) {
// return;
// }
//
// const formData = new FormData();
// formData.append('image', image);
//
// const response = await window.fetch('<?php //echo rest_url( '/autonami-admin/upload-image' ) ?>//', {
// headers: {
// 'X-WP-Nonce': wpApiSettings.nonce
// },
// method: 'POST',
// body: formData
// });
//
// const jsonResult = await response.json();
// if (parseInt(jsonResult.code) === 200 && !!jsonResult.result) {
// this.sendPostMessage('upload_media', {
// isUploaded: true,
// imageURL: jsonResult.result,
// }, event.origin);
// }
//
// this.sendPostMessage('upload_media', {
// isUploaded: false,
// imageURL: '',
// }, event.origin);
//}
selectProduct() {
$('#modal-autonami-product-tool').iziModal('open');
}
onProductSelect( product ) {
this.sendPostMessage('select_product_for_tool', {
product: {
...product,
formattedPrice: this.formatAmount( product.price ),
},
}, this.productToolEvent.origin);
$('#modal-autonami-product-tool').iziModal('close');
}
initProductToolModal() {
let search = '';
let limit = 10;
let offset = 0;
const that = this;
/** Pagination Clicks */
$(document).on('click', '#bwf-c-product-modal-prev', function() {
offset = offset - limit;
that.renderProductToolModal( search, limit, offset );
});
$('body').on('click', '#bwf-c-product-modal-next', function() {
offset = offset + limit;
that.renderProductToolModal( search, limit, offset );
});
/** Search event */
const debouncedSearch = _.debounce(function() {
that.renderProductToolModal( search, limit, offset );
}, 700);
$(document).on('input', '#bwf-c-product-tool-search input', function(e) {
search = e.target.value;
debouncedSearch();
});
/** On select */
$(document).on('click', '#bwf-c-product-tool-select', function(e) {
let productData = $(this).data('product');
productData = JSON.parse( decodeURIComponent( productData ) );
that.onProductSelect( productData );
});
}
renderProductsLoading() {
let html = `<table class="bwf-c-product-modal-table"><tbody>`;
Array.from( Array( 10 ).keys() ).map( ( product, index ) => {
html += `<tr>
<td>
<div class="bwf-c-product-modal-row">
<p class="bwf-placeholder-loader is-image"></p>
<div class="bwf-c-product-modal-row-info">
<span class="bwf-tag-label">
<p class="bwf-placeholder-loader" style="width: 70px;"></p>
</span>
<span class="bwf-tag-slug">
<p class="bwf-placeholder-loader" style="height: 10px;"></p>
</span>
</div>
</div>
</td>
<td class="bwf-button-cell">
<p class="bwf-placeholder-loader" style="height: 32px; width: 80px;"></p>
</td>
</tr>`;
} );
html += `</tbody></table>`;
$('#modal-autonami-product-tool-content').html(html);
}
async renderProductToolModal( search = '', limit = 10, offset = 0 ) {
this.renderProductsLoading();
const data = await this.getProducts( search, limit, offset );
if( !! data && !! data.error ) {
return `<div>${ data.error }</div>`;
}
const { products, totalCount } = data;
const html = await this.getProductsHTML( products );
const pagination = this.getProductsPaginationHTML( limit, offset, totalCount );
$('#modal-autonami-product-tool-content').html( html + pagination );
}
getProductsPaginationHTML( limit = 10, offset = 0, total = 0 ) {
const page = ( offset / limit ) + 1;
const totalPages = Math.ceil( total / limit );
const nextPossible = ( totalPages - page ) > 0;
const prevPossible = page > 1;
const html = `<div class="bwf-c-product-modal-pagination">
<div class="bwf-pagination-page-arrows">
<span class="bwf-pagination-page-arrows-label" role="status" aria-live="polite">Page ${ page } of ${ totalPages }</span>
<div class="bwf-pagination-page-arrows-buttons">
<button type="button" ${ ! prevPossible && 'disabled=""' } class="components-button bwf-pagination-link" aria-label="Previous Page" id="bwf-c-product-modal-prev">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" role="img" aria-hidden="true" focusable="false">
<path d="M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"></path>
</svg>
</button>
<button type="button" ${ ! nextPossible && 'disabled=""' } class="components-button bwf-pagination-link is-active" aria-label="Next Page" id="bwf-c-product-modal-next">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" role="img" aria-hidden="true" focusable="false">
<path d="M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"></path>
</svg>
</button>
</div>
</div>
</div>`;
return html;
}
async getProductsHTML( products = [] ) {
let html = `<table class="bwf-c-product-modal-table"><tbody>`;
products.map( ( product, index ) => {
const price = `Price: ${ this.formatAmount( product.price ) }`;
const stockQuantity = !! product.stock_quantity && `Stock: ${ product.stock_quantity }`;
const stockStatus = product.stock_status;
const description = [ price, stockQuantity, stockStatus ]
.filter( Boolean )
.join( ' | ' );
const image = Array.isArray( product.images ) && product.images[ 0 ] ? product.images[ 0 ].src : ''
const imageHTML = !!image ? `<img class="bwf-c-product-modal-image" src='${image}' />` : '';
html += `<tr>
<td>
<div class="bwf-c-product-modal-row">
${imageHTML}
<div class="bwf-c-product-modal-row-info">
<span class="bwf-tag-label">
${ product.name }${ ' ' }
<span class="bwf-c-product-id">
#${ product.id }
</span>
</span>
<span class="bwf-tag-slug">
${ description }
</span>
</div>
</div>
</td>
<td class="bwf-button-cell">
<span id="bwf-c-product-tool-select" data-product="${ encodeURIComponent( JSON.stringify(product) ) }" class="bwf-tag-item-select">Select</span>
</td>
</tr>`;
} );
html += `</tbody></table>`;
return html;
}
async getProducts( search = '', limit = 10, offset = 0 ) {
const query = {
search,
per_page: limit,
page: parseInt( offset / limit ) + 1,
orderby: 'popularity',
};
let response = '';
try {
response = await wp.apiFetch( {
path: wp.url.addQueryArgs( '/wc-analytics/products', query ),
parse: false,
} );
} catch ( error ) {
return { error };
}
return {
products: await response.json(),
totalCount: parseInt( response.headers.get( 'x-wp-total' ), 10 ),
};
}
}
new BWFAN_Email_Editor();
})(jQuery);

View File

@@ -0,0 +1,49 @@
( function ( $ ) {
$( document ).ready( function () {
const adminSearchBar = $( '#bwfan-admin-bar-search' );
adminSearchBar.on( 'keyup', function () {
let value = $( this ).val();
if ( value ) {
fetch(
bwfanProObj.siteUrl+'/wp-json/' + bwfanProObj.apiNamespace + '/contacts?search=' +
value +
'&limit=5&offset=0',
{
credentials: 'include',
headers: {
'content-type': 'application/json',
'X-WP-Nonce': wpApiSettings.nonce,
},
}
)
.then( ( response ) => response.json() )
.then( function ( result ) {
if ( result.code == 200 ) {
let res = result.result;
let template = '';
if ( res.length > 0 ) {
res.map( function ( contact ) {
if (
contact.hasOwnProperty( 'email' ) &&
contact.hasOwnProperty( 'id' )
) {
template +=
'<a class="bwf-contact-suggestion" target="_blank" href="'+bwfanProObj.siteUrl+'/wp-admin/admin.php?page=autonami&path=/contact/' +
contact.id +
'">' +
contact.email +
'</a>';
}
} );
} else {
template = '<span class="label">No contacts found</span>';
}
$( '#bwf-contact-list-suggestion-list' ).html(
template
);
}
} );
}
} );
} );
} )( jQuery );

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -0,0 +1,228 @@
<?php
#[AllowDynamicProperties]
class BWFAN_Pro_Admin {
private static $ins = null;
public $admin_path;
public $admin_url;
private function __construct() {
$this->admin_path = BWFAN_PRO_PLUGIN_DIR . '/admin';
$this->admin_url = BWFAN_PRO_PLUGIN_URL . '/admin';
add_action( 'bwfan_wp_sendemail_setting_html', [ $this, 'utm_fields' ] );
add_filter( 'bwfan_automation_global_js_data', [ $this, 'language_settings' ] );
add_action( 'admin_head', [ $this, 'spinner_gif' ] );
add_action( 'admin_bar_menu', [ $this, 'bwfan_pro_add_menu_in_admin_bar' ], 9999, 1 );
}
public static function get_instance() {
if ( is_null( self::$ins ) ) {
self::$ins = new self();
}
return self::$ins;
}
public function utm_fields( $event ) {
include __DIR__ . '/views/utm_fields.php';
}
/**
* adding language options in case any of the language plugin like wpml, polylang,translatepress activated
*/
public function language_settings( $settings ) {
return BWFAN_PRO_Common::get_language_settings( $settings );
}
public function spinner_gif() {
ob_start();
?>
<style>
.bwfan_btn_spin_blue {
opacity: 1 !important;
position: relative;
color: rgba(0, 163, 161, .05) !important;
pointer-events: none !important;
}
.bwfan_btn_spin_blue::-moz-selection {
color: rgba(0, 163, 161, .05) !important;
}
.bwfan_btn_spin_blue::selection {
color: rgba(0, 163, 161, .05) !important;
}
.bwfan_btn_spin_blue:after {
animation: bwfan_spin .5s infinite linear;
border: 2px solid #0071a1;
border-radius: 50%;
border-right-color: transparent !important;
border-top-color: transparent !important;
content: "";
display: block;
width: 12px;
height: 12px;
top: 50%;
left: 50%;
margin-top: -8px;
margin-left: -8px;
position: absolute;
}
a.bwfan-add-repeater-data i {
font-size: 16px;
width: 16px;
height: 16px;
color: #444;
}
</style>
<?php
echo ob_get_clean(); //phpcs:ignore WordPress.Security.EscapeOutput
}
/**
* Register admin bar autonami links.
*
* @param \WP_Admin_Bar $wp_admin_bar
*/
public function bwfan_pro_add_menu_in_admin_bar( \WP_Admin_Bar $wp_admin_bar ) {
// Always add "search contact" link even at admin pages.
?>
<style type="text/css">
#wp-admin-bar-bwfan_admin_bar_search_contact-default {
width: 400px;
position: relative;
padding: 0 !important;
}
#wp-admin-bar-bwfan_admin_bar_search_contact-default li > .ab-item {
display: none;
}
#wpadminbar .quicklinks .menupop ul li .bwf-search-contacts .ab-item, #wpadminbar .quicklinks .menupop.hover ul li .bwf-search-contacts .ab-item {
height: auto;
}
#wp-admin-bar-bwfan_admin_bar_search_contact-default li .bwf-search-contacts {
background: #fff;
padding: 5px;
}
#wp-admin-bar-bwfan_admin_bar_search_contact-default li .bwf-search-contacts .bwf-search-input input {
width: 100%;
border: 1px solid #8c8f94;
border-radius: 4px;
padding: 0px 10px;
font-size: 15px;
color: #000;
box-sizing: border-box;
}
#wp-admin-bar-bwfan_admin_bar_search_contact-default li .label {
font-size: 14px;
display: block;
color: #000;
font-weight: 500;
cursor: default;
}
#bwf-contact-list-suggestion-list {
padding: 10px;
white-space: normal;
}
#bwf-contact-list-suggestion-list a.bwf-contact-suggestion {
width: fit-content;
border-radius: 18px;
padding: 0px 15px;
background-color: #e5e5e5;
border: 1px solid #9d9898;
color: #000 !important;
display: inline-block;
margin: 0 0 7px 7px;
}
#wp-admin-bar-bwfan_admin_bar_search_contact-default li .bwf-quick-links {
padding: 12px 20px;
background: #f7f5f5;
}
#wp-admin-bar-bwfan_admin_bar_search_contact-default .bwf-quick-links ul li a.ab-item, #wp-admin-bar-bwfan_admin_bar_search_contact-default .bwf-quick-links ul a.ab-item {
display: none;
}
#wp-admin-bar-bwfan_admin_bar_search_contact-default li .bwf-quick-links ul li {
padding: 10px 0;
margin: 0;
display: grid;
grid-template-columns: 50% 50%;
}
#wp-admin-bar-bwfan_admin_bar_search_contact-default li .bwf-quick-links ul li {
list-style: none;
padding: 0;
width: 48%;
display: inline-block;
}
#wpadminbar #wp-admin-bar-bwfan_admin_bar_search_contact-default li .bwf-quick-links ul li a {
text-decoration: none;
color: #1daafc;
}
</style>
<?php
$admin_url = admin_url( 'admin.php?page=autonami' );
$wp_admin_bar->add_node( [
'id' => 'bwfan_admin_bar_search_contact',
'title' => __( 'Search Contact', 'wp-marketing-automations-pro' ),
'parent' => 'top-secondary',
'href' => $admin_url . '&path=/contacts',
'meta' => [
'target' => '_blank',
],
] );
$html = '<div class="bwf-search-contacts">
<div class="bwf-search-input">
<span class="label">Enter name or email to search contact</span>
<input type="text" autocomplete="off" placeholder="Search Contacts" id="bwfan-admin-bar-search"/>
<div id="bwf-contact-list-suggestion-list">
</div>
</div>
<div class="bwf-quick-links">
<p class="label">Quick Links</p>
<ul>
<li><a href="' . esc_url( $admin_url . '&path=/automations' ) . '" target="_blank">Automations</a></li>
<li><a href="' . esc_url( $admin_url . '&path=/contacts' ) . '" target="_blank">Contacts</a></li>
<li><a href="' . esc_url( $admin_url . '&path=/analytics' ) . '" target="_blank">Analytics</a></li>
<li><a href="' . esc_url( $admin_url . '&path=/carts' ) . '" target="_blank">Cart</a></li>
<li><a href="' . esc_url( $admin_url . '&path=/settings' ) . '" target="_blank">Settings</a></li>
</ul>
</div>
</div>';
$wp_admin_bar->add_node( [
'id' => 'bwfan_admin_bar_li1',
'title' => $html,
'parent' => 'bwfan_admin_bar_search_contact',
'href' => "#",
] );
wp_enqueue_script( 'bwfan-admin-bar', $this->admin_url . '/assets/js/bwfan-pro-admin-bar.js', array( 'wp-api' ), BWFAN_VERSION_DEV, true );
wp_localize_script( 'bwfan-admin-bar', 'bwfanProObj', array(
'siteUrl' => site_url(),
'apiNamespace' => BWFAN_API_NAMESPACE,
) );
}
}
BWFAN_Pro_Admin::get_instance();

View File

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

View File

@@ -0,0 +1,35 @@
<?php
?>
<fieldset class="bwfan-tab-content bwfan-activeTab" setting-id="tab-birthday">
<div class="form-group field-input">
<label><?php esc_html_e( 'Show birthday field on checkout', 'wp-marketing-automations-pro' ); ?></label>
<div class="field-wrap">
<div class="wrapper">
<input class="bwfan_enable_birthday_checkout" name="bwfan_enable_birthday_checkout" type="checkbox" value="1" <?php echo empty( $global_settings['bwfan_enable_birthday_checkout'] ) ? '' : 'checked'; ?> />
<span class=""><?php esc_html_e( 'Enable birthday field to be shown on checkout page.', 'wp-marketing-automations-pro' ); ?></span>
</div>
</div>
</div>
<div class="form-group field-input">
<label><?php esc_html_e( 'Field Description', 'wp-marketing-automations-pro' ); ?></label>
<div class="field-wrap">
<div class="wrapper">
<input type="text" name="bwfan_birthday_field_desc" value="<?php echo empty( $global_settings['bwfan_birthday_field_desc'] ) ? '' : $global_settings['bwfan_birthday_field_desc']; //phpcs:ignore WordPress.Security.EscapeOutput ?>"/>
<span class=""><?php esc_html_e( 'This description will be shown with the birthday field.', 'auutonami-automations-pro' ); ?></span>
</div>
</div>
</div>
<div class="form-group field-input">
<label><?php esc_html_e( 'Checkout Field Placement', 'wp-marketing-automations-pro' ); ?></label>
<div class="field-wrap">
<div class="wrapper">
<select name="bwfan_birthday_field_position">
<?php $selected_position = isset( $global_settings['bwfan_birthday_field_position'] ) && ! empty( $global_settings['bwfan_birthday_field_position'] ) ? $global_settings['bwfan_birthday_field_position'] : ''; ?>
<option value="after_order_notes" <?php echo $selected_position === "after_order_notes" ? 'selected' : ''; ?> >After Order Notes</option>
<option value="before_order_notes" <?php echo $selected_position === "before_order_notes" ? 'selected' : ''; ?> >Before Order Notes</option>
<option value="after_billing_details" <?php echo $selected_position === "after_billing_details" ? 'selected' : ''; ?> >After Billing Details</option>
</select>
</div>
</div>
</div>
</fieldset>

View File

@@ -0,0 +1,32 @@
<?php
$license = BWFAN_Common::get_pro_license();
$token = get_option( 'bwfan_u_key', 0 );
$site_url = urlencode( home_url() );
$automation_id = sanitize_key( $_GET['edit'] );
$iframe_src = "//app.getautonami.com/get/$license/$token/$site_url/crm.automation.$automation_id";
/** Remove extra slashes */
$iframe_src = preg_replace('/([^:])(\/{2,})/', '$1/', $iframe_src);
?>
<div class="bwf-c-editor-modal-wrapper" id="bwf-modal-editor">
<div class="bwf-c-editor-modal bwf-c-editor-modal-full-width" id="bwf-modal-editor-inner">
</div>
</div>
<div class="bwfan_izimodal_default" style="display: none" id="modal-autonami-product-tool">
<div class="bwfan-search-filter-modal-wrap">
<div class="bwfan-modal-header bwfan_p15">
<div class="modal-header-title bwfan_heading_l bwfan_head_mr"><?php esc_html_e( 'Select a Product', 'wp-marketing-automations-pro' ) ?></div>
<div class="modal-header-search" id="bwf-c-product-tool-search">
<span class="dashicons dashicons-search modal-search-icon"></span>
<input type="search" id="modal-search-action-field" placeholder="<?php esc_html_e( 'Search Product', 'wp-marketing-automations-pro' ) ?>">
</div>
<span class="dashicons dashicons-no-alt bwfan_btn_close bwfan_modal_close" data-izimodal-close></span>
</div>
<div class="bwfan-modal-content">
<div class="bwfan-modal-content-content bwfan_p15" id="modal-autonami-product-tool-content">
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,11 @@
<#
is_enable_dragdrop = ('editor' === selected_template) ? '' : 'bwfan-display-none';
editor = !!data.actionSavedData && !!data.actionSavedData.data && !!data.actionSavedData.data.editor ? data.actionSavedData.data.editor : {};
body = !!editor.body ? editor.body : '';
design = !!editor.design ? editor.design : '';
#>
<div class="bwfan-email-editor bwfan-col-sm-12 bwfan-pl-0 bwfan-pr-0 bwfan-mb-15 {{is_enable_dragdrop}}">
<button class="button bwfan-button primary" id="bwf-launch-editor-modal"><?php esc_html_e( 'Launch Editor', 'wp-marketing-automations-pro' ) ?></button>
<input name="bwfan[{{data.action_id}}][data][editor][body]" type="hidden" value="{{body}}" id="bwfan-editor-body"/>
<input name="bwfan[{{data.action_id}}][data][editor][design]" type="hidden" value="{{design}}" id="bwfan-editor-design"/>
</div>

View File

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

View File

@@ -0,0 +1,45 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* @var $event BWFAN_Wp_Sendemail
*/
?>
<div class="bwfan_email_tracking bwfan-mb-15">
<label for="bwfan_append_utm">
<input type="checkbox" name="bwfan[{{data.action_id}}][data][append_utm]" id="bwfan_append_utm" value="1" {{is_append_utm}}/>
<?php
echo esc_html__( 'Add UTM parameters to the links', 'wp-marketing-automations-pro' );
$message = __( 'Add UTM parameters in all the links present in the email.', 'wp-marketing-automations-pro' );
echo $event->add_description( $message, 'xl' ); //phpcs:ignore WordPress.Security.EscapeOutput
?>
</label>
<div class="bwfan_utm_sources {{show_utm_parameters}}">
<div class="bwfan-input-form clearfix">
<div class="bwfan-col-sm-4 bwfan-pl-0"><span class="bwfan_label_input"><?php echo esc_html__( 'UTM Source', 'wp-marketing-automations-pro' ); ?></span></div>
<div class="bwfan-col-sm-8 bwfan-pr-0">
<input type="text" class="bwfan-input-wrapper" name="bwfan[{{data.action_id}}][data][utm_source]" value="{{entered_utm_source}}" id="bwfan_utm_source"/>
</div>
</div>
<div class="bwfan-input-form clearfix">
<div class="bwfan-col-sm-4 bwfan-pl-0"><span class="bwfan_label_input"><?php echo esc_html__( 'UTM Medium', 'wp-marketing-automations-pro' ); ?></span></div>
<div class="bwfan-col-sm-8 bwfan-pr-0">
<input type="text" class="bwfan-input-wrapper" name="bwfan[{{data.action_id}}][data][utm_medium]" value="{{entered_utm_medium}}" id="bwfan_utm_medium"/>
</div>
</div>
<div class="bwfan-input-form clearfix">
<div class="bwfan-col-sm-4 bwfan-pl-0"><span class="bwfan_label_input"><?php echo esc_html__( 'UTM Campaign', 'wp-marketing-automations-pro' ); ?></span></div>
<div class="bwfan-col-sm-8 bwfan-pr-0">
<input type="text" class="bwfan-input-wrapper" name="bwfan[{{data.action_id}}][data][utm_campaign]" value="{{entered_utm_campaign}}" id="bwfan_utm_campaign"/>
</div>
</div>
<div class="bwfan-input-form clearfix">
<div class="bwfan-col-sm-4 bwfan-pl-0"><span class="bwfan_label_input"><?php echo esc_html__( 'UTM Term', 'wp-marketing-automations-pro' ); ?></span></div>
<div class="bwfan-col-sm-8 bwfan-pr-0">
<input type="text" class="bwfan-input-wrapper" name="bwfan[{{data.action_id}}][data][utm_term]" value="{{entered_utm_term}}" id="bwfan_utm_term"/>
</div>
</div>
</div>
</div>