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,747 @@
/* This stylesheet is used to style the admin option form of the plugin. */
/*----------
Alerts
---------------*/
.alert-premium {
border: 4px solid #dd3d36;
padding: 10px;
text-align: center;
margin: 15px;
}
/*---------------------------------------------------------------------------------------------
Tables
---------------------------------------------------------------------------------------------*/
#spu-rules > .inside {
padding: 0;
}
table.spu_table {
border: 0 none;
background: #fff;
}
table.spu_table tbody tr td {
padding: 13px 15px;
border-top: 1px solid #f5f5f5;
border-bottom: 0 none;
}
table.spu_table tbody tr td.label {
width: 24%;
vertical-align: top;
background: #F9F9F9;
border-top: 1px solid #f0f0f0;
border-right: 1px solid #E1E1E1;
}
table.spu_table > tbody > tr:first-child > td,
table.spu_table > tbody > tr:first-child > td.label {
border-top: 0 none;
}
table.spu_table td.label ul.hl {
margin: 20px 0 0;
}
table.spu_table td.label ul.hl li {
margin: 0 3px 0 0;
}
table.spu_table td.label ul.hl li a.spu-button {
font-size: 12px;
padding: 6px 10px;
font-weight: normal;
}
table.spu_table tbody tr td.label label {
display: block;
font-size: 13px;
line-height: 1.4em;
font-weight: bold;
padding: 0;
margin: 0 0 3px;
color: #333;
}
table.spu_table tbody tr td.label label span.required {
color: #f00;
display: inline;
margin-left: 3px;
}
table.spu_table tbody tr td.label p {
display: block;
font-size: 12px;
line-height: 1.4em;
padding: 0 !important;
margin: 3px 0 0 !important;
font-style: normal;
line-height: 16px;
color: #899194;
}
table.spu_table input[type="text"],
table.spu_table input[type="number"],
table.spu_table textarea,
table.spu_table select{
width: 99.95%;
padding: 3px 5px;
outline: none;
}
table.spu_table select {
padding: 2px;
}
table.spu_table select option {
padding: 3px;
}
table.spu_table input[type="text"]:focus,
table.spu_table textarea:focus,
table.spu_table select:focus {
border-color:#98B6CB;
}
#spu-options .no-top-margin{
margin-top:0 !important;
}
#spu-options .wp-picker-clear, #spu-options div.wp-picker-holder, #spu-options .wp-picker-input-wrap {
background:white;
z-index: 999 !important;
position: absolute !important;
}
.spu-label {
display: block;
font-weight: bold;
margin-bottom: 6px;
cursor: default;
}
#spu-options .wp-picker-container{ white-space: nowrap; }
input#spu-width {
width: 90px;
}
h3.spu-title {
border-bottom: 1px solid #ccc;
font-size: 18px !important;
}
/*---------------------------------------------------------------------------------------------
*
* Rules
*
*---------------------------------------------------------------------------------------------*/
#spu-rules .inside {
margin: 0;
padding: 0;
}
#spu-rules .rules-groups {
padding: 5px 0;
}
#spu-rules h4 {
margin: 15px 0 5px;
}
#spu-rules .rules-group {
margin: 0 0 15px;
}
#spu-rules .rules-group h4 {
margin: 0 0 3px;;
}
#spu-rules .rules-group table.spu_table tbody tr td {
padding: 4px;
border: 0 none;
}
#spu-rules .rules-group td.param {
width: 40%;
}
#spu-rules .rules-group td.operator {
width: 20%;
}
#spu-rules .rules-group td.add {
width: 40px;
}
#spu-rules .rules-group td.remove {
width: 18px;
vertical-align: middle;
}
#spu-rules .rules-group tr .rules-remove-rule {
display: none;
}
#spu-rules .rules-group tr:hover .rules-remove-rule {
display: block;
padding: 0 7px;
font-weight: bold;
font-size: 16px;
border-radius: 50%;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}
#spu-rules .rules-group .rules-remove-rule:hover {
color: red;
}
/**
* Other Rules
*/
.spu-loading{
height: 16px;
margin: 10px auto;
padding: 6px;
width: 16px;
}
div#spu-premium {
border: 2px solid #999;
box-shadow: 7px 11px 13px -3px #ccc;
}
div#spu-premium li{
list-style: square;
margin-left: 30px;
}
/* Don't allow user to delete the first field group */
#spu-rules .rules-group:first-child tr:first-child:hover .rules-remove-rule {
display: none;
}
#spu-options p.help {
font-weight: normal;
font-size: .9em !important;
}
@font-face {
font-family: 'spufont';
src:url('../../../public/assets/fonts/spufont.eot?xaknv7');
src:url('../../../public/assets/fonts/spufont.eot?#iefixxaknv7') format('embedded-opentype'),
url('../../../public/assets/fonts/spufont.woff?xaknv7') format('woff'),
url('../../../public/assets/fonts/spufont.ttf?xaknv7') format('truetype'),
url('../../../public/assets/fonts/spufont.svg?xaknv7#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;
padding-right: 5px;
/* 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-magic:before {
content: "\f0d0";
}
.spu-icon-angle-up:before {
content: "\f106";
}
.spu-icon-angle-down:before {
content: "\f107";
}
.spu-icon-toggle-off:before {
content: "\f204";
}
.spu-icon-toggle-on:before {
content: "\f205";
}
.spu-icon-info:before {
content: "\ea0c";
}
.spu-icon-spinner:before {
content: "\f110";
animation: spu-rotate 1s infinite linear;
-webkit-animation: spu-rotate 1s infinite linear;
-o-animation: spu-rotate 1s infinite linear;
-moz-animation: spu-rotate 1s infinite linear;
}
h3 .spu-icon {
margin-right: 7px;
}
@keyframes spu-rotate {
0% {
transform: rotate(0deg);
opacity: 1;
}
50% {
opacity: .7;
}
100% {
transform: rotate(359deg);
opacity: 1;
}
}
th#spu_switch{
width: 70px;
text-align: center;
}
td.spu_switch{
text-align: center;
}
.spu_switch a {
font-size: 2em;
}
.spu_switch a i.spu-icon-toggle-off {
color: #999;
}
.spu_switch a i.spu-icon-toggle-on {
color: forestgreen;
}
.post-type-spucpt div#preview-action {
display: none;
}
h4.rules-or {
border-top: 2px dashed #ddd;
line-height: 1;
text-align: center;
}
h4.rules-or span{
background: #ffffff;
position: relative;
top: -8px;
padding: 2px 10px;
}
.spu-admin-options h3{
border-bottom: 1px solid #555;
padding-bottom: 10px;
}
.spu-setting-box {
margin-bottom: 30px;
}
span.spu-help {
font-size: 12px;
font-weight: normal;
}
#wppopups-welcome {
border-top: 3px solid #0073aa;
color: #555;
padding-top: 110px;
}
@media (max-width: 767px) {
#wppopups-welcome {
padding-top: 64px;
}
}
#wppopups-welcome *,
#wppopups-welcome *::before,
#wppopups-welcome *::after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
#wppopups-welcome .container {
margin: 0 auto;
max-width: 720px;
padding: 0;
}
#wppopups-welcome .block {
padding: 40px;
}
@media (max-width: 767px) {
#wppopups-welcome .block {
padding: 20px;
}
}
#wppopups-welcome img {
max-width: 100%;
height: auto;
width: 135px;
}
.upgrade-welcome-cta{display: flex; align-items: center;}
a.play-video {
background: url(../images/video-bg.jpg) no-repeat center center;
display: block;
padding: 80px;
border: 2px solid #ccc;
margin: 10px;
background-size: cover;
}
a.play-video img{
transition: all 100ms ease-in;
}
a.play-video:hover img{
opacity: .8;
}
#wppopups-welcome h1 {
color: #222;
font-size: 24px;
text-align: center;
margin: 0 0 16px 0;
}
#wppopups-welcome h5 {
color: #222;
font-size: 16px;
margin: 0 0 8px 0;
}
#wppopups-welcome h6 {
font-size: 16px;
font-weight: 400;
line-height: 1.6;
text-align: center;
margin: 0;
}
#wppopups-welcome p {
font-size: 14px;
margin: 0 0 20px 0;
}
#wppopups-welcome .button-wrap {
max-width: 590px;
margin: 0 auto 0 auto;
}
#wppopups-welcome .button-wrap .left {
float: left;
width: 50%;
padding-right: 20px;
}
@media (max-width: 767px) {
#wppopups-welcome .button-wrap .left {
float: none;
width: 100%;
padding: 0;
margin-bottom: 20px;
}
}
#wppopups-welcome .button-wrap .right {
float: right;
width: 50%;
padding-left: 20px;
}
@media (max-width: 767px) {
#wppopups-welcome .button-wrap .right {
float: none;
width: 100%;
padding: 0;
}
}
#wppopups-welcome .intro {
background-color: #fff;
border: 2px solid #e1e1e1;
border-radius: 2px;
margin-bottom: 30px;
position: relative;
padding-top: 40px;
}
#wppopups-welcome .intro .sullie {
background-color: #fff;
border: 2px solid #e1e1e1;
border-radius: 50%;
height: 110px;
width: 110px;
padding: 18px 14px 0 14px;
position: absolute;
top: -58px;
left: 50%;
margin-left: -55px;
}
#wppopups-welcome .intro .video-thumbnail {
display: block;
margin: 0 auto;
}
#wppopups-welcome .intro .button-wrap {
margin-top: 25px;
}
#wppopups-welcome .features {
background-color: #fff;
border: 2px solid #e1e1e1;
border-bottom: 0;
border-radius: 2px 2px 0 0;
position: relative;
padding-top: 20px;
padding-bottom: 20px;
}
#wppopups-welcome .features .feature-list {
margin-top: 60px;
}
#wppopups-welcome .features .feature-block {
float: left;
width: 50%;
padding-bottom: 35px;
overflow: auto;
}
@media (max-width: 767px) {
#wppopups-welcome .features .feature-block {
float: none;
width: 100%;
}
}
#wppopups-welcome .features .feature-block.first {
padding-right: 20px;
clear: both;
}
@media (max-width: 767px) {
#wppopups-welcome .features .feature-block.first {
padding-right: 0;
}
}
#wppopups-welcome .features .feature-block.last {
padding-left: 20px;
}
@media (max-width: 767px) {
#wppopups-welcome .features .feature-block.last {
padding-left: 0;
}
}
#wppopups-welcome .features .feature-block img {
float: left;
max-width: 46px;
}
#wppopups-welcome .features .feature-block h5 {
margin-left: 68px;
}
#wppopups-welcome .features .feature-block p {
margin: 0;
margin-left: 68px;
}
#wppopups-welcome .features .button-wrap {
margin-top: 25px;
text-align: center;
}
#wppopups-welcome .upgrade-cta {
background-color: #000;
border: 2px solid #e1e1e1;
border-top: 0;
border-bottom: 0;
color: #fff;
}
a.wppopups-btn {
background-color: #2273aa;
border-radius: 3px;
border: none;
color: #fff;
cursor: pointer;
font-weight: 700;
letter-spacing: 2px;
line-height: 1;
padding: 16px 13px;
text-align: center;
text-transform: uppercase;
width: auto;
text-decoration: none;
display: block;
}
.wppopups-clear:before {
content: " ";
display: table;
}
.wppopups-clear:after {
clear: both;
content: " ";
display: table;
}
#wppopups-welcome .upgrade-cta h2 {
color: #fff;
font-size: 20px;
margin: 0 0 30px 0;
}
#wppopups-welcome .upgrade-cta ul {
display: -ms-flex;
display: -webkit-flex;
display: flex;
-webkit-flex-wrap: wrap;
flex-wrap: wrap;
font-size: 15px;
margin: 0;
padding: 0;
}
#wppopups-welcome .upgrade-cta ul li {
display: block;
width: 50%;
margin: 0 0 8px 0;
padding: 0;
}
#wppopups-welcome .upgrade-cta ul li .dashicons {
color: #2a9b39;
margin-right: 5px;
}
#wppopups-welcome .upgrade-cta .left {
float: left;
width: 66.666666%;
padding-right: 20px;
}
@media (max-width: 767px) {
#wppopups-welcome .upgrade-cta .left {
float: none;
width: 100%;
padding-right: 0;
margin-bottom: 20px;
}
}
#wppopups-welcome .upgrade-cta .right {
float: right;
width: 33.333333%;
padding-left: 20px;
text-align: center;
}
@media (max-width: 767px) {
#wppopups-welcome .upgrade-cta .right {
float: none;
width: 100%;
padding-left: 0;
}
}
#wppopups-welcome .upgrade-cta .right h2 {
text-align: center;
margin: 0;
}
#wppopups-welcome .upgrade-cta .right h2 span {
display: inline-block;
border-bottom: 1px solid #555;
padding: 0 15px 12px;
}
#wppopups-welcome .upgrade-cta .right .price {
padding: 26px 0;
}
#wppopups-welcome .upgrade-cta .right .price .amount {
font-size: 48px;
font-weight: 600;
position: relative;
display: inline-block;
}
#wppopups-welcome .upgrade-cta .right .price .amount:before {
content: '$';
position: absolute;
top: -8px;
left: -16px;
font-size: 18px;
}
#wppopups-welcome .upgrade-cta .right .price .term {
font-size: 12px;
display: inline-block;
}
#wppopups-welcome .testimonials {
background-color: #fff;
border: 2px solid #e1e1e1;
border-top: 0;
padding: 20px 0;
}
#wppopups-welcome .testimonials .testimonial-block {
margin: 50px 0 0 0;
}
#wppopups-welcome .testimonials .testimonial-block img {
border-radius: 50%;
float: left;
max-width: 100px;
box-shadow: 0 0 18px rgba(0, 0, 0, 0.2);
}
@media (max-width: 767px) {
#wppopups-welcome .testimonials .testimonial-block img {
width: 65px;
}
}
#wppopups-welcome .testimonials .testimonial-block p {
font-size: 14px;
margin: 0 0 12px 140px;
}
@media (max-width: 767px) {
#wppopups-welcome .testimonials .testimonial-block p {
margin-left: 100px;
}
}
#wppopups-welcome .testimonials .testimonial-block p:last-of-type {
margin-bottom: 0;
}
#wppopups-welcome .footer {
background-color: #f1f1f1;
border: 2px solid #e1e1e1;
border-top: 0;
border-radius: 0 0 2px 2px;
}
#wppopups-welcome.pro .features {
border: 2px solid #e1e1e1;
margin-bottom: 30px;
}
#wppopups-welcome.pro .upgrade,
#wppopups-welcome.pro .footer {
display: none;
}
#wppopups-welcome.pro .testimonials {
border: 2px solid #e1e1e1;
}

View File

@@ -0,0 +1,62 @@
/**
* Editor
*/
html{
background: #9C9B9B;
}
body#tinymce.wp-editor{
margin: 20px auto;
}
body#tinymce.wp-editor,
body#tinymce.wp-editor * {
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
}
body#tinymce.wp-editor{
max-width: 100%;
}
/**
* Top position
*/
body#tinymce.spu-optin-editor.spu-position-top-bar,
body#tinymce.spu-position-top-bar {
margin-top: 0 !important;
border-top: none !important;
}
body#tinymce.spu-optin-editor.spu-position-top-bar,
body#tinymce.spu-position-top-bar ,
body#tinymce.spu-optin-editor.spu-position-bottom-bar,
body#tinymce.spu-position-bottom-bar {
padding-top: 10px !important;
padding-bottom: 10px !important;
width: 100% !important;
border-left: none !important;
border-right: none !important;
border-radius: 0;
}
body#tinymce.spu-optin-editor.spu-position-bottom-bar,
body#tinymce.spu-position-bottom-bar {
margin-bottom: 0 !important;
border-bottom: none !important;
position: absolute;
left: 0;
bottom: 0;
}
body#tinymce.spu-position-top-bar h1,
body#tinymce.spu-position-top-bar h2,
body#tinymce.spu-position-top-bar h3,
body#tinymce.spu-position-top-bar h4,
body#tinymce.spu-position-top-bar h5,
body#tinymce.spu-position-top-bar h6,
body#tinymce.spu-position-top-bar p,
body#tinymce.spu-position-bottom-bar h1,
body#tinymce.spu-position-bottom-bar h2,
body#tinymce.spu-position-bottom-bar h3,
body#tinymce.spu-position-bottom-bar h4,
body#tinymce.spu-position-bottom-bar h5,
body#tinymce.spu-position-bottom-bar h6,
body#tinymce.spu-position-bottom-bar p{
margin: 0;
}

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,362 @@
var spu = {
// module
rules : null
};
SPU_ADMIN = (function ( $ ) {
var spu_editor = '';
$(document).ready(function(){
spu.rules.init();
var color_field = $('#spu-appearance input.spu-color-field'),
spu_optin = $('#spu_optin');
// Only run if there is no optin being used in premium version
if( color_field.length && ( ! spu_optin.length || spu_optin.val() == '' ) ){
color_field.wpColorPicker({ change: applyStyles, clear: applyStyles });
}
$("#spu-appearance input,#spu-appearance select").not(".spu-color-field").change(applyStyles);
//Toogle trigger boxes on init
checkTriggerMethod( $("#spu_trigger").val() );
//Toogle trigger boxes on change
$("#spu_trigger").change(function(){
checkTriggerMethod( $(this).val() );
})
/**
* Updates on position change
*/
$('#spu_position').on('change', function(){
var $editor = SPU_ADMIN.spu_editor,
val = $(this).val();
//update editor
$editor.alterClass('spu-position-*', 'spu-position-'+ val )
if( val == 'top-bar' || val == 'bottom-bar') {
$editor.find('.spu-box-container *:not("p, .spu-fields-container, .spu-fields-container *")').remove();
}
});
});
/**
* When tinyMcr loads
*/
function TinyMceOptin() {
SPU_ADMIN.spu_editor = $("#content_ifr").contents().find('html #tinymce');
// add position class
SPU_ADMIN.spu_editor.addClass(' spu-position-' + spu_js.opts.css.position).removeClass('wp-autoresize');
applyStyles();
}
function checkTriggerMethod( val ) {
if( val == 'pixels' || val == 'percentage' || val == 'visible') {
$('tr.auto_hide').fadeIn('fast');
} else {
$('tr.auto_hide').fadeOut('fast');
}/*TODO I should fix premium so these values are not even considered here*/
if( val == 'manual' || val == 'trigger-click' || val == 'visible' || val == 'exit-intent') {
$('.spu-trigger-number').fadeOut('fast');
} else {
$('.spu-trigger-number').fadeIn('fast');
}
}
// functions
function getPxValue($el, retval) {
if($el.val()) {
return parseInt($el.val());
} else {
return (retval !== undefined) ? retval + "px" : 0;
}
}
function getColor($el, retval) {
if($el.val().length > 0) {
return $el.wpColorPicker('color');
} else {
return (retval !== undefined) ? retval : '';
}
}
function applyStyles() {
var $editor = $("#content_ifr").contents().find('html');
$editor.trigger('spu_tinymce_init');
$editor.css({
'background': spu_hexToRgb(getColor($("#spu_bgcolor")),$("#spu_bgopacity").val())
});
// if there is no optin mode load defaults
if (typeof spup_js == "undefined" || $('#spu_optin').val() == '') {
// remove any field that could be there after deactivating premium version
$editor.find(".spu-fields-container").remove();
$editor.find("#tinymce").attr('style', 'padding: ' + getPxValue($("#spu-padding")) + 'px !important');
$editor.find("#tinymce").css({
'background-color': spu_hexToRgb(getColor($("#spu-background-color")),$("#spu_background_opacity").val()),
'border-color': getColor($("#spu-border-color")),
'border-width': getPxValue($("#spu-border-width")),
'border-style': $("#spu-border-type").val(),
'width': $("#spu-width").val(),
'color': getColor($("#spu-color")),
'height': 'auto',
'min-width': '200px',
'max-width': '100%',
'margin': '8px auto 0;',
'box-shadow': ($("#spu-shadow-type").val() == 'inset' ? 'inset' : '') +' '+ $("#spu-shadow-x").val() + 'px ' + $("#spu-shadow-y").val() + 'px ' + $("#spu-shadow-blur").val() + 'px ' + $("#spu-shadow-spread").val() + 'px ' + getColor($("#spu-shadow-color"))
});
var img_src = $('#spu_bgimage').val();
$editor.find("#tinymce").css({
'background-image': 'url("'+img_src+'")',
'background-size' : 'cover'
});
}
}
/*
* Rules
*
* Js for needed for rules
*
* @since: 1.0.0
* Thanks to advanced custom fields plugin for part of this code
*/
spu.rules = {
$el : null,
init : function(){
// vars
var _this = this;
// $el
_this.$el = $('#spu-rules');
// add rule
_this.$el.on('click', '.rules-add-rule', function(){
_this.add_rule( $(this).closest('tr') );
return false;
});
// remove rule
_this.$el.on('click', '.rules-remove-rule', function(){
_this.remove_rule( $(this).closest('tr') );
return false;
});
// add rule
_this.$el.on('click', '.rules-add-group', function(){
_this.add_group();
return false;
});
// change rule
_this.$el.on('change', '.param select', function(){
// vars
var $tr = $(this).closest('tr'),
rule_id = $tr.attr('data-id'),
$group = $tr.closest('.rules-group'),
group_id = $group.attr('data-id'),
val_td = $tr.find('td.value'),
ajax_data = {
'action' : "spu/field_group/render_rules",
'nonce' : spu_js.nonce,
'rule_id' : rule_id,
'group_id' : group_id,
'value' : '',
'param' : $(this).val()
};
// add loading gif
var div = $('<div class="spu-loading"><img src="'+spu_js.admin_url+'/images/wpspin_light.gif"/> </div>');
val_td.html( div );
// load rules html
$.ajax({
url: ajaxurl,
data: ajax_data,
type: 'post',
dataType: 'html',
success: function(html){
val_td.html(html);
}
});
// Operators Rules
var operator_td = $tr.find('td.operator'),
ajax_data = {
'action' : "spu/field_group/render_operator",
'nonce' : spu_js.nonce,
'rule_id' : rule_id,
'group_id' : group_id,
'value' : '',
'param' : $(this).val()
};
operator_td.html( div );
$.ajax({
url: ajaxurl,
data: ajax_data,
type: 'post',
dataType: 'html',
success: function(html){
operator_td.html(html);
}
});
});
},
add_rule : function( $tr ){
// vars
var $tr2 = $tr.clone(),
old_id = $tr2.attr('data-id'),
new_id = 'rule_' + ( parseInt( old_id.replace('rule_', ''), 10 ) + 1);
// update names
$tr2.find('[name]').each(function(){
$(this).attr('name', $(this).attr('name').replace( old_id, new_id ));
$(this).attr('id', $(this).attr('id').replace( old_id, new_id ));
});
// update data-i
$tr2.attr( 'data-id', new_id );
// add tr
$tr.after( $tr2 );
return false;
},
remove_rule : function( $tr ){
// vars
var siblings = $tr.siblings('tr').length;
if( siblings == 0 ) {
// remove group
this.remove_group( $tr.closest('.rules-group') );
} else {
// remove tr
$tr.remove();
}
},
add_group : function(){
// vars
var $group = this.$el.find('.rules-group:last'),
$group2 = $group.clone(),
old_id = $group2.attr('data-id'),
new_id = 'group_' + ( parseInt( old_id.replace('group_', ''), 10 ) + 1);
// update names
$group2.find('[name]').each(function(){
$(this).attr('name', $(this).attr('name').replace( old_id, new_id ));
$(this).attr('id', $(this).attr('id').replace( old_id, new_id ));
});
// update data-i
$group2.attr( 'data-id', new_id );
// update h4
$group2.find('h4').html( spu_js.l10n.or ).addClass('rules-or');
// remove all tr's except the first one
$group2.find('tr:not(:first)').remove();
// add tr
$group.after( $group2 );
},
remove_group : function( $group ){
$group.remove();
}
};
return {
onTinyMceInit: function() {
TinyMceOptin();
}
}
}(jQuery));
( function( global, $ ) {
var editor,
syncCSS = function() {
$( '#spu-custom-css' ).val( editor.getSession().getValue() );
},
loadAce = function() {
if(! $('#custom_css').length )
return;
editor = ace.edit( 'custom_css' );
global.safecss_editor = editor;
editor.getSession().setUseWrapMode( true );
editor.setShowPrintMargin( false );
editor.getSession().setValue( $( '#spu-custom-css' ).val() );
editor.getSession().setMode( "ace/mode/css" );
jQuery.fn.spin&&$( '#custom_css_container' ).spin( false );
$( '#post' ).submit( syncCSS );
};
if ( $.browser.msie&&parseInt( $.browser.version, 10 ) <= 7 ) {
$( '#custom_css_container' ).hide();
$( '#spu-custom-css' ).show();
return false;
} else {
$( global ).load( loadAce );
}
global.aceSyncCSS = syncCSS;
} )( this, jQuery );
function spu_hexToRgb(hex, alpha) {
hex = hex.replace('#', '');
var r = parseInt(hex.length == 3 ? hex.slice(0, 1).repeat(2) : hex.slice(0, 2), 16);
var g = parseInt(hex.length == 3 ? hex.slice(1, 2).repeat(2) : hex.slice(2, 4), 16);
var b = parseInt(hex.length == 3 ? hex.slice(2, 3).repeat(2) : hex.slice(4, 6), 16);
if ( alpha ) {
return 'rgba(' + r + ', ' + g + ', ' + b + ', ' + alpha + ')';
}
else {
return 'rgb(' + r + ', ' + g + ', ' + b + ')';
}
}
/**
* jQuery alterClass plugin
*
* Remove element classes with wildcard matching. Optionally add classes:
* $( '#foo' ).alterClass( 'foo-* bar-*', 'foobar' )
*
* Copyright (c) 2011 Pete Boere (the-echoplex.net)
* Free under terms of the MIT license: http://www.opensource.org/licenses/mit-license.php
*
*/
(function ( $ ) {
$.fn.alterClass = function ( removals, additions ) {
var self = this;
if ( removals.indexOf( '*' ) === -1 ) {
// Use native jQuery methods if there is no wildcard matching
self.removeClass( removals );
return !additions ? self : self.addClass( additions );
}
var patt = new RegExp( '\\s' +
removals.
replace( /\*/g, '[A-Za-z0-9-_]+' ).
split( ' ' ).
join( '\\s|\\s' ) +
'\\s', 'g' );
self.each( function ( i, it ) {
var cn = ' ' + it.className + ' ';
while ( patt.test( cn ) ) {
cn = cn.replace( patt, ' ' );
}
it.className = $.trim( cn );
});
return !additions ? self : self.addClass( additions );
};
})( jQuery );

