PluginProbe ʕ •ᴥ•ʔ
Folders – Unlimited Folders to Organize Media Library Folder, Pages, Posts, File Manager / 2.3.7
Folders – Unlimited Folders to Organize Media Library Folder, Pages, Posts, File Manager v2.3.7
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-review-box.php
folders / includes Last commit date
class-affiliate.php 6 years ago class-review-box.php 6 years ago folders.class.php 6 years ago form.class.php 6 years ago plugin.updates.php 6 years ago tree.class.php 6 years ago
class-review-box.php
212 lines
1 <?php
2 /* Free/Pro Class name change */
3 class folders_review_box {
4
5 public $plugin_name = "Folders";
6
7 public $plugin_slug = "folders";
8
9 public function __construct() {
10
11 add_action("wp_ajax_".$this->plugin_slug."_review_box", array($this, "affiliate_program"));
12
13 add_action('admin_notices', array($this, 'admin_notices'));
14 }
15
16 public function affiliate_program() {
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."_review_box")) {
20 if($days == -1) {
21 add_option($this->plugin_slug."_hide_review_box", "1");
22 } else {
23 $date = date("Y-m-d", strtotime("+".$days." days"));
24 update_option($this->plugin_slug."_show_review_box_after", $date);
25 }
26 }
27 die;
28 }
29
30 public function admin_notices() {
31 $is_hidden = get_option($this->plugin_slug."_hide_review_box");
32 if($is_hidden !== false) {
33 return;
34 }
35 $current_count = get_option($this->plugin_slug."_show_review_box_after");
36 if($current_count === false) {
37 $date = date("Y-m-d", strtotime("+7 days"));
38 add_option($this->plugin_slug."_show_review_box_after", $date);
39 return;
40 } else if($current_count < 35) {
41 return;
42 }
43 $date_to_show = get_option($this->plugin_slug."_show_review_box_after");
44 if($date_to_show !== false) {
45 $current_date = date("Y-m-d");
46 if($current_date < $date_to_show) {
47 return;
48 }
49 }
50 ?>
51 <style>
52 .<?php echo $this->plugin_slug ?>-premio-review-box p a {
53 display: inline-block;
54 float: right;
55 text-decoration: none;
56 color: #999999;
57 position: absolute;
58 right: 12px;
59 top: 12px;
60 }
61 .<?php echo $this->plugin_slug ?>-premio-review-box p a:hover, .<?php echo $this->plugin_slug ?>-premio-review-box p a:focus {
62 color: #333333;
63 }
64 .<?php echo $this->plugin_slug ?>-premio-review-box .button span {
65 display: inline-block;
66 line-height: 27px;
67 font-size: 16px;
68 }
69 .<?php echo $this->plugin_slug ?>-review-box-popup {
70 position: fixed;
71 width: 100%;
72 height: 100%;
73 z-index: 10001;
74 background: rgba(0,0,0,0.65);
75 top: 0;
76 left: 0;
77 display: none;
78 }
79 .<?php echo $this->plugin_slug ?>-review-box-popup-content {
80 background: #ffffff;
81 padding: 20px;
82 position: absolute;
83 max-width: 450px;
84 width: 100%;
85 margin: 0 auto;
86 top: 45%;
87 left: 0;
88 right: 0;
89 -webkit-border-radius: 5px;
90 -moz-border-radius: 5px;
91 border-radius: 5px;: ;
92 }
93 .<?php echo $this->plugin_slug ?>-review-box-title {
94 padding: 0 0 10px 0;
95 font-weight: bold;
96 }
97 .<?php echo $this->plugin_slug ?>-review-box-options a {
98 display: block;
99 margin: 5px 0 5px 0;
100 color: #333;
101 text-decoration: none;
102 }
103 .<?php echo $this->plugin_slug ?>-review-box-options a.dismiss {
104 color: #999;
105 }
106 .<?php echo $this->plugin_slug ?>-review-box-options a:hover, .affiliate-options a:focus {
107 color: #0073aa;
108 }
109 button.<?php echo $this->plugin_slug ?>-close-review-box-popup {
110 position: absolute;
111 top: 5px;
112 right: 0;
113 border: none;
114 background: transparent;
115 cursor: pointer;
116 }
117 a.button.button-primary.<?php echo $this->plugin_slug ?>-review-box-btn {
118 font-size: 14px;
119 background: #F51366;
120 color: #fff;
121 border: solid 1px #F51366;
122 border-radius: 3px;
123 line-height: 24px;
124 -webkit-box-shadow: 0 3px 5px -3px #333333;
125 -moz-box-shadow: 0 3px 5px -3px #333333;
126 box-shadow: 0 3px 5px -3px #333333;
127 text-shadow: none;
128 }
129 .notice.notice-info.premio-notice {
130 position: relative;
131 padding: 1px 30px 1px 12px;
132 }
133 .notice.notice-info.premio-notice ul li {
134 margin: 0;
135 }
136 .notice.notice-info.premio-notice ul li a {
137 color: #0073aa;
138 font-size: 14px;
139 text-decoration: underline;
140 }
141 .<?php echo $this->plugin_slug ?>-premio-review-box p {
142 display: inline-block;
143 line-height: 30px;
144 vertical-align: middle;
145 padding: 0 10px 0 0;
146 }
147 .<?php echo $this->plugin_slug ?>-premio-review-box p img {
148 width: 30px;
149 height: 30px;
150 display: inline-block;
151 margin: 0 10px;
152 vertical-align: middle;
153 border-radius: 15px;
154 }
155 </style>
156 <div class="notice notice-info premio-notice <?php echo $this->plugin_slug ?>-premio-review-box <?php echo $this->plugin_slug ?>-premio-review-box">
157 <p>
158 Hi there, it seems like <b><?php echo $this->plugin_name ?></b> is bringing you some value, and that's pretty awesome! Can you please show us some love and rate <?php echo $this->plugin_name ?> on WordPress? It'll only take 2 minutes of your time, and will really help us spread the word
159 - <b>Gal Dubinski</b>, Co-founder <img width="30px" src="<?php echo esc_url(plugin_dir_url(__FILE__)."../assets/images/premio-owner.png") ?>" />
160 <a href="javascript:;" class="dismiss-btn <?php echo $this->plugin_slug ?>-premio-review-dismiss-btn"><span class="dashicons dashicons-no-alt"></span></a>
161 </p>
162 <div class="clear clearfix"></div>
163 <ul>
164 <li><a class="<?php echo $this->plugin_slug ?>-premio-review-box-hide-btn" href="https://wordpress.org/support/plugin/folders/reviews/?filter=5" target="_blank">I'd love to help :)</a></li>
165 <li><a class="<?php echo $this->plugin_slug ?>-premio-review-box-future-btn" href="javascript:;">Not this time</a></li>
166 <li><a class="<?php echo $this->plugin_slug ?>-premio-review-box-hide-btn" href="javascript:;">I've already rated you</a></li>
167 </ul>
168 </div>
169 <div class="<?php echo $this->plugin_slug ?>-review-box-popup">
170 <div class="<?php echo $this->plugin_slug ?>-review-box-popup-content">
171 <button class="<?php echo $this->plugin_slug ?>-close-review-box-popup"><span class="dashicons dashicons-no-alt"></span></button>
172 <div class="<?php echo $this->plugin_slug ?>-review-box-title">Would you like us to remind you about this later?</div>
173 <div class="<?php echo $this->plugin_slug ?>-review-box-options">
174 <a href="javascript:;" data-days="3">Remind me in 3 days</a>
175 <a href="javascript:;" data-days="10">Remind me in 10 days</a>
176 <a href="javascript:;" data-days="-1" class="dismiss">Don't remind me about this</a>
177 </div>
178 </div>
179 </div>
180 <script>
181 jQuery(document).ready(function(){
182 jQuery("body").addClass("has-premio-box");
183 jQuery(document).on("click", ".<?php echo $this->plugin_slug ?>-premio-review-dismiss-btn, .<?php echo $this->plugin_slug ?>-premio-review-box-future-btn", function(){
184 jQuery(".<?php echo $this->plugin_slug ?>-review-box-popup").show();
185 });
186 jQuery(document).on("click", ".<?php echo $this->plugin_slug ?>-close-review-box-popup", function(){
187 jQuery(".<?php echo $this->plugin_slug ?>-review-box-popup").hide();
188 });
189 jQuery(document).on("click",".<?php echo $this->plugin_slug ?>-premio-review-box-hide-btn",function(){
190 jQuery(".<?php echo $this->plugin_slug ?>-review-box-options a:last").trigger("click");
191 });
192 jQuery(document).on("click", ".<?php echo $this->plugin_slug ?>-review-box-options a", function(){
193 var dataDays = jQuery(this).attr("data-days");
194 jQuery(".<?php echo $this->plugin_slug ?>-review-box-popup").remove();
195 jQuery(".<?php echo $this->plugin_slug ?>-premio-review-box").remove();
196 jQuery("body").removeClass("has-premio-box");
197 jQuery.ajax({
198 url: "<?php echo admin_url("admin-ajax.php") ?>",
199 data: "action=<?php echo esc_attr($this->plugin_slug) ?>_review_box&days="+dataDays+"&nonce=<?php echo esc_attr(wp_create_nonce($this->plugin_slug."_review_box")) ?>",
200 type: "post",
201 success: function() {
202 jQuery(".<?php echo $this->plugin_slug ?>-review-box-popup").remove();
203 jQuery(".<?php echo $this->plugin_slug ?>-premio-review-box").remove();
204 }
205 });
206 });
207 });
208 </script>
209 <?php
210 }
211 }
212 $folders_review_box = new folders_review_box();