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,15 @@
<?php
// pages
class OPanda_AdminPage extends FactoryPages321_AdminPage {
/**
* Factory Dependencies
*
* @since 1.0.0
* @var string
*/
protected $deps = array(
'factory_core' => FACTORY_325_VERSION
);
}

View File

@@ -0,0 +1,755 @@
<?php
/**
* The file contains a short help info.
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2014, OnePress Ltd
*
* @package core
* @since 1.0.0
*/
/**
* Common Settings
*/
class OPanda_HowToUsePage extends FactoryPages321_AdminPage {
public $menuPostType = OPANDA_POST_TYPE;
public $id = "how-to-use";
public function __construct(Factory325_Plugin $plugin) {
parent::__construct($plugin);
$this->menuTitle = __('How to use?', 'bizpanda');
}
public function assets($scripts, $styles) {
$this->scripts->request('jquery');
$this->styles->add(OPANDA_BIZPANDA_URL . '/assets/admin/css/howtouse.030100.css');
$this->styles->request('bootstrap.core', 'bootstrap');
}
protected $_pages = false;
/**
* Returns an array of the pages of the section 'How to use?'.
*
* @since 1.0.0
* @return mixed[]
*/
protected function getPages() {
if ( $this->_pages !== false ) return $this->_pages;
$items = array(
array(
'name' => 'social-apps',
'title' => __('Creating Social Apps', 'bizpanda'),
'hollow' => true,
'items' => array(
array(
'name' => 'facebook-app',
'title' => __('Creating Facebook App', 'bizpanda')
),
array(
'name' => 'twitter-app',
'title' => __('Creating Twitter App', 'bizpanda')
),
array(
'name' => 'google-client-id',
'title' => __('Getting Google Client ID', 'bizpanda')
)
)
),
array(
'name' => 'zapier',
'title' => __('Zapier Integration', 'bizpanda')
),
array(
'name' => 'troubleshooting',
'title' => __('Troubleshooting', 'bizpanda')
)
);
$items[0]['items'][] = array(
'name' => 'linkedin-api-key',
'title' => __('Getting LinkedIn API Key', 'bizpanda')
);
$this->_pages = apply_filters( 'opanda_help_pages', $items );
return $this->_pages;
}
/**
* Returns a current page name.
*
* @since 1.0.0
* @return string The current page name or null.
*/
protected function _getCurrentPageName() {
if ( isset( $_GET['onp_sl_page'] ) ) return $_GET['onp_sl_page'];
$pages = $this->getPages();
return $pages[0]['name'];
}
/**
* Returns a parent page name of the current page.
*
* @since 1.0.0
* @return string|null A page name of the current parent page or null.
*/
protected function _getCurrentParentPage() {
$current = $this->_getCurrentPageName();
$page = $this->getPageData( $current );
if ( $page ) return $page['parent'];
return null;
}
/**
* Returns data of the specified page, including the parent page name.
*
* @since 1.0.0
* @return mixed[]|null The page data or null.
*/
protected function _getPageData( $name, $parent = null, $haystack = null ) {
$haystack = ( empty( $haystack ) ) ? $this->getPages() : $haystack;
foreach( $haystack as $page ) {
if ( $page['name'] == $name ) {
$page['parent'] = $parent['name'];
return $page;
}
if ( isset( $page['items'] ) ) {
$result = $this->_getPageData( $name, $page, $page['items'] );
if ( $result ) return $result;
}
}
return null;
}
/**
* Gets the full path (which includes all parent pages) to a given page.
*
* @param type $pageName A page name to return the full path.
* @return mixed[] The navigation branch.
*/
protected function _getPageTree( $pageName = null ) {
if ( empty( $pageName ) ) $pageName = $this->_getCurrentPageName();
$tree = array();
$pageNameToSearch = $pageName;
while( true ) {
$pageData = $this->_getPageData( $pageNameToSearch );
if ( empty( $pageData ) ) break;
$tree[] = $pageData['name'];
if ( empty( $pageData['parent']) ) break;
$pageNameToSearch = $pageData['parent'];
}
return $tree;
}
/**
* Renders the navigation.
*
* @since 1.0.0
* @return void
*/
protected function _renderNav( $currents = array() ) {
$pages = $this->getPages();
$index = 1;
?>
<div class="onp-help-nav">
<?php foreach( $pages as $item ) {
$item['title'] = $index . '. ' . $item['title'];
$index++;
$this->_renderNavItem( $item, 0, $currents );
} ?>
</div>
<?php
}
/**
* Renders a single navigation item including its childs.
*
* @since 1.0.0
* @param string[] $item Navigation item to renders.
* @param int $level Current navigation level, used in the recursion.
* @return void
*/
protected function _renderNavItem( $item, $level = 0, $currents = array() ) {
$classes = array();
$classes[] = 'onp-help-nav-level';
$classes[] = 'onp-help-nav-level-' . $level;
switch($level) {
case 0:
$classes[] = 'onp-help-nav-category';
break;
case 1:
$classes[] = 'onp-help-nav-page';
break;
case 2:
$classes[] = 'onp-help-nav-subpage';
break;
}
$classes[] = 'onp-help-' . $item['name'];
if ( in_array( $item['name'], $currents ) ) {
$classes[] = 'onp-help-active-item';
}
$isGroup = isset( $item['items'] );
if ( $isGroup ) $classes[] = 'onp-has-subitems';
$class = implode(' ', $classes);
$level = $level + 1;
$url = $isGroup && ( isset( $item['hollow'] ) && $item['hollow'] )
? $this->getActionUrl('index', array('onp_sl_page' => $item['items'][0]['name'] ) )
: $this->getActionUrl('index', array('onp_sl_page' => $item['name'] ) );
?>
<div class="<?php echo $class ?>">
<div class="onp-inner-wrap">
<a href="<?php echo $url; ?>">
<?php if ( $isGroup ): ?>
<l class="fa fa-plus-square-o"></l>
<l class="fa fa-minus-square-o"></l>
<?php endif ?>
<span><?php echo $item['title'] ?></span>
</a>
<?php if ( isset( $item['items'] )): ?>
<div class="onp-help-nav-subitems">
<?php foreach( $item['items'] as $subItem ) { $this->_renderNavItem( $subItem, $level, $currents ); } ?>
</div>
<?php endif ?>
</div>
</div>
<?php
}
/**
* Shows the content table for a given navigatin item (category, page).
*
* @param mixed[] $page An
* @return type
*/
public function showContentTable( $page = null ) {
$page = empty( $page ) ? $this->current : $page;
if ( empty( $page) ) return;
$data = $this->_getPageData( $page );
if ( empty( $data['items']) ) return;
?>
<ul>
<?php foreach( $data['items'] as $item ) { ?>
<li>
<a href="<?php $this->actionUrl('index', array( 'onp_sl_page' => $item['name'] )) ?>"><?php echo $item['title'] ?></a>
</li>
<?php } ?>
</ul>
<?php
}
/**
* Shows one of the help pages.
*
* @sinve 1.0.0
* @return void
*/
public function indexAction() {
$this->current = $this->_getCurrentPageName();
$this->currents = $this->_getPageTree();
add_action('opanda_help_page_facebook-app', array($this, 'facebookApp' ));
add_action('opanda_help_page_twitter-app', array($this, 'twitterApp' ));
add_action('opanda_help_page_google-client-id', array($this, 'googleClientId' ));
add_action('opanda_help_page_linkedin-api-key', array($this, 'linkedinApiKey' ));
add_action('opanda_help_page_troubleshooting', array($this, 'troubleshooting' ));
add_action('opanda_help_page_zapier', array($this, 'zapier' ));
?>
<div class="wrap factory-bootstrap-331 factory-fontawesome-320">
<?php $this->_renderNav( $this->currents ) ?>
<div class="onp-help-content">
<div class="onp-inner-wrap">
<?php do_action('opanda_help_page_' . $this->current, $this ) ?>
</div>
</div>
</div>
<?php
return;
}
/**
* Shows 'Troubleshooting'
*
* @sinve 1.0.0
* @return void
*/
public function troubleshooting() {
?>
<div class="onp-help-section">
<h1><?php _e('Troubleshooting', 'bizpanda'); ?></h1>
<p><?php _e('If you have any questions or faced with any troubles while using our plugin, please check our <a href="http://support.onepress-media.com/" target="_blank">knowledge base</a>. It is possible that instructions for resolving your issue have already been posted.', 'bizpanda'); ?></p>
<p>
<?php _e('If the answer to your question isn\'t listed, please submit a ticket <a href="http://support.onepress-media.com/create-ticket/" target="_blank">here</a>.<br />You can also email us directly <strong>support@byonepress.com</strong>', 'bizpanda'); ?>
</p>
</div>
<?php
}
/**
* Shows 'Get more features!'
*
* @sinve 1.0.0
* @return void
*
*/
public function premium() {
global $optinpanda;
$alreadyActivated = get_option('onp_trial_activated_' . $optinpanda->pluginName, false);
?>
<div class="onp-help-section">
<?php if ( !$alreadyActivated ) { ?>
<h1><?php _e('Try Premium Version For 7 Days For Free!', 'bizpanda'); ?></h1>
<?php } else { ?>
<h1><?php _e('Upgrade Opt-In Panda To Premium!', 'bizpanda'); ?></h1>
<?php } ?>
<?php if ( !$alreadyActivated ) { ?>
<p>
<?php printf( __('The plugin you are using is a free version of the popular <a target="_blank" href="%s"> Opt-In Panda</a> plugin.
We offer you to try the premium version for 7 days absolutely for free. We sure you will love it.', 'bizpanda'), onp_licensing_325_get_purchase_url( $this->plugin ) ) ?>
</p>
<p>
<?php _e('Check out the table below to know about the premium features.', 'bizpanda'); ?>
</p>
<?php } else { ?>
<p>
<?php _e('The plugin you are using is a free version of the popular <a target="_blank" href="%s"> Opt-In Panda plugin</a> sold on CodeCanyon.', 'bizpanda') ?>
<?php _e('Check out the table below to know about all the premium features.', 'bizpanda'); ?>
</p>
<?php } ?>
</div>
<div class="onp-help-section">
<h2><i class="fa fa-star-o"></i> Comparison of Free & Premium Versions</h2>
<p>Click on the dotted title to learn more about a given feature.</p>
<table class="table table-bordered onp-how-comparation">
<thead>
<tr>
<th></th>
<th>Free</th>
<th class="onp-how-premium">Premium</th>
</tr>
</thead>
<tbody>
<tr>
<td class="onp-how-title">Unlimited Lockers</td>
<td class="onp-how-yes">yes</td>
<td class="onp-how-yes onp-how-premium">yes</td>
</tr>
<tr>
<td class="onp-how-title">Locking via shortcodes</td>
<td class="onp-how-yes">yes</td>
<td class="onp-how-yes onp-how-premium">yes</td>
</tr>
<tr>
<td class="onp-how-title">Batch Locks</td>
<td class="onp-how-yes">yes</td>
<td class="onp-how-yes onp-how-premium">yes</td>
</tr>
<tr>
<td class="onp-how-title"><a href="#social-options">Individual settings for each button</a></td>
<td class="onp-how-no">no</td>
<td class="onp-how-yes onp-how-premium"><strong>yes</strong></td>
</tr>
<tr>
<td class="onp-how-title"><a href="#extra-options">Visibility Options</a></td>
<td class="onp-how-no">no</td>
<td class="onp-how-yes onp-how-premium"><strong>yes</strong></td>
</tr>
<td class="onp-how-title"><a href="#extra-options">Advanced Options</a></td>
<td class="onp-how-no">no</td>
<td class="onp-how-yes onp-how-premium"><strong>yes</strong></td>
</tr>
<tr>
<td class="onp-how-group-title"><i class="fa fa-bullhorn"></i> Social Buttons</td>
<td class="onp-how-yes"></td>
<td class="onp-how-yes onp-how-premium"></td
</tr>
<tr>
<td class="onp-how-title">Facebook Like</td>
<td class="onp-how-yes">yes</td>
<td class="onp-how-yes onp-how-premium">yes</td>
</tr>
<tr>
<td class="onp-how-title">Twitter Tweet</td>
<td class="onp-how-yes">yes</td>
<td class="onp-how-yes onp-how-premium">yes</td>
</tr>
<tr>
<td class="onp-how-title">Google +1</td>
<td class="onp-how-yes">yes</td>
<td class="onp-how-yes onp-how-premium">yes</td>
</tr>
<tr>
<td class="onp-how-title">Facebook Share</a></td>
<td class="onp-how-no">no</td>
<td class="onp-how-yes onp-how-premium"><strong>yes</strong></td>
</tr>
<tr>
<td class="onp-how-title">Twitter Follow</td>
<td class="onp-how-no">no</td>
<td class="onp-how-yes onp-how-premium"><strong>yes</strong></td>
</tr>
<tr>
<td class="onp-how-title">LinkedIn Share</td>
<td class="onp-how-no">no</td>
<td class="onp-how-yes onp-how-premium"><strong>yes</strong></td>
</tr>
<tr>
<td class="onp-how-title">Google Share</td>
<td class="onp-how-no">no</td>
<td class="onp-how-yes onp-how-premium"><strong>yes</strong></td>
</tr>
<tr>
<td class="onp-how-group-title"><i class="fa fa-adjust"></i> Overlap Modes</td>
<td class="onp-how-yes"></td>
<td class="onp-how-yes onp-how-premium"></td>
</tr>
<tr>
<td class="onp-how-title">Full</td>
<td class="onp-how-yes">yes</td>
<td class="onp-how-yes onp-how-premium">yes</td>
</tr>
<tr>
<td class="onp-how-title">Transparency</td>
<td class="onp-how-yes">yes</td>
<td class="onp-how-yes onp-how-premium">yes</td>
</tr>
<tr>
<td class="onp-how-title"><a href="#blurring">Blurring (new!)</a></td>
<td class="onp-how-no">no</td>
<td class="onp-how-yes onp-how-premium"><strong>yes</strong></td>
</tr>
<tr>
<td class="onp-how-group-title"><i class="fa fa-picture-o"></i> Themes</td>
<td class="onp-how-yes"></td>
<td class="onp-how-yes onp-how-premium"></td
</tr>
<tr>
<td class="onp-how-title onp-how-group-in-group">The 'Secrets' Theme</td>
<td class="onp-how-yes">yes</td>
<td class="onp-how-yes onp-how-premium">yes</td>
</tr>
<tr>
<td class="onp-how-title onp-how-group-in-group"><a href="#extra-themes">The 'Flat' Theme (new!)</a></td>
<td class="onp-how-no">no</td>
<td class="onp-how-yes onp-how-premium"><strong>yes</strong></td>
</tr>
<tr>
<td class="onp-how-title onp-how-group-in-group"><a href="#extra-themes">The 'Dandyish' Theme</a></td>
<td class="onp-how-no">no</td>
<td class="onp-how-yes onp-how-premium"><strong>yes</strong></td>
</tr>
<tr>
<td class="onp-how-title onp-how-group-in-group"><a href="#extra-themes">The 'Glass' Theme</a></td>
<td class="onp-how-no">no</td>
<td class="onp-how-yes onp-how-premium"><strong>yes</strong></td>
</tr>
<tr>
<td class="onp-how-group-title"><i class="fa fa-clock-o"></i> Services</td>
<td class="onp-how-yes"></td>
<td class="onp-how-yes onp-how-premium"></td
</tr>
<tr>
<td class="onp-how-title onp-how-group-in-group"><a href="#updates">Updates</a></td>
<td class="onp-how-no">not guaranteed</td>
<td class="onp-how-yes onp-how-premium"><strong>primary updates</strong></td>
</tr>
<tr>
<td class="onp-how-title"><a href="#support">Support</a></td>
<td class="onp-how-no">not guaranteed</td>
<td class="onp-how-yes onp-how-premium"><strong>dedicated support</strong></td>
</tr>
</tbody>
</table>
<?php if ( !$alreadyActivated ) { ?>
<div>
<a class="button button-primary" id="activate-trial-btn" href="<?php echo onp_licensing_325_manager_link($this->plugin->pluginName, 'activateTrial', false ) ?>">
<i class="fa fa-star-o"></i>
Click Here To Activate Your Free Trial For 7 Days
<i class="fa fa-star-o"></i>
<br />
<small>(instant activation by a click)</small>
</a>
</div>
<?php } else { ?>
<div class='factory-bootstrap-331'>
<a class="btn btn-gold" id="onp-sl-purchase-btn" href="<?php echo onp_licensing_325_get_purchase_url( $this->plugin ) ?>">
<i class="fa fa-star"></i>
Purchase Opt-In Panda Premium For $26
<i class="fa fa-star"></i>
</a>
</div>
<?php } ?>
</div>
<?php if ( !$alreadyActivated ) { ?>
<div class="onp-help-section">
<p style="text-align: center;">
<a href="<?php echo onp_licensing_325_get_purchase_url( $this->plugin ) ?>"><strong>Or Buy The Opt-In Panda Right Now For $26</strong></a>
</p>
<div class="onp-remark">
<div class="onp-inner-wrap">
<p><?php _e('You can purchase the premium version at any time within your trial period or right now. After purchasing you will get a license key to unlock all the plugin features.', 'bizpanda'); ?></p>
<p><?php printf(__('<strong>To purchase the Opt-In Panda</strong>, <a target="_blank" href="%s">click here</a> to visit the plugin page on CodeCanyon. Then click the "Purchase" button on the right sidebar.', 'bizpanda'), onp_licensing_325_get_purchase_url( $this->plugin )); ?></p>
</div>
</div>
</div>
<?php } ?>
<div class="onp-help-section">
<p>Upgrade To Premium and get all the following features:</p>
</div>
<div class="onp-help-section" id="social-options">
<h1>
<i class="fa fa-star-o"></i> <?php _e('Drive More Traffic & Build Quality Followers', 'bizpanda'); ?>
</h1>
<p><?php _e('The premium version of the plugin provides 7 social buttons for all major social networks: Facebook, Twitter, Google, LinkedIn, including the Twitter Follow button. You can use them together or separately for customized results.', 'bizpanda') ?></p>
<p class='onp-img'>
<img src='http://cconp.s3.amazonaws.com/bizpanda/social-options.png' />
</p>
<p><?php _e('What\'s more, each button has individual settings (this way you can set an individual URL for each button).') ?>
<p><?php _e('<strong>For example</strong>, you can set up the locker to get followers your Twitter account, fans for your Facebook page, +1s for a home page of your website.', 'bizpanda') ?></p>
</div>
<div class="onp-help-section" id="extra-options">
<h1>
<i class="fa fa-star-o"></i> <?php _e('Set How, When and For Whom Your Lockers Appear', 'bizpanda'); ?>
</h1>
<p>Of course, each website has its own unique audience. We know that a good business is an agile business. The premium version of Opt-In Panda provides 8 additional options that allow you to configure the lockers flexibly to meet your needs.</p>
<p class='onp-img'>
<img src='http://cconp.s3.amazonaws.com/bizpanda/advanced-options.png' />
</p>
<div class="clearfix"></div>
</div>
<div class="onp-help-section" id='blurring'>
<h1>
<i class="fa fa-star-o"></i> <?php _e('Create Highly Shareable Content Via The Blur Effect', 'bizpanda'); ?>
</h1>
<p>The previous versions of the plugin allowed only to hide the locked content totally. But recently we have added the long-awaited option to overlap content and make it transparent or blurred.</p>
<p class='onp-img'>
<img src='http://cconp.s3.amazonaws.com/bizpanda/blur-effect.png' />
</p>
<p>When we tested this feature on sites of some our customers, we were blown away how this feature attracts attention of the huge number of visitors. If people see and understand that they will get after unlocking, the plugin works more effectively.</p>
</div>
<div class="onp-help-section" id='extra-themes'>
<h1>
<i class="fa fa-star-o"></i> <?php _e('3 Extra Stunning Themes For Your Lockers', 'bizpanda'); ?>
</h1>
<p>
<p>The premium version of Opt-In Panda comes with 3 extra impressive, polished styles which create interest and attract attention. They are nicely animated and don't look obtrusive:</p>
<ul>
<li><strong>Dandyish</strong>. A very bright theme to attract maximum attention!</li>
<li><strong>Flat (new!)</strong>. An extremely awesome theme based on the latest web technologies that will make your site a superstar. It's truly fascinating!</li>
<li><strong>Glass</strong>. A theme with transparent background which looks good on any website.</li>
</ul>
</p>
<p class='onp-img'>
<img src='http://cconp.s3.amazonaws.com/bizpanda/new-themes.png' />
</p>
</div>
<div class="onp-help-section" id='updates'>
<h1>
<i class="fa fa-star-o"></i> <?php _e('Get New Features & Updates Almost Every Week', 'bizpanda'); ?>
</h1>
<p>We release about 3-4 updates each month, adding new features and fixing bugs. The Free version does not guarantee that you will get all the major updates. But if you upgrade to the Premium version, your copy of the plugin will be always up-to-date.</p>
</div>
<div class="onp-help-section" id='support'>
<h1>
<i class="fa fa-star-o"></i> <?php _e('Guaranteed Support Within 24h', 'bizpanda'); ?>
</h1>
<p>
All of our plugins come with free support. We care about your plugin after purchase just as much as you do. We want to make your life easier and make you happy about choosing our plugins.
</p>
<p>
Unfortunately we receive plenty of support requests every day and we cannot answer to all the users quickly. But for the users of the premium version (and the trial version), we guarantee to respond to every inquiry within 1 business day (typical response time is 3 hours).
</p>
</div>
<?php if ( !$alreadyActivated ) { ?>
<div class="onp-help-section">
<div>
<a class="button button-primary" id="activate-trial-btn" href="<?php echo onp_licensing_325_manager_link($this->plugin->pluginName, 'activateTrial', false ) ?>">
<i class="fa fa-star-o"></i>
Click Here To Activate Your Free Trial For 7 Days
<i class="fa fa-star-o"></i>
<br />
<small>(instant activation by a click)</small>
</a>
</div>
</div>
<div class="onp-help-section">
<p style="text-align: center;">
<a href="<?php echo onp_licensing_325_get_purchase_url( $this->plugin ) ?>"><strong>Or Buy The Opt-In Panda Right Now For $26</strong></a>
</p>
<div class="onp-remark">
<div class="onp-inner-wrap">
<p><?php _e('You can purchase the premium version at any time within your trial period or right now. After purchasing you will get a license key to unlock all the plugin features.', 'bizpanda'); ?></p>
<p><?php printf(__('<strong>To purchase the Opt-In Panda</strong>, <a target="_blank" href="%s">click here</a> to visit the plugin page on CodeCanyon. Then click the "Purchase" button on the right sidebar.', 'bizpanda'), onp_licensing_325_get_purchase_url( $this->plugin )); ?></p>
</div>
</div>
</div>
<?php } else { ?>
<div class="onp-help-section">
<div class='factory-bootstrap-331'>
<a class="btn btn-gold" id="onp-sl-purchase-btn" href="<?php echo onp_licensing_325_get_purchase_url( $this->plugin ) ?>">
<i class="fa fa-star"></i>
Purchase Opt-In Panda Premium For $26
<i class="fa fa-star"></i>
</a>
</div>
</div>
<?php } ?>
<?php
}
/**
* Page 'Creating Social Apps'
*
* @since 1.0.0
* @return void
*/
public function socialApps() {
require OPANDA_BIZPANDA_DIR . '/admin/pages/how-to-use/social-apps.php';
}
/**
* Page 'Creating Social Apps' => 'Creating Facebook App'
*
* @since 1.0.0
* @return void
*/
public function facebookApp() {
require OPANDA_BIZPANDA_DIR . '/admin/pages/how-to-use/facebook-app.php';
}
/**
* Page 'Creating Social Apps' => 'Creating Twitter App'
*
* @since 1.0.0
* @return void
*/
public function twitterApp() {
require OPANDA_BIZPANDA_DIR . '/admin/pages/how-to-use/twitter-app.php';
}
/**
* Page 'Creating Social Apps' => 'Getting Google Client ID'
*
* @since 1.0.0
* @return void
*/
public function googleClientId() {
require OPANDA_BIZPANDA_DIR . '/admin/pages/how-to-use/google-app.php';
}
/**
* Page 'Creating Social Apps' => 'Getting LinkedIn API Key'
*
* @since 1.0.0
* @return void
*/
public function linkedinApiKey() {
require OPANDA_BIZPANDA_DIR . '/admin/pages/how-to-use/linkedin-app.php';
}
/**
* Page 'Important Notes'
*
* @since 1.0.0
* @return void
*/
public function notes() {
require OPANDA_BIZPANDA_DIR . '/admin/pages/how-to-use/notes.php';
}
/**
* Page 'Important Notes' => 'Using the Facebook Like with the Social Locker'
*
* @since 1.0.0
* @return void
*/
public function facebookLike() {
require OPANDA_BIZPANDA_DIR . '/admin/pages/how-to-use/facebook-like.php';
}
/**
* Page 'SSL Certificate'
*
* @since 1.0.0
* @return void
*/
public function ssl() {
require OPANDA_BIZPANDA_DIR . '/admin/pages/how-to-use/ssl.php';
}
/**
* Page 'Zapier Integration'
*
* @since 1.0.0
* @return void
*/
public function zapier() {
require OPANDA_BIZPANDA_DIR . '/admin/pages/how-to-use/zapier.php';
}
}
FactoryPages321::register($bizpanda, 'OPanda_HowToUsePage');

View File

@@ -0,0 +1,145 @@
<div class="onp-help-section">
<h1><?php _e('Creating Facebook App', 'bizpanda'); ?></h1>
<p>
<?php _e('A Facebook App is required for the following buttons:', 'bizpanda'); ?>
<ul>
<?php if ( BizPanda::hasPlugin('sociallocker') ) { ?>
<li><?php _e('Facebook Like of the Social Locker.', 'bizpanda') ?></li>
<li><?php _e('Facebook Share of the Social Locker.', 'bizpanda') ?></li>
<?php } ?>
<li><?php _e('Facebook Sign-In of the Sign-In Locker.', 'bizpanda') ?></li>
<?php if ( BizPanda::hasPlugin('optinpanda') ) { ?>
<li><?php _e('Facebook Subscribe of the Email Locker.', 'bizpanda') ?></li>
<?php } ?>
</ul>
</p>
<p><?php _e('By default the plugin utilises its own fully configured Facebook app.', 'bizpanda') ?></p>
<p><?php _e('So you <strong>don\'t need to create your own app</strong>. Nonetheless you can create your own app, for example, to replace the app logo on the authorization screen with your website logo.') ?></p>
</div>
<div class="onp-help-section">
<p><?php printf( __('1. Open the website <a href="%s" target="_blank">developers.facebook.com</a> and click <strong>Add a New App</strong> (you have to be logged in):', 'bizpanda'), 'https://developers.facebook.com/' ) ?></p>
<p class='onp-img'>
<img src="http://cconp.s3.amazonaws.com/bizpanda/facebook-app/v3/1.png">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('2. Type your app name (it will be visible for users), email address (for notifications from Facebook) and click <strong>Create App ID</strong>:', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/facebook-app/v3/2.png">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('3. Pass the security check if required and click on <strong>Submit</strong>:', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/facebook-app/v3/3.png">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('4. Click <strong>Settings -> Basic</strong> in the menu at the left:', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/facebook-app/v3/4.png">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('5. Twice enter your site domain name: without "www" and with "www", check your email address, select the category and paste links to Terms & Policy pages:', 'bizpanda') ?></p>
<table class="table">
<thead>
<tr>
<th><?php _e('Field', 'bizpanda') ?></th>
<th><?php _e('How To Fill', 'bizpanda') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td class="onp-title"><?php _e('App Domains', 'bizpanda') ?></td>
<td>
<p><?php _e('Paste these domains:', 'bizpanda') ?></p>
<p><i><?php echo opanda_get_domain( get_site_url() ) ?></i>
<p><i><?php echo 'www.' . opanda_get_domain( get_site_url() ) ?></i>
</p>
</td>
</tr>
<tr>
<td class="onp-title"><?php _e('Privacy Policy URL', 'bizpanda') ?></td>
<td>
<p><?php printf( __('Paste the URL (you can edit it <a href="%s" target="_blank">here</a>):', 'bizpanda'), admin_url('admin.php?page=settings-' . $this->plugin->pluginName . '&opanda_screen=terms&action=index' ) ) ?></p>
<p><i><?php echo opanda_privacy_policy_url(true) ?></i>
</p>
</td>
</tr>
<tr>
<td class="onp-title"><?php _e('Terms of Service URL', 'bizpanda') ?></td>
<td>
<p><?php printf( __('Paste the URL (you can edit it <a href="%s" target="_blank">here</a>):', 'bizpanda'), admin_url('admin.php?page=settings-' . $this->plugin->pluginName . '&opanda_screen=terms&action=index' ) ) ?></p>
<p><i><?php echo opanda_terms_url(true) ?></i>
</td>
</tr>
</tbody>
</table>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/facebook-app/v3/5.png">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('6. Fill the form <strong>Data Protection Officer Contact Information</strong> below if required according to your business:', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/facebook-app/v3/6.png">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('7. Click on <strong>Add Platform</strong> after the forms:', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/facebook-app/v3/7.png">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('8. Select <strong>Website</strong>:', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/facebook-app/v3/8.png">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('9. Specify an URL of your website and save the changes:', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/facebook-app/v3/9.png">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('10. Move to the section <strong>App Review</strong>:', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/facebook-app/v3/10.png">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('11. Make your app available to the general public:', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/facebook-app/v3/11.png">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('12. Copy your app id:', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/facebook-app/v3/12.png">
</p>
</div>
<div class="onp-help-section">
<p><?php printf( __('13. Paste your Facebook App Id on the page Global Settings > <a href="%s">Social Options</a>.', 'bizpanda' ), opanda_get_settings_url('social') ) ?></p>
<p><?php printf( __('Feel free to <a href="%s">contact us</a> if you faced any troubles.', 'bizpanda'), opanda_get_help_url('troubleshooting') ) ?></p>
</div>

View File

@@ -0,0 +1,60 @@
<div class="onp-help-section">
<h1><?php _e('Using the Facebook Like with the Social Locker', 'bizpanda'); ?></h1>
<p>
<?php _e('This note describes the Facebook restriction regarding using the Facebook Buttons in the Social Locker.', 'bizpanda') ?>
<?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 ...', 'bizpanda') ?></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>
<?php _e('<strong>This Facebook restriction doesn\'t affect</strong> on the Facebook Connect and Facebook Subscribe buttons (which ask to log into your app) from Email and Connect Lockers.', 'bizpanda') ?>
</p>
<p>
<?php _e('<strong>This restriction doesn\'t affect</strong> on buttons from other social networks (Twitter, Google, LinkedIn).', 'bizpanda') ?>
</p>
<p>
<?php _e('Technically <strong>you can ignore this restriction, the Social Locker will work without any problems</strong>. Also you can just update a bit the settings of your lockers to make it compatible with the new policy.', 'bizpanda') ?>
</p>
<?php $this->showContentTable() ?>
</div>
<div class="onp-help-section">
<h2><?php _e('Making Social Locker compatible with the Facebook Policies', 'bizpanda'); ?></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?', 'bizpanda') ?></p>
<p><strong><?php _e('1. Enable the option Close Icon.', 'bizpanda') ?></strong></p>
<p>
<?php _e('You have to give people the way to skip the liking process.', 'bizpanda') ?>
<?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.', 'bizpanda') ?>
</p>
<p><strong><?php _e('2. Remove any phrases like "this content is locked" from your locker.', 'bizpanda') ?></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).', 'bizpanda') ?>
</p>
<p><strong><?php _e('3. Turn on the Transparency or Blurring mode.', 'bizpanda') ?></strong></p>
<p>
<?php _e('It makes your locker looks like a popup which appears suddenly to ask the user to support you.', 'bizpanda') ?>
</p>
<p class='onp-img'>
<img src='http://cconp.s3.amazonaws.com/bizpanda/facebook-like/1.png' />
</p>
<?php $this->showContentTable() ?>
</div>

View File

@@ -0,0 +1,170 @@
<div class="onp-help-section">
<h1><?php _e('Getting Google Client ID', 'bizpanda'); ?></h1>
<p>
<?php _e('A Google Client ID is required for the following buttons:', 'bizpanda'); ?>
<ul>
<?php if ( BizPanda::hasPlugin('sociallocker') ) { ?>
<li><?php _e('YouTube Subscribe of the Social Locker.', 'bizpanda') ?></li>
<?php } ?>
<li><?php _e('Google Sign-In of the Sign-In Locker.', 'bizpanda') ?></li>
<?php if ( BizPanda::hasPlugin('optinpanda') ) { ?>
<li><?php _e('Google Subscribe of the Email Locker.', 'bizpanda') ?></li>
<?php } ?>
</ul>
</p>
<p><?php _e('By default the plugin utilises its own fully configured client ID.', 'bizpanda') ?></p>
<p><?php _e('So you <strong>don\'t need to create your own client ID</strong>. Nonetheless you can create your own app, for example, to replace the app logo on the authorization screen with your website logo.') ?></p>
</div>
<div class="onp-help-section">
<p><?php printf( __('1. Go to the <a href="%s" target="_blank">Google Developers Console</a>.', 'bizpanda'), 'https://console.developers.google.com/project' ) ?></p>
</div>
<div class="onp-help-section">
<p><?php _e('2. Click "Select a project":', 'bizpanda') ?></p>
<p class='onp-img'>
<img src="http://cconp.s3.amazonaws.com/bizpanda/google-app/v2/1.png">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('2. Click "Select a project":', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/google-app/v2/1.png">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('3. Click the button with the plus icon:', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/google-app/v2/2.png">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('4. Enter a new project name (for example, your website name) and click "Create":', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/google-app/v2/3.png">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('5. Again click "Select a project":', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/google-app/v2/1.png">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('6. And select your project you have just created:', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/google-app/v2/4.png">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('7. Make sure that you are in the Library section. Find and enable the following APIs:', 'bizpanda') ?></p>
<ul>
<li><?php _e('<strong>Google+ API</strong> (to use the Google Plus, Google Share and Sign-In buttons)', 'bizpanda') ?></li>
<li><?php _e('<strong>YouTube APIs</strong> (to use the YouTube Subscribe button)', 'bizpanda') ?></li>
</ul>
<p><?php _e('To enable these APIs, click on a title of the required API in the list and then click the button "Enable".', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/google-app/v2/5.png">
</p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/google-app/v2/6.png">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('8. Move to the "Credentials" section:', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/google-app/v2/7.png">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('9. Create new credentials "OAuth client ID"', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/google-app/v2/8.png">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('10. Google may ask you to configure a consent screen before creating OAuth client ID, at this case follow the Google instruction and then return back:', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/google-app/v2/9.png">
</p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/google-app/v2/10.png">
</p>
</div>
<?php
$origin = null;
$pieces = parse_url( site_url() );
$domain = isset($pieces['host']) ? $pieces['host'] : '';
if (preg_match('/(?P<domain>[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', $domain, $regs)) {
$origin = $regs['domain'];
}
?>
<div class="onp-help-section">
<p><?php _e('11. Fill up the form:', 'bizpanda' ) ?></p>
<table class="table">
<thead>
<tr>
<th><?php _e('Field', 'bizpanda') ?></th>
<th><?php _e('How To Fill', 'bizpanda') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td class="onp-title"><?php _e('Application Type', 'bizpanda') ?></td>
<td>
<p>Web Application</p>
</td>
</tr>
<tr>
<td class="onp-title"><?php _e('Authorized Javascript origins', 'bizpanda') ?></td>
<td>
<p><?php _e('Add the origins:', 'bizpanda') ?></p>
<p><i><?php echo 'http://' . str_replace('www.', '', $origin) ?></i></p>
<p><i><?php echo 'http://www.' . $origin ?></i></p>
<p><?php _e('If you use SSL, additionally add URLs with "https"', 'bizpanda') ?></p>
</td>
</tr>
<tr>
<td class="onp-title"><?php _e('Authorized redirect URIs', 'bizpanda') ?></td>
<td>
<p><?php _e('Paste the URL:', 'bizpanda') ?></p>
<p><i><?php echo add_query_arg( array(
'action' => 'opanda_connect',
'opandaHandler' => 'google'
), admin_url('admin-ajax.php') ) ?></i>
</p>
</td>
</tr>
</tbody>
</table>
<p class='onp-img'>
<img src="http://cconp.s3.amazonaws.com/bizpanda/google-app/v2/11.png">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('12. After clicking on the button Create, you will see your new Client ID:', 'bizpanda' ) ?></p>
<p class='onp-img'>
<img src="http://cconp.s3.amazonaws.com/bizpanda/google-app/v2/12.png">
</p>
</div>
<div class="onp-help-section">
<p><?php printf( __('10. Copy and paste it on the page Global Settings > <a href="%s">Social Options</a>.', 'bizpanda' ), opanda_get_settings_url('social') ) ?></p>
<p><?php printf( __('Feel free to <a href="%s">contact us</a> if you faced any troubles.', 'bizpanda'), opanda_get_help_url('troubleshooting') ) ?></p>
</div>

View File

@@ -0,0 +1,112 @@
<div class="onp-help-section">
<h1><?php _e('Getting LinkedIn Client ID', 'bizpanda'); ?></h1>
<p>
<?php _e('A LinkedIn Client ID is required for the following buttons:', 'bizpanda'); ?>
<ul>
<li><?php _e('LinkedIn Sign-In of the Sign-In Locker.', 'bizpanda') ?></li>
<?php if ( BizPanda::hasPlugin('optinpanda') ) { ?>
<li><?php _e('LinkedIn Subscribe of the Email Locker.', 'bizpanda') ?></li>
<?php } ?>
</ul>
</p>
<p><?php _e('By default the plugin utilises its own fully configured client ID.', 'bizpanda') ?></p>
<p><?php _e('So you <strong>don\'t need to create your own client ID</strong>. Nonetheless you can create your own app, for example, to replace the app logo on the authorization screen with your website logo.') ?></p>
</div>
<div class="onp-help-section">
<p><?php printf( __('1. Go to the <a href="%s" target="_blank">LinkedIn Developer Network</a> and click <strong>Create Application</strong>.', 'bizpanda'), 'https://www.linkedin.com/secure/developer' ) ?></p>
</div>
<div class="onp-help-section">
<p><?php _e('2. Fill up the form the following way:', 'bizpanda' ) ?></p>
<table class="table">
<thead>
<tr>
<th><?php _e('Field', 'bizpanda') ?></th>
<th><?php _e('How To Fill', 'bizpanda') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td class="onp-title"><?php _e('Company', 'bizpanda') ?></td>
<td><?php _e('Select an existing company or create your own one (you can use your website name as a company name).', 'bizpanda') ?></td>
</tr>
<tr>
<td class="onp-title"><?php _e('Name', 'bizpanda') ?></td>
<td><?php _e('The best name is your website name.', 'bizpanda') ?></td>
</tr>
<tr>
<td class="onp-title"><?php _e('Description', 'bizpanda') ?></td>
<td>
<p><?php _e('Explain what your app does, e.g:', 'bizpanda') ?></p>
<p><i><?php _e('This application asks your credentials in order to unlock the content. Please read the Terms of Use to know how these credentials will be used.', 'bizpanda') ?></i></p>
</td>
</tr>
<tr>
<td class="onp-title"><?php _e('Application Logo URL', 'bizpanda') ?></td>
<td>
<p><?php _e('Paste an URL to your logo (80x80px). Or use this default logo:', 'bizpanda') ?></p>
<p><i><?php _e('https://cconp.s3.amazonaws.com/bizpanda/linkedin-app/default-logo.png', 'bizpanda') ?></i></p>
</td>
</tr>
<tr>
<td class="onp-title"><?php _e('Application Use', 'bizpanda') ?></td>
<td>
<p><?php _e('Select "Other" from the list.', 'bizpanda') ?></p>
</td>
</tr>
<tr>
<td class="onp-title"><?php _e('Website URL', 'bizpanda') ?></td>
<td>
<p><?php _e('Paste your website URL:', 'bizpanda') ?></p>
<p><i><?php echo site_url() ?></i></p>
</td>
</tr>
<tr>
<td class="onp-title"><?php _e('Business Email', 'bizpanda') ?></td>
<td>
<p><?php _e('Enter your email to receive updates regarding your app.', 'bizpanda') ?></p>
</td>
</tr>
<tr>
<td class="onp-title"><?php _e('Business Phone', 'bizpanda') ?></td>
<td>
<p><?php _e('Enter your phone. It will not be visible for visitors.', 'bizpanda') ?></p>
</td>
</tr>
</tbody>
</table>
<p><?php _e('Mark the checkbox "I have read and agree to the LinkedIn API Terms of Use." and submit the form.', 'bizpanda') ?></p>
</div>
<div class="onp-help-section">
<p><?php _e('3. On the page "Authentication", mark "<strong>r_basicprofile</strong>" and "<strong>r_emailaddress</strong>".', 'bizpanda' ) ?></p>
</div>
<div class="onp-help-section">
<p>
<?php _e('4. In the field "<strong>Authorized Redirect URLs</strong>" of the section "<strong>OAuth 2.0</strong>" paste the URL:', 'bizpanda' ) ?><br />
</p>
<p>
<i>
<?php echo add_query_arg( array(
'action' => 'opanda_connect',
'opandaHandler' => 'linkedin',
'opandaRequestType' => 'callback'
), admin_url('admin-ajax.php') ) ?>
</i>
</p>
<p>Click the orange button "<strong>Add</strong>", then click the button button "<strong>Update</strong>" below the from.</p>
</div>
<div class="onp-help-section">
<p><?php _e('5. On the page "Settings", switch <strong>Application Status</strong> to <strong>Live</strong>. Click the button Update.', 'bizpanda' ) ?></p>
</div>
<div class="onp-help-section">
<p><?php printf( __('4. Return to the page "Authentication", copy your <strong>Client ID</strong> and <strong>Client Secret</strong>, paste them on the page Global Settings > <a href="%s">Social Options</a>.', 'bizpanda' ), admin_url('admin.php?page=settings-bizpanda&opanda_screen=social') ) ?></p>
<p><?php printf( __('Feel free to <a href="%s">contact us</a> if you faced any troubles.', 'bizpanda'), opanda_get_help_url('troubleshooting') ) ?></p>
</div>

View File

@@ -0,0 +1,7 @@
<div class="onp-help-section">
<h1><?php _e('Creating Social Apps', 'bizpanda'); ?></h1>
<p><?php _e('Creating own Social Apps is not required in most cases. Click on the links below to know about the cases when you need to create respective apps.', 'bizpanda') ?></p>
<?php $this->showContentTable() ?>
</div>

View File

@@ -0,0 +1,185 @@
<div class="onp-help-section">
<h1><?php _e('Creating Twitter App', 'bizpanda'); ?></h1>
<p>
<?php _e('A Twitter App is required for the following buttons:', 'bizpanda' ) ?>
<ul>
<?php if ( BizPanda::hasPlugin('sociallocker') ) { ?>
<li><?php _e('Twitter Tweet of the Social Locker.', 'bizpanda') ?></li>
<li><?php _e('Twitter Follow of the Social Locker.', 'bizpanda') ?></li>
<?php } ?>
<li><?php _e('Twitter Sign-In of the Sign-In Locker.', 'bizpanda') ?></li>
<?php if ( BizPanda::hasPlugin('optinpanda') ) { ?>
<li><?php _e('Twitter Subscribe of the Email Locker.', 'bizpanda') ?></li>
<?php } ?>
</ul>
</p>
<p><?php _e('By default the plugin utilises its own fully configured Twitter app.', 'bizpanda') ?></p>
<p><?php _e('So you <strong>don\'t need to create your own app</strong>. Nonetheless you can create your own app, for example, to replace the app logo on the authorization screen with your website logo.') ?></p>
</div>
<div class="onp-help-section">
<p><?php printf( __('1. Open the website <a href="%s" target="_blank">developer.twitter.com/en/apps</a> and click <strong>Create an app</strong> (you have to be signed in).', 'bizpanda'), 'https://developer.twitter.com/en/apps' ) ?></p>
</div>
<div class="onp-help-section">
<p><?php _e('2. Fill up the form, agree to the Developer Agreement, click <strong>Create Your Twitter application</strong>.', 'bizpanda' ) ?></p>
<table class="table">
<thead>
<tr>
<th><?php _e('Field', 'bizpanda') ?></th>
<th><?php _e('How To Fill', 'bizpanda') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td class="onp-title"><?php _e('App name', 'bizpanda') ?></td>
<td><?php _e('The best app name is your website name.', 'bizpanda') ?></td>
</tr>
<tr>
<td class="onp-title"><?php _e('App Description', 'bizpanda') ?></td>
<td>
<p><?php _e('Explain why you ask for the credentials, e.g:', 'bizpanda') ?></p>
<p><i><?php _e('This application asks your credentials in order to unlock the content. Please read the TOS.', 'bizpanda') ?></i></p>
</td>
</tr>
<tr>
<td class="onp-title"><?php _e('Website URL', 'bizpanda') ?></td>
<td>
<p><?php _e('Paste your website URL:', 'bizpanda') ?></p>
<p><i><?php echo site_url() ?></i></p>
</td>
</tr>
<tr>
<td class="onp-title"><?php _e('Enable Sign in with Twitter', 'bizpanda') ?></td>
<td>
<p><?php _e('Mark it.', 'bizpanda') ?></p>
</td>
</tr>
<tr>
<td class="onp-title"><?php _e('Callback URL', 'bizpanda') ?></td>
<td>
<p><?php _e('Callback URLs:', 'bizpanda') ?></p>
<p><i><?php echo admin_url('admin-ajax.php') ?></i>
</p>
</td>
</tr>
<tr>
<td class="onp-title"><?php _e('Terms of Service URL', 'bizpanda') ?></td>
<td>
<p><?php printf( __('Paste the URL (you can edit it <a href="%s" target="_blank">here</a>):', 'bizpanda'), admin_url('admin.php?page=settings-' . $this->plugin->pluginName . '&opanda_screen=terms&action=index' ) ) ?></p>
<p><i><?php echo opanda_terms_url(true) ?></i>
</td>
</tr>
<tr>
<td class="onp-title"><?php _e('Privacy policy URL', 'bizpanda') ?></td>
<td>
<p><?php printf( __('Paste the URL (you can edit it <a href="%s" target="_blank">here</a>):', 'bizpanda'), admin_url('admin.php?page=settings-' . $this->plugin->pluginName . '&opanda_screen=terms&action=index' ) ) ?></p>
<p><i><?php echo opanda_privacy_policy_url(true) ?></i></p>
</td>
</tr>
<tr>
<td class="onp-title"><?php _e('Tell us how this app will be used', 'bizpanda') ?></td>
<td>
<p><?php _e('Explain how your app works, e.g:', 'bizpanda') ?></p>
<p><i><?php _e('This app asks visitors of our website to sign in via Twitter or tweet/follow to get access to restricted content available only for registered users or followers.', 'bizpanda') ?></i></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="onp-help-section">
<p><?php _e('3. Move to the section "Permissions", mark <strong>Read and Write</strong> (if you are going to use tweeting functionality) or <strong>Read Only</strong> (if you are NOT going to use tweeting functionality) and save changes.', 'bizpanda' ) ?></p>
<p><?php _e('If you are going to use the Twitter Sign-In Button, mark the permission <strong>Request email addresses from users</strong> in the section "Additional Permissions".','bizpanda') ?></p>
<p class='onp-img'>
<img src='http://cconp.s3.amazonaws.com/bizpanda/twitter-app/4.png' />
</p>
</div>
<div class="onp-help-section">
<p><?php _e('4. Move to the section "Keys and tokens", find your API key and API secret key:', 'bizpanda' ) ?></p>
<p class='onp-img'>
<img src='http://cconp.s3.amazonaws.com/bizpanda/twitter-app/5.png' />
</p>
</div>
<div class="onp-help-section">
<p><?php printf( __('5. Paste your key and secret on the page Global Settings > <a href="%s">Social Options</a>.', 'bizpanda' ), admin_url('admin.php?page=settings-bizpanda&opanda_screen=social') ) ?></p>
<p><?php printf( __('Feel free to <a href="%s">contact us</a> if you faced any troubles.', 'bizpanda'), opanda_get_help_url('troubleshooting') ) ?></p>
</div>
<!--div class="onp-help-section">
<p class='onp-note'>
<?php _e('By default Twitter does not return an <strong>email address</strong> of the user until your app is not got whitelisted. To make your app whitelisted, please follow the instruction below.', 'bizpanda') ?>
</p>
</div>
<div class="onp-help-section">
<p><?php printf( __('9. Visit Twitter Help Center: <a href="https://support.twitter.com/forms/platform" target="_blank">https://support.twitter.com/forms/platform</a>', 'bizpanda' ), admin_url('admin.php?page=settings-optinpanda&opanda_screen=social') ) ?></p>
</div>
<div class="onp-help-section">
<p><?php _e('10. Choose <strong>I need access to special permissions</strong>, fill and submit the form:', 'bizpanda' ) ?></p>
<table class="table">
<thead>
<tr>
<th><?php _e('Field', 'bizpanda') ?></th>
<th><?php _e('How To Fill', 'bizpanda') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td class="onp-title"><?php _e('Application Name', 'bizpanda') ?></td>
<td><?php _e('Enter your app name you typed in the step 2.', 'bizpanda') ?></td>
</tr>
<tr>
<td class="onp-title"><?php _e('Application ID', 'bizpanda') ?></td>
<td>
<p><?php _e('You can find your app ID in the URL when viewing your app on the apps.twitter.com.', 'bizpanda') ?></p>
<p class='onp-img'>
<img src='http://cconp.s3.amazonaws.com/bizpanda/twitter-app/8.png' style="width: 400px;" />
</p>
</td>
</tr>
<tr>
<td class="onp-title"><?php _e('Permissions Requested', 'bizpanda') ?></td>
<td>
<p><?php _e('Explain what permissions you need:', 'bizpanda') ?></p>
<p><i><?php _e('Please enable the permission "Request email addresses from users" for my app. I want to use the option "include_email" while requesting "account/verify_credentials". I ask visitors of my website to sign in by using their Twitter accounts and need to know their emails.', 'bizpanda') ?></i></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="onp-help-section">
<p><?php printf( __('10. <strong>Within 2-3 business days</strong>, you will get a reply from Twitter. If the email permission was successfully granted for your app, visit <a href="%s" target="_blank">apps.twitter.com</a> and click on the title of your app.', 'bizpanda' ), 'https://apps.twitter.com' ) ?></p>
</div>
<div class="onp-help-section">
<p><?php printf( __('11. Click on the tab <strong>Settings</strong>, fill the fields and save the form:', 'bizpanda' ), 'https://apps.twitter.com' ) ?></p>
<table class="table">
<thead>
<tr>
<th><?php _e('Field', 'bizpanda') ?></th>
<th><?php _e('How To Fill', 'bizpanda') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td class="onp-title"><?php _e('Privacy Policy URL', 'bizpanda') ?></td>
<td><i><?php echo opanda_privacy_policy_url() ?></i></td>
</tr>
<tr>
<td class="onp-title"><?php _e('Terms of Service URL', 'bizpanda') ?></td>
<td><i><?php echo opanda_terms_url() ?></i></td>
</tr>
</tbody>
</table>
</div>
<div class="onp-help-section">
<p><?php printf( __('11. Click on the tab <strong>Permissions</strong>, mark the checkbox <strong>Request email addresses from users</strong> and save the changes.', 'bizpanda' ), 'https://apps.twitter.com' ) ?></p>
</div-->

View File

@@ -0,0 +1,74 @@
<div class="onp-help-section">
<h1><?php _e('Connection to Zapier', 'bizpanda'); ?></h1>
<p><?php printf( __("You can send data collected via your lockers to Zapier and then automatically pass them to other web apps supported by Zapier. For example, to Google Docs. <a href='%s' target='_blank'>Click here</a> to learn more about Zapier.", "bizpanda"), 'https://zapier.com/help/what-is-zapier/' ); ?></p>
<p><?php _e('To connect the plugin to Zapier, please follow the steps below:', 'bizpanda'); ?></p>
</div>
<div class="onp-help-section">
<p><?php _e('1. Make sure that you have a Zapier account. If not, create one here: <a href="https://zapier.com/sign-up/" target="_blank">https://zapier.com/sign-up/</a>', 'bizpanda') ?></p>
</div>
<div class="onp-help-section">
<p><?php _e('2. Pick <strong>Webhooks</strong> and the apps where you wish to send data to. Learn more about Webooks here: <a href="https://zapier.com/apps/webhook/integrations" target="_blank">https://zapier.com/apps/webhook/integrations</a>', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/zapier/1.jpg">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('3. Select a <strong>Zap</strong> you need by clicking on <strong>Use this Zap</strong>. For example, Webkooks + Google Sheet:', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/zapier/2.jpg">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('4. While creating a Zap, select <strong>Catch Hook</strong> option:', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/zapier/3.jpg">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('5. Skip the step <strong>Pick off a Child Key</strong> if you don\'t have any preferences for this option or you aren\'t sure how to set it up:', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/zapier/4.jpg">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('6. Copy a webhook URL on the step <strong>Test Webhooks by Zapier</strong>. The option Silent Mode may be turned off or turned on, it doesn\'t have matter.', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/zapier/5.jpg">
</p>
</div>
<div class="onp-help-section">
<p><?php printf( __('7. Paste the webhook URL on the page Global Settings -> <a href="%s" target="_blank">Zapier</a> and click Save Changes. Make sure that the options <strong>Only New Leads</strong> and <strong>Only Confirmed Leads</strong> turned off (you need to disable them for testing connection on the next step, later you can configure them as you need).', 'bizpanda'), opanda_get_settings_url('zapier') ) ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/zapier/6.jpg">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('8. Pass connection test on Zapier. For that, on the page Test Webhooks by Zapier after saving the webhook URL in the settings of the plugin, click the button <strong>Ok, I did this</strong>.', 'bizpanda') ?></p>
</div>
<div class="onp-help-section">
<p><?php _e('9. While the spinner runs, open a webpage on your website where the locker is located and unlock it.', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/zapier/7.jpg">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('10. If the hook is fired successfully, you will see the success message, if not try to refresh the Zapier page.', 'bizpanda') ?></p>
<p class="onp-img">
<img src="http://cconp.s3.amazonaws.com/bizpanda/zapier/8.jpg">
</p>
</div>
<div class="onp-help-section">
<p><?php _e('11.Complete other configuration steps on Zapier and enjoy your results.', 'bizpanda') ?></p>
<p><?php printf( __('Feel free to <a href="%s">contact us</a> if you faced any troubles.', 'bizpanda'), opanda_get_help_url('troubleshooting') ) ?></p>
</div>

View File

@@ -0,0 +1,647 @@
<?php
/**
* The file contains a short help info.
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2014, OnePress Ltd
*
* @package core
* @since 1.0.0
*/
/**
* Common Settings
*/
class OPanda_LeadsPage extends OPanda_AdminPage {
public function __construct( $plugin ) {
$this->menuPostType = OPANDA_POST_TYPE;
$this->id = "leads";
if( !current_user_can('administrator') )
$this->capabilitiy = "manage_opanda_leads";
require_once OPANDA_BIZPANDA_DIR . '/admin/includes/leads.php';
$count = OPanda_Leads::getCount();
if ( empty( $count ) ) $count = '0';
$this->menuTitle = sprintf( __('Leads (%d)', 'bizpanda'), $count );
parent::__construct( $plugin );
}
public function assets($scripts, $styles) {
$this->styles->add(OPANDA_BIZPANDA_URL . '/assets/admin/css/leads.010008.css');
$this->scripts->add(OPANDA_BIZPANDA_URL . '/assets/admin/js/leads.010008.js');
$this->scripts->request('jquery');
$this->scripts->request( array(
'control.checkbox',
'control.dropdown'
), 'bootstrap' );
$this->styles->request( array(
'bootstrap.core',
'bootstrap.form-group',
'bootstrap.separator',
'control.dropdown',
'control.checkbox',
), 'bootstrap' );
}
public function indexAction() {
if(!class_exists('WP_List_Table')){
require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
}
require_once( OPANDA_BIZPANDA_DIR . '/admin/includes/classes/class.leads.table.php' );
$table = new OPanda_LeadsListTable( array('screen' => 'bizpanda-leads') );
$table->prepare_items();
?>
<div class="wrap factory-fontawesome-320" id="opanda-leads-page">
<h2>
<?php _e('Leads', 'bizpanda') ?>
<a href="<?php $this->actionUrl('export') ?>" class="add-new-h2"><?php _e( 'export', 'bizpanda' ); ?></a>
<a href="<?php $this->actionUrl('clearAll') ?>" class="add-new-h2"><?php _e( 'clear all', 'bizpanda' ); ?></a>
</h2>
<?php if ( BizPanda::isSinglePlugin() ) { ?>
<?php if ( BizPanda::hasPlugin('optinpanda') ) { ?>
<p style="margin-top: 0px;"> <?php _e('This page shows contacts of visitors who opted-in or signed-in on your website through Email or Sign-In Lockers.', 'bizpanda'); ?></p>
<?php } else { ?>
<p style="margin-top: 0px;"><?php printf( __('This page shows contacts of visitors who signed-in on your website through the <a href="%s">Sign-In Locker</a>.', 'bizpanda'), opanda_get_help_url('what-is-signin-locker') ); ?></p>
<?php } ?>
<?php } else { ?>
<p style="margin-top: 0px;"> <?php _e('This page shows contacts of visitors who opted-in or signed-in on your website through Email or Sign-In Lockers.', 'bizpanda'); ?></p>
<?php } ?>
<?php if ( isset( $_GET['onp_table_cleared'] ) ) { ?>
<div class="factory-bootstrap-331">
<div class="alert alert-success">
<?php _e('The data has been successfully cleared.', 'bizpanda') ?>
</div>
</div>
<?php } ?>
<?php
$table->search_box(__('Search Leads', 'mymail'), 's');
$table->views();
?>
<form method="post" action="">
<?php echo $table->display(); ?>
</form>
</div>
<?php
OPanda_Leads::updateCount();
}
public function leadDetailsAction() {
$leadId = isset( $_REQUEST['leadID'] ) ? intval( $_REQUEST['leadID'] ) : 0;
$lead = OPanda_Leads::get( $leadId );
$customFields = OPanda_Leads::getCustomFields( $leadId );
$email = $lead->lead_email;
$name = $lead->lead_name;
$family = $lead->lead_family;
if ( !empty( $name) || !empty( $family) ) {
$displayName = $name . ' ' . $family;
} else {
$displayName = !empty( $lead->lead_display_name )? $lead->lead_display_name : $lead->lead_email;
}
$emailConfirmed = empty( $lead->lead_email_confirmed ) ? 0 : 1;
$subscriptionConfirmed = empty( $lead->lead_subscription_confirmed ) ? 0 : 1;
if ( isset( $_POST['submit'] ) ) {
$data = array();
$email = $_POST['email'];
if ( !filter_var($email, FILTER_VALIDATE_EMAIL) || !preg_match('/@.+\./', $email) ) {
$error = __('Please enter a valid email.', 'bizpanda');
} else {
$name = $_POST['name'];
$family = $_POST['family'];
if ( !empty( $name) || !empty( $family) ) {
$displayName = $name . ' ' . $family;
} else {
$displayName = !empty( $lead->lead_display_name )? $lead->lead_display_name : $lead->lead_email;
}
$data['email'] = $email;
$data['displayName'] = $displayName;
$data['name'] = $name;
$data['family'] = $family;
$emailConfirmed = empty( $_POST['email_confirmed'] ) ? 0 : 1;
$subscriptionConfirmed = empty( $_POST['subscription_confirmed'] ) ? 0 : 1;
$customValues = isset( $_POST['opanda_values'] ) ? $_POST['opanda_values'] : array();
$customNames = isset( $_POST['opanda_names'] ) ? $_POST['opanda_names'] : array();
$index = 0;
foreach( $customNames as $customName ) {
$data['{' . $customName . '}'] = $customValues[$index];
$customFields[$customName] = $customValues[$index];
$index++;
}
OPanda_Leads::save($lead, $data, array(), $emailConfirmed, $subscriptionConfirmed);
$url = admin_url('/edit.php?post_type=opanda-item&page=leads-bizpanda&action=leadDetails&leadID=' . $lead->ID . '&opanda_success=1');
wp_redirect($url);
exit;
}
}
$avatar = OPanda_Leads::getAvatar( $leadId, $lead->lead_email, 150 );
$postUrl = admin_url('/edit.php?post_type=opanda-item&page=leads-bizpanda&action=leadDetails&leadID=' . $lead->ID);
$cancelUrl = admin_url('/edit.php?post_type=opanda-item&page=leads-bizpanda');
?>
<div class="wrap factory-fontawesome-320" id="opanda-lead-details-page">
<h2>Edit <strong><?php echo htmlspecialchars( $displayName ) ?></strong></h2>
<?php if ( isset( $_GET['opanda_success'] ) ) { ?>
<div class="factory-bootstrap-331">
<div class="alert alert-success"><?php _e('<strong>Well done!</strong> The lead data updated successfully.', 'bizpanda') ?></div>
</div>
<?php } ?>
<?php if ( !empty( $error ) ) { ?>
<div class="factory-bootstrap-331">
<div class="alert alert-danger"><?php echo $error; ?></div>
</div>
<?php } ?>
<form method="POST" action="<?php echo $postUrl ?>">
<input type="hidden" name="leadID" value="<?php echo $leadId ?>" />
<input type="hidden" name="submit" value="1" />
<table class="form-table">
<tr>
<td scope="row" class="avatar-wrap">
<div class="opanda-avatar"><?php echo $avatar ?></div>
</td>
<td class="user-info">
<h3 class="detail">
<ul class="click-to-edit">
<li><?php echo htmlspecialchars( $email ) ?></li>
<li><input id="opanda_email" class="" type="text" name="email" value="<?php echo htmlspecialchars( $email ) ?>" placeholder="<?php _e('Email', 'bizpanda') ?>"></li>
</ul>
</h3>
<div class="detail">
<label for="opanda_name"><?php _e('Name:', 'bizpanda') ?></label>
<ul class="click-to-edit">
<li><?php echo htmlspecialchars( $name ) ?> <?php echo htmlspecialchars( $family ) ?></li>
<li>
<input id="opanda_name" type="text" name="name" value="<?php echo htmlspecialchars( $name ) ?>" placeholder="<?php _e('First Name', 'bizpanda') ?>">
<input id="opanda_family" class="" type="text" name="family" value="<?php echo htmlspecialchars( $family ) ?>" placeholder="<?php _e('Last Name', 'bizpanda') ?>">
</li>
</ul>
</div>
<div class="detail">
<label for="opanda_email_confirmed"><?php _e('Email Confirmed:', 'bizpanda') ?></label>
<ul class="click-to-edit">
<li><?php if ( $emailConfirmed ) { _e('yes', 'bizpanda'); } else { _e('no', 'bizpanda'); } ?></li>
<li>
<input type="checkbox" id="opanda_email_confirmed" name="email_confirmed" value="1" <?php if ( $emailConfirmed ) { echo 'checked="checked"'; } ?> >
</li>
</ul>
</div>
<?php if ( BizPanda::hasPlugin('optinpanda') ) { ?>
<div class="detail">
<label for="opanda_subscription_confirmed"><?php _e('Subscription Confirmed:', 'bizpanda') ?></label>
<ul class="click-to-edit">
<li><?php if ( $subscriptionConfirmed ) { _e('yes', 'bizpanda'); } else { _e('no', 'bizpanda'); } ?></li>
<li>
<input type="checkbox" id="opanda_email_confirmed" name="subscription_confirmed" value="1" <?php if ( $subscriptionConfirmed ) { echo 'checked="checked"'; } ?> >
</li>
</ul>
</div>
<?php } ?>
<?php if ( !empty( $customFields ) ) { ?>
<div class="custom-field-wrap">
<?php
$index = 0;
foreach ( $customFields as $fieldName => $fieldValue ) {
$index++;
?>
<div class="detail">
<label for="opanda_<?php echo $index ?>"><?php echo $fieldName ?>:</label>
<ul class="click-to-edit">
<li><?php echo $fieldValue ?></li>
<li><input type="text" id="opanda_<?php echo $index ?>" name="opanda_values[]" value="<?php echo $fieldValue ?>" class="regular-text input"></li>
<input type="hidden" name="opanda_names[]" value="<?php echo $fieldName ?>" />
</ul>
</div>
<?php } ?>
</div>
<?php } ?>
<div class="controls-wrap">
<input type="submit" class="button button-primary" value="<?php _e('Save Changes', 'bizpanda') ?>" />
<a href="<?php echo $cancelUrl ?>" class="button button-default"><?php _e('Return', 'bizpanda') ?></a>
</div>
</td>
</tr>
</table>
</form>
</div>
<?php
}
public function exportAction() {
global $bizpanda;
$error = null;
$warning = null;
// getting a list of lockers
$lockerIds = array();
global $wpdb;
$data = $wpdb->get_results(
"SELECT l.lead_item_id AS locker_id, COUNT(l.ID) AS count, p.post_title AS locker_title "
. "FROM {$wpdb->prefix}opanda_leads AS l "
. "LEFT JOIN {$wpdb->prefix}posts AS p ON p.ID = l.lead_item_id "
. "GROUP BY l.lead_item_id", ARRAY_A );
$lockerList = array(
array('all', __('Mark All', 'bizpanda') )
);
foreach( $data as $items ) {
$lockerList[] = array( $items['locker_id'], $items['locker_title'] . ' (' . $items['count'] . ')');
$lockerIds[] = $items['locker_id'];
}
// default values
$status = 'all';
$fields = array('lead_email', 'lead_name', 'lead_family');
$delimiter = ',';
// custom fields
$customFields = OPanda_Leads::getCustomFields();
$selectedCustomFields = array();
$customFieldsForList = array();
foreach( $customFields as $customField ) {
$customFieldsForList[] = array( $customField->field_name, $customField->field_name );
}
// exporting
if ( isset( $_POST['opanda_export'] ) ) {
// - delimiter
$delimiter = isset( $_POST['opanda_delimiter'] ) ? $_POST['opanda_delimiter'] : ',';
if ( !in_array( $status, array(',', ';') ) ) $status = ',';
// - channels
$lockers = isset( $_POST['opanda_lockers'] ) ? $_POST['opanda_lockers'] : array();
$lockerIds = array();
foreach( $lockers as $lockerId ) {
if ( 'all' == $lockerId ) continue;
$lockerIds[] = intval( $lockerId );
}
// - status
$status = isset( $_POST['opanda_status'] ) ? $_POST['opanda_status'] : 'all';
if ( !in_array( $status, array('all', 'confirmed', 'not-confirmed') ) ) $status = 'all';
// - fields
$rawFields = isset( $_POST['opanda_fields'] ) ? $_POST['opanda_fields'] : array();
$fields = array();
foreach( $rawFields as $field ) {
if ( !in_array( $field, array('lead_email', 'lead_display_name', 'lead_name', 'lead_family', 'lead_ip') ) ) continue;
$fields[] = $field;
}
// - custom fields
$rawCustomFields = isset( $_POST['opanda_custom_fields'] ) ? $_POST['opanda_custom_fields'] : array();
$selectedCustomFields = array();
foreach( $rawCustomFields as $customField ) {
$selectedCustomFields[] = $customField;
}
if ( in_array('custom_facebook_id', $rawFields) ) {
$selectedCustomFields[] = 'facebookId';
}
if ( empty( $lockers) || ( empty( $fields ) && empty( $selectedCustomFields ) ) ) {
$error = __('Please make sure that you selected at least one channel and field.', 'bizpanda');
} else {
$sql = 'SELECT leads.ID,';
$fields[] = 'ID';
$sqlFields = array();
foreach( $fields as $field ) $sqlFields[] = 'leads.' . $field;
$sql .= implode(',', $sqlFields);
if ( !empty( $selectedCustomFields ) ) {
$sql .= ',fields.field_name,fields.field_value';
}
$sql .= ' FROM ' . $wpdb->prefix . 'opanda_leads AS leads ';
if ( !empty( $selectedCustomFields ) ) {
$sql .= 'LEFT JOIN ' . $wpdb->prefix . 'opanda_leads_fields AS fields ON fields.lead_id = leads.ID ';
}
$sql .= 'WHERE leads.lead_item_id IN (' . implode(',', $lockerIds) . ')';
if ( 'all' != $status ) {
$sql .= ' AND leads.lead_email_confirmed = '. ( ( 'confirmed' == $status ) ? '1' : '0' );
}
$result = $wpdb->get_results( $sql, ARRAY_A );
$leads = array();
foreach( $result as $item ) {
$id = $item['ID'];
if ( !isset( $leads[$id] ) ) {
$leads[$id] = array();
foreach( $fields as $field ) {
if ( $field === 'ID' ) continue;
$leads[$id][$field] = $item[$field];
}
foreach( $selectedCustomFields as $field ) $leads[$id][$field] = null;
}
if ( !empty( $item['field_name'] ) && in_array($item['field_name'], $selectedCustomFields) ) {
$leads[$id][$item['field_name']] = $item['field_value'];
}
}
if ( empty( $leads ) ) {
$warning = __('No leads found. Please try to change the settings of exporting.', 'bizpanda');
} else {
$filename = 'leads-' . date('Y-m-d-H-i-s') . '.csv';
header("Content-Type: text/csv");
header("Content-Disposition: attachment; filename=" . $filename);
header("Cache-Control: no-cache, no-store, must-revalidate");
header("Pragma: no-cache");
header("Expires: 0");
$output = fopen("php://output", "w");
foreach( $leads as $row ) {
fputcsv($output, $row, $delimiter);
}
fclose($output);
exit;
}
}
}
// creating a form
$form = new FactoryForms328_Form(array(
'scope' => 'opanda',
'name' => 'exporting'
), $bizpanda );
$form->setProvider( new FactoryForms328_OptionsValueProvider(array(
'scope' => 'opanda'
)));
$options = array(
array(
'type' => 'separator'
),
array(
'type' => 'radio',
'name' => 'format',
'title' => __('Format', 'bizpanda'),
'hint' => __('Only the CSV format is available currently.'),
'data' => array(
array('csv', __('CSV File', 'bizpanda') )
),
'default' => 'csv'
),
array(
'type' => 'radio',
'name' => 'delimiter',
'title' => __('Delimiter', 'bizpanda'),
'hint' => __('Choose a delimiter for a CSV document.'),
'data' => array(
array(',', __('Comma', 'bizpanda') ),
array(';', __('Semicolon', 'bizpanda') )
),
'default' => $delimiter
),
array(
'type' => 'separator'
),
array(
'type' => 'list',
'way' => 'checklist',
'name' => 'lockers',
'title' => __('Channels', 'bizpanda'),
'hint' => __('Mark lockers which attracted leads you wish to export.'),
'data' => $lockerList,
'default' => implode(',', $lockerIds)
),
array(
'type' => 'radio',
'name' => 'status',
'title' => __('Email Status', 'bizpanda'),
'hint' => __('Choose the email status of leads to export.'),
'data' => array(
array('all', __('All', 'bizpanda') ),
array('confirmed', __('Only Confirmed Emails', 'bizpanda') ),
array('not-confirmed', __('Only Not Confirmed', 'bizpanda') )
),
'default' => $status
),
array(
'type' => 'separator'
),
array(
'type' => 'list',
'way' => 'checklist',
'name' => 'fields',
'title' => __('Fields To Export', 'bizpanda'),
'data' => array(
array('lead_email', __('Email', 'bizpanda') ),
array('lead_display_name', __('Display Name', 'bizpanda') ),
array('lead_name', __('Firstname', 'bizpanda') ),
array('lead_family', __('Lastname', 'bizpanda') ),
array('lead_ip', __('IP', 'bizpanda') ),
array('custom_facebook_id', __('Facebook App Scoped Id', 'bizpanda') )
),
'default' => implode(',', $fields)
)
);
if ( !empty( $customFieldsForList ) ) {
$options[] = array(
'type' => 'list',
'way' => 'checklist',
'name' => 'custom_fields',
'title' => __('Custom Fields', 'bizpanda'),
'data' => $customFieldsForList,
'default' => implode(',', $selectedCustomFields)
);
}
$options[] = array(
'type' => 'separator'
);
$form->add($options);
?>
<div class="wrap" id="opanda-export-page">
<h2>
<?php _e('Exporting Leads', 'bizpanda') ?>
</h2>
<p style="margin-top: 0px;"> <?php _e('Select leads you would like to export and click the button "Export Leads".', 'bizpanda'); ?></p>
<div class="factory-bootstrap-331 factory-fontawesome-320">
<?php if ( $error ) { ?>
<div class="alert alert-danger"><?php echo $error ?></div>
<?php } ?>
<?php if ( $warning ) { ?>
<div class="alert alert-normal"><?php echo $warning ?></div>
<?php } ?>
<form method="post" class="form-horizontal">
<?php $form->html(); ?>
<div class="form-group form-horizontal">
<label class="col-sm-2 control-label"> </label>
<div class="control-group controls col-sm-10">
<input name="opanda_export" class="btn btn-primary" type="submit" value="<?php _e('Export Leads', 'bizpanda') ?>"/>
</div>
</div>
</form>
</div>
</div>
<?php
}
/**
* Clears the statisticals data.
*
* @sinve 1.0.0
* @return void
*/
public function clearAllAction() {
if ( !isset( $_REQUEST['onp_confirmed'] ) ) {
return $this->confirm(array(
'title' => __('Are you sure that you desire to clear all your leads data?', 'bizpanda'),
'description' => __('All your leads data will be removed.', 'bizpanda'),
'actions' => array(
'onp_confirm' => array(
'class' => 'btn btn-danger',
'title' => __("Yes, I'm sure", 'bizpanda'),
'url' => $this->getActionUrl('clearAll', array(
'onp_confirmed' => true
))
),
'onp_cancel' => array(
'class' => 'btn btn-default',
'title' => __("No, return back", 'bizpanda'),
'url' => $this->getActionUrl('index')
),
)
));
}
global $wpdb;
$wpdb->query("DELETE FROM {$wpdb->prefix}opanda_leads");
$wpdb->query("DELETE FROM {$wpdb->prefix}opanda_leads_fields");
return $this->redirectToAction('index', array('onp_table_cleared' => true));
}
/**
* Shows the html block with a confirmation dialog.
*
* @sinve 1.0.0
* @return void
*/
public function confirm( $data ) {
?>
<div class="onp-page-wrap factory-bootstrap-331" id="onp-confirm-dialog">
<div id="onp-confirm-dialog-wrap">
<h1><?php echo $data['title'] ?></h1>
<p><?php echo $data['description'] ?></p>
<div class='onp-actions'>
<?php foreach( $data['actions'] as $action ) { ?>
<a href='<?php echo $action['url'] ?>' class='<?php echo $action['class'] ?>'>
<?php echo $action['title'] ?>
</a>
<?php } ?>
</div>
</div>
</div>
<?php
}
}
FactoryPages321::register($bizpanda, 'OPanda_LeadsPage');

View File

@@ -0,0 +1,163 @@
<?php
/**
* Shows the dialog to select a type of new opt-in element.
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2014, OnePress Ltd
*
* @package core
* @since 1.0.0
*/
class OPanda_NewPandaItemPage extends OPanda_AdminPage {
public function __construct( $plugin ) {
$this->menuTitle = __('+ New Locker', 'bizpanda');
$this->menuPostType = OPANDA_POST_TYPE;
$this->id = "new-item";
parent::__construct( $plugin );
}
public function assets($scripts, $styles) {
$this->scripts->request('jquery');
$this->styles->request( array(
'bootstrap.core'
), 'bootstrap' );
$this->scripts->add(OPANDA_BIZPANDA_URL . '/assets/admin/js/new-item.010000.js');
$this->styles->add(OPANDA_BIZPANDA_URL . '/assets/admin/css/new-item.010000.css');
}
/**
* Shows the screen.
*
* @sinve 1.0.0
* @return void
*/
public function indexAction() {
$types = OPanda_Items::getAvailable();
// checkes extra items which are not installed yet
require_once OPANDA_BIZPANDA_DIR . '/admin/includes/plugins.php';
$suggestions = OPanda_Plugins::getSuggestions();
?>
<div class="wrap factory-fontawesome-320">
<div class="opanda-items ">
<h2><?php _e('Creating New Item', 'bizpanda') ?></h2>
<p style="margin-top: 0px;"><?php _e('Choose which items you would like to create.', 'bizpanda') ?></p>
<?php foreach( $types as $name => $type ) { ?>
<div class="postbox opanda-item opanda-item-<?php echo $type['type'] ?>">
<h4 class="opanda-title">
<?php echo $type['title'] ?>
</h4>
<div class="opanda-description">
<?php echo $type['description'] ?>
</div>
<div class="opanda-buttons">
<a href="<?php echo admin_url('post-new.php?post_type=opanda-item&opanda_item=' . $name); ?>" class="button button-large opanda-create">
<i class="fa fa-plus"></i><span><?php _e('Create Item', 'bizpanda') ?></span>
</a>
<?php if ( isset( $type['help'] )) { ?>
<a href="<?php echo $type['help'] ?>" class="button button-large opanda-help opanda-right" title="<?php _e('Click here to learn more', 'bizpanda') ?>">
<i class="fa fa-question-circle"></i>
</a>
<?php } ?>
</div>
</div>
<?php } ?>
</div>
<?php if ( !empty( $suggestions ) ) { ?>
<div class="opanda-separator"></div>
<div class="opanda-extra-items">
<div class="opanda-inner-wrap">
<h2>
<?php _e('More Marketing Tools To Grow Your Business', 'bizpanda') ?>
</h2>
<p style="margin-top: 0px;">
<?php _e('Check out other plugins which add more features to your lockers.', 'bizpanda') ?>
</p>
<?php foreach( $suggestions as $suggestion ) {
$url = $suggestion['url'];
if ( false === strpos( $url, 'utm_source') ) {
if ( BizPanda::isSinglePlugin() ) {
$plugin = BizPanda::getPlugin();
$args = array(
'utm_source' => 'plugin-' . $plugin->options['name'],
'utm_medium' => ( $plugin->license && isset( $plugin->license->data['Category'] ) )
? ( $plugin->license->data['Category'] . '-version' )
: 'unknown-version',
'utm_campaign' => 'suggestions',
'tracker' => isset( $plugin->options['tracker'] ) ? $plugin->options['tracker'] : null
);
$url = add_query_arg( $args, $url );
} else {
$url = add_query_arg( array(
'utm_source' => 'plugin-bizpanda',
'utm_medium' => 'mixed-versions',
'utm_campaign' => 'suggestions',
'utm_term' => implode(',', BizPanda::getPluginNames( true ) )
), $url );
}
}
?>
<div class="postbox opanda-item opanda-item-<?php echo $suggestion['type'] ?>">
<div class="opanda-item-cover"></div>
<i class="fa fa-plus-circle opanda-plus-background"></i>
<h4 class="opanda-title">
<?php echo $suggestion['title'] ?>
</h4>
<div class="opanda-description">
<?php echo $suggestion['description'] ?>
</div>
<div class="opanda-buttons">
<a href='<?php echo $url ?>' class="button button-large" title="<?php _e('Click here to learn more', 'bizpanda') ?>">
<i class="fa fa-external-link"></i><span>Learn More</span>
</a>
</div>
</div>
<?php } ?>
<img class="opanda-arrow" src='<?php echo OPANDA_BIZPANDA_URL . '/assets/admin/img/new-item-arrow.png' ?>' />
</div>
</div>
<?php } ?>
</div>
<?php
}
}
FactoryPages321::register($bizpanda, 'OPanda_NewPandaItemPage');

View File

@@ -0,0 +1,270 @@
<?php
/**
* The page 'Settings'.
*
* @since 1.0.0
*/
class OPanda_SettingsPage extends FactoryPages321_AdminPage {
/**
* The parent menu of the page in the admin menu.
*
* @see FactoryPages321_AdminPage
*
* @since 1.0.0
* @var string
*/
public $menuPostType = OPANDA_POST_TYPE;
/**
* The id of the page in the admin menu.
*
* Mainly used to navigate between pages.
* @see FactoryPages321_AdminPage
*
* @since 1.0.0
* @var string
*/
public $id = "settings";
public function __construct(Factory325_Plugin $plugin) {
parent::__construct($plugin);
$this->menuTitle = __('Global Settings', 'bizpanda');
if( !current_user_can('administrator') )
$this->capabilitiy = "manage_opanda_setting";
}
/**
* Requests assets (js and css) for the page.
*
* @see FactoryPages321_AdminPage
*
* @since 1.0.0
* @return void
*/
public function assets($scripts, $styles) {
$this->scripts->request('jquery');
$this->scripts->request( array(
'control.checkbox',
'control.dropdown',
'plugin.ddslick',
), 'bootstrap' );
$this->styles->request( array(
'bootstrap.core',
'bootstrap.form-group',
'bootstrap.separator',
'control.dropdown',
'control.checkbox',
), 'bootstrap' );
$this->scripts->add(OPANDA_BIZPANDA_URL . '/assets/admin/js/settings.010020.js');
$this->styles->add(OPANDA_BIZPANDA_URL . '/assets/admin/css/settings.010020.css');
}
/**
* Renders the page
*
* @sinve 1.0.0
* @return void
*/
public function indexAction() {
global $bizpanda;
$current = isset( $_GET['opanda_screen'] ) ? $_GET['opanda_screen'] : null;
$screens = array();
$subscriptionOptions = array(
'title' => __('Subscription Options', 'bizpanda'),
'class' => 'OPanda_SubscriptionSettings',
'path' => OPANDA_BIZPANDA_DIR . '/admin/pages/settings/class.subscription.php'
);
$socialOptions = array();
if ( BizPanda::hasFeature('social') || BizPanda::hasPlugin('sociallocker') ) {
$socialOptions = array(
'title' => __('Social Options', 'bizpanda'),
'class' => 'OPanda_SocialSettings',
'path' => OPANDA_BIZPANDA_DIR . '/admin/pages/settings/class.social.php'
);
}
// for the plugin Opt-In Panda, the subscription options should be the first
if ( BizPanda::isSinglePlugin() && BizPanda::hasPlugin('optinpanda') ) {
if ( empty( $current ) ) $current = 'subscription';
$screens['subscription'] = $subscriptionOptions;
if (!empty( $socialOptions ) ) $screens['social'] = $socialOptions;
} else {
if ( empty( $current ) ) $current = 'social';
if (!empty( $socialOptions ) ) $screens['social'] = $socialOptions;
if ( BizPanda::hasFeature('subscription') ) $screens['subscription'] = $subscriptionOptions;
}
if ( BizPanda::hasFeature('lockers') ) {
$screens['lock'] = array(
'title' => __('Lock Options', 'bizpanda'),
'class' => 'OPanda_AdvancedSettings',
'path' => OPANDA_BIZPANDA_DIR . '/admin/pages/settings/class.lock.php'
);
}
$screens['stats'] = array(
'title' => __('Stats', 'bizpanda'),
'class' => 'OPanda_StatsSettings',
'path' => OPANDA_BIZPANDA_DIR . '/admin/pages/settings/class.stats.php'
);
$screens['notifications'] = array(
'title' => __('Notifications', 'bizpanda'),
'class' => 'OPanda_NotificationsSettings',
'path' => OPANDA_BIZPANDA_DIR . '/admin/pages/settings/class.notifications.php'
);
$screens['zapier'] = array(
'title' => __('Zapier', 'bizpanda'),
'class' => 'OPanda_ZapierSettings',
'path' => OPANDA_BIZPANDA_DIR . '/admin/pages/settings/class.zapier.php'
);
$screens['permissions'] = array(
'title' => __('Permissions', 'bizpanda'),
'class' => 'OPanda_PermissionsSettings',
'path' => OPANDA_BIZPANDA_DIR . '/admin/pages/settings/class.permissions.php'
);
$screens['text'] = array(
'title' => __('Front-end Text', 'bizpanda'),
'class' => 'OPanda_TextSettings',
'path' => OPANDA_BIZPANDA_DIR . '/admin/pages/settings/class.text.php'
);
if ( BizPanda::hasFeature('terms') ) {
$screens['terms'] = array(
'title' => __('Terms & Policies', 'bizpanda'),
'class' => 'OPanda_TermsSettings',
'path' => OPANDA_BIZPANDA_DIR . '/admin/pages/settings/class.terms.php'
);
}
$screens = apply_filters( 'opanda_settings_screens', $screens );
if ( !isset( $screens[$current] ) ) $current = 'social';
require_once OPANDA_BIZPANDA_DIR . '/admin/pages/settings/class.settings.php';
require_once $screens[$current]['path'];
$screen = new $screens[$current]['class']( $this );
$action = isset( $_GET['opanda_action'] ) ? $_GET['opanda_action'] : null;
if ( !empty( $action ) ) {
$methodName = $action . 'Action';
$screen->$methodName();
return;
}
// getting options
$options = $screen->getOptions();
$options = apply_filters("opanda_{$current}_settings", $options );
// creating a form
$form = new FactoryForms328_Form(array(
'scope' => 'opanda',
'name' => 'setting'
), $bizpanda );
$form->setProvider( new FactoryForms328_OptionsValueProvider(array(
'scope' => 'opanda'
)));
$form->add($options);
if ( isset( $_POST['save-action'] ) ) {
do_action("opanda_{$current}_settings_saving");
$form->save();
do_action("opanda_{$current}_settings_saved");
$redirectArgs = apply_filters("opanda_{$current}_settings_redirect_args", array(
'opanda_saved' => 1,
'opanda_screen' => $current
));
return $this->redirectToAction('index', $redirectArgs);
}
$formAction = add_query_arg( array(
'post_type' => OPANDA_POST_TYPE,
'page' => 'settings-' . $bizpanda->pluginName,
'opanda_screen' => $current
), admin_url('edit.php') );
?>
<div class="wrap ">
<h2 class="nav-tab-wrapper">
<?php foreach ( $screens as $screenName => $screenData ) { ?><a href="<?php $this->actionUrl('index', array('opanda_screen' => $screenName)) ?>" class="nav-tab <?php if ( $screenName === $current ) { echo 'nav-tab-active'; } ?>">
<?php echo $screenData['title'] ?>
</a><?php } ?>
</h2>
<?php $screen->header() ?>
<div class="factory-bootstrap-331 opanda-screen-<?php echo $current ?>">
<form method="post" class="form-horizontal" action="<?php echo $formAction ?>">
<?php if ( isset( $_GET['opanda_saved'] ) && empty( $screen->error) ) { ?>
<div id="message" class="alert alert-success">
<p><?php _e('The settings have been updated successfully!', 'bizpanda') ?></p>
</div>
<?php } ?>
<?php if ( !empty( $screen->success ) ) { ?>
<div id="message" class="alert alert-success">
<p><?php echo $screen->success ?></p>
</div>
<?php } ?>
<?php if ( !empty( $screen->error ) ) { ?>
<div id="message" class="alert alert-danger">
<p><?php echo $screen->error ?></p>
</div>
<?php } ?>
<?php do_action('onp_sl_settings_options_notices') ?>
<div style="padding-top: 10px;">
<?php $form->html(); ?>
</div>
<div class="form-group form-horizontal">
<label class="col-sm-2 control-label"> </label>
<div class="control-group controls col-sm-10">
<input name="save-action" class="btn btn-primary" type="submit" value="<?php _e('Save Changes', 'bizpanda') ?>"/>
</div>
</div>
</form>
</div>
</div>
<?php
}
}
FactoryPages321::register($bizpanda, 'OPanda_SettingsPage');

View File

@@ -0,0 +1,407 @@
<?php
/**
* The file contains a page that shows the common settings for the plugin.
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2013, OnePress Ltd
*
* @package core
* @since 1.0.0
*/
/**
* The page Common Settings.
*
* @since 1.0.0
*/
class OPanda_AdvancedSettings extends OPanda_Settings {
public $id = 'advanced';
/**
* Shows the header html of the settings screen.
*
* @since 1.0.0
* @return void
*/
public function header() {
global $optinpanda;
?>
<p>
<?php _e('Options linked with the locking feature. Don\'t change the options here if you are not sure that you do.', 'bizpanda' )?>
</p>
<?php
}
/**
* A page to edit the Advanced Options.
*
* @since v3.7.2
* @return vod
*/
public function getOptions() {
global $optinpanda;
$forms = array();
$forms[] = array(
'type' => 'separator'
);
$forms[] = array(
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'debug',
'title' => __( 'Debug', 'bizpanda' ),
'hint' => __( 'If this option turned on, the plugin displays information about why the locker is not visible.', 'bizpanda' )
);
$forms[] = array(
'type' => 'separator'
);
$forms[] = array(
'type' => 'textbox',
'name' => 'passcode',
'title' => __( 'Pass Code', 'bizpanda' ),
'hint' => sprintf( __( 'Optional. When the pass code is contained in your website URL, the locked content gets automatically unlocked.<br/><div class="opanda-example"><strong>Usage example:</strong> <a href="#" class="opanda-url" target="_blank">%s<span class="opanda-passcode"></span></a></div>', 'bizpanda' ), site_url() ),
'default' => false
);
$forms[] = array(
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'permanent_passcode',
'title' => __( 'Permanent Unlock<br /> For Pass Code', 'bizpanda' ),
'hint' => __( 'Optional. If On, your lockers will be revealed forever if the user once opened the page URL with the Pass Code.<br />Otherwise your lockers will be unlocked only when the page URL contains the Pass Code.', 'bizpanda' ),
'default' => false
);
if ( BizPanda::hasPlugin('sociallocker') ) {
$forms[] = array(
'type' => 'separator'
);
$forms[] = array(
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'interrelation',
'title' => __( 'Interrelation', 'bizpanda' ),
'hint' => __( 'Set On to make lockers interrelated. When one of the interrelated lockers are unlocked on your site, the others will be unlocked too.<br /> Recommended to turn on, if you use the Batch Locking feature.', 'bizpanda' ),
'default' => false
);
}
if ( BizPanda::hasPlugin('optinpanda') ) {
if ( !BizPanda::hasPlugin('sociallocker') ) {
$forms[] = array(
'type' => 'separator'
);
}
$forms[] = array(
'type' => 'dropdown',
'data' => array(
array( 'byemail', __('Unlock all email lockers having the same list together.', 'bizpanda') ),
array( 'bypage', __('Unlock all email lockers located on the same page together.', 'bizpanda') )
),
'name' => 'emaillocker_mode',
'default' => 'byemail',
'title' => __( 'Email Lockers', 'bizpanda' ),
'hint' => __( 'Sets what parameter will be used to link and unlock email lockers.', 'bizpanda' )
);
$forms[] = array(
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'forbid_temp_emails',
'default' => false,
'title' => __( 'Forbid Temp Emails', 'bizpanda' ),
'hint' => __( 'If On, the locker will not accept temporary email address to unlock content.', 'bizpanda' )
);
$tempDomains = self::getTempEmailDomains();
$forms[] = array(
'type' => 'div',
'id' => 'temp_domains_list',
'items' => array(
array(
'type' => 'textarea',
'name' => 'temp_domains',
'default' => implode(', ', $tempDomains),
'title' => __( 'Forbid Email Domains', 'bizpanda' ),
'hint' => __( 'A list of domains (and their parts) used for creating temporary email addresses. You can edit it or leave it as is.', 'bizpanda' )
)
)
);
}
$forms[] = array(
'type' => 'separator'
);
$forms[] = array(
'type' => 'dropdown',
'data' => array(
array( 'visible_with_warning', __('Show Locker With Warning', 'bizpanda') ),
array( 'visible', __('Show Locker As Usual', 'bizpanda') ),
array( 'hidden', __('Hide Locker', 'bizpanda') ),
),
'name' => 'in_app_browsers',
'default' => 'visible_with_warning',
'title' => __( 'In-App Browsers', 'bizpanda' ),
'hint' => __( 'Optional. By default the locker appears when a page is opened in in-app mobile browsers like Facebook In-App Browser, Instagram In-App Browser (and others). For some users the locker may not work properly in in-app browsers, so you can hide it or show the locker with a warning offering to open a page in a standard browser.', 'bizpanda' )
);
$forms[] = array(
'type' => 'div',
'id' => 'in_app_browsers_warning',
'items' => array(
array(
'type' => 'textarea',
'name' => 'in_app_browsers_warning',
'title' => __( 'In-App Warning', 'bizpanda' ),
'default' => __( 'You are viewing this page in the {browser}. The locker may work incorrectly in this browser. Please open this page in a standard browser.', 'bizpanda' ),
'hint' => __( 'A warning message visible together with the locker when a user opens your page in an in-app browser.', 'bizpanda' )
)
)
);
if ( BizPanda::hasPlugin('sociallocker') ) {
$forms[] = array(
'type' => 'separator'
);
$forms[] = array(
'type' => 'dropdown',
'data' => array(
array( 'show_error', __('Show Locker With Error', 'bizpanda') ),
array( 'show_content', __('Hide Locker, Show Content', 'bizpanda') )
),
'name' => 'adblock',
'default' => 'show_error',
'title' => __( 'AdBlock', 'bizpanda' ),
'hint' => __( 'Optional. Setup how the locker should behave if AdBlock blocks social widgets.', 'bizpanda' )
);
$forms[] = array(
'type' => 'div',
'id' => 'adblock_error',
'items' => array(
array(
'type' => 'textarea',
'name' => 'adblock_error',
'title' => __( 'AdBlock Error', 'bizpanda' ),
'default' => __( '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' ),
'hint' => __( 'An error displaying when AdBlock extensions block loading of social buttons.', 'bizpanda' )
)
)
);
}
$forms[] = array(
'type' => 'separator'
);
$forms[] = array(
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'rss',
'title' => __( 'Locked content<br /> is visible in RSS feeds', 'bizpanda' ),
'hint' => __( 'Set On to make locked content visible in RSS feed.', 'bizpanda' ),
'default' => false
);
if ( BizPanda::hasPlugin('sociallocker') ) {
$forms[] = array(
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'actual_urls',
'title' => __( 'Actual URLs by default', 'bizpanda' ),
'hint' => __( 'Optional. If you do not set explicitly URLs to like/share in the settings of social buttons, then by default the plugin will use an URL of the page where the locker is located. Turn on this option to extract URLs to like/share from an address bar of the user browser, saving all query arguments. By default permalinks are used.', 'bizpanda' ),
'default' => false
);
}
$forms[] = array(
'type' => 'separator'
);
$forms[] = array(
'type' => 'html',
'html' => '<div class="col-md-offset-2" style="padding: 30px 0 10px 0;">' .
'<strong style="font-size: 15px;">' . __('Advanced Options', 'bizpanda') . '</strong>' .
'<p>' . __('Please don\'t change these options if everything works properly.', 'bizpanda') . '</p>' .
'</div>'
);
$forms[] = array(
'type' => 'separator'
);
$forms[] = array(
'type' => 'textbox',
'name' => 'session_duration',
'title' => __( 'Session Duration<br />(in secs)', 'bizpanda' ),
'hint' => __( 'Optional. The session duration used in the advanced Visiblity Options. The default value 900 seconds (15 minutes).', 'bizpanda' ),
'default' => 900
);
$forms[] = array(
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'session_freezing',
'title' => __( 'Session Freezing', 'bizpanda' ),
'hint' => __( 'Optional. If On, the length of users\' sessions is fixed, by default the sessions are prolonged automatically every time when a user visits your website for a specified value of the session duration.', 'bizpanda' ),
'default' => false
);
$forms[] = array(
'type' => 'separator'
);
$forms[] = array(
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'normalize_markup',
'title' => __( 'Normalize Markup', 'bizpanda' ),
'hint' => __( 'Optional. If you use the Batch Lock and the locker appears incorrectly, probably HTML markup of your page is broken. Try to turn on this option and the plugin will try to normalize html markup before output.', 'bizpanda' )
);
$forms[] = array(
'type' => 'separator'
);
$forms[] = array(
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'dynamic_theme',
'title' => __( 'I use a dynamic theme', 'bizpanda' ),
'hint' => __( 'If your theme loads pages dynamically via ajax, set "On" to get the lockers working (if everything works properly, don\'t turn on this option).', 'bizpanda' )
);
$forms[] = array(
'type' => 'textbox',
'way' => 'buttons',
'name' => 'managed_hook',
'title' => __( 'Creater Trigger', 'bizpanda' ),
'hint' => __( 'Optional. Set any jQuery trigger bound to the root document to create lockers. By default lockers are created on loading a page.', 'bizpanda' )
);
$forms[] = array(
'type' => 'separator'
);
$forms[] = array(
'type' => 'dropdown',
'name' => 'alt_overlap_mode',
'data' => array(
array( 'full', __('Classic (full)', 'bizpanda') ),
array( 'transparence', __('Transparency', 'bizpanda') )
),
'default' => 'transparence',
'title' => __( 'Alt Overlap Mode', 'bizpanda' ),
'hint' => __( 'This overlap mode will be applied for browsers which don\'t support the blurring effect.', 'bizpanda' )
);
$forms[] = array(
'type' => 'dropdown',
'data' => array(
array( 'auto', __('Auto', 'bizpanda') ),
array( 'always_hidden', __('Hidden On Loading', 'bizpanda') ),
array( 'always_visible', __('Visible On Loading', 'bizpanda') )
),
'name' => 'content_visibility',
'default' => 'auto',
'title' => __( 'Content Visibility<br />On Loading', 'bizpanda' ),
'hint' => __( 'By default if the blurring or transparent mode is used, the content may be visible during a short time before the locker appears. On other side, if the classic mode is used, the locked content is hidden by default on loading. Change this option to manage content visibility when a page loads.', 'bizpanda' )
);
if ( BizPanda::hasPlugin('sociallocker') ) {
$forms[] = array(
'type' => 'separator'
);
$forms[] = array(
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'tumbler',
'title' => __( 'Anti-Cheating', 'bizpanda' ),
'default' => false,
'hint' => __( 'Turn it on to protect your locked content against cheating from visitors. Some special browser extensions allow to view the locked content without actual sharing. This option checks whether the user has really liked/shared your page.', 'bizpanda' )
);
$forms[] = array(
'type' => 'textbox',
'name' => 'timeout',
'title' => __( 'Timeout of waiting<br />loading the locker (in ms)', 'bizpanda' ),
'default' => '20000',
'hint' => __( 'A user can have browser extensions which block loading scripts of social networks. If the social buttons have not been loaded within the specified timeout interval, the locker shows the error (in the red container) alerting about that a browser blocks loading of the social buttons.<br />', 'bizpanda' )
);
}
$forms[] = array(
'type' => 'separator'
);
return $forms;
}
/**
* Returns a list of default temporary email domains.
*/
public static function getTempEmailDomains() {
return array(
'sharklasers',
'grr',
'guerrillamail',
'guerrillamailblock',
'pokemail',
'spam4',
'yk20.com',
'0hiolce.com',
'etoic.com',
'jklasdf.com',
'u.0u.ro',
'uacro.com',
'rblx.site',
'malove.site',
'harvard-ac-uk.tk',
'xing886',
'xww.ro',
'barryogorman.com',
'kozow.com',
'dmarc.ro',
'freemail.tweakly.net',
'ppetw.com',
'uu.gl',
'usa.cc',
'0v.ro',
'mailfs.com',
'apssdc.ml',
'0w.ro',
'laoho.com',
'wupics.com',
'xww.ro',
'getnada.com',
'amail.club',
'banit',
'cars2.club',
'cmail.club',
'duck2.club',
'nada.email',
'nada.ltd',
'wmail.club'
);
}
}

View File

@@ -0,0 +1,164 @@
<?php
/**
* A class for the page providing the basic settings.
*
* @author Alex Kovalev <alex.kovalevv@gmail.com>
* @copyright (c) 2016, OnePress Ltd
*
* @package core
* @since 1.0.0
*/
/**
* The page Basic Settings.
*
* @since 1.0.0
*/
class OPanda_NotificationsSettings extends OPanda_Settings {
public $id = 'notifications';
public function __construct($page) {
parent::__construct($page);
}
/**
* Shows the header html of the settings screen.
*
* @since 1.0.0
* @return void
*/
public function header() {
global $optinpanda;
?>
<p>
<?php _e('Mark events you wish to get notifications about.', 'bizpanda' )?>
</p>
<?php
}
/**
* Returns options for the Basic Settings screen.
*
* @since 1.0.0
* @return void
*/
public function getOptions() {
$options = array();
$wpEditorData = array();
$defaultLeadsEmail = file_get_contents( OPANDA_BIZPANDA_DIR . '/content/leads-notification.html' );
$defaultUnlocksEmail = file_get_contents( OPANDA_BIZPANDA_DIR . '/content/unlocks-notification.html' );
$options[] = array(
'type' => 'separator'
);
$options[] = array(
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'notify_leads',
'title' => __( 'New Lead Received', 'bizpanda' ),
'default' => false,
'hint' => __( 'Set On to recived notifications via email about new leads.', 'bizpanda' )
);
$options[] = array(
'type' => 'div',
'id' => 'opanda_notify_leads-options',
'items' => array(
array(
'type' => 'separator'
),
array(
'type' => 'textbox',
'name' => 'leads_email_receiver',
'default' => get_option('admin_email'),
'title' => __('Recipient', 'bizpanda'),
'hint' => __('An email address of the recipient to send notifications.', 'bizpanda')
),
array(
'type' => 'textbox',
'name' => 'leads_email_subject',
'default' => 'A new lead grabbed on {sitename}',
'title' => __('Subject', 'bizpanda'),
'hint' => __('A subject of the notification email. Supported tags: {sitename}.', 'bizpanda')
),
array(
'type' => 'wp-editor',
'name' => 'leads_email_body',
'data' => $wpEditorData,
'title' => __('Message', 'bizpanda'),
'hint' => __('A body of the notification email. Supported tags: {sitename}, {siteurl}, {details}, {context}.', 'bizpanda'),
'tinymce' => array(
'height' => 250,
'content_css' => OPANDA_BIZPANDA_URL . '/assets/admin/css/tinymce.010000.css'
),
'default' => $defaultLeadsEmail
),
array(
'type' => 'separator'
)
)
);
$options[] = array(
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'notify_unlocks',
'title' => __( 'Unlock Occurred', 'bizpanda' ),
'default' => false,
'hint' => __( 'Set On to recived notifications via email about unlocks.', 'bizpanda' )
);
$options[] = array(
'type' => 'div',
'id' => 'opanda_notify_unlocks-options',
'items' => array(
array(
'type' => 'separator'
),
array(
'type' => 'textbox',
'name' => 'unlocks_email_receiver',
'default' => get_option('admin_email'),
'title' => __('Recipient', 'bizpanda'),
'hint' => __('An email address of the recipient to send notifications.', 'bizpanda')
),
array(
'type' => 'textbox',
'name' => 'unlocks_email_subject',
'default' => 'A new unlock occurred on {sitename}',
'title' => __('Subject', 'bizpanda'),
'hint' => __('A subject of the notification email. Supported tags: {sitename}.', 'bizpanda')
),
array(
'type' => 'wp-editor',
'name' => 'unlocks_email_body',
'data' => $wpEditorData,
'title' => __('Message', 'bizpanda'),
'hint' => __('A body of the notification email. Supported tags: {sitename}, {siteurl}, {context}.', 'bizpanda'),
'tinymce' => array(
'height' => 250,
'content_css' => OPANDA_BIZPANDA_URL . '/assets/admin/css/tinymce.010000.css'
),
'default' => $defaultUnlocksEmail
)
)
);
$options[] = array(
'type' => 'separator'
);
return $options;
}
public function onSaving() {
}
}

View File

@@ -0,0 +1,189 @@
<?php
/**
* A class for the page providing the basic settings.
*
* @author Alex Kovalev <alex.kovalevv@gmail.com>
* @copyright (c) 2016, OnePress Ltd
*
* @package core
* @since 1.0.0
*/
/**
* The page Basic Settings.
*
* @since 1.0.0
*/
class OPanda_PermissionsSettings extends OPanda_Settings {
public $id = 'permissions';
public function __construct($page) {
parent::__construct($page);
global $wp_roles;
$this->wp_roles = $wp_roles;
if ( !isset( $wp_roles ) )
$this->wp_roles = new WP_Roles();
$this->roles = $this->wp_roles->get_names();
}
/**
* Shows the header html of the settings screen.
*
* @since 1.0.0
* @return void
*/
public function header() {
global $optinpanda;
?>
<p>
<?php _e('Configure roles and permissions for getting access to the plugin features.', 'bizpanda' )?>
</p>
<?php
}
/**
* Returns options for the Basic Settings screen.
*
* @since 1.0.0
* @return void
*/
public function getOptions() {
$options = array();
$options[] = array(
'type' => 'separator'
);
foreach ($this->roles as $role_value => $role_name) {
if( $role_value == 'administrator' )
continue;
$options[] = array(
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'user_role_' . $role_value,
'title' => sprintf(__( '%s Role', 'bizpanda' ), $role_name),
'default' => false,
'hint' => sprintf(__( 'Grants access for users with the %s role.', 'bizpanda' ), $role_name)
);
$options[] =array(
'type' => 'div',
'class' => 'opanda-user-role-options-group',
'id' => 'opanda_user_role_' . $role_value . '_options_group',
'items' => array(
array(
'type' => 'div',
'cssClass' => 'permissions-set',
'items' => array(
array(
'type' => 'checkbox',
'name' => 'allow_user_role_' . $role_value . '_edit',
'title' => __( 'Lockers', 'bizpanda' ),
'default' => false,
'hint' => sprintf(__( 'Allows to view and edit lockers.', 'bizpanda' ), $role_name)
),
array(
'type' => 'checkbox',
'name' => 'allow_user_role_' . $role_value . '_leads',
'title' => __( 'Leads', 'bizpanda' ),
'default' => false,
'hint' => sprintf(__( 'Grants access to the Leads page.', 'bizpanda' ), $role_name)
),
array(
'type' => 'checkbox',
'name' => 'allow_user_role_' . $role_value . '_stats',
'title' => __( 'Stats & Reports', 'bizpanda' ),
'default' => true,
'hint' => sprintf(__( 'Grants access to the Stats & Reports page.', 'bizpanda' ), $role_name)
),
array(
'type' => 'checkbox',
'name' => 'allow_user_role_' . $role_value . '_setting',
'title' => __( 'Settings', 'bizpanda' ),
'default' => false,
'hint' => sprintf(__( 'Grants access to the Global Settings page.', 'bizpanda' ), $role_name)
),
array(
'type' => 'checkbox',
'name' => 'allow_user_role_' . $role_value . '_licensing',
'title' => __( 'License Manager', 'bizpanda' ),
'default' => false,
'hint' => sprintf(__( 'Grants access to the License Manager page.', 'bizpanda' ), $role_name)
)
)
)
)
);
$options[] = array(
'type' => 'separator'
);
}
return $options;
}
public function onSaving() {
foreach ($this->roles as $role_value => $role_name) {
if( $role_value == 'administrator' )
continue;
$this->editCapabilityOption($role_value, 'edit');
$this->editCapabilityOption($role_value, 'leads');
$this->editCapabilityOption($role_value, 'stats');
$this->editCapabilityOption($role_value, 'setting');
$this->editCapabilityOption($role_value, 'licensing');
}
}
public function editCapabilityOption($role_name, $capabilityPrefix) {
$role = $GLOBALS [ 'wp_roles' ]->role_objects[$role_name];
if( isset($_POST['opanda_allow_user_role_' . $role_name . '_'. $capabilityPrefix]) && !empty($_POST['opanda_allow_user_role_' . $role_name . '_' . $capabilityPrefix]) ) {
if( $capabilityPrefix != 'edit' )
$this->wp_roles->add_cap( $role_name, 'manage_opanda_' . $capabilityPrefix );
else {
$this->wp_roles->add_cap( $role_name, 'read_opanda-item' );
$this->wp_roles->add_cap( $role_name, 'read_private_opanda-items' );
$this->wp_roles->add_cap( $role_name, 'delete_opanda-item' );
$this->wp_roles->add_cap( $role_name, 'delete_opanda-items' );
$this->wp_roles->add_cap( $role_name, 'edit_opanda-item' );
$this->wp_roles->add_cap( $role_name, 'edit_opanda-items' );
$this->wp_roles->add_cap( $role_name, 'edit_others_opanda-items' );
$this->wp_roles->add_cap( $role_name, 'publish_opanda-items' );
}
} else {
if( $role->has_cap( 'manage_opanda_' . $capabilityPrefix ) && $capabilityPrefix != 'edit' )
$role->remove_cap( 'manage_opanda_' . $capabilityPrefix );
else if( $capabilityPrefix == 'edit' ) {
if( $role->has_cap( 'read_opanda-item' ) )
$this->wp_roles->remove_cap( $role_name, 'read_opanda-item' );
if( $role->has_cap( 'read_private_opanda-items' ) )
$this->wp_roles->remove_cap( $role_name, 'read_private_opanda-items' );
if( $role->has_cap( 'delete_opanda-item' ) )
$this->wp_roles->remove_cap( $role_name, 'delete_opanda-item' );
if( $role->has_cap( 'delete_opanda-items' ) )
$this->wp_roles->remove_cap( $role_name, 'delete_opanda-items' );
if( $role->has_cap( 'edit_opanda-item' ) )
$this->wp_roles->remove_cap( $role_name, 'edit_opanda-item' );
if( $role->has_cap( 'edit_opanda-items' ) )
$this->wp_roles->remove_cap( $role_name, 'edit_opanda-items' );
if( $role->has_cap( 'edit_others_opanda-items' ) )
$this->wp_roles->remove_cap( $role_name, 'edit_others_opanda-items' );
if( $role->has_cap( 'publish_opanda-items' ) )
$this->wp_roles->remove_cap( $role_name, 'publish_opanda-items' );
}
}
}
}

View File

@@ -0,0 +1,157 @@
<?php
/**
* The base class for screens of settings.
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2014, OnePress Ltd
*
* @since 1.0.0
*/
abstract class OPanda_Settings {
/**
* Saves the current page object to make available the URLs methods.
* And calls the init method to set notices.
*
* @since 1.0.0
*
* @param FactoryPages321_AdminPage $page
* @return OPanda_Settings
*/
public function __construct( $page ) {
$this->page = $page;
$this->plugin = $page->plugin;
add_action("opanda_{$this->id}_settings_saving", array($this, 'onSaving'));
add_action("opanda_{$this->id}_settings_saved", array($this, 'onSaved'));
add_filter("opanda_{$this->id}_settings_redirect_args", array( $this, 'addErrorsToRedirectArgs') );
$this->isSaving = isset( $_POST['save-action'] );
if ( isset( $_REQUEST['opanda_error'] ) ) {
$this->error = urldecode( $_REQUEST['opanda_error'] );
}
$this->init();
}
/**
* The success notice to display.
*
* @since 1.0.0
* @var string
*/
public $success = null;
/**
* The error notice to display.
*
* @since 1.0.0
* @var string
*/
public $error = null;
/**
* Inits the settings.
* Here you can set the notices to display.
*
* @since 1.0.0
* @return void
*/
public function init() {}
/**
* Shows the header html of the settings.
* Usually it's a concise description of the current screen of the settings.
*
* @since 1.0.0
* @return void
*/
public function header() {}
/**
* Shows the footer html of the settings. Currently it's not used.
*
* @since 1.0.0
* @return void
*/
public function footer() {}
/**
* Returns the array of the options to display.
*
* @since 1.0.0
* @return mixed[]
*/
abstract public function getOptions();
/**
* Builds an URL for the specified action with the set arguments.
*
* @since 1.0.0
* @param string $action An action of the current screen of settings.
* @param string[] $args A set of extra arguments.
* @return string The result URL.
*/
public function getActionUrl( $action = 'index', $args = array() ) {
$args['opanda_screen'] = $this->id;
if ( 'index' !== $action ) $args['opanda_action'] = $action;
return $this->page->getActionUrl('index', $args);
}
/**
* Prints an URL for the specified action with the set arguments.
*
* @since 1.0.0
* @param string $action An action of the current screen of settings.
* @param string[] $args A set of extra arguments.
* @return string The result URL.
*/
public function actionUrl( $action = 'index', $args = array() ) {
echo $this->getActionUrl( $action );
}
/**
* Redirects to the specified action with the set arguments.
*
* @since 1.0.0
* @param string $action An action of the current screen of settings.
* @param string[] $args A set of extra arguments.
* @return string The result URL.
*/
public function redirectToAction( $action = 'index', $args = array() ) {
wp_redirect( $this->getActionUrl( $action = 'index', $args) );
exit;
}
/**
* Calls before saving the settings.
*
* @since 1.0.0
* @return void
*/
public function onSaving() {}
/**
* Calls after the form is saved.
*
* @since 1.0.0
* @return void
*/
public function onSaved() {}
/**
* Shows an error.
*/
public function showError( $text ) {
$this->error = $text;
}
public function addErrorsToRedirectArgs( $args ) {
if ( empty( $this->error ) || !$this->isSaving ) return $args;
$args['opanda_error'] = urlencode($this->error);
return $args;
}
}

View File

@@ -0,0 +1,383 @@
<?php
/**
* A class for the page providing the social settings.
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2014, OnePress Ltd
*
* @package core
* @since 1.0.0
*/
/**
* The Social Settings
*
* @since 1.0.0
*/
class OPanda_SocialSettings extends OPanda_Settings {
public $id = 'social';
/**
* Shows the header html of the settings screen.
*
* @since 1.0.0
* @return void
*/
public function header() {
?>
<p><?php _e('Set up here your social API keys and app IDs for social buttons.', 'optionpanda') ?></p>
<?php
}
/**
* Returns subscription options.
*
* @since 1.0.0
* @return mixed[]
*/
public function getOptions() {
$languages = array(
array('ca_ES', __('Catalan', 'bizpanda')),
array('cs_CZ', __('Czech', 'bizpanda')),
array('cy_GB', __('Welsh', 'bizpanda')),
array('da_DK', __('Danish', 'bizpanda')),
array('de_DE', __('German', 'bizpanda')),
array('eu_ES', __('Basque', 'bizpanda')),
array('en_US', __('English', 'bizpanda')),
array('es_ES', __('Spanish', 'bizpanda')),
array('fi_FI', __('Finnish', 'bizpanda')),
array('fr_FR', __('French', 'bizpanda')),
array('gl_ES', __('Galician', 'bizpanda')),
array('hu_HU', __('Hungarian', 'bizpanda')),
array('it_IT', __('Italian', 'bizpanda')),
array('ja_JP', __('Japanese', 'bizpanda')),
array('ko_KR', __('Korean', 'bizpanda')),
array('nb_NO', __('Norwegian', 'bizpanda')),
array('nl_NL', __('Dutch', 'bizpanda')),
array('pl_PL', __('Polish', 'bizpanda')),
array('pt_BR', __('Portuguese (Brazil)', 'bizpanda')),
array('pt_PT', __('Portuguese (Portugal)', 'bizpanda')),
array('ro_RO', __('Romanian', 'bizpanda')),
array('ru_RU', __('Russian', 'bizpanda')),
array('sk_SK', __('Slovak', 'bizpanda')),
array('sl_SI', __('Slovenian', 'bizpanda')),
array('sv_SE', __('Swedish', 'bizpanda')),
array('th_TH', __('Thai', 'bizpanda')),
array('tr_TR', __('Turkish', 'bizpanda')),
array('ku_TR', __('Kurdish', 'bizpanda')),
array('zh_CN', __('Simplified Chinese (China)', 'bizpanda')),
array('zh_HK', __('Traditional Chinese (Hong Kong)', 'bizpanda')),
array('zh_TW', __('Traditional Chinese (Taiwan)', 'bizpanda')),
array('af_ZA', __('Afrikaans', 'bizpanda')),
array('sq_AL', __('Albanian', 'bizpanda')),
array('hy_AM', __('Armenian', 'bizpanda')),
array('az_AZ', __('Azeri', 'bizpanda')),
array('be_BY', __('Belarusian', 'bizpanda')),
array('bn_IN', __('Bengali', 'bizpanda')),
array('bs_BA', __('Bosnian', 'bizpanda')),
array('bg_BG', __('Bulgarian', 'bizpanda')),
array('hr_HR', __('Croatian', 'bizpanda')),
array('nl_BE', __('Dutch (Belgie)', 'bizpanda')),
array('eo_EO', __('Esperanto', 'bizpanda')),
array('et_EE', __('Estonian', 'bizpanda')),
array('fo_FO', __('Faroese', 'bizpanda')),
array('ka_GE', __('Georgian', 'bizpanda')),
array('el_GR', __('Greek', 'bizpanda')),
array('gu_IN', __('Gujarati', 'bizpanda')),
array('hi_IN', __('Hindi', 'bizpanda')),
array('is_IS', __('Icelandic', 'bizpanda')),
array('id_ID', __('Indonesian', 'bizpanda')),
array('ga_IE', __('Irish', 'bizpanda')),
array('jv_ID', __('Javanese', 'bizpanda')),
array('kn_IN', __('Kannada', 'bizpanda')),
array('kk_KZ', __('Kazakh', 'bizpanda')),
array('la_VA', __('Latin', 'bizpanda')),
array('lv_LV', __('Latvian', 'bizpanda')),
array('li_NL', __('Limburgish', 'bizpanda')),
array('lt_LT', __('Lithuanian', 'bizpanda')),
array('mk_MK', __('Macedonian', 'bizpanda')),
array('mg_MG', __('Malagasy', 'bizpanda')),
array('ms_MY', __('Malay', 'bizpanda')),
array('mt_MT', __('Maltese', 'bizpanda')),
array('mr_IN', __('Marathi', 'bizpanda')),
array('mn_MN', __('Mongolian', 'bizpanda')),
array('ne_NP', __('Nepali', 'bizpanda')),
array('pa_IN', __('Punjabi', 'bizpanda')),
array('rm_CH', __('Romansh', 'bizpanda')),
array('sa_IN', __('Sanskrit', 'bizpanda')),
array('sr_RS', __('Serbian', 'bizpanda')),
array('so_SO', __('Somali', 'bizpanda')),
array('sw_KE', __('Swahili', 'bizpanda')),
array('tl_PH', __('Filipino', 'bizpanda')),
array('ta_IN', __('Tamil', 'bizpanda')),
array('tt_RU', __('Tatar', 'bizpanda')),
array('te_IN', __('Telugu', 'bizpanda')),
array('ml_IN', __('Malayalam', 'bizpanda')),
array('uk_UA', __('Ukrainian', 'bizpanda')),
array('uz_UZ', __('Uzbek', 'bizpanda')),
array('vi_VN', __('Vietnamese', 'bizpanda')),
array('xh_ZA', __('Xhosa', 'bizpanda')),
array('zu_ZA', __('Zulu', 'bizpanda')),
array('km_KH', __('Khmer', 'bizpanda')),
array('tg_TJ', __('Tajik', 'bizpanda')),
array('ar_AR', __('Arabic', 'bizpanda')),
array('he_IL', __('Hebrew', 'bizpanda')),
array('ur_PK', __('Urdu', 'bizpanda')),
array('fa_IR', __('Persian', 'bizpanda')),
array('sy_SY', __('Syriac', 'bizpanda')),
array('yi_DE', __('Yiddish', 'bizpanda')),
array('gn_PY', __('Guarani', 'bizpanda')),
array('qu_PE', __('Quechua', 'bizpanda')),
array('ay_BO', __('Aymara', 'bizpanda')),
array('se_NO', __('Northern Sami', 'bizpanda')),
array('ps_AF', __('Pashto', 'bizpanda'))
);
$options = array();
$options[] = array(
'type' => 'separator'
);
$options[] = array(
'type' => 'html',
'html' => '<div class="col-md-offset-2" style="padding: 10px 0 10px 0;">' .
'<strong style="font-size: 15px;">' . __('Social Buttons', 'bizpanda') . '</strong>' .
'<p>' . __('Options to configure native social buttons (Like, Share, Tweet, Subscribe).', 'bizpanda') . '</p>' .
'</div>'
);
$options[] = array(
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'lazy',
'title' => __( 'Lazy Loading', 'bizpanda' ),
'hint' => __( 'If on, start loading resources needed for the buttons only when the locker gets visible on the screen on scrolling. Speeds up loading the website.', 'bizpanda' )
);
$options[] = array(
'type' => 'separator'
);
$options[] = array(
'type' => 'dropdown',
'name' => 'lang',
'title' => __( 'Language of Buttons', 'bizpanda' ),
'data' => $languages,
'hint' => sprintf( __( 'Optional. Select the language that will be used for the social buttons. Used only with the native buttons.', 'bizpanda' ), opanda_get_settings_url('text') )
);
$options[] = array(
'type' => 'dropdown',
'way' => 'buttons',
'name' => 'facebook_version',
'title' => __( 'Facebook API Version', 'bizpanda' ),
'default' => 'v5.0',
'data' => array(
array('v5.0', 'v5.0'),
array('v6.0', 'v6.0'),
array('v7.0', 'v7.0'),
),
'hint' => __( 'Optional. Use the most recent version of the API by default.', 'bizpanda' )
);
$options[] = array(
'type' => 'separator'
);
$options[] = array(
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'own_apps_for_permissions',
'title' => __( 'Use Own Apps<br />To Request Permissions', 'bizpanda' ),
'hint' => __( 'Optional. Some social buttons require a user to grant a set of permissions to perform social actions. It works fine out-of-box by using embedded social apps. At the case if you wish to display a logo of your website when a user grants the permissions you need to register your own social apps.', 'bizpanda' )
);
$options[] = array(
'type' => 'div',
'id' => 'own_social_apps_wrap',
'items' => $this->getSocialAppsOptions()
);
$options[] = array(
'type' => 'separator'
);
$options[] = array(
'type' => 'html',
'html' => '<div class="col-md-offset-2" style="padding: 10px 0 10px 0;">' .
'<strong style="font-size: 15px;">' . __('Sign-In Buttons', 'bizpanda') . '</strong>' .
'<p>' . __('Options to configure sign-in buttons used with sign-in lockers.', 'bizpanda') . '</p>' .
'</div>'
);
$options[] = array(
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'own_apps_to_signin',
'title' => __( 'Use Own Apps<br />To Sign-In Users', 'bizpanda' ),
'hint' => __( 'Optional. Sign-In buttons work fine out-of-box by using embedded social apps. Set your own apps only if you wish to display a logo of your website when a user signs-in.', 'bizpanda' )
);
$options[] = array(
'type' => 'div',
'id' => 'own_signin_apps_wrap',
'items' => $this->getSignInAppsOptions()
);
$options[] = array(
'type' => 'separator'
);
return $options;
}
/**
* Returns options for social buttons.
*/
protected function getSocialAppsOptions() {
$options[] = array(
'type' => 'separator'
);
$options[] = array(
'type' => 'textbox',
'name' => 'facebook_app_id',
'title' => __( 'Facebook App ID', 'bizpanda' ),
'hint' => sprintf( __( 'The App ID of your Facebook App.', 'bizpanda' ), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=facebook-app') ),
'after' => sprintf( __( '<a href="%s" class="btn btn-default">How To Get</a>', 'bizpanda' ), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=facebook-app') )
);
$options[] = array(
'type' => 'separator'
);
$options[] = array(
'type' => 'textbox',
'name' => 'google_client_id',
'title' => __( 'Google Client ID', 'bizpanda' ),
'after' => sprintf( __( '<a href="%s" class="btn btn-default">How To Get</a>', 'bizpanda' ), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=google-client-id') ),
'hint' => sprintf( __( 'The Google Client ID of your Google App.', 'bizpanda' ) )
);
$options[] = array(
'type' => 'textbox',
'name' => 'google_client_secret',
'title' => __( 'Google Client Secret', 'bizpanda' ),
'hint' => __( 'The Google Client Secret of your Google App.', 'bizpanda' )
);
$options[] = array(
'type' => 'separator'
);
$options[] = array(
'type' => 'textbox',
'name' => 'twitter_social_app_consumer_key',
'title' => __( 'Twitter App Key', 'bizpanda' ),
'after' => sprintf( __( '<a href="%s" class="btn btn-default">How To Get</a>', 'bizpanda' ), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=twitter-app') ),
'hint' => sprintf( __( 'The Twitter Consumer Key of your Twitter App (set only "Read" permission).', 'bizpanda' ) )
);
$options[] = array(
'type' => 'textbox',
'name' => 'twitter_social_app_consumer_secret',
'title' => __( 'Twitter App Key Secret', 'bizpanda' ),
'hint' => __( 'The Twitter Consumer Secret of your Twitter App.', 'bizpanda' ),
'for' => array(__('Connect Locker', 'bizpanda'))
);
return $options;
}
/**
* Returns options for sign-in buttons.
*/
protected function getSignInAppsOptions() {
$options[] = array(
'type' => 'separator'
);
$options[] = array(
'type' => 'textbox',
'name' => 'facebook_app_id',
'title' => __( 'Facebook App ID', 'bizpanda' ),
'after' => sprintf( __( '<a href="%s" class="btn btn-default">How To Get</a>', 'bizpanda' ), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=facebook-app') ),
'hint' => sprintf( __( 'The Facebook App ID of your Facebook App.', 'bizpanda' ) )
);
$options[] = array(
'type' => 'textbox',
'name' => 'facebook_app_secret',
'title' => __( 'Facebook App Secret', 'bizpanda' ),
'hint' => __( 'The Facebook App Secret of your Facebook App.', 'bizpanda' )
);
$options[] = array(
'type' => 'separator'
);
$options[] = array(
'type' => 'textbox',
'name' => 'google_client_id',
'title' => __( 'Google Client ID', 'bizpanda' ),
'after' => sprintf( __( '<a href="%s" class="btn btn-default">How To Get</a>', 'bizpanda' ), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=google-client-id') ),
'hint' => sprintf( __( 'The Google Client ID of your Google App.', 'bizpanda' ) )
);
$options[] = array(
'type' => 'textbox',
'name' => 'google_client_secret',
'title' => __( 'Google Client Secret', 'bizpanda' ),
'hint' => __( 'The Google Client Secret of your Google App.', 'bizpanda' )
);
$options[] = array(
'type' => 'separator'
);
$options[] = array(
'type' => 'textbox',
'name' => 'twitter_signin_app_consumer_key',
'title' => __( 'Twitter App Key', 'bizpanda' ),
'after' => sprintf( __( '<a href="%s" class="btn btn-default">How To Get</a>', 'bizpanda' ), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=twitter-app') ),
'hint' => sprintf( __( 'The Twitter Consumer Key of your Twitter App (set "Read" and "Write" permissions).', 'bizpanda' ) )
);
$options[] = array(
'type' => 'textbox',
'name' => 'twitter_signin_app_consumer_secret',
'title' => __( 'Twitter App Key Secret', 'bizpanda' ),
'hint' => __( 'The Twitter Consumer Secret of your Twitter App.', 'bizpanda' ),
'for' => array(__('Connect Locker', 'bizpanda'))
);
$options[] = array(
'type' => 'separator'
);
$options[] = array(
'type' => 'textbox',
'name' => 'linkedin_client_id',
'title' => __( 'LinkedIn Client ID', 'bizpanda' ),
'after' => sprintf( __( '<a href="%s" class="btn btn-default">How To Get</a>', 'bizpanda' ), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=linkedin-api-key') ),
'hint' => sprintf( __( 'The LinkedIn Client ID of your LinkedIn App.', 'bizpanda' ) )
);
$options[] = array(
'type' => 'textbox',
'name' => 'linkedin_client_secret',
'title' => __( 'LinkedIn Client Secret', 'bizpanda' ),
'hint' => __( 'The LinkedIn Client Secret of your LinkedIn App.', 'bizpanda' )
);
return $options;
}
}

View File

@@ -0,0 +1,189 @@
<?php
/**
* A class for the page providing the basic settings.
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2013, OnePress Ltd
*
* @package core
* @since 1.0.0
*/
/**
* The page Basic Settings.
*
* @since 1.0.0
*/
class OPanda_StatsSettings extends OPanda_Settings {
public $id = 'stats';
/**
* Sets notices.
*
* @since 1.0.0
* @return void
*/
public function init() {
if ( isset( $_GET['onp_table_cleared'] )) {
$this->success = __('The data has been successfully cleared.', 'bizpanda');
}
}
/**
* Shows the header html of the settings screen.
*
* @since 1.0.0
* @return void
*/
public function header() {
?>
<p><?php _e('Configure here how the plugin should collect the statistical data.', 'optionpanda') ?></p>
<?php
}
/**
* Returns options for the Basic Settings screen.
*
* @since 1.0.0
* @return void
*/
public function getOptions() {
global $optinpanda;
$options = array();
$options[] = array(
'type' => 'separator'
);
$options[] = array(
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'google_analytics',
'title' => __( 'Google Analytics', 'bizpanda' ),
'hint' => __( 'If set On, the plugin will generate <a href="https://support.google.com/analytics/answer/1033068?hl=en" target="_blank">events</a> for the Google Analytics when the content is unlocked.<br /><strong>Note:</strong> before enabling this feature, please <a href="https://support.google.com/analytics/answer/1008015?hl=en" target="_blank">make sure</a> that your website contains the Google Analytics tracker code.', 'bizpanda' )
);
$options[] = array(
'type' => 'html',
'html' => array($this, 'statsHtml')
);
$options[] = array(
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'tracking',
'title' => __( 'Collecting Stats', 'bizpanda' ),
'hint' => __( 'Turns on collecting the statistical data for reports.', 'bizpanda' )
);
$options[] = array(
'type' => 'separator'
);
return $options;
}
/**
* Render the html block on how much the statistics data takes places.
*
* @sinve 1.0.0
* @return void
*/
public function statsHtml() {
global $wpdb;
$dataSizeInBytes = $wpdb->get_var(
"SELECT round(data_length + index_length) as 'size_in_bytes' FROM information_schema.TABLES WHERE " .
"table_schema = '" . DB_NAME . "' AND table_name = '{$wpdb->prefix}opanda_stats_v2'");
$count = $wpdb->get_var("SELECT COUNT(*) AS n FROM {$wpdb->prefix}opanda_stats_v2");
$humanDataSize = factory_325_get_human_filesize( $dataSizeInBytes );
?>
<div class="form-group">
<label class="col-sm-2 control-label"></label>
<div class="control-group controls col-sm-10">
<p class="onp-sl-inline">
<?php if ( $count == 0 ) { ?>
<?php printf( __( 'The statistical data is <strong>empty</strong>.', 'bizpanda' ), $humanDataSize ); ?>
<?php } else { ?>
<?php printf( __( 'The statistical data takes <strong>%s</strong> on your server', 'bizpanda' ), $humanDataSize ); ?>
<a class="button" style="margin-left: 5px;" href="<?php $this->actionUrl('clearStatsData') ?>"><?php _e('clear data', 'bizpanda') ?></a>
<?php } ?>
</p>
</div>
</div>
<?php
}
/**
* Clears the statisticals data.
*
* @sinve 1.0.0
* @return void
*/
public function clearStatsDataAction() {
if ( !isset( $_REQUEST['onp_confirmed'] ) ) {
return $this->confirm(array(
'title' => __('Are you sure that you want to clear the current statistical data?', 'bizpanda'),
'description' => __('All the statistical data will be removed.', 'bizpanda'),
'actions' => array(
'onp_confirm' => array(
'class' => 'btn btn-danger',
'title' => __("Yes, I'm sure", 'bizpanda'),
'url' => $this->getActionUrl('clearStatsData', array(
'onp_confirmed' => true
))
),
'onp_cancel' => array(
'class' => 'btn btn-default',
'title' => __("No, return back", 'bizpanda'),
'url' => $this->getActionUrl('index')
),
)
));
}
global $wpdb;
$wpdb->query("DELETE FROM {$wpdb->prefix}opanda_stats_v2");
$lockers = get_posts(array(
'post_type' => OPANDA_POST_TYPE
));
foreach( $lockers as $locker ) {
delete_post_meta($locker->ID, 'opanda_imperessions');
delete_post_meta($locker->ID, 'opanda_unlocks');
}
return $this->redirectToAction('index', array('onp_table_cleared' => true));
}
/**
* Shows the html block with a confirmation dialog.
*
* @sinve 1.0.0
* @return void
*/
public function confirm( $data ) {
?>
<div class="onp-page-wrap factory-bootstrap-331" id="onp-confirm-dialog">
<div id="onp-confirm-dialog-wrap">
<h1><?php echo $data['title'] ?></h1>
<p><?php echo $data['description'] ?></p>
<div class='onp-actions'>
<?php foreach( $data['actions'] as $action ) { ?>
<a href='<?php echo $action['url'] ?>' class='<?php echo $action['class'] ?>'>
<?php echo $action['title'] ?>
</a>
<?php } ?>
</div>
</div>
</div>
<?php
}
}

View File

@@ -0,0 +1,147 @@
<?php
/**
* A class for the page providing the subscription settings.
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2014, OnePress Ltd
*
* @package core
* @since 1.0.0
*/
/**
* The Subscription Settings
*
* @since 1.0.0
*/
class OPanda_SubscriptionSettings extends OPanda_Settings {
public $id = 'subscription';
public function init() {
if ( isset( $_GET['opanda_aweber_disconnected'] )) {
$this->success = __('Your Aweber Account has been successfully disconnected.', 'bizpanda');
}
}
/**
* Shows the header html of the settings screen.
*
* @since 1.0.0
* @return void
*/
public function header() {
?>
<p><?php _e('Set up here how you would like to save emails of your subscribers.', 'optionpanda') ?></p>
<?php
}
/**
* Returns subscription options.
*
* @since 1.0.0
* @return mixed[]
*/
public function getOptions() {
$options = array();
$options[] = array(
'type' => 'separator'
);
require_once OPANDA_BIZPANDA_DIR . '/admin/includes/subscriptions.php';
$serviceList = OPanda_SubscriptionServices::getSerivcesList();
// fix
$service = get_option('opanda_subscription_service', 'database');
if ( $service == 'none' ) update_option('opanda_subscription_service', 'database');
$listItems = array();
foreach( $serviceList as $serviceName => $serviceInfo ) {
$listItems[] = array(
'value' => $serviceName,
'title' => $serviceInfo['title'],
'hint' => isset( $serviceInfo['description'] ) ? $serviceInfo['description'] : null,
'image' => isset( $serviceInfo['image'] ) ? $serviceInfo['image'] : null,
'hover' => isset( $serviceInfo['hover'] ) ? $serviceInfo['hover'] : null
);
}
$options[] = array(
'type' => 'dropdown',
'name' => 'subscription_service',
'way' => 'ddslick',
'width' => 450,
'data' => $listItems,
'default' => 'none',
'title' => __('Mailing Service', 'bizpanda')
);
$options = apply_filters( 'opanda_subscription_services_options', $options, $this );
$options[] = array(
'type' => 'separator'
);
$options[] = array( 'type' => 'html', 'html' => array($this, 'showConfirmationMessageHeader') );
$options[] = array(
'type' => 'textbox',
'name' => 'sender_email',
'title' => __('Sender Email', 'bizpanda'),
'hint' => __('Optional. A sender for confirmation emails.', 'bizpanda'),
'default' => get_bloginfo('admin_email')
);
$options[] = array(
'type' => 'textbox',
'name' => 'sender_name',
'title' => __('Sender Name', 'bizpanda'),
'hint' => __('Optional. A sender name for confirmation emails.', 'bizpanda'),
'default' => get_bloginfo('name')
);
$options[] = array(
'type' => 'separator'
);
return $options;
}
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('If you are going to use Double Opt-In and send confirmation emails through Wordpress, fill the sender information below.', 'emaillocker' ) ?>
</div>
</div>
<?php
}
/**
* Calls before saving the settings.
*
* @since 1.0.0
* @return void
*/
public function onSaving() {
do_action('opanda_on_saving_subscription_settings', $this );
}
public function disconnectAweberAction() {
delete_option('opanda_aweber_consumer_key');
delete_option('opanda_aweber_consumer_secret');
delete_option('opanda_aweber_access_key');
delete_option('opanda_aweber_access_secret');
delete_option('opanda_aweber_auth_code');
delete_option('opanda_aweber_account_id');
return $this->redirectToAction('index', array('opanda_aweber_disconnected' => true));
}
}

View File

@@ -0,0 +1,198 @@
<?php
/**
* A class for the page providing the basic settings.
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2013, OnePress Ltd
*
* @package core
* @since 1.0.0
*/
/**
* The page Basic Settings.
*
* @since 1.0.0
*/
class OPanda_TermsSettings extends OPanda_Settings {
public $id = 'terms';
/**
* Sets notices.
*
* @since 1.0.0
* @return void
*/
public function init() {
if ( isset( $_GET['onp_table_cleared'] )) {
$this->success = __('The data has been successfully cleared.', 'bizpanda');
}
}
/**
* Shows the header html of the settings screen.
*
* @since 1.0.0
* @return void
*/
public function header() {
?>
<p><?php _e('Configure here Terms of Use and Privacy Policy for locker on your website. It\'s not mandatory, but improves transparency and conversions.', 'optionpanda') ?></p>
<?php
}
/**
* Returns options for the Basic Settings screen.
*
* @since 1.0.0
* @return void
*/
public function getOptions() {
global $optinpanda;
$options = array();
$pages = get_pages();
$result = array();
foreach( $pages as $page ) {
$result[] = array($page->ID, $page->post_title . ' [ID=' . $page->ID . ']');
}
$defaultTermsOfUse = file_get_contents( OPANDA_BIZPANDA_DIR . '/content/terms-of-use.html' );
$defaultPrivacy = file_get_contents( OPANDA_BIZPANDA_DIR . '/content/privacy-policy.html' );
$options[] = array(
'type' => 'separator'
);
$options[] = array(
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'terms_enabled',
'title' => __('Enable Terms of Use', 'bizpanda'),
'hint' => __('Set On to show the link to Terms of Use of your website below the Sign-In/Email lockers.', 'bizpanda'),
'default' => true
);
$options[] = array(
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'privacy_enabled',
'title' => __('Enable Privacy Policies', 'bizpanda'),
'hint' => __('Set On to show the link to Privacy Policies of your website below the Sign-In/Email lockers.', 'bizpanda'),
'default' => true
);
$options[] = array(
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'terms_use_pages',
'data' => $result,
'title' => __('Use Existing Pages', 'bizpanda'),
'hint' => __('Set On, if your website already contains pages for "Terms of Use" and "Privacy Policies" and you want to use them.', 'bizpanda'),
'default' => false
);
$options[] = array(
'type' => 'separator'
);
$noPagesWrap = array(
'type' => 'div',
'id' => 'opanda-nopages-options',
'items' => array(
array(
'type' => 'div',
'id' => 'no-page-opanda-terms-enabled-options',
'items' => array(
array(
'type' => 'wp-editor',
'name' => 'terms_of_use_text',
'title' => __('Terms of Use', 'bizpanda'),
'hint' => __('The text of Terms of Use. The link to this text will be shown below the lockers.', 'bizpanda'),
'tinymce' => array(
'height' => 250,
'content_css' => OPANDA_BIZPANDA_URL . '/assets/admin/css/tinymce.010000.css'
),
'default' => $defaultTermsOfUse
),
array(
'type' => 'separator'
)
)
),
array(
'type' => 'div',
'id' => 'no-page-opanda-privacy-enabled-options',
'items' => array(
array(
'type' => 'wp-editor',
'name' => 'privacy_policy_text',
'title' => __('Privacy Policy', 'bizpanda'),
'hint' => __('The text of Privacy Policy. The link to this text will be shown below the lockers.', 'bizpanda'),
'tinymce' => array(
'height' => 250,
'content_css' => OPANDA_BIZPANDA_URL . '/assets/admin/css/tinymce.010000.css'
),
'default' => $defaultPrivacy
),
array(
'type' => 'separator'
)
)
)
)
);
$pagesWrap = array(
'type' => 'div',
'id' => 'opanda-pages-options',
'items' => array(
array(
'type' => 'div',
'id' => 'page-opanda-terms-enabled-options',
'items' => array(
array(
'type' => 'dropdown',
'name' => 'terms_of_use_page',
'data' => $result,
'title' => __('Terms of Use', 'bizpanda'),
'hint' => __('Select a page which contains the "Terms of Use" for the lockers or/and your website.', 'bizpanda')
),
array(
'type' => 'separator'
)
)
),
array(
'type' => 'div',
'id' => 'page-opanda-privacy-enabled-options',
'items' => array(
array(
'type' => 'dropdown',
'name' => 'privacy_policy_page',
'data' => $result,
'title' => __('Privacy Policy', 'bizpanda'),
'hint' => __('Select a page which contains the "Privacy Policy" for the lockers or/and your website.', 'bizpanda')
),
array(
'type' => 'separator'
)
)
),
)
);
$options[] = $noPagesWrap;
$options[] = $pagesWrap;
return $options;
}
}

View File

@@ -0,0 +1,463 @@
<?php
/**
* A class for the page providing the basic settings.
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2013, OnePress Ltd
*
* @package core
* @since 1.0.0
*/
/**
* The page Basic Settings.
*
* @since 1.0.0
*/
class OPanda_TextSettings extends OPanda_Settings {
public $id = 'text';
/**
* Shows the header html of the settings screen.
*
* @since 1.0.0
* @return void
*/
public function header() {
?>
<p><?php _e('You can change primary front-end text in the settings of a particular locker. Here you can change the remaining text. It will be applied to all your lockers.', 'bizpanda') ?></p>
<?php
}
/**
* Returns options for the Basic Settings screen.
*
* @since 1.0.0
* @return void
*/
public function getOptions() {
global $optinpanda;
$options = array();
$pages = get_pages();
$result = array();
$result[] = array('0', '- none -');
foreach( $pages as $page ) {
$result[] = array($page->ID, $page->post_title . ' [ID=' . $page->ID . ']');
}
$confirmScreenOptions = array(
'type' => 'form-group',
'title' => 'The Screen "Please Confirm Your Email"',
'hint' => __('Appears when the locker asks the user to confirm one\'s email.', 'bizpanda'),
'items' => array(
array(
'type' => 'textbox',
'name' => 'res_confirm_screen_title',
'title' => __('Header', 'bizpanda'),
'default' => __('Please Confirm Your Email', 'bizpanda')
),
array(
'type' => 'textarea',
'name' => 'res_confirm_screen_instructiont',
'title' => __('Instruction', 'bizpanda'),
'hint' => __('Explain here that the user has to do to confirm one\'s email. Use the tag {email} to display an email address of the user.', 'bizpanda'),
'default' => __('We have sent a confirmation email to {email}. Please click on the confirmation link in the email to reveal the content.', 'bizpanda')
),
array(
'type' => 'textbox',
'name' => 'res_confirm_screen_note1',
'title' => __('Note #1', 'bizpanda'),
'hint' => __('Clarify when the content will be unlocked.', 'bizpanda'),
'default' => __('The content will be unlocked automatically within 10 seconds after confirmation.', 'bizpanda')
),
array(
'type' => 'textbox',
'name' => 'res_confirm_screen_note2',
'title' => __('Note #2', 'bizpanda'),
'hint' => __('Clarify that delivering the confirmation email may take some time.', 'bizpanda'),
'default' => __('Note delivering the email may take several minutes.', 'bizpanda')
),
array(
'type' => 'separator'
),
array(
'type' => 'textbox',
'name' => 'res_confirm_screen_cancel',
'title' => __('Cancel Link', 'bizpanda'),
'default' => __('(cancel)', 'bizpanda'),
'cssClass' => 'opanda-width-short'
),
array(
'type' => 'textbox',
'name' => 'res_confirm_screen_open',
'title' => __('Open My Inbox Button', 'bizpanda'),
'default' => __('Open my inbox on {service}', 'bizpanda'),
'hint' => __('Use the tag {service} to display a name of a mailbox of the user.', 'bizpanda'),
'cssClass' => 'opanda-width-short'
)
)
);
$onestepScreenOptions = array(
'type' => 'form-group',
'title' => 'The Screen "One Step To Complete"',
'hint' => __('Appears when a social network does not return an email address and the locker asks the users to enter it manually.', 'bizpanda'),
'items' => array(
array(
'type' => 'textbox',
'name' => 'res_onestep_screen_title',
'title' => __('Header', 'bizpanda'),
'default' => __('One Step To Complete', 'bizpanda')
),
array(
'type' => 'textarea',
'name' => 'res_onestep_screen_instructiont',
'title' => __('Instruction', 'bizpanda'),
'default' => __('Please enter your email below to continue.', 'bizpanda')
),
array(
'type' => 'textbox',
'name' => 'res_onestep_screen_button',
'title' => __('Button', 'bizpanda'),
'default' => __('OK, complete', 'bizpanda')
)
)
);
$preconfirmLikeScreenOptions = array();
if ( BizPanda::hasPlugin('sociallocker') ) {
$preconfirmLikeScreenOptions = array(
'type' => 'form-group',
'title' => __( 'The Screen "Confirm Your Like"', 'bizpanda' ),
'hint' => __('Appears when a user clicks on the Facebook Like button.', 'bizpanda'),
'items' => array(
array(
'type' => 'textbox',
'name' => 'res_confirm_like_screen_header',
'title' => __('Header', 'bizpanda'),
'default' => __('One More Step', 'bizpanda'),
'cssClass' => 'opanda-width-short',
),
array(
'type' => 'textbox',
'name' => 'res_confirm_like_screen_message',
'title' => __('Message', 'bizpanda'),
'default' => __('Click the button below to like and unlock.', 'bizpanda'),
'cssClass' => 'opanda-width-short'
),
array(
'type' => 'textbox',
'name' => 'res_confirm_like_screen_button',
'title' => __('Button', 'bizpanda'),
'default' => __('Confirm Like', 'bizpanda'),
'cssClass' => 'opanda-width-short'
)
)
);
}
$signinOptions = array();
if ( BizPanda::hasFeature('signin-locker')) {
$signinOptions = array(
'type' => 'form-group',
'title' => __( 'Sign-In Buttons', 'bizpanda' ),
'hint' => __('The text which are located on the Sign-In Buttons.', 'bizpanda'),
'items' => array(
array(
'type' => 'textbox',
'name' => 'res_signin_long',
'title' => __('Long Text', 'bizpanda'),
'hint' => __('Displayed on a wide Sign-In Button', 'bizpanda'),
'default' => __('Sign in via {name}', 'bizpanda'),
'cssClass' => 'opanda-width-short',
),
array(
'type' => 'textbox',
'name' => 'res_signin_short',
'title' => __('Short Text', 'bizpanda'),
'hint' => __('Displayed on a narrow Sign-In Button', 'bizpanda'),
'default' => __('via {name}', 'bizpanda'),
'cssClass' => 'opanda-width-short'
),
array(
'type' => 'separator'
),
array(
'type' => 'textbox',
'name' => 'res_signin_facebook_name',
'title' => __('Facebook', 'bizpanda'),
'default' => __('Facebook', 'bizpanda'),
'cssClass' => 'opanda-width-short'
),
array(
'type' => 'textbox',
'name' => 'res_signin_twitter_name',
'title' => __('Twitter', 'bizpanda'),
'default' => __('Twitter', 'bizpanda'),
'cssClass' => 'opanda-width-short'
),
array(
'type' => 'textbox',
'name' => 'res_signin_google_name',
'title' => __('Google', 'bizpanda'),
'default' => __('Google', 'bizpanda'),
'cssClass' => 'opanda-width-short'
),
array(
'type' => 'textbox',
'name' => 'res_signin_linkedin_name',
'title' => __('LinkedIn', 'bizpanda'),
'default' => __('LinkedIn', 'bizpanda'),
'cssClass' => 'opanda-width-short'
),
array(
'type' => 'separator'
),
array(
'type' => 'textbox',
'name' => 'res_signin_email_form_text',
'title' => __('Email Form Header', 'bizpanda'),
'default' => __('Cannot sign in via social networks? Enter your email manually.', 'bizpanda')
),
array(
'type' => 'textbox',
'name' => 'res_signin_email_button',
'title' => __('Email Button Text', 'bizpanda'),
'default' => __('sign in to unlock', 'bizpanda')
),
array(
'type' => 'textbox',
'name' => 'res_signin_after_email_button',
'title' => __('After Email Button Text', 'bizpanda'),
'default' => __('Your email address is 100% safe from spam!', 'bizpanda')
),
)
);
}
$miscOptions = array(
'type' => 'form-group',
'title' => 'Miscellaneous',
'hint' => __('Various text used usually with all lockers and screens.', 'bizpanda'),
'items' => array(
array(
'type' => 'textbox',
'name' => 'res_misc_data_processing',
'title' => __('Processing Data', 'bizpanda'),
'default' => __('Processing data, please wait...', 'bizpanda')
),
array(
'type' => 'textbox',
'name' => 'res_misc_or_enter_email',
'title' => __('Enter Your Email Manually', 'bizpanda'),
'default' => __('or enter your email manually to sign in', 'bizpanda')
),
array(
'type' => 'separator'
),
'res_misc_enter_your_name' => array(
'type' => 'textbox',
'name' => 'res_misc_enter_your_name',
'title' => __('Enter Your Name', 'bizpanda'),
'default' => __('enter your name', 'bizpanda')
),
array(
'type' => 'textbox',
'name' => 'res_misc_enter_your_email',
'title' => __('Enter Your Email Address', 'bizpanda'),
'default' => __('enter your email address', 'bizpanda')
),
array(
'type' => 'separator'
),
array(
'type' => 'textbox',
'name' => 'res_misc_your_agree_with',
'title' => __('You Agree With', 'bizpanda'),
'hint' => __('Use the tag {links} to display the links to the Terms Of Use and Privacy Policy or tags {terms} and {privacy) to display links apart.', 'bizpanda'),
'default' => __('By clicking on the button(s), you agree with {links}', 'bizpanda')
),
array(
'type' => 'textbox',
'name' => 'res_misc_agreement_checkbox',
'title' => __('I Consent To Processing', 'bizpanda'),
'default' => __('I consent to processing of my data according to {links}', 'bizpanda'),
'hint' => __('Use the tag {links} to display the links to the Terms Of Use and Privacy Policy or tags {terms} and {privacy) to display links apart.', 'bizpanda')
),
array(
'type' => 'textbox',
'name' => 'res_misc_agreement_checkbox_alt',
'title' => __('I Agree With', 'bizpanda'),
'default' => __('I agree with {links}', 'bizpanda'),
'hint' => __('Use the tag {links} to display the links to the Terms Of Use and Privacy Policy or tags {terms} and {privacy) to display links apart.', 'bizpanda')
),
array(
'type' => 'separator'
),
array(
'type' => 'textbox',
'name' => 'res_misc_terms_of_use',
'title' => __('Terms Of Use', 'bizpanda'),
'default' => __('Terms of Use', 'bizpanda'),
'cssClass' => 'opanda-width-short'
),
array(
'type' => 'textbox',
'name' => 'res_misc_privacy_policy',
'title' => __('Privacy Policy', 'bizpanda'),
'default' => __('Privacy Policy', 'bizpanda'),
'cssClass' => 'opanda-width-short'
),
array(
'type' => 'separator'
),
array(
'type' => 'textbox',
'name' => 'res_misc_or_wait',
'title' => __('Or Wait', 'bizpanda'),
'default' => __('or wait {timer}s', 'bizpanda'),
'hint' => __('Use the tag {timer} to display the number of seconds remaining to unlocking.'),
'cssClass' => 'opanda-width-short'
),
array(
'type' => 'textbox',
'name' => 'res_misc_close',
'title' => __('Close', 'bizpanda'),
'default' => __('close', 'bizpanda'),
'cssClass' => 'opanda-width-short'
),
array(
'type' => 'textbox',
'name' => 'res_misc_or',
'title' => __('Or', 'bizpanda'),
'default' => __('OR', 'bizpanda'),
'cssClass' => 'opanda-width-short'
),
)
);
if ( !BizPanda::hasPlugin('optinpanda') ) {
unset( $miscOptions['items']['res_misc_enter_your_name'] );
}
$errosOptions = array(
'type' => 'form-group',
'title' => __('Errors & Notices', 'bizpanda'),
'hint' => __('The text which users see when something goes wrong.', 'bizpanda'),
'items' => array(
array(
'type' => 'textbox',
'name' => 'res_errors_no_consent',
'title' => __('No Consent', 'bizpanda'),
'default' => __('Please give us your consent in order to continue.', 'bizpanda')
),
array(
'type' => 'separator'
),
array(
'type' => 'textbox',
'name' => 'res_errors_empty_field',
'title' => __('Empty Field', 'bizpanda'),
'default' => __('Please fill this field.', 'bizpanda')
),
array(
'type' => 'textbox',
'name' => 'res_errors_empty_email',
'title' => __('Empty Email', 'bizpanda'),
'default' => __('Please enter your email address.', 'bizpanda')
),
'res_errors_temporary_email' => array(
'type' => 'textbox',
'name' => 'res_errors_temporary_email',
'title' => __('Temporary Email', 'bizpanda'),
'default' => __('Sorry, temporary email addresses cannot be used to unlock content.', 'bizpanda')
),
array(
'type' => 'textbox',
'name' => 'res_errors_inorrect_email',
'title' => __('Incorrect Email', 'bizpanda'),
'default' => __('It seems you entered an incorrect email address. Please check it.', 'bizpanda')
),
array(
'type' => 'textbox',
'name' => 'res_errors_empty_name',
'title' => __('Empty Name', 'bizpanda'),
'default' => __('Please enter your name.', 'bizpanda')
),
array(
'type' => 'textbox',
'name' => 'res_errors_empty_checkbox',
'title' => __('Empty Checkbox', 'bizpanda'),
'default' => __('Please mark this checkbox to continue.', 'bizpanda')
),
array(
'type' => 'separator'
),
'res_errors_subscription_canceled' => array(
'type' => 'textbox',
'name' => 'res_errors_subscription_canceled',
'title' => __('Subscription Canceled', 'bizpanda'),
'default' => __('You have canceled your subscription.', 'bizpanda')
),
'res_errors_not_signed_in' => array(
'type' => 'textbox',
'name' => 'res_errors_not_signed_in',
'title' => __('Not Signed In', 'bizpanda'),
'default' => __('Sorry, but you have not signed in. Please try again.', 'bizpanda')
),
'res_errors_not_granted' => array(
'type' => 'textbox',
'name' => 'res_errors_not_granted',
'title' => __('Not Granted Permissions', 'bizpanda'),
'hint' => __('Use the tag {permissions} to show required permissions.'),
'default' => __('Sorry, but you have not granted all the required permissions ({permissions}). Please try again.', 'bizpanda')
)
)
);
if ( !BizPanda::hasFeature('signin-locker')) {
unset( $errosOptions['items']['res_errors_not_signed_in'] );
unset( $errosOptions['items']['res_errors_not_granted'] );
}
if ( !BizPanda::hasPlugin('optinpanda') ) {
unset( $errosOptions['items']['res_errors_subscription_canceled'] );
unset( $errosOptions['items']['res_errors_subscription_canceled'] );
}
$options = array();
if ( !empty( $preconfirmLikeScreenOptions ) ) $options[] = $preconfirmLikeScreenOptions;
if ( BizPanda::hasPlugin('optinpanda') ) {
$options[] = $confirmScreenOptions;
if ( !empty( $signinOptions ) ) $options[] = $signinOptions;
$options[] = $miscOptions;
} else {
if ( !empty( $signinOptions ) ) $options[] = $signinOptions;
$options[] = $miscOptions;
}
$options[] = $onestepScreenOptions;
$options[] = $errosOptions;
$options[] = array(
'type' => 'separator'
);
return $options;
}
}

View File

@@ -0,0 +1,110 @@
<?php
/**
* A class for the page providing the basic settings.
*
* @author Alex Kovalev <alex.kovalevv@gmail.com>
* @copyright (c) 2016, OnePress Ltd
*
* @package core
* @since 1.0.0
*/
/**
* The page Basic Settings.
*
* @since 1.0.0
*/
class OPanda_ZapierSettings extends OPanda_Settings {
public $id = 'zapier';
public function __construct($page) {
parent::__construct($page);
}
/**
* Shows the header html of the settings screen.
*
* @since 1.0.0
* @return void
*/
public function header() {
global $optinpanda;
?>
<p>
<?php printf( __('Allows to set up integration with Zapier via <a href="%s" target="_blank">Webhooks</a>.', 'bizpanda'), 'https://zapier.com/apps/webhook/integrations' )?>
</p>
<?php
}
/**
* Returns options for the Basic Settings screen.
*
* @since 1.0.0
* @return void
*/
public function getOptions() {
$options = array();
$wpEditorData = array();
$defaultLeadsEmail = file_get_contents( OPANDA_BIZPANDA_DIR . '/content/leads-notification.html' );
$defaultUnlocksEmail = file_get_contents( OPANDA_BIZPANDA_DIR . '/content/unlocks-notification.html' );
$options[] = array(
'type' => 'separator'
);
$options[] = array(
'type' => 'url',
'name' => 'zapier_hook_new_leads',
'title' => __( 'Hook For Leads', 'bizpanda' ),
'after' => sprintf( __( '<a href="%s" class="btn btn-default">How To Get</a>', 'bizpanda' ), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=zapier') ),
'default' => "",
'hint' => sprintf( __( 'Fires when a lead gained. <a href="%s" target="_blank">Click here</a> to know how to get a webhook URL.', 'bizpanda' ), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=zapier') )
);
$options[] = array(
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'zapier_only_new',
'title' => __( 'Only New Leads', 'bizpanda' ),
'default' => false,
'hint' => __( 'If On, sends data to Zapier only if a lead is new (not listed on the page Leads).', 'bizpanda' )
);
$options[] = array(
'type' => 'checkbox',
'way' => 'buttons',
'name' => 'zapier_only_confirmed',
'title' => __( 'Only Confirmed Leads', 'bizpanda' ),
'default' => false,
'hint' => __( 'If On, sends data to Zapier only for those leads who confirmed their subscription (or all leads if the Single Opt-In is set).', 'bizpanda' )
);
$options[] = array(
'type' => 'separator'
);
$options[] = array(
'type' => 'url',
'way' => 'buttons',
'name' => 'zipier_hook_new_unlocks',
'title' => __( 'Hook For New Unlocks', 'bizpanda' ),
'after' => sprintf( __( '<a href="%s" class="btn btn-default">How To Get</a>', 'bizpanda' ), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=zapier') ),
'default' => "",
'hint' => sprintf( __( 'Fires when a new unlock occurs. <a href="%s" target="_blank">Click here</a> to know how to get a webhook URL.', 'bizpanda' ), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=zapier') )
);
$options[] = array(
'type' => 'separator'
);
return $options;
}
public function onSaving() {
}
}

View File

@@ -0,0 +1,368 @@
<?php
/**
* The file contains a page that shows statistics
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2013, OnePress Ltd
*
* @package core
* @since 1.0.0
*/
/**
* Common Settings
*/
class OPanda_StatisticsPage extends OPanda_AdminPage {
public function __construct( $plugin ) {
$this->id = 'stats';
$this->menuPostType = OPANDA_POST_TYPE;
$this->menuTitle = __('Stats & Reports', 'bizpanda');
if( !current_user_can('administrator') )
$this->capabilitiy = "manage_opanda_stats";
parent::__construct( $plugin );
}
public function assets($scripts, $styles) {
$this->scripts->request('jquery');
$this->styles->request( array(
'bootstrap.core'
), 'bootstrap' );
$this->scripts->add(OPANDA_BIZPANDA_URL . '/assets/admin/js/libs/datepicker.js');
$this->styles->add(OPANDA_BIZPANDA_URL . '/assets/admin/css/libs/datepicker.css');
$this->scripts->add(OPANDA_BIZPANDA_URL . '/assets/admin/js/stats.010000.js');
$this->styles->add(OPANDA_BIZPANDA_URL . '/assets/admin/css/stats.010000.css');
}
/**
* Shows an index page where a user can set settings.
*
* @sinve 1.0.0
* @return void
*/
public function indexAction() {
// getting all the items for the item selector
$dropdownItems = get_posts(array(
'post_type' => OPANDA_POST_TYPE,
'meta_key' => 'opanda_item',
'meta_value' => OPanda_Items::getAvailableNames(),
'numberposts' => -1
));
// current item
$itemId = isset( $_GET['opanda_id'] ) ? $_GET['opanda_id'] : null;
if ( empty( $itemId ) ) {
$itemId = isset( $dropdownItems[0]->ID ) ? $dropdownItems[0]->ID : 0;
}
$itemName = OPanda_Items::getItemNameById($itemId);
$showPopup = ( count( $dropdownItems ) > 1 && !isset( $_GET['opanda_id'] ) );
$screens = apply_filters("opanda_item_type_stats_screens", array(), $itemName);
$screens = apply_filters("opanda_{$itemName}_stats_screens", $screens);
$item = get_post( $itemId );
if ( empty( $item) ) die( __('The item with ID = ' . $itemId . ' is not found.' , 'bizpanda' ) );
$itemTitle = empty( $item->post_title )
? sprintf( __('(no titled, id=%s)', 'bizpanda'), $item->ID )
: $item->post_title;
// current item screen
$currentScreenName = isset($_REQUEST['opanda_screen']) ? $_REQUEST['opanda_screen'] : 'summary';
$currentScreen = $screens[$currentScreenName];
require_once(OPANDA_BIZPANDA_DIR . '/admin/includes/classes/class.stats-screen.php');
require_once $currentScreen['path'];
$screenClass = isset( $currentScreen['screenClsss'] ) ? $currentScreen['screenClsss'] : 'OPanda_StatsScreen';
$screen = new $screenClass(array(
'chartClass' => $currentScreen['chartClass'],
'tableClass' => $currentScreen['tableClass']
));
// current post
$postId = isset($_REQUEST['opanda_post_id']) ? intval($_REQUEST['opanda_post_id']) : false;
$post = ($postId) ? get_post($postId) : false;
// set date range
$dateStart = isset($_REQUEST['opanda_date_start']) ? $_REQUEST['opanda_date_start'] : false;
$dateEnd = isset($_REQUEST['opanda_date_end']) ? $_REQUEST['opanda_date_end'] : false;
$hrsOffset = get_option('gmt_offset');
if (strpos($hrsOffset, '-') !== 0) $hrsOffset = '+' . $hrsOffset;
$hrsOffset .= ' hours';
// by default shows a 30 days' range
if ( empty($dateEnd) || ($dateRangeEnd = strtotime($dateEnd)) === false) {
$phpdate = getdate( strtotime($hrsOffset, time()) );
$dateRangeEnd = mktime(0, 0, 0, $phpdate['mon'], $phpdate['mday'], $phpdate['year']);
}
if ( empty($dateStart) || ($dateRangeStart = strtotime($dateStart)) === false) {
$dateRangeStart = strtotime("-1 month", $dateRangeEnd);
}
// getting the chart data
$chart = $screen->getChart(array(
'itemId' => $itemId,
'postId' => $postId,
'rangeStart' => $dateRangeStart,
'rangeEnd' => $dateRangeEnd,
));
// getting the table data
$page = ( isset( $_GET['opanda_page'] ) ) ? intval( $_GET['opanda_page'] ) : 1;
if ( $page <= 0 ) $page = 1;
$table = $screen->getTable(array(
'itemId' => $itemId,
'postId' => $postId,
'rangeStart' => $dateRangeStart,
'rangeEnd' => $dateRangeEnd,
'per' => 50,
'total' => true,
'page' => $page
));
// the base urls
$urlBase = add_query_arg( array(
'opanda_id' => $itemId,
'opanda_post_id' => $postId,
'opanda_screen' => $currentScreenName,
'opanda_date_start' => date('m/d/Y', $dateRangeStart),
'opanda_date_end' => date('m/d/Y', $dateRangeEnd),
), opanda_get_admin_url('stats') );
$dateStart = date('m/d/Y', $dateRangeStart);
$dateEnd = date('m/d/Y', $dateRangeEnd);
// extra css classes
$tableCssClass = '';
if ( $table->getColumnsCount() > 8 ) $tableCssClass .= ' opanda-concise-table';
else $tableCssClass .= ' opanda-free-table';
?>
<div class="wrap">
<h2><?php _e('Stats & Reports', 'bizpanda') ?></h2>
<div id="opanda-control-panel">
<div class="opanda-left" id="opanda-current-item">
<span><?php _e('You are viewing reports for ', 'bizpanda') ?> <a href="<?php echo admin_url("post.php?post=" . $itemId . "&action=edit") ?>"><strong><?php echo $itemTitle ?></strong></a></span>
</div>
<form method="get" id="opanda-item-selector" class="opanda-right">
<input type="hidden" name="post_type" value="<?php echo OPANDA_POST_TYPE ?>" />
<input type="hidden" name="page" value="stats-bizpanda" />
<input type="hidden" name="opanda_date_start" class="form-control" value="<?php echo $dateStart ?>" />
<input type="hidden" name="opanda_date_end" class="form-control" value="<?php echo $dateEnd ?>" />
<span><?php _e('Select a locker to view:', 'optionpanda') ?></span>
<select name="opanda_id">
<?php foreach( $dropdownItems as $dropdownItem ) { ?>
<option value="<?php echo $dropdownItem->ID ?>" <?php if ( $dropdownItem->ID == $itemId ) { echo 'selected="selected"'; } ?>>
<?php if ( empty($dropdownItem->post_title) ) { ?>
<?php printf( __('(no titled, id=%s)', 'bizpanda'), $dropdownItem->ID ) ?>
<?php } else { ?>
<?php echo $dropdownItem->post_title ?>
<?php } ?>
</option>
<?php } ?>
</select>
<input class="button" type="submit" value="<?php _e('Select', 'bizpanda') ?>" />
</form>
</div>
<div class="factory-bootstrap-331 factory-fontawesome-320">
<div class="onp-chart-hints">
<div class="onp-chart-hint onp-chart-hint-errors">
<?php printf( __('This chart shows the count of times when the locker was not available to use due to the visitor installed the extensions like Avast or Adblock which may block social networks.<br />By default, the such visitors see the locker without social buttons but with the offer to disable the extensions. You can set another behaviour <a href="%s"><strong>here</strong></a>.', 'bizpanda'), admin_url('admin.php?page=common-settings-' . $this->plugin->pluginName . '&action=advanced') ) ?>
</div>
</div>
<div id="opanda-chart-description">
<?php echo $currentScreen['description'] ?>
</div>
<div id="onp-sl-chart-area">
<form method="get">
<div id="onp-sl-settings-bar">
<div id="onp-sl-type-select">
<div class="btn-group" id="chart-type-group" data-toggle="buttons-radio">
<?php foreach ( $screens as $screenName => $screen ) { ?>
<a href="<?php echo add_query_arg( 'opanda_screen', $screenName, $urlBase ) ?>" class="btn btn-default <?php if ( $screenName == $currentScreenName ) { echo 'active'; } ?> type-<?php echo $screenName ?>" data-value="<?php echo $screenName ?>"><?php echo $screen['title'] ?></a>
<?php } ?>
</div>
</div>
<div id="onp-sl-date-select">
<input type="hidden" name="post_type" value="<?php echo OPANDA_POST_TYPE ?>" />
<input type="hidden" name="page" value="stats-bizpanda" />
<input type="hidden" name="opanda_post_id" value="<?php echo $postId ?>" />
<input type="hidden" name="opanda_screen" value="<?php echo $currentScreenName ?>" />
<input type="hidden" name="opanda_id" value="<?php echo $itemId ?>" />
<span class="onp-sl-range-label"><?php _e('Date range', 'bizpanda') ?>:</span>
<input type="text" id="onp-sl-date-start" name="opanda_date_start" class="form-control" value="<?php echo $dateStart ?>" />
<input type="text" id="onp-sl-date-end" name="opanda_date_end" class="form-control" value="<?php echo $dateEnd ?>" />
<a id="onp-sl-apply-dates" class="btn btn-default">
<?php _e('Apply', 'bizpanda') ?>
</a>
</div>
</div>
</form>
<div class="chart-wrap">
<div id="chart" style="width: 100%; height: 195px;"></div>
</div>
</div>
<div id="onp-sl-chart-selector">
<?php if ( $chart->hasSelectors() ) { ?>
<?php foreach( $chart->getSelectors() as $name => $field ) { ?>
<div class="onp-sl-selector-item onp-sl-selector-<?php echo $name ?>" data-selector="<?php echo $name ?>">
<span class="chart-color" style="background-color: <?php echo $field['color'] ?>"></span>
<?php echo $field['title'] ?>
</div>
<?php } ?>
<?php } ?>
</div>
<?php if ($postId) { ?>
<div class="alert alert-warning">
<?php echo sprintf(__('Data for the post: <strong>%s</strong> (<a href="%s">return back</a>)', 'bizpanda'),$post->post_title, add_query_arg( 'opanda_post_id', false, $urlBase ) ); ?>
</div>
<?php } else { ?>
<p><?php _e('Top-50 posts and pages where you put the locker, ordered by their performance:', 'bizpanda') ?></p>
<?php } ?>
<div id="opanda-data-table-wrap">
<table id="opanda-data-table" class="<?php echo $tableCssClass ?>">
<thead>
<?php if ( $table->hasComplexColumns() ) { ?>
<tr>
<?php foreach( $table->getHeaderColumns() as $name => $column ) { ?>
<th rowspan="<?php echo $column['rowspan'] ?>" colspan="<?php echo $column['colspan'] ?>" class="opanda-col-<?php echo $name ?> <?php echo isset( $column['cssClass'] ) ? $column['cssClass'] : '' ?> <?php if ( isset( $column['highlight']) ) { echo 'opanda-column-highlight'; } ?>">
<?php echo $column['title'] ?>
<?php if ( isset( $column['hint'] ) ) { ?>
<i class="opanda-hint" title="<?php echo $column['hint']; ?>"></i>
<?php } ?>
</th>
<?php } ?>
</tr>
<tr>
<?php foreach( $table->getHeaderColumns(2) as $name => $column ) { ?>
<th class="opanda-col-<?php echo $name ?> <?php echo isset( $column['cssClass'] ) ? $column['cssClass'] : '' ?> <?php if ( isset( $column['highlight']) ) { echo 'opanda-column-highlight'; } ?>">
<?php echo $column['title'] ?>
<?php if ( isset( $column['hint'] ) ) { ?>
<i class="opanda-hint" title="<?php echo $column['hint']; ?>"></i>
<?php } ?>
</th>
<?php } ?>
</tr>
<?php } else { ?>
<?php foreach( $table->getColumns() as $name => $column ) { ?>
<th class="opanda-column-<?php echo $name ?> <?php echo isset( $column['cssClass'] ) ? $column['cssClass'] : '' ?> <?php if ( isset( $column['highlight']) ) { echo 'opanda-column-highlight'; } ?>">
<?php echo $column['title'] ?>
<?php if ( isset( $column['hint'] ) ) { ?>
<i class="opanda-hint" title="<?php echo $column['hint']; ?>"></i>
<?php } ?>
</th>
<?php } ?>
<?php } ?>
</thead>
<tbody>
<?php for( $i = 0; $i < $table->getRowsCount(); $i++ ) { if ( $i >= 50 ) break; ?>
<tr>
<?php foreach( $table->getDataColumns() as $name => $column ) { ?>
<td class="opanda-col-<?php echo $name ?> <?php echo isset( $column['cssClass'] ) ? $column['cssClass'] : '' ?> <?php if ( isset( $column['highlight']) ) { echo 'opanda-column-highlight'; } ?>">
<?php $table->printValue( $i, $name, $column ) ?>
</td>
<?php } ?>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
<!-- Load the AJAX API -->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(function(){
window.bizpanda.statistics.drawChart({
'type': '<?php echo $chart->type ?>'
});
});
window.opanda_default_selectors = [<?php echo join(',', $chart->getSelectorsNames()) ?>];
window.chartData = [
<?php $chart->printData() ?>
];
</script>
<?php if ( $showPopup ) { ?>
<!-- Locker Select Popup -->
<div id="opanda-locker-select-overlap" style="display: none;"></div>
<div id="opanda-locker-select-popup" style="display: none;">
<strong><?php _e('Select Locker', 'bizpanda') ?></strong>
<p><?php _e('Please select a locker to view reports.', 'bizpanda') ?></p>
<select id="opanda-locker-select">
<?php foreach( $dropdownItems as $dropdownItem ) { ?>
<option value="<?php echo opanda_get_admin_url('stats', array('opanda_id' => $dropdownItem->ID)); ?>" <?php if ( $dropdownItem->ID == $itemId ) { echo 'selected="selected" data-default="true"'; } ?>>
<?php if ( empty($dropdownItem->post_title) ) { ?>
<?php printf( __('(no titled, id=%s)', 'bizpanda'), $dropdownItem->ID ) ?>
<?php } else { ?>
<?php echo $dropdownItem->post_title ?>
<?php } ?>
</option>
<?php } ?>
</select>
<input class="button" type="submit" value="<?php _e('Select', 'bizpanda') ?>" id="opanda-locker-select-submit" />
</div>
<?php } ?>
<?php
}
}
FactoryPages321::register($bizpanda, 'OPanda_StatisticsPage');