View File

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

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@@ -0,0 +1,65 @@
(function( $ ) {
'use strict';
tinymce.create('tinymce.plugins.SPU', {
init : function(ed, url) {
ed.addButton('spu_button', {
title : 'Add Popup',
cmd : 'spu_button',
image : url+'/popup.png'
});
ed.addCommand('spu_button', function() {
jQuery('#spu_editor').dialog({
height: 500,
width: '600px',
buttons: {
"Insert Shortcode": function() {
var spu_id = jQuery('#spu-posts').val();
var str = "";
str = '[spu popup="'+spu_id+'"';
var selected_text = ed.selection.getContent();
if (selected_text) {
str += "]" + selected_text + "[/spu]";
} else {
str += "]YOUR TEXT OR IMG HERE[/spu]";
}
var Editor = tinyMCE.get('content');
Editor.focus();
Editor.selection.setContent(str);
jQuery( this ).dialog( "close" );
},
Cancel: function() {
jQuery( this ).dialog( "close" );
}
}
}).dialog('open');
});
},
createControl : function(n, cm) {
return null;
},
getInfo : function() {
return {
longname : 'Popups Button',
author : 'Damian Logghe',
authorurl : 'https://timersys.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example',
version : "0.1"
};
}
});
tinymce.PluginManager.add('spu', tinymce.plugins.SPU);
})( jQuery );

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,972 @@
<?php
/**
* Popups.
*
* @package SocialPopup_Admin
* @author Damian Logghe <info@timersys.com>
* @license GPL-2.0+
* @link https://timersys.com
* @copyright 2014 Timersys
*/
define( 'SPU_ADMIN_DIR' , plugin_dir_path(__FILE__) );
/**
* Admin Class of the plugin
*
* @package SocialPopup_Admin
* @author Damian Logghe <info@timersys.com>
*/
class SocialPopup_Admin {
/**
* Instance of this class.
*
* @since 1.0.0
*
* @var object
*/
protected static $instance = null;
/**
* Slug of the plugin screen.
*
* @since 1.0.0
*
* @var string
*/
protected $plugin_screen_hook_suffix = null;
/**
* Plugins settings
* @var array
*/
protected $spu_settings = array();
/**
* Premium version is enabled
*
* @since 1.1
*
* @var bool
*/
protected $premium = false;
/**
* Helper function
*
* @since 1.1
*
* @var bool
*/
protected $helper = '';
/**
* Initialize the plugin by loading admin scripts & styles and adding a
* settings page and menu.
*
* @since 1.0.0
*/
private function __construct() {
$plugin = SocialPopup::get_instance();
$this->plugin_slug = $plugin->get_plugin_slug();
// helper funcs
$this->helper = new Spu_Helper;
//settings name
$this->options_name = $this->plugin_slug .'_settings';
//load settings
$this->spu_settings = $plugin->get_settings();
//premium version ?
$this->premium = defined('SPUP_PLUGIN_HOOK');
// add settings page
add_action('admin_menu' , array( $this, 'add_settings_menu' ) );
//Add our metaboxes
add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
//Save metaboxes
add_action( 'save_post', array( $this, 'save_meta_options' ), 20, 2 );
// Load admin style sheet and JavaScript.
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) );
// Add an action link pointing to the options page.
add_filter( 'plugin_action_links_' . SPU_PLUGIN_HOOK, array( $this, 'add_action_links' ) );
//Filters for rules
add_filter('spu/get_post_types', array($this, 'get_post_types'), 1, 3);
add_filter('spu/get_taxonomies', array($this, 'get_taxonomies'), 1, 3);
//AJAX Actions
add_action('wp_ajax_spu/field_group/render_rules', array( $this->helper, 'ajax_render_rules' ) );
add_action('wp_ajax_spu/field_group/render_operator', array( $this->helper, 'ajax_render_operator' ) );
add_action('wp_ajax_spu_enable_ajax_notice_handler', array( $this, 'ajax_notice_handler' ) );
//Tinymce
add_filter( 'tiny_mce_before_init', array($this, 'tinymce_init'), 9999 );
add_action( 'admin_init', array( $this, 'editor_styles' ) );
add_action( 'init', array( $this, 'register_tiny_buttons' ) );
//Columns in cpt
add_filter( 'manage_edit-spucpt_columns' , array( $this, 'set_custom_cpt_columns'), 10, 2 );
add_action( 'manage_spucpt_posts_custom_column' , array( $this, 'custom_columns'), 10, 2 );
add_action( 'admin_init' , array( $this, 'toggle_on_popup') );
add_action( 'admin_init' , array( $this, 'extra_checks') );
add_filter('use_block_editor_for_post_type', array( $this, 'disable_gutenberg' ), 9999, 2 );
add_filter('gutenberg_can_edit_post_type', array( $this, 'disable_gutenberg' ), 9999, 2 );
$this->set_rules_fields();
}
/**
* 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;
}
/**
* Add menu for Settings page of the plugin
* @since 1.1
* @return void
*/
public function add_settings_menu() {
add_submenu_page('edit.php?post_type=spucpt', __( 'Settings', 'popups' ), __( 'Settings', 'popups' ), apply_filters( 'spu/settings_page/roles', 'manage_options'), 'spu_settings', array( $this, 'settings_page' ) );
}
/**
* Settings page of the plugin
* @since 1.1
* @return void
*/
public function settings_page() {
$defaults = apply_filters( 'spu/settings_page/defaults_opts', array(
'aff_link' => '',
'ajax_mode' => '0',
'shortcodes_style' => '',
'facebook' => '',
'google' => '',
'twitter' => '',
'spu_license_key' => '',
'ua_code' => '',
'mc_api' => '',
));
$opts = apply_filters( 'spu/settings_page/opts', get_option( 'spu_settings', $defaults ) );
if ( isset( $_POST['spu_nonce'] ) && wp_verify_nonce( $_POST['spu_nonce'], 'spu_save_settings' ) ) {
$opts = esc_sql( @$_POST['spu_settings'] );
update_option( 'spu_settings' , $opts );
}
include 'views/settings-page.php';
}
/**
* Register the metaboxes for our cpt and remove others
*/
public function add_meta_boxes() {
add_meta_box(
'spu-video',
'<i class="spu-icon-info spu-icon"></i>' . __( 'Help video', 'popups' ),
array( $this, 'metabox_video' ),
'spucpt',
'normal',
'core'
);
add_meta_box(
'spu-appearance',
'<i class="spu-icon-magic spu-icon"></i>' . __( 'PopUp Appearance', 'popups' ),
array( $this, 'popup_appearance' ),
'spucpt',
'normal',
'core'
);
add_meta_box(
'spu-rules',
'<i class="spu-icon-eye spu-icon"></i>' . __( 'PopUp Display Rules', 'popups' ),
array( $this, 'popup_rules' ),
'spucpt',
'normal',
'core'
);
add_meta_box(
'spu-options',
'<i class="spu-icon-gears spu-icon"></i>' . __( 'Display Options', 'popups' ),
array( $this, 'popup_options' ),
'spucpt',
'normal',
'core'
);
if( !$this->premium ) {
add_meta_box(
'spu-premium',
__( 'Popups Premium', 'popups' ),
array( $this, 'popup_premium' ),
'spucpt',
'normal',
'core'
);
}
add_meta_box(
'spu-help',
'<i class="spu-icon-info spu-icon"></i>' . __( 'PopUp Shortcodes', 'popups' ),
array( $this, 'popup_help' ),
'spucpt',
'normal',
'core'
);
add_meta_box(
'spu-support',
__( 'Need support?', 'popups' ),
array( $this, 'metabox_support' ),
'spucpt',
'side'
);
add_meta_box(
'spu-donate',
__( 'Donate & support', 'popups' ),
array( $this, 'metabox_donate' ),
'spucpt',
'side'
);
}
/**
* Include the metabox view for popup premium
* @param object $post spucpt post object
* @param array $metabox full metabox items array
* @since 1.1
*/
public function popup_premium( $post, $metabox ) {
include 'views/metaboxes/metabox-premium.php';
}
/**
* Include the metabox view for popup help
* @param object $post spucpt post object
* @param array $metabox full metabox items array
* @since 1.1
*/
public function popup_help( $post, $metabox ) {
include 'views/metaboxes/metabox-help.php';
}
/**
* Include the metabox view for popup rules
* @param object $post spucpt post object
* @param array $metabox full metabox items array
* @since 1.1
*/
public function popup_rules( $post, $metabox ) {
$groups = apply_filters('spu/metaboxes/get_box_rules', $this->helper->get_box_rules( $post->ID ), $post->ID);
include 'views/metaboxes/metabox-rules.php';
}
/**
* Include the metabox view for popup options
* @param object $post spucpt post object
* @param array $metabox full metabox items array
* @since 1.1
*/
public function popup_options( $post, $metabox ) {
$opts = apply_filters('spu/metaboxes/get_box_options', $this->helper->get_box_options( $post->ID ), $post->ID );
include 'views/metaboxes/metabox-options.php';
}
/**
* Include the metabox view for popup appearance
* @param object $post spucpt post object
* @param array $metabox full metabox items array
* @since 1.1
*/
public function popup_appearance( $post, $metabox ) {
$opts = apply_filters('spu/metaboxes/get_box_options', $this->helper->get_box_options( $post->ID ), $post->ID );
include 'views/metaboxes/metabox-appearance.php';
}
/**
* Include the metabox view for donate box
* @param object $post spucpt post object
* @param array $metabox full metabox items array
* @since 1.1
*/
public function metabox_donate( $post, $metabox ) {
$donate_metabox = apply_filters( 'spu/metaboxes/donate_metabox', dirname(__FILE__) . '/views/metaboxes/metabox-donate.php' );
include $donate_metabox;
}
/**
* Include the metabox view for help video
* @param object $post spucpt post object
* @param array $metabox full metabox items array
* @since 1.1
*/
public function metabox_video( $post, $metabox ) {
$video_metabox = apply_filters( 'spu/metaboxes/video_metabox', dirname(__FILE__) . '/views/metaboxes/metabox-video.php' );
include $video_metabox;
}
/**
* Include the metabox view for support box
* @param object $post spucpt post object
* @param array $metabox full metabox items array
* @since 1.1
*/
public function metabox_support( $post, $metabox ) {
$support_metabox = apply_filters( 'spu/metaboxes/support_metabox', dirname(__FILE__) . '/views/metaboxes/metabox-support.php' );
include $support_metabox;
}
/**
* Saves popup options and rules
*
* @param $post_id
*
* @return mixed
*/
public function save_meta_options( $post_id, $post ) {
static $spu_save = 0;
if ( $post->post_type != 'spucpt' )
return $post_id;
// For some reason sometimes this hook run twice, until I can find the reason and reproduce error
// let's use a static var to prevent this
if( $spu_save > 0 )
return $post_id;
// Verify that the nonce is set and valid.
if ( !isset( $_POST['spu_options_nonce'] ) || ! wp_verify_nonce( $_POST['spu_options_nonce'], 'spu_options' ) ) {
return $post_id;
}
// If this is an autosave, our form has not been submitted, so we don't want to do anything.
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
return $post_id;
}
// same for ajax
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
return $post_id;
}
// same for cron
if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
return $post_id;
}
// same for posts revisions
if ( wp_is_post_revision( $post_id ) ) {
return $post_id;
}
// can user edit this post?
if ( ! current_user_can( 'edit_post', $post_id ) ) {
return $post_id;
}
$opts = $_POST['spu'];
unset( $_POST['spu'] );
$post = get_post($post_id);
// sanitize settings
$opts['css']['bgopacity'] = sanitize_text_field( $opts['css']['bgopacity'] );
$opts['css']['overlay_color'] = sanitize_text_field( $opts['css']['overlay_color'] );
$opts['css']['background_color'] = sanitize_text_field( $opts['css']['background_color'] );
$opts['css']['background_opacity'] = sanitize_text_field( $opts['css']['background_opacity'] );
$opts['css']['width'] = sanitize_text_field( $opts['css']['width'] );
$opts['css']['padding'] = absint( sanitize_text_field( $opts['css']['padding'] ) );
$opts['css']['color'] = sanitize_text_field( $opts['css']['color'] );
$opts['css']['shadow_color'] = sanitize_text_field( $opts['css']['shadow_color'] );
$opts['css']['shadow_type'] = sanitize_text_field( $opts['css']['shadow_type'] );
$opts['css']['shadow_x_offset'] = absint( sanitize_text_field( $opts['css']['shadow_x_offset'] ) );
$opts['css']['shadow_y_offset'] = absint( sanitize_text_field( $opts['css']['shadow_y_offset'] ) );
$opts['css']['shadow_blur'] = absint( sanitize_text_field( $opts['css']['shadow_blur'] ) );
$opts['css']['shadow_spread'] = absint( sanitize_text_field( $opts['css']['shadow_spread'] ) );
$opts['css']['border_color'] = sanitize_text_field( $opts['css']['border_color'] );
$opts['css']['border_width'] = absint( sanitize_text_field( $opts['css']['border_width'] ) );
$opts['css']['border_radius'] = absint( sanitize_text_field( $opts['css']['border_radius'] ) );
$opts['css']['border_type'] = sanitize_text_field( $opts['css']['border_type'] );
$opts['css']['close_color'] = sanitize_text_field( $opts['css']['close_color'] );
$opts['css']['close_hover_color'] = sanitize_text_field( $opts['css']['close_hover_color'] );
$opts['css']['close_size'] = sanitize_text_field( $opts['css']['close_size'] );
$opts['css']['close_position'] = sanitize_text_field( $opts['css']['close_position'] );
$opts['css']['close_shadow_color'] = sanitize_text_field( $opts['css']['close_shadow_color'] );
$opts['css']['position'] = sanitize_text_field( $opts['css']['position'] );
$opts['name-convert-cookie'] = sanitize_text_field( $opts['name-convert-cookie'] ) ;
$opts['name-close-cookie'] = sanitize_text_field( $opts['name-close-cookie'] );
$opts['type-convert-cookie'] = sanitize_text_field( $opts['type-convert-cookie'] ) ;
$opts['type-close-cookie'] = sanitize_text_field( $opts['type-close-cookie'] );
$opts['duration-convert-cookie'] = absint( sanitize_text_field( $opts['duration-convert-cookie'] ) );
$opts['duration-close-cookie'] = absint( sanitize_text_field( $opts['duration-close-cookie'] ) );
// add popup ID to make the unique
$opts['name-convert-cookie'] = $opts['name-convert-cookie'] == 'spu_conversion' ? 'spu_conversion_'.$post_id : $opts['name-convert-cookie'] ;
$opts['name-close-cookie'] = $opts['name-close-cookie'] == 'spu_closing' ? 'spu_closing_'.$post_id : $opts['name-close-cookie'];
$opts['trigger_number'] = absint( sanitize_text_field( $opts['trigger_number'] ) );
// Check for social shortcodes and update post meta ( we check later if we need to enqueue any social js)
$total_shortcodes =0;
if( has_shortcode( $post->post_content, 'spu-facebook' ) || has_shortcode( $post->post_content, 'spu-facebook-page' ) ){
$total_shortcodes++;
update_post_meta( $post_id, 'spu_fb', true );
} else {
delete_post_meta( $post_id, 'spu_fb');
}
if( has_shortcode( $post->post_content, 'spu-twitter' ) ){
$total_shortcodes++;
update_post_meta( $post_id, 'spu_tw', true );
} else {
delete_post_meta( $post_id, 'spu_tw');
}
if( has_shortcode( $post->post_content, 'spu-google' ) ){
$total_shortcodes++;
$opts['google'] = true;
update_post_meta( $post_id, 'spu_google', true );
} else {
delete_post_meta( $post_id, 'spu_google');
}
// save total shortcodes (for auto styling)
if( $total_shortcodes ){
update_post_meta( $post_id, 'spu_social', $total_shortcodes );
} else {
delete_post_meta( $post_id, 'spu_social' );
}
if( has_shortcode( $post->post_content, 'gravityform' ) ) {
preg_match('/\[gravityform id="([0-9]+)".*\]/i', $post->post_content, $matches);
if( !empty( $matches[1] ) )
update_post_meta( $post_id, 'spu_gravity', $matches[1]);
} else {
delete_post_meta( $post_id, 'spu_gravity' );
}
// save box settings
update_post_meta( $post_id, 'spu_options', apply_filters( 'spu/metaboxes/sanitized_options', $opts ) );
// Start with rules
if( isset($_POST['spu_rules']) && is_array($_POST['spu_rules']) )
{
// clean array keys
$groups = array_values( $_POST['spu_rules'] );
foreach($groups as $group_id => $group )
{
if( is_array($group) )
{
// clean array keys
$groups_a[] = array_values( $group );
}
}
update_post_meta( $post_id, 'spu_rules', apply_filters( 'spu/metaboxes/sanitized_rules', $groups_a ) );
unset( $_POST['spu_rules'] );
}
$spu_save++;
}
/**
* Register and enqueue admin-specific style sheet.
*
* @TODO:
*
* - Rename "Plugin_Name" to the name your plugin
*
* @since 1.0.0
*
* @return null Return early if no settings page is registered.
*/
public function enqueue_admin_styles() {
global $pagenow;
$post_type = isset($_GET['post_type']) ? $_GET['post_type'] : get_post_type();
if ( $post_type !== 'spucpt' || !in_array( $pagenow, array( 'post-new.php', 'post.php', 'edit.php' ) ) ) {
return;
}
wp_enqueue_style( 'spu-admin-css', plugins_url( 'assets/css/admin.css', __FILE__ ) , '', SocialPopup::VERSION );
wp_enqueue_style( 'wp-color-picker' );
}
/**
* Register and enqueue admin-specific JavaScript.
*
* @TODO:
*
* - Rename "Plugin_Name" to the name your plugin
*
* @since 1.0.0
*
* @return null Return early if no settings page is registered.
*/
public function enqueue_admin_scripts() {
global $pagenow, $post;
if ( get_post_type() !== 'spucpt' || !in_array( $pagenow, array( 'post-new.php', 'edit.php', 'post.php' ) ) ) {
return;
}
$box_id = isset( $post->ID ) ? $post->ID : '';
wp_enqueue_script( 'wp-color-picker' );
wp_enqueue_script( 'ace_code_highlighter_js', plugins_url( 'assets/js/ace.js', __FILE__ ) , '', '1.0.0', true );
wp_enqueue_script( 'ace_mode_js', plugins_url( 'assets/js/mode-css.js', __FILE__ ) , array( 'ace_code_highlighter_js' ), '1.0.0', true );
wp_enqueue_script( 'worker_css_js', plugins_url( 'assets/js/worker-css.js', __FILE__ ) , array( 'jquery', 'ace_code_highlighter_js' ), '1.0.0', true );
wp_enqueue_script( 'spu-admin-js', plugins_url( 'assets/js/admin.js', __FILE__ ) , '', SocialPopup::VERSION );
wp_localize_script( 'spu-admin-js', 'spu_js',
array(
'admin_url' => admin_url( ),
'nonce' => wp_create_nonce( 'spu_nonce' ),
'l10n' => array (
'or' => '<span>'.__('OR', 'popups' ).'</span>'
),
'opts' => $this->helper->get_box_options($box_id)
)
);
wp_localize_script( 'spup-admin-js' , 'spup_js' ,
array(
'opts' => $this->helper->get_box_options($box_id),
'spinner' => SPU_PLUGIN_URL . 'public/assets/img/ajax-loader.gif'
)
);
}
/**
* Add settings action link to the plugins page.
*
* @since 1.0.0
*/
public function add_action_links( $links ) {
return array_merge(
array(
'settings' => '<a href="' . admin_url( 'edit.php?post_type=spucpt' ) . '">' . __( 'Add a Popup', 'popups' ) . '</a>'
),
$links
);
}
/**
* Return available posts types. Used in filters
* @param array $post_types custom post types
* @param array $exclude cpt to explude
* @param array $include cpts to include
* @return array Resulting cpts
*/
function get_post_types( $post_types, $exclude = array(), $include = array() ) {
// get all custom post types
$post_types = array_merge($post_types, get_post_types());
// core include / exclude
$spu_includes = array_merge( array(), $include );
$spu_excludes = array_merge( array( 'spucpt', 'acf', 'revision', 'nav_menu_item','custom_css', 'customize_changeset', 'oembed_cache', 'wpvqgr_quiz_trivia', 'wpvqgr_quiz_perso', 'wpvqgr_user', 'popup', 'popup_theme', 'page_rating', 'sa_slider', 'faq', 'opanda-item', 'amn_smtp' ), $exclude );
foreach( $spu_includes as $p )
{
if( post_type_exists($p) )
{
$post_types[ $p ] = $p;
}
}
// exclude
foreach( $spu_excludes as $p )
{
unset( $post_types[ $p ] );
}
return $post_types;
}
/**
* Get taxonomies. Used in filters rules
*
* @param array $choices [description]
* @param boolean $simple_value [description]
*
* @return array [type] [description]
*/
function get_taxonomies( $choices, $simple_value = false ) {
// vars
$post_types = get_post_types();
if($post_types)
{
foreach($post_types as $post_type)
{
$post_type_object = get_post_type_object($post_type);
$taxonomies = get_object_taxonomies($post_type);
if($taxonomies)
{
foreach($taxonomies as $taxonomy)
{
if( 'nav_menu' == $taxonomy ) continue;
$terms = get_terms($taxonomy, array('hide_empty' => true));
if($terms)
{
foreach($terms as $term)
{
$value = $taxonomy . ':' . $term->term_id;
if( $simple_value )
{
$value = $term->term_id;
}
$choices[$post_type_object->label . ': ' . $taxonomy][$value] = $term->name;
}
}
}
}
}
}
return $choices;
}
/**
* Load tinymce style on load
* @param [type] $args [description]
* @return [type] [description]
*/
public function tinymce_init($args) {
if( get_post_type() !== 'spucpt') {
return $args;
}
$func = '';
// dirty hax, WPML replace our function so let's try to get theirs and add to ours
// same with follow up emails by woocommerce
if( array_key_exists('setup', $args) && strpos($args['setup'], 'function(ed)') !== false) {
if( $pos = strpos($args['setup'], 'function(ed){') !== false ) {
if( $pos < 15 ){
$func .= rtrim(substr_replace($args['setup'],'',$pos,strlen('function(ed){')),'}');
}
}
if( $pos = strpos($args['setup'], 'function(ed) {') !== false ) {
if( $pos < 15 ){
$func .= rtrim(substr_replace($args['setup'],'',$pos,strlen('function(ed) {')),'}');
}
}
}
$args['setup'] = 'function(ed) {
if(typeof SPU_ADMIN === \'undefined\') {
return;
}
ed.onInit.add(SPU_ADMIN.onTinyMceInit);
if(typeof SPUP_ADMIN === \'undefined\') {
return;
}
ed.onInit.add(SPUP_ADMIN.onTinyMceInit);
'.$func.'
}';
return $args;
}
/**
* Add the stylesheet for optin in editor
* @since 1.2.3.6
*/
function editor_styles() {
global $pagenow;
$post_type = isset($_GET['post']) ? get_post_type($_GET['post']) : '';
if( 'spucpt' == $post_type || get_post_type() == 'spucpt' || (isset( $_GET['post_type']) && $_GET['post_type'] == 'spucpt') ) {
add_editor_style( SPU_PLUGIN_URL . 'admin/assets/css/editor-style.css' );
}
// Add html for shortcodes popup
if( 'post.php' == $pagenow || 'post-new.php' == $pagenow ) {
wp_enqueue_script( 'jquery-ui-dialog' );
wp_enqueue_style( 'wp-jquery-ui-dialog' );
add_action( 'in_admin_footer', array($this, 'add_editor' ),100 );
}
}
function get_rules_choices() {
$choices = array(
__("User", 'popups' ) => array(
'user_type' => __("User role", 'popups' ),
'logged_user' => __("User is logged", 'popups' ),
'left_comment' => __("User never left a comment", 'popups' ),
'search_engine' => __("User came via a search engine", 'popups' ),
'same_site' => __("User did not arrive via another page on your site", 'popups' ),
),
__("Post", 'popups' ) => array(
'post' => __("Post", 'popups' ),
'post_id' => __("Post ID", 'popups' ),
'post_type' => __("Post Type", 'popups' ),
'post_category' => __("Post Category", 'popups' ),
'post_format' => __("Post Format", 'popups' ),
'post_status' => __("Post Status", 'popups' ),
'taxonomy' => __("Post Taxonomy", 'popups' ),
),
__("Page", 'popups' ) => array(
'page' => __("Page", 'popups' ),
'page_type' => __("Page Type", 'popups' ),
'page_parent' => __("Page Parent", 'popups' ),
'page_template' => __("Page Template", 'popups' ),
),
__("Other", 'popups' ) => array(
'referrer' => __("Referrer", 'popups' ),
'query_string' => __("Query String", 'popups' ),
'keyword_url' => __("Url contains keyword", 'popups' ),
'custom_url' => __("Custom Url", 'popups' ),
'mobiles' => __("Mobile Phone", 'popups' ),
'tablets' => __("Tablet", 'popups' ),
'desktop' => __("Desktop", 'popups' ),
'crawlers' => __("Bots/Crawlers", 'popups' ),
'browser' => __("Browser", 'popups' ),
)
);
// allow custom rules rules
return apply_filters( 'spu/metaboxes/rule_types', $choices );
}
/**
* Hook each rule to a field to print
*/
private function set_rules_fields() {
// User
add_action('spu/rules/print_user_type_field', array('Spu_Helper', 'print_select'), 10, 2);
add_action('spu/rules/print_logged_user_field', array('Spu_Helper', 'print_select'), 10, 2);
add_action('spu/rules/print_left_comment_field', array('Spu_Helper', 'print_select'), 10, 2);
add_action('spu/rules/print_search_engine_field', array('Spu_Helper', 'print_select'), 10, 2);
add_action('spu/rules/print_same_site_field', array('Spu_Helper', 'print_select'), 10, 2);
// Post
add_action('spu/rules/print_post_type_field', array('Spu_Helper', 'print_select'), 10, 2);
add_action('spu/rules/print_post_id_field', array('Spu_Helper', 'print_textfield'), 10, 1);
add_action('spu/rules/print_post_field', array('Spu_Helper', 'print_select'), 10, 2);
add_action('spu/rules/print_post_category_field', array('Spu_Helper', 'print_select'), 10, 2);
add_action('spu/rules/print_post_format_field', array('Spu_Helper', 'print_select'), 10, 2);
add_action('spu/rules/print_post_status_field', array('Spu_Helper', 'print_select'), 10, 2);
add_action('spu/rules/print_taxonomy_field', array('Spu_Helper', 'print_select'), 10, 2);
// Page
add_action('spu/rules/print_page_field', array('Spu_Helper', 'print_select'), 10, 2);
add_action('spu/rules/print_page_type_field', array('Spu_Helper', 'print_select'), 10, 2);
add_action('spu/rules/print_page_parent_field', array('Spu_Helper', 'print_select'), 10, 2);
add_action('spu/rules/print_page_template_field', array('Spu_Helper', 'print_select'), 10, 2);
//Other
add_action('spu/rules/print_mobiles_field', array('Spu_Helper', 'print_select'), 10, 2);
add_action('spu/rules/print_desktop_field', array('Spu_Helper', 'print_select'), 10, 2);
add_action('spu/rules/print_tablets_field', array('Spu_Helper', 'print_select'), 10, 2);
add_action('spu/rules/print_crawlers_field', array('Spu_Helper', 'print_select'), 10, 2);
add_action('spu/rules/print_referrer_field', array('Spu_Helper', 'print_textfield'), 10, 1);
add_action('spu/rules/print_query_string_field', array('Spu_Helper', 'print_textfield'), 10, 1);
add_action('spu/rules/print_keyword_url_field', array('Spu_Helper', 'print_textfield'), 10, 1);
add_action('spu/rules/print_custom_url_field', array('Spu_Helper', 'print_textfield'), 10, 1);
add_action('spu/rules/print_browser_field', array('Spu_Helper', 'print_textfield'), 10, 1);
}
/**
* Add custom columns to spu cpt
*
* @param [type] $columns [description]
*
* @since 1.3.3
* @return array|int
*/
public function set_custom_cpt_columns( $columns ){
unset( $columns['date'] );
$spu_switch = array( 'spu_switch' => __( 'On / Off', 'popups' ) );
$columns = array_slice($columns, 0, 1, true) + $spu_switch + array_slice($columns, 1, count( $columns ) - 1, true) ;
$columns['spu_id'] = __( 'ID', 'popups' );
$columns['spu_trigger_class'] = __( 'Trigger class', 'popups' );
return $columns;
}
/**
* Add callbacks for custom colums
* @param array $column [description]
* @param int $post_id [description]
* @return echo html
* @since 1.3.3
*/
function custom_columns( $column, $post_id ) {
global $wpdb;
switch ( $column ) {
case 'spu_id' :
echo '#spu-'.$post_id;
break;
case 'spu_switch' :
echo '<a href="'. wp_nonce_url( admin_url('edit.php?post_type=spucpt&post='. $post_id . '&spu_action=spu_toggle_on'), 'spu_toggle_on', 'spu_nonce') .'"><i class="spu-icon spu-icon-';
echo get_post_status( $post_id ) == 'publish' ? 'toggle-on' : 'toggle-off';
echo '"></i></a>';
break;
case 'spu_trigger_class':
echo '.spu-open-' . $post_id;
break;
}
}
/**
* Catch the toggle on/off action and change post status
* Redirect to clear url once is completed
*/
function toggle_on_popup() {
//checks
if ( ! isset( $_GET['spu_action'] ) || $_GET['spu_action'] != 'spu_toggle_on' )
return;
if ( !isset( $_GET['spu_nonce'] ) || !wp_verify_nonce($_GET['spu_nonce'], 'spu_toggle_on') )
return;
if ( empty( $_GET['post'] ) )
return;
$post_id = esc_attr( $_GET['post'] );
$post_status = get_post_status( $post_id );
$post = array(
'ID' => $post_id,
'post_status' => $post_status != 'publish' ? 'publish' : 'draft'
);
wp_update_post( $post );
wp_safe_redirect( admin_url('edit.php?post_type=spucpt') );
exit;
}
/**
* Add filters for tinymce buttons
*/
public function register_tiny_buttons() {
add_filter( "mce_external_plugins", array( $this, "add_button" ) );
add_filter( 'mce_buttons', array( $this, 'register_button' ) );
}
/**
* Add buton js file
* @param [type] $plugin_array [description]
*/
function add_button( $plugin_array ) {
$plugin_array['spu'] = plugins_url( 'assets/js/spu-tinymce.js' , __FILE__ );
return $plugin_array;
}
/**
* Register button
* @param [type] $buttons [description]
* @return [type] [description]
*/
function register_button( $buttons ) {
array_push( $buttons, '|', 'spu_button' ); // dropcap', 'recentposts
return $buttons;
}
/**
* Add popup editor for
*/
function add_editor() {
include 'includes/tinymce-editor.php';
}
/**
* Save into db the dimissed notice
* @return [type] [description]
*/
function ajax_notice_handler() {
update_option( 'spu_enabled_cache', TRUE );
die();
}
/**
* Extra checks needed on admin init
*/
public function extra_checks(){
// second check it's because on 1.9 by mistake was not added SPUP_VERSION
if( ( defined('SPUP_VERSION') && version_compare(SPUP_VERSION, '1.9.1', '<') ) || ( defined( 'SPUP_PLUGIN_FILE') && ! defined('SPUP_VERSION') ) ){
deactivate_plugins( array('popups-premium/popups-premium.php'));
update_option('spu_pair_plugins',true);
add_action( 'admin_notices', array('SocialPopup_Notices','pair_plugins' ));
}
}
/**
* Disabled Gutenberg for Popup CPT
*/
public function disable_gutenberg($current_status, $post_type) {
if ($post_type === 'spucpt') {
return false;
}
return $current_status;
}
}

