Commit inicial - WordPress Análisis de Precios Unitarios

- WordPress core y plugins
- Tema Twenty Twenty-Four configurado
- Plugin allow-unfiltered-html.php simplificado
- .gitignore configurado para excluir wp-config.php y uploads

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-11-03 21:04:30 -06:00
commit a22573bf0b
24068 changed files with 4993111 additions and 0 deletions

View File

@@ -0,0 +1,331 @@
/**
* CSS for the metabox "Connect Options"
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2015, OnePress Ltd
*
* @package optinpanda
* @since 1.0.0
*/
#OPanda_ConnectOptionsMetaBox {
display: block;
}
#OPanda_ConnectOptionsMetaBox .inside,
#OPanda_ConnectOptionsMetaBox .factory-form-metabox {
padding-bottom: 0px;
}
.opanda-connect-buttons .opanda-button input {
outline: none !important;
}
#OPanda_ConnectOptionsMetaBox select {
width: auto;
}
.opanda-connect-buttons .opanda-button input:disabled {
cursor: default;
}
#OPanda_ConnectOptionsMetaBox .factory-separator {
border: 0px;
border-top: 1px solid #f1f1f1;
}
/* connect buttons */
#OPanda_ConnectOptionsMetaBox .opanda-connect-buttons {
padding: 0 0 10px 0;
overflow: auto;
background: #f7f7f7;
margin: 0 0 0 -22px;
padding: 30px 22px 32px 22px;
position: relative;
width: 100%;
-moz-box-sizing: content-box;
box-sizing: content-box;
white-space: nowrap;
}
.opanda-connect-buttons .opanda-button {
width: 178px;
display: inline-block;
vertical-align: top;
padding: 3px 0 0 0;
-moz-box-sizing: border-box;
box-sizing: border-box;
border-left: 1px solid #f1f1f1;
border-right: 1px solid #f1f1f1;
box-shadow: 0 2px 3px rgba(0,0,0,0.03);
background-color: #e1e1e1;
color: #111;
}
.opanda-connect-buttons .opanda-button + .opanda-button {
border-left: 0px;
margin-left: 15px;
}
.opanda-connect-buttons .opanda-inner-wrap {
background-color: #fff;
}
.opanda-connect-buttons .opanda-button-facebook {
background: #989de1;
}
.opanda-connect-buttons .opanda-button-twitter {
background: #55acee;
}
.opanda-connect-buttons .opanda-button-google {
background: #f47665;
}
.opanda-connect-buttons .opanda-button-linkedin {
background: #286b8d;
}
.opanda-connect-buttons .opanda-button-email {
background: #9faeae;
}
.opanda-connect-buttons .opanda-button-title {
display: block;
font-size: 14px;
line-height: 16px;
border-bottom: 1px solid #f5f5f5;
padding: 14px 15px;
}
.opanda-connect-buttons .opanda-button-title > * {
display: inline-block;
vertical-align: bottom;
}
.opanda-connect-buttons .opanda-button-title span + span {
margin-left: 5px;
}
.opanda-connect-buttons .opanda-button-title {
position: relative;
}
/* erorrs */
.opanda-connect-buttons .opanda-error {
display: none;
position: relative;
}
.opanda-connect-buttons .opanda-error i {
cursor: help;
color: #f47665;
}
.opanda-connect-buttons .opanda-error .opanda-error-text,
.opanda-connect-buttons .opanda-actions-disabled .opanda-error-text {
display: none;
position: absolute;
width: 300px;
background-color: rgba(0,0,0,0.8);
white-space: normal;
z-index: 10;
padding: 10px 12px 12px 12px;
font-weight: normal;
line-height: 150%;
border-radius: 4px;
color: #fff;
font-size: 13px;
margin-top: 5px;
}
.opanda-connect-buttons .opanda-error-text a {
color: #fff !important;
font-weight: bold;
}
.opanda-connect-buttons .opanda-button-title:hover .opanda-error-text {
display: block;
}
.opanda-connect-buttons .opanda-has-error .opanda-checkbox {
display: none;
}
.opanda-connect-buttons .opanda-has-error .opanda-button-title {
cursor: default;
}
.opanda-connect-buttons .opanda-has-error .opanda-error {
display: inline-block;
}
.opanda-connect-buttons .opanda-actions,
.opanda-connect-buttons .opanda-actions-disabled {
padding: 8px 15px 12px 15px;
margin: 0px;
}
.opanda-connect-buttons .opanda-actions-disabled {
border-top: 1px solid #f5f5f5;
background-color: #fafafa;
padding-top: 10px;
position: relative;
}
.opanda-connect-buttons .opanda-actions-disabled input {
cursor: no-drop !important;
}
.opanda-connect-buttons .opanda-actions-disabled .opanda-error-text {
display: none;
left: 100%;
margin-left: -2px;
top: -30px;
}
.opanda-connect-buttons .opanda-actions-disabled .opanda-error-wrap {
position: relative;
padding-right: 20px;
}
.opanda-connect-buttons .opanda-actions-disabled .opanda-error-wrap:hover .opanda-error-text {
display: block;
}
.opanda-connect-buttons .opanda-actions-disabled .opanda-error-wrap input {
margin-top: 0px;
}
.opanda-connect-buttons .opanda-action {
margin-bottom: 0px;
padding-bottom: 6px;
}
.opanda-connect-buttons .opanda-action > * {
display: inline-block;
vertical-align: bottom;
}
.opanda-connect-buttons .opanda-action .opanda-action-link {
text-decoration: none;
color: #111;
margin-left: 5px;
text-transform: capitalize;
border-bottom: 1px dashed #aaa;
outline: none;
box-shadow: none;
}
.opanda-connect-buttons .opanda-action.opanda-hover .opanda-action-link {
border-bottom: 1px dashed #dfdfbd;
background-color: #ffffdd;
}
.opanda-connect-buttons .opanda-action.opanda-on .opanda-action-link {
font-weight: bold;
color: #0074a2;
border-bottom: 1px dotted #0074a2;
}
.opanda-connect-buttons .opanda-button.opanda-off {
background-color: #e1e1e1;
color: #999;
}
.opanda-connect-buttons .opanda-button.opanda-off .opanda-inner-wrap {
background-color: #f9f9f9;
}
.opanda-connect-buttons .opanda-button.opanda-off .opanda-action-link,
.opanda-connect-buttons .opanda-button.opanda-off input[type=checkbox]:checked:before {
color: #999;
}
.opanda-connect-buttons .opanda-button.opanda-off input:focus {
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.opanda-connect-buttons .opanda-button.opanda-off .opanda-button-title input {
border-color: #aaa;
}
.opanda-connect-buttons .opanda-button.opanda-off .opanda-action .opanda-action-link {
color: #bbb;
border-bottom: 1px dashed #eee;
cursor: default;
}
.opanda-connect-buttons .opanda-button.opanda-off .opanda-action.opanda-hover .opanda-action-link {
background-color: transparent;
border-bottom: 1px dashed #eee;
}
/* premium errors */
.opanda-connect-buttons .opanda-error-premium .opanda-error-text {
width: 270px;
padding: 0px;
background-color: transparent;
}
.opanda-connect-buttons .opanda-error-premium i {
position: relative;
top: 1px;
font-size: 16px;
color: #777;
}
.opanda-connect-buttons .opanda-premium-note {
margin: 0px;
position: static;
width: 100%;
border: 0px;
}
.opanda-connect-buttons .opanda-premium-note .fa {
color: #fff;
}
/* connect buttons options */
#OPanda_ConnectOptionsMetaBox .opanda-connect-buttons-options {
background-color: #fff;
margin: 0 -22px 0 -22px;
padding: 38px 22px 26px 22px;
position: relative;
width: 100%;
-moz-box-sizing: content-box;
box-sizing: content-box;
border-top: 1px solid #eaeaea;
}
.opanda-connect-buttons-options.opanda-off {
display: none;
}
.opanda-connect-buttons-options .control-label {
max-width: 184px !important;
}
.opanda-connect-buttons-options .control-group {
max-width: 800px !important;
}
.opanda-connect-buttons-options .opanda-header {
margin-bottom: 20px;
}
.opanda-connect-buttons-options .opanda-header .opanda-inner-wrap {
background-color: #f8f8f8;
padding: 9px 9px 7px 9px;
position: relative;
border-left: 4px solid #f1f1f1;
}
.opanda-connect-buttons-options .opanda-header strong {
display: block;
font-size: 16px;
}
.opanda-connect-buttons-options .opanda-header p {
margin: 0px;
}
.opanda-connect-buttons-options .opanda-header strong + p {
margin-top: 5px;
}
.factory-control-subscribe_mode .factory-hints,
.factory-control-subscribe_delivery .factory-hints {
vertical-align: top;
color: #737373;
width: auto;
max-width: 500px;
position: relative;
top: -1px;
border-left: 1px solid #999;
padding: 0 0 0 9px;
margin: 10px 0 0 5px;
background: transparent;
}
.factory-control-subscribe_mode .factory-hints .factory-hint,
.factory-control-subscribe_delivery .factory-hints .factory-hint {
background: transparent;
padding: 0px;
margin-top: 0px;
}

View File

@@ -0,0 +1,452 @@
if ( !window.bizpanda ) window.bizpanda = {};
if ( !window.bizpanda.connectOptions ) window.bizpanda.connectOptions = {};
(function($){
window.bizpanda.connectOptions = {
init: function( item ) {
var self = this;
this.item = $('#opanda_item').val();
this.$control = $(".opanda-connect-buttons");
this.$buttons = this.$control.find(".opanda-button");
this.$actions = this.$control.find(".opanda-action");
this.$result = $("#opanda_connect_buttons");
$(window).resize(function(){ self.adjustHeights(); });
self.adjustHeights();
self.hideEmptyDisabledActions();
this.initButtons();
this.setupEvents();
$.bizpanda.filters.add('opanda-preview-options', function( options ){
var extraOptions = self.getConnectOptions();
return $.extend(true, options, extraOptions);
});
var hasDeliveryChoice = $("#opanda_subscribe_delivery").length;
var $deliveryOptions = $("#opanda-delivery-options");
var $confirmationEmail = $("#opanda-confirmation-email");
var $deliverySelect = $("#opanda_subscribe_delivery");
$("#opanda_subscribe_mode").change(function(){
var value = $(this).val();
if ( value === 'double-optin' || value === 'quick-double-optin' ) {
if ( hasDeliveryChoice ) {
$deliveryOptions.fadeIn();
var delivery = $deliverySelect.val();
if ( delivery === 'wordpress' ) $confirmationEmail.fadeIn();
}
else $("#opanda-confirmation-email").fadeIn();
} else {
$("#opanda-delivery-options").hide();
$("#opanda-confirmation-email").hide();
}
}).change();
if ( hasDeliveryChoice ) {
$("#opanda_subscribe_delivery").change(function(){
var value = $(this).val();
if ( value === 'wordpress' && ($confirmationEmail.css('display') == 'block') ) {
$("#opanda-confirmation-email").fadeIn();
} else {
$("#opanda-confirmation-email").hide();
}
}).change();
}
},
getConnectOptions: function() {
var gerOrder = function( fieldId ) {
var actions = $(fieldId).val();
return actions ? actions.split(",") : [];
};
var order = gerOrder("#opanda_connect_buttons");
var emailIndex = $.inArray( 'email', order );
if ( emailIndex > -1 ) { order.splice(emailIndex, 1); }
var groups = ( emailIndex > -1 )
? ['connect-buttons', 'subscription']
: ['connect-buttons'];
var optinMode = $('#opanda_subscribe_mode').val();
var options = {
groups: {
order: groups
},
terms: window.opanda_terms,
privacyPolicy: window.opanda_privacy_policy,
connectButtons: {
order: order,
facebook: {
socialProxy: window.facebook_social_proxy,
actions: gerOrder('#opanda_facebook_actions'),
},
twitter: {
socialProxy: window.twitter_social_proxy,
actions: gerOrder('#opanda_twitter_actions'),
follow: {
user: $("#opanda_twitter_follow_user").val(),
notifications: $("#opanda_twitter_follow_notifications").is(':checked')
},
tweet: {
message: $("#opanda_twitter_tweet_message").val()
}
},
google: {
socialProxy: window.google_social_proxy,
actions: gerOrder('#opanda_google_actions'),
youtubeSubscribe: {
channelId: $("#opanda_google_youtube_channel_id").val()
}
},
linkedin: {
socialProxy: window.linkedin_social_proxy,
actions: gerOrder('#opanda_linkedin_actions'),
clientId: window.opanda_linkedin_client_id,
follow: {
company: $("#opanda_linkedin_follow_company").val()
}
}
},
subscription: {
text: {
message: $("#opanda_subscribe_before_form").val() || window.res_signin_email_form_text
},
form: {
buttonText: $("#opanda_subscribe_button_text").val() || window.res_signin_email_button,
noSpamText: $("#opanda_subscribe_after_button").val() || window.res_signin_after_email_button,
type: $("#opanda_subscribe_name").is(':checked') ? 'name-email-form' : 'email-form'
}
},
subscribeActionOptions: {
campaignId: $("#opanda_subscribe_list").length ? $("#opanda_subscribe_list").val() : null,
service: window.opanda_subscription_service_name,
doubleOptin: $.inArray( optinMode, ['quick-double-optin', 'double-optin'] > -1),
confirm: $.inArray( optinMode, ['double-optin'] > -1)
}
};
return options;
},
adjustHeights: function() {
var maxHeight = 0;
var $buttons = this.$buttons.find(".opanda-actions:not(.opanda-actions-disabled)").each(function(){
var height = $(this).css('height', 'auto').height();
if ( height > maxHeight ) maxHeight = height;
});
$buttons.height(maxHeight);
},
hideEmptyDisabledActions: function() {
$(".opanda-actions-disabled").each(function(){
if ( $(this).find(".opanda-action").length > 0 ) return;
$(this).hide();
});
},
initButtons: function() {
var self = this;
var stringResult = this.$result.val();
if (!stringResult) stringResult = null;
if ( stringResult ) {
var buttons = stringResult.split(',');
for( var index in buttons ) {
var buttonName = buttons[index];
this.activateButton( buttonName, true );
}
}
this.$buttons.each(function(){
self.initButtonActions( $(this).data('name') )
});
this.initActionSaveEmail();
this.updateResult();
},
initActionSaveEmail: function () {
$("input[data-action='lead']").change(function(){
$("#opanda_catch_leads").val( $(this).is(":checked") ? "1" : "0" );
});
if ( $("#opanda_catch_leads").val() == "1" ) {
$("input[data-action='lead']").attr('checked', 'checked');
} else {
$("input[data-action='lead']").removeAttr('checked');
}
},
initButtonActions: function( buttonName ) {
var stringResult = $("#opanda_" + buttonName + "_actions").val();
if (!stringResult) stringResult = null;
if ( stringResult ) {
var actions = stringResult.split(',');
for( var index in actions ) {
var actionName = actions[index];
this.activateButtonAction( buttonName, actionName, true );
}
}
},
setupEvents: function() {
var self = this;
this.$buttons.find(".opanda-button-title input").change(function(){
self.toogleButton( $(this).val() );
});
this.$buttons.find(".opanda-action input").change(function(){
var common = $(this).data('common') ? true : false;
var button = $(this).data('button');
var action = $(this).data('action');
if ( $(this).is(':checked') ) {
self.showOptions( common, button, action );
}
var $input = self.getOptionsLink( common, button, action ).find("input");
if ( $(this).is(':checked') ) {
$input.attr('checked', 'checked');
} else {
$input.removeAttr('checked', 'checked');
}
self.updateResult();
return false;
});
this.$buttons.find(".opanda-action .opanda-action-link").click(function(){
var common = $(this).data('common') ? true : false;
var button = $(this).data('button');
var action = $(this).data('action');
self.toogleOptions( common, button, action );
return false;
});
this.$buttons.find(".opanda-action .opanda-action-link").hover(function(){
var common = $(this).data('common') ? true : false;
var button = $(this).data('button');
var action = $(this).data('action');
var $link = self.getOptionsLink( common, button, action );
$link.addClass('opanda-hover');
}, function(){
var common = $(this).data('common') ? true : false;
var button = $(this).data('button');
var action = $(this).data('action');
var $link = self.getOptionsLink( common, button, action );
$link.removeClass('opanda-hover');
});
},
/**
* Gets the button $object.
*/
getButton: function( name ) {
return this.$control.find(".opanda-button-" + name);
},
/**
* Activates or deactivates the button.
*/
toogleButton: function( name ) {
var $button = this.getButton( name );
if ( $button.hasClass('opanda-on') ) this.deactivateButton( name );
else this.activateButton( name );
},
/**
* Activates the connect button.
*/
activateButton: function( name, setup ) {
var $button = this.getButton( name );
if ( $button.is(".opanda-has-error") ) return;
$button.removeClass('opanda-off').addClass('opanda-on');
$button.find(".opanda-actions .opanda-action:not(.opanda-action-disabled) input").removeAttr('disabled');
$button.find(".opanda-button-title input").attr('checked', 'checked');
if ( !setup ) this.updateResult();
},
/**
* Deactivates the button.
*/
deactivateButton: function( name, setup ) {
var $button = this.getButton( name );
$button.removeClass('opanda-on').addClass('opanda-off');
$button.find(".opanda-actions input").attr('disabled', 'disabled');
$button.find(".opanda-button-title input").removeAttr('checked');
if ( !setup ) this.updateResult();
},
/**
* Activates the button action.
*/
activateButtonAction: function( buttonName, actionName, setup) {
var $button = this.getButton( buttonName );
var $action = $button.find('.opanda-action-' + actionName);
if ( $action.is('.opanda-action-disabled') ) return;
$action.find('input').attr('checked', 'checked');
if ( !setup ) this.updateActionsResult( buttonName, actionName );
},
/**
* Deactivates the button action.
*/
deactivateButtonAction: function( buttonName, actionName, setup) {
var $button = this.getButton( buttonName );
$button.find('.opanda-action-' + actionName + ' inpput').removeAttr('checked');
if ( !setup ) this.updateActionsResult( buttonName, actionName );
},
/**
* Gets the options $object.
*/
getOptions: function( common, button, action ) {
if ( common ) {
return $( "#opanda-" + action + "-options" );
} else {
return $( "#opanda-" + button + "-" + action + "-options" );
}
},
/**
* Gets the options link $object.
*/
getOptionsLink: function( common, button, action ) {
if ( common ) {
return this.$control.find(".opanda-action-" + action);
} else {
return this.$control.find(".opanda-button-" + button + " .opanda-action-" + action);
}
},
/**
* Shows or hides the options.
*/
toogleOptions: function( common, button, action ) {
var $options = this.getOptions( common, button, action );
if ( !$options.is(":visible") ) this.showOptions( common, button, action );
else this.hideOptions( common, button, action );
},
/**
* Shows the action options.
*/
showOptions: function( common, button, action ) {
$(".opanda-connect-buttons-options").addClass('opanda-off');
this.$actions.removeClass('opanda-on');
var $options = this.getOptions( common, button, action );
$options.hide().removeClass('opanda-off').fadeIn(300);
var $link = this.getOptionsLink( common, button, action );
$link.addClass('opanda-on');
},
/**
* Hides the action options.
*/
hideOptions: function( common, button, action ) {
$(".opanda-connect-buttons-options").addClass('opanda-off');
this.$actions.removeClass('opanda-on');
},
/**
* Updates the hidden field where the available buttons are saved.
*/
updateResult: function() {
var buttons = [];
$(".opanda-connect-buttons .opanda-button.opanda-on").each(function(){
buttons.push( $(this).data('name') );
});
this.$result.val( buttons.join(',') );
for( var i in buttons ) {
this.updateActionsResult( buttons[i] );
}
},
/**
* Updates the hidden field where the button actions are saved.
*/
updateActionsResult: function( buttonName ) {
var actions = [];
$(".opanda-connect-buttons .opanda-button-" + buttonName + " .opanda-action input:checked").each(function(){
actions.push( $(this).data('action') );
});
$("#opanda_" + buttonName + "_actions").val( actions.join(',') );
}
};
$(function(){
window.bizpanda.connectOptions.init();
});
})(jQuery)

View File

