PluginProbe ʕ •ᴥ•ʔ
Folders – Unlimited Folders to Organize Media Library Folder, Pages, Posts, File Manager / 2.7.3
Folders – Unlimited Folders to Organize Media Library Folder, Pages, Posts, File Manager v2.7.3
3.1.9 3.1.8 3.1.7 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 trunk 1.3.7 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 2.4 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.5 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.6.6 2.6.7 2.6.8 2.6.9 2.7 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.8.9 2.9 2.9.1 2.9.2
folders / includes / class-affiliate.php
folders / includes Last commit date
class-affiliate.php 5 years ago class-polylang.php 5 years ago class-review-box.php 5 years ago class-wpml.php 5 years ago folders.class.php 4 years ago form.class.php 5 years ago media.replace.php 4 years ago plugin.updates.php 5 years ago plugins.class.php 5 years ago tree.class.php 5 years ago
class-affiliate.php
176 lines
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) exit;
3 class Folder_affiliate_program {
4
5 public $plugin_name = "Folders";
6
7 public $plugin_slug = "folders";
8
9 public function __construct() {
10 add_action("wp_ajax_".$this->plugin_slug."_affiliate_program", array($this, "affiliate_program"));
11
12 add_action('admin_notices', array($this, 'admin_notices'));
13 }
14
15 public function affiliate_program() {
16 if (current_user_can('manage_options')) {
17 $nonce = filter_input(INPUT_POST, 'nonce', FILTER_SANITIZE_STRING);
18 $days = filter_input(INPUT_POST, 'days', FILTER_SANITIZE_STRING);
19 if (!empty($nonce) && wp_verify_nonce($nonce, $this->plugin_slug . "_affiliate_program")) {
20 if ($days == -1) {
21 add_option($this->plugin_slug . "_hide_affiliate_box", "1");
22 } else {
23 $date = date("Y-m-d", strtotime("+" . $days . " days"));
24 update_option($this->plugin_slug . "_show_affiliate_box_after", $date);
25 }
26 }
27 die;
28 }
29 }
30
31 public function admin_notices() {
32 if (current_user_can('manage_options')) {
33 $is_hidden = get_option($this->plugin_slug."_hide_affiliate_box");
34 if($is_hidden !== false) {
35 return;
36 }
37 $date_to_show = get_option($this->plugin_slug."_show_affiliate_box_after");
38 if($date_to_show === false || empty($date_to_show)) {
39 $date = date("Y-m-d", strtotime("+5 days"));
40 update_option($this->plugin_slug."_show_affiliate_box_after", $date);
41 return;
42 }
43 $current_date = date("Y-m-d");
44 if($current_date < $date_to_show) {
45 return;
46 }
47 ?>
48 <style>
49 .<?php echo $this->plugin_slug ?>-premio-affiliate p a {
50 display: inline-block;
51 float: right;
52 text-decoration: none;
53 color: #999999;
54 position: absolute;
55 right: 12px;
56 top: 12px;
57 }
58 .<?php echo $this->plugin_slug ?>-premio-affiliate p a:hover, .<?php echo $this->plugin_slug ?>-premio-affiliate p a:focus {
59 color: #333333;
60 }
61 .<?php echo $this->plugin_slug ?>-premio-affiliate .button span {
62 display: inline-block;
63 line-height: 27px;
64 font-size: 16px;
65 }
66 .<?php echo $this->plugin_slug ?>-premio-affiliate {
67 padding: 1px 100px 12px 12px;
68 margin: 15px 15px 2px;
69 position: relative;
70 }
71 .<?php echo $this->plugin_slug ?>-affiliate-popup {
72 position: fixed;
73 width: 100%;
74 height: 100%;
75 z-index: 10001;
76 background: rgba(0,0,0,0.65);
77 top: 0;
78 left: 0;
79 display: none;
80 }
81 .<?php echo $this->plugin_slug ?>-affiliate-popup-content {
82 background: #ffffff;
83 padding: 20px;
84 position: absolute;
85 max-width: 450px;
86 width: 100%;
87 margin: 0 auto;
88 top: 45%;
89 left: 0;
90 right: 0;
91 -webkit-border-radius: 5px;
92 -moz-border-radius: 5px;
93 border-radius: 5px;
94 }
95 .<?php echo $this->plugin_slug ?>-affiliate-title {
96 padding: 0 0 10px 0;
97 font-weight: bold;
98 }
99 .<?php echo $this->plugin_slug ?>-affiliate-options a {
100 display: block;
101 margin: 5px 0 5px 0;
102 color: #333;
103 text-decoration: none;
104 }
105 .<?php echo $this->plugin_slug ?>-affiliate-options a.dismiss {
106 color: #999;
107 }
108 .<?php echo $this->plugin_slug ?>-affiliate-options a:hover, .affiliate-options a:focus {
109 color: #0073aa;
110 }
111 button.<?php echo $this->plugin_slug ?>-close-affiliate-popup {
112 position: absolute;
113 top: 5px;
114 right: 0;
115 border: none;
116 background: transparent;
117 cursor: pointer;
118 }
119 a.button.button-primary.<?php echo $this->plugin_slug ?>-affiliate-btn {
120 font-size: 14px;
121 background: #F51366;
122 color: #fff;
123 border: solid 1px #F51366;
124 border-radius: 3px;
125 line-height: 24px;
126 -webkit-box-shadow: 0 3px 5px -3px #333333;
127 -moz-box-shadow: 0 3px 5px -3px #333333;
128 box-shadow: 0 3px 5px -3px #333333;
129 text-shadow: none;
130 }
131 </style>
132 <div class="notice notice-info chaty-notice <?php echo $this->plugin_slug ?>-premio-affiliate <?php echo $this->plugin_slug ?>-premio-affiliate">
133 <p>Hi there, you've been using <?php echo $this->plugin_name ?> for a while now. Do you know that <b><?php echo $this->plugin_name ?></b> has an affiliate program? Join now and get <b>25% lifetime commission</b> <a href="javascript:;" class="dismiss-btn"><span class="dashicons dashicons-no-alt"></span> Dismiss</a></p>
134 <div class="clear clearfix"></div>
135 <a class="button button-primary <?php echo $this->plugin_slug ?>-affiliate-btn" target="_blank" href="https://premio.io/affiliates/?utm_source=inapp&plugin=folders&domain=<?php echo $_SERVER['HTTP_HOST'] ?>">Tell me more <span class="dashicons dashicons-arrow-right-alt"></span></a>
136 </div>
137 <div class="<?php echo $this->plugin_slug ?>-affiliate-popup">
138 <div class="<?php echo $this->plugin_slug ?>-affiliate-popup-content">
139 <button class="<?php echo $this->plugin_slug ?>-close-affiliate-popup"><span class="dashicons dashicons-no-alt"></span></button>
140 <div class="<?php echo $this->plugin_slug ?>-affiliate-title">Would you like us to remind you about this later?</div>
141 <div class="<?php echo $this->plugin_slug ?>-affiliate-options">
142 <a href="javascript:;" data-days="3">Remind me in 3 days</a>
143 <a href="javascript:;" data-days="10">Remind me in 10 days</a>
144 <a href="javascript:;" data-days="-1" class="dismiss">Don't remind me about this</a>
145 </div>
146 </div>
147 </div>
148 <script>
149 jQuery(document).ready(function(){
150 jQuery(document).on("click", ".<?php echo $this->plugin_slug ?>-premio-affiliate p a.dismiss-btn", function(){
151 jQuery(".<?php echo $this->plugin_slug ?>-affiliate-popup").show();
152 });
153 jQuery(document).on("click", ".<?php echo $this->plugin_slug ?>-close-affiliate-popup", function(){
154 jQuery(".<?php echo $this->plugin_slug ?>-affiliate-popup").hide();
155 });
156 jQuery(document).on("click", ".<?php echo $this->plugin_slug ?>-affiliate-options a", function(){
157 var dataDays = jQuery(this).attr("data-days");
158 jQuery(".<?php echo $this->plugin_slug ?>-affiliate-popup").hide();
159 jQuery(".<?php echo $this->plugin_slug ?>-premio-affiliate").hide();
160 jQuery.ajax({
161 url: "<?php echo admin_url("admin-ajax.php") ?>",
162 data: "action=<?php echo esc_attr($this->plugin_slug) ?>_affiliate_program&days="+dataDays+"&nonce=<?php echo esc_attr(wp_create_nonce($this->plugin_slug."_affiliate_program")) ?>",
163 type: "post",
164 success: function() {
165 jQuery(".<?php echo $this->plugin_slug ?>-affiliate-popup").remove();
166 jQuery(".<?php echo $this->plugin_slug ?>-premio-affiliate").remove();
167 }
168 });
169 });
170 });
171 </script>
172 <?php
173 }
174 }
175 }
176 $Folder_affiliate_program = new Folder_affiliate_program();