View File

@@ -0,0 +1,46 @@
<?php
/**
* Class that handle all admin notices
*
* @since 1.3.1
* @package SocialPopup
* @subpackage SocialPopup/Admin/Includes
* @author Damian Logghe <info@timersys.com>
*/
class SocialPopup_Notices {
/**
* Initialize the class and set its properties.
*
* @since 1.3.1
*/
public function __construct( ) {
if( isset( $_GET['spu_notice'])){
update_option('spu_'.esc_attr($_GET['spu_notice']), true);
}
}
public function rate_plugin(){
?><div class="notice-info notice">
<h3><i class=" dashicons-before dashicons-share-alt"></i>WordPress Popups Plugin</h3>
<p><?php echo sprintf(__( 'We noticed that you have been using our plugin for a while and we would like to ask you a little favour. If you are happy with it and can take a minute please <a href="%s" target="_blank">leave a nice review</a> on WordPress. It will be a tremendous help for us!', 'spu' ), 'https://wordpress.org/support/view/plugin-reviews/popups?filter=5' ); ?></p>
<ul>
<li><?php echo sprintf(__('<a href="%s" target="_blank">Leave a nice review</a>'),'https://wordpress.org/support/view/plugin-reviews/popups?filter=5');?></li>
<li><?php echo sprintf(__('<a href="%s">I already did</a>'), admin_url('?spu_notice=rate_plugin'));?></li>
</ul>
</div><?php
}
public static function pair_plugins(){
?><div class="notice-info error">
<h3><i class=" dashicons-before dashicons-share-alt"></i>WordPress Popups Plugin error</h3>
<p><?php _e('The Popups premium was automatically deactivated.', 'spu');?></p>
<p><?php _e( 'Your current version of Popups premium it\'s not compatible with the core Popups plugin you just installed/updated. Please upgrade your premium version to at least 1.9.1 or downgrade the core version to 1.7.3 .', 'spu' ); ?></p>
<p><a href="<?= admin_url('?spu_notice=pair_plugins_dismiss');?>" class="button-primary"><?php _e('Dismiss','spu');?></a></p>
</div><?php
}
}

