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

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 @@
.slick-loading .slick-list{background:#fff url(../images/ajax-loader.gif) center center no-repeat}.slick-slider{position:relative;display:block;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:0}.slick-list.dragging{cursor:pointer;cursor:hand}.slick-slider .slick-list,.slick-slider .slick-track{-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;margin-left:auto;margin-right:auto}.slick-track:after,.slick-track:before{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,109 @@
.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-clearfix:before, .wtpsw-clearfix:after {content: "";display: table;}
.wtpsw-clearfix::after {clear: both;}
.wtpsw-post-slider, .wtpsw-post-carousel{visibility: hidden; opacity:0; transition:opacity 0.5s linear; }
.wtpsw-post-slider.slick-initialized, .wtpsw-post-carousel.slick-initialized{ visibility: visible; opacity:1; }
/* Svg Img CSS */
.wtpsw-post-slider .slick-arrow, .wtpsw-post-carousel .slick-arrow{position:absolute; top: 38%; z-index:9; padding:0; margin:0px; display: inline-block; background-color: rgba(255,255,255,0.7); text-align:center; width:30px; height:40px; cursor: pointer;}
.wtpsw-post-slider .slick-arrow svg, .wtpsw-post-carousel .slick-arrow svg{fill: #000; height: 100%; width: 100%;}
.wtpsw-post-carousel.design-1 .slick-arrow {margin: 0 0.9375em;}
.wtpsw-post-slider.design-1 .slick-next, .wtpsw-post-carousel.design-1 .slick-next {right:0px;}
.wtpsw-post-slider.design-1 .slick-prev, .wtpsw-post-carousel.design-1 .slick-prev{left:0px;}
.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-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-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;}
/* Plugin Fixes CSS */
.fusion-flex-container.wtpsw-fusion-flex{ flex-direction: column; }
.wtpsw-elementor-tab-wrap{min-width: 0; min-height: 0;}
/* 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-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-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: 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

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: 295 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,91 @@
( function($) {
'use strict';
jQuery(window).on('elementor/frontend/init', function() {
elementorFrontend.hooks.addAction( 'frontend/element_ready/wp-widget-text.default', wtpsw_elementor_init );
elementorFrontend.hooks.addAction( 'frontend/element_ready/shortcode.default', wtpsw_elementor_init );
elementorFrontend.hooks.addAction( 'frontend/element_ready/text-editor.default', wtpsw_elementor_init );
/* Tabs Element */
elementorFrontend.hooks.addAction( 'frontend/element_ready/tabs.default', function($scope) {
if( $scope.find('.wtpsw-post-slider-init').length >= 1 ) {
$scope.find('.elementor-tabs-content-wrapper').addClass('wtpsw-elementor-tab-wrap');
} else {
$scope.find('.elementor-tabs-content-wrapper').removeClass('wtpsw-elementor-tab-wrap');
}
/* 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_elementor_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_elementor_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_elementor_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);
});
});
});
/**
* Initialize Plugin Functionality
*/
function wtpsw_elementor_init() {
wtpsw_trending_slider_init();
wtpsw_trending_carousel_init();
}
})(jQuery);

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,27 @@
( function($) {
"use strict";
/* 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 );
})(jQuery);
/* 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,320 @@
/* Define global Variable */
var wtpsw_next_arrow = '<span class="slick-next slick-arrow" data-role="none" tabindex="0" role="button"><svg fill="currentColor" viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg"><title/><path d="M69.8437,43.3876,33.8422,13.3863a6.0035,6.0035,0,0,0-7.6878,9.223l30.47,25.39-30.47,25.39a6.0035,6.0035,0,0,0,7.6878,9.2231L69.8437,52.6106a6.0091,6.0091,0,0,0,0-9.223Z"/></svg></span>';
var wtpsw_prev_arrow = '<span class="slick-prev slick-arrow" data-role="none" tabindex="0" role="button"><svg fill="currentColor" viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg"><title/><path d="M39.3756,48.0022l30.47-25.39a6.0035,6.0035,0,0,0-7.6878-9.223L26.1563,43.3906a6.0092,6.0092,0,0,0,0,9.2231L62.1578,82.615a6.0035,6.0035,0,0,0,7.6878-9.2231Z"/></svg></span>';
( function($) {
"use strict";
/* 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,
nonce : Wtpsw.data_nonce,
};
$.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 */
/***** Elementor Compatibility Start *****/
if( Wtpsw.elementor_preview == 0 ) {
$(window).on('elementor/frontend/init', function() {
/* Tweak for Slick Slider */
$('.wtpsw-post-slider-init').each(function( index ) {
/* Tweak for Vertical Tab */
$(this).closest('.elementor-tabs-content-wrapper').addClass('wtpsw-elementor-tab-wrap');
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);
});
});
}
$(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').on('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});
$('#'+slider_id).slick( 'setPosition' );
}
}, 200);
});
});
/* 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});
setTimeout(function() {
if( typeof(slider_id) !== 'undefined' && slider_id != '' ) {
$('#'+slider_id).slick( 'setPosition' );
$('#'+slider_id).css({'visibility': 'visible', 'opacity': 1});
$('#'+slider_id).slick( 'setPosition' );
}
}, 200);
});
});
})(jQuery);
/* 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;
}
/* flex Condition */
if(Wtpsw.is_avada == 1) {
jQuery(this).closest('.fusion-flex-container').addClass('wtpsw-fusion-flex');
}
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 ),
nextArrow : wtpsw_next_arrow,
prevArrow : wtpsw_prev_arrow,
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;
}
/* flex Condition */
if(Wtpsw.is_avada == 1) {
jQuery(this).closest('.fusion-flex-container').addClass('wtpsw-fusion-flex');
}
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 ),
nextArrow : wtpsw_next_arrow,
prevArrow : wtpsw_prev_arrow,
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,98 @@
<?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
*
* @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
*
* @since 1.0.0
*/
function wtpsw_settings_page() {
include_once( WTPSW_DIR . '/includes/admin/form/wtpsw-settings.php' );
}
/**
* How It Work Page
*
* @since 1.0.0
*/
function wtpsw_designs_page() {
include_once( WTPSW_DIR . '/includes/admin/wtpsw-how-it-works.php' );
}
/**
* Upgrade to PRO Vs Free
*
* @since 1.0.0
*/
function wtpsw_premium_page() {
include_once( WTPSW_DIR . '/includes/admin/form/premium.php' );
}
/**
* Function register setings
*
* @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
*
* @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,137 @@
<?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><span class="wtpsw-sf-blue">WP Trending Post Slider and Widget </span>Including in <span class="wtpsw-sf-blue">Essential Plugin Bundle</span></h2>
<style>
/* Table CSS */
table, th, td {border: 1px solid #d1d1d1;}
table.wpos-plugin-list{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; margin-bottom: 50px;}
.wpos-plugin-list th {width: 16%; background: #2271b1; color: #fff; }
.wpos-plugin-list td {vertical-align: top;}
.wpos-plugin-type { text-align: left; color: #fff; font-weight: 700; padding: 0 10px; margin: 15px 0; }
.wpos-slider-list { font-size: 14px; font-weight: 500; padding: 0 10px 0 25px; }
.wpos-slider-list li {text-align: left; font-size: 13px; list-style: disc;}
.wtpsw-sf-blue{color:#6c63ff; font-weight:bold;}
.wtpsw-sf-btn{display: inline-block; font-size: 18px; padding: 10px 25px; border-radius: 100px; background-color: #46b450; border-color: #46b450; color: #fff !important; font-weight: 600; text-decoration: none;}
.wtpsw-sf-btn-orange{ background-color: #FF1000; border-color: #FF1000 ;}
.wtpsw-sf-btn:hover,
.wtpsw-sf-btn:focus{background-color: #3fa548; border-color: #3fa548;}
.wtpsw-sf-btn-orange:hover,
.wtpsw-sf-btn-orange:focus {background-color: #D01003 ; border-color: #D01003 ;}
</style>
<div id="poststuff">
<div id="post-body" class="metabox-holder">
<div id="post-body-content">
<div style="text-align: center; background: #DCDCDC; margin: 30px 0; padding: 10px 30px 30px 30px;">
<p style="font-weight: bold !important; font-size:20px !important;"><span style="color: #50c621;">Essential Plugin Bundle</span> + Any Leading Builders (Avada / Elementor / Divi / <br>VC-WPBakery / Site Origin / Beaver) = <span style="background: #50c621;color: #fff;padding: 2px 10px;">WordPress Magic</span></p>
<h4 style="color: #333; font-size: 14px; font-weight: 700;">Over 15K+ Customers Using <span style="color: #50c621 !important;">Essential Plugin Bundle</span></h4>
<a href="<?php echo esc_url( WTPSW_PLUGIN_LINK_UPGRADE ); ?>" target="_blank" class="wtpsw-sf-btn wtpsw-sf-btn-orange"><span class="dashicons dashicons-cart"></span> View Essential Plugin Bundle</a>
</div>
<h2 style="font-size: 24px; text-align: center; color: #6c63ff;">Bundle Deal Details</h2>
<table class="wpos-plugin-list">
<thead>
<tr>
<th><h3 class="wpos-plugin-type">Image Slider</h3></th>
<th><h3 class="wpos-plugin-type">Marketing</h3></th>
<th><h3 class="wpos-plugin-type">Photo Album</h3></th>
<th><h3 class="wpos-plugin-type">Publication</h3></th>
<th><h3 class="wpos-plugin-type">Showcase</h3></th>
<th><h3 class="wpos-plugin-type">WooCommerce</h3></th>
</tr>
<tr>
<td>
<ul class="wpos-slider-list">
<li>Accordion and Accordion Slider</li>
<li>WP Slick Slider and Image Carousel</li>
<li>WP Responsive Recent Post Slider/Carousel</li>
<li>WP Logo Showcase Responsive Slider and Carousel</li>
<li>WP Featured Content and Slider</li>
<li><span style="color:#2271b1; font-weight: bold;">Trending/Popular Post Slider and Widget</span></li>
<li>Timeline and History slider</li>
<li>Meta slider and carousel with lightbox</li>
<li>Post Category Image With Grid and Slider</li>
</ul>
</td>
<td>
<ul class="wpos-slider-list">
<li>Popup Anything - A Marketing Popup and Lead Generation Conversions</li>
<li>Countdown Timer Ultimate</li>
</ul>
</td>
<td>
<ul class="wpos-slider-list">
<li>Album and Image Gallery plus Lightbox</li>
<li>Portfolio and Projects</li>
<li>Video gallery and Player</li>
</ul>
</td>
<td>
<ul class="wpos-slider-list">
<li>WP Responsive Recent Post Slider/Carousel</li>
<li>WP News and Scrolling Widgets</li>
<li>WP Blog and Widget</li>
<li>Blog Designer - Post and Widget</li>
<li><span style="color:#2271b1; font-weight: bold;">Trending/Popular Post Slider and Widget</span></li>
<li>WP Featured Content and Slider</li>
<li>Timeline and History slider</li>
<li>Testimonial Grid and Testimonial Slider plus Carousel with Rotator Widget</li>
<li>Post Ticker Ultimate</li>
<li>Post grid and filter ultimate</li>
</ul>
</td>
<td>
<ul class="wpos-slider-list">
<li>Testimonial Grid and Testimonial Slider plus Carousel with Rotator Widget</li>
<li>Team Slider and Team Grid Showcase plus Team Carousel</li>
<li>Hero Banner Ultimate</li>
<li>WP Logo Showcase Responsive Slider and Carousel</li>
</ul>
</td>
<td>
<ul class="wpos-slider-list">
<li>Product Slider and Carousel with Category for WooCommerce</li>
<li>Product Categories Designs for WooCommerce</li>
<li>Popup Anything - A Marketing Popup and Lead Generation Conversions</li>
<li>Countdown Timer Ultimate</li>
</ul>
</td>
</tr>
</thead>
</table>
<div style="text-align: center; margin-bottom:30px">
<h3 class="wtpsw-sf-blue" style="margin:0; margin-bottom:10px; font-size:24px; font-weight:bold;">Use Essential Plugin Bundle</h3>
<h1 style="font-size: 28px; font-weight: 700; letter-spacing: -1px; text-align: center; padding:0; margin-bottom: 5px;">With Your Favourite Page Builders</h1>
<span style="font-size: 14px; color: #000;">and see how Essential Plugins can help you.</span>
</div>
<div style="text-align: center;">
<img style="width: 100%; margin-bottom:30px;" src="<?php echo esc_url( WTPSW_URL ); ?>assets/images/image-upgrade.png" alt="image-upgrade" title="image-upgrade" />
<div style="font-size: 14px; margin-bottom:10px;"><span class="wtpsw-sf-blue">Trending/Popular Post Slider </span>Including in <span class="wtpsw-sf-blue">Essential Plugin Bundle</span></div>
<a href="<?php echo esc_url( WTPSW_PLUGIN_LINK_UPGRADE ); ?>" target="_blank" class="wtpsw-sf-btn wtpsw-sf-btn-orange"><span class="dashicons dashicons-cart"></span> View Essential Plugin Bundle</a>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,98 @@
<?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 esc_html_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>'.esc_html__( "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 esc_html_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 esc_html_e( 'Post Within', 'wtpsw' ); ?></label>
</th>
<td>
<select id="wtpsw-post-within" class="wtpsw-post-within" name="wtpsw_options[post_range]">
<option value=""><?php esc_attr_e( 'All Time', 'wtpsw' ); ?></option>
<option value="daily" <?php selected( $wtpsw_options['post_range'], 'daily' ); ?>><?php esc_html_e( 'Today', 'wtpsw' ); ?></option>
<option value="last_day" <?php selected( $wtpsw_options['post_range'], 'last_day' ); ?>><?php esc_html_e( 'Last Day', 'wtpsw' ); ?></option>
<option value="last_week" <?php selected( $wtpsw_options['post_range'], 'last_week' ); ?>><?php esc_html_e( 'Last 7 Days', 'wtpsw' ); ?></option>
<option value="last_month" <?php selected( $wtpsw_options['post_range'], 'last_month' ); ?>><?php esc_html_e( 'Last Month', 'wtpsw' ); ?></option>
</select><br/>
<span class="description"><?php esc_html_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 esc_html_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 esc_attr($post_key); ?>" value="<?php echo esc_attr($post_key); ?>" name="wtpsw_options[post_types][]" <?php checked( in_array( $post_key, $tp_support_post_types ), true ); ?> />
<?php echo esc_attr( $post_label ); ?>( <?php echo esc_attr__('Post Type','wtpsw').' : '.esc_attr( $post_key ); ?> )
</label>
</div>
<?php } } ?>
<span class="description"><?php esc_html_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 esc_attr_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,286 @@
<?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-block-editor', 'wp-i18n', 'wp-element', 'wp-components' ), WTPSW_VERSION, true );
wp_localize_script( 'wtpsw-block-js', 'Wtpsw_Block', array(
'pro_demo_link' => 'https://demo.essentialplugin.com/prodemo/pro-featured-and-trending-post/',
'free_demo_link' => 'https://demo.essentialplugin.com/trending-post-demo/',
'pro_link' => WTPSW_PLUGIN_LINK_UNLOCK,
));
// 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.
*
* @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
*
* @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' => esc_html__( 'Essential Plugin Blocks', 'wtpsw' ),
'icon' => null,
);
}
return $categories;
}
add_filter( 'block_categories_all', 'wtpsw_add_block_category' );

View File

@@ -0,0 +1,163 @@
<?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 esc_html_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 esc_html_e( 'Need Support & Solutions?', 'wtpsw' ); ?></span>
</h2>
</div>
<div class="inside">
<p><?php esc_html_e('Boost design and best solution for your website.', 'wtpsw'); ?></p>
<a class="button button-primary button-orange" href="<?php echo esc_url( WTPSW_PLUGIN_LINK_UNLOCK ); ?>" target="_blank"><?php esc_html_e( 'Grab Now', 'wtpsw' ); ?></a>
</div><!-- .inside -->
</div><!-- #general -->
<div class="postbox">
<div class="postbox-header">
<h2 class="hndle">
<span><?php esc_html_e( 'How It Works - Display and Shortcode', 'wtpsw' ); ?></span>
</h2>
</div>
<div class="inside">
<table class="form-table">
<tr>
<th>
<label><?php esc_html_e( 'Getting Started', 'wtpsw' ); ?></label>
</th>
<td>
<p><?php esc_html_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 esc_html_e( 'All Shortcodes', 'wtpsw' ); ?></label>
</th>
<td>
<span class="wpos-copy-clipboard wtpsw-shortcode-preview">[wtpsw_popular_post]</span> <?php esc_html_e( 'Trending Post Slider View', 'wtpsw' ); ?><br />
<span class="wpos-copy-clipboard wtpsw-shortcode-preview">[wtpsw_carousel]</span> <?php esc_html_e( 'Trending Post Carousel View', 'wtpsw' ); ?><br />
<span class="wpos-copy-clipboard wtpsw-shortcode-preview">[wtpsw_gridbox]</span> <?php esc_html_e( 'Trending Post Gridbox View', 'wtpsw'); ?>
<br/><br/>
</td>
</tr>
<tr>
<th>
<label><?php esc_html_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 esc_html_e('Check Documentation', 'wtpsw'); ?></a>
</td>
</tr>
</table>
</div>
</div>
<div class="postbox">
<div class="postbox-header">
<h2 class="hndle">
<span><?php esc_html_e( 'Gutenberg Support', 'wp-testimonial-with-widget' ); ?></span>
</h2>
</div>
<div class="inside">
<table class="form-table">
<tbody>
<tr>
<th>
<label><?php esc_html_e( 'How it Work', 'wp-testimonial-with-widget' ); ?>:</label>
</th>
<td>
<ul>
<li><?php esc_html_e( 'Step-1. Go to the Gutenberg editor of your page.', 'wp-testimonial-with-widget' ); ?></li>
<li><?php esc_html_e( 'Step-2. Search "testimonial" keyword in the gutenberg block list.', 'wp-testimonial-with-widget' ); ?></li>
<li><?php esc_html_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 esc_html_e( 'Help to improve this plugin!', 'wtpsw' ); ?></span>
</h2>
</div>
<div class="inside">
<p><?php esc_html_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 esc_html_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 esc_html_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 esc_url(WTPSW_PLUGIN_LINK_UNLOCK); ?>" target="_blank"><?php esc_html_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,152 @@
<?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
*
* @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
*
* @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,53 @@
<?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
*
* @since 1.0.0
*/
function wtpsw_post_view_count(){
$prefix = WTPSW_META_PREFIX;
$post_id = isset( $_POST['post_id'] ) ? esc_attr( $_POST['post_id'] ) : '';
$nonce = ! empty( $_POST['nonce'] ) ? esc_attr( $_POST['nonce'] ) : '';
if( ! empty( $post_id ) && wp_verify_nonce( $nonce, 'wtpsw-post-view-count-data' )) {
// 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,169 @@
<?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_script' ) );
// 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
*
* @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
*
* @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
*
* @since 1.0.0
*/
function wtpsw_front_end_style_script() {
global $post;
// Determine Elementor Preview Screen
// Check elementor preview is there
$elementor_preview = ( defined('ELEMENTOR_PLUGIN_BASE') && isset( $_GET['elementor-preview'] ) && $post->ID == (int) $_GET['elementor-preview'] ) ? 1 : 0;
// 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;
}
/* Styles */
// 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', array(), WTPSW_VERSION );
wp_enqueue_style('wpos-slick-style');
}
// Registring slider style
wp_register_style( 'wtpsw-public-style', WTPSW_URL.'assets/css/wtpsw-public.css', array(), WTPSW_VERSION );
wp_enqueue_style( 'wtpsw-public-style' );
/* Scripts */
// 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(
'elementor_preview' => $elementor_preview,
'ajaxurl' => admin_url( 'admin-ajax.php', ( is_ssl() ? 'https' : 'http' ) ),
'is_mobile' => ( wp_is_mobile() ) ? 1 : 0,
'is_avada' => ( class_exists( 'FusionBuilder' ) ) ? 1 : 0,
'is_rtl' => ( is_rtl() ) ? 1 : 0,
'post_view_count' => $post_view_count,
'data_nonce' => wp_create_nonce( 'wtpsw-post-view-count-data' ),
));
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
*
* @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,158 @@
<?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
*
* @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_dequeue_script( 'wtpsw-public-script' );
wp_enqueue_script( 'wpos-slick-jquery' );
wp_enqueue_script( 'wtpsw-public-script' );
// 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 esc_attr($unique); ?>" class="wtpsw-post-carousel wtpsw-post-slider-init <?php echo esc_attr($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,144 @@
<?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
*
* @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 esc_attr($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,154 @@
<?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
*
* @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_dequeue_script( 'wtpsw-public-script' );
wp_enqueue_script( 'wpos-slick-jquery' );
wp_enqueue_script( 'wtpsw-public-script' );
// 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 esc_attr( $unique ); ?>" class="wtpsw-post-slider wtpsw-post-slider-init <?php echo esc_attr( $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,289 @@
<?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
*
* @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', __( '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
*
* @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
*
* @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 esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title', 'wtpsw' ); ?></label>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>" />
</p>
<!-- Post type -->
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'post_type' ) ); ?>"><?php esc_html_e( 'Post Type', 'wtpsw' ); ?></label>
<select class="widefat ftpp-reg-post-types" id="<?php echo esc_attr( $this->get_field_id( 'post_type' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'post_type' )); ?>" >
<option value="" selected ><?php esc_html_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="'.esc_attr( $post_key ).'" '.selected( $post_key, $instance['post_type'] ).'>'.esc_attr( $post_value ).'</option>';
}
}
}
?>
</select>
</p>
<!-- View By Field -->
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'view_by' )); ?>"><?php esc_html_e( 'Post List By', 'wtpsw'); ?></label>
<select class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'view_by' )); ?>" name="<?php echo esc_attr($this->get_field_name( 'view_by' )); ?>">
<option value="views" <?php selected( $instance['view_by'], 'views' ); ?> ><?php esc_html_e('Total Views', 'wtpsw') ?></option>
<option value="comment" <?php selected( $instance['view_by'], 'comment' ); ?>><?php esc_html_e( 'Comments Count', 'wtpsw' ); ?></option>
</select>
</p>
<!-- Number of Items Field -->
<p>
<label for="<?php echo esc_attr($this->get_field_id( 'limit' )); ?>"><?php esc_html_e( 'Number of Items', 'wtpsw'); ?></label>
<input class="widefat" min="-1" id="<?php echo esc_attr($this->get_field_id( 'limit' )); ?>" name="<?php echo esc_attr($this->get_field_name( 'limit' )); ?>" type="number" value="<?php echo esc_attr($instance['limit']); ?>" />
</p>
<!-- Order Field -->
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'order' )); ?>"><?php esc_html_e( 'Order', 'wtpsw' ); ?></label>
<select class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'order' )); ?>" name="<?php echo esc_attr( $this->get_field_name( 'order' )); ?>">
<option value="ASC" <?php selected( $instance['order'], 'ASC' ); ?> ><?php esc_html_e('ASC', 'wtpsw') ?></option>
<option value="DESC" <?php selected( $instance['order'], 'DESC' ); ?>><?php esc_html_e('DESC', 'wtpsw'); ?></option>
</select>
</p>
<!-- Show Content Field -->
<p>
<input type="checkbox" value="1" id="<?php echo esc_attr($this->get_field_id( 'show_content' )); ?>" name="<?php echo esc_attr($this->get_field_name( 'show_content' )); ?>" <?php checked( $instance['show_content'], 1 ); ?> />
<label for="<?php echo esc_attr( $this->get_field_id( 'show_content' )); ?>"><?php esc_html_e( 'Display Short Content', 'wtpsw' ); ?></label><br/>
<span class="description"><em><?php esc_html_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 esc_attr( $this->get_field_id( 'content_length' )); ?>"><?php esc_html_e( 'Post Content Length', 'wtpsw'); ?></label>
<input class="widefat" id="<?php echo esc_attr($this->get_field_id( 'content_length' )); ?>" name="<?php echo esc_attr($this->get_field_name( 'content_length' )); ?>" type="number" min="1" value="<?php echo esc_attr( $instance['content_length'] ); ?>" />
<span class="description"><em><?php esc_html_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 esc_attr( $this->get_field_id( 'show_thumb' )); ?>" name="<?php echo esc_attr($this->get_field_name( 'show_thumb' )); ?>" <?php checked( $instance['show_thumb'], 1 ); ?> />
<label for="<?php echo esc_attr($this->get_field_id( 'show_thumb' )); ?>"><?php esc_html_e( 'Show Thumbnail', 'wtpsw'); ?></label>
</p>
<!-- Show Author Field -->
<p>
<input type="checkbox" value="1" id="<?php echo esc_attr( $this->get_field_id( 'show_author' )); ?>" name="<?php echo esc_attr( $this->get_field_name( 'show_author' )); ?>" <?php checked( $instance['show_author'], 1 ); ?> />
<label for="<?php echo esc_attr( $this->get_field_id( 'show_author' )); ?>"><?php esc_html_e( 'Show Author', 'wtpsw'); ?></label>
</p>
<!-- Show Date Field -->
<p>
<input type="checkbox" value="1" id="<?php echo esc_attr( $this->get_field_id( 'show_date' )); ?>" name="<?php echo esc_attr( $this->get_field_name( 'show_date' )); ?>" <?php checked( $instance['show_date'], 1 ); ?> />
<label for="<?php echo esc_attr( $this->get_field_id( 'show_date' )); ?>"><?php esc_html_e( 'Show Date', 'wtpsw'); ?></label>
</p>
<!-- Show Comment Field -->
<p>
<input type="checkbox" value="1" id="<?php echo esc_attr( $this->get_field_id( 'show_comment_count' )); ?>" name="<?php echo esc_attr( $this->get_field_name( 'show_comment_count' )); ?>" <?php checked( $instance['show_comment_count'], 1 ); ?> />
<label for="<?php echo esc_attr( $this->get_field_id( 'show_comment_count' )); ?>"><?php esc_html_e( 'Show Comment Count', 'wtpsw' ); ?></label>
</p>
<!-- Show Comment Field -->
<p>
<input type="checkbox" value="1" id="<?php echo esc_attr( $this->get_field_id( 'hide_empty_comment_count' )); ?>" name="<?php echo esc_attr( $this->get_field_name( 'hide_empty_comment_count' )); ?>" <?php checked( $instance['hide_empty_comment_count'], 1 ); ?> />
<label for="<?php echo esc_attr( $this->get_field_id( 'hide_empty_comment_count' )); ?>"><?php esc_html_e( 'Hide Empty Comment Count', 'wtpsw' ); ?></label><br/>
<span class="description"><em><?php esc_html_e( 'Hide comment count if it is empty.', 'wtpsw' ); ?></em></span>
</p>
</div>
<?php
}
/**
* Outputs the content of the 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 . wp_kses_post($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,201 @@
<?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
*
* @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
*
* @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
*
* @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
*
* @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
*
* @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
*
* @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
*
* @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
*
* @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
*
* @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 = esc_html__( '0 Comments', 'wtpsw' );
} elseif ( $comment_number > 1 ) {
$comment_text = $comment_number . esc_html__(' Comments', 'wtpsw');
} elseif ( $comment_number == 1 ) {
$comment_text = esc_html__('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,329 @@
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: 2023-08-03 11:26+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:194
msgid " Comments"
msgstr ""
#: includes/wtpsw-functions.php:192
msgid "0 Comments"
msgstr ""
#: includes/wtpsw-functions.php:196
msgid "1 Comment"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:119
msgid "5 stars!"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:64
msgid "All Shortcodes"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:53
msgid "All Time"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:141
msgid "ASC"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:40
msgid "Boost design and best solution for your website."
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:79
msgid "Check Documentation"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:127
msgid "Comments Count"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:142
msgid "DESC"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:37
msgid "Display most popular trending post on your blog."
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:149
msgid "Display Short Content"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:76
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:157
msgid "Enter number of words to display in post content."
msgstr ""
#: includes/admin/supports/gutenberg-block.php:279
msgid "Essential Plugin Blocks"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:40
msgid "General Settings"
msgstr ""
#: includes/admin/class-wtpsw-admin.php:37
#: includes/admin/wtpsw-how-it-works.php:55
msgid "Getting Started"
msgstr ""
#: includes/admin/class-wtpsw-admin.php:37
msgid "Getting Started - WP Trending Post Slider and Widget"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:41
#: includes/admin/wtpsw-how-it-works.php:154
msgid "Grab Now"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:115
msgid "Help to improve this plugin!"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:188
msgid "Hide comment count if it is empty."
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:187
msgid "Hide Empty Comment Count"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:25
msgid "How It Works"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:48
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:150
msgid ""
"If your post has excerpt then it will take it else post content will be "
"taken."
msgstr ""
#: wp-trending-post-slider-widget.php:198
#, 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:56
msgid "Last 7 Days"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:55
msgid "Last Day"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:57
msgid "Last Month"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:36
msgid "Need Support & Solutions?"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:133
msgid "Number of Items"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:139
msgid "Order"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:155
msgid "Post Content Length"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:124
msgid "Post List By"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:107
#: includes/admin/form/wtpsw-settings.php:73
msgid "Post Type"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:49
msgid "Post Within"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:83
msgid "Save Changes"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:109
msgid "Select Post Type"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:77
msgid ""
"Select post type box for trending post. You can enter post type name in "
"shortcode parameter."
msgstr ""
#: includes/admin/form/wtpsw-settings.php:65
msgid "Select Post Types"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:59
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:169
msgid "Show Author"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:181
msgid "Show Comment Count"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:175
msgid "Show Date"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:163
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:197
#, php-format
msgid "Thank you for activating %s"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:101
msgid "Title"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:54
msgid "Today"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:126
msgid "Total Views"
msgstr ""
#: includes/admin/class-wtpsw-admin.php:34
msgid "Trending Post"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:19
msgid "Trending Post - Settings"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:68
msgid "Trending Post Carousel View"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:58
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:69
msgid "Trending Post Gridbox View"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:204
msgid "Trending Post List - Widget"
msgstr ""
#: includes/shortcode/wtpsw-carousel.php:28
#: includes/shortcode/wtpsw-gridbox.php:28
#: includes/shortcode/wtpsw-slider.php:28
msgid "Trending Post Slider - Shortcode"
msgstr ""
#: includes/shortcode/wtpsw-carousel.php:36
#: includes/shortcode/wtpsw-gridbox.php:36
#: includes/shortcode/wtpsw-slider.php:36
msgid "Trending Post slider - Shortcode"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:67
msgid "Trending Post Slider View"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:40
#: includes/widgets/class-wtpsw-post-list-widget.php:43
msgid "Trending Posts"
msgstr ""
#. Name of the plugin
msgid "Trending/Popular Post Slider and Widget"
msgstr ""
#: includes/admin/class-wtpsw-admin.php:40
msgid "Upgrade To Premium"
msgstr ""
#: includes/admin/class-wtpsw-admin.php:40
msgid "Upgrade To Premium - Trending/Popular Post Slider and Widget"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:132
msgid "Upgrate to Pro"
msgstr ""
#. Author of the plugin
msgid "WP OnlineSupport, Essential Plugin"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:24
msgid "Your changes saved successfully."
msgstr ""

View File

@@ -0,0 +1,330 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Trending/Popular Post Slider and Widget\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-03 11:26+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:194
msgid " Comments"
msgstr ""
#: includes/wtpsw-functions.php:192
msgid "0 Comments"
msgstr ""
#: includes/wtpsw-functions.php:196
msgid "1 Comment"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:119
msgid "5 stars!"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:64
msgid "All Shortcodes"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:53
msgid "All Time"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:141
msgid "ASC"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:40
msgid "Boost design and best solution for your website."
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:79
msgid "Check Documentation"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:127
msgid "Comments Count"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:142
msgid "DESC"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:37
msgid "Display most popular trending post on your blog."
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:149
msgid "Display Short Content"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:76
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:157
msgid "Enter number of words to display in post content."
msgstr ""
#: includes/admin/supports/gutenberg-block.php:279
msgid "Essential Plugin Blocks"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:40
msgid "General Settings"
msgstr ""
#: includes/admin/class-wtpsw-admin.php:37
#: includes/admin/wtpsw-how-it-works.php:55
msgid "Getting Started"
msgstr ""
#: includes/admin/class-wtpsw-admin.php:37
msgid "Getting Started - WP Trending Post Slider and Widget"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:41
#: includes/admin/wtpsw-how-it-works.php:154
msgid "Grab Now"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:115
msgid "Help to improve this plugin!"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:188
msgid "Hide comment count if it is empty."
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:187
msgid "Hide Empty Comment Count"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:25
msgid "How It Works"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:48
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:150
msgid ""
"If your post has excerpt then it will take it else post content will be "
"taken."
msgstr ""
#: wp-trending-post-slider-widget.php:198
#, 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:56
msgid "Last 7 Days"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:55
msgid "Last Day"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:57
msgid "Last Month"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:36
msgid "Need Support & Solutions?"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:133
msgid "Number of Items"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:139
msgid "Order"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:155
msgid "Post Content Length"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:124
msgid "Post List By"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:107
#: includes/admin/form/wtpsw-settings.php:73
msgid "Post Type"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:49
msgid "Post Within"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:83
msgid "Save Changes"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:109
msgid "Select Post Type"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:77
msgid ""
"Select post type box for trending post. You can enter post type name in "
"shortcode parameter."
msgstr ""
#: includes/admin/form/wtpsw-settings.php:65
msgid "Select Post Types"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:59
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:169
msgid "Show Author"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:181
msgid "Show Comment Count"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:175
msgid "Show Date"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:163
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:197
#, php-format
msgid "Thank you for activating %s"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:101
msgid "Title"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:54
msgid "Today"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:126
msgid "Total Views"
msgstr ""
#: includes/admin/class-wtpsw-admin.php:34
msgid "Trending Post"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:19
msgid "Trending Post - Settings"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:68
msgid "Trending Post Carousel View"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:58
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:69
msgid "Trending Post Gridbox View"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:204
msgid "Trending Post List - Widget"
msgstr ""
#: includes/shortcode/wtpsw-carousel.php:28
#: includes/shortcode/wtpsw-gridbox.php:28
#: includes/shortcode/wtpsw-slider.php:28
msgid "Trending Post Slider - Shortcode"
msgstr ""
#: includes/shortcode/wtpsw-carousel.php:36
#: includes/shortcode/wtpsw-gridbox.php:36
#: includes/shortcode/wtpsw-slider.php:36
msgid "Trending Post slider - Shortcode"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:67
msgid "Trending Post Slider View"
msgstr ""
#: includes/widgets/class-wtpsw-post-list-widget.php:40
#: includes/widgets/class-wtpsw-post-list-widget.php:43
msgid "Trending Posts"
msgstr ""
#. Name of the plugin
msgid "Trending/Popular Post Slider and Widget"
msgstr ""
#: includes/admin/class-wtpsw-admin.php:40
msgid "Upgrade To Premium"
msgstr ""
#: includes/admin/class-wtpsw-admin.php:40
msgid "Upgrade To Premium - Trending/Popular Post Slider and Widget"
msgstr ""
#: includes/admin/wtpsw-how-it-works.php:132
msgid "Upgrate to Pro"
msgstr ""
#. Author of the plugin
msgid "WP OnlineSupport, Essential Plugin"
msgstr ""
#: includes/admin/form/wtpsw-settings.php:24
msgid "Your changes saved successfully."
msgstr ""

View File

@@ -0,0 +1,311 @@
=== Trending/Popular Post Slider and Widget ===
Contributors: wponlinesupport, anoopranawat, pratik-jain, piyushpatel123, 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: 6.4.1
Stable tag: 1.8
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 ==
✅ Now that you have your website ready why dont you **download** and try out this Trending/Popular Post slider to give it better functionality.
**Download Now** and WP Trending Post Slider and Widget allow you to display 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.
**Download Now** this Trending/Popular Post slider because It is proven that Trending Post sliders have been a powerful tool to present your content in a very neat manner with the help of fancy sliders and customized designs.
[FREE DEMO](https://demo.essentialplugin.com/trending-post-demo/?utm_source=WP&utm_medium=Trending-Popular&utm_campaign=Read-Me) | [PRO DEMO](https://demo.essentialplugin.com/prodemo/pro-featured-and-trending-post/?utm_source=WP&utm_medium=Trending-Popular&utm_campaign=Read-Me)
Your customer might like the professional and fancy vibe of your site with Trending Post sliders
**✅ This plugin displays your trending posts using :**
* Trending Slider (1 design)
* Trending Carousel (1 design)
* Trending Gridbox (1 design)
* Trending widget (1 design)
**Download Now** it today and explore all the features.
When you want to makeover your WordPress website theme with something extraordinary and creative, you must consider the Trending post slider.
Help your website get a slide-wise display to show the custom posts. Not just eye appealing, it is also loved by visitors as they find it quite easy to locate custom posts.
**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.
**Also added Gutenberg block support.**
= ✅ Here is the plugin shortcode example =
**Trending Slider**
<code>[wtpsw_popular_post]</code>
**Trending Carousel**
<code>[wtpsw_carousel]</code>
**Trending gridbox**
<code>[wtpsw_gridbox]</code>
**To display only Trending 4 post:**
<code>[wtpsw_popular_post limit="4"]</code>
Where limit define the number of posts to display. You can use same parameter with all shortcode.
= ✅ 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>
= ✅ Use Following Trending Slider 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"]
* **extra_class** : [wtpsw_popular_post extra_class=""] (Enter extra CSS class for design customization ).
= ✅ Use Following Trending Carousel 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"]
* **extra_class** : [wtpsw_carousel extra_class=""] (Enter extra CSS class for design customization ).
= ✅ Use Following Trending Gridbox 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")
* **extra_class** : [wtpsw_gridbox extra_class=""] (Enter extra CSS class for design customization ).
✅ **Checkout demo for better understanding**
[FREE DEMO](https://demo.essentialplugin.com/trending-post-demo/?utm_source=WP&utm_medium=Trending-Popular&utm_campaign=Read-Me) | [PRO DEMO](https://demo.essentialplugin.com/prodemo/pro-featured-and-trending-post/?utm_source=WP&utm_medium=Trending-Popular&utm_campaign=Read-Me)
✅ **Essential Plugin Bundle Deal**
[Annual or Lifetime Bundle Deal](https://www.essentialplugin.com/pricing/?utm_source=WP&utm_medium=Trending-Popular&utm_campaign=Read-Me)
= 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!
= ✅ Features include: =
* Added Gutenberg block support.
* Trending post slider
* Trending post carousel
* Trending post gridbox
* Trending post Widget
* Easy to add.
* Also work with Gutenberg shortcode block.
* Elementor, Beaver and SiteOrigin Page Builder Native Support (New).
* Divi Page Builder Native Support (New).
* Fusion Page Builder (Avada) Native Support (New).
* Responsive.
* You can create multiple testimonial slider with different options at single page or post.
* Fully responsive. Scales with its container.
* 100% Multi Language.
== 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>
== 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.8 (27, Nov 2023) =
* [*] Updated analytics SDK.
* [*] Check compatibility with WordPress version 6.4.1
= 1.7 ( 29, Aug 2023 ) =
* [*] Tested up to: 6.3
= 1.6.1 ( 4, Aug 2023 ) =
* [*] Tested up to: 6.2.2
* [*] Fixed all security related issues.
= 1.6 ( 13, April 2023 ) =
* [*] Fixed some slider issue.
= 1.5.8 ( 31, March 2023 ) =
* [*] New - Add nonce to post count in frontend side.
* [*] Check compatibility to WordPress version 6.2.
= 1.5.7 (12, Dec 2022) =
* [*] Tested up to: 6.1.1
= 1.5.6 (08, Nov 2022) =
* [*] Tested up to: 6.1
= 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>".esc_html__( 'By', 'wtpsw' )." <a href='".get_author_posts_url( $post->post_author )."'>".get_the_author()."</a></span>";
}
if($showdate == "true") {
$wtpsw_post_stats[] = "<span>".get_the_date()."</span>";
}
if( $show_comment_count == "true" && $comment_text ) {
$wtpsw_post_stats[] = "<span class='wtpsw-post-comment'>".esc_attr($comment_text)."</span>";
}
echo join( ' / ', $wtpsw_post_stats ); ?>
</div>
<?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,50 @@
<?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>".esc_html__( 'By', 'wtpsw' )." <a href='".get_author_posts_url( $post->post_author )."'>".get_the_author()."</a></span>";
}
if( $showdate == "true" ) {
$wtpsw_post_stats[] = "<span>".get_the_date()."</span>";
}
if( $show_comment_count == "true" && $comment_text ) {
$wtpsw_post_stats[] = "<span class='wtpsw-post-comment'>".esc_attr($comment_text)."</span>";
}
echo join( ' / ', $wtpsw_post_stats ); ?>
</div>
<?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>".esc_html__( 'By', 'wtpsw' )." <a href='".get_author_posts_url( $post->post_author )."'>".get_the_author()."</a></span>";
}
if($showdate == "true") {
$wtpsw_post_stats[] = "<span>".get_the_date()."</span>";
}
if( $show_comment_count == "true" && $comment_text ) {
$wtpsw_post_stats[] = "<span class='wtpsw-post-comment'>".esc_attr($comment_text)."</span>";
}
echo join( ' / ', $wtpsw_post_stats ); ?>
</div>
<?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'>".esc_html__( 'By ', 'wtpsw' )."<a href='".get_author_posts_url( $post->post_author )."'>".get_the_author()."</a></span>";
}
if( $show_comment_count && $comment_text ) {
$wtpsw_stats[] = "<span class='wtpsw-post-comment'>".esc_attr($comment_text)."</span>";
}
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,267 @@
<?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.8
* 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.8' ); // 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_UNLOCK' ) ) {
define( 'WTPSW_PLUGIN_LINK_UNLOCK', 'https://www.essentialplugin.com/essential-plugin-bundle-pricing/?utm_source=WP&utm_medium=Trending-Popular&utm_campaign=Features-PRO' ); // Plugin link
}
if( ! defined( 'WTPSW_PLUGIN_LINK_UPGRADE' ) ) {
define( 'WTPSW_PLUGIN_LINK_UPGRADE', 'https://www.essentialplugin.com/pricing/?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
*
* @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.
*
* @since 1.0.0
*/
register_activation_hook( __FILE__, 'wtpsw_install' );
/**
* Deactivation Hook
*
* Register plugin deactivation hook.
*
* @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
*
* @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
*
* @since 1.0.0
*/
function wtpsw_uninstall() {
}
/**
* Deactivate free plugin
*
* @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.
*
* @since 1.2.3
*/
function wtpsw_admin_notice() {
global $pagenow;
// If not plugin screen
if( 'plugins.php' != $pagenow ) {
return;
}
// Check Lite Version
$dir = ABSPATH . 'wp-content/plugins/featured-and-trending-post-pro/featured-and-trending-post-pro.php';
if( ! file_exists( $dir ) ) {
return;
}
$notice_link = add_query_arg( array('message' => 'wtpsw-plugin-notice'), admin_url('plugins.php') );
$notice_transient = get_transient( 'wtpsw_install_notice' );
// If free plugin exist
if( $notice_transient == false && 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: 700px; 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,473 @@
<?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( isset( $_GET['message'] ) && 'wpos-anylc-dismiss-notice' == $_GET['message'] && ! empty( $_GET['anylc_id'] )
&& isset( $_GET['_wpnonce'] ) && wp_verify_nonce( $_GET['_wpnonce'], 'wpos-anylc-dismiss-notice-nonce' )
) {
$anylc_id = sanitize_text_field( $_GET['anylc_id'] );
set_transient( 'wpos_anylc_optin_notice_'.$anylc_id, true, 172800 );
}
// Flush the redirect transient
if( isset( $_GET['anylc_nonce'] ) && wp_verify_nonce( $_GET['anylc_nonce'], 'wpos-anylc-redirect-nonce' ) ) {
update_option( 'wpos_anylc_redirect', '' );
}
// Check if any redirect is set after plugin activation
$redirect = get_option( 'wpos_anylc_redirect' );
if ( $redirect ) {
/**
* Little Tweak to avoid the infinite looping.
*/
parse_str( parse_url( $redirect, PHP_URL_QUERY ), $url_data );
if( ! isset( $url_data['anylc_nonce'] ) || ( isset( $url_data['anylc_nonce'] ) && ! wp_verify_nonce( $_GET['anylc_nonce'], 'wpos-anylc-redirect-nonce' ) ) ) {
$redirect = add_query_arg( array( 'anylc_nonce' => wp_create_nonce( 'wpos-anylc-redirect-nonce' ) ), $redirect );
}
// Redirect to 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, '_wpnonce' => wp_create_nonce( 'wpos-anylc-dismiss-notice-nonce' ) ), 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>'.wp_kses_post( $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,331 @@
<?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;
$redirect_page = ! empty( $module_data['redirect_page'] ) ? $module_data['redirect_page'] : $module_data['menu'];
if( ! empty( $redirect_page ) ) {
$pos = strpos( $redirect_page, '?post_type' );
$redirect_url = ( $pos !== false ) ? admin_url( $redirect_page ) : add_query_arg( array( 'page' => $redirect_page ), 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,160 @@
<?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;}
/* Some CSS */
/*.wpos-anylc-admin-wrap{text-align: center; padding:15px 0;}
.wpos-anylc-line-style{font-style: italic; text-decoration: underline; color: #000; font-weight: 700; letter-spacing: 1px;}
.wpos-anylc-email-line{ letter-spacing: 1px; position: relative; padding: 0.75rem 1.25rem; margin-bottom: 1rem; border: 1px solid transparent; border-radius: 0.25rem; color: #000; background-color: #F8F8F8; border-color: #F8F8F8;}
.wpos-anylc-nl-wrap{ letter-spacing: 1px; position: relative; padding: 0.75rem 1.25rem; margin-bottom: 1rem; border: 1px solid transparent; border-radius: 0.25rem; color: #000; background-color: #F8F8F8; border-color: #F8F8F8;}
.wpos-anylc-skip-btn{border-color:#404040 !important; color: #404040 !important;}
.wpos-anylc-black-wrap{color: #000; font-weight: 700;}
.wpos-anylc-list-wrap{margin-left: 10px;}
.wpos-anylc-list-wrap li span{font-style: italic; color: #000; font-weight: 700; letter-spacing: 1px;}
.wpos-anylc-best-regard{ text-align: center; font-style: italic; color:#000;font-weight: 700; letter-spacing: 1px; margin-top: 25px;}
.wpos-anylc-optin-action{display: flex;align-items: center; background-color: #F8F8F8;}
.wpos-anylc-subs-btn{width: 50%;}
.wpos-anylc-subs-btn .wpos-anylc-allow-btn{background: #FF0000; border-color:#FF0000;}
.wpos-anylc-subs-btn .wpos-anylc-allow-btn:hover{background:#D22B2B; border-color:#D22B2B;}
.wpos-anylc-btn-skip{width: 50%; display: flex; flex-direction: column;align-items: flex-start;}
.wpos-anylc-btn-skip span{font-weight: 500;font-size:12px; font-style:italic; margin-right: 20px;}
.wpos-anylc-btn-skip .wpos-anylc-skip-btn{font-size: 12px;}
.wpos-anylc-terms{background-color:#F8F8F8;}*/
</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" style="width: 650px; margin: 0 auto; margin-top: 70px;">
<div>
<div style="height:50px; text-align: center; background-color: rgba(180,185,190, 0.2);">
<img style="position: relative; top:-40px;" src="<?php echo esc_url( $analy_product['icon'] ); ?>" alt="Icon" />
</div>
<div style="padding: 10px;">
<div style="margin-top:50px; margin-bottom: 30px; text-align: center; font-weight: 700; font-size: 24px;">Never miss an important update</div>
<div style="font-size: 20px; font-weight: 500; line-height:25px; margin: 10px 12px; color:#646970;">Opt-in to get email notifications for security & feature updates, and to share some basic WordPress environment info. This will help us make the plugin more compatible with your site and better at doing what you need it to.</div>
</div>
</div>
<!-- <div class="wpos-anylc-optin-icon-wrap" style="text-align: center; background-color: rgba(180,185,190, 0.3);">
<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 esc_url( $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 esc_url( $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 esc_html( $product_name ); ?></b> compatible with most themes and plugins by allowing to share non-sensitive data to <a target="_blank" href="https://www.essentialplugin.com/">essentialplugin.com</a> about your website.</p>
<p>If you skip this, that's okay! <b><?php //echo esc_html( $product_name ); ?></b> will still work just fine.</p> -->
<!-- <div class="wpos-anylc-admin-wrap"><span class="wpos-anylc-black-wrap">Hey! &#128100; <?php //echo ucfirst( $user_name ); ?>,</span> Opt in Bonuses, Information & &#127873; <span class="wpos-anylc-line-style">Premium Gifts</span> for YOU</div>
<div class="wpos-anylc-email-line">Opt- in subscribers will have - &#128233; Email notifications, security features, update releases for <span class="wpos-anylc-line-style"><?php //echo esc_html( $product_name ); ?></span></div>
<div>
<p>Globally, <span class="wpos-anylc-black-wrap">49%</span> of users want to receive <span class="wpos-anylc-line-style">Promotional Emails</span> about the brands through emails.</p>
</div>
<div class="wpos-anylc-nl-wrap">
<p>Our newsletter also contains topics about:</p>
<ul class="wpos-anylc-list-wrap">
<li>1. <span>WordPress (WP)</span> &#8702; From Matt Mullenweg to Smallest of WP Version Upgrades</li>
<li>2. <span>Digital Marketing</span> &#8702; From Traffic to Conversions</li>
<li>3. <span>General Tech</span> &#8702; From WEB to chatGPT to EV </li>
</ul>
</div>
<div>
<p><span class="wpos-anylc-black-wrap">42%</span> of our Email users are benefited with our shared useful knowledge, content & first email will come with &#127873; <span class="wpos-anylc-line-style">Premium Gifts.</span></p>
</div>
<div class="wpos-anylc-best-regard">With Best Regards, &#128591; Namaste! & Universal Blessings</div> -->
<?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 esc_attr( $promotion_key ); ?>" name="promotion[]" checked="checked" /> <?php echo esc_html( $promotion_data['name'] ); ?></label></div>
<?php } ?>
</div>
<?php } ?>
<!-- </div> -->
<div class="wpos-anylc-optin-action wpos-anylc-clearfix" style="background-color: rgba(180,185,190, 0.3);">
<button type="submit" name="wpos_anylc_optin" class="button button-primary button-large 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 right wpos-anylc-skip-btn" value="skip" style="padding: 0 !important;background: transparent;border: none;">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 class="wpos-anylc-btn-skip">
<?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">I'm fine without subscription!</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-subs-btn">
<button type="submit" name="wpos_anylc_optin" class="button button-primary right button-large wpos-anylc-allow-btn" value="wpos_anylc_optin">OK LETS START SUBSCRIBE</button>
</div> -->
</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.essentialplugin.com/privacy-policy/#free-pluign-info" target="_blank">Privacy Policy</a> - <a href="https://www.essentialplugin.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 esc_html( $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 wp_kses_post( $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 esc_url( $redirect_url ); ?>">Click Here</a> in case you are not auto redirect.
<script type="text/javascript">
window.location = "<?php echo esc_url( $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 esc_attr( $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 esc_html( $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 esc_html( $module['name'] ); ?></b> to <a href="https://www.essentialplugin.com/" 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 esc_attr( $module['id'] ); ?>"></div>

View File

@@ -0,0 +1,260 @@
<?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: $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 activation
*
* @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'], 'anylc_nonce' => wp_create_nonce( 'wpos-anylc-redirect-nonce' ) ), admin_url('admin.php') );
update_option( 'wpos_anylc_redirect', $redirect_link );
} elseif( ! empty( $wpos_analytics_module[ $plugin ]['redirect_page'] ) ) {
$redirect_page = $wpos_analytics_module[ $plugin ]['redirect_page'];
$pos = strpos( $redirect_page, '?post_type' );
$redirect_link = ( $pos !== false ) ? admin_url( $redirect_page ) : add_query_arg( array( 'page' => $redirect_page, 'anylc_nonce' => wp_create_nonce( 'wpos-anylc-redirect-nonce' ) ), 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,325 @@
<?php
/**
* Dashboard Page
*
* @package Essential Plugins Bundle
* @since 1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
// Call Plugin API
if ( ! function_exists( 'plugins_api' ) ) {
require_once ABSPATH . '/wp-admin/includes/plugin-install.php';
}
// Taking some data
$plugins_allowedtags = array(
'a' => array(
'href' => array(),
'title' => array(),
'target' => array(),
),
'abbr' => array( 'title' => array() ),
'acronym' => array( 'title' => array() ),
'code' => array(),
'pre' => array(),
'em' => array(),
'strong' => array(),
'ul' => array(),
'ol' => array(),
'li' => array(),
'p' => array(),
'br' => array(),
);
$plugins_data = wpos_espbw_get_plugin_data();
$plugins_filter = wpos_espbw_plugins_filter();
// Check Plugin Install Permission
if( ! current_user_can('install_plugins') ) {
echo '<div class="error">
<p>'. esc_html__( "Sorry, It looks like that you do not have permission to install the plugin.", "espbw") .'</p>
<p>'. esc_html__("You can take a look at our all plugins at", "espbw") .' <a href="https://profiles.wordpress.org/wponlinesupport#content-plugins" target="_blank">'. esc_html__("here", "espbw") . '</a>.</p>
</div>';
return;
}
?>
<script type="text/javascript">
var pagenow = 'plugin-install';
</script>
<div class="wrap espbw-settings">
<div class="espbw-dashboard-wrap">
<div class="espbw-dashboard-title">
<div class="espbw-dashboard-title-inr">
<div class="espbw-dashboard-logo"><a href="<?php echo WTPSW_SITE_LINK; ?>/?utm_source=wp&utm_medium=plugin&utm_campaign=essential-bundle" target="_blank"><img src="<?php echo esc_url( WPOS_ESPBW_URL ); ?>assets/images/essentialplugin-logo.png" alt="essentialplugin" /></a></div>
<h3 style="text-align:center;"><?php esc_html_e( 'Essential Plugins', 'espbw' ); ?></h3>
<em class="wpos-em">Installs directly from <b>wordpress.org</b> repository</em> <br />
</div>
</div>
<br/>
<div class="wp-filter espbw-filter">
<ul class="filter-links espbw-filter-links">
<li class="espbw-plugin-all"><a href="javascript:void(0);" class="espbw-filter-link current"><?php esc_html_e('All Essential Plugins', 'espbw'); ?></a></li>
<li class="espbw-plugin-recommended"><a href="javascript:void(0);" class="espbw-filter-link" data-filter="recommended"><?php esc_html_e('Utility Plugins', 'espbw'); ?></a></li>
<li class="espbw-plugin-sliders"><a href="javascript:void(0);" class="espbw-filter-link" data-filter="sliders"><?php esc_html_e('Sliders', 'espbw'); ?></a></li>
<li class="espbw-plugin-woo"><a href="javascript:void(0);" class="espbw-filter-link" data-filter="woocommerce"><?php esc_html_e('WooCommerce', 'espbw'); ?></a></li>
</ul>
<form class="search-form search-plugins" method="get">
<input type="hidden" name="page" value="espbw-dashboard" />
<input type="search" name="espbw_search" value="" class="wp-filter-search espbw-search-inp espbw-search-inp-js" placeholder="<?php echo esc_html_e('Search Plugins e.g popup', 'espbw'); ?>" />
</form>
</div>
<?php if( ! empty( $plugins_data->plugins ) ) { ?>
<form id="plugin-filter" method="post">
<div class="espbw-plugin-list-wrap">
<div class="widefat espbw-plugin-list espbw-clearfix" id="the-list">
<?php foreach ($plugins_data->plugins as $plugin_key => $plugin_data) {
if ( is_object( $plugin_data ) ) {
$plugin_data = (array) $plugin_data;
}
// Taking some data
$title = wp_kses( $plugin_data['name'], $plugins_allowedtags );
$version = wp_kses( $plugin_data['version'], $plugins_allowedtags );
$name = strip_tags( $title . ' ' . $version );
$description = strip_tags( $plugin_data['short_description'] );
$last_updated_timestamp = strtotime( $plugin_data['last_updated'] );
$author = wp_kses( $plugin_data['author'], $plugins_allowedtags );
$author = str_replace( "href=", 'target="_blank" href=', $author );
$requires_php = isset( $plugin['requires_php'] ) ? $plugin['requires_php'] : null;
$requires_wp = isset( $plugin_data['requires'] ) ? $plugin_data['requires'] : null;
$compatible_php = is_php_version_compatible( $requires_php );
$compatible_wp = is_wp_version_compatible( $requires_wp );
$tested_wp = ( empty( $plugin_data['tested'] ) || version_compare( get_bloginfo( 'version' ), $plugin_data['tested'], '<=' ) );
$details_link = self_admin_url( 'plugin-install.php?tab=plugin-information&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 esc_html_e( 'Last Updated:' ); ?></strong>
<?php
/* translators: %s: Human-readable time difference. */
printf( __( '%s ago' ), human_time_diff( $last_updated_timestamp ) );
?>
</div>
<div class="column-downloaded">
<?php
if ( $plugin_data['active_installs'] >= 1000000 ) {
$active_installs_millions = floor( $plugin_data['active_installs'] / 1000000 );
$active_installs_text = sprintf(
/* translators: %s: Number of millions. */
_nx( '%s+ Million', '%s+ Million', $active_installs_millions, 'Active plugin installations' ),
number_format_i18n( $active_installs_millions )
);
} elseif ( 0 == $plugin_data['active_installs'] ) {
$active_installs_text = _x( 'Less Than 10', 'Active plugin installations' );
} else {
$active_installs_text = number_format_i18n( $plugin_data['active_installs'] ) . '+';
}
/* translators: %s: Number of installations. */
printf( __( '%s Active Installations' ), $active_installs_text );
?>
</div>
<div class="column-compatibility">
<?php
if ( ! $tested_wp ) {
echo '<span class="compatibility-untested">' . __( 'Untested with your version of WordPress' ) . '</span>';
} elseif ( ! $compatible_wp ) {
echo '<span class="compatibility-incompatible">' . __( '<strong>Incompatible</strong> with your version of WordPress' ) . '</span>';
} else {
echo '<span class="compatibility-compatible">' . __( '<strong>Compatible</strong> with your version of WordPress' ) . '</span>';
}
?>
</div>
</div><!-- end .plugin-card-bottom -->
</div><!-- end .plugin-card -->
</div><!-- end .espbw-plugin-card-wrap -->
<?php } ?>
</div>
<div class="espbw-hide espbw-search-no-result"><?php esc_html_e('Sorry, No result found. Please refine your search.', 'espbw'); ?></div>
</div><!-- end .espbw-plugin-list-wrap -->
</form>
<?php } else { ?>
<div class="espbw-no-result">
<p><?php esc_html_e('Sorry, Something happened wrong.', 'espbw'); ?></p>
<p><?php esc_html_e('You can take a look at our all plugins at', 'espbw'); ?> <a href="https://profiles.wordpress.org/wponlinesupport#content-plugins" target="_blank"><?php esc_html_e('here', 'espbw'); ?></a>.</p>
</div>
<?php }
?>
</div>
</div><!-- end .wrap -->

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,254 @@
<?php
/**
* Common Functions
*
* @package Essential Plugins Bundle
* @since 1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/**
* Function to sort plugins api data
*
* @since 1.0
*/
function wpos_espbw_sort_plugin_data( $a, $b ) {
$a_active_installs = is_numeric( $a['active_installs'] ) ? $a['active_installs'] : 0;
$b_active_installs = is_numeric( $b['active_installs'] ) ? $b['active_installs'] : 0;
if ($a_active_installs == $b_active_installs) {
return 0;
}
return ($a_active_installs > $b_active_installs) ? -1 : 1;
}
/**
* Function to add script and style at admin side
*
* @since 1.0
*/
function wpos_espbw_get_plugin_data() {
// Get cache result
$plugins_data = get_transient( 'espbw_plugins_data' );
// If no cache is there
if( empty( $plugins_data ) ) {
// Call Plugin API
if ( ! function_exists( 'plugins_api' ) ) {
require_once ABSPATH . '/wp-admin/includes/plugin-install.php';
}
$plugins_data = plugins_api( 'query_plugins', array(
'per_page' => 60,
'author' => 'wponlinesupport',
'fields' => array(
'icons' => true,
'active_installs' => true,
)
) );
if( is_wp_error( $plugins_data ) || empty( $plugins_data->plugins ) ) {
$file = WPOS_ESPBW_DIR . 'plugins-data.json';
// We don't need to write to the file, so just open for reading.
$fp = fopen( $file, 'r' );
// Pull data of the file in.
$file_data = fread( $fp, 1024 * KB_IN_BYTES );
// Close file handle
fclose( $fp );
$file_data = utf8_encode($file_data);
$plugins_data_arr = json_decode( $file_data, true );
$plugins_data = json_decode( $file_data );
$plugins_data->plugins = $plugins_data_arr['plugins'];
}
if( ! is_wp_error( $plugins_data ) && ! empty( $plugins_data->plugins ) ) {
// Sort the data based on active install
usort( $plugins_data->plugins, "wpos_espbw_sort_plugin_data" );
set_transient( 'espbw_plugins_data', $plugins_data, (12 * HOUR_IN_SECONDS) );
}
}
return $plugins_data;
}
/**
* Add some filter classes for plugins.
*
* @since 1.0
*/
function wpos_espbw_plugins_filter() {
$plugin_filters = array(
'sp-faq' => array(
'class' => 'espbw-recommended espbw-showcase',
'tags' => 'faq, faq list, faq plugin, faqs, wp faq with category, jquery ui accordion, faq with accordion, frequently asked questions, wordpress faq',
),
'app-mockups-carousel' => array(
'class' => 'espbw-sliders',
'tags' => 'app mockups carousel, mockups, device mockup, mockup slider, app gallery slider, app gallery Carousel, device gallery carousel, app mockups carousel, mockups carousel',
),
'countdown-timer-ultimate' => array(
'class' => 'espbw-recommended espbw-showcase',
'tags' => 'countdown timer, timer, timer countdown, countdown, event countdown timer, animated countdown timer, birthday countdown, clock, count down, countdown, countdown clock, countdown generator, countdown system, countdown timer, countdown timer, date countdown, event countdown, flash countdown, jQuery countdown, time counter, website countdown, wp countdown, wp countdown timer',
),
'featured-post-creative' => array(
'class' => 'espbw-post espbw-showcase',
'tags' => 'featured post, featured post grid, featured post widget, responsive featured post grid, responsive featured post, featured post brick layout, featured posts',
),
'footer-mega-grid-columns' => array(
'class' => '',
'tags' => 'footer, footer widgets, footer widgets in grid, website footer, footer, mega footer, megafooter',
),
'hero-banner-ultimate' => array(
'class' => '',
'tags' => 'hero image, hero banner, hero header, hero video, video background, hero video, youtube video background, vimeo video background',
),
'popup-anything-on-click' => array(
'class' => 'espbw-recommended',
'tags' => 'modal popup, popup, modal, full screen popup, html popup, image popup, popup on click, modal popup on click, full screen popup on click, click popup',
),
'portfolio-and-projects' => array(
'class' => 'espbw-recommended',
'tags' => 'portfolio, portfolio listing, projects, project grid, project portfolio, Responsive Portfolio, portfolio categories, add portfolio, add portfolio plugin, portfolio gallery, portfolio plugin, career portfolio, googole image style, best portfolio, portfolio display, project management',
),
'maintenance-mode-with-timer' => array(
'class' => '',
'tags' => 'maintenance mode, coming soon, maintenance mode with timer, maintenance mode with countdown timer, countdown timer, coming soon with countdown timer, offline, site is offline, site offline, under construction, launch, launch page, maintenance',
),
'preloader-for-website' => array(
'class' => '',
'tags' => 'page loader, loader, page load animations, animated pre-loader, animated preloader, colorful, customize, Jquery Loader, jquery pre-loader, jquery preloader, loader, pre-loader, preload, preloader',
),
'search-and-navigation-popup' => array(
'class' => '',
'tags' => 'serchbox popup, menubar popup, navigation popup, serchbox popup',
),
'smooth-scroll-by-wpos' => array(
'class' => '',
'tags' => 'mousewheel scroll, scroll, smooth scroll, scrolling, go to top, back to top, scroll to element, scroll to section, smooth scroll to element, smooth scroll to section',
),
'ticker-ultimate' => array(
'class' => 'espbw-recommended espbw-post espbw-showcase',
'tags' => 'wponlinesupport, ticker, news ticker, blog ticker, post ticker, ticker slider, ticker vertical slider, ticker horizontal slider',
),
'wp-blog-and-widgets' => array(
'class' => 'espbw-recommended espbw-post espbw-showcase',
'tags' => 'blog design, blog layout, wordpress blog , custom blog template, wordpress blog widget, blog layout design, custom blog layout, Free wordpress blog, blog custom post type, blog menu, blog page with custom post type, blog, latest blog, custom post type, cpt, widget',
),
'sp-news-and-widget' => array(
'class' => 'espbw-recommended espbw-post espbw-showcase',
'tags' => 'wordpress news plugin, news website, news page scrolling , wordpress vertical news plugin widget, wordpress horizontal news plugin widget, scrolling news wordpress plugin, scrolling news widget wordpress plugin, WordPress set post or page as news, WordPress dynamic news, news, latest news, custom post type, cpt, widget, vertical news scrolling widget, news widget',
),
'wp-testimonial-with-widget' => array(
'class' => 'espbw-recommended espbw-showcase',
'tags' => 'testimonial, Testimonial, testimonials, Testimonials, widget, Best testimonial slider, Responsive testimonial slider, client testimonial slider, easy testimonial slider, testimonials with widget, wordpress testimonial with widget, testimonial rotator, testimonial slider, Testimonial slider, testimonial with shortcode, client testimonial, client quote',
),
'timeline-and-history-slider' => array(
'class' => 'espbw-recommended espbw-post espbw-showcase',
'tags' => 'timeline slider, life history, history slider, company story timeline, process slider, process, responsive timeline, about us, achievements, Activity Log, awesome company timeline, biography, events timeline, history, history timeline, life achievements, lifestream, story, personal timeline',
),
'wp-team-showcase-and-slider' => array(
'class' => 'espbw-recommended espbw-showcase',
'tags' => 'team, teamshowcase, team slider, responsive teamshowcase, teamshowcase rotator, employees, meet team, members, skills, staff, team, v-card, members profile, my team, our team, responsive team display, responsive team, team members, team members profile, team profile, team showcase, tlp team, WordPress Team Member',
),
'recent-posts-widget-designer' => array(
'class' => '',
'tags' => 'post widget, post widget with thumbnail, post widget designer, post widget designs, recent post widget with thumbnail, recent post widget designer, recent post widget designs',
),
'styles-for-wp-pagenavi-addon' => array(
'class' => '',
'tags' => 'navigation, pagination, paging, pages, navigation, pagenavi style, wp pagenavi styling, pagenavi styling, pagenavi css',
),
'post-grid-and-filter-ultimate' => array(
'class' => 'espbw-post espbw-showcase',
'tags' => 'post grid, post, post filter, post category filter, custom post grid, grid display, grid, content grid, filter, post designs, grid designs',
),
'accordion-and-accordion-slider' => array(
'class' => 'espbw-showcase',
'tags' => 'accordion, accordion image slider, accordion, horizontal accordion, vertical accordion, responsive accordion, accordion carousel,',
),
'html5-videogallery-plus-player' => array(
'class' => 'espbw-recommended espbw-showcase',
'tags' => 'video, youtube video gallery, vimeo video gallery, youtube video gallery with popup, Youtube-video, youtube embed, youtube gallery, youtube player, magnific Popup, vimeo video gallery gallery, HTML5 video player, HTML5 video gallery, wordpress HTML5 video, wordpress HTML5 video player, wordpress HTML5 video gallery, responsive, wordpress responsive video gallery',
),
'wp-featured-content-and-slider' => array(
'class' => 'espbw-recommended espbw-showcase',
'tags' => 'content slider, slider, features, services, featured content, featured services, featured content rotator, featured content slider, featured content slideshow, featured posts, featured content slider',
),
'wp-responsive-recent-post-slider' => array(
'class' => 'espbw-recommended espbw-post espbw-showcase',
'tags' => 'post slider, posts slider, recent post slider, recent posts slider, slider, responsive post slider, responsive posts slider, responsive recent post slider, responsive recent posts slider, wordpress posts slider, post slideshow, posts slideshow, recent posts slideshow',
),
'blog-designer-for-post-and-widget' => array(
'class' => 'espbw-recommended espbw-post espbw-showcase',
'tags' => 'post, post design, post designer, post designs, post layout, post layout design, post widget, blog, blog designs, blog design, stylist post, post slider, post grid, recent post, recent post slider, recent post designs, posts in page, post carousel slider',
),
'wp-slick-slider-and-image-carousel' => array(
'class' => 'espbw-recommended espbw-sliders espbw-showcase',
'tags' => 'slick, image slider, slick slider, slick image slider, slider, image slider, header image slider, responsive image slider, responsive content slider, carousel, image carousel, carousel slider, content slider, coin slider, touch slider, text slider, responsive slider, responsive slideshow, Responsive Touch Slider, wp slider, wp image slider, wp header image slider, photo slider, responsive photo slider',
),
'wp-trending-post-slider-and-widget' => array(
'class' => 'espbw-post espbw-showcase',
'tags' => 'popular post, popular posts, trending, trending posts carousel trending post, trending posts, trending posts carousel, popular posts slider, trending posts slider, widget, shortcodes, slider, post slick slider, trending posts widget, popular posts widget, daily popular, page views, popular posts, top posts',
),
'audio-player-with-playlist-ultimate' => array(
'class' => 'espbw-showcase',
'tags' => 'audio player with playlist, album art, artist, audio player, audio player with playlist, multiple player, music player, repeat, shuffle, single player, song title',
),
'sliderspack-all-in-one-image-sliders' => array(
'class' => 'espbw-recommended espbw-sliders espbw-showcase',
'tags' => 'logo ticker, bxslider, meta slider, flexslider, fancybox, nivo slider, owl slider, unslider , wallop slider , bx slider, flex slider, rolling slider, image slider, slider, 3d slider, 3d image slider, 3d image carousel, image carousel, carousel, swiper, swiper carousel, Cascade Slider',
),
'album-and-image-gallery-plus-lightbox' => array(
'class' => 'espbw-recommended espbw-showcase',
'tags' => 'album, image album, gallery, magnific image slider, image gallery, responsive image gallery, image slider, image gallery slider, gallery slider, album slider, lightbox, albums, best gallery plugin, photo gallery, galleries, gallery, image captions, media gallery, photo albums, photo gallery, photography, Picture Gallery, pictures, responsive galleries, responsive gallery, slideshow galleries, slideshow gallery, thumbnail galleries, thumbnail gallery, wordpress gallery plugin, wordpress photo gallery plugin, wordpress responsive gallery, wp gallery, wp gallery plugins',
),
'wp-modal-popup-with-cookie-integration' => array(
'class' => '',
'tags' => 'popup',
),
'meta-slider-and-carousel-with-lightbox' => array(
'class' => 'espbw-recommended espbw-sliders',
'tags' => 'frontend gallery slider, frontend gallery Carousel, image slider, image carousel, meta gallery slider, meta gallery carousel, gallery slider, gallery',
),
'post-category-image-with-grid-and-slider' => array(
'class' => 'espbw-sliders espbw-showcase',
'tags' => 'category, category image, post category image, post category image grid, post category image slider, customization, custom category image, category featured image, category grid, category slider',
),
'wp-logo-showcase-responsive-slider-slider' => array(
'class' => 'espbw-recommended espbw-showcase',
'tags' => 'logo slider, logo slider, widget, client logo carousel, client logo slider, client, customer, image carousel, carousel, logo showcase, Responsive logo slider, Responsive logo carousel, WordPress logo slider, WordPress logo carousel, slick carousel, Best logo showcase, easy logo slider, logo carousel wordpress, logo slider wordpress, sponsors, sponsors slider, sponsors carousel',
),
'product-categories-designs-for-woocommerce' => array(
'class' => 'espbw-woocommerce espbw-showcase',
'tags' => 'woocommerce, categories designs, categories slider, categories grid, WooCommerce categories designs, WooCommerce categories slider, WooCommerce categories grid',
),
'woo-product-slider-and-carousel-with-category' => array(
'class' => 'espbw-woocommerce',
'tags' => 'woocommerce, best selling products, best selling products slider, slick slider, best selling products by category, shortcode, template code, featured product, featured product slider, Featured product by category, autoplay slider, best product slider, best product slider for woo shop, carousel, clean woo product slider, multiple product slider, product carousel, product content slider, product contents carousel, product slider, product slider carousel for woo, products slider, responsive product slider, responsive product carousel, slider, smooth product slider woo product slider, advance slider, woo best selling products, woo category slider, latest products, most selling products, product carousel slider, recent product carousel, recent product slider',
),
'slider-and-carousel-plus-widget-for-instagram' => array(
'class' => 'espbw-recommended espbw-sliders espbw-showcase',
'tags' => 'Custom Instagram Feed, feed, hashtag, instagram, Instagram feed, instagram gallery, Instagram images, Instagram photos, Instagram posts, Instagram wall, lightbox, photos, instagram social feed, show instagram post, responsive instgram, beautiful instagram, instagram widget, instgram plugin, artistic instagram, instagram wordpress, smashing instgram',
),
'frontend-gallery-slider-for-advanced-custom-field' => array(
'class' => 'espbw-recommended espbw-sliders espbw-showcase',
'tags' => 'frontend gallery slider, frontend gallery Carousel, slider, acf frontend gallery slider, acf frontend gallery Carousel, acf gallery, acf',
),
);
return $plugin_filters;
}

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: $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