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

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,326 @@
{
"IcoMoonType": "selection",
"icons": [
{
"icon": {
"paths": [
"M402.286 219.429c-178.286 0-329.143 100.571-329.143 219.429 0 62.857 42.286 123.429 115.429 165.714l55.429 32-20 48c12-6.857 24-14.286 35.429-22.286l25.143-17.714 30.286 5.714c28.571 5.143 57.714 8 87.429 8 178.286 0 329.143-100.571 329.143-219.429s-150.857-219.429-329.143-219.429zM402.286 146.286c222.286 0 402.286 130.857 402.286 292.571s-180 292.571-402.286 292.571c-34.857 0-68.571-3.429-100.571-9.143-47.429 33.714-101.143 58.286-158.857 73.143-15.429 4-32 6.857-49.143 9.143h-1.714c-8.571 0-16.571-6.857-18.286-16.571v0c-2.286-10.857 5.143-17.714 11.429-25.143 22.286-25.143 47.429-47.429 66.857-94.857-92.571-53.714-152-136.571-152-229.143 0-161.714 180-292.571 402.286-292.571zM872 814.286c19.429 47.429 44.571 69.714 66.857 94.857 6.286 7.429 13.714 14.286 11.429 25.143v0c-2.286 10.286-10.857 17.714-20 16.571-17.143-2.286-33.714-5.143-49.143-9.143-57.714-14.857-111.429-39.429-158.857-73.143-32 5.714-65.714 9.143-100.571 9.143-103.429 0-198.286-28.571-269.714-75.429 16.571 1.143 33.714 2.286 50.286 2.286 122.857 0 238.857-35.429 327.429-99.429 95.429-69.714 148-164 148-266.286 0-29.714-4.571-58.857-13.143-86.857 96.571 53.143 159.429 137.714 159.429 233.143 0 93.143-59.429 175.429-152 229.143z"
],
"attrs": [
{}
],
"isMulticolor": false,
"isMulticolor2": false,
"tags": [
"comments-o"
],
"grid": 14
},
"attrs": [
{}
],
"properties": {
"order": 1,
"id": 0,
"prevSize": 28,
"code": 59654,
"name": "comments-o"
},
"setIdx": 0,
"setId": 45,
"iconIdx": 0
},
{
"icon": {
"paths": [
"M72.571 512q0-93.143 38.286-178.857l209.714 574.286q-112-54.286-180-160.571t-68-234.857zM808.571 489.714q0 10.857-1.429 22t-5.714 28.286-6.571 25.143-10 33.714-10 33.143l-43.429 146.286-158.857-472q26.286-1.714 50.286-4.571 10.857-1.143 14.857-10.571t-1.429-17.714-16.286-7.714l-117.143 5.714q-42.857-0.571-115.429-5.714-6.857-0.571-11.714 2.857t-6.571 8.571-0.857 10.571 5.143 9.429 11.143 4.571l45.714 4.571 68.571 187.429-96 288-160-475.429q26.286-1.714 50.286-4.571 10.857-1.143 14.857-10.571t-1.429-17.714-16.286-7.714l-117.143 5.714q-4 0-13.143-0.286t-14.857-0.286q60-91.429 156.857-144.857t210-53.429q84 0 160.286 30.286t136.286 85.143h-5.714q-31.429 0-52.571 23.143t-21.143 54.571q0 6.857 1.143 13.714t2.286 12.286 4.571 13.143 5.143 12 6.857 12.857 7.143 12 8.286 13.714 8 13.143q36 61.143 36 121.143zM519.429 550.286l135.429 369.714q0.571 3.429 2.857 6.286-72 25.143-145.714 25.143-64 0-124-18.286zM897.143 301.143q54.286 99.429 54.286 210.857 0 119.429-59.429 220.286t-159.429 159.143l134.286-387.429q33.714-96.571 33.714-157.714 0-24-3.429-45.143zM512 0q104 0 198.857 40.571t163.429 109.143 109.143 163.429 40.571 198.857-40.571 198.857-109.143 163.429-163.429 109.143-198.857 40.571-198.857-40.571-163.429-109.143-109.143-163.429-40.571-198.857 40.571-198.857 109.143-163.429 163.429-109.143 198.857-40.571zM512 1000.571q98.857 0 189.429-38.857t156-104.286 104.286-156 38.857-189.429-38.857-189.429-104.286-156-156-104.286-189.429-38.857-189.429 38.857-156 104.286-104.286 156-38.857 189.429 38.857 189.429 104.286 156 156 104.286 189.429 38.857z"
],
"attrs": [
{}
],
"isMulticolor": false,
"isMulticolor2": false,
"tags": [
"wordpress"
],
"grid": 14
},
"attrs": [
{}
],
"properties": {
"order": 1,
"id": 0,
"prevSize": 28,
"code": 59653,
"name": "wordpress"
},
"setIdx": 1,
"setId": 44,
"iconIdx": 0
},
{
"icon": {
"paths": [
"M1008 6.286q18.857 13.714 15.429 36.571l-146.286 877.714q-2.857 16.571-18.286 25.714-8 4.571-17.714 4.571-6.286 0-13.714-2.857l-258.857-105.714-138.286 168.571q-10.286 13.143-28 13.143-7.429 0-12.571-2.286-10.857-4-17.429-13.429t-6.571-20.857v-199.429l493.714-605.143-610.857 528.571-225.714-92.571q-21.143-8-22.857-31.429-1.143-22.857 18.286-33.714l950.857-548.571q8.571-5.143 18.286-5.143 11.429 0 20.571 6.286z"
],
"width": 1026,
"attrs": [
{}
],
"isMulticolor": false,
"isMulticolor2": false,
"tags": [
"paper-plane",
"send"
],
"grid": 14
},
"attrs": [
{}
],
"properties": {
"order": 1,
"id": 1,
"name": "paper-plane, send",
"prevSize": 28,
"code": 59652
},
"setIdx": 1,
"setId": 44,
"iconIdx": 1
},
{
"icon": {
"paths": [
"M804.571 420.571v109.714q0 22.857-16 38.857t-38.857 16h-237.714v237.714q0 22.857-16 38.857t-38.857 16h-109.714q-22.857 0-38.857-16t-16-38.857v-237.714h-237.714q-22.857 0-38.857-16t-16-38.857v-109.714q0-22.857 16-38.857t38.857-16h237.714v-237.714q0-22.857 16-38.857t38.857-16h109.714q22.857 0 38.857 16t16 38.857v237.714h237.714q22.857 0 38.857 16t16 38.857z"
],
"width": 805,
"attrs": [
{}
],
"isMulticolor": false,
"isMulticolor2": false,
"tags": [
"plus"
],
"grid": 14
},
"attrs": [
{}
],
"properties": {
"order": 1,
"id": 2,
"prevSize": 28,
"code": 59648,
"name": "plus"
},
"setIdx": 1,
"setId": 44,
"iconIdx": 2
},
{
"icon": {
"paths": [
"M614.286 420.571q0 7.429-5.714 13.143l-266.286 266.286q-5.714 5.714-13.143 5.714t-13.143-5.714l-266.286-266.286q-5.714-5.714-5.714-13.143t5.714-13.143l28.571-28.571q5.714-5.714 13.143-5.714t13.143 5.714l224.571 224.571 224.571-224.571q5.714-5.714 13.143-5.714t13.143 5.714l28.571 28.571q5.714 5.714 5.714 13.143z"
],
"width": 658,
"attrs": [
{}
],
"isMulticolor": false,
"isMulticolor2": false,
"tags": [
"angle-down"
],
"grid": 14
},
"attrs": [
{}
],
"properties": {
"order": 2,
"id": 3,
"prevSize": 28,
"code": 59650,
"name": "angle-down"
},
"setIdx": 1,
"setId": 44,
"iconIdx": 3
},
{
"icon": {
"paths": [
"M614.286 676.571q0 7.429-5.714 13.143l-28.571 28.571q-5.714 5.714-13.143 5.714t-13.143-5.714l-224.571-224.571-224.571 224.571q-5.714 5.714-13.143 5.714t-13.143-5.714l-28.571-28.571q-5.714-5.714-5.714-13.143t5.714-13.143l266.286-266.286q5.714-5.714 13.143-5.714t13.143 5.714l266.286 266.286q5.714 5.714 5.714 13.143z"
],
"width": 658,
"attrs": [
{}
],
"isMulticolor": false,
"isMulticolor2": false,
"tags": [
"angle-up"
],
"grid": 14
},
"attrs": [
{}
],
"properties": {
"order": 3,
"id": 4,
"prevSize": 28,
"code": 59649,
"name": "angle-up"
},
"setIdx": 1,
"setId": 44,
"iconIdx": 4
},
{
"icon": {
"paths": [
"M632.571 501.143l-424 424q-10.857 10.857-25.714 10.857t-25.714-10.857l-94.857-94.857q-10.857-10.857-10.857-25.714t10.857-25.714l303.429-303.429-303.429-303.429q-10.857-10.857-10.857-25.714t10.857-25.714l94.857-94.857q10.857-10.857 25.714-10.857t25.714 10.857l424 424q10.857 10.857 10.857 25.714t-10.857 25.714z"
],
"width": 695,
"attrs": [
{}
],
"isMulticolor": false,
"isMulticolor2": false,
"tags": [
"chevron-right"
],
"grid": 14
},
"attrs": [
{}
],
"properties": {
"order": 4,
"id": 5,
"prevSize": 28,
"code": 59651,
"name": "chevron-right"
},
"setIdx": 1,
"setId": 44,
"iconIdx": 5
},
{
"icon": {
"paths": [
"M950.857 859.429v-438.857q-18.286 20.571-39.429 37.714-153.143 117.714-243.429 193.143-29.143 24.571-47.429 38.286t-49.429 27.714-58.571 14h-1.143q-27.429 0-58.571-14t-49.429-27.714-47.429-38.286q-90.286-75.429-243.429-193.143-21.143-17.143-39.429-37.714v438.857q0 7.429 5.429 12.857t12.857 5.429h841.143q7.429 0 12.857-5.429t5.429-12.857zM950.857 258.857v-14t-0.286-7.429-1.714-7.143-3.143-5.143-5.143-4.286-8-1.429h-841.143q-7.429 0-12.857 5.429t-5.429 12.857q0 96 84 162.286 110.286 86.857 229.143 181.143 3.429 2.857 20 16.857t26.286 21.429 25.429 18 28.857 15.714 24.571 5.143h1.143q11.429 0 24.571-5.143t28.857-15.714 25.429-18 26.286-21.429 20-16.857q118.857-94.286 229.143-181.143 30.857-24.571 57.429-66t26.571-75.143zM1024 237.714v621.714q0 37.714-26.857 64.571t-64.571 26.857h-841.143q-37.714 0-64.571-26.857t-26.857-64.571v-621.714q0-37.714 26.857-64.571t64.571-26.857h841.143q37.714 0 64.571 26.857t26.857 64.571z"
],
"width": 1024.0009956359863,
"attrs": [],
"isMulticolor": false,
"isMulticolor2": false,
"tags": [
"envelope-o"
],
"defaultCode": 61443,
"grid": 14
},
"attrs": [],
"properties": {
"name": "envelope-o",
"id": 6,
"order": 5,
"prevSize": 28,
"code": 61443
},
"setIdx": 1,
"setId": 44,
"iconIdx": 6
},
{
"icon": {
"paths": [
"M872.571 827.429q32 50.857 12.286 87.143t-80.286 36.286h-658.286q-60.571 0-80.286-36.286t12.286-87.143l287.429-453.143v-228h-36.571q-14.857 0-25.714-10.857t-10.857-25.714 10.857-25.714 25.714-10.857h292.571q14.857 0 25.714 10.857t10.857 25.714-10.857 25.714-25.714 10.857h-36.571v228zM427.429 413.143l-155.429 245.143h406.857l-155.429-245.143-11.429-17.714v-249.143h-73.143v249.143z"
],
"width": 950.8549194335938,
"attrs": [],
"isMulticolor": false,
"isMulticolor2": false,
"tags": [
"flask"
],
"defaultCode": 61635,
"grid": 14
},
"attrs": [],
"properties": {
"name": "flask",
"id": 7,
"order": 6,
"prevSize": 28,
"code": 61635
},
"setIdx": 1,
"setId": 44,
"iconIdx": 7
},
{
"icon": {
"paths": [
"M352.571 799.429l-28.571 28.571q-5.714 5.714-13.143 5.714t-13.143-5.714l-266.286-266.286q-5.714-5.714-5.714-13.143t5.714-13.143l266.286-266.286q5.714-5.714 13.143-5.714t13.143 5.714l28.571 28.571q5.714 5.714 5.714 13.143t-5.714 13.143l-224.571 224.571 224.571 224.571q5.714 5.714 5.714 13.143t-5.714 13.143zM690.286 189.714l-213.143 737.714q-2.286 7.429-8.857 11.143t-13.429 1.429l-35.429-9.714q-7.429-2.286-11.143-8.857t-1.429-14l213.143-737.714q2.286-7.429 8.857-11.143t13.429-1.429l35.429 9.714q7.429 2.286 11.143 8.857t1.429 14zM1065.714 561.714l-266.286 266.286q-5.714 5.714-13.143 5.714t-13.143-5.714l-28.571-28.571q-5.714-5.714-5.714-13.143t5.714-13.143l224.571-224.571-224.571-224.571q-5.714-5.714-5.714-13.143t5.714-13.143l28.571-28.571q5.714-5.714 13.143-5.714t13.143 5.714l266.286 266.286q5.714 5.714 5.714 13.143t-5.714 13.143z"
],
"width": 1097.141944885254,
"attrs": [],
"isMulticolor": false,
"isMulticolor2": false,
"tags": [
"code"
],
"defaultCode": 61729,
"grid": 14
},
"attrs": [],
"properties": {
"name": "code",
"id": 8,
"order": 7,
"prevSize": 28,
"code": 61729
},
"setIdx": 1,
"setId": 44,
"iconIdx": 8
}
],
"height": 1024,
"metadata": {
"name": "icomoon"
},
"preferences": {
"showGlyphs": true,
"showCodes": true,
"showQuickUse": true,
"showQuickUse2": true,
"showSVGs": true,
"fontPref": {
"prefix": "icon-",
"metadata": {
"fontFamily": "icomoon"
},
"metrics": {
"emSize": 1024,
"baseline": 6.25,
"whitespace": 50
},
"embed": false
},
"imagePref": {
"prefix": "icon-",
"png": true,
"useClassSelector": true,
"color": 0,
"bgColor": 16777215
},
"historySize": 100
}
}

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by IcoMoon</metadata>
<defs>
<font id="icomoon" horiz-adv-x="1024">
<font-face units-per-em="1024" ascent="960" descent="-64" />
<missing-glyph horiz-adv-x="1024" />
<glyph unicode="&#x20;" horiz-adv-x="512" d="" />
<glyph unicode="&#xe900;" glyph-name="plus" horiz-adv-x="805" d="M804.571 530.286v-109.714q0-22.857-16-38.857t-38.857-16h-237.714v-237.714q0-22.857-16-38.857t-38.857-16h-109.714q-22.857 0-38.857 16t-16 38.857v237.714h-237.714q-22.857 0-38.857 16t-16 38.857v109.714q0 22.857 16 38.857t38.857 16h237.714v237.714q0 22.857 16 38.857t38.857 16h109.714q22.857 0 38.857-16t16-38.857v-237.714h237.714q22.857 0 38.857-16t16-38.857z" />
<glyph unicode="&#xe901;" glyph-name="angle-up" horiz-adv-x="658" d="M614.286 274.286q0-7.429-5.714-13.143l-28.571-28.571q-5.714-5.714-13.143-5.714t-13.143 5.714l-224.571 224.571-224.571-224.571q-5.714-5.714-13.143-5.714t-13.143 5.714l-28.571 28.571q-5.714 5.714-5.714 13.143t5.714 13.143l266.286 266.286q5.714 5.714 13.143 5.714t13.143-5.714l266.286-266.286q5.714-5.714 5.714-13.143z" />
<glyph unicode="&#xe902;" glyph-name="angle-down" horiz-adv-x="658" d="M614.286 530.286q0-7.429-5.714-13.143l-266.286-266.286q-5.714-5.714-13.143-5.714t-13.143 5.714l-266.286 266.286q-5.714 5.714-5.714 13.143t5.714 13.143l28.571 28.571q5.714 5.714 13.143 5.714t13.143-5.714l224.571-224.571 224.571 224.571q5.714 5.714 13.143 5.714t13.143-5.714l28.571-28.571q5.714-5.714 5.714-13.143z" />
<glyph unicode="&#xe903;" glyph-name="chevron-right" horiz-adv-x="695" d="M632.571 449.714l-424-424q-10.857-10.857-25.714-10.857t-25.714 10.857l-94.857 94.857q-10.857 10.857-10.857 25.714t10.857 25.714l303.429 303.429-303.429 303.429q-10.857 10.857-10.857 25.714t10.857 25.714l94.857 94.857q10.857 10.857 25.714 10.857t25.714-10.857l424-424q10.857-10.857 10.857-25.714t-10.857-25.714z" />
<glyph unicode="&#xe904;" glyph-name="paper-plane, send" horiz-adv-x="1026" d="M1008 944.571q18.857-13.714 15.429-36.571l-146.286-877.714q-2.857-16.571-18.286-25.714-8-4.571-17.714-4.571-6.286 0-13.714 2.857l-258.857 105.714-138.286-168.571q-10.286-13.143-28-13.143-7.429 0-12.571 2.286-10.857 4-17.429 13.429t-6.571 20.857v199.429l493.714 605.143-610.857-528.571-225.714 92.571q-21.143 8-22.857 31.429-1.143 22.857 18.286 33.714l950.857 548.571q8.571 5.143 18.286 5.143 11.429 0 20.571-6.286z" />
<glyph unicode="&#xe905;" glyph-name="wordpress" d="M72.571 438.857q0 93.143 38.286 178.857l209.714-574.286q-112 54.286-180 160.571t-68 234.857zM808.571 461.143q0-10.857-1.429-22t-5.714-28.286-6.571-25.143-10-33.714-10-33.143l-43.429-146.286-158.857 472q26.286 1.714 50.286 4.571 10.857 1.143 14.857 10.571t-1.429 17.714-16.286 7.714l-117.143-5.714q-42.857 0.571-115.429 5.714-6.857 0.571-11.714-2.857t-6.571-8.571-0.857-10.571 5.143-9.429 11.143-4.571l45.714-4.571 68.571-187.429-96-288-160 475.429q26.286 1.714 50.286 4.571 10.857 1.143 14.857 10.571t-1.429 17.714-16.286 7.714l-117.143-5.714q-4 0-13.143 0.286t-14.857 0.286q60 91.429 156.857 144.857t210 53.429q84 0 160.286-30.286t136.286-85.143h-5.714q-31.429 0-52.571-23.143t-21.143-54.571q0-6.857 1.143-13.714t2.286-12.286 4.571-13.143 5.143-12 6.857-12.857 7.143-12 8.286-13.714 8-13.143q36-61.143 36-121.143zM519.429 400.571l135.429-369.714q0.571-3.429 2.857-6.286-72-25.143-145.714-25.143-64 0-124 18.286zM897.143 649.714q54.286-99.429 54.286-210.857 0-119.429-59.429-220.286t-159.429-159.143l134.286 387.429q33.714 96.571 33.714 157.714 0 24-3.429 45.143zM512 950.857q104 0 198.857-40.571t163.429-109.143 109.143-163.429 40.571-198.857-40.571-198.857-109.143-163.429-163.429-109.143-198.857-40.571-198.857 40.571-163.429 109.143-109.143 163.429-40.571 198.857 40.571 198.857 109.143 163.429 163.429 109.143 198.857 40.571zM512-49.714q98.857 0 189.429 38.857t156 104.286 104.286 156 38.857 189.429-38.857 189.429-104.286 156-156 104.286-189.429 38.857-189.429-38.857-156-104.286-104.286-156-38.857-189.429 38.857-189.429 104.286-156 156-104.286 189.429-38.857z" />
<glyph unicode="&#xe906;" glyph-name="comments-o" d="M402.286 731.428c-178.286 0-329.143-100.571-329.143-219.429 0-62.857 42.286-123.429 115.429-165.714l55.429-32-20-48c12 6.857 24 14.286 35.429 22.286l25.143 17.714 30.286-5.714c28.571-5.143 57.714-8 87.429-8 178.286 0 329.143 100.571 329.143 219.429s-150.857 219.429-329.143 219.429zM402.286 804.571c222.286 0 402.286-130.857 402.286-292.571s-180-292.571-402.286-292.571c-34.857 0-68.571 3.429-100.571 9.143-47.429-33.714-101.143-58.286-158.857-73.143-15.429-4-32-6.857-49.143-9.143h-1.714c-8.571 0-16.571 6.857-18.286 16.571v0c-2.286 10.857 5.143 17.714 11.429 25.143 22.286 25.143 47.429 47.429 66.857 94.857-92.571 53.714-152 136.571-152 229.143 0 161.714 180 292.571 402.286 292.571zM872 136.571c19.429-47.429 44.571-69.714 66.857-94.857 6.286-7.429 13.714-14.286 11.429-25.143v0c-2.286-10.286-10.857-17.714-20-16.571-17.143 2.286-33.714 5.143-49.143 9.143-57.714 14.857-111.429 39.429-158.857 73.143-32-5.714-65.714-9.143-100.571-9.143-103.429 0-198.286 28.571-269.714 75.429 16.571-1.143 33.714-2.286 50.286-2.286 122.857 0 238.857 35.429 327.429 99.429 95.429 69.714 148 164 148 266.286 0 29.714-4.571 58.857-13.143 86.857 96.571-53.143 159.429-137.714 159.429-233.143 0-93.143-59.429-175.429-152-229.143z" />
<glyph unicode="&#xf003;" glyph-name="envelope-o" d="M950.857 91.428v438.857q-18.286-20.571-39.429-37.714-153.143-117.714-243.429-193.143-29.143-24.571-47.429-38.286t-49.429-27.714-58.571-14h-1.143q-27.429 0-58.571 14t-49.429 27.714-47.429 38.286q-90.286 75.429-243.429 193.143-21.143 17.143-39.429 37.714v-438.857q0-7.429 5.429-12.857t12.857-5.429h841.143q7.429 0 12.857 5.429t5.429 12.857zM950.857 692v14t-0.286 7.429-1.714 7.143-3.143 5.143-5.143 4.286-8 1.429h-841.143q-7.429 0-12.857-5.429t-5.429-12.857q0-96 84-162.286 110.286-86.857 229.143-181.143 3.429-2.857 20-16.857t26.286-21.429 25.429-18 28.857-15.714 24.571-5.143h1.143q11.429 0 24.571 5.143t28.857 15.714 25.429 18 26.286 21.429 20 16.857q118.857 94.286 229.143 181.143 30.857 24.571 57.429 66t26.571 75.143zM1024 713.143v-621.714q0-37.714-26.857-64.571t-64.571-26.857h-841.143q-37.714 0-64.571 26.857t-26.857 64.571v621.714q0 37.714 26.857 64.571t64.571 26.857h841.143q37.714 0 64.571-26.857t26.857-64.571z" />
<glyph unicode="&#xf0c3;" glyph-name="flask" horiz-adv-x="951" d="M872.571 123.428q32-50.857 12.286-87.143t-80.286-36.286h-658.286q-60.571 0-80.286 36.286t12.286 87.143l287.429 453.143v228h-36.571q-14.857 0-25.714 10.857t-10.857 25.714 10.857 25.714 25.714 10.857h292.571q14.857 0 25.714-10.857t10.857-25.714-10.857-25.714-25.714-10.857h-36.571v-228zM427.429 537.714l-155.429-245.143h406.857l-155.429 245.143-11.429 17.714v249.143h-73.143v-249.143z" />
<glyph unicode="&#xf121;" glyph-name="code" horiz-adv-x="1097" d="M352.571 151.428l-28.571-28.571q-5.714-5.714-13.143-5.714t-13.143 5.714l-266.286 266.286q-5.714 5.714-5.714 13.143t5.714 13.143l266.286 266.286q5.714 5.714 13.143 5.714t13.143-5.714l28.571-28.571q5.714-5.714 5.714-13.143t-5.714-13.143l-224.571-224.571 224.571-224.571q5.714-5.714 5.714-13.143t-5.714-13.143zM690.286 761.143l-213.143-737.714q-2.286-7.429-8.857-11.143t-13.429-1.429l-35.429 9.714q-7.429 2.286-11.143 8.857t-1.429 14l213.143 737.714q2.286 7.429 8.857 11.143t13.429 1.429l35.429-9.714q7.429-2.286 11.143-8.857t1.429-14zM1065.714 389.143l-266.286-266.286q-5.714-5.714-13.143-5.714t-13.143 5.714l-28.571 28.571q-5.714 5.714-5.714 13.143t5.714 13.143l224.571 224.571-224.571 224.571q-5.714 5.714-5.714 13.143t5.714 13.143l28.571 28.571q5.714 5.714 13.143 5.714t13.143-5.714l266.286-266.286q5.714-5.714 5.714-13.143t-5.714-13.143z" />
</font></defs></svg>