@@ -0,0 +1,245 @@
<?php
/**
* Boots the code for the admin part of the Sign-In Locker
*
* @since 1.0.0
* @package core
*/
/**
* Registers metaboxes for Sign-In Locker.
*
* @see opanda_item_type_metaboxes
* @since 1.0.0
*/
function opanda_signin_locker_metaboxes( $metaboxes ) {
$metaboxes[] = array(
'class' => 'OPanda_ConnectOptionsMetaBox',
'path' => BIZPANDA_SIGNIN_LOCKER_DIR . '/admin/metaboxes/connect-options.php'
);
return $metaboxes;
}
add_filter('opanda_signin-locker_type_metaboxes', 'opanda_signin_locker_metaboxes', 10, 1);
/**
* Prepares the Sign-In Locker to use while activation.
*
* @since 1.0.0
*/
function opanda_signin_locker_activation( $plugin, $helper ) {
// default email locker
$helper->addPost(
'opanda_default_signin_locker_id',
array(
'post_type' => OPANDA_POST_TYPE,
'post_title' => __('Sign-In Locker (default)', 'signinlocker'),
'post_name' => 'opanda_default_signin_locker'
),
array(
'opanda_item' => 'signin-locker',
'opanda_header' => __('Sign In To Unlock This Content', 'signinlocker'),
'opanda_message' => __('Please sign in. It\'s free. Just click one of the buttons below to get instant access.', 'signinlocker'),
'opanda_style' => 'great-attractor',
'opanda_catch_leads' => 1,
'opanda_connect_buttons' => 'facebook,twitter,google',
'opanda_facebook_actions' => BizPanda::hasPlugin('optinpanda') ? 'signup' : 'signup',
'opanda_twitter_actions' => BizPanda::hasPlugin('optinpanda') ? 'signup' : 'signup',
'opanda_google_actions' => BizPanda::hasPlugin('optinpanda') ? 'signup' : 'signup',
'opanda_linkedin_actions' => BizPanda::hasPlugin('optinpanda') ? 'signup' : 'signup',
'opanda_email_actions' => BizPanda::hasPlugin('optinpanda') ? 'signup' : 'signup',
'opanda_mobile' => 1,
'opanda_highlight' => 1,
'opanda_is_system' => 1,
'opanda_is_default' => 1
)
);
}
add_action('after_bizpanda_activation', 'opanda_signin_locker_activation', 10, 2);
/**
* Registers default themes.
*
* We don't need to include the file containing the file OPanda_ThemeManager because this function will
* be called from the hook defined inside the class OPanda_ThemeManager.
*
* @see onp_sl_register_themes
* @see OPanda_ThemeManager
*
* @since 1.0.0
* @return void
*/
function opanda_register_signin_locker_themes( $item = 'signin-locker' ) {
OPanda_ThemeManager::registerTheme(array(
'name' => 'great-attractor',
'title' => 'Great Attractor',
'path' => OPANDA_BIZPANDA_DIR . '/themes/great-attractor',
'items' => array('social-locker', 'signin-locker', 'email-locker'),
'socialButtons' => [
'allowedDisplay' => ['native', 'covers'],
'defaultDisplay' => 'covers'
]
));
OPanda_ThemeManager::registerTheme(array(
'name' => 'friendly-giant',
'title' => 'Friendly Giant',
'path' => OPANDA_BIZPANDA_DIR . '/themes/friendly-giant',
'items' => array('social-locker', 'signin-locker', 'email-locker'),
'socialButtons' => [
'allowedDisplay' => ['native', 'covers'],
'defaultDisplay' => 'covers'
]
));
OPanda_ThemeManager::registerTheme(array(
'name' => 'dark-force',
'title' => 'Dark Force',
'path' => OPANDA_BIZPANDA_DIR . '/themes/dark-force',
'items' => array('social-locker', 'signin-locker', 'email-locker'),
'socialButtons' => [
'allowedDisplay' => ['native', 'covers'],
'defaultDisplay' => 'covers'
]
));
}
add_action('onp_sl_register_themes', 'opanda_register_signin_locker_themes');
/**
* Shows the help page 'What it it?' for the Sign-In Locker.
*
* @since 1.0.0
*/
function opanda_help_page_what_is_signin_locker( $manager ) {
require BIZPANDA_SIGNIN_LOCKER_DIR . '/admin/help/what-is-it.php';
}
add_action('opanda_help_page_what-is-signin-locker', 'opanda_help_page_what_is_signin_locker');
/**
* Shows the help page 'Usage Example' for the Sign-In Locker.
*
* @since 1.0.0
*/
function opanda_help_page_usage_example_signin_locker( $manager ) {
require BIZPANDA_SIGNIN_LOCKER_DIR . '/admin/help/usage-example.php';
}
add_action('opanda_help_page_usage-example-signin-locker', 'opanda_help_page_usage_example_signin_locker');
/**
* Shows the help page 'GDPR compatibility' for the Social Locker.
*
* @since 1.0.0
*/
function opanda_help_page_gdpr_signin_locker( $manager ) {
require BIZPANDA_SIGNIN_LOCKER_DIR . '/admin/help/gdpr.php';
}
add_action('opanda_help_page_gdpr-signin-locker', 'opanda_help_page_gdpr_signin_locker');
/**
* Registers the quick tags for the wp editors.
*
* @see admin_print_footer_scripts
* @since 1.0.0
*/
function opanda_quicktags_for_signin_locker()
{ ?>
<script type="text/javascript">
(function(){
if (!window.QTags) return;
window.QTags.addButton( 'signinlocker', 'signinlocker', '[signinlocker]', '[/signinlocker]' );
}());
</script>
<?php
}
add_action('admin_print_footer_scripts', 'opanda_quicktags_for_signin_locker');
/**
* Registers stats screens for Sign-In.
*
* @since 1.0.0
*/
function opanda_signin_locker_stats_screens( $screens ) {
$screens = array(
// The Summary Screen
'summary' => array (
'title' => __('<i class="fa fa-search"></i> Summary', 'signinlocker'),
'description' => __('The page shows the total number of unlocks for the current locker.', 'signinlocker'),
'chartClass' => 'OPanda_SignInLocker_Summary_StatsChart',
'tableClass' => 'OPanda_SignInLocker_Summary_StatsTable',
'path' => BIZPANDA_SIGNIN_LOCKER_DIR . '/admin/stats/summary.php'
),
// The Profits Screen
'profits' => array(
'title' => __('<i class="fa fa-usd"></i> Benefits', 'signinlocker'),
'description' => __('The page shows benefits the locker brought for your website.', 'signinlocker'),
'chartClass' => 'OPanda_SignInLocker_Profits_StatsChart',
'tableClass' => 'OPanda_SignInLocker_Profits_StatsTable',
'path' => BIZPANDA_SIGNIN_LOCKER_DIR . '/admin/stats/profits.php'
),
// The Channels Screen
'channels' => array(
'title' => __('<i class="fa fa-search-plus"></i> Channels', 'signinlocker'),
'description' => __('The page shows which ways visitors used to unlock the content.', 'signinlocker'),
'chartClass' => 'OPanda_SignInLocker_Channels_StatsChart',
'tableClass' => 'OPanda_SignInLocker_Channels_StatsTable',
'path' => BIZPANDA_SIGNIN_LOCKER_DIR . '/admin/stats/channels.php'
),
// The Bounces Screen
/*
'bounces' => array(
'title' => __('<i class="fa fa-sign-out"></i> Bounces', 'signinlocker'),
'description' => __('The page shows major weaknesses of the locker which lead to bounces. Hover your mouse pointer on [?] in the table, to know more about a particular metric.', 'signinlocker'),
'chartClass' => 'OPanda_SignInLocker_Bounces_StatsChart',
'tableClass' => 'OPanda_SignInLocker_Bounces_StatsTable',
'path' => BIZPANDA_SIGNIN_LOCKER_DIR . '/admin/stats/bounces.php'
)*/
);
// The Skips Screen
$screens['skips'] = array (
'title' => __('<i class="fa fa-tint"></i> Skips', 'signinlocker'),
'description' => __('The chart shows how many users skipped the locker by using the Timer or Close Icon, comparing to the users who unlocked the content.', 'signinlocker'),
'chartClass' => 'OPanda_SignInLocker_Skips_StatsChart',
'tableClass' => 'OPanda_SignInLocker_Skips_StatsTable',
'path' => BIZPANDA_SIGNIN_LOCKER_DIR . '/admin/stats/skips.php'
);
return $screens;
}
add_filter('opanda_signin-locker_stats_screens', 'opanda_signin_locker_stats_screens', 10, 1);

View File

@@ -0,0 +1,26 @@
<?php
global $bizpanda;
$lang = $bizpanda->options['lang'];
?>
<div class="onp-help-section">
<h1><?php _e('Sign-In Locker GDPR Compatibility', 'sociallocker'); ?></h1>
<p>
<?php _e('The General Data Protection Regulation (GDPR) is a new data protection law in the EU that takes effect on May 25, 2018.', 'sociallocker') ?>
<?php _e('GDPR covers processing personal data.') ?>
</p>
<p>
<strong><?php _e('Sign-In Locker is fully compatible with GDPR if the option Consent Checkbox is activated.</strong>', 'sociallocker') ?></strong>
</p>
<p>
<?php _e('Sign-In Locker collects and processes personal data covered by GDPR. So if your website interacts with EU citizens, you need to activate the option Consent Checkbox.') ?>
</p>
<p>
<?php _e('Please note, Sign-In Locker doesn\'t send any personal data to our servers (to servers of the plugin developer). All data are stored only on your website and 3d party services you configured by yourself to work with Sign-In Locker.') ?>
</p>
</div>

View File

@@ -0,0 +1,157 @@
<?php
global $bizpanda;
$lang = $bizpanda->options['lang'];
?>
<div class="onp-help-section">
<h1><?php _e('Quick Start Guide', 'signinlocker'); ?></h1>
<?php if ( BizPanda::hasPlugin('signinlocker') ) { ?>
<p>
<?php _e('Using the Sign-In Locker is similar to using the Social Locker but it require a bit more efforts for the initial configuration.') ?>
</p>
<?php } elseif( BizPanda::hasPlugin('optinpanda' ) ) { ?>
<p>
<?php _e('Using the Sign-In Locker is similar to using the Email Locker but it require a bit more efforts for the initial configuration.') ?>
</p>
<?php } ?>
<p>
<?php _e('To pick out the content which should be locked, you can use special shortcodes. During installation, the plugin created for you the shortcode <span class="onp-mark onp-mark-gray onp-mark-stricked onp-code">[signinlocker][/signinlocker]</span> named <strong>Sign-In Locker</strong>.', 'signinlocker'); ?>
</p>
<p class='onp-note'>
<?php _e('<strong>Note:</strong> You can create more shortcodes at any time for whatever you need them for. For instance, you could create one for locking video players or another one for locking download links.', 'signinlocker'); ?>
</p>
</div>
<div class="onp-help-section">
<h2>1. <?php _e('Open the editor', 'signinlocker'); ?></h2>
<p><?php printf( __('In admin menu, select Opt-In Panda -> <a href="%s">All Lockers</a>.', 'signinlocker'), admin_url('edit.php?post_type=opanda-item') ); ?></p>
<p><?php _e('Then click on the shortcode titled <strong>Sign-In Locker</strong> to open its editor:', 'signinlocker'); ?></p>
<p class='onp-img'>
<img src='<?php echo 'https://cconp.s3.amazonaws.com/bizpanda/signin-locker/help/panda-items.png' ?>' />
</p>
</div>
<div class="onp-help-section">
<h2>2. <?php _e('Configure the locker', 'signinlocker'); ?></h2>
<p>1) <?php _e('Set a clear title that attracts attention or creates a call to action (see the example below).', 'signinlocker'); ?></p>
<p>2) <?php _e('Describe what the visitor will get after they unlock the content. This is very important, as visitors need to be aware of what they are getting. And please, only promise things you can deliver.', 'signinlocker'); ?></p>
<p>3) <?php _e('Choose one of the available themes for your locker.', 'signinlocker'); ?></p>
<p>4) <?php _e('Set the Overlay Mode. We recommend to use the Blurring Mode as the most attention-grabbing mode.', 'signinlocker'); ?></p>
</p>
<p class='onp-img'>
<img src='<?php echo 'https://cconp.s3.amazonaws.com/bizpanda/signin-locker/help/basic-options.png' ?>' />
</p>
<p>
5) <?php _e('Make sure that the Facebook, Twitter and Google buttons are marked. That makes available for the users to sign in through the respective social networks.', 'signinlocker'); ?>
</p>
<p>
6) <?php _e('Select actions you would like to execute for each button when the user clicks it to sign in.', 'signinlocker'); ?>
</p>
<p>
7) <?php _e('Configure each action.', 'signinlocker'); ?>
</p>
<p class='onp-img'>
<img src='<?php echo 'https://cconp.s3.amazonaws.com/bizpanda/signin-locker/help/social-options.png' ?>' />
</p>
<p>
<?php _e('Check out the image below to learn how to configure the buttons and their actions:', 'signinlocker'); ?>
</p>
<p class='onp-img'>
<img src='<?php echo 'https://cconp.s3.amazonaws.com/bizpanda/signin-locker/help/social-options-explanation.png' ?>' />
</p>
<p>
<?php _e('Congratulations! The locker is ready to use.', 'signinlocker'); ?>
</p>
<p>
<?php printf( __('The page <a href="%s">Stats & Reports</a> will help you to correct your locker after collecting the first statistical data.', 'signinlocker'), admin_url( 'edit.php?post_type=opanda-item&page=stats-' . $bizpanda->pluginName ) ); ?>
</p>
<p class='onp-note'>
<?php _e('On the right sidebars, there are some additional options which can help you to adjust the locker to your site audience. Try to use them by yourself later.', 'signinlocker'); ?>
</p>
</div>
<div class="onp-help-section">
<h2>3. <?php _e('Place the locker', 'signinlocker'); ?></h2>
<p>
<?php _e('Decide what content you would like to lock. It might be:', 'signinlocker'); ?>
<ul>
<li><?php _e('A download link (for instance, a free graphic, an audio file, video resources, or a printable pdf of your article).', 'signinlocker'); ?></li>
<li><?php _e('A promo code (for instance, a 10% off discount, if the visitor shares your promo page).', 'signinlocker'); ?></li>
<li><?php _e('The end of your article (for instance, you might show the beginning of the article to gain interest, but hide the ending).', 'signinlocker'); ?></li>
</ul>
<?php _e('Basically, you can hide any content that would be important for visitors who are visiting your site.', 'signinlocker'); ?>
</p>
<p>
<?php _e('However, <strong>you should never</strong>:', 'signinlocker'); ?>
<ul>
<li>
<?php _e('Lock all of your content, posts or pages.', 'signinlocker'); ?>
</li>
<li>
<?php _e('Lock boring content or content that is not interesting.', 'signinlocker'); ?>
</li>
</ul>
</p>
<p>
<?php _e('In other words, dont try to trick your visitors.', 'signinlocker'); ?>
</p>
<p>
<?php _e('Open the post editor for the post where you want to put the locker. Add a block named «Sign-In Locker».', 'signinlocker') ?>
</p>
<p class='onp-img'>
<img src='<?php echo 'https://cconp.s3.amazonaws.com/bizpanda/signin-locker/help/block-widget.png' ?>' />
</p>
<p>
<?php _e('Put content you wish to lock into the added block.', 'signinlocker') ?>
</p>
<p class='onp-img'>
<img src='<?php echo 'https://cconp.s3.amazonaws.com/bizpanda/signin-locker/help/edit-block.png' ?>' />
</p>
<p>
<?php _e('If you have several lockers you can pick the concrete one by clicking on the block border.', 'signinlocker') ?>
</p>
<p class='onp-img'>
<img src='<?php echo 'https://cconp.s3.amazonaws.com/bizpanda/signin-locker/help/block-settings.png' ?>' />
</p>
<p>
<?php _e('Also you can use shortcodes to call the locker by wrapping the content you wish to lock. For instance: <span class="onp-mark onp-mark-gray onp-mark-stricked onp-code">[signinlocker] Locked Content Goes Here [/signinlocker]</span>', 'signinlocker') ?>
</p>
<p>
<?php _e('Thats it! Save your post and see the locker on your site! ', 'signinlocker'); ?>
</p>
<p class='onp-img'>
<img src='<?php echo'https://cconp.s3.amazonaws.com/bizpanda/signin-locker/help/signinlocker.png' ?>' />
</p>
</div>

View File

@@ -0,0 +1,134 @@
<?php
global $bizpanda;
$lang = $bizpanda->options['lang'];
require_once OPANDA_BIZPANDA_DIR . '/admin/includes/plugins.php';
$optinpandaUrl = OPanda_Plugins::getPremiumUrl('optinpanda');
$sociallockerUrl = OPanda_Plugins::getPremiumUrl('sociallocker');
?>
<div class="onp-help-section">
<h1><?php _e('Sign-In Locker', 'signinlocker'); ?></h1>
<?php if ( BizPanda::hasPlugin('sociallocker') ) { ?>
<p>
<?php printf( __('Sign-In Locker works the same way as the <a href="%s">Social Locker</a> but instead of liking/sharing it asks the user to sign in through social networks. Concurrently it can perform some social actions.', 'signinlocker'), opanda_get_help_url('what-is-social-locker') ) ?>
</p>
<?php } elseif( BizPanda::hasPlugin('optinpanda' ) ) { ?>
<p>
<?php printf( __('Sign-In Locker works the same way as the <a href="%s">Email Locker</a> but instead of entering an email it asks the user to sign in through social networks. Concurrently it can perform some social actions.', 'signinlocker'), opanda_get_help_url('what-is-email-locker') ) ?>
</p>
<?php } ?>
<p><strong><?php _e('What can you do with the Sign-In Locker', 'signinlocker') ?></strong></p>
<p>
<?php _e('When the user signs in, the social network grants access to the user\'s contact data and allow additionally perform the following actions:', 'signinlocker') ?>
</p>
<ul style="margin-bottom: 20px;">
<li><?php _e('Register the user on our website (create an account)', 'signinlocker') ?></li>
<?php if ( !BizPanda::hasPlugin('optinpanda') ) { ?>
<li><?php printf( __('Subscribe the user to your mailing list (<a href="%s" target="_blank">Opt-In Panda</a> required)', 'signinlocker'), $optinpandaUrl ) ?></li>
<?php } else { ?>
<li><?php _e('Subscribe the user to your mailing list.', 'signinlocker') ?></li>
<?php } ?>
<?php if ( !BizPanda::hasPlugin('sociallocker') ) { ?>
<li><?php printf( __('Publish a tweet from behalf of the user (<a href="%s" target="_blank">Social Locker</a> required)', 'signinlocker'), $sociallockerUrl ) ?></li>
<li><?php printf( __('Subscribe the user to your account on Twitter (<a href="%s" target="_blank">Social Locker</a> required)', 'signinlocker'), $sociallockerUrl ) ?></li>
<li><?php printf( __('Subscribe the user to your Youtube channel (<a href="%s" target="_blank">Social Locker</a> required)', 'signinlocker'), $sociallockerUrl ) ?></li>
<?php } else { ?>
<li><?php _e('Publish a tweet from behalf of the user', 'signinlocker') ?></li>
<li><?php _e('Subscribe the user to your account on Twitter (make the user a follower)', 'signinlocker') ?></li>
<li><?php _e('Subscribe the user to your Youtube channel', 'signinlocker') ?></li>
<?php } ?>
</ul>
<p><strong><?php _e('Know your audience') ?></strong></p>
<p><?php _e('Except the user\'s contact data, the Sign-In Locker also receives some personal data (name, profile url).') ?></p>
<p><?php _e('That allows you to know better your audinece and understand who is these people who visits your website. Also you can go and engage with them personally on their social pages on Facebook, Twitter, Google or LinkedIn.') ?></p>
<?php if ( BizPanda::hasPlugin('sociallocker') ) { ?>
<p><strong><?php _e('Comparing Sign-In Locker and Social Locker', 'signinlocker') ?></strong></p>
<p>
<?php _e('Although the Sign-In Locker brings more benefits per unlock, it has more lower conversion than Social Locker. Please check out the table below to learn more:', 'signinlocker') ?>
</p>
<table class="table">
<thead>
<tr>
<th>Paramters</th>
<th>Sing-In Locker</th>
<th>Social Locker</th>
</tr>
</thead>
<tbody>
<tr>
<td><?php _e('Benefits', 'signinlocker') ?></td>
<td><?php _e('More benefits per unlock. Can be configured to execute several actions per unlock.', 'signinlocker') ?></td>
<td><?php _e('Only one action has to be perfomed to unlock the content.', 'signinlocker') ?></td>
</tr>
<tr>
<td><?php _e('Conversion', 'signinlocker') ?></td>
<td><?php _e('More lower conversion due to the locker asks the user to authorize your social app and grant extra permissions.', 'signinlocker') ?></td>
<td><?php _e('Extremely high conversion which may reach up to 50%. All what the user has to make is to click on the social button.', 'signinlocker') ?></td>
</tr>
<tr>
<td><?php _e('Content', 'signinlocker') ?></td>
<td><?php _e('As asks the user to authorize your social app to read one\'s personal data, the content you provide should have more value.', 'signinlocker') ?></td>
<td><?php _e('You can lock practically any content. Giving a like is not hard.', 'signinlocker') ?></td>
</tr>
</tbody>
</table>
<?php } elseif( BizPanda::hasPlugin('optinpanda' ) ) { ?>
<p><strong><?php _e('Comparing Sign-In Locker and Email Locker', 'signinlocker') ?></strong></p>
<p>
<?php _e('Although the Sign-In Locker brings more benefits per unlock, it has more lower conversion than Email Locker. Please check out the table below to learn more:', 'signinlocker') ?>
</p>
<table class="table">
<thead>
<tr>
<th>Paramters</th>
<th>Sing-In Locker</th>
<th>Email Locker</th>
</tr>
</thead>
<tbody>
<tr>
<td><?php _e('Benefits', 'signinlocker') ?></td>
<td><?php _e('More benefits per unlock. Can be configured to execute several actions per unlock.', 'signinlocker') ?></td>
<td><?php _e('The user has to opt-in only to unlock the content.', 'signinlocker') ?></td>
</tr>
<tr>
<td><?php _e('Conversion', 'signinlocker') ?></td>
<td><?php _e('More lower conversion due to the locker asks the user to authorize your social app and grant extra permissions.', 'signinlocker') ?></td>
<td><?php _e('High conversion which may reach up to 40%.', 'signinlocker') ?></td>
</tr>
<tr>
<td><?php _e('Content', 'signinlocker') ?></td>
<td><?php _e('As asks the user to authorize your social app to read one\'s personal data, the content you provide should have more value.', 'signinlocker') ?></td>
<td><?php _e('You can lock practically any content.', 'signinlocker') ?></td>
</tr>
</tbody>
</table>
<?php } ?>
<p style="margin-top: 25px;">
<a href="<?php $manager->actionUrl('index', array( 'onp_sl_page' => 'usage-example-signin-locker' )) ?>" class="btn btn-default"><?php _e('Learn how to configure and use Sign-In Locker', 'signinlocker') ?><i class="fa fa-long-arrow-right"></i></a>
</p>
</div>

