Shortcodes and extra features for Phlox theme - Version 2.9.22

Version Description

Download this release

Release Info

Developer averta
Plugin Icon 128x128 Shortcodes and extra features for Phlox theme
Version 2.9.22
Comparing to
See all releases

Code changes from version 2.9.21 to 2.9.22

README.txt CHANGED
@@ -7,7 +7,7 @@ Tags: phlox, gallery, elementor, auxin, averta, auxin-elements, framework, widge
7
  Requires PHP: 5.4
8
  Requires at least: 4.6
9
  Tested up to: 6.0.1
10
- Stable tag: 2.9.21
11
  License: GPLv3
12
  License URI: http://www.gnu.org/licenses/gpl.html
13
 
7
  Requires PHP: 5.4
8
  Requires at least: 4.6
9
  Tested up to: 6.0.1
10
+ Stable tag: 2.9.22
11
  License: GPLv3
12
  License URI: http://www.gnu.org/licenses/gpl.html
13
 
admin/assets/js/plugins.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Phlox Core Plugin - v2.9.21 (2022-08)
2
  * All required javascript plugins for admin
3
  * http://phlox.pro/
4
  * Place any jQuery/helper plugins in here, instead of separate, slower script files!
1
+ /*! Phlox Core Plugin - v2.9.22 (2022-08)
2
  * All required javascript plugins for admin
3
  * http://phlox.pro/
4
  * Place any jQuery/helper plugins in here, instead of separate, slower script files!
admin/includes/classes/class-auxin-upgrader-http-api.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Auxin_Upgrader_Http_Api {
4
+
5
+ protected $api = 'http://api.averta.net/envato/items/';
6
+
7
+ public function __construct(){}
8
+
9
+ /**
10
+ * Get single setting value
11
+ *
12
+ * @param string $option
13
+ * @param string $section
14
+ * @param string $default
15
+ * @return string
16
+ */
17
+ private function get_setting( $option, $section, $default = '' ) {
18
+ $options = get_site_option( $section );
19
+
20
+ if ( isset( $options[$option] ) ) {
21
+ return $options[$option];
22
+ }
23
+ return $default;
24
+ }
25
+
26
+ /**
27
+ * Make a wordpress remote post request on averta API
28
+ *
29
+ * @param array $args
30
+ * @return void
31
+ */
32
+ private function remote_post( $args ){
33
+ global $wp_version;
34
+
35
+ $request_string = array(
36
+ 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo('url'),
37
+ 'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30: 3),
38
+ 'body' => $args
39
+ );
40
+
41
+ // Start checking for an update
42
+ $request = wp_remote_post( $this->api, $request_string );
43
+
44
+ if ( is_wp_error( $request ) || wp_remote_retrieve_response_code( $request ) !== 200 ) {
45
+ return false;
46
+ }
47
+
48
+ return $request;
49
+ }
50
+
51
+ /**
52
+ * Get our non official items list
53
+ *
54
+ * @return array
55
+ */
56
+ private function get_non_official_items(){
57
+ return apply_filters( 'auxin_set_non_official_items', array(
58
+ '3909293' => 'phlox-pro',
59
+ '3909293-03' => 'auxin-shop',
60
+ '3909293-04' => 'auxin-the-news',
61
+ '3909293-05' => 'auxin-pro-tools',
62
+ '3909293-06' => 'masterslider-wp',
63
+ '3909293-07' => 'js_composer',
64
+ '3909293-08' => 'bdthemes-element-pack',
65
+ '3909293-09' => 'Ultimate_VC_Addons',
66
+ '3909293-10' => 'waspthemes-yellow-pencil',
67
+ '3909293-11' => 'LayerSlider',
68
+ '3909293-12' => 'revslider',
69
+ '3909293-13' => 'go_pricing',
70
+ '3909293-14' => 'convertplug'
71
+ ) );
72
+ }
73
+
74
+ /**
75
+ * Get download link from averta API
76
+ *
77
+ * @return void
78
+ */
79
+ public function get_download_link( $key ){
80
+
81
+ $token = $this->get_setting( 'token' , AUXELS_PURCHASE_KEY );
82
+ $token = empty( $token ) ? $this->get_setting( 'token' , THEME_ID . '_license' ) : $token;
83
+
84
+ if( empty( $token ) ) {
85
+ return new WP_Error( 'no_credentials',
86
+ __( 'Envato username, API key and your item purchase code are required for downloading updates from Envato marketplace.', 'auxin-elements' )
87
+ );
88
+ }
89
+
90
+ $items = $this->get_non_official_items();
91
+
92
+ if( ! in_array( $key, $items ) ) {
93
+ return new WP_Error( 'no_credentials',
94
+ '"' . $key . '" ' . __( 'Is not exist in our non official list. ', 'auxin-elements' )
95
+ );
96
+ }
97
+ $item_ID = array_search( $key, $items );
98
+
99
+ $request = $this->remote_post( array(
100
+ 'cat' => 'download-purchase',
101
+ 'action' => 'token',
102
+ 'item-id' => $item_ID,
103
+ 'token' => $token,
104
+ 'url' => get_site_url()
105
+ ) );
106
+
107
+ if( $request === false ){
108
+ return new WP_Error( 'process_faild',
109
+ __( 'Error in getting download link.', 'auxin-elements' )
110
+ );
111
+ }
112
+
113
+ $response = wp_remote_retrieve_body( $request );
114
+ $response = json_decode( $response, true );
115
+
116
+ if( ! isset( $response['download_url'] ) || empty( $response['download_url'] ) ) {
117
+ // Envato API error ..
118
+ return new WP_Error( 'no_credentials',
119
+ __( 'Error on connecting to download API...', 'auxin-elements' )
120
+ );
121
+ }
122
+
123
+ return $response['download_url'];
124
+ }
125
+
126
+ }
admin/includes/classes/class-auxin-upgrader-prepare.php CHANGED
@@ -13,6 +13,9 @@ class Auxin_Upgrader_Prepare {
13
  'themes' => 'update_themes'
14
  );
