PluginProbe ʕ •ᴥ•ʔ
My Sticky Bar – Floating Notification Bar & Sticky Header (formerly myStickymenu) / 2.8.1
My Sticky Bar – Floating Notification Bar & Sticky Header (formerly myStickymenu) v2.8.1
2.9.1 2.9.0 2.8.9 2.8.8 trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9 1.9.1 2.0 2.0.1 2.0.3 2.0.4 2.0.5 2.0.6 2.1 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.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.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7
mystickymenu / admin / poptin-plugin.php
mystickymenu / admin Last commit date
bar-preview.php 1 year ago bar-settings.php 1 year ago customize-bar.php 1 year ago display-rules.php 1 year ago email-signup.php 1 year ago poptin-plugin.php 1 year ago poptin-popup.php 1 year ago stickymenu-dashboard.php 1 year ago
poptin-plugin.php
353 lines
1 <?php
2 // You may comment this out IF you're sure the function exists.
3 require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
4 remove_all_filters('plugins_api');
5 $plugins_allowedtags = array(
6 'a' => array(
7 'href' => array(),
8 'title' => array(),
9 'target' => array(),
10 ),
11 'abbr' => array( 'title' => array() ),
12 'acronym' => array( 'title' => array() ),
13 'code' => array(),
14 'pre' => array(),
15 'em' => array(),
16 'strong' => array(),
17 'ul' => array(),
18 'ol' => array(),
19 'li' => array(),
20 'p' => array(),
21 'br' => array(),
22 );
23
24 /* Poptin Plugins */
25 $args = [
26 'slug' => 'poptin',
27 'fields' => [
28 'short_description' => true,
29 'icons' => true,
30 'reviews' => false, // excludes all reviews
31 ],
32 ];
33 $data = plugins_api( 'plugin_information', $args );
34 $poptin_plugin = array();
35 if ( $data && ! is_wp_error( $data ) ) {
36 $poptin_plugin['poptin'] = $data;
37 $poptin_plugin['poptin']->name = 'Poptin: Beautiful Pop Ups and Embedded Inline Contact Forms for Your Website';
38 $poptin_plugin['poptin']->short_description = 'Pop ups and contact forms builder for your website. Get more sales, leads, and subscribers with beautiful popups & inline forms templates, no coding skills required';
39 }
40 ?>
41 <div class="wrap mystickyelement-wrap recommended-plugins">
42 <h2>
43 <?php _e('Install Poptin', 'mystickyelements'); ?>
44 </h2>
45 </div>
46 <div class="wrap recommended-plugins">
47 <div class="wp-list-table widefat plugin-install">
48 <div class="the-list">
49 <?php
50 foreach ( (array) $poptin_plugin as $plugin ) {
51 if ( is_object( $plugin ) ) {
52 $plugin = (array) $plugin;
53 }
54
55 // Display the group heading if there is one.
56 if ( isset( $plugin['group'] ) && $plugin['group'] != $group ) {
57 if ( isset( $this->groups[ $plugin['group'] ] ) ) {
58 $group_name = $this->groups[ $plugin['group'] ];
59 if ( isset( $plugins_group_titles[ $group_name ] ) ) {
60 $group_name = $plugins_group_titles[ $group_name ];
61 }
62 } else {
63 $group_name = $plugin['group'];
64 }
65
66 // Starting a new group, close off the divs of the last one.
67 if ( ! empty( $group ) ) {
68 echo '</div></div>';
69 }
70
71 echo '<div class="plugin-group"><h3>' . esc_html( $group_name ) . '</h3>';
72 // Needs an extra wrapping div for nth-child selectors to work.
73 echo '<div class="plugin-items">';
74
75 $group = $plugin['group'];
76 }
77 $title = wp_kses( $plugin['name'], $plugins_allowedtags );
78
79 // Remove any HTML from the description.
80 $description = strip_tags( $plugin['short_description'] );
81 $version = wp_kses( $plugin['version'], $plugins_allowedtags );
82
83 $name = strip_tags( $title . ' ' . $version );
84
85 $author = wp_kses( $plugin['author'], $plugins_allowedtags );
86 if ( ! empty( $author ) ) {
87 /* translators: %s: Plugin author. */
88 $author = ' <cite>' . sprintf( __( 'By %s' ), $author ) . '</cite>';
89 }
90
91 $requires_php = isset( $plugin['requires_php'] ) ? $plugin['requires_php'] : null;
92 $requires_wp = isset( $plugin['requires'] ) ? $plugin['requires'] : null;
93
94 $compatible_php = is_php_version_compatible( $requires_php );
95 $compatible_wp = is_wp_version_compatible( $requires_wp );
96 $tested_wp = ( empty( $plugin['tested'] ) || version_compare( get_bloginfo( 'version' ), $plugin['tested'], '<=' ) );
97
98 $action_links = array();
99
100 if ( current_user_can( 'install_plugins' ) || current_user_can( 'update_plugins' ) ) {
101 $status = install_plugin_install_status( $plugin );
102
103 switch ( $status['status'] ) {
104 case 'install':
105 if ( $status['url'] ) {
106 if ( $compatible_php && $compatible_wp ) {
107 $action_links[] = sprintf(
108 '<a class="install-now button" data-slug="%s" href="%s" aria-label="%s" data-name="%s">%s</a>',
109 esc_attr( $plugin['slug'] ),
110 esc_url( $status['url'] ),
111 /* translators: %s: Plugin name and version. */
112 esc_attr( sprintf( _x( 'Install %s now', 'plugin' ), $name ) ),
113 esc_attr( $name ),
114 __( 'Install Now' )
115 );
116 } else {
117 $action_links[] = sprintf(
118 '<button type="button" class="button button-disabled" disabled="disabled">%s</button>',
119 _x( 'Cannot Install', 'plugin' )
120 );
121 }
122 }
123 break;
124
125 case 'update_available':
126 if ( $status['url'] ) {
127 if ( $compatible_php && $compatible_wp ) {
128 $action_links[] = sprintf(
129 '<a class="update-now button aria-button-if-js" data-plugin="%s" data-slug="%s" href="%s" aria-label="%s" data-name="%s">%s</a>',
130 esc_attr( $status['file'] ),
131 esc_attr( $plugin['slug'] ),
132 esc_url( $status['url'] ),
133 /* translators: %s: Plugin name and version. */
134 esc_attr( sprintf( _x( 'Update %s now', 'plugin' ), $name ) ),
135 esc_attr( $name ),
136 __( 'Update Now' )
137 );
138 } else {
139 $action_links[] = sprintf(
140 '<button type="button" class="button button-disabled" disabled="disabled">%s</button>',
141 _x( 'Cannot Update', 'plugin' )
142 );
143 }
144 }
145 break;
146
147 case 'latest_installed':
148 case 'newer_installed':
149 if ( is_plugin_active( $status['file'] ) ) {
150 $action_links[] = sprintf(
151 '<button type="button" class="button button-disabled" disabled="disabled">%s</button>',
152 _x( 'Active', 'plugin' )
153 );
154 } elseif ( current_user_can( 'activate_plugin', $status['file'] ) ) {
155 $button_text = __( 'Activate' );
156 /* translators: %s: Plugin name. */
157 $button_label = _x( 'Activate %s', 'plugin' );
158 $activate_url = add_query_arg(
159 array(
160 '_wpnonce' => wp_create_nonce( 'activate-plugin_' . $status['file'] ),
161 'action' => 'activate',
162 'plugin' => $status['file'],
163 ),
164 network_admin_url( 'plugins.php' )
165 );
166
167 if ( is_network_admin() ) {
168 $button_text = __( 'Network Activate' );
169 /* translators: %s: Plugin name. */
170 $button_label = _x( 'Network Activate %s', 'plugin' );
171 $activate_url = add_query_arg( array( 'networkwide' => 1 ), $activate_url );
172 }
173
174 $action_links[] = sprintf(
175 '<a href="%1$s" class="button activate-now" aria-label="%2$s">%3$s</a>',
176 esc_url( $activate_url ),
177 esc_attr( sprintf( $button_label, $plugin['name'] ) ),
178 $button_text
179 );
180 } else {
181 $action_links[] = sprintf(
182 '<button type="button" class="button button-disabled" disabled="disabled">%s</button>',
183 _x( 'Installed', 'plugin' )
184 );
185 }
186 break;
187 }
188 }
189
190 $details_link = self_admin_url(
191 'plugin-install.php?tab=plugin-information&amp;plugin=' . $plugin['slug'] .
192 '&amp;TB_iframe=true&amp;width=600&amp;height=550'
193 );
194
195 $action_links[] = sprintf(
196 '<a href="%s" class="thickbox open-plugin-details-modal" aria-label="%s" data-title="%s">%s</a>',
197 esc_url( $details_link ),
198 /* translators: %s: Plugin name and version. */
199 esc_attr( sprintf( __( 'More information about %s' ), $name ) ),
200 esc_attr( $name ),
201 __( 'More Details' )
202 );
203
204 if ( ! empty( $plugin['icons']['svg'] ) ) {
205 $plugin_icon_url = $plugin['icons']['svg'];
206 } elseif ( ! empty( $plugin['icons']['2x'] ) ) {
207 $plugin_icon_url = $plugin['icons']['2x'];
208 } elseif ( ! empty( $plugin['icons']['1x'] ) ) {
209 $plugin_icon_url = $plugin['icons']['1x'];
210 } else {
211 $plugin_icon_url = $plugin['icons']['default'];
212 }
213
214 /**
215 * Filters the install action links for a plugin.
216 *
217 * @since 2.7.0
218 *
219 * @param string[] $action_links An array of plugin action links. Defaults are links to Details and Install Now.
220 * @param array $plugin The plugin currently being listed.
221 */
222 $action_links = apply_filters( 'plugin_install_action_links', $action_links, $plugin );
223
224 $last_updated_timestamp = strtotime( $plugin['last_updated'] );
225 ?>
226 <div class="plugin-card plugin-card-<?php echo sanitize_html_class( $plugin['slug'] ); ?>">
227 <?php
228 if ( ! $compatible_php || ! $compatible_wp ) {
229 echo '<div class="notice inline notice-error notice-alt"><p>';
230 if ( ! $compatible_php && ! $compatible_wp ) {
231 _e( 'This plugin doesn&#8217;t work with your versions of WordPress and PHP.' );
232 if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
233 printf(
234 /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
235 ' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
236 self_admin_url( 'update-core.php' ),
237 esc_url( wp_get_update_php_url() )
238 );
239 wp_update_php_annotation( '</p><p><em>', '</em>' );
240 } elseif ( current_user_can( 'update_core' ) ) {
241 printf(
242 /* translators: %s: URL to WordPress Updates screen. */
243 ' ' . __( '<a href="%s">Please update WordPress</a>.' ),
244 self_admin_url( 'update-core.php' )
245 );
246 } elseif ( current_user_can( 'update_php' ) ) {
247 printf(
248 /* translators: %s: URL to Update PHP page. */
249 ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
250 esc_url( wp_get_update_php_url() )
251 );
252 wp_update_php_annotation( '</p><p><em>', '</em>' );
253 }
254 } elseif ( ! $compatible_wp ) {
255 _e( 'This plugin doesn&#8217;t work with your version of WordPress.' );
256 if ( current_user_can( 'update_core' ) ) {
257 printf(
258 /* translators: %s: URL to WordPress Updates screen. */
259 ' ' . __( '<a href="%s">Please update WordPress</a>.' ),
260 self_admin_url( 'update-core.php' )
261 );
262 }
263 } elseif ( ! $compatible_php ) {
264 _e( 'This plugin doesn&#8217;t work with your version of PHP.' );
265 if ( current_user_can( 'update_php' ) ) {
266 printf(
267 /* translators: %s: URL to Update PHP page. */
268 ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
269 esc_url( wp_get_update_php_url() )
270 );
271 wp_update_php_annotation( '</p><p><em>', '</em>' );
272 }
273 }
274 echo '</p></div>';
275 }
276 ?>
277 <div class="plugin-card-top">
278 <div class="name column-name">
279 <h3>
280 <a href="<?php echo esc_url( $details_link ); ?>" class="thickbox open-plugin-details-modal">
281 <?php echo wp_kses($title, $plugins_allowedtags); ?>
282 <img src="<?php echo esc_attr( $plugin_icon_url ); ?>" class="plugin-icon" alt="" />
283 </a>
284 </h3>
285 </div>
286 <div class="action-links">
287 <?php
288 if ( $action_links ) {
289 echo '<ul class="plugin-action-buttons"><li>' . implode( '</li><li>', $action_links ) . '</li></ul>';
290 }
291 ?>
292 </div>
293 <div class="desc column-description">
294 <p><?php echo wp_kses($description, $plugins_allowedtags); ?></p>
295 <p class="authors"><?php echo wp_kses($author, $plugins_allowedtags); ?></p>
296 </div>
297 </div>
298 <div class="plugin-card-bottom">
299 <div class="vers column-rating">
300 <?php
301 wp_star_rating(
302 array(
303 'rating' => $plugin['rating'],
304 'type' => 'percent',
305 'number' => $plugin['num_ratings'],
306 )
307 );
308 ?>
309 <span class="num-ratings" aria-hidden="true">(<?php echo number_format_i18n( $plugin['num_ratings'] ); ?>)</span>
310 </div>
311 <div class="column-updated">
312 <strong><?php _e( 'Last Updated:' ); ?></strong>
313 <?php
314 /* translators: %s: Human-readable time difference. */
315 printf( __( '%s ago' ), human_time_diff( $last_updated_timestamp ) );
316 ?>
317 </div>
318 <div class="column-downloaded">
319 <?php
320 if ( $plugin['active_installs'] >= 1000000 ) {
321 $active_installs_millions = floor( $plugin['active_installs'] / 1000000 );
322 $active_installs_text = sprintf(
323 /* translators: %s: Number of millions. */
324 _nx( '%s+ Million', '%s+ Million', $active_installs_millions, 'Active plugin installations' ),
325 number_format_i18n( $active_installs_millions )
326 );
327 } elseif ( 0 == $plugin['active_installs'] ) {
328 $active_installs_text = _x( 'Less Than 10', 'Active plugin installations' );
329 } else {
330 $active_installs_text = number_format_i18n( $plugin['active_installs'] ) . '+';
331 }
332 /* translators: %s: Number of installations. */
333 printf( __( '%s Active Installations' ), $active_installs_text );
334 ?>
335 </div>
336 <div class="column-compatibility">
337 <?php
338 if ( ! $tested_wp ) {
339 echo '<span class="compatibility-untested">' . __( 'Untested with your version of WordPress' ) . '</span>';
340 } elseif ( ! $compatible_wp ) {
341 echo '<span class="compatibility-incompatible">' . __( '<strong>Incompatible</strong> with your version of WordPress' ) . '</span>';
342 } else {
343 echo '<span class="compatibility-compatible">' . __( '<strong>Compatible</strong> with your version of WordPress' ) . '</span>';
344 }
345 ?>
346 </div>
347 </div>
348 </div>
349 <?php
350 } ?>
351 </div>
352 </div>
353 </div>