View File

@@ -0,0 +1,989 @@
<?php
/**
* The file contains a class to configure the metabox Social Options.
*
* Created via the Factory Metaboxes.
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2013, OnePress Ltd
*
* @package core
* @since 1.0.0
*/
/**
* The class configure the metabox Social Options.
*
* @since 1.0.0
*/
class OPanda_ConnectOptionsMetaBox extends FactoryMetaboxes321_FormMetabox
{
/**
* A visible title of the metabox.
*
* Inherited from the class FactoryMetabox.
* @link http://codex.wordpress.org/Function_Reference/add_meta_box
*
* @since 1.0.0
* @var string
*/
public $title;
/**
* A prefix that will be used for names of input fields in the form.
*
* Inherited from the class FactoryFormMetabox.
*
* @since 1.0.0
* @var string
*/
public $scope = 'opanda';
/**
* The priority within the context where the boxes should show ('high', 'core', 'default' or 'low').
*
* @link http://codex.wordpress.org/Function_Reference/add_meta_box
* Inherited from the class FactoryMetabox.
*
* @since 1.0.0
* @var string
*/
public $priority = 'core';
public $cssClass = 'factory-bootstrap-331';
public function __construct( $plugin ) {
parent::__construct( $plugin );
$this->title = __('Connect Options', 'signinlocker');
}
/**
* Configures a metabox.
*/
public function configure( $scripts, $styles) {
$styles->add( BIZPANDA_SIGNIN_LOCKER_URL . '/admin/assets/css/connect-options.050600.css');
$scripts->add( BIZPANDA_SIGNIN_LOCKER_URL . '/admin/assets/js/connect-options.050601.js');
do_action( 'opanda_connect_options_assets', $scripts, $styles );
}
/**
* Configures the connect buttons options.
*/
public function form( $form ) {
require_once OPANDA_BIZPANDA_DIR . '/admin/includes/plugins.php';
$options = array();
$options[] = array(
'type' => 'html',
'html' => '<div class="opanda-fullwidth opanda-hint">
<strong>'.__('How to setup', 'signinlocker').'</strong>: ' .
'<ol>' .
'<li>' . __('Select social networks which will be available to sign in.', 'signinlocker') .
'<li>' . __('For each social network, select actions which have to be performed to sign in.', 'signinlocker') .
'<li>' . __('Configure each selected action by clicking on its title.', 'signinlocker') .
'</ol>' .
'</div>'
);
$options[] = array(
'type' => 'html',
'html' => array( $this, 'showConnectButtonsControl' )
);
// leads options
$options[] = array(
'type' => 'div',
'id' => 'opanda-lead-options',
'cssClass' => 'opanda-connect-buttons-options opanda-off factory-fontawesome-320',
'items' => array(
array(
'type' => 'html',
'html' => $this->getOptionsHeaderHtml(
__('Action: Save Email', 'signinlocker'),
__('This action retrieves an email and some other personal data of the user and saves it in the database.', 'signinlocker')
)
),
array(
'type' => 'html',
'html' => array($this,'getLeadExplanationOption')
)
)
);
// subscription options
$subscription = array();
$subscription[] = array(
'type' => 'html',
'html' => $this->getOptionsHeaderHtml(
__('Action: Subscribe', 'signinlocker'),
__('This action allows to subscribe the user to the specified mailing list when one clicks on the Sign In button.', 'signinlocker')
)
);
require_once OPANDA_BIZPANDA_DIR . '/admin/includes/subscriptions.php';
if ( BizPanda::hasPlugin('optinpanda') ) {
$subscription[] = array(
'type' => 'html',
'html' => array($this, 'showSubscriptionService')
);
$serviceName = OPanda_SubscriptionServices::getCurrentName();
$serviceInfo = OPanda_SubscriptionServices::getCurrentServiceInfo();
if ( 'database' !== $serviceName && 'none' !== $serviceName ) {
$serviceName = OPanda_SubscriptionServices::getCurrentServiceInfo();
$manualList = isset( $serviceName['manualList'] ) ? $serviceName['manualList'] : false;
if ( $manualList ) {
$subscription[] = array(
'type' => 'textbox',
'name' => 'subscribe_list',
'title' => __('List', 'signinlocker'),
'hint' => __( 'Specify the list ID to add subscribers.', 'signinlocker' )
);
} else {
$subscription[] = array(
'type' => 'dropdown',
'name' => 'subscribe_list',
'data' => array(
'ajax' => true,
'url' => admin_url('admin-ajax.php'),
'data' => array(
'action' => 'opanda_get_subscrtiption_lists',
'opanda_service' => $serviceName
)
),
'empty' => __( '- empty -', 'signinlocker' ),
'title' => __('List', 'signinlocker'),
'hint' => __( 'Select the list to add subscribers.', 'signinlocker' )
);
}
}
$subscription[] = array(
'type' => 'dropdown',
'name' => 'subscribe_mode',
'hasGroups' => false,
'hasHints' => true,
'data' => OPanda_SubscriptionServices::getCurrentOptinModes( true ),
'title' => __('Opt-In Mode', 'signinlocker')
);
$subscription[] = array(
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'subscribe_name',
'title' => __('Require Name', 'signinlocker'),
'hint' => 'If On, requires to specify the name to unlock (only for the Email Form).'
);
$modes = OPanda_SubscriptionServices::getCurrentOptinModes();
if ( !isset( $serviceInfo['transactional'] ) || !$serviceInfo['transactional'] ) {
$choices = array(
'service' => array(
'value' => 'service',
'title' => sprintf( __('Through %s', 'emaillocker'), $serviceInfo['title'] ),
'hint' => sprintf( __('%s takes care about sending confirmation emails.', 'emaillocker'), $serviceInfo['title'] )
),
'wordpress' => array(
'value' => 'wordpress',
'title' => __('Through Wordpress', 'emaillocker'),
'hint' => 'Wordpress and installed plugins take care about sending confirmation emails. By default Wordpress utilizes an email delivery service of your web host (usually not reliable). Fortunately there is plenty of reliable services you can integrate easily (<a href="https://wordpress.org/plugins/sendgrid-email-delivery-simplified/" target="_blank">SendGrid</a>, <a href="https://wordpress.org/plugins/mailin/" target="_blank">SendinBlue</a>, <a href="https://wordpress.org/plugins/wpmandrill/" target="_blank">Mandrill</a>, <a href="https://wordpress.org/plugins/postmark-approved-wordpress-plugin/" target="_blank">Postmark</a>, <a href="https://wordpress.org/plugins/mailjet-for-wordpress/" target="_blank">Mailjet</a>, <a href="https://wordpress.org/plugins/wp-ses/" target="_blank">Amazon SES</a> and others).'
)
);
if ( !isset( $modes['quick'] ) ) {
unset( $choices['wordpress'] );
}
if ( !isset( $modes['double-optin'] ) && !isset( $modes['quick-double-optin'] ) ) {
unset( $choices['service'] );
}
$selectItems = array();
foreach ($choices as $choice) $selectItems[] = $choice;
$deliveryOption = array(
'type' => 'dropdown',
'name' => 'subscribe_delivery',
'hasGroups' => false,
'hasHints' => true,
'data' => $selectItems,
'title' => __('Send Confirmation', 'emaillocker')
);
$subscription[] = array(
'type' => 'div',
'id' => 'opanda-delivery-options',
'items' => array(
array( 'type' => 'separator' ),
$deliveryOption
)
);
}
$siteTitle = get_bloginfo('name');
$siteDescription = get_bloginfo('description');
$emailSubject = array(
'type' => 'textbox',
'name' => 'confirm_email_subject',
'title' => 'Subject',
'default' => __('Please confirm your email address', 'emaillocker')
);
$emailBody = array(
'type' => 'wp-editor',
'name' => 'confirm_email_body',
'title' => 'Text',
'default' => __('', 'emaillocker'),
'hint' => __('Use the shortcode <strong>[link]</strong> to insert the confirmation link.', 'emaillocker'),
'tinymce' => array(
'height' => 120
),
'layout' => array(
'hint-position' => 'left'
),
'default' => sprintf( __('To confirm your email address and unlock the content, please click the link below:<br />[link]<br/><br/>-<br/>%s<br/>%s', 'emaillocker'), $siteTitle, $siteDescription )
);
$subscription[] = array(
'type' => 'div',
'id' => 'opanda-confirmation-email',
'items' => array(
array( 'type' => 'separator' ),
array( 'type' => 'html', 'html' => array($this, 'showConfirmationMessageHeader') ),
$emailSubject,
$emailBody
)
);
$subscription[] = array(
'type' => 'separator'
);
$subscription[] = array(
'type' => 'textbox',
'name' => 'subscribe_before_form',
'title' => __('Before Form', 'signinlocker'),
'hint' => __('The text before the form.', 'signinlocker'),
'default' => __('Cannot sign in via social networks? Enter your email manually.', 'signinlocker')
);
$subscription[] = array(
'type' => 'textbox',
'name' => 'subscribe_button_text',
'title' => __('Buttton Text', 'signinlocker'),
'hint' => __('The text on the button.', 'signinlocker'),
'default' => __('sign in to unlock', 'signinlocker')
);
$subscription[] = array(
'type' => 'textbox',
'name' => 'subscribe_after_button',
'title' => __('After Buttton', 'signinlocker'),
'hint' => __('The text below the button. Guarantee something.', 'signinlocker'),
'default' => __('Your email address is 100% safe from spam!', 'signinlocker')
);
} else {
$subscription[] = array(
'type' => 'html',
'html' => array($this, 'getSubscriptionExplanationOption')
);
}
$options[] = array(
'type' => 'div',
'id' => 'opanda-subscribe-options',
'cssClass' => 'opanda-connect-buttons-options opanda-off factory-fontawesome-320',
'items' => $subscription
);
// signup options
$rolesItems = array();
foreach (get_editable_roles() as $roleName => $roleInfo) {
$rolesItems[] = array($roleName, $roleName);
}
$options[] = array(
'type' => 'div',
'id' => 'opanda-signup-options',
'cssClass' => 'opanda-connect-buttons-options opanda-off factory-fontawesome-320',
'items' => array(
array(
'type' => 'html',
'html' => $this->getOptionsHeaderHtml(
__('Action: Create Account', 'signinlocker'),
__('This action creates an account for a user on your website and makes one logged in.', 'signinlocker')
)
),
array(
'type' => 'html',
'html' => array($this,'getSignupRoleOption')
),
array(
'type' => 'html',
'html' => array($this,'getSignupWelcomeOption')
),
)
);
// twitter follow options
$options[] = array(
'type' => 'div',
'id' => 'opanda-twitter-follow-options',
'cssClass' => 'opanda-connect-buttons-options opanda-off',
'items' => array(
array(
'type' => 'html',
'html' => $this->getOptionsHeaderHtml(
__('Twitter Action: Follow', 'signinlocker'),
__('This action makes the user following you on Twitter after clicking the Sign In button.', 'signinlocker')
)
),
array(
'type' => 'textbox',
'title' => __('User to follow', 'signinlocker'),
'hint' => __('Set a user screen name to follow (for example, <a href="http://twitter.com/byonepress" target="_blank">byonepress</a>)', 'signinlocker'),
'name' => 'twitter_follow_user'
),
array(
'type' => 'checkbox',
'way' => 'buttons',
'title' => __('Notifications', 'signinlocker'),
'hint' => __('If On, the follower will get notifications about new tweets (usually via sms).', 'signinlocker'),
'name' => 'twitter_follow_notifications',
'default' => false
)
)
);
// twitter tweet options
$options[] = array(
'type' => 'div',
'id' => 'opanda-twitter-tweet-options',
'cssClass' => 'opanda-connect-buttons-options opanda-off',
'items' => array(
array(
'type' => 'html',
'html' => $this->getOptionsHeaderHtml(
__('Twitter Action: Tweet', 'signinlocker'),
__('Sends the specified tweet below from behalf of the user after signing in.', 'signinlocker')
)
),
array(
'type' => 'textarea',
'title' => __('Tweet', 'signinlocker'),
'hint' => __('Type a message to tweet. It may include any URL.', 'signinlocker'),
'name' => 'twitter_tweet_message'
),
)
);
// youtube subscribe options
$options[] = array(
'type' => 'div',
'id' => 'opanda-google-youtube-subscribe-options',
'cssClass' => 'opanda-connect-buttons-options opanda-off',
'items' => array(
array(
'type' => 'html',
'html' => $this->getOptionsHeaderHtml(
__('Google Action: Subscribe To Youtube Channel', 'signinlocker'),
__('This action subscribers the user to the specified Youtube channel.', 'signinlocker')
)
),
array(
'type' => 'textbox',
'title' => __('Youtube Channel ID', 'signinlocker'),
'hint' => __('Set a channel ID to subscribe (for example, <a href="http://www.youtube.com/channel/UCANLZYMidaCbLQFWXBC95Jg" target="_blank">UCANLZYMidaCbLQFWXBC95Jg</a>).', 'signinlocker'),
'name' => 'google_youtube_channel_id'
)
)
);
// hidden files to save active buttons and their actions
$options[] = array(
'type' => 'hidden',
'name' => 'connect_buttons',
'default' => 'facebook,twitter,google,email'
);
$options[] = array(
'type' => 'hidden',
'name' => 'facebook_actions',
'default' => 'lead'
);
$options[] = array(
'type' => 'hidden',
'name' => 'twitter_actions',
'default' => 'lead'
);
$options[] = array(
'type' => 'hidden',
'name' => 'google_actions',
'default' => 'lead'
);
$options[] = array(
'type' => 'hidden',
'name' => 'linkedin_actions',
'default' => 'lead'
);
$options[] = array(
'type' => 'hidden',
'name' => 'email_actions',
'default' => 'lead'
);
$options[] = array(
'type' => 'hidden',
'name' => 'catch_leads',
'default' => true
);
$options = apply_filters('opanda_connect_options', $options);
$form->add( $options );
}
public function getOptionsHeaderHtml( $title, $description = null ) {
$title = '<strong>' . $title . '</strong>';
$description = empty( $description ) ? '' : '<p>' . $description . '</p>';
return '<div class="form-group opanda-header"><label class="col-sm-2 control-label"></label><div class="control-group col-sm-10"><div class="opanda-inner-wrap">' . $title . $description . '</div></div></div>';
}
public function getLeadExplanationOption() {
$url = OPanda_Plugins::getPremiumUrl('optinpanda');
?>
<div class="form-group" style="margin-bottom: 10px;">
<label class="col-sm-2 control-label">
<?php _e('How to use', 'signinlocker') ?>
</label>
<div class="control-group col-sm-10">
<p style="padding-top: 3px;">
<?php printf( __('<a href="%s" class="button" target="_blank">See emails</a> of users who already signed-up or <a href="%s" class="button" target="_blank">export emails</a> in the CSV format.', 'signinlocker'), admin_url('edit.php?post_type=opanda-item&page=leads-bizpanda'), admin_url('admin.php?page=leads-bizpanda&action=export') ) ?>
</p>
<?php ?>
<?php if ( !BizPanda::hasPlugin('optinpanda') ) { ?>
<p>
<?php printf( __('Install the plugin <a href="%s" target="_blank">Opt-In Panda</a> to subscribe automatically all the signed-up users to your mailing list. Supports the most services and plugins: Aweber, MailChimp, GetResponse, MyMail, MailPoet, K-news and more.'), $url ) ?>
</p>
<?php } ?>
<?php
?>
</div>
</div>
<?php
}
public function getSubscriptionExplanationOption() {
$url = OPanda_Plugins::getPremiumUrl('optinpanda', 'co-subscribe-action');
?>
<div class="form-group" style="margin-bottom: 10px;">
<label class="col-sm-2 control-label">
<?php _e('How to use', 'signinlocker') ?>
</label>
<div class="control-group col-sm-10">
<p>
<?php printf( __('Install the plugin <a href="%s" target="_blank">Opt-In Panda</a> to subscribe automatically all the signed-up users to your mailing list. Supports the most services and plugins: Aweber, MailChimp, GetResponse, MyMail, MailPoet, K-news and more.'), $url ) ?>
</p>
</div>
</div>
<?php
}
public function getSignupRoleOption() {
$defaultRole = get_option('default_role');
?>
<div class="form-group" style="margin-bottom: 10px;">
<label class="col-sm-2 control-label">
<?php _e('New User Role', 'signinlocker') ?>
</label>
<div class="control-group col-sm-10">
<p style="padding-top: 7px;">
<?php printf( __('All new users will be assigned to the role <strong>%s</strong> (<a href="%s" target="_blank">change</a>).', 'signinlocker' ), $defaultRole, admin_url('options-general.php') ) ?>
</p>
</div>
</div>
<?php
}
public function getSignupWelcomeOption() {
$defaultRole = get_option('default_role');
?>
<div class="form-group">
<label class="col-sm-2 control-label">
<?php _e('Welcome Email', 'signinlocker') ?>
</label>
<div class="control-group col-sm-10">
<p style="padding-top: 7px;">
<?php printf( __('By default new users receive the standard wordpress welcome message. You can change it if you want.<br /><a href="https://wordpress.org/plugins/search.php?q=Welcome+Email" target="_blank">Click here</a> to select a free plugin to customize the welcome email.', 'signinlocker' ), $defaultRole, admin_url('options-general.php') ) ?>
</p>
</div>
</div>
<?php
}
// ------------------------------------------------------------------------------
// Shows the control to manage the Connect Buttons
// ------------------------------------------------------------------------------
public function showConfirmationMessageHeader(){
?>
<div class="form-group">
<label class="col-sm-2 control-label"></label>
<div class="control-group controls col-sm-10">
<?php _e('The confirmation email to send:', 'emaillocker' ) ?>
</div>
</div>
<?php
}
/**
* Shows the control to manage the connect buttons.
*
* @since 1.0.0
* @return string
*/
public function showConnectButtonsControl() {
$buttons = array(
'facebook' => array(
'title' => __('Facebook', 'signinlocker'),
'errors' => array($this, 'getFacebookErrors'),
'actions' => array(
'lead' => array(
'on' => true,
'title' => __('Save Email', 'signinlocker'),
'always' => true
),
'subscribe' => array(
'title' => __('Subscribe', 'signinlocker')
),
'signup' => array(
'on' => true,
'title' => __('Create Account', 'signinlocker')
)
)
),
'twitter' => array(
'title' => __('Twitter', 'signinlocker'),
'errors' => array($this, 'getTwitterErrors'),
'actions' => array(
'lead' => array(
'on' => true,
'title' => __('Save Email', 'signinlocker'),
'always' => true
),
'subscribe' => array(
'title' => __('Subscribe', 'signinlocker')
),
'signup' => array(
'on' => true,
'title' => __('Create Account', 'signinlocker')
),
'follow' => array(
'title' => __('Follow', 'signinlocker'),
'type' => 'social'
),
'tweet' => array(
'title' => __('Tweet', 'signinlocker'),
'type' => 'social'
)
)
),
'google' => array(
'title' => __('Google', 'signinlocker'),
'errors' => array($this, 'getGoogleErrors'),
'actions' => array(
'lead' => array(
'on' => true,
'title' => __('Save Email', 'signinlocker'),
'always' => true
),
'subscribe' => array(
'title' => __('Subscribe', 'signinlocker')
),
'signup' => array(
'on' => true,
'title' => __('Create Account', 'signinlocker')
),
'youtube-subscribe' => array(
'title' => __('Subscribe (YouTube)', 'signinlocker'),
'type' => 'social'
)
)
),
'linkedin' => array(
'title' => __('LinkedIn', 'signinlocker'),
'errors' => array($this, 'getLinkedInErrors'),
'actions' => array(
'lead' => array(
'on' => true,
'title' => __('Save Email', 'signinlocker'),
'always' => true
),
'subscribe' => array(
'title' => __('Subscribe', 'signinlocker')
),
'signup' => array(
'on' => true,
'title' => __('Create Account', 'signinlocker')
)
)
),
'email' => array(
'title' => __('Email Form', 'signinlocker'),
'errors' => array($this, 'getEmailFormErrors'),
'actions' => array(
'lead' => array(
'on' => true,
'title' => __('Save Email', 'signinlocker'),
'always' => true
),
'subscribe' => array(
'title' => __('Subscribe', 'signinlocker')
),
'signup' => array(
'on' => true,
'title' => __('Create Account', 'signinlocker')
)
)
)
);
if ( BizPanda::hasPlugin('optinpanda') ) {
foreach( $buttons as $buttonName => $buttonData ) {
$buttons[$buttonName]['actions']['subscribe']['on'] = true;
}
} else {
$url = OPanda_Plugins::getPremiumUrl('optinpanda', 'co-subscribe-action');
foreach( $buttons as $buttonName => $buttonData ) {
$buttons[$buttonName]['actions']['subscribe']['error'] = sprintf( __('To enable this action, please install the plugin Opt-In Panda which provides subscription features. <a href="%s" target="_blank">Click here to learn more</a>.', 'signinlocker'), $url );
}
}
if ( BizPanda::hasPlugin('sociallocker') ) {
foreach( $buttons as $buttonName => $buttonData ) {
foreach( $buttons[$buttonName]['actions'] as $actionName => $actionData ) {
if ( isset( $actionData['type'] ) && 'social' === $actionData['type'] ) {
$buttons[$buttonName]['actions'][$actionName]['on'] = true;
}
}
}
} else {
$url = OPanda_Plugins::getPremiumUrl('sociallocker', 'co-social-actions');
foreach( $buttons as $buttonName => $buttonData ) {
foreach( $buttons[$buttonName]['actions'] as $actionName => $actionData ) {
if ( isset( $actionData['type'] ) && 'social' === $actionData['type'] ) {
$buttons[$buttonName]['actions'][$actionName]['error'] = sprintf( __('To enable this action, please install the Social Locker plugin which provides social features. <a href="%s" target="_blank">Click here to learn more</a>.', 'signinlocker'), $url );
}
}
}
}
if ( BizPanda::isSinglePlugin() && BizPanda::hasPlugin('optinpanda') ) {
} else {
if ( !BizPanda::hasFeature('sociallocker-premium') ) {
unset( $buttons['twitter']['actions']['follow']['on'] );
$buttons['twitter']['actions']['follow']['error'] = opanda_get_premium_note( false, 'co-follow-action' );
unset( $buttons['twitter']['actions']['tweet']['on'] );
$buttons['twitter']['actions']['tweet']['error'] = opanda_get_premium_note( false, 'co-follow-action' );
unset( $buttons['google']['actions']['youtube-subscribe']['on'] );
$buttons['google']['actions']['youtube-subscribe']['error'] = opanda_get_premium_note( false, 'co-youtube-action' );
}
}
$buttons = apply_filters('opanda_connect_buttons_options', $buttons);
$commonActions = array('subscribe', 'signup', 'lead');
// prints social proxy urls for the buttons
$useOwnApps = opanda_get_option('own_apps_to_signin', false);
$socialProxyItems = [
'facebook' => [
'clientId' => opanda_get_option('facebook_app_id', false),
'clientSecret' => opanda_get_option('facebook_app_secret', false)
],
'google' => [
'clientId' => opanda_get_option('google_client_id', false),
'clientSecret' => opanda_get_option('google_client_secret', false)
],
'twitter' => [
'clientId' => opanda_get_option('twitter_signin_app_consumer_key', false),
'clientSecret' => opanda_get_option('twitter_signin_app_consumer_secret', false)
],
'linkedin' => [
'clientId' => opanda_get_option('linkedin_client_id', false),
'clientSecret' => opanda_get_option('linkedin_client_secret', false)
],
];
?>
<script>
<?php foreach( $socialProxyItems as $itemName => $itemValues ) { ?>
window.<?php echo $itemName ?>_social_proxy = <?php if ( $useOwnApps && !empty($itemValues['clientId'] ) && !empty( $itemValues['clientSecret']) ) { ?>{
'url': '<?php echo opanda_local_proxy_url() ?>',
'paramPrefix': 'opanda'
}<?php } else { ?>{
'endpoint': '<?php echo opanda_remote_social_proxy_url() ?>',
'paramPrefix': null
}<?php } ?>;
<?php } ?>
</script>
<script>
window.res_signin_email_form_text = "<?php echo addslashes( get_option('opanda_res_signin_email_form_text', '') ) ?>";
window.res_signin_email_button = "<?php echo addslashes( get_option('opanda_res_signin_email_button', '') ) ?>";
window.res_signin_after_email_button = "<?php echo addslashes( get_option('opanda_res_signin_after_email_button', '') ) ?>";
</script>
<div class="opanda-connect-buttons factory-fontawesome-320">
<?php foreach( $buttons as $name => $button ) { ?>
<?php
$errors = isset( $button['errors'] ) ? call_user_func( $button['errors'] ) : null;
$errorName = isset( $errors['name'] ) ? $errors['name'] : 'noname';
$errorIcon = isset( $errors['icon'] ) ? $errors['icon'] : 'fa-exclamation-triangle';
$errorText = isset( $errors['text'] ) ? $errors['text'] : $errors;
?>
<div class="opanda-button opanda-button-<?php echo $name ?> opanda-off <?php if ( $errors ) { echo 'opanda-has-error'; } ?>" data-name="<?php echo $name ?>">
<div class="opanda-inner-wrap">
<label class="opanda-button-title" for="opanda-button-<?php echo $name ?>-activated">
<?php if ( $errors ) { ?>
<span class="opanda-error opanda-error-<?php echo $errorName ?>">
<i class="fa <?php echo $errorIcon ?>"></i>
<div class='opanda-error-text'><?php echo $errorText ?></div>
</span>
<?php } else { ?>
<span class='opanda-checkbox'>
<input type="checkbox" value="<?php echo $name ?>" id="opanda-button-<?php echo $name ?>-activated" />
</span>
<?php } ?>
<span><?php echo $button['title'] ?></span>
</label>
<ul class='opanda-actions'>
<?php foreach( $button['actions'] as $actionName => $actionData ) { ?>
<?php if ( isset( $button['actions'][$actionName]['on'] ) ) { ?>
<?php
$actionTitle = $actionData['title'];
?>
<?php $isCommon = in_array( $actionName, $commonActions ); ?>
<li class='opanda-action opanda-action-<?php echo $actionName ?>'>
<span>
<input
type="checkbox"
value="1"
data-common="<?php echo ( $isCommon ? '1' : '0' ); ?>"
data-button="<?php echo $name ?>"
data-action="<?php echo $actionName ?>"
disabled="disabled" />
</span>
<a href="#" class="opanda-action-link" data-common="<?php echo ( $isCommon ? '1' : '0' ); ?>" data-button="<?php echo $name ?>" data-action="<?php echo $actionName ?>"><?php echo $actionTitle ?></a>
</li>
<?php } ?>
<?php } ?>
</ul>
<ul class='opanda-actions opanda-actions-disabled'>
<?php foreach( $button['actions'] as $actionName => $actionData ) { ?>
<?php if ( !isset( $button['actions'][$actionName]['on'] ) ) { ?>
<?php
$actionTitle = $actionData['title'];
?>
<?php $isCommon = in_array( $actionName, $commonActions ); ?>
<li class='opanda-action opanda-action-disabled opanda-action-<?php echo $actionName ?>'>
<span class="opanda-error-wrap">
<input type="checkbox" disabled="disabled" value="1" />
<span class='opanda-error-text'><?php echo $actionData['error'] ?></span>
<a href="#" class="opanda-action-link" data-common="<?php echo ( $isCommon ? '1' : '0' ); ?>" data-button="<?php echo $name ?>" data-action="<?php echo $actionName ?>"><?php echo $actionTitle ?></a>
</span>
</li>
<?php } ?>
<?php } ?>
</ul>
</div>
</div>
<?php } ?>
</div>
<?php
}
/**
* Returns errors of the Facebook Connect button.
*
* @since 1.0.0
* @return string
*/
public function getFacebookErrors() {
return false;
/*
return [
'text' => false
];
*/
}
/**
* Returns errors of the Twitter Connect button.
*
* @since 1.0.0
* @return string
*/
public function getTwitterErrors() {
return false;
}
/**
* Returns errors of the Facebook Connect button.
*
* @since 1.0.0
* @return string
*/
public function getGoogleErrors() {
return false;
}
/**
* Returns errors of the LinkedIn Connect button.
*
* @since 1.0.0
* @return string
*/
public function getLinkedInErrors() {
return false;
}
/**
* Returns errors for Email Form.
*
* @since 1.0.0
* @return string
*/
public function getEmailFormErrors() {
return false;
}
public function showSubscriptionService() {
$info = OPanda_SubscriptionServices::getCurrentServiceInfo();
$serviceName = ( empty( $info ) ) ? 'none' : $info['name'];
?>
<div class="form-group">
<label class="col-sm-2 control-label"></label>
<div class="control-group controls col-sm-10">
<?php if ( 'database' === $serviceName ) { ?>
<?php printf( __('The emails will be saved in the <a href="%s" target="_blank">local database</a> because you haven\'t selected a mailing service', 'signinlocker'), opanda_get_subscribers_url() ) ?>
<?php } else { ?>
<?php printf( __('You selected <strong>%s</strong> as your mailing service', 'signinlocker'), $info['title'] ) ?>
<?php } ?>
(<a href="<?php echo opanda_get_settings_url('subscription') ?>" target="_blank"><?php _e('change', 'signinlocker') ?></a>).
</div>
</div>
<?php
}
/**
* Removes the action 'lead' from options of the buttons because it's a virtual action.
*/
public function onSavingForm( $postId ) {
$buttons = array('facebook', 'twitter', 'google', 'linkedin', 'email');
foreach( $buttons as $buttonName ) {
$strActions = isset( $_POST['opanda_' . $buttonName . '_actions'] )
? $_POST['opanda_' . $buttonName . '_actions']
: '';
$rawActions = explode(',', $strActions);
$filteredActions = array();
foreach( $rawActions as $action ) {
if ( 'lead' == $action ) continue;
$filteredActions[] = $action;
}
$_POST['opanda_' . $buttonName . '_actions'] = implode(',', $filteredActions);
}
}
}
FactoryMetaboxes321::register('OPanda_ConnectOptionsMetaBox', $bizpanda);

