PluginProbe ʕ •ᴥ•ʔ
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents / 3.4.2
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents v3.4.2
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
Branding.php 4 years ago Shared.php 4 years ago
Shared.php
192 lines
1 <?php
2
3 namespace EmbedPress\Includes\Traits;
4
5 if ( !defined( 'ABSPATH' ) ) {
6 exit;
7 } // Exit if accessed directly
8 use \EmbedPress\Includes\Classes\EmbedPress_Plugin_Usage_Tracker;
9 use \EmbedPress\Includes\Classes\EmbedPress_Notice;
10
11 use PriyoMukul\WPNotice\Notices;
12
13 trait Shared {
14
15 private $insights = null;
16
17
18 /**
19 * Optional usage tracker
20 *
21 * @since v1.0.0
22 */
23 public function start_plugin_tracking() {
24 $this->insights = $tracker = EmbedPress_Plugin_Usage_Tracker::get_instance( EMBEDPRESS_FILE, [
25 'opt_in' => true,
26 'goodbye_form' => true,
27 'item_id' => '98ba0ac16a4f7b3b940d'
28 ] );
29 $tracker->set_notice_options(array(
30 'notice' => __( 'Want to help make <strong>EmbedPress</strong> even more awesome? You can get a <strong>10% discount coupon</strong> for Premium extensions if you allow us to track the usage.', 'embedpress' ),
31 'extra_notice' => __( 'We collect non-sensitive diagnostic data and plugin usage information.
32 Your site URL, WordPress & PHP version, plugins & themes and email address to send you the
33 discount coupon. This data lets us make sure this plugin always stays compatible with the most
34 popular plugins and themes. No spam, I promise.', 'embedpress' ),
35 ));
36 $tracker->init();
37 }
38
39 public function admin_notice() {
40 $_assets_url = plugins_url( 'assets/', EMBEDPRESS_PLUGIN_BASENAME );
41
42 $notices = new Notices([
43 'id' => 'embedpress',
44 'store' => 'options',
45 'storage_key' => 'notices',
46 'version' => '1.0.0',
47 'lifetime' => 3,
48 'styles' => $_assets_url . 'css/admin-notices.css',
49 ]);
50
51 /**
52 * This is review message and thumbnail.
53 */
54 $_review_notice = [
55 'thumbnail' => $_assets_url . 'images/icon-128x128.png',
56 'html' => '<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>',
57 'links' => [
58 'later' => array(
59 'link' => 'https://wordpress.org/support/plugin/embedpress/reviews/',
60 'target' => '_blank',
61 'label' => __('Ok, you deserve it!', 'wp-scheduled-posts'),
62 'icon_class' => 'dashicons dashicons-external',
63 ),
64 'allready' => array(
65 'label' => __('I already did', 'wp-scheduled-posts'),
66 'icon_class' => 'dashicons dashicons-smiley',
67 'attributes' => [
68 'data-dismiss' => true
69 ],
70 ),
71 'maybe_later' => array(
72 'label' => __('Maybe Later', 'wp-scheduled-posts'),
73 'icon_class' => 'dashicons dashicons-calendar-alt',
74 'attributes' => [
75 'data-later' => true
76 ],
77 ),
78 'support' => array(
79 'link' => 'https://wpdeveloper.com/support',
80 'label' => __('I need help', 'wp-scheduled-posts'),
81 'icon_class' => 'dashicons dashicons-sos',
82 ),
83 'never_show_again' => array(
84 'label' => __('Never show again', 'wp-scheduled-posts'),
85 'icon_class' => 'dashicons dashicons-dismiss',
86 'attributes' => [
87 'data-dismiss' => true
88 ],
89 ),
90 ],
91 ];
92
93 $notices->add(
94 'review',
95 $_review_notice,
96 [
97 'start' => $notices->strtotime( '+15 day' ),
98 'recurrence' => 30,
99 'dismissible' => true,
100 ]
101 );
102
103 $_freedom30_notice= [
104 'thumbnail' => $_assets_url . 'images/freedom30.png',
105 'html' => '<p>'. __( 'Celebrate independence & upgrade to <strong>EmbedPress PRO</strong> with up to <strong>50% OFF</strong> to use all the premium features from today', 'embedpress' ) .' <a class="button button-primary btn-embedpress" target="_blank" href="https://embedpress.com/#pricing">Claim My Offer</a></p>',
106 ];
107
108 $notices->add(
109 'freedom30',
110 $_freedom30_notice,
111 [
112 'start' => $notices->time(),
113 'expire' => strtotime( '5th July 2022 11:59:59 PM' ),
114 'recurrence' => false,
115 'dismissible' => true,
116 'display_if' => ! is_array( $notices->is_installed( 'embedpress-pro/embedpress-pro.php' ) )
117 ]
118 );
119
120 ob_start();
121 $this->insights->notice();
122 $opt_in_content = ob_get_clean();
123
124 $notices->add(
125 'optin',
126 $opt_in_content,
127 [
128 'start' => $notices->strtotime( '+20 day' ),
129 'recurrence' => 30,
130 'dismissible' => true,
131 'display_if' => ! is_array( $notices->is_installed( 'embedpress-pro/embedpress-pro.php' ) )
132 ]
133 );
134 if( ! empty( $opt_in_content ) ) {
135 }
136
137
138 $notices->init();
139
140 return;
141
142 /**
143 * This is upsale notice settings
144 * classes for wrapper,
145 * Message message for showing.
146 */
147 // $notice->classes( 'upsale', 'notice is-dismissible ' );
148 // $notice->message( 'upsale', '<p>' . __( 'Thank you for relying on EmbedPress with 60,000 other websites. Checkout our Pro features.', $notice->text_domain ) . '</p>' );
149
150 // // Update Notice For PRO Version
151 // if ( $this->is_pro_active() && \version_compare( get_embedpress_pro_version(), '2.0.0', '<' ) ) {
152 // $notice->classes( 'update', 'notice is-dismissible ' );
153 // $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>', 'embedpress' ) . '</p>' );
154 // $notice->thumbnail( 'update', plugins_url( 'assets/images/icon-128x128.png', EMBEDPRESS_PLUGIN_BASENAME ) );
155 // }
156
157 // if ( \version_compare( EMBEDPRESS_VERSION, '3.0.0', '=' ) ) {
158 // $notice->classes( 'update', 'notice is-dismissible ' );
159 // $notice->message( 'update', '<p>' . __( 'EmbedPress 3.0 is here with new features and options, read the details <a href="https://wpdeveloper.com/introducing-embedpress-3.0" target="_blank">here</a>, and check the new setting page. <a href="'. admin_url('admin.php?page=embedpress') .'">Click Here.</a>', 'embedpress' ) . '</p>' );
160 // $notice->thumbnail( 'update', plugins_url( 'assets/images/icon-128x128.png', EMBEDPRESS_PLUGIN_BASENAME ) );
161 // }
162
163 // $notice->upsale_args = array(
164 // 'href' => 'https://embedpress.com/?utm_source=plugin&utm_medium=free&utm_campaign=pro_upgrade#pricing',
165 // 'btn_text' => __( 'Learn More', 'embedpress' ),
166 // );
167
168 // $notice->options_args = array(
169 // 'notice_will_show' => [
170 // 'update' => $notice->timestamp,
171 // 'opt_in' => $notice->makeTime( $notice->timestamp, '3 Day' ),
172 // 'upsale' => $notice->makeTime( $notice->timestamp, '14 Day' ),
173 // 'review' => $notice->makeTime( $notice->timestamp, '7 Day' ), // after 3 days
174 // ],
175 // );
176 }
177
178 public function is_pro_active() {
179 return is_plugin_active( 'embedpress-pro/embedpress-pro.php' );
180 }
181
182 /**
183 * Show Admin notice when one of embedpress old plugin active
184 *
185 * @since 2.4.0
186 */
187 public function embedpress_admin_notice() {
188
189 }
190
191 }
192