After

Width:  |  Height:  |  Size: 7.6 KiB

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,55 @@
/**
* Created by Ovidiu on 8/5/2016.
*/
var ThriveNMWordpressNotification = ThriveNMWordpressNotification || {};
ThriveNMWordpressNotification.functions = ThriveNMWordpressNotification.functions || {};
(function ( $ ) {
$( document ).on( 'click', '.td_nm_wordpress_notice .notice-dismiss', function () {
var key = $( this ).parent().attr( 'data-key' );
ThriveNMWordpressNotification.functions.dismiss_notice( key, false );
} );
/**
* Trigger dismiss notice
* @param test_id
*/
ThriveNMWordpressNotification.functions.trigger_dismiss_notice = function ( key ) {
this.dismiss_notice( key, true );
};
/**
* Dismiss notice ajax request
* @param test_id
* @param redirect
*/
ThriveNMWordpressNotification.functions.dismiss_notice = function ( key, redirect ) {
$.ajax( {
headers: {
'X-WP-Nonce': ThriveNMWordpressNotification.nonce
},
cache: false,
url: ThriveNMWordpressNotification.routes.ajaxurl + '?_nonce=' + ThriveNMWordpressNotification.nonce,
type: 'POST',
data: {
key: key,
redirect: redirect,
action: 'td_nm_admin_controller',
route: 'deletenotification'
}
} ).done( function ( response ) {
if ( response.status == true && redirect == true ) {
top.location.href = response.redirect_url;
}
$( 'div' ).find( '[data-key="' + key + '"]' ).remove();
} )
.error( function () {
console.log( "error" );
} );
};
})( jQuery );

View File