View File

@@ -0,0 +1,134 @@
<?php
class OPanda_SignInLocker_Bounces_StatsTable extends OPanda_StatsTable {
public function getColumns() {
return array(
'index' => array(
'title' => ''
),
'title' => array(
'title' => __('Post Title', 'signinlocker')
),
'impress' => array(
'title' => __('Impressions', 'signinlocker'),
'highlight' => true,
'cssClass' => 'opanda-col-number'
),
'users' => array(
'title' => __('Visitors Who', 'signinlocker'),
'cssClass' => 'opanda-col-common',
'columns' => array(
/*
'ignored' => array(
'title' => __('Ignored Locker', 'signinlocker'),
'hint' => __('The number of visitors who viewed the locker but didn\'t try to interact with the one (no clicks on any buttons).', 'signinlocker'),
'cssClass' => 'opanda-col-number'
),*/
'errors' => array(
'title' => __('Faced Errors', 'signinlocker'),
'hint' => __('Visitors who faced with any errors and were not able to unlock the content. This value normally should be equal 0. If not, please check settings of your locker or contact OnePress support.', 'signinlocker'),
'cssClass' => 'opanda-col-number'
),
'social-fails' => array(
'title' => __('Declined Social Apps', 'signinlocker'),
'hint' => __('Visitors who refused to authorize of your social apps. If you think this value is too large, try to set less social actions to be performed on signing in through social networks.', 'signinlocker'),
'cssClass' => 'opanda-col-number'
)
)
)
);
}
public function columnIgnored( $row ) {
if ( !isset( $row['impress'] ) ) $row['impress'] = 0;
if ( !isset( $row['interaction'] ) ) $row['interaction'] = 0;
$diff = $row['impress'] - $row['interaction'];
if ( $diff < 0 ) $diff = 0;
echo $diff;
}
public function columnErrors( $row ) {
if ( !isset( $row['error'] ) ) $row['error'] = 0;
echo $row['error'];
}
public function columnNotConfirmed( $row ) {
if ( !isset( $row['email-received'] ) ) $row['email-received'] = 0;
if ( !isset( $row['email-confirmed'] ) ) $row['email-confirmed'] = 0;
$diff = $row['email-received'] - $row['email-confirmed'];
if ( $diff < 0 ) $diff = 0;
echo $diff;
}
public function columnSocialFails( $row ) {
if ( !isset( $row['social-app-declined'] ) ) $row['social-app-declined'] = 0;
echo $row['social-app-declined'];
}
}
class OPanda_SignInLocker_Bounces_StatsChart extends OPanda_StatsChart {
public $type = 'column';
public function getFields() {
return array(
'aggregate_date' => array(
'title' => __('Date')
),
/*
'ignored' => array(
'title' => __('Who Ignored Locker', 'signinlocker'),
'cssClass' => 'opanda-col-number',
'color' => '#cccccc'
),*/
'errors' => array(
'title' => __('Who Faced Errors', 'signinlocker'),
'cssClass' => 'opanda-col-number',
'color' => '#F97D81'
),
'social-fails' => array(
'title' => __('Who Declined Social Apps', 'signinlocker'),
'cssClass' => 'opanda-col-number',
'color' => '#29264E'
)
);
}
public function fieldIgnored( $row ) {
if ( !isset( $row['impress'] ) ) $row['impress'] = 0;
if ( !isset( $row['interaction'] ) ) $row['interaction'] = 0;
$diff = $row['impress'] - $row['interaction'];
if ( $diff < 0 ) $diff = 0;
return $diff;
}
public function fieldErrors( $row ) {
if ( !isset( $row['error'] ) ) $row['error'] = 0;
return $row['error'];
}
public function fieldNotConfirmed( $row ) {
if ( !isset( $row['email-received'] ) ) $row['email-received'] = 0;
if ( !isset( $row['email-confirmed'] ) ) $row['email-confirmed'] = 0;
$diff = $row['email-received'] - $row['email-confirmed'];
if ( $diff < 0 ) $diff = 0;
return $diff;
}
public function fieldSocialFails( $row ) {
if ( !isset( $row['social-app-declined'] ) ) $row['social-app-declined'] = 0;
return $row['social-app-declined'];
}
}

View File

@@ -0,0 +1,77 @@
<?php
class OPanda_SignInLocker_Channels_StatsTable extends OPanda_StatsTable {
public function getColumns() {
return array(
'index' => array(
'title' => ''
),
'title' => array(
'title' => __('Post Title', 'signinlocker')
),
'unlock' => array(
'title' => __('Number of Unlocks', 'signinlocker'),
'hint' => __('The number of unlocks made by visitors.', 'signinlocker'),
'highlight' => true,
'cssClass' => 'opanda-col-number'
),
'unlock-via-form' => array(
'title' => __('Via Opt-In Form'),
'cssClass' => 'opanda-col-number'
),
'unlock-via-facebook' => array(
'title' => __('Via Facebook'),
'cssClass' => 'opanda-col-number'
),
'unlock-via-twitter' => array(
'title' => __('Via Twitter'),
'cssClass' => 'opanda-col-number'
),
'unlock-via-google' => array(
'title' => __('Via Google'),
'cssClass' => 'opanda-col-number'
),
'unlock-via-linkedin' => array(
'title' => __('Via LinkedIn'),
'cssClass' => 'opanda-col-number'
)
);
}
}
class OPanda_SignInLocker_Channels_StatsChart extends OPanda_StatsChart {
public $type = 'line';
public function getFields() {
return array(
'aggregate_date' => array(
'title' => __('Date')
),
'unlock-via-form' => array(
'title' => __('Via Opt-In Form'),
'color' => '#31ccab'
),
'unlock-via-facebook' => array(
'title' => __('Via Facebook'),
'color' => '#7089be'
),
'unlock-via-twitter' => array(
'title' => __('Via Twitter'),
'color' => '#3ab9e9'
),
'unlock-via-google' => array(
'title' => __('Via Google'),
'color' => '#e26f61'
),
'unlock-via-linkedin' => array(
'title' => __('Via LinkedIn'),
'color' => '#006080'
)
);
}
}

View File

