initial commit
@ -0,0 +1,22 @@
|
||||
.espbw-clearfix:before, .espbw-clearfix:after {content: "";display: table;}
|
||||
.espbw-clearfix::after {clear: both;}
|
||||
.espbw-hide{display: none;}
|
||||
.filter-links a{padding-left:30px !important; background-size:25px 25px; background-repeat:no-repeat; background-position:left center;}
|
||||
.filter-links .espbw-plugin-all a.espbw-filter-link{background-image:url('../images/essential-plugin-50.png');}
|
||||
.filter-links .espbw-plugin-recommended a.espbw-filter-link{background-image:url('../images/utility-icon.png');}
|
||||
.filter-links .espbw-plugin-marketing a.espbw-filter-link{background-image:url('../images/inbound50-by-50.png');}
|
||||
.filter-links .espbw-plugin-sliders a.espbw-filter-link{background-image:url('../images/sliderspack.png');}
|
||||
.filter-links .espbw-plugin-woo a.espbw-filter-link{background-image:url('../images/cart-2.png');}
|
||||
.wpos-em{font-size:15px; color:#e11919 !important;}
|
||||
.espbw-dashboard-logo{text-align: center;}
|
||||
.espbw-dashboard-logo img{width:140px;}
|
||||
.espbw-plugin-card-wrap{margin: 0 0 16px 0; display: inline-block; vertical-align: top; width: 50%; padding: 0 8px; font-size: 13px; box-sizing: border-box;}
|
||||
.espbw-plugin-list{margin: 0 -8px; font-size:0.001px; width: auto;}
|
||||
.espbw-plugin-list .plugin-card{float: none; width: 100%; margin: 0;}
|
||||
.espbw-dashboard-title{text-align: center;}
|
||||
.espbw-dashboard-title h3{margin: 10px 0 8px 0; font-size: 1.8em}
|
||||
.espbw-dashboard-title-inr{display: inline-block; text-align: right;}
|
||||
.espbw-dashboard-title-inr span{display: inline-block; font-weight: 600; text-decoration: underline;}
|
||||
.espbw-filter .espbw-search-inp{margin: 0; border-radius: 0;}
|
||||
.espbw-filter a:focus{box-shadow: none; outline: 0;}
|
||||
.espbw-search-no-result{clear: both; text-align: center; font-size: 16px;}
|
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 474 B |
After Width: | Height: | Size: 824 B |
After Width: | Height: | Size: 7.6 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 734 B |
@ -0,0 +1,76 @@
|
||||
/*jslint browser:true */
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
var timer;
|
||||
var timeOut = 300; /* delay after last keypress to execute filter */
|
||||
|
||||
$( document ).ready(function() {
|
||||
|
||||
/* Stop Submitting Search Form */
|
||||
$('.espbw-search-inp-js').submit(function( event ) {
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
$(document).on('keyup paste input', '.espbw-search-inp-js', function(event) {
|
||||
|
||||
clearTimeout(timer); /* if we pressed the key, it will clear the previous timer and wait again */
|
||||
var curr_ele = $(this);
|
||||
var cls_ele = curr_ele.closest('.espbw-dashboard-wrap');
|
||||
var search_ele = cls_ele.find('.espbw-plugin-list');
|
||||
|
||||
cls_ele.find('.espbw-search-no-result').hide();
|
||||
cls_ele.find('.espbw-filter-link').removeClass('current');
|
||||
|
||||
timer = setTimeout(function() {
|
||||
|
||||
var search_value = $.trim( curr_ele.val().toLowerCase() );
|
||||
var search_array = search_value.split(" ");
|
||||
|
||||
if( search_value == '' ) {
|
||||
cls_ele.find('.espbw-plugin-all .espbw-filter-link').addClass('current');
|
||||
}
|
||||
|
||||
search_ele.find('.espbw-plugin-card-wrap').each(function(index) {
|
||||
|
||||
var contents = $(this).find('.espbw-plugin-name').text().toLowerCase();
|
||||
var tags = $(this).attr('data-tags').toLowerCase();
|
||||
|
||||
if ( contents.indexOf(search_value) !== -1 || tags.indexOf(search_value) !== -1 ) {
|
||||
$(this).show();
|
||||
} else {
|
||||
$(this).hide();
|
||||
}
|
||||
});
|
||||
|
||||
if( ! cls_ele.find('.espbw-plugin-card-wrap').is(":visible") ) {
|
||||
cls_ele.find('.espbw-search-no-result').show();
|
||||
}
|
||||
|
||||
}, timeOut);
|
||||
});
|
||||
|
||||
/* Filter Links */
|
||||
$(document).on('click', '.espbw-filter-link', function() {
|
||||
|
||||
var curr_ele = $(this);
|
||||
var cls_ele = curr_ele.closest('.espbw-dashboard-wrap');
|
||||
var plugin_list_ele = cls_ele.find('.espbw-plugin-list');
|
||||
var filter = curr_ele.attr('data-filter');
|
||||
filter = filter ? filter : '';
|
||||
|
||||
cls_ele.find('.espbw-search-inp-js').val('');
|
||||
plugin_list_ele.find('.espbw-plugin-card-wrap').hide();
|
||||
cls_ele.find('.espbw-filter-link').removeClass('current');
|
||||
curr_ele.addClass('current');
|
||||
|
||||
if( filter == '' ) {
|
||||
plugin_list_ele.find('.espbw-plugin-card-wrap').show();
|
||||
} else {
|
||||
plugin_list_ele.find('.espbw-'+filter).show();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})(jQuery);
|
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* Admin Class
|
||||
* Handles the Admin side functionality of plugin
|
||||
*
|
||||
* @package Essential Plugins Bundle
|
||||
* @since 1.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
class WPOS_ESPBW_Admin {
|
||||
|
||||
function __construct() {
|
||||
|
||||
// Action to register admin menu
|
||||
add_action( 'admin_menu', array($this, 'espbw_register_menu'), 14 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to register admin menus
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
function espbw_register_menu() {
|
||||
|
||||
global $wpos_espbw_module;
|
||||
|
||||
// Loop of menu
|
||||
if( ! empty( $wpos_espbw_module ) ) {
|
||||
foreach ($wpos_espbw_module as $module_key => $module_val) {
|
||||
|
||||
// Dashboard Page
|
||||
add_submenu_page( $module_val['menu'], __('Essential Plugins Bundle By WP OnlineSuport', 'espbw'), '<span style="color:#2ECC71;">'.__('Install Popular Plugins From WPOS', 'espbw').'</span>', 'manage_options', "{$module_val['prefix']}-espbw-dashboard", array($this, 'espbw_dashboard_page'), $module_val['position'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render Plugin Dashboard Page
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
function espbw_dashboard_page() {
|
||||
include_once( WPOS_ESPBW_DIR . '/includes/admin/views/dashboard.php' );
|
||||
}
|
||||
}
|
||||
|
||||
$wpos_espbw_admin = new WPOS_ESPBW_Admin();
|
@ -0,0 +1,325 @@
|
||||
<?php
|
||||
/**
|
||||
* Dashboard Page
|
||||
*
|
||||
* @package Essential Plugins Bundle
|
||||
* @since 1.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
// Call Plugin API
|
||||
if ( ! function_exists( 'plugins_api' ) ) {
|
||||
require_once ABSPATH . '/wp-admin/includes/plugin-install.php';
|
||||
}
|
||||
|
||||
// Taking some data
|
||||
$plugins_allowedtags = array(
|
||||
'a' => array(
|
||||
'href' => array(),
|
||||
'title' => array(),
|
||||
'target' => array(),
|
||||
),
|
||||
'abbr' => array( 'title' => array() ),
|
||||
'acronym' => array( 'title' => array() ),
|
||||
'code' => array(),
|
||||
'pre' => array(),
|
||||
'em' => array(),
|
||||
'strong' => array(),
|
||||
'ul' => array(),
|
||||
'ol' => array(),
|
||||
'li' => array(),
|
||||
'p' => array(),
|
||||
'br' => array(),
|
||||
);
|
||||
|
||||
$plugins_data = wpos_espbw_get_plugin_data();
|
||||
$plugins_filter = wpos_espbw_plugins_filter();
|
||||
|
||||
// Check Plugin Install Permission
|
||||
if( ! current_user_can('install_plugins') ) {
|
||||
echo '<div class="error">
|
||||
<p>'. esc_html__( "Sorry, It looks like that you do not have permission to install the plugin.", "espbw") .'</p>
|
||||
<p>'. esc_html__("You can take a look at our all plugins at", "espbw") .' <a href="https://profiles.wordpress.org/wponlinesupport#content-plugins" target="_blank">'. esc_html__("here", "espbw") . '</a>.</p>
|
||||
</div>';
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
var pagenow = 'plugin-install';
|
||||
</script>
|
||||
<div class="wrap espbw-settings">
|
||||
<div class="espbw-dashboard-wrap">
|
||||
|
||||
<div class="espbw-dashboard-title">
|
||||
<div class="espbw-dashboard-title-inr">
|
||||
<div class="espbw-dashboard-logo"><a href="<?php echo WTPSW_SITE_LINK; ?>/?utm_source=wp&utm_medium=plugin&utm_campaign=essential-bundle" target="_blank"><img src="<?php echo esc_url( WPOS_ESPBW_URL ); ?>assets/images/essentialplugin-logo.png" alt="essentialplugin" /></a></div>
|
||||
<h3 style="text-align:center;"><?php esc_html_e( 'Essential Plugins', 'espbw' ); ?></h3>
|
||||
<em class="wpos-em">Installs directly from <b>wordpress.org</b> repository</em> <br />
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
|
||||
<div class="wp-filter espbw-filter">
|
||||
<ul class="filter-links espbw-filter-links">
|
||||
<li class="espbw-plugin-all"><a href="javascript:void(0);" class="espbw-filter-link current"><?php esc_html_e('All Essential Plugins', 'espbw'); ?></a></li>
|
||||
<li class="espbw-plugin-recommended"><a href="javascript:void(0);" class="espbw-filter-link" data-filter="recommended"><?php esc_html_e('Utility Plugins', 'espbw'); ?></a></li>
|
||||
<li class="espbw-plugin-sliders"><a href="javascript:void(0);" class="espbw-filter-link" data-filter="sliders"><?php esc_html_e('Sliders', 'espbw'); ?></a></li>
|
||||
<li class="espbw-plugin-woo"><a href="javascript:void(0);" class="espbw-filter-link" data-filter="woocommerce"><?php esc_html_e('WooCommerce', 'espbw'); ?></a></li>
|
||||
</ul>
|
||||
|
||||
<form class="search-form search-plugins" method="get">
|
||||
<input type="hidden" name="page" value="espbw-dashboard" />
|
||||
<input type="search" name="espbw_search" value="" class="wp-filter-search espbw-search-inp espbw-search-inp-js" placeholder="<?php echo esc_html_e('Search Plugins e.g popup', 'espbw'); ?>" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php if( ! empty( $plugins_data->plugins ) ) { ?>
|
||||
<form id="plugin-filter" method="post">
|
||||
<div class="espbw-plugin-list-wrap">
|
||||
<div class="widefat espbw-plugin-list espbw-clearfix" id="the-list">
|
||||
|
||||
<?php foreach ($plugins_data->plugins as $plugin_key => $plugin_data) {
|
||||
|
||||
if ( is_object( $plugin_data ) ) {
|
||||
$plugin_data = (array) $plugin_data;
|
||||
}
|
||||
|
||||
// Taking some data
|
||||
$title = wp_kses( $plugin_data['name'], $plugins_allowedtags );
|
||||
$version = wp_kses( $plugin_data['version'], $plugins_allowedtags );
|
||||
$name = strip_tags( $title . ' ' . $version );
|
||||
$description = strip_tags( $plugin_data['short_description'] );
|
||||
$last_updated_timestamp = strtotime( $plugin_data['last_updated'] );
|
||||
$author = wp_kses( $plugin_data['author'], $plugins_allowedtags );
|
||||
$author = str_replace( "href=", 'target="_blank" href=', $author );
|
||||
$requires_php = isset( $plugin['requires_php'] ) ? $plugin['requires_php'] : null;
|
||||
$requires_wp = isset( $plugin_data['requires'] ) ? $plugin_data['requires'] : null;
|
||||
$compatible_php = is_php_version_compatible( $requires_php );
|
||||
$compatible_wp = is_wp_version_compatible( $requires_wp );
|
||||
$tested_wp = ( empty( $plugin_data['tested'] ) || version_compare( get_bloginfo( 'version' ), $plugin_data['tested'], '<=' ) );
|
||||
$details_link = self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_data['slug'] . '&TB_iframe=true&width=600&height=550' );
|
||||
$extra_class = ( ! empty( $plugins_filter[ $plugin_data['slug'] ]['class'] ) ) ? $plugins_filter[ $plugin_data['slug'] ]['class'] : '';
|
||||
$plugin_tags = ( ! empty( $plugins_filter[ $plugin_data['slug'] ]['tags'] ) ) ? $plugins_filter[ $plugin_data['slug'] ]['tags'] : '';
|
||||
|
||||
// Author String
|
||||
if ( ! empty( $author ) ) {
|
||||
/* translators: %s: Plugin author. */
|
||||
$author = ' <cite>' . sprintf( __( 'By %s' ), $author ) . '</cite>';
|
||||
}
|
||||
|
||||
// Plugin Icon
|
||||
if ( ! empty( $plugin_data['icons']['svg'] ) ) {
|
||||
$plugin_icon_url = $plugin_data['icons']['svg'];
|
||||
} elseif ( ! empty( $plugin_data['icons']['2x'] ) ) {
|
||||
$plugin_icon_url = $plugin_data['icons']['2x'];
|
||||
} elseif ( ! empty( $plugin_data['icons']['1x'] ) ) {
|
||||
$plugin_icon_url = $plugin_data['icons']['1x'];
|
||||
} else {
|
||||
$plugin_icon_url = $plugin_data['icons']['default'];
|
||||
}
|
||||
|
||||
// Plugin Action Links
|
||||
$action_links = array();
|
||||
|
||||
if ( current_user_can( 'install_plugins' ) || current_user_can( 'update_plugins' ) ) {
|
||||
$status = install_plugin_install_status( $plugin_data );
|
||||
|
||||
switch ( $status['status'] ) {
|
||||
case 'install':
|
||||
if ( $status['url'] ) {
|
||||
if ( $compatible_php && $compatible_wp ) {
|
||||
$action_links[] = sprintf(
|
||||
'<a class="install-now button" data-slug="%s" href="%s" aria-label="%s" data-name="%s">%s</a>',
|
||||
esc_attr( $plugin_data['slug'] ),
|
||||
esc_url( $status['url'] ),
|
||||
/* translators: %s: Plugin name and version. */
|
||||
esc_attr( sprintf( __( 'Install %s now' ), $name ) ),
|
||||
esc_attr( $name ),
|
||||
__( 'Install Now' )
|
||||
);
|
||||
} else {
|
||||
$action_links[] = sprintf(
|
||||
'<button type="button" class="button button-disabled" disabled="disabled">%s</button>',
|
||||
_x( 'Cannot Install', 'plugin' )
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'update_available':
|
||||
if ( $status['url'] ) {
|
||||
if ( $compatible_php && $compatible_wp ) {
|
||||
$action_links[] = sprintf(
|
||||
'<a class="update-now button aria-button-if-js" data-plugin="%s" data-slug="%s" href="%s" aria-label="%s" data-name="%s">%s</a>',
|
||||
esc_attr( $status['file'] ),
|
||||
esc_attr( $plugin_data['slug'] ),
|
||||
esc_url( $status['url'] ),
|
||||
/* translators: %s: Plugin name and version. */
|
||||
esc_attr( sprintf( __( 'Update %s now' ), $name ) ),
|
||||
esc_attr( $name ),
|
||||
__( 'Update Now' )
|
||||
);
|
||||
} else {
|
||||
$action_links[] = sprintf(
|
||||
'<button type="button" class="button button-disabled" disabled="disabled">%s</button>',
|
||||
_x( 'Cannot Update', 'plugin' )
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'latest_installed':
|
||||
case 'newer_installed':
|
||||
if ( is_plugin_active( $status['file'] ) ) {
|
||||
$action_links[] = sprintf(
|
||||
'<button type="button" class="button button-disabled" disabled="disabled">%s</button>',
|
||||
_x( 'Active', 'plugin' )
|
||||
);
|
||||
} elseif ( current_user_can( 'activate_plugin', $status['file'] ) ) {
|
||||
$button_text = __( 'Activate' );
|
||||
/* translators: %s: Plugin name. */
|
||||
$button_label = _x( 'Activate %s', 'plugin' );
|
||||
$activate_url = add_query_arg(
|
||||
array(
|
||||
'_wpnonce' => wp_create_nonce( 'activate-plugin_' . $status['file'] ),
|
||||
'action' => 'activate',
|
||||
'plugin' => $status['file'],
|
||||
),
|
||||
network_admin_url( 'plugins.php' )
|
||||
);
|
||||
|
||||
if ( is_network_admin() ) {
|
||||
$button_text = __( 'Network Activate' );
|
||||
/* translators: %s: Plugin name. */
|
||||
$button_label = _x( 'Network Activate %s', 'plugin' );
|
||||
$activate_url = add_query_arg( array( 'networkwide' => 1 ), $activate_url );
|
||||
}
|
||||
|
||||
$action_links[] = sprintf(
|
||||
'<a href="%1$s" class="button activate-now" aria-label="%2$s">%3$s</a>',
|
||||
esc_url( $activate_url ),
|
||||
esc_attr( sprintf( $button_label, $plugin_data['name'] ) ),
|
||||
$button_text
|
||||
);
|
||||
} else {
|
||||
$action_links[] = sprintf(
|
||||
'<button type="button" class="button button-disabled" disabled="disabled">%s</button>',
|
||||
_x( 'Installed', 'plugin' )
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$action_links[] = sprintf(
|
||||
'<a href="%s" class="thickbox open-plugin-details-modal" aria-label="%s" data-title="%s">%s</a>',
|
||||
esc_url( $details_link ),
|
||||
/* translators: %s: Plugin name and version. */
|
||||
esc_attr( sprintf( __( 'More information about %s' ), $name ) ),
|
||||
esc_attr( $name ),
|
||||
__( 'More Details' )
|
||||
);
|
||||
?>
|
||||
|
||||
<div class="espbw-plugin-card-wrap <?php echo $extra_class; ?>" data-tags="<?php echo esc_attr( $plugin_tags ); ?>">
|
||||
<div class="plugin-card plugin-card-<?php echo sanitize_html_class( $plugin_data['slug'] ); ?>">
|
||||
<div class="plugin-card-top">
|
||||
<div class="name column-name">
|
||||
<h3>
|
||||
<a href="<?php echo esc_url( $details_link ); ?>" class="thickbox open-plugin-details-modal">
|
||||
<span class="espbw-plugin-name"><?php echo $title; ?></span>
|
||||
<img src="<?php echo esc_url( $plugin_icon_url ); ?>" class="plugin-icon" alt="" />
|
||||
</a>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="action-links">
|
||||
<?php
|
||||
if ( $action_links ) {
|
||||
echo '<ul class="plugin-action-buttons"><li>' . implode( '</li><li>', $action_links ) . '</li></ul>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="desc column-description">
|
||||
<p><?php echo $description; ?></p>
|
||||
<p class="authors"><?php echo $author; ?></p>
|
||||
</div>
|
||||
</div><!-- end .plugin-card-top -->
|
||||
|
||||
<div class="plugin-card-bottom">
|
||||
<div class="vers column-rating">
|
||||
<?php
|
||||
wp_star_rating(
|
||||
array(
|
||||
'rating' => $plugin_data['rating'],
|
||||
'type' => 'percent',
|
||||
'number' => $plugin_data['num_ratings'],
|
||||
)
|
||||
);
|
||||
?>
|
||||
<span class="num-ratings" aria-hidden="true">(<?php echo number_format_i18n( $plugin_data['num_ratings'] ); ?>)</span>
|
||||
</div>
|
||||
|
||||
<div class="column-updated">
|
||||
<strong><?php esc_html_e( 'Last Updated:' ); ?></strong>
|
||||
<?php
|
||||
/* translators: %s: Human-readable time difference. */
|
||||
printf( __( '%s ago' ), human_time_diff( $last_updated_timestamp ) );
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="column-downloaded">
|
||||
<?php
|
||||
if ( $plugin_data['active_installs'] >= 1000000 ) {
|
||||
$active_installs_millions = floor( $plugin_data['active_installs'] / 1000000 );
|
||||
$active_installs_text = sprintf(
|
||||
/* translators: %s: Number of millions. */
|
||||
_nx( '%s+ Million', '%s+ Million', $active_installs_millions, 'Active plugin installations' ),
|
||||
number_format_i18n( $active_installs_millions )
|
||||
);
|
||||
} elseif ( 0 == $plugin_data['active_installs'] ) {
|
||||
$active_installs_text = _x( 'Less Than 10', 'Active plugin installations' );
|
||||
} else {
|
||||
$active_installs_text = number_format_i18n( $plugin_data['active_installs'] ) . '+';
|
||||
}
|
||||
/* translators: %s: Number of installations. */
|
||||
printf( __( '%s Active Installations' ), $active_installs_text );
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="column-compatibility">
|
||||
<?php
|
||||
if ( ! $tested_wp ) {
|
||||
echo '<span class="compatibility-untested">' . __( 'Untested with your version of WordPress' ) . '</span>';
|
||||
} elseif ( ! $compatible_wp ) {
|
||||
echo '<span class="compatibility-incompatible">' . __( '<strong>Incompatible</strong> with your version of WordPress' ) . '</span>';
|
||||
} else {
|
||||
echo '<span class="compatibility-compatible">' . __( '<strong>Compatible</strong> with your version of WordPress' ) . '</span>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div><!-- end .plugin-card-bottom -->
|
||||
</div><!-- end .plugin-card -->
|
||||
</div><!-- end .espbw-plugin-card-wrap -->
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
<div class="espbw-hide espbw-search-no-result"><?php esc_html_e('Sorry, No result found. Please refine your search.', 'espbw'); ?></div>
|
||||
</div><!-- end .espbw-plugin-list-wrap -->
|
||||
</form>
|
||||
<?php } else { ?>
|
||||
|
||||
<div class="espbw-no-result">
|
||||
<p><?php esc_html_e('Sorry, Something happened wrong.', 'espbw'); ?></p>
|
||||
<p><?php esc_html_e('You can take a look at our all plugins at', 'espbw'); ?> <a href="https://profiles.wordpress.org/wponlinesupport#content-plugins" target="_blank"><?php esc_html_e('here', 'espbw'); ?></a>.</p>
|
||||
</div>
|
||||
|
||||
<?php }
|
||||
?>
|
||||
</div>
|
||||
</div><!-- end .wrap -->
|
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* Script Class
|
||||
* Handles the script and style functionality of plugin
|
||||
*
|
||||
* @package Essential Plugins Bundle
|
||||
* @since 1.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
class WPOS_ESPBW_Script {
|
||||
|
||||
function __construct() {
|
||||
|
||||
// Action to add style at admin side
|
||||
add_action( 'admin_enqueue_scripts', array($this, 'espbw_admin_script_style') );
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to add script and style at admin side
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
function espbw_admin_script_style( $hook ) {
|
||||
|
||||
// Taking pages array
|
||||
$page = isset( $_GET['page'] ) ? $_GET['page'] : '';
|
||||
|
||||
// Registring admin css
|
||||
wp_register_style( 'espbw-admin-css', WPOS_ESPBW_URL.'assets/css/admin-style.css', array(), WPOS_ESPBW_VERSION );
|
||||
|
||||
// Registring admin script
|
||||
wp_register_script( 'espbw-admin-script', WPOS_ESPBW_URL.'assets/js/admin-script.js', array('jquery'), WPOS_ESPBW_VERSION, true );
|
||||
|
||||
// Olny for dashboard screen
|
||||
if( strpos( $page, 'espbw-dashboard' ) !== false ) {
|
||||
|
||||
// enqueing admin css
|
||||
wp_enqueue_style( 'espbw-admin-css' );
|
||||
|
||||
// enqueing admin script
|
||||
wp_enqueue_script( 'plugin-install' );
|
||||
wp_enqueue_script( 'updates' );
|
||||
wp_localize_script( 'updates', '_wpUpdatesItemCounts', array(
|
||||
'totals' => wp_get_update_data(),
|
||||
));
|
||||
add_thickbox();
|
||||
|
||||
wp_enqueue_script( 'espbw-admin-script' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$wpos_espbw_script = new WPOS_ESPBW_Script();
|
@ -0,0 +1,254 @@
|
||||
<?php
|
||||
/**
|
||||
* Common Functions
|
||||
*
|
||||
* @package Essential Plugins Bundle
|
||||
* @since 1.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to sort plugins api data
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
function wpos_espbw_sort_plugin_data( $a, $b ) {
|
||||
|
||||
$a_active_installs = is_numeric( $a['active_installs'] ) ? $a['active_installs'] : 0;
|
||||
$b_active_installs = is_numeric( $b['active_installs'] ) ? $b['active_installs'] : 0;
|
||||
|
||||
if ($a_active_installs == $b_active_installs) {
|
||||
return 0;
|
||||
}
|
||||
return ($a_active_installs > $b_active_installs) ? -1 : 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to add script and style at admin side
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
function wpos_espbw_get_plugin_data() {
|
||||
|
||||
// Get cache result
|
||||
$plugins_data = get_transient( 'espbw_plugins_data' );
|
||||
|
||||
// If no cache is there
|
||||
if( empty( $plugins_data ) ) {
|
||||
|
||||
// Call Plugin API
|
||||
if ( ! function_exists( 'plugins_api' ) ) {
|
||||
require_once ABSPATH . '/wp-admin/includes/plugin-install.php';
|
||||
}
|
||||
|
||||
$plugins_data = plugins_api( 'query_plugins', array(
|
||||
'per_page' => 60,
|
||||
'author' => 'wponlinesupport',
|
||||
'fields' => array(
|
||||
'icons' => true,
|
||||
'active_installs' => true,
|
||||
)
|
||||
) );
|
||||
|
||||
if( is_wp_error( $plugins_data ) || empty( $plugins_data->plugins ) ) {
|
||||
|
||||
$file = WPOS_ESPBW_DIR . 'plugins-data.json';
|
||||
|
||||
// We don't need to write to the file, so just open for reading.
|
||||
$fp = fopen( $file, 'r' );
|
||||
|
||||
// Pull data of the file in.
|
||||
$file_data = fread( $fp, 1024 * KB_IN_BYTES );
|
||||
|
||||
// Close file handle
|
||||
fclose( $fp );
|
||||
|
||||
$file_data = utf8_encode($file_data);
|
||||
$plugins_data_arr = json_decode( $file_data, true );
|
||||
$plugins_data = json_decode( $file_data );
|
||||
$plugins_data->plugins = $plugins_data_arr['plugins'];
|
||||
}
|
||||
|
||||
if( ! is_wp_error( $plugins_data ) && ! empty( $plugins_data->plugins ) ) {
|
||||
|
||||
// Sort the data based on active install
|
||||
usort( $plugins_data->plugins, "wpos_espbw_sort_plugin_data" );
|
||||
|
||||
set_transient( 'espbw_plugins_data', $plugins_data, (12 * HOUR_IN_SECONDS) );
|
||||
}
|
||||
}
|
||||
|
||||
return $plugins_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add some filter classes for plugins.
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
function wpos_espbw_plugins_filter() {
|
||||
|
||||
$plugin_filters = array(
|
||||
'sp-faq' => array(
|
||||
'class' => 'espbw-recommended espbw-showcase',
|
||||
'tags' => 'faq, faq list, faq plugin, faqs, wp faq with category, jquery ui accordion, faq with accordion, frequently asked questions, wordpress faq',
|
||||
),
|
||||
'app-mockups-carousel' => array(
|
||||
'class' => 'espbw-sliders',
|
||||
'tags' => 'app mockups carousel, mockups, device mockup, mockup slider, app gallery slider, app gallery Carousel, device gallery carousel, app mockups carousel, mockups carousel',
|
||||
),
|
||||
'countdown-timer-ultimate' => array(
|
||||
'class' => 'espbw-recommended espbw-showcase',
|
||||
'tags' => 'countdown timer, timer, timer countdown, countdown, event countdown timer, animated countdown timer, birthday countdown, clock, count down, countdown, countdown clock, countdown generator, countdown system, countdown timer, countdown timer, date countdown, event countdown, flash countdown, jQuery countdown, time counter, website countdown, wp countdown, wp countdown timer',
|
||||
),
|
||||
'featured-post-creative' => array(
|
||||
'class' => 'espbw-post espbw-showcase',
|
||||
'tags' => 'featured post, featured post grid, featured post widget, responsive featured post grid, responsive featured post, featured post brick layout, featured posts',
|
||||
),
|
||||
'footer-mega-grid-columns' => array(
|
||||
'class' => '',
|
||||
'tags' => 'footer, footer widgets, footer widgets in grid, website footer, footer, mega footer, megafooter',
|
||||
),
|
||||
'hero-banner-ultimate' => array(
|
||||
'class' => '',
|
||||
'tags' => 'hero image, hero banner, hero header, hero video, video background, hero video, youtube video background, vimeo video background',
|
||||
),
|
||||
'popup-anything-on-click' => array(
|
||||
'class' => 'espbw-recommended',
|
||||
'tags' => 'modal popup, popup, modal, full screen popup, html popup, image popup, popup on click, modal popup on click, full screen popup on click, click popup',
|
||||
),
|
||||
'portfolio-and-projects' => array(
|
||||
'class' => 'espbw-recommended',
|
||||
'tags' => 'portfolio, portfolio listing, projects, project grid, project portfolio, Responsive Portfolio, portfolio categories, add portfolio, add portfolio plugin, portfolio gallery, portfolio plugin, career portfolio, googole image style, best portfolio, portfolio display, project management',
|
||||
),
|
||||
'maintenance-mode-with-timer' => array(
|
||||
'class' => '',
|
||||
'tags' => 'maintenance mode, coming soon, maintenance mode with timer, maintenance mode with countdown timer, countdown timer, coming soon with countdown timer, offline, site is offline, site offline, under construction, launch, launch page, maintenance',
|
||||
),
|
||||
'preloader-for-website' => array(
|
||||
'class' => '',
|
||||
'tags' => 'page loader, loader, page load animations, animated pre-loader, animated preloader, colorful, customize, Jquery Loader, jquery pre-loader, jquery preloader, loader, pre-loader, preload, preloader',
|
||||
),
|
||||
'search-and-navigation-popup' => array(
|
||||
'class' => '',
|
||||
'tags' => 'serchbox popup, menubar popup, navigation popup, serchbox popup',
|
||||
),
|
||||
'smooth-scroll-by-wpos' => array(
|
||||
'class' => '',
|
||||
'tags' => 'mousewheel scroll, scroll, smooth scroll, scrolling, go to top, back to top, scroll to element, scroll to section, smooth scroll to element, smooth scroll to section',
|
||||
),
|
||||
'ticker-ultimate' => array(
|
||||
'class' => 'espbw-recommended espbw-post espbw-showcase',
|
||||
'tags' => 'wponlinesupport, ticker, news ticker, blog ticker, post ticker, ticker slider, ticker vertical slider, ticker horizontal slider',
|
||||
),
|
||||
'wp-blog-and-widgets' => array(
|
||||
'class' => 'espbw-recommended espbw-post espbw-showcase',
|
||||
'tags' => 'blog design, blog layout, wordpress blog , custom blog template, wordpress blog widget, blog layout design, custom blog layout, Free wordpress blog, blog custom post type, blog menu, blog page with custom post type, blog, latest blog, custom post type, cpt, widget',
|
||||
),
|
||||
'sp-news-and-widget' => array(
|
||||
'class' => 'espbw-recommended espbw-post espbw-showcase',
|
||||
'tags' => 'wordpress news plugin, news website, news page scrolling , wordpress vertical news plugin widget, wordpress horizontal news plugin widget, scrolling news wordpress plugin, scrolling news widget wordpress plugin, WordPress set post or page as news, WordPress dynamic news, news, latest news, custom post type, cpt, widget, vertical news scrolling widget, news widget',
|
||||
),
|
||||
'wp-testimonial-with-widget' => array(
|
||||
'class' => 'espbw-recommended espbw-showcase',
|
||||
'tags' => 'testimonial, Testimonial, testimonials, Testimonials, widget, Best testimonial slider, Responsive testimonial slider, client testimonial slider, easy testimonial slider, testimonials with widget, wordpress testimonial with widget, testimonial rotator, testimonial slider, Testimonial slider, testimonial with shortcode, client testimonial, client quote',
|
||||
),
|
||||
'timeline-and-history-slider' => array(
|
||||
'class' => 'espbw-recommended espbw-post espbw-showcase',
|
||||
'tags' => 'timeline slider, life history, history slider, company story timeline, process slider, process, responsive timeline, about us, achievements, Activity Log, awesome company timeline, biography, events timeline, history, history timeline, life achievements, lifestream, story, personal timeline',
|
||||
),
|
||||
'wp-team-showcase-and-slider' => array(
|
||||
'class' => 'espbw-recommended espbw-showcase',
|
||||
'tags' => 'team, teamshowcase, team slider, responsive teamshowcase, teamshowcase rotator, employees, meet team, members, skills, staff, team, v-card, members profile, my team, our team, responsive team display, responsive team, team members, team members profile, team profile, team showcase, tlp team, WordPress Team Member',
|
||||
),
|
||||
'recent-posts-widget-designer' => array(
|
||||
'class' => '',
|
||||
'tags' => 'post widget, post widget with thumbnail, post widget designer, post widget designs, recent post widget with thumbnail, recent post widget designer, recent post widget designs',
|
||||
),
|
||||
'styles-for-wp-pagenavi-addon' => array(
|
||||
'class' => '',
|
||||
'tags' => 'navigation, pagination, paging, pages, navigation, pagenavi style, wp pagenavi styling, pagenavi styling, pagenavi css',
|
||||
),
|
||||
'post-grid-and-filter-ultimate' => array(
|
||||
'class' => 'espbw-post espbw-showcase',
|
||||
'tags' => 'post grid, post, post filter, post category filter, custom post grid, grid display, grid, content grid, filter, post designs, grid designs',
|
||||
),
|
||||
'accordion-and-accordion-slider' => array(
|
||||
'class' => 'espbw-showcase',
|
||||
'tags' => 'accordion, accordion image slider, accordion, horizontal accordion, vertical accordion, responsive accordion, accordion carousel,',
|
||||
),
|
||||
'html5-videogallery-plus-player' => array(
|
||||
'class' => 'espbw-recommended espbw-showcase',
|
||||
'tags' => 'video, youtube video gallery, vimeo video gallery, youtube video gallery with popup, Youtube-video, youtube embed, youtube gallery, youtube player, magnific Popup, vimeo video gallery gallery, HTML5 video player, HTML5 video gallery, wordpress HTML5 video, wordpress HTML5 video player, wordpress HTML5 video gallery, responsive, wordpress responsive video gallery',
|
||||
),
|
||||
'wp-featured-content-and-slider' => array(
|
||||
'class' => 'espbw-recommended espbw-showcase',
|
||||
'tags' => 'content slider, slider, features, services, featured content, featured services, featured content rotator, featured content slider, featured content slideshow, featured posts, featured content slider',
|
||||
),
|
||||
'wp-responsive-recent-post-slider' => array(
|
||||
'class' => 'espbw-recommended espbw-post espbw-showcase',
|
||||
'tags' => 'post slider, posts slider, recent post slider, recent posts slider, slider, responsive post slider, responsive posts slider, responsive recent post slider, responsive recent posts slider, wordpress posts slider, post slideshow, posts slideshow, recent posts slideshow',
|
||||
),
|
||||
'blog-designer-for-post-and-widget' => array(
|
||||
'class' => 'espbw-recommended espbw-post espbw-showcase',
|
||||
'tags' => 'post, post design, post designer, post designs, post layout, post layout design, post widget, blog, blog designs, blog design, stylist post, post slider, post grid, recent post, recent post slider, recent post designs, posts in page, post carousel slider',
|
||||
),
|
||||
'wp-slick-slider-and-image-carousel' => array(
|
||||
'class' => 'espbw-recommended espbw-sliders espbw-showcase',
|
||||
'tags' => 'slick, image slider, slick slider, slick image slider, slider, image slider, header image slider, responsive image slider, responsive content slider, carousel, image carousel, carousel slider, content slider, coin slider, touch slider, text slider, responsive slider, responsive slideshow, Responsive Touch Slider, wp slider, wp image slider, wp header image slider, photo slider, responsive photo slider',
|
||||
),
|
||||
'wp-trending-post-slider-and-widget' => array(
|
||||
'class' => 'espbw-post espbw-showcase',
|
||||
'tags' => 'popular post, popular posts, trending, trending posts carousel trending post, trending posts, trending posts carousel, popular posts slider, trending posts slider, widget, shortcodes, slider, post slick slider, trending posts widget, popular posts widget, daily popular, page views, popular posts, top posts',
|
||||
),
|
||||
'audio-player-with-playlist-ultimate' => array(
|
||||
'class' => 'espbw-showcase',
|
||||
'tags' => 'audio player with playlist, album art, artist, audio player, audio player with playlist, multiple player, music player, repeat, shuffle, single player, song title',
|
||||
),
|
||||
'sliderspack-all-in-one-image-sliders' => array(
|
||||
'class' => 'espbw-recommended espbw-sliders espbw-showcase',
|
||||
'tags' => 'logo ticker, bxslider, meta slider, flexslider, fancybox, nivo slider, owl slider, unslider , wallop slider , bx slider, flex slider, rolling slider, image slider, slider, 3d slider, 3d image slider, 3d image carousel, image carousel, carousel, swiper, swiper carousel, Cascade Slider',
|
||||
),
|
||||
'album-and-image-gallery-plus-lightbox' => array(
|
||||
'class' => 'espbw-recommended espbw-showcase',
|
||||
'tags' => 'album, image album, gallery, magnific image slider, image gallery, responsive image gallery, image slider, image gallery slider, gallery slider, album slider, lightbox, albums, best gallery plugin, photo gallery, galleries, gallery, image captions, media gallery, photo albums, photo gallery, photography, Picture Gallery, pictures, responsive galleries, responsive gallery, slideshow galleries, slideshow gallery, thumbnail galleries, thumbnail gallery, wordpress gallery plugin, wordpress photo gallery plugin, wordpress responsive gallery, wp gallery, wp gallery plugins',
|
||||
),
|
||||
'wp-modal-popup-with-cookie-integration' => array(
|
||||
'class' => '',
|
||||
'tags' => 'popup',
|
||||
),
|
||||
'meta-slider-and-carousel-with-lightbox' => array(
|
||||
'class' => 'espbw-recommended espbw-sliders',
|
||||
'tags' => 'frontend gallery slider, frontend gallery Carousel, image slider, image carousel, meta gallery slider, meta gallery carousel, gallery slider, gallery',
|
||||
),
|
||||
'post-category-image-with-grid-and-slider' => array(
|
||||
'class' => 'espbw-sliders espbw-showcase',
|
||||
'tags' => 'category, category image, post category image, post category image grid, post category image slider, customization, custom category image, category featured image, category grid, category slider',
|
||||
),
|
||||
'wp-logo-showcase-responsive-slider-slider' => array(
|
||||
'class' => 'espbw-recommended espbw-showcase',
|
||||
'tags' => 'logo slider, logo slider, widget, client logo carousel, client logo slider, client, customer, image carousel, carousel, logo showcase, Responsive logo slider, Responsive logo carousel, WordPress logo slider, WordPress logo carousel, slick carousel, Best logo showcase, easy logo slider, logo carousel wordpress, logo slider wordpress, sponsors, sponsors slider, sponsors carousel',
|
||||
),
|
||||
'product-categories-designs-for-woocommerce' => array(
|
||||
'class' => 'espbw-woocommerce espbw-showcase',
|
||||
'tags' => 'woocommerce, categories designs, categories slider, categories grid, WooCommerce categories designs, WooCommerce categories slider, WooCommerce categories grid',
|
||||
),
|
||||
'woo-product-slider-and-carousel-with-category' => array(
|
||||
'class' => 'espbw-woocommerce',
|
||||
'tags' => 'woocommerce, best selling products, best selling products slider, slick slider, best selling products by category, shortcode, template code, featured product, featured product slider, Featured product by category, autoplay slider, best product slider, best product slider for woo shop, carousel, clean woo product slider, multiple product slider, product carousel, product content slider, product contents carousel, product slider, product slider carousel for woo, products slider, responsive product slider, responsive product carousel, slider, smooth product slider woo product slider, advance slider, woo best selling products, woo category slider, latest products, most selling products, product carousel slider, recent product carousel, recent product slider',
|
||||
),
|
||||
'slider-and-carousel-plus-widget-for-instagram' => array(
|
||||
'class' => 'espbw-recommended espbw-sliders espbw-showcase',
|
||||
'tags' => 'Custom Instagram Feed, feed, hashtag, instagram, Instagram feed, instagram gallery, Instagram images, Instagram photos, Instagram posts, Instagram wall, lightbox, photos, instagram social feed, show instagram post, responsive instgram, beautiful instagram, instagram widget, instgram plugin, artistic instagram, instagram wordpress, smashing instgram',
|
||||
),
|
||||
'frontend-gallery-slider-for-advanced-custom-field' => array(
|
||||
'class' => 'espbw-recommended espbw-sliders espbw-showcase',
|
||||
'tags' => 'frontend gallery slider, frontend gallery Carousel, slider, acf frontend gallery slider, acf frontend gallery Carousel, acf gallery, acf',
|
||||
),
|
||||
);
|
||||
|
||||
return $plugin_filters;
|
||||
}
|
@ -0,0 +1,187 @@
|
||||
<?php
|
||||
/**
|
||||
* WPOS Recommended Plugins
|
||||
*
|
||||
* @author WP Online Support
|
||||
* @package Essential Plugins Bundle
|
||||
* @since 1.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'WPOS_ESPBW' ) ) :
|
||||
|
||||
/**
|
||||
* Main Recommended Plugins Class By WP Online Support.
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
final class WPOS_ESPBW {
|
||||
|
||||
/**
|
||||
* @var Instance
|
||||
* @since 1.0
|
||||
*/
|
||||
protected static $instance = null;
|
||||
|
||||
/**
|
||||
* Main Instance.
|
||||
*
|
||||
* Insures that only one instance of Analytics exists in memory at any one time.
|
||||
* Also prevents needing to define globals all over the place.
|
||||
*
|
||||
* @since 1.0
|
||||
* @uses WPOS_ESPBW::setup_constants() Setup the constants needed.
|
||||
* @uses WPOS_ESPBW::includes() Include the required files.
|
||||
* @uses WPOS_ESPBW::wpos_espbw_plugins_loaded() load the language files.
|
||||
* @see WPOS_ESPBW()
|
||||
* @return object the one true instance
|
||||
*/
|
||||
public static function instance() {
|
||||
if ( is_null( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Throw error on object clone.
|
||||
*
|
||||
* The whole idea of the singleton design pattern is that there is a single object therefore, we don't want the object to be cloned.
|
||||
*
|
||||
* @since 1.0
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
public function __clone() {
|
||||
// Cloning instances of the class is forbidden.
|
||||
_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?' ), '1.0' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable unserializing of the class.
|
||||
*
|
||||
* @since 1.0
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
public function __wakeup() {
|
||||
// Unserializing instances of the class is forbidden.
|
||||
_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?' ), '1.0' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Plugin Constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->setup_constants();
|
||||
$this->includes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define constant if not already set.
|
||||
*
|
||||
* @param string $name
|
||||
* @param string|bool $value
|
||||
*/
|
||||
public function define( $name, $value ) {
|
||||
if ( ! defined( $name ) ) {
|
||||
define( $name, $value );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup plugin constants. Basic plugin definitions
|
||||
*
|
||||
* @access private
|
||||
* @since 1.0
|
||||
*/
|
||||
private function setup_constants() {
|
||||
$this->define( 'WPOS_ESPBW_VERSION', '1.0' );
|
||||
$this->define( 'WPOS_ESPBW_DIR', plugin_dir_path( __FILE__ ) );
|
||||
$this->define( 'WPOS_ESPBW_URL', plugin_dir_url( __FILE__ ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Include required files.
|
||||
*
|
||||
* @access private
|
||||
* @since 1.0
|
||||
*/
|
||||
private function includes() {
|
||||
|
||||
// Functions file
|
||||
require_once WPOS_ESPBW_DIR .'/includes/espbw-functions.php';
|
||||
|
||||
// Script Class
|
||||
require_once WPOS_ESPBW_DIR .'/includes/class-espbw-script.php';
|
||||
|
||||
// Admin Class
|
||||
require_once WPOS_ESPBW_DIR .'/includes/admin/class-espbw-admin.php';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The main function responsible for returning the one true
|
||||
* Instance to functions everywhere.
|
||||
*
|
||||
* Use this function like you would a global variable, except without needing
|
||||
* to declare the global.
|
||||
*
|
||||
* Example: $wpos_espbw = WPOS_ESPBW();
|
||||
*
|
||||
* @since 1.0
|
||||
* @return object The one true Analytics Instance.
|
||||
*/
|
||||
function WPOS_ESPBW_RECOMMEND() {
|
||||
return WPOS_ESPBW::instance();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Initialize Analytics Module
|
||||
*
|
||||
* @since 1.0
|
||||
* @return object The one true Analytics Instance.
|
||||
*/
|
||||
function wpos_espbw_init_module( $args = array() ) {
|
||||
|
||||
global $wpos_espbw_module;
|
||||
|
||||
$defaul_args = array(
|
||||
'prefix' => '',
|
||||
'menu' => false,
|
||||
'position' => 4,
|
||||
);
|
||||
|
||||
$args = wp_parse_args( $args, $defaul_args );
|
||||
|
||||
// If required data is not there then simply return
|
||||
if( empty( $args['menu'] ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Taking some variables
|
||||
$wpos_espbw_module = ! empty( $wpos_espbw_module ) ? $wpos_espbw_module : array();
|
||||
$wpos_espbw_module[] = $args;
|
||||
|
||||
return $wpos_espbw_module;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Initialize Analytics Class Once all stuff has been loaded
|
||||
*
|
||||
* @since 1.0
|
||||
* @return object The one true Analytics Instance.
|
||||
*/
|
||||
function wpos_espbw_plugins_loaded() {
|
||||
|
||||
// Get Analytics Running.
|
||||
WPOS_ESPBW_RECOMMEND();
|
||||
}
|
||||
add_action( 'plugins_loaded', 'wpos_espbw_plugins_loaded', 12 );
|
||||
|
||||
endif; // End if class_exists check
|