@@ -0,0 +1,276 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-dashboard
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
if ( ! class_exists( 'TD_NM' ) ) :
final class TD_NM {
/**
* The single instance of the class
*
* @var TD_NM
*/
protected static $_instance;
/**
* @var TD_NM_Data
*/
public $data = null;
public $checker = null;
/**
* Tve_Dash_Notification_Manager constructor.
*/
protected function __construct() {
$this->includes();
$this->init_hooks();
}
/**
* Main instance of Notification Manager
*
* Ensure only one instance of Notification Manager is loaded or can be loaded
*
* @return TD_NM
*/
public static function instance() {
if ( is_null( self::$_instance ) ) {
self::$_instance = new self();
}
return self::$_instance;
}
/**
* Hook into actions and filters
*/
protected function init_hooks() {
add_action( 'init', array( $this, 'init' ) );
}
/**
* Includes required core files used in admin and on the frontend.
*/
protected function includes() {
include_once( 'includes/class-td-nm-ajax.php' ); //ajax manager for all ajax requests
include_once( 'includes/td-nm-core-functions.php' ); //functions file
include_once( 'includes/class-td-nm-data.php' ); //data manager for custom db tables
include_once( 'includes/class-td-nm-post-types.php' ); //register post types
include_once( 'includes/actions/class-nm-action-abstract.php' );
include_once( 'includes/actions/class-nm-action-custom-script.php' );
include_once( 'includes/actions/class-nm-action-send-email-notification.php' );
include_once( 'includes/actions/class-nm-action-wordpress-notification.php' );
include_once( 'includes/triggers/class-nm-trigger-factory.php' );
include_once( 'includes/triggers/class-nm-trigger-abstract.php' );
include_once( 'includes/triggers/class-nm-trigger-email-sign-up.php' );
include_once( 'includes/triggers/class-nm-trigger-split-test-ends.php' );
include_once( 'includes/triggers/class-nm-trigger-testimonial-submitted.php' );
include_once( 'includes/triggers/class-nm-trigger-quiz-completion.php' );
include_once( 'includes/class-td-nm-checker.php' );
if ( $this->is_request( 'admin' ) ) {
include_once( 'includes/admin/class-td-nm-admin.php' );
}
if ( $this->is_request( 'frontend' ) ) {
}
}
/**
* Hook that init the TD_NM
*/
public function init() {
$this->data = new TD_NM_Data();
$this->checker = TD_NM_Checker::instance();
}
/**
* What type of request is this?
*
* @param string $type admin, ajax, cron or frontend.
*
* @return bool
*/
protected function is_request( $type ) {
switch ( $type ) {
case 'admin' :
return is_admin();
case 'ajax' :
return defined( 'DOING_AJAX' );
case 'cron' :
return defined( 'DOING_CRON' );
case 'frontend' :
return ( ! is_admin() || defined( 'DOING_AJAX' ) ) && ! defined( 'DOING_CRON' );
}
}
/**
* NM path with appended file if passed as parameter
*
* @param string $file
*
* @return string
*/
public function path( $file = '' ) {
return untrailingslashit( plugin_dir_path( __FILE__ ) ) . ( ! empty( $file ) ? '/' : '' ) . ltrim( $file, '\\/' );
}
/**
* NM url with appended file if passed as parameter
*
* @param string $file
*
* @return string
*/
public function url( $file = '' ) {
return untrailingslashit( TVE_DASH_URL ) . '/inc/notification-manager' . ( ! empty( $file ) ? '/' : '' ) . ltrim( $file, '\\/' );
}
public function get_trigger_types() {
$types = apply_filters( 'td_nm_trigger_types', array() );
$triggers = array();
foreach ( $types as $key => $label ) {
$model = array(
'key' => $key,
'label' => $label,
'icon' => '',
);
switch ( $key ) {
case 'email_sign_up':
$model['icon'] = 'tvd-nm-icon-envelope-o';
break;
case 'split_test_ends':
$model['icon'] = 'tvd-nm-icon-flask';
break;
case 'testimonial_submitted':
$model['icon'] = 'tvd-nm-icon-comments-o';
break;
case 'quiz_completion':
$model['icon'] = 'tvd-icon-tqb';
break;
default:
$model['icon'] = 'tvd-nm-icon-flask';
break;
}
$triggers[] = $model;
}
return $triggers;
}
public function get_action_types() {
$actions = array(
array(
'key' => 'send_email_notification',
'label' => __( 'Send Email Notification', 'thrive-dash' ),
'icon' => 'tvd-nm-icon-envelope-o'
),
array(
'key' => 'custom_script',
'label' => __( 'Call a Custom Script', 'thrive-dash' ),
'icon' => 'tvd-nm-icon-code'
),
array(
'key' => 'wordpress_notification',
'label' => __( 'WordPress Notification', 'thrive-dash' ),
'icon' => 'tvd-nm-icon-wordpress'
),
);
return $actions;
}
/**
* List of shortcodes used for creating messages that will be sent to users
*
* @return array
*/
public function get_message_shortcodes() {
return array(
'email_sign_up' => array(
'send_email_notification' => array(
array(
'shortcode' => '[lead_details]',
'label' => __( 'Displays the name of your opt-in offer', 'thrive-dash' ),
),
array(
'shortcode' => '[lead_email]',
'label' => __( 'Displays the email address of the new lead', 'thrive-dash' ),
)
),
'wordpress_notification' => array(
array(
'shortcode' => '[link]Lead Form[/link]',
'label' => __( 'Hyperlink that links to the lead reporting screen.', 'thrive-dash' ),
),
)
),
'split_test_ends' => array(
'send_email_notification' => array(
array(
'shortcode' => '[test_link]Test Reports[/test_link]',
'label' => __( 'Hyperlink that links to the A/B test screen', 'thrive-dash' ),
)
),
'wordpress_notification' => array(
array(
'shortcode' => '[link]Test Reports[/link]',
'label' => __( 'Hyperlink that links to the A/B test screen', 'thrive-dash' ),
),
),
),
'testimonial_submitted' => array(
'send_email_notification' => array(
array(
'shortcode' => '[testimonial_details]',
'label' => __( 'Displays the testimonial details.', 'thrive-dash' ),
),
),
'wordpress_notification' => array(
array(
'shortcode' => '[link]Testimonial Page[/link]',
'label' => __( 'Hyperlink that links to the testimonial page.', 'thrive-dash' ),
),
)
),
'quiz_completion' => array(
'send_email_notification' => array(
array(
'shortcode' => '[quiz_details]',
'label' => __( 'Displays quiz details.', 'thrive-dash' ),
),
),
'wordpress_notification' => array(
array(
'shortcode' => '[link]Quiz Dashboard[/link]',
'label' => __( 'Hyperlink that links to Quiz Dashboard.', 'thrive-dash' ),
),
)
),
);
}
}
endif;
function TD_NM() {
return TD_NM::instance();
}
$GLOBALS['TD_NM'] = TD_NM();

View File

@@ -0,0 +1,63 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-dashboard
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
return array(
'Thrive_Dashboard' => __( 'Thrive Dashboard', 'thrive-dash' ),
'NM_Dashboard' => __( 'Notification Manager', 'thrive-dash' ),
'LeadGroups' => __( 'Lead Groups', 'thrive-dash' ),
'lead_groups' => __( 'lead groups', 'thrive-dash' ),
'lead_group' => __( 'lead group', 'thrive-dash' ),
'group' => __( 'group', 'thrive-dash' ),
'Shortcodes' => __( 'Shortcodes', 'thrive-dash' ),
'shortcode' => __( 'shortcode', 'thrive-dash' ),
'shortcodes' => __( 'shortcodes', 'thrive-dash' ),
'ThriveBoxes' => __( 'ThriveBoxes', 'thrive-dash' ),
'thrive_boxes' => __( 'thrive boxes', 'thrive-dash' ),
'thrive_box' => __( 'thrive box', 'thrive-dash' ),
'no_s_to_display' => __( 'No %s to display', 'thrive-dash' ),
'no_s_found' => __( 'No %s found', 'thrive-dash' ),
'next_step_no_option_selected' => __( 'In order to proceed to next step at least one option should be selected.', 'thrive-dash' ),
'custom_script_settings' => __( 'Custom Script Settings', 'thrive-dash' ),
'insert_recipients_email' => __( "Insert recipient's email", 'thrive-dash' ),
'invalid_email' => __( 'Invalid email', 'thrive-dash' ),
'email_duplicated' => __( 'Email duplicated', 'thrive-dash' ),
'field_exists' => __( 'Field already exists', 'thrive-dash' ),
'subject_empty' => __( 'Subject empty', 'thrive-dash' ),
'message_empty' => __( 'Message empty', 'thrive-dash' ),
'no_recipient' => __( 'No recipient', 'thrive-dash' ),
'invalid_recipient' => __( 'Invalid recipient', 'thrive-dash' ),
'hide_available_shortcodes' => __( 'Hide available shortcodes', 'thrive-dash' ),
'show_available_shortcodes' => __( 'Show available shortcodes', 'thrive-dash' ),
'invalid_url' => __( 'Invalid URL', 'thrive-dash' ),
'no_notification_created_yet' => __( 'No notification created yet', 'thrive-dash' ),
'others' => __( 'Others', 'thrive-dash' ),
'success_delete' => __( 'Success Delete', 'thrive-dash' ),
'error_delete' => __( 'Error Delete', 'thrive-dash' ),
'action_saved' => __( 'Action saved', 'thrive-dash' ),
'select_action' => __( 'Please select an action', 'thrive-dash' ),
'split_tests' => __( 'A/B Tests', 'thrive-dash' ),
'trigger_saved' => __( 'Trigger saved', 'thrive-dash' ),
'connected' => __( 'Connected', 'thrive-dash' ),
'action_failed' => __( 'Action failed', 'thrive-dash' ),
'connection_established' => __( 'Connection established', 'thrive-dash' ),
'no_connection_established' => __( 'For the moment you have no Email Delivery Connection established. Click the Add New button to set one.', 'thrive-dash' ),
'your_existing_connections' => __( 'Your existing connections:', 'thrive-dash' ),
'active' => __( 'active', 'thrive-dash' ),
'inactive' => __( 'inactive', 'thrive-dash' ),
'default_message_send_email_wp' => __( 'A new lead has been added!', 'thrive-dash' ),
'default_message_split_test_ends_wp' => __( 'A split test recently ended. [link]Click here to see the results[/link]', 'thrive-dash' ),
'default_message_testimonial_sub_wp' => __( 'A Thrive Ovation endorsement has been submitted. [link]Click here to see the testimonial[/link]', 'thrive-dash' ),
'default_message_quiz_completion_wp' => __( 'A new quiz completion was registered. [link]Click here to see the Quiz[/link]', 'thrive-dash' ),
'default_message_quiz_completion_send_email' => __( "Someone recently completed your quiz. Here are the details:\n\n[quiz_details]", 'thrive-dash' ),
'default_message_subject_quiz_completion_send_email' => __( 'A visitor has completed your quiz!', 'thrive-dash' ),
'add_new_action' => __( 'Add New Action', 'thrive-dash' ),
'no_quizzes' => __( 'No quizzes.', 'thrive-dash' ),
);

View File

@@ -0,0 +1,28 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-dashboard
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
abstract class TD_NM_Action_Abstract {
/** @var array */
protected $settings;
public function __construct( $settings ) {
$this->settings = $settings;
}
abstract public function execute( $prepare_data );
abstract public function prepare_email_sign_up_data( $sign_up_data );
abstract public function prepare_split_test_ends_data( $split_test_ends_data );
abstract public function prepare_testimonial_submitted_data( $testimonial_data );
}

View File

@@ -0,0 +1,126 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-dashboard
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
class TD_NM_Action_Custom_Script extends TD_NM_Action_Abstract {
public function execute( $prepared_data ) {
$url = $this->settings['url'];
wp_remote_post( $url, array(
'body' => $prepared_data
) );
}
public function prepare_email_sign_up_data( $sign_up_data ) {
$data = array();
$tl_item = $sign_up_data[0];
$tl_form = $sign_up_data[2];
$tl_data = $sign_up_data[4];
$data['thrv_event'] = 'thrv_signup';
$data['source'] = $tl_item->post_type;
$data['source_name'] = $tl_item->post_title;
$data['source_id'] = $tl_item->ID;
$data['source_form_name'] = $tl_form['post_title'];
$data['source_form_id'] = $tl_form['key'];
$data['user_email'] = $tl_data['email'];
$data['user_custom_data'] = $tl_data['custom_fields'];
$labels = array();
if ( ! empty( $tl_data['tve_labels'] ) ) {
$base64_decoded = base64_decode( $tl_data['tve_labels'] );
$labels = thrive_safe_unserialize( $base64_decoded );
}
if ( is_array( $labels ) && ! empty( $labels ) ) {
foreach ( $labels as $input_name => $label ) {
$label = sanitize_text_field( $label );
$data['user_custom_data'][ $label ] = ! empty( $tl_data['custom_fields'][ $input_name ] ) ? $tl_data['custom_fields'][ $input_name ] : null;
}
}
return $data;
}
public function prepare_split_test_ends_data( $split_test_ends_data ) {
$data = array();
$test_item = $split_test_ends_data[0];
$test = $split_test_ends_data[1];
$data['thrv_event'] = 'split_test';
$data['test_id'] = $test->id;
$data['test_url'] = $test->url;
$data['winning_variation_name'] = $test_item->variation['post_title'];
$data['winning_variation_id'] = $test_item->variation['key'];
return $data;
}
public function prepare_testimonial_submitted_data( $testimonial_data ) {
$data = array();
$testimonial = $testimonial_data[0];
$extra_data = $testimonial_data[1];
$data['id'] = $testimonial['id'];
$data['title'] = $testimonial['title'];
$data['date'] = $testimonial['date'];
$data['content'] = $testimonial['summary'];
$data['role'] = $testimonial['role'];
$data['name'] = $testimonial['name'];
$data['email'] = $testimonial['email'];
$data['website_url'] = $testimonial['website_url'];
$data['picture_url'] = $testimonial['picture_url'];
if ( ! empty( $testimonial['tags'] ) && is_array( $testimonial['tags'] ) ) {
$tags_text_arr = array();
foreach ( $testimonial['tags'] as $tag ) {
$tags_text_arr[] = $tag['text'];
}
$data['tags'] = implode( ',', $tags_text_arr );
}
return $data;
}
public function prepare_quiz_completion_data( $data ) {
$quiz = $data[0];
$user = $data[1];
$data = array(
'quiz' => array(
'Name' => $quiz->post_title
),
'quiz_user' => array(
'result' => $user['points'],
'email' => ! empty( $user['email'] ) ? $user['email'] : __( 'unknown', 'thrive-dash' ),
'date_started' => $user['date_started'],
),
'original_data' => $data,
);
$data = apply_filters( 'td_nm_custom_script_quiz_completion', $data );
if ( ! is_array( $data ) ) {
$data = array();
}
$return = array(
'quiz' => ! empty( $data['quiz'] ) ? $data['quiz'] : null,
'user' => ! empty( $data['quiz_user'] ) ? $data['quiz_user'] : null,
);
return $return;
}
}

View File