@@ -0,0 +1,134 @@
<?php
class OPanda_SignInLocker_Profits_StatsTable extends OPanda_StatsTable {
public function getColumns() {
$columns = array(
'index' => array(
'title' => ''
),
'title' => array(
'title' => __('Post Title', 'signinlocker')
),
'unlock' => array(
'title' => __('Unlocks', 'signinlocker'),
'hint' => __('The number of unlocks made by visitors.', 'signinlocker'),
'highlight' => true,
'cssClass' => 'opanda-col-number'
)
);
$columns['leads'] = array(
'title' => __('Leads', 'signinlocker'),
'hint' => __('The number of new leads collected via the locker.', 'signinlocker'),
'cssClass' => 'opanda-col-number'
);
$columns['account-registered'] = array(
'title' => __('Users Registered', 'signinlocker'),
'hint' => __('The number of new accounts created via the locker.', 'signinlocker'),
'cssClass' => 'opanda-col-number',
'prefix' => '+'
);
if ( BizPanda::hasPlugin('sociallocker') ) {
$columns['got-twitter-follower'] = array(
'title' => __('Twitter Followers', 'signinlocker'),
'hint' => __('The number of new followers attracted via the locker.', 'signinlocker'),
'cssClass' => 'opanda-col-number',
'prefix' => '+'
);
$columns['tweet-posted'] = array(
'title' => __('Tweets', 'signinlocker'),
'hint' => __('The number of new tweets posted via the locker.', 'signinlocker'),
'cssClass' => 'opanda-col-number',
'prefix' => '+'
);
$columns['got-youtube-subscriber'] = array(
'title' => __('Youtube Subscribers', 'signinlocker'),
'hint' => __('The number of new subscribers attracted via the locker.', 'signinlocker'),
'cssClass' => 'opanda-col-number',
'prefix' => '+'
);
/*
$columns['got-linkedin-follower'] = array(
'title' => __('LinkedIn Followers', 'signinlocker'),
'hint' => __('The number of new followers attracted via the locker.', 'signinlocker'),
'cssClass' => 'opanda-col-number',
'prefix' => '+'
);
*/
}
return $columns;
}
public function columnLeads( $row ) {
if ( !isset( $row['email-received'] ) ) $row['email-received'] = 0;
if ( $row['email-received'] > 0 ) echo '+';
echo $row['email-received'];
}
}
class OPanda_SignInLocker_Profits_StatsChart extends OPanda_StatsChart {
public $type = 'line';
public function getFields() {
$fields = array();
$fields['aggregate_date'] = array(
'title' => __('Date')
);
if ( BizPanda::hasPlugin('optinpanda') ) {
$fields['got-twitter-follower'] = array(
'title' => __('Emails', 'signinlocker'),
'color' => '#FFCC66'
);
}
$fields['leads'] = array(
'title' => __('Leads Collected', 'signinlocker'),
'color' => '#FFCC66'
);
$fields['account-registered'] = array(
'title' => __('Users Registered', 'signinlocker'),
'color' => '#336699'
);
if ( BizPanda::hasPlugin('sociallocker') ) {
$fields['tweet-posted'] = array(
'title' => __('Twitter Tweets', 'signinlocker'),
'color' => '#3bb4ea'
);
$fields['got-twitter-follower'] = array(
'title' => __('Twitter Followers', 'signinlocker'),
'color' => '#1e92c9'
);
$fields['got-youtube-subscriber'] = array(
'title' => __('Youtube Subscribers', 'signinlocker'),
'color' => '#ba5145'
);
/*
$fields['got-linkedin-follower'] = array(
'title' => __('LinkedIn Followers', 'signinlocker'),
'color' => '#006080'
);
*/
}
return $fields;
}
}

View File

@@ -0,0 +1,59 @@
<?php
class OPanda_SignInLocker_Skips_StatsTable extends OPanda_StatsTable {
public function getColumns() {
return array(
'index' => array(
'title' => ''
),
'title' => array(
'title' => __('Post Title', 'signinlocker')
),
'unlock' => array(
'title' => __('Number of Unlocks', 'signinlocker'),
'hint' => __('The number of unlocks made by visitors.', 'signinlocker'),
'highlight' => true,
'cssClass' => 'opanda-col-number'
),
'skip-via-timer' => array(
'title' => __('Skipped by Timer'),
'cssClass' => 'opanda-col-number'
),
'skip-via-cross' => array(
'title' => __('Skipped by Close Icon'),
'cssClass' => 'opanda-col-number'
)
);
}
}
class OPanda_SignInLocker_Skips_StatsChart extends OPanda_StatsChart {
public $type = 'column';
public function getFields() {
return array(
'aggregate_date' => array(
'title' => __('Date')
),
'unlock' => array(
'title' => __('Number of Unlocks', 'signinlocker'),
'color' => '#0074a2'
),
'skip-via-timer' => array(
'title' => __('Skipped by Timer'),
'color' => '#333333'
),
'skip-via-cross' => array(
'title' => __('Skipped by Close Icon'),
'color' => '#dddddd'
)
);
}
}

View File

@@ -0,0 +1,51 @@
<?php
class OPanda_SignInLocker_Summary_StatsTable extends OPanda_StatsTable {
public function getColumns() {
return array(
'index' => array(
'title' => ''
),
'title' => array(
'title' => __('Post Title', 'signinlocker')
),
'impress' => array(
'title' => __('Impressions', 'signinlocker'),
'cssClass' => 'opanda-col-number'
),
'unlock' => array(
'title' => __('Number of Unlocks', 'signinlocker'),
'hint' => __('The number of unlocks made by visitors.', 'signinlocker'),
'highlight' => true,
'cssClass' => 'opanda-col-number'
),
'conversion' => array(
'title' => __('Conversion', 'signinlocker'),
'hint' => __('The ratio of the number of unlocks to impressions, in percentage.', 'signinlocker'),
'cssClass' => 'opanda-col-number'
)
);
}
}
class OPanda_SignInLocker_Summary_StatsChart extends OPanda_StatsChart {
public function getSelectors() {
return null;
}
public function getFields() {
return array(
'aggregate_date' => array(
'title' => __('Date')
),
'unlock' => array(
'title' => __('Number of Unlocks'),
'color' => '#0074a2'
)
);
}
}

View File

@@ -0,0 +1,339 @@
<?php
if ( defined('BIZPANDA_SIGNIN_LOCKER_ACTIVE') ) return;
define('BIZPANDA_SIGNIN_LOCKER_ACTIVE', true);
define('BIZPANDA_SIGNIN_LOCKER_DIR', dirname(__FILE__));
define('BIZPANDA_SIGNIN_LOCKER_URL', plugins_url( null, __FILE__ ));
if ( is_admin() ) require BIZPANDA_SIGNIN_LOCKER_DIR . '/admin/boot.php';
if ( !function_exists('opanda_register_signin_locker') ) {
global $bizpanda;
BizPanda::enableFeature('signin-locker');
/**
* Registers the Sign-In Locker item.
*
* @since 1.0.0
*/
function opanda_register_signin_locker( $items ) {
$plugin = null;
if ( BizPanda::hasPlugin('optinpanda') ) {
global $optinpanda;
$plugin = $optinpanda;
} else {
global $sociallocker;
$plugin = $sociallocker;
}
global $optinpanda;
$items['signin-locker'] = array(
'name' => 'signin-locker',
'type' => 'premium',
'title' => __('Sign-In Locker', 'signinlocker'),
'help' => opanda_get_help_url('what-is-signin-locker'),
'description' => __('<p>Locks the content until the user signs in through social networks.</p><p>You can set up various social actions to be performed to sign in (e.g. subscribe, follow, share).</p>', 'signinlocker'),
'shortcode' => 'signinlocker',
'plugin' => $plugin
);
return $items;
}
add_filter('opanda_items', 'opanda_register_signin_locker', 2);
/**
* Adds options to print at the frontend.
*
* @since 1.0.0
*/
function opanda_signin_locker_options( $options, $id ) {
$options['terms'] = opanda_terms_url();
$options['privacyPolicy'] = opanda_privacy_policy_url();
if ( !get_option('opanda_terms_use_pages', false) ) {
$options['termsPopup'] = array(
'width' => 570,
'height' => 400
);
}
$actions = explode( ',', opanda_get_item_option($id, 'connect_buttons') );
$hasEmailForm = in_array( 'email', $actions );
if ( $hasEmailForm ) {
$emailFormIndex = array_search ('email', $actions);
unset( $actions[$emailFormIndex] );
}
$options['groups'] = $hasEmailForm
? array('connect-buttons', 'subscription')
: array('connect-buttons');
// connect buttons
$useOwnApps = opanda_get_option('own_apps_to_signin', false);
$localSocialProxy = [
'url' => opanda_local_proxy_url(),
'paramPrefix' => 'opanda'
];
$remoteSocialProxy = [
'endpoint' => opanda_remote_social_proxy_url(),
'paramPrefix' => null
];
$options['connectButtons'] = array();
$options['connectButtons']['order'] = $actions;
if ( in_array( 'facebook', $actions ) ) {
$options['connectButtons']['facebook'] = array(
'actions'=> opanda_signin_locker_get_actions( $id, 'facebook_actions' )
);
$clientId = opanda_get_option('facebook_app_id', false);
$clientSecret = opanda_get_option('facebook_app_secret', false);
if ( $useOwnApps && !empty( $clientId ) && !empty( $clientSecret ) ) {
$options['connectButtons']['facebook']['socialProxy'] = $localSocialProxy;
} else {
$options['connectButtons']['facebook']['socialProxy'] = $remoteSocialProxy;
}
}
if ( in_array( 'twitter', $actions ) ) {
$options['connectButtons']['twitter'] = array(
'actions' => opanda_signin_locker_get_actions( $id, 'twitter_actions' ),
'follow' => array(
'user' => opanda_get_item_option($id, 'twitter_follow_user'),
'notifications' => opanda_get_item_option($id, 'twitter_follow_notifications'),
),
'tweet'=> array(
'message' => opanda_get_item_option($id, 'twitter_tweet_message'),
'paramPrefix' => 'opanda'
)
);
$clientId = opanda_get_option('twitter_signin_app_consumer_key', false);
$clientSecret = opanda_get_option('twitter_signin_app_consumer_secret', false);
if ( $useOwnApps && !empty( $clientId ) && !empty( $clientSecret ) ) {
$options['connectButtons']['twitter']['socialProxy'] = $localSocialProxy;
} else {
$options['connectButtons']['twitter']['socialProxy'] = $remoteSocialProxy;
}
}
if ( in_array( 'google', $actions ) ) {
$options['connectButtons']['google'] = array(
'actions' => opanda_signin_locker_get_actions( $id, 'google_actions' ),
'clientId' => opanda_get_option('google_client_id'),
'youtubeSubscribe' => array(
'channelId' => opanda_get_item_option($id, 'google_youtube_channel_id')
)
);
$clientId = opanda_get_option('google_client_id', false);
$clientSecret = opanda_get_option('google_client_secret', false);
if ( $useOwnApps && !empty( $clientId ) && !empty( $clientSecret ) ) {
$options['connectButtons']['google']['socialProxy'] = $localSocialProxy;
} else {
$options['connectButtons']['google']['socialProxy'] = $remoteSocialProxy;
}
}
if ( in_array( 'linkedin', $actions ) ) {
$linkedInActions = opanda_signin_locker_get_actions( $id, 'linkedin_actions' );
if( ($key = array_search('follow', $linkedInActions)) !== false ) {
unset($linkedInActions[$key]);
}
$options['connectButtons']['linkedin'] = array(
'actions' => $linkedInActions,
'clientId' => opanda_get_option('linkedin_client_id')
);
$clientId = opanda_get_option('linkedin_client_id', false);
$clientSecret = opanda_get_option('linkedin_client_secret', false);
if ( $useOwnApps && !empty( $clientId ) && !empty( $clientSecret ) ) {
$options['connectButtons']['linkedin']['socialProxy'] = $localSocialProxy;
} else {
$options['connectButtons']['linkedin']['socialProxy'] = $remoteSocialProxy;
}
}
// subscription options
if ( $hasEmailForm ) {
$options['subscription'] = array();
$res_signin_email_form_text = BizPanda::hasPlugin('optinpanda') ? opanda_get_item_option($id, 'subscribe_before_form', false) : null;
if ( empty( $res_signin_email_form_text ) ) $res_signin_email_form_text = get_option('opanda_res_signin_email_form_text', '');
$res_signin_email_button = BizPanda::hasPlugin('optinpanda') ? opanda_get_item_option($id, 'subscribe_button_text', false) : null;
if ( empty( $res_signin_email_button ) ) $res_signin_email_button = get_option('opanda_res_signin_email_button', '');
$res_signin_after_email_button = BizPanda::hasPlugin('optinpanda') ? opanda_get_item_option($id, 'subscribe_after_button', false) : null;
if ( empty( $res_signin_after_email_button ) ) $res_signin_after_email_button = get_option('opanda_res_signin_after_email_button', '');
$options['subscription']['text'] = $res_signin_email_form_text;
$options['subscription']['form'] = array(
'actions' => opanda_signin_locker_get_actions( $id, 'email_actions' ),
'buttonText' => $res_signin_email_button,
'noSpamText' => $res_signin_after_email_button,
'type' => opanda_get_item_option($id, 'subscribe_name') ? 'name-email-form' : 'email-form'
);
}
$optinMode = opanda_get_item_option($id, 'subscribe_mode');
$service = opanda_get_option('subscription_service', 'database');
$listId = ( 'database' === $service ) ? 'default' : opanda_get_item_option($id, 'subscribe_list', false);
$options['subscribeActionOptions'] = array(
'listId' => $listId,
'service' => $service,
'doubleOptin' => in_array( $optinMode, array('quick-double-optin', 'double-optin') ),
'confirm' => in_array( $optinMode, array('double-optin') ),
);
return $options;
}
add_filter('opanda_signin-locker_item_options', 'opanda_signin_locker_options', 10, 2);
/**
* Adds the action 'lead' if the actions 'subscribe' and 'create account' are not selected.
*/
function opanda_signin_locker_get_actions( $id, $optionName ) {
$actions = explode( ',', opanda_get_item_option($id, $optionName ) );
if ( empty( $actions ) || empty($actions[0]) ) $actions = array();
if ( !BizPanda::hasPlugin('optinpanda') ) {
$temp = $actions; $actions = array();
foreach( $temp as $actionName ) {
if ( 'subscribe' === $actionName ) continue;
$actions[] = $actionName;
}
}
$catchLeads = opanda_get_item_option($id, 'catch_leads', false);
if ( !$catchLeads ) return $actions;
if ( in_array( 'signup', $actions) ) return $actions;
if ( in_array( 'subscribe', $actions) ) return $actions;
$actions[] = 'lead';
return $actions;
}
/**
* Requests assets for email locker.
*/
function opanda_signin_locker_assets( $lockerId, $options, $fromBody, $fromHeader ) {
OPanda_AssetsManager::requestLockerAssets( $lockerId );
OPanda_AssetsManager::requestTheme( isset( $options['opanda_style'] ) ? $options['opanda_style'] : false );
// The screen "Please Confirm Your Email"
OPanda_AssetsManager::requestTextRes(array(
'confirm_screen_title',
'confirm_screen_instructiont',
'confirm_screen_note1',
'confirm_screen_note2',
'confirm_screen_cancel',
'confirm_screen_open',
));
// Miscellaneous
OPanda_AssetsManager::requestTextRes(array(
'misc_data_processing',
'misc_or_enter_email',
'misc_enter_your_email',
'misc_enter_your_name',
'misc_your_agree_with',
'misc_agreement_checkbox',
'misc_agreement_checkbox_alt',
'misc_terms_of_use',
'misc_privacy_policy',
'misc_or_wait',
'misc_close',
'misc_or'
));
// Errors & Notices
OPanda_AssetsManager::requestTextRes(array(
'errors_no_consent',
'errors_empty_field',
'errors_empty_checkbox',
'errors_empty_email',
'errors_inorrect_email',
'errors_empty_name',
'errors_subscription_canceled',
'misc_close',
'misc_or'
));
// The screen "One Step To Complete" | Errors & Notices
OPanda_AssetsManager::requestTextRes(array(
'onestep_screen_title',
'onestep_screen_instructiont',
'onestep_screen_button',
'errors_not_signed_in',
'errors_not_granted'
));
// Sign-In Buttons
OPanda_AssetsManager::requestTextRes(array(
'signin_long',
'signin_short',
'signin_facebook_name',
'signin_twitter_name',
'signin_google_name',
'signin_linkedin_name'
));
}
add_action('opanda_request_assets_for_signin-locker', 'opanda_signin_locker_assets', 10, 4);
/**
* A shortcode for the Sign-In Locker
*
* @since 1.0.0
*/
class OPanda_SignInLockerShortcode extends OPanda_LockerShortcode {
/**
* Shortcode name
* @var string
*/
public $shortcodeName = array(
'signinlocker', 'signinlocker-1', 'signinlocker-2', 'signinlocker-3', 'signinlocker-4', 'signinlocker-bulk'
);
protected function getDefaultId() {
return get_option('opanda_default_signin_locker_id');
}
}
FactoryShortcodes320::register( 'OPanda_SignInLockerShortcode', $bizpanda );
}

View File

@@ -0,0 +1,90 @@
/**
* CSS for the metabox "Social Options"
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2015, OnePress Ltd
*
* @package optinpanda
* @since 1.0.0
*/
#OPanda_SocialOptionsMetaBox {
display: block;
}
#OPanda_SocialOptionsMetaBox .factory-tab-item .alert {
position: relative;
top: -25px;
}
#OPanda_SocialOptionsMetaBox .factory-control-facebook_share_dialog {
margin-top: 15px;
}
#OPanda_SocialOptionsMetaBox .factory-bodies {
display: block !important;
position: relative;
}
#OPanda_SocialOptionsMetaBox .opanda-overlay-note {
width: 270px;
left: 50%;
margin: 70px 0 0 -135px;
}
#opanda_twitter_tweet_text {
background: #fff url("../img/tweet-content-bg.png") no-repeat 50% 50%;
min-height: 100px;
}
#opanda_vk_share_description {
min-height: 100px;
}
#opanda_facebook_like_title,
#opanda_facebook_share_title,
#opanda_twitter_tweet_title,
#opanda_twitter_follow_title,
#opanda_google_plus_title,
#opanda_google_share_title,
#opanda_linkedin_share_title {
max-width: 200px;
}
#opanda-button-styles-box {
padding: 15px 36px 15px 8px;
-moz-box-sizing: content-box;
box-sizing: content-box;
width: 100%;
margin-bottom: 25px;
position: relative;
margin-left: -22px;
border-bottom: 1px solid #e5e5e5;
}
#opanda-button-styles-box .opanda-inline-group {
display: inline-block;
}
.opanda-inline-form .control-label,
.opanda-inline-form .control-group {
display: inline-block;
vertical-align: top;
font-weight: normal;
}
.opanda-inline-form .control-label {
padding-left: 16px;
}
.opanda-inline-form .control-group {
margin-left: 5px;
}
#opanda_social_buttons_display,
#opanda_social_buttons_size,
#opanda_show_counters {
width: auto;
}
#OPanda_SocialOptionsMetaBox .inside {
margin-top: 0px;
}
#OPanda_SocialOptionsMetaBox .factory-form-metabox {
padding-top: 0px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

View File

