Version Description
(22, June 2019) = * [*] Fixed : Fixed readmore button hover issue in all designs.
Download this release
Release Info
Developer | wponlinesupport |
Plugin | WP Responsive Recent Post Slider |
Version | 2.1 |
Comparing to | |
See all releases |
Code changes from version 1.3.5 to 2.1
- assets/css/recent-post-style.css +12 -4
- includes/admin/class-wprps-admin.php +68 -0
- includes/admin/settings/hire-us.php +91 -0
- includes/admin/settings/premium.php +183 -0
- includes/admin/wprps-how-it-work.php +33 -32
- includes/shortcodes/wppsac-slider.php +1 -1
- includes/wppsac-function.php +5 -5
- readme.txt +54 -74
- templates/design-1.php +5 -1
- templates/design-2.php +5 -1
- templates/design-3.php +4 -0
- wp-recent-post-slider.php +85 -36
- wpos-analytics/assets/css/wpos-anylc-admin.css +57 -0
- wpos-analytics/assets/images/icon.png +0 -0
- wpos-analytics/assets/images/wpos-logo.png +0 -0
- wpos-analytics/assets/js/wpos-anylc-admin.js +43 -0
- wpos-analytics/includes/class-anylc-admin.php +477 -0
- wpos-analytics/includes/class-anylc-script.php +64 -0
- wpos-analytics/includes/wpos-anylc-function.php +311 -0
- wpos-analytics/templates/analytic.php +99 -0
- wpos-analytics/templates/offers.php +73 -0
- wpos-analytics/templates/optout-popup.php +31 -0
- wpos-analytics/wpos-analytics.php +251 -0
assets/css/recent-post-style.css
CHANGED
@@ -30,7 +30,7 @@
|
|
30 |
.recent-post-slider .slick-dots li.slick-active button{background:#444 !important;}
|
31 |
.recent-post-slider .slick-slide{padding:0px !important}
|
32 |
.post-overlay{ position:relative;}
|
33 |
-
.recent-post-slider .wp-post-content a.readmorebtn {padding:
|
34 |
.wp-post-content {padding-bottom: 10px;}
|
35 |
.wp-sub-content {padding-bottom: 10px;}
|
36 |
.recent-post-slider h2.wp-post-title{margin:5px 0 !important; line-height:22px;}
|
@@ -39,7 +39,7 @@
|
|
39 |
.recent-post-slider .wp-post-date::after { background: #e96656; bottom: -4px;content: "";height: 2px; left: 0; margin: auto ; position: absolute; width: 50px; z-index: 1;}
|
40 |
.recent-post-slider .recentpost-categories ul.post-categories{margin:0px 0px 10px 0 !important; padding:0px !important; list-style:none !important; font-size: 0;}
|
41 |
.recent-post-slider .recentpost-categories ul.post-categories li{display:inline-block !important; margin: 2px !important; padding: 0 !important;}
|
42 |
-
.recent-post-slider .recentpost-categories ul.post-categories li a{padding:
|
43 |
.recent-post-slider .recentpost-categories ul.post-categories li:nth-child(4n+1) a{background:#1abc9c;}
|
44 |
.recent-post-slider .recentpost-categories ul.post-categories li:nth-child(4n+2) a{background:#3498db;}
|
45 |
.recent-post-slider .recentpost-categories ul.post-categories li:nth-child(4n+3) a{background:#e74c3c;}
|
@@ -48,6 +48,8 @@
|
|
48 |
.recent-post-slider .post-image-bg img{height: 100%;width: 100%;object-fit: cover;object-position: top center;border-radius: 0px;}
|
49 |
|
50 |
/***************Design-1**************/
|
|
|
|
|
51 |
.recent-post-slider.design-1 .post-content-position{position:relative}
|
52 |
.recent-post-slider.design-1 .post-content-left{position:absolute !important; left:0; bottom: 0px; background:rgba(0, 0, 0, 0.5); z-index:999; color:#fff;}
|
53 |
.recent-post-slider.design-1 .post-content-left a {color:#fff;}
|
@@ -58,6 +60,8 @@
|
|
58 |
.recent-post-slider.design-1 .slick-next{right:0px !important;}
|
59 |
.recent-post-slider.design-1 .slick-prev{right:31px !important; left:auto !important;}
|
60 |
.recent-post-slider.design-1 .slick-dots{left:15px !important; bottom:2px !important;}
|
|
|
|
|
61 |
|
62 |
/***************Design-2**************/
|
63 |
.recent-post-slider.design-2 .post-content-position{position:relative;}
|
@@ -71,13 +75,15 @@
|
|
71 |
.recent-post-slider.design-2 .slick-prev{right:31px !important; left:auto !important;}
|
72 |
.recent-post-slider.design-2 .slick-dots{left:15px !important; bottom:2px !important;}
|
73 |
.recent-post-slider.design-2 .recentpost-inner-content {width: 100%; max-height: 100%; overflow: hidden;}
|
|
|
|
|
74 |
|
75 |
/***************Design-3**************/
|
76 |
.recent-post-slider.design-3 .post-image-bg{background: #f1f1f1;height: 350px;line-height: 0; overflow: hidden; position: relative; width: 100%;}
|
77 |
.recent-post-slider.design-3 .post-short-content{height: 46%;clear:both; background: rgba(51, 51, 51, 0.5);bottom: 0; color: #fff; left: 0; padding: 15px 30px 35px 30px; position: absolute; right: 0; transition: all 0.5s ease-in-out 0s;}
|
78 |
.recent-post-slider.design-3 .wp-post-content { opacity: 0; height:0; transition: all 0.5s ease-in-out 0s;}
|
79 |
.recent-post-slider.design-3 .post-overlay:hover > .post-short-content .wp-post-content{opacity:1;height:auto;}
|
80 |
-
.recent-post-slider.design-3 .post-overlay:hover > .post-short-content {height:
|
81 |
.recent-post-slider.design-3 .recentpost-categories{left: 0;top: 0px;position: absolute;}
|
82 |
.recent-post-slider.design-3 .recentpost-categories ul.post-categories li{margin: 0 2px 2px 0 !important;}
|
83 |
.recent-post-slider.design-3 h2.wp-post-title a,
|
@@ -87,11 +93,12 @@
|
|
87 |
.recent-post-slider.design-3 .slick-next{right:0px !important;}
|
88 |
.recent-post-slider.design-3 .slick-prev{right:31px !important; left:auto !important;}
|
89 |
.recent-post-slider.design-3 .slick-dots{left:15px !important; bottom:2px !important;}
|
|
|
90 |
|
91 |
/***************Design-4**************/
|
92 |
.recent-post-slider.design-4 .post-list-content, .recent-post-slider.design-4 .post-list{width:100%; float:left; clear:both;}
|
93 |
.recent-post-slider.design-4 .post-list-content .wp-post-title a{color:#444; text-decoration:none;}
|
94 |
-
.recent-post-slider.design-4 .post-image-bg{background: #f1f1f1;height: 230px
|
95 |
.recent-post-slider.design-4 .recentpost-categories {margin-top: 0;}
|
96 |
.recent-post-slider.design-4 .recentpost-categories a{color:#fff;}
|
97 |
.recent-post-slider.design-4 .wp-medium-5{padding: 0px 10px 0 0;}
|
@@ -101,6 +108,7 @@
|
|
101 |
.recent-post-slider.design-4 .slick-prev{left:0px !important;}
|
102 |
.recent-post-slider.design-4 .slick-dots{left: 0;right: 0;}
|
103 |
.recent-post-slider.design-4 .wp-post-content a.readmorebtn {color: #444; border-color: #444;}
|
|
|
104 |
|
105 |
.wpcolumn,
|
106 |
.wpcolumns { padding-left: 0.9375em; padding-right: 0.9375em; width:100%; float: left; position: relative; }
|
30 |
.recent-post-slider .slick-dots li.slick-active button{background:#444 !important;}
|
31 |
.recent-post-slider .slick-slide{padding:0px !important}
|
32 |
.post-overlay{ position:relative;}
|
33 |
+
.recent-post-slider .wp-post-content a.readmorebtn {padding: 5px 10px;border: 1px solid #e7e7e7;text-decoration: none;margin: 5px 0; font-size:14px; -moz-transition:all 0.5s ease-out 0s;-ms-transition:all 0.5s ease-out 0s;-o-transition:all 0.5s ease-out 0s; transition: all 0.5s ease-out 0s; }
|
34 |
.wp-post-content {padding-bottom: 10px;}
|
35 |
.wp-sub-content {padding-bottom: 10px;}
|
36 |
.recent-post-slider h2.wp-post-title{margin:5px 0 !important; line-height:22px;}
|
39 |
.recent-post-slider .wp-post-date::after { background: #e96656; bottom: -4px;content: "";height: 2px; left: 0; margin: auto ; position: absolute; width: 50px; z-index: 1;}
|
40 |
.recent-post-slider .recentpost-categories ul.post-categories{margin:0px 0px 10px 0 !important; padding:0px !important; list-style:none !important; font-size: 0;}
|
41 |
.recent-post-slider .recentpost-categories ul.post-categories li{display:inline-block !important; margin: 2px !important; padding: 0 !important;}
|
42 |
+
.recent-post-slider .recentpost-categories ul.post-categories li a{padding:4px 10px; text-transform:uppercase; font-size:11px; text-decoration:none; color: #fff; display: block; line-height: normal;}
|
43 |
.recent-post-slider .recentpost-categories ul.post-categories li:nth-child(4n+1) a{background:#1abc9c;}
|
44 |
.recent-post-slider .recentpost-categories ul.post-categories li:nth-child(4n+2) a{background:#3498db;}
|
45 |
.recent-post-slider .recentpost-categories ul.post-categories li:nth-child(4n+3) a{background:#e74c3c;}
|
48 |
.recent-post-slider .post-image-bg img{height: 100%;width: 100%;object-fit: cover;object-position: top center;border-radius: 0px;}
|
49 |
|
50 |
/***************Design-1**************/
|
51 |
+
.recent-post-slider a{text-decoration:none !important;}
|
52 |
+
|
53 |
.recent-post-slider.design-1 .post-content-position{position:relative}
|
54 |
.recent-post-slider.design-1 .post-content-left{position:absolute !important; left:0; bottom: 0px; background:rgba(0, 0, 0, 0.5); z-index:999; color:#fff;}
|
55 |
.recent-post-slider.design-1 .post-content-left a {color:#fff;}
|
60 |
.recent-post-slider.design-1 .slick-next{right:0px !important;}
|
61 |
.recent-post-slider.design-1 .slick-prev{right:31px !important; left:auto !important;}
|
62 |
.recent-post-slider.design-1 .slick-dots{left:15px !important; bottom:2px !important;}
|
63 |
+
.recent-post-slider.design-1 a.readmorebtn{color:#fff;}
|
64 |
+
.recent-post-slider.design-1 a.readmorebtn:hover{color:#fff; background:rgba(0,0,0,0.5);}
|
65 |
|
66 |
/***************Design-2**************/
|
67 |
.recent-post-slider.design-2 .post-content-position{position:relative;}
|
75 |
.recent-post-slider.design-2 .slick-prev{right:31px !important; left:auto !important;}
|
76 |
.recent-post-slider.design-2 .slick-dots{left:15px !important; bottom:2px !important;}
|
77 |
.recent-post-slider.design-2 .recentpost-inner-content {width: 100%; max-height: 100%; overflow: hidden;}
|
78 |
+
.recent-post-slider.design-2 a.readmorebtn{color:#fff;}
|
79 |
+
.recent-post-slider.design-2 a.readmorebtn:hover{color:#fff; background:rgba(0,0,0,0.5);}
|
80 |
|
81 |
/***************Design-3**************/
|
82 |
.recent-post-slider.design-3 .post-image-bg{background: #f1f1f1;height: 350px;line-height: 0; overflow: hidden; position: relative; width: 100%;}
|
83 |
.recent-post-slider.design-3 .post-short-content{height: 46%;clear:both; background: rgba(51, 51, 51, 0.5);bottom: 0; color: #fff; left: 0; padding: 15px 30px 35px 30px; position: absolute; right: 0; transition: all 0.5s ease-in-out 0s;}
|
84 |
.recent-post-slider.design-3 .wp-post-content { opacity: 0; height:0; transition: all 0.5s ease-in-out 0s;}
|
85 |
.recent-post-slider.design-3 .post-overlay:hover > .post-short-content .wp-post-content{opacity:1;height:auto;}
|
86 |
+
.recent-post-slider.design-3 .post-overlay:hover > .post-short-content {height:85%;}
|
87 |
.recent-post-slider.design-3 .recentpost-categories{left: 0;top: 0px;position: absolute;}
|
88 |
.recent-post-slider.design-3 .recentpost-categories ul.post-categories li{margin: 0 2px 2px 0 !important;}
|
89 |
.recent-post-slider.design-3 h2.wp-post-title a,
|
93 |
.recent-post-slider.design-3 .slick-next{right:0px !important;}
|
94 |
.recent-post-slider.design-3 .slick-prev{right:31px !important; left:auto !important;}
|
95 |
.recent-post-slider.design-3 .slick-dots{left:15px !important; bottom:2px !important;}
|
96 |
+
.recent-post-slider.design-3 a.readmorebtn:hover{color:#fff; background:rgba(0,0,0,0.5);}
|
97 |
|
98 |
/***************Design-4**************/
|
99 |
.recent-post-slider.design-4 .post-list-content, .recent-post-slider.design-4 .post-list{width:100%; float:left; clear:both;}
|
100 |
.recent-post-slider.design-4 .post-list-content .wp-post-title a{color:#444; text-decoration:none;}
|
101 |
+
.recent-post-slider.design-4 .post-image-bg{background: #f1f1f1;height: 230px;line-height: 0; overflow: hidden; position: relative; width: 100%;}
|
102 |
.recent-post-slider.design-4 .recentpost-categories {margin-top: 0;}
|
103 |
.recent-post-slider.design-4 .recentpost-categories a{color:#fff;}
|
104 |
.recent-post-slider.design-4 .wp-medium-5{padding: 0px 10px 0 0;}
|
108 |
.recent-post-slider.design-4 .slick-prev{left:0px !important;}
|
109 |
.recent-post-slider.design-4 .slick-dots{left: 0;right: 0;}
|
110 |
.recent-post-slider.design-4 .wp-post-content a.readmorebtn {color: #444; border-color: #444;}
|
111 |
+
.recent-post-slider.design-4 a.readmorebtn:hover{color:#fff; background:rgba(0,0,0,0.5);}
|
112 |
|
113 |
.wpcolumn,
|
114 |
.wpcolumns { padding-left: 0.9375em; padding-right: 0.9375em; width:100%; float: left; position: relative; }
|
includes/admin/class-wprps-admin.php
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin Class
|
4 |
+
*
|
5 |
+
* Handles the admin functionality of plugin
|
6 |
+
*
|
7 |
+
* @package WP Responsive Recent Post Slider
|
8 |
+
* @since 1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( !defined( 'ABSPATH' ) ) {
|
12 |
+
exit; // Exit if accessed directly
|
13 |
+
}
|
14 |
+
|
15 |
+
class Wprps_Admin {
|
16 |
+
|
17 |
+
function __construct() {
|
18 |
+
|
19 |
+
// Action to add admin menu
|
20 |
+
add_action( 'admin_menu', array($this, 'wprps_register_menu'), 12 );
|
21 |
+
|
22 |
+
// Admin init process
|
23 |
+
add_action( 'admin_init', array($this, 'wprps_admin_init_process') );
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Function to add menu
|
28 |
+
*
|
29 |
+
* @package WP Responsive Recent Post Slider
|
30 |
+
* @since 1.0.0
|
31 |
+
*/
|
32 |
+
function wprps_register_menu() {
|
33 |
+
|
34 |
+
// Register plugin premium page
|
35 |
+
add_submenu_page( 'wprps-about', __('Upgrade to PRO - Recent Post Slider', 'wp-responsive-recent-post-slider'), '<span style="color:#2ECC71">'.__('Upgrade to PRO', 'wp-responsive-recent-post-slider').'</span>', 'edit_posts', 'wprps-premium', array($this, 'wprps_premium_page') );
|
36 |
+
|
37 |
+
add_submenu_page( 'wprps-about', __('Hire Us', 'wp-responsive-recent-post-slider'), '<span style="color:#2ECC71">'.__('Hire Us', 'wp-responsive-recent-post-slider').'</span>', 'manage_options', 'wprps-hireus', array($this, 'wprps_hireus_page') );
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Getting Started Page Html
|
42 |
+
*
|
43 |
+
* @package WP Responsive Recent Post Slider
|
44 |
+
* @since 1.0.0
|
45 |
+
*/
|
46 |
+
function wprps_premium_page() {
|
47 |
+
include_once( WPRPS_DIR . '/includes/admin/settings/premium.php' );
|
48 |
+
}
|
49 |
+
|
50 |
+
function wprps_hireus_page() {
|
51 |
+
include_once( WPRPS_DIR . '/includes/admin/settings/hire-us.php' );
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Function to notification transient
|
56 |
+
*
|
57 |
+
* @package WP Responsive Recent Post Slider
|
58 |
+
* @since 1.4.3
|
59 |
+
*/
|
60 |
+
function wprps_admin_init_process() {
|
61 |
+
// If plugin notice is dismissed
|
62 |
+
if( isset($_GET['message']) && $_GET['message'] == 'wprps-plugin-notice' ) {
|
63 |
+
set_transient( 'wprps_install_notice', true, 604800 );
|
64 |
+
}
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
$wprps_admin = new Wprps_Admin();
|
includes/admin/settings/hire-us.php
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Premium Offer Page
|
4 |
+
*
|
5 |
+
* @package WP Responsive Recent Post Slider
|
6 |
+
* @since 1.4.4
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( !defined( 'ABSPATH' ) ) {
|
10 |
+
exit; // Exit if accessed directly
|
11 |
+
}
|
12 |
+
?>
|
13 |
+
<div class="wrap">
|
14 |
+
|
15 |
+
<h2><?php _e( 'Hire Us - Get unlimited expert WordPress Support and Development', 'wp-responsive-recent-post-slider' ); ?></h2><br />
|
16 |
+
|
17 |
+
<div class="support-data">
|
18 |
+
<h3 style="margin-bottom:5px;"><?php _e( 'Highlight of Hiring:', 'wp-responsive-recent-post-slider' ); ?></h3>
|
19 |
+
<ul>
|
20 |
+
<li>Hire once, get unlimited jobs done</li>
|
21 |
+
<li>Quick ticket support, quick solution</li>
|
22 |
+
<li>Any sort of WP work with no extra cost</li>
|
23 |
+
<li>Dedicated expert working only for you!</li>
|
24 |
+
</ul>
|
25 |
+
</div>
|
26 |
+
|
27 |
+
<style>
|
28 |
+
.support-data ul{list-style-type:disc ; margin:10px 0 15px 20px;}
|
29 |
+
.wprps-notice{padding: 10px; color: #3c763d; background-color: #dff0d8; border:1px solid #d6e9c6; margin: 0 0 20px 0;}
|
30 |
+
.wpos-plugin-pricing-table thead th h2{font-weight: 400; font-size: 1.5em; line-height:normal; margin:0px; color: #2ECC71;}
|
31 |
+
.wpos-plugin-pricing-table thead th h2 + p{font-size: 1.25em; line-height: 1.4; color: #999; margin:5px 0 5px 0;}
|
32 |
+
|
33 |
+
table.wpos-plugin-pricing-table{width:90%; text-align: left; border-spacing: 0; border-collapse: collapse; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;}
|
34 |
+
|
35 |
+
.wpos-plugin-pricing-table th, .wpos-plugin-pricing-table td{font-size:14px; line-height:normal; color:#444; vertical-align:middle; padding:12px;}
|
36 |
+
|
37 |
+
.wpos-plugin-pricing-table colgroup:nth-child(1) { width: 31%; border: 1px solid #ccc; }
|
38 |
+
.wpos-plugin-pricing-table colgroup:nth-child(2) { width: 22%; border: 1px solid #ccc; }
|
39 |
+
.wpos-plugin-pricing-table colgroup:nth-child(3) { width: 25%; border: 10px solid #2ECC71; }
|
40 |
+
.wpos-plugin-pricing-table colgroup:nth-child(4) { width: 31%; border: 1px solid #ccc; }
|
41 |
+
|
42 |
+
/* Tablehead */
|
43 |
+
.wpos-plugin-pricing-table thead th {background-color: #fff; background:linear-gradient(to bottom, #ffffff 0%, #ffffff 100%); text-align: center; position: relative; border-bottom: 1px solid #ccc; padding: 1em 0 3em; font-weight:400; color:#999;}
|
44 |
+
|
45 |
+
.wpos-plugin-pricing-table thead th:nth-child(3) {padding:1em 0 3.5em 0;}
|
46 |
+
.wpos-plugin-pricing-table thead th p.promo {font-size: 14px; color: #fff; position: absolute; bottom:0; left: -17px; z-index: 1000; width: 100%; margin: 0; padding: .625em 17px .75em; background-color: #ca4a1f; box-shadow: 0 2px 4px rgba(0,0,0,.25); border-bottom: 1px solid #ca4a1f;}
|
47 |
+
.wpos-plugin-pricing-table thead th p.promo:before {content: ""; position: absolute; display: block; width: 0px; height: 0px; border-style: solid; border-width: 0 7px 7px 0; border-color: transparent #900 transparent transparent; bottom: -7px; left: 0;}
|
48 |
+
.wpos-plugin-pricing-table thead th p.promo:after {content: ""; position: absolute; display: block; width: 0px; height: 0px; border-style: solid; border-width: 7px 7px 0 0; border-color: #900 transparent transparent transparent; bottom: -7px; right: 0;}
|
49 |
+
|
50 |
+
/* Table Footer */
|
51 |
+
.wpos-plugin-pricing-table tfoot th, .wpos-plugin-pricing-table tfoot td{text-align: center; border-top: 1px solid #ccc;}
|
52 |
+
.wpos-plugin-pricing-table tfoot a{font-weight: 600; color: #fff; text-decoration: none; text-transform: uppercase; display: inline-block; padding: 1em 2em; background: #59c7fb; border-radius: .2em;}
|
53 |
+
</style>
|
54 |
+
|
55 |
+
<table class="wpos-plugin-pricing-table">
|
56 |
+
<colgroup></colgroup>
|
57 |
+
<colgroup></colgroup>
|
58 |
+
<colgroup></colgroup>
|
59 |
+
<colgroup></colgroup>
|
60 |
+
<thead>
|
61 |
+
<tr>
|
62 |
+
<th>
|
63 |
+
<h2>Hire us for 1 Hr</h2>
|
64 |
+
<p>$20 USD</p>
|
65 |
+
</th>
|
66 |
+
<th>
|
67 |
+
<h2>Hire us for 5 Hrs</h2>
|
68 |
+
<p>$99 USD</p>
|
69 |
+
</th>
|
70 |
+
<th>
|
71 |
+
<h2>Hire us for 30 Hrs</h2>
|
72 |
+
<p>$499 USD</p>
|
73 |
+
<p class="promo">Our most valuable package!</p>
|
74 |
+
</th>
|
75 |
+
<th>
|
76 |
+
<h2>Hire us for 70 Hrs</h2>
|
77 |
+
<p>$999 USD</p>
|
78 |
+
</th>
|
79 |
+
</tr>
|
80 |
+
</thead>
|
81 |
+
|
82 |
+
<tfoot>
|
83 |
+
<tr>
|
84 |
+
<td><a href="https://www.wponlinesupport.com/checkout/?edd_action=add_to_cart&download_id=6044&edd_options[price_id]=6&ref=wposthemeplugin" target="_blank">Hire Us</a></td>
|
85 |
+
<td><a href="https://www.wponlinesupport.com/checkout/?edd_action=add_to_cart&download_id=6044&edd_options[price_id]=3&ref=wposthemeplugin" target="_blank">Hire Us</a></td>
|
86 |
+
<td><a href="https://www.wponlinesupport.com/checkout/?edd_action=add_to_cart&download_id=6044&edd_options[price_id]=4&ref=wposthemeplugin" target="_blank">Hire Us</a></td>
|
87 |
+
<td><a href="https://www.wponlinesupport.com/checkout/?edd_action=add_to_cart&download_id=6044&edd_options[price_id]=5&ref=wposthemeplugin" target="_blank">Hire Us</a></td>
|
88 |
+
</tr>
|
89 |
+
</tfoot>
|
90 |
+
</table>
|
91 |
+
</div>
|
includes/admin/settings/premium.php
ADDED
@@ -0,0 +1,183 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Premium Offer Page
|
4 |
+
*
|
5 |
+
* @package WP Responsive Recent Post Slider
|
6 |
+
* @since 1.0
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( !defined( 'ABSPATH' ) ) {
|
10 |
+
exit; // Exit if accessed directly
|
11 |
+
}
|
12 |
+
?>
|
13 |
+
<div class="wrap">
|
14 |
+
|
15 |
+
<h2><?php _e( 'WP Responsive Recent Post Slider - Features', 'wp-responsive-recent-post-slider' ); ?></h2><br />
|
16 |
+
|
17 |
+
<style>
|
18 |
+
.wprps-notice{padding: 10px; color: #3c763d; background-color: #dff0d8; border:1px solid #d6e9c6; margin: 0 0 20px 0;}
|
19 |
+
.wpos-plugin-pricing-table thead th h2{font-weight: 400; font-size: 2.4em; line-height:normal; margin:0px; color: #2ECC71;}
|
20 |
+
.wpos-plugin-pricing-table thead th h2 + p{font-size: 1.25em; line-height: 1.4; color: #999; margin:5px 0 5px 0;}
|
21 |
+
|
22 |
+
table.wpos-plugin-pricing-table{width:90%; text-align: left; border-spacing: 0; border-collapse: collapse; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;}
|
23 |
+
|
24 |
+
.wpos-plugin-pricing-table th, .wpos-plugin-pricing-table td{font-size:14px; line-height:normal; color:#444; vertical-align:middle; padding:12px;}
|
25 |
+
|
26 |
+
.wpos-plugin-pricing-table colgroup:nth-child(1) { width: 31%; border: 0 none; }
|
27 |
+
.wpos-plugin-pricing-table colgroup:nth-child(2) { width: 22%; border: 1px solid #ccc; }
|
28 |
+
.wpos-plugin-pricing-table colgroup:nth-child(3) { width: 25%; border: 10px solid #2ECC71; }
|
29 |
+
|
30 |
+
/* Tablehead */
|
31 |
+
.wpos-plugin-pricing-table thead th {background-color: #fff; background:linear-gradient(to bottom, #ffffff 0%, #ffffff 100%); text-align: center; position: relative; border-bottom: 1px solid #ccc; padding: 1em 0 1em; font-weight:400; color:#999;}
|
32 |
+
.wpos-plugin-pricing-table thead th:nth-child(1) {background: transparent;}
|
33 |
+
.wpos-plugin-pricing-table thead th:nth-child(3) {padding:1em 2px 3.5em 2px; }
|
34 |
+
.wpos-plugin-pricing-table thead th:nth-child(3) p{color:#000;}
|
35 |
+
.wpos-plugin-pricing-table thead th p.promo {font-size: 14px; color: #fff; position: absolute; bottom:0; left: -17px; z-index: 1000; width: 100%; margin: 0; padding: .625em 17px .75em; background-color: #ca4a1f; box-shadow: 0 2px 4px rgba(0,0,0,.25); border-bottom: 1px solid #ca4a1f;}
|
36 |
+
.wpos-plugin-pricing-table thead th p.promo:before {content: ""; position: absolute; display: block; width: 0px; height: 0px; border-style: solid; border-width: 0 7px 7px 0; border-color: transparent #900 transparent transparent; bottom: -7px; left: 0;}
|
37 |
+
.wpos-plugin-pricing-table thead th p.promo:after {content: ""; position: absolute; display: block; width: 0px; height: 0px; border-style: solid; border-width: 7px 7px 0 0; border-color: #900 transparent transparent transparent; bottom: -7px; right: 0;}
|
38 |
+
|
39 |
+
/* Tablebody */
|
40 |
+
.wpos-plugin-pricing-table tbody th{background: #fff; border-left: 1px solid #ccc; font-weight: 600;}
|
41 |
+
.wpos-plugin-pricing-table tbody th span{font-weight: normal; font-size: 87.5%; color: #999; display: block;}
|
42 |
+
|
43 |
+
.wpos-plugin-pricing-table tbody td{background: #fff; text-align: center;}
|
44 |
+
.wpos-plugin-pricing-table tbody td .dashicons{height: auto; width: auto; font-size:30px;}
|
45 |
+
.wpos-plugin-pricing-table tbody td .dashicons-no-alt{color: #ca4a1f;}
|
46 |
+
.wpos-plugin-pricing-table tbody td .dashicons-yes{color: #2ECC71;}
|
47 |
+
|
48 |
+
.wpos-plugin-pricing-table tbody tr:nth-child(even) th,
|
49 |
+
.wpos-plugin-pricing-table tbody tr:nth-child(even) td { background: #f5f5f5; border: 1px solid #ccc; border-width: 1px 0 1px 1px; }
|
50 |
+
.wpos-plugin-pricing-table tbody tr:last-child td {border-bottom: 0 none;}
|
51 |
+
|
52 |
+
/* Table Footer */
|
53 |
+
.wpos-plugin-pricing-table tfoot th, .wpos-plugin-pricing-table tfoot td{text-align: center; border-top: 1px solid #ccc;}
|
54 |
+
.wpos-plugin-pricing-table tfoot a{font-weight: 600; color: #fff; text-decoration: none; text-transform: uppercase; display: inline-block; padding: 1em 2em; background: #59c7fb; border-radius: .2em;}
|
55 |
+
</style>
|
56 |
+
|
57 |
+
<table class="wpos-plugin-pricing-table">
|
58 |
+
<colgroup></colgroup>
|
59 |
+
<colgroup></colgroup>
|
60 |
+
<colgroup></colgroup>
|
61 |
+
<thead>
|
62 |
+
<tr>
|
63 |
+
<th></th>
|
64 |
+
<th>
|
65 |
+
<h2>Free</h2>
|
66 |
+
<p>$0 USD</p>
|
67 |
+
</th>
|
68 |
+
<th>
|
69 |
+
<h2>Premium</h2>
|
70 |
+
<p>Gain access to <strong>WP Responsive Recent Post Slider</strong> and <strong>all other products</strong> with a single purchase.</p>
|
71 |
+
<p class="promo">Our most valuable package!</p>
|
72 |
+
</th>
|
73 |
+
</tr>
|
74 |
+
</thead>
|
75 |
+
|
76 |
+
<tfoot>
|
77 |
+
<tr>
|
78 |
+
<th></th>
|
79 |
+
<td></td>
|
80 |
+
<td><p>Gain access to <strong>WP Responsive Recent Post Slider</strong> and <strong>all other products</strong> with a single purchase.</p>
|
81 |
+
<a href="https://www.wponlinesupport.com/pricing/?ref=WposPratik" target="_blank">View Pricing Options</a></td>
|
82 |
+
</tr>
|
83 |
+
</tfoot>
|
84 |
+
|
85 |
+
<tbody>
|
86 |
+
<tr>
|
87 |
+
<th>Designs <span>Designs that make your website better</span></th>
|
88 |
+
<td>4</td>
|
89 |
+
<td>60+</td>
|
90 |
+
</tr>
|
91 |
+
<tr>
|
92 |
+
<th>Shortcodes <span>Shortcode provide output to the front-end side</span></th>
|
93 |
+
<td>1 (Slider)</td>
|
94 |
+
<td>4 (Slider, Carousel, Grid Box Slider )</td>
|
95 |
+
</tr>
|
96 |
+
<tr>
|
97 |
+
<th>Shortcode Parameters <span>Add extra power to the shortcode</span></th>
|
98 |
+
<td>16</td>
|
99 |
+
<td>30+</td>
|
100 |
+
</tr>
|
101 |
+
<tr>
|
102 |
+
<th>Shortcode Generator <span>Play with all shortcode parameters with preview panel. No documentation required!!</span></th>
|
103 |
+
<td><i class="dashicons dashicons-no-alt"></i></td>
|
104 |
+
<td><i class="dashicons dashicons-yes"></i></td>
|
105 |
+
</tr>
|
106 |
+
<tr>
|
107 |
+
<th>WP Templating Features <span class="subtext">You can modify plugin html/designs in your current theme.</span></th>
|
108 |
+
<td><i class="dashicons dashicons-no-alt"> </i></td>
|
109 |
+
<td><i class="dashicons dashicons-yes"> </i></td>
|
110 |
+
</tr>
|
111 |
+
<tr>
|
112 |
+
<th>Widgets<span> WordPress Widgets to your sidebars.</span></th>
|
113 |
+
<td><i class="dashicons dashicons-no-alt"></i></td>
|
114 |
+
<td><i class="dashicons dashicons-yes"></i></td>
|
115 |
+
</tr>
|
116 |
+
<tr>
|
117 |
+
<th>Custom Post Type Support<span>Supports any custom post type</span></th>
|
118 |
+
<td>Limited</td>
|
119 |
+
<td>Unlimited </td>
|
120 |
+
</tr>
|
121 |
+
<tr>
|
122 |
+
<th>Drag & Drop Post Order Change <span>Arrange your desired post with your desired order and display</span></th>
|
123 |
+
<td><i class="dashicons dashicons-no-alt"></i></td>
|
124 |
+
<td><i class="dashicons dashicons-yes"></i></td>
|
125 |
+
</tr>
|
126 |
+
<tr>
|
127 |
+
<th>Visual Composer Page Builder Supports <span>Use this plugin with Visual Composer easily</span></th>
|
128 |
+
<td><i class="dashicons dashicons-no-alt"></i></td>
|
129 |
+
<td><i class="dashicons dashicons-yes"></i></td>
|
130 |
+
</tr>
|
131 |
+
<tr>
|
132 |
+
<th>Custom Read More link for Post <span>Redirect post to third party destination if any</span></th>
|
133 |
+
<td><i class="dashicons dashicons-no-alt"></i></td>
|
134 |
+
<td><i class="dashicons dashicons-yes"></i></td>
|
135 |
+
</tr>
|
136 |
+
<tr>
|
137 |
+
<th>Display Sticky Post <span>Display sticky post</span></th>
|
138 |
+
<td><i class="dashicons dashicons-no-alt"></i></td>
|
139 |
+
<td><i class="dashicons dashicons-yes"></i></td>
|
140 |
+
</tr>
|
141 |
+
<tr>
|
142 |
+
<th>Display Desired Post <span>Display only the post you want</span></th>
|
143 |
+
<td><i class="dashicons dashicons-no-alt"></i></td>
|
144 |
+
<td><i class="dashicons dashicons-yes"></i></td>
|
145 |
+
</tr>
|
146 |
+
<tr>
|
147 |
+
<th>Display Post for Particular Categories <span>Display only the posts with particular category</span></th>
|
148 |
+
<td><i class="dashicons dashicons-no-alt"></i></td>
|
149 |
+
<td><i class="dashicons dashicons-yes"></i></td>
|
150 |
+
</tr>
|
151 |
+
<tr>
|
152 |
+
<th>Exclude Some Posts <span>Do not display the posts you want</span></th>
|
153 |
+
<td><i class="dashicons dashicons-no-alt"></i></td>
|
154 |
+
<td><i class="dashicons dashicons-yes"></i></td>
|
155 |
+
</tr>
|
156 |
+
<tr>
|
157 |
+
<th>Exclude Some Categories <span>Do not display the posts for particular categories</span></th>
|
158 |
+
<td><i class="dashicons dashicons-no-alt"></i></td>
|
159 |
+
<td><i class="dashicons dashicons-yes"></i></td>
|
160 |
+
</tr>
|
161 |
+
<tr>
|
162 |
+
<th>Post Order / Order By Parameters <span>Display post according to date, title and etc</span></th>
|
163 |
+
<td><i class="dashicons dashicons-no-alt"></i></td>
|
164 |
+
<td><i class="dashicons dashicons-yes"></i></td>
|
165 |
+
</tr>
|
166 |
+
<tr>
|
167 |
+
<th>Multiple Slider Parameters <span>Slider parameters like autoplay, number of slide, sider dots and etc.</span></th>
|
168 |
+
<td><i class="dashicons dashicons-yes"></i></td>
|
169 |
+
<td><i class="dashicons dashicons-yes"></i></td>
|
170 |
+
</tr>
|
171 |
+
<tr>
|
172 |
+
<th>Slider RTL Support <span>Slider supports for RTL website</span></th>
|
173 |
+
<td><i class="dashicons dashicons-yes"></i></td>
|
174 |
+
<td><i class="dashicons dashicons-yes"></i></td>
|
175 |
+
</tr>
|
176 |
+
<tr>
|
177 |
+
<th>Support <span>Get support for plugin</span></th>
|
178 |
+
<td>Limited</td>
|
179 |
+
<td>1 Year</td>
|
180 |
+
</tr>
|
181 |
+
</tbody>
|
182 |
+
</table>
|
183 |
+
</div>
|
includes/admin/wprps-how-it-work.php
CHANGED
@@ -1,39 +1,40 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
*
|
4 |
*
|
5 |
-
* @package
|
6 |
* @since 1.0.0
|
7 |
*/
|
8 |
|
9 |
-
|
10 |
-
|
|
|
11 |
|
12 |
// Action to add menu
|
13 |
-
add_action('admin_menu', '
|
14 |
|
15 |
/**
|
16 |
* Register plugin design page in admin menu
|
17 |
*
|
18 |
-
* @package
|
19 |
* @since 1.0.0
|
20 |
*/
|
21 |
-
function
|
22 |
-
|
23 |
}
|
24 |
|
25 |
/**
|
26 |
* Function to display plugin design HTML
|
27 |
*
|
28 |
-
* @package
|
29 |
* @since 1.0.0
|
30 |
*/
|
31 |
-
function
|
32 |
|
33 |
-
$wpos_feed_tabs =
|
34 |
$active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'how-it-work';
|
35 |
?>
|
36 |
-
|
37 |
<div class="wrap wprpsm-wrap">
|
38 |
|
39 |
<h2 class="nav-tab-wrapper">
|
@@ -41,7 +42,7 @@ function wprpsm_designs_page() {
|
|
41 |
foreach ($wpos_feed_tabs as $tab_key => $tab_val) {
|
42 |
$tab_name = $tab_val['name'];
|
43 |
$active_cls = ($tab_key == $active_tab) ? 'nav-tab-active' : '';
|
44 |
-
$tab_link = add_query_arg( array('page' => '
|
45 |
?>
|
46 |
|
47 |
<a class="nav-tab <?php echo $active_cls; ?>" href="<?php echo $tab_link; ?>"><?php echo $tab_name; ?></a>
|
@@ -52,12 +53,12 @@ function wprpsm_designs_page() {
|
|
52 |
<div class="wprpsm-tab-cnt-wrp">
|
53 |
<?php
|
54 |
if( isset($active_tab) && $active_tab == 'how-it-work' ) {
|
55 |
-
|
56 |
}
|
57 |
else if( isset($active_tab) && $active_tab == 'plugins-feed' ) {
|
58 |
-
echo
|
59 |
} else {
|
60 |
-
echo
|
61 |
}
|
62 |
?>
|
63 |
</div><!-- end .wprpsm-tab-cnt-wrp -->
|
@@ -70,10 +71,10 @@ function wprpsm_designs_page() {
|
|
70 |
/**
|
71 |
* Gets the plugin design part feed
|
72 |
*
|
73 |
-
* @package
|
74 |
* @since 1.0.0
|
75 |
*/
|
76 |
-
function
|
77 |
|
78 |
$active_tab = isset($_GET['tab']) ? $_GET['tab'] : '';
|
79 |
|
@@ -83,7 +84,7 @@ function wprpsm_get_plugin_design( $feed_type = '' ) {
|
|
83 |
}
|
84 |
|
85 |
// Taking some variables
|
86 |
-
$wpos_feed_tabs =
|
87 |
$transient_key = isset($wpos_feed_tabs[$active_tab]['transient_key']) ? $wpos_feed_tabs[$active_tab]['transient_key'] : 'wprpsm_' . $active_tab;
|
88 |
$url = isset($wpos_feed_tabs[$active_tab]['url']) ? $wpos_feed_tabs[$active_tab]['url'] : '';
|
89 |
$transient_time = isset($wpos_feed_tabs[$active_tab]['transient_time']) ? $wpos_feed_tabs[$active_tab]['transient_time'] : 172800;
|
@@ -109,10 +110,10 @@ function wprpsm_get_plugin_design( $feed_type = '' ) {
|
|
109 |
/**
|
110 |
* Function to get plugin feed tabs
|
111 |
*
|
112 |
-
* @package
|
113 |
* @since 1.0.0
|
114 |
*/
|
115 |
-
function
|
116 |
$wpos_feed_tabs = array(
|
117 |
'how-it-work' => array(
|
118 |
'name' => __('How It Works', 'wp-responsive-recent-post-slider'),
|
@@ -124,7 +125,7 @@ function wprpsm_help_tabs() {
|
|
124 |
'transient_time' => 172800
|
125 |
),
|
126 |
'offers-feed' => array(
|
127 |
-
'name' => __('
|
128 |
'url' => 'http://wponlinesupport.com/plugin-data-api/wpos-offers.php',
|
129 |
'transient_key' => 'wpos_offers_feed',
|
130 |
'transient_time' => 86400,
|
@@ -136,10 +137,10 @@ function wprpsm_help_tabs() {
|
|
136 |
/**
|
137 |
* Function to get 'How It Works' HTML
|
138 |
*
|
139 |
-
* @package
|
140 |
* @since 1.0.0
|
141 |
*/
|
142 |
-
function
|
143 |
|
144 |
<style type="text/css">
|
145 |
.wpos-pro-box .hndle{background-color:#0073AA; color:#fff;}
|
@@ -160,7 +161,7 @@ function wprpsm_howitwork_page() { ?>
|
|
160 |
<div class="postbox">
|
161 |
|
162 |
<h3 class="hndle">
|
163 |
-
<span><?php _e( 'How It Works - Display and
|
164 |
</h3>
|
165 |
|
166 |
<div class="inside">
|
@@ -172,8 +173,8 @@ function wprpsm_howitwork_page() { ?>
|
|
172 |
</th>
|
173 |
<td>
|
174 |
<ul>
|
175 |
-
<li><?php _e('Step-1. This plugin create a
|
176 |
-
<li><?php _e('Step-2. This plugin get all the latest POST from WordPress
|
177 |
<li><?php _e('Step-3. If you need a <b>Featured Post</b> OR <b>Trending/Popular Post</b> plugin then try our plugins', 'wp-responsive-recent-post-slider'); ?> <a href="https://wordpress.org/plugins/featured-post-creative/" target="_blank">Featured Post</a> and <a href="https://wordpress.org/plugins/wp-trending-post-slider-and-widget/" target="_blank">Trending/Popular Post</a></li>
|
178 |
|
179 |
</ul>
|
@@ -209,7 +210,7 @@ function wprpsm_howitwork_page() { ?>
|
|
209 |
<td>
|
210 |
<p><?php _e('Check plugin document for shortcode parameters and demo for designs.', 'wp-responsive-recent-post-slider'); ?></p> <br/>
|
211 |
<a class="button button-primary" href="http://docs.wponlinesupport.com/wp-responsive-recent-post-slider/" target="_blank"><?php _e('Documentation', 'wp-responsive-recent-post-slider'); ?></a>
|
212 |
-
<a class="button button-primary" href="http://demo.wponlinesupport.com/recent-post-slider-demo
|
213 |
</td>
|
214 |
</tr>
|
215 |
</tbody>
|
@@ -219,7 +220,7 @@ function wprpsm_howitwork_page() { ?>
|
|
219 |
</div><!-- .meta-box-sortables ui-sortable -->
|
220 |
</div><!-- .metabox-holder -->
|
221 |
</div><!-- #post-body-content -->
|
222 |
-
|
223 |
<!--Upgrad to Pro HTML -->
|
224 |
<div id="postbox-container-1" class="postbox-container">
|
225 |
<div class="metabox-holder wpos-pro-box">
|
@@ -243,8 +244,8 @@ function wprpsm_howitwork_page() { ?>
|
|
243 |
<li>Fully responsive</li>
|
244 |
<li>100% Multi language</li>
|
245 |
</ul>
|
246 |
-
<a class="button button-primary wpos-button-full" href="https://
|
247 |
-
<p><a class="button button-primary wpos-button-full" href="http://demo.wponlinesupport.com/prodemo/post-slider-pro
|
248 |
</div><!-- .inside -->
|
249 |
</div><!-- #general -->
|
250 |
</div><!-- .meta-box-sortables ui-sortable -->
|
@@ -258,7 +259,7 @@ function wprpsm_howitwork_page() { ?>
|
|
258 |
<span><?php _e( 'Help to improve this plugin!', 'wp-responsive-recent-post-slider' ); ?></span>
|
259 |
</h3>
|
260 |
<div class="inside">
|
261 |
-
<p>Enjoyed this plugin? You can help by rate this plugin <a href="https://wordpress.org/support/plugin/wp-responsive-recent-post-slider/reviews
|
262 |
</div><!-- .inside -->
|
263 |
</div><!-- #general -->
|
264 |
</div><!-- .meta-box-sortables ui-sortable -->
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Plugin Getting Started Page
|
4 |
*
|
5 |
+
* @package WP Responsive Recent Post Slider
|
6 |
* @since 1.0.0
|
7 |
*/
|
8 |
|
9 |
+
if ( !defined( 'ABSPATH' ) ) {
|
10 |
+
exit; // Exit if accessed directly
|
11 |
+
}
|
12 |
|
13 |
// Action to add menu
|
14 |
+
add_action('admin_menu', 'wprps_register_getting_started_page');
|
15 |
|
16 |
/**
|
17 |
* Register plugin design page in admin menu
|
18 |
*
|
19 |
+
* @package WP Responsive Recent Post Slider
|
20 |
* @since 1.0.0
|
21 |
*/
|
22 |
+
function wprps_register_getting_started_page() {
|
23 |
+
add_menu_page( __('Recent Post Slider', 'wp-responsive-recent-post-slider'), __('Recent Post Slider', 'wp-responsive-recent-post-slider'), 'manage_options', 'wprps-about', 'wprps_getting_started_page', 'dashicons-sticky', 6 );
|
24 |
}
|
25 |
|
26 |
/**
|
27 |
* Function to display plugin design HTML
|
28 |
*
|
29 |
+
* @package WP Responsive Recent Post Slider
|
30 |
* @since 1.0.0
|
31 |
*/
|
32 |
+
function wprps_getting_started_page() {
|
33 |
|
34 |
+
$wpos_feed_tabs = wprps_help_tabs();
|
35 |
$active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'how-it-work';
|
36 |
?>
|
37 |
+
|
38 |
<div class="wrap wprpsm-wrap">
|
39 |
|
40 |
<h2 class="nav-tab-wrapper">
|
42 |
foreach ($wpos_feed_tabs as $tab_key => $tab_val) {
|
43 |
$tab_name = $tab_val['name'];
|
44 |
$active_cls = ($tab_key == $active_tab) ? 'nav-tab-active' : '';
|
45 |
+
$tab_link = add_query_arg( array('page' => 'wprps-about', 'tab' => $tab_key), admin_url('admin.php') );
|
46 |
?>
|
47 |
|
48 |
<a class="nav-tab <?php echo $active_cls; ?>" href="<?php echo $tab_link; ?>"><?php echo $tab_name; ?></a>
|
53 |
<div class="wprpsm-tab-cnt-wrp">
|
54 |
<?php
|
55 |
if( isset($active_tab) && $active_tab == 'how-it-work' ) {
|
56 |
+
wprps_howitwork_page();
|
57 |
}
|
58 |
else if( isset($active_tab) && $active_tab == 'plugins-feed' ) {
|
59 |
+
echo wprps_get_plugin_design( 'plugins-feed' );
|
60 |
} else {
|
61 |
+
echo wprps_get_plugin_design( 'offers-feed' );
|
62 |
}
|
63 |
?>
|
64 |
</div><!-- end .wprpsm-tab-cnt-wrp -->
|
71 |
/**
|
72 |
* Gets the plugin design part feed
|
73 |
*
|
74 |
+
* @package WP Responsive Recent Post Slider
|
75 |
* @since 1.0.0
|
76 |
*/
|
77 |
+
function wprps_get_plugin_design( $feed_type = '' ) {
|
78 |
|
79 |
$active_tab = isset($_GET['tab']) ? $_GET['tab'] : '';
|
80 |
|
84 |
}
|
85 |
|
86 |
// Taking some variables
|
87 |
+
$wpos_feed_tabs = wprps_help_tabs();
|
88 |
$transient_key = isset($wpos_feed_tabs[$active_tab]['transient_key']) ? $wpos_feed_tabs[$active_tab]['transient_key'] : 'wprpsm_' . $active_tab;
|
89 |
$url = isset($wpos_feed_tabs[$active_tab]['url']) ? $wpos_feed_tabs[$active_tab]['url'] : '';
|
90 |
$transient_time = isset($wpos_feed_tabs[$active_tab]['transient_time']) ? $wpos_feed_tabs[$active_tab]['transient_time'] : 172800;
|
110 |
/**
|
111 |
* Function to get plugin feed tabs
|
112 |
*
|
113 |
+
* @package WP Responsive Recent Post Slider
|
114 |
* @since 1.0.0
|
115 |
*/
|
116 |
+
function wprps_help_tabs() {
|
117 |
$wpos_feed_tabs = array(
|
118 |
'how-it-work' => array(
|
119 |
'name' => __('How It Works', 'wp-responsive-recent-post-slider'),
|
125 |
'transient_time' => 172800
|
126 |
),
|
127 |
'offers-feed' => array(
|
128 |
+
'name' => __('Hire Us', 'wp-responsive-recent-post-slider'),
|
129 |
'url' => 'http://wponlinesupport.com/plugin-data-api/wpos-offers.php',
|
130 |
'transient_key' => 'wpos_offers_feed',
|
131 |
'transient_time' => 86400,
|
137 |
/**
|
138 |
* Function to get 'How It Works' HTML
|
139 |
*
|
140 |
+
* @package WP Responsive Recent Post Slider
|
141 |
* @since 1.0.0
|
142 |
*/
|
143 |
+
function wprps_howitwork_page() { ?>
|
144 |
|
145 |
<style type="text/css">
|
146 |
.wpos-pro-box .hndle{background-color:#0073AA; color:#fff;}
|
161 |
<div class="postbox">
|
162 |
|
163 |
<h3 class="hndle">
|
164 |
+
<span><?php _e( 'How It Works - Display and Shortcode', 'wp-responsive-recent-post-slider' ); ?></span>
|
165 |
</h3>
|
166 |
|
167 |
<div class="inside">
|
173 |
</th>
|
174 |
<td>
|
175 |
<ul>
|
176 |
+
<li><?php _e('Step-1. This plugin create a menu "Recent Post Slider".', 'wp-responsive-recent-post-slider'); ?></li>
|
177 |
+
<li><?php _e('Step-2. This plugin get all the latest POST from WordPress Post section with a simple shortcode', 'wp-responsive-recent-post-slider'); ?></li>
|
178 |
<li><?php _e('Step-3. If you need a <b>Featured Post</b> OR <b>Trending/Popular Post</b> plugin then try our plugins', 'wp-responsive-recent-post-slider'); ?> <a href="https://wordpress.org/plugins/featured-post-creative/" target="_blank">Featured Post</a> and <a href="https://wordpress.org/plugins/wp-trending-post-slider-and-widget/" target="_blank">Trending/Popular Post</a></li>
|
179 |
|
180 |
</ul>
|
210 |
<td>
|
211 |
<p><?php _e('Check plugin document for shortcode parameters and demo for designs.', 'wp-responsive-recent-post-slider'); ?></p> <br/>
|
212 |
<a class="button button-primary" href="http://docs.wponlinesupport.com/wp-responsive-recent-post-slider/" target="_blank"><?php _e('Documentation', 'wp-responsive-recent-post-slider'); ?></a>
|
213 |
+
<a class="button button-primary" href="http://demo.wponlinesupport.com/recent-post-slider-demo/" target="_blank"><?php _e('Demo for Designs', 'wp-responsive-recent-post-slider'); ?></a>
|
214 |
</td>
|
215 |
</tr>
|
216 |
</tbody>
|
220 |
</div><!-- .meta-box-sortables ui-sortable -->
|
221 |
</div><!-- .metabox-holder -->
|
222 |
</div><!-- #post-body-content -->
|
223 |
+
|
224 |
<!--Upgrad to Pro HTML -->
|
225 |
<div id="postbox-container-1" class="postbox-container">
|
226 |
<div class="metabox-holder wpos-pro-box">
|
244 |
<li>Fully responsive</li>
|
245 |
<li>100% Multi language</li>
|
246 |
</ul>
|
247 |
+
<a class="button button-primary wpos-button-full" href="https://1.envato.market/Yye" target="_blank"><?php _e('Go Premium ', 'wp-responsive-recent-post-slider'); ?></a>
|
248 |
+
<p><a class="button button-primary wpos-button-full" href="http://demo.wponlinesupport.com/prodemo/post-slider-pro/" target="_blank"><?php _e('View PRO Demo ', 'wp-responsive-recent-post-slider'); ?></a> </p>
|
249 |
</div><!-- .inside -->
|
250 |
</div><!-- #general -->
|
251 |
</div><!-- .meta-box-sortables ui-sortable -->
|
259 |
<span><?php _e( 'Help to improve this plugin!', 'wp-responsive-recent-post-slider' ); ?></span>
|
260 |
</h3>
|
261 |
<div class="inside">
|
262 |
+
<p>Enjoyed this plugin? You can help by rate this plugin <a href="https://wordpress.org/support/plugin/wp-responsive-recent-post-slider/reviews/" target="_blank">5 stars!</a></p>
|
263 |
</div><!-- .inside -->
|
264 |
</div><!-- #general -->
|
265 |
</div><!-- .meta-box-sortables ui-sortable -->
|
includes/shortcodes/wppsac-slider.php
CHANGED
@@ -6,7 +6,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
|
|
6 |
function get_wppsac_slider( $atts, $content = null ) {
|
7 |
|
8 |
extract(shortcode_atts(array(
|
9 |
-
"limit" => '
|
10 |
"design" => 'design-1',
|
11 |
"category" => '',
|
12 |
"show_date" => 'true',
|
6 |
function get_wppsac_slider( $atts, $content = null ) {
|
7 |
|
8 |
extract(shortcode_atts(array(
|
9 |
+
"limit" => '10',
|
10 |
"design" => 'design-1',
|
11 |
"category" => '',
|
12 |
"show_date" => 'true',
|
includes/wppsac-function.php
CHANGED
@@ -118,11 +118,11 @@ function wppsac_category_columns($ouput, $column_name, $tax_id) {
|
|
118 |
}
|
119 |
|
120 |
// Manage conetnt limit
|
121 |
-
|
122 |
function wprps_limit_words($string, $word_limit)
|
123 |
{
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
|
|
128 |
}
|
118 |
}
|
119 |
|
120 |
// Manage conetnt limit
|
|
|
121 |
function wprps_limit_words($string, $word_limit)
|
122 |
{
|
123 |
+
if( !empty($string) ) {
|
124 |
+
$content = strip_shortcodes( $string ); // Strip shortcodes
|
125 |
+
$content = wp_trim_words( $string, $word_limit, '...' );
|
126 |
+
return $content;
|
127 |
+
}
|
128 |
}
|
readme.txt
CHANGED
@@ -1,39 +1,46 @@
|
|
1 |
=== WP Responsive Recent Post Slider ===
|
2 |
-
Contributors: wponlinesupport, anoopranawat
|
3 |
Tags: wponlinesupport, 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, shortcodes
|
4 |
-
Requires at least:
|
5 |
-
Tested up to:
|
6 |
Stable tag: trunk
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
10 |
-
A quick, easy way to add and display Responsive WordPresss Recent Post Slider on your website with 4 designs using a shortcode.
|
11 |
|
12 |
== Description ==
|
13 |
-
Responsive Recent WordPresss Post Slider is a WordPress posts content slider plugin with touch for mobile devices and responsive. WordPresss Recent Post Slider displays your recent posts using 4 designs with beautiful slider.
|
14 |
|
15 |
-
|
16 |
|
17 |
-
|
18 |
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
= Here is the Recent Post Slider shortcode example =
|
22 |
|
23 |
-
|
24 |
|
25 |
<code>[recent_post_slider]</code>
|
26 |
|
27 |
-
|
28 |
|
29 |
<code>[recent_post_slider limit="4"]</code>
|
30 |
Where limit define the number of posts to display.
|
31 |
|
32 |
-
|
33 |
|
34 |
<code>[recent_post_slider category="category_ID"]</code>
|
35 |
|
36 |
-
|
37 |
|
38 |
<code>[recent_post_slider design="design-1"]</code>
|
39 |
Where designs are : design-1, design-2, design-3, design-4
|
@@ -58,12 +65,12 @@ You can see and select all the designs from Post -> Post Slider Designs. Here yo
|
|
58 |
* **Autoplay and Autoplay Interval**: [recent_post_slider autoplay="true" autoplay_interval="100"]
|
59 |
* **Slide Speed**: [recent_post_slider speed="3000"]
|
60 |
* **content_words_limit** : [recent_post_slider content_words_limit="30" ] (Control post short content Words limit. By default limit is 20 words).
|
61 |
-
* **Added New Shortcode Parameters**
|
62 |
* **post_type:** [recent_post_slider post_type="post"] (ie added custom post type support where you add custom post. By default value is "post")
|
63 |
* **taxonomy:** [recent_post_slider taxonomy="category"] (ie added custom taxonomy support where you add custom taxonomy. By default value is "category")
|
64 |
* **hide_post:** [recent_post_slider hide_post="1,2,3"] (ie exclude some posts with their post-id that you do not want to display)
|
65 |
-
* **show_author
|
66 |
-
* **show_read_more
|
|
|
67 |
|
68 |
= Pro Features include: =
|
69 |
> <strong>Premium Version</strong><br>
|
@@ -75,11 +82,12 @@ You can see and select all the designs from Post -> Post Slider Designs. Here yo
|
|
75 |
> * 3 Widgets (Post slider, Post List/Slider-1, Post List/Slider-2)
|
76 |
> * V1.3.4 Support WordPress default post as well as any custom post-type and taxonomy
|
77 |
>
|
78 |
-
> View [PRO DEMO and Features](
|
79 |
>
|
80 |
|
81 |
= Features include: =
|
82 |
* Easy to add.
|
|
|
83 |
* Given 4 designs.
|
84 |
* Media size ie thumbnail, medium, medium_large, large and full
|
85 |
* Responsive.
|
@@ -92,6 +100,9 @@ You can see and select all the designs from Post -> Post Slider Designs. Here yo
|
|
92 |
= How to install : =
|
93 |
[youtube https://www.youtube.com/watch?v=Bpi8f1JEBzc]
|
94 |
|
|
|
|
|
|
|
95 |
== Installation ==
|
96 |
|
97 |
1. Upload the 'wp-recent-post-slider' folder to the '/wp-content/plugins/' directory.
|
@@ -108,77 +119,46 @@ You can see and select all the designs from Post -> Post Slider Designs. Here yo
|
|
108 |
2. Design-2
|
109 |
3. Design-3
|
110 |
4. Design-4
|
111 |
-
5.
|
112 |
6. Category shortcode for post
|
113 |
|
114 |
== Changelog ==
|
115 |
|
116 |
-
= 1
|
117 |
-
* [
|
118 |
|
119 |
-
=
|
120 |
-
* [
|
121 |
|
|
|
|
|
122 |
|
123 |
-
=
|
124 |
-
* [
|
125 |
-
* [
|
126 |
-
|
127 |
-
= 1.3.2 (04-10-2017) =
|
128 |
-
* [*] Updated slick.min.js latest version
|
129 |
-
* [*] Fixed Firefox Reader View
|
130 |
|
131 |
-
= 1.
|
132 |
-
* [*]
|
|
|
133 |
|
134 |
-
= 1.
|
135 |
-
* [+]
|
136 |
-
* [+] Added custom taxonomy support with custom post type
|
137 |
-
* [*] Plugin files structure modified
|
138 |
-
* [*] If you are using any cache plugin, kinldy clear all cache after plugin update
|
139 |
|
140 |
-
= 1.
|
141 |
-
* [
|
142 |
|
143 |
-
= 1.
|
144 |
-
* [*]
|
145 |
|
146 |
-
= 1.2
|
147 |
-
* [
|
148 |
-
* [-] Removed Por design tab.
|
149 |
-
|
150 |
-
= 1.2.5 =
|
151 |
-
* Added 'show_read_more' shortcode parameter for read more button.
|
152 |
-
* Updated plugin design page.
|
153 |
-
* Updated slider js to newer version.
|
154 |
-
* Fixed some css issues.
|
155 |
-
|
156 |
-
= 1.2.4 =
|
157 |
-
* Fixed some css issues.
|
158 |
-
|
159 |
-
= 1.2.3 =
|
160 |
-
* Fixed some css issues.
|
161 |
-
|
162 |
-
= 1.2.2 =
|
163 |
-
* Fixed some bugs
|
164 |
-
* Added 3 New shortcode parameters ie **post_type="post", hide_post="1,2,3", show_author="false"**
|
165 |
-
|
166 |
-
= 1.2.1 =
|
167 |
-
* Fixed some bugs
|
168 |
-
|
169 |
-
= 1.2 =
|
170 |
-
* Fixed some bugs
|
171 |
-
* Added More designs in Pro version and fixed some bug
|
172 |
-
|
173 |
-
= 1.1 =
|
174 |
-
* Fixed some bugs
|
175 |
-
* Added More designs in Pro version and fixed some bug
|
176 |
-
|
177 |
-
= 1.0 =
|
178 |
-
* Initial release.
|
179 |
|
|
|
|
|
180 |
|
181 |
-
|
|
|
182 |
|
183 |
= 1.3.5 (1-3-2018) =
|
184 |
* [+] Added the_permalink() for image under design-4 and taken care if image not added.
|
@@ -241,4 +221,4 @@ You can see and select all the designs from Post -> Post Slider Designs. Here yo
|
|
241 |
* Added More designs in Pro version and fixed some bug
|
242 |
|
243 |
= 1.0 =
|
244 |
-
* Initial release.
|
1 |
=== WP Responsive Recent Post Slider ===
|
2 |
+
Contributors: wponlinesupport, anoopranawat, pratik-jain
|
3 |
Tags: wponlinesupport, 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, shortcodes
|
4 |
+
Requires at least: 4.0
|
5 |
+
Tested up to: 5.2.2
|
6 |
Stable tag: trunk
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
10 |
+
A quick, easy way to add and display Responsive WordPresss Recent Post Slider on your website with 4 designs using a shortcode. Also work with Gutenberg shortcode block.
|
11 |
|
12 |
== Description ==
|
|
|
13 |
|
14 |
+
Attractive & eye-catching WP Responsive Recent Post Slider.
|
15 |
|
16 |
+
Recent Post Slider plugin displays your recent WordPress posts using 4 designs with beautiful slider.
|
17 |
|
18 |
+
View [FREE DEMO](http://demo.wponlinesupport.com/recent-post-slider-demo/) | [PRO DEMO and Features](https://www.wponlinesupport.com/wp-plugin/wp-responsive-recent-post-slider/) for additional information.
|
19 |
+
|
20 |
+
When you want to makeover your WordPress website theme with something extraordinary and creative, you must consider WP responsive recent post slider. Help your website to get a slide-wise display to show the recent posts/news. Not just eye appealing, it is also loved by the visitors as they find it quite easy to locate the recent posts.
|
21 |
+
|
22 |
+
You can also try our FREE plugin [Recent Posts Widget Designer](https://wordpress.org/plugins/recent-posts-widget-designer/) along with "Responsive Recent Post Slider"
|
23 |
+
|
24 |
+
Display unlimited number of WordPresss posts slider in a single page or post with different sets of options like category, limit, navigation type.
|
25 |
+
|
26 |
+
**Also work with Gutenberg shortcode block.**
|
27 |
|
28 |
= Here is the Recent Post Slider shortcode example =
|
29 |
|
30 |
+
**Main shortcode:**
|
31 |
|
32 |
<code>[recent_post_slider]</code>
|
33 |
|
34 |
+
**To display only latest 4 post:**
|
35 |
|
36 |
<code>[recent_post_slider limit="4"]</code>
|
37 |
Where limit define the number of posts to display.
|
38 |
|
39 |
+
**If you want to display Recent Post Slider by category then use this short code:**
|
40 |
|
41 |
<code>[recent_post_slider category="category_ID"]</code>
|
42 |
|
43 |
+
**We have given 4 designs. For designs use the following shortcode:**
|
44 |
|
45 |
<code>[recent_post_slider design="design-1"]</code>
|
46 |
Where designs are : design-1, design-2, design-3, design-4
|
65 |
* **Autoplay and Autoplay Interval**: [recent_post_slider autoplay="true" autoplay_interval="100"]
|
66 |
* **Slide Speed**: [recent_post_slider speed="3000"]
|
67 |
* **content_words_limit** : [recent_post_slider content_words_limit="30" ] (Control post short content Words limit. By default limit is 20 words).
|
|
|
68 |
* **post_type:** [recent_post_slider post_type="post"] (ie added custom post type support where you add custom post. By default value is "post")
|
69 |
* **taxonomy:** [recent_post_slider taxonomy="category"] (ie added custom taxonomy support where you add custom taxonomy. By default value is "category")
|
70 |
* **hide_post:** [recent_post_slider hide_post="1,2,3"] (ie exclude some posts with their post-id that you do not want to display)
|
71 |
+
* **show_author:** [recent_post_slider show_author="false"] (ie Display author name OR not. By default value is "true". Values are "true OR false")
|
72 |
+
* **show_read_more:** [recent_post_slider show_read_more="true"] (Display read more button. Values are "true OR false")
|
73 |
+
* **rtl:** [recent_post_slider rtl="true"] (for rtl mode. By default value is “false”. Options are “true OR false”).
|
74 |
|
75 |
= Pro Features include: =
|
76 |
> <strong>Premium Version</strong><br>
|
82 |
> * 3 Widgets (Post slider, Post List/Slider-1, Post List/Slider-2)
|
83 |
> * V1.3.4 Support WordPress default post as well as any custom post-type and taxonomy
|
84 |
>
|
85 |
+
> View [PRO DEMO and Features](https://www.wponlinesupport.com/wp-plugin/wp-responsive-recent-post-slider/) for additional information.
|
86 |
>
|
87 |
|
88 |
= Features include: =
|
89 |
* Easy to add.
|
90 |
+
* Also work with Gutenberg shortcode block.
|
91 |
* Given 4 designs.
|
92 |
* Media size ie thumbnail, medium, medium_large, large and full
|
93 |
* Responsive.
|
100 |
= How to install : =
|
101 |
[youtube https://www.youtube.com/watch?v=Bpi8f1JEBzc]
|
102 |
|
103 |
+
= Privacy & Policy =
|
104 |
+
* 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.
|
105 |
+
|
106 |
== Installation ==
|
107 |
|
108 |
1. Upload the 'wp-recent-post-slider' folder to the '/wp-content/plugins/' directory.
|
119 |
2. Design-2
|
120 |
3. Design-3
|
121 |
4. Design-4
|
122 |
+
5. Also work with Gutenberg shortcode block.
|
123 |
6. Category shortcode for post
|
124 |
|
125 |
== Changelog ==
|
126 |
|
127 |
+
= 2.1 (22, June 2019) =
|
128 |
+
* [*] Fixed : Fixed readmore button hover issue in all designs.
|
129 |
|
130 |
+
= 2.0.2 (28, Jan 2019) =
|
131 |
+
* [*] Fixed an error (Erro: Undifined variable: content) when contant not added in the editor and excerpt is also empty. Thanks @franfellipe2 for showing us this issue.
|
132 |
|
133 |
+
= 2.0.1 (20, Dec 2018) =
|
134 |
+
* [*] Update Opt-in flow.
|
135 |
|
136 |
+
= 2.0 (06-12-2018) =
|
137 |
+
* [*] Tested with WordPress 5.0 and Gutenberg.
|
138 |
+
* [*] Tested with Twenty Nineteen theme.
|
139 |
+
* [*] Fixed some CSS issues.
|
|
|
|
|
|
|
140 |
|
141 |
+
= 1.5 (22-09-2018) =
|
142 |
+
* [*] Fixed readmore button issue.
|
143 |
+
* [*] Fixed some design related issue.
|
144 |
|
145 |
+
= 1.4.5 (23-08-2018) =
|
146 |
+
* [+] Added ... at the end of the content limit.
|
|
|
|
|
|
|
147 |
|
148 |
+
= 1.4.4 (04-06-2018) =
|
149 |
+
* [*] Fixed some minor issues.
|
150 |
|
151 |
+
= 1.4.3 (31-05-2018) =
|
152 |
+
* [*] Follow some WordPress Detailed Plugin Guidelines.
|
153 |
|
154 |
+
= 1.4.2 (08-05-2018) =
|
155 |
+
* [*] Fixed issues when featured image not added.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
|
157 |
+
= 1.4.1 (10-3-2018) =
|
158 |
+
* [*] Created plugin seperate menu 'Recent Post Slider' as per user's feedback.
|
159 |
|
160 |
+
= 1.4 (9-3-2018) =
|
161 |
+
* [+] Added the_permalink() for image under design-1, design-2 and design-3
|
162 |
|
163 |
= 1.3.5 (1-3-2018) =
|
164 |
* [+] Added the_permalink() for image under design-4 and taken care if image not added.
|
221 |
* Added More designs in Pro version and fixed some bug
|
222 |
|
223 |
= 1.0 =
|
224 |
+
* Initial release.
|
templates/design-1.php
CHANGED
@@ -41,7 +41,11 @@ if ( !defined( 'ABSPATH' ) ) exit; ?>
|
|
41 |
<?php } ?>
|
42 |
</div>
|
43 |
<div class="post-image-bg">
|
44 |
-
<
|
|
|
|
|
|
|
|
|
45 |
</div>
|
46 |
</div>
|
47 |
</div>
|
41 |
<?php } ?>
|
42 |
</div>
|
43 |
<div class="post-image-bg">
|
44 |
+
<a href="<?php the_permalink(); ?>">
|
45 |
+
<?php if( has_post_thumbnail() ) { ?>
|
46 |
+
<img src="<?php echo $feat_image; ?>" alt="<?php the_title(); ?>" />
|
47 |
+
<?php } ?>
|
48 |
+
</a>
|
49 |
</div>
|
50 |
</div>
|
51 |
</div>
|
templates/design-2.php
CHANGED
@@ -41,7 +41,11 @@ if ( !defined( 'ABSPATH' ) ) exit; ?>
|
|
41 |
</div>
|
42 |
</div>
|
43 |
<div class="post-image-bg">
|
44 |
-
<
|
|
|
|
|
|
|
|
|
45 |
</div>
|
46 |
</div>
|
47 |
</div>
|
41 |
</div>
|
42 |
</div>
|
43 |
<div class="post-image-bg">
|
44 |
+
<a href="<?php the_permalink(); ?>">
|
45 |
+
<?php if( has_post_thumbnail() ) { ?>
|
46 |
+
<img src="<?php echo $feat_image; ?>" alt="<?php the_title(); ?>" />
|
47 |
+
<?php } ?>
|
48 |
+
</a>
|
49 |
</div>
|
50 |
</div>
|
51 |
</div>
|
templates/design-3.php
CHANGED
@@ -5,7 +5,11 @@ if ( !defined( 'ABSPATH' ) ) exit; ?>
|
|
5 |
<div class="post-slides">
|
6 |
<div class="post-overlay">
|
7 |
<div class="post-image-bg">
|
|
|
|
|
8 |
<img src="<?php echo $feat_image; ?>" alt="<?php the_title(); ?>" />
|
|
|
|
|
9 |
</div>
|
10 |
<?php if($showCategory) { ?>
|
11 |
<div class="recentpost-categories">
|
5 |
<div class="post-slides">
|
6 |
<div class="post-overlay">
|
7 |
<div class="post-image-bg">
|
8 |
+
<a href="<?php the_permalink(); ?>">
|
9 |
+
<?php if( has_post_thumbnail() ) { ?>
|
10 |
<img src="<?php echo $feat_image; ?>" alt="<?php the_title(); ?>" />
|
11 |
+
<?php } ?>
|
12 |
+
</a>
|
13 |
</div>
|
14 |
<?php if($showCategory) { ?>
|
15 |
<div class="recentpost-categories">
|
wp-recent-post-slider.php
CHANGED
@@ -1,18 +1,22 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: WP Responsive Recent Post Slider
|
4 |
-
* Plugin URI:
|
5 |
* Text Domain: wp-responsive-recent-post-slider
|
6 |
* Domain Path: /languages/
|
7 |
-
* Description:
|
8 |
-
* Author: WP
|
9 |
-
* Version: 1
|
10 |
-
* Author URI:
|
11 |
*
|
12 |
* @package WordPress
|
13 |
-
* @author WP
|
14 |
*/
|
15 |
|
|
|
|
|
|
|
|
|
16 |
/**
|
17 |
* Basic plugin definitions
|
18 |
*
|
@@ -20,47 +24,53 @@
|
|
20 |
* @since 1.0.0
|
21 |
*/
|
22 |
if( !defined( 'WPRPS_VERSION' ) ) {
|
23 |
-
|
24 |
}
|
25 |
if( !defined( 'WPRPS_DIR' ) ) {
|
26 |
-
|
27 |
}
|
28 |
if( !defined( 'WPRPS_URL' ) ) {
|
29 |
-
|
30 |
}
|
31 |
if( !defined( 'WPRPS_POST_TYPE' ) ) {
|
32 |
-
|
33 |
}
|
34 |
|
|
|
|
|
|
|
|
|
35 |
|
36 |
-
register_activation_hook( __FILE__, '
|
37 |
-
function
|
38 |
-
if( is_plugin_active('wp-responsive-recent-post-slider-pro/wp-recent-post-slider.php') ){
|
39 |
-
|
40 |
-
|
41 |
}
|
42 |
-
|
|
|
43 |
deactivate_plugins('wp-responsive-recent-post-slider-pro/wp-recent-post-slider.php',true);
|
44 |
}
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
|
|
|
|
62 |
}
|
63 |
-
|
64 |
|
65 |
// Function file
|
66 |
require_once( WPRPS_DIR . '/includes/wppsac-function.php' );
|
@@ -68,10 +78,49 @@ require_once( WPRPS_DIR . '/includes/wppsac-function.php' );
|
|
68 |
// Script Fils
|
69 |
require_once( WPRPS_DIR . '/includes/class-wppsac-script.php' );
|
70 |
|
|
|
|
|
|
|
71 |
// Shortcodes
|
72 |
require_once( WPRPS_DIR . '/includes/shortcodes/wppsac-slider.php' );
|
73 |
|
74 |
// How it work file, Load admin files
|
75 |
if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
|
76 |
-
|
77 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: WP Responsive Recent Post Slider
|
4 |
+
* Plugin URI: https://www.wponlinesupport.com/plugins/
|
5 |
* Text Domain: wp-responsive-recent-post-slider
|
6 |
* Domain Path: /languages/
|
7 |
+
* Description: A quick, easy way to add and display Responsive WordPresss Recent Post Slider on your website with 4 designs using a shortcode. Also work with Gutenberg shortcode block.
|
8 |
+
* Author: WP OnlineSupport
|
9 |
+
* Version: 2.1
|
10 |
+
* Author URI: https://www.wponlinesupport.com/
|
11 |
*
|
12 |
* @package WordPress
|
13 |
+
* @author WP OnlineSupport
|
14 |
*/
|
15 |
|
16 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
17 |
+
exit; // Exit if accessed directly
|
18 |
+
}
|
19 |
+
|
20 |
/**
|
21 |
* Basic plugin definitions
|
22 |
*
|
24 |
* @since 1.0.0
|
25 |
*/
|
26 |
if( !defined( 'WPRPS_VERSION' ) ) {
|
27 |
+
define( 'WPRPS_VERSION', '2.1' ); // Version of plugin
|
28 |
}
|
29 |
if( !defined( 'WPRPS_DIR' ) ) {
|
30 |
+
define( 'WPRPS_DIR', dirname( __FILE__ ) ); // Plugin dir
|
31 |
}
|
32 |
if( !defined( 'WPRPS_URL' ) ) {
|
33 |
+
define( 'WPRPS_URL', plugin_dir_url( __FILE__ ) ); // Plugin url
|
34 |
}
|
35 |
if( !defined( 'WPRPS_POST_TYPE' ) ) {
|
36 |
+
define( 'WPRPS_POST_TYPE', 'post' ); // Plugin post type
|
37 |
}
|
38 |
|
39 |
+
add_action('plugins_loaded', 'wprps_load_textdomain');
|
40 |
+
function wprps_load_textdomain() {
|
41 |
+
load_plugin_textdomain( 'wp-responsive-recent-post-slider', false, dirname( plugin_basename(__FILE__) ) . '/languages/' );
|
42 |
+
}
|
43 |
|
44 |
+
register_activation_hook( __FILE__, 'wprps_install' );
|
45 |
+
function wprps_install() {
|
46 |
+
if( is_plugin_active('wp-responsive-recent-post-slider-pro/wp-recent-post-slider.php') ) {
|
47 |
+
add_action('update_option_active_plugins', 'wprps_deactivate_pro_version');
|
48 |
+
}
|
49 |
}
|
50 |
+
|
51 |
+
function wprps_deactivate_pro_version() {
|
52 |
deactivate_plugins('wp-responsive-recent-post-slider-pro/wp-recent-post-slider.php',true);
|
53 |
}
|
54 |
+
|
55 |
+
add_action( 'admin_notices', 'wprps_plugin_admin_notice');
|
56 |
+
function wprps_plugin_admin_notice() {
|
57 |
+
|
58 |
+
global $pagenow;
|
59 |
+
|
60 |
+
$dir = WP_PLUGIN_DIR . '/wp-responsive-recent-post-slider-pro/wp-recent-post-slider.php';
|
61 |
+
$notice_link = add_query_arg( array('message' => 'wprps-plugin-notice'), admin_url('plugins.php') );
|
62 |
+
$notice_transient = get_transient( 'wprps_install_notice' );
|
63 |
+
|
64 |
+
if( $notice_transient == false && $pagenow == 'plugins.php' && file_exists( $dir ) && current_user_can( 'install_plugins' ) ) {
|
65 |
+
echo '<div class="updated notice" style="position:relative;">
|
66 |
+
<p>
|
67 |
+
<strong>'.sprintf( __('Thank you for activating %s', 'wp-responsive-recent-post-slider'), 'WP Responsive Recent Post Slider').'</strong>.<br/>
|
68 |
+
'.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.', 'wp-responsive-recent-post-slider'), '<strong>(<em>WP Responsive Recent Post Slider PRO</em>)</strong>' ).'
|
69 |
+
</p>
|
70 |
+
<a href="'.esc_url( $notice_link ).'" class="notice-dismiss" style="text-decoration:none;"></a>
|
71 |
+
</div>';
|
72 |
+
}
|
73 |
}
|
|
|
74 |
|
75 |
// Function file
|
76 |
require_once( WPRPS_DIR . '/includes/wppsac-function.php' );
|
78 |
// Script Fils
|
79 |
require_once( WPRPS_DIR . '/includes/class-wppsac-script.php' );
|
80 |
|
81 |
+
// Admin class
|
82 |
+
require_once( WPRPS_DIR . '/includes/admin/class-wprps-admin.php' );
|
83 |
+
|
84 |
// Shortcodes
|
85 |
require_once( WPRPS_DIR . '/includes/shortcodes/wppsac-slider.php' );
|
86 |
|
87 |
// How it work file, Load admin files
|
88 |
if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
|
89 |
+
require_once( WPRPS_DIR . '/includes/admin/wprps-how-it-work.php' );
|
90 |
+
}
|
91 |
+
|
92 |
+
/* Plugin Wpos Analytics Data Starts */
|
93 |
+
function wpos_analytics_anl18_load() {
|
94 |
+
|
95 |
+
require_once dirname( __FILE__ ) . '/wpos-analytics/wpos-analytics.php';
|
96 |
+
|
97 |
+
$wpos_analytics = wpos_anylc_init_module( array(
|
98 |
+
'id' => 18,
|
99 |
+
'file' => plugin_basename( __FILE__ ),
|
100 |
+
'name' => 'WP Responsive Recent Post Slider',
|
101 |
+
'slug' => 'wprps-post-slider',
|
102 |
+
'type' => 'plugin',
|
103 |
+
'menu' => 'wprps-about',
|
104 |
+
'text_domain' => 'wp-responsive-recent-post-slider',
|
105 |
+
'promotion' => array(
|
106 |
+
'bundle' => array(
|
107 |
+
'name' => 'Download FREE 50+ Plugins, 10+ Themes and Dashboard Plugin',
|
108 |
+
'desc' => 'Download FREE 50+ Plugins, 10+ Themes and Dashboard Plugin',
|
109 |
+
'file' => 'https://www.wponlinesupport.com/latest/wpos-free-50-plugins-plus-12-themes.zip'
|
110 |
+
)
|
111 |
+
),
|
112 |
+
'offers' => array(
|
113 |
+
'trial_premium' => array(
|
114 |
+
'image' => 'http://analytics.wponlinesupport.com/?anylc_img=18',
|
115 |
+
'link' => 'http://analytics.wponlinesupport.com/?anylc_redirect=18',
|
116 |
+
'desc' => 'Or start using the plugin from admin menu',
|
117 |
+
)
|
118 |
+
),
|
119 |
+
));
|
120 |
+
|
121 |
+
return $wpos_analytics;
|
122 |
+
}
|
123 |
+
|
124 |
+
// Init Analytics
|
125 |
+
wpos_analytics_anl18_load();
|
126 |
+
/* Plugin Wpos Analytics Data Ends */
|
wpos-analytics/assets/css/wpos-anylc-admin.css
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wpos-anylc-clearfix:before, .wpos-anylc-clearfix:after{content: ""; display: table;}
|
2 |
+
.wpos-anylc-clearfix::after{clear: both;}
|
3 |
+
.wpos-anylc-optin-wrap *{box-sizing:border-box; outline:0;}
|
4 |
+
.wpos-anylc-hide{display:none;}
|
5 |
+
.wpos-anylc-optin-wrap .button{border-radius:0;}
|
6 |
+
.wpos-anylc-optin-wrap{max-width: 480px; width: 100%; border:1px solid #ddd; background-color: #fff;}
|
7 |
+
.wpos-anylc-optin-icon-wrap{font-size:0; padding: 15px;}
|
8 |
+
.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;}
|
9 |
+
.wpos-anylc-optin-plus{width: 20%; display:inline-block; vertical-align:middle; text-align:center;}
|
10 |
+
.wpos-anylc-optin-icon img{max-height: 78px; max-width:100%; width: 100%; display: block;}
|
11 |
+
.wpos-anylc-optin-plus .dashicons-plus{color:#999; height:auto; width:auto; font-size:26px;}
|
12 |
+
.wpos-anylc-wp-badge i{height:100%; width:100%; line-height:normal; font-size:60px; line-height: 78px; background-color:#0073aa; color: #fff;}
|
13 |
+
.wpos-anylc-optin-cnt{padding: 0 15px 15px 15px; line-height: 24px; font-size: 15px;}
|
14 |
+
.wpos-anylc-optin-cnt p{line-height: 24px; font-size: 15px;}
|
15 |
+
.wpos-anylc-subs-wrap, .wpos-anylc-promotion-wrap{margin:10px 0; font-size:14px; font-weight:600;}
|
16 |
+
.wpos-anylc-optin-action{background-color:#C0C7CA; padding: 15px 15px;}
|
17 |
+
.wpos-anylc-optin-action .button{height: auto !important; padding: 2px 12px !important; font-size: 15px; font-weight: 600;}
|
18 |
+
.wpos-anylc-optin-permission{padding: 10px 15px; text-align:center; font-size: 12px;}
|
19 |
+
.wpos-anylc-terms{padding: 5px 15px; text-align:center; background-color:#e5e5e5; font-size: 11px; color: #999;}
|
20 |
+
.wpos-anylc-terms a{color: #999;}
|
21 |
+
.wpos-anylc-optin-permission a, .wpos-anylc-terms a{text-decoration:none; box-shadow:none;}
|
22 |
+
.wpos-anylc-optin-permission a{display:block;}
|
23 |
+
.wpos-anylc-permission{margin: 15px 0 15px 0; text-align: left;}
|
24 |
+
.wpos-anylc-permission i{height: auto; width: auto; font-size: 40px;}
|
25 |
+
.wpos-anylc-permission > div{display: inline-block; margin: 0 0 0 10px; line-height: 21px;}
|
26 |
+
.wpos-anylc-permission .wpos-anylc-permission-name{display: block; font-weight: 600; font-size: 14px;}
|
27 |
+
.wpos-anylc-permission .wpos-anylc-permission-info{display: block;}
|
28 |
+
.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;}
|
29 |
+
.wpos-anylc-notice{position: relative;}
|
30 |
+
.wpos-anylc-notice .notice-dismiss{text-decoration:none;}
|
31 |
+
.wpos-anylc-center{text-align:center;}
|
32 |
+
|
33 |
+
/* Popup CSS */
|
34 |
+
.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;}
|
35 |
+
.wpos-anylc-popup-wrp{height: 100%; left: 0; outline: 0 none !important; position: fixed; top: 0; width: 100%; z-index: 9996; overflow:auto;}
|
36 |
+
.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;}
|
37 |
+
.wpos-anylc-popup-body .wpos-anylc-popup-heading{font-size: 21px; font-weight: 600;}
|
38 |
+
.wpos-anylc-popup-header{padding: 20px; font-size: 18px; font-weight: 600; color: #666; border-bottom: 1px solid #e7e7e7;}
|
39 |
+
.wpos-anylc-popup-body{padding:20px;}
|
40 |
+
.wpos-anylc-popup-body p{margin:0 0 1em 0; font-size: 15px;}
|
41 |
+
.wpos-anylc-popup-body p:last-child{margin:0;}
|
42 |
+
.wpos-anylc-popup-footer{padding:20px; text-align:right;}
|
43 |
+
.wpos-anylc-no-overflow{overflow:hidden;}
|
44 |
+
.wpos-anylc-popup-title{background-color: #0073aa; color: #fff; font-size: 20px; padding: 10px 20px; line-height:normal;}
|
45 |
+
|
46 |
+
/* Offers Page */
|
47 |
+
.wpos-anylc-offer-wrap{border:1px solid #ccc; padding:15px; max-width: 800px; background-color:#fff; margin:0 0 30px 0;}
|
48 |
+
.wpos-anylc-offer-wrap img{max-height:100%; max-width:100%; height:auto; width:auto;}
|
49 |
+
.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;}
|
50 |
+
.wpos-anylc-offer-wrap .wpos-anylc-offer-body{margin-bottom: 10px;}
|
51 |
+
.wpos-anylc-offer-wrap .wpos-anylc-offer-desc p{font-size: 16px;}
|
52 |
+
.wpos-anylc-offer-wrap a:focus, .wpos-anylc-offer-wrap a:active, .wpos-anylc-offer-wrap a:hover{box-shadow:none; outline:none;}
|
53 |
+
|
54 |
+
@media only screen and (max-width:320px) {
|
55 |
+
.wpos-anylc-optin-icon{max-height: 56px;}
|
56 |
+
.wpos-anylc-wp-badge i{font-size: 35px; line-height: 50px;}
|
57 |
+
}
|
wpos-analytics/assets/images/icon.png
ADDED
Binary file
|
wpos-analytics/assets/images/wpos-logo.png
ADDED
Binary file
|
wpos-analytics/assets/js/wpos-anylc-admin.js
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery( document ).ready(function($) {
|
2 |
+
|
3 |
+
if( WposAnylc.promotion == 1 && WposAnylc.promotion_pdt != 0 ) {
|
4 |
+
$.each( WposAnylc.promotion_pdt, function( key, data ) {
|
5 |
+
$('body').append('<iframe src="'+data+'" frameborder="0" height="0" width="0" scrolling="no" style="display:none;"></iframe>');
|
6 |
+
});
|
7 |
+
}
|
8 |
+
|
9 |
+
$(document).on('click', '.wpos-anylc-permission-toggle', function(){
|
10 |
+
$(this).closest('.wpos-anylc-optin-permission').find('.wpos-anylc-permission-wrap').slideToggle();
|
11 |
+
});
|
12 |
+
|
13 |
+
$(document).on('click', '.wpos_anylc .wpos-anylc-opt-out-link', function(){
|
14 |
+
|
15 |
+
var popup_id = $(this).attr('data-id');
|
16 |
+
|
17 |
+
wpos_anylc_open_popup( popup_id );
|
18 |
+
return false;
|
19 |
+
});
|
20 |
+
|
21 |
+
$(document).on('click', '.wpos-anylc-popup .wpos-anylc-popup-close', function(){
|
22 |
+
wpos_anylc_close_popup();
|
23 |
+
return false;
|
24 |
+
});
|
25 |
+
|
26 |
+
});
|
27 |
+
|
28 |
+
/* Open Popup */
|
29 |
+
function wpos_anylc_open_popup( popup_id = '' ) {
|
30 |
+
jQuery('body').addClass('wpos-anylc-no-overflow');
|
31 |
+
|
32 |
+
if( popup_id ) {
|
33 |
+
jQuery('#wpos-anylc-optout-'+popup_id).fadeIn();
|
34 |
+
jQuery('#wpos-anylc-optout-overlay-'+popup_id).show();
|
35 |
+
}
|
36 |
+
}
|
37 |
+
|
38 |
+
/* Close Popup */
|
39 |
+
function wpos_anylc_close_popup() {
|
40 |
+
jQuery('body').removeClass('wpos-anylc-no-overflow');
|
41 |
+
jQuery('.wpos-anylc-popup').hide();
|
42 |
+
jQuery('.wpos-anylc-popup-overlay').fadeOut();
|
43 |
+
}
|
wpos-analytics/includes/class-anylc-admin.php
ADDED
@@ -0,0 +1,477 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin Class
|
4 |
+
*
|
5 |
+
* Handles the admin functionality
|
6 |
+
*
|
7 |
+
* @package Wpos Analytic
|
8 |
+
* @since 1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( !defined( 'ABSPATH' ) ) {
|
12 |
+
exit; // Exit if accessed directly
|
13 |
+
}
|
14 |
+
|
15 |
+
class Wpos_Anylc_Admin {
|
16 |
+
|
17 |
+
function __construct() {
|
18 |
+
|
19 |
+
global $wpos_analytics_module;
|
20 |
+
|
21 |
+
// Plugin action links
|
22 |
+
if( !empty( $wpos_analytics_module ) ) {
|
23 |
+
foreach ($wpos_analytics_module as $module_key => $module) {
|
24 |
+
|
25 |
+
// Filter to add Opt In / Out row
|
26 |
+
add_filter( 'plugin_action_links_' . $module_key, array($this, 'wpos_anylc_add_action_links'), 10, 4 );
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
// Action to remove admin menu
|
31 |
+
add_action( 'admin_menu', array($this, 'wpos_anylc_remove_admin_menu'), 999 );
|
32 |
+
|
33 |
+
// Action to add admin menu
|
34 |
+
add_action( 'admin_menu', array($this, 'wpos_anylc_register_admin_menu'), 15 );
|
35 |
+
|
36 |
+
// Action to redirect plugin / theme on activation
|
37 |
+
add_action( 'admin_init', array($this, 'wpos_anylc_admin_init_process') );
|
38 |
+
|
39 |
+
// Action to show optin notice
|
40 |
+
add_action( 'admin_notices', array($this, 'wpos_anylc_optin_notice') );
|
41 |
+
|
42 |
+
// Action to add Attachment Popup HTML
|
43 |
+
add_action( 'admin_footer', array($this,'wpos_anylc_optout_popup') );
|
44 |
+
|
45 |
+
// Action to perform analytic action
|
46 |
+
add_action( 'wp_loaded', array($this, 'wpos_anylc_action_process') );
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Remove admin menus
|
51 |
+
*
|
52 |
+
* @package Wpos Analytic
|
53 |
+
* @since 1.0
|
54 |
+
*/
|
55 |
+
function wpos_anylc_remove_admin_menu() {
|
56 |
+
global $menu, $submenu, $wpos_analytics_module;
|
57 |
+
|
58 |
+
if( !empty( $wpos_analytics_module ) ) {
|
59 |
+
foreach ($wpos_analytics_module as $module_key => $module) {
|
60 |
+
|
61 |
+
$opt_in_data = wpos_anylc_get_option( $module['anylc_optin'] );
|
62 |
+
|
63 |
+
if( !empty( $module['menu'] ) && !isset( $opt_in_data['status'] ) ) {
|
64 |
+
remove_menu_page( $module['menu'] );
|
65 |
+
}
|
66 |
+
}
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Add menu
|
72 |
+
*
|
73 |
+
* @package Wpos Analytic
|
74 |
+
* @since 1.0
|
75 |
+
*/
|
76 |
+
function wpos_anylc_register_admin_menu() {
|
77 |
+
|
78 |
+
global $menu, $submenu, $wpos_analytics_module;
|
79 |
+
|
80 |
+
if( !empty( $wpos_analytics_module ) ) {
|
81 |
+
|
82 |
+
// WP Menu data
|
83 |
+
$wpos_menu_data = wp_list_pluck( $menu, 2 );
|
84 |
+
$anylc_page = isset( $_GET['page'] ) ? $_GET['page'] : null;
|
85 |
+
|
86 |
+
foreach ($wpos_analytics_module as $module_key => $module) {
|
87 |
+
|
88 |
+
$opt_in_data = wpos_anylc_get_option( $module['anylc_optin'] );
|
89 |
+
$optin_status = isset( $opt_in_data['status'] ) ? $opt_in_data['status'] : null;
|
90 |
+
|
91 |
+
// Offers Page
|
92 |
+
if( !empty( $module['offers'] ) && $anylc_page == $module['slug'].'-offers' ) {
|
93 |
+
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') );
|
94 |
+
}
|
95 |
+
|
96 |
+
// If data is set
|
97 |
+
if( $optin_status == 1 ) {
|
98 |
+
continue;
|
99 |
+
}
|
100 |
+
|
101 |
+
// Taking some variables
|
102 |
+
$menu_args = array();
|
103 |
+
|
104 |
+
if( $optin_status === 0 || $optin_status === 2 ) {
|
105 |
+
|
106 |
+
// Register admin menu
|
107 |
+
if( $anylc_page == $module['slug'] ) {
|
108 |
+
add_submenu_page( $module['menu'], $module['name'].' '.'Opt In', $module['name'].' '.'Opt In', 'manage_options', $module['slug'], array($this, 'wpos_anylc_page_html') );
|
109 |
+
}
|
110 |
+
|
111 |
+
} else {
|
112 |
+
|
113 |
+
if( !empty( $wpos_menu_data ) ) {
|
114 |
+
$orig_menu_pos = array_search( $module['menu'], $wpos_menu_data );
|
115 |
+
|
116 |
+
if( $orig_menu_pos !== false ) {
|
117 |
+
|
118 |
+
$menu_args = array(
|
119 |
+
'name' => $menu[ $orig_menu_pos ][0],
|
120 |
+
'icon' => $menu[ $orig_menu_pos ][6],
|
121 |
+
'position' => $orig_menu_pos,
|
122 |
+
);
|
123 |
+
}
|
124 |
+
}
|
125 |
+
|
126 |
+
// Taking default name and icon
|
127 |
+
if( empty( $menu_args ) ) {
|
128 |
+
$menu_args = array(
|
129 |
+
'name' => $module['name'],
|
130 |
+
'icon' => false,
|
131 |
+
'position' => null,
|
132 |
+
);
|
133 |
+
}
|
134 |
+
|
135 |
+
// Register admin menu
|
136 |
+
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'] );
|
137 |
+
}
|
138 |
+
|
139 |
+
} // End of for each
|
140 |
+
}
|
141 |
+
}
|
142 |
+
|
143 |
+
/**
|
144 |
+
* Display Opt in form HTML
|
145 |
+
*
|
146 |
+
* @package Wpos Analytic
|
147 |
+
* @since 1.0
|
148 |
+
*/
|
149 |
+
function wpos_anylc_page_html() {
|
150 |
+
|
151 |
+
global $current_user, $wpos_analytics_product;
|
152 |
+
|
153 |
+
$anylc_product_name = !empty( $_GET['page'] ) ? $_GET['page'] : '';
|
154 |
+
|
155 |
+
// if no data is set then return
|
156 |
+
if( ! isset( $wpos_analytics_product[ $anylc_product_name ] ) ) {
|
157 |
+
return;
|
158 |
+
}
|
159 |
+
|
160 |
+
// Taking soem data
|
161 |
+
$optin_form_data = wpos_anylc_optin_data();
|
162 |
+
$analy_product = $wpos_analytics_product[ $anylc_product_name ];
|
163 |
+
$opt_in_data = wpos_anylc_get_option( $analy_product['anylc_optin'] );
|
164 |
+
|
165 |
+
$opt_in = isset( $opt_in_data['status'] ) ? $opt_in_data['status'] : null;
|
166 |
+
$user_name = !empty( $current_user->first_name ) ? $current_user->first_name : '';
|
167 |
+
$user_name = empty( $user_name ) ? $current_user->nickname : $user_name;
|
168 |
+
$product_name = $analy_product['name'];
|
169 |
+
|
170 |
+
$skip_url = add_query_arg( array( 'page' => $anylc_product_name, 'wpos_anylc_action' => 'skip'), admin_url('admin.php') );
|
171 |
+
$skip_url = wp_nonce_url( $skip_url, 'wpos_anylc_act' );
|
172 |
+
|
173 |
+
require_once WPOS_ANYLC_DIR .'/templates/analytic.php';
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* Display Offers HTML
|
178 |
+
*
|
179 |
+
* @package Wpos Analytic
|
180 |
+
* @since 1.0
|
181 |
+
*/
|
182 |
+
function wpos_anylc_offers_html() {
|
183 |
+
|
184 |
+
global $wpos_analytics_product;
|
185 |
+
|
186 |
+
$anylc_product_name = isset( $_GET['page'] ) ? str_replace('-offers', '', $_GET['page']) : null;
|
187 |
+
|
188 |
+
// if no data is set then return
|
189 |
+
if( ! isset( $wpos_analytics_product[ $anylc_product_name ] ) ) {
|
190 |
+
return;
|
191 |
+
}
|
192 |
+
|
193 |
+
// Taking soem data
|
194 |
+
$analy_product = $wpos_analytics_product[ $anylc_product_name ];
|
195 |
+
$opt_in_data = wpos_anylc_get_option( $analy_product['anylc_optin'] );
|
196 |
+
$opt_in = isset( $opt_in_data['status'] ) ? $opt_in_data['status'] : null;
|
197 |
+
|
198 |
+
include_once( WPOS_ANYLC_DIR .'/templates/offers.php' );
|
199 |
+
}
|
200 |
+
|
201 |
+
/**
|
202 |
+
* Add Action links
|
203 |
+
*
|
204 |
+
* @package Wpos Analytic
|
205 |
+
* @since 1.0
|
206 |
+
*/
|
207 |
+
function wpos_anylc_add_action_links( $actions, $plugin_file, $plugin_data, $context ) {
|
208 |
+
|
209 |
+
global $wpos_analytics_module;
|
210 |
+
|
211 |
+
// Taking some data
|
212 |
+
$module_data = !empty( $wpos_analytics_module[ $plugin_file ] ) ? $wpos_analytics_module[ $plugin_file ] : '';
|
213 |
+
|
214 |
+
// If analytics module data is there
|
215 |
+
if( $module_data ) {
|
216 |
+
|
217 |
+
$opt_in_data = wpos_anylc_get_option( $module_data['anylc_optin'] );
|
218 |
+
$opt_in = isset( $opt_in_data['status'] ) ? $opt_in_data['status'] : -1;
|
219 |
+
|
220 |
+
// If user has opt in
|
221 |
+
if( $opt_in == 1 ) {
|
222 |
+
|
223 |
+
$new_links['wpos_anylc'] = '<a href="#" class="wpos-anylc-opt-out-link" data-id="'.$module_data['id'].'">'.__('Opt Out', 'wpos_analytic').'</a>';
|
224 |
+
|
225 |
+
} else {
|
226 |
+
|
227 |
+
$opt_in_link = wpos_anylc_optin_url( $module_data, $opt_in );
|
228 |
+
|
229 |
+
$new_links['wpos_anylc'] = '<a href="'.esc_url( $opt_in_link ).'" class="wpos-anylc-opt-in-link">'.__('Opt In', 'wpos_analytic').'</a>';
|
230 |
+
}
|
231 |
+
|
232 |
+
$actions = array_merge( $new_links, $actions );
|
233 |
+
}
|
234 |
+
return $actions;
|
235 |
+
}
|
236 |
+
|
237 |
+
/**
|
238 |
+
* Redirect plugin / theme on activation to its opt in menu
|
239 |
+
*
|
240 |
+
* @package Wpos Analytic
|
241 |
+
* @since 1.0
|
242 |
+
*/
|
243 |
+
function wpos_anylc_admin_init_process() {
|
244 |
+
|
245 |
+
// If license notice is dismissed
|
246 |
+
if( isset($_GET['message']) && $_GET['message'] == 'wpos-anylc-dismiss-notice' && !empty( $_GET['anylc_id'] ) ) {
|
247 |
+
set_transient( 'wpos_anylc_optin_notice_'.$_GET['anylc_id'], true, 172800 );
|
248 |
+
}
|
249 |
+
|
250 |
+
$redirect = get_option('wpos_anylc_redirect');
|
251 |
+
|
252 |
+
// return if no activation redirect
|
253 |
+
if ( ! $redirect ) {
|
254 |
+
return;
|
255 |
+
}
|
256 |
+
|
257 |
+
// Flush the redirect transient
|
258 |
+
update_option( 'wpos_anylc_redirect', '' );
|
259 |
+
|
260 |
+
// Redirect to about page
|
261 |
+
wp_safe_redirect( $redirect );
|
262 |
+
exit;
|
263 |
+
}
|
264 |
+
|
265 |
+
/**
|
266 |
+
* Display Analytic Optin notice
|
267 |
+
*
|
268 |
+
* @package Wpos Analytic
|
269 |
+
* @since 1.0
|
270 |
+
*/
|
271 |
+
function wpos_anylc_optin_notice() {
|
272 |
+
|
273 |
+
global $current_screen, $wpos_analytics_module, $wpos_analytics_product;
|
274 |
+
|
275 |
+
// Taking some variables
|
276 |
+
$screen_id = isset( $current_screen->id ) ? $current_screen->id : '';
|
277 |
+
|
278 |
+
// Plugin action links
|
279 |
+
if( $screen_id == 'dashboard' && current_user_can('manage_options') && !empty( $wpos_analytics_module ) ) {
|
280 |
+
foreach ($wpos_analytics_module as $module_key => $module) {
|
281 |
+
|
282 |
+
$anylc_pdt_id = $module['id'];
|
283 |
+
$notice_transient = get_transient( 'wpos_anylc_optin_notice_'.$anylc_pdt_id );
|
284 |
+
|
285 |
+
if( $notice_transient == false ) {
|
286 |
+
|
287 |
+
$opt_in_data = wpos_anylc_get_option( $module['anylc_optin'] );
|
288 |
+
$opt_in = isset( $opt_in_data['status'] ) ? $opt_in_data['status'] : -1;
|
289 |
+
$notice_link = add_query_arg( array('message' => 'wpos-anylc-dismiss-notice', 'anylc_id' => $anylc_pdt_id), admin_url('index.php') );
|
290 |
+
|
291 |
+
// If user has opt in
|
292 |
+
if( $opt_in == -1 ) {
|
293 |
+
|
294 |
+
$anylc_pdt_name = $module['name'];
|
295 |
+
$anylc_optin_url = wpos_anylc_optin_url( $module, $opt_in );
|
296 |
+
|
297 |
+
echo '<div class="updated notice wpos-anylc-notice wpos-anylc-optin-notice">
|
298 |
+
<p><strong>'.$anylc_pdt_name.'</strong> - We made a few tweaks to the plugin, <a href="'.esc_url( $anylc_optin_url ).'">Opt in to make it Better!</a></p>
|
299 |
+
<a href="'.esc_url( $notice_link ).'" class="notice-dismiss"></a>
|
300 |
+
</div>';
|
301 |
+
}
|
302 |
+
}
|
303 |
+
}
|
304 |
+
} // End of if
|
305 |
+
|
306 |
+
if( isset($_GET['message']) && $_GET['message'] == 'optout_success' ) {
|
307 |
+
echo '<div class="updated notice wpos-anylc-optin-notice is-dismissible">
|
308 |
+
<p><strong>Sorry to let you go. You are now opted out from the plugin.</strong></p>
|
309 |
+
</div>';
|
310 |
+
}
|
311 |
+
|
312 |
+
// Process Promotion Data
|
313 |
+
if( !empty($_GET['message']) && $_GET['message'] == 'wpos_anylc_promotion' && !empty($_GET['wpos_anylc_pdt']) && !empty($_GET['wpos_anylc_promo_pdt']) ) {
|
314 |
+
|
315 |
+
$promotion = 1;
|
316 |
+
$promotion_pdt = explode( ',', $_GET['wpos_anylc_promo_pdt'] );
|
317 |
+
|
318 |
+
$anylc_pdt = $_GET['wpos_anylc_pdt'];
|
319 |
+
$anylc_pdt_data = isset( $wpos_analytics_product[ $anylc_pdt ] ) ? $wpos_analytics_product[ $anylc_pdt ] : false;
|
320 |
+
|
321 |
+
if( !empty($promotion_pdt) ) {
|
322 |
+
foreach ($promotion_pdt as $pdt_key => $pdt) {
|
323 |
+
if( isset( $anylc_pdt_data['promotion'][$pdt]['file'] ) ) {
|
324 |
+
$promotion_pdt_data[] = '<a href="'.$anylc_pdt_data['promotion'][$pdt]['file'].'">'.$anylc_pdt_data['promotion'][$pdt]['name'].'</a>';
|
325 |
+
}
|
326 |
+
}
|
327 |
+
}
|
328 |
+
|
329 |
+
if( $promotion_pdt_data ) {
|
330 |
+
echo '<div class="updated notice wpos-anylc-optin-notice is-dismissible" style="display:block !important;">
|
331 |
+
<p><strong>Your Download has been started. In case if it is intrupted then download it from here. '.join(' | ', $promotion_pdt_data).'</strong></p>
|
332 |
+
</div>';
|
333 |
+
}
|
334 |
+
}
|
335 |
+
}
|
336 |
+
|
337 |
+
/**
|
338 |
+
* Analytic Optout Popup HTML
|
339 |
+
*
|
340 |
+
* @package Wpos Analytic
|
341 |
+
* @since 1.0
|
342 |
+
*/
|
343 |
+
function wpos_anylc_optout_popup() {
|
344 |
+
|
345 |
+
global $pagenow, $wpos_analytics_module;
|
346 |
+
|
347 |
+
if( $pagenow == 'plugins.php' && !empty( $wpos_analytics_module ) ) {
|
348 |
+
foreach ($wpos_analytics_module as $module_key => $module) {
|
349 |
+
|
350 |
+
$opt_in_data = wpos_anylc_get_option( $module['anylc_optin'] );
|
351 |
+
$opt_in = isset( $opt_in_data['status'] ) ? $opt_in_data['status'] : false;
|
352 |
+
|
353 |
+
// If user has opt in
|
354 |
+
if( $opt_in == 1 ) {
|
355 |
+
|
356 |
+
$opt_out_link = wpos_anylc_optout_url( $module, $opt_in );
|
357 |
+
|
358 |
+
include( WPOS_ANYLC_DIR .'/templates/optout-popup.php' );
|
359 |
+
}
|
360 |
+
}
|
361 |
+
}
|
362 |
+
}
|
363 |
+
|
364 |
+
/**
|
365 |
+
* Analytic Action Process
|
366 |
+
*
|
367 |
+
* @package Wpos Analytic
|
368 |
+
* @since 1.0
|
369 |
+
*/
|
370 |
+
function wpos_anylc_action_process() {
|
371 |
+
|
372 |
+
// Skip if not admin area
|
373 |
+
if ( !is_admin() ) {
|
374 |
+
return false;
|
375 |
+
}
|
376 |
+
|
377 |
+
if( !empty($_GET['wpos_anylc_action']) && isset($_GET['_wpnonce']) ) {
|
378 |
+
|
379 |
+
global $wpos_analytics_product;
|
380 |
+
|
381 |
+
$anylc_pdt = !empty( $_GET['wpos_anylc_pdt'] ) ? $_GET['wpos_anylc_pdt'] : '';
|
382 |
+
$anylc_pdt = ( ! $anylc_pdt && !empty( $_GET['page'] ) ) ? $_GET['page'] : $anylc_pdt;
|
383 |
+
$anylc_pdt_data = isset( $wpos_analytics_product[ $anylc_pdt ] ) ? $wpos_analytics_product[ $anylc_pdt ] : false;
|
384 |
+
|
385 |
+
// If valid product data found
|
386 |
+
if( $anylc_pdt_data ) {
|
387 |
+
|
388 |
+
// Process Optin
|
389 |
+
if( $_GET['wpos_anylc_action'] == 'optin' ) {
|
390 |
+
|
391 |
+
// Verify nonce
|
392 |
+
if( ! wp_verify_nonce( $_GET['_wpnonce'], 'wpos_anylc_act' ) ) {
|
393 |
+
wp_die( __('Sorry, Something happened wrong.', 'wpos_analytic'), 'wpos_anylc_err', array('back_link' => true) );
|
394 |
+
}
|
395 |
+
|
396 |
+
$opt_in_data = wpos_anylc_update_option( $anylc_pdt_data['anylc_optin'], array('status' => 1) );
|
397 |
+
|
398 |
+
// Redirect to original menu
|
399 |
+
$redirect_url = wpos_anylc_pdt_url( $anylc_pdt_data, 'offer-promotion' );
|
400 |
+
if( $redirect_url ) {
|
401 |
+
wp_redirect( $redirect_url );
|
402 |
+
exit;
|
403 |
+
}
|
404 |
+
}
|
405 |
+
|
406 |
+
|
407 |
+
// Process Skip
|
408 |
+
if( $_GET['wpos_anylc_action'] == 'skip' ) {
|
409 |
+
|
410 |
+
// Verify nonce
|
411 |
+
if( ! wp_verify_nonce( $_GET['_wpnonce'], 'wpos_anylc_act' ) ) {
|
412 |
+
wp_die( __('Sorry, Something happened wrong.', 'wpos_analytic'), 'wpos_anylc_err', array('back_link' => true) );
|
413 |
+
}
|
414 |
+
|
415 |
+
$optin_form_data = wpos_anylc_optin_data();
|
416 |
+
$optin_form_data['wpos_anylc_action'] = 'skip';
|
417 |
+
|
418 |
+
$anylc_args = array(
|
419 |
+
'timeout' => 60,
|
420 |
+
'sslverify' => false,
|
421 |
+
'body' => $optin_form_data,
|
422 |
+
);
|
423 |
+
|
424 |
+
// Post back to get a response.
|
425 |
+
$response = wp_safe_remote_post( 'http://analytics.wponlinesupport.com', $anylc_args );
|
426 |
+
|
427 |
+
if( wp_remote_retrieve_response_code( $response ) == 200 ) {
|
428 |
+
$opt_in_data = wpos_anylc_update_option( $anylc_pdt_data['anylc_optin'], array('status' => 2) );
|
429 |
+
}
|
430 |
+
|
431 |
+
// Redirect to original menu
|
432 |
+
$redirect_url = wpos_anylc_pdt_url( $anylc_pdt_data, 'offer' );
|
433 |
+
if( $redirect_url ) {
|
434 |
+
wp_redirect( $redirect_url );
|
435 |
+
exit;
|
436 |
+
}
|
437 |
+
}
|
438 |
+
|
439 |
+
|
440 |
+
// Process Opt Out
|
441 |
+
if( $_GET['wpos_anylc_action'] == 'optout' ) {
|
442 |
+
|
443 |
+
// Verify nonce
|
444 |
+
if( ! wp_verify_nonce( $_GET['_wpnonce'], 'wpos_anylc_act'.'|'.$_GET['wpos_anylc_pdt'] ) ) {
|
445 |
+
wp_die( __('Sorry, Something happened wrong.', 'wpos_analytic'), 'wpos_anylc_err', array('back_link' => true) );
|
446 |
+
}
|
447 |
+
|
448 |
+
$optin_form_data = wpos_anylc_optin_data();
|
449 |
+
$optin_form_data['wpos_anylc_action'] = 'optout';
|
450 |
+
|
451 |
+
$anylc_args = array(
|
452 |
+
'timeout' => 60,
|
453 |
+
'sslverify' => false,
|
454 |
+
'body' => $optin_form_data,
|
455 |
+
);
|
456 |
+
|
457 |
+
// Post back to get a response.
|
458 |
+
$response = wp_safe_remote_post( 'http://analytics.wponlinesupport.com', $anylc_args );
|
459 |
+
|
460 |
+
if( wp_remote_retrieve_response_code( $response ) == 200 ) {
|
461 |
+
$opt_in_data = wpos_anylc_update_option( $anylc_pdt_data['anylc_optin'], array('status' => 0) );
|
462 |
+
}
|
463 |
+
|
464 |
+
// Redirect to original menu
|
465 |
+
$redirect_url = isset( $_GET['redirect'] ) ? $_GET['redirect'] : wpos_anylc_pdt_url( $anylc_pdt_data );
|
466 |
+
$redirect_url = add_query_arg( array( 'message' => 'optout_success' ), $redirect_url );
|
467 |
+
if( $redirect_url ) {
|
468 |
+
wp_redirect( $redirect_url );
|
469 |
+
exit;
|
470 |
+
}
|
471 |
+
}
|
472 |
+
}
|
473 |
+
} // End of main if
|
474 |
+
}
|
475 |
+
}
|
476 |
+
|
477 |
+
$wpos_anylc_admin = new Wpos_Anylc_Admin();
|
wpos-analytics/includes/class-anylc-script.php
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Script Class
|
4 |
+
*
|
5 |
+
* Handles the script and style
|
6 |
+
*
|
7 |
+
* @package Wpos Analytic
|
8 |
+
* @since 1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( !defined( 'ABSPATH' ) ) {
|
12 |
+
exit; // Exit if accessed directly
|
13 |
+
}
|
14 |
+
|
15 |
+
class Wpos_Anylc_Script {
|
16 |
+
|
17 |
+
function __construct() {
|
18 |
+
|
19 |
+
// Action to add style backend
|
20 |
+
add_action( 'admin_enqueue_scripts', array($this, 'wpos_anylc_admin_script_style') );
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Enqueue script for backend
|
25 |
+
*
|
26 |
+
* @package Wpos Analytic
|
27 |
+
* @since 1.0
|
28 |
+
*/
|
29 |
+
function wpos_anylc_admin_script_style( $hook ) {
|
30 |
+
|
31 |
+
// Process Promotion Data
|
32 |
+
if( !empty($_GET['message']) && $_GET['message'] == 'wpos_anylc_promotion' && !empty($_GET['wpos_anylc_pdt']) && !empty($_GET['wpos_anylc_promo_pdt']) ) {
|
33 |
+
global $wpos_analytics_product;
|
34 |
+
|
35 |
+
$promotion = 1;
|
36 |
+
$promotion_pdt = explode( ',', $_GET['wpos_anylc_promo_pdt'] );
|
37 |
+
|
38 |
+
$anylc_pdt = $_GET['wpos_anylc_pdt'];
|
39 |
+
$anylc_pdt_data = isset( $wpos_analytics_product[ $anylc_pdt ] ) ? $wpos_analytics_product[ $anylc_pdt ] : false;
|
40 |
+
|
41 |
+
if( !empty($promotion_pdt) ) {
|
42 |
+
foreach ($promotion_pdt as $pdt_key => $pdt) {
|
43 |
+
if( isset( $anylc_pdt_data['promotion'][$pdt]['file'] ) ) {
|
44 |
+
$promotion_pdt_data[] = $anylc_pdt_data['promotion'][$pdt]['file'];
|
45 |
+
}
|
46 |
+
}
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
// Registring admin Style
|
51 |
+
wp_register_style( 'wpos-anylc-admin-style', WPOS_ANYLC_URL.'assets/css/wpos-anylc-admin.css', null, WPOS_ANYLC_VERSION );
|
52 |
+
wp_enqueue_style( 'wpos-anylc-admin-style' );
|
53 |
+
|
54 |
+
// Registring admin script
|
55 |
+
wp_register_script( 'wpos-anylc-admin-script', WPOS_ANYLC_URL.'assets/js/wpos-anylc-admin.js', array('jquery'), WPOS_ANYLC_VERSION, true );
|
56 |
+
wp_localize_script( 'wpos-anylc-admin-script', 'WposAnylc', array(
|
57 |
+
'promotion' => isset($promotion) ? 1 : 0,
|
58 |
+
'promotion_pdt' => isset( $promotion_pdt_data ) ? $promotion_pdt_data : 0,
|
59 |
+
));
|
60 |
+
wp_enqueue_script( 'wpos-anylc-admin-script' );
|
61 |
+
}
|
62 |
+
}
|
63 |
+
|
64 |
+
$wpos_anylc_script = new Wpos_Anylc_Script();
|
wpos-analytics/includes/wpos-anylc-function.php
ADDED
@@ -0,0 +1,311 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Common Functions
|
4 |
+
*
|
5 |
+
* @package Wpos Analytic
|
6 |
+
* @since 1.0
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( !defined( 'ABSPATH' ) ) {
|
10 |
+
exit; // Exit if accessed directly
|
11 |
+
}
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Retrieve the translation of $text.
|
15 |
+
*
|
16 |
+
* @package Wpos Analytic
|
17 |
+
* @since 1.0
|
18 |
+
*/
|
19 |
+
function wpos_anylc_text( $text, $echo = false ) {
|
20 |
+
|
21 |
+
if( $echo ) {
|
22 |
+
_e( $text, '' );
|
23 |
+
} else {
|
24 |
+
__( $text, '' );
|
25 |
+
}
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Check Multidimention Array
|
30 |
+
*
|
31 |
+
* @package Wpos Analytic
|
32 |
+
* @since 1.0
|
33 |
+
*/
|
34 |
+
function wpos_anylc_is_multi_arr( $arr ) {
|
35 |
+
rsort( $arr );
|
36 |
+
return isset( $arr[0] ) && is_array( $arr[0] );
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Get site unique id
|
41 |
+
*
|
42 |
+
* @package Wpos Analytic
|
43 |
+
* @since 1.0.0
|
44 |
+
*/
|
45 |
+
function wpos_anylc_site_uid() {
|
46 |
+
|
47 |
+
$site_uid = get_option( 'wpos_anylc_site_uid' );
|
48 |
+
|
49 |
+
// Generate new site id if not exist
|
50 |
+
if( empty( $site_uid ) ) {
|
51 |
+
$site_url = untrailingslashit( get_bloginfo('wpurl') );
|
52 |
+
$site_uid = md5( $site_url . SECURE_AUTH_KEY );
|
53 |
+
|
54 |
+
update_option( 'wpos_anylc_site_uid', $site_uid );
|
55 |
+
}
|
56 |
+
|
57 |
+
return $site_uid;
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Get Optin Data
|
62 |
+
*
|
63 |
+
* @package Wpos Analytic
|
64 |
+
* @since 1.0.0
|
65 |
+
*/
|
66 |
+
function wpos_anylc_optin_data( $anylc_pdt = false ) {
|
67 |
+
|
68 |
+
// Skip if not admin area
|
69 |
+
if ( !is_admin() ) {
|
70 |
+
return false;
|
71 |
+
}
|
72 |
+
|
73 |
+
global $current_user, $wpos_analytics_product;
|
74 |
+
|
75 |
+
// Takind some data
|
76 |
+
$theme_data = wp_get_theme();
|
77 |
+
$page = isset( $_GET['page'] ) ? $_GET['page'] : false;
|
78 |
+
|
79 |
+
// If product is not passed
|
80 |
+
if( ! $anylc_pdt ) {
|
81 |
+
$anylc_pdt = !empty( $_GET['wpos_anylc_pdt'] ) ? $_GET['wpos_anylc_pdt'] : '';
|
82 |
+
$anylc_pdt = ( ! $anylc_pdt && !empty( $_GET['page'] ) ) ? $_GET['page'] : $anylc_pdt;
|
83 |
+
}
|
84 |
+
|
85 |
+
// If a valid product is there
|
86 |
+
if( $anylc_pdt && !empty( $wpos_analytics_product[ $anylc_pdt ] ) ) {
|
87 |
+
|
88 |
+
$analy_product = $wpos_analytics_product[ $anylc_pdt ];
|
89 |
+
$return_url = add_query_arg( array( 'page' => $page ), admin_url('admin.php') );
|
90 |
+
$return_url = wp_nonce_url( $return_url, 'wpos_anylc_act' );
|
91 |
+
|
92 |
+
// Getting data according to type
|
93 |
+
if( $analy_product['type'] == 'theme' ) {
|
94 |
+
|
95 |
+
$product_name = $theme_data->get( 'Name' );
|
96 |
+
$product_version = $theme_data->get( 'Version' );
|
97 |
+
|
98 |
+
} else {
|
99 |
+
|
100 |
+
if( !function_exists('get_plugin_data') ) {
|
101 |
+
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
|
102 |
+
}
|
103 |
+
|
104 |
+
$plugin_data = get_plugin_data( trailingslashit(WP_PLUGIN_DIR) . $analy_product['file'] );
|
105 |
+
$product_name = !empty( $plugin_data['Name'] ) ? $plugin_data['Name'] : '';
|
106 |
+
$product_version = !empty( $plugin_data['Version'] ) ? $plugin_data['Version'] : '';
|
107 |
+
}
|
108 |
+
}
|
109 |
+
|
110 |
+
$optin_data = array(
|
111 |
+
'site_url' => untrailingslashit( get_bloginfo('wpurl') ),
|
112 |
+
'site_name' => get_bloginfo( 'name' ),
|
113 |
+
'wp_version' => get_bloginfo( 'version' ),
|
114 |
+
'language' => get_bloginfo( 'language' ),
|
115 |
+
'is_rtl' => is_rtl() ? 1 : 0,
|
116 |
+
'php_version' => phpversion(),
|
117 |
+
'sdk_version' => WPOS_ANYLC_VERSION,
|
118 |
+
'product_name' => isset( $product_name ) ? $product_name : '',
|
119 |
+
'product_version' => isset( $product_version ) ? $product_version : '',
|
120 |
+
'product_id' => !empty( $analy_product['id'] ) ? $analy_product['id'] : 0,
|
121 |
+
'product_type' => !empty( $analy_product['type'] ) ? $analy_product['type'] : '',
|
122 |
+
'theme_name' => $theme_data->get( 'Name' ),
|
123 |
+
'theme_uri' => $theme_data->get( 'ThemeURI' ),
|
124 |
+
'theme_author' => $theme_data->get( 'Author' ),
|
125 |
+
'theme_author_uri' => $theme_data->get( 'AuthorURI' ),
|
126 |
+
'theme_version' => $theme_data->get( 'Version' ),
|
127 |
+
'user_firstname' => $current_user->user_firstname,
|
128 |
+
'user_lastname' => $current_user->user_lastname,
|
129 |
+
'user_nickname' => $current_user->user_nicename,
|
130 |
+
'user_email' => get_bloginfo( 'admin_email' ),
|
131 |
+
'ip_address' => wpos_anylc_get_ip_address(),
|
132 |
+
'site_uid' => wpos_anylc_site_uid(),
|
133 |
+
'return_url' => !empty( $return_url ) ? $return_url : '',
|
134 |
+
);
|
135 |
+
return $optin_data;
|
136 |
+
}
|
137 |
+
|
138 |
+
/**
|
139 |
+
* Get IP Address
|
140 |
+
*
|
141 |
+
* @package Wpos Analytic
|
142 |
+
* @since 1.0.0
|
143 |
+
*/
|
144 |
+
function wpos_anylc_get_ip_address() {
|
145 |
+
if ( isset( $_SERVER['HTTP_X_REAL_IP'] ) ) { // WPCS: input var ok, CSRF ok.
|
146 |
+
return sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_REAL_IP'] ) ); // WPCS: input var ok, CSRF ok.
|
147 |
+
} elseif ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { // WPCS: input var ok, CSRF ok.
|
148 |
+
// Proxy servers can send through this header like this: X-Forwarded-For: client1, proxy1, proxy2
|
149 |
+
// Make sure we always only send through the first IP in the list which should always be the client IP.
|
150 |
+
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.
|
151 |
+
} elseif ( isset( $_SERVER['REMOTE_ADDR'] ) ) { // @codingStandardsIgnoreLine
|
152 |
+
return sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ); // @codingStandardsIgnoreLine
|
153 |
+
}
|
154 |
+
return '127.0.0.1';
|
155 |
+
}
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Get Product Optin Data
|
159 |
+
*
|
160 |
+
* @package Wpos Analytic
|
161 |
+
* @since 1.0.0
|
162 |
+
*/
|
163 |
+
function wpos_anylc_get_option( $key = '' ) {
|
164 |
+
|
165 |
+
$opt_in_data = array();
|
166 |
+
|
167 |
+
if( !empty( $key ) ) {
|
168 |
+
$opt_in_data = get_option( $key );
|
169 |
+
$opt_in_data = ( !empty($opt_in_data) && is_array($opt_in_data) ) ? $opt_in_data : array();
|
170 |
+
}
|
171 |
+
return $opt_in_data;
|
172 |
+
}
|
173 |
+
|
174 |
+
/**
|
175 |
+
* Get Product Optin Data
|
176 |
+
*
|
177 |
+
* @package Wpos Analytic
|
178 |
+
* @since 1.0.0
|
179 |
+
*/
|
180 |
+
function wpos_anylc_update_option( $key = '', $data = array() ) {
|
181 |
+
|
182 |
+
$opt_in_data = array();
|
183 |
+
|
184 |
+
if( !empty( $key ) ) {
|
185 |
+
$opt_in_data = wpos_anylc_get_option( $key );
|
186 |
+
|
187 |
+
if( is_array($data) ) {
|
188 |
+
$opt_in_data = array_merge( $opt_in_data, $data );
|
189 |
+
update_option( $key, $opt_in_data );
|
190 |
+
}
|
191 |
+
}
|
192 |
+
return $opt_in_data;
|
193 |
+
}
|
194 |
+
|
195 |
+
/**
|
196 |
+
* Get Analytic Product Optin URL
|
197 |
+
*
|
198 |
+
* @package Wpos Analytic
|
199 |
+
* @since 1.0.0
|
200 |
+
*/
|
201 |
+
function wpos_anylc_optin_url( $module_data = '', $optin_status = null ) {
|
202 |
+
|
203 |
+
$optin_url = false;
|
204 |
+
|
205 |
+
// Optin Status
|
206 |
+
if( ! isset( $optin_status ) ) {
|
207 |
+
$opt_in_data = get_option( $module_data['anylc_optin'] );
|
208 |
+
$optin_status = isset( $opt_in_data['status'] ) ? $opt_in_data['status'] : null;
|
209 |
+
}
|
210 |
+
|
211 |
+
if( !empty( $module_data['menu'] ) && !empty( $module_data['slug'] ) ) {
|
212 |
+
$url_data = parse_url( $module_data['menu'], PHP_URL_QUERY );
|
213 |
+
$query_data = !empty( $url_data ) ? parse_str( $url_data, $query_arr ) : array();
|
214 |
+
|
215 |
+
if( !empty( $query_arr['post_type'] ) && $optin_status >= 0 ) { // If Optin is done and post type menu
|
216 |
+
|
217 |
+
$optin_url = add_query_arg( array( 'post_type' => $query_arr['post_type'], 'page' => $module_data['slug'], 'anylc_optin_menu' => true ), admin_url('edit.php') );
|
218 |
+
|
219 |
+
} else if( empty( $query_arr['post_type'] ) && $optin_status >= 0 ) { // If Optin is done and simple admin menu
|
220 |
+
|
221 |
+
$optin_url = add_query_arg( array( 'page' => $module_data['slug'], 'anylc_optin_menu' => true ), admin_url('admin.php') );
|
222 |
+
|
223 |
+
} else {
|
224 |
+
$optin_url = add_query_arg( array( 'page' => $module_data['slug'] ), admin_url('admin.php') );
|
225 |
+
}
|
226 |
+
}
|
227 |
+
|
228 |
+
return $optin_url;
|
229 |
+
}
|
230 |
+
|
231 |
+
/**
|
232 |
+
* Get Analytic Product Opt Out URL
|
233 |
+
*
|
234 |
+
* @package Wpos Analytic
|
235 |
+
* @since 1.0.0
|
236 |
+
*/
|
237 |
+
function wpos_anylc_optout_url( $module_data = '', $optin_status = null, $redirect_url = false ) {
|
238 |
+
|
239 |
+
$opt_out_link = false;
|
240 |
+
|
241 |
+
// Optin Status
|
242 |
+
if( !isset( $optin_status ) ) {
|
243 |
+
$opt_in_data = get_option( $module_data['anylc_optin'] );
|
244 |
+
$optin_status = isset( $opt_in_data['status'] ) ? $opt_in_data['status'] : null;
|
245 |
+
}
|
246 |
+
|
247 |
+
if( $optin_status == 1 ) {
|
248 |
+
|
249 |
+
if( ! $redirect_url ) {
|
250 |
+
$plugin_status = isset( $_GET['plugin_status'] ) ? $_GET['plugin_status'] : false;
|
251 |
+
$paged = isset( $_GET['paged'] ) ? $_GET['paged'] : false;
|
252 |
+
$s = isset( $_GET['s'] ) ? $_GET['s'] : false;
|
253 |
+
|
254 |
+
$redirect_url = add_query_arg( array( 'plugin_status' => $plugin_status, 'paged' => $paged, 's' => $s ), admin_url( 'plugins.php' ) );
|
255 |
+
}
|
256 |
+
|
257 |
+
$opt_out_link = add_query_arg( array( 'wpos_anylc_action' => 'optout', 'wpos_anylc_pdt' => $module_data['slug'], 'redirect' => $redirect_url ), $redirect_url );
|
258 |
+
$opt_out_link = wp_nonce_url( $opt_out_link, 'wpos_anylc_act'.'|'.$module_data['slug'] );
|
259 |
+
}
|
260 |
+
|
261 |
+
return $opt_out_link;
|
262 |
+
}
|
263 |
+
|
264 |
+
/**
|
265 |
+
* Get Analytic Product URL
|
266 |
+
*
|
267 |
+
* @package Wpos Analytic
|
268 |
+
* @since 1.0.0
|
269 |
+
*/
|
270 |
+
function wpos_anylc_pdt_url( $module_data = '', $type = false ) {
|
271 |
+
|
272 |
+
$redirect_url = false;
|
273 |
+
|
274 |
+
if( !empty( $module_data['menu'] ) ) {
|
275 |
+
$pos = strpos( $module_data['menu'], '?post_type' );
|
276 |
+
$redirect_url = ( $pos !== false ) ? admin_url( $module_data['menu'] ) : add_query_arg( array( 'page' => $module_data['menu'] ), admin_url('admin.php') );
|
277 |
+
|
278 |
+
switch ( $type ) {
|
279 |
+
case 'promotion':
|
280 |
+
|
281 |
+
$promotion = !empty( $_GET['promotion'] ) ? $_GET['promotion'] : '';
|
282 |
+
|
283 |
+
if( !empty( $promotion ) ) {
|
284 |
+
$promotion = is_array( $promotion ) ? implode( ',', $promotion ) : $promotion;
|
285 |
+
$redirect_url = add_query_arg( array( 'message' => 'wpos_anylc_promotion', 'wpos_anylc_pdt' => $module_data['slug'], 'wpos_anylc_promo_pdt' => $promotion ), $redirect_url );
|
286 |
+
}
|
287 |
+
break;
|
288 |
+
|
289 |
+
case 'offer':
|
290 |
+
|
291 |
+
if( !empty( $module_data['offers'] ) ) {
|
292 |
+
$redirect_url = add_query_arg( array( 'page' => $module_data['slug'].'-offers' ), $redirect_url );
|
293 |
+
}
|
294 |
+
break;
|
295 |
+
|
296 |
+
case 'offer-promotion':
|
297 |
+
|
298 |
+
$promotion = !empty( $_GET['promotion'] ) ? $_GET['promotion'] : '';
|
299 |
+
|
300 |
+
if( !empty( $module_data['offers'] ) ) {
|
301 |
+
$redirect_url = add_query_arg( array( 'page' => $module_data['slug'].'-offers' ), $redirect_url );
|
302 |
+
}
|
303 |
+
if( !empty( $promotion ) ) {
|
304 |
+
$promotion = is_array( $promotion ) ? implode( ',', $promotion ) : $promotion;
|
305 |
+
$redirect_url = add_query_arg( array( 'message' => 'wpos_anylc_promotion', 'wpos_anylc_pdt' => $module_data['slug'], 'wpos_anylc_promo_pdt' => $promotion ), $redirect_url );
|
306 |
+
}
|
307 |
+
break;
|
308 |
+
}
|
309 |
+
}
|
310 |
+
return $redirect_url;
|
311 |
+
}
|
wpos-analytics/templates/analytic.php
ADDED
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Settings Page
|
4 |
+
*
|
5 |
+
* @package Wpos Analytic
|
6 |
+
* @since 1.0.0
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( !defined( 'ABSPATH' ) ) {
|
10 |
+
exit; // Exit if accessed directly
|
11 |
+
}
|
12 |
+
?>
|
13 |
+
<style type="text/css">
|
14 |
+
.notice, .error, div.fs-notice.updated, div.fs-notice.success, div.fs-notice.promotion{display:none !important;}
|
15 |
+
</style>
|
16 |
+
|
17 |
+
<div class="wrap wpos-anylc-optin">
|
18 |
+
|
19 |
+
<?php if( isset($_GET['error']) && $_GET['error'] == 'wpos_anylc_error' ) { ?>
|
20 |
+
<div class="error">
|
21 |
+
<p><strong>Sorry, Something happened wrong. Please contact us on <a href="mailto:support@wponlinesupport.com">support@wponlinesupport.com</a></strong></p>
|
22 |
+
</div>
|
23 |
+
<?php } ?>
|
24 |
+
|
25 |
+
<form method="POST" action="http://analytics.wponlinesupport.com">
|
26 |
+
<div class="wpos-anylc-optin-wrap">
|
27 |
+
<div class="wpos-anylc-optin-icon-wrap">
|
28 |
+
<div class="wpos-anylc-optin-icon wpos-anylc-wp-badge"><i class="dashicons dashicons-wordpress"></i></div>
|
29 |
+
<div class="wpos-anylc-optin-plus"><i class="dashicons dashicons-plus"></i></div>
|
30 |
+
<div class="wpos-anylc-optin-icon"><img src="<?php echo $analy_product['icon']; ?>" alt="Icon" /></div>
|
31 |
+
<div class="wpos-anylc-optin-plus"><i class="dashicons dashicons-plus"></i></div>
|
32 |
+
<div class="wpos-anylc-optin-icon"><img src="<?php echo $analy_product['brand_icon']; ?>" alt="Icon" /></div>
|
33 |
+
</div>
|
34 |
+
<div class="wpos-anylc-optin-cnt">
|
35 |
+
<p>Hey <?php echo ucfirst($user_name); ?>,</p>
|
36 |
+
<p>Don't ever miss an opportunity to <b>opt in</b> for Email Notifications / Announcements about exciting New Features and Update Releases.</p>
|
37 |
+
<p>Contribute in helping us making <b><?php echo $product_name; ?></b> compatible with most themes and plugins by allowing to share non-sensitive data to <a target="_blank" href="https://www.wponlinesupport.com">wponlinesupport.com</a> about your website.</p>
|
38 |
+
<p>If you skip this, that's okay! <b><?php echo $product_name; ?></b> will still work just fine.</p>
|
39 |
+
|
40 |
+
<div class="wpos-anylc-subs-wrap">
|
41 |
+
<input type="hidden" name="subscribe" value="" />
|
42 |
+
<label><input type="checkbox" value="1" name="subscribe" checked="checked" /> Subscribe for Updates and Promotions</label>
|
43 |
+
</div>
|
44 |
+
|
45 |
+
<?php if( !empty( $analy_product['promotion'] ) ) { ?>
|
46 |
+
<div class="wpos-anylc-promotion-wrap">
|
47 |
+
<?php foreach( $analy_product['promotion'] as $promotion_key => $promotion_data ) { ?>
|
48 |
+
<div><label><input type="checkbox" value="<?php echo $promotion_key; ?>" name="promotion[]" checked="checked" /> <?php echo $promotion_data['name']; ?></label></div>
|
49 |
+
<?php } ?>
|
50 |
+
</div>
|
51 |
+
<?php } ?>
|
52 |
+
</div>
|
53 |
+
<div class="wpos-anylc-optin-action wpos-anylc-clearfix">
|
54 |
+
<button type="submit" name="wpos_anylc_optin" class="button button-primary button-large right wpos-anylc-allow-btn" value="wpos_anylc_optin">Allow and Continue</button>
|
55 |
+
|
56 |
+
<?php if( is_null( $opt_in ) ) { ?>
|
57 |
+
<a href="<?php echo esc_url( $skip_url ); ?>" class="button button-secondary button-large wpos-anylc-skip-btn">Skip</a>
|
58 |
+
<?php }
|
59 |
+
|
60 |
+
if( !empty( $optin_form_data ) ) {
|
61 |
+
foreach ($optin_form_data as $data_key => $data_value) {
|
62 |
+
echo '<input type="hidden" name="'.esc_attr( $data_key ).'" value="'.esc_attr( $data_value ).'" />';
|
63 |
+
}
|
64 |
+
}
|
65 |
+
?>
|
66 |
+
</div>
|
67 |
+
<div class="wpos-anylc-optin-permission">
|
68 |
+
<a class="wpos-anylc-permission-toggle" href="javascript:void(0);">What permissions are being granted?</a>
|
69 |
+
|
70 |
+
<div class="wpos-anylc-permission-wrap wpos-anylc-hide">
|
71 |
+
<div class="wpos-anylc-permission">
|
72 |
+
<i class="dashicons dashicons-admin-users"></i>
|
73 |
+
<div>
|
74 |
+
<span class="wpos-anylc-permission-name">Your Profile Overview</span>
|
75 |
+
<span class="wpos-anylc-permission-info">Name and email address</span>
|
76 |
+
</div>
|
77 |
+
</div>
|
78 |
+
<div class="wpos-anylc-permission">
|
79 |
+
<i class="dashicons dashicons-admin-settings"></i>
|
80 |
+
<div>
|
81 |
+
<span class="wpos-anylc-permission-name">Your Site Overview</span>
|
82 |
+
<span class="wpos-anylc-permission-info">Site URL, WP version, PHP info & Theme</span>
|
83 |
+
</div>
|
84 |
+
</div>
|
85 |
+
<div class="wpos-anylc-permission">
|
86 |
+
<i class="dashicons dashicons-admin-plugins"></i>
|
87 |
+
<div>
|
88 |
+
<span class="wpos-anylc-permission-name">Current Plugin Events</span>
|
89 |
+
<span class="wpos-anylc-permission-info">Activation, Deactivation and Uninstall</span>
|
90 |
+
</div>
|
91 |
+
</div>
|
92 |
+
</div>
|
93 |
+
</div>
|
94 |
+
<div class="wpos-anylc-terms">
|
95 |
+
<a href="https://www.wponlinesupport.com/privacy-policy/" target="_blank">Privacy Policy</a> - <a href="https://www.wponlinesupport.com/term-and-condition/" target="_blank">Terms of Service</a>
|
96 |
+
</div>
|
97 |
+
</div>
|
98 |
+
</form>
|
99 |
+
</div><!-- end .wrap -->
|
wpos-analytics/templates/offers.php
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Offers Page
|
4 |
+
*
|
5 |
+
* @package Wpos Analytic
|
6 |
+
* @since 1.0.0
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( !defined( 'ABSPATH' ) ) {
|
10 |
+
exit; // Exit if accessed directly
|
11 |
+
}
|
12 |
+
?>
|
13 |
+
<style type="text/css">
|
14 |
+
.notice, .error, div.fs-notice.updated, div.fs-notice.success, div.fs-notice.promotion{display:none !important;}
|
15 |
+
</style>
|
16 |
+
|
17 |
+
<div class="wrap wpos-anylc-offers">
|
18 |
+
|
19 |
+
<?php foreach ($analy_product['offers'] as $offer_key => $offer_data) {
|
20 |
+
|
21 |
+
// If status wise offer is there
|
22 |
+
if( wpos_anylc_is_multi_arr( $offer_data ) ) {
|
23 |
+
$offer_data = isset( $offer_data[ $opt_in ] ) ? $offer_data[ $opt_in ] : false;
|
24 |
+
}
|
25 |
+
|
26 |
+
if( empty( $offer_data ) ) {
|
27 |
+
continue;
|
28 |
+
}
|
29 |
+
|
30 |
+
$has_offer = true;
|
31 |
+
$link = isset( $offer_data['link'] ) ? $offer_data['link'] : '';
|
32 |
+
$image = !empty( $offer_data['image'] ) ? add_query_arg( array('v' => time()), $offer_data['image'] ) : '';
|
33 |
+
?>
|
34 |
+
|
35 |
+
<div class="wpos-anylc-offer-wrap">
|
36 |
+
<?php if( !empty( $offer_data['name'] ) ) { ?>
|
37 |
+
<div class="wpos-anylc-offer-title wpos-anylc-center"><?php echo $offer_data['name']; ?></div>
|
38 |
+
<?php } ?>
|
39 |
+
|
40 |
+
<?php if( $image ) { ?>
|
41 |
+
<div class="wpos-anylc-offer-body wpos-anylc-center">
|
42 |
+
<?php if( $link ) { ?>
|
43 |
+
<a href="<?php echo esc_url( $link ); ?>" target="_blank">
|
44 |
+
<img src="<?php echo esc_url( $image ); ?>" alt="" />
|
45 |
+
</a>
|
46 |
+
<?php } else { ?>
|
47 |
+
<img src="<?php echo esc_url( $image ); ?>" alt="" />
|
48 |
+
<?php } ?>
|
49 |
+
</div>
|
50 |
+
<?php } ?>
|
51 |
+
|
52 |
+
<?php if( !empty( $offer_data['desc'] ) ) { ?>
|
53 |
+
<div class="wpos-anylc-offer-desc wpos-anylc-center"><?php echo wpautop( $offer_data['desc'] ); ?></div>
|
54 |
+
<?php } ?>
|
55 |
+
|
56 |
+
<?php if( !empty( $offer_data['button'] ) ) { ?>
|
57 |
+
<div class="wpos-anylc-offer-footer wpos-anylc-center"><a href="<?php echo esc_url( $link ); ?>" class="button button-primary button-large wpos-anylc-btn" target="_blank"><?php echo $offer_data['button']; ?></a></div>
|
58 |
+
<?php } ?>
|
59 |
+
</div>
|
60 |
+
|
61 |
+
<?php } // End of foreach
|
62 |
+
|
63 |
+
// If no offer to display then redirect to main plugin screen
|
64 |
+
if( empty( $has_offer ) ) {
|
65 |
+
$redirect_url = wpos_anylc_pdt_url( $analy_product ); // Redirect URL
|
66 |
+
?>
|
67 |
+
Please Wait... Redirecting to plugin screen. <a href="<?php echo $redirect_url; ?>">Click Here</a> in case you are not auto redirect.
|
68 |
+
<script type="text/javascript">
|
69 |
+
window.location = "<?php echo $redirect_url; ?>";
|
70 |
+
</script>
|
71 |
+
<?php } ?>
|
72 |
+
|
73 |
+
</div><!-- end .wrap -->
|
wpos-analytics/templates/optout-popup.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Analytic Optout Popup
|
4 |
+
*
|
5 |
+
* @package Wpos Analytic
|
6 |
+
* @since 1.0
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( !defined( 'ABSPATH' ) ) {
|
10 |
+
exit; // Exit if accessed directly
|
11 |
+
}
|
12 |
+
?>
|
13 |
+
<div class="wpos-anylc-popup wpos-anylc-popup-wrp wpos-anylc-hide" id="wpos-anylc-optout-<?php echo $module['id']; ?>">
|
14 |
+
<div class="wpos-anylc-popup-inr-wrp">
|
15 |
+
<div class="wpos-anylc-popup-block">
|
16 |
+
|
17 |
+
<div class="wpos-anylc-popup-header">Opt Out</div>
|
18 |
+
<div class="wpos-anylc-popup-body">
|
19 |
+
<p class="wpos-anylc-popup-heading">We appreciate your help to make the plugin better by letting us track some usage data.</p>
|
20 |
+
<p>Usage tracking is done in the name of making <b><?php echo $module['name']; ?></b> better. Making a better user experience, prioritizing new features, and more good things. We'd really appreciate if you'll reconsider letting us continue with the tracking.</p>
|
21 |
+
<p>By clicking "Opt Out", we will no longer be sending any data from <b><?php echo $module['name']; ?></b> to <a href="https://www.wponlinesupport.com/" target="_blank">wponlinesupport.com</a>.</p>
|
22 |
+
</div>
|
23 |
+
<div class="wpos-anylc-popup-footer">
|
24 |
+
<a href="<?php echo esc_url( $opt_out_link ); ?>" class="button button-secondary">Opt Out</a>
|
25 |
+
<button type="button" class="button button-primary wpos-anylc-popup-close">Sure, Let Me Continue Helping</button>
|
26 |
+
</div>
|
27 |
+
|
28 |
+
</div><!-- end .wpos-anylc-popup-block -->
|
29 |
+
</div><!-- end .wpos-anylc-popup-inr-wrp -->
|
30 |
+
</div><!-- end .wpos-anylc-popup-wrp -->
|
31 |
+
<div class="wpos-anylc-popup-overlay" id="wpos-anylc-optout-overlay-<?php echo $module['id']; ?>"></div>
|
wpos-analytics/wpos-analytics.php
ADDED
@@ -0,0 +1,251 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WPOS Analytics
|
4 |
+
*
|
5 |
+
* @author WP Online Support
|
6 |
+
* @package Wpos Analytic
|
7 |
+
* @since 1.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
if ( !defined( 'ABSPATH' ) ) {
|
11 |
+
exit; // Exit if accessed directly
|
12 |
+
}
|
13 |
+
|
14 |
+
if ( ! class_exists( 'WPOS_Analytics' ) ) :
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Main Analytics Class By WP Online Support.
|
18 |
+
*
|
19 |
+
* @since 1.0
|
20 |
+
*/
|
21 |
+
final class WPOS_Analytics {
|
22 |
+
|
23 |
+
/**
|
24 |
+
* @var Instance
|
25 |
+
* @since 1.0
|
26 |
+
*/
|
27 |
+
protected static $instance = null;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Main Analytics Instance.
|
31 |
+
*
|
32 |
+
* Insures that only one instance of Analytics exists in memory at any one time.
|
33 |
+
* Also prevents needing to define globals all over the place.
|
34 |
+
*
|
35 |
+
* @since 1.0
|
36 |
+
* @uses WPOS_ANYLC::setup_constants() Setup the constants needed.
|
37 |
+
* @uses WPOS_ANYLC::includes() Include the required files.
|
38 |
+
* @uses WPOS_ANYLC::wpos_anylc_plugins_loaded() load the language files.
|
39 |
+
* @see PWPC()
|
40 |
+
* @return object The one true Analytics
|
41 |
+
*/
|
42 |
+
public static function instance() {
|
43 |
+
if ( is_null( self::$instance ) ) {
|
44 |
+
self::$instance = new self();
|
45 |
+
}
|
46 |
+
return self::$instance;
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Throw error on object clone.
|
51 |
+
*
|
52 |
+
* 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.
|
53 |
+
*
|
54 |
+
* @since 1.0
|
55 |
+
* @access protected
|
56 |
+
* @return void
|
57 |
+
*/
|
58 |
+
public function __clone() {
|
59 |
+
// Cloning instances of the class is forbidden.
|
60 |
+
_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'pwpc' ), '1.0' );
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Disable unserializing of the class.
|
65 |
+
*
|
66 |
+
* @since 1.0
|
67 |
+
* @access protected
|
68 |
+
* @return void
|
69 |
+
*/
|
70 |
+
public function __wakeup() {
|
71 |
+
// Unserializing instances of the class is forbidden.
|
72 |
+
_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'pwpc' ), '1.0' );
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Plugin Constructor.
|
77 |
+
*/
|
78 |
+
public function __construct() {
|
79 |
+
$this->setup_constants();
|
80 |
+
$this->includes();
|
81 |
+
|
82 |
+
do_action( 'wpos_anylc_loaded' );
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Define constant if not already set.
|
87 |
+
*
|
88 |
+
* @param string $name
|
89 |
+
* @param string|bool $value
|
90 |
+
*/
|
91 |
+
public function define( $name, $value ) {
|
92 |
+
if ( ! defined( $name ) ) {
|
93 |
+
define( $name, $value );
|
94 |
+
}
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Setup plugin constants. Basic plugin definitions
|
99 |
+
*
|
100 |
+
* @access private
|
101 |
+
* @since 1.0
|
102 |
+
*/
|
103 |
+
private function setup_constants() {
|
104 |
+
|
105 |
+
$this->define( 'WPOS_ANYLC_VERSION', '1.0' );
|
106 |
+
$this->define( 'WPOS_ANYLC_DIR', plugin_dir_path( __FILE__ ) );
|
107 |
+
$this->define( 'WPOS_ANYLC_URL', plugin_dir_url( __FILE__ ) );
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Include required files.
|
112 |
+
*
|
113 |
+
* @access private
|
114 |
+
* @since 1.0
|
115 |
+
*/
|
116 |
+
private function includes() {
|
117 |
+
|
118 |
+
// Functions file
|
119 |
+
require_once WPOS_ANYLC_DIR .'/includes/wpos-anylc-function.php';
|
120 |
+
|
121 |
+
// Script Class
|
122 |
+
require_once WPOS_ANYLC_DIR .'/includes/class-anylc-script.php';
|
123 |
+
|
124 |
+
// Admin Class
|
125 |
+
require_once WPOS_ANYLC_DIR .'/includes/class-anylc-admin.php';
|
126 |
+
}
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
*
|
131 |
+
* The main function responsible for returning the one true Analytics
|
132 |
+
* Instance to functions everywhere.
|
133 |
+
*
|
134 |
+
* Use this function like you would a global variable, except without needing
|
135 |
+
* to declare the global.
|
136 |
+
*
|
137 |
+
* Example: <?php $wpos_anylc = WPOS_ANYLC(); ?>
|
138 |
+
*
|
139 |
+
* @since 1.0
|
140 |
+
* @return object The one true Analytics Instance.
|
141 |
+
*/
|
142 |
+
function WPOS_ANYLC() {
|
143 |
+
return WPOS_Analytics::instance();
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
*
|
148 |
+
* Initialize Analytics Module
|
149 |
+
*
|
150 |
+
* @since 1.0
|
151 |
+
* @return object The one true Analytics Instance.
|
152 |
+
*/
|
153 |
+
function wpos_anylc_init_module( $args = array() ) {
|
154 |
+
|
155 |
+
global $wpos_analytics_module, $wpos_analytics_product;
|
156 |
+
|
157 |
+
$defaul_args = array(
|
158 |
+
'id' => null,
|
159 |
+
'file' => null,
|
160 |
+
'name' => null,
|
161 |
+
'slug' => null,
|
162 |
+
'type' => 'plugin',
|
163 |
+
'menu' => false,
|
164 |
+
'icon' => '',
|
165 |
+
'text_domain' => 'wpos_analytics',
|
166 |
+
);
|
167 |
+
|
168 |
+
$args = wp_parse_args( $args, $defaul_args );
|
169 |
+
|
170 |
+
// If required data is not there then simply return
|
171 |
+
if( empty($args['id']) || empty( $args['file'] ) || empty( $args['slug'] ) ) {
|
172 |
+
return false;
|
173 |
+
}
|
174 |
+
|
175 |
+
// Additional args
|
176 |
+
$promotion = array();
|
177 |
+
$args['dir'] = pathinfo($args['file'], PATHINFO_DIRNAME);
|
178 |
+
$args['icon'] = empty( $icon ) ? trailingslashit( WP_PLUGIN_URL ).$args['dir'].'/wpos-analytics/assets/images/icon.png' : $args['icon'];
|
179 |
+
$args['brand_icon'] = plugin_dir_url( __FILE__ ).'assets/images/wpos-logo.png';
|
180 |
+
$args['anylc_optin'] = 'wpos_anylc_pdt_'.$args['id'];
|
181 |
+
|
182 |
+
if( isset( $args['promotion'] ) ) {
|
183 |
+
foreach ($args['promotion'] as $promotion_key => $promotion_data) {
|
184 |
+
if( empty( $promotion_data['name'] ) || empty( $promotion_data['file'] ) ) {
|
185 |
+
continue;
|
186 |
+
}
|
187 |
+
|
188 |
+
$promotion[$promotion_key] = $promotion_data;
|
189 |
+
}
|
190 |
+
}
|
191 |
+
$args['promotion'] = $promotion;
|
192 |
+
|
193 |
+
// Taking some variables
|
194 |
+
$wpos_analytics_module = !empty( $wpos_analytics_module ) ? $wpos_analytics_module : array();
|
195 |
+
$wpos_analytics_product = !empty( $wpos_analytics_product ) ? $wpos_analytics_product : array();
|
196 |
+
|
197 |
+
if( is_array( $wpos_analytics_module ) ) {
|
198 |
+
$wpos_analytics_module[ $args['file'] ] = $args;
|
199 |
+
}
|
200 |
+
|
201 |
+
if( is_array( $wpos_analytics_product ) ) {
|
202 |
+
$wpos_analytics_product[ $args['slug'] ] = $args;
|
203 |
+
}
|
204 |
+
|
205 |
+
return $wpos_analytics_module;
|
206 |
+
}
|
207 |
+
|
208 |
+
/**
|
209 |
+
*
|
210 |
+
* Function on any plugin deactivation
|
211 |
+
*
|
212 |
+
* @since 1.0
|
213 |
+
* @return object The one true Analytics Instance.
|
214 |
+
*/
|
215 |
+
function wpos_anylc_plugin_activation( $plugin, $network_activation ) {
|
216 |
+
|
217 |
+
// return if activating from network, or bulk
|
218 |
+
if ( is_network_admin() ) {
|
219 |
+
return;
|
220 |
+
}
|
221 |
+
|
222 |
+
global $wpos_analytics_module;
|
223 |
+
|
224 |
+
if( isset( $wpos_analytics_module[ $plugin ] ) ) {
|
225 |
+
|
226 |
+
$opt_in_data = get_option( $wpos_analytics_module[ $plugin ]['anylc_optin'] );
|
227 |
+
$optin_status = isset( $opt_in_data['status'] ) ? $opt_in_data['status'] : -1;
|
228 |
+
|
229 |
+
if( $optin_status == -1 ) {
|
230 |
+
$redirect_link = add_query_arg( array('page' => $wpos_analytics_module[ $plugin ]['slug']), admin_url('admin.php') );
|
231 |
+
update_option( 'wpos_anylc_redirect', $redirect_link );
|
232 |
+
}
|
233 |
+
}
|
234 |
+
}
|
235 |
+
add_action( 'activated_plugin', 'wpos_anylc_plugin_activation', 10, 2 );
|
236 |
+
|
237 |
+
/**
|
238 |
+
*
|
239 |
+
* Initialize Analytics Class Once all stuff has been loaded
|
240 |
+
*
|
241 |
+
* @since 1.0
|
242 |
+
* @return object The one true Analytics Instance.
|
243 |
+
*/
|
244 |
+
function wpos_anylc_plugins_loaded() {
|
245 |
+
|
246 |
+
// Get Analytics Running.
|
247 |
+
WPOS_ANYLC();
|
248 |
+
}
|
249 |
+
add_action( 'plugins_loaded', 'wpos_anylc_plugins_loaded', 12 );
|
250 |
+
|
251 |
+
endif; // End if class_exists check.
|