PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.5.13
Shortcodes and extra features for Phlox theme v2.5.13
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-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
475 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 if( ! defined('THEME_PRO') || ! THEME_PRO ) {
46 add_filter( 'auxin_admin_welcome_sections', array( $this, 'add_section_go_pro' ), 120 );
47 add_action( 'auxin_admin_before_welcome_section_content', array( $this, 'maybe_add_dashboard_notice') );
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 echo Auxin_Dashboard_Notice::get_instance()->get_notice( 'auxels-notice-info-dashboard' );
119 }
120
121 /**
122 * Adds a new section to welcome page
123 *
124 * @param array $sections
125 */
126 public function add_section_plugins( $sections ){
127
128 $sections['plugins'] = array(
129 'label' => esc_html__( 'Plugins', 'auxin-elements' ),
130 'description' => '',
131 'callback' => 'setup_plugins',
132 'add_admin_menu' => true
133 );
134
135 return $sections;
136 }
137
138 /**
139 * Adds a new section to welcome page
140 *
141 * @param array $sections
142 */
143 public function add_section_feedback( $sections ){
144
145 $sections['feedback'] = array(
146 'label' => __( 'Feedback', 'auxin-elements' ),
147 'description' => '',
148 'callback' => array( $this, 'render_feedback' )
149 );
150
151 return $sections;
152 }
153
154 /**
155 * Adds a new section to welcome page
156 *
157 * @param array $sections
158 */
159 public function add_section_status( $sections ){
160
161 $system_notices = Auxels_System_Check::get_instance()->get_num_of_notices();
162 $system_check = $system_notices ? sprintf(' <span class = "update-plugins count-%1$s"><span class="update-count">%1$s</span></span>', $system_notices ) : '';
163
164 $sections['status'] = array(
165 'label' => __( 'System Status', 'auxin-elements' ) . $system_check,
166 'description' => '',
167 'url' => admin_url( 'site-health.php' ), // optional
168 );
169
170 return $sections;
171 }
172
173 /**
174 * Adds a new section to welcome page
175 *
176 * @param array $sections
177 */
178 public function add_section_go_pro( $sections ){
179
180 $sections['go_pro'] = array(
181 'label' => esc_html__( 'Go Pro', 'auxin-elements' ),
182 'description' => '',
183 '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
184 'target' => '_blank',
185 'image' => AUXELS_ADMIN_URL . '/assets/images/welcome/rocket-pro.gif',
186 'add_admin_menu' => true
187 );
188
189 return $sections;
190 }
191
192 function render_feedback(){
193 // the previous rate of the client
194 $previous_rate = auxin_get_option( 'user_rating' );
195
196 $support_tab_url = self_admin_url( 'admin.php?page=auxin-welcome&tab=help' );
197 ?>
198
199 <div class="feature-section aux-welcome-page-feedback">
200 <div class="aux-section-content-box">
201
202 <div class="aux-columns-wrap">
203 <div class="aux-image-wrap"></div>
204 <div class="aux-form-wrap">
205 <form class="aux-feedback-form" action="<?php echo admin_url( 'admin.php?page=auxin-welcome&tab=feedback'); ?>" method="post" >
206
207 <div class="aux-rating-section">
208 <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>
209 <div class="aux-theme-ratings">
210 <?php
211 for( $i = 1; $i <= 10; $i++ ){
212 printf(
213 '<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>',
214 $i, checked( $previous_rate, $i, false )
215 );
216 }
217 ?>
218
219 </div>
220 <div class="aux-ratings-measure">
221 <p><?php _e( "Don't like it", 'auxin-elements' ); ?></p>
222 <p><?php _e( "Like it so much", 'auxin-elements' ); ?></p>
223 </div>
224 </div>
225
226 <div class="aux-feedback-section aux-hide">
227 <div class="aux-notice-box aux-notice-blue aux-rate-us-offer aux-hide">
228 <img src="<?php echo AUXELS_ADMIN_URL.'/assets/images/welcome/rate-like.svg'; ?>" />
229 <p><?php printf(
230 __('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.'),
231 '<a href="http://phlox.pro/rate/'.THEME_ID.'" target="_black">',
232 '</a>'
233 ); ?>
234 </p>
235 </div>
236 <h3 class="aux-feedback-form-title aux-content-title"><?php _e('Please explain why you gave this score (optional)', 'auxin-elements'); ?></h3>
237 <h4 class="aux-feedback-form-subtitle">
238 <?php
239 printf( __( 'Please do not use this form to get support, in this case please check the %s help section %s', 'auxin-elements' ),
240 '<a href="' .$this->welcome->get_tab_link('help'). '">', '</a>' ); ?>
241 </h4>
242 <textarea placeholder="Enter your feedback here" rows="10" name="feedback" class="large-text"></textarea>
243 <input type="text" placeholder="Email address (Optional)" name="email" class="text-input" />
244 <?php wp_nonce_field( 'phlox_feedback' ); ?>
245
246 <input type="submit" class="aux-wl-button aux-round aux-blue aux-wide" value="<?php esc_attr_e( 'Submit', 'auxin-elements' ); ?>" />
247
248 <div class="aux-sending-status">
249 <img class="ajax-progress aux-hide" src="<?php echo AUXIN_URL; ?>/css/images/elements/saving.gif" />
250 <span class="ajax-response aux-hide" ><?php _e( 'Submitting your feedback ..', 'auxin-elements' ); ?></span>
251 </div>
252
253 </div>
254
255 <?php $this->send_feedback_mail(); ?>
256 </form>
257 </div>
258 </div>
259 </div>
260 </div>
261
262 <?php
263 }
264
265
266 private function send_feedback_mail(){
267 if ( ! ( ! isset( $_POST['phlox_feedback'] ) || ! wp_verify_nonce( $_POST['phlox_feedback'], 'feedback_send') ) ) {
268
269 $email = ! empty( $_POST["email"] ) ? sanitize_email( $_POST["email"] ) : 'Empty';
270 $feedback = ! empty( $_POST["feedback"] ) ? esc_textarea( $_POST["feedback"] ) : '';
271
272 if( $feedback ){
273 wp_mail( 'info@averta.net', 'feedback from phlox dashboard', $feedback . chr(0x0D).chr(0x0A) . 'Email: ' . $email );
274 $text = __( 'Thanks for your feedback', 'auxin-elements' );
275 } else{
276 $text = __('Please try again and fill up at least the feedback field.', 'auxin-elements');
277 }
278
279 printf('<p class="notification">%s</p>', $text);
280 }
281 }
282
283
284 /**
285 * Display changelogs on welcome page
286 *
287 * @param string $tab The tab that we intent to append this section to.
288 * @return void
289 */
290 function append_changelog( $tab ){
291
292 if( 'dashboard' !== $tab ){
293 return;
294 }
295
296 // sanitize the theme id
297 $theme_id = sanitize_key( THEME_ID );
298
299 $changelog_cache_id = "auxin_cache_remote_changelog__{$theme_id}";
300
301 // get remote changelog
302 if( ( false === $changelog_info = get_transient( $changelog_cache_id ) ) || isset( $_GET['flush_transient'] ) ){
303
304 $changelog_remote = $this->get_remote_changelog( $theme_id );
305
306 if( is_wp_error( $changelog_remote ) ){
307 echo $changelog_remote->get_error_message();
308 return;
309 } else {
310 $changelog_info = $changelog_remote;
311 set_transient( $changelog_cache_id, $changelog_remote, 2 * HOUR_IN_SECONDS );
312 }
313
314 }
315
316 // print the changelog
317 if( $changelog_info ){ ?>
318 <div class="aux-changelog-wrap">
319 <div class="aux-changelog-header">
320 <h2><?php _e( 'Changelog', 'auxin-elements' ); ?></h2>
321 <div class="aux-welcome-socials">
322 <span><?php _e('Follow Us', 'auxin-elements' ); ?></span>
323 <div class="aux-welcome-social-items">
324 <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>
325 <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>
326 <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>
327 <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>
328 <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>
329 </div>
330 <ul>
331
332 </ul>
333 </div>
334 </div>
335 <div class="aux-changelog-content">
336 <div class="aux-changelog-list"><?php echo $changelog_info; ?></div>
337 </div>
338 </div>
339 <?php
340 }
341
342 }
343
344
345 /**
346 * Display video tutorials on welcome page
347 *
348 * @param string $tab The tab that we intent to append this section to.
349 * @return void
350 */
351 function append_tutorials( $tab ){
352
353 if( 'help' !== $tab ){ return; }
354 $video_list = $this->get_video_tutorial_list();
355 ?>
356 <div class="aux-setup-content">
357 <div class="aux-video-list aux-grid-list aux-isotope-list" >
358
359 <?php foreach ( $video_list as $video_id => $video_title ) { ?>
360 <div class="aux-grid-item aux-iso-item grid_4" >
361 <div class="aux-grid-item-inner">
362 <div class="aux-grid-item-media">
363 <iframe width="440" height="248" src="https://www.youtube-nocookie.com/embed/<?php echo $video_id; ?>?rel=0&amp;showinfo=0"
364 frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
365 </div>
366 <div class="aux-grid-item-footer">
367 <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>
368 </div>
369 </div>
370 </div>
371 <?php } ?>
372
373 </div>
374 </div>
375 <?php
376 }
377
378 /**
379 * Collect the plugin filters
380 *
381 * @return array plugin filters
382 */
383 private function get_video_tutorial_list(){
384 if( empty( $this->tutorial_list ) ){
385 $this->tutorial_list = apply_filters( 'auxin_admin_welcome_video_tutorial_list', array() );
386 }
387
388 return $this->tutorial_list;
389 }
390
391 /**
392 * Collect the video tutorilas
393 *
394 * @return array video tutorilas list
395 */
396 public function add_video_tutorial_list( $list ){
397
398 $new_list = array(
399 'W8jkMN7EEdo' => 'Installing Phlox Pro',
400 'porrf6QgjuU' => 'Configuring Menu General Options',
401 'irSajN7JXQQ' => 'Customizing Header Menu',
402 'AU6qT84scSY' => 'Adding a Burger Menu',
403 'gVm9EJ6BrAI' => 'Customizing Post Formats',
404 'YkXKxgWruDk' => 'Customizing Post Options',
405 'UIVE7ZWbSoI' => 'Displaying Blog Slider',
406 'b37PUx76ejc' => 'Customizing Blog Page Options',
407 '09pnnTaYAto' => 'Organizing Blog with Category',
408 'NJDnhbI23P4' => 'Displaying About Author Box',
409 'W-nqEKUk0Ss' => 'Displaying Related Posts on Blog',
410 'qNVie3fELr4' => 'Customizing Page Options',
411 'QutPg4W642A' => 'Creating Different Pages with Custom Pages',
412 '8GiqLqtsWrU' => 'Configuring Layout and Design Options',
413 'IWj6vbnjrUE' => 'Specifying Content and Titles Typography',
414 'hNU85eRLCQg' => 'Customizing Header Section',
415 'mo7hiMIQvv0' => 'Adding a Scroll to Top Button',
416 'SefEG3KOYcI' => 'Customizing the Background',
417 'RzVFT4UxXtw' => 'Customizing Audio and Video Player',
418 'J3GO3Lt22dw' => 'Adding a Frame for Your Website',
419 'DueARmwq1q4' => 'Customizing Footer Area',
420 'w65-HRbMvMo' => 'Displaying Subfooter',
421 'SOcYs6wJsao' => 'Displaying Subfooter Bar',
422 'bcQS7iol000' => 'Customizing your Website Login Page',
423 'Pi9121CAGgY' => 'Adding Custom CSS and JavaScript',
424 //'A96MVeK1RCc' => 'Installing Phlox Pro',
425 'kYh0z4jo6jM' => 'Creating Audio with Elementor',
426 'DiiVuwhNwnU' => 'Creating Button with Elementor',
427 'oi7R8iLRvCo' => 'Creating Video with Elementor',
428 'gveFqSpfcQQ' => 'Creating Contact Form with Elementor',
429 'ZKMypryYnto' => 'Creating Map with Elementor',
430 'sOVsUu-2DHw' => 'Contact Box with Elementor'
431 );
432
433 return array_merge( $list, $new_list );
434 }
435
436 /**
437 * Retrieves the changelog remotely
438 *
439 * @param string $item_name The name of the project that we intend to get the info of
440 * @return string The changelog context
441 */
442 private function get_remote_changelog( $item_name = '' ){
443
444 if( empty( $item_name ) ){
445 $item_name = THEME_ID;
446 }
447
448 global $wp_version;
449
450 $args = array(
451 'user-agent' => 'WordPress/'. $wp_version.'; '. get_site_url(),
452 'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 10 ),
453 'body' => array(
454 'action' => 'text',
455 'cat' => 'changelog',
456 'item-name' => $item_name,
457 'content' => 'list',
458 'view' => 'html',
459 'limit' => 5
460 )
461 );
462
463 $request = wp_remote_get( 'http://api.averta.net/envato/items/', $args );
464
465 if ( is_wp_error( $request ) || wp_remote_retrieve_response_code( $request ) !== 200 ) {
466 return new WP_Error( 'no_response', 'Error while receiving remote data' );
467 }
468
469 $response = $request['body'];
470
471 return $response;
472 }
473
474 }
475