@@ -0,0 +1,351 @@
if ( !window.bizpanda ) window.bizpanda = {};
if ( !window.bizpanda.socialOptions ) window.bizpanda.socialOptions = {};
(function($){
window.bizpanda.socialOptions = {
init: function() {
var self = this;
this.item = $('#opanda_item').val();
this.initSocialTabs();
this.initButtonStyles();
this.lockPremiumFeatures();
$.bizpanda.filters.add('opanda-preview-options', function( options ){
var extraOptions = self.getSocialOptions();
return $.extend(true, options, extraOptions);
});
},
/**
* Inits options for styling buttons.
*/
initButtonStyles: function() {
var self = this;
this.$buttonsDisplay = $('#opanda_social_buttons_display_select');
this.$buttonsSize = $('#opanda_social_buttons_size_select');
this.$buttonsCounters = $('#opanda_social_buttons_counters_select');
this.$buttonsDisplayInput = $('#opanda_social_buttons_display');
this.$buttonsSizeInput = $('#opanda_social_buttons_size');
this.$buttonsCountersInput = $('#opanda_social_buttons_counters');
var selectedDisplay = this.$buttonsDisplayInput.val();
var selectedSize = this.$buttonsSizeInput.val();
var selectedCounters = this.$buttonsDisplayInput.val();
if ( selectedDisplay ) {
this.$buttonsDisplay.find('option[value="' + selectedDisplay + '"]').prop('selected', 'selected');
}
if ( selectedSize ) {
this.$buttonsSize.find('option[value="' + selectedSize + '"]').prop('selected', 'selected');
}
if ( selectedCounters ) {
this.$buttonsCounters.find('option[value="' + selectedCounters + '"]').prop('selected', 'selected');
}
this.$theme = $('#opanda_style');
this.$theme.change(function(){
self.updateAvailableButtonStyles( true );
});
self.updateAvailableButtonStyles();
this.$buttonsDisplay.change(function(){
var value = self.$buttonsDisplay.val();
if ( $.inArray( value, ['native', 'covers-native'] ) >= 0 ) {
$('.opanda-social-buttons-counters-wrap').fadeIn();
} else {
$('.opanda-social-buttons-counters-wrap').hide();
}
if ( $.inArray( value, ['covers'] ) >= 0 ) {
$('.opanda-social-buttons-size-wrap').fadeIn();
} else {
$('.opanda-social-buttons-size-wrap').hide();
}
$('#opanda_social_buttons_display').val( value );
});
this.$buttonsSize.change(function(){
var value = self.$buttonsSize.val();
$('#opanda_social_buttons_size').val( value );
});
this.$buttonsCounters.change(function(){
var value = self.$buttonsCounters.val();
$('#opanda_social_buttons_counters').val( value );
});
this.$buttonsDisplay.change();
},
/**
* Updates the list of available styles of the buttons.
*/
updateAvailableButtonStyles: function( styleIsChanged ) {
var $selectedThemeOption = this.$theme.find('option:selected');
var allowedDisplay = $selectedThemeOption.data('socialbuttonsalloweddisplay');
if ( allowedDisplay ) allowedDisplay = allowedDisplay.split(',');
var defaultDisplay = $selectedThemeOption.data('socialbuttonsdefaultdisplay');
if ( !defaultDisplay ) defaultDisplay = 'native';
var $options = this.$buttonsDisplay.find('option');
var selectedDisplay = this.$buttonsDisplayInput.val();
var isSelectionHidden = false;
var firstVisibleValue = null;
$options.each(function( ){
var $option = $(this);
var value = $option.val();
if ( !allowedDisplay || $.inArray( value, allowedDisplay ) >= 0 ) {
$option.show();
if ( !firstVisibleValue ) firstVisibleValue = value;
} else {
if ( selectedDisplay == value ) {
isSelectionHidden = true;
}
$option.hide();
}
});
var isSelectedEmpty = !selectedDisplay;
var valueToSelect = ( styleIsChanged ) ? defaultDisplay : firstVisibleValue;
if ( isSelectedEmpty ) valueToSelect = defaultDisplay;
if ( isSelectionHidden || styleIsChanged || isSelectedEmpty ) {
this.$buttonsDisplay.find('option[value="' + valueToSelect + '"]').prop('selected', 'selected');
this.$buttonsDisplayInput.val(valueToSelect);
this.$buttonsDisplay.change();
}
},
/**
* Inits social tabs.
*/
initSocialTabs: function() {
var self = this;
var socialTabWrap = $(".factory-align-vertical .nav-tabs");
var socialTabItem = $(".factory-align-vertical .nav-tabs li");
$(".factory-align-vertical .nav-tabs li").click(function(){
$(".opanda-overlay-tumbler-hint").hide().remove();
});
// current order
var currentString = $("#opanda_buttons_order").val();
if (currentString) {
var currentSet = currentString.split(',');
var originalSet = {};
socialTabItem.each(function(){
var tabId = $(this).data('tab-id');
originalSet[tabId] = $(this).detach();
});
for(var index in currentSet) {
var currentId = currentSet[index];
socialTabWrap.append(originalSet[currentId]);
delete originalSet[currentId];
}
for(var index in originalSet) {
socialTabWrap.append(originalSet[index]);
}
$(function(){
$(socialTabWrap.find("li a").get(0)).tab('show');
});
}
// make shortable
$(".factory-align-vertical .nav-tabs").addClass("ui-sortable");
$(".factory-align-vertical .nav-tabs").sortable({
placeholder: "sortable-placeholder",
opacity: 0.7,
items: "> li",
update: function(event, ui) {
self.updateButtonOrder();
}
});
socialTabWrap.find('li').each(function(){
var tabId = $(this).data('tab-id');
var item = $(this);
var checkbox = $("#opanda_" + tabId + "_available");
checkbox.change(function(){
var isAvailable = checkbox.is(':checked');
if (!isAvailable) {
item.addClass('factory-disabled');
} else {
item.removeClass('factory-disabled');
}
self.updateButtonOrder();
}).change();
});
// hides/shows the option "Message To Share" of the Facebook Share button
$("#opanda_facebook_share_dialog").change(function(){
var checked = $(this).is(":checked");
if ( checked ) {
$("#factory-form-group-message-to-share").hide();
} else {
$("#factory-form-group-message-to-share").fadeIn();
}
}).change();
},
updateButtonOrder: function(value) {
if (!value) {
var socialTabWrap = $(".factory-align-vertical .nav-tabs");
var resultArray = [];
socialTabWrap.find('li:not(.sortable-placeholder):not(.factory-disabled)').each(function(){
var tabId = $(this).data('tab-id');
if ( window['sociallocker-next-build'] === 'free' && $.inArray( tabId, ['facebook-like', 'twitter-tweet', 'google-plus']) >= 0 ) {
resultArray.push( tabId );
} else if ( window['sociallocker-next-build'] !== 'free' ) {
resultArray.push( tabId );
}
});
var result = resultArray.join(',');
$("#opanda_buttons_order").val(result).change();
}
},
getSocialOptions: function() {
var buttons = $("#opanda_buttons_order").val();
var options = {
groups: {
order: ['social-buttons']
},
socialButtons: {
counters: parseInt( $("#opanda_social_buttons_counters").val() ),
display: $("#opanda_social_buttons_display").val(),
coversSize: $("#opanda_social_buttons_size").val(),
order: buttons ? buttons.split(",") : buttons,
facebook: {
appId: window.opanda_facebook_app_id,
lang: window.opanda_lang,
version: window.opanda_facebook_version,
like: {
socialProxy: window.facebook_like_social_proxy,
url: $("#opanda_facebook_like_url").val(),
title: $("#opanda_facebook_like_title").val()
},
share: {
socialProxyAppId: window.facebook_share_social_proxy_app_id,
socialProxy: window.facebook_share_social_proxy,
title: $("#opanda_facebook_share_title").val(),
shareDialog: $("#opanda_facebook_share_dialog").is(':checked'),
url: $("#opanda_facebook_share_url").val(),
counter: $("#opanda_facebook_share_counter_url").val()
}
},
twitter: {
lang: window.opanda_short_lang,
tweet: {
socialProxy: window.twitter_social_proxy,
url: $("#opanda_twitter_tweet_url").val(),
text: $("#opanda_twitter_tweet_text").val(),
title: $("#opanda_twitter_tweet_title").val(),
skipCheck: $("#opanda_twitter_tweet_skip_auth").is(':checked'),
via: $("#opanda_twitter_tweet_via").val()
},
follow: {
socialProxy: window.twitter_social_proxy,
url: $("#opanda_twitter_follow_url").val(),
title: $("#opanda_twitter_follow_title").val(),
skipCheck: $("#opanda_twitter_tweet_skip_auth").is(':checked'),
hideScreenName: $("#opanda_twitter_follow_hide_name").is(':checked')
}
},
google: {
lang: window.opanda_short_lang,
plus: {
url: $("#opanda_google_plus_url").val(),
title: $("#opanda_google_plus_title").val(),
prefilltext: $("#opanda_google_plus_text").val()
},
share: {
url: $("#opanda_google_share_url").val(),
title: $("#opanda_google_share_title").val(),
prefilltext: $("#opanda_google_share_text").val()
}
},
youtube: {
subscribe: {
socialProxy: window.google_social_proxy,
clientId: window.opanda_google_client_id,
channelId: $("#opanda_google_youtube_channel_id").val(),
title: $("#opanda_google_youtube_title").val()
}
},
linkedin: {
share: {
url: $("#opanda_linkedin_share_url").val(),
title: $("#opanda_linkedin_share_title").val()
}
}
}
};
console.log( options );
return options;
},
lockPremiumFeatures: function() {
if ( $.inArray( this.item, ['social-locker', 'email-locker', 'signin-locker'] ) === -1 ) return;
$(".factory-tab-item.opanda-not-available").each( function(){
var $overlay = $("<div class='opanda-overlay'></div>");
var $note = $overlay.find(".opanda-premium-note");
$(this).append( $overlay );
$(this).append( $note );
});
return;
}
};
$(function(){
window.bizpanda.socialOptions.init();
});
})(jQuery)

View File

@@ -0,0 +1,308 @@
<?php
/**
* Boots the code for the admin part of the Social Locker
*
* @since 1.0.0
* @package core
*/
/**
* Registers metaboxes for Social Locker.
*
* @see opanda_item_type_metaboxes
* @since 1.0.0
*/
function opanda_socail_locker_metaboxes( $metaboxes ) {
$metaboxes[] = array(
'class' => 'OPanda_SocialOptionsMetaBox',
'path' => BIZPANDA_SOCIAL_LOCKER_DIR . '/admin/metaboxes/social-options.php'
);
if ( OPanda_Items::isCurrentFree() ) {
$metaboxes[] = array(
'class' => 'OPanda_SocialLockerMoreFeaturesMetaBox',
'path' => BIZPANDA_SOCIAL_LOCKER_DIR . '/admin/metaboxes/more-features.php'
);
}
return $metaboxes;
}
add_filter('opanda_social-locker_type_metaboxes', 'opanda_socail_locker_metaboxes', 10, 1);
/**
* Prepares the Social Locker to use while activation.
*
* @since 1.0.0
*/
function opanda_social_locker_activation( $plugin, $helper ) {
// imports the old social lockers
global $wpdb;
$sociallockerIDs = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} WHERE post_type='social-locker'" );
if ( !empty( $sociallockerIDs) ) {
// Converts the old Social Lockers to the Opt-In Panda Items of the type 'Social Locker'
foreach( $sociallockerIDs as $postID ) {
$wpdb->query("INSERT INTO {$wpdb->postmeta} (post_id, meta_key, meta_value) VALUES ($postID, 'opanda_item', 'social-locker')");
}
}
$wpdb->query("UPDATE {$wpdb->posts} SET post_type='" . OPANDA_POST_TYPE . "' WHERE post_type='social-locker'");
$wpdb->query("UPDATE {$wpdb->posts} SET post_title='" . __('Social Locker', 'optionpanda') . "', post_name='opanda_default_social_locker' WHERE post_name='default_sociallocker_locker'");
$defaulTheme = 'flat';
// default social locker
$helper->addPost(
'opanda_default_social_locker_id',
array(
'post_type' => OPANDA_POST_TYPE,
'post_title' => __('Social Locker (default)', 'sociallocker'),
'post_name' => 'opanda_default_social_locker'
),
array(
'opanda_item' => 'social-locker',
'opanda_header' => __('This content is locked', 'sociallocker'),
'opanda_message' => __('Please support us, use one of the buttons below to unlock the content.', 'sociallocker'),
'opanda_style' => $defaulTheme,
'opanda_mobile' => 1,
'opanda_highlight' => 1,
'opanda_is_system' => 1,
'opanda_is_default' => 1
)
);
}
add_action('after_bizpanda_activation', 'opanda_social_locker_activation', 10, 2);
/**
* Registers default themes.
*
* We don't need to include the file containing the file OPanda_ThemeManager because this function will
* be called from the hook defined inside the class OPanda_ThemeManager.
*
* @see onp_sl_register_themes
* @see OPanda_ThemeManager
*
* @since 1.0.0
* @return void
*/
function opanda_register_social_locker_themes() {
OPanda_ThemeManager::registerTheme(array(
'name' => 'starter',
'title' => 'Starter',
'path' => OPANDA_BIZPANDA_DIR . '/themes/starter',
'items' => array('social-locker', 'signin-locker', 'email-locker', 'custom-locker'),
'socialButtons' => [
'allowedDisplay' => ['native', 'covers', 'covers-native'],
'defaultDisplay' => 'native'
]
));
OPanda_ThemeManager::registerTheme(array(
'name' => 'secrets',
'title' => 'Secrets',
'path' => OPANDA_BIZPANDA_DIR . '/themes/secrets',
'items' => array('social-locker', 'signin-locker', 'email-locker', 'custom-locker'),
'socialButtons' => [
'allowedDisplay' => ['native', 'covers', 'covers-native'],
'defaultDisplay' => 'covers-native'
]
));
OPanda_ThemeManager::registerTheme(array(
'name' => 'dandyish',
'title' => 'Dandyish',
'path' => OPANDA_BIZPANDA_DIR . '/themes/dandyish',
'items' => array('social-locker', 'signin-locker', 'email-locker', 'custom-locker'),
'socialButtons' => [
'allowedDisplay' => ['native', 'covers', 'covers-native'],
'defaultDisplay' => 'native'
]
));
OPanda_ThemeManager::registerTheme(array(
'name' => 'glass',
'title' => 'Glass',
'path' => OPANDA_BIZPANDA_DIR . '/themes/glass',
'items' => array('social-locker', 'signin-locker', 'email-locker', 'custom-locker'),
'socialButtons' => [
'allowedDisplay' => ['native', 'covers', 'covers-native'],
'defaultDisplay' => 'native'
]
));
OPanda_ThemeManager::registerTheme(array(
'name' => 'flat',
'title' => 'Flat',
'path' => OPANDA_BIZPANDA_DIR . '/themes/flat',
'items' => array('social-locker', 'signin-locker', 'email-locker', 'custom-locker'),
'socialButtons' => [
'allowedDisplay' => ['native', 'covers', 'covers-native'],
'defaultDisplay' => 'covers'
]
));
OPanda_ThemeManager::registerTheme(array(
'name' => 'great-attractor',
'title' => 'Great Attractor',
'path' => OPANDA_BIZPANDA_DIR . '/themes/great-attractor',
'items' => array('social-locker', 'signin-locker', 'email-locker', 'custom-locker'),
'socialButtons' => [
'allowedDisplay' => ['native', 'covers'],
'defaultDisplay' => 'covers'
]
));
OPanda_ThemeManager::registerTheme(array(
'name' => 'friendly-giant',
'title' => 'Friendly Giant',
'path' => OPANDA_BIZPANDA_DIR . '/themes/friendly-giant',
'items' => array('social-locker', 'signin-locker', 'email-locker', 'custom-locker'),
'socialButtons' => [
'allowedDisplay' => ['native', 'covers'],
'defaultDisplay' => 'covers'
]
));
OPanda_ThemeManager::registerTheme(array(
'name' => 'dark-force',
'title' => 'Dark Force',
'path' => OPANDA_BIZPANDA_DIR . '/themes/dark-force',
'items' => array('social-locker', 'signin-locker', 'email-locker', 'custom-locker'),
'socialButtons' => [
'allowedDisplay' => ['native', 'covers'],
'defaultDisplay' => 'covers'
]
));
}
add_action('onp_sl_register_themes', 'opanda_register_social_locker_themes');
/**
* Shows the help page 'What is it?' for the Social Locker.
*
* @since 1.0.0
*/
function opanda_help_page_usage_what_is_social_locker( $manager ) {
require BIZPANDA_SOCIAL_LOCKER_DIR . '/admin/help/what-is-it.php';
}
add_action('opanda_help_page_what-is-social-locker', 'opanda_help_page_usage_what_is_social_locker');
/**
* Shows the help page 'Usage Example' for the Social Locker.
*
* @since 1.0.0
*/
function opanda_help_page_usage_example_social_locker( $manager ) {
require BIZPANDA_SOCIAL_LOCKER_DIR . '/admin/help/usage-example.php';
}
add_action('opanda_help_page_usage-example-social-locker', 'opanda_help_page_usage_example_social_locker');
/**
* Shows the help page 'GDPR compatibility' for the Social Locker.
*
* @since 1.0.0
*/
function opanda_help_page_gdpr_social_locker( $manager ) {
require BIZPANDA_SOCIAL_LOCKER_DIR . '/admin/help/gdpr.php';
}
add_action('opanda_help_page_gdpr-social-locker', 'opanda_help_page_gdpr_social_locker');
/**
* Shows the help page 'Other Notes' for the Social Locker.
*
* @since 1.0.0
*/
function opanda_help_page_other_notes_social_locker( $manager ) {
require BIZPANDA_SOCIAL_LOCKER_DIR . '/admin/help/other-notes.php';
}
add_action('opanda_help_page_other-notes-social-locker', 'opanda_help_page_other_notes_social_locker');
/**
* Registers the quick tags for the wp editors.
*
* @see admin_print_footer_scripts
* @since 1.0.0
*/
function opanda_quicktags_for_social_locker()
{ ?>
<script type="text/javascript">
(function(){
if (!window.QTags) return;
window.QTags.addButton( 'sociallocker', 'sociallocker', '[sociallocker]', '[/sociallocker]' );
}());
</script>
<?php
}
add_action('admin_print_footer_scripts', 'opanda_quicktags_for_social_locker');
/**
* Registers stats screens for Email Locker.
*
* @since 1.0.0
*/
function opanda_social_locker_stats_screens( $screens ) {
global $optinpanda;
$screens = array(
// The Summary Screen
'summary' => array (
'title' => __('<i class="fa fa-search"></i> Summary', 'sociallocker'),
'description' => __('The page shows the total number of unlocks for the current locker.', 'sociallocker'),
'chartClass' => 'OPanda_SocialLocker_Summary_StatsChart',
'tableClass' => 'OPanda_SocialLocker_Summary_StatsTable',
'path' => BIZPANDA_SOCIAL_LOCKER_DIR . '/admin/stats/summary.php'
),
// The Channels Screen
'channels' => array(
'title' => __('<i class="fa fa-search-plus"></i> Detailed', 'sociallocker'),
'description' => __('The page shows which ways visitors used to unlock the content.', 'sociallocker'),
'chartClass' => 'OPanda_SocialLocker_Detailed_StatsChart',
'tableClass' => 'OPanda_SocialLocker_Detailed_StatsTable',
'path' => BIZPANDA_SOCIAL_LOCKER_DIR . '/admin/stats/detailed.php'
)
);
// The Skips Screen
$screens['skips'] = array (
'title' => __('<i class="fa fa-tint"></i> Skips', 'sociallocker'),
'description' => __('The chart shows how many users skipped the locker by using the Timer or Close Icon, comparing to the users who unlocked the content.', 'sociallocker'),
'chartClass' => 'OPanda_SocialLocker_Skips_StatsChart',
'tableClass' => 'OPanda_SocialLocker_Skips_StatsTable',
'path' => BIZPANDA_SOCIAL_LOCKER_DIR . '/admin/stats/skips.php'
);
return $screens;
}
add_filter('opanda_social-locker_stats_screens', 'opanda_social_locker_stats_screens', 10, 1);

View File

@@ -0,0 +1,26 @@
<?php
global $bizpanda;
$lang = $bizpanda->options['lang'];
?>
<div class="onp-help-section">
<h1><?php _e('Social Locker GDPR Compatibility', 'sociallocker'); ?></h1>
<p>
<?php _e('The General Data Protection Regulation (GDPR) is a new data protection law in the EU that takes effect on May 25, 2018.', 'sociallocker') ?>
<?php _e('GDPR covers processing personal data.') ?>
</p>
<p>
<strong><?php _e('Social Locker is fully compatible with GDPR out of the box.</strong>', 'sociallocker') ?></strong>
</p>
<p>
<?php _e('Social Locker doesn\'t collect any personal data when a user clicks on like/share buttons. So you don\'t need to add any Consent Checkboxes or refer to your Terms of Use and Privacy Policy.') ?>
</p>
<p>
<?php _e('Please note, for other types of content lockers (Sign-In Locker / Email Locker) you need to activate the Consent Checkbox for GDPR Compatibility.')?>
</p>
</div>

View File

@@ -0,0 +1,62 @@
<?php
global $bizpanda;
$lang = $bizpanda->options['lang'];
?>
<div class="onp-help-section">
<h1><?php _e('Using the Facebook Like with the Social Locker', 'sociallocker'); ?></h1>
<p>
<?php _e('This note describes the Facebook restriction regarding using the Facebook Buttons in the Social Locker.', 'sociallocker') ?>
<?php _e('Since 5 Nov, you don\'t have to incentivize people to like your page to unlock the content:') ?>
</p>
<p class='onp-remark'>
<span class="onp-inner-wrap">
<i><?php _e('You must not incentivize people to use social plugins or to like a Page. This includes offering rewards, or gating apps or app content based on whether or not a person has liked a Page. It remains acceptable to incentivize people to login to your app, checkin at a place ...', 'sociallocker') ?></i><br />
<i style="display: block; margin-top: 5px;">
<strong><?php _e('Source:', 'optionpanda') ?></strong>
<a href="https://developers.facebook.com/blog/post/2014/08/07/Graph-API-v2.1/" target="_blank">https://developers.facebook.com/policy#properuse</a>
</i>
</span>
</p>
<p>
<strong><?php _e('This restriction doesn\'t affect on:</strong>', 'sociallocker') ?></strong>
<ul>
<li><?php _e('Facebook Sign-In and Subscribe buttons (which ask to sign in to a Facebook app).', 'sociallocker') ?></li>
<li><?php _e('Other social networks (Twitter, Google, LinkedIn).', 'sociallocker') ?></li>
</ul>
</p>
<p>
<?php _e('Technically <strong>you can ignore this restriction, the Social Locker will continue working without any problems</strong>. Also you can just update a bit the settings of your lockers to make it compatible with the new policy.', 'sociallocker') ?>
</p>
</div>
<div class="onp-help-section">
<h2><?php _e('Making Social Locker compatible with the Facebook Policies', 'sociallocker'); ?></h2>
<p><?php _e('If want to use the Social Locker with the Facebook Like and keep it compatible with the new Facebook Policies, you need to convert your Social Locker to "Social Reminder". What does it mean?', 'sociallocker') ?></p>
<p><strong><?php _e('1. Enable the option Close Icon.', 'sociallocker') ?></strong></p>
<p>
<?php _e('You have to give people the way to skip the liking process.', 'sociallocker') ?>
<?php _e('The Close Icon is not bright and the most people will not notice it at first time and will still click on the Like button.', 'sociallocker') ?>
</p>
<p><strong><?php _e('2. Remove any phrases like "this content is locked" from your locker.', 'sociallocker') ?></strong></p>
<p>
<?php _e('Don\'t write that your content is locked. Ask support you because you need it in order to keep doing what you\'re doing (provide free downloads, write good articles and so on).', 'sociallocker') ?>
</p>
<p><strong><?php _e('3. Turn on the Transparency or Blurring mode.', 'sociallocker') ?></strong></p>
<p>
<?php _e('It makes your locker looks like a popup which appears suddenly to ask the user to support you.', 'sociallocker') ?>
</p>
<p class='onp-img'>
<img src='<?php echo OPANDA_BIZPANDA_URL . '/assets/admin/img/how-to-use/facebook-like/1.png' ?>' />
</p>
</div>

