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,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 );