PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.6.0
Shortcodes and extra features for Phlox theme v2.6.0
2.17.21 2.17.20 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.6 1.0.9 1.1.0 1.3.0 1.3.1 1.3.10 1.3.14 1.3.2 1.3.3 1.3.6 1.4.0 1.4.1 1.4.2 1.5.0 1.5.2 1.6.0 1.6.2 1.6.4 1.7.0 1.7.2 2.10.0 2.10.1 2.10.3 2.10.5 2.10.7 2.10.8 2.10.9 2.11.0 2.11.1 2.11.2 2.12.0 2.14.0 2.15.0 2.15.2 2.15.4 2.15.5 2.15.6 2.15.7 2.15.8 2.15.9 2.16.0 2.16.1 2.16.2 2.16.3 2.16.4 2.17.0 2.17.1 2.17.12 2.17.13 2.17.14 2.17.15 2.17.16 2.17.2 2.17.3 2.17.4 2.17.5 2.17.6 2.17.8 2.17.9 2.4.12 2.4.13 2.4.14 2.4.16 2.4.18 2.4.19 2.4.9 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.14 2.5.15 2.5.16 2.5.17 2.5.19 2.5.2 2.5.20 2.5.3 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.10 2.6.12 2.6.13 2.6.14 2.6.15 2.6.16 2.6.17 2.6.19 2.6.2 2.6.20 2.6.4 2.6.5 2.6.7 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 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 2.8.9 2.9.0 2.9.12 2.9.14 2.9.15 2.9.16 2.9.17 2.9.18 2.9.19 2.9.2 2.9.20 2.9.21 2.9.22 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8
auxin-elements / includes / classes / class-auxin-welcome-sections.php
auxin-elements / includes / classes Last commit date
class-auxels-admin-assets.php 6 years ago class-auxels-archive-menu-links.php 6 years ago class-auxels-envato-elements.php 6 years ago class-auxels-import-parser.php 8 years ago class-auxels-import.php 6 years ago class-auxels-search-post-type.php 6 years ago class-auxin-admin-dashboard.php 6 years ago class-auxin-demo-importer.php 6 years ago class-auxin-dependency-sorting.php 8 years ago class-auxin-import.php 6 years ago class-auxin-install.php 6 years ago class-auxin-master-nav-menu-admin.php 6 years ago class-auxin-page-template.php 6 years ago class-auxin-permalink.php 6 years ago class-auxin-plugin-requirements.php 6 years ago class-auxin-post-type-base.php 6 years ago class-auxin-siteorigin-widget.php 6 years ago class-auxin-svg-support-allowedattributes.php 7 years ago class-auxin-svg-support-allowedtags.php 7 years ago class-auxin-svg-support.php 7 years ago class-auxin-walker-nav-menu-back.php 6 years ago class-auxin-welcome-sections.php 6 years ago class-auxin-welcome.php 6 years ago class-auxin-whitelabel.php 6 years ago class-auxin-widget-indie.php 6 years ago class-auxin-widget-shortcode-map.php 6 years ago class-auxin-widget.php 6 years ago
class-auxin-welcome-sections.php
477 lines
1 <?php
2
3
4 class Auxin_Welcome_Sections {
5
6 /**
7 * Instance of this class.
8 *
9 * @var object
10 */
11 protected static $instance = null;
12
13 /**
14 * Instance of main welcome class.
15 *
16 * @var object
17 */
18 public $welcome = null;
19
20 /**
21 * The slug name to refer to this menu
22 *
23 * @since 1.0
24 *
25 * @var string
26 */
27 public $page_slug;
28
29 /**
30 * List of video tutorilas.
31 *
32 * @var array
33 */
34 protected $tutorial_list = null;
35
36
37 function __construct(){;
38 add_filter( 'auxin_admin_welcome_sections', array( $this, 'add_section_importer' ), 60 );
39 add_filter( 'auxin_admin_welcome_sections', array( $this, 'add_section_templates'), 65 );
40 add_filter( 'auxin_admin_welcome_sections', array( $this, 'add_section_plugins' ), 70 );
41 add_filter( 'auxin_admin_welcome_sections', array( $this, 'add_section_feedback' ), 100 );
42 add_filter( 'auxin_admin_welcome_sections', array( $this, 'add_section_status' ), 110 );
43 add_filter( 'auxin_admin_welcome_sections', array( $this, 'add_section_updates' ), 120 );
44
45 add_action( 'auxin_admin_before_welcome_section_content', array( $this, 'maybe_add_dashboard_notice') );
46 if( ! defined('THEME_PRO') || ! THEME_PRO ) {
47 add_filter( 'auxin_admin_welcome_sections', array( $this, 'add_section_go_pro' ), 120 );
48 }
49
50 add_action( 'auxin_admin_after_welcome_section_content' , array( $this, 'append_changelog') );
51 add_action( 'auxin_admin_after_welcome_section_content' , array( $this, 'append_tutorials') );
52
53 add_filter( 'auxin_admin_welcome_video_tutorial_list' , array( $this, 'add_video_tutorial_list' ) );
54 }
55
56 /**
57 * Return an instance of this class.
58 *
59 * @return object A single instance of this class.
60 */
61 public static function get_instance() {
62
63 // If the single instance hasn't been set, set it now.
64 if ( null == self::$instance ) {
65 self::$instance = new self;
66 }
67
68 return self::$instance;
69 }
70
71
72 /*-----------------------------------------------------------------------------------*/
73 /* Adds demos tab in theme about (welcome) page
74 /*-----------------------------------------------------------------------------------*/
75
76 public function add_section_updates( $sections ){
77 $total_updates = function_exists('auxin_get_total_updates') ? auxin_get_total_updates() : 0;
78 $update_count = $total_updates ? sprintf(' <span class = "update-plugins count-%1$s"><span class="update-count">%1$s</span></span>', $total_updates ) : '';
79
80 $sections['updates'] = array(
81 'label' => esc_html__( 'Updates', 'auxin-elements' ) . $update_count,
82 'description' => '',
83 'callback' => 'setup_updates',
84 'add_admin_menu' => $total_updates ? true : false
85 );
86
87 return $sections;
88 }
89
90 public function add_section_templates( $sections ){
91
92 $sections['templates'] = array(
93 'label' => esc_html__( 'Template Kits', 'auxin-elements' ),
94 'description' => '',
95 'callback' => 'setup_templates',
96 'add_admin_menu' => true
97 );
98
99 return $sections;
100 }
101
102 public function add_section_importer( $sections ){
103
104 if( ! empty( $sections['importer'] ) ){
105 $sections['importer']['callback'] = 'setup_importer';
106 $sections['importer']['add_admin_menu'] = true;
107 }
108
109 return $sections;
110 }
111
112 /**
113 * Adds a notice after dashboard navigation
114 *
115 * @param array $sections
116 */
117 public function maybe_add_dashboard_notice( $sections ){
118 $api_id = ( defined('THEME_PRO' ) && THEME_PRO ) ? '3' : '4';
119 $style = array( 'display' => 'block !important' );
120 Auxin_Notices::get_ads_notices( $api_id, $style, 'no-updated' );
121 }
122
123 /**
124 * Adds a new section to welcome page
125 *
126 * @param array $sections
127 */
128 public function add_section_plugins( $sections ){
129
130 $sections['plugins'] = array(
131 'label' => esc_html__( 'Plugins', 'auxin-elements' ),
132 'description' => '',
133 'callback' => 'setup_plugins',
134 'add_admin_menu' => true
135 );
136
137 return $sections;
138 }
139
140 /**
141 * Adds a new section to welcome page
142 *
143 * @param array $sections
144 */
145 public function add_section_feedback( $sections ){
146
147 $sections['feedback'] = array(
148 'label' => __( 'Feedback', 'auxin-elements' ),
149 'description' => '',
150 'callback' => array( $this, 'render_feedback' )
151 );
152
153 return $sections;
154 }
155
156 /**
157 * Adds a new section to welcome page
158 *
159 * @param array $sections
160 */
161 public function add_section_status( $sections ){
162
163 $system_notices = Auxels_System_Check::get_instance()->get_num_of_notices();
164 $system_check = $system_notices ? sprintf(' <span class = "update-plugins count-%1$s"><span class="update-count">%1$s</span></span>', $system_notices ) : '';
165
166 $sections['status'] = array(
167 'label' => __( 'System Status', 'auxin-elements' ) . $system_check,
168 'description' => '',
169 'url' => admin_url( 'site-health.php' ), // optional
170 );
171
172 return $sections;
173 }
174
175 /**
176 * Adds a new section to welcome page
177 *
178 * @param array $sections
179 */
180 public function add_section_go_pro( $sections ){
181
182 $sections['go_pro'] = array(
183 'label' => esc_html__( 'Go Pro', 'auxin-elements' ),
184 'description' => '',
185 'url' => esc_url( 'http://phlox.pro/go-pro/?utm_source=phlox-welcome&utm_medium=phlox-free&utm_campaign=phlox-go-pro&utm_content=welcome-tab' ), // optional
186 'target' => '_blank',
187 'image' => AUXELS_ADMIN_URL . '/assets/images/welcome/rocket-pro.gif',
188 'add_admin_menu' => true
189 );
190
191 return $sections;
192 }
193
194 function render_feedback(){
195 // the previous rate of the client
196 $previous_rate = auxin_get_option( 'user_rating' );
197
198 $support_tab_url = self_admin_url( 'admin.php?page=auxin-welcome&tab=help' );
199 ?>
200
201 <div class="feature-section aux-welcome-page-feedback">
202 <div class="aux-section-content-box">
203
204 <div class="aux-columns-wrap">
205 <div class="aux-image-wrap"></div>
206 <div class="aux-form-wrap">
207 <form class="aux-feedback-form" action="<?php echo admin_url( 'admin.php?page=auxin-welcome&tab=feedback'); ?>" method="post" >
208
209 <div class="aux-rating-section">
210 <h3 class="aux-content-title"><?php echo wp_sprintf( __( 'How likely are you to recommend %s to a friend?', THEME_DOMAIN ), THEME_NAME_I18N ) ?></h3>
211 <div class="aux-theme-ratings">
212 <?php
213 for( $i = 1; $i <= 10; $i++ ){
214 printf(
215 '<div class="aux-rate-cell"><input type="radio" name="theme_rate" id="theme-rating%1$s" value="%1$s" %2$s/><label class="rating" for="theme-rating%1$s">%1$s</label></div>',
216 $i, checked( $previous_rate, $i, false )
217 );
218 }
219 ?>
220
221 </div>
222 <div class="aux-ratings-measure">
223 <p><?php _e( "Don't like it", 'auxin-elements' ); ?></p>
224 <p><?php _e( "Like it so much", 'auxin-elements' ); ?></p>
225 </div>
226 </div>
227
228 <div class="aux-feedback-section aux-hide">
229 <div class="aux-notice-box aux-notice-blue aux-rate-us-offer aux-hide">
230 <img src="<?php echo AUXELS_ADMIN_URL.'/assets/images/welcome/rate-like.svg'; ?>" />
231 <p><?php printf(
232 __('Thanks for using Phlox theme. If you are enjoying this theme, please support us by %s submitting 5 star rate here%s. That would be a huge help for us to continue developing this theme.'),
233 '<a href="http://phlox.pro/rate/'.THEME_ID.'" target="_black">',
234 '</a>'
235 ); ?>
236 </p>
237 </div>
238 <h3 class="aux-feedback-form-title aux-content-title"><?php _e('Please explain why you gave this score (optional)', 'auxin-elements'); ?></h3>
239 <h4 class="aux-feedback-form-subtitle">
240 <?php
241 printf( __( 'Please do not use this form to get support, in this case please check the %s help section %s', 'auxin-elements' ),
242 '<a href="' .$this->welcome->get_tab_link('help'). '">', '</a>' ); ?>
243 </h4>
244 <textarea placeholder="Enter your feedback here" rows="10" name="feedback" class="large-text"></textarea>
245 <input type="text" placeholder="Email address (Optional)" name="email" class="text-input" />
246 <?php wp_nonce_field( 'phlox_feedback' ); ?>
247
248 <input type="submit" class="aux-wl-button aux-round aux-blue aux-wide" value="<?php esc_attr_e( 'Submit', 'auxin-elements' ); ?>" />
249
250 <div class="aux-sending-status">
251 <img class="ajax-progress aux-hide" src="<?php echo AUXIN_URL; ?>/css/images/elements/saving.gif" />
252 <span class="ajax-response aux-hide" ><?php _e( 'Submitting your feedback ..', 'auxin-elements' ); ?></span>
253 </div>
254
255 </div>
256
257 <?php $this->send_feedback_mail(); ?>
258 </form>
259 </div>
260 </div>
261 </div>
262 </div>
263
264 <?php
265 }
266
267
268 private function send_feedback_mail(){
269 if ( ! ( ! isset( $_POST['phlox_feedback'] ) || ! wp_verify_nonce( $_POST['phlox_feedback'], 'feedback_send') ) ) {
270
271 $email = ! empty( $_POST["email"] ) ? sanitize_email( $_POST["email"] ) : 'Empty';
272 $feedback = ! empty( $_POST["feedback"] ) ? esc_textarea( $_POST["feedback"] ) : '';
273
274 if( $feedback ){
275 wp_mail( 'info@averta.net', 'feedback from phlox dashboard', $feedback . chr(0x0D).chr(0x0A) . 'Email: ' . $email );
276 $text = __( 'Thanks for your feedback', 'auxin-elements' );
277 } else{
278 $text = __('Please try again and fill up at least the feedback field.', 'auxin-elements');
279 }
280
281 printf('<p class="notification">%s</p>', $text);
282 }
283 }
284
285
286 /**
287 * Display changelogs on welcome page
288 *
289 * @param string $tab The tab that we intent to append this section to.
290 * @return void
291 */
292 function append_changelog( $tab ){
293
294 if( 'dashboard' !== $tab ){
295 return;
296 }
297
298 // sanitize the theme id
299 $theme_id = sanitize_key( THEME_ID );
300
301 $changelog_cache_id = "auxin_cache_remote_changelog__{$theme_id}";
302
303 // get remote changelog
304 if( ( false === $changelog_info = get_transient( $changelog_cache_id ) ) || isset( $_GET['flush_transient'] ) ){
305
306 $changelog_remote = $this->get_remote_changelog( $theme_id );
307
308 if( is_wp_error( $changelog_remote ) ){
309 echo $changelog_remote->get_error_message();
310 return;
311 } else {
312 $changelog_info = $changelog_remote;
313 set_transient( $changelog_cache_id, $changelog_remote, 2 * HOUR_IN_SECONDS );
314 }
315
316 }
317
318 // print the changelog
319 if( $changelog_info ){ ?>
320 <div class="aux-changelog-wrap">
321 <div class="aux-changelog-header">
322 <h2><?php _e( 'Changelog', 'auxin-elements' ); ?></h2>
323 <div class="aux-welcome-socials">
324 <span><?php _e('Follow Us', 'auxin-elements' ); ?></span>
325 <div class="aux-welcome-social-items">
326 <a href="http://www.twitter.com/averta_ltd" class="aux-social-item aux-social-twitter" target="_blank" title="<?php _e('Follow us on Twitter', 'auxin-elements' ); ?>"></a>
327 <a href="http://www.facebook.com/averta" class="aux-social-item aux-social-facebook" target="_blank" title="<?php _e('Follow us on Facebook', 'auxin-elements' ); ?>"></a>
328 <a href="https://www.instagram.com/averta.co/" class="aux-social-item aux-social-instagram"target="_blank" title="<?php _e('Follow us on Instagram', 'auxin-elements' ); ?>"></a>
329 <a href="https://themeforest.net/user/averta" class="aux-social-item aux-social-envato" target="_blank" title="<?php _e('Follow us on Envato', 'auxin-elements' ); ?>"></a>
330 <a href="https://www.youtube.com/playlist?list=PL7X-1Jmy1jcdekHe6adxB81SBcrHOmLRS" class="aux-social-item aux-social-youtube" target="_blank" title="<?php _e('Subscribe to Phlox YouTube channel', 'auxin-elements' ); ?>"></a>
331 </div>
332 <ul>
333
334 </ul>
335 </div>
336 </div>
337 <div class="aux-changelog-content">
338 <div class="aux-changelog-list"><?php echo $changelog_info; ?></div>
339 </div>
340 </div>
341 <?php
342 }
343
344 }
345
346
347 /**
348 * Display video tutorials on welcome page
349 *
350 * @param string $tab The tab that we intent to append this section to.
351 * @return void
352 */
353 function append_tutorials( $tab ){
354
355 if( 'help' !== $tab ){ return; }
356 $video_list = $this->get_video_tutorial_list();
357 ?>
358 <div class="aux-setup-content">
359 <div class="aux-video-list aux-grid-list aux-isotope-list" >
360
361 <?php foreach ( $video_list as $video_id => $video_title ) { ?>
362 <div class="aux-grid-item aux-iso-item grid_4" >
363 <div class="aux-grid-item-inner">
364 <div class="aux-grid-item-media">
365 <iframe width="440" height="248" src="https://www.youtube-nocookie.com/embed/<?php echo $video_id; ?>?rel=0&amp;showinfo=0"
366 frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
367 </div>
368 <div class="aux-grid-item-footer">
369 <a class="aux-grid-footer-text-link" href="<?php echo esc_url( 'https://youtu.be/'. $video_id ); ?>" target="_blank"><h3><?php echo esc_html( $video_title ); ?><span class="dashicons dashicons-external"></span></h3></a>
370 </div>
371 </div>
372 </div>
373 <?php } ?>
374
375 </div>
376 </div>
377 <?php
378 }
379
380 /**
381 * Collect the plugin filters
382 *
383 * @return array plugin filters
384 */
385 private function get_video_tutorial_list(){
386 if( empty( $this->tutorial_list ) ){
387 $this->tutorial_list = apply_filters( 'auxin_admin_welcome_video_tutorial_list', array() );
388 }
389
390 return $this->tutorial_list;
391 }
392
393 /**
394 * Collect the video tutorilas
395 *
396 * @return array video tutorilas list
397 */
398 public function add_video_tutorial_list( $list ){
399
400 $new_list = array(
401 'W8jkMN7EEdo' => 'Installing Phlox Pro',
402 'porrf6QgjuU' => 'Configuring Menu General Options',
403 'irSajN7JXQQ' => 'Customizing Header Menu',
404 'AU6qT84scSY' => 'Adding a Burger Menu',
405 'gVm9EJ6BrAI' => 'Customizing Post Formats',
406 'YkXKxgWruDk' => 'Customizing Post Options',
407 'UIVE7ZWbSoI' => 'Displaying Blog Slider',
408 'b37PUx76ejc' => 'Customizing Blog Page Options',
409 '09pnnTaYAto' => 'Organizing Blog with Category',
410 'NJDnhbI23P4' => 'Displaying About Author Box',
411 'W-nqEKUk0Ss' => 'Displaying Related Posts on Blog',
412 'qNVie3fELr4' => 'Customizing Page Options',
413 'QutPg4W642A' => 'Creating Different Pages with Custom Pages',
414 '8GiqLqtsWrU' => 'Configuring Layout and Design Options',
415 'IWj6vbnjrUE' => 'Specifying Content and Titles Typography',
416 'hNU85eRLCQg' => 'Customizing Header Section',
417 'mo7hiMIQvv0' => 'Adding a Scroll to Top Button',
418 'SefEG3KOYcI' => 'Customizing the Background',
419 'RzVFT4UxXtw' => 'Customizing Audio and Video Player',
420 'J3GO3Lt22dw' => 'Adding a Frame for Your Website',
421 'DueARmwq1q4' => 'Customizing Footer Area',
422 'w65-HRbMvMo' => 'Displaying Subfooter',
423 'SOcYs6wJsao' => 'Displaying Subfooter Bar',
424 'bcQS7iol000' => 'Customizing your Website Login Page',
425 'Pi9121CAGgY' => 'Adding Custom CSS and JavaScript',
426 //'A96MVeK1RCc' => 'Installing Phlox Pro',
427 'kYh0z4jo6jM' => 'Creating Audio with Elementor',
428 'DiiVuwhNwnU' => 'Creating Button with Elementor',
429 'oi7R8iLRvCo' => 'Creating Video with Elementor',
430 'gveFqSpfcQQ' => 'Creating Contact Form with Elementor',
431 'ZKMypryYnto' => 'Creating Map with Elementor',
432 'sOVsUu-2DHw' => 'Contact Box with Elementor'
433 );
434
435 return array_merge( $list, $new_list );
436 }
437
438 /**
439 * Retrieves the changelog remotely
440 *
441 * @param string $item_name The name of the project that we intend to get the info of
442 * @return string The changelog context
443 */
444 private function get_remote_changelog( $item_name = '' ){
445
446 if( empty( $item_name ) ){
447 $item_name = THEME_ID;
448 }
449
450 global $wp_version;
451
452 $args = array(
453 'user-agent' => 'WordPress/'. $wp_version.'; '. get_site_url(),
454 'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 10 ),
455 'body' => array(
456 'action' => 'text',
457 'cat' => 'changelog',
458 'item-name' => $item_name,
459 'content' => 'list',
460 'view' => 'html',
461 'limit' => 5
462 )
463 );
464
465 $request = wp_remote_get( 'http://api.averta.net/envato/items/', $args );
466
467 if ( is_wp_error( $request ) || wp_remote_retrieve_response_code( $request ) !== 200 ) {
468 return new WP_Error( 'no_response', 'Error while receiving remote data' );
469 }
470
471 $response = $request['body'];
472
473 return $response;
474 }
475
476 }
477