View File

@@ -0,0 +1,29 @@
<?php
/*
* Upgrader Class
*
* @description: Upgrade rutines and upgrade messages
* @since 1.3.1
* @version 1.0
*/
class SocialPopup_Upgrader {
public function upgrade_plugin() {
global $wpdb;
$current_version = get_option('spu-version');
if( !get_option('spu_plugin_updated') ) {
// show feedback box if updating plugin
if ( empty( $current_version ) ) {
$total = $wpdb->get_var( "SELECT count(*) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'spucpt'" );
if ( $total > 0 ) {
update_option( 'spu_plugin_updated', true );
}
} elseif ( ! empty( $current_version ) && version_compare( $current_version, SPU_VERSION, '<' ) ) {
update_option( 'spu_plugin_updated', true );
}
}
}
}

View File

@@ -0,0 +1,374 @@
<?php
/**
* Welcome page class.
*/
class SPU_Welcome {
/**
* Primary class constructor.
*
* @since 2.0.0
*/
public function __construct() {
add_action( 'admin_menu', [ $this, 'register' ] );
add_action( 'admin_head', [ $this, 'hide_menu' ] );
add_action( 'admin_enqueue_scripts', [ $this, 'scripts' ] );
add_action( 'admin_init', [ $this, 'redirect' ], 9999 );
add_action( 'admin_print_scripts', [ $this, 'wppopups_admin_hide_unrelated_notices' ] );
if( get_post_type() == 'spucpt' || ( isset($_GET['post_type']) && $_GET['post_type'] == 'spucpt') ) {
add_action( 'admin_notices', [ $this, 'popups_small_notice' ] );
}
}
public function scripts(){
if ( isset($_GET['page']) && $_GET['page'] == 'spu-getting-started' ){
wp_enqueue_style( 'spu-admin-css', SPU_PLUGIN_URL .'admin/assets/css/admin.css', '', SocialPopup::VERSION );
}
}
public static function popups_small_notice(){
?><div class="notice-info error is-dismiseable">
<h3><i class=" dashicons-before dashicons-share-alt"></i>Popups plugin is discontinued</h3>
<p>Popups plugin is now discontinued and only security updates will be released.</p>
<p>Please migrate to <a href="<?= admin_url( 'index.php?page=spu-getting-started' );?>">WP Popups</a>, the most powerful and easy to use popup maker plugin. You will be able to import legacy popups with a few clicks.</p>
</div><?php
}
/**
* Register the pages to be used for the Welcome screen (and tabs).
*
* These pages will be removed from the Dashboard menu, so they will
* not actually show. Sneaky, sneaky.
*
* @since 2.0.0
*/
public function register() {
// Getting started - shows after installation.
add_dashboard_page(
esc_html__( 'Popups is discontinued', 'wppopups' ),
esc_html__( 'Popups is discontinued', 'popups' ),
apply_filters( 'spu_welcome_cap', 'manage_options' ),
'spu-getting-started',
[ $this, 'output' ]
);
}
/**
* Removed the dashboard pages from the admin menu.
*
* This means the pages are still available to us, but hidden.
*
* @since 2.0.0
*/
public function hide_menu() {
remove_submenu_page( 'index.php', 'spu-getting-started' );
}
/**
* Welcome screen redirect.
*
* This function checks if a new install or update has just occurred. If so,
* then we redirect the user to the appropriate page.
*
* @since 2.0.0
*/
public function redirect() {
// Check option to disable welcome redirect.
if ( ( isset($_GET['page']) && $_GET['page'] == 'spu-getting-started' ) || get_option( 'spu_activation_redirect', false ) ) {
return;
}
// Only do this for single site installs.
if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
return;
}
// Initial install.
wp_safe_redirect( admin_url( 'index.php?page=spu-getting-started' ) );
}
/**
* Hide unrelated notices in popups
*/
function wppopups_admin_hide_unrelated_notices() {
// Bail if we're not on a WP Popups screen or page.
if ( ( ! isset($_GET['post_type']) || $_GET['post_type'] == 'spucpt') && get_post_type() !== 'spucpt' && ( empty( $_GET['page'] ) || ( strpos( $_REQUEST['page'], 'spu' ) === false && strpos( $_REQUEST['page'], 'popups' ) === false ) ) ) {
return;
}
global $wp_filter;
if ( ! empty( $wp_filter['user_admin_notices']->callbacks ) && is_array( $wp_filter['user_admin_notices']->callbacks ) ) {
foreach ( $wp_filter['user_admin_notices']->callbacks as $priority => $hooks ) {
foreach ( $hooks as $name => $arr ) {
if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) {
unset( $wp_filter['user_admin_notices']->callbacks[ $priority ][ $name ] );
continue;
}
if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'popups' ) !== false ) {
continue;
}
if ( ! empty( $name ) && strpos( $name, 'popups' ) === false ) {
unset( $wp_filter['user_admin_notices']->callbacks[ $priority ][ $name ] );
}
}
}
}
if ( ! empty( $wp_filter['admin_notices']->callbacks ) && is_array( $wp_filter['admin_notices']->callbacks ) ) {
foreach ( $wp_filter['admin_notices']->callbacks as $priority => $hooks ) {
foreach ( $hooks as $name => $arr ) {
if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) {
unset( $wp_filter['admin_notices']->callbacks[ $priority ][ $name ] );
continue;
}
if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'popups' ) !== false ) {
continue;
}
if ( ! empty( $name ) && strpos( $name, 'popups' ) === false ) {
unset( $wp_filter['admin_notices']->callbacks[ $priority ][ $name ] );
}
}
}
}
if ( ! empty( $wp_filter['all_admin_notices']->callbacks ) && is_array( $wp_filter['all_admin_notices']->callbacks ) ) {
foreach ( $wp_filter['all_admin_notices']->callbacks as $priority => $hooks ) {
foreach ( $hooks as $name => $arr ) {
if ( is_object( $arr['function'] ) && $arr['function'] instanceof Closure ) {
unset( $wp_filter['all_admin_notices']->callbacks[ $priority ][ $name ] );
continue;
}
if ( ! empty( $arr['function'][0] ) && is_object( $arr['function'][0] ) && strpos( strtolower( get_class( $arr['function'][0] ) ), 'popups' ) !== false ) {
continue;
}
if ( ! empty( $name ) && strpos( $name, 'popups' ) === false ) {
unset( $wp_filter['all_admin_notices']->callbacks[ $priority ][ $name ] );
}
}
}
}
}
/**
* Getting Started screen. Shows after first install.
*
* @since 2.0.0
*/
public function output() {
?>
<div id="wppopups-welcome" class="">
<div class="container">
<div class="intro">
<div class="wppopups-logo-welcome" style="background-image: url(<?php echo 'data:image/svg+xml;base64,' . base64_encode( '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 153 151" width="153" height="151"><defs><image width="151" height="151" id="img1" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJcAAACXCAMAAAAvQTlLAAAAAXNSR0IB2cksfwAAAMBQTFRFAHOqAHOqAHOqAAAAAHOqAHOqAHOqAHOqAHOqAHOqAHOqAHOqAHOqAHOqAHOqAHOqAHOqAHOqAHOqAHOqAHOqAHOqAHOqAHOqAHOqAHOqAHOqAHOqAHOqAHOqAHOqAHOqAHOqL22LZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm1Y1mKQAAAEB0Uk5TbIBMANj/mOk17gwj1BfhIOPdFtca5SbsMPAp5yQoMhzfcIA+aP989OsjhdQR0RLXGd/ZFRjY1h3cGx7lqLfAXWj80ucAAAE5SURBVHic7djJTgJBFEbhhouAOLSCMjiCeFVUhgbEWd7/rViYKC7ohKRM/5pz9rfy5S6qkoqiXFblLaWosJFVRVy4cOHChetPukqirvKmpquyta3psp1dTZfFe5oui/c1XVatabrs4FDTZfWGpsuaLU2XHR1ruuzkF2AhXHYa/kkK4rKz4BsL47LztqbL4sD/E52L1XXXcIXu0ld3hQsXLly4cOHChQsXLly4cOHChQsXLly4cOHChQsXLly4cOHChQsXLly4cOHChQsXLly4cOHChQsXLly4cP0rV9rkdcrk+t30fp5+K+Lyu3tNl/cHmi7vL29MyOXDkabLk2+YlMvHE02XD6eari+YmssfJpounw00XZ/XhaDLk0dNlz89a7o8edF0+eubpis1XLhw4cKFy+z9I6vmC+sAc2Bjpu3VAAAAAElFTkSuQmCC"/></defs><style>tspan { white-space:pre }</style><use id="Layer 1" href="#img1" x="1" y="0" /></svg>' );?>
) !important;">
</div>
<div class="block">
<h1><?php esc_html_e( 'Popups plugin it\'s being discontinued but..', 'popups' ); ?></h1>
<h6><?php _e( 'It\'s being replaced for the most powerful and intuitive plugin called', 'popups' ); ?></h6>
<h1 style="margin: 15px 0 0 0;font-size: 29px;"> <strong>WP Popups</strong></h1>
</div>
<iframe style="margin: 0 auto;display: block;" width="560" height="315" src="https://www.youtube.com/embed/_yJ-xHVOQYw" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<div class="block">
<h6><?php esc_html_e( 'WP Popups was coded to be the most powerful Popup builder. Once installed you can migrate your legacy popups easily with a few clicks.', 'popups' ); ?></h6>
<div class="button-wrap wppopups-clear">
<div class="left">
<a href="https://wordpress.org/plugins/wp-popups-lite/"
class="wppopups-btn wppopups-btn-block wppopups-btn-lg wppopups-btn-blue">
<?php esc_html_e( 'Download WP Popups', 'popups' ); ?>
</a>
</div>
<div class="right">
<a href="https://wppopups.com/docs/how-to-import-legacy-popups-from-old-plugin/?utm_source=WordPress&amp;utm_medium=link&amp;utm_campaign=legacy-upgrade-page"
class="wppopups-btn wppopups-btn-block wppopups-btn-lg wppopups-btn-grey"
target="_blank" rel="noopener noreferrer">
<?php esc_html_e( 'IMPORT LEGACY POPUPS', 'popups' ); ?>
</a>
</div>
</div>
<p style="text-align: center;margin-top: 30px;">Popups plugin will only receive security updates for a year and after that it will be discontinued. Please migrate to WP Popups as soon as possible.</p>
</div>
</div><!-- /.intro -->
<div class="features">
<div class="block">
<h1><?php esc_html_e( 'WP Popups', 'popups' ); ?></h1>
<h6><?php esc_html_e( 'WP Popups is the best multipurpose popup maker plugin for WordPress.', 'popups' ); ?></h6>
<div class="feature-list wppopups-clear">
<div class="feature-block first">
<img src="<?php echo WPPOPUPS_PLUGIN_URL; ?>assets/images/icons/custom-templates.svg">
<h5><?php esc_html_e( 'Template Builder', 'popups' ); ?></h5>
<p><?php esc_html_e( 'Use a prebuilt template or create your own. Easily export them to use it in all your sites!', 'popups' ); ?></p>
</div>
<div class="feature-block last">
<img src="<?php echo WPPOPUPS_PLUGIN_URL; ?>assets/images/icons/display-rules.svg">
<h5><?php esc_html_e( '30+ Display rules', 'popups' ); ?></h5>
<p><?php esc_html_e( 'Trigger popup based on multiple rules. There is no other Popup plugin with the same flexibility!', 'popups' ); ?></p>
</div>
<div class="feature-block first">
<img src="<?php echo WPPOPUPS_PLUGIN_URL; ?>assets/images/icons/animations.svg">
<h5><?php esc_html_e( '45+ Animations', 'popups' ); ?></h5>
<p><?php esc_html_e( 'Animate your popup with some magic to capture your users attention.', 'popups' ); ?></p>
</div>
<div class="feature-block last">
<img src="<?php echo WPPOPUPS_PLUGIN_URL; ?>assets/images/icons/triggers.svg">
<h5><?php esc_html_e( 'Multiple triggers', 'popups' ); ?></h5>
<p><?php esc_html_e( 'Show popup by using one more triggers combined,positions.svg like when user leaves the page, after X seconds, etc.', 'popups' ); ?></p>
</div>
</div>
<h1><?php esc_html_e( 'Premium features', 'popups' ); ?></h1>
<h6><?php esc_html_e( 'Upgrade to WP Popups to unlock all the magic!', 'popups' ); ?></h6>
<div class="feature-list wppopups-clear">
<div class="feature-block first">
<img src="<?php echo WPPOPUPS_PLUGIN_URL; ?>assets/images/icons/ab-test.svg">
<h5><?php esc_html_e( 'A/B Testing', 'popups' ); ?></h5>
<p><?php esc_html_e( 'Create different versions, measure results and choose the best popup for your campaign.', 'popups' ); ?></p>
</div>
<div class="feature-block last">
<img src="<?php echo WPPOPUPS_PLUGIN_URL; ?>assets/images/icons/analytics.svg">
<h5><?php esc_html_e( 'Analytics', 'popups' ); ?></h5>
<p><?php esc_html_e( 'Track conversions and impressions of your popups and integrate it with Google Analytics.', 'popups' ); ?></p>
</div>
<div class="feature-block first">
<img src="<?php echo WPPOPUPS_PLUGIN_URL; ?>assets/images/icons/email-marketing.svg">
<h5><?php esc_html_e( 'Email Marketing', 'popups' ); ?></h5>
<p><?php esc_html_e( 'Integrates with all the popular email providers. Capture leads easily!', 'popups' ); ?></p>
</div>
<div class="feature-block last">
<img src="<?php echo WPPOPUPS_PLUGIN_URL; ?>assets/images/icons/geolocation.svg">
<h5><?php esc_html_e( 'Geolocation Addon', 'popups' ); ?></h5>
<p><?php esc_html_e( 'With the geolocation addon you can show the popup just to geotargeted users of your choice.', 'popups' ); ?></p>
</div>
<div class="feature-block first">
<img src="<?php echo WPPOPUPS_PLUGIN_URL; ?>assets/images/icons/age-verification.svg">
<h5><?php esc_html_e( 'Age Verification Addon', 'popups' ); ?></h5>
<p><?php esc_html_e( 'Create an Age Verification Popup to ask for user\'s age before seeing content.', 'popups' ); ?></p>
</div>
<div class="feature-block last">
<img src="<?php echo WPPOPUPS_PLUGIN_URL; ?>assets/images/icons/idle-logout.svg">
<h5><?php esc_html_e( 'Idle Logout Addon', 'popups' ); ?></h5>
<p><?php esc_html_e( 'Log out your users after inactivity time, but give them a chance to continue logged by showing a popup.', 'popups' ); ?></p>
</div>
<div class="feature-block first">
<img src="<?php echo WPPOPUPS_PLUGIN_URL; ?>assets/images/icons/leaving-notice.svg">
<h5><?php esc_html_e( 'Leaving Notice Addon', 'popups' ); ?></h5>
<p><?php esc_html_e( 'Show a warning to users when they click on external links before they leave your site.', 'popups' ); ?></p>
</div>
<div class="feature-block last">
<img src="<?php echo WPPOPUPS_PLUGIN_URL; ?>assets/images/icons/login-registration.svg">
<h5><?php esc_html_e( 'AJAX Login/Registration Addon', 'popups' ); ?></h5>
<p><?php esc_html_e( 'Convert your popup into a login and registration form powered by ajax.', 'popups' ); ?></p>
</div>
</div>
<div class="button-wrap">
<a href="https://wppopups.com/features/?utm_source=WordPress&amp;utm_medium=link&amp;utm_campaign=liteplugin"
class="wppopups-btn wppopups-btn-lg wppopups-btn-grey" rel="noopener noreferrer"
target="_blank">
<?php esc_html_e( 'See All Features', 'popups' ); ?>
</a>
</div>
</div>
</div>
<div class="upgrade-cta upgrade">
<div class="block wppopups-clear upgrade-welcome-cta">
<div class="left">
<h2><?php esc_html_e( 'Upgrade to PRO', 'popups' ); ?></h2>
<ul>
<li>
<span class="dashicons dashicons-yes"></span> <?php esc_html_e( 'Analytics', 'popups' ); ?>
</li>
<li>
<span class="dashicons dashicons-yes"></span> <?php esc_html_e( 'Exit intent', 'popups' ); ?>
</li>
<li>
<span class="dashicons dashicons-yes"></span> <?php esc_html_e( 'Optin templates', 'popups' ); ?>
</li>
<li>
<span class="dashicons dashicons-yes"></span> <?php esc_html_e( 'A/B Testing', 'popups' ); ?>
</li>
<li>
<span class="dashicons dashicons-yes"></span> <?php esc_html_e( 'Email Marketing', 'popups' ); ?>
</li>
<li>
<span class="dashicons dashicons-yes"></span> <?php esc_html_e( 'More Animations', 'popups' ); ?>
</li>
<li>
<span class="dashicons dashicons-yes"></span> <?php esc_html_e( 'More positions', 'popups' ); ?>
</li>
<li>
<span class="dashicons dashicons-yes"></span> <?php esc_html_e( 'Geolocation', 'popups' ); ?>
</li>
<li>
<span class="dashicons dashicons-yes"></span> <?php esc_html_e( 'More triggers', 'popups' ); ?>
</li>
<li>
<span class="dashicons dashicons-yes"></span> <?php esc_html_e( 'Multiple addons', 'popups' ); ?>
</li>
</ul>
</div>
<div class="right">
<a href="https://wppopups.com/pricing/?utm_source=WordPress&amp;utm_medium=link&amp;utm_campaign=legacy-upgrade-page" rel="noopener noreferrer"
target="_blank"
class="wppopups-btn wppopups-btn-block wppopups-btn-lg wppopups-btn-blue wppopups-upgrade-modal">
<?php esc_html_e( 'Upgrade Now', 'popups' ); ?>
</a>
</div>
</div>
</div>
</div><!-- /.container -->
</div><!-- /#wppopups-welcome -->
<?php
update_option('spu_activation_redirect',true);
}
}
new SPU_Welcome();

