initial commit

This commit is contained in:
2024-04-29 13:12:44 +05:45
commit 34887303c5
19300 changed files with 5268802 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1 @@
.wpos-pro-guten-shrt{border:1px solid #ccc;padding:8px;line-height:22px;background-color:#eee;font-size:13px;text-align:center;color:#32373c;font-family:arial, sans-serif}.wpos-pro-guten-shrt-title span{border-bottom:2px solid #32373c;margin-bottom:10px;display:inline-block;font-size:16px;font-weight:600}.wpos-pro-guten-shrt .wpos-guten-shrt-footer{margin:10px 0 0 0}.wpos-pro-guten-shrt .wpos-guten-shrt-footer span{display:block;border-top:2px solid #ccc;width:50px;margin:5px auto}.components-disabled{opacity:0.5}.components-disabled .wpos-hidden-opts-desc a{pointer-events:auto}

View File

@ -0,0 +1,22 @@
/* Slider */
.slick-loading .slick-list{ background: #fff url('ajax-loader.gif') center center no-repeat;}
.slick-slider{ position: relative;display: block; -moz-box-sizing: border-box;box-sizing: border-box; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-touch-callout: none;-khtml-user-select: none; -ms-touch-action: pan-y; touch-action: pan-y; -webkit-tap-highlight-color: transparent; }
.slick-list{ position: relative;display: block; overflow: hidden; margin: 0; padding: 0;}
.slick-list:focus{ outline: none;}
.slick-list.dragging{ cursor: pointer; cursor: hand;}
.slick-slider .slick-track,
.slick-slider .slick-list{ -webkit-transform: translate3d(0, 0, 0); -moz-transform: translate3d(0, 0, 0); -ms-transform: translate3d(0, 0, 0); -o-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
.slick-track{ position: relative;top: 0;left: 0; display: block;}
.slick-track:before,
.slick-track:after{ display: table; content: '';}
.slick-track:after{ clear: both;}
.slick-loading .slick-track{ visibility: hidden;}
.slick-slide{ display: none; float: left; height: 100%; min-height: 1px;}
[dir='rtl'] .slick-slide{ float: right;}
.slick-slide img{ display: block;}
.slick-slide.slick-loading img{ display: none;}
.slick-slide.dragging img{ pointer-events: none;}
.slick-initialized .slick-slide{ display: block;}
.slick-loading .slick-slide{ visibility: hidden;}
.slick-vertical .slick-slide{ display: block; height: auto; border: 1px solid transparent;}
.slick-arrow.slick-hidden { display: none;}

View File

@ -0,0 +1,20 @@
/* Builder Shortcode Preview */
.wtpsw-builder-shrt-prev{background-color: #e7e7e7; padding: 10px; border: 1px solid #ccc; font-size: 15px;text-align: center;}
.wtpsw-builder-shrt-title span{border-bottom: 1px solid #999; display: inline-block; padding: 0 0 5px 0;}
/* Widget */
.wtpsw-widget-wrap hr{margin: 7px 0 !important;}
.wtpsw-widget-wrap p{margin: 10px 0;}
.wtpsw-widget-wrap p em{font-size: 12px; display: block;}
.wtpsw-widget-wrap p em span,
.wtpsw-widget-wrap p em label{cursor: pointer; font-weight: bold;}
.so-content .wtpsw-widget-wrap p label,
.fl-builder-settings-fields .wtpsw-widget-wrap p label{font-weight: 500;}
.so-content .wtpsw-widget-wrap p input,
.so-content .wtpsw-widget-wrap p select,
.fl-builder-settings-fields .wtpsw-widget-wrap p input,
.fl-builder-settings-fields .wtpsw-widget-wrap p select{width: 100%; max-width: 100%; margin: 5px 0 8px 0 !important;}
.so-content .wtpsw-widget-wrap p input[type="checkbox"],
.fl-builder-settings-fields .wtpsw-widget-wrap p input[type="checkbox"]{width: auto;}
.fl-builder-settings-fields .wtpsw-widget-wrap input,
.fl-builder-settings-fields .wtpsw-widget-wrap label{vertical-align: middle;}

View File

@ -0,0 +1,112 @@
.wtpsw-post-grid *, .wtpsw-post-slider *, .wtpsw-post-carousel-slides *{outline: none !important; -webkit-box-sizing:border-box; -moz-box-sizing:border-box; box-sizing:border-box;}
.wtpsw-post-slider{visibility: hidden; opacity:0; transition:opacity 0.5s linear; }
.wtpsw-post-slider.slick-initialized{ visibility: visible; opacity:1; }
.wtpsw-post-carousel{visibility: hidden; opacity:0; transition:opacity 0.5s linear; }
.wtpsw-post-carousel.slick-initialized{ visibility: visible; opacity:1; }
.wtpsw-post-slider .slick-arrow{text-indent:-99999px;}
.wtpsw-post-slider button.slick-arrow {background-color: transparent!important; width:22px; height:38px; position:absolute; z-index:9; border:0px !important; padding:0 !important; margin:0px !important; border-radius:0px !important}
.wtpsw-post-slider button.slick-next, .wtpsw-post-slider button.slick-next:hover, .wtpsw-post-slider button.slick-next:focus{background:rgba(255,255,255,0.7) url(arrow-right.png) center center no-repeat !important; background-size:15px 26px !important; outline:none !important}
.wtpsw-post-slider button.slick-prev, .wtpsw-post-slider button.slick-prev:hover, .wtpsw-post-slider button.slick-prev:focus{background:rgba(255,255,255,0.7) url(arrow-left.png) center center no-repeat !important; background-size:15px 26px !important; outline:none !important}
.wtpsw-post-slider .slick-dots{padding:0 !important; margin:10px 0 0 0 !important; text-align:center;}
.wtpsw-post-slider .slick-dots li {list-style:none !important; display:inline-block !important; margin:0 2px !important; padding:0px !important; }
.wtpsw-post-slider .slick-dots li button{text-indent:-99999px; background:#fff !important; margin:0px !important; padding:0px !important; border:1px solid #000; border-radius:50% !important; width:10px !important; height:10px !important; cursor:pointer;}
.wtpsw-post-slider .slick-dots li button:focus{outline:none !important}
.wtpsw-post-slider .slick-dots li.slick-active button{background:#444 !important;}
.wtpsw-post-slider .slick-slide{padding:0px !important}
.wtpsw-post-carousel .slick-arrow{text-indent:-99999px;}
.wtpsw-post-carousel button.slick-arrow {background-color: transparent!important; width:22px; height:38px; position:absolute; z-index:9; border:0px !important; padding:0 !important; margin:0px !important; border-radius:0px !important}
.wtpsw-post-carousel button.slick-next, .wtpsw-post-carousel button.slick-next:hover, .wtpsw-post-carousel button.slick-next:focus{background:rgba(255,255,255,0.7) url(arrow-right.png) center center no-repeat !important; background-size:15px 26px !important; outline:none !important}
.wtpsw-post-carousel button.slick-prev, .wtpsw-post-carousel button.slick-prev:hover, .wtpsw-post-carousel button.slick-prev:focus{background:rgba(255,255,255,0.7) url(arrow-left.png) center center no-repeat !important; background-size:15px 26px !important; outline:none !important}
.wtpsw-post-carousel .slick-dots{padding:0 !important; margin:0 !important; position:absolute; text-align:center;}
.wtpsw-post-carousel .slick-dots li {list-style:none !important; display:inline-block !important; margin:0 2px !important; padding:0px !important; }
.wtpsw-post-carousel .slick-dots li button{text-indent:-99999px; background:#fff !important; margin:0px !important; padding:0px !important; border:1px solid #000; border-radius:50% !important; width:10px !important; height:10px !important; cursor:pointer;}
.wtpsw-post-carousel .slick-dots li button:focus{outline:none !important}
.wtpsw-post-carousel .slick-dots li.slick-active button{background:#444 !important;}
.wtpsw-post-carousel .slick-slide{padding:0px !important}
.wtpsw-clearfix:before, .wtpsw-clearfix:after {content: "";display: table;}
.wtpsw-clearfix::after {clear: both;}
.wtpsw-post-slider, .wtpsw-post-carousel{padding-bottom:20px; clear:both;}
.wtpsw-post-slider h2.wtpsw-post-title{margin:0 0 5px 0 !important; line-height:normal;}
.wtpsw-post-slider .wtpsw-post-stats{margin-bottom:10px; position:relative; font-size:13px;}
.wtpsw-post-carousel h4.wtpsw-post-title{margin:0 0 5px 0 !important; line-height:normal; }
.wtpsw-post-carousel .wtpsw-post-stats{margin-bottom:10px; position:relative; font-size:13px;}
.wtpsw-link-overlay {position: absolute;height: 100%;width: 100%;top: 0px;left: 0px;z-index: 1;}
/* Slider Design */
.wtpsw-post-slider.design-1 .wtpsw-post-list{width:100%; float:left; clear:both;}
.wtpsw-post-slider.design-1 .wtpsw-post-title a{color:#444; text-decoration:none;}
.wtpsw-post-slider.design-1 .wtpsw-post-image-bg{background: #f1f1f1;height: 230px !important;line-height: 0; overflow: hidden; position: relative; width: 100%;}
.wtpsw-post-slider.design-1 .wtpsw-post-image-bg img {height: 100% !important;width: 100% !important;object-fit: cover;object-position: top center;}
.wtpsw-post-slider.design-1 .wtpsw-medium-5 {padding: 0 !important;}
.wtpsw-post-slider.design-1 .wtpsw-post-list-content .wtpsw-medium-7{padding: 0 !important;}
.wtpsw-post-slider.design-1 .slick-arrow {top:38% !important;}
.wtpsw-post-slider.design-1 .slick-next {right:0px !important;}
.wtpsw-post-slider.design-1 .slick-prev {left:0px !important;}
.wtpsw-post-slider.design-1 .slick-dots {left:15px !important; right:15px !important; bottom:0px !important; text-align:center; width:100%;}
/* Carousel Design */
.wtpsw-post-carousel.design-1 .wtpsw-post-list{width:100%; float:left; clear:both;}
.wtpsw-post-carousel.design-1 .wtpsw-post-title a{color:#444; text-decoration:none;}
.wtpsw-post-carousel.design-1 .wtpsw-post-image-bg{background: #f1f1f1;height: 220px !important; margin-bottom:15px;line-height: 0; overflow: hidden; position: relative; width: 100%;}
.wtpsw-post-carousel.design-1 .wtpsw-post-image-bg img {height: 100% !important;width: 100% !important;object-fit: cover;object-position: top center;}
.wtpsw-post-carousel.design-1 .wtpsw-medium-5 {padding: 0px 10px 0 0;}
.wtpsw-post-carousel.design-1 .wtpsw-post-list-content .wtpsw-medium-7{padding:5px 35px 10px 15px;}
.wtpsw-post-carousel.design-1 .slick-arrow {top:38% !important; margin: 0 0.9375em !important}
.wtpsw-post-carousel.design-1 .slick-next{right:0px !important;}
.wtpsw-post-carousel.design-1 .slick-prev{left:0px !important;}
.wtpsw-post-carousel.design-1 .slick-dots{text-align:center; width:100%;}
/* Grid design */
.wtpsw-post-grid.design-1 .wtpsw-post-gridbox.wtpsw-medium-6 .wtpsw-post-image-bg {height: 100%;}
.wtpsw-post-grid.design-1 .wtpsw-post-gridbox .wtpsw-post-list {height: 100%;}
.wtpsw-post-grid.design-1 .wtpsw-post-gridbox .wtpsw-post-image-bg {position:relative; height: 100%; background: #f1f1f1;}
.wtpsw-post-grid.design-1 .wtpsw-post-gridbox .wtpsw-post-image-bg .wtpsw-post-list-content {position:absolute; bottom:0; width:100%; padding: 15px; box-sizing: border-box;
background: -moz-linear-gradient(to bottom,#0000 0, #0006 50%, #000000b3 100%);
background: -ms-linear-gradient(to bottom,rgba(0,0,0,0) 0, rgba(0,0,0,0.4) 50%, rgba(0,0,0,.7) 100%);
background: -o-linear-gradient(to bottom,rgba(0,0,0,0) 0, rgba(0,0,0,0.4) 50%, rgba(0,0,0,.7) 100%);
background: -webkit-linear-gradient(to bottom,rgba(0,0,0,0) 0, rgba(0,0,0,0.4) 50%, rgba(0,0,0,.7) 100%);
background: -webkit-gradient(linear, center top, center bottom, from(rgba(0,0,0,0)), to(rgba(0,0,0,0.7)));
background: linear-gradient(to bottom,#0000 0, #0006 50%, #000000b3 100%);
}
.wtpsw-post-grid.design-1 .wtpsw-post-title {margin: 0; padding: 10px 0; line-height: normal;}
.wtpsw-post-grid.design-1 .wtpsw-post-title a {line-height: normal;text-decoration: none;color: #fff;}
.wtpsw-post-grid.design-1 .wtpsw-post-stats {color: #fff; font-size: 12px;}
.wtpsw-post-grid.design-1 .wtpsw-post-stats span a {text-decoration: none; color: #fff;}
.wtpsw-post-grid.design-1 .wtpsw-post-stats span:first-child {font-style: italic; text-transform: capitalize;}
.wtpsw-post-grid.design-1 .wtpsw-medium-3 .wtpsw-post-stats span:last-child {display: block;}
.wtpsw-post-grid.design-1 .wtpsw-post-gridbox.wtpsw-medium-6 {height:460px; overflow:hidden; padding: 0 0 5px 5px;}
.wtpsw-post-grid.design-1 .wtpsw-post-gridbox.wtpsw-medium-6 .wtpsw-post-image-bg img {height: 100% !important;width: 100% !important;object-fit: cover;object-position: top center; border-radius: 0; box-shadow: none;}
.wtpsw-post-grid.design-1 .wtpsw-post-gridbox.wtpsw-medium-3 {height:230px; overflow:hidden; padding: 0 0 5px 5px;}
.wtpsw-post-grid.design-1 .wtpsw-post-gridbox.wtpsw-medium-3 .wtpsw-post-image-bg img {height: 100% !important;width: 100% !important;object-fit: cover;object-position: top center; border-radius: 0; box-shadow: none;}
.wtpsw-post-items .wtpsw-post-li { clear: both; padding: 10px 0 !important; }
.wtpsw-post-li { border-bottom: 1px solid #ddd; list-style: outside none none !important; margin: 0 !important; }
.wtpsw-post-thumb-left { display: table-cell; vertical-align: top; padding-right:10px; width:90px; }
#secondary .widget a.wtpsw-post-title{color:#555;}
.wtpsw-post-thumb-left img { margin-right: 10px; }
.wtpsw-post-thumb-right {display: table-cell; vertical-align: top; }
.wtpsw-post-thumb-right h6{margin:0 0 6px 0 !important}
.wtpsw-post-thumb-right h6 a.wtpsw-post-title{color:#555;}
.wtpsw-date-post, .wtpsw-date-post a, .wtpsw-post-stats { font-size: 13px; margin-top: 5px; }
.wtpswcolumn, .wtpswcolumns{float:left; width:100%; position: relative;}
.wtpsw-post-gridbox .wtpsw-post-content { color: #fff; font-size: 16px; line-height: 1.5; }
@media only screen {
.wtpswcolumn, .wtpswcolumns {position: relative;padding-left: 0.9375em;padding-right: 0.9375em; float: left; }
}
@media only screen and (min-width: 40.0625em) {
.wtpswcolumn, .wtpswcolumns {position: relative;padding-left: 0.9375em;padding-right: 0.9375em;float: left; }
.wtpsw-medium-1 { width: 8.33333%; }
.wtpsw-medium-2 { width: 16.66667%; }
.wtpsw-medium-3 { width: 25%; }
.wtpsw-medium-4 { width: 33.33333%; }
.wtpsw-medium-5 { width: 41.66667%; }
.wtpsw-medium-6 { width: 50%; }
.wtpsw-medium-7 { width: 58.33333%; }
.wtpsw-medium-8 { width: 66.66667%; }
.wtpsw-medium-9 { width: 75%; }
.wtpsw-medium-10 { width: 83.33333%; }
.wtpsw-medium-11 { width: 91.66667%; }
.wtpsw-medium-12 { width: 100%; }
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,88 @@
( function($) {
'use strict';
jQuery(window).on('elementor/frontend/init', function() {
/* Shortcode Element */
elementorFrontend.hooks.addAction( 'frontend/element_ready/shortcode.default', function() {
wtpsw_trending_slider_init();
wtpsw_trending_carousel_init();
});
/* Text Editor Element */
elementorFrontend.hooks.addAction( 'frontend/element_ready/text-editor.default', function() {
wtpsw_trending_slider_init();
wtpsw_trending_carousel_init();
});
/* Tabs Element */
elementorFrontend.hooks.addAction( 'frontend/element_ready/tabs.default', function($scope) {
/* Tweak for slick slider */
$scope.find('.wtpsw-post-slider-init').each(function( index ) {
var slider_id = $(this).attr('id');
$('#'+slider_id).css({'visibility': 'hidden', 'opacity': 0});
wtpsw_trending_slider_init();
wtpsw_trending_carousel_init();
setTimeout(function() {
/* Tweak for slick slider */
if( typeof(slider_id) !== 'undefined' && slider_id != '' ) {
$('#'+slider_id).slick( 'setPosition' );
$('#'+slider_id).css({'visibility': 'visible', 'opacity': 1});
}
}, 300);
});
});
/* Accordion Element */
elementorFrontend.hooks.addAction( 'frontend/element_ready/accordion.default', function($scope) {
/* Tweak for slick slider */
$scope.find('.wtpsw-post-slider-init').each(function( index ) {
var slider_id = $(this).attr('id');
$('#'+slider_id).css({'visibility': 'hidden', 'opacity': 0});
wtpsw_trending_slider_init();
wtpsw_trending_carousel_init();
setTimeout(function() {
/* Tweak for slick slider */
if( typeof(slider_id) !== 'undefined' && slider_id != '' ) {
$('#'+slider_id).slick( 'setPosition' );
$('#'+slider_id).css({'visibility': 'visible', 'opacity': 1});
}
}, 300);
});
});
/* Toggle Element */
elementorFrontend.hooks.addAction( 'frontend/element_ready/toggle.default', function($scope) {
/* Tweak for slick slider */
$scope.find('.wtpsw-post-slider-init').each(function( index ) {
var slider_id = $(this).attr('id');
$('#'+slider_id).css({'visibility': 'hidden', 'opacity': 0});
wtpsw_trending_slider_init();
wtpsw_trending_carousel_init();
setTimeout(function() {
/* Tweak for slick slider */
if( typeof(slider_id) !== 'undefined' && slider_id != '' ) {
$('#'+slider_id).slick( 'setPosition' );
$('#'+slider_id).css({'visibility': 'visible', 'opacity': 1});
}
}, 300);
});
});
});
})(jQuery);

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,23 @@
jQuery(document).ready(function($) {
/* Click to Copy the Text */
$(document).on('click', '.wpos-copy-clipboard', function() {
var copyText = $(this);
copyText.select();
document.execCommand("copy");
});
/* Drag widget event to render layout for Beaver Builder */
$('.fl-builder-content').on( 'fl-builder.preview-rendered', wtpsw_render_preview );
/* Save widget event to render layout for Beaver Builder */
$('.fl-builder-content').on( 'fl-builder.layout-rendered', wtpsw_render_preview );
/* Publish button event to render layout for Beaver Builder */
$('.fl-builder-content').on( 'fl-builder.didSaveNodeSettings', wtpsw_render_preview );
});
/* Function to render shortcode preview for Beaver Builder */
function wtpsw_render_preview() {
wtpsw_trending_slider_init();
wtpsw_trending_carousel_init();
}

View File

@ -0,0 +1,268 @@
jQuery( document ).ready(function( $ ) {
/* Post views count ajax */
if( Wtpsw.post_view_count != 0 ) {
var data = {
action : 'wtpsw_post_view_count',
is_ajax : 1,
post_id : Wtpsw.post_view_count
};
$.post(Wtpsw.ajaxurl,data,function(response) {
/* Do Response Process */
});
}
/* For Trending Post Slider */
wtpsw_trending_slider_init();
/* For Trending Post carousel */
wtpsw_trending_carousel_init();
/* Elementor Compatibility */
$(document).on('click', '.elementor-tab-title', function() {
var ele_control = $(this).attr('aria-controls');
var slider_wrap = $('#'+ele_control).find('.wtpsw-post-slider-init');
/* Tweak for slick slider */
$( slider_wrap ).each(function( index ) {
var slider_id = $(this).attr('id');
$('#'+slider_id).css({'visibility': 'hidden', 'opacity': 0});
setTimeout(function() {
if( typeof(slider_id) !== 'undefined' && slider_id != '' ) {
$('#'+slider_id).slick( 'setPosition' );
$('#'+slider_id).css({'visibility': 'visible', 'opacity': 1});
}
}, 350);
});
});
/* Beaver Builder Compatibility for Accordion and Tabs */
$(document).on('click', '.fl-accordion-button, .fl-tabs-label', function() {
var ele_control = $(this).attr('aria-controls');
var slider_wrap = $('#'+ele_control).find('.wtpsw-post-slider-init');
/* Tweak for filter */
$( slider_wrap ).each(function( index ) {
var slider_id = $(this).attr('id');
$('#'+slider_id).css({'visibility': 'hidden', 'opacity': 0});
setTimeout(function() {
if( typeof(slider_id) !== 'undefined' && slider_id != '' ) {
$('#'+slider_id).slick( 'setPosition' );
$('#'+slider_id).css({'visibility': 'visible', 'opacity': 1});
}
}, 300);
});
});
/* SiteOrigin Compatibility For Accordion Panel */
$(document).on('click', '.sow-accordion-panel', function() {
var ele_control = $(this).attr('data-anchor');
var slider_wrap = $('#accordion-content-'+ele_control).find('.wtpsw-post-slider-init');
/* Tweak for slick slider */
$( slider_wrap ).each(function( index ) {
var slider_id = $(this).attr('id');
/* Tweak for slick slider */
if( typeof(slider_id) !== 'undefined' && slider_id != '' ) {
$('#'+slider_id).slick( 'setPosition' );
}
});
});
/* SiteOrigin Compatibility for Tab Panel */
$(document).on('click focus', '.sow-tabs-tab', function() {
var sel_index = $(this).index();
var cls_ele = $(this).closest('.sow-tabs');
var tab_cnt = cls_ele.find('.sow-tabs-panel').eq( sel_index );
var slider_wrap = tab_cnt.find('.wtpsw-post-slider-init');
/* Tweak for slick slider */
$( slider_wrap ).each(function( index ) {
var slider_id = $(this).attr('id');
$('#'+slider_id).css({'visibility': 'hidden', 'opacity': 0});
setTimeout(function() {
if( typeof(slider_id) !== 'undefined' && slider_id != '' ) {
$('#'+slider_id).slick( 'setPosition' );
$('#'+slider_id).css({'visibility': 'visible', 'opacity': 1});
}
}, 300);
});
});
/* Divi Builder Compatibility for Accordion & Toggle */
$(document).on('click', '.et_pb_toggle', function() {
var acc_cont = $(this).find('.et_pb_toggle_content');
var slider_wrap = acc_cont.find('.wtpsw-post-slider-init');
/* Tweak for slick slider */
$( slider_wrap ).each(function( index ) {
var slider_id = $(this).attr('id');
if( typeof(slider_id) !== 'undefined' && slider_id != '' ) {
$('#'+slider_id).slick( 'setPosition' );
}
});
});
/* Divi Builder Compatibility for Tabs */
$('.et_pb_tabs_controls li a').click( function() {
var cls_ele = $(this).closest('.et_pb_tabs');
var tab_cls = $(this).closest('li').attr('class');
var tab_cont = cls_ele.find('.et_pb_all_tabs .'+tab_cls);
var slider_wrap = tab_cont.find('.wtpsw-post-slider-init');
setTimeout(function() {
/* Tweak for slick slider */
$( slider_wrap ).each(function( index ) {
var slider_id = $(this).attr('id');
if( typeof(slider_id) !== 'undefined' && slider_id != '' ) {
$('#'+slider_id).slick( 'setPosition' );
}
});
}, 550);
});
/* Fusion Builder Compatibility for Tabs */
$(document).on('click', '.fusion-tabs li .tab-link', function() {
var cls_ele = $(this).closest('.fusion-tabs');
var tab_id = $(this).attr('href');
var tab_cont = cls_ele.find(tab_id);
var slider_wrap = tab_cont.find('.wtpsw-post-slider-init');
/* Tweak for slick slider */
$( slider_wrap ).each(function( index ) {
var slider_id = $(this).attr('id');
$('#'+slider_id).css({'visibility': 'hidden', 'opacity': 0});
setTimeout(function() {
if( typeof(slider_id) !== 'undefined' && slider_id != '' ) {
$('#'+slider_id).slick( 'setPosition' );
$('#'+slider_id).css({'visibility': 'visible', 'opacity': 1});
}
}, 550);
});
});
/* Fusion Builder Compatibility for Toggles */
$(document).on('click', '.fusion-accordian .panel-heading a', function() {
var cls_ele = $(this).closest('.fusion-accordian');
var tab_id = $(this).attr('href');
var tab_cont = cls_ele.find(tab_id);
var slider_wrap = tab_cont.find('.wtpsw-post-slider-init');
/* Tweak for slick slider */
$( slider_wrap ).each(function( index ) {
var slider_id = $(this).attr('id');
$('#'+slider_id).css({'visibility': 'hidden', 'opacity': 0});
if( typeof(slider_id) !== 'undefined' && slider_id != '' ) {
$('#'+slider_id).slick( 'setPosition' );
$('#'+slider_id).css({'visibility': 'visible', 'opacity': 1});
}
});
});
});
/* Function to Initialize Featured Post Slider */
function wtpsw_trending_slider_init() {
/* For Trending Post Slider */
jQuery( '.wtpsw-post-slider' ).each(function( index ) {
if( jQuery(this).hasClass('slick-initialized') ) {
return;
}
var slider_id = jQuery(this).attr('id');
var slider_conf = jQuery.parseJSON( jQuery(this).attr('data-conf'));
if( typeof(slider_id) != 'undefined' && slider_id != '' ) {
jQuery('#'+slider_id).slick({
infinite : true,
slidesToShow : 1,
slidesToScroll : 1,
dots : ( slider_conf.dots == "true" ) ? true : false,
arrows : ( slider_conf.arrows == "true" ) ? true : false,
autoplay : ( slider_conf.autoplay == "true" ) ? true : false,
speed : parseInt(slider_conf.speed),
autoplaySpeed : parseInt( slider_conf.autoplayinterval ),
rtl : ( Wtpsw.is_rtl == 1 ) ? true : false,
});
}
});
}
/* Function to Initialize Featured Post Slider */
function wtpsw_trending_carousel_init() {
/* For Trending Post Carousel */
jQuery( '.wtpsw-post-carousel' ).each(function( index ) {
if( jQuery(this).hasClass('slick-initialized') ) {
return;
}
var slider_id = jQuery(this).attr('id');
var slider_conf = jQuery.parseJSON( jQuery(this).attr('data-conf'));
if( typeof(slider_id) != 'undefined' && slider_id != '' ) {
jQuery('#'+slider_id).slick({
infinite : true,
dots : ( slider_conf.dots == "true" ) ? true : false,
arrows : ( slider_conf.arrows == "true" ) ? true : false,
autoplay : ( slider_conf.autoplay == "true" ) ? true : false,
speed : parseInt( slider_conf.speed ),
autoplaySpeed : parseInt( slider_conf.autoplayinterval ),
slidesToShow : parseInt( slider_conf.slides_to_show ),
slidesToScroll : parseInt( slider_conf.slides_to_scroll ),
rtl : ( Wtpsw.is_rtl == 1 ) ? true : false,
mobileFirst : ( Wtpsw.is_mobile == 1 ) ? true : false,
responsive: [{
breakpoint: 767,
settings: {
slidesToShow: (parseInt(slider_conf.slides_to_show) > 3) ? 3 : parseInt(slider_conf.slides_to_show),
slidesToScroll: 1,
dots: true
}
},
{
breakpoint: 640,
settings: {
slidesToShow: (parseInt(slider_conf.slides_to_show) > 2) ? 2 : parseInt(slider_conf.slides_to_show),
slidesToScroll: 1
}
},
{
breakpoint: 479,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
},
{
breakpoint: 319,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}
]
});
}
});
}

View File

@ -0,0 +1,104 @@
<?php
/**
* Admin Class
*
* Handles admin side functionality of plugin
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
class Wtpsw_Admin {
function __construct() {
// Action to register admin menu
add_action( 'admin_menu', array($this, 'wtpsw_register_menu') );
// Action to register plugin settings
add_action ( 'admin_init', array($this,'wtpsw_admin_processes') );
}
/**
* Function to register admin menus
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
function wtpsw_register_menu() {
// Register Setting Page
add_menu_page ( __('Trending Post', 'wtpsw'), __('Trending Post', 'wtpsw'), 'manage_options', 'wtpsw-settings', array($this, 'wtpsw_settings_page'), 'dashicons-star-filled' );
// Register How It Work Page
add_submenu_page( 'wtpsw-settings', __('Getting Started - WP Trending Post Slider and Widget', 'wtpsw'), __('Getting Started', 'wtpsw'), 'edit_posts', 'wtpsw-help', array($this, 'wtpsw_designs_page') );
// Register plugin premium page
add_submenu_page( 'wtpsw-settings', __('Upgrade To Premium - Trending/Popular Post Slider and Widget', 'wtpsw'), '<span style="color:#ff2700">'.__('Upgrade To Premium', 'wtpsw').'</span>', 'manage_options', 'wtpsw-premium', array($this, 'wtpsw_premium_page') );
}
/**
* Function to handle the setting page html
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
function wtpsw_settings_page() {
include_once( WTPSW_DIR . '/includes/admin/form/wtpsw-settings.php' );
}
/**
* How It Work Page
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
function wtpsw_designs_page() {
include_once( WTPSW_DIR . '/includes/admin/wtpsw-how-it-works.php' );
}
/**
* Upgrade to PRO Vs Free
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
function wtpsw_premium_page() {
include_once( WTPSW_DIR . '/includes/admin/form/premium.php' );
}
/**
* Function register setings
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
function wtpsw_admin_processes() {
// If plugin notice is dismissed
if( isset($_GET['message']) && $_GET['message'] == 'wtpsw-plugin-notice' ) {
set_transient( 'wtpsw_install_notice', true, 604800 );
}
register_setting( 'wtpsw_plugin_options', 'wtpsw_options', array($this, 'wtpsw_validate_options') );
}
/**
* Validate Settings Options
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
function wtpsw_validate_options( $input ){
$input['post_types'] = isset($input['post_types']) ? $input['post_types'] : array();
return $input;
}
}
$wtpsw_Admin = new Wtpsw_Admin();

View File

@ -0,0 +1,236 @@
<?php
/**
* Plugin Premium Offer Page
*
* @package Trending/Popular Post Slider and Widget
* @since 1.0.0
*/
if ( !defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
?>
<div class="wrap">
<h2><?php _e( 'WP Trending Post Slider and Widget', 'wtpsw' ); ?></h2><br />
<style>
.wpos-plugin-pricing-table thead th h2{font-weight: 400; font-size: 2.4em; line-height:normal; margin:0px; color: #2ECC71;}
.wpos-plugin-pricing-table thead th h2 + p{font-size: 1.25em; line-height: 1.4; color: #999; margin:5px 0 5px 0;}
table.wpos-plugin-pricing-table{width:100%; text-align: left; border-spacing: 0; border-collapse: collapse; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;}
.wpos-plugin-pricing-table th, .wpos-plugin-pricing-table td{font-size:14px; line-height:normal; color:#444; vertical-align:middle; padding:12px;}
.wpos-plugin-pricing-table colgroup:nth-child(1) { width: 31%; border: 0 none; }
.wpos-plugin-pricing-table colgroup:nth-child(2) { width: 22%; border: 1px solid #ccc; }
.wpos-plugin-pricing-table colgroup:nth-child(3) { width: 25%; border: 10px solid #2ECC71; }
/* Tablehead */
.wpos-plugin-pricing-table thead th {background-color: #fff; background:linear-gradient(to bottom, #ffffff 0%, #ffffff 100%); text-align: center; position: relative; border-bottom: 1px solid #ccc; padding: 1em 0 1em; font-weight:400; color:#999;}
.wpos-plugin-pricing-table thead th:nth-child(1) {background: transparent;}
.wpos-plugin-pricing-table thead th:nth-child(3) p{color:#000;}
.wpos-plugin-pricing-table thead th p.promo {font-size: 14px; color: #fff; position: absolute; bottom:0; left: -17px; z-index: 1000; width: 100%; margin: 0; padding: .625em 17px .75em; background-color: #ca4a1f; box-shadow: 0 2px 4px rgba(0,0,0,.25); border-bottom: 1px solid #ca4a1f;}
.wpos-plugin-pricing-table thead th p.promo:before {content: ""; position: absolute; display: block; width: 0px; height: 0px; border-style: solid; border-width: 0 7px 7px 0; border-color: transparent #900 transparent transparent; bottom: -7px; left: 0;}
.wpos-plugin-pricing-table thead th p.promo:after {content: ""; position: absolute; display: block; width: 0px; height: 0px; border-style: solid; border-width: 7px 7px 0 0; border-color: #900 transparent transparent transparent; bottom: -7px; right: 0;}
/* Tablebody */
.wpos-plugin-pricing-table tbody th{background: #fff; border-left: 1px solid #ccc; font-weight: 600;}
.wpos-plugin-pricing-table tbody th span{font-weight: normal; font-size: 87.5%; color: #999; display: block;}
.wpos-plugin-pricing-table tbody td{background: #fff; text-align: center;}
.wpos-plugin-pricing-table tbody td .dashicons{height: auto; width: auto; font-size:30px;}
.wpos-plugin-pricing-table tbody td .dashicons-no-alt{color: #ff2700;}
.wpos-plugin-pricing-table tbody td .dashicons-yes{color: #2ECC71;}
.wpos-plugin-pricing-table tbody tr:nth-child(even) th,
.wpos-plugin-pricing-table tbody tr:nth-child(even) td { background: #f5f5f5; border: 1px solid #ccc; border-width: 1px 0 1px 1px; }
.wpos-plugin-pricing-table tbody tr:last-child td {border-bottom: 0 none;}
/* Table Footer */
.wpos-plugin-pricing-table tfoot th, .wpos-plugin-pricing-table tfoot td{text-align: center; border-top: 1px solid #ccc;}
.wpos-plugin-pricing-table tfoot a, .wpos-plugin-pricing-table thead a{font-weight: 600; color: #fff; text-decoration: none; text-transform: uppercase; display: inline-block; padding: 1em 2em; background: #ff2700; border-radius: .2em;}
.wpos-epb{color:#ff2700 !important;}
/* SideBar */
.wpos-sidebar .wpos-epb-wrap{background:#0055fb; color:#fff; padding:15px;}
.wpos-sidebar .wpos-epb-wrap h2{font-size:24px !important; color:#fff; margin:0 0 15px 0; padding:0px !important;}
.wpos-sidebar .wpos-epb-wrap h2 span{font-size:20px !important; color:#ffff00 !important;}
.wpos-sidebar .wpos-epb-wrap ul li{font-size:16px; margin-bottom:8px;}
.wpos-sidebar .wpos-epb-wrap ul li span{color:#ffff00 !important;}
.wpos-sidebar .wpos-epb-wrap ul{list-style: decimal inside none;}
.wpos-sidebar .wpos-epb-wrap b{font-weight:bold !important;}
.wpos-sidebar .wpos-epb-wrap p{font-size:16px;}
.wpos-sidebar .wpos-epb-wrap .button-yellow{font-weight: 600;color: #000; text-align:center;text-decoration: none;display:block;padding: 1em 2em;background: #ffff00;border-radius: .2em;}
.wpos-sidebar .wpos-epb-wrap .button-orange{font-weight: 600;color: #fff; text-align:center;text-decoration: none;display:block;padding: 1em 2em;background: #ff2700;border-radius: .2em;}
</style>
<div id="poststuff">
<div id="post-body" class="metabox-holder">
<div id="post-body-content">
<table class="wpos-plugin-pricing-table">
<colgroup></colgroup>
<colgroup></colgroup>
<colgroup></colgroup>
<thead>
<tr>
<th></th>
<th>
<h2>Free</h2>
</th>
<th>
<h2 class="wpos-epb">Premium</h2>
<p>Gain access to <strong>WP Trending Post Slider and Widget</strong></p>
<a href="<?php echo WTPSW_PLUGIN_UPGRADE; ?>" target="_blank">Buy Now</a>
</th>
</tr>
</thead>
<tfoot>
<tr>
<th></th>
<td></td>
<td><p>Gain access to <strong>Trending/Popular Post Slider and Widget</strong></p>
<a href="<?php echo WTPSW_PLUGIN_UPGRADE; ?>" target="_blank">Buy Now</a>
</tr>
</tfoot>
<tbody>
<tr>
<th>Designs <span>Designs that make your website better</span></th>
<td>3</i></td>
<td>40+</td>
</tr>
<tr>
<th>Shortcodes <span>Shortcode provide output to the front-end side</span></th>
<td>3 (Slider, Carousel, Gridbox)</td>
<td>8 (Grid, Slider, Carousel, Gridbox)</td>
</tr>
<tr>
<th>Shortcode Parameters <span>Add extra power to the shortcode</span></th>
<td>15+</td>
<td>25+</td>
</tr>
<tr>
<th>Featured Post Support<span>Display featured posts as well.</span></th>
<td><i class="dashicons dashicons-no-alt"></i></td>
<td><i class="dashicons dashicons-yes"></i></td>
</tr>
<tr>
<th>Custom Post Type Support<span>Display only registered post type posts. You can find it on plugin setting page.</span></th>
<td><i class="dashicons dashicons-yes"></i></td>
<td><i class="dashicons dashicons-yes"></i></td>
</tr>
<tr>
<th>Shortcode Generator <span>Play with all shortcode parameters with preview panel. No documentation required!!</span></th>
<td><i class="dashicons dashicons-no-alt"></i></td>
<td><i class="dashicons dashicons-yes"></i></td>
</tr>
<tr>
<th>WP Templating Features <span>WP Templating Features You can modify plugin html/designs in your current theme.</span></th>
<td><i class="dashicons dashicons-no-alt"></i></td>
<td><i class="dashicons dashicons-yes"></i></td>
</tr>
<tr>
<th>Gutenberg Block Supports <span>Use this plugin with Gutenberg easily</span></th>
<td><i class="dashicons dashicons-yes"></i></td>
<td><i class="dashicons dashicons-yes"></i></td>
</tr>
<tr>
<th>Elementor Page Builder Support <em class="wpos-new-feature">New</em> <span>Use this plugin with Elementor easily</span></th>
<td><i class="dashicons dashicons-no-alt"></i></td>
<td><i class="dashicons dashicons-yes"></i></td>
</tr>
<tr>
<th>Beaver Builder Support <em class="wpos-new-feature">New</em> <span>Use this plugin with Beaver Builder easily</span></th>
<td><i class="dashicons dashicons-no-alt"></i></td>
<td><i class="dashicons dashicons-yes"></i></td>
</tr>
<tr>
<th>SiteOrigin Page Builder Support <em class="wpos-new-feature">New</em> <span>Use this plugin with SiteOrigin easily</span></th>
<td><i class="dashicons dashicons-no-alt"></i></td>
<td><i class="dashicons dashicons-yes"></i></td>
</tr>
<tr>
<th>Divi Page Builder Native Support <em class="wpos-new-feature">New</em> <span>Use this plugin with Divi Builder easily</span></th>
<td><i class="dashicons dashicons-yes"></i></td>
<td><i class="dashicons dashicons-yes"></i></td>
</tr>
<tr>
<th>Fusion Page Builder (Avada) native support <em class="wpos-new-feature">New</em> <span>Use this plugin with Fusion( Avada ) Builder easily</span></th>
<td><i class="dashicons dashicons-yes"></i></td>
<td><i class="dashicons dashicons-yes"></i></td>
</tr>
<tr>
<th>WPBakery Page Builder Support <span>Use this plugin with WPBakery Page Builder easily</span></th>
<td><i class="dashicons dashicons-no-alt"></i></td>
<td><i class="dashicons dashicons-yes"></i></td>
</tr>
<tr>
<th>Widgets<span> WordPress Widgets to your sidebars.</span></th>
<td>1</td>
<td>6</td>
</tr>
<tr>
<th>Display Desired Post <span>Display only the post you want</span></th>
<td><i class="dashicons dashicons-no-alt"></i></td>
<td><i class="dashicons dashicons-yes"></i></td>
</tr>
<tr>
<th>Display Post for Particular Categories <span>Display only the posts with particular category</span></th>
<td><i class="dashicons dashicons-no-alt"></i></td>
<td><i class="dashicons dashicons-yes"></i></td>
</tr>
<tr>
<th>Display Post for Particular Author <span>Display only the posts with particular author</span></th>
<td><i class="dashicons dashicons-no-alt"></i></td>
<td><i class="dashicons dashicons-yes"></i></td>
</tr>
<tr>
<th>Exclude Some Posts <span>Do not display the posts you want</span></th>
<td><i class="dashicons dashicons-no-alt"></i></td>
<td><i class="dashicons dashicons-yes"></i></td>
</tr>
<tr>
<th>Exclude Some Categories <span>Do not display the posts for particular categories</span></th>
<td><i class="dashicons dashicons-no-alt"></i></td>
<td><i class="dashicons dashicons-yes"></i></td>
</tr>
<tr>
<th>Exclude Some Author <span>Do not display the posts for particular author</span></th>
<td><i class="dashicons dashicons-no-alt"></i></td>
<td><i class="dashicons dashicons-yes"></i></td>
</tr>
<tr>
<th>Post Order / Order By Parameters <span>Display post according to date, title and etc</span></th>
<td><i class="dashicons dashicons-yes"></i></td>
<td><i class="dashicons dashicons-yes"></i></td>
</tr>
<tr>
<th>Multiple Slider Parameters <span>Slider parameters like autoplay, number of slide, sider dots and etc.</span></th>
<td><i class="dashicons dashicons-yes"></i></td>
<td><i class="dashicons dashicons-yes"></i></td>
</tr>
<tr>
<th>Slider RTL Support <span>Slider supports for RTL website</span></th>
<td><i class="dashicons dashicons-yes"></i></td>
<td><i class="dashicons dashicons-yes"></i></td>
</tr>
<tr>
<th>Automatic Update <span>Get automatic plugin updates </span></th>
<td>Lifetime</td>
<td>Lifetime</td>
</tr>
<tr>
<th>Support <span>Get support for plugin</span></th>
<td>Limited</td>
<td>1 Year</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,301 @@
<?php
/**
* Plugin Premium Offer Page
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
if ( !defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
?>
<div class="wrap wpls-wrap">
<h2 class="text-center"><?php _e( 'Trending Popular with ', 'wtpsw' ); ?><span class="h-blue"><?php _e( 'Essential Plugin Bundle Free Trial', 'wtpsw' ); ?></span></h2>
<style>
.button-orange { background: #FF5D52 !important; color: #fff !important; border: 2px solid #FF5D52 !important; font-size:18px!important; font-weight:bold; padding:10px 20px !important; }
.section-space-medium{margin:15px 0;}
.text-center{text-align:center;}
.h-blue { color: #0055fb !important; margin-bottom: 0px !important;}
.cart-section-header{font-size:26px; line-height:34px; margin:10px 0px;}
.wpos-trail-main-table{background:#fff; width:100%;}
.wpos-trail-main-table th, .wpos-trail-main-table td{padding:10px; text-align:left; border:1px solid #ddd; border-collapse: collapse;}
.edd_checkout_cart_item_title{font-size:18px; font-weight:bold;}
.wpos-trail-main-table tfoot th.edd_cart_total{text-align:right; font-size:18px; color:#0055fb;}
.epb-list h5{margin:2px 0 !important;}
.epb-list .dashicons {background: #aadb98;color: #34801a;font-size: 14px;padding: 2px;border-radius: 50%;margin-right: 5px; line-height:20px;}
.epb-list li{margin-bottom:15px;}
.page-template-free-trial-membership .wpos-bundle-stats .wpos-bundle-box {font-size:16px; margin-bottom:15px; box-shadow: 0 5px 30px 0 rgba(214,215,216,.57);padding: 20px 20px 20px 20px;background: #fff;position: relative;}
.section-space-small{margin-bottom:20px;}
.page-template-free-trial-membership .common-plan .wpos-bundle-stats .medium-4 .wpos-bundle-box{padding: 15px;}
.common-plan img{width: 45px;height: 45px;margin-bottom: 8px;}
.pay-later-cta {box-shadow: 0 5px 30px 0 rgba(214,215,216,.57);padding: 20px 20px 20px 20px;background: #fff;border-bottom: 2px solid #efeded;}
.pricing-review-wrap span{font-size: 14px;}
.page-template-free-trial-membership .wpos-seam-integration li{width: 32%;display: inline-block;}
.page-template-free-trial-membership .epb-list li{margin-bottom: 0;line-height: 34px;}
.page-template-free-trial-membership .wpos-checkout-right .epb-list li{line-height: 26px;}
.page-template-free-trial-membership .wp-builder-list li a{display: table;}
.page-template-free-trial-membership .wp-builder-list li a img{display: table-cell;width: 50px;}
.page-template-free-trial-membership .wp-builder-list li a span{vertical-align: middle;display: table-cell;padding-left: 10px;line-height: normal;}
.page-template-free-trial-membership .wpos-pricing-faq-page ul{max-width: 650px;margin: 0 auto;}
.grid-x:before, .grid-x:after{content: "";display: table;}
.grid-x::after, .grid-x{clear: both;}
.grid-padding-x{ margin-right: -.9375rem; margin-left: -.9375rem;}
@media only screen and (max-width: 40em) {
.page-template-free-trial-membership .pricing-review-wrap .medium-3{margin-bottom: 15px;}
.page-template-free-trial-membership .wpos-seam-integration li{width: 100%;}
.page-template-free-trial-membership .wpos-seam-integration li ul.epb-list li{border: none !important;}
.page-template-free-trial-membership .wpos-pricing-faq-page .accordion-item a{font-size: 16px;line-height: normal;}
.page-template-free-trial-membership .medium-4.wpos-checkout-right img{max-width: 200px;margin: 0 auto 20px;display: block;width: 100%;}
.common-plan .medium-2{width: 100%;}
}
@media only screen and (min-width: 40em) {
.cell {padding-right: .9375rem; padding-left: .9375rem; float:left; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
.medium-12{ width: 100%; }
.medium-8{ width: 66.66667%; }
.medium-4{ width: 33.333%; }
.medium-3{ width:25%; }
.medium-2{ width: 20%; }
}
</style>
<div id="poststuff">
<div id="post-body" class="metabox-holder page-template-free-trial-membership">
<div id="post-body-content">
<div class="grid-x grid-padding-x">
<div class="small-12 medium-8 cell">
<div class="wpos-trail-table">
<table class="wpos-trail-main-table">
<thead>
<tr class="edd_cart_header_row">
<th class="edd_cart_item_name">0$ Pro Trial</th>
<th class="edd_cart_item_price">Item Price</th>
</tr>
</thead>
<tbody>
<tr class="edd_cart_item" id="edd_cart_item_0_106568" data-download-id="106568">
<td class="edd_cart_item_name">
<span class="edd_checkout_cart_item_title">14 Days Pro Essential Plugin Bundle 0$ Pro Trial - Unlimited Sites</span>
<p class="eddr-notice eddr-cart-item-notice" style="margin-bottom: 0 !important;"><em style="font-weight:bold; font-size:13px;line-height: normal;">* <span class="h-blue">After 14-Days</span> 0$ Pro Trial $149 will be billed annually.</em></p>
<p class="eddr-notice h-orange eddr-cart-item-notice"><em style="font-weight:bold; font-size:13px; ">* <span class="h-blue">Within 14-Days </span>0$ Pro Trial easily cancelable and you will not be charge at all.</em></p>
</td>
<td class="edd_cart_item_price">$149.00
</td>
</tr>
</tbody>
<tfoot>
<tr class="edd_cart_footer_row">
<th colspan="2" class="edd_cart_total">Total: <span class="edd_cart_amount" data-subtotal="149" data-total="149">$0.00</span></th>
</tr>
</tfoot>
</table>
</div>
<div class="grid-x grid-padding-x" style="text-align: center;width: 100%;padding: 30px 0;">
<div class="small-12 medium-6" style="display: inline-block; font-weight: bold;border-right: 1px solid #ddd;text-align: center;">
<span class="h-blue" style="font-size: 40px;margin-right: 10px;">277</span> <span style="display: inline-block;color: #505050;max-width: 100px;line-height: normal;text-align: left;font-size: 15px;">Trials in the last month</span>
</div>
<div class="small-12 medium-6" style="display: inline-block; font-weight: bold;text-align: center;">
<span class="h-blue" style="font-size: 40px;margin-right: 10px;">16,435</span> <span style="display: inline-block;color: #505050;max-width: 100px;line-height: normal;text-align: left;font-size: 15px;">Pro-users since 2015</span>
</div>
</div>
</div>
<div class="small-12 medium-4 cell wpos-checkout-right">
<h4 class="cart-section-header">14 Days Pro Essential Plugin Bundle <span style="color: #0055fb ;">0$ Pro Trial</span></h4>
<h5 style="font-size: 18px;line-height: 30px;margin: 10px 0px;">Your Plan Details:</h5>
<ul style="margin: 0;list-style: none;font-size: 16px;">
<li style="margin-bottom:8px;">
<span style="display:inline-block;vertical-align: middle;"><img src="<?php echo WTPSW_URL; ?>/assets/images/utility-50.png" width="24"></span> <span style="display:inline-block;vertical-align: middle;">39 Utility Plugins</span>
</li>
<li style="margin-bottom:8px;">
<span style="display:inline-block;vertical-align: middle;"><img src="<?php echo WTPSW_URL; ?>/assets/images/inboundwp-50.png" width="24"></span> <span style="display:inline-block;vertical-align: middle;">6 Marketing Tools</span>
</li>
<li style="margin-bottom:8px;">
<span style="display:inline-block;vertical-align: middle;"><img src="<?php echo WTPSW_URL; ?>/assets/images/SlidersPack-50.png" width="24"></span><span style="display:inline-block;vertical-align: middle;"> 10 SlidersPack</span>
</li>
<li style="margin-bottom:8px;">
<span style="display:inline-block;vertical-align: middle;"><img src="<?php echo WTPSW_URL; ?>/assets/images/popup-anything-icon.png" width="24"></span><span style="display:inline-block;vertical-align: middle;"> Popup Anything A Marketing Popup</span>
</li>
<li>
<span style="display:inline-block;vertical-align: middle;"><img src="<?php echo WTPSW_URL; ?>/assets/images/security-icon.png" width="24"></span><span style="display:inline-block;vertical-align: middle;"> Essential Security</span>
</li>
</ul>
</div>
<div class="small-12 medium-12 cell text-center section-space-medium">
<a href="<?php echo WTPSW_CHECKOUT_PLUGIN_LINK; ?>" class="large button button-orange radius" target="_blank">Join 0$ 14 Days Pro Bundle Trial</a>
</div>
</div>
<div class="grid-x grid-padding-x" style="margin:30px 0;">
<div class="medium-12 cell text-center">
<h3 class="text-center cart-section-header" style="display: inline-block;">Build <span style="background:#0099fb;color:#fff;padding: 0 5px;">better websites</span>, <span style="background:#0099fb;color:#fff;padding: 0 5px;">landing pages</span> &amp; <span style="background:#0099fb;color:#fff;padding: 0 5px;">conversion flow</span></h3>
</div>
<div class="text-center medium-12 cell epb-list">
<ul style="list-style:none;margin-left: 0;">
<li>
<h5 style="font-size:17px;"><span class="dashicons dashicons-saved"></span></i>45 plugins, 10 sliders, Best in class - Popup plugin<span class="new-badge" style="position: relative;top: -8px;right: 2px;font-size: 10px;">New</span> with 2000+ pre-built templates in <span class="h-blue">Essential Bundle</span></h5>
</li>
<li>
<h5 style="font-size:17px;line-height: 30px;margin-bottom: 6px !important;"><span class="dashicons dashicons-saved"></span> Compatible with <span style="text-decoration: underline;color: #ff5d52;">Gutenberg, DIVI, Elementor, Avada, VC/WPbakery</span> etc page builder/themes</h5>
</li>
</ul>
</div>
</div>
<div class="grid-x grid-padding-x wpos-bundle-stats">
<div class="small-12 medium-12 cell text-center section-space-small">
<h3 class="cart-section-header text-center">What You Will Get?</h3>
</div>
<div class="medium-2 small-12 cell">
<div class="wpos-bundle-box text-center">
<img src="<?php echo WTPSW_URL; ?>/assets/images/utility-50.png"><br>
39 <br>
Utility Plugins
</div>
</div>
<div class="medium-2 small-12 cell">
<div class="wpos-bundle-box text-center">
<img src="<?php echo WTPSW_URL; ?>/assets/images/inboundwp-50.png"><br>
6 <br>
Marketing Tools
</div>
</div>
<div class="medium-2 small-12 cell">
<div class="wpos-bundle-box text-center">
<img src="<?php echo WTPSW_URL; ?>assets/images/SlidersPack-50.png"><br>
10 <br>
SlidersPack
</div>
</div>
<div class="medium-2 small-12 cell">
<div class="wpos-bundle-box text-center">
<img src="<?php echo WTPSW_URL; ?>assets/images/popup-anything-icon.png"><br>
Popup Anything <br>
A Marketing Popup
</div>
</div>
<div class="medium-2 small-12 cell">
<div class="wpos-bundle-box text-center">
<img src="<?php echo WTPSW_URL; ?>/assets/images/security-icon.png"><br>
Essential <br>Security
</div>
</div>
<div class="medium-4 small-12 cell">
<div class="wpos-bundle-box text-center">
2000+ Templates
</div>
</div>
<div class="medium-4 small-12 cell">
<div class="wpos-bundle-box text-center">
Regular Updates With Valid Subscription
</div>
</div>
<div class="medium-4 small-12 cell">
<div class="wpos-bundle-box text-center">
Auto Renewal Yearly Product License
</div>
</div>
</div>
<h3 class="pay-later-cta text-center section-space-medium" style="font-size: 28px;"><span style="color:#ed4635;">PAY $0 USD</span> + <span style="color:#5f9654;">INSTALL</span> + <span style="color:#9d42b0;">USE &amp; EXPLORE</span> = <span class="h-blue">YOUR DECISION YOU PAY OR NOT</span></h3>
<div class="pricing-review-wrap text-center section-space-medium" style="padding:30px 0;background-color: #eaf1fe;">
<div class="grid-container">
<h4 class="section-space-small cart-section-header">Get convinced? Check out what our real-life members have to say...</h4>
<div class="grid-x grid-padding-x">
<div class="small-12 medium-3 cell text-center">
<a href="https://tinyurl.com/y4bh9dnn" target="_blank" style="display: block;">
<img src="<?php echo WTPSW_URL; ?>/assets/images/g-logo.png" width="44">
<br>
<span style="color:#555">Google Reviews</span><br>
<span class="dashicons dashicons-star-filled" style="color: #fe8f01;"></span><span class="dashicons dashicons-star-filled" style="color: #fe8f01;"></span><span class="dashicons dashicons-star-filled" style="color: #fe8f01;"></span><span class="dashicons dashicons-star-filled" style="color: #fe8f01;"></span><span class="dashicons dashicons-star-filled" style="color: #fe8f01;"></span><br>
<span>150+ reviews</span>
</a>
</div>
<div class="small-12 medium-3 cell">
<a href="https://www.facebook.com/EssentialPlugins/reviews/" target="_blank" style="display: block;">
<img src="<?php echo WTPSW_URL; ?>/assets/images/fb-icon.png" width="44">
<br>
<span style="color:#555">Facebook Reviews</span><br>
<span class="dashicons dashicons-star-filled" style="color: #fe8f01;"></span><span class="dashicons dashicons-star-filled" style="color: #fe8f01;"></span><span class="dashicons dashicons-star-filled" style="color: #fe8f01;"></span><span class="dashicons dashicons-star-filled" style="color: #fe8f01;"></span><span class="dashicons dashicons-star-filled" style="color: #fe8f01;"></span><br>
<span>50+ reviews</span>
</a>
</div>
<div class="small-12 medium-3 cell" style="padding-top: 10px;">
<a href="https://profiles.wordpress.org/wponlinesupport/#content-plugins" target="_blank" style="display: block;">
<img src="<?php echo WTPSW_URL; ?>/assets/images/wordpress-icon-logo.png" width="150">
<br>
<span style="color:#555">WordPress.org Reviews</span><br>
<span class="dashicons dashicons-star-filled" style="color: #fe8f01;"></span><span class="dashicons dashicons-star-filled" style="color: #fe8f01;"></span><span class="dashicons dashicons-star-filled" style="color: #fe8f01;"></span><span class="dashicons dashicons-star-filled" style="color: #fe8f01;"></span><span class="dashicons dashicons-star-filled" style="color: #fe8f01;"></span><br>
<span>500+ reviews</span>
</a>
</div>
<div class="small-12 medium-3 cell" style="padding-top:10px;">
<a href="https://www.essentialplugin.com/essential-plugin-bundle-testimonials/" target="_blank" style="display: block;">
<img src="<?php echo WTPSW_URL; ?>/assets/images/essential-plugin-logo.png" width="150">
<br>
<span style="color:#555">On-Site Reviews</span><br>
<span class="dashicons dashicons-star-filled" style="color: #fe8f01;"></span><span class="dashicons dashicons-star-filled" style="color: #fe8f01;"></span><span class="dashicons dashicons-star-filled" style="color: #fe8f01;"></span><span class="dashicons dashicons-star-filled" style="color: #fe8f01;"></span><span class="dashicons dashicons-star-filled" style="color: #fe8f01;"></span><br>
<span>200+ reviews</span>
</a>
</div>
</div>
</div>
</div>
<div class="text-center section-space-larger">
<a href="<?php echo WTPSW_CHECKOUT_PLUGIN_LINK; ?>" class="large button button-orange radius" target="_blank">Join 0$ 14 Days Pro Bundle Trial</a>
<ul class="epb-list" style="text-align: left;list-style: none;margin: 0 auto;padding: 0 15px;max-width: 500px;">
<li><span class="dashicons dashicons-saved"></span><span class="h-orange">After 14 days - 0$ Pro Trial $149 will be billed annually.</span></li>
<li><span class="dashicons dashicons-saved"></span><span class="h-orange">Within 14 days 0$ Pro Trial easily cancelable and you will not be charge at all.</span></li>
</ul>
</div>
<div id="wpos-seam-integration" class="wpos-seam-integration section-space-medium">
<div class="grid-x grid-padding-x">
<div class="small-12 medium-12 cell text-center section-space-small">
<h4 class="h-blue cart-section-header">Seamless Integration With All Major Page Builders</h4>
<h3 class="cart-section-header">+ Multisite, Ecom Compatible</h3>
</div>
</div>
<div class="grid-container">
<div class="grid-x grid-padding-x">
<div class="small-12 medium-12 cell section-space-small">
<ul class="wp-builder-list" style="list-style:none;margin:0;">
<li>
<img src="<?php echo WTPSW_URL; ?>/assets/images/gutenberg-icon.png" width="30"><span style="margin-left: 10px;">Gutenberg Page Builder</span>
</li>
<li>
<img src="<?php echo WTPSW_URL; ?>/assets/images/site-origin-icon.png" width="30"><span style="margin-left: 10px;">Siteorigin Page Builder</span>
</li>
<li>
<img src="<?php echo WTPSW_URL; ?>/assets/images/elementor-icon.png" width="30"><span style="margin-left: 10px;">Elementor Page Builder</span>
</li>
<li>
<img src="<?php echo WTPSW_URL; ?>/assets/images/vc-icon.png" width="30"><span style="margin-left: 10px;">VC Composer Page Builder</span>
</li>
<li>
<img src="<?php echo WTPSW_URL; ?>/assets/images/wpbakery-icon.png" width="30"><span style="margin-left: 10px;">WPbakery Page Builder</span>
</li>
<li>
<img src="<?php echo WTPSW_URL; ?>/assets/images/beaver-icon.png" width="30"><span style="margin-left: 10px;">Beaver Page Builder</span>
</li>
<li>
<img src="<?php echo WTPSW_URL; ?>/assets/images/divi-icon.png" width="30"><span style="margin-left: 10px;">Adding DIVI and Avada theme support</span>
</li>
</ul>
</div>
<div class="small-12 medium-12 cell text-center">
<a href="<?php echo WTPSW_CHECKOUT_PLUGIN_LINK; ?>" class="large button button-orange radius" target="_blank">Join 0$ 14 Days Pro Bundle Trial</a>
<ul class="epb-list" style="text-align: left;list-style: none;max-width: 500px;margin: 0 auto;padding: 0;">
<li style="line-height: 34px;width: 100%;padding: 0;margin: 0;"><span class="dashicons dashicons-saved"></span><span class="h-orange">After 14 days - 0$ Pro Trial $149 will be billed annually.</span></li>
<li style="line-height: 34px;width: 100%;padding: 0;margin: 0;"><span class="dashicons dashicons-saved"></span><span class="h-orange">Within 14 days 0$ Pro Trial easily cancelable and you will not be charge at all.</span></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,101 @@
<?php
/**
* Settings Page
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
$reg_post_types = wtpsw_get_post_types();
$tp_support_post_types = wtpsw_get_option( 'post_types', array() );
?>
<div class="wrap wtpsw-settings">
<h2><?php _e( 'Trending Post - Settings', 'wtpsw' ); ?></h2>
<?php
if( isset($_GET['settings-updated']) && $_GET['settings-updated'] == 'true' ) {
echo '<div id="message" class="updated notice notice-success is-dismissible">
<p>'.__("Your changes saved successfully.", "wtpsw").'</p>
</div>';
}
?>
<form action="options.php" method="POST" id="wtpsw-settings-form" class="wtpsw-settings-form">
<?php
settings_fields( 'wtpsw_plugin_options' );
global $wtpsw_options;
?>
<div id="wtpsw-general-settings" class="post-box-container wtpsw-general-settings">
<div class="metabox-holder">
<div class="meta-box-sortables ui-sortable">
<div id="general" class="postbox">
<div class="postbox-header">
<h2 class="hndle">
<span><?php _e( 'General Settings', 'wtpsw' ); ?></span>
</h2>
</div>
<div class="inside">
<table class="form-table wtpsw-general-settings-tbl">
<tbody>
<tr>
<th scope="row">
<label for="wtpsw-post-within"><?php _e('Post Within', 'wtpsw'); ?></label>
</th>
<td>
<select id="wtpsw-post-within" class="wtpsw-post-within" name="wtpsw_options[post_range]">
<option value=""><?php _e('All Time', 'wtpsw'); ?></option>
<option value="daily" <?php selected( $wtpsw_options['post_range'], 'daily' ); ?>><?php _e('Today', 'wtpsw'); ?></option>
<option value="last_day" <?php selected( $wtpsw_options['post_range'], 'last_day' ); ?>><?php _e('Last Day', 'wtpsw'); ?></option>
<option value="last_week" <?php selected( $wtpsw_options['post_range'], 'last_week' ); ?>><?php _e('Last 7 Days', 'wtpsw'); ?></option>
<option value="last_month" <?php selected( $wtpsw_options['post_range'], 'last_month' ); ?>><?php _e('Last Month', 'wtpsw'); ?></option>
</select><br/>
<span class="description"><?php _e('Select time range for post visibility. Note: The post published within this time range will be visible.', 'wtpsw'); ?></span>
</td>
</tr>
<tr>
<th>
<label for="select-post-type"><?php _e('Select Post Types', 'wtpsw'); ?></label>
</th>
<td>
<?php if( !empty($reg_post_types) ) {
foreach ($reg_post_types as $post_key => $post_label) { ?>
<div class="ftpp-post-type-wrap">
<label>
<input type="checkbox" id="ftpp-tp-post-<?php echo $post_key; ?>" value="<?php echo $post_key; ?>" name="wtpsw_options[post_types][]" <?php checked( in_array($post_key, $tp_support_post_types), true ); ?> />
<?php echo $post_label; ?>( <?php echo __('Post Type','wtpsw').' : '.$post_key; ?> )
</label>
</div>
<?php }
} ?>
<span class="description"><?php _e('Select post type box for trending post. You can enter post type name in shortcode parameter.', 'wtpsw'); ?></span> <br/>
</td>
</tr>
<tr>
<td colspan="2" valign="top" scope="row">
<input type="submit" id="wtpsw-settings-submit" name="wtpsw-settings-submit" class="button button-primary right" value="<?php _e('Save Changes','wtpsw');?>" />
</td>
</tr>
</tbody>
</table>
</div><!-- .inside -->
</div><!-- #general -->
</div><!-- .meta-box-sortables ui-sortable -->
</div><!-- .metabox-holder -->
</div><!-- #wtpsw-general-settings -->
</form><!-- end .wtpsw-settings-form -->
</div><!-- end .wtpsw-settings -->

View File

@ -0,0 +1,288 @@
<?php
/**
* Blocks Initializer
*
* @package Trending/Popular Post Slider and Widget
* @since 1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
function wtpsw_register_guten_block() {
// Block Editor Script
wp_register_script( 'wtpsw-block-js', WTPSW_URL.'assets/js/blocks.build.js', array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-block-editor', 'wp-components' ), WTPSW_VERSION, true );
wp_localize_script( 'wtpsw-block-js', 'Wtpsw_Block', array(
'pro_demo_link' => 'https://demo.wponlinesupport.com/prodemo/pro-featured-and-trending-post/',
'free_demo_link' => 'https://demo.wponlinesupport.com/trending-post-demo/',
'pro_link' => WTPSW_PLUGIN_LINK,
));
// Register block and explicit attributes for trending slider
register_block_type( 'wtpsw-free/trending-slider', array(
'attributes' => array(
'align' => array(
'type' => 'string',
'default' => '',
),
'className' => array(
'type' => 'string',
'default' => '',
),
'showdate' => array(
'type' => 'boolean',
'default' => true,
),
'showauthor' => array(
'type' => 'boolean',
'default' => true,
),
'show_comment_count' => array(
'type' => 'boolean',
'default' => true,
),
'hide_empty_comment_count' => array(
'type' => 'boolean',
'default' => false,
),
'showcontent' => array(
'type' => 'boolean',
'default' => false,
),
'words_limit' => array(
'type' => 'number',
'default' => 40,
),
'dots' => array(
'type' => 'string',
'default' => 'true',
),
'arrows' => array(
'type' => 'string',
'default' => 'true',
),
'autoplay' => array(
'type' => 'string',
'default' => 'true',
),
'autoplayinterval' => array(
'type' => 'number',
'default' => 3000,
),
'speed' => array(
'type' => 'number',
'default' => 300,
),
'limit' => array(
'type' => 'number',
'default' => 10,
),
'post_type' => array(
'type' => 'string',
'default' => 'post',
),
'view_by' => array(
'type' => 'string',
'default' => 'views',
),
'order' => array(
'type' => 'string',
'default' => 'desc',
),
),
'render_callback' => 'wtpsw_trending_post_slider',
));
// Register block and explicit attributes for trending carousel
register_block_type( 'wtpsw-free/trending-carousel', array(
'attributes' => array(
'align' => array(
'type' => 'string',
'default' => '',
),
'className' => array(
'type' => 'string',
'default' => '',
),
'showdate' => array(
'type' => 'boolean',
'default' => true,
),
'showauthor' => array(
'type' => 'boolean',
'default' => true,
),
'show_comment_count' => array(
'type' => 'boolean',
'default' => true,
),
'hide_empty_comment_count' => array(
'type' => 'boolean',
'default' => false,
),
'showcontent' => array(
'type' => 'boolean',
'default' => false,
),
'words_limit' => array(
'type' => 'number',
'default' => 40,
),
'slides_to_show' => array(
'type' => 'number',
'default' => 3,
),
'slides_to_scroll' => array(
'type' => 'number',
'default' => 1,
),
'dots' => array(
'type' => 'string',
'default' => 'true',
),
'arrows' => array(
'type' => 'string',
'default' => 'true',
),
'autoplay' => array(
'type' => 'string',
'default' => 'true',
),
'autoplayinterval' => array(
'type' => 'number',
'default' => 3000,
),
'speed' => array(
'type' => 'number',
'default' => 300,
),
'limit' => array(
'type' => 'number',
'default' => 10,
),
'post_type' => array(
'type' => 'string',
'default' => 'post',
),
'view_by' => array(
'type' => 'string',
'default' => 'views',
),
'order' => array(
'type' => 'string',
'default' => 'DESC',
),
),
'render_callback' => 'wtpsw_popular_post_carousel',
));
// Register block and explicit attributes for trending gridbox
register_block_type( 'wtpsw-free/trending-gridbox', array(
'attributes' => array(
'align' => array(
'type' => 'string',
'default' => '',
),
'className' => array(
'type' => 'string',
'default' => '',
),
'showdate' => array(
'type' => 'boolean',
'default' => true,
),
'showauthor' => array(
'type' => 'boolean',
'default' => true,
),
'show_comment_count' => array(
'type' => 'boolean',
'default' => true,
),
'hide_empty_comment_count' => array(
'type' => 'boolean',
'default' => false,
),
'showcontent' => array(
'type' => 'boolean',
'default' => false,
),
'words_limit' => array(
'type' => 'number',
'default' => 40,
),
'limit' => array(
'type' => 'number',
'default' => 5,
),
'post_type' => array(
'type' => 'string',
'default' => 'post',
),
'view_by' => array(
'type' => 'string',
'default' => 'views',
),
'order' => array(
'type' => 'string',
'default' => 'DESC',
),
),
'render_callback' => 'wtpsw_trending_post_gridbox',
));
if ( function_exists( 'wp_set_script_translations' ) ) {
wp_set_script_translations( 'wtpsw-block-js', 'wtpsw', WTPSW_DIR . '/languages' );
}
}
add_action( 'init', 'wtpsw_register_guten_block' );
/**
* Enqueue Gutenberg block assets for backend editor.
*
* @uses {wp-blocks} for block type registration & related functions.
* @uses {wp-element} for WP Element abstraction — structure of blocks.
* @uses {wp-i18n} to internationalize the block's text.
* @uses {wp-editor} for WP editor styles.
*
* @package WP Trending Post Slider and Widget
* @since 1.0
*/
function wtpsw_editor_assets() {
// Block Editor CSS
if( ! wp_style_is( 'wpos-guten-block-css', 'registered' ) ) {
wp_register_style( 'wpos-guten-block-css', WTPSW_URL.'assets/css/blocks.editor.build.css', array( 'wp-edit-blocks' ), WTPSW_VERSION );
}
// Block Editor Script
wp_enqueue_style( 'wpos-guten-block-css' );
wp_enqueue_script( 'wtpsw-block-js' );
}
add_action( 'enqueue_block_editor_assets', 'wtpsw_editor_assets' );
/**
* Adds an extra category to the block inserter
*
* @package WP Trending Post Slider and Widget
* @since 1.0
*/
function wtpsw_add_block_category( $categories ) {
$guten_cats = wp_list_pluck( $categories, 'slug' );
if( ! in_array( 'wpos_guten_block', $guten_cats ) ) {
$categories[] = array(
'slug' => 'wpos_guten_block',
'title' => __('WPOS Blocks', 'wtpsw'),
'icon' => null,
);
}
return $categories;
}
add_filter( 'block_categories_all', 'wtpsw_add_block_category' );

View File

@ -0,0 +1,162 @@
<?php
/**
* Pro Designs and Plugins Feed
*
* @package WP Trending Post Slider and Widget
* @since 1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
?>
<div class="wrap wtpsw-wrap">
<style type="text/css">
.wpos-pro-box .hndle{background-color:#0073AA; color:#fff;}
.wpos-pro-box .postbox{background:#dbf0fa none repeat scroll 0 0; border:1px solid #0073aa; color:#191e23;}
.postbox-container .wpos-list li:before{font-family: dashicons; content: "\f139"; font-size:20px; color: #0073aa; vertical-align: middle;}
.wtpsw-wrap .wpos-button-full{display:block; text-align:center; box-shadow:none; border-radius:0;}
.wtpsw-shortcode-preview{background-color: #e7e7e7; font-weight: bold; padding: 2px 5px; display: inline-block; margin:0 0 2px 0;}
.upgrade-to-pro{font-size:18px; text-align:center; margin-bottom:15px;}
.wpos-copy-clipboard{-webkit-touch-callout: all; -webkit-user-select: all; -khtml-user-select: all; -moz-user-select: all; -ms-user-select: all; user-select: all;}
.wpos-new-feature{ font-size: 10px; margin-left:2px; color: #fff; font-weight: bold; background-color: #03aa29; padding:1px 4px; font-style: normal; }
.button-orange{background: #ff2700 !important;border-color: #ff2700 !important; font-weight: 600;}
</style>
<h2><?php _e( 'How It Works', 'wtpsw' ); ?></h2>
<div class="post-box-container">
<div id="poststuff">
<div id="post-body" class="metabox-holder columns-2">
<!--How it workd HTML -->
<div id="post-body-content">
<div class="metabox-holder">
<div class="meta-box-sortables">
<div class="postbox">
<div class="postbox-header">
<h2 class="hndle">
<span><?php _e( 'Need Support & Solutions?', 'wtpsw' ); ?></span>
</h2>
</div>
<div class="inside">
<p><?php _e('Boost design and best solution for your website.', 'wtpsw'); ?></p>
<a class="button button-primary button-orange" href="<?php echo WTPSW_PLUGIN_LINK; ?>" target="_blank"><?php _e('Grab Now', 'wtpsw'); ?></a>
</div><!-- .inside -->
</div><!-- #general -->
<div class="postbox">
<div class="postbox-header">
<h2 class="hndle">
<span><?php _e( 'How It Works - Display and Shortcode', 'wtpsw' ); ?></span>
</h2>
</div>
<div class="inside">
<table class="form-table">
<tr>
<th>
<label><?php _e('Getting Started', 'wtpsw'); ?></label>
</th>
<td>
<p><?php _e('Trending Post display most visited post on your website. It works with WordPress default post type.', 'wtpsw'); ?></p>
</td>
</tr>
<tr>
<th>
<label><?php _e('All Shortcodes', 'wtpsw'); ?></label>
</th>
<td>
<span class="wpos-copy-clipboard wtpsw-shortcode-preview">[wtpsw_popular_post]</span> <?php _e('Trending Post Slider View', 'wtpsw'); ?><br />
<span class="wpos-copy-clipboard wtpsw-shortcode-preview">[wtpsw_carousel]</span> <?php _e('Trending Post Carousel View', 'wtpsw'); ?><br />
<span class="wpos-copy-clipboard wtpsw-shortcode-preview">[wtpsw_gridbox]</span> <?php _e('Trending Post Gridbox View', 'wtpsw'); ?>
<br/><br/>
</td>
</tr>
<tr>
<th>
<label><?php _e('Documentation', 'wtpsw'); ?>:</label>
</th>
<td>
<a class="button button-primary" href="https://docs.essentialplugin.com/trending-popular-post-slider-and-widget/" target="_blank"><?php _e('Check Documentation', 'wtpsw'); ?></a>
</td>
</tr>
</table>
</div>
</div>
<div class="postbox">
<div class="postbox-header">
<h2 class="hndle">
<span><?php _e( 'Gutenberg Support', 'wp-testimonial-with-widget' ); ?></span>
</h2>
</div>
<div class="inside">
<table class="form-table">
<tbody>
<tr>
<th>
<label><?php _e('How it Work', 'wp-testimonial-with-widget'); ?>:</label>
</th>
<td>
<ul>
<li><?php _e('Step-1. Go to the Gutenberg editor of your page.', 'wp-testimonial-with-widget'); ?></li>
<li><?php _e('Step-2. Search "testimonial" keyword in the gutenberg block list.', 'wp-testimonial-with-widget'); ?></li>
<li><?php _e('Step-3. Add any block of testimonial and you will find its relative options on the right end side.', 'wp-testimonial-with-widget'); ?></li>
</ul>
</td>
</tr>
</tbody>
</table>
</div><!-- .inside -->
</div><!-- #general -->
<div class="postbox">
<div class="postbox-header">
<h2 class="hndle">
<span><?php _e( 'Help to improve this plugin!', 'wtpsw' ); ?></span>
</h2>
</div>
<div class="inside">
<p><?php _e('Enjoyed this plugin? You can help by rate this plugin', 'wtpsw'); ?> <a href="https://wordpress.org/support/plugin/wp-trending-post-slider-and-widget/reviews#new-post" target="_blank"><?php _e('5 stars!', 'wtpsw'); ?></a></p>
</div><!-- .inside -->
</div><!-- #general -->
</div>
</div>
</div>
<!--Upgrad to Pro HTML -->
<div id="postbox-container-1" class="postbox-container">
<div class="metabox-holder wpos-pro-box">
<div class="meta-box-sortables">
<div class="postbox">
<h3 class="hndle">
<span><?php _e( 'Upgrate to Pro', 'wtpsw' ); ?></span>
</h3>
<div class="inside">
<ul class="wpos-list">
<li>40+ stunning and cool designs for Grid, slider, carousel and gridbox</li>
<li>8 shortcodes</li>
<li>Visual Composer Page Builder Support</li>
<li>6 different types of widgets</li>
<li>Custom post type support</li>
<li>Gutenberg Block Supports.</li>
<li>WPBakery Page Builder Supports</li>
<li>Elementor, Beaver and SiteOrigin Page Builder Support. <span class="wpos-new-feature">New</span></li>
<li>Divi Page Builder Native Support. <span class="wpos-new-feature">New</span></li>
<li>Fusion Page Builder (Avada) native support.<span class="wpos-new-feature">New</span></li>
<li>WP Templating Features</li>
<li>Display Desired post include and exclude </li>
<li>Display posts with include categories and exclude categories</li>
<li>Display posts with particular include author and exclude author</li>
<li>Custom CSS</li>
<li>100% Multi language</li>
</ul>
<div class="upgrade-to-pro">Gain access to <strong>WP Trending Post Slider and Widget</strong> included in <br /><strong>Essential Plugin Bundle</div>
<a class="button button-primary wpos-button-full button-orange" href="<?php echo WTPSW_PLUGIN_LINK; ?>" target="_blank"><?php _e('Grab Now', 'wtpsw'); ?></a>
</div><!-- .inside -->
</div><!-- #general -->
</div><!-- .meta-box-sortables -->
</div><!-- .metabox-holder -->
</div><!-- #post-container-1 -->
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,154 @@
<?php
/**
* Model Class
*
* Handles query related functionality of plugin
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
class Wtpsw_Model {
function __construct(){
}
/**
* Function to get post data
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
function wtpsw_get_posts( $args = array() ) {
// Taking defaults
$result_data = array();
$postsargs['post_status'] = array( 'publish' );
$postsargs['post_type'] = !empty($args['post_type']) ? $args['post_type'] : 'post';
$postsargs['posts_per_page'] = !empty($args['posts_per_page']) ? $args['posts_per_page'] : -1;
// Order by records
$postsargs['order'] = !empty($args['order']) ? $args['order'] : 'DESC';
$postsargs['orderby'] = !empty($args['orderby']) ? $args['orderby'] : 'date';
// Meta key
if(isset($args['meta_key']) && !empty($args['meta_key'])) {
$postsargs['meta_key'] = $args['meta_key'];
}
// Per page records
if(isset($args['paged']) && !empty($args['paged'])) {
$postsargs['paged'] = $args['paged'];
}
// Meta query
if(isset($args['meta_query']) && !empty($args['meta_query'])) {
$postsargs['meta_query'] = $args['meta_query'];
}
// Taxonomy query
if(isset($args['tax_query']) && !empty($args['tax_query'])) {
$postsargs['tax_query'] = $args['tax_query'];
}
// Date query
if(isset($args['date_query']) && !empty($args['date_query'])) {
$postsargs['date_query'] = $args['date_query'];
}
// Run WP Query
$result = new WP_Query( $postsargs );
// If only want to get count
if(isset($args['getcount']) && $args['getcount'] == '1') {
$result_data = $result->post_count;
} elseif ( isset($args['list_data']) && !empty($args['list_data']) ) { // Data with post and count in array format
// Converting retrived post data to array
$result_data = wtpsw_object_to_array($result->posts);
// Fetch data with count
if( isset($args['list_data']) && !empty($args['list_data']) ) {
$data_res = array();
$data_res['data'] = $result_data;
// To get total count of post
$data_res['total'] = isset($result->found_posts) ? $result->found_posts : '';
// Assigning it in to returned array
$result_data = $data_res;
}
} else { // Simply pass whole query
$result_data = $result;
}
return $result_data;
}
/**
* Function to modify query where
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
function wtpsw_query_where( $where = '' ) {
global $wpdb, $wtpsw_options, $wtpsw_view_by;
$current_date = current_time('timestamp');
$post_range = isset($wtpsw_options['post_range']) ? $wtpsw_options['post_range'] : '';
switch ($post_range) {
case 'daily':
$start_date = date( 'Y-m-d', $current_date );
$where_con = " AND DATE($wpdb->posts.post_date) = '{$start_date}' ";
break;
case 'last_day':
$start_date = date( 'Y-m-d', strtotime( '-1 days', $current_date ) );
$where_con = " AND DATE($wpdb->posts.post_date) = '{$start_date}' ";
break;
case 'last_week':
$start_date = date( 'Y-m-d', strtotime( '-7 days', $current_date ) );
$end_date = date( 'Y-m-d', $current_date );
$where_con = " AND DATE($wpdb->posts.post_date) > '{$start_date}' AND DATE($wpdb->posts.post_date) <= '{$end_date}'";
break;
case 'last_month':
$start_date = date( 'Y-m-d', strtotime( '-1 months', $current_date ) );
$end_date = date( 'Y-m-d', $current_date );
$where_con = " AND DATE($wpdb->posts.post_date) >= '{$start_date}' AND DATE($wpdb->posts.post_date) <= '{$end_date}'";
break;
default:
$where_con = '';
break;
}
// Append where condition
if( isset($where_con) ){
$where .= $where_con;
}
if(!empty($wtpsw_view_by) && $wtpsw_view_by == 'comment_count'){
$where .= " AND $wpdb->posts.comment_count > 0";
}
return $where;
}
}
$wtpsw_model = new Wtpsw_Model();

View File

@ -0,0 +1,54 @@
<?php
/**
* Public Class
*
* Handles the public side functionality of plugin
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
class Wtpsw_Public {
function __construct(){
// Ajax call to update post count
add_action( 'wp_ajax_wtpsw_post_view_count', array($this, 'wtpsw_post_view_count') );
add_action( 'wp_ajax_nopriv_wtpsw_post_view_count',array( $this, 'wtpsw_post_view_count') );
}
/**
* Function to update views of post
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
function wtpsw_post_view_count(){
$prefix = WTPSW_META_PREFIX;
$post_id = isset($_POST['post_id']) ? $_POST['post_id'] : '';
if( !empty($post_id) ) {
// Getting existing views
$views = get_post_meta( $post_id, $prefix.'views', true );
$views = !empty($views) ? $views : 0;
// Update new views
update_post_meta( $post_id, $prefix.'views', ($views+1) );
echo 'Success';
} else {
echo 'Error - Reference Id not found.';
}
die();
}
}
$wtpsw_public = new Wtpsw_Public();

View File

@ -0,0 +1,180 @@
<?php
/**
* Script Class
*
* Handles the script and style functionality of plugin
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
class Wtpsw_Script {
function __construct() {
// Action to add script at admin side
add_action( 'admin_enqueue_scripts', array($this, 'wtpsw_admin_script') );
// Action to add style on frontend
add_action( 'wp_enqueue_scripts', array($this, 'wtpsw_front_end_style') );
// Action to add script on frontend
add_action( 'wp_enqueue_scripts', array($this, 'wtpsw_front_end_script'), 15 );
// Action to add admin script and style when edit with elementor at admin side
add_action( 'elementor/editor/after_enqueue_scripts', array( $this, 'wtpsw_admin_builder_script_style' ) );
// Action to add admin script and style when edit with SiteOrigin at admin side
add_action('siteorigin_panel_enqueue_admin_scripts', array( $this, 'wtpsw_admin_builder_script_style' ), 10, 2);
}
/**
* Function to register admin scripts and styles
*
* @package WP Trending Post Slider and Widget
* @since 1.5
*/
function wtpsw_register_admin_assets() {
/* Styles */
wp_register_style( 'wtpsw-admin-css', WTPSW_URL.'assets/css/wtpsw-admin.css', array(), WTPSW_VERSION );
/* Scripts */
wp_register_script( 'wtpsw-admin-script', WTPSW_URL.'assets/js/wtpsw-admin.js', array('jquery'), WTPSW_VERSION, true );
}
/**
* Function to add script at admin side
*
* @package WP Trending Post Slider and Widget
* @since 1.4
*/
function wtpsw_admin_script( $hook ) {
$this->wtpsw_register_admin_assets();
if( $hook == 'trending-post_page_wtpsw-help' ) {
wp_enqueue_script( 'wtpsw-admin-script' );
}
}
/**
* Enqueue front styles
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
function wtpsw_front_end_style() {
// Registring and enqueing slick slider css
if( ! wp_style_is( 'wpos-slick-style', 'registered' ) ) {
wp_register_style( 'wpos-slick-style', WTPSW_URL.'assets/css/slick.css', null, WTPSW_VERSION );
wp_enqueue_style('wpos-slick-style');
}
// Registring slider style
wp_register_style( 'wtpsw-public-style', WTPSW_URL.'assets/css/wtpsw-public.css', null, WTPSW_VERSION );
wp_enqueue_style('wtpsw-public-style');
}
/**
* Enqueue front script
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
function wtpsw_front_end_script() {
global $post;
// Taking post id to update post view count
$post_id = isset($post->ID) ? $post->ID : '';
$post_view_count = 0;
$supported_posts = wtpsw_get_option( 'post_types', array() ); // suppoterd post type
if( !empty($post_id) && !is_preview() && !empty($supported_posts) && is_singular($supported_posts) && !is_front_page() && !is_home() && !is_feed() && !is_robots() ) {
$post_view_count = $post_id;
}
// Registring slider script
if( !wp_script_is( 'wpos-slick-jquery', 'registered' ) ) {
wp_register_script( 'wpos-slick-jquery', WTPSW_URL.'assets/js/slick.min.js', array('jquery'), WTPSW_VERSION, true );
}
// Register Elementor script
wp_register_script( 'wtpsw-elementor-js', WTPSW_URL.'assets/js/elementor/wtpsw-elementor.js', array('jquery'), WTPSW_VERSION, true );
// Registering Public Script (Slider Script)
wp_register_script( 'wtpsw-public-script', WTPSW_URL.'assets/js/wtpsw-public.js', array('jquery'), WTPSW_VERSION, true );
wp_localize_script( 'wtpsw-public-script', 'Wtpsw', array(
'ajaxurl' => admin_url( 'admin-ajax.php', ( is_ssl() ? 'https' : 'http' ) ),
'is_mobile' => (wp_is_mobile()) ? 1 : 0,
'is_rtl' => (is_rtl()) ? 1 : 0,
'post_view_count' => $post_view_count,
));
wp_enqueue_script( 'wtpsw-public-script' );
// Enqueue Script for Elementor Preview
if ( defined('ELEMENTOR_PLUGIN_BASE') && isset( $_GET['elementor-preview'] ) && $post->ID == (int) $_GET['elementor-preview'] ) {
// Dequeue public script
wp_dequeue_script( 'wtpsw-public-script' );
wp_enqueue_script( 'wpos-slick-jquery' );
wp_enqueue_script( 'wtpsw-public-script' );
wp_enqueue_script( 'wtpsw-elementor-js' );
}
// Enqueue Style & Script for Beaver Builder
if ( class_exists( 'FLBuilderModel' ) && FLBuilderModel::is_builder_active() ) {
$this->wtpsw_register_admin_assets();
// Dequeue admin style
wp_enqueue_style( 'wtpsw-admin-css');
wp_enqueue_script( 'wtpsw-admin-script' );
// Dequeue public script
wp_dequeue_script( 'wtpsw-public-script' );
wp_enqueue_script( 'wpos-slick-jquery' );
wp_enqueue_script( 'wtpsw-public-script' );
}
// Enqueue Admin Style & Script for Divi Page Builder
if( function_exists( 'et_core_is_fb_enabled' ) && isset( $_GET['et_fb'] ) && $_GET['et_fb'] == 1 ) {
$this->wtpsw_register_admin_assets();
wp_enqueue_style( 'wtpsw-admin-css');
}
// Enqueue Admin Style for Fusion Page Builder
if( class_exists( 'FusionBuilder' ) && (( isset( $_GET['builder'] ) && $_GET['builder'] == 'true' ) ) ) {
$this->wtpsw_register_admin_assets();
wp_enqueue_style( 'wtpsw-admin-css');
}
}
/**
* Function to add script at admin side
*
* @package WP Trending Post Slider and Widget
* @since 1.5
*/
function wtpsw_admin_builder_script_style() {
$this->wtpsw_register_admin_assets();
wp_enqueue_style( 'wtpsw-admin-css');
wp_enqueue_script( 'wtpsw-admin-script' );
}
}
$wtpsw_script = new Wtpsw_Script();

View File

@ -0,0 +1,157 @@
<?php
/**
* 'wtpsw_carousel' Shortcode
*
* @package WP Trending Post Slider and Widget
* @since 1.5
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/**
* Handles Popuplar Post Gridbox
*
* @package WP Trending Post Slider and Widget
* @since 1.5
*/
function wtpsw_popular_post_carousel( $atts, $content = null ) {
// SiteOrigin Page Builder Gutenberg Block Tweak - Do not Display Preview
if( isset( $_POST['action'] ) && ( $_POST['action'] == 'so_panels_layout_block_preview' || $_POST['action'] == 'so_panels_builder_content_json' ) ) {
return '[wtpsw_carousel]';
}
// Divi Frontend Builder - Do not Display Preview
if( function_exists( 'et_core_is_fb_enabled' ) && isset( $_POST['is_fb_preview'] ) && isset( $_POST['shortcode'] ) ) {
return '<div class="wtpsw-builder-shrt-prev">
<div class="wtpsw-builder-shrt-title"><span>'.esc_html__('Trending Post Slider - Shortcode', 'wtpsw').'</span></div>
wtpsw_carousel
</div>';
}
// Fusion Builder Live Editor - Do not Display Preview
if( class_exists( 'FusionBuilder' ) && (( isset( $_GET['builder'] ) && $_GET['builder'] == 'true' ) || ( isset( $_POST['action'] ) && $_POST['action'] == 'get_shortcode_render' )) ) {
return '<div class="wtpsw-builder-shrt-prev">
<div class="wtpsw-builder-shrt-title"><span>'.esc_html__('Trending Post slider - Shortcode', 'wtpsw').'</span></div>
wtpsw_carousel
</div>';
}
global $wtpsw_options, $wtpsw_model, $wtpsw_view_by, $post;
// Enqueue required script
wp_enqueue_script('wpos-slick-jquery');
// Shortcode attributes
extract( shortcode_atts( array(
'limit' => 10,
'post_type' => 'post',
'view_by' => 'views',
'order' => 'DESC',
'design' => 'design-1',
'showdate' => 'true',
'showauthor' => 'true',
'showcontent' => 'false',
'words_limit' => 40,
'slides_to_show' => 3,
'slides_to_scroll' => 1,
'dots' => 'true',
'arrows' => 'true',
'speed' => 300,
'autoplay' => 'true',
'autoplayinterval' => 3000,
'show_comment_count' => 'true',
'hide_empty_comment_count' => 'false',
'className' => '',
'align' => '',
'extra_class' => '',
), $atts, 'wtpsw_carousel' ) );
$prefix = WTPSW_META_PREFIX;
$supported_post_types = wtpsw_get_option( 'post_types', array() );
$unique = wtpsw_get_unique();
$limit = ( ! empty( $limit ) && is_numeric( $limit ) ) ? $limit : 10;
$post_type = ( ! empty( $post_type ) && in_array( $post_type, $supported_post_types ) ) ? $post_type : '';
$view_by = ! empty( $view_by ) ? $view_by : 'views';
$order = ( strtolower($order ) == 'asc' ) ? 'ASC' : 'DESC';
$slides_to_show = ! empty( $slides_to_show ) ? $slides_to_show : 3;
$slides_to_scroll = ! empty( $slides_to_scroll ) ? $slides_to_scroll : 1;
$speed = ! empty( $speed ) ? $speed : 300;
$autoplayinterval = ! empty( $autoplayinterval ) ? $autoplayinterval : 3000;
$hide_empty_comment_count = ( $hide_empty_comment_count == 'true' ) ? true : false;
$align = ! empty( $align ) ? 'align'.$align : '';
$extra_class = $extra_class .' '. $align .' '. $className;
$extra_class = wtpsw_sanitize_html_classes( $extra_class );
// If no valid post type is found
if(empty($post_type) ) {
return $content;
}
// Slider configuration
$slider_conf = compact('dots', 'arrows', 'autoplay', 'autoplayinterval', 'speed', 'slides_to_show', 'slides_to_scroll');
// Order By
if( $view_by == 'comment' ){
$orderby = 'comment_count';
} elseif ( $view_by == 'views' ) {
$orderby = 'meta_value_num';
}
$wtpsw_view_by = $orderby; // Assign to global variable for query filter
$post_args = array(
'post_type' => $post_type,
'posts_per_page' => $limit,
'order' => $order,
'orderby' => $orderby
);
if( $view_by == 'views' ) {
$post_args['meta_key'] = $prefix.'views';
}
// Wrps class variables
$main_wrap = "wtpsw-post-carousel-{$unique}";
$main_wrap .= " {$design}";
$main_wrap .= " {$extra_class}";
// Filter to change query where condition
add_filter( 'posts_where', array( $wtpsw_model, 'wtpsw_query_where' ) );
// Query to get post
$wtpsw_posts = $wtpsw_model->wtpsw_get_posts( $post_args );
// Remove Filter for change query where condition
remove_filter( 'posts_where', array( $wtpsw_model, 'wtpsw_query_where' ) );
ob_start();
if( $wtpsw_posts->have_posts() ) : ?>
<div id="wtpsw-carousel-<?php echo $unique; ?>" class="wtpsw-post-carousel <?php echo $main_wrap; ?>" data-conf="<?php echo htmlspecialchars(json_encode($slider_conf)); ?>">
<?php while ($wtpsw_posts->have_posts()) : $wtpsw_posts->the_post();
global $post;
$wtpsw_post_stats = array();
$post_id = isset($post->ID) ? $post->ID : '';
$comment_text = wtpsw_get_comments_number( $post->ID, $hide_empty_comment_count );
// Design file
include( WTPSW_DIR . '/templates/carousel/design-1.php' );
endwhile; ?>
</div>
<?php
endif;
wp_reset_postdata(); // Reset WP Query
$content .= ob_get_clean();
return $content;
}
// Trending popular post carousel shortcode
add_shortcode( 'wtpsw_carousel', 'wtpsw_popular_post_carousel' );

View File

@ -0,0 +1,145 @@
<?php
/**
* 'wtpsw_gridbox' Shortcode
*
* @package WP Trending Post Slider and Widget
* @since 1.5
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/**
* Handles Popuplar Post Gridbox
*
* @package WP Trending Post Slider and Widget
* @since 1.5
*/
function wtpsw_trending_post_gridbox( $atts, $content = null ) {
// SiteOrigin Page Builder Gutenberg Block Tweak - Do not Display Preview
if( isset( $_POST['action'] ) && ( $_POST['action'] == 'so_panels_layout_block_preview' || $_POST['action'] == 'so_panels_builder_content_json' ) ) {
return '[wtpsw_gridbox]';
}
// Divi Frontend Builder - Do not Display Preview
if( function_exists( 'et_core_is_fb_enabled' ) && isset( $_POST['is_fb_preview'] ) && isset( $_POST['shortcode'] ) ) {
return '<div class="wtpsw-builder-shrt-prev">
<div class="wtpsw-builder-shrt-title"><span>'.esc_html__('Trending Post Slider - Shortcode', 'wtpsw').'</span></div>
wtpsw_gridbox
</div>';
}
// Fusion Builder Live Editor - Do not Display Preview
if( class_exists( 'FusionBuilder' ) && (( isset( $_GET['builder'] ) && $_GET['builder'] == 'true' ) || ( isset( $_POST['action'] ) && $_POST['action'] == 'get_shortcode_render' )) ) {
return '<div class="wtpsw-builder-shrt-prev">
<div class="wtpsw-builder-shrt-title"><span>'.esc_html__('Trending Post slider - Shortcode', 'wtpsw').'</span></div>
wtpsw_gridbox
</div>';
}
global $wtpsw_options, $wtpsw_model, $wtpsw_view_by, $post;
// Enqueue required script
wp_enqueue_script('wpos-slick-jquery');
// Shortcode attributes
extract( shortcode_atts( array(
'limit' => 5,
'post_type' => 'post',
'view_by' => 'views',
'order' => 'DESC',
'design' => 'design-1',
'showdate' => 'true',
'showauthor' => 'true',
'showcontent' => 'false',
'words_limit' => 40,
'show_comment_count' => 'true',
'hide_empty_comment_count' => 'false',
'className' => '',
'align' => '',
'extra_class' => '',
), $atts, 'wtpsw_gridbox' ) );
$prefix = WTPSW_META_PREFIX;
$supported_post_types = wtpsw_get_option( 'post_types', array() );
$post_type = ( ! empty( $post_type ) && in_array( $post_type, $supported_post_types ) ) ? $post_type : '';
$limit = ( ! empty( $limit ) && is_numeric( $limit ) ) ? $limit : 10;
$view_by = ! empty( $view_by ) ? $view_by : 'views';
$order = ( strtolower($order ) == 'asc' ) ? 'ASC' : 'DESC';
$hide_empty_comment_count = ( $hide_empty_comment_count == 'true' ) ? true : false;
$align = ! empty( $align ) ? 'align'.$align : '';
$extra_class = $extra_class .' '. $align .' '. $className;
$extra_class = wtpsw_sanitize_html_classes( $extra_class );
// If no valid post type is found
if( empty($post_type) ) {
return $content;
}
// Count variables
$wtpsw_count = 1;
// Order By
if( $view_by == 'comment' ) {
$orderby = 'comment_count';
} elseif ( $view_by == 'views' ) {
$orderby = 'meta_value_num';
}
$wtpsw_view_by = $orderby; // Assign to global variable for query filter
$post_args = array(
'post_type' => $post_type,
'posts_per_page' => $limit,
'order' => $order,
'orderby' => $orderby
);
if( $view_by == 'views' ) {
$post_args['meta_key'] = $prefix.'views';
}
// Wrps class variables
$main_wrap = "{$design}";
$main_wrap .= " {$extra_class}";
// Filter to change query where condition
add_filter( 'posts_where', array( $wtpsw_model, 'wtpsw_query_where' ) );
// Query to get post
$wtpsw_posts = $wtpsw_model->wtpsw_get_posts( $post_args );
// Remove Filter for change query where condition
remove_filter( 'posts_where', array( $wtpsw_model, 'wtpsw_query_where' ) );
ob_start();
if( $wtpsw_posts->have_posts() ) : ?>
<div class="wtpsw-post-grid <?php echo $main_wrap; ?> wtpsw-clearfix">
<?php while ($wtpsw_posts->have_posts()) : $wtpsw_posts->the_post();
global $post;
$wtpsw_post_stats = array();
$post_id = isset($post->ID) ? $post->ID : '';
$comment_text = wtpsw_get_comments_number( $post->ID, $hide_empty_comment_count );
// Design file
include( WTPSW_DIR . '/templates/grid-box/design-1.php' );
$wtpsw_count++;
endwhile; ?>
</div>
<?php
endif;
wp_reset_postdata();
$content .= ob_get_clean();
return $content;
}
// Trending popular post gridbox shortcode
add_shortcode( 'wtpsw_gridbox', 'wtpsw_trending_post_gridbox' );

View File

@ -0,0 +1,153 @@
<?php
/**
* 'wtpsw_popular_post' Shortcode
*
* @package WP Trending Post Slider and Widget
* @since 1.5
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/**
* Handles Popuplar Post Gridbox
*
* @package WP Trending Post Slider and Widget
* @since 1.5
*/
function wtpsw_trending_post_slider( $atts, $content = null ) {
// SiteOrigin Page Builder Gutenberg Block Tweak - Do not Display Preview
if( isset( $_POST['action'] ) && ( $_POST['action'] == 'so_panels_layout_block_preview' || $_POST['action'] == 'so_panels_builder_content_json' ) ) {
return '[wtpsw_popular_post]';
}
// Divi Frontend Builder - Do not Display Preview
if( function_exists( 'et_core_is_fb_enabled' ) && isset( $_POST['is_fb_preview'] ) && isset( $_POST['shortcode'] ) ) {
return '<div class="wtpsw-builder-shrt-prev">
<div class="wtpsw-builder-shrt-title"><span>'.esc_html__('Trending Post Slider - Shortcode', 'wtpsw').'</span></div>
wtpsw_popular_post
</div>';
}
// Fusion Builder Live Editor - Do not Display Preview
if( class_exists( 'FusionBuilder' ) && (( isset( $_GET['builder'] ) && $_GET['builder'] == 'true' ) || ( isset( $_POST['action'] ) && $_POST['action'] == 'get_shortcode_render' )) ) {
return '<div class="wtpsw-builder-shrt-prev">
<div class="wtpsw-builder-shrt-title"><span>'.esc_html__('Trending Post slider - Shortcode', 'wtpsw').'</span></div>
wtpsw_popular_post
</div>';
}
global $wtpsw_options, $wtpsw_model, $wtpsw_view_by, $post;
// Enqueue required script
wp_enqueue_script('wpos-slick-jquery');
// Shortcode attributes
extract( shortcode_atts( array(
'limit' => 10,
'post_type' => 'post',
'view_by' => 'views',
'order' => 'DESC',
'design' => 'design-1',
'showdate' => 'true',
'showauthor' => 'true',
'showcontent' => 'true',
'words_limit' => 40,
'dots' => 'true',
'arrows' => 'true',
'speed' => 300,
'autoplay' => 'true',
'autoplayinterval' => 3000,
'show_comment_count' => 'true',
'hide_empty_comment_count' => 'false',
'className' => '',
'align' => '',
'extra_class' => '',
), $atts, 'wtpsw_popular_post' ) );
$prefix = WTPSW_META_PREFIX;
$unique = wtpsw_get_unique();
$supported_post_types = wtpsw_get_option( 'post_types', array() );
$post_type = ( ! empty( $post_type ) && in_array( $post_type, $supported_post_types ) ) ? $post_type : '';
$limit = ( ! empty( $limit ) && is_numeric( $limit ) ) ? $limit : 10;
$view_by = ! empty( $view_by ) ? $view_by : 'views';
$speed = ! empty( $speed ) ? $speed : 300;
$autoplayinterval = ! empty( $autoplayinterval ) ? $autoplayinterval : 3000;
$order = ( strtolower($order ) == 'asc' ) ? 'ASC' : 'DESC';
$hide_empty_comment_count = ( $hide_empty_comment_count == 'true' ) ? true : false;
$align = ! empty( $align ) ? 'align'.$align : '';
$extra_class = $extra_class .' '. $align .' '. $className;
$extra_class = wtpsw_sanitize_html_classes( $extra_class );
// Return if no valid post type
if( empty( $post_type ) ) {
return $content;
}
// Slider configuration
$slider_conf = compact('dots', 'arrows', 'autoplay', 'autoplayinterval', 'speed');
// Order By
if( $view_by == 'comment' ) {
$orderby = 'comment_count';
} elseif ( $view_by == 'views' ) {
$orderby = 'meta_value_num';
}
$wtpsw_view_by = $orderby; // Assign to global variable for query filter
$post_args = array(
'post_type' => $post_type,
'posts_per_page' => $limit,
'order' => $order,
'orderby' => $orderby
);
if( $view_by == 'views' ) {
$post_args['meta_key'] = $prefix.'views';
}
// Wrps class variables
$main_wrap = "wtpsw-post-slider-{$unique}";
$main_wrap .= " {$design}";
$main_wrap .= " {$extra_class}";
// Filter to change query where condition
add_filter( 'posts_where', array( $wtpsw_model, 'wtpsw_query_where' ) );
// Query to get post
$wtpsw_posts = $wtpsw_model->wtpsw_get_posts( $post_args );
// Remove Filter for change query where condition
remove_filter( 'posts_where', array( $wtpsw_model, 'wtpsw_query_where' ) );
ob_start();
if( $wtpsw_posts->have_posts() ) : ?>
<div id="wtpsw-slider-<?php echo $unique; ?>" class="wtpsw-post-slider <?php echo $main_wrap; ?>" data-conf="<?php echo htmlspecialchars(json_encode($slider_conf)); ?>">
<?php while ($wtpsw_posts->have_posts()) : $wtpsw_posts->the_post();
global $post;
$wtpsw_post_stats = array();
$post_id = isset($post->ID) ? $post->ID : '';
$comment_text = wtpsw_get_comments_number( $post->ID, $hide_empty_comment_count );
// Design file
include( WTPSW_DIR . "/templates/slider/design-1.php" );
endwhile; ?>
</div>
<?php
endif;
wp_reset_postdata(); // Reset WP Query
$content .= ob_get_clean();
return $content;
}
// Trending popular post Slider shortcode
add_shortcode( 'wtpsw_popular_post', 'wtpsw_trending_post_slider' );

View File

@ -0,0 +1,293 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
add_action( 'widgets_init', 'wtpsw_post_list_widget' );
/**
* Register trending post vertical slider widget
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
function wtpsw_post_list_widget() {
register_widget( 'Wtpsw_Post_List_Widget' );
}
/**
* Vertical Scrolling Post Widget Class
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
if ( ! defined( 'ABSPATH' )) exit;
class Wtpsw_Post_List_Widget extends WP_Widget {
var $model, $defaults;
function __construct() {
global $wtpsw_model;
$this->model = $wtpsw_model;
// Widget settings
$widget_ops = array( 'classname' => 'wtpsw_post_list_widget', 'description' => __( 'Display most popular trending post on your blog.', 'wtpsw' ) );
// Create the widget
parent::__construct( 'wtpsw-post-list-widget', __( 'WPOS - Trending Posts', 'wtpsw' ), $widget_ops );
$this->defaults = array(
'title' => __( 'Trending Posts', 'wtpsw' ),
'limit' => 5,
'post_type' => 'post',
'show_content' => 0,
'show_thumb' => 1,
'show_author' => 1,
'show_date' => 1,
'order' => 'DESC',
'view_by' => 'views',
'content_length' => 20,
'show_comment_count' => 1,
'hide_empty_comment_count' => 0,
);
}
/**
* Updates the widget control options
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
function update( $new_instance, $old_instance ) {
$instance = $old_instance;
// Input fields
$instance['post_type'] = $new_instance['post_type'];
$instance['view_by'] = $new_instance['view_by'];
$instance['title'] = strip_tags( $new_instance['title'] );
$instance['limit'] = ( empty($new_instance['limit'] ) || ( $new_instance['limit'] < -1 ) ) ? 5 : $new_instance['limit'];
$instance['order'] = ( isset( $new_instance['order'] ) && $new_instance['order'] == 'ASC' ) ? 'ASC' : 'DESC';
$instance['content_length'] = ! empty( $new_instance['content_length'] ) ? $new_instance['content_length'] : 20;
$instance['show_author'] = ! empty( $new_instance['show_author'] ) ? 1 : 0;
$instance['show_comment_count'] = ! empty( $new_instance['show_comment_count'] ) ? 1 : 0;
$instance['show_content'] = ! empty( $new_instance['show_content'] ) ? 1 : 0;
$instance['show_thumb'] = ! empty( $new_instance['show_thumb'] ) ? 1 : 0;
$instance['show_date'] = ! empty( $new_instance['show_date'] ) ? 1 : 0;
$instance['hide_empty_comment_count'] = ! empty( $new_instance['hide_empty_comment_count'] ) ? 1 : 0;
return $instance;
}
/**
* Displays the widget form in widget area
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
function form( $instance ) {
$instance = wp_parse_args( (array) $instance, $this->defaults );
$post_types = wtpsw_get_post_types();
$support_post_types = wtpsw_get_option( 'post_types', array() );
$sel_post_type = ( ! empty( $instance['post_type'] ) && in_array( $instance['post_type'], $support_post_types ) ) ? $instance['post_type'] : '';
?>
<div class="wtpsw-widget-wrap">
<!-- Title Field -->
<p>
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title', 'wtpsw'); ?>:</label>
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $instance['title']; ?>" />
</p>
<!-- Post type -->
<p>
<label for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e( 'Post Type', 'wtpsw' ); ?>:</label>
<select class="widefat ftpp-reg-post-types" id="<?php echo $this->get_field_id('post_type'); ?>" name="<?php echo $this->get_field_name('post_type'); ?>" >
<option value="" selected ><?php _e( 'Select Post Type', 'wtpsw'); ?></option>
<?php
if( !empty($post_types) ) {
foreach ($post_types as $post_key => $post_value) {
if(in_array($post_key, $support_post_types)) {
echo '<option value="'.$post_key.'" '.selected($post_key, $instance['post_type']).'>'.$post_value.'</option>';
}
}
}
?>
</select>
</p>
<!-- View By Field -->
<p>
<label for="<?php echo $this->get_field_id( 'view_by' ); ?>"><?php _e( 'Post List By', 'wtpsw'); ?>:</label>
<select class="widefat" id="<?php echo $this->get_field_id( 'view_by' ); ?>" name="<?php echo $this->get_field_name( 'view_by' ); ?>">
<option value="views" <?php selected( $instance['view_by'], 'views' ); ?> ><?php _e('Total Views', 'wtpsw') ?></option>
<option value="comment" <?php selected( $instance['view_by'], 'comment' ); ?>><?php _e('Comments Count', 'wtpsw'); ?></option>
</select>
</p>
<!-- Number of Items Field -->
<p>
<label for="<?php echo $this->get_field_id( 'limit' ); ?>"><?php _e( 'Number of Items', 'wtpsw'); ?>:</label>
<input class="widefat" min="-1" id="<?php echo $this->get_field_id( 'limit' ); ?>" name="<?php echo $this->get_field_name( 'limit' ); ?>" type="number" value="<?php echo $instance['limit']; ?>" />
</p>
<!-- Order Field -->
<p>
<label for="<?php echo $this->get_field_id( 'order' ); ?>"><?php _e( 'Order', 'wtpsw'); ?>:</label>
<select class="widefat" id="<?php echo $this->get_field_id( 'order' ); ?>" name="<?php echo $this->get_field_name( 'order' ); ?>">
<option value="ASC" <?php selected( $instance['order'], 'ASC' ); ?> ><?php _e('ASC', 'wtpsw') ?></option>
<option value="DESC" <?php selected( $instance['order'], 'DESC' ); ?>><?php _e('DESC', 'wtpsw'); ?></option>
</select>
</p>
<!-- Show Content Field -->
<p>
<input type="checkbox" value="1" id="<?php echo $this->get_field_id( 'show_content' ); ?>" name="<?php echo $this->get_field_name( 'show_content' ); ?>" <?php checked( $instance['show_content'], 1 ); ?> />
<label for="<?php echo $this->get_field_id( 'show_content' ); ?>"><?php _e( 'Display Short Content', 'wtpsw' ); ?></label><br/>
<span class="description"><em><?php _e('If your post has excerpt then it will take it else post content will be taken.', 'wtpsw'); ?></em></span>
</p>
<!-- Show Post Content Word Limit -->
<p>
<label for="<?php echo $this->get_field_id( 'content_length' ); ?>"><?php _e( 'Post Content Length', 'wtpsw'); ?>:</label>
<input class="widefat" id="<?php echo $this->get_field_id( 'content_length' ); ?>" name="<?php echo $this->get_field_name( 'content_length' ); ?>" type="number" min="1" value="<?php echo $instance['content_length']; ?>" />
<span class="description"><em><?php _e('Enter number of words to display in post content.', 'wtpsw'); ?></em></span>
</p>
<!-- Show Thumbnail Field -->
<p>
<input type="checkbox" value="1" id="<?php echo $this->get_field_id( 'show_thumb' ); ?>" name="<?php echo $this->get_field_name( 'show_thumb' ); ?>" <?php checked( $instance['show_thumb'], 1 ); ?> />
<label for="<?php echo $this->get_field_id( 'show_thumb' ); ?>"><?php _e( 'Show Thumbnail', 'wtpsw'); ?></label>
</p>
<!-- Show Author Field -->
<p>
<input type="checkbox" value="1" id="<?php echo $this->get_field_id( 'show_author' ); ?>" name="<?php echo $this->get_field_name( 'show_author' ); ?>" <?php checked( $instance['show_author'], 1 ); ?> />
<label for="<?php echo $this->get_field_id( 'show_author' ); ?>"><?php _e( 'Show Author', 'wtpsw'); ?></label>
</p>
<!-- Show Date Field -->
<p>
<input type="checkbox" value="1" id="<?php echo $this->get_field_id( 'show_date' ); ?>" name="<?php echo $this->get_field_name( 'show_date' ); ?>" <?php checked( $instance['show_date'], 1 ); ?> />
<label for="<?php echo $this->get_field_id( 'show_date' ); ?>"><?php _e( 'Show Date', 'wtpsw'); ?></label>
</p>
<!-- Show Comment Field -->
<p>
<input type="checkbox" value="1" id="<?php echo $this->get_field_id( 'show_comment_count' ); ?>" name="<?php echo $this->get_field_name( 'show_comment_count' ); ?>" <?php checked( $instance['show_comment_count'], 1 ); ?> />
<label for="<?php echo $this->get_field_id( 'show_comment_count' ); ?>"><?php _e( 'Show Comment Count', 'wtpsw'); ?></label>
</p>
<!-- Show Comment Field -->
<p>
<input type="checkbox" value="1" id="<?php echo $this->get_field_id( 'hide_empty_comment_count' ); ?>" name="<?php echo $this->get_field_name( 'hide_empty_comment_count' ); ?>" <?php checked( $instance['hide_empty_comment_count'], 1 ); ?> />
<label for="<?php echo $this->get_field_id( 'hide_empty_comment_count' ); ?>"><?php _e( 'Hide Empty Comment Count', 'wtpsw'); ?></label><br/>
<span class="description"><em><?php _e('Hide comment count if it is empty.', 'wtpsw'); ?></em></span>
</p>
</div>
<?php
}
/**
* Outputs the content of the widget
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
function widget( $args, $instance ) {
// SiteOrigin Page Builder Gutenberg Block Tweak - Do not Display Preview
if( isset( $_POST['action'] ) && ( $_POST['action'] == 'so_panels_layout_block_preview' || $_POST['action'] == 'so_panels_builder_content_json' ) ) {
echo "<div class='wtpsw-builder-shrt-prev'><div class='wtpsw-builder-shrt-title'><span>".esc_html__('Trending Post List - Widget', 'wtpsw')."</span></div>WPOS - Trending Post List</div>";
return;
}
global $wtpsw_options, $wtpsw_view_by;
$instance = wp_parse_args( (array) $instance, $this->defaults );
extract( $args );
$prefix = WTPSW_META_PREFIX;
$support_post_types = wtpsw_get_option('post_types', array());
$title = $instance['title'];
$limit = $instance['limit'];
$order = $instance['order'];
$view_by = $instance['view_by'];
$content_length = $instance['content_length'];
$post_type = ( ! empty( $instance['post_type'] ) && in_array( $instance['post_type'], $support_post_types ) ) ? $instance['post_type'] : '';
$post_type = ( ! empty( $instance['post_type'] ) && in_array( $instance['post_type'], $support_post_types ) ) ? $instance['post_type'] : '';
$show_date = ! empty( $instance['show_date'] ) ? true : false;
$show_author = ! empty( $instance['show_author'] ) ? true : false;
$show_comment_count = ! empty( $instance['show_comment_count'] ) ? true : false;
$show_thumb = ! empty( $instance['show_thumb'] ) ? true : false;
$show_content = ! empty( $instance['show_content'] ) ? true : false;
$hide_empty_comment_count = ! empty( $instance['hide_empty_comment_count'] ) ? true : false;
// If no valid post type is found
if( empty( $post_type ) ) {
return;
}
// Order By
if( $view_by == 'comment' ) {
$orderby = 'comment_count';
} elseif ( $view_by == 'views' ) {
$orderby = 'meta_value_num';
}
$wtpsw_view_by = $orderby; // Assign to global variable for query filter
$post_args = array(
'post_type' => $post_type,
'posts_per_page' => $limit,
'order' => $order,
'orderby' => $orderby
);
if( $view_by == 'views' ) {
$post_args['meta_key'] = $prefix.'views';
}
// Filter to change query where condition
add_filter( 'posts_where', array($this->model, 'wtpsw_query_where') );
// Query to get post
$wtpsw_posts = $this->model->wtpsw_get_posts( $post_args );
// Remove Filter for change query where condition
remove_filter( 'posts_where', array($this->model, 'wtpsw_query_where') );
echo $before_widget;
if ( $title ) {
echo $before_title . $title . $after_title;
}
if( $wtpsw_posts->have_posts() ) : ?>
<div class="wtpsw-post-items">
<ul>
<?php while ($wtpsw_posts->have_posts()) : $wtpsw_posts->the_post();
global $post;
$wtpsw_stats = array(); // Need to flush
$comment_text = wtpsw_get_comments_number( $post->ID, $hide_empty_comment_count );
// Design file
include( WTPSW_DIR . '/templates/wtpsw-post-lists.php' );
endwhile; ?>
</ul>
</div>
<?php
endif;
wp_reset_postdata(); // Reset WP Query
echo $after_widget;
}
}

View File

@ -0,0 +1,210 @@
<?php
/**
* Functions File
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/**
* Update default settings
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
function wtpsw_default_settings(){
global $wtpsw_options;
$wtpsw_options = array(
'post_range' => '',
'post_types' => array( 'post' ),
);
$default_options = apply_filters('wtpsw_options_default_values', $wtpsw_options );
// Update default options
update_option( 'wtpsw_options', $default_options );
// Overwrite global variable when option is update
$wtpsw_options = wtpsw_get_settings();
}
/**
* Get Settings From Option Page
*
* Handles to return all settings value
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
function wtpsw_get_settings() {
$options = get_option('wtpsw_options');
$settings = is_array($options) ? $options : array();
return $settings;
}
/**
* Get an option
* Looks to see if the specified setting exists, returns default if not
*
* @package WP Trending Post Slider and Widget
* @since 1.0
*/
function wtpsw_get_option( $key = '', $default = false ) {
global $wtpsw_options;
$value = ! empty( $wtpsw_options[ $key ] ) ? $wtpsw_options[ $key ] : $default;
$value = apply_filters( 'wtpsw_get_option', $value, $key, $default );
return apply_filters( 'wtpsw_get_option_' . $key, $value, $key, $default );
}
/**
* Sanitize Multiple HTML class
*
* @package WP Trending Post Slider and Widget
* @since 1.5
*/
function wtpsw_sanitize_html_classes($classes, $sep = " ") {
$return = "";
if( ! is_array( $classes ) ) {
$classes = explode($sep, $classes);
}
if( ! empty( $classes ) ) {
foreach($classes as $class){
$return .= sanitize_html_class($class) . " ";
}
$return = trim( $return );
}
return $return;
}
/**
* Convert Object To Array
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
function wtpsw_object_to_array($result) {
$array = array();
foreach ($result as $key=>$value) {
if (is_object($value)) {
$array[$key] = wtpsw_object_to_array($value);
} else {
$array[$key] = $value;
}
}
return $array;
}
/**
* Function to unique number value
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
function wtpsw_get_unique() {
static $unique = 0;
$unique++;
// For Elementor & Beaver Builder
if( ( defined('ELEMENTOR_PLUGIN_BASE') && isset( $_POST['action'] ) && $_POST['action'] == 'elementor_ajax' )
|| ( class_exists('FLBuilderModel') && ! empty( $_POST['fl_builder_data']['action'] ) )
|| ( function_exists('vc_is_inline') && vc_is_inline() ) ) {
$unique = current_time('timestamp') . '-' . rand();
}
return $unique;
}
/**
* Function to get post excerpt
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
function wtpsw_get_post_excerpt( $post_id = null, $content = '', $word_length = '55', $more = '...' ) {
$word_length = !empty($word_length) ? $word_length : '55';
// If post id is passed
if( !empty($post_id) ) {
if (has_excerpt($post_id)) {
$content = get_the_excerpt();
} else {
$content = !empty($content) ? $content : get_the_content();
}
}
if( !empty($content) ) {
$content = strip_shortcodes( $content ); // Strip shortcodes
$content = wp_trim_words( $content, $word_length, $more );
}
return $content;
}
/**
* Function to get registered post types
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
function wtpsw_get_post_types( $args = array() ) {
// Taking defaults
$all_post_types = array();
$post_types = array();
$args = array(
'public' => !empty($args['public']) ? $args['public'] : 'true'
);
$all_post_types = get_post_types( $args, 'object' );
$exclude_post = array('attachment');
foreach ($all_post_types as $post_type_key => $post_data) {
if( !in_array( $post_type_key, $exclude_post) ) {
$post_types[$post_type_key] = !empty($post_data->label) ? $post_data->label : $post_type_key;
}
}
return apply_filters('wtpsw_get_post_types', $post_types );
}
/**
* Function to get comment count text
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
function wtpsw_get_comments_number( $post_id = '', $hide_empty = false ) {
$comment_text = '';
if( !empty($post_id) ) {
$comment_number = get_comments_number( $post_id );
if ( $comment_number == 0 && empty($hide_empty) ) {
$comment_text = __('0 Comments', 'wtpsw');
} elseif ( $comment_number > 1 ) {
$comment_text = $comment_number . __(' Comments', 'wtpsw');
} elseif ( $comment_number == 1 ) {
$comment_text = __('1 Comment', 'wtpsw');
}
}
return $comment_text;
}

View File

@ -0,0 +1 @@
{"domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural_forms":"nplurals=2; plural=n != 1;","lang":"en_US"},"https://github.com/ahmadawais/create-guten-block/":[null,""],"https://www.essentialplugin.com/":[null,""],"Trending/Popular Post Slider and Widget - Gutenberg":[null,""],"Trending/Popular Post Slider and Widget Gutenberg.":[null,""],"WP OnlineSupport":[null,""],"WPOS Blocks":[null,""]}}}

View File

@ -0,0 +1,339 @@
msgid ""
msgstr ""
"Project-Id-Version: Trending/Popular Post Slider and Widget\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-18 06:09+0000\n"
"PO-Revision-Date: 2021-08-20 05:55+0000\n"
"Last-Translator: \n"
"Language-Team: English (United States)\n"
"Language: en_US\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Loco https://localise.biz/\n"
"X-Loco-Version: 2.5.0; wp-5.6.1\n"
"X-Domain: wtpsw"
#: includes/wtpsw-functions.php:203
msgid " Comments"
msgstr ""
#: includes/wtpsw-functions.php:201
msgid "0 Comments"
msgstr ""
#: includes/wtpsw-functions.php:205
msgid "1 Comment"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:85
msgid "5 stars!"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:52
msgid "All Shortcodes"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:55
msgid "All Time"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:144
msgid "ASC"
msgstr ""
#: templates/carousel/design-1.php:28 templates/grid-box/design-1.php:27
#: templates/slider/design-1.php:31
msgid "By"
msgstr ""
#: templates/wtpsw-post-lists.php:34
msgid "By "
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:72
msgid "Check plugin document for shortcode parameters and demo for designs."
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:130
msgid "Comments Count"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:74
msgid "Demo"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:145
msgid "DESC"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:38
msgid "Display most popular trending post on your blog."
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:152
msgid "Display Short Content"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:73
msgid "Documentation"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:85
msgid "Enjoyed this plugin? You can help by rate this plugin"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:160
msgid "Enter number of words to display in post content."
msgstr ""
#: includes/admin/form/wtpsw-settings.php:42
msgid "General Settings"
msgstr ""
#: includes/admin/class-wtpsw-admin.php:38
#: includes/admin/wtpsw-how-it-works.php:44
msgid "Getting Started"
msgstr ""
#: includes/admin/class-wtpsw-admin.php:38
msgid "Getting Started - WP Trending Post Slider and Widget"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:120
msgid "Go Premium "
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:81
msgid "Help to improve this plugin!"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:191
msgid "Hide comment count if it is empty."
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:190
msgid "Hide Empty Comment Count"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:15
msgid "How It Works"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:37
msgid "How It Works - Display and Shortcode"
msgstr ""
#. Author URI of the plugin
msgid "https://www.essentialplugin.com/"
msgstr ""
#. URI of the plugin
msgid ""
"https://www.essentialplugin.com/wordpress-plugin/trending-post-slider-widget/"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:153
msgid ""
"If your post has excerpt then it will take it else post content will be "
"taken."
msgstr ""
#: wp-trending-post-slider-widget.php:187
#, php-format
msgid ""
"It looks like you had PRO version %s of this plugin activated. To avoid "
"conflicts the extra version has been deactivated and we recommend you delete "
"it."
msgstr ""
#: includes/admin/form/wtpsw-settings.php:58
msgid "Last 7 Days"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:57
msgid "Last Day"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:59
msgid "Last Month"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:68
msgid "Need Support?"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:136
msgid "Number of Items"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:142
msgid "Order"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:158
msgid "Post Content Length"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:127
msgid "Post List By"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:110
#: includes/admin/form/wtpsw-settings.php:75
msgid "Post Type"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:51
msgid "Post Within"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:86
msgid "Save Changes"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:112
msgid "Select Post Type"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:80
msgid ""
"Select post type box for trending post. You can enter post type name in "
"shortcode parameter."
msgstr ""
#: includes/admin/form/wtpsw-settings.php:67
msgid "Select Post Types"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:61
msgid ""
"Select time range for post visibility. Note: The post published within this "
"time range will be visible."
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:172
msgid "Show Author"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:184
msgid "Show Comment Count"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:178
msgid "Show Date"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:166
msgid "Show Thumbnail"
msgstr ""
#. Description of the plugin
msgid ""
"Show Trending/Popular post in page and sidebar with slider/Grid block with "
"different designs. Also work with Gutenberg shortcode block."
msgstr ""
#: wp-trending-post-slider-widget.php:186
#, php-format
msgid "Thank you for activating %s"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:104
msgid "Title"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:56
msgid "Today"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:129
msgid "Total Views"
msgstr ""
#: includes/admin/class-wtpsw-admin.php:35
msgid "Trending Post"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:19
msgid "Trending Post - Settings"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:56
msgid "Trending Post Carousel View"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:47
msgid ""
"Trending Post display most visited post on your website. It works with "
"WordPress default post type."
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:57
msgid "Trending Post Gridbox View"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:208
msgid "Trending Post List - Widget"
msgstr ""
#: includes/shortcode/wtpsw-gridbox.php:29
#: includes/shortcode/wtpsw-slider.php:29
#: includes/shortcode/wtpsw-carousel.php:29
msgid "Trending Post Slider - Shortcode"
msgstr ""
#: includes/shortcode/wtpsw-gridbox.php:37
#: includes/shortcode/wtpsw-slider.php:37
#: includes/shortcode/wtpsw-carousel.php:37
msgid "Trending Post slider - Shortcode"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:55
msgid "Trending Post Slider View"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:44
msgid "Trending Posts"
msgstr ""
#. Name of the plugin
msgid "Trending/Popular Post Slider and Widget"
msgstr ""
#: includes/admin/class-wtpsw-admin.php:41
msgid "Upgrade to PRO"
msgstr ""
#: includes/admin/class-wtpsw-admin.php:41
msgid "Upgrade to PRO - Trending/Popular Post Slider and Widget"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:98
msgid "Upgrate to Pro"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:121
msgid "View PRO Demo "
msgstr ""
#. Author of the plugin
msgid "WP OnlineSupport"
msgstr ""
#: includes/admin/form/premium.php:15
msgid "WP Trending Post Slider and Widget - Features"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:41
msgid "WPOS - Trending Posts"
msgstr ""
#: includes/admin/supports/gutenberg-block.php:281
msgid "WPOS Blocks"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:24
msgid "Your changes saved successfully."
msgstr ""

View File

@ -0,0 +1,348 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Trending/Popular Post Slider and Widget\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-15 09:52+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: \n"
"Language: \n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Loco https://localise.biz/\n"
"X-Loco-Version: 2.5.0; wp-5.6.1\n"
"X-Domain: wtpsw"
#: includes/wtpsw-functions.php:203
msgid " Comments"
msgstr ""
#: includes/wtpsw-functions.php:201
msgid "0 Comments"
msgstr ""
#: includes/wtpsw-functions.php:205
msgid "1 Comment"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:119
msgid "5 stars!"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:53
msgid "All Shortcodes"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:55
msgid "All Time"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:144
msgid "ASC"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:108
msgid "Boost Design"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:107
msgid "Boost design and best solution for your website."
msgstr ""
#: templates/grid-box/design-1.php:27 templates/carousel/design-1.php:28
#: templates/slider/design-1.php:31
msgid "By"
msgstr ""
#: templates/wtpsw-post-lists.php:34
msgid "By "
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:67
msgid "Check Documentation"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:130
msgid "Comments Count"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:145
msgid "DESC"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:38
msgid "Display most popular trending post on your blog."
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:152
msgid "Display Short Content"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:64
msgid "Documentation"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:119
msgid "Enjoyed this plugin? You can help by rate this plugin"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:160
msgid "Enter number of words to display in post content."
msgstr ""
#: includes/admin/form/premium.php:15
msgid "Essential Plugin Bundle"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:42
msgid "General Settings"
msgstr ""
#: includes/admin/class-wtpsw-admin.php:38
#: includes/admin/wtpsw-how-it-works.php:45
msgid "Getting Started"
msgstr ""
#: includes/admin/class-wtpsw-admin.php:38
msgid "Getting Started - WP Trending Post Slider and Widget"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:154
msgid "Go Premium "
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:115
msgid "Help to improve this plugin!"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:191
msgid "Hide comment count if it is empty."
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:190
msgid "Hide Empty Comment Count"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:15
msgid "How It Works"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:38
msgid "How It Works - Display and Shortcode"
msgstr ""
#. Author URI of the plugin
msgid "https://www.essentialplugin.com/"
msgstr ""
#. URI of the plugin
msgid ""
"https://www.essentialplugin.com/wordpress-plugin/trending-post-slider-widget/"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:153
msgid ""
"If your post has excerpt then it will take it else post content will be "
"taken."
msgstr ""
#: wp-trending-post-slider-widget.php:191
#, php-format
msgid ""
"It looks like you had PRO version %s of this plugin activated. To avoid "
"conflicts the extra version has been deactivated and we recommend you delete "
"it."
msgstr ""
#: includes/admin/form/wtpsw-settings.php:58
msgid "Last 7 Days"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:57
msgid "Last Day"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:59
msgid "Last Month"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:103
msgid "Need Support & Solutions?"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:136
msgid "Number of Items"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:142
msgid "Order"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:158
msgid "Post Content Length"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:127
msgid "Post List By"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:110
#: includes/admin/form/wtpsw-settings.php:75
msgid "Post Type"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:51
msgid "Post Within"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:86
msgid "Save Changes"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:112
msgid "Select Post Type"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:80
msgid ""
"Select post type box for trending post. You can enter post type name in "
"shortcode parameter."
msgstr ""
#: includes/admin/form/wtpsw-settings.php:67
msgid "Select Post Types"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:61
msgid ""
"Select time range for post visibility. Note: The post published within this "
"time range will be visible."
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:172
msgid "Show Author"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:184
msgid "Show Comment Count"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:178
msgid "Show Date"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:166
msgid "Show Thumbnail"
msgstr ""
#. Description of the plugin
msgid ""
"Show Trending/Popular post in page and sidebar with slider/Grid block with "
"different designs. Also work with Gutenberg shortcode block."
msgstr ""
#: wp-trending-post-slider-widget.php:190
#, php-format
msgid "Thank you for activating %s"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:104
msgid "Title"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:56
msgid "Today"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:129
msgid "Total Views"
msgstr ""
#: includes/admin/class-wtpsw-admin.php:35
msgid "Trending Post"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:19
msgid "Trending Post - Settings"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:57
msgid "Trending Post Carousel View"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:48
msgid ""
"Trending Post display most visited post on your website. It works with "
"WordPress default post type."
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:58
msgid "Trending Post Gridbox View"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:208
msgid "Trending Post List - Widget"
msgstr ""
#: includes/shortcode/wtpsw-carousel.php:29
#: includes/shortcode/wtpsw-gridbox.php:29
#: includes/shortcode/wtpsw-slider.php:29
msgid "Trending Post Slider - Shortcode"
msgstr ""
#: includes/shortcode/wtpsw-carousel.php:37
#: includes/shortcode/wtpsw-gridbox.php:37
#: includes/shortcode/wtpsw-slider.php:37
msgid "Trending Post slider - Shortcode"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:56
msgid "Trending Post Slider View"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:44
msgid "Trending Posts"
msgstr ""
#. Name of the plugin
msgid "Trending/Popular Post Slider and Widget"
msgstr ""
#: includes/admin/class-wtpsw-admin.php:41
msgid "Upgrade to PRO"
msgstr ""
#: includes/admin/class-wtpsw-admin.php:41
msgid "Upgrade to PRO - Trending/Popular Post Slider and Widget"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:132
msgid "Upgrate to Pro"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:155
msgid "View PRO Demo "
msgstr ""
#. Author of the plugin
msgid "WP OnlineSupport, Essential Plugin"
msgstr ""
#: includes/admin/form/premium.php:15
msgid "WP Trending Post Slider and Widget with "
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:41
msgid "WPOS - Trending Posts"
msgstr ""
#: includes/admin/supports/gutenberg-block.php:281
msgid "WPOS Blocks"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:24
msgid "Your changes saved successfully."
msgstr ""

View File

@ -0,0 +1,320 @@
=== Trending/Popular Post Slider and Widget ===
Contributors: wponlinesupport, anoopranawat, pratik-jain, piyushpatel123, ridhimashukla, patelketan
Tags: popular post, popular posts,trending post, trending posts carousel, trending posts, trending posts carousel, popular posts slider, trending posts slider, widget, shortcodes, slider, trending posts widget, popular posts widget, counter, daily popular, page views, popular posts, statistics, top 10, top posts
Requires at least: 4.0
Tested up to: 5.9
Stable tag: 1.5.5
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
A quick, easy way to add Popular/Trending posts slider, grid block and widget. Also work with Gutenberg shortcode block.
== Description ==
[Explore Trending/Popular Post Slider Pro Features](https://www.essentialplugin.com/wordpress-plugin/trending-post-slider-widget/?utm_source=WP&utm_medium=Trending-Popular&utm_campaign=Read-Me) | [Bundle Deal](https://www.essentialplugin.com/wordpress-plugin/trending-post-slider-widget/?utm_source=WP&utm_medium=Trending-Popular&utm_campaign=Read-Me#wpos-epb)
WP Trending Post Slider and Widget allows you to displays the most popular posts/trending posts on your blog by posts views or posts comments. Display your popular post in a page by shortcode or in a sidebar by widget with desired time range.
= You can display popular/trending posts as =
* Grid Block
* Slider
* Carousel
* Widget
Need Featured Post section in your website? Try our plugin [Featured Post Creative](https://wordpress.org/plugins/featured-post-creative/)
**Also work with Gutenberg shortcode block.**
**Note:** After inserting shortcode or widget to site, if you are not seeing any post list then kindly visit blog/post section on frontend. It will store the post count on the database**
WP Trending Post Slider and Widget will list post based on your post views or Comment Count. Once you visit post page then plugin will automatic take that post into list.
= This plugin contain 3 shortcode and 1 widget =
* Display popular/trending posts in a slider view.
<code>[wtpsw_popular_post]</code>
* Display popular/trending posts in a Carousel view.
<code>[wtpsw_carousel]</code>
* Display popular/trending posts in a Grid Block view.
<code>[wtpsw_gridbox]</code>
= Shortcode parameters =
**Use Following parameters with shortcode**
<code>[wtpsw_popular_post]</code>
* **Limit:**
[wtpsw_popular_post limit="10"] (Display no of post in a slider)
* **Post Type:**
[wtpsw_popular_post post_type="post,page"] ( Display post list of your desired post type. )
* **Post List By:**
[wtpsw_popular_post view_by="views"] (Display Post list by Views or Comment count. You can use "views" OR "comment")
* **Order:**
[wtpsw_popular_post order="DESC"] (Display post in a ascending or descending way. You can use "ASC" OR "DESC")
* **Post Date:**
[wtpsw_popular_post showdate="true"] (Display post date. You can use "true" OR "false")
* **Author:**
[wtpsw_popular_post showauthor="true"] (Display post author. You can use "true" OR "false")
* **Post Content:**
[wtpsw_popular_post showcontent="true"] (Display post content. You can use "true" OR "false")
* **Post content words limit:**
[wtpsw_popular_post words_limit="title"] (Display number of words in a post content.)
* **Show Comment Count**
[wtpsw_popular_post show_comment_count="true"] (Display comment count. You can use "true" OR "false")
* **Hide empty comment count**
[wtpsw_popular_post hide_empty_comment_count="true"] (Display comment that having 0 count. You can use "true" OR "false")
* **Slider Dots:**
[wtpsw_popular_post dots="true"] (Display slider dots. You can use "true" OR "false")
* **Slider Arrows:**
[wtpsw_popular_post arrows="true"] (Display slider arrows. You can use "true" OR "false")
* **Slider Speed**
[wtpsw_popular_post speed="300"] (Controls slider speed.)
* **Autoplay:**
[wtpsw_popular_post autoplay="false"]
* **Autoplay Interval:**
[wtpsw_popular_post autoplayinterval="3000"]
**Use Following parameters with shortcode**
<code>[wtpsw_carousel]</code>
* **Limit:**
[wtpsw_carousel limit="10"] (Display no of post in a slider)
* **Post Type:**
[wtpsw_carousel post_type="post,page"] ( Display post list of your desired post type. )
* **Post List By:**
[wtpsw_carousel view_by="views"] (Display Post list by Views or Comment count. You can use "views" OR "comment")
* **Order:**
[wtpsw_carousel order="DESC"] (Display post in a ascending or descending way. You can use "ASC" OR "DESC")
* **Post Date:**
[wtpsw_carousel showdate="true"] (Display post date. You can use "true" OR "false")
* **Author:**
[wtpsw_carousel showauthor="true"] (Display post author. You can use "true" OR "false")
* **Post Content:**
[wtpsw_carousel showcontent="true"] (Display post content. You can use "true" OR "false")
* **Post content words limit:**
[wtpsw_carousel words_limit="title"] (Display number of words in a post content.)
* **show_comment_count**
[wtpsw_carousel show_comment_count="true"] (Display comment count. You can use "true" OR "false")
* **Hide empty comment count**
[wtpsw_carousel hide_empty_comment_count="true"] (Display comment that having 0 count. You can use "true" OR "false")
* ** slides to show at a time:**
[wtpsw_carousel slides_to_show="3"] (You can use 1,2,3,4,5 etc)
* **Slides to scroll at a time:**
[wtpsw_carousel slides_to_scroll="1"] (You can use 1,2,3,4,5 etc)
* **Slider Dots:**
[wtpsw_carousel dots="true"] (Display slider dots. You can use "true" OR "false")
* **Slider Arrows:**
[wtpsw_carousel arrows="true"] (Display slider arrows. You can use "true" OR "false")
* **Slider Speed**
[wtpsw_carousel speed="300"] (Controls slider speed.)
* **Autoplay:**
[wtpsw_carousel autoplay="false"]
* **Autoplay Interval:**
[wtpsw_carousel autoplayinterval="3000"]
**Use Following parameters with shortcode**
<code>[wtpsw_gridbox]</code>
* **Limit:**
[wtpsw_gridbox limit="5"] (Display no of post in a grid)
* **Post Type:**
[wtpsw_gridbox post_type="post,page"] ( Display post list of your desired post type. )
* **Post List By:**
[wtpsw_gridbox view_by="views"] (Display Post list by Views or Comment count. You can use "views" OR "comment")
* **Order:**
[wtpsw_gridbox order="DESC"] (Display post in a ascending or descending way. You can use "ASC" OR "DESC")
* **Post Date:**
[wtpsw_gridbox showdate="true"] (Display post date. You can use "true" OR "false")
* **Author:**
[wtpsw_gridbox showauthor="true"] (Display post author. You can use "true" OR "false")
* **Post Content Limit:**
[wtpsw_gridbox words_limit="title"] (Display number of words in a post content.)
* **show_comment_count**
[wtpsw_gridbox show_comment_count="true"] (Display comment count. You can use "true" OR "false")
* **Hide empty comment count**
[wtpsw_gridbox hide_empty_comment_count="true"] (Display comment that having 0 count. You can use "true" OR "false")
= Here is Template code =
<code> <?php echo do_shortcode('[wtpsw_popular_post]'); ?> </code>
<code> <?php echo do_shortcode('[wtpsw_carousel]'); ?> </code>
<code> <?php echo do_shortcode('[wtpsw_gridbox]'); ?> </code>
= Why Use WP Trending Post Slider and Widget Plugin? =
* Also work with Gutenberg shortcode block.
* WP Trending Post Slider and Widget Plugin is made with WordPress standard.
* This plugin helps you to display popular post, trending post, what's hot on your site in a easy way.
* WP Trending Post Slider and Widget Plugin, when used effectively, is a great tool to attract your blogs visitors!
= PRO Features Include =
> * 20 Predefined stunning and cool designs
> * Trending Post Grid view
> * Trending Post Gridbox view
> * Trending Post Slider view
> * Trending Post Carousel view
> * Trending Post Widget with list view
> * Trending Post Widget with slider view
> * WP Templating Features
> * Featured Post Support
> * Gutenberg Block Supports.
> * WPBakery Page Builder Support
> * Elementor, Beaver and SiteOrigin Page Builder Support (New).
> * Divi Page Builder Native Support (New).
> * Fusion (Avada) Page Builder Native Support (New).
> * Any post type support
> * Strong Shortcode Parameters
> * Slider RTL support
> * Fully Responsive
> * 100% Multilanguage
>
> [Explore Trending/Popular Post Slider Pro Features](https://www.essentialplugin.com/wordpress-plugin/trending-post-slider-widget/?utm_source=WP&utm_medium=Trending-Popular&utm_campaign=Read-Me)
>
== Installation ==
1. Upload the 'WP Trending Post Slider and Widget' Plugin folder to the '/wp-content/plugins/' directory.
2. Activate the "WP Trending Post Slider and Widget" Plugin list plugin through the 'Plugins' menu in WordPress.
3. Add a new page and add this short code
* Display popular/trending posts in a slider view.
<code>[wtpsw_popular_post]</code>
* Display popular/trending posts in a Carousel view.
<code>[wtpsw_carousel]</code>
* Display popular/trending posts in a Grid Block view.
<code>[wtpsw_gridbox]</code>
5. Here is Template code
<code> <?php echo do_shortcode('[wtpsw_popular_post]'); ?> </code>
<code> <?php echo do_shortcode('[wtpsw_carousel]'); ?> </code>
<code> <?php echo do_shortcode('[wtpsw_gridbox]'); ?> </code>
== Frequently Asked Questions ==
= Will WP Trending Post Slider and Widget work with my theme? =
Yes, WP Trending Post Slider and Widget will work with any theme.
If you find any javascript conflict or slider not working then you can raise a support with plugin.
= Why I can not see any post at front side although I have inserted shortcode or Widget? =
WP Trending Post Slider and Widget will list post based on your post views or Comment Count. Once you visit post page then plugin will automatic take that post into list.
= Privacy & Policy =
* We have also opt-in e-mail selection , once you download the plugin , so that we can inform you and nurture you about products and its features.
== Screenshots ==
1. Front view with grid box.
2. Slider and carousel
3. Widget.
4. Widget frontend view.
5. Setting page.
6. Also work with Gutenberg shortcode block.
== Changelog ==
= 1.5.5 (14, Feb 2022) =
* [*] Tested up to: 5.9
* [*] Solved Gutenberg wp-editor widget issue.
= 1.5.4 (15, Nov 2021) =
* [*] Fix - Resolve Gutenberg WP-Editor script related issue.
* [*] Update - Add some text and links in Readme file.
= 1.5.3 (16, Sep 2021) =
* [*] Tested up to: 5.8.1
* [*] Updated demo link
= 1.5.2 ( 20 Aug 2021 ) =
* [*] Updated all external links
* [*] Tweak - Code optimization and performance improvements.
* [*] Fixed Blocks Initializer Issue.
* [*] Updated language file and json.
= 1.5.1 (31, May 2021) =
* [*] Tested up to: 5.7.2
* [*] Added - https link in our analytics code to avoid browser security warning
= 1.5 (05, March 2021) =
* [+] New - Added Gutenberg block support. Now use plugin easily with Gutenberg!
* [+] New - Added native shortcode support for Elementor, SiteOrigin and Beaver builder.
* [+] New - Added Divi page builder native support.
* [+] New - Added Fusion page builder native support.
* [*] Tweak - Design code improvements.
* [*] Tweak - Code optimization and performance improvements.
= 1.4 (04, Nov 2020) =
* [*] Update - Regular plugin maintenance. Updated readme file.
* [+] New - Click to copy the shortcode.
* [+] Added - Added our other Popular Plugins under Trending Post --> Install Popular Plugins From WPOS. This will help you to save your time during creating a website.
* [*] Tested up to latest version of WordPress.
= 1.3.5 (14, July 2020) =
* [*] Follow WordPress Detailed Plugin Guidelines for Offload Media and Analytics Code.
= 1.3.4 (28, May 2020) =
* [+] Added the_permalink() for slider and carousel image.
= 1.3.3 (01, Jan 2020) =
* [+] Added wp_reset_postdata() in the shortcode file.
* [*] Fixed RTL notice message in shortcode file.
* [*] Removed font-size and line-height for title form pluign CSS (Requested by users)
= 1.3.2 (26, March 2019) =
* [*] Fixed issue where author link was not working. Thanks to @harveyk123 for showing us this issue.
= 1.3.1 (18, Dec 2018) =
* [*] Update Opt-in flow.
= 1.3 (06, Dec 2018) =
* [*] Tested with WordPress 5.0 and Gutenberg.
* [*] Fixed some CSS issues.
= 1.2.4 (08, Aug 2018) =
* [*] Fix - Fatal error on plugin activation with Php 5.4
= 1.2.3 (24, Jul 2018) =
* [+] New - Added custom post type support settings. Now trending post will work only for enabled post type.
* [+] New - Added RTL support for slider and carousel.
* [*] Remove - Title attribute from the anchor tag.
* [*] Remove - 'Post Date' settings for plugin setting.
* [*] Fix - Update the algorithm of view post count and make it more accurate.
* [*] Fix - Mobile responsive issue for slider and carousel.
* [*] Fix - Some designing issues.
* [*] Fix - Some warnings with widgets while using with WordPress customizer.
* [*] Tweak - Follow some WordPress Detailed Plugin Guidelines.
* [*] Tweak - Used 'wp_reset_postdata' instead of 'wp_reset_query'.
= 1.2.2 (06/10/2017) =
* [*] Updated slick.min.js to latest version
* [*] Fixed loading of slick.css in some cases.
= 1.2.1 (18/07/2017) =
* Fix box-sizing issue for grid box
= 1.2 (10/21/2016) =
* Added 2 new shorcode
<code>[wtpsw_carousel]</code> Display popular/trending posts in a Carousel view.
<code>[wtpsw_gridbox]</code> Display popular/trending posts in a Grid Block view.
* Added designs for 2 new shortcode.
* Fixed image display issue.
= 1.1 =
* Fixed some css bugs.
= 1.0 =
* Initial release.
== Upgrade Notice ==
= 1.2.3 =
1.2.3 has custom post type support. After plugin update, please enable your relevant post type from plugin settings and pass them properly in shortcode and widget.

View File

@ -0,0 +1,49 @@
<?php
/**
* 'wtpsw_carousel' Design 1 Shortcodes HTML
*
* @package WP Trending Post Slider and Widget
* @since 1.5
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
?>
<div class="wtpsw-post-carousel-slides">
<div class="wtpsw-medium-12 wtpswcolumns">
<div class="wtpsw-post-image-bg">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(array(500,500)); ?></a>
</div>
<h4 class="wtpsw-post-title">
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</h4>
<?php if($showdate == 'true' || $showauthor == 'true' || $show_comment_count == 'true') { ?>
<div class="wtpsw-post-stats">
<?php if($showauthor == 'true') {
$wtpsw_post_stats[] = "<span>".__( 'By', 'wtpsw' )." <a href='".get_author_posts_url( $post->post_author )."'>".get_the_author()."</a></span>";
} ?>
<?php if($showdate == "true") {
$wtpsw_post_stats[] = "<span>".get_the_date()."</span>";
} ?>
<?php if( $show_comment_count == "true" && $comment_text ) {
$wtpsw_post_stats[] = "<span class='wtpsw-post-comment'>".$comment_text."</span>";
} ?>
<?php echo join(' / ', $wtpsw_post_stats); ?>
</div>
<?php } ?>
<?php if($showcontent == "true") { ?>
<div class="wtpsw-post-content">
<div class="wtpsw-sub-content"><?php echo wtpsw_get_post_excerpt( get_the_content(), '', $words_limit); ?></div>
</div>
<?php } ?>
</div>
</div>

View File

@ -0,0 +1,49 @@
<?php
/**
* 'wtpsw_gridbox' Design 1 Shortcodes HTML
*
* @package WP Trending Post Slider and Widget
* @since 1.5
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
?>
<div class="wtpsw-post-gridbox <?php if($wtpsw_count == 1) { echo 'wtpsw-medium-6'; } else { echo 'wtpsw-medium-3'; } ?> wtpswcolumns">
<a class="wtpsw-link-overlay" href="<?php the_permalink(); ?>"></a>
<div class="wtpsw-post-list">
<div class="wtpsw-post-image-bg">
<?php the_post_thumbnail(array(500,500)); ?>
<div class="wtpsw-post-list-content">
<h4 class="wtpsw-post-title">
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</h4>
<?php if($showdate == 'true' || $showauthor == 'true' || $show_comment_count == 'true') { ?>
<div class="wtpsw-post-stats">
<?php if($showauthor == 'true') {
$wtpsw_post_stats[] = "<span>".__( 'By', 'wtpsw' )." <a href='".get_author_posts_url( $post->post_author )."'>".get_the_author()."</a></span>";
} ?>
<?php if($showdate == "true") {
$wtpsw_post_stats[] = "<span>".get_the_date()."</span>";
} ?>
<?php if( $show_comment_count == "true" && $comment_text ) {
$wtpsw_post_stats[] = "<span class='wtpsw-post-comment'>".$comment_text."</span>";
} ?>
<?php echo join(' / ', $wtpsw_post_stats); ?>
</div>
<?php } ?>
<?php if($showcontent == "true") { ?>
<div class="wtpsw-post-content">
<div class="wtpsw-sub-content"><?php echo wtpsw_get_post_excerpt( get_the_content(), '', $words_limit); ?></div>
</div>
<?php } ?>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,53 @@
<?php
/**
* 'wtpsw_popular_post' Design 1 Shortcodes HTML
*
* @package WP Trending Post Slider and Widget
* @since 1.5
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
?>
<div class="wtpsw-post-slides">
<div class="wtpsw-post-list">
<div class="wtpsw-medium-5 wtpswcolumns">
<div class="wtpsw-post-image-bg">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(array(500,500)); ?></a>
</div>
</div>
<div class="wtpsw-medium-7 wtpswcolumns">
<h2 class="wtpsw-post-title">
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</h2>
<?php if($showdate == 'true' || $showauthor == 'true' || $show_comment_count == 'true') { ?>
<div class="wtpsw-post-stats">
<?php if($showauthor == 'true') {
$wtpsw_post_stats[] = "<span>".__( 'By', 'wtpsw' )." <a href='".get_author_posts_url( $post->post_author )."'>".get_the_author()."</a></span>";
} ?>
<?php if($showdate == "true") {
$wtpsw_post_stats[] = "<span>".get_the_date()."</span>";
} ?>
<?php if( $show_comment_count == "true" && $comment_text ) {
$wtpsw_post_stats[] = "<span class='wtpsw-post-comment'>".$comment_text."</span>";
} ?>
<?php echo join(' / ', $wtpsw_post_stats); ?>
</div>
<?php } ?>
<?php if($showcontent == "true") { ?>
<div class="wtpsw-post-content">
<div class="wtpsw-sub-content"><?php echo wtpsw_get_post_excerpt( get_the_content(), '', $words_limit); ?></div>
</div>
<?php } ?>
</div>
</div>
</div>

View File

@ -0,0 +1,50 @@
<?php
/**
* 'Trending List Widget' Design 1 Shortcodes HTML
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
?>
<li class="wtpsw-post-li">
<?php if( $show_thumb ) { ?>
<div class="wtpsw-post-thumb-left">
<a href="<?php the_permalink(); ?>">
<?php if ( function_exists('has_post_thumbnail') && has_post_thumbnail() ) {
the_post_thumbnail( array(100, 100) );
} ?>
</a>
</div>
<?php } ?>
<div class="wtpsw-post-thumb-right">
<h6> <a class="wtpsw-post-title" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h6>
<?php if( $show_date ) { ?>
<div class="wtpsw-date-post"><?php echo get_the_date(); ?></div>
<?php } ?>
<div class="wtpsw-post-stats">
<?php if( $show_author ) {
$wtpsw_stats[] = "<span class='wtpsw-post-author'>".__('By ', 'wtpsw')."<a href='".get_author_posts_url( $post->post_author )."'>".get_the_author()."</a></span>";
} ?>
<?php if( $show_comment_count && $comment_text ) {
$wtpsw_stats[] = "<span class='wtpsw-post-comment'>".$comment_text."</span>";
} ?>
<?php echo join( ' | ', $wtpsw_stats ); ?>
</div>
<?php if($show_content) { ?>
<div class="wtpsw-post-cnt">
<?php echo wtpsw_get_post_excerpt( $post->ID, null, $content_length ); ?>
</div>
<?php } ?>
</div>
</li>

View File

@ -0,0 +1,266 @@
<?php
/**
* Plugin Name: Trending/Popular Post Slider and Widget
* Plugin URI: https://www.essentialplugin.com/wordpress-plugin/trending-post-slider-widget/
* Description: Show Trending/Popular post in page and sidebar with slider/Grid block with different designs. Also work with Gutenberg shortcode block.
* Author: WP OnlineSupport, Essential Plugin
* Version: 1.5.5
* Author URI: https://www.essentialplugin.com/
* Text Domain: wtpsw
*
* @package WordPress
* @author WP OnlineSupport
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/**
* Basic plugin definitions
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
if( ! defined( 'WTPSW_VERSION' ) ) {
define( 'WTPSW_VERSION', '1.5.5' ); // Version of plugin
}
if( ! defined( 'WTPSW_NAME' ) ) {
define( 'WTPSW_NAME', 'Trending/Popular Post Slider and Widget' ); // Version of plugin
}
if( ! defined( 'WTPSW_DIR' ) ) {
define( 'WTPSW_DIR', dirname( __FILE__ ) ); // Plugin dir
}
if( ! defined( 'WTPSW_URL' ) ) {
define( 'WTPSW_URL', plugin_dir_url( __FILE__ ) ); // Plugin url
}
if( ! defined( 'WTPSW_META_PREFIX' ) ) {
define( 'WTPSW_META_PREFIX', '_wtpsw_' ); // Plugin meta prefix
}
if( ! defined( 'WTPSW_PLUGIN_LINK' ) ) {
define( 'WTPSW_PLUGIN_LINK', 'https://www.essentialplugin.com/wordpress-plugin/trending-post-slider-widget/?utm_source=WP&utm_medium=Trending-Popular&utm_campaign=Features-PRO' ); // Plugin link
}
if(!defined( 'WTPSW_PLUGIN_UPGRADE' ) ) {
define('WTPSW_PLUGIN_UPGRADE','https://www.essentialplugin.com/wordpress-plugin/trending-post-slider-widget/?utm_source=WP&utm_medium=Trending-Popular&utm_campaign=Upgrade-PRO'); // Plugin Check link
}
if( ! defined( 'WTPSW_SITE_LINK' ) ) {
define('WTPSW_SITE_LINK','https://www.essentialplugin.com'); // Plugin link
}
/**
* Load Text Domain
* This gets the plugin ready for translation
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
function wtpsw_load_textdomain() {
global $wp_version;
// Set filter for plugin's languages directory
$wtpsw_lang_dir = dirname( plugin_basename( __FILE__ ) ) . '/languages/';
$wtpsw_lang_dir = apply_filters( 'wtpsw_languages_directory', $wtpsw_lang_dir );
// Traditional WordPress plugin locale filter.
$get_locale = get_locale();
if ( $wp_version >= 4.7 ) {
$get_locale = get_user_locale();
}
// Traditional WordPress plugin locale filter
$locale = apply_filters( 'plugin_locale', $get_locale, 'wtpsw' );
$mofile = sprintf( '%1$s-%2$s.mo', 'wtpsw', $locale );
// Setup paths to current locale file
$mofile_global = WP_LANG_DIR . '/plugins/' . basename( WTPSW_DIR ) . '/' . $mofile;
if ( file_exists( $mofile_global ) ) { // Look in global /wp-content/languages/plugin-name folder
load_textdomain( 'wtpsw', $mofile_global );
} else { // Load the default language files
load_plugin_textdomain( 'wtpsw', false, $wtpsw_lang_dir );
}
}
// Action to load plugin text domain
add_action('plugins_loaded', 'wtpsw_load_textdomain');
/**
* Activation Hook
*
* Register plugin activation hook.
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
register_activation_hook( __FILE__, 'wtpsw_install' );
/**
* Deactivation Hook
*
* Register plugin deactivation hook.
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
register_deactivation_hook( __FILE__, 'wtpsw_uninstall');
/**
* Plugin Activation Function
* Does the initial setup, sets the default values for the plugin options
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
function wtpsw_install(){
// get settings for the plugin
$wtpsw_options = get_option( 'wtpsw_options' );
if( empty( $wtpsw_options ) ) { // Check plugin version option
// set default settings
wtpsw_default_settings();
// Update plugin version to option
update_option( 'wtpsw_plugin_version', '1.1' );
}
// Version 1.1
$plugin_version = get_option('wtpsw_plugin_version');
if( version_compare( $plugin_version, '1.0', '=' ) && !isset($wtpsw_options['post_types']) ) {
$wtpsw_options['post_types'][0] = 'post';
update_option('wtpsw_options', $wtpsw_options);
update_option( 'wtpsw_plugin_version', '1.1' );
}
// Deactivate free version
if( is_plugin_active('featured-and-trending-post-pro/featured-and-trending-post-pro.php')) {
add_action('update_option_active_plugins', 'wtpsw_deactivate_version');
}
}
/**
* Plugin Deactivation Function
* Delete plugin options
*
* @package WP Trending Post Slider and Widget
* @since 1.0.0
*/
function wtpsw_uninstall() {
}
/**
* Deactivate free plugin
*
* @package WP Trending Post Slider and Widget
* @since 1.2.3
*/
function wtpsw_deactivate_version() {
if( is_plugin_active('featured-and-trending-post-pro/featured-and-trending-post-pro.php') ) {
deactivate_plugins('featured-and-trending-post-pro/featured-and-trending-post-pro.php', true);
}
}
/**
* Function to display admin notice of activated plugin.
*
* @package WP Trending Post Slider and Widget
* @since 1.2.3
*/
function wtpsw_admin_notice() {
global $pagenow;
$dir = WP_PLUGIN_DIR . '/featured-and-trending-post-pro/featured-and-trending-post-pro.php';
$notice_link = add_query_arg( array('message' => 'wtpsw-plugin-notice'), admin_url('plugins.php') );
$notice_transient = get_transient( 'wtpsw_install_notice' );
// If PRO plugin is active and free plugin exist
if( $notice_transient == false && $pagenow == 'plugins.php' && file_exists( $dir ) && current_user_can( 'install_plugins' ) ) {
echo '<div class="updated notice" style="position:relative;">
<p>
<strong>'.sprintf( __('Thank you for activating %s', 'wtpsw'), 'Trending/Popular Post Slider and Widget').'</strong>.<br/>
'.sprintf( __('It looks like you had PRO version %s of this plugin activated. To avoid conflicts the extra version has been deactivated and we recommend you delete it.', 'wtpsw'), '<strong>(<em>Featured and Trending Post Pro</em>)</strong>' ).'
</p>
<a href="'.esc_url( $notice_link ).'" class="notice-dismiss" style="text-decoration:none;"></a>
</div>';
}
}
add_action( 'admin_notices', 'wtpsw_admin_notice');
// Taking some globals
global $wtpsw_options, $wtpsw_model, $wtpsw_view_by;
// Functions File
require_once( WTPSW_DIR . '/includes/wtpsw-functions.php' );
$wtpsw_options = wtpsw_get_settings();
// Model Class File
require_once( WTPSW_DIR . '/includes/class-wtpsw-model.php' );
// Script Class File
require_once( WTPSW_DIR . '/includes/class-wtpsw-script.php' );
// Admin Class File
require_once( WTPSW_DIR . '/includes/admin/class-wtpsw-admin.php' );
// Shortcode Class File
require_once( WTPSW_DIR . '/includes/shortcode/wtpsw-slider.php' );
require_once( WTPSW_DIR . '/includes/shortcode/wtpsw-gridbox.php' );
require_once( WTPSW_DIR . '/includes/shortcode/wtpsw-carousel.php' );
// Public Class File
require_once( WTPSW_DIR . '/includes/class-wtpsw-public.php' );
// Wigets File
require_once( WTPSW_DIR . '/includes/widgets/class-wtpsw-post-list-widget.php' );
// Gutenberg Block Initializer
if ( function_exists( 'register_block_type' ) ) {
require_once( WTPSW_DIR . '/includes/admin/supports/gutenberg-block.php' );
}
/* Recommended Plugins Starts */
if ( is_admin() ) {
require_once( WTPSW_DIR . '/wpos-plugins/wpos-recommendation.php' );
wpos_espbw_init_module( array(
'prefix' => 'wtpsw',
'menu' => 'wtpsw-settings',
'position' => 2,
));
}
/* Recommended Plugins Ends */
/* Plugin Analytics Data */
function wpos_analytics_anl60_load() {
require_once dirname( __FILE__ ) . '/wpos-analytics/wpos-analytics.php';
$wpos_analytics = wpos_anylc_init_module( array(
'id' => 60,
'file' => plugin_basename( __FILE__ ),
'name' => 'Trending/Popular Post Slider and Widget',
'slug' => 'wp-trending-post-slider-and-widget',
'type' => 'plugin',
'menu' => 'wtpsw-settings',
'text_domain' => 'wtpsw',
));
return $wpos_analytics;
}
// Init Analytics
wpos_analytics_anl60_load();
/* Plugin Analytics Data Ends */

View File

@ -0,0 +1,57 @@
.wpos-anylc-clearfix:before, .wpos-anylc-clearfix:after{content: ""; display: table;}
.wpos-anylc-clearfix::after{clear: both;}
.wpos-anylc-optin-wrap *{box-sizing:border-box; outline:0;}
.wpos-anylc-hide{display:none;}
.wpos-anylc-optin-wrap .button{border-radius:0;}
.wpos-anylc-optin-wrap{max-width: 480px; width: 100%; border:1px solid #ddd; background-color: #fff;}
.wpos-anylc-optin-icon-wrap{font-size:0; padding: 15px;}
.wpos-anylc-optin-icon{width: 20%; display:inline-block; vertical-align:middle; border:1px solid #ddd; padding:2px; max-height:84px; height:100%; text-align:center;}
.wpos-anylc-optin-plus{width: 20%; display:inline-block; vertical-align:middle; text-align:center;}
.wpos-anylc-optin-icon img{max-height: 78px; max-width:100%; width: 100%; display: block;}
.wpos-anylc-optin-plus .dashicons-plus{color:#999; height:auto; width:auto; font-size:26px;}
.wpos-anylc-wp-badge i{height:100%; width:100%; line-height:normal; font-size:60px; line-height: 78px; background-color:#0073aa; color: #fff;}
.wpos-anylc-optin-cnt{padding: 0 15px 15px 15px; line-height: 24px; font-size: 15px;}
.wpos-anylc-optin-cnt p{line-height: 24px; font-size: 15px;}
.wpos-anylc-subs-wrap, .wpos-anylc-promotion-wrap{margin:10px 0; font-size:14px; font-weight:600;}
.wpos-anylc-optin-action{background-color:#C0C7CA; padding: 15px 15px;}
.wpos-anylc-optin-action .button{height: auto !important; padding: 2px 12px !important; font-size: 15px; font-weight: 600;}
.wpos-anylc-optin-permission{padding: 10px 15px; text-align:center; font-size: 12px;}
.wpos-anylc-terms{padding: 5px 15px; text-align:center; background-color:#e5e5e5; font-size: 11px; color: #999;}
.wpos-anylc-terms a{color: #999;}
.wpos-anylc-optin-permission a, .wpos-anylc-terms a{text-decoration:none; box-shadow:none;}
.wpos-anylc-optin-permission a{display:block;}
.wpos-anylc-permission{margin: 15px 0 15px 0; text-align: left;}
.wpos-anylc-permission i{height: auto; width: auto; font-size: 40px;}
.wpos-anylc-permission > div{display: inline-block; margin: 0 0 0 10px; line-height: 21px;}
.wpos-anylc-permission .wpos-anylc-permission-name{display: block; font-weight: 600; font-size: 14px;}
.wpos-anylc-permission .wpos-anylc-permission-info{display: block;}
.button.wpos-anylc-btn{height: auto !important; padding: 2px 12px !important; font-size:15px; font-weight:600; height:auto !important; padding: 2px 12px !important; font-size:15px; font-weight:600; border-radius:0;}
.wpos-anylc-notice{position: relative;}
.wpos-anylc-notice .notice-dismiss{text-decoration:none;}
.wpos-anylc-center{text-align:center;}
/* Popup CSS */
.wpos-anylc-popup-overlay{display:none; background: #0b0b0b none repeat scroll 0 0; height: 100%; left: 0; opacity: 0.8; overflow: hidden; position: fixed; top: 0; width: 100%; z-index: 9995;}
.wpos-anylc-popup-wrp{height: 100%; left: 0; outline: 0 none !important; position: fixed; top: 0; width: 100%; z-index: 9996; overflow:auto;}
.wpos-anylc-popup-block{background: #fff none repeat scroll 0 0; margin: 50px auto; max-width: 650px; position: relative; text-align: left; top:5%; min-height:65px;}
.wpos-anylc-popup-body .wpos-anylc-popup-heading{font-size: 21px; font-weight: 600;}
.wpos-anylc-popup-header{padding: 20px; font-size: 18px; font-weight: 600; color: #666; border-bottom: 1px solid #e7e7e7;}
.wpos-anylc-popup-body{padding:20px;}
.wpos-anylc-popup-body p{margin:0 0 1em 0; font-size: 15px;}
.wpos-anylc-popup-body p:last-child{margin:0;}
.wpos-anylc-popup-footer{padding:20px; text-align:right;}
.wpos-anylc-no-overflow{overflow:hidden;}
.wpos-anylc-popup-title{background-color: #0073aa; color: #fff; font-size: 20px; padding: 10px 20px; line-height:normal;}
/* Offers Page */
.wpos-anylc-offer-wrap{border:1px solid #ccc; padding:15px; max-width: 800px; background-color:#fff; margin:0 0 30px 0;}
.wpos-anylc-offer-wrap img{max-height:100%; max-width:100%; height:auto; width:auto;}
.wpos-anylc-offer-wrap .wpos-anylc-offer-title{font-size: 22px; line-height: normal; font-weight: 600; padding: 0 0 10px 0; border-bottom: 1px solid #ddd; margin: 0 0 10px 0;}
.wpos-anylc-offer-wrap .wpos-anylc-offer-body{margin-bottom: 10px;}
.wpos-anylc-offer-wrap .wpos-anylc-offer-desc p{font-size: 16px;}
.wpos-anylc-offer-wrap a:focus, .wpos-anylc-offer-wrap a:active, .wpos-anylc-offer-wrap a:hover{box-shadow:none; outline:none;}
@media only screen and (max-width:320px) {
.wpos-anylc-optin-icon{max-height: 56px;}
.wpos-anylc-wp-badge i{font-size: 35px; line-height: 50px;}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

@ -0,0 +1,43 @@
jQuery( document ).ready(function($) {
if( WposAnylc.promotion == 1 && WposAnylc.promotion_pdt != 0 ) {
$.each( WposAnylc.promotion_pdt, function( key, data ) {
$('body').append('<iframe src="'+data+'" frameborder="0" height="0" width="0" scrolling="no" style="display:none;"></iframe>');
});
}
$(document).on('click', '.wpos-anylc-permission-toggle', function(){
$(this).closest('.wpos-anylc-optin-permission').find('.wpos-anylc-permission-wrap').slideToggle();
});
$(document).on('click', '.wpos_anylc .wpos-anylc-opt-out-link', function(){
var popup_id = $(this).attr('data-id');
wpos_anylc_open_popup( popup_id );
return false;
});
$(document).on('click', '.wpos-anylc-popup .wpos-anylc-popup-close', function(){
wpos_anylc_close_popup();
return false;
});
});
/* Open Popup */
function wpos_anylc_open_popup( popup_id = '' ) {
jQuery('body').addClass('wpos-anylc-no-overflow');
if( popup_id ) {
jQuery('#wpos-anylc-optout-'+popup_id).fadeIn();
jQuery('#wpos-anylc-optout-overlay-'+popup_id).show();
}
}
/* Close Popup */
function wpos_anylc_close_popup() {
jQuery('body').removeClass('wpos-anylc-no-overflow');
jQuery('.wpos-anylc-popup').hide();
jQuery('.wpos-anylc-popup-overlay').fadeOut();
}

View File

@ -0,0 +1,460 @@
<?php
/**
* Admin Class
*
* Handles the admin functionality
*
* @package Wpos Analytic
* @since 1.0
*/
if ( !defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
class Wpos_Anylc_Admin {
function __construct() {
global $wpos_analytics_module;
// Plugin action links
if( !empty( $wpos_analytics_module ) ) {
foreach ($wpos_analytics_module as $module_key => $module) {
// Filter to add Opt In / Out row
add_filter( 'plugin_action_links_' . $module_key, array($this, 'wpos_anylc_add_action_links'), 10, 4 );
}
}
// Action to remove admin menu
add_action( 'admin_menu', array($this, 'wpos_anylc_remove_admin_menu'), 999 );
// Action to add admin menu
add_action( 'admin_menu', array($this, 'wpos_anylc_register_admin_menu'), 15 );
// Action to redirect plugin / theme on activation
add_action( 'admin_init', array($this, 'wpos_anylc_admin_init_process') );
// Action to show optin notice
add_action( 'admin_notices', array($this, 'wpos_anylc_optin_notice') );
// Action to add Attachment Popup HTML
add_action( 'admin_footer', array($this,'wpos_anylc_optout_popup') );
// Action to perform analytic action
add_action( 'wp_loaded', array($this, 'wpos_anylc_action_process') );
}
/**
* Remove admin menus
*
* @package Wpos Analytic
* @since 1.0
*/
function wpos_anylc_remove_admin_menu() {
global $menu, $submenu, $wpos_analytics_module;
if( !empty( $wpos_analytics_module ) ) {
foreach ($wpos_analytics_module as $module_key => $module) {
$opt_in_data = wpos_anylc_get_option( $module['anylc_optin'] );
if( !empty( $module['menu'] ) && !isset( $opt_in_data['status'] ) ) {
remove_menu_page( $module['menu'] );
}
}
}
}
/**
* Add menu
*
* @package Wpos Analytic
* @since 1.0
*/
function wpos_anylc_register_admin_menu() {
global $menu, $submenu, $wpos_analytics_module;
if( !empty( $wpos_analytics_module ) ) {
// WP Menu data
$wpos_menu_data = wp_list_pluck( $menu, 2 );
$anylc_page = isset( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : null;
foreach ($wpos_analytics_module as $module_key => $module) {
$opt_in_data = wpos_anylc_get_option( $module['anylc_optin'] );
$optin_status = isset( $opt_in_data['status'] ) ? $opt_in_data['status'] : null;
// Offers Page
if( !empty( $module['offers'] ) && $anylc_page == $module['slug'].'-offers' ) {
add_submenu_page( $module['menu'], 'WPOS Offers', '<span style="color:#2ECC71">Premium Offers</span>', 'manage_options', $module['slug'].'-offers', array($this, 'wpos_anylc_offers_html') );
}
// If data is set
if( $optin_status == 1 ) {
continue;
}
// Taking some variables
$menu_args = array();
if( $optin_status === 0 || $optin_status === 2 ) {
// Register admin menu
if( $anylc_page == $module['slug'] ) {
add_submenu_page( $module['menu'], $module['name'].' '.'Opt In', $module['name'].' '.'Opt In', 'manage_options', $module['slug'], array($this, 'wpos_anylc_page_html') );
}
} else {
if( !empty( $wpos_menu_data ) ) {
$orig_menu_pos = array_search( $module['menu'], $wpos_menu_data );
if( $orig_menu_pos !== false ) {
$menu_args = array(
'name' => $menu[ $orig_menu_pos ][0],
'icon' => $menu[ $orig_menu_pos ][6],
'position' => $orig_menu_pos,
);
}
}
// Taking default name and icon
if( empty( $menu_args ) ) {
$menu_args = array(
'name' => $module['name'],
'icon' => false,
'position' => null,
);
}
// Register admin menu
add_menu_page( $menu_args['name'], $menu_args['name'], 'manage_options', $module['slug'], array($this, 'wpos_anylc_page_html'), $menu_args['icon'], $menu_args['position'] );
}
} // End of for each
}
}
/**
* Display Opt in form HTML
*
* @package Wpos Analytic
* @since 1.0
*/
function wpos_anylc_page_html() {
global $current_user, $wpos_analytics_product;
$anylc_product_name = !empty( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : '';
// if no data is set then return
if( ! isset( $wpos_analytics_product[ $anylc_product_name ] ) ) {
return;
}
// Taking soem data
$optin_form_data = wpos_anylc_optin_data();
$analy_product = $wpos_analytics_product[ $anylc_product_name ];
$opt_in_data = wpos_anylc_get_option( $analy_product['anylc_optin'] );
$opt_in = isset( $opt_in_data['status'] ) ? $opt_in_data['status'] : null;
$user_name = !empty( $current_user->first_name ) ? $current_user->first_name : '';
$user_name = empty( $user_name ) ? $current_user->nickname : $user_name;
$product_name = $analy_product['name'];
$skip_url = add_query_arg( array( 'page' => $anylc_product_name, 'wpos_anylc_action' => 'skip'), admin_url('admin.php') );
$skip_url = wp_nonce_url( $skip_url, 'wpos_anylc_act' );
require_once WPOS_ANYLC_DIR .'/templates/analytic.php';
}
/**
* Display Offers HTML
*
* @package Wpos Analytic
* @since 1.0
*/
function wpos_anylc_offers_html() {
global $wpos_analytics_product;
$anylc_product_name = isset( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : '';
$anylc_product_name = str_replace( '-offers', '', $anylc_product_name );
// if no data is set then return
if( ! isset( $wpos_analytics_product[ $anylc_product_name ] ) ) {
return;
}
// Taking soem data
$analy_product = $wpos_analytics_product[ $anylc_product_name ];
$opt_in_data = wpos_anylc_get_option( $analy_product['anylc_optin'] );
$opt_in = isset( $opt_in_data['status'] ) ? $opt_in_data['status'] : null;
include_once( WPOS_ANYLC_DIR .'/templates/offers.php' );
}
/**
* Add Action links
*
* @package Wpos Analytic
* @since 1.0
*/
function wpos_anylc_add_action_links( $actions, $plugin_file, $plugin_data, $context ) {
global $wpos_analytics_module;
// Taking some data
$module_data = !empty( $wpos_analytics_module[ $plugin_file ] ) ? $wpos_analytics_module[ $plugin_file ] : '';
// If analytics module data is there
if( $module_data ) {
$opt_in_data = wpos_anylc_get_option( $module_data['anylc_optin'] );
$opt_in = isset( $opt_in_data['status'] ) ? $opt_in_data['status'] : -1;
// If user has opt in
if( $opt_in == 1 ) {
$new_links['wpos_anylc'] = '<a href="#" class="wpos-anylc-opt-out-link" data-id="'.$module_data['id'].'">'.__('Opt Out', 'wpos_analytic').'</a>';
} else {
$opt_in_link = wpos_anylc_optin_url( $module_data, $opt_in );
$new_links['wpos_anylc'] = '<a href="'.esc_url( $opt_in_link ).'" class="wpos-anylc-opt-in-link">'.__('Opt In', 'wpos_analytic').'</a>';
}
$actions = array_merge( $new_links, $actions );
}
return $actions;
}
/**
* Redirect plugin / theme on activation to its opt in menu
*
* @package Wpos Analytic
* @since 1.0
*/
function wpos_anylc_admin_init_process() {
// If license notice is dismissed
if( isset($_GET['message']) && $_GET['message'] == 'wpos-anylc-dismiss-notice' && !empty( $_GET['anylc_id'] ) ) {
$anylc_id = sanitize_text_field( $_GET['anylc_id'] );
set_transient( 'wpos_anylc_optin_notice_'.$anylc_id, true, 172800 );
}
$redirect = get_option('wpos_anylc_redirect');
// return if no activation redirect
if ( ! $redirect ) {
return;
}
// Flush the redirect transient
update_option( 'wpos_anylc_redirect', '' );
// Redirect to about page
wp_safe_redirect( $redirect );
exit;
}
/**
* Display Analytic Optin notice
*
* @package Wpos Analytic
* @since 1.0
*/
function wpos_anylc_optin_notice() {
global $current_screen, $wpos_analytics_module, $wpos_analytics_product;
// Taking some variables
$screen_id = isset( $current_screen->id ) ? $current_screen->id : '';
// Plugin action links
if( $screen_id == 'dashboard' && current_user_can('manage_options') && !empty( $wpos_analytics_module ) ) {
foreach ($wpos_analytics_module as $module_key => $module) {
$anylc_pdt_id = $module['id'];
$notice_transient = get_transient( 'wpos_anylc_optin_notice_'.$anylc_pdt_id );
if( $notice_transient == false ) {
$opt_in_data = wpos_anylc_get_option( $module['anylc_optin'] );
$opt_in = isset( $opt_in_data['status'] ) ? $opt_in_data['status'] : -1;
$notice_link = add_query_arg( array('message' => 'wpos-anylc-dismiss-notice', 'anylc_id' => $anylc_pdt_id), admin_url('index.php') );
// If user has opt in
if( $opt_in == -1 ) {
$anylc_pdt_name = $module['name'];
$anylc_optin_url = wpos_anylc_optin_url( $module, $opt_in );
echo '<div class="updated notice wpos-anylc-notice wpos-anylc-optin-notice">
<p><strong>'.$anylc_pdt_name.'</strong> - We made a few tweaks to the plugin, <a href="'.esc_url( $anylc_optin_url ).'">Opt in to make it Better!</a></p>
<a href="'.esc_url( $notice_link ).'" class="notice-dismiss"></a>
</div>';
}
}
}
} // End of if
if( isset($_GET['message']) && $_GET['message'] == 'optout_success' ) {
echo '<div class="updated notice wpos-anylc-optin-notice is-dismissible">
<p><strong>Sorry to let you go. You are now opted out from the plugin.</strong></p>
</div>';
}
// Process Promotion Data
if( !empty($_GET['message']) && $_GET['message'] == 'wpos_anylc_promotion' && !empty($_GET['wpos_anylc_pdt']) && !empty($_GET['wpos_anylc_promo_pdt']) ) {
$promotion = 1;
$wpos_anylc_promo_pdt = sanitize_text_field( $_GET['wpos_anylc_promo_pdt'] );
$promotion_pdt = explode( ',', $wpos_anylc_promo_pdt );
$anylc_pdt = sanitize_text_field( $_GET['wpos_anylc_pdt'] );
$anylc_pdt_data = isset( $wpos_analytics_product[ $anylc_pdt ] ) ? $wpos_analytics_product[ $anylc_pdt ] : false;
if( !empty($promotion_pdt) ) {
foreach ($promotion_pdt as $pdt_key => $pdt) {
if( isset( $anylc_pdt_data['promotion'][$pdt]['file'] ) ) {
$promotion_pdt_data[] = '<a href="'.$anylc_pdt_data['promotion'][$pdt]['file'].'">'.$anylc_pdt_data['promotion'][$pdt]['name'].'</a>';
}
}
}
if( $promotion_pdt_data ) {
echo '<div class="updated notice wpos-anylc-optin-notice is-dismissible" style="display:block !important;">
<p><strong>Your Download has been started. In case if it is intrupted then download it from here. '.join(' | ', $promotion_pdt_data).'</strong></p>
</div>';
}
}
}
/**
* Analytic Optout Popup HTML
*
* @package Wpos Analytic
* @since 1.0
*/
function wpos_anylc_optout_popup() {
global $pagenow, $wpos_analytics_module;
if( $pagenow == 'plugins.php' && !empty( $wpos_analytics_module ) ) {
foreach ($wpos_analytics_module as $module_key => $module) {
$opt_in_data = wpos_anylc_get_option( $module['anylc_optin'] );
$opt_in = isset( $opt_in_data['status'] ) ? $opt_in_data['status'] : false;
// If user has opt in
if( $opt_in == 1 ) {
// Creating redirect URL
$plugin_status = isset( $_GET['plugin_status'] ) ? sanitize_text_field( $_GET['plugin_status'] ) : false;
$paged = isset( $_GET['paged'] ) ? sanitize_text_field( $_GET['paged'] ) : false;
$s = isset( $_GET['s'] ) ? sanitize_text_field( $_GET['s'] ) : false;
$redirect_url = add_query_arg( array( 'plugin_status' => $plugin_status, 'paged' => $paged, 's' => $s, 'wpos_anylc_pdt' => $module['slug'] ), admin_url( 'plugins.php' ) );
$redirect_url = wp_nonce_url( $redirect_url, 'wpos_anylc_act'.'|'.$module['slug'] );
// Form Data
$optin_form_data = wpos_anylc_optin_data( $module['slug'], $redirect_url );
include( WPOS_ANYLC_DIR .'/templates/optout-popup.php' );
}
}
}
}
/**
* Analytic Action Process
*
* @package Wpos Analytic
* @since 1.0
*/
function wpos_anylc_action_process() {
// Skip if not admin area
if ( !is_admin() ) {
return false;
}
if( !empty($_GET['wpos_anylc_action']) && isset($_GET['_wpnonce']) ) {
global $wpos_analytics_product;
$anylc_pdt = !empty( $_GET['wpos_anylc_pdt'] ) ? sanitize_text_field( $_GET['wpos_anylc_pdt'] ) : '';
$anylc_pdt = ( ! $anylc_pdt && !empty( $_GET['page'] ) ) ? sanitize_text_field( $_GET['page'] ) : $anylc_pdt;
$anylc_pdt_data = isset( $wpos_analytics_product[ $anylc_pdt ] ) ? $wpos_analytics_product[ $anylc_pdt ] : false;
// If valid product data found
if( $anylc_pdt_data ) {
// Process Optin
if( $_GET['wpos_anylc_action'] == 'optin' ) {
// Verify nonce
if( ! wp_verify_nonce( $_GET['_wpnonce'], 'wpos_anylc_act' ) ) {
wp_die( __('Sorry, Something happened wrong.', 'wpos_analytic'), 'wpos_anylc_err', array('back_link' => true) );
}
$opt_in_data = wpos_anylc_update_option( $anylc_pdt_data['anylc_optin'], array('status' => 1) );
// Redirect to original menu
$redirect_url = wpos_anylc_pdt_url( $anylc_pdt_data, 'offer-promotion' );
if( $redirect_url ) {
wp_redirect( $redirect_url );
exit;
}
}
// Process Skip
if( $_GET['wpos_anylc_action'] == 'skip' ) {
// Verify nonce
if( ! wp_verify_nonce( $_GET['_wpnonce'], 'wpos_anylc_act' ) ) {
wp_die( __('Sorry, Something happened wrong.', 'wpos_analytic'), 'wpos_anylc_err', array('back_link' => true) );
}
$opt_in_data = wpos_anylc_update_option( $anylc_pdt_data['anylc_optin'], array('status' => 2) );
// Redirect to original menu
$redirect_url = wpos_anylc_pdt_url( $anylc_pdt_data, 'offer' );
if( $redirect_url ) {
wp_redirect( $redirect_url );
exit;
}
}
// Process Opt Out
if( $_GET['wpos_anylc_action'] == 'optout' ) {
// Verify nonce
if( ! wp_verify_nonce( $_GET['_wpnonce'], 'wpos_anylc_act'.'|'.$_GET['wpos_anylc_pdt'] ) ) {
wp_die( __('Sorry, Something happened wrong.', 'wpos_analytic'), 'wpos_anylc_err', array('back_link' => true) );
}
$opt_in_data = wpos_anylc_update_option( $anylc_pdt_data['anylc_optin'], array('status' => 0) );
// Redirect with success message
$redirect_url = add_query_arg( array( 'message' => 'optout_success', 'wpos_anylc_action' => false, 'wpos_anylc_pdt' => false, '_wpnonce' => false ) );
if( $redirect_url ) {
wp_redirect( $redirect_url );
exit;
}
}
}
} // End of main if
}
}
$wpos_anylc_admin = new Wpos_Anylc_Admin();

View File

@ -0,0 +1,65 @@
<?php
/**
* Script Class
*
* Handles the script and style
*
* @package Wpos Analytic
* @since 1.0
*/
if ( !defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
class Wpos_Anylc_Script {
function __construct() {
// Action to add style backend
add_action( 'admin_enqueue_scripts', array($this, 'wpos_anylc_admin_script_style') );
}
/**
* Enqueue script for backend
*
* @package Wpos Analytic
* @since 1.0
*/
function wpos_anylc_admin_script_style( $hook ) {
// Process Promotion Data
if( !empty($_GET['message']) && $_GET['message'] == 'wpos_anylc_promotion' && !empty($_GET['wpos_anylc_pdt']) && !empty($_GET['wpos_anylc_promo_pdt']) ) {
global $wpos_analytics_product;
$promotion = 1;
$wpos_anylc_promo_pdt = sanitize_text_field( $_GET['wpos_anylc_promo_pdt'] );
$promotion_pdt = explode( ',', $wpos_anylc_promo_pdt );
$anylc_pdt = sanitize_text_field( $_GET['wpos_anylc_pdt'] );
$anylc_pdt_data = isset( $wpos_analytics_product[ $anylc_pdt ] ) ? $wpos_analytics_product[ $anylc_pdt ] : false;
if( !empty($promotion_pdt) ) {
foreach ($promotion_pdt as $pdt_key => $pdt) {
if( isset( $anylc_pdt_data['promotion'][$pdt]['file'] ) ) {
$promotion_pdt_data[] = $anylc_pdt_data['promotion'][$pdt]['file'];
}
}
}
}
// Registring admin Style
wp_register_style( 'wpos-anylc-admin-style', WPOS_ANYLC_URL.'assets/css/wpos-anylc-admin.css', null, WPOS_ANYLC_VERSION );
wp_enqueue_style( 'wpos-anylc-admin-style' );
// Registring admin script
wp_register_script( 'wpos-anylc-admin-script', WPOS_ANYLC_URL.'assets/js/wpos-anylc-admin.js', array('jquery'), WPOS_ANYLC_VERSION, true );
wp_localize_script( 'wpos-anylc-admin-script', 'WposAnylc', array(
'promotion' => isset($promotion) ? 1 : 0,
'promotion_pdt' => isset( $promotion_pdt_data ) ? $promotion_pdt_data : 0,
));
wp_enqueue_script( 'wpos-anylc-admin-script' );
}
}
$wpos_anylc_script = new Wpos_Anylc_Script();

View File

@ -0,0 +1,329 @@
<?php
/**
* Common Functions
*
* @package Wpos Analytic
* @since 1.0
*/
if ( !defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/**
* Retrieve the translation of $text.
*
* @package Wpos Analytic
* @since 1.0
*/
function wpos_anylc_text( $text, $echo = false ) {
if( $echo ) {
_e( $text, '' );
} else {
__( $text, '' );
}
}
/**
* Clean variables using sanitize_text_field. Arrays are cleaned recursively.
* Non-scalar values are ignored.
*
* @since 1.0
*/
function wpos_anylc_clean( $var ) {
if ( is_array( $var ) ) {
return array_map( 'wpos_anylc_clean', $var );
} else {
$data = is_scalar( $var ) ? sanitize_text_field( $var ) : $var;
return wp_unslash($data);
}
}
/**
* Check Multidimention Array
*
* @package Wpos Analytic
* @since 1.0
*/
function wpos_anylc_is_multi_arr( $arr ) {
rsort( $arr );
return isset( $arr[0] ) && is_array( $arr[0] );
}
/**
* Get site unique id
*
* @package Wpos Analytic
* @since 1.0.0
*/
function wpos_anylc_site_uid() {
$site_uid = get_option( 'wpos_anylc_site_uid' );
// Generate new site id if not exist
if( empty( $site_uid ) ) {
$site_url = untrailingslashit( get_bloginfo('wpurl') );
$site_uid = md5( $site_url . SECURE_AUTH_KEY );
update_option( 'wpos_anylc_site_uid', $site_uid );
}
return $site_uid;
}
/**
* Get Optin Data
*
* @package Wpos Analytic
* @since 1.0.0
*/
function wpos_anylc_optin_data( $anylc_pdt = false, $return_url = '' ) {
// Skip if not admin area
if ( !is_admin() ) {
return false;
}
global $current_user, $wpos_analytics_product;
// Takind some data
$theme_data = wp_get_theme();
$page = isset( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : false;
// If product is not passed
if( ! $anylc_pdt ) {
$anylc_pdt = !empty( $_GET['wpos_anylc_pdt'] ) ? sanitize_text_field( $_GET['wpos_anylc_pdt'] ) : '';
$anylc_pdt = ( ! $anylc_pdt && !empty( $_GET['page'] ) ) ? sanitize_text_field( $_GET['page'] ) : $anylc_pdt;
}
// If a valid product is there
if( $anylc_pdt && !empty( $wpos_analytics_product[ $anylc_pdt ] ) ) {
$analy_product = $wpos_analytics_product[ $anylc_pdt ];
if( empty( $return_url ) ) {
$return_url = add_query_arg( array( 'page' => $page ), admin_url('admin.php') );
$return_url = wp_nonce_url( $return_url, 'wpos_anylc_act' );
}
// Getting data according to type
if( $analy_product['type'] == 'theme' ) {
$product_name = $theme_data->get( 'Name' );
$product_version = $theme_data->get( 'Version' );
} else {
if( !function_exists('get_plugin_data') ) {
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
}
$plugin_data = get_plugin_data( trailingslashit(WP_PLUGIN_DIR) . $analy_product['file'] );
$product_name = !empty( $plugin_data['Name'] ) ? $plugin_data['Name'] : '';
$product_version = !empty( $plugin_data['Version'] ) ? $plugin_data['Version'] : '';
}
}
$optin_data = array(
'site_url' => untrailingslashit( get_bloginfo('wpurl') ),
'site_name' => get_bloginfo( 'name' ),
'wp_version' => get_bloginfo( 'version' ),
'language' => get_bloginfo( 'language' ),
'is_rtl' => is_rtl() ? 1 : 0,
'php_version' => phpversion(),
'sdk_version' => WPOS_ANYLC_VERSION,
'product_name' => isset( $product_name ) ? $product_name : '',
'product_version' => isset( $product_version ) ? $product_version : '',
'product_id' => !empty( $analy_product['id'] ) ? $analy_product['id'] : 0,
'product_type' => !empty( $analy_product['type'] ) ? $analy_product['type'] : '',
'theme_name' => $theme_data->get( 'Name' ),
'theme_uri' => $theme_data->get( 'ThemeURI' ),
'theme_author' => $theme_data->get( 'Author' ),
'theme_author_uri' => $theme_data->get( 'AuthorURI' ),
'theme_version' => $theme_data->get( 'Version' ),
'user_firstname' => $current_user->user_firstname,
'user_lastname' => $current_user->user_lastname,
'user_nickname' => $current_user->user_nicename,
'user_email' => get_bloginfo( 'admin_email' ),
'ip_address' => wpos_anylc_get_ip_address(),
'site_uid' => wpos_anylc_site_uid(),
'return_url' => $return_url,
);
return $optin_data;
}
/**
* Get IP Address
*
* @package Wpos Analytic
* @since 1.0.0
*/
function wpos_anylc_get_ip_address() {
if ( isset( $_SERVER['HTTP_X_REAL_IP'] ) ) { // WPCS: input var ok, CSRF ok.
return sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_REAL_IP'] ) ); // WPCS: input var ok, CSRF ok.
} elseif ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { // WPCS: input var ok, CSRF ok.
// Proxy servers can send through this header like this: X-Forwarded-For: client1, proxy1, proxy2
// Make sure we always only send through the first IP in the list which should always be the client IP.
return (string) rest_is_ip_address( trim( current( preg_split( '/[,:]/', sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) ) ) ) ); // WPCS: input var ok, CSRF ok.
} elseif ( isset( $_SERVER['REMOTE_ADDR'] ) ) { // @codingStandardsIgnoreLine
return sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ); // @codingStandardsIgnoreLine
}
return '127.0.0.1';
}
/**
* Get Product Optin Data
*
* @package Wpos Analytic
* @since 1.0.0
*/
function wpos_anylc_get_option( $key = '' ) {
$opt_in_data = array();
if( !empty( $key ) ) {
$opt_in_data = get_option( $key );
$opt_in_data = ( !empty($opt_in_data) && is_array($opt_in_data) ) ? $opt_in_data : array();
}
return $opt_in_data;
}
/**
* Get Product Optin Data
*
* @package Wpos Analytic
* @since 1.0.0
*/
function wpos_anylc_update_option( $key = '', $data = array() ) {
$opt_in_data = array();
if( !empty( $key ) ) {
$opt_in_data = wpos_anylc_get_option( $key );
if( is_array($data) ) {
$opt_in_data = array_merge( $opt_in_data, $data );
update_option( $key, $opt_in_data );
}
}
return $opt_in_data;
}
/**
* Get Analytic Product Optin URL
*
* @package Wpos Analytic
* @since 1.0.0
*/
function wpos_anylc_optin_url( $module_data = '', $optin_status = null ) {
$optin_url = false;
// Optin Status
if( ! isset( $optin_status ) ) {
$opt_in_data = get_option( $module_data['anylc_optin'] );
$optin_status = isset( $opt_in_data['status'] ) ? $opt_in_data['status'] : null;
}
if( !empty( $module_data['menu'] ) && !empty( $module_data['slug'] ) ) {
$url_data = parse_url( $module_data['menu'], PHP_URL_QUERY );
$query_data = !empty( $url_data ) ? parse_str( $url_data, $query_arr ) : array();
if( !empty( $query_arr['post_type'] ) && $optin_status >= 0 ) { // If Optin is done and post type menu
$optin_url = add_query_arg( array( 'post_type' => $query_arr['post_type'], 'page' => $module_data['slug'], 'anylc_optin_menu' => true ), admin_url('edit.php') );
} else if( empty( $query_arr['post_type'] ) && $optin_status >= 0 ) { // If Optin is done and simple admin menu
$optin_url = add_query_arg( array( 'page' => $module_data['slug'], 'anylc_optin_menu' => true ), admin_url('admin.php') );
} else {
$optin_url = add_query_arg( array( 'page' => $module_data['slug'] ), admin_url('admin.php') );
}
}
return $optin_url;
}
/**
* Get Analytic Product Opt Out URL
*
* @package Wpos Analytic
* @since 1.0.0
*/
function wpos_anylc_optout_url( $module_data = '', $optin_status = null, $redirect_url = false ) {
$opt_out_link = false;
// Optin Status
if( !isset( $optin_status ) ) {
$opt_in_data = get_option( $module_data['anylc_optin'] );
$optin_status = isset( $opt_in_data['status'] ) ? $opt_in_data['status'] : null;
}
if( $optin_status == 1 ) {
if( ! $redirect_url ) {
$plugin_status = isset( $_GET['plugin_status'] ) ? sanitize_text_field( $_GET['plugin_status'] ) : false;
$paged = isset( $_GET['paged'] ) ? sanitize_text_field( $_GET['paged'] ) : false;
$s = isset( $_GET['s'] ) ? sanitize_text_field( $_GET['s'] ) : false;
$redirect_url = add_query_arg( array( 'plugin_status' => $plugin_status, 'paged' => $paged, 's' => $s ), admin_url( 'plugins.php' ) );
}
$opt_out_link = add_query_arg( array( 'wpos_anylc_action' => 'optout', 'wpos_anylc_pdt' => $module_data['slug'], 'redirect' => $redirect_url ), $redirect_url );
$opt_out_link = wp_nonce_url( $opt_out_link, 'wpos_anylc_act'.'|'.$module_data['slug'] );
}
return $opt_out_link;
}
/**
* Get Analytic Product URL
*
* @package Wpos Analytic
* @since 1.0.0
*/
function wpos_anylc_pdt_url( $module_data = '', $type = false ) {
$redirect_url = false;
if( !empty( $module_data['menu'] ) ) {
$pos = strpos( $module_data['menu'], '?post_type' );
$redirect_url = ( $pos !== false ) ? admin_url( $module_data['menu'] ) : add_query_arg( array( 'page' => $module_data['menu'] ), admin_url('admin.php') );
switch ( $type ) {
case 'promotion':
$promotion = !empty( $_GET['promotion'] ) ? wpos_anylc_clean( $_GET['promotion'] ) : '';
if( !empty( $promotion ) ) {
$promotion = is_array( $promotion ) ? implode( ',', $promotion ) : $promotion;
$redirect_url = add_query_arg( array( 'message' => 'wpos_anylc_promotion', 'wpos_anylc_pdt' => $module_data['slug'], 'wpos_anylc_promo_pdt' => $promotion ), $redirect_url );
}
break;
case 'offer':
if( !empty( $module_data['offers'] ) ) {
$redirect_url = add_query_arg( array( 'page' => $module_data['slug'].'-offers' ), $redirect_url );
}
break;
case 'offer-promotion':
$promotion = !empty( $_GET['promotion'] ) ? wpos_anylc_clean( $_GET['promotion'] ) : '';
if( !empty( $module_data['offers'] ) ) {
$redirect_url = add_query_arg( array( 'page' => $module_data['slug'].'-offers' ), $redirect_url );
}
if( !empty( $promotion ) ) {
$promotion = is_array( $promotion ) ? implode( ',', $promotion ) : $promotion;
$redirect_url = add_query_arg( array( 'message' => 'wpos_anylc_promotion', 'wpos_anylc_pdt' => $module_data['slug'], 'wpos_anylc_promo_pdt' => $promotion ), $redirect_url );
}
break;
}
}
return $redirect_url;
}

View File

@ -0,0 +1,94 @@
<?php
/**
* Settings Page
*
* @package Wpos Analytic
* @since 1.0.0
*/
if ( !defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
?>
<style type="text/css">
.notice, .error, div.fs-notice.updated, div.fs-notice.success, div.fs-notice.promotion{display:none !important;}
</style>
<div class="wrap wpos-anylc-optin">
<?php if( isset($_GET['error']) && $_GET['error'] == 'wpos_anylc_error' ) { ?>
<div class="error">
<p><strong>Sorry, Something happened wrong. Please contact us on <a href="mailto:support@wponlinesupport.com">support@wponlinesupport.com</a></strong></p>
</div>
<?php } ?>
<form method="POST" action="https://analytics.wponlinesupport.com">
<div class="wpos-anylc-optin-wrap">
<div class="wpos-anylc-optin-icon-wrap">
<div class="wpos-anylc-optin-icon wpos-anylc-wp-badge"><i class="dashicons dashicons-wordpress"></i></div>
<div class="wpos-anylc-optin-plus"><i class="dashicons dashicons-plus"></i></div>
<div class="wpos-anylc-optin-icon"><img src="<?php echo $analy_product['icon']; ?>" alt="Icon" /></div>
<div class="wpos-anylc-optin-plus"><i class="dashicons dashicons-plus"></i></div>
<div class="wpos-anylc-optin-icon"><img src="<?php echo $analy_product['brand_icon']; ?>" alt="Icon" /></div>
</div>
<div class="wpos-anylc-optin-cnt">
<p>Hey <?php echo ucfirst($user_name); ?>,</p>
<p>Don't ever miss an opportunity to <b>opt in</b> for Email Notifications / Announcements about exciting New Features and Update Releases.</p>
<p>Contribute in helping us making <b><?php echo $product_name; ?></b> compatible with most themes and plugins by allowing to share non-sensitive data to <a target="_blank" href="<?php echo WTPSW_SITE_LINK; ?>">essentialplugin.com</a> about your website.</p>
<p>If you skip this, that's okay! <b><?php echo $product_name; ?></b> will still work just fine.</p>
<?php if( !empty( $analy_product['promotion'] ) ) { ?>
<div class="wpos-anylc-promotion-wrap">
<?php foreach( $analy_product['promotion'] as $promotion_key => $promotion_data ) { ?>
<div><label><input type="checkbox" value="<?php echo $promotion_key; ?>" name="promotion[]" checked="checked" /> <?php echo $promotion_data['name']; ?></label></div>
<?php } ?>
</div>
<?php } ?>
</div>
<div class="wpos-anylc-optin-action wpos-anylc-clearfix">
<button type="submit" name="wpos_anylc_optin" class="button button-primary button-large right wpos-anylc-allow-btn" value="wpos_anylc_optin">Allow and Continue</button>
<?php if( is_null( $opt_in ) ) { ?>
<button type="submit" name="wpos_anylc_action" class="button button-secondary button-large wpos-anylc-skip-btn" value="skip">Skip</button>
<?php }
if( ! empty( $optin_form_data ) ) {
foreach ($optin_form_data as $data_key => $data_value) {
echo '<input type="hidden" name="'.esc_attr( $data_key ).'" value="'.esc_attr( $data_value ).'" />';
}
}
?>
</div>
<div class="wpos-anylc-optin-permission">
<a class="wpos-anylc-permission-toggle" href="javascript:void(0);">What permissions are being granted?</a>
<div class="wpos-anylc-permission-wrap wpos-anylc-hide">
<div class="wpos-anylc-permission">
<i class="dashicons dashicons-admin-users"></i>
<div>
<span class="wpos-anylc-permission-name">Your Profile Overview</span>
<span class="wpos-anylc-permission-info">Name and email address</span>
</div>
</div>
<div class="wpos-anylc-permission">
<i class="dashicons dashicons-admin-settings"></i>
<div>
<span class="wpos-anylc-permission-name">Your Site Overview</span>
<span class="wpos-anylc-permission-info">Site URL, WP version, PHP info & Theme</span>
</div>
</div>
<div class="wpos-anylc-permission">
<i class="dashicons dashicons-admin-plugins"></i>
<div>
<span class="wpos-anylc-permission-name">Current Plugin Events</span>
<span class="wpos-anylc-permission-info">Activation, Deactivation and Uninstall</span>
</div>
</div>
</div>
</div>
<div class="wpos-anylc-terms">
<a href="https://www.wponlinesupport.com/privacy-policy/#free-pluign-info" target="_blank">Privacy Policy</a> - <a href="https://www.wponlinesupport.com/term-and-condition/" target="_blank">Terms of Service</a>
</div>
</div>
</form>
</div><!-- end .wrap -->

View File

@ -0,0 +1,73 @@
<?php
/**
* Offers Page
*
* @package Wpos Analytic
* @since 1.0.0
*/
if ( !defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
?>
<style type="text/css">
.notice, .error, div.fs-notice.updated, div.fs-notice.success, div.fs-notice.promotion{display:none !important;}
</style>
<div class="wrap wpos-anylc-offers">
<?php foreach ($analy_product['offers'] as $offer_key => $offer_data) {
// If status wise offer is there
if( wpos_anylc_is_multi_arr( $offer_data ) ) {
$offer_data = isset( $offer_data[ $opt_in ] ) ? $offer_data[ $opt_in ] : false;
}
if( empty( $offer_data ) ) {
continue;
}
$has_offer = true;
$link = isset( $offer_data['link'] ) ? $offer_data['link'] : '';
$image = !empty( $offer_data['image'] ) ? add_query_arg( array('v' => time()), $offer_data['image'] ) : '';
?>
<div class="wpos-anylc-offer-wrap">
<?php if( !empty( $offer_data['name'] ) ) { ?>
<div class="wpos-anylc-offer-title wpos-anylc-center"><?php echo $offer_data['name']; ?></div>
<?php } ?>
<?php if( $image ) { ?>
<div class="wpos-anylc-offer-body wpos-anylc-center">
<?php if( $link ) { ?>
<a href="<?php echo esc_url( $link ); ?>" target="_blank">
<img src="<?php echo esc_url( $image ); ?>" alt="" />
</a>
<?php } else { ?>
<img src="<?php echo esc_url( $image ); ?>" alt="" />
<?php } ?>
</div>
<?php } ?>
<?php if( !empty( $offer_data['desc'] ) ) { ?>
<div class="wpos-anylc-offer-desc wpos-anylc-center"><?php echo wpautop( $offer_data['desc'] ); ?></div>
<?php } ?>
<?php if( !empty( $offer_data['button'] ) ) { ?>
<div class="wpos-anylc-offer-footer wpos-anylc-center"><a href="<?php echo esc_url( $link ); ?>" class="button button-primary button-large wpos-anylc-btn" target="_blank"><?php echo $offer_data['button']; ?></a></div>
<?php } ?>
</div>
<?php } // End of foreach
// If no offer to display then redirect to main plugin screen
if( empty( $has_offer ) ) {
$redirect_url = wpos_anylc_pdt_url( $analy_product ); // Redirect URL
?>
Please Wait... Redirecting to plugin screen. <a href="<?php echo $redirect_url; ?>">Click Here</a> in case you are not auto redirect.
<script type="text/javascript">
window.location = "<?php echo $redirect_url; ?>";
</script>
<?php } ?>
</div><!-- end .wrap -->

View File

@ -0,0 +1,40 @@
<?php
/**
* Analytic Optout Popup
*
* @package Wpos Analytic
* @since 1.0
*/
if ( !defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
?>
<div class="wpos-anylc-popup wpos-anylc-popup-wrp wpos-anylc-hide" id="wpos-anylc-optout-<?php echo $module['id']; ?>">
<div class="wpos-anylc-popup-inr-wrp">
<div class="wpos-anylc-popup-block">
<div class="wpos-anylc-popup-header">Opt Out</div>
<div class="wpos-anylc-popup-body">
<p class="wpos-anylc-popup-heading">We appreciate your help to make the plugin better by letting us track some usage data.</p>
<p>Usage tracking is done in the name of making <b><?php echo $module['name']; ?></b> better. Making a better user experience, prioritizing new features, and more good things. We'd really appreciate if you'll reconsider letting us continue with the tracking.</p>
<p>By clicking "Opt Out", we will no longer be sending any data from <b><?php echo $module['name']; ?></b> to <a href="<?php echo WTPSW_SITE_LINK; ?>" target="_blank">essentialplugin.com</a>.</p>
</div>
<div class="wpos-anylc-popup-footer">
<form method="POST" action="https://analytics.wponlinesupport.com">
<?php
if( ! empty( $optin_form_data ) ) {
foreach ($optin_form_data as $data_key => $data_value) {
echo '<input type="hidden" name="'.esc_attr( $data_key ).'" value="'.esc_attr( $data_value ).'" />';
}
}
?>
<button type="submit" name="wpos_anylc_action" class="button button-secondary" value="optout">Opt Out</button>
<button type="button" class="button button-primary wpos-anylc-popup-close">Sure, Let Me Continue Helping</button>
</form>
</div>
</div><!-- end .wpos-anylc-popup-block -->
</div><!-- end .wpos-anylc-popup-inr-wrp -->
</div><!-- end .wpos-anylc-popup-wrp -->
<div class="wpos-anylc-popup-overlay" id="wpos-anylc-optout-overlay-<?php echo $module['id']; ?>"></div>

View File

@ -0,0 +1,251 @@
<?php
/**
* WPOS Analytics
*
* @author WP Online Support
* @package Wpos Analytic
* @since 1.0
*/
if ( !defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
if ( ! class_exists( 'WPOS_Analytics' ) ) :
/**
* Main Analytics Class By WP Online Support.
*
* @since 1.0
*/
final class WPOS_Analytics {
/**
* @var Instance
* @since 1.0
*/
protected static $instance = null;
/**
* Main Analytics 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_ANYLC::setup_constants() Setup the constants needed.
* @uses WPOS_ANYLC::includes() Include the required files.
* @uses WPOS_ANYLC::wpos_anylc_plugins_loaded() load the language files.
* @see PWPC()
* @return object The one true Analytics
*/
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&#8217; huh?', 'pwpc' ), '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&#8217; huh?', 'pwpc' ), '1.0' );
}
/**
* Plugin Constructor.
*/
public function __construct() {
$this->setup_constants();
$this->includes();
do_action( 'wpos_anylc_loaded' );
}
/**
* 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_ANYLC_VERSION', '1.1' );
$this->define( 'WPOS_ANYLC_DIR', plugin_dir_path( __FILE__ ) );
$this->define( 'WPOS_ANYLC_URL', plugin_dir_url( __FILE__ ) );
}
/**
* Include required files.
*
* @access private
* @since 1.0
*/
private function includes() {
// Functions file
require_once WPOS_ANYLC_DIR .'/includes/wpos-anylc-function.php';
// Script Class
require_once WPOS_ANYLC_DIR .'/includes/class-anylc-script.php';
// Admin Class
require_once WPOS_ANYLC_DIR .'/includes/class-anylc-admin.php';
}
}
/**
*
* The main function responsible for returning the one true Analytics
* Instance to functions everywhere.
*
* Use this function like you would a global variable, except without needing
* to declare the global.
*
* Example: <?php $wpos_anylc = WPOS_ANYLC(); ?>
*
* @since 1.0
* @return object The one true Analytics Instance.
*/
function WPOS_ANYLC() {
return WPOS_Analytics::instance();
}
/**
*
* Initialize Analytics Module
*
* @since 1.0
* @return object The one true Analytics Instance.
*/
function wpos_anylc_init_module( $args = array() ) {
global $wpos_analytics_module, $wpos_analytics_product;
$defaul_args = array(
'id' => null,
'file' => null,
'name' => null,
'slug' => null,
'type' => 'plugin',
'menu' => false,
'icon' => '',
'text_domain' => 'wpos_analytics',
);
$args = wp_parse_args( $args, $defaul_args );
// If required data is not there then simply return
if( empty($args['id']) || empty( $args['file'] ) || empty( $args['slug'] ) ) {
return false;
}
// Additional args
$promotion = array();
$args['dir'] = pathinfo($args['file'], PATHINFO_DIRNAME);
$args['icon'] = empty( $icon ) ? trailingslashit( WP_PLUGIN_URL ).$args['dir'].'/wpos-analytics/assets/images/icon.png' : $args['icon'];
$args['brand_icon'] = plugin_dir_url( __FILE__ ).'assets/images/wpos-logo.png';
$args['anylc_optin'] = 'wpos_anylc_pdt_'.$args['id'];
if( isset( $args['promotion'] ) ) {
foreach ($args['promotion'] as $promotion_key => $promotion_data) {
if( empty( $promotion_data['name'] ) || empty( $promotion_data['file'] ) ) {
continue;
}
$promotion[$promotion_key] = $promotion_data;
}
}
$args['promotion'] = $promotion;
// Taking some variables
$wpos_analytics_module = !empty( $wpos_analytics_module ) ? $wpos_analytics_module : array();
$wpos_analytics_product = !empty( $wpos_analytics_product ) ? $wpos_analytics_product : array();
if( is_array( $wpos_analytics_module ) ) {
$wpos_analytics_module[ $args['file'] ] = $args;
}
if( is_array( $wpos_analytics_product ) ) {
$wpos_analytics_product[ $args['slug'] ] = $args;
}
return $wpos_analytics_module;
}
/**
*
* Function on any plugin deactivation
*
* @since 1.0
* @return object The one true Analytics Instance.
*/
function wpos_anylc_plugin_activation( $plugin, $network_activation ) {
// return if activating from network, or bulk
if ( is_network_admin() ) {
return;
}
global $wpos_analytics_module;
if( isset( $wpos_analytics_module[ $plugin ] ) ) {
$opt_in_data = get_option( $wpos_analytics_module[ $plugin ]['anylc_optin'] );
$optin_status = isset( $opt_in_data['status'] ) ? $opt_in_data['status'] : -1;
if( $optin_status == -1 ) {
$redirect_link = add_query_arg( array('page' => $wpos_analytics_module[ $plugin ]['slug']), admin_url('admin.php') );
update_option( 'wpos_anylc_redirect', $redirect_link );
}
}
}
add_action( 'activated_plugin', 'wpos_anylc_plugin_activation', 10, 2 );
/**
*
* Initialize Analytics Class Once all stuff has been loaded
*
* @since 1.0
* @return object The one true Analytics Instance.
*/
function wpos_anylc_plugins_loaded() {
// Get Analytics Running.
WPOS_ANYLC();
}
add_action( 'plugins_loaded', 'wpos_anylc_plugins_loaded', 12 );
endif; // End if class_exists check.

View File

@ -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;}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

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

View File

@ -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();

View File

@ -0,0 +1,326 @@
<?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 _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-marketing"><a href="javascript:void(0);" class="espbw-filter-link" data-filter="marketing"><?php esc_html_e('Inbound Marketing', '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&amp;plugin=' . $plugin_data['slug'] . '&amp;TB_iframe=true&amp;width=600&amp;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 _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 -->

View File

@ -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();

View File

@ -0,0 +1,258 @@
<?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',
),
'inboundwp-lite' => array(
'class' => 'espbw-marketing',
'tags' => 'Spin Wheel, WhatsApp chat Support, Inbound, Inbound marketing, Better Heading, Social Proof, Testimonial, Review, Deal Countdown Timer, Marketing PopUp',
),
'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;
}

File diff suppressed because one or more lines are too long

View File

@ -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&#8217; 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&#8217; 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: <?php $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