PluginProbe ʕ •ᴥ•ʔ
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents / 2.4.0
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents v2.4.0
4.6.5 4.6.4 4.6.3 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 2.0.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.2.0 2.2.1 2.2.2 2.3.0 2.3.1 2.3.2 2.3.3 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.1.3 3.2.0 3.2.1 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.4.0 3.4.1 3.4.2 3.4.3 3.5.0 3.5.1 3.5.2 3.5.3 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.7.0 3.7.1 3.7.2 3.7.3 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.9.0 3.9.1 3.9.10 3.9.11 3.9.12 3.9.13 3.9.14 3.9.15 3.9.16 3.9.17 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9 4.0.0 4.0.1 4.0.10 4.0.11 4.0.12 4.0.13 4.0.14 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.0.9 4.1.0 4.1.1 4.1.10 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 4.3.1 4.4.0 4.4.1 4.4.10 4.4.11 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9 4.5.0 4.5.1
embedpress / EmbedPress / Includes / Traits / Shared.php
embedpress / EmbedPress / Includes / Traits Last commit date
Shared.php 6 years ago
Shared.php
160 lines
1 <?php
2 namespace EmbedPress\Includes\Traits;
3
4 if (!defined('ABSPATH')) {
5 exit;
6 } // Exit if accessed directly
7 use \EmbedPress\Includes\Classes\EmbedPress_Plugin_Usage_Tracker;
8 use \EmbedPress\Includes\Classes\EmbedPress_Notice;
9
10 trait Shared {
11
12
13 /**
14 * Optional usage tracker
15 *
16 * @since v1.0.0
17 */
18 public function start_plugin_tracking() {
19 new EmbedPress_Plugin_Usage_Tracker(
20 EMBEDPRESS_FILE,
21 'http://app.wpdeveloper.net',
22 array(),
23 true,
24 true,
25 1
26 );
27 }
28
29 public function admin_notice() {
30 $notice = new EmbedPress_Notice(EMBEDPRESS_PLUGIN_BASENAME, EMBEDPRESS_VERSION);
31
32 /**
33 * Current Notice End Time.
34 * Notice will dismiss in 3 days if user does nothing.
35 */
36 $notice->cne_time = '3 Day';
37
38 /**
39 * Current Notice Maybe Later Time.
40 * Notice will show again in 7 days
41 */
42 $notice->maybe_later_time = '21 Day';
43
44 $notice->text_domain = 'embedpress';
45
46 $scheme = (parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY)) ? '&' : '?';
47 $url = $_SERVER['REQUEST_URI'] . $scheme;
48 $notice->links = [
49 'review' => array(
50 'later' => array(
51 'link' => 'https://wordpress.org/support/plugin/embedpress/reviews/',
52 'target' => '_blank',
53 'label' => __('Ok, you deserve it!', 'embedpress'),
54 'icon_class' => 'dashicons dashicons-external',
55 ),
56 'allready' => array(
57 'link' => $url,
58 'label' => __('I already did', 'embedpress'),
59 'icon_class' => 'dashicons dashicons-smiley',
60 'data_args' => [
61 'dismiss' => true,
62 ],
63 ),
64 'maybe_later' => array(
65 'link' => $url,
66 'label' => __('Maybe Later', 'embedpress'),
67 'icon_class' => 'dashicons dashicons-calendar-alt',
68 'data_args' => [
69 'later' => true,
70 ],
71 ),
72 'support' => array(
73 'link' => 'https://wordpress.org/support/plugin/embedpress/',
74 'label' => __('I need help', 'embedpress'),
75 'icon_class' => 'dashicons dashicons-sos',
76 ),
77 'never_show_again' => array(
78 'link' => $url,
79 'label' => __('Never show again', 'embedpress'),
80 'icon_class' => 'dashicons dashicons-dismiss',
81 'data_args' => [
82 'dismiss' => true,
83 ],
84 ),
85 ),
86 ];
87
88 /**
89 * This is review message and thumbnail.
90 */
91 $notice->message('review', '<p>' . __('We hope you\'re enjoying EmbedPress! Could you please do us a BIG favor and give it a 5-star rating on WordPress to help us spread the word and boost our motivation?', 'embedpress') . '</p>');
92 $notice->thumbnail('review', plugins_url('assets/images/icon-128x128.png', EMBEDPRESS_PLUGIN_BASENAME));
93 /**
94 * This is upsale notice settings
95 * classes for wrapper,
96 * Message message for showing.
97 */
98 $notice->classes( 'upsale', 'notice is-dismissible ' );
99 $notice->message( 'upsale', '<p>'. __( '8,000+ People already using <a href="https://wpdeveloper.net/ea/notificationX" target="_blank">EmbedPress</a> to increase their Sales & Engagement!', $notice->text_domain ) .'</p>' );
100 $notice->thumbnail( 'upsale', plugins_url( 'assets/images/nx-icon.svg', EMBEDPRESS_PLUGIN_BASENAME ) );
101
102 // Update Notice For PRO Version
103 if( $this->is_pro_active() && \version_compare( EMBEDPRESS_PRO_VERSION, '2.0.0', '<' ) ) {
104 $notice->classes( 'update', 'notice is-dismissible ' );
105 $notice->message( 'update', '<p>'. __( 'You are using an incompatible version of EmbedPress PRO. Please update to v3.4.0+. <a href="https://essential-addons.com/elementor/docs/manually-update-essential-addons-pro/" target="_blank">Follow manual update guide.</a>', $notice->text_domain ) .'</p>' );
106 $notice->thumbnail( 'update', plugins_url( 'assets/images/icon-128x128.png', EMBEDPRESS_PLUGIN_BASENAME ) );
107 }
108
109 $notice->upsale_args = array(
110 'slug' => 'notificationx',
111 'page_slug' => 'nx-builder',
112 'file' => 'notificationx.php',
113 'btn_text' => __( 'Install Free', 'embedpress'),
114 'condition' => [
115 'by' => 'class',
116 'class' => 'NotificationX'
117 ],
118 );
119
120 $notice->options_args = array(
121 'notice_will_show' => [
122 'opt_in' => $notice->timestamp,
123 'upsale' => $notice->makeTime($notice->timestamp, '14 Day'),
124 'review' => $notice->makeTime($notice->timestamp, '7 Day'), // after 3 days
125 ],
126 );
127 if( $this->is_pro_active() && \version_compare( EMBEDPRESS_PRO_VERSION, '2.0.0', '<' ) ) {
128 $notice->options_args['notice_will_show']['update'] = $notice->timestamp;
129 }
130
131 $notice->init();
132 }
133
134 public function is_pro_active(){
135 return is_plugin_active('embedpress-pro/embedpress-pro.php');
136 }
137
138 public function embedpress_admin_notice(){
139 if ($this->is_pro_active()) {
140 return;
141 }
142
143 $plugin_list = [
144 'embedpress-vimeo/embedpress-vimeo.php',
145 'embedpress-wistia/embedpress-wistia.php',
146 'embedpress-youtube/embedpress-youtube.php',
147 ];
148 $active_plugins = get_option('active_plugins');
149 foreach($active_plugins as $plugin){
150 if(in_array($plugin,$plugin_list)){
151 $msg = '<strong>[Good News]</strong> Introducing <strong>EmbedPress Pro</strong>! And as existing Loyal User you get Unlimited Sites access to EmbedPress Pro for free. Please update and claim your free license to continue. <br/><strong>[<a href="https://embedpress.com/ep-loyal-users" target="_blank" rel="noopener">Details</a>] - [<a href="https://embedpress.com/new-pro-2020-free" target="_blank" rel="noopener">Get EmbedPress Pro for Free</a>]</strong>';
152 echo '<div class="notice notice-info is-dismissible">
153 <p>'.$msg.'</p>
154 </div>';
155 break;
156 }
157 }
158 }
159
160 }