View File

@@ -0,0 +1,129 @@
<?php
global $bizpanda;
$lang = $bizpanda->options['lang'];
?>
<div class="onp-help-section">
<h2><?php _e('Quick Start Guide', 'sociallocker'); ?></h2>
<p>
<?php _e('You can pick the content you want to lock by using special shortcodes. During installation, the plugin created for you the shortcode <span class="onp-mark onp-mark-gray onp-mark-stricked onp-code">[sociallocker][/sociallocker]</span> named <strong>Social Locker</strong>.', 'sociallocker'); ?>
</p>
<p class='onp-note'>
<?php _e('<strong>Note:</strong> You can create more shortcodes at any time for whatever you need them for. For instance, you could create one for locking video players or another one for locking download links.', 'sociallocker'); ?>
</p>
<p>
<?php _e('Let\'s examine how to use the default shortcode <strong>Social Locker</strong>.', 'sociallocker'); ?>
</p>
</div>
<div class="onp-help-section">
<h2>1. <?php _e('Open the editor', 'sociallocker'); ?></h2>
<p><?php printf( __('In admin menu, select Social Locker -> <a href="%s">All Lockers</a>.', 'sociallocker'), admin_url('edit.php?post_type=opanda-item') ); ?></p>
<p><?php _e('Click on the shortcode titled "Social Locker" to open the editor:', 'sociallocker'); ?></p>
<p class='onp-img'>
<img src='<?php echo 'https://cconp.s3.amazonaws.com/bizpanda/social-locker/help/' . $lang . '/2.png' ?>' />
</p>
</div>
<div class="onp-help-section">
<h2>2. <?php _e('Configure the locker', 'sociallocker'); ?></h2>
<p>1) <?php _e('Set a clear title that attracts attention or creates a call to action (see the example below).', 'sociallocker'); ?></p>
<p>2) <?php _e('Describe what the visitor will get after they unlock the content. This is very important, as visitors need to be aware of what they are getting. And please, only promise things you can deliver.', 'sociallocker'); ?></p>
<p>3) <?php _e('Choose one of the available themes for your locker.', 'sociallocker'); ?></p>
</p>
<p class='onp-img'>
<img src='<?php echo 'https://cconp.s3.amazonaws.com/bizpanda/social-locker/help/' . $lang . '/3.png' ?>' />
</p>
<p>
4) <?php _e('Select social buttons that will be available for visitors and configure every selected button.', 'sociallocker'); ?>
</p>
<p class='onp-img'>
<img src='<?php echo 'https://cconp.s3.amazonaws.com/bizpanda/social-locker/help/' . $lang . '/4.png' ?>' />
</p>
<p>
<?php _e('Congratulations! The locker is ready to use.', 'sociallocker'); ?>
</p>
<p>
<?php printf( __('The page <a href="%s">Stats & Reports</a> will help you to correct your locker after collecting the first statistical data.', 'sociallocker'), admin_url( 'edit.php?post_type=opanda-item&page=stats-' . $bizpanda->pluginName ) ); ?>
</p>
<p class='onp-note'>
<?php _e('On the right sidebars, there are some additional options which can help you to adjust the locker to your site audience. Try to use them by yourself later.', 'sociallocker'); ?>
</p>
</div>
<div class="onp-help-section">
<h2>3. <?php _e('Place the locker', 'sociallocker'); ?></h2>
<p>
<?php _e('Decide what content you would like to lock. It might be:', 'sociallocker'); ?>
<ul>
<li><?php _e('A download link (for instance, a free graphic, an audio file, video resources, or a printable pdf of your article).', 'sociallocker'); ?></li>
<li><?php _e('A promo code (for instance, a 10% off discount, if the visitor shares your promo page).', 'sociallocker'); ?></li>
<li><?php _e('The end of your article (for instance, you might show the beginning of the article to gain interest, but hide the ending).', 'sociallocker'); ?></li>
</ul>
<?php _e('Basically, you can hide any content that would be important for visitors who are visiting your site.', 'sociallocker'); ?>
</p>
<p>
<?php _e('However, <strong>you should never</strong>:', 'sociallocker'); ?>
<ul>
<li>
<?php _e('Lock all of your content, posts or pages.', 'sociallocker'); ?>
</li>
<li>
<?php _e('Lock boring content or content that is not interesting.', 'sociallocker'); ?>
</li>
</ul>
</p>
<p>
<?php _e('In other words, don not try to trick your visitors. If you do, people will become annoyed and will remove the likes/tweets/+1s after unlocking your content, which will not have the desired result.', 'sociallocker'); ?>
</p>
<p>
<?php _e('Open the post editor for the post where you want to put the locker. Add a block named «Social Locker».', 'sociallocker') ?>
</p>
<p class='onp-img'>
<img src='<?php echo 'https://cconp.s3.amazonaws.com/bizpanda/social-locker/help/' . $lang . '/4-2.png' ?>' />
</p>
<p>
<?php _e('Put content you wish to lock into the added block.', 'sociallocker') ?>
</p>
<p class='onp-img'>
<img src='<?php echo 'https://cconp.s3.amazonaws.com/bizpanda/social-locker/help/' . $lang . '/4-3.png' ?>' />
</p>
<p>
<?php _e('If you have several lockers you can pick the concrete one by clicking on the block border.', 'sociallocker') ?>
</p>
<p class='onp-img'>
<img src='<?php echo 'https://cconp.s3.amazonaws.com/bizpanda/social-locker/help/' . $lang . '/4-4.png' ?>' />
</p>
<p>
<?php _e('Also you can use shortcodes to call the locker by wrapping the content you wish to lock. For instance: <span class="onp-mark onp-mark-gray onp-mark-stricked onp-code">[sociallocker] Locked Content Goes Here [/sociallocker]</span>', 'sociallocker') ?>
</p>
<p>
<?php _e('That\'s it! Save your post and see it on your site! ', 'sociallocker'); ?>
</p>
<p class='onp-img'>
<img src='<?php echo 'https://cconp.s3.amazonaws.com/bizpanda/social-locker/help/' . $lang . '/6.png' ?>' />
</p>
</div>

View File

@@ -0,0 +1,25 @@
<div class="onp-help-section">
<h1><?php _e('Social Locker', 'sociallocker'); ?></h1>
<p>
<?php _e('Social Locker hides some piece of value content on your website and ask the user to like or share (in other words, "pay with a like", "pay with a tweet" and so on) to get instant access to your content.') ?>
</p>
<p><?php _e('Social Locker gives you the following benefits:', 'sociallocker') ?></p>
<p><strong><?php _e('1. More Social Traffic') ?></strong></p>
<p><?php _e('Social Locker will add systematically viral traffic to your website, your opt-in funnel or your sales-page. When users share or tweet your page to get access to the content you locked, their friends see it and some of them visit your website. That repeats again and again.', 'sociallocker') ?></p>
<p><strong><?php _e('2. More Quality Fans & Followers') ?></strong></p>
<p><?php _e('Every blogger and internet entrepreneur knows how difficult it is to get fans and followers, especially for new websites with a low budget..', 'sociallocker') ?></p>
<p><?php _e('Get every visitor of your site to follow you. Keep in contact with your audience and build loyalty. Just lock some valued content and tell visitors that the locked content is available only for your fans and followers.') ?></p>
<p><strong><?php _e('3. Better SEO Ranking') ?></strong></p>
<p><?php _e('Google\'s search algorithm takes over 200 factors into consideration when determining which results to show for a search query and in what order. Social media is one of the most important factors in their algorithm and has a significant influence on how a site ranks in a search.', 'sociallocker') ?></p>
<p><?php _e('Results in the organic search results\' top positions have a high number of likes, shares and tweets. So, the better your social media performance, the better your SEO results.') ?>
<p style="margin-top: 25px;">
<a href="<?php $manager->actionUrl('index', array( 'onp_sl_page' => 'usage-example-social-locker' )) ?>" class="btn btn-default"><?php _e('Learn how to configure and use Social Locker', 'sociallocker') ?><i class="fa fa-long-arrow-right"></i></a>
</p>
</div>

View File