@@ -0,0 +1,313 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-dashboard
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
class TD_NM_Action_Send_Email_Notification extends TD_NM_Action_Abstract {
public function execute( $prepared_data ) {
$connection = $this->get_service();
$email_data = array(
'emails' => $this->get_emails(),
'subject' => $this->get_subject( $prepared_data ),
'text_content' => $this->get_text_content( $prepared_data ),
'html_content' => $this->get_html_content( $prepared_data ),
);
if ( ! $connection ) {
return $this->sendMultipleEmails( $email_data );
}
try {
$connection->sendMultipleEmails( $email_data );
} catch ( Exception $e ) {
global $wpdb;
/**
* at this point, we need to log the error in a DB table, so that the user can see all these error later on and (maybe) re-subscribe the user
*/
$log_data = array(
'date' => date( 'Y-m-d H:i:s' ),
'error_message' => sanitize_textarea_field( $e->getMessage() ),
'api_data' => serialize( tve_sanitize_data_recursive( $prepared_data ) ),
'connection' => $connection->get_key(),
'list_id' => 'asset',
);
$wpdb->insert( $wpdb->prefix . 'tcb_api_error_log', $log_data );
}
}
public function prepare_email_sign_up_data( $sign_up_data ) {
$data = array();
$tl_item = $sign_up_data[0];
$tl_form = $sign_up_data[2];
$tl_data = $sign_up_data[4];
$lead_details['source'] = $tl_item->post_type;
$lead_details['source_name'] = $tl_item->post_title;
$lead_details['source_id'] = $tl_item->ID;
$lead_details['source_form_name'] = $tl_form['post_title'];
$lead_details['source_form_id'] = $tl_form['key'];
/*Send also the custom fields to the lead_detail shortcode*/
foreach ( $tl_data['custom_fields'] as $key => $value ) {
$lead_details[ 'custom_' . $key ] = $value;
}
$data['lead_details'] = $lead_details;
$data['lead_email'] = $tl_data['email'];
return $data;
}
public function prepare_split_test_ends_data( $split_test_ends_data ) {
$data = array();
$test_item = $split_test_ends_data[0];
$test = $split_test_ends_data[1];
$test_details['thrv_event'] = 'split_test';
$test_details['test_id'] = $test->id;
$test_details['test_url'] = $test->url;
$test_details['winning_variation_name'] = $test_item->variation['post_title'];
$test_details['winning_variation_id'] = $test_item->variation['key'];
$data['test_details'] = $test_details;
$data['test_link'] = $test->url;
return $data;
}
public function prepare_testimonial_submitted_data( $testimonial_data ) {
$data = array();
$testimonial = $testimonial_data[0];
unset( $testimonial['id'] );
unset( $testimonial['content'] );
unset( $testimonial['status'] );
unset( $testimonial['source'] );
foreach ( $testimonial as $key => $value ) {
if ( ! empty( $value ) ) {
if ( is_string( $value ) ) {
$testimonial_details[ $key ] = $value;
} elseif ( is_array( $value ) ) {
$aux = array();
foreach ( $value as $val ) {
$aux[] = ( ! empty( $val['text'] ) ) ? $val['text'] : '';
}
$testimonial_details[ $key ] = implode( ',', $aux );
}
}
}
$data['lead_details'] = $testimonial_details;
return $data;
}
/**
* @return bool|Thrive_Dash_List_Connection_Abstract
*/
public function get_service() {
$connection = get_option( 'tvd-nm-email-service', false );
if ( ! $connection ) {
return false;
}
return Thrive_Dash_List_Manager::connection_instance( $connection );
}
/**
* returns an array of emails from settings->recipients
*
* @return array
*/
public function get_emails() {
$emails = array();
foreach ( $this->settings['recipients'] as $item ) {
$emails[] = $item['value'];
}
return $emails;
}
public function get_html_content( $prepared_data ) {
$content = $this->settings['message']['content'];
$item_details = '';
if ( isset( $prepared_data['lead_details'] ) ) {
foreach ( $prepared_data['lead_details'] as $key => $value ) {
$item_details .= "<p><strong>{$key}</strong>:\n {$value}</p>";
}
}
if ( isset( $prepared_data['quiz'] ) ) {
foreach ( $prepared_data['quiz'] as $key => $value ) {
$item_details .= "<p><strong>{$key}</strong>:\n <span>{$value}</span></p>";
}
}
if ( isset( $prepared_data['quiz_user'] ) ) {
foreach ( $prepared_data['quiz_user'] as $key => $value ) {
$item_details .= "<p><strong>{$key}</strong>:\n <span>{$value}</span></p>";
}
}
if ( ! empty( $prepared_data['quiz_user_flow'] ) ) {
foreach ( $prepared_data['quiz_user_flow'] as $key => $item ) {
$item_details .= "<p><strong>{$item['question']}</strong>\n<span>{$item['answer']}</span></p>";
}
}
$lead_email = '';
if ( isset( $prepared_data['lead_email'] ) ) {
$lead_email .= "email: " . $prepared_data['lead_email'];
}
if ( stripos( $content, '[lead_email]' ) !== false ) {
$content = str_replace( '[lead_email]', $lead_email, $content );
}
$keywords = array( '[lead_details]', '[testimonial_details]', '[quiz_details]' );
foreach ( $keywords as $keyword ) {
if ( stripos( $content, $keyword ) !== false ) {
$content = str_replace( $keyword, $item_details, $content );
}
}
preg_match( '@\[test_link\](.+)\[/test_link\]@', $content, $matches );
if ( ! empty( $matches ) ) {
$content = str_replace( $matches[0], '<a href="' . $prepared_data["test_link"] . '">' . $matches[1] . '</a>', $content );
}
$content = nl2br( $content );
return $content;
}
public function get_text_content( $prepared_data ) {
$content = $this->settings['message']['content'];
$item_details = "\n";
if ( isset( $prepared_data['lead_details'] ) ) {
foreach ( $prepared_data['lead_details'] as $key => $value ) {
$item_details .= "{$key}: {$value}\n";
}
}
if ( isset( $prepared_data['quiz'] ) ) {
$item_details .= "\nQuiz Details:\n";
foreach ( $prepared_data['quiz'] as $key => $value ) {
$item_details .= "{$key}: {$value}\n";
}
}
if ( isset( $prepared_data['quiz_user'] ) ) {
$item_details .= "\nUser Details:\n";
foreach ( $prepared_data['quiz_user'] as $key => $value ) {
$item_details .= "{$key}: {$value}\n";
}
}
$lead_email = '';
if ( isset( $prepared_data['lead_email'] ) ) {
$lead_email .= "email: " . $prepared_data['lead_email'];
}
if ( stripos( $content, '[lead_details]' ) !== false ) {
$content = str_replace( '[lead_details]', $item_details, $content );
}
if ( stripos( $content, '[lead_email]' ) !== false ) {
$content = str_replace( '[lead_email]', $lead_email, $content );
}
preg_match( '@\[test_link\](.+)\[/test_link\]@', $content, $matches );
if ( ! empty( $matches ) ) {
$content = str_replace( $matches[0], $prepared_data["test_link"], $content );
}
return $content;
}
public function get_subject( $prepared_data ) {
$subject = $this->settings['message']['subject'];
if ( stristr( $subject, '[lead_email]' ) !== false ) {
$subject = str_replace( '[lead_email]', $prepared_data['lead_email'], $subject );
}
return $subject;
}
public function prepare_quiz_completion_data( $data ) {
$quiz = $data[0];
$user = $data[1];
$data = array(
'quiz' => array(
'Quiz Name' => $quiz->post_title,
),
'quiz_user' => array(
'Quiz Result' => $user['points'],
'Email' => ! empty( $user['email'] ) ? $user['email'] : __( 'unknown', 'thrive-dash' ),
'Date started' => $user['date_started'],
),
'original_data' => $data,
);
$filtered = apply_filters( 'td_nm_email_notification_quiz_completion', $data );
if ( ! is_array( $filtered ) ) {
$filtered = array();
}
$return = array(
'quiz' => ! empty( $filtered['quiz'] ) ? $filtered['quiz'] : null,
'quiz_user' => ! empty( $filtered['quiz_user'] ) ? $filtered['quiz_user'] : null,
'quiz_user_flow' => array(),
);
if ( ! empty( $user['flow'] ) ) {
foreach ( $user['flow'] as $question ) {
foreach ( $question['answers'] as $answer ) {
if ( ! empty( $answer['chosen'] ) ) {
$return['quiz_user_flow'][] = array(
'question' => $question['text'],
'answer' => (int) $question['q_type'] === 3 ? $answer['answer_text'] : $answer['text'],
);
}
}
}
}
return $return;
}
protected function sendMultipleEmails( $data ) {
$to = $data['emails'];
$subject = $data['subject'];
$message = $data['html_content'];
$headers = array( 'Content-Type: text/html; charset=UTF-8' );
$sent = wp_mail( $to, $subject, $message, $headers );
return $sent;
}
}

View File

@@ -0,0 +1,77 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-dashboard
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
class TD_NM_Action_Wordpress_Notification extends TD_NM_Action_Abstract {
public function execute( $prepared_data ) {
preg_match_all( '/\\[link\\].*?\\[\/link\\]/is', $this->settings['message']['content'], $matches );
$message = $this->settings['message']['content'];
$message = sanitize_textarea_field( $message );
if ( ! empty( $matches ) && isset( $matches[0] ) ) {
foreach ( $matches[0] as $expression ) {
preg_match( '#\\[link\\](.+)\\[/link\\]#s', $expression, $expression_match );
$message = str_replace( $expression_match[0], '<a href="javascript:void(0);" onclick="ThriveNMWordpressNotification.functions.trigger_dismiss_notice(' . $this->settings['notification_id'] . ')">' . $expression_match[1] . '</a>', $message );
}
}
$meta_value = array( 'url' => $prepared_data['test_url'], 'message' => $message );
update_post_meta( $this->settings['notification_id'], 'td_nm_wordpress_notification', $meta_value );
}
public function prepare_email_sign_up_data( $sign_up_data ) {
$data = array();
$tl_item = $sign_up_data[0];
$tl_form = $sign_up_data[1];
$data['source'] = $tl_item->post_type;
$data['key'] = $tl_form->ID;
$data['test_url'] = admin_url( 'admin.php?page=thrive_leads_dashboard' ) . '#form-type/' . $tl_form->ID;
$data['trigger_source'] = 'leads';
return $data;
}
public function prepare_split_test_ends_data( $split_test_ends_data ) {
$data = array();
$test_item = $split_test_ends_data[0];
$test = $split_test_ends_data[1];
$data['key'] = $test_item->test_id;
$data['trigger_source'] = $test->trigger_source;
$data['test_url'] = $test->url;
return $data;
}
public function prepare_testimonial_submitted_data( $testimonial_data ) {
$data = array();
$testimonial = $testimonial_data[0];
$extra_data = $testimonial_data[1];
$data['test_url'] = $extra_data['url'];
$data['key'] = $testimonial['id'];
return $data;
}
public function prepare_quiz_completion_data( $data ) {
return array(
'test_url' => admin_url( 'admin.php?page=tqb_admin_dashboard' ) . '#dashboard/quiz/' . $data[0]->ID,
);
}
}

View File

@@ -0,0 +1,256 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-dashboard
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
class TD_NM_Admin_Ajax_Controller {
protected static $_instance;
/**
* TD_NM_Admin_Ajax_Controller constructor.
* Protected constructor because we want to use it as singleton
*/
protected function __construct() {
}
/**
* Gets the SingleTone's instance
*
* @return TD_NM_Admin_Ajax_Controller
*/
public static function instance() {
if ( empty( static::$_instance ) ) {
static::$_instance = new static();
}
return static::$_instance;
}
/**
* Sets the request's header with server protocol and status
* Sets the request's body with specified $message
*
* @param $message
* @param string $status
*/
protected function error( $message, $status = '404 Not Found' ) {
status_header( 400 );
wp_send_json( array(
'error' => $message,
) );
return $message;
}
/**
* Returns the params from $_POST or $_REQUEST
*
* @param $key
* @param null $default
*
* @return mixed|null|$default
*/
protected function param( $key, $default = null ) {
return isset( $_POST[ $key ] ) ? map_deep( $_POST[ $key ], 'sanitize_text_field' ) : ( isset( $_REQUEST[ $key ] ) ? map_deep( $_REQUEST[ $key ], 'sanitize_text_field' ) : $default );
}
public function handle() {
if ( ! check_ajax_referer( 'td_nm_admin_ajax_request', '_nonce', false ) ) {
$this->error( sprintf( __( 'Invalid request', 'thrive-dash' ) ) );
}
$route = $this->param( 'route' );
$route = preg_replace( '#([^a-zA-Z0-9-])#', '', $route );
$method_name = $route . '_action';
if ( ! method_exists( $this, $method_name ) ) {
$this->error( sprintf( __( 'Method %s not implemented', 'thrive-dash' ), $method_name ) );
}
return $this->{$method_name}();
}
public function notification_action() {
$model = json_decode( file_get_contents( 'php://input' ), true );
$method = empty( $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] ) ? 'GET' : sanitize_text_field( $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] );
switch ( $method ) {
case 'POST':
case 'PUT':
case 'PATCH':
if ( ! ( $item = td_nm_save_notification( $model ) ) ) {
$this->error( __( 'Notification could not be saved', 'thrive-dash' ) );
}
return $item;
break;
case 'DELETE':
$id = $this->param( 'ID' );
if ( empty( $id ) ) {
$this->error( __( 'Invalid parameters in delete', 'thrive-dash' ) );
}
if ( ( $deleted = td_nm_delete_notification( $id ) ) === false ) {
$this->error( __( 'Notification could not be deleted', 'thrive-dash' ) );
}
return $deleted;
break;
}
}
public function action_action() {
$model = json_decode( file_get_contents( 'php://input' ), true );
$model = tve_sanitize_data_recursive( $model, 'sanitize_textarea_field' );
$method = empty( $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] ) ? 'GET' : sanitize_text_field( $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] );
switch ( $method ) {
case 'POST':
case 'PUT':
case 'PATCH':
$old_actions = td_nm_get_actions( $model['notification_id'] );
$update_actions = $old_actions;
$id = null;
if ( is_numeric( $model['ID'] ) ) { //update because we have ID
$update_actions[ $model['ID'] ] = $model;
$id = $model['ID'];
} else { //push new model in array
$update_actions[] = $model;
$id = count( $update_actions ) - 1; // The first action index is 0.
}
if ( $old_actions == $update_actions ) {
return $id;
}
if ( td_nm_save_actions( $update_actions, $model['notification_id'] ) === false ) {
$this->error( __( 'Action could not be saved', 'thrive-dash' ) );
}
return $id;
break;
case 'DELETE':
$saved = false;
if ( ! is_numeric( $this->param( 'ID' ) ) || ! is_numeric( $this->param( 'notification_id' ) ) ) {
$this->error( __( 'Invalid parameters in delete', 'thrive-dash' ) );
}
$actions = td_nm_get_actions( $this->param( 'notification_id' ) );
if ( ! empty( $actions ) ) {
unset( $actions[ $this->param( 'ID' ) ] );
$actions = array_values( $actions );
foreach ( $actions as $key => &$item ) {
$item['ID'] = $key;
}
if ( ( $saved = td_nm_save_actions( $actions, $this->param( 'notification_id' ) ) ) === false ) {
$this->error( __( 'Action could not be deleted', 'thrive-dash' ) );
}
}
return $saved;
break;
}
}
public function trigger_action() {
$model = json_decode( file_get_contents( 'php://input' ), true );
$method = empty( $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] ) ? 'GET' : sanitize_text_field( $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] );
switch ( $method ) {
case 'POST':
case 'PUT':
case 'PATCH':
if ( ( $saved = td_nm_save_trigger( $model, $model['ID'] ) ) === false ) {
$this->error( __( 'Trigger could not be saved', 'thrive-dash' ) );
}
return $saved;
break;
}
}
/**
* Set which connection should be used for sending emails
* Updates an WP Option
*
* @return bool
*/
public function toggleservice_action() {
$connection = '';
if ( (int) $this->param( 'active' ) ) {
$connection = $this->param( 'service' );
}
update_option( 'tvd-nm-email-service', $connection );
return true;
}
/**
* Save API Connection by using API List Manager
*
* @return mixed
*/
public function setupconnection_action() {
$connection = Thrive_Dash_List_Manager::connection_instance( $this->param( 'api' ) );
$_POST['api'] = $this->param( 'api' );
$_POST['connection'] = $this->param( 'connection' );
if ( is_string( $saved = $connection->read_credentials() ) ) {
$this->error( $saved );
}
update_option( 'tvd-nm-email-service', $this->param( 'api' ) );
return $saved;
}
/**
* Tests an API Connection
*
* @return string
*/
public function connectiontest_action() {
$connection = Thrive_Dash_List_Manager::connection_instance( $this->param( 'service' ) );
return is_string( $tested = $connection->test_connection() ) ? $this->error( $tested ) : array( 'success' => __( 'Connection OK', 'thrive-dash' ) );
}
/**
* Deletes a wordpress notification from the post meta table
*
* @return bool
*/
public function deletenotification_action() {
$key = $this->param( 'key' );
if ( ! empty( $key ) && is_numeric( $key ) ) {
$return = array();
if ( $this->param( 'redirect' ) == true ) {
$post_meta_value = get_post_meta( $key, 'td_nm_wordpress_notification', true );
$return['redirect_url'] = $post_meta_value['url'];
}
$return['status'] = delete_post_meta( $key, 'td_nm_wordpress_notification' );
wp_send_json( $return );
} else {
$this->error( __( 'Invalid parameter type', 'thrive-dash' ) );
}
return false;
}
}

