first commit

This commit is contained in:
2024-11-10 21:08:49 +01:00
commit 0d932ce5ee
14455 changed files with 2567501 additions and 0 deletions

View File

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

View File

@@ -0,0 +1,280 @@
/* This stylesheet is used to style the public-facing components of the plugin. */
html,
body {
min-height: 100% !important;
height: auto !important;
}
.spu-box, .spu-box *{
box-sizing: border-box;
}
.spu-bg{
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
display: none;
z-index: 99999;
}
.spu-box:before,
.spu-box:after {
content:"";
display:table;
}
.spu-box:after {
clear:both;
}
/* Triggers "haslayout" for IE6/7 */
.spu-box {
zoom:1;
}
.spu-box {
position:fixed;
z-index: 999999;
margin: 10px;
max-width: 100%;
}
.spu-box.spu-centered{
margin: 0;
}
/** Some basic css for box content**/
.spu-box img{
max-width: 100%;
height: auto;
}
/** end basic style**/
.spu-box.spu-top-left{
top: 0; left: 0; bottom: auto; right: auto;
}
.spu-box.spu-top-right{
top: 0; right: 0; bottom: auto; left: auto;
}
.spu-box.spu-bottom-left{
bottom: 0; left: 0; top: auto; right: auto;
}
.spu-box.spu-bottom-right{
bottom: 0; right: 0; top: auto; left: auto;
}
.spu-content > *:first-child {
margin-top: 0; padding-top: 0;
}
.spu-content > *:last-child {
margin-bottom:0; padding-bottom:0;
}
.spu-close{
position:absolute;
padding: 0;
cursor: pointer;
background: transparent;
border: 0;
-webkit-appearance: none;
line-height: 1;
}
.spu-close.top_right{
right:8px;
top:5px;
}
.spu-close.top_left{
left:8px;
top:5px;
}
.spu-close.bottom_right{
right:8px;
bottom:5px;
}
.spu-close.bottom_left{
left:8px;
bottom:5px;
}
p.spu-powered {
position: absolute;
bottom: -55px;
width: 100%;
text-align: center;
color: #fff;
left: 0px;
}
p.spu-powered a{
color: #ccc;
text-decoration: underline;
}
.spu-close:hover, .spu-close:focus {
text-decoration: none;
cursor: pointer;
}
.spu-shortcode {
float: left;
line-height: normal !important;
}
.spu-facebook-page{
text-align: center;
display: block;
}
.spu-shortcode iframe{
max-width: 1200px;
}
.spu_shortcodes{
zoom: 1;
}
.spu-content .wysija-msg li{
list-style: none;
}
.spu_shortcodes:before,
.spu_shortcodes:after { content: ""; display: table; }
.spu_shortcodes:after { clear: both; }
@font-face {
font-family: 'spufont';
src:url('../fonts/spufont.eot?sze5my');
src:url('../fonts/spufont.eot?#iefixsze5my') format('embedded-opentype'),
url('../fonts/spufont.woff?sze5my') format('woff'),
url('../fonts/spufont.ttf?sze5my') format('truetype'),
url('../fonts/spufont.svg?sze5my#spufont') format('svg');
font-weight: normal;
font-style: normal;
}
[class^="spu-icon-"], [class*=" spu-icon-"] {
font-family: 'spufont';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.spu-icon-envelope:before {
content: "\f003";
}
.spu-icon-check:before {
content: "\f00c";
}
.spu-icon-close:before {
content: "\f00d";
}
.spu-icon-eye:before {
content: "\f06e";
}
.spu-icon-gears:before {
content: "\f085";
}
.spu-icon-angle-up:before {
content: "\f106";
}
.spu-icon-angle-down:before {
content: "\f107";
}
.spu-icon-spinner:before {
content: "\f110";
}
.spu-spinner {
-webkit-animation: spu-rotate 1s infinite linear;
-moz-animation: spu-rotate 1s infinite linear;
-o-animation: spu-rotate 1s infinite linear;
margin: 5px;
display: none;
}
/**
* Top Bar position
*/
.spu-box.spu-top-bar,
.spu-box.spu-bottom-bar{
margin: 0;
width: 100% !important;
padding: 10px 30px !important;
border-left: none !important;
border-right: none !important;
border-radius: 0;
position: fixed;
box-shadow: none;
z-index: 1000;
}
.spu-box.spu-top-bar.with-spu-gdpr{
padding-bottom: 40px !important;
}
.spu-box.spu-top-bar{
top: 0;
border-top: none !important;
}
.spu-box.spu-bottom-bar{
bottom: 0;
border-bottom: none !important;
}
.spu-box.spu-top-bar h1,
.spu-box.spu-top-bar h2,
.spu-box.spu-top-bar h3,
.spu-box.spu-top-bar h4,
.spu-box.spu-top-bar h5,
.spu-box.spu-top-bar h6,
.spu-box.spu-top-bar p,
.spu-box.spu-bottom-bar h1,
.spu-box.spu-bottom-bar h2,
.spu-box.spu-bottom-bar h3,
.spu-box.spu-bottom-bar h4,
.spu-box.spu-bottom-bar h5,
.spu-box.spu-bottom-bar h6,
.spu-box.spu-bottom-bar p{
margin: 0;
}
@keyframes spu-rotate {
0% {
transform: rotate(0);
}
100% {
transform: rotate(360deg);
}
}
@-webkit-keyframes spu-rotate {
0% {
transform: rotate(0);
}
100% {
transform: rotate(360deg);
}
}
@-moz-keyframes spu-rotate {
0% {
transform: rotate(0);
}
100% {
transform: rotate(360deg);
}
}
@-o-keyframes spu-rotate {
0% {
transform: rotate(0);
}
100% {
transform: rotate(360deg);
}
}
@media only screen and (max-width: 620px) {
.spu-box.taller-than-viewport {
left: 0 !important;
top: 100px !important;
position: absolute !important;
}
.spu-box{
margin: 0;
}
}

View File

@@ -0,0 +1,22 @@
<?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="spufont" 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="&#xea0c;" glyph-name="info" d="M448 656c0 26.4 21.6 48 48 48h32c26.4 0 48-21.6 48-48v-32c0-26.4-21.6-48-48-48h-32c-26.4 0-48 21.6-48 48v32zM640 192h-256v64h64v192h-64v64h192v-256h64zM512 960c-282.77 0-512-229.23-512-512s229.23-512 512-512 512 229.23 512 512-229.23 512-512 512zM512 32c-229.75 0-416 186.25-416 416s186.25 416 416 416 416-186.25 416-416-186.25-416-416-416z" />
<glyph unicode="&#xf003;" glyph-name="envelope" 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="&#xf00c;" glyph-name="check" d="M954.857 627.428q0-22.857-16-38.857l-491.429-491.429q-16-16-38.857-16t-38.857 16l-284.571 284.571q-16 16-16 38.857t16 38.857l77.714 77.714q16 16 38.857 16t38.857-16l168-168.571 374.857 375.429q16 16 38.857 16t38.857-16l77.714-77.714q16-16 16-38.857z" />
<glyph unicode="&#xf00d;" glyph-name="close" horiz-adv-x="805" d="M741.714 195.428q0-22.857-16-38.857l-77.714-77.714q-16-16-38.857-16t-38.857 16l-168 168-168-168q-16-16-38.857-16t-38.857 16l-77.714 77.714q-16 16-16 38.857t16 38.857l168 168-168 168q-16 16-16 38.857t16 38.857l77.714 77.714q16 16 38.857 16t38.857-16l168-168 168 168q16 16 38.857 16t38.857-16l77.714-77.714q16-16 16-38.857t-16-38.857l-168-168 168-168q16-16 16-38.857z" />
<glyph unicode="&#xf06e;" glyph-name="eye" d="M950.857 402.286q-86.857 134.857-217.714 201.714 34.857-59.429 34.857-128.571 0-105.714-75.143-180.857t-180.857-75.143-180.857 75.143-75.143 180.857q0 69.143 34.857 128.571-130.857-66.857-217.714-201.714 76-117.143 190.571-186.571t248.286-69.429 248.286 69.429 190.571 186.571zM539.429 621.714q0 11.429-8 19.429t-19.429 8q-71.429 0-122.571-51.143t-51.143-122.571q0-11.429 8-19.429t19.429-8 19.429 8 8 19.429q0 49.143 34.857 84t84 34.857q11.429 0 19.429 8t8 19.429zM1024 402.286q0-19.429-11.429-39.429-80-131.429-215.143-210.571t-285.429-79.143-285.429 79.429-215.143 210.286q-11.429 20-11.429 39.429t11.429 39.429q80 130.857 215.143 210.286t285.429 79.429 285.429-79.429 215.143-210.286q11.429-20 11.429-39.429z" />
<glyph unicode="&#xf085;" glyph-name="gears" horiz-adv-x="1097" d="M512 438.857q0 60.571-42.857 103.429t-103.429 42.857-103.429-42.857-42.857-103.429 42.857-103.429 103.429-42.857 103.429 42.857 42.857 103.429zM950.857 146.286q0 29.714-21.714 51.429t-51.429 21.714-51.429-21.714-21.714-51.429q0-30.286 21.429-51.714t51.714-21.429 51.714 21.429 21.429 51.714zM950.857 731.428q0 29.714-21.714 51.429t-51.429 21.714-51.429-21.714-21.714-51.429q0-30.286 21.429-51.714t51.714-21.429 51.714 21.429 21.429 51.714zM731.429 490.857v-105.714q0-5.714-4-11.143t-9.143-6l-88.571-13.714q-6.286-20-18.286-43.429 19.429-27.429 51.429-65.714 4-5.714 4-11.429 0-6.857-4-10.857-13.143-17.143-47.143-51.143t-44.857-34q-6.286 0-12 4l-65.714 51.429q-21.143-10.857-44-17.714-6.286-61.714-13.143-88.571-4-13.714-17.143-13.714h-106.286q-6.286 0-11.429 4.286t-5.714 10l-13.143 87.429q-19.429 5.714-42.857 17.714l-67.429-50.857q-4-4-11.429-4-6.286 0-12 4.571-82.286 76-82.286 91.429 0 5.143 4 10.857 5.714 8 23.429 30.286t26.857 34.857q-13.143 25.143-20 46.857l-86.857 13.714q-5.714 0.571-9.714 5.429t-4 11.143v105.714q0 5.714 4 11.143t9.143 6l88.571 13.714q6.286 20 18.286 43.429-19.429 27.429-51.429 65.714-4 6.286-4 11.429 0 6.857 4 11.429 12.571 17.143 46.857 50.857t45.143 33.714q6.286 0 12-4l65.714-51.429q19.429 10.286 44 18.286 6.286 61.714 13.143 88 4 13.714 17.143 13.714h106.286q6.286 0 11.429-4.286t5.714-10l13.143-87.429q19.429-5.714 42.857-17.714l67.429 50.857q4.571 4 11.429 4 6.286 0 12-4.571 82.286-76 82.286-91.429 0-5.143-4-10.857-6.857-9.143-24-30.857t-25.714-34.286q13.143-27.429 19.429-46.857l86.857-13.143q5.714-1.143 9.714-6t4-11.143zM1097.143 186.286v-80q0-9.143-85.143-17.714-6.857-15.429-17.143-29.714 29.143-64.571 29.143-78.857 0-2.286-2.286-4-69.714-40.571-70.857-40.571-4.571 0-26.286 26.857t-29.714 38.857q-11.429-1.143-17.143-1.143t-17.143 1.143q-8-12-29.714-38.857t-26.286-26.857q-1.143 0-70.857 40.571-2.286 1.714-2.286 4 0 14.286 29.143 78.857-10.286 14.286-17.143 29.714-85.143 8.571-85.143 17.714v80q0 9.143 85.143 17.714 7.429 16.571 17.143 29.714-29.143 64.571-29.143 78.857 0 2.286 2.286 4 2.286 1.143 20 11.429t33.714 19.429 17.143 9.143q4.571 0 26.286-26.571t29.714-38.571q11.429 1.143 17.143 1.143t17.143-1.143q29.143 40.571 52.571 64l3.429 1.143q2.286 0 70.857-40 2.286-1.714 2.286-4 0-14.286-29.143-78.857 9.714-13.143 17.143-29.714 85.143-8.571 85.143-17.714zM1097.143 771.428v-80q0-9.143-85.143-17.714-6.857-15.429-17.143-29.714 29.143-64.571 29.143-78.857 0-2.286-2.286-4-69.714-40.571-70.857-40.571-4.571 0-26.286 26.857t-29.714 38.857q-11.429-1.143-17.143-1.143t-17.143 1.143q-8-12-29.714-38.857t-26.286-26.857q-1.143 0-70.857 40.571-2.286 1.714-2.286 4 0 14.286 29.143 78.857-10.286 14.286-17.143 29.714-85.143 8.571-85.143 17.714v80q0 9.143 85.143 17.714 7.429 16.571 17.143 29.714-29.143 64.571-29.143 78.857 0 2.286 2.286 4 2.286 1.143 20 11.429t33.714 19.429 17.143 9.143q4.571 0 26.286-26.571t29.714-38.571q11.429 1.143 17.143 1.143t17.143-1.143q29.143 40.571 52.571 64l3.429 1.143q2.286 0 70.857-40 2.286-1.714 2.286-4 0-14.286-29.143-78.857 9.714-13.143 17.143-29.714 85.143-8.571 85.143-17.714z" />
<glyph unicode="&#xf0d0;" glyph-name="magic" horiz-adv-x="951" d="M680 618.857l167.429 167.429-61.143 61.143-167.429-167.429zM935.429 786.286q0-15.429-10.286-25.714l-734.857-734.857q-10.286-10.286-25.714-10.286t-25.714 10.286l-113.143 113.143q-10.286 10.286-10.286 25.714t10.286 25.714l734.857 734.857q10.286 10.286 25.714 10.286t25.714-10.286l113.143-113.143q10.286-10.286 10.286-25.714zM163.429 894.857l56-17.143-56-17.143-17.143-56-17.143 56-56 17.143 56 17.143 17.143 56zM363.429 802.286l112-34.286-112-34.286-34.286-112-34.286 112-112 34.286 112 34.286 34.286 112zM894.857 529.143l56-17.143-56-17.143-17.143-56-17.143 56-56 17.143 56 17.143 17.143 56zM529.143 894.857l56-17.143-56-17.143-17.143-56-17.143 56-56 17.143 56 17.143 17.143 56z" />
<glyph unicode="&#xf106;" 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="&#xf107;" 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="&#xf110;" glyph-name="spinner" d="M300.571 154.286q0-30.286-21.429-51.714t-51.714-21.429q-29.714 0-51.429 21.714t-21.714 51.429q0 30.286 21.429 51.714t51.714 21.429 51.714-21.429 21.429-51.714zM585.143 36.571q0-30.286-21.429-51.714t-51.714-21.429-51.714 21.429-21.429 51.714 21.429 51.714 51.714 21.429 51.714-21.429 21.429-51.714zM182.857 438.857q0-30.286-21.429-51.714t-51.714-21.429-51.714 21.429-21.429 51.714 21.429 51.714 51.714 21.429 51.714-21.429 21.429-51.714zM869.714 154.286q0-29.714-21.714-51.429t-51.429-21.714q-30.286 0-51.714 21.429t-21.429 51.714 21.429 51.714 51.714 21.429 51.714-21.429 21.429-51.714zM318.857 723.428q0-37.714-26.857-64.571t-64.571-26.857-64.571 26.857-26.857 64.571 26.857 64.571 64.571 26.857 64.571-26.857 26.857-64.571zM987.429 438.857q0-30.286-21.429-51.714t-51.714-21.429-51.714 21.429-21.429 51.714 21.429 51.714 51.714 21.429 51.714-21.429 21.429-51.714zM621.714 841.143q0-45.714-32-77.714t-77.714-32-77.714 32-32 77.714 32 77.714 77.714 32 77.714-32 32-77.714zM924.571 723.428q0-53.143-37.714-90.571t-90.286-37.429q-53.143 0-90.571 37.429t-37.429 90.571q0 52.571 37.429 90.286t90.571 37.714q52.571 0 90.286-37.714t37.714-90.286z" />
<glyph unicode="&#xf204;" glyph-name="toggle-off" horiz-adv-x="1170" d="M658.286 438.857q0 59.429-23.143 113.429t-62.571 93.429-93.429 62.571-113.429 23.143-113.429-23.143-93.429-62.571-62.571-93.429-23.143-113.429 23.143-113.429 62.571-93.429 93.429-62.571 113.429-23.143 113.429 23.143 93.429 62.571 62.571 93.429 23.143 113.429zM1097.143 438.857q0 59.429-23.143 113.429t-62.571 93.429-93.429 62.571-113.429 23.143h-220.571q68-51.429 107.714-128t39.714-164.571-39.714-164.571-107.714-128h220.571q59.429 0 113.429 23.143t93.429 62.571 62.571 93.429 23.143 113.429zM1170.286 438.857q0-74.286-29.143-142t-78-116.571-116.571-78-142-29.143h-438.857q-74.286 0-142 29.143t-116.571 78-78 116.571-29.143 142 29.143 142 78 116.571 116.571 78 142 29.143h438.857q74.286 0 142-29.143t116.571-78 78-116.571 29.143-142z" />
<glyph unicode="&#xf205;" glyph-name="toggle-on" horiz-adv-x="1170" d="M0 438.857q0 74.286 29.143 142t78 116.571 116.571 78 142 29.143h438.857q74.286 0 142-29.143t116.571-78 78-116.571 29.143-142-29.143-142-78-116.571-116.571-78-142-29.143h-438.857q-74.286 0-142 29.143t-116.571 78-78 116.571-29.143 142zM804.571 146.286q59.429 0 113.429 23.143t93.429 62.571 62.571 93.429 23.143 113.429-23.143 113.429-62.571 93.429-93.429 62.571-113.429 23.143-113.429-23.143-93.429-62.571-62.571-93.429-23.143-113.429 23.143-113.429 62.571-93.429 93.429-62.571 113.429-23.143z" />
</font></defs></svg>

After

Width:  |  Height:  |  Size: 10 KiB

View File

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

View File

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

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,862 @@
<?php
/**
* Popups.
*
* @package Popups
* @author Damian Logghe <info@timersys.com>
* @license GPL-2.0+
* @link http://example.com
* @copyright 2014 Your Name or Company Name
*/
/**
* Public Class of the plugin
* @package Popups
* @author Damian Logghe <info@timersys.com>
*/
class SocialPopup {
/**
* Plugin version, used for cache-busting of style and script file references.
*
* @since 1.0.0
*
* @var string
*/
const VERSION = SPU_VERSION;
/**
* Popups to use acrros files
*
* @since 1.7
*
* @var string
*/
const PLUGIN_NAME = 'Popups';
/**
*
* The variable name is used as the text domain when internationalizing strings
* of text. Its value should match the Text Domain file header in the main
* plugin file.
*
* @since 1.0.0
*
* @var string
*/
protected $plugin_slug = 'spu';
/**
* Plugins settings
* @var array
*/
protected $spu_settings = array();
/**
* Instance of this class.
*
* @since 1.0.0
*
* @var object
*/
protected static $instance = null;
/**
* Plugin info accesible everywhere
* @var array
*
* @since 1.0.0
*/
public $info;
/**
* Initialize the plugin by setting localization and loading public scripts
* and styles.
*
* @since 1.0.0
*/
private function __construct() {
// vars
$this->info = array(
'dir' => SPU_PLUGIN_DIR,
'url' => SPU_PLUGIN_URL,
'hook' => SPU_PLUGIN_HOOK,
'version' => self::VERSION,
'upgrade_version' => '1.6.4.3',
'wpml_lang' => defined('ICL_LANGUAGE_CODE') ? ICL_LANGUAGE_CODE : '',
);
// Load plugin text domain
$this->load_plugin_textdomain();
$this->load_dependencies();
$this->spu_settings = apply_filters('spu/settings_page/opts', get_option( 'spu_settings' ) );
//Register cpt
add_action( 'init', array( $this, 'register_cpt' ) );
// Add noindex to cpt
add_action('wp_head', array($this, 'add_no_index') );
// Activate plugin when new blog is added
add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) );
// Register public-facing style sheet and JavaScript.
add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts' ) );
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
if( empty($this->spu_settings['ajax_mode'] ) ) {
//print boxes
add_action( 'wp_footer', array( $this, 'print_boxes' ), 1 );
}
add_action( 'init', array( $this, 'register_spu_ajax' ), 11 );
//FILTERS
add_filter('spu/get_info', array($this, 'get_info'), 1, 1);
//spu content function
add_filter( 'spu/popup/content', 'wptexturize') ;
add_filter( 'spu/popup/content', 'convert_smilies' );
add_filter( 'spu/popup/content', 'convert_chars' );
add_filter( 'spu/popup/content', 'wpautop' );
add_filter( 'spu/popup/content', 'shortcode_unautop' );
add_filter( 'spu/popup/content', 'do_shortcode', 11 );
//Register shortcodes
add_shortcode( 'spu-facebook', array( $this, 'facebook_shortcode' ) );
add_shortcode( 'spu-facebook-page', array( $this, 'facebook_page_shortcode' ) );
add_shortcode( 'spu-twitter', array( $this, 'twitter_shortcode' ) );
add_shortcode( 'spu-google', array( $this, 'google_shortcode' ) );
add_shortcode( 'spu-close', array( $this, 'close_shortcode' ) );
add_shortcode( 'spu', array( $this, 'popup_link_shortcode' ) );
}
/**
* Return the plugin slug.
*
* @since 1.0.0
*
* @return Plugin slug variable.
*/
public function get_plugin_slug() {
return $this->plugin_slug;
}
/**
* Return an instance of this class.
*
* @since 1.0.0
*
* @return object A single instance of this class.
*/
public static function get_instance() {
// If the single instance hasn't been set, set it now.
if ( null == self::$instance ) {
self::$instance = new self;
}
return self::$instance;
}
/**
* Fired when the plugin is activated.
*
* @since 1.0.0
*
* @param boolean $network_wide True if WPMU superadmin uses
* "Network Activate" action, false if
* WPMU is disabled or plugin is
* activated on an individual blog.
*/
public static function activate( $network_wide ) {
if ( function_exists( 'is_multisite' ) && is_multisite() ) {
if ( $network_wide ) {
// Get all blog ids
$blog_ids = self::get_blog_ids();
foreach ( $blog_ids as $blog_id ) {
switch_to_blog( $blog_id );
self::single_activate();
}
restore_current_blog();
} else {
self::single_activate();
}
} else {
self::single_activate();
}
}
/**
* Fired when the plugin is deactivated.
*
* @since 1.0.0
*
* @param boolean $network_wide True if WPMU superadmin uses
* "Network Deactivate" action, false if
* WPMU is disabled or plugin is
* deactivated on an individual blog.
*/
public static function deactivate( $network_wide ) {
if ( function_exists( 'is_multisite' ) && is_multisite() ) {
if ( $network_wide ) {
// Get all blog ids
$blog_ids = self::get_blog_ids();
foreach ( $blog_ids as $blog_id ) {
switch_to_blog( $blog_id );
self::single_deactivate();
}
restore_current_blog();
} else {
self::single_deactivate();
}
} else {
self::single_deactivate();
}
}
/**
* Fired when a new site is activated with a WPMU environment.
*
* @since 1.0.0
*
* @param int $blog_id ID of the new blog.
*/
public function activate_new_site( $blog_id ) {
if ( 1 !== did_action( 'wpmu_new_blog' ) ) {
return;
}
switch_to_blog( $blog_id );
self::single_activate();
restore_current_blog();
}
/**
* Register custom post types
* @return void
*/
function register_cpt() {
$name = 'Popups v' . SocialPopup::VERSION;
if( class_exists('PopupsP') ){
$name .= ' - Premium v'. PopupsP::VERSION;
}
$name = apply_filters( 'spu/display/title', $name );
$labels = array(
'name' => $name,
'singular_name' => _x( 'Popups', 'post type singular name', 'popups' ),
'menu_name' => _x( 'Popups', 'admin menu', 'popups' ),
'name_admin_bar' => _x( 'Popups', 'add new on admin bar', 'popups' ),
'add_new' => _x( 'Add New', 'Popups', 'popups' ),
'add_new_item' => __( 'Add New Popups', 'popups' ),
'new_item' => __( 'New Popups', 'popups' ),
'edit_item' => __( 'Edit Popups', 'popups' ),
'view_item' => __( 'View Popups', 'popups' ),
'all_items' => __( 'All Popups', 'popups' ),
'search_items' => __( 'Search Popups', 'popups' ),
'parent_item_colon' => __( 'Parent Popups:', 'popups' ),
'not_found' => __( 'No Popups found.', 'popups' ),
'not_found_in_trash' => __( 'No Popups found in Trash.', 'popups' )
);
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'exclude_from_search' => true,
'rewrite' => array( 'slug' => 'spucpt' ),
'capability_type' => 'post',
'capabilities' => array(
'publish_posts' => apply_filters( 'spu/settings_page/roles', 'manage_options'),
'edit_posts' => apply_filters( 'spu/settings_page/roles', 'manage_options'),
'edit_others_posts' => apply_filters( 'spu/settings_page/roles', 'manage_options'),
'delete_posts' => apply_filters( 'spu/settings_page/roles', 'manage_options'),
'delete_others_posts' => apply_filters( 'spu/settings_page/roles', 'manage_options'),
'read_private_posts' => apply_filters( 'spu/settings_page/roles', 'manage_options'),
'edit_post' => apply_filters( 'spu/settings_page/roles', 'manage_options'),
'delete_post' => apply_filters( 'spu/settings_page/roles', 'manage_options'),
'read_post' => apply_filters( 'spu/settings_page/roles', 'manage_options'),
),
'has_archive' => false,
'hierarchical' => false,
'menu_position' => null,
'menu_icon' => 'dashicons-share-alt',
'supports' => array( 'title', 'editor','author' ),
'show_in_rest' => true
);
register_post_type( 'spucpt', $args );
}
function add_no_index() {
global $post;
if( get_post_type() == 'spucpt' && is_single() )
echo '<meta name="robots" content="noindex, nofollow" />';
}
/**
* Get all blog ids of blogs in the current network that are:
* - not archived
* - not spam
* - not deleted
*
* @since 1.0.0
*
* @return array|false The blog ids, false if no matches.
*/
private static function get_blog_ids() {
global $wpdb;
// get an array of blog ids
$sql = "SELECT blog_id FROM $wpdb->blogs
WHERE archived = '0' AND spam = '0'
AND deleted = '0'";
return $wpdb->get_col( $sql );
}
/**
* Fired for each blog when the plugin is activated.
*
* @since 1.0.0
*/
private static function single_activate() {
// If there are not popups created let's create a default one
global $wpdb;
$spus = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type='spucpt'");
if ( empty( $spus) ) {
$post_content ='<h2 style="text-align:center">Welcome!</h2><p style="text-align:center">This is popup preview that you can fill with any content you want.</p><p style="text-align:center">The plugin include some shortcodes, you can read more about them at the bottom of this page. The main 3 sections to configure the popup are:</p><p>Appearance: Where you edit the look and feel of the popup.<br>Display Rules: Here you choose on which page to display the popup (Set to all by default)<br>Display options: Some important settings about the plugin, being the more important trigger action.</br></p>';
$defaults = array(
'post_status' => 'draft',
'post_type' => 'spucpt',
'post_content' => $post_content,
'post_title' => 'Popups Example'
);
wp_insert_post( $defaults, $wp_error );
}
$upgrader = new SocialPopup_Upgrader();
$upgrader->upgrade_plugin();
update_option('spu-version', SPU_VERSION);
do_action( 'spu/activate' );
}
/**
* Fired for each blog when the plugin is deactivated.
*
* @since 1.0.0
*/
private static function single_deactivate() {
// @TODO: Define deactivation functionality here
}
/**
* Load the plugin text domain for translation.
*
* @since 1.0.0
*/
public function load_plugin_textdomain() {
$domain = 'popups';
$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
load_textdomain( $domain, trailingslashit( WP_LANG_DIR ) . $domain . '/' . $domain . '-' . $locale . '.mo' );
load_plugin_textdomain( $domain, FALSE, dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/' );
}
/**
* Register and enqueues public-facing JavaScript files.
*
* @since 1.0.0
*/
public function register_scripts() {
$js_url = plugins_url( 'assets/js/public.js', __FILE__ );
$handle = 'spu-public';
$opts = $this->spu_settings;
wp_register_style( 'spu-public-css', plugins_url( 'assets/css/public.css', __FILE__ ), array(), self::VERSION );
wp_register_script( $handle, $js_url, array( 'jquery' ), self::VERSION, true );
wp_register_script( 'spu-facebook', '//connect.facebook.net/'.get_locale().'/sdk.js#xfbml=1&version=v2.3', array('jquery'), null, FALSE);
wp_register_script( 'spu-twitter', '//platform.twitter.com/widgets.js', array('jquery'), self::VERSION, FALSE);
wp_register_script( 'spu-google', '//apis.google.com/js/platform.js', array('jquery'), self::VERSION, FALSE);
}
/**
* load and print SPU popup when rules matches
*
* @since 1.0.0
*/
public function check_for_matches() {
$spu_matches = false;
$spu_rules = new Spu_Rules();
//Grab all popups ids
$spu_ids = $this->get_spu_ids();
if( !empty($spu_ids) ) {
foreach ( $spu_ids as $spu ) {
$rules = !empty($spu->spu_rules) ? unserialize($spu->spu_rules) : array();
$match = $spu_rules->check_rules( $rules );
if ( $match ) {
$spu_matches[$spu->ID] = $spu->ID;
}
}
// check if we are viewing a popup, and only show that one (preview mode)
$viewing_id = defined('DOING_AJAX') && isset($_REQUEST['pid']) ? $_REQUEST['pid'] : get_queried_object_id();
foreach ( $spu_ids as $spu ) {
if ( $spu->ID == $viewing_id ) {
$spu_matches = array();
$spu_matches[$spu->ID] = $spu->ID;
}
}
}
return apply_filters( 'spu/check_for_matches', $spu_matches, $spu_ids, $spu_rules );
}
/**
* Return array of popups ids
*/
function get_spu_ids() {
global $wpdb;
// IF wpml is active and spucpt is translated get correct ids for language
if( function_exists('icl_object_id') ) {
$spu_ids = $this->get_wpml_ids();
if(!empty($spu_ids)) {
return $spu_ids;
}
}
// IF polylang is active and spucpt is translated get correct ids for language
if( function_exists('pll_current_language') ) {
$spu_ids = $this->get_polylang_ids();
if(!empty($spu_ids)) {
return $spu_ids;
}
}
$post_status = isset( $_REQUEST['is_preview'] ) && $_REQUEST['is_preview'] == '1' ? "AND (post_status='publish' OR post_status='draft')" : "AND post_status='publish'";
return $wpdb->get_results( "SELECT ID, post_content, MAX(CASE WHEN pm1.meta_key = 'spu_rules' then pm1.meta_value ELSE NULL END) as spu_rules,
MAX(CASE WHEN pm1.meta_key = 'spu_ab_parent' then pm1.meta_value ELSE NULL END) as spu_ab_parent
FROM $wpdb->posts p LEFT JOIN $wpdb->postmeta pm1 ON ( pm1.post_id = p.ID) WHERE post_type='spucpt' {$post_status} GROUP BY p.ID");
}
/**
* Function that enqueue all needed scritps and styles
* @since 1.3
*/
public function enqueue_scripts() {
$handle = 'spu-public';
$opts = $this->spu_settings;
if( isset($this->info['wpml_lang']) && !empty($this->info['wpml_lang']) )
$ajax_url = '/?spu_action=spu_load&lang='.$this->info['wpml_lang'];
else
$ajax_url = '/?spu_action=spu_load';
wp_enqueue_script($handle);
wp_enqueue_style('spu-public-css');
wp_localize_script( $handle, 'spuvar',
array(
'is_admin' => current_user_can( apply_filters( 'spu/capabilities/testmode', 'administrator' ) ),
'disable_style' => isset( $this->spu_settings['shortcodes_style'] ) ? esc_attr( $this->spu_settings['shortcodes_style'] ) : '',
'ajax_mode' => isset( $this->spu_settings['ajax_mode'] ) ? esc_attr( $this->spu_settings['ajax_mode'] ) :'',
'ajax_url' => admin_url('admin-ajax.php'),
'ajax_mode_url' => site_url($ajax_url),
'pid' => get_queried_object_id(),
'is_front_page' => is_front_page(),
'is_category' => is_category(),
'site_url' => site_url(),
'is_archive' => is_archive(),
'is_search' => is_search(),
'is_preview' => (get_post_type() == 'spucpt'),
'seconds_confirmation_close' => apply_filters( 'spu/spuvar/seconds_confirmation_close', 5 ),
)
);
$this->enqueue_social_shortcodes();
}
/**
* Function that runs the different checks to see if social is enqueue or not
* @since 1.3
*/
private function enqueue_social_shortcodes(){
global $wpdb,$spuvar_social;
$opts = $this->spu_settings;
$spuvar_social = array();
$handle = 'spu-public';
// Check if any popup have facebook, then enqueue js
if( $fb = $wpdb->get_var( "SELECT meta_value FROM $wpdb->postmeta WHERE meta_key = 'spu_fb' " ) ) {
// Check if defined or remove js in options
if( !defined( 'SPU_UNLOAD_FB_JS') && empty( $opts['facebook'] ) )
wp_enqueue_script( 'spu-facebook');
$spuvar_social['facebook'] = true;
}
if( $fb = $wpdb->get_var( "SELECT meta_value FROM $wpdb->postmeta WHERE meta_key ='spu_tw' " ) ) {
if( ! defined( 'SPU_UNLOAD_TW_JS') && empty( $opts['twitter'] ) )
wp_enqueue_script( 'spu-twitter');
$spuvar_social['twitter'] = true;
}
if( $fb = $wpdb->get_var( "SELECT meta_value FROM $wpdb->postmeta WHERE meta_key ='spu_google' " ) ) {
if( ! defined( 'SPU_UNLOAD_GO_JS') && empty( $opts['google'] ) )
wp_enqueue_script( 'spu-google');
$spuvar_social['google'] = true;
}
wp_localize_script( $handle, 'spuvar_social', $spuvar_social);
//also include gravity forms if needed
if( $gf = $wpdb->get_var( "SELECT meta_value FROM $wpdb->postmeta WHERE meta_key ='spu_gravity' " ) ) {
if( function_exists('gravity_form_enqueue_scripts'))
gravity_form_enqueue_scripts($gf, true);
}
}
/**
* [facebook_shortcode description]
*
* @param $atts
* @param $content
*
* @internal param $ $content [description] $content [description]
* @internal param $atts [description] $atts [description]
* @return string [description]
*/
function facebook_shortcode( $atts, $content ) {
extract( shortcode_atts( array(
'href' => apply_filters( 'spu/social/fb_href', 'https://www.facebook.com/pages/Timersys/146687622031640' ),
'layout' => 'button_count', // standard, box_count, button_count, button
'show_faces' => 'false', // true
'share' => 'false', // true
'action' => 'like', // recommend
'width' => '',
), $atts ) );
$layout = strtolower( trim( $layout ) );
$action = strtolower( trim( $action ) );
// to avoid problems
if( 'standard' != $layout && 'box_count' != $layout && 'button_count' != $layout && 'button' != $layout ) {
$layout = 'button_count';
}
if( 'like' != $action && 'recommend' != $action ) {
$action = 'like';
}
return '<div class="spu-facebook spu-shortcode"><div class="fb-like" data-width="'.strtolower( trim( $width ) ).'" data-href="'. $href .'" data-layout="'.$layout.'" data-action="'.$action.'" data-show-faces="'.strtolower( trim( $show_faces ) ).'" data-share="'.strtolower( trim( $share ) ).'"></div></div>';
}
/**
* Shortcode for facebook page
*
* @param $atts
* @param $content
*
* @internal param $ $content [description] $content [description]
* @internal param $atts [description] $atts [description]
* @return string [description]
*/
function facebook_page_shortcode( $atts, $content ) {
extract( shortcode_atts( array(
'href' => apply_filters( 'spu/social/fb_href', 'https://www.facebook.com/pages/Timersys/146687622031640' ),
'name' => apply_filters( 'spu/social/fb_name', 'Timersys' ),
'show_faces' => 'true', // false
'hide_cover' => 'false', // true
'width' => '500',
), $atts ) );
return '<div class="spu-facebook-page"><div class="fb-page" data-href="'. $href .'" data-width="'.strtolower( trim( $width ) ).'" data-hide-cover="'.strtolower( trim( $hide_cover ) ).'" data-show-facepile="'.strtolower( trim( $show_faces ) ).'" data-show-posts="false"><div class="fb-xfbml-parse-ignore"><blockquote cite="'. $href .'"><a href="'. $href .'">'.esc_attr( $name ).'</a></blockquote></div></div></div>';
}
/**
* [twitter_shortcode description]
* @param string $content [description]
* @param array $atts [description]
* @return string [description]
*/
function twitter_shortcode( $atts, $content ) {
extract( shortcode_atts( array(
'user' => apply_filters( 'spu/social/tw_user', 'chifliiiii' ),
'show_count' => 'true', // false
'size' => '', // large
'lang' => '',
), $atts ) );
return '<div class="spu-twitter spu-shortcode"><a href="https://twitter.com/'.$user.'" class="twitter-follow-button" data-show-count="'.strtolower( trim( $show_count ) ).'" data-size="'.strtolower( trim( $size ) ).'" data-lang="'.$lang.'"></a></div>';
}
/**
* [google_shortcode description]
* @param [type] $atts [description]
* @param [type] $content [description]
* @return string [description]
*/
function google_shortcode( $atts, $content ) {
extract( shortcode_atts( array(
'type' => 'g-plusone', //small standard tall
'size' => 'medium', //small standard tall
'annotation' => 'bubble', //inline none
'url' => apply_filters( 'spu/social/gp_url', 'https://plus.google.com/u/0/103508783120806246698/posts' ),
), $atts ) );
$size = strtolower( trim( $size ) );
$annotation = strtolower( trim( $annotation ) );
//to avoid problems
if( 'medium' != $size && 'small' != $size && 'standard' != $size && 'tall' != $size ) {
$size = 'medium';
}
if( 'bubble' != $annotation && 'inline' != $annotation && 'none' != $annotation ) {
$annotation = 'bubble';
}
if( 'g-plusone' != $type && 'g-follow' != $type ) {
$type = 'g-plusone';
}
return '<div class="spu-google spu-shortcode"><div class="'.$type.'" data-callback="googleCB" data-onendinteraction="closeGoogle" data-recommendations="false" data-annotation="'.$annotation.'" data-size="'.$size.'" data-href="'.$url.'"></div></div>';
}
function close_shortcode( $atts, $content ) {
extract( shortcode_atts( array(
'class' => 'button-primary btn-primary',
'text' => 'Close',
'conversion' => false
), $atts ) );
$button_class = ! $conversion || $conversion == 'false' ? 'spu-close-popup ' : 'spu-close-convert ';
return '<button class="'.$button_class.$class.'">'.$text.'</button>';
}
/**
* Returns plugin info
* @param string $i info name
* @return mixed one all or none
*/
function get_info( $i )
{
// vars
$return = false;
// specific
if( isset($this->info[ $i ]) )
{
$return = $this->info[ $i ];
}
// all
if( $i == 'all' )
{
$return = $this->info;
}
// return
return $return;
}
/**
* Print the actual popup
* @return mixed echo popup html
*/
function print_boxes( ) {
do_action('spu/print_boxes');
$spu_matches = $this->check_for_matches();
//if we have matches continue
if( ! empty( $spu_matches) ) {
foreach ($spu_matches as $spu_id ) {
include( 'views/popup.php');
} //endforeach
echo '<div id="fb-root" class=" fb_reset"></div>';
}
}
/**
* Return plugin settings
* @return array
* @since 1.1
*/
function get_settings() {
return $this->spu_settings;
}
/**
* Load necessary files
* @since 1.2.3
*/
private function load_dependencies(){
// Include Helper class
require_once( SPU_PLUGIN_DIR . 'includes/class-spu-helper.php' );
// Include Rules Class
require_once( SPU_PLUGIN_DIR . 'public/includes/class-spu-rules.php' );
}
/**
* Custom ajax hook. Wp_ajax won't let us do_shortcode for example
* @return mixed Prints all spus
*/
function register_spu_ajax() {
if ( empty( $_REQUEST['spu_action'] ) || $_REQUEST['spu_action'] != 'spu_load' )
return;
define( 'DOING_AJAX', TRUE );
$this->print_boxes();
die();
}
/**
* Return popups for current language
* @return bool | array of ids
*/
protected function get_polylang_ids( ) {
global $wpdb;
$post_status = isset( $_REQUEST['is_preview'] ) && $_REQUEST['is_preview'] == '1' ? "AND (post_status='publish' OR post_status='draft')" : "AND post_status='publish'";
$sql = "SELECT description
FROM $wpdb->posts p
LEFT JOIN $wpdb->term_relationships as tr ON p.ID = tr.object_id
LEFT JOIN $wpdb->term_taxonomy as tt ON tt.term_taxonomy_id = tr.term_taxonomy_id
WHERE post_type='spucpt' {$post_status} AND tt.taxonomy = 'post_translations'
GROUP BY p.ID";
$ids = array();
$popups = $wpdb->get_results( $sql );
if( !empty($popups) ) {
$current = pll_current_language();
foreach ($popups as $p) {
$langs = unserialize($p->description);
if( isset($langs[$current]) )
$ids[] = $langs[$current];
}
}
if( !empty($ids)){
$sql = "SELECT DISTINCT ID, post_content,
MAX(CASE WHEN pm1.meta_key = 'spu_rules' then pm1.meta_value ELSE NULL END) as spu_rules,
MAX(CASE WHEN pm1.meta_key = 'spu_ab_parent' then pm1.meta_value ELSE NULL END) as spu_ab_parent
FROM $wpdb->posts p
LEFT JOIN $wpdb->postmeta pm1 ON ( pm1.post_id = p.ID)
WHERE post_type='spucpt' {$post_status} AND ID IN (".implode(',',array_unique($ids)).")
GROUP BY p.ID";
return $wpdb->get_results( $sql );
}
return false;
}
/**
* Return popups for current language
* @return bool | array of ids
*/
protected function get_wpml_ids( ) {
global $wpdb;
$wpml_settings = get_option( 'icl_sitepress_settings', true);
if ( ! empty( $wpml_settings['custom_posts_sync_option']['spucpt'] ) ) {
$post_status = isset( $_REQUEST['is_preview'] ) && $_REQUEST['is_preview'] == '1' ? "AND (post_status='publish' OR post_status='draft')" : "AND post_status='publish'";
$lang_code = isset( $_GET['lang'] ) ? $_GET['lang'] : ICL_LANGUAGE_CODE;
$sql = "SELECT DISTINCT ID, post_content,
MAX(CASE WHEN pm1.meta_key = 'spu_rules' then pm1.meta_value ELSE NULL END) as spu_rules,
MAX(CASE WHEN pm1.meta_key = 'spu_ab_parent' then pm1.meta_value ELSE NULL END) as spu_ab_parent
FROM $wpdb->posts p
LEFT JOIN $wpdb->postmeta pm1 ON ( pm1.post_id = p.ID)
LEFT JOIN {$wpdb->prefix}icl_translations as b ON p.ID = b.element_id
WHERE post_type='spucpt' {$post_status} AND b.language_code = '" . esc_sql( $lang_code ) . "'
GROUP BY p.ID";
$ids = $wpdb->get_results( $sql );
if( !empty($ids) )
return $ids;
}
return false;
}
/**
* Popup button
* @param [type] $atts [description]
* @param [type] $content [description]
* @return [type] [description]
*/
public function popup_link_shortcode($atts, $content ) {
return '<a href="#" class="spu-open-'.$atts['popup'].'">'.do_shortcode( $content ).'</a>';
}
}

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

@@ -0,0 +1,93 @@
<?php
/**
* Popup view
*
* @package Popups
* @author Damian Logghe <info@timersys.com
* @license GPL-2.0+
* @link https://timersys.com
* @copyright 2014 Timersys
*/
?><!-- Popups v<?php echo self::VERSION; ?> - https://wordpress.org/plugins/popups/ --><?php
$box = get_post( $spu_id );
$helper = new Spu_Helper;
// has box with this id been found?
if ( ! $box instanceof WP_Post ) {
return;
}
$opts = $helper->get_box_options( $box->ID );
$css = $opts['css'];
$content = $box->post_content;
$data_attrs = '';
$box_class = '';
$width = !empty( $css['width'] ) ? $css['width'] : '';
// run filters on content
$content = apply_filters( 'spu/popup/content', $content, $box );
// Qtranslate support
if ( function_exists('qtrans_useCurrentLanguageIfNotFoundShowAvailable') ) {
$content = qtrans_useCurrentLanguageIfNotFoundShowAvailable( $content );
}
// WPGlobus support
if ( class_exists('WPGlobus') ) {
$content = WPGlobus_Core::text_filter( $content, WPGlobus::Config()->language );
}
do_action( 'spu/popup/before_popup', $box, $opts, $css);
?>
<style type="text/css">
#spu-<?php echo $box->ID; ?> .spu-close{
font-size: <?php echo esc_attr($css['close_size']); ?>;
color:<?php echo esc_attr($css['close_color']); ?>;
text-shadow: 0 1px 0 <?php echo esc_attr($css['close_shadow_color']); ?>;
}
#spu-<?php echo $box->ID; ?> .spu-close:hover{
color:<?php echo esc_attr($css['close_hover_color']); ?>;
}
#spu-<?php echo $box->ID; ?> {
background-color: <?php echo ( !empty( $css['background_color'] ) ) ? esc_attr($css['background_color']) : 'white'; ?>;
background-color: <?php echo ( !empty( $css['background_color'] ) ) ? Spu_Helper::hex2rgba(esc_attr($css['background_color']),esc_attr($css['background_opacity'] )) : 'white'; ?>;
color: <?php echo esc_attr($css['color']); ?>;
padding: <?php echo esc_attr($css['padding']); ?>px;
<?php if ( $css['border_type'] != 'none' ) {
?>border: <?php echo esc_attr($css['border_width']) . 'px' ?> <?php echo esc_attr($css['border_type']) ?> <?php echo esc_attr($css['border_color']); echo !empty( $opts['optin'] ) ? ' !important':'';?>;
<?php } ?>
border-radius: <?php echo esc_attr($css['border_radius']) . 'px' ?>;
-moz-border-radius: <?php echo esc_attr($css['border_radius']) . 'px' ?>;
-webkit-border-radius: <?php echo esc_attr($css['border_radius']) . 'px' ?>;
-moz-box-shadow: <?php echo $css['shadow_type'] == 'inset' ? 'inset' : ''?> <?php echo esc_attr($css['shadow_x_offset']) . 'px' ?> <?php echo esc_attr($css['shadow_y_offset']) . 'px' ?> <?php echo esc_attr($css['shadow_blur']) . 'px' ?> <?php echo esc_attr($css['shadow_spread']) . 'px' ?> <?php echo esc_attr($css['shadow_color'])?>;
-webkit-box-shadow: <?php echo $css['shadow_type'] == 'inset' ? 'inset' : ''?> <?php echo esc_attr($css['shadow_x_offset']) . 'px' ?> <?php echo esc_attr($css['shadow_y_offset']) . 'px' ?> <?php echo esc_attr($css['shadow_blur']) . 'px' ?> <?php echo esc_attr($css['shadow_spread']) . 'px' ?> <?php echo esc_attr($css['shadow_color'])?>;
box-shadow: <?php echo $css['shadow_type'] == 'inset' ? 'inset' : ''?> <?php echo esc_attr($css['shadow_x_offset']) . 'px' ?> <?php echo esc_attr($css['shadow_y_offset']) . 'px' ?> <?php echo esc_attr($css['shadow_blur']) . 'px' ?> <?php echo esc_attr($css['shadow_spread']) . 'px' ?> <?php echo esc_attr($css['shadow_color'])?>;
<?php echo ( empty( $opts['optin'] ) || $opts['optin'] == 'custom' ) ? 'width: ' . esc_attr( $width ) : ''; ?>;
}
#spu-bg-<?php echo $box->ID; ?> {
opacity: <?php echo ( !empty( $css['bgopacity'] ) ) ? esc_attr($css['bgopacity']) : 0; ?>;
background-color: <?php echo esc_attr($css['overlay_color'])?>;
}
<?php echo isset( $css['custom_css'] ) ? $css['custom_css'] : '';?>
<?php do_action( 'spu/popup/popup_style', $box, $opts, $css);?>
</style>
<div class="spu-bg" id="spu-bg-<?php echo $box->ID; ?>"></div>
<div class="spu-box <?php echo apply_filters( 'spu/popup/box_class', $box_class, $opts, $css, $box );?> spu-<?php echo esc_attr( $opts['css']['position'] ); ?> spu-total-<?php echo get_post_meta($box->ID, 'spu_social',true);?> <?php echo get_post_meta($box->ID, 'spu_google',true) ? 'spu-gogl' : '';?>" id="spu-<?php echo $box->ID; ?>"
data-box-id="<?php echo $box->ID ; ?>" data-trigger="<?php echo esc_attr( $opts['trigger'] ); ?>"
data-trigger-number="<?php echo esc_attr( absint( $opts['trigger_number'] ) ); ?>"
data-spuanimation="<?php echo esc_attr($opts['animation']); ?>" data-tconvert-cookie="<?php echo esc_attr( $opts['type-convert-cookie'] ); ?>" data-tclose-cookie="<?php echo esc_attr( $opts['type-close-cookie'] ); ?>" data-dconvert-cookie="<?php echo esc_attr( absint ( $opts['duration-convert-cookie'] ) ); ?>" data-dclose-cookie="<?php echo esc_attr( absint ( $opts['duration-close-cookie'] ) ); ?>" data-nconvert-cookie="<?php echo esc_attr( $opts['name-convert-cookie'] ); ?>" data-nclose-cookie="<?php echo esc_attr( $opts['name-close-cookie'] ); ?>" data-test-mode="<?php echo esc_attr($opts['test_mode']); ?>"
data-auto-hide="<?php echo esc_attr($opts['auto_hide']); ?>" data-close-on-conversion="<?php echo $opts['conversion_close'] == 1 ?'1':''; ?>" data-bgopa="<?php echo esc_attr($css['bgopacity']);?>" data-total="<?php echo get_post_meta($box->ID, 'spu_social',true);?>"
style="left:-99999px !important;right:auto;" data-width="<?php echo esc_attr(str_replace('px', '', $width)); ?>" <?php echo apply_filters( 'spu/popup/data_attrs', $data_attrs, $opts, $box );?>>
<div class="spu-content"><?php echo $content; ?></div>
<span class="spu-close spu-close-popup <?php echo esc_attr($css['close_position']); ?>"><i class="spu-icon spu-icon-close"></i></span>
<span class="spu-timer"></span>
<?php if( $opts['powered_link'] == '1' ) {
$aff_link = !empty($this->spu_settings['aff_link']) ? $this->spu_settings['aff_link'] : 'https://timersys.com/popups/';
?>
<p class="spu-powered">Powered by <a href="<?php echo $aff_link;?>" target="_blank">WordPress Popup</a></p>
<?php } ?>
</div>
<!-- / Popups Box -->
<?php
do_action( 'spu/popup/after_popup', $box, $opts, $css);