View File

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

View File

@@ -0,0 +1,38 @@
<form name="form" autocomplete="off">
<div id="spu_editor" class="shortcode_editor" title="Insert popup link to page" style="display:none;height:500px">
<div style="display: none;"><!--hack for chrome-->
<input type="text" id="PreventChromeAutocomplete" name="PreventChromeAutocomplete" autocomplete="address-level4" />
</div>
<table class="form-table">
<tr>
<td colspan="2">
<p>
<?php _e('Choose which popup you want to insert. This will generate an href link that you can use with text or images', 'spu');?>
</p>
</td>
</tr>
<tr>
<th><label for="spu_what"><?php _e( 'Choose:', 'spu' ); ?></label></th>
<td>
<select name="spu-post" id="spu-posts">
<option value=""><?php _e('Choose one','spu');?></option>
<?php
global $wpdb;
$popups = $wpdb->get_results( "SELECT post_title, ID FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'spucpt'");
// The Loop
if ( $popups ) {
foreach( $popups as $po ) {
echo '<option value="'.$po->ID.'">'.$po->post_title.'</option>"';
}
}
?>
</select>
</td>
</tr>
</table>
</div>
</form>

View File

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

View File

@@ -0,0 +1,211 @@
<?php
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;?>
<div class="spu-admin-options">
<?php do_action( 'spu/metaboxes/before_appearance_options', $opts );?>
<h3>Overlay</h3>
<table class="form-table">
<tr>
<th><label class="spu-label" for="spu_bgopacity"><?php _e( 'Overlay opacity', 'popups' ); ?></label></th>
<td>
<input type="number" id="spu_bgopacity" name="spu[css][bgopacity]" min="0" step="0.1" max="1" value="<?php echo esc_attr($opts['css']['bgopacity']); ?>" />
<p class="spu-help"><?php _e( 'Leave at 0 for no background. Max value is 1', 'popups' ); ?></p>
</td>
</tr>
<tr>
<th><label class="spu-label" for="spu_bgcolor"><?php _e( 'Overlay color', 'popups' ); ?></label></th>
<td>
<input id="spu_bgcolor" name="spu[css][overlay_color]" type="text" class="spu-color-field" value="<?php echo esc_attr($opts['css']['overlay_color']); ?>" />
</td>
</tr>
<?php do_action( 'spu/metaboxes/after_overlay_appearance', $opts );?>
<tr><th colspan="2"><?php if( ! defined('SPUP_VERSION') ) echo sprintf( __( 'On <a href="%s">Premium version</a> you can have full screen popups, or sticky popups, insert optin forms inside yours post and much more!','popups'), 'https://timersys.com/plugins/popups-premium/?utm_source=Plugin&utm_medium=appearance_overlay&utm_campaign=Popups%20Premium');?></th></tr>
</table>
<h3>Popup Background</h3>
<table class="form-table">
<tr>
<th><label class="spu-label" for="spu-background-color"><?php _e( 'Background color', 'popups' ); ?></label></th>
<td>
<input id="spu-background-color" name="spu[css][background_color]" type="text" class="spu-color-field" value="<?php echo esc_attr($opts['css']['background_color']); ?>" />
</td>
</tr>
<tr>
<th><label class="spu-label" for="spu_background_opacity"><?php _e( 'Background opacity', 'popups' ); ?></label></th>
<td>
<input type="number" id="spu_background_opacity" name="spu[css][background_opacity]" min="0" step="0.1" max="1" value="<?php echo esc_attr($opts['css']['background_opacity']); ?>" />
<p class="spu-help"><?php _e( 'Leave at 0 for no background. Max value is 1', 'popups' ); ?></p>
</td>
</tr>
<?php do_action( 'spu/metaboxes/after_background_appearance', $opts );?>
<tr><th colspan="2"><?php if( ! defined('SPUP_VERSION') ) echo sprintf( __( 'Check <a href="%s">Premium version</a> to add background images or choose a pre made optin theme!','popups'), 'https://timersys.com/plugins/popups-premium/?utm_source=Plugin&utm_medium=appearance_bg&utm_campaign=Popups%20Premium');?></th></tr>
</table>
<h3>Popup Box</h3>
<table class="form-table">
<tr class="hide-for-optins">
<th><label class="spu-label" for="spu-width"><?php _e( 'Box width', 'popups' ); ?></label></th>
<td>
<input id="spu-width" name="spu[css][width]" id="spu-box-width" type="text" class="small" value="<?php echo esc_attr($opts['css']['width']); ?>" />
<p class="spu-help"><?php _e( 'Max size the responsive popup will grow. You can use % or px.', 'popups' ); ?></p>
</td>
</tr>
<tr class="hide-for-optins">
<th><label class="spu-label" for="spu-padding"><?php _e( 'Padding', 'popups' ); ?></label></th>
<td>
<input id="spu-padding" name="spu[css][padding]" id="spu-box-padding" type="number" class="small" value="<?php echo esc_attr($opts['css']['padding']); ?>" />px
</td>
</tr>
<tr>
<th><label class="spu-label" for="spu-color"><?php _e( 'Text color', 'popups' ); ?></label></th>
<td>
<input id="spu-color" name="spu[css][color]" type="text" class="spu-color-field" value="<?php echo esc_attr($opts['css']['color']); ?>" />
</td>
</tr>
<?php do_action( 'spu/metaboxes/after_box_appearance', $opts );?>
</table>
<h3>Popup Shadow</h3>
<table class="form-table">
<tr>
<th><label class="spu-label" for="spu-shadow-color"><?php _e( 'Shadow Color', 'popups' ); ?></label></th>
<td>
<input id="spu-shadow-color" name="spu[css][shadow_color]" type="text" class="spu-color-field" value="<?php echo esc_attr($opts['css']['shadow_color']); ?>" />
</td>
</tr>
<tr>
<th><label class="spu-label" for="spu-shadow-type"><?php _e( 'Shadow Type', 'popups' ); ?></label></th>
<td>
<select name="spu[css][shadow_type]" id="spu-shadow-type">
<option value="inset" <?php selected('inset',esc_attr($opts['css']['shadow_type']));?>>Inset</option>
<option value="outset" <?php selected('outset',esc_attr($opts['css']['shadow_type']));?>>Outset</option>
</select>
</td>
</tr>
<tr>
<th><label class="spu-label" for="spu-shadow-x"><?php _e( 'X Offset', 'popups' ); ?></label></th>
<td>
<input id="spu-shadow-x" name="spu[css][shadow_x_offset]" type="number" step="1" class="small" value="<?php echo esc_attr($opts['css']['shadow_x_offset']); ?>" />px
</td>
</tr>
<tr>
<th><label class="spu-label" for="spu-shadow-y"><?php _e( 'Y Offset', 'popups' ); ?></label></th>
<td>
<input id="spu-shadow-y" name="spu[css][shadow_y_offset]" type="number" step="1" class="small" value="<?php echo esc_attr($opts['css']['shadow_y_offset']); ?>" />px
</td>
</tr>
<tr>
<th><label class="spu-label" for="spu-shadow-blur"><?php _e( 'Blur', 'popups' ); ?></label></th>
<td>
<input id="spu-shadow-blur" name="spu[css][shadow_blur]" type="number" step="1" class="small" value="<?php echo esc_attr($opts['css']['shadow_blur']); ?>" />px
</td>
</tr>
<tr>
<th><label class="spu-label" for="spu-shadow-spread"><?php _e( 'Spread', 'popups' ); ?></label></th>
<td>
<input id="spu-shadow-spread" name="spu[css][shadow_spread]" type="number" step="1" class="small" value="<?php echo esc_attr($opts['css']['shadow_spread']); ?>" />px
</td>
</tr>
<?php do_action( 'spu/metaboxes/after_shadow_appearance', $opts );?>
</table>
<h3>Border</h3>
<table class="form-table">
<tr>
<th><label class="spu-label" for="spu-border-color"><?php _e( 'Border color', 'popups' ); ?></label></th>
<td>
<input name="spu[css][border_color]" id="spu-border-color" type="text" class="spu-color-field" value="<?php echo esc_attr($opts['css']['border_color']); ?>" />
</td>
</tr>
<tr>
<th><label class="spu-label" for="spu-border-width"><?php _e( 'Border width', 'popups' ); ?></label></th>
<td>
<input name="spu[css][border_width]" id="spu-border-width" type="number" min="0" max="25" value="<?php echo esc_attr($opts['css']['border_width']); ?>" /> px
</td>
</tr>
<tr>
<th><label class="spu-label" for="spu-border-radius"><?php _e( 'Border radius', 'popups' ); ?></label></th>
<td>
<input name="spu[css][border_radius]" id="spu-border-radius" type="number" min="0" max="25" value="<?php echo esc_attr($opts['css']['border_radius']); ?>" /> px
</td>
</tr>
<tr>
<th><label class="spu-label" for="spu-border-type"><?php _e( 'Border type', 'popups' ); ?></label></th>
<td>
<select name="spu[css][border_type]" id="spu-border-type">
<option value="none" <?php selected('none',esc_attr($opts['css']['border_type']));?>>None</option>
<option value="solid" <?php selected('solid',esc_attr($opts['css']['border_type']));?>>Solid</option>
<option value="dotted" <?php selected('dotted',esc_attr($opts['css']['border_type']));?>>Dotted</option>
<option value="dashed" <?php selected('dashed',esc_attr($opts['css']['border_type']));?>>Dashed</option>
<option value="double" <?php selected('double',esc_attr($opts['css']['border_type']));?>>Double</option>
<option value="groove" <?php selected('groove',esc_attr($opts['css']['border_type']));?>>Groove</option>
<option value="inset" <?php selected('inset',esc_attr($opts['css']['border_type']));?>>Inset</option>
<option value="outset" <?php selected('outset',esc_attr($opts['css']['border_type']));?>>Outset</option>
<option value="ridge" <?php selected('ridge',esc_attr($opts['css']['border_type']));?>>Ridge</option>
</select>
</td>
</tr>
<?php do_action( 'spu/metaboxes/after_border_appearance', $opts );?>
</table>
<h3>Close</h3>
<table class="form-table">
<tr>
<th><label class="spu-label" for="spu-close-color"><?php _e( 'Color', 'popups' ); ?></label></th>
<td>
<input name="spu[css][close_color]" id="spu-close-color" type="text" class="spu-color-field" value="<?php echo esc_attr($opts['css']['close_color']); ?>" />
</td>
</tr>
<tr>
<th><label class="spu-label" for="spu-close-color"><?php _e( 'Hover Color', 'popups' ); ?></label></th>
<td>
<input name="spu[css][close_hover_color]" id="spu-close-color" type="text" class="spu-color-field" value="<?php echo esc_attr($opts['css']['close_hover_color']); ?>" />
</td>
</tr>
<tr>
<th><label class="spu-label" for="spu-close-color"><?php _e( 'Shadow Color', 'popups' ); ?></label></th>
<td>
<input name="spu[css][close_shadow_color]" id="spu-close-color" type="text" class="spu-color-field" value="<?php echo esc_attr($opts['css']['close_shadow_color']); ?>" />
</td>
</tr>
<tr>
<th><label class="spu-label" for="spu-close-size"><?php _e( 'Size', 'popups' ); ?></label></th>
<td>
<input name="spu[css][close_size]" id="spu-close-size" type="text" class="" value="<?php echo esc_attr($opts['css']['close_size']); ?>" />
<p class="spu-help"><?php _e( 'You can use px, em or rem units', 'popups' ); ?></p>
</td>
</tr>
<tr>
<th><label class="spu-label" for="spu-border-radius"><?php _e( 'Position', 'popups' ); ?></label></th>
<td>
<select name="spu[css][close_position]" id="spu-border-type">
<option value="top_right" <?php selected('top_right',esc_attr($opts['css']['close_position']));?>>Top right</option>
<option value="top_left" <?php selected('top_left',esc_attr($opts['css']['close_position']));?>>Top Left</option>
<option value="bottom_right" <?php selected('bottom_right',esc_attr($opts['css']['close_position']));?>>Bottom Right</option>
<option value="bottom_left" <?php selected('bottom_left',esc_attr($opts['css']['close_position']));?>>Bottom Left</option>
</select>
</td>
</tr>
<?php do_action( 'spu/metaboxes/after_close_appearance', $opts );?>
</table>
<h3>CSS</h3>
<table class="form-table">
<tr>
<th><label class="spu-label" for="spu-custom-css"><?php _e( 'Custom CSS', 'popups' ); ?></label></th>
<td>
<div id="custom_css_container">
<div name="custom_css" id="custom_css" style="border: 1px solid #DFDFDF; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; width: 100%; height: 200px; position: relative;"></div>
</div>
<?php
if( !isset( $opts['css']['custom_css'] ) ) {
$popup_id = get_the_id();
$opts['css']['custom_css'] = "/*
* Add custom CSS for this popup
* Be sure to start your rules with #spu-{$popup_id} { } and use !important when needed to override plugin rules
*/";
}
?>
<textarea name="spu[css][custom_css]" id="spu-custom-css" style="display: none;"><?php echo esc_attr($opts['css']['custom_css']); ?></textarea>
</td>
</tr>
</table>
<?php do_action( 'spu/metaboxes/after_appearance_options', $opts );?>
</div>