15
 
 
 
 
16
  public function __construct(){
17
 
18
  add_action( 'load-plugins.php', array( $this, 'update_plugins' ) );
@@ -26,6 +29,9 @@ class Auxin_Upgrader_Prepare {
26
  add_action( 'wp_update_themes', array( $this, 'update_themes' ) );
27
 
28
  add_action( 'admin_init', array( $this, 'maybe_update_list' ) );
 
 
 
29
  }
30
 
31
  /**
@@ -371,4 +377,219 @@ class Auxin_Upgrader_Prepare {
371
  return self::$instance;
372
  }
373
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
374
  }
13
  'themes' => 'update_themes'
14
  );
15
 
16
+ // todo: remove this line after a while
17
+ protected $api = 'http://api.averta.net/envato/items/';
18
+
19
  public function __construct(){
20
 
21
  add_action( 'load-plugins.php', array( $this, 'update_plugins' ) );
29
  add_action( 'wp_update_themes', array( $this, 'update_themes' ) );
30
 
31
  add_action( 'admin_init', array( $this, 'maybe_update_list' ) );
32
+
33
+ // todo: remove this hooks after a while
34
+ add_action( 'plugins_loaded', [ $this, 'updater' ] );
35
  }
36
 
37
  /**
377
  return self::$instance;
378
  }
379
 
380
+ // todo: remove code from this line to the end of file after a while - remove class-auxin-upgrader-http-api.php file too
381
+ /**
382
+ * auto updater hooks
383
+ *
384
+ * @return void
385
+ */
386
+ public function updater() {
387
+ if ( class_exists( 'AUXPRO_Upgrader_Prepare' ) ) {
388
+ return;
389
+ }
390
+
391
+ add_filter( 'site_transient_update_plugins', array( $this, 'disable_update_plugins' ) );
392
+ add_filter( 'site_transient_update_themes', array( $this, 'disable_update_themes' ) );
393
+
394
+ add_action( 'admin_init', [ $this, 'init_api_request_instance' ] );
395
+ add_filter ( 'pre_set_site_transient_update_themes', [ $this, 'pre_set_transient_update_theme' ] );
396
+ add_filter( 'auxin_before_setting_update_themes_transient', [ $this, 'update_themes_transient' ], 10, 2 );
397
+ add_filter( 'auxin_before_setting_update_plugins_transient', [ $this, 'update_plugins_transient' ], 10, 2 );
398
+
399
+ add_filter( 'auxin_modify_package_before_upgrade', [ $this, 'modify_package' ] );
400
+ }
401
+
402
+ /**
403
+ * Remove auxin plugins from wp auto update
404
+ *
405
+ * @return object
406
+ */
407
+ public function disable_update_plugins( $transient ) {
408
+ // Pass plugins list with their slug e.g. array( 'auxin-elements' )
409
+ $plugins = apply_filters( 'auxin_disable_plugins_updates', array() );
410
+ if ( isset($transient) && is_object($transient) && ! empty( $plugins ) ) {
411
+ foreach ( $plugins as $key => $plugin ) {
412
+ $plugin_path = $plugin . '/' . $plugin . '.php';
413
+ if ( isset( $transient->response[$plugin_path] ) ) {
414
+ unset( $transient->response[$plugin_path] );
415
+ }
416
+ }
417
+ }
418
+ return $transient;
419
+ }
420
+
421
+ /**
422
+ * Remove auxin themes from wp auto update
423
+ *
424
+ * @return object
425
+ */
426
+ public function disable_update_themes( $transient ) {
427
+ // Pass themes list with their slug e.g. array( 'phlox' )
428
+ $themes = apply_filters( 'auxin_disable_themes_updates', array() );
429
+ if ( isset($transient) && is_object($transient) && ! empty( $themes ) ) {
430
+ foreach ( $themes as $theme ) {
431
+ if ( isset( $transient->response[ $theme ] ) ) {
432
+ unset( $transient->response[ $theme ] );
433
+ }
434
+ }
435
+ }
436
+ return $transient;
437
+ }
438
+
439
+ /**
440
+ * Initialize api request upgrader
441
+ *
442
+ * @return void
443
+ */
444
+ public function init_api_request_instance() {
445
+ $this->api_request = new Auxin_Upgrader_Http_Api();
446
+ }
447
+
448
+ /**
449
+ * General remote get function
450
+ *
451
+ * @param array $request_args
452
+ * @return void
453
+ */
454
+ public function remote_get( $request_args ){
455
+ $url = add_query_arg(
456
+ $request_args,
457
+ $this->api
458
+ );
459
+
460
+ $request = wp_remote_get( $url );
461
+
462
+ if ( is_wp_error( $request ) ) {
463
+ return false;
464
+ }
465
+
466
+ return wp_remote_retrieve_body( $request );
467
+ }
468
+
469
+ /**
470
+ * Check theme versions against the latest versions hosted on Averta API
471
+ *
472
+ * @return object $new_option
473
+ */
474
+ public function update_themes_transient( $new_option, $themes ) {
475
+ foreach ( $themes as $slug => $data ) {
476
+
477
+ if( !$data->isOfficial ) {
478
+ // Get version number of our api
479
+ $new_version = $this->remote_get( array(
480
+ 'cat' => 'version-check',
481
+ 'action' => 'final',
482
+ 'item-name' => sanitize_key( $slug )
483
+ ) );
484
+
485
+ if( ! empty( $new_version ) && version_compare( $new_version, $data->get( 'Version' ), '>' ) ){
486
+ $new_option->response[ $data->get_stylesheet() ] = array(
487
+ 'slug' => esc_sql($slug),
488
+ 'version' => esc_sql($new_version),
489
+ 'package' => 'AUXIN_GET_DOWNLOAD_URL'
490
+ );
491
+ }
492
+ }
493
+
494
+ }
495
+
496
+ return $new_option;
497
+ }
498
+
499
+ /**
500
+ * Check plugin versions against the latest versions hosted on Averta API
501
+ *
502
+ * @return object $new_option
503
+ */
504
+ public function update_plugins_transient( $new_option, $plugins ) {
505
+
506
+ foreach ( $plugins as $path => $data ) {
507
+ $slug = dirname( $path );
508
+
509
+ if( !$data['isOfficial'] ) {
510
+
511
+ // Get version number of our api
512
+ $new_version = $this->remote_get( array(
513
+ 'cat' => 'version-check',
514
+ 'action' => 'final',
515
+ 'item-name' => sanitize_key( $slug )
516
+ ) );
517
+
518
+ if( ! empty( $new_version ) && version_compare( $new_version, $data['Version'], '>' ) ){
519
+ $new_option->response[ $path ] = array(
520
+ 'slug' => esc_sql($slug),
521
+ 'version' => esc_sql($new_version),
522
+ 'package' => 'AUXIN_GET_DOWNLOAD_URL'
523
+ );
524
+ }
525
+ }
526
+ }
527
+
528
+ return $new_option;
529
+ }
530
+
531
+ /**
532
+ * Upgrade theme through wordpress built in upgrader system
533
+ *
534
+ * @param object $transient
535
+ * @return object $transient
536
+ */
537
+ public function pre_set_transient_update_theme( $transient ) {
538
+
539
+ if( empty( $transient->checked ) ) {
540
+ return $transient;
541
+ }
542
+
543
+ $get_themes = $this->get_themes();
544
+ $api_request = new Auxin_Upgrader_Http_Api;
545
+ foreach ( $get_themes as $slug => $data ) {
546
+
547
+ if( !$data->isOfficial ) {
548
+
549
+ // Get version number of our api
550
+ $new_version = $this->remote_get( array(
551
+ 'cat' => 'version-check',
552
+ 'action' => 'final',
553
+ 'item-name' => sanitize_key( $slug )
554
+ ) );
555
+
556
+ if( ! empty( $new_version ) && version_compare( $new_version, $data->get( 'Version' ), '>' ) ){
557
+ $downlaod_link = $api_request->get_download_link( $slug );
558
+ if( is_wp_error( $downlaod_link ) ){
559
+ continue;
560
+ }
561
+ $transient->response[ $data->get_stylesheet() ] = array(
562
+ 'slug' => esc_sql($slug),
563
+ 'version' => $data->get( 'Version' ),
564
+ 'new_version' => esc_sql($new_version),
565
+ 'package' => $downlaod_link
566
+ );
567
+ }
568
+ }
569
+
570
+ }
571
+
572
+ return $transient;
573
+ }
574
+
575
+
576
+ /**
577
+ * Modify package url of premium plugins
578
+ *
579
+ * @param array $r
580
+ * @return array $r
581
+ */
582
+ public function modify_package( $r ) {
583
+
584
+ if( ! wp_http_validate_url( $r['package'] ) && $r['package'] == 'AUXIN_GET_DOWNLOAD_URL' ){
585
+ $r['slug'] = ( $r['slug'] == 'masterslider' ) ? 'masterslider-wp' : $r['slug'];
586
+ $downlaod_link = $this->api_request->get_download_link( $r['slug'] );
587
+ if( ! is_wp_error( $downlaod_link ) ){
588
+ $r['package'] = $downlaod_link;
589
+ }
590
+ }
591
+
592
+ return $r;
593
+ }
594
+
595
  }