View File

@@ -0,0 +1,359 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-dashboard
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
/**
* Class TD_NM_Admin
*/
class TD_NM_Admin {
private $_dashboard_page = 'tve_dash_notification_manager';
public function __construct() {
add_action( 'init', array( $this, 'init' ) );
add_action( 'init', array( $this, 'includes' ) );
add_action( 'current_screen', array( $this, 'conditional_hooks' ) );
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
add_action( 'admin_notices', array( $this, 'td_nm_get_wordpress_notifications' ) );
}
public function init() {
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles' ) );
}
public function includes() {
}
public function enqueue_styles() {
tve_dash_enqueue_style( 'td-nm-admin', TD_NM()->url( 'assets/css/admin.css' ) );
}
public function enqueue_scripts() {
if ( tve_get_current_screen_key() === 'admin_page_tve_dash_notification_manager' ) {
$current_user = wp_get_current_user();
tve_dash_enqueue();
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'backbone' );
tve_dash_enqueue_script( 'td-nm-admin', TD_NM()->url( 'assets/js/admin/backbone.min.js' ), array(
'tve-dash-main-js',
'jquery',
'backbone',
), false, true );
$params = array(
't' => include TD_NM()->path( 'i18n.php' ),
'dash_url' => admin_url( 'admin.php?page=tve_dash_section' ),
'url' => TD_NM()->url(),
'trigger_types' => TD_NM()->get_trigger_types(),
'action_types' => TD_NM()->get_action_types(),
'tl' => array(
'groups' => $this->get_tl_groups(),
'shortcodes' => $this->get_tl_shortcodes(),
'thrive_boxes' => $this->get_tl_thrive_boxes(),
),
'tqb' => array(
'quizzes' => $this->get_quizzes(),
),
'current_user_email' => $current_user->user_email,
'message_shortcodes' => TD_NM()->get_message_shortcodes(),
'split_tests' => $this->get_split_tests(),
'admin_nonce' => wp_create_nonce( 'td_nm_admin_ajax_request' ),
'notifications' => td_nm_get_notifications(),
'email_services' => $this->get_email_services(),
);
wp_localize_script( 'td-nm-admin', 'TD_NM', $params );
}
}
public function get_quizzes() {
$quizzes = array();
if ( class_exists( 'TQB_Quiz_Manager' ) ) {
$temp_quizzes = TQB_Quiz_Manager::get_quizzes();
foreach ( $temp_quizzes as $quiz ) {
$quizzes[] = array(
'value' => $quiz->ID,
'label' => $quiz->post_title,
);
}
}
return $quizzes;
}
/**
* Hook into based on current screen
*/
public function conditional_hooks() {
$screen = tve_get_current_screen_key();
/**
* Main Dashboard section
*/
if ( $screen === 'toplevel_page_tve_dash_section' ) {
add_filter( 'tve_dash_filter_features', array( $this, 'admin_notification_feature' ) );
}
/**
* NM Dashboard
*/
if ( $screen === 'admin_page_tve_dash_notification_manager' ) {
add_action( 'admin_print_footer_scripts', array( $this, 'admin_backbone_templates' ) );
}
}
/**
* Push in the Notification Manager Feature to be displayed on Dashboard Thrive Features Section
*
* @param $features
*
* @return mixed
*/
public function admin_notification_feature( $features ) {
$features['notification_manager'] = array(
'icon' => 'tvd-icon-notification',
'title' => 'Notification Manager',
'description' => __( 'Receive notifications when certain events occur on your site', 'thrive-dash' ),
'btn_link' => add_query_arg( 'page', $this->_dashboard_page, admin_url( 'admin.php' ) ),
'btn_text' => __( "Manage Notifications", 'thrive-dash' ),
);
return $features;
}
/**
* Add page to admin menu so the page could be accessed
*/
public function admin_menu() {
add_submenu_page( '', __( 'Notification Manager', 'thrive-dash' ), __( 'Notification Manager', 'thrive-dash' ), TVE_DASH_CAPABILITY, $this->_dashboard_page, array(
$this,
'admin_dashboard',
) );
}
/**
* Main TD_NM page content
*/
public function admin_dashboard() {
ob_start(); ?>
<div id="tvd-nm-header"></div>
<div class="tvd-nm-breadcrumbs-wrapper" id="tvd-nm-breadcrumbs-wrapper"></div>
<div id="tvd-nm-wrapper"></div><?php
echo ob_get_clean(); // phpcs:ignore;
}
/**
* Append the backbone templates to source to be later used by Backbone scripts
*/
public function admin_backbone_templates() {
$templates = tve_dash_get_backbone_templates( TD_NM()->path( 'includes/admin/views/backbone' ) );
tve_dash_output_backbone_templates( $templates );
}
/**
* Get TL Groups if the plugin/function is available
*
* @return array
*/
public function get_tl_groups() {
$db = function_exists( 'tve_leads_get_groups' ) ? tve_leads_get_groups() : array();
$items = array();
foreach ( $db as $post ) {
$items[] = array(
'value' => $post->ID,
'label' => $post->post_title,
);
}
return $items;
}
/**
* Get TL Shortcodes if the plugin/function is available
*
* @return array
*/
public function get_tl_shortcodes() {
$db = function_exists( 'tve_leads_get_shortcodes' ) ? tve_leads_get_shortcodes() : array();
$items = array();
foreach ( $db as $post ) {
$items[] = array(
'value' => $post->ID,
'label' => $post->post_title,
);
}
return $items;
}
/**
* Get TL ThriveBoxes if the plugin/function is available
*
* @return array
*/
public function get_tl_thrive_boxes() {
$db = function_exists( 'tve_leads_get_two_step_lightboxes' ) ? tve_leads_get_two_step_lightboxes() : array();
$items = array();
foreach ( $db as $post ) {
$items[] = array(
'value' => $post->ID,
'label' => $post->post_title,
);
}
return $items;
}
public function get_split_tests() {
/** @var $tvedb Thrive_Leads_DB */
global $tvedb;
/** @var $tvedb Tho_Db */
global $thodb;
/** @var TQB_Database */
global $tqbdb;
$tests = array(
'tl' => array(),
'tho' => array(),
'tqb' => array(),
'tab' => array(),
);
if ( $tvedb ) {
$lead_tests = $tvedb->tve_leads_get_tests( array(
'status' => defined( 'TVE_LEADS_STATUS_RUNNING' ) ? TVE_LEADS_STATUS_RUNNING : 'running',
) );
foreach ( $lead_tests as $test ) {
$tests['tl'][] = array(
'value' => $test->id,
'label' => $test->title,
);
}
}
if ( $thodb ) {
$headline_tests = $thodb->get_tests( array( 'status' => THO_TEST_STATUS_ACTIVE ) );
foreach ( $headline_tests as $test ) {
$tests['tho'][] = array(
'value' => $test->id,
'label' => get_the_title( $test->post_id ),
);
}
}
if ( $tqbdb ) {
$tqb_tests = $tqbdb->get_tests( array(
'status' => 1,
) );
foreach ( $tqb_tests as $test ) {
$tests['tqb'][] = array(
'value' => $test['id'],
'label' => $test['title'],
);
}
}
if ( class_exists( 'Thrive_AB_Test_Manager' ) ) {
$tab_test_manager = new Thrive_AB_Test_Manager();
$tab_tests = $tab_test_manager->get_tests( array(
'status' => 'running',
) );
foreach ( $tab_tests as $test ) {
$tests['tab'][] = array(
'value' => $test['id'],
'label' => $test['title'],
);
}
}
return $tests;
}
public function get_email_services() {
$email_services = Thrive_Dash_List_Manager::get_available_apis( false, [ 'include_types' => [ 'email' ] ] );
$connected_services = Thrive_Dash_List_Manager::get_available_apis( true, [ 'include_types' => [ 'email' ] ] );
$connected_keys = array_keys( $connected_services );
$active_connection = get_option( 'tvd-nm-email-service' );
$items = array();
/**
* @var string $key
* @var Thrive_Dash_List_Connection_Abstract $instance
*/
foreach ( $email_services as $key => $instance ) {
$item = array(
'key' => $key,
'title' => $instance->get_title(),
'connected' => in_array( $key, $connected_keys ),
'active' => $key === $active_connection,
'status' => in_array( $key, $connected_keys ) ? __( 'connected', 'thrive-dash' ) : __( 'Unset', 'thrive-dash' ),
);
$items[] = $item;
}
return $items;
}
/**
* Displays WordPress notifications
*/
public function td_nm_get_wordpress_notifications() {
global $wpdb;
$results = $wpdb->get_results( "select post_id from $wpdb->postmeta where meta_key = 'td_nm_wordpress_notification'", ARRAY_A );
if ( ! empty( $results ) ) {
/*Enqueue Script*/
wp_enqueue_script( 'tve-nm-wordpress-notification-js', TD_NM()->url( 'assets/js/admin/wordpress_notification.js' ) );
$thrive_nm_special_routes = array(
'nonce' => wp_create_nonce( 'td_nm_admin_ajax_request' ),
'routes' => array(
'ajaxurl' => admin_url( 'admin-ajax.php' ),
),
);
wp_localize_script( 'tve-nm-wordpress-notification-js', 'ThriveNMWordpressNotification', $thrive_nm_special_routes );
foreach ( $results as $post ) {
$post_meta_value = get_post_meta( $post['post_id'], 'td_nm_wordpress_notification', true );
/**
* $post_meta_value['message'] can contain HTML tags
* The string can be of this form:
*
* A new quiz completion was registered. <a href="#">Click here to see the Quiz</a>
*/
printf( '<div data-key="%1$s" class="%2$s"><p>%3$s</p></div>', absint( $post['post_id'] ), 'notice notice-success td_nm_wordpress_notice is-dismissible', strip_tags( $post_meta_value['message'], '<a>' ) );
}
}
}
}
return new TD_NM_Admin();

View File

@@ -0,0 +1,8 @@
<div class="<#= item.get('disable') ? 'tvd-hide' : '' #> tvd-col tvd-s6 tvd-m3 tvd-nm-action-type" data-action-type="<#= item.get('key') #>">
<div class="tvd-center-align tvd-card tvd-white tvd-pointer">
<i class="<#= item.get('icon') #> tvd-nm-large-icon tvd-blue-text"></i>
<p class="tvd-center-align tvd-margin-bottom">
<#= item.get('label') #>
</p>
</div>
</div>

View File

@@ -0,0 +1,6 @@
<h4><?php echo __( 'Custom Script Settings', 'thrive-dash' ) ?></h4>
<p><?php echo sprintf( __( 'When the selected event occurs, Thrive will call the script and pass the event type and any associated data. %s', 'thrive-dash' ), '<a class="tvd-blue-text" target="_blank" href="https://thrivethemes.com/tkb_item/how-to-call-a-custom-script-using-the-notification-manager/">' . __( 'Learn more about how this works and what data is passed', 'thrive-dash' ) . '</a>' ) ?></p>
<div class="tvd-input-field">
<input id="tvd-nm-custom-script-url" type="text" data-bind="url" value="<#= item.get('url') #>">
<label for="tvd-nm-custom-script-url"><?php echo __( 'URL of Custom Script', 'thrive-dash' ) ?></label>
</div>

View File

@@ -0,0 +1,9 @@
<div id="tvd-nm-recipients-wrapper"></div>
<div class="tvd-row">
<div class="tvd-col12">
<a id="tvd-nm-add-recipient" class="tvd-btn-flat tvd-btn-flat-secondary tvd-btn-flat-blue tvd-btn-margin-top tvd-waves-effect tvd-right">
<?php echo __( 'Add recipient', 'thrive-dash' ) ?>
</a>
</div>
</div>
<div id="tvd-nm-message-wrapper"></div>

View File

@@ -0,0 +1,3 @@
<h4><?php echo __( 'WordPress Notification Settings', 'thrive-dash' ) ?></h4>
<p><?php echo __( 'When the selected event occurs, an WordPress notification will be displayed in Admin Dashboard section', 'thrive-dash' ) ?></p>
<div id="tvd-nm-message-wrapper"></div>

View File

@@ -0,0 +1,9 @@
<ul class="tvd-nm-breadcrumbs">
<# links.each( function( item, index ) { item.has_link = index < links.size() - 1 #>
<li class="tvd-breadcrumb <#= ( item.has_link ? '' : ' tvu-no-link' ) #>">
<# if ( item.has_link ) { #><a href="<#= item.get_url() #>"><# } #>
<#= _.escape ( item.get ( 'label' ) ) #>
<# if ( item.has_link ) { #></a><# } #>
</li>
<# } ) #>
</ul>