View File

@@ -0,0 +1,16 @@
<?php
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
?>
<p><?php _e( 'If you like this plugin, consider supporting it by donating.', 'popups' );?></p>
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=K4T6L69EV9G2Q" class="button-primary"><?php _e( 'Donate with PayPal', 'popups' );?></a>
<p><?php _e( 'Some other ways to support this plugin', 'popups' );?></p>
<ul class="ul-square">
<li><a href="http://wordpress.org/support/view/plugin-reviews/popups?rate=5#postform" target="_blank"><?php _e( 'Leave a &#9733;&#9733;&#9733;&#9733;&#9733; review on WordPress.org', 'popups' );?></a></li>
<li><a href="https://timersys.com/free-plugins/popups/" target="_blank"><?php _e( 'Write about Popups on your blog', 'popups' );?></a></li>
<li><a href="http://twitter.com/intent/tweet/?text=I+am+using+Social+PopUP+on+my+WordPress+site.+It%27s+great%21&amp;via=chifliiii&amp;url=http%3A%2F%2Fwordpress.org%2Fplugins%2Fpopups%2F" target="_blank"><?php _e( 'Tweet about Popups', 'popups' );?></a></li>
<li><a href="http://wordpress.org/plugins/popups/#compatibility"><?php _e( 'Vote "works" on the WordPress.org plugin page', 'popups' );?></a></li>
</ul>