@@ -0,0 +1,475 @@
<?php
/**
* The file contains a class to configure the metabox Social Options.
*
* Created via the Factory Metaboxes.
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2013, OnePress Ltd
*
* @package core
* @since 1.0.0
*/
/**
* The class configure the metabox Social Options.
*
* @since 1.0.0
*/
class OPanda_SocialOptionsMetaBox extends FactoryMetaboxes321_FormMetabox
{
/**
* A visible title of the metabox.
*
* Inherited from the class FactoryMetabox.
* @link http://codex.wordpress.org/Function_Reference/add_meta_box
*
* @since 1.0.0
* @var string
*/
public $title;
/**
* A prefix that will be used for names of input fields in the form.
*
* Inherited from the class FactoryFormMetabox.
*
* @since 1.0.0
* @var string
*/
public $scope = 'opanda';
/**
* The priority within the context where the boxes should show ('high', 'core', 'default' or 'low').
*
* @link http://codex.wordpress.org/Function_Reference/add_meta_box
* Inherited from the class FactoryMetabox.
*
* @since 1.0.0
* @var string
*/
public $priority = 'core';
public $cssClass = 'factory-bootstrap-331 factory-fontawesome-320';
public function __construct( $plugin ) {
parent::__construct( $plugin );
$this->title = __('Social Options', 'sociallocker');
}
/**
* Configures a metabox.
*/
public function configure( $scripts, $styles) {
$styles->add( BIZPANDA_SOCIAL_LOCKER_URL . '/admin/assets/css/social-options.050600.css');
$scripts->add( BIZPANDA_SOCIAL_LOCKER_URL . '/admin/assets/js/social-options.050600.js');
}
/**
* Configures a form that will be inside the metabox.
*
* @see FactoryMetaboxes321_FormMetabox
* @since 1.0.0
*
* @param FactoryForms328_Form $form A form object to configure.
* @return void
*/
public function form( $form ) {
require_once OPANDA_BIZPANDA_DIR . '/admin/includes/plugins.php';
$sociallockerUrl = OPanda_Plugins::getPremiumUrl('sociallocker');
$tabs = array(
'type' => 'tab',
'align' => 'vertical',
'class' => 'social-settings-tab',
'items' => array()
);
$facebookIsActiveByDefault = true;
$twitterActiveByDefault = true;
$googleIsActiveByDefault = false;
$vkIsActiveByDefault = false;
// if the user has not updated the facebook app id, show a notice
$facebookAppId = get_option('opanda_facebook_app_id', '117100935120196');
// - Facebook Like Tab
$tabs['items'][] = array(
'type' => 'tab-item',
'name' => 'facebook-like',
'items' => array(
array(
'type' => 'checkbox',
'way' => 'buttons',
'title' => __('Available', 'sociallocker'),
'hint' => __('Set On, to activate the button.', 'sociallocker'),
'name' => 'facebook-like_available',
'default' => $facebookIsActiveByDefault
),
array(
'type' => 'url',
'title' => __('Facebook Page', 'sociallocker'),
'hint' => __('Set an URL of your facebook page which the user has to like in order to unlock your content.', 'sociallocker'),
'name' => 'facebook_like_url'
),
array(
'type' => 'textbox',
'title' => __('Button Title', 'sociallocker'),
'hint' => __('Optional. A title of the button that is situated on the covers in the themes "Secrets" and "Flat".', 'sociallocker'),
'name' => 'facebook_like_title',
'default' => __('like', 'sociallocker')
)
)
);
// - Twitter Tweet Tab
$tabs['items'][] = array(
'type' => 'tab-item',
'title' => '',
'name' => 'twitter-tweet',
'items' => array(
array(
'type' => 'checkbox',
'way' => 'buttons',
'title' => __('Available', 'sociallocker'),
'hint' => __('Set On, to activate the button.', 'sociallocker'),
'name' => 'twitter-tweet_available',
'default' => $twitterActiveByDefault
),
array(
'type' => 'url',
'title' => __('URL to tweet', 'sociallocker'),
'hint' => __('Set an URL which the user has to tweet in order to unlock your content. Leave this field empty to use an URL of the page where the locker will be located.', 'sociallocker'),
'name' => 'twitter_tweet_url'
),
array(
'type' => 'textarea',
'title' => __('Tweet', 'sociallocker'),
'hint' => __('Type a message to tweet. Leave this field empty to use default tweet (page title + URL). Also you can use the shortcode [post_title] in order to insert automatically a post title into the tweet.', 'sociallocker'),
'name' => 'twitter_tweet_text'
),
array(
'type' => 'checkbox',
'way' => 'buttons',
'title' => __('Skip Check', 'sociallocker'),
'hint' => __('Optional. Skip checking whether the user actually has tweeted or not. The locker will not ask for permissions to read tweets.', 'sociallocker'),
'name' => 'twitter_tweet_skip_auth'
),
array(
'type' => 'textbox',
'title' => __('Via', 'sociallocker'),
'hint' => __('Optional. Screen name of the user to attribute the Tweet to (without @).', 'sociallocker'),
'name' => 'twitter_tweet_via'
),
array(
'type' => 'textbox',
'title' => __('Button Title', 'sociallocker'),
'hint' => __('Optional. A title of the button that is situated on the covers in the themes "Secrets" and "Flat".', 'sociallocker'),
'name' => 'twitter_tweet_title',
'default' => __('tweet', 'sociallocker')
),
)
);
// - Facebook Share Tab
$tabs['items'][] = array(
'type' => 'tab-item',
'name' => 'facebook-share',
'items' => array(
array(
'type' => 'checkbox',
'way' => 'buttons',
'title' => __('Available', 'sociallocker'),
'hint' => __('Set On, to activate the button.', 'sociallocker'),
'name' => 'facebook-share_available',
'default' => false
),
array(
'type' => 'url',
'title' => __('URL to share', 'sociallocker'),
'hint' => __('Set an URL which the user has to share in order to unlock your content. Leave this field empty to use an URL of the page where the locker will be located.', 'sociallocker'),
'name' => 'facebook_share_url'
),
array(
'type' => 'textbox',
'title' => __('Button Title', 'sociallocker'),
'hint' => __('Optional. A title of the button that is situated on the covers in the themes "Secrets" and "Flat".', 'sociallocker'),
'name' => 'facebook_share_title',
'default' => __('share', 'sociallocker')
)
)
);
// - Twitter Follow Tab
$tabs['items'][] = array(
'type' => 'tab-item',
'name' => 'twitter-follow',
'items' => array(
array(
'type' => 'checkbox',
'way' => 'buttons',
'title' => __('Available', 'sociallocker'),
'hint' => __('Set On, to activate the button.', 'sociallocker'),
'name' => 'twitter-follow_available',
'default' => false
),
array(
'type' => 'url',
'title' => __('User to Follow', 'sociallocker'),
'hint' => __('Set an URL of your Twitter profile (for example, <a href="https://twitter.com/byonepress" target="_blank">https://twitter.com/byonepress</a>).', 'sociallocker'),
'name' => 'twitter_follow_url'
),
array(
'type' => 'checkbox',
'way' => 'buttons',
'title' => __('Skip Check', 'sociallocker'),
'hint' => __('Optional. Skip checking whether the user actually has followed or not. The locker will not ask for permissions to read followers.', 'sociallocker'),
'name' => 'twitter_follow_skip_auth'
),
array(
'type' => 'checkbox',
'way' => 'buttons',
'title' => __('Hide Username', 'sociallocker'),
'hint' => __('Optional. Set On to hide your username on the button (makes the button shorter). For the native button only.', 'sociallocker'),
'name' => 'twitter_follow_hide_name'
),
array(
'type' => 'textbox',
'title' => __('Button Title', 'sociallocker'),
'hint' => __('Optional. A title of the button that is situated on the covers in the themes "Secrets" and "Flat".', 'sociallocker'),
'name' => 'twitter_follow_title',
'default' => __('follow us', 'sociallocker')
)
)
);
// - YouTube Subscribe
// if the user has not set the cliend id, show a notice
$googleClientId = get_option('opanda_google_client_id', false );
$tabs['items'][] = array(
'type' => 'tab-item',
'name' => 'youtube-subscribe',
'items' => array(
array(
'type' => 'checkbox',
'way' => 'buttons',
'title' => __('Available', 'sociallocker'),
'hint' => __('Set On, to activate the button.', 'sociallocker'),
'name' => 'youtube-subscribe_available',
'default' => false
),
array(
'type' => 'textbox',
'title' => __('Channel ID', 'sociallocker'),
'hint' => __('Set a channel ID to subscribe (for example, <a href="http://www.youtube.com/channel/UCANLZYMidaCbLQFWXBC95Jg" target="_blank">UCANLZYMidaCbLQFWXBC95Jg</a>).', 'sociallocker'),
'name' => 'google_youtube_channel_id'
),
array(
'type' => 'textbox',
'title' => __('Button Title', 'sociallocker'),
'hint' => __('Optional. A visible title of the buttons that is used in some themes (by default only in the Secrets theme).', 'sociallocker'),
'name' => 'google_youtube_title',
'default' => __('subscribe', 'sociallocker')
)
)
);
// - LinkedIn Share Tab
$tabs['items'][] = array(
'type' => 'tab-item',
'name' => 'linkedin-share',
'items' => array(
array(
'type' => 'checkbox',
'way' => 'buttons',
'title' => __('Available', 'sociallocker'),
'hint' => __('Set On, to activate the button.', 'sociallocker'),
'name' => 'linkedin-share_available',
'default' => false
),
array(
'type' => 'url',
'title' => __('URL to share', 'sociallocker'),
'hint' => __('Set an URL which the user has to share in order to unlock your content. Leave this field empty to use an URL of the page where the locker will be located.', 'sociallocker'),
'name' => 'linkedin_share_url'
),
array(
'type' => 'textbox',
'title' => __('Button Title', 'sociallocker'),
'hint' => __('Optional. A title of the button that is situated on the covers in the themes "Secrets" and "Flat".', 'sociallocker'),
'name' => 'linkedin_share_title',
'default' => __('share', 'sociallocker')
)
)
);
$tabs = apply_filters('onp_sl_social_options', $tabs);
$defaultOrder = array();
if ( $vkIsActiveByDefault ) $defaultOrder[] = 'vk-like';
if ( $facebookIsActiveByDefault ) $defaultOrder[] = 'facebook-like';
if ( $twitterActiveByDefault ) $defaultOrder[] = 'twitter-tweet';
if ( $googleIsActiveByDefault ) $defaultOrder[] = 'google-plus';
$form->add(array(
array(
'type' => 'html',
'html' => array( $this, 'showSocialButtonsStyleSelector' )
),
array(
'type' => 'html',
'html' => '<div class="onp-sl-metabox-hint">
<strong>'.__('Hint', 'sociallocker').'</strong>: '.
__('Drag and drop the tabs to change the order of the buttons.', 'sociallocker').
'</div>'
),
array(
'type' => 'hidden',
'name' => 'buttons_order',
'default' => implode(',', $defaultOrder)
),
array(
'type' => 'hidden',
'name' => 'social_buttons_display'
),
array(
'type' => 'hidden',
'name' => 'social_buttons_size',
'default' => 'default'
),
array(
'type' => 'hidden',
'name' => 'social_buttons_counters',
'default' => 1
),
$tabs
));
}
public function showSocialButtonsStyleSelector() {
$styles = OPanda_ThemeManager::getSocialButtonsDisplayModes();
$sizes = OPanda_ThemeManager::getSocialButtonsSizes();
$this->printPreviewVars();
?>
<div id="opanda-button-styles-box" class="opanda-inline-form">
<div class="opanda-inline-group opanda-social-buttons-display-wrap">
<label for="opanda_social_buttons_display_select" class="control-label">
<i class="fa fa-bookmark-o" style="margin-right: 4px"></i>
<?php _e('Style of Buttons', 'opanda') ?>
</label>
<div class="control-group">
<select id="opanda_social_buttons_display_select" name="opanda_social_buttons_display_select" class="factory-dropdown factory-from-control-dropdown form-control" data-way="default">
<?php foreach ( $styles as $style ) { ?>
<option value="<?php echo $style['value'] ?>"><?php echo $style['title'] ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="opanda-inline-group opanda-social-buttons-size-wrap">
<label for="opanda_social_buttons_size_select" class="control-label">
<i class="fa fa-arrows-v" style="margin-right: 3px"></i>
<?php _e('Size', 'opanda') ?>
</label>
<div class="control-group">
<select id="opanda_social_buttons_size_select" name="opanda_social_buttons_size_select" class="factory-dropdown factory-from-control-dropdown form-control" data-way="default">
<?php foreach ( $sizes as $size ) { ?>
<option value="<?php echo $size['value'] ?>"><?php echo $size['title'] ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="opanda-inline-group opanda-social-buttons-counters-wrap">
<label for="opanda_social_buttons_counters_select" class="control-label">
<i class="fa fa-calculator" style="margin-right: 3px"></i>
<?php _e('Counters', 'opanda') ?>
</label>
<div class="control-group">
<select id="opanda_social_buttons_counters_select" name="opanda_social_buttons_counters_select" class="factory-dropdown factory-from-control-dropdown form-control" data-way="default">
<option value="1"><?php _e('Show Counters', 'opanda') ?></option>
<option value="0"><?php _e('Hide Counters', 'opanda') ?></option>
</select>
</div>
</div>
</div>
<?php
}
/**
* Prints variables needed for preview.
*/
public function printPreviewVars() {
$useOwnApps = opanda_get_option('own_apps_for_permissions', false);
$defaultAppId = '117100935120196';
$facebookAppId = get_option('opanda_facebook_app_id', $defaultAppId);
$socialProxyItems = [
'facebook_like' => [
'clientId' => true,
'clientSecret' => true
],
'facebook_share' => [
'clientId' => $facebookAppId && $facebookAppId !== $defaultAppId,
'clientSecret' => true
],
'google' => [
'clientId' => opanda_get_option('google_client_id', false),
'clientSecret' => opanda_get_option('google_client_secret', false)
],
'twitter' => [
'clientId' => opanda_get_option('twitter_social_app_consumer_key', false),
'clientSecret' => opanda_get_option('twitter_social_app_consumer_secret', false)
],
];
$facebookAppId = get_option('opanda_facebook_app_id', '117100935120196');
$facebookSocialProxyAppId = $useOwnApps && $facebookAppId && $facebookAppId !== $defaultAppId ? $facebookAppId : '';
?>
<script>
window.opanda_lang = '<?php echo get_option('opanda_lang', 'US_en') ?>';
window.opanda_short_lang = '<?php echo get_option('opanda_short_lang', 'en') ?>';
window.opanda_facebook_app_id = '<?php echo $facebookAppId ?>';
window.opanda_facebook_version = '<?php echo get_option('opanda_facebook_version', 'v7.0') ?>';
window.facebook_share_social_proxy_app_id = '<?php echo $facebookSocialProxyAppId ?>';
<?php foreach( $socialProxyItems as $itemName => $itemValues ) { ?>
window.<?php echo $itemName ?>_social_proxy = <?php if ( $useOwnApps && !empty($itemValues['clientId'] ) && !empty( $itemValues['clientSecret']) ) { ?>{
'url': '<?php echo opanda_local_proxy_url() ?>',
'paramPrefix': 'opanda'
}<?php } else { ?>{
'endpoint': '<?php echo opanda_remote_social_proxy_url() ?>',
'paramPrefix': null
}<?php } ?>;
<?php } ?>
</script>
<?php
}
}
FactoryMetaboxes321::register('OPanda_SocialOptionsMetaBox', $bizpanda);

View File

@@ -0,0 +1,91 @@
<?php
class OPanda_SocialLocker_Detailed_StatsTable extends OPanda_StatsTable {
public function getColumns() {
return array(
'index' => array(
'title' => ''
),
'title' => array(
'title' => __('Post Title', 'sociallocker')
),
'unlock' => array(
'title' => __('Total', 'sociallocker'),
'hint' => __('The total number of unlocks made by visitors.', 'sociallocker'),
'highlight' => true,
'cssClass' => 'opanda-col-number'
),
'channels' => array(
'title' => __('Unlocks Via', 'sociallocker'),
'cssClass' => 'opanda-col-common',
'columns' => array(
'unlock-via-facebook-like' => array(
'title' => __('FB Like'),
'cssClass' => 'opanda-col-number'
),
'unlock-via-facebook-share' => array(
'title' => __('FB Share'),
'cssClass' => 'opanda-col-number'
),
'unlock-via-twitter-tweet' => array(
'title' => __('Twitter Tweet'),
'cssClass' => 'opanda-col-number'
),
'unlock-via-twitter-follow' => array(
'title' => __('Twitter Follow'),
'cssClass' => 'opanda-col-number'
),
'unlock-via-youtube-subscribe' => array(
'title' => __('YouTube Subscribe'),
'cssClass' => 'opanda-col-number'
),
'unlock-via-linkedin-share' => array(
'title' => __('LinkedIn Share'),
'cssClass' => 'opanda-col-number'
)
)
)
);
}
}
class OPanda_SocialLocker_Detailed_StatsChart extends OPanda_StatsChart {
public $type = 'line';
public function getFields() {
return array(
'aggregate_date' => array(
'title' => __('Date')
),
'unlock-via-facebook-like' => array(
'title' => __('FB Likes'),
'color' => '#7089be'
),
'unlock-via-facebook-share' => array(
'title' => __('FB Shares'),
'color' => '#566a93'
),
'unlock-via-twitter-tweet' => array(
'title' => __('Tweets'),
'color' => '#3ab9e9'
),
'unlock-via-twitter-follow' => array(
'title' => __('Twitter Followers'),
'color' => '#1c95c3'
),
'unlock-via-youtube-subscribe' => array(
'title' => __('YouTube Subscribe'),
'color' => '#8f352b'
),
'unlock-via-linkedin-share' => array(
'title' => __('LinkedIn Shares'),
'color' => '#006080'
)
);
}
}

View File

@@ -0,0 +1,59 @@
<?php
class OPanda_SocialLocker_Skips_StatsTable extends OPanda_StatsTable {
public function getColumns() {
return array(
'index' => array(
'title' => ''
),
'title' => array(
'title' => __('Post Title', 'sociallocker')
),
'unlock' => array(
'title' => __('Number of Unlocks', 'sociallocker'),
'hint' => __('The number of unlocks made by visitors.', 'sociallocker'),
'highlight' => true,
'cssClass' => 'opanda-col-number'
),
'skip-via-timer' => array(
'title' => __('Skipped by Timer'),
'cssClass' => 'opanda-col-number'
),
'skip-via-cross' => array(
'title' => __('Skipped by Close Icon'),
'cssClass' => 'opanda-col-number'
)
);
}
}
class OPanda_SocialLocker_Skips_StatsChart extends OPanda_StatsChart {
public $type = 'column';
public function getFields() {
return array(
'aggregate_date' => array(
'title' => __('Date')
),
'unlock' => array(
'title' => __('Number of Unlocks', 'sociallocker'),
'color' => '#0074a2'
),
'skip-via-timer' => array(
'title' => __('Skipped by Timer'),
'color' => '#333333'
),
'skip-via-cross' => array(
'title' => __('Skipped by Close Icon'),
'color' => '#dddddd'
)
);
}
}

View File

@@ -0,0 +1,52 @@
<?php
class OPanda_SocialLocker_Summary_StatsTable extends OPanda_StatsTable {
public function getColumns() {
return array(
'index' => array(
'title' => ''
),
'title' => array(
'title' => __('Post Title', 'sociallocker')
),
'impress' => array(
'title' => __('Impressions', 'sociallocker'),
'cssClass' => 'opanda-col-number'
),
'unlock' => array(
'title' => __('Number of Unlocks', 'sociallocker'),
'hint' => __('The number of unlocks made by visitors.', 'sociallocker'),
'highlight' => true,
'cssClass' => 'opanda-col-number'
),
'conversion' => array(
'title' => __('Conversion', 'sociallocker'),
'hint' => __('The ratio of the number of unlocks to impressions, in percentage.', 'sociallocker'),
'cssClass' => 'opanda-col-number'
)
);
}
}
class OPanda_SocialLocker_Summary_StatsChart extends OPanda_StatsChart {
public function getSelectors() {
return null;
}
public function getFields() {
return array(
'aggregate_date' => array(
'title' => __('Date')
),
'unlock' => array(
'title' => __('Number of Unlocks'),
'color' => '#0074a2'
)
);
}
}

View File

@@ -0,0 +1,321 @@
<?php
define('BIZPANDA_SOCIAL_LOCKER_DIR', dirname(__FILE__));
define('BIZPANDA_SOCIAL_LOCKER_URL', plugins_url( null, __FILE__ ));
if ( is_admin() ) require BIZPANDA_SOCIAL_LOCKER_DIR . '/admin/boot.php';
global $bizpanda;
/**
* Registers the Email Locker item.
*
* @since 1.0.0
*/
function opanda_register_social_locker( $items ) {
global $sociallocker;
$title = __('Social Locker', 'sociallocker');
$items['social-locker'] = array(
'name' => 'social-locker',
'type' => 'premium',
'title' => $title,
'help' => opanda_get_help_url('sociallocker'),
'description' => __('<p>Asks users to "pay with a like" or share to unlock content.</p><p>Perfect way to get more followers, attract social traffic and improve some social metrics.</p>', 'sociallocker'),
'shortcode' => 'sociallocker',
'plugin' => $sociallocker
);
return $items;
}
add_filter('opanda_items', 'opanda_register_social_locker', 1);
/**
* Adds options to print at the frontend.
* @param $options mixed[] Existing options that already added.
* @param $id An ID of the locker.
* @return mixed Updated options.
*/
function opanda_social_locker_options( $options, $id ) {
global $post;
$options['groups'] = array('social-buttons');
$options['socialButtons'] = array();
$buttonOrder = 'twitter-tweet,facebook-like';
$actualUrls = opanda_get_option('actual_urls', false);
$postUrl = !empty($post) ? get_permalink( $post->ID ) : null;
$postUrl = $actualUrls ? null : $postUrl;
$socialButtons = array(
'display' => opanda_get_item_option($id, 'social_buttons_display', false, 'covers-native'),
'coversSize' => opanda_get_item_option($id, 'social_buttons_size', false, 'default'),
'counters' => opanda_get_item_option($id, 'social_buttons_counters', false, 1),
'order' => opanda_get_item_option($id, 'buttons_order', false, $buttonOrder),
'behaviorOnError' => get_option( 'opanda_adblock', 'show_error'),
'behaviorError' => get_option(
'opanda_adblock_error',
__( 'Unable to create social buttons. Please make sure that nothing blocks loading of social scripts in your
browser. Some browser extentions (Avast, PrivDog, AdBlock, Adguard etc.) or usage of private tabs in FireFox
may cause this issue. Turn them off and try again.', 'bizpanda' ))
);
$options['socialButtons'] = array_merge( $options['socialButtons'], $socialButtons );
// removes buttons that are not allowed
$allowedButtons = array('facebook-like', 'facebook-share', 'twitter-tweet', 'twitter-follow', 'youtube-subscribe', 'linkedin-share');
$allowedButtons = apply_filters('opanda_social-locker_allowed_buttons', $allowedButtons);
if ( $options['socialButtons']['order'] ) {
$options['socialButtons']['order'] = explode( ',', $options['socialButtons']['order'] );
}
if ( empty( $options['socialButtons']['order'] ) ) {
unset( $options['socialButtons']['order'] );
} else {
$filteredButtons = array();
foreach( $options['socialButtons']['order'] as $buttonName ) {
if ( !in_array( $buttonName, $allowedButtons ) ) continue;
$filteredButtons[] = $buttonName;
}
$options['socialButtons']['order'] = $filteredButtons;
}
$buttons = $options['socialButtons']['order'];
// proxy to use
$useOwnApps = opanda_get_option('own_apps_for_permissions', false);
$localSocialProxy = [
'url' => opanda_local_proxy_url(),
'paramPrefix' => 'opanda'
];
$remoteSocialProxy = [
'endpoint' => opanda_remote_social_proxy_url(),
'paramPrefix' => null
];
// Facebook
if ( in_array( 'facebook-like', $buttons ) || in_array( 'facebook-share', $buttons ) ) {
$defaultAppId = '117100935120196';
$facebookAppId = opanda_get_option('facebook_app_id', $defaultAppId);
$options['socialButtons']['facebook'] = array(
'appId' => $facebookAppId,
'lang' => opanda_get_option('lang', 'en_GB'),
'version' => opanda_get_option('facebook_version', 'v7.0'),
'like' => array(
'url' => opanda_get_dynamic_url( $id, 'facebook_like_url', $postUrl),
'title' => opanda_get_item_option($id, 'facebook_like_title' )
)
);
if ( in_array( 'facebook-like', $buttons ) ) {
$options['socialButtons']['facebook']['like'] = array(
'url' => opanda_get_dynamic_url( $id, 'facebook_like_url', $postUrl),
'title' => opanda_get_item_option($id, 'facebook_like_title' ),
'socialProxy' => $localSocialProxy
);
}
if ( in_array( 'facebook-share', $buttons ) ) {
$options['socialButtons']['facebook']['share'] = array(
'url' => opanda_get_dynamic_url($id, 'facebook_share_url', $postUrl),
'title' => opanda_get_item_option($id, 'facebook_share_title'),
'shareDialog' => true,
'counter' => opanda_get_item_option($id, 'facebook_share_counter_url')
);
if ( $useOwnApps && !empty( $facebookAppId ) && $facebookAppId !== $defaultAppId ) {
$options['socialButtons']['facebook']['share']['socialProxyAppId'] = $facebookAppId;
$options['socialButtons']['facebook']['share']['socialProxy'] = $localSocialProxy;
} else {
$options['socialButtons']['facebook']['share']['socialProxyAppId'] = false;
$options['socialButtons']['facebook']['share']['socialProxy'] = $remoteSocialProxy;
}
}
}
// Twitter
if ( in_array( 'twitter-tweet', $buttons ) || in_array( 'twitter-follow', $buttons ) ) {
$options['socialButtons']['twitter'] = array(
'lang' => opanda_get_option('short_lang', 'en')
);
$clientId = opanda_get_option('twitter_social_app_consumer_key', false);
$clientSecret = opanda_get_option('twitter_social_app_consumer_secret', false);
if ( in_array( 'twitter-tweet', $buttons ) ) {
$tweetText = opanda_get_item_option($id, 'twitter_tweet_text' );
$options['socialButtons']['twitter']['tweet'] = array(
'url' => opanda_get_dynamic_url( $id, 'twitter_tweet_url', $postUrl),
'text' => $tweetText,
'skipCheck' => opanda_get_item_option($id, 'twitter_tweet_skip_auth'),
'title' => opanda_get_item_option($id, 'twitter_tweet_title' ),
'via' => opanda_get_item_option($id, 'twitter_tweet_via' )
);
if ( $useOwnApps && !empty( $clientId ) && !empty( $clientSecret ) ) {
$options['socialButtons']['twitter']['tweet']['socialProxy'] = $localSocialProxy;
} else {
$options['socialButtons']['twitter']['tweet']['socialProxy'] = $remoteSocialProxy;
}
// replaces shortcodes in the locker message and twitter text
if ( !empty( $tweetText ) ) {
$postTitle = $post != null ? $post->post_title : '';
$postUrl = $post != null ? get_permalink($post->ID) : '';
$tweetText = str_replace('[post_title]', $postTitle, $tweetText );
$options['socialButtons']['twitter']['tweet']['text'] = apply_filters('opanda_twitter_tweet_text', $tweetText, $id, $options);
}
}
if ( in_array( 'twitter-follow', $buttons ) ) {
$options['socialButtons']['twitter']['follow'] = array(
'url' => opanda_get_dynamic_url( $id, 'twitter_follow_url', $postUrl),
'title' => opanda_get_item_option($id, 'twitter_follow_title' ),
'skipCheck' => opanda_get_item_option($id, 'twitter_follow_skip_auth' ),
'hideScreenName' => opanda_get_item_option($id, 'twitter_follow_hide_name', false, false )
);
if ( $useOwnApps && !empty( $clientId ) && !empty( $clientSecret ) ) {
$options['socialButtons']['twitter']['follow']['socialProxy'] = $localSocialProxy;
} else {
$options['socialButtons']['twitter']['follow']['socialProxy'] = $remoteSocialProxy;
}
}
}
// YouTube
if ( in_array( 'youtube-subscribe', $buttons ) ) {
$options['socialButtons']['youtube'] = array(
'subscribe' => [
'channelId' => opanda_get_item_option($id, 'google_youtube_channel_id'),
'title' => opanda_get_item_option($id, 'google_youtube_title')
]
);
$clientId = opanda_get_option('google_client_id', false);
$clientSecret = opanda_get_option('google_client_secret', false);
if ( $useOwnApps && !empty( $clientId ) && !empty( $clientSecret ) ) {
$options['socialButtons']['youtube']['subscribe']['socialProxy'] = $localSocialProxy;
} else {
$options['socialButtons']['youtube']['subscribe']['socialProxy'] = $remoteSocialProxy;
}
}
// LinkedIn
if ( in_array( 'linkedin-share', $buttons ) ) {
$options['socialButtons']['linkedin'] = array(
'share' => array(
'url' => opanda_get_dynamic_url( $id, 'linkedin_share_url', $postUrl),
'title' => opanda_get_item_option($id, 'linkedin_share_title' )
)
);
}
// another languages
// downgrades
return $options;
}
add_filter('opanda_social-locker_item_options', 'opanda_social_locker_options', 10, 2);
/**
* Requests assets for email locker.
*/
function opanda_social_locker_assets( $lockerId, $options, $fromBody, $fromHeader ) {
OPanda_AssetsManager::requestLockerAssets();
OPanda_AssetsManager::requestTheme( isset( $options['opanda_style'] ) ? $options['opanda_style'] : false );
// Confirm Like
OPanda_AssetsManager::requestTextRes(array(
'confirm_like_screen_header',
'confirm_like_screen_message',
'confirm_like_screen_button'
));
// Miscellaneous
OPanda_AssetsManager::requestTextRes(array(
'misc_your_agree_with',
'misc_agreement_checkbox',
'misc_agreement_checkbox_alt',
'misc_terms_of_use',
'misc_privacy_policy',
'misc_close',
'misc_or_wait',
'errors_not_signed_in',
'errors_not_granted'
));
// Errors & Notices
OPanda_AssetsManager::requestTextRes(array(
'errors_no_consent'
));
if ( isset( $options['opanda_buttons_order'] ) && strpos( $options['opanda_buttons_order'], 'facebook-like' ) !== false ) {
OPanda_AssetsManager::requestFacebookSDK();
}
}
add_action('opanda_request_assets_for_social-locker', 'opanda_social_locker_assets', 10, 4);
/**
* A shortcode for the Social Locker
*
* @since 1.0.0
*/
class OPanda_SocialLockerShortcode extends OPanda_LockerShortcode {
/**
* Shortcode name
* @var string
*/
public $shortcodeName = array(
'sociallocker', 'sociallocker-1', 'sociallocker-2', 'sociallocker-3', 'sociallocker-4'
);
protected function getDefaultId() {
return get_option('opanda_default_social_locker_id');
}
}
FactoryShortcodes320::register( 'OPanda_SocialLockerShortcode', $bizpanda );