View File

@@ -0,0 +1,16 @@
<div class="tvd-row">
<div class="tvd-col tvd-s12 tvd-m12 tvd-l12">
<h3 class="tvd-title tvd-left">
<?php echo __( 'Notifications', 'thrive-dash' ) ?>
<a data-source="qCY1Gq9PZv4" class="tvd-open-video">
<span class="tvd-icon-play"></span>
</a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</h3>
<a href="javascript:void(0)" id="" class="tvd-left tvd-btn tvd-btn-blue tvd-waves-effect tvd-waves-light tvd-nm-create-notification">
<?php echo __( 'Add New', 'thrive-dash' ) ?>
</a>
</div>
</div>
<div id="tvd-nm-notifications-list"></div>

View File

@@ -0,0 +1,26 @@
<nav id="tvd-nav">
<div class="tvd-nav">
<div class="nav-wrapper">
<div class="tve-logo tvd-left">
<a href="<?php echo admin_url( 'admin.php?page=tve_dash_notification_manager' ) ?>"
title="<?php echo __( 'Thrive Notification Manager', 'thrive-dash' ) ?>">
<img alt="<?php echo __( 'Thrive logo', 'thrive-dash' ) ?>" src="<?php echo TVE_DASH_URL; ?>/css/images/thrive-logo.png"/>
</a>
</div>
<ul id="tvd-dash-submenu" class="tvd-right">
<li>
<a id="td-nm-email-services" href="javascript:void(0)">
<i class="tvd-icon-paper-plane"></i>
<?php echo __( 'Email Delivery Setup', 'thrive-dash' ) ?>
</a>
</li>
<li>
<a id="tvd-share-modal" class="tvd-modal-trigger" href="#tvd-modal1" data-overlay_class="tvd-white-bg" data-opacity=".95">
<span class="tvd-icon-heart"></span>
</a>
</li>
</ul>
</div>
</div>
</nav>
<?php include TVE_DASH_PATH . '/templates/share.phtml'; ?>

View File

@@ -0,0 +1,17 @@
<div class="tvd-row">
<div class="tvd-input-field">
<input id="tvd-nm-message-subject" type="text" data-bind="subject" data-field="subject" value="<#- item.get('subject') #>">
<label for="tvd-nm-message-subject"><?php echo __( 'Subject', 'thrive-dash' ) ?></label>
</div>
</div>
<div class="tvd-row">
<div class="tvd-input-field">
<textarea id="tvd-nm-message-content" class="tvd-materialize-textarea" data-bind="content" data-field="content"><#= item.get('content') #></textarea>
<label for="tvd-nm-message-content"><?php echo __( 'Message', 'thrive-dash' ) ?></label>
</div>
</div>
<div id="tvd-nm-message-shortcodes-wrapper">
<h4 class="tvd-nm-inline-display tvd-nm-toggle-display tvd-nm-toggle-display-text"><?php echo __( 'Hide available shortcodes', 'thrive-dash' ) ?></h4>
<span class="tvd-nm-icon-angle-down tvd-nm-inline-display tvd-right tvd-nm-toggle-display tvd-nm-toggle-display-icon"></span>
<div id="tvd-nm-message-shortcodes-container"></div>
</div>

View File

@@ -0,0 +1,17 @@
<div class="tvd-row tvd-copy-row">
<div class="tvd-col tvd-s3">
<div class="tvd-input-field tvd-margin-top-small">
<input readonly="readonly" type="text" value="<#= item.get('shortcode') #>" class="tvd-no-margin tvd-copy">
</div>
</div>
<div class="tvd-col tvd-s2">
<span class="">
<a class="tvd-waves-effect tvd-waves-light tvd-btn tvd-btn-blue tvd-btn-small tvd-margin-top-small tvd-copy-to-clipboard" href="javascript:void(0)">
<span class="tvd-copy-text"><?php echo __( 'Copy', 'thrive-dash' ) ?></span>
</a>
</span>
</div>
<div class="tvd-col tvd-s7 tvd-ver">
<span class="tvd-small-text tvd-nm-shortcode-label"><#= item.get('label') #></span>
</div>
</div>

View File

@@ -0,0 +1,23 @@
<div class="tvd-modal-content">
<h3 class="tvd-modal-title"><?php echo __( 'Add New Action', 'thrive-dash' ) ?></h3>
<div id="tvd-nm-notification-summary"></div>
<p><?php echo __( 'Select what action you want to be performed and fill the required fields. A notification accepts only one action for each type.', 'thrive-dash' ) ?></p>
<div id="tvd-nm-action-types" class="tvd-row tvd-collapse"></div>
<div id="tvd-nm-action-settings"></div>
</div>
<div class="tvd-modal-footer">
<div class="tvd-row">
<div class="tvd-col tvd-s12 tvd-m6">
<a href="javascript:void(0)"
class="tvd-btn-flat tvd-btn-flat-secondary tvd-btn-flat-dark tvd-waves-effect tvd-modal-close">
<?php echo __( 'Cancel', 'thrive-dash' ) ?>
</a>
</div>
<div class="tvd-col tvd-s6">
<a href="javascript:void(0)"
class="tvd-waves-effect tvd-waves-light tvd-btn tvd-btn-green tvd-right tvd-modal-submit">
<?php echo __( 'Save Action', 'thrive-dash' ) ?>
</a>
</div>
</div>
</div>

View File

@@ -0,0 +1,49 @@
<div class="tvd-nm-modal-step">
<div class="tvd-modal-content">
<h3 class="tvd-modal-title"><?php echo __( "Create New Notification", 'thrive-dash' ) ?></h3>
<p><?php echo __( 'Step 1: Set your Trigger', 'thrive-dash' ) ?></p>
<div id="tvd-nm-trigger-types" class="tvd-row tvd-collapse"></div>
<div id="tvd-nm-trigger-settings" class="tvd-row tvd-collapse"></div>
</div>
<div class="tvd-modal-footer">
<div class="tvd-row">
<div class="tvd-col tvd-s12 tvd-m6">
<a href="javascript:void(0)"
class="tvd-btn-flat tvd-btn-flat-secondary tvd-btn-flat-dark tvd-waves-effect tvd-modal-close">
<?php echo __( 'Cancel', 'thrive-dash' ) ?>
</a>
</div>
<div class="tvd-col tvd-s12 tvd-m6">
<a href="javascript:void(0)"
class="tvd-waves-effect tvd-waves-light tvd-btn tvd-btn-green tvd-right tvd-nm-modal-next-step">
<?php echo __( 'Save and continue', 'thrive-dash' ) ?>
</a>
</div>
</div>
</div>
</div>
<div class="tvd-nm-modal-step">
<div class="tvd-modal-content">
<h3 class="tvd-modal-title"><?php echo __( "Create New Notification", 'thrive-dash' ) ?></h3>
<div id="tvd-nm-notification-summary"></div>
<p><?php echo __( 'Step 2: Set the action to be performed', 'thrive-dash' ) ?></p>
<div id="tvd-nm-action-types" class="tvd-row tvd-collapse"></div>
<div id="tvd-nm-action-settings"></div>
</div>
<div class="tvd-modal-footer">
<div class="tvd-row">
<div class="tvd-col tvd-s12 tvd-m6">
<a href="javascript:void(0)"
class="tvd-btn-flat tvd-btn-flat-secondary tvd-btn-flat-dark tvd-waves-effect tvd-nm-modal-prev-step">
<?php echo __( 'Back', 'thrive-dash' ) ?>
</a>
</div>
<div class="tvd-col tvd-s12 tvd-m6">
<a href="javascript:void(0)"
class="tvd-waves-effect tvd-waves-light tvd-btn tvd-btn-green tvd-right tvd-modal-submit">
<?php echo __( 'Save notification', 'thrive-dash' ) ?>
</a>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,23 @@
<div class="tvd-modal-content tvd-red">
<h3 class="tvd-modal-title tvd-center-align tvd-white-text">
<?php echo __( 'Are you sure you want to remove this?', 'thrive-dash' ); ?>
</h3>
<div class="tvd-v-spacer"></div>
</div>
<div class="tvd-modal-footer tvd-red">
<div class="tvd-row">
<div class="tvd-col tvd-s12 tvd-m6">
<a href="javascript:void(0)"
class="tvd-nm-delete-yes tvd-btn-flat tvd-btn-flat-secondary tvd-btn-flat-light tvd-left">
<?php echo __( 'YES, DELETE IT', 'thrive-dash' ); ?>
</a>
</div>
<div class="tvd-col tvd-s12 tvd-m6">
<a href="javascript:void(0)"
class="tvd-btn-flat tvd-btn-flat tvd-btn-flat-primary tvd-btn-flat-light tvd-right tvd-modal-close">
<?php echo __( 'NO, KEEP IT', 'thrive-dash' ); ?>
</a>
</div>
</div>
</div>
<a href="javascript:void(0)" class="tvd-modal-action tvd-modal-close tvd-modal-close-x tvd-white-text"><i class="tvd-icon-close2"></i></a>

View File

@@ -0,0 +1,22 @@
<div class="tvd-modal-content">
<h3 class="tvd-modal-title"></h3>
<div class="tvd-v-spacer"></div>
<div id="tvd-nm-action-types" class="tvd-row tvd-collapse"></div>
<div id="tvd-nm-action-settings"></div>
</div>
<div class="tvd-modal-footer">
<div class="tvd-row">
<div class="tvd-col tvd-s12 tvd-m6">
<a href="javascript:void(0)"
class="tvd-btn-flat tvd-btn-flat-secondary tvd-btn-flat-dark tvd-waves-effect tvd-modal-close">
<?php echo __( 'Cancel', 'thrive-dash' ) ?>
</a>
</div>
<div class="tvd-col tvd-s6">
<a href="javascript:void(0)"
class="tvd-waves-effect tvd-waves-light tvd-btn tvd-btn-green tvd-right tvd-modal-submit">
<?php echo __( 'Save Action', 'thrive-dash' ) ?>
</a>
</div>
</div>
</div>

View File

@@ -0,0 +1,21 @@
<div class="tvd-modal-content">
<h3 class="tvd-modal-title"><?php echo __( "Edit trigger", 'thrive-dash' ) ?></h3>
<div id="tvd-nm-trigger-types" class="tvd-row tvd-collapse"></div>
<div id="tvd-nm-trigger-settings" class="tvd-row tvd-collapse"></div>
</div>
<div class="tvd-modal-footer">
<div class="tvd-row">
<div class="tvd-col tvd-s12 tvd-m6">
<a href="javascript:void(0)"
class="tvd-btn-flat tvd-btn-flat-secondary tvd-btn-flat-dark tvd-waves-effect tvd-modal-close">
<?php echo __( 'Cancel', 'thrive-dash' ) ?>
</a>
</div>
<div class="tvd-col tvd-s12 tvd-m6">
<a href="javascript:void(0)"
class="tvd-waves-effect tvd-waves-light tvd-btn tvd-btn-green tvd-right tvd-modal-submit">
<?php echo __( 'Save Trigger', 'thrive-dash' ) ?>
</a>
</div>
</div>
</div>

View File

@@ -0,0 +1,64 @@
<div class="tvd-nm-modal-step">
<div class="tvd-modal-content">
<h3 class="tvd-modal-title"><?php echo __( "Email Delivery Setup", 'thrive-dash' ) ?></h3>
<p id="tvd-nm-connections-text"><?php echo __( 'Your existing connections', 'thrive-dash' ) ?></p>
<ul id="tvd-nm-connected-list"></ul>
<button class="tvd-btn-flat-blue tvd-btn-flat tvd-waves-effect tvd-nm-modal-next-step">
<span class="tvd-icon-plus tvd-icon-small"></span><?php echo __( 'Add New', 'thrive-dash' ) ?>
</button>
</div>
<div class="tvd-modal-footer">
<div class="tvd-row">
<div class="tvd-col tvd-s12">
<a href="javascript:void(0)"
class="tvd-waves-effect tvd-waves-light tvd-btn tvd-btn-green tvd-right tvd-modal-close">
<?php echo __( 'OK', 'thrive-dash' ) ?>
</a>
</div>
</div>
</div>
</div>
<div class="tvd-nm-modal-step">
<div class="tvd-modal-content">
<h3 class="tvd-modal-title"><?php echo __( "Email Delivery Setup", 'thrive-dash' ) ?></h3>
<p><?php echo __( 'Select the email delivery service you want to use for Send Email Notification Actions. Integrating one of these services ensures your emails get delivered without you needing to deal with email server setups and spam protection', 'thrive-dash' ) ?></p>
<div id="tvd-nm-connections-list" class="tvd-row"></div>
</div>
<div class="tvd-modal-footer">
<div class="tvd-row">
<div class="tvd-col tvd-s12 tvd-m6">
<a href="javascript:void(0)" class="tvd-btn-flat-blue tvd-btn-flat tvd-waves-effect tvd-nm-modal-prev-step">
<?php echo __( 'Back', 'thrive-dash' ) ?>
</a>
</div>
</div>
</div>
</div>
<div class="tvd-nm-modal-step">
<div class="tvd-modal-content">
<h3 class="tvd-modal-title"><?php echo __( "Email Delivery Setup", 'thrive-dash' ) ?></h3>
<p><?php echo __( "Fill the form's fields with your credentials and click the Connect button to establish the connection.", 'thrive-dash' ) ?></p>
<div id="tvd-nm-connection-form" class="tvd-row tvd-collapse"></div>
</div>
<div class="tvd-modal-footer">
<div class="tvd-row">
<div class="tvd-col tvd-s12 tvd-m6">
<a href="javascript:void(0)" class="tvd-btn-flat tvd-btn-flat-secondary tvd-btn-flat-dark tvd-waves-effect tvd-nm-modal-prev-step">
<?php echo __( 'Cancel', 'thrive-dash' ) ?>
</a>
</div>
<div class="tvd-col tvd-s12 tvd-m6">
<a href="javascript:void(0)"
class="tvd-waves-effect tvd-waves-light tvd-btn tvd-btn-green tvd-right tvd-nm-save-connection">
<?php echo __( 'Connect', 'thrive-dash' ) ?>
</a>
</div>
</div>
</div>
</div>
<?php foreach ( Thrive_Dash_List_Manager::get_available_apis( false, [ 'include_types' => [ 'email' ] ] ) as $key => $api ) : ?>
<?php /** @var $api Thrive_Dash_List_Connection_Abstract */ ?>
<div class="tvd-nm-connection-form" data-key="<?php echo $key ?>" style="display: none">
<?php echo $api->output_setup_form() ?>
</div>
<?php endforeach; ?>