auxin-elements.php CHANGED
@@ -12,7 +12,7 @@
12
  * Plugin Name: Phlox Core Elements
13
  * Plugin URI: https://wordpress.org/plugins/auxin-elements/
14
  * Description: Exclusive and comprehensive plugin that extends the functionality of Phlox theme by adding new Elements, widgets and options.
15
- * Version: 2.9.21
16
  * Author: averta
17
  * Author URI: http://averta.net
18
  * Text Domain: auxin-elements
12
  * Plugin Name: Phlox Core Elements
13
  * Plugin URI: https://wordpress.org/plugins/auxin-elements/
14
  * Description: Exclusive and comprehensive plugin that extends the functionality of Phlox theme by adding new Elements, widgets and options.
15
+ * Version: 2.9.22
16
  * Author: averta
17
  * Author URI: http://averta.net
18
  * Text Domain: auxin-elements
includes/define.php CHANGED
@@ -12,7 +12,7 @@ if( ! defined( 'THEME_NAME' ) ){
12
  }
13
 
14
 
15
- define( 'AUXELS_VERSION' , '2.9.21' );
16
 
17
  define( 'AUXELS_SLUG' , 'auxin-elements' );
18
 
12
  }
13
 
14
 
15
+ define( 'AUXELS_VERSION' , '2.9.22' );
16
 