View File

@@ -0,0 +1,67 @@
<?php
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
?>
<p><?php _e( 'You have some social shortcodes to use that will print a Facebook like, a Google+ Follow and a Twitter follow. Check the available options and <strong>configure them with your social accounts</strong>:', 'popups' );?></p>
<p><strong><?php _e( 'Facebook Page', 'popups' );?>:</strong></p>
<p>
[spu-facebook-page href="" name="" show_faces="" hide_cover="" width=""]
</p>
<a href="fb-opts" onclick="jQuery('#fbpage-opts').slideToggle();return false;"><?php _e( 'View Facebook Page Options', 'popups' );?></a>
<ul id="fbpage-opts" style="display:none;">
<li><b>href:</b> <?php _e( 'Your Facebook page url', 'popups' );?></li>
<li><b>name:</b> <?php _e( 'Your page name', 'popups' );?></li>
<li><b>show_faces:</b> <?php _e( 'true|false <b>Default value:</b> true', 'popups' );?></li>
<li><b>hide_cover:</b> <?php _e( 'true|false <b>Default value:</b> false', 'popups' );?></li>
<li><b>width:</b> <?php _e( 'number <b>Default value:</b> 500', 'popups' );?></b></li>
</ul>
<p><strong><?php _e( 'Facebook Button', 'popups' );?>:</strong></p>
<p>
[spu-facebook href="" layout="" show_faces="" share="" action="" width=""]
</p>
<a href="fb-opts" onclick="jQuery('#fb-opts').slideToggle();return false;"><?php _e( 'View Facebook Options', 'popups' );?></a>
<ul id="fb-opts" style="display:none;">
<li><b>href:</b> <?php _e( 'Your Facebook page url', 'popups' );?></li>
<li><b>layout:</b> <?php _e( 'standard, box_count, button <b>Default value:</b> button_count', 'popups' );?></li>
<li><b>show_faces:</b> <?php _e( 'true <b>Default value:</b> false', 'popups' );?></li>
<li><b>share:</b> <?php _e( 'true <b>Default value:</b> false', 'popups' );?></li>
<li><b>action:</b> <?php _e( 'recommend <b>Default value:</b> like', 'popups' );?></li>
<li><b>width:</b> <?php _e( 'number <b>Default value:</b>', 'popups' );?></li>
</ul>
<p><strong><?php _e( 'Google+ Button', 'popups' );?>:</strong></p>
<p>
[spu-google url="" size="" annotation=""]
</p>
<a href="go-opts" onclick="jQuery('#go-opts').slideToggle();return false;"><?php _e( 'View Google+ Options', 'popups' );?></a>
<ul id="go-opts" style="display:none;">
<li><b>url:</b> <?php _e( 'Your Google+ url', 'popups' );?></li>
<li><b>type:</b> g-plusone, g-follow <?php _e( '<b>Default value:</b>', 'popups' );?>g-plusone</li>
<li><b>size:</b> <?php _e( 'small, standard, tall <b>Default value:</b> medium', 'popups' );?></li>
<li><b>annotation:</b> <?php _e( 'inline, none <b>Default value:</b> bubble', 'popups' );?></li>
</ul>
<p><strong><?php _e( 'Twitter Button', 'popups' );?>:</strong></p>
<p>
[spu-twitter user="" show_count="" size="" lang=""]
</p>
<a href="tw-opts" onclick="jQuery('#tw-opts').slideToggle();return false;"><?php _e( 'View Twitter Options', 'popups' );?></a>
<ul id="tw-opts" style="display:none;">
<li><b>user:</b> <?php _e( 'Your Twitter user <b>Default value: </b>', 'popups' ); echo ' ' . apply_filters( 'spu/social/tw_user', 'chifliiiii' ); ?></li>
<li><b>show_count:</b> <?php _e( 'false <b>Default value:</b> true', 'popups' );?></li>
<li><b>size:</b> <?php _e( 'large <b>Default value:</b> ""', 'popups' );?></li>
<li><b>lang:</b> </li>
</ul>
<h3 style="padding-left:0;margin: 20px 0;"><strong><?php _e('Other available Shortcodes:', 'popups' );?></strong></h3>
<p><strong><?php _e( 'Close Button', 'popups' );?>:</strong></p>
<p>
[spu-close class="" text="" align="" conversion="false"]
</p>
<a href="close-opts" onclick="jQuery('#close-opts').slideToggle();return false;"><?php _e( 'View Close shortcode Options', 'popups' );?></a>
<ul id="close-opts" style="display:none;">
<li><b>class:</b> <?php _e( 'Pass a custom class to style your button', 'popups' );?></li>
<li><b>text:</b> <?php _e( 'Button label - <b>Default value:</b> Close', 'popups' );?></li>
<li><b>conversion:</b> <?php _e( 'Conversion button?- <b>Default value:</b> False', 'popups' );?></li>
<li><b>align:</b> <?php _e( 'left, right, center, none - <b>Default value:</b> center', 'popups' );?></li>
</ul>

View File

@@ -0,0 +1,149 @@
<?php
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;?>
<div class="spu-admin-options">
<h3>Position</h3>
<table class="form-table">
<?php do_action( 'spu/metaboxes/before_display_options', $opts );?>
<tr valign="top">
<th><label for="spu_position"><?php _e( 'Box Position', 'popups' ); ?></label></th>
<td>
<select id="spu_position" name="spu[css][position]" class="widefat">
<option value="centered" <?php selected($opts['css']['position'], 'centered'); ?>><?php _e( 'Centered', 'popups' ); ?></option>
<option value="top-left" <?php selected($opts['css']['position'], 'top-left'); ?>><?php _e( 'Top Left', 'popups' ); ?></option>
<option value="top-right" <?php selected($opts['css']['position'], 'top-right'); ?>><?php _e( 'Top Right', 'popups' ); ?></option>
<option value="bottom-left" <?php selected($opts['css']['position'], 'bottom-left'); ?>><?php _e( 'Bottom Left', 'popups' ); ?></option>
<option value="bottom-right" <?php selected($opts['css']['position'], 'bottom-right'); ?>><?php _e( 'Bottom Right', 'popups' ); ?></option>
<option value="top-bar" <?php selected($opts['css']['position'], 'top-bar'); ?>><?php _e( 'Top Bar', 'popups' ); ?></option>
<option value="bottom-bar" <?php selected($opts['css']['position'], 'bottom-bar'); ?>><?php _e( 'Bottom Bar', 'popups' ); ?></option>
<?php do_action( 'spu/metaboxes/positions', $opts );?>
</select>
</td>
<td colspan="2"></td>
</tr>
<tr><th colspan="2"><?php if( ! defined('SPUP_VERSION') ) echo sprintf( __( 'On <a href="%s">Premium version</a> there are more cool positions and popup styles.','popups'), 'https://timersys.com/plugins/popups-premium/?utm_source=Plugin&utm_medium=options_position&utm_campaign=Popups%20Premium');?></th></tr>
<?php do_action( 'spu/metaboxes/after_position_options', $opts );?>
</table>
<h3>Trigger</h3>
<table class="form-table">
<tr valign="top">
<th><label for="spu_trigger"><?php _e( 'Trigger action', 'popups' ); ?></label></th>
<td class="spu-sm">
<select id="spu_trigger" name="spu[trigger]" class="widefat">
<option value="seconds" <?php selected($opts['trigger'], 'seconds'); ?>><?php _e( 'seconds after page load', 'popups' ); ?></option>
<option value="percentage" <?php selected($opts['trigger'], 'percentage'); ?>>% <?php _e( 'of page height', 'popups' ); ?></option>
<option value="pixels" <?php selected($opts['trigger'], 'pixels'); ?>><?php _e( 'Scrolled down pixels', 'popups' ); ?></option>
<option value="manual" <?php selected($opts['trigger'], 'manual'); ?>><?php _e( 'Manual Triggering', 'popups' ); ?></option>
<?php do_action( 'spu/metaboxes/trigger_options', $opts );?>
</select>
</td>
<td>
<input type="number" class="spu-trigger-number" name="spu[trigger_number]" min="0" value="<?php echo esc_attr($opts['trigger_number']); ?>" />
<?php do_action( 'spu/metaboxes/trigger_values', $opts );?>
</td>
</tr>
<tr>
<td style="margin:0;padding:0"></td><td style="position: relative;top: -15px;margin:0;padding:0 0 0 10px"><p class="help"><?php _e( 'Choose how the popup will be triggered on the page', 'popups' ); ?></p></td>
</tr>
<tr><th colspan="2"><?php if( ! defined('SPUP_VERSION') ) echo sprintf( __( 'On <a href="%s">Premium version</a> you can use exit intent trigger technology, or attach to any element that appears in the viewport.','popups'), 'https://timersys.com/plugins/popups-premium/?utm_source=Plugin&utm_medium=options_trigger&utm_campaign=Popups%20Premium');?></th></tr>
<?php do_action( 'spu/metaboxes/after_trigger_options', $opts );?>
</table>
<h3><?php _e( 'Cookies', 'popups');?></h3>
<p><?php _e( 'We use PHP cookies to prevent popups opening for users after they closed it.', 'popups');?></p>
<table class="form-table">
<tr valign="top">
<th><label for="spu_name_conversion_cookie"><?php _e( 'Conversion cookie name', 'popups' ); ?></label></th>
<td colspan="3">
<input type="text" id="spu_name_conversion_cookie" name="spu[name-convert-cookie]" value="<?php echo esc_attr($opts['name-convert-cookie']); ?>" />
<p class="help"><?php _e( 'The name that the popup will use for convertion cookie. Changing this name will reset the cookie, so all users will see popup again.', 'popups' ); ?></p>
</td>
</tr>
<tr valign="top">
<th><label for="spu_duration_conversion_cookie"><?php _e( 'Conversion cookie Duration', 'popups' ); ?></label></th>
<td colspan="3">
<input type="number" id="spu_duration_conversion_cookie" name="spu[duration-convert-cookie]" min="0" value="<?php echo esc_attr($opts['duration-convert-cookie']); ?>" />
<select name="spu[type-convert-cookie]">
<option value="h" <?php selected(esc_attr($opts['type-convert-cookie']),'h'); ?>><?php _e('Hours','popups'); ?></option>
<option value="d" <?php selected(esc_attr($opts['type-convert-cookie']),'d'); ?>><?php _e('Days','popups'); ?></option>
</select>
<p class="help"><?php _e( 'When a user do a conversion like for example a click or form submission, how many days/hours should it stay hidden?', 'popups' ); ?></p>
</td>
</tr>
<tr valign="top">
<th><label for="spu_name_closing_cookie"><?php _e( 'Closing cookie name', 'popups' ); ?></label></th>
<td colspan="3">
<input type="text" id="spu_name_closing_cookie" name="spu[name-close-cookie]" value="<?php echo esc_attr($opts['name-close-cookie']); ?>" />
<p class="help"><?php _e( 'The name that the popup will use for closing cookie. Changing this name will reset the cookie, so all users will see popup again.', 'popups' ); ?></p>
</td>
</tr>
<tr valign="top">
<th><label for="spu_duration_close_cookie"><?php _e( 'Closing cookie duration', 'popups' ); ?></label></th>
<td colspan="3">
<input type="number" id="spu_duration_close_cookie" name="spu[duration-close-cookie]" min="0" value="<?php echo isset( $opts['duration-close-cookie'] ) ? esc_attr($opts['duration-close-cookie']) : esc_attr($opts['duration-convert-cookie']); ?>" />
<select name="spu[type-close-cookie]">
<option value="h" <?php selected(esc_attr($opts['type-close-cookie']),'h'); ?>><?php _e('Hours','popups'); ?></option>
<option value="d" <?php selected(esc_attr($opts['type-close-cookie']),'d'); ?>><?php _e('Days','popups'); ?></option>
</select>
<p class="help"><?php _e( 'After closing the popup, how many days/hours should it stay hidden?', 'popups' ); ?></p>
</td>
</tr>
<?php do_action( 'spu/metaboxes/after_cookie_options', $opts );?>
</table>
<h3>Close options</h3>
<table class="form-table">
<tr valign="top" class="conversion_close">
<th><label for="spu_conversion_close"><?php _e( 'Close on conversion?', 'popups' ); ?></label></th>
<td colspan="3">
<label><input type="radio" id="spu_conversion_close_1" name="spu[conversion_close]" value="1" <?php checked($opts['conversion_close'], 1); ?> /> <?php _e( 'Yes' ); ?></label> &nbsp;
<label><input type="radio" id="spu_conversion_close_0" name="spu[conversion_close]" value="0" <?php checked($opts['conversion_close'], 0); ?> /> <?php _e( 'No' ); ?></label> &nbsp;
<p class="help"><?php _e( 'If you have a form or social shortcode, by default popup will close on submission/conversion', 'popups' ); ?></p>
</td>
</tr>
<?php do_action( 'spu/metaboxes/after_close_options', $opts );?>
</table>
<h3>Other options</h3>
<table class="form-table">
<tr valign="top" class="auto_hide">
<th><label for="spu_auto_hide"><?php _e( 'Auto-hide?', 'popups' ); ?></label></th>
<td colspan="3">
<label><input type="radio" id="spu_auto_hide_1" name="spu[auto_hide]" value="1" <?php checked($opts['auto_hide'], 1); ?> /> <?php _e( 'Yes' ); ?></label> &nbsp;
<label><input type="radio" id="spu_auto_hide_0" name="spu[auto_hide]" value="0" <?php checked($opts['auto_hide'], 0); ?> /> <?php _e( 'No' ); ?></label> &nbsp;
<p class="help"><?php _e( 'Hide box again when visitors scroll back up?', 'popups' ); ?></p>
</td>
</tr>
<tr valign="top">
<th><label for="spu_test_mode"><?php _e( 'Enable test mode?', 'popups' ); ?></label></th>
<td colspan="3">
<label><input type="radio" id="spu_test_mode_1" name="spu[test_mode]" value="1" <?php checked($opts['test_mode'], 1); ?> /> <?php _e( 'Yes' ); ?></label> &nbsp;
<label><input type="radio" id="spu_test_mode_0" name="spu[test_mode]" value="0" <?php checked($opts['test_mode'], 0); ?> /> <?php _e( 'No' ); ?></label> &nbsp;
<p class="help"><?php _e( 'If test mode is enabled, the box will show up regardless of whether a cookie has been set. (To admins only)', 'popups' ); ?></p>
</td>
</tr>
<tr valign="top">
<th><label><?php _e( 'Animation', 'popups' ); ?></label></th>
<td colspan="3">
<select id="spu_animation" name="spu[animation]" class="widefat">
<option value="fade" <?php selected($opts['animation'], 'fade'); ?> > <?php _e( 'Fade In', 'popups' ); ?></option>
<option value="slide" <?php selected($opts['animation'], 'slide'); ?> > <?php _e( 'Slide In', 'popups' ); ?></option>
<?php do_action( 'spu/metaboxes/animations', $opts );?>
<option value="disable" <?php selected($opts['animation'], 'disable'); ?> > <?php _e( 'Disable animations', 'popups' ); ?></option>
</select>
<p class="help"><?php _e( 'Slide will only apply when popup is on the corners', 'popups' ); ?></p>
</td>
</tr>
<tr><th colspan="2"><?php if( ! defined('SPUP_VERSION') ) echo sprintf( __( 'On <a href="%s">Premium version</a> you have 8 new animations to play with!','popups'), 'https://timersys.com/plugins/popups-premium/?utm_source=Plugin&utm_medium=options_trigger&utm_campaign=Popups%20Premium');?></th></tr>
<tr valign="top" class="powered_link">
<th><label for="spu_powered_link"><?php _e( 'Show powered by link?', 'popups' ); ?></label></th>
<td colspan="3">
<label><input type="radio" id="spu_powered_link_1" name="spu[powered_link]" value="1" <?php checked($opts['powered_link'], 1); ?> /> <?php _e( 'Yes' ); ?></label> &nbsp;
<label><input type="radio" id="spu_powered_link_0" name="spu[powered_link]" value="0" <?php checked($opts['powered_link'], 0); ?> /> <?php _e( 'No' ); ?></label> &nbsp;
<p class="help"><?php echo sprintf(__( 'Shows a "powered by" link below your popup. If your affiliate link is set in the <a href="%s">settings</a>, it will be used.', 'popups' ), admin_url('edit.php?post_type=spucpt&page=spu_settings')); ?></p>
</td>
</tr>
<?php do_action( 'spu/metaboxes/after_other_options', $opts );?>
</table>
<?php do_action( 'spu/metaboxes/after_options', $opts );?>
</div>
<?php wp_nonce_field( 'spu_options', 'spu_options_nonce' ); ?>