View File

@@ -0,0 +1,23 @@
<div class="tvd-col tvd-s4">
<div class="tvd-card tvd-white tvd-small tvd-valign-wrapper">
<div class="tvd-card-content tvd-center-align tvd-valign">
<span class="tvd-nm-large-icon tvd-green-text <#= trigger.get('icon') #>"></span>
<p>
<#= trigger.get('label') #>
</p>
</div>
</div>
</div>
<# if(action !== null){ #>
<div class="tvd-col tvd-s4">
<div class="tvd-card tvd-white tvd-small tvd-valign-wrapper">
<div class="tvd-card-content tvd-center-align tvd-valign">
<span class="tvd-nm-large-icon tvd-green-text <#= action.get('icon') #>"></span>
<p>
<#= action.get('label') #>
</p>
</div>
</div>
</div>
<# } #>

View File

@@ -0,0 +1,6 @@
<div class="tvd-card tvd-card-new tvd-valign-wrapper">
<div class="tvd-card-content tvd-valign tvd-center-align">
<i class="tvd-icon-plus tvd-icon-rounded tvd-icon-medium"></i>
<h4 class="tvd-nm-new-button-header-text"><?php echo __( 'Add New Notification', 'thrive-dash' ) ?></h4>
</div>
</div>

View File

@@ -0,0 +1,4 @@
<div class="tvd-col tvd-s3 tvd-m3" id="tvd-nm-trigger-wrapper"></div>
<div class="tvd-col tvd-s9 tvd-m9">
<div class="tvd-row" id="tvd-nm-actions-wrapper"></div>
</div>

View File

@@ -0,0 +1,3 @@
<a class="tvd-btn-icon-only tvd-btn-icon-only-red tvd-right tvd-nm-delete-notification tvd-tooltipped" data-position="top" data-tooltip="<?php echo __( 'Delete notification', 'thrive-dash' ); ?>" href="javascript:void(0)">
<i class="tvd-icon-trash-o"></i>
</a>

View File

@@ -0,0 +1,4 @@
<input type="checkbox" id="tvd-nm-checkbox-<#= item.get('value') #>-<#= item.cid #>" data-id="<#= item.get('value') #>">
<label for="tvd-nm-checkbox-<#= item.get('value') #>-<#= item.cid #>" title="<#= item.get('label') #>" class="tvd-nm-checkbox-label">
<#= item.get('label') #>
</label>

View File

@@ -0,0 +1,13 @@
<div class="tvd-col tvd-s9">
<div class="tvd-input-field">
<input id="tvd-nm-option-input-<#= item.cid #>" type="email" value="<#= item.get('value') #>" data-bind="value">
<label for="tvd-nm-option-input-<#= item.cid #>" class="tvd-active">
<#= item.get('label') #>
</label>
</div>
</div>
<div class="tvd-col tvd-s3">
<a href="javascript:void(0)" class="tvd-nm-remove-recipient tvd-btn-flat tvd-btn-flat-secondary tvd-btn-flat-gray tvd-btn-margin-top tvd-waves-effect tvd-full-btn">
<?php echo __( 'Remove', 'thrive-dash' ) ?>
</a>
</div>

View File

@@ -0,0 +1,4 @@
<input id="tvd-nm-option-input-<#= item.get('cId') #>" type="text" value="<#= item.get('value') #>" data-bind="value">
<label label="tvd-nm-option-input-<#= item.get('cId') #>">
<#= item.get('label') #>
</label>

View File

@@ -0,0 +1,8 @@
<div>
Value:
<#= item.get('value') #>
</div>
<div>
Label:
<#= item.get('label') #>
</div>

View File

@@ -0,0 +1,3 @@
<span class="tvd-chip">
<#= item.get('value') #>
</span>

View File

@@ -0,0 +1,48 @@
<ul class="tvd-collection <#= item.get('active') ? 'tvd-nm-selected-service' : '' #>">
<li class="tvd-collection-item">
<div class="tvd-row tvd-collapse">
<div class="tvd-col tvd-s3">
<div class="tvd-vertical-align">
<img alt="<?php echo __( 'Autoresponder logo', 'thrive-dash' ) ?>" src="<?php echo TVE_DASH_URL . '/inc/auto-responder/views/images/' ?><#= item.get('key') #>_small.jpg">
<strong class="tvd-capitalize">
<#= item.get('title') #>
</strong>
</div>
</div>
<div class="tvd-col tvd-s4">
<div class="tvd-row">
<div class="tvd-col tvd-l4">
<div class="tvd-switch tvd-vertical-align">
<label>
<input data-key="<#= item.get('key') #>"
<#= item.get('active') ? 'checked' : '' #> class="tvd-nm-toggle-service" type="checkbox" autocomplete="off">
<span class="tvd-lever"></span>
</label>
</div>
</div>
<div class="tvd-col tvd-l8">
<strong class="tvd-vertical-align tvd-capitalize">
<#= item.get('status') #>,
<#= item.get('active') ? TD_NM.t.active : TD_NM.t.inactive #>
</strong>
</div>
</div>
</div>
<div class="tvd-col tvd-s4">
<span class="tvd-vertical-align">
<span class="tvd-icon-exchange tvd-text-gray"></span>
<a class="tvd-underline tvd-nm-connection-test" data-key="<#= item.get('key') #>" title="<?php echo __( 'Test connection', 'thrive-dash' ) ?>" href="javascript:void(0)">
<?php echo __( 'Test connection', 'thrive-dash' ) ?>
</a>
</span>
</div>
<div class="tvd-col tvd-s1">
<div class="tvd-vertical-align">
<a href="javascript:void(0)" class="tvd-right tvd-nm-connection" data-key="<#= item.get('key') #>">
<span class="tvd-icon-pencil"></span>
</a>
</div>
</div>
</div>
</li>
</ul>

View File

@@ -0,0 +1,7 @@
<div class="tvd-col tvd-s3 tvd-center-align">
<a href="javascript:void(0)" data-key="<#= item.get('key') #>" class="tvd-nm-connection tvd-nm-connection-<#= item.get('key') #> <#= item.get('connected') ? 'tvd-nm-connected' : '' #>"></a>
<span class="tvd-nm-connection-name">
<#= item.get('title') #><br>
<span class=""><#= item.get('connected') ? '(connected)' : '&nbsp;' #></span>
</span>
</div>

View File

@@ -0,0 +1,3 @@
<div class="tvd-card tvd-white tvd-small tvd-valign-wrapper">
summary item
</div>

View File

@@ -0,0 +1,15 @@
<div class="tvd-card-content tvd-center-align tvd-valign">
<div class="tvd-nm-action-buttons">
<a class="tvd-nm-blue-gray-text" href="javascript:void(0)">
<i class="tvd-icon-pencil tvd-left"></i>
</a>
<a class="tvd-nm-blue-gray-text" href="javascript:void(0)">
<i class="tvd-icon-trash-o"></i>
</a>
</div>
<i class="<#= item.get('icon') #> tvd-nm-large-icon tvd-blue-text"></i>
<p>
<#- item.get('label') #>
</p>
</div>

View File

@@ -0,0 +1,26 @@
<div class="tvd-card-content tvd-valign">
<div class="tvd-nm-action-buttons">
<a class="tvd-btn-icon-only tvd-btn-icon-only-blue tvd-nm-action-edit" href="javascript:void(0)">
<i class="tvd-icon-pencil tvd-left"></i>
</a>
<a class="tvd-btn-icon-only tvd-btn-icon-only-red tvd-nm-action-delete" href="javascript:void(0)">
<i class="tvd-icon-trash-o"></i>
</a>
</div>
<h4><?php echo __( 'Call custom script', 'thrive-dash' ) ?></h4>
<div class="tvd-row tvd-copy-row">
<div class="tvd-col tvd-s8">
<div class="tvd-input-field tvd-margin-top-small">
<input readonly="readonly" type="text" value="<#= item.get('url') #>" class="tvd-no-margin tvd-copy">
</div>
</div>
<div class="tvd-col tvd-s4">
<span class="">
<a class="tvd-waves-effect tvd-waves-light tvd-btn tvd-btn-blue tvd-btn-small tvd-margin-top-small tvd-copy-to-clipboard" href="javascript:void(0)">
<span class="tvd-copy-text"><?php echo __( 'Copy', 'thrive-dash' ) ?></span>
</a>
</span>
</div>
</div>
</div>

View File

@@ -0,0 +1,26 @@
<div class="tvd-card-content tvd-valign">
<div class="tvd-nm-action-buttons">
<a class="tvd-btn-icon-only tvd-btn-icon-only-blue tvd-nm-action-edit" href="javascript:void(0)">
<i class="tvd-icon-pencil tvd-left"></i>
</a>
<a class="tvd-btn-icon-only tvd-btn-icon-only-red tvd-nm-action-delete" href="javascript:void(0)">
<i class="tvd-icon-trash-o"></i>
</a>
</div>
<div>
<span><?php echo __( 'Email subject line:', 'thrive-dash' ) ?></span>
<span>
<strong>
<# if(item.get('message').get('subject').length >= 20){ #>
<#- item.get('message').get('subject').substring(0, 17) #>...
<# }else{ #>
<#- item.get('message').get('subject') #>
<# } #>
</strong>
</span>
</div>
<div class="tvd-nm-emails-list">
<span><?php echo __( 'To:', 'thrive-dash' ) ?></span>
</div>
</div>

View File

@@ -0,0 +1,26 @@
<div class="tvd-card-content tvd-valign">
<div class="tvd-nm-action-buttons">
<a class="tvd-btn-icon-only tvd-btn-icon-only-blue tvd-nm-action-edit" href="javascript:void(0)">
<i class="tvd-icon-pencil tvd-left"></i>
</a>
<a class="tvd-btn-icon-only tvd-btn-icon-only-red tvd-nm-action-delete" href="javascript:void(0)">
<i class="tvd-icon-trash-o"></i>
</a>
</div>
<h4><?php echo __( 'WordPress Notification', 'thrive-dash' ) ?></h4>
<div class="tvd-row tvd-copy-row">
<div class="tvd-col tvd-s8">
<div class="tvd-input-field tvd-margin-top-small">
<input readonly="readonly" type="text" value="<#= item.get('message').get('content') #>" class="tvd-no-margin tvd-copy">
</div>
</div>
<div class="tvd-col tvd-s4">
<span class="">
<a class="tvd-waves-effect tvd-waves-light tvd-btn tvd-btn-blue tvd-btn-small tvd-margin-top-small tvd-copy-to-clipboard" href="javascript:void(0)">
<span class="tvd-copy-text"><?php echo __( 'Copy', 'thrive-dash' ) ?></span>
</a>
</span>
</div>
</div>
</div>

View File

@@ -0,0 +1,8 @@
<div class="tvd-card tvd-white tvd-small tvd-valign-wrapper <#= item.get('class') #>">
<div class="tvd-card-content tvd-center-align tvd-valign">
<i class="<#= item.get('icon') #> tvd-nm-large-icon <#= item.get('color') #>"></i>
<p>
<#= item.get('label') #>
</p>
</div>
</div>

View File

@@ -0,0 +1,12 @@
<div class="tvd-card-content tvd-center-align tvd-valign">
<div class="tvd-nm-action-buttons">
<a class="tvd-btn-icon-only tvd-btn-icon-only-blue tvd-nm-edit-trigger" href="javascript:void(0)">
<i class="tvd-icon-pencil"></i>
</a>
</div>
<i class="<#= item.get('icon') #> tvd-nm-large-icon tvd-green-text"></i>
<p>
<#= item.get('label') #>
</p>
</div>

View File

@@ -0,0 +1,8 @@
<div class="tvd-col tvd-s6 tvd-m3 tvd-nm-trigger-type" data-trigger-type="<#= item.get('key') #>">
<div class="tvd-center-align tvd-card tvd-white tvd-pointer">
<i class="<#= item.get('icon') #> tvd-nm-large-icon tvd-green-text"></i>
<p class="tvd-center-align tvd-margin-bottom">
<#= item.get('label') #>
</p>
</div>
</div>

View File

@@ -0,0 +1,5 @@
<h4><?php echo __( 'Email Sign Up Settings', 'thrive-dash' ) ?></h4>
<p><?php echo __( 'Which source of email sign up should trigger the notification?', 'thrive-dash' ) ?></p>
<div id="tvd-nm-lead-groups-wrapper" class="tvd-row"></div>
<div id="tvd-nm-lead-shortcodes-wrapper" class="tvd-row"></div>
<div id="tvd-nm-lead-thrive-boxes-wrapper" class="tvd-row"></div>

View File

@@ -0,0 +1,3 @@
<h4><?php echo __( 'New Quiz Completion', 'thrive-dash' ) ?></h4>
<p><?php echo __( 'Receive a notification when someone completes a quiz on your website', 'thrive-dash' ) ?></p>
<div id="tvd-nm-quizzes-wrapper" class="tvd-row"></div>

View File

@@ -0,0 +1,6 @@
<h4><?php echo __( 'A/B Test Ends Settings', 'thrive-dash' ) ?></h4>
<p><?php echo __( 'Which sort of A/B test should trigger the notification?', 'thrive-dash' ) ?></p>
<div id="tvd-nm-tl-tests-wrapper" class="tvd-row"></div>
<div id="tvd-nm-tho-tests-wrapper" class="tvd-row"></div>
<div id="tvd-nm-tqb-tests-wrapper" class="tvd-row"></div>
<div id="tvd-nm-tab-tests-wrapper" class="tvd-row"></div>

View File

@@ -0,0 +1,2 @@
<h4><?php echo __( 'New Testimonial Submission', 'thrive-dash' ) ?></h4>
<p><?php echo __( 'Receive a notification when someone submits a testimonial via one of the testimonial capture forms on your website.', 'thrive-dash' ) ?></p>

View File