17
  define( 'AUXELS_SLUG' , 'auxin-elements' );
18
 
languages/auxin-elements-fa_IR.po CHANGED
@@ -2,7 +2,7 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Auxin Essential Elements\n"
4
  "Report-Msgid-Bugs-To: http://averta.net/phlox/wordpress-theme/\n"
5
- "POT-Creation-Date: 2022-08-01 16:03:47+00:00\n"
6
  "PO-Revision-Date: 2016-11-09 12:50+0330\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
@@ -408,6 +408,24 @@ msgstr ""
408
  msgid "Update failed."
409
  msgstr ""
410
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
411
  #: admin/includes/metaboxes/metabox-fields-general-advanced.php:21
412
  #, fuzzy
413
  msgid "Advanced Setting"
2
  msgstr ""
3
  "Project-Id-Version: Auxin Essential Elements\n"
4
  "Report-Msgid-Bugs-To: http://averta.net/phlox/wordpress-theme/\n"
5
+ "POT-Creation-Date: 2022-08-02 09:14:20+00:00\n"
6
  "PO-Revision-Date: 2016-11-09 12:50+0330\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
408
  msgid "Update failed."
409
  msgstr ""
410
 
411
+ #: admin/includes/classes/class-auxin-upgrader-http-api.php:86
412
+ msgid ""
413
+ "Envato username, API key and your item purchase code are required for "
414
+ "downloading updates from Envato marketplace."
415
+ msgstr ""
416
+
417
+ #: admin/includes/classes/class-auxin-upgrader-http-api.php:94
418
+ msgid "Is not exist in our non official list. "
419
+ msgstr ""
420
+
421
+ #: admin/includes/classes/class-auxin-upgrader-http-api.php:109
422
+ msgid "Error in getting download link."
423
+ msgstr ""
424
+
425
+ #: admin/includes/classes/class-auxin-upgrader-http-api.php:119
426
+ msgid "Error on connecting to download API..."
427
+ msgstr ""
428
+
429
  #: admin/includes/metaboxes/metabox-fields-general-advanced.php:21