View File

@@ -0,0 +1,40 @@
<?php
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
?>
<?php
$today = strtotime(date("Y-m-d H:i:s"));
$blackbegin = strtotime("2014-11-28");
$blackend = strtotime("2014-12-02");
if($today > $blackbegin && $today < $blackend) : ?>
<div class="alert-premium">
<p><strong>Happy Black Friday!</strong> Get any Timersys Plugin with a 40% discount using the <code>BLACKFRIDAY</code> coupon code </p>
</div>
<?php endif;?>
<p><?php _e( 'Take the best WordPress Popups plugin to the next level with Popups Premium extension.', 'popups' );?></p>
<h2><?php _e( 'Popups Premium Features:', 'popups' );?></h2>
<ul>
<li><?php _e( 'Beautiful optin forms for popular mail providers', 'popups' );?></li>
<li><?php _e( 'Currently supporting MailChimp, Aweber, Postmatic, Mailpoet, Constant Contact, ActiveCampaign, Newsletter plugin, InfusionSoft, etc', 'popups' );?></li>
<li><?php _e( 'A/B testing. Explore which popup perform better for you.', 'popups' );?></li>
<li><?php _e( 'Track impressions and Conversions of social likes and forms submissions like Contact Form 7, Gravity forms, etc', 'popups' );?></li>
<li><?php _e( 'Track impressions and Conversions in Google Analytics ande define custom events', 'popups' );?></li>
<li><?php _e( 'Exit Intent technology', 'popups' );?></li>
<li><?php _e( 'New popup positions: top/bottoms bars , fullscreen mode, after post content', 'popups' );?></li>
<li><?php _e( '8 New animations effects', 'popups' );?> - <a href="https://timersys.com/popups/?utm_source=Plugin&utm_medium=demo-button&utm_campaign=Popups%20Premium">Online demo</a></li>
<li><?php _e( 'New trigger methods', 'popups' );?></li>
<li><?php _e( 'More Display Rules: Show after N(numbers) of pages viewed', 'popups' );?></li>
<li><?php _e( 'More Display Rules: Show popup at certain time', 'popups' );?></li>
<li><?php _e( 'More Display Rules: Show popup at certain day', 'popups' );?></li>
<li><?php _e( 'More Display Rules: Show/hide if another popup already converted', 'popups' );?></li>
<li><?php _e( 'Timer for auto closing', 'popups' );?></li>
<li><?php _e( 'Ability to disable close button', 'popups' );?></li>
<li><?php _e( 'Ability to disable Advanced close methods like esc or clicking outside of the popup', 'popups' );?></li>
<li><?php _e( 'Premium support', 'popups' );?></li>
</ul>
<p><strong>Hurry up and get your copy!</strong> Take advantage of this <span style="color:red">launch offer</span> before the price goes up. We have a <strong>lot of new features</strong> to be added soon!</p>
<p style="text-align:center">
<a class="button-primary" href="https://timersys.com/downloads/popups-premium/?utm_source=Plugin&utm_medium=buy-button&utm_campaign=Popups%20Premium"><?php _e( 'Buy Now!', 'popups' );?></a>
</p>

View File

@@ -0,0 +1,109 @@
<?php
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
/*
* Meta box - Rules
*
* This template file is used when editing a popup and creates the interface for editing popup rules.
*
* @type template
* @since 2.0
*/
do_action( 'spu/metaboxes/before_rules', $post );
?>
<table class="spu_table widefat" id="spu_rules">
<tbody>
<tr>
<td class="label">
<label for="post_type"><?php _e("Rules", 'popups' ); ?></label>
<p class="description"><?php _e("Create a set of rules to determine where the popup will show", 'popups' ); ?></p>
</td>
<td>
<div class="rules-groups">
<?php if( is_array($groups) ): ?>
<?php foreach( $groups as $group_id => $group ):
$group_id = 'group_' . $group_id;
?>
<div class="rules-group" data-id="<?php echo $group_id; ?>">
<?php if( $group_id == 'group_0' ): ?>
<h4><?php _e("Show this popup if", 'popups' ); ?></h4>
<?php else: ?>
<h4 class="rules-or"><span><?php _e("OR", 'popups' ); ?></span></h4>
<?php endif; ?>
<?php if( is_array($group) ): ?>
<table class="spu_table widefat">
<tbody>
<?php foreach( $group as $rule_id => $rule ):
$rule_id = 'rule_' . $rule_id;
?>
<tr data-id="<?php echo $rule_id; ?>">
<td class="param"><?php
$choices = $this->get_rules_choices();
// create field
$args = array(
'group_id' => $group_id,
'rule_id' => $rule_id,
'name' => 'spu_rules[' . $group_id . '][' . $rule_id . '][param]',
'value' => $rule['param']
);
Spu_Helper::print_select( $args, $choices );
?></td>
<td class="operator"><?php
$args = array(
'group_id' => $group_id,
'rule_id' => $rule_id,
'name' => 'spu_rules[' . $group_id . '][' . $rule_id . '][operator]',
'value' => $rule['operator'],
'param' => $rule['param'],
);
Spu_Helper::ajax_render_operator( $args );
?></td>
<td class="value"><?php
$args = array(
'group_id' => $group_id,
'rule_id' => $rule_id,
'value' => !empty($rule['value']) ? $rule['value'] : '',
'name' => 'spu_rules[' . $group_id . '][' . $rule_id . '][value]',
'param' => $rule['param'],
);
Spu_Helper::ajax_render_rules( $args );
?></td>
<td class="add">
<a href="#" class="rules-add-rule button"><?php _e("+ AND", 'popups' ); ?></a>
</td>
<td class="remove">
<a href="#" class="rules-remove-rule rules-remove-rule">-</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
<?php endforeach; ?>
<h4 class="rules-or"><span><?php _e("OR", 'popups' ); ?></span></h4>
<a class="button rules-add-group" href="#"><?php _e("Add rule group (+ OR)", 'popups' ); ?></a>
<p style="margin-top:30px">
<?php echo sprintf(__('<strong>Hint</strong>: If you are planning to open the popup with a button, simple leave this set to "All Pages" and change trigger method below to "Manual triggering". Then inside the page you want to open the popup add the following shortcode [spu popup="%s"]Click here[/spu]','spu'),$post->ID);?>
</p>
<?php endif; ?>
</div>
</td>
</tr>
</tbody>
</table>

View File

@@ -0,0 +1,6 @@
<?php
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
?>
<p><?php echo sprintf( __( 'You are using Popups plugin v%s', 'popups' ), SocialPopup::VERSION );?></p>
<p><?php echo sprintf( __( 'If you need support please go to the WordPress.org <a href="%s">support forums</a>', 'popups' ), 'http://wordpress.org/support/plugin/popups/');?></p>

View File

@@ -0,0 +1,6 @@
<?php
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
?>
<p><?= __('Take a look to this "How to add a Popup" help video to better understand how the plugin works. Remember you can minimize this box click clicking on the top right arrow.');?></p>
<iframe width="100%" height="315" style="max-width:550px;display: block;margin:10px auto;" src="https://www.youtube.com/embed/S_MfZne6X2I??rel=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>

View File

@@ -0,0 +1,77 @@
<?php
/**
* Settings page template
* @since 1.1
*/
?>
<div class="wrap">
<h2>Popups <?php echo SocialPopup::VERSION;
if( class_exists('PopupsP') ){
echo ' - Premium v', PopupsP::VERSION;
}
?></h2>
<form name="spu-settings" method="post">
<table class="form-table">
<?php do_action( 'spu/settings_page/before' ); ?>
<tr valign="top" class="">
<th><label for="add_link"><?php _e( 'Affiliate link', 'popups' ); ?></label></th>
<td colspan="3">
<label><input type="text" id="add_link" name="spu_settings[aff_link]" value="<?php echo isset($opts['aff_link']) ? $opts['aff_link'] :'';?>" class="regular-text" />
<p class="help"><?php echo sprintf(__( 'You can earn money by promoting the plugin! Join <a href="%s">our affiliate program</a> and paste your affiliate link here to earn 35&#37; in commissions . Once entered, it will replace the default "Powered by" on the popups.', 'popups' ) , 'https://timersys.com/affiliates/'); ?></p>
</td>
</tr>
<tr valign="top" class="">
<th><label for="ajax_mode"><?php _e( 'Ajax mode?', 'popups' ); ?></label></th>
<td colspan="3">
<label><input type="checkbox" id="ajax_mode" name="spu_settings[ajax_mode]" value="1" <?php isset($opts['ajax_mode']) && checked($opts['ajax_mode'], 1); ?> />
<p class="help"><?php _e( 'Load popups using ajax. Compatible with cache plugins, but might not work with all plugins', 'popups' ); ?></p>
</td>
</tr>
<tr valign="top" class="">
<th><label for="style"><?php _e( 'Remove shortcodes style', 'popups' ); ?></label></th>
<td colspan="3">
<label><input type="checkbox" id="style" name="spu_settings[shortcodes_style]" value="1" <?php isset($opts['shortcodes_style']) && checked($opts['shortcodes_style'], 1); ?> />
<p class="help"><?php _e( 'By default the plugin will apply some style to shortcodes. Check here if you want to manually style them', 'popups' ); ?></p>
</td>
</tr>
<tr valign="top" class="">
<th><label for="style"><?php _e( 'Unload Facebook javascript', 'popups' ); ?></label></th>
<td colspan="3">
<label><input type="checkbox" id="style" name="spu_settings[facebook]" value="1" <?php isset($opts['facebook']) && checked($opts['facebook'], 1); ?> />
<p class="help"><?php _e( 'If you use your own Facebook script, check this', 'popups' ); ?></p>
</td>
</tr>
<tr valign="top" class="">
<th><label for="style"><?php _e( 'Unload Google javascript', 'popups' ); ?></label></th>
<td colspan="3">
<label><input type="checkbox" id="style" name="spu_settings[google]" value="1" <?php isset($opts['google']) && checked($opts['google'], 1); ?> />
<p class="help"><?php _e( 'If you use your own Google script, check this', 'popups' ); ?></p>
</td>
</tr>
<tr valign="top" class="">
<th><label for="style"><?php _e( 'Unload Twitter javascript', 'popups' ); ?></label></th>
<td colspan="3">
<label><input type="checkbox" id="style" name="spu_settings[twitter]" value="1" <?php isset($opts['twitter']) && checked($opts['twitter'], 1); ?> />
<p class="help"><?php _e( 'If you use your own Twitter script, check this', 'popups' ); ?></p>
</td>
</tr>
<?php do_action( 'spu/settings_page/after' ); ?>
<tr valign="top" class="">
<th><label for="uninstall"><?php _e( 'Delete all data on Uninstall', 'popups' ); ?></label></th>
<td colspan="3">
<label><input type="checkbox" id="uninstall" name="spu_settings[uninstall]" value="1" <?php isset($opts['uninstall']) && checked($opts['uninstall'], 1); ?> />
<p class="help"><?php _e( 'When you uninstall the plugin all popups, settings and stats will be deleted from your db', 'popups' ); ?></p>
</td>
</tr>
<tr><td><input type="submit" class="button-primary" value="<?php _e( 'Save settings', 'popups' );?>"/></td>
<?php wp_nonce_field('spu_save_settings','spu_nonce'); ?>
</table>
</form>
</div>