@@ -0,0 +1,22 @@
<?php
$unavailable_tooltip_text = __( 'This feature is only available for Thrive Leads, Thrive Ovation, Thrive Headline Optimizer, Thrive Quiz Builder', 'thrive-dash' );
?>
<div class="tvd-row">
<div class="tvd-col tvd-s12 tvd-m12 tvd-l12">
<h3 class="tvd-title tvd-left">
<?php echo __( 'Notifications', 'thrive-dash' ) ?>
<a class="tvd-open-video" data-source="qCY1Gq9PZv4">
<span class="tvd-icon-play"></span>
</a>
</h3>
<a style="margin-left: 30px;" href="javascript:void(0)" data-position="top" data-tooltip="<?php echo $unavailable_tooltip_text; ?>" class="tvd-disabled tvd-left tvd-btn tvd-btn-blue tvd-waves-effect tvd-waves-light tvd-tooltipped">
<?php echo __( 'Add New', 'thrive-dash' ) ?>
</a>
</div>
</div>
<div class="tvd-card tvd-card-new tvd-valign-wrapper tvd-tooltipped" data-position="top" data-tooltip="<?php echo $unavailable_tooltip_text; ?>">
<div class="tvd-card-content tvd-valign tvd-center-align">
<i class="tvd-icon-plus tvd-icon-rounded tvd-icon-medium"></i>
<h4><?php echo __( 'Add New Notification', 'thrive-dash' ) ?></h4>
</div>
</div>

View File

@@ -0,0 +1,46 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-dashboard
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
class TD_NM_Ajax {
public static function init() {
static::add_ajax_events();
}
public static function add_ajax_events() {
$ajax_events = array(
'admin_controller' => false,
);
foreach ( $ajax_events as $ajax_event => $nopriv ) {
add_action( 'wp_ajax_td_nm_' . $ajax_event, array( __CLASS__, $ajax_event ) );
if ( $nopriv ) {
add_action( 'wp_ajax_nopriv_td_nm_' . $ajax_event, array( __CLASS__, $ajax_event ) );
}
}
}
/**
* All ajax requests for admin will be managed by admin ajax controller
* Dies with json response
*/
public static function admin_controller() {
if ( ! current_user_can( TVE_DASH_CAPABILITY ) ) {
wp_die( '' );
}
include_once TD_NM()->path( 'includes/admin/class-td-nm-admin-ajax-controller.php' );
$response = TD_NM_Admin_Ajax_Controller::instance()->handle();
wp_send_json( $response );
}
}
TD_NM_Ajax::init();

View File

@@ -0,0 +1,235 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-dashboard
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
class TD_NM_Checker {
protected static $instance;
protected function __construct() {
$this->init_hooks();
}
public function init_hooks() {
add_action( 'tve_leads_form_conversion', array( __CLASS__, 'on_email_sign_up' ), 10, 5 );
add_action( 'tve_leads_action_set_test_item_winner', array( $this, 'on_split_test_ends' ), 10, 2 );
add_action( 'tho_action_set_test_item_winner', array( $this, 'on_split_test_ends' ), 10, 2 );
add_action( 'tab_action_set_test_item_winner', array( $this, 'on_split_test_ends' ), 10, 2 );
add_action( 'tqb_split_test_ends', array( $this, 'on_split_test_ends' ), 10, 2 );
add_action( 'tvo_testimonial_added_through_capture_form', array( $this, 'on_testimonial_added' ), 10, 2 );
add_action( 'tqb_quiz_completed', array( $this, 'on_quiz_completion' ), 10, 2 );
}
public static function instance() {
if ( ! static::$instance ) {
static::$instance = new self();
}
return static::$instance;
}
public function on_quiz_completion( $quiz, $user ) {
$notifications = td_nm_get_notifications( array(
'meta_key' => 'td_nm_trigger_type',
'meta_value' => 'quiz_completion',
) );
$data = func_get_args();
foreach ( $notifications as $notification ) {
$trigger = new TD_NM_Trigger_Quiz_Completion( $notification->trigger['settings'] );
if ( $trigger->applicable_on_data( $quiz ) ) {
static::instance()->execute_quiz_completion_actions( $notification->actions, $data );
}
}
}
public static function on_email_sign_up( $tl_item, $tl_form_type, $tl_variation, $tl_test, $optin_data ) {
$notifications = td_nm_get_notifications( array(
'meta_key' => 'td_nm_trigger_type',
'meta_value' => 'email_sign_up',
) );
$sign_up_data = func_get_args();
foreach ( $notifications as $notification ) {
$trigger = new TD_NM_Trigger_Email_Sign_Up( $notification->trigger['settings'] );
if ( $trigger->applicable_on_data( $tl_item ) ) {
static::instance()->execute_sign_up_actions( $notification->actions, $sign_up_data );
}
}
}
public function on_split_test_ends( $test_item, $test ) {
$notifications = td_nm_get_notifications( array(
'meta_key' => 'td_nm_trigger_type',
'meta_value' => 'split_test_ends',
) );
$test_data = func_get_args();
foreach ( $notifications as $notification ) {
$trigger = new TD_NM_Trigger_Split_Test_Ends( $notification->trigger['settings'] );
if ( $trigger->applicable_on_data( $test ) ) {
$this->execute_split_test_ends_actions( $notification->actions, $test_data );
}
}
}
public function on_testimonial_added( $testimonial, $extra_data ) {
$notifications = td_nm_get_notifications( array(
'meta_key' => 'td_nm_trigger_type',
'meta_value' => 'testimonial_submitted',
) );
$testimonial_data = func_get_args();
foreach ( $notifications as $notification ) {
$trigger = new TD_NM_Trigger_Testimonial_Submitted( $notification->trigger['settings'] );
if ( $trigger->applicable_on_data( $extra_data ) ) {
$this->execute_testimonial_submitted_actions( $notification->actions, $testimonial_data );
}
}
}
public function execute_sign_up_actions( $actions, $sign_up_data ) {
foreach ( $actions as $item ) {
/** @var TD_NM_Action_Abstract $action */
$action = null;
$prepared_data = array();
/**
* ugly way to instantiate the action but we have to make sure it works in PHP 5.2
*/
switch ( $item['type'] ) {
case 'custom_script':
/** @var TD_NM_Action_Custom_Script $action */
$action = new TD_NM_Action_Custom_Script( $item );
$prepared_data = $action->prepare_email_sign_up_data( $sign_up_data );
break;
case 'send_email_notification':
/** @var TD_NM_Action_Send_Email_Notification $action */
$action = new TD_NM_Action_Send_Email_Notification( $item );
$prepared_data = $action->prepare_email_sign_up_data( $sign_up_data );
break;
case 'wordpress_notification':
/** @var TD_NM_Action_Wordpress_Notification $action */
$action = new TD_NM_Action_Wordpress_Notification( $item );
$prepared_data = $action->prepare_email_sign_up_data( $sign_up_data );
break;
}
if ( $action ) {
$action->execute( $prepared_data );
}
}
}
public function execute_quiz_completion_actions( $actions, $data ) {
foreach ( $actions as $item ) {
/** @var TD_NM_Action_Abstract $action */
$action = null;
$prepared_data = array();
/**
* ugly way to instantiate the action but we have to make sure it works in PHP 5.2
*/
switch ( $item['type'] ) {
case 'custom_script':
/** @var TD_NM_Action_Custom_Script $action */
$action = new TD_NM_Action_Custom_Script( $item );
$prepared_data = $action->prepare_quiz_completion_data( $data );
break;
case 'send_email_notification':
/** @var TD_NM_Action_Send_Email_Notification $action */
$action = new TD_NM_Action_Send_Email_Notification( $item );
$prepared_data = $action->prepare_quiz_completion_data( $data );
break;
case 'wordpress_notification':
/** @var TD_NM_Action_Wordpress_Notification $action */
$action = new TD_NM_Action_Wordpress_Notification( $item );
$prepared_data = $action->prepare_quiz_completion_data( $data );
break;
}
if ( $action ) {
$action->execute( $prepared_data );
}
}
}
public function execute_split_test_ends_actions( $actions, $test_data ) {
foreach ( $actions as $item ) {
/** @var TD_NM_Action_Abstract $action */
$action = null;
$prepared_data = array();
/**
* ugly way to instantiate the action but we have to make sure it works in PHP 5.2
*/
switch ( $item['type'] ) {
case 'custom_script':
/** @var TD_NM_Action_Custom_Script $action */
$action = new TD_NM_Action_Custom_Script( $item );
$prepared_data = $action->prepare_split_test_ends_data( $test_data );
break;
case 'send_email_notification':
/** @var TD_NM_Action_Send_Email_Notification $action */
$action = new TD_NM_Action_Send_Email_Notification( $item );
$prepared_data = $action->prepare_split_test_ends_data( $test_data );
break;
case 'wordpress_notification':
/** @var TD_NM_Action_Wordpress_Notification $action */
$action = new TD_NM_Action_Wordpress_Notification( $item );
$prepared_data = $action->prepare_split_test_ends_data( $test_data );
break;
}
if ( $action ) {
$action->execute( $prepared_data );
}
}
}
public function execute_testimonial_submitted_actions( $actions, $testimonial_data ) {
foreach ( $actions as $item ) {
/** @var TD_NM_Action_Abstract $action */
$action = null;
$prepared_data = array();
/**
* ugly way to instantiate the action but we have to make sure it works in PHP 5.2
*/
switch ( $item['type'] ) {
case 'custom_script':
/** @var TD_NM_Action_Custom_Script $action */
$action = new TD_NM_Action_Custom_Script( $item );
$prepared_data = $action->prepare_testimonial_submitted_data( $testimonial_data );
break;
case 'send_email_notification':
/** @var TD_NM_Action_Send_Email_Notification $action */
$action = new TD_NM_Action_Send_Email_Notification( $item );
$prepared_data = $action->prepare_testimonial_submitted_data( $testimonial_data );
break;
case 'wordpress_notification':
/** @var TD_NM_Action_Wordpress_Notification $action */
$action = new TD_NM_Action_Wordpress_Notification( $item );
$prepared_data = $action->prepare_testimonial_submitted_data( $testimonial_data );
break;
}
if ( $action ) {
$action->execute( $prepared_data );
}
}
}
}

View File

@@ -0,0 +1,14 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-dashboard
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
class TD_NM_Data {
}

View File

@@ -0,0 +1,34 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-dashboard
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
class TD_NM_Post_Types {
public static function init() {
add_action( 'init', array( __CLASS__, 'register_post_types' ), 5 );
}
public static function register_post_types() {
if ( post_type_exists( 'td_nm_notification' ) ) {
return;
}
register_post_type( 'td_nm_notification', array(
'publicly_queryable' => true,
'query_var' => false,
'description' => 'Thrive Notification',
'rewrite' => false,
'labels' => array(
'name' => 'Thrive Notification',
),
) );
}
}
TD_NM_Post_Types::init();

View File

@@ -0,0 +1,12 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-dashboard
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
include( 'td-nm-data-functions.php' ); //data functions

View File

@@ -0,0 +1,180 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-dashboard
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden
}
/**
* Save the Notification Post
*
* @param $model
*
* @return int|false
*/
function td_nm_save_notification( $model ) {
$defaults = array(
'post_type' => 'td_nm_notification',
'post_status' => 'publish',
);
if ( empty( $model['ID'] ) ) {
$id = wp_insert_post( array_merge( $defaults, $model ) );
} else {
$id = wp_update_post( $model );
}
if ( empty( $id ) || is_wp_error( $id ) ) {
return false;
}
//save trigger or delete the notification
$trigger_saved = td_nm_save_trigger( $model['trigger'], $id );
if ( empty( $trigger_saved ) ) {
td_nm_delete_notification( $id );
return false;
}
//save the actions or delete the notification
$actions_saved = td_nm_save_actions( $model['actions'], $id );
if ( empty( $actions_saved ) ) {
td_nm_delete_notification( $id );
return false;
}
return $id;
}
/**
* Assign some post_meta for the a notification|post
*
* @param array $trigger
* @param int $notification_id
*
* @return int|false
*/
function td_nm_save_trigger( $trigger, $notification_id ) {
if ( empty( $trigger['type'] ) || empty( $trigger['settings'] ) || get_post_status( $notification_id ) === false ) {
return false;
}
$old_type = get_post_meta( $notification_id, 'td_nm_trigger_type', true );
$old_settings = get_post_meta( $notification_id, 'td_nm_trigger_settings', true );
if ( $trigger['type'] === $old_type && $old_settings === $trigger['settings'] ) {
return $notification_id;
}
update_post_meta( $notification_id, 'td_nm_trigger_type', $trigger['type'] );
update_post_meta( $notification_id, 'td_nm_trigger_settings', $trigger['settings'] );
return $notification_id;
}
/**
* Read Notifications from DB based on filters
*
* @param array $filters
*
* @return array
*/
function td_nm_get_notifications( $filters = array() ) {
$defaults = array(
'posts_per_page' => - 1,
'post_type' => 'td_nm_notification',
'orderby' => 'date',
'order' => 'ASC',
);
if ( ! function_exists( 'is_plugin_active' ) ) {
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
}
$filters = array_merge( $defaults, $filters );
$posts = get_posts( $filters );
$notifications = array();
foreach ( $posts as $post ) {
$trigger = td_nm_get_trigger( $post->ID );
$trigger_instance = TD_NM_Trigger_Factory::get_instance( $trigger );
if ( $applicable = $trigger_instance->is_notification_applicable() ) {
$post->trigger = $trigger;
$post->actions = td_nm_get_actions( $post->ID );
$notifications[] = $post;
}
}
return $notifications;
}
/**
* Get trigger for a notification|post
*
* @param int $notification_id
*
* @return array
*/
function td_nm_get_trigger( $notification_id ) {
$item = array(
'type' => null,
'settings' => array(),
);
$item['type'] = get_post_meta( $notification_id, 'td_nm_trigger_type', true );
$item['settings'] = get_post_meta( $notification_id, 'td_nm_trigger_settings', true );
$item['ID'] = $notification_id;
return $item;
}
/**
* Get actions for a notification|post
*
* @param int $notification_id
*
* @return array
*/
function td_nm_get_actions( $notification_id ) {
$items = get_post_meta( $notification_id, 'td_nm_actions', true );
foreach ( $items as $key => &$item ) {
$item['ID'] = $key;
}
return $items;
}
/**
* @param $actions
* @param $notification_id
*
* @return bool|int
*/
function td_nm_save_actions( $actions, $notification_id ) {
foreach ( $actions as &$action ) {
$action['notification_id'] = $notification_id;
}
return update_post_meta( $notification_id, 'td_nm_actions', $actions );
}
/**
* Delete notification|post with all its data|meta
*
* @param $notification_id
*
* @return bool
*/
function td_nm_delete_notification( $notification_id ) {
$post_deleted = wp_delete_post( $notification_id, true );
return empty( $post_deleted ) || is_wp_error( $post_deleted ) ? false : true;
}

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;
}
}