430
  #, fuzzy
431
  msgid "Advanced Setting"
languages/auxin-elements.pot CHANGED
@@ -1,9 +1,9 @@
1
  # Averta Copyright (c) {2022}
2
  msgid ""
3
  msgstr ""
4
- "Project-Id-Version: Phlox Core Elements 2.9.21\n"
5
  "Report-Msgid-Bugs-To: http://averta.net/phlox/wordpress-theme/\n"
6
- "POT-Creation-Date: 2022-08-01 16:03:47+00:00\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=utf-8\n"
9
  "Content-Transfer-Encoding: 8bit\n"
@@ -389,6 +389,24 @@ msgstr ""
389
  msgid "Update failed."
390
  msgstr ""
391
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
392
  #: admin/includes/metaboxes/metabox-fields-general-advanced.php:21
393
  msgid "Advanced Setting"
394
  msgstr ""
1
  # Averta Copyright (c) {2022}
2
  msgid ""
3
  msgstr ""
4
+ "Project-Id-Version: Phlox Core Elements 2.9.22\n"
5
  "Report-Msgid-Bugs-To: http://averta.net/phlox/wordpress-theme/\n"
6
+ "POT-Creation-Date: 2022-08-02 09:14:20+00:00\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=utf-8\n"
9
  "Content-Transfer-Encoding: 8bit\n"
389
  msgid "Update failed."
390
  msgstr ""
391
 
392
+ #: admin/includes/classes/class-auxin-upgrader-http-api.php:86
393
+ msgid ""
394
+ "Envato username, API key and your item purchase code are required for "
395
+ "downloading updates from Envato marketplace."
396
+ msgstr ""
397
+
398
+ #: admin/includes/classes/class-auxin-upgrader-http-api.php:94
399
+ msgid "Is not exist in our non official list. "
400
+ msgstr ""
401
+
402
+ #: admin/includes/classes/class-auxin-upgrader-http-api.php:109
403
+ msgid "Error in getting download link."
404
+ msgstr ""
405
+
406
+ #: admin/includes/classes/class-auxin-upgrader-http-api.php:119
407
+ msgid "Error on connecting to download API..."
408
+ msgstr ""
409
+
410
  #: admin/includes/metaboxes/metabox-fields-general-advanced.php:21
411
  msgid "Advanced Setting"
412
  msgstr ""
public/assets/js/plugins.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Phlox Core Plugin - v2.9.21 (2022-08)
2
  * All required plugins
3
  * http://phlox.pro/
4
  */
1
+ /*! Phlox Core Plugin - v2.9.22 (2022-08)
2
  * All required plugins
3
  * http://phlox.pro/
4
  */
public/class-auxels.php CHANGED
@@ -96,9 +96,7 @@ class AUXELS {
96
  }
97
 
98
  // Load admin spesific codes
99
- else {
100
- $this->admin = include( AUXELS_ADMIN_DIR . '/class-auxels-admin.php' );
101
- }
102
 
103
  // Load Frontend Functionality
104
  } else {
96
  }
97
 
98
  // Load admin spesific codes
99
+ $this->admin = include( AUXELS_ADMIN_DIR . '/class-auxels-admin.php' );
 
 
100
 
101
  // Load Frontend Functionality
102
  } else {