Advanced AJAX Product Filters - Version 1.3.2.7

Version Description

  • Fix - Links to BeRocket
  • Fix - Compatibility with other BeRocket plugins
  • Fix - Categories default sorting is not working
  • Fix - Remove some php notices
  • Fix - Reset in above products position break other filters
  • Fix - Tax rates option for price
Download this release

Release Info

Developer RazyRx
Plugin Icon wp plugin Advanced AJAX Product Filters
Version 1.3.2.7
Comparing to
See all releases

Code changes from version 1.3.2.5 to 1.3.2.7

berocket/assets/css/admin.css CHANGED
@@ -101,7 +101,7 @@
101
  .berocket_framework_sidebar_save_button {
102
  height: 50px;
103
  }
104
- .berocket_framework_sidebar_save_button .button-primary.button {
105
  display: none;
106
  padding: 9px 0;
107
  margin: 0;
@@ -315,7 +315,7 @@
315
  text-align: left;
316
  }
317
 
318
- .br_framework_settings .button {
319
  margin-top: 30px;
320
  margin-bottom: 20px;
321
  color: #fff;
@@ -339,7 +339,7 @@
339
  height: auto;
340
  }
341
 
342
- .br_framework_settings .button.tiny-button {
343
  padding: 2px 13px;
344
  min-width: 40px;
345
  font-size: 13px;
@@ -388,7 +388,7 @@
388
  margin: 0.5em 0;
389
  }
390
 
391
- .br_framework_settings .berocket_select_fontawesome .button {
392
  margin-top: 10px;
393
  margin-bottom: 10px;
394
  }
@@ -410,7 +410,7 @@
410
  text-align: center;
411
  }
412
 
413
- .br_framework_settings .berocket_select_fontawesome.berocket_select_image .button {
414
  margin: 29px 0.5em 29px 0;
415
  }
416
 
@@ -593,22 +593,23 @@
593
  background: #efefef;
594
  }
595
 
596
- .br_framework_settings .berocket_products_search li.button {
597
  line-height: 26px;
598
  padding: 0 10px;
599
  max-width: 600px;
600
  overflow: hidden;
 
601
  }
602
- .br_framework_settings .single_product .berocket_products_search li.button {
603
  max-width: initial;
604
  width: 100%;
605
  }
606
 
607
  /* ----------------- */
608
 
609
- .br_framework_settings .button:hover,
610
- .br_framework_settings .button:focus,
611
- .br_framework_settings .button:active{
612
  background: #00beb0 none repeat scroll 0 0;
613
  color: white;
614
  }
@@ -786,13 +787,13 @@
786
  text-decoration: none;
787
  }
788
 
789
- .br_framework_settings .button.accent {
790
  background: #ff5252 none repeat scroll 0 0;
791
  }
792
 
793
- .br_framework_settings .button.accent:hover,
794
- .br_framework_settings .button.accent:focus,
795
- .br_framework_settings .button.accent:active {
796
  background: #ff6e68 none repeat scroll 0 0;
797
  color: white;
798
  }
@@ -1476,10 +1477,10 @@
1476
  margin-bottom: 0.5em;
1477
  background-color: #eee;
1478
  }
1479
- .br_framework_settings .button.berocket_remove_condition,
1480
- .br_framework_settings .button.berocket_add_condition,
1481
- .br_framework_settings .button.br_remove_group,
1482
- .br_framework_settings .button.br_add_group {
1483
  padding: 0 10px;
1484
  margin: 0;
1485
  width: initial;
@@ -1490,3 +1491,7 @@
1490
  padding: 2px 10px;
1491
  cursor: move;
1492
  }
 
 
 
 
101
  .berocket_framework_sidebar_save_button {
102
  height: 50px;
103
  }
104
+ .berocket_framework_sidebar_save_button .button-primary.button:not(.not_berocket_button) {
105
  display: none;
106
  padding: 9px 0;
107
  margin: 0;
315
  text-align: left;
316
  }
317
 
318
+ .br_framework_settings .button:not(.not_berocket_button) {
319
  margin-top: 30px;
320
  margin-bottom: 20px;
321
  color: #fff;
339
  height: auto;
340
  }
341
 
342
+ .br_framework_settings .button.tiny-button:not(.not_berocket_button) {
343
  padding: 2px 13px;
344
  min-width: 40px;
345
  font-size: 13px;
388
  margin: 0.5em 0;
389
  }
390
 
391
+ .br_framework_settings .berocket_select_fontawesome .button:not(.not_berocket_button) {
392
  margin-top: 10px;
393
  margin-bottom: 10px;
394
  }
410
  text-align: center;
411
  }
412
 
413
+ .br_framework_settings .berocket_select_fontawesome.berocket_select_image .button:not(.not_berocket_button) {
414
  margin: 29px 0.5em 29px 0;
415
  }
416
 
593
  background: #efefef;
594
  }
595
 
596
+ .br_framework_settings .berocket_products_search li.button:not(.not_berocket_button) {
597
  line-height: 26px;
598
  padding: 0 10px;
599
  max-width: 600px;
600
  overflow: hidden;
601
+ margin: 0;
602
  }
603
+ .br_framework_settings .single_product .berocket_products_search li.button:not(.not_berocket_button) {
604
  max-width: initial;
605
  width: 100%;
606
  }
607
 
608
  /* ----------------- */
609
 
610
+ .br_framework_settings .button:not(.not_berocket_button):hover,
611
+ .br_framework_settings .button:not(.not_berocket_button):focus,
612
+ .br_framework_settings .button:not(.not_berocket_button):active{
613
  background: #00beb0 none repeat scroll 0 0;
614
  color: white;
615
  }
787
  text-decoration: none;
788
  }
789
 
790
+ .br_framework_settings .button.accent:not(.not_berocket_button) {
791
  background: #ff5252 none repeat scroll 0 0;
792
  }
793
 
794
+ .br_framework_settings .button.accent:not(.not_berocket_button):hover,
795
+ .br_framework_settings .button.accent:not(.not_berocket_button):focus,
796
+ .br_framework_settings .button.accent:not(.not_berocket_button):active {
797
  background: #ff6e68 none repeat scroll 0 0;
798
  color: white;
799
  }
1477
  margin-bottom: 0.5em;
1478
  background-color: #eee;
1479
  }
1480
+ .br_framework_settings .button.berocket_remove_condition:not(.not_berocket_button),
1481
+ .br_framework_settings .button.berocket_add_condition:not(.not_berocket_button),
1482
+ .br_framework_settings .button.br_remove_group:not(.not_berocket_button),
1483
+ .br_framework_settings .button.br_add_group:not(.not_berocket_button) {
1484
  padding: 0 10px;
1485
  margin: 0;
1486
  width: initial;
1491
  padding: 2px 10px;
1492
  cursor: move;
1493
  }
1494
+
1495
+ .account_key_send.br_framework_settings .button.tiny-button {
1496
+ margin: 0;
1497
+ }
berocket/assets/css/global-admin.css CHANGED
@@ -23,6 +23,9 @@
23
  .current .berocket_admin_menu_custom_post_submenu:before {
24
  background: transparent url('../images/submenu-icon-a.png') top left/cover;
25
  }
 
 
 
26
  .berocket_debug_errors {
27
  margin-top: 60px;
28
  }
23
  .current .berocket_admin_menu_custom_post_submenu:before {
24
  background: transparent url('../images/submenu-icon-a.png') top left/cover;
25
  }
26
+ .berocket_admin_menu_custom_post_submenu_upgrade {
27
+ color: #77e038;
28
+ }
29
  .berocket_debug_errors {
30
  margin-top: 60px;
31
  }
berocket/assets/js/admin.js CHANGED
@@ -15,7 +15,7 @@ var br_something_changed = false;
15
  br_something_changed = true;
16
  });
17
  }, 250);
18
- $('.br_framework_submit_form').submit( function(event) {
19
  event.preventDefault();
20
  if( !br_savin_ajax ) {
21
  var br_reload_page = $(this).is('.br_reload_form');
15
  br_something_changed = true;
16
  });
17
  }, 250);
18
+ $(document).on('submit', '.br_framework_submit_form', function(event) {
19
  event.preventDefault();
20
  if( !br_savin_ajax ) {
21
  var br_reload_page = $(this).is('.br_reload_form');
berocket/framework.php CHANGED
@@ -34,7 +34,7 @@ if( ! class_exists( 'BeRocket_Framework' ) ) {
34
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
35
  load_plugin_textdomain('BeRocket_domain', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/');
36
  class BeRocket_Framework {
37
- public static $framework_version = '2.5';
38
  public static $settings_name = '';
39
  public $addons;
40
  public $libraries;
@@ -70,7 +70,7 @@ if( ! class_exists( 'BeRocket_Framework' ) ) {
70
  $this->cc = $child; // Child Class object
71
  do_action('BeRocket_framework_init_plugin', $this->cc->info);
72
  $this->plugin_version_capability = apply_filters('brfr_plugin_version_capability_'.$this->cc->info['plugin_name'], $this->plugin_version_capability, $this);
73
- if( $this->plugin_version_capability == 15 ) {
74
  $is_active_plugin = get_transient( 'berocket_framework_plugin_is_active_'.$this->info['id'] );
75
  if( $is_active_plugin === false || is_admin() ) {
76
  $active_plugin = get_option( 'berocket_key_activated_plugins' );
@@ -96,6 +96,7 @@ if( ! class_exists( 'BeRocket_Framework' ) ) {
96
  if ( $this->cc->init_validation() ) {
97
  add_action( 'init', array( $this->cc, 'init' ) );
98
  add_action( 'wp_head', array( $this->cc, 'set_styles' ) );
 
99
  add_action( 'admin_init', array( $this->cc, 'admin_init' ) );
100
  add_action( 'admin_menu', array( $this->cc, 'admin_menu' ) );
101
  add_action( 'admin_enqueue_scripts', array( $this->cc, 'admin_enqueue_scripts' ) );
@@ -243,6 +244,7 @@ if( ! class_exists( 'BeRocket_Framework' ) ) {
243
  $plugin = array(
244
  'id' => $this->info['id'],
245
  'name' => $this->info['name'],
 
246
  'free_slug' => $this->values['free_slug'],
247
  );
248
  $plugins[$this->info['id']] = $plugin;
@@ -269,24 +271,29 @@ if( ! class_exists( 'BeRocket_Framework' ) ) {
269
  public function plugin_row_meta( $links, $file ) {
270
  $plugin_base_slug = plugin_basename( $this->cc->info[ 'plugin_file' ] );
271
  if ( $file == $plugin_base_slug ) {
 
 
 
 
 
272
  $row_meta = array(
273
  'docs' => '<a href="https://berocket.com/docs/plugin/' .
274
- $this->cc->values[ 'premium_slug' ] . '" title="' .
275
  __( 'View Plugin Documentation', 'BeRocket_domain' ) .
276
  '" target="_blank">' . __( 'Docs', 'BeRocket_domain' ) . '</a>',
277
  );
278
  if( ! empty($this->plugin_version_capability) && $this->plugin_version_capability == 3 ) {
279
  if( ! empty($this->cc->values[ 'free_slug' ]) ) {
280
  $row_meta['support'] = '<a href="https://wordpress.org/support/plugin/' . $this->cc->values[ 'free_slug' ] .
281
- '/" title="' . __( 'View Support Page', 'BeRocket_domain' ) .
282
  '" target="_blank">' . __( 'Support', 'BeRocket_domain' ) . '</a>';
283
  }
284
  } elseif( ! empty($this->plugin_version_capability) && $this->plugin_version_capability > 10 ) {
285
- $row_meta['premium'] = '<a href="https://berocket.com/support/product/' . $this->cc->values[ 'premium_slug' ] .
286
  '" title="' . __( 'View Premium Support Page', 'BeRocket_domain' ) .
287
  '" target="_blank">' . __( 'Premium Support', 'BeRocket_domain' ) . '</a>';
288
  } else {
289
- $row_meta['premium'] = '<a href="https://berocket.com/product/' . $this->cc->values[ 'premium_slug' ] .
290
  '" title="' . __( 'View Premium Version Page', 'BeRocket_domain' ) .
291
  '" target="_blank">' . __( 'Premium Version', 'BeRocket_domain' ) . '</a>';
292
  }
@@ -363,6 +370,40 @@ if( ! class_exists( 'BeRocket_Framework' ) ) {
363
  $options = $this->get_option();
364
  echo '<style>' . $options[ 'custom_css' ] . '</style>';
365
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
366
 
367
  /**
368
  * Function adding styles/scripts and settings to admin_init WordPress action
@@ -740,28 +781,33 @@ if( ! class_exists( 'BeRocket_Framework' ) ) {
740
  }
741
 
742
  if( ! $setup_style['hide_header'] ) {
 
 
 
 
 
743
  echo "
744
  <header>
745
  <div class='br_logo_white'>
746
- <a href='https://berocket.com/products/' title='BeRocket' target='_blank'><img src='" . ( plugins_url( 'assets/images/br_logo_white.png', __FILE__ ) ) . "' /></a>
747
  </div>
748
  <nav class='premium'>";
749
  if( ! $setup_style['hide_header_links'] ) {
750
  $header_links = array(
751
  'documentation' => array(
752
  'text' => "<i class='fa fa-book'></i>",
753
- 'link' => apply_filters('brfr_docs_link_' . $setup_style['name_for_filters'], "https://berocket.com/docs/plugin/{$this->cc->values['premium_slug']}" )
754
  )
755
  );
756
- if( ! empty($this->plugin_version_capability) && $this->plugin_version_capability > 5 ) {
757
  $header_links['support'] = array(
758
  'text' => "<i class='fa fa-support'></i>",
759
- 'link' => apply_filters('brfr_support_link_' . $setup_style['name_for_filters'], "https://berocket.com/support/product/{$this->cc->values['premium_slug']}" )
760
  );
761
  } elseif( ! empty($this->cc->values['free_slug']) ) {
762
  $header_links['support'] = array(
763
  'text' => "<i class='fa fa-support'></i>",
764
- 'link' => apply_filters('brfr_support_link_' . $setup_style['name_for_filters'], "https://wordpress.org/support/plugin/{$this->cc->values['free_slug']}" )
765
  );
766
  }
767
  $header_links = apply_filters('brfr_header_links_' . $setup_style['name_for_filters'], $header_links);
@@ -800,7 +846,11 @@ if( ! class_exists( 'BeRocket_Framework' ) ) {
800
  echo '</form>';
801
  }
802
  if( ! $setup_style['hide_additional_blocks'] ) {
803
- require_once( plugin_dir_path( __FILE__ ) . 'templates/premium.php');
 
 
 
 
804
  }
805
  echo '</div>';
806
  echo '<div class="clear-both"></div>';
34
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
35
  load_plugin_textdomain('BeRocket_domain', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/');
36
  class BeRocket_Framework {
37
+ public static $framework_version = '2.5.2';
38
  public static $settings_name = '';
39
  public $addons;
40
  public $libraries;
70
  $this->cc = $child; // Child Class object
71
  do_action('BeRocket_framework_init_plugin', $this->cc->info);
72
  $this->plugin_version_capability = apply_filters('brfr_plugin_version_capability_'.$this->cc->info['plugin_name'], $this->plugin_version_capability, $this);
73
+ if( $this->plugin_version_capability == 15 && is_admin() ) {
74
  $is_active_plugin = get_transient( 'berocket_framework_plugin_is_active_'.$this->info['id'] );
75
  if( $is_active_plugin === false || is_admin() ) {
76
  $active_plugin = get_option( 'berocket_key_activated_plugins' );
96
  if ( $this->cc->init_validation() ) {
97
  add_action( 'init', array( $this->cc, 'init' ) );
98
  add_action( 'wp_head', array( $this->cc, 'set_styles' ) );
99
+ add_action( 'wp_footer', array( $this->cc, 'set_scripts' ), 9000 );
100
  add_action( 'admin_init', array( $this->cc, 'admin_init' ) );
101
  add_action( 'admin_menu', array( $this->cc, 'admin_menu' ) );
102
  add_action( 'admin_enqueue_scripts', array( $this->cc, 'admin_enqueue_scripts' ) );
244
  $plugin = array(
245
  'id' => $this->info['id'],
246
  'name' => $this->info['name'],
247
+ 'plugin_name' => $this->info['plugin_name'],
248
  'free_slug' => $this->values['free_slug'],
249
  );
250
  $plugins[$this->info['id']] = $plugin;
271
  public function plugin_row_meta( $links, $file ) {
272
  $plugin_base_slug = plugin_basename( $this->cc->info[ 'plugin_file' ] );
273
  if ( $file == $plugin_base_slug ) {
274
+ if( ! empty($this->plugin_version_capability) && $this->plugin_version_capability > 10 ) {
275
+ $meta_data = '?utm_source=paid_plugin&utm_medium=plugins&utm_campaign='.$this->info['plugin_name'];
276
+ } else {
277
+ $meta_data = '?utm_source=free_plugin&utm_medium=plugins&utm_campaign='.$this->info['plugin_name'];
278
+ }
279
  $row_meta = array(
280
  'docs' => '<a href="https://berocket.com/docs/plugin/' .
281
+ $this->cc->values[ 'premium_slug' ] . $meta_data . '" title="' .
282
  __( 'View Plugin Documentation', 'BeRocket_domain' ) .
283
  '" target="_blank">' . __( 'Docs', 'BeRocket_domain' ) . '</a>',
284
  );
285
  if( ! empty($this->plugin_version_capability) && $this->plugin_version_capability == 3 ) {
286
  if( ! empty($this->cc->values[ 'free_slug' ]) ) {
287
  $row_meta['support'] = '<a href="https://wordpress.org/support/plugin/' . $this->cc->values[ 'free_slug' ] .
288
+ '/' . $meta_data . '" title="' . __( 'View Support Page', 'BeRocket_domain' ) .
289
  '" target="_blank">' . __( 'Support', 'BeRocket_domain' ) . '</a>';
290
  }
291
  } elseif( ! empty($this->plugin_version_capability) && $this->plugin_version_capability > 10 ) {
292
+ $row_meta['premium'] = '<a href="https://berocket.com/support/product/' . $this->cc->values[ 'premium_slug' ] . $meta_data .
293
  '" title="' . __( 'View Premium Support Page', 'BeRocket_domain' ) .
294
  '" target="_blank">' . __( 'Premium Support', 'BeRocket_domain' ) . '</a>';
295
  } else {
296
+ $row_meta['premium'] = '<a href="https://berocket.com/product/' . $this->cc->values[ 'premium_slug' ] . $meta_data .
297
  '" title="' . __( 'View Premium Version Page', 'BeRocket_domain' ) .
298
  '" target="_blank">' . __( 'Premium Version', 'BeRocket_domain' ) . '</a>';
299
  }
370
  $options = $this->get_option();
371
  echo '<style>' . $options[ 'custom_css' ] . '</style>';
372
  }
373
+ public function set_scripts() {
374
+ $options = $this->get_option();
375
+ $javascript = br_get_value_from_array($options, array('javascript'));
376
+ $is_admin = current_user_can($this->option_page_capability());
377
+ if(is_array($javascript)) {
378
+ $html = '<script>';
379
+ foreach($javascript as $trigger => $script) {
380
+ $function_name = strtolower($this->info['plugin_name'] . '_' . $trigger);
381
+ $function_name = preg_replace("/[^a-z0-9_\s-]/", "", $function_name);
382
+ $function_name = 'brjst_' . preg_replace("/[\s_-]+/", "_", $function_name);
383
+ $html .= '
384
+ function '.$function_name.'() {
385
+ try {
386
+ '.$script.'
387
+ } catch(err){
388
+ ';
389
+ if( $is_admin ) {
390
+ $html .= 'alert("You have some incorrect custom JavaScript code (Plugin: '.$this->info['full_name'].', Trigger: '.$trigger.')");
391
+ console.log(err);';
392
+ }
393
+ $html .= '
394
+ }
395
+ };
396
+ ';
397
+ if( $trigger == 'load' ) {
398
+ $html .='jQuery(document).ready('.$function_name.');';
399
+ } else {
400
+ $html .='jQuery(document).on("'.$trigger.'", '.$function_name.');';
401
+ }
402
+ }
403
+ $html .= '</script>';
404
+ echo $html;
405
+ }
406
+ }
407
 
408
  /**
409
  * Function adding styles/scripts and settings to admin_init WordPress action
781
  }
782
 
783
  if( ! $setup_style['hide_header'] ) {
784
+ if( ! empty($this->plugin_version_capability) && $this->plugin_version_capability > 10 ) {
785
+ $meta_data = '?utm_source=paid_plugin&utm_medium=settings&utm_campaign='.$this->info['plugin_name'];
786
+ } else {
787
+ $meta_data = '?utm_source=free_plugin&utm_medium=settings&utm_campaign='.$this->info['plugin_name'];
788
+ }
789
  echo "
790
  <header>
791
  <div class='br_logo_white'>
792
+ <a href='https://berocket.com/products/{$meta_data}' title='BeRocket' target='_blank'><img src='" . ( plugins_url( 'assets/images/br_logo_white.png', __FILE__ ) ) . "' /></a>
793
  </div>
794
  <nav class='premium'>";
795
  if( ! $setup_style['hide_header_links'] ) {
796
  $header_links = array(
797
  'documentation' => array(
798
  'text' => "<i class='fa fa-book'></i>",
799
+ 'link' => apply_filters('brfr_docs_link_' . $setup_style['name_for_filters'], "https://berocket.com/docs/plugin/{$this->cc->values['premium_slug']}{$meta_data}" )
800
  )
801
  );
802
+ if( ! empty($this->plugin_version_capability) && $this->plugin_version_capability > 10 ) {
803
  $header_links['support'] = array(
804
  'text' => "<i class='fa fa-support'></i>",
805
+ 'link' => apply_filters('brfr_support_link_' . $setup_style['name_for_filters'], "https://berocket.com/support/product/{$this->cc->values['premium_slug']}{$meta_data}" )
806
  );
807
  } elseif( ! empty($this->cc->values['free_slug']) ) {
808
  $header_links['support'] = array(
809
  'text' => "<i class='fa fa-support'></i>",
810
+ 'link' => apply_filters('brfr_support_link_' . $setup_style['name_for_filters'], "https://wordpress.org/support/plugin/{$this->cc->values['free_slug']}{$meta_data}" )
811
  );
812
  }
813
  $header_links = apply_filters('brfr_header_links_' . $setup_style['name_for_filters'], $header_links);
846
  echo '</form>';
847
  }
848
  if( ! $setup_style['hide_additional_blocks'] ) {
849
+ if ( @ file_exists( plugin_dir_path( __FILE__ ) . '../templates/premium.php' ) ) {
850
+ require_once( plugin_dir_path( __FILE__ ) . '../templates/premium.php' );
851
+ } else {
852
+ require_once( plugin_dir_path( __FILE__ ) . 'templates/premium.php');
853
+ }
854
  }
855
  echo '</div>';
856
  echo '<div class="clear-both"></div>';
berocket/framework_version.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- $framework_version_current = '2.5';
3
  if( version_compare($framework_version_current, $framework_version, '>') ) {
4
  $framework_version = $framework_version_current;
5
  $framework_dir = __DIR__;
1
  <?php
2
+ $framework_version_current = '2.5.2';
3
  if( version_compare($framework_version_current, $framework_version, '>') ) {
4
  $framework_version = $framework_version_current;
5
  $framework_dir = __DIR__;
berocket/includes/admin_notices.php CHANGED
@@ -1076,6 +1076,7 @@ if( ! class_exists( 'berocket_admin_notices_rate_stars' ) ) {
1076
  foreach($plugins as $plugin) {
1077
  if( $plugin['id'] == $plugin_id ) {
1078
  add_action('admin_footer', array($this, 'wp_footer_js'));
 
1079
  $html .= '
1080
  <div class="berocket_feature_request berocket-feature-request berocket-feature-request-'.$plugin['id'].'">
1081
  <a class="berocket_feature_request_button" href="#feature_request"><img src="'.plugin_dir_url( __FILE__ ).'../assets/images/Feature-request.png" alt="Feature Request"></a>
@@ -1088,7 +1089,7 @@ if( ! class_exists( 'berocket_admin_notices_rate_stars' ) ) {
1088
  <textarea name="brfeature_description" placeholder="'.__('Feature Description', 'BeRocket_domain').'"></textarea>
1089
  <button class="berocket_feature_request_submit" type="submit">'.__('SEND FEATURE REQUEST', 'BeRocket_domain').'</button>
1090
  </form>
1091
- <div style="margin-bottom: 10px;">* <small>This form will be sended to <a target="_blank" href="https://berocket.com">berocket.com</a></small></div>
1092
  </div>
1093
  <div class="berocket_feature_request_thanks" style="display: none;">
1094
  <img src="'.plugin_dir_url( __FILE__ ).'../assets/images/Thank-you.png">';
1076
  foreach($plugins as $plugin) {
1077
  if( $plugin['id'] == $plugin_id ) {
1078
  add_action('admin_footer', array($this, 'wp_footer_js'));
1079
+ $meta_data = '?utm_source=free_plugin&utm_medium=plugins&utm_campaign='.$plugin['plugin_name'];
1080
  $html .= '
1081
  <div class="berocket_feature_request berocket-feature-request berocket-feature-request-'.$plugin['id'].'">
1082
  <a class="berocket_feature_request_button" href="#feature_request"><img src="'.plugin_dir_url( __FILE__ ).'../assets/images/Feature-request.png" alt="Feature Request"></a>
1089
  <textarea name="brfeature_description" placeholder="'.__('Feature Description', 'BeRocket_domain').'"></textarea>
1090
  <button class="berocket_feature_request_submit" type="submit">'.__('SEND FEATURE REQUEST', 'BeRocket_domain').'</button>
1091
  </form>
1092
+ <div style="margin-bottom: 10px;">* <small>This form will be sended to <a target="_blank" href="https://berocket.com' . $meta_data . '">berocket.com</a></small></div>
1093
  </div>
1094
  <div class="berocket_feature_request_thanks" style="display: none;">
1095
  <img src="'.plugin_dir_url( __FILE__ ).'../assets/images/Thank-you.png">';
berocket/includes/updater.php CHANGED
@@ -133,9 +133,12 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
133
  $account_keys_item = $item;
134
  continue;
135
  }
136
-
137
  if ( ! empty($compatibility_hack[ str_replace( "edit.php?post_type=", "", $item[ 2 ] ) ]) ) {
138
- $item[ 0 ] = "<span class='berocket_admin_menu_custom_post_submenu'>" . $item[ 0 ] . "</span>";
 
 
 
 
139
  $new_sub_order[ $compatibility_hack[ str_replace( "edit.php?post_type=", "", $item[ 2 ] ) ] ][] = $item;
140
  } else {
141
  $new_order_temp[] = $item;
@@ -207,70 +210,51 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
207
  if ( ! empty( $_GET[ 'page' ] ) && $_GET[ 'page' ] == 'berocket_account' ) {
208
  return $notices;
209
  }
 
 
210
 
211
- $plugin_count = get_option('berocket_updater_registered_plugins');
212
- update_option('berocket_updater_registered_plugins', count(self::$plugin_info));
213
- if( count(self::$plugin_info) != $plugin_count ) {
214
- $not_activated_notices = false;
215
- } else {
216
- if ( is_network_admin() ) {
217
- $not_activated_notices = get_site_transient( 'berocket_not_activated_notices_site' );
218
- } else {
219
- $not_activated_notices = get_transient( 'berocket_not_activated_notices' );
220
- }
221
  }
222
 
223
- if ( $not_activated_notices == false ) {
224
- $active_plugin = get_option( 'berocket_key_activated_plugins' );
225
- $active_site_plugin = get_site_option( 'berocket_key_activated_plugins' );
226
-
227
- if ( ! is_array( $active_plugin ) ) {
228
- $active_plugin = array();
229
- }
230
-
231
- if ( ! is_array( $active_site_plugin ) ) {
232
- $active_site_plugin = array();
233
- }
234
 
235
- $not_activated_notices = array();
236
- foreach ( self::$plugin_info as $plugin ) {
237
- if ( empty( $active_plugin[ $plugin[ 'id' ] ] ) && empty( $active_site_plugin[ $plugin[ 'id' ] ] ) ) {
238
- if ( version_compare( $plugin[ 'version' ], '2.0', '>=' ) && ( ! isset($plugin['version_capability']) || $plugin['version_capability'] > 5 ) ) {
239
- $not_activated_notices[] = array(
240
- 'start' => 0,
241
- 'end' => 0,
242
- 'name' => $plugin[ 'name' ],
243
- 'html' => '<strong>'.__('Please', 'BeRocket_domain'). '
244
- <a class="berocket_button" href="' . ( is_network_admin() ? admin_url( 'network/admin.php?page=berocket_account' ) : admin_url( 'admin.php?page=berocket_account' ) ) . '">' . __('activate plugin', 'BeRocket_domain') . '</a> ' . $plugin[ 'name' ] . ' ' . __('with help of Plugin/Account Key from', 'BeRocket_domain') . '
245
- <a class="berocket_button" href="' . BeRocket_update_path . 'user" target="_blank">' . __('BeRocket account', 'BeRocket_domain') . '</a></strong>.
246
- ' . __('You can activate plugin in', 'BeRocket_domain') . '
247
- <a class="berocket_button" href="' . ( is_network_admin() ? admin_url( 'network/admin.php?page=berocket_account' ) : admin_url( 'admin.php?page=berocket_account' ) ) . '">' . __('BeRocket Account settings', 'BeRocket_domain') . '</a>
248
- ',
249
- 'righthtml' => '',
250
- 'rightwidth' => 0,
251
- 'nothankswidth' => 0,
252
- 'contentwidth' => 1600,
253
- 'subscribe' => false,
254
- 'priority' => 10,
255
- 'height' => 70,
256
- 'repeat' => false,
257
- 'repeatcount' => 1,
258
- 'image' => array(
259
- 'local' => '',
260
- 'width' => 0,
261
- 'height' => 0,
262
- 'scale' => 1,
263
- )
264
- );
265
- }
 
266
  }
267
  }
268
-
269
- if ( is_network_admin() ) {
270
- set_site_transient( 'berocket_not_activated_notices_site', $not_activated_notices, 7200 );
271
- } else {
272
- set_transient( 'berocket_not_activated_notices', $not_activated_notices, 7200 );
273
- }
274
  }
275
 
276
  $notices = array_merge( $notices, $not_activated_notices );
@@ -304,45 +288,44 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
304
  } else {
305
  $key = sanitize_text_field( $_POST[ 'key' ] );
306
  $id = sanitize_text_field( $_POST[ 'id' ] );
307
- $out = get_transient( 'brupdate_' . $id . '_' . $key );
 
 
308
 
309
- if ( $out == false ) {
310
- $site_url = get_site_url();
311
- $plugins = self::$plugin_info;
312
-
313
- if ( is_array( $plugins ) ) {
314
- $plugins = array_keys( $plugins );
315
- $plugins = implode( ',', $plugins );
316
- } else {
317
- $plugins = '';
318
- }
319
 
320
- $response = wp_remote_post( BeRocket_update_path . 'main/account_updater', array(
321
- 'body' => array(
322
- 'key' => $key,
323
- 'id' => $id,
324
- 'url' => $site_url,
325
- 'plugins' => $plugins
326
- ),
327
- 'method' => 'POST',
328
- 'timeout' => 30,
329
- 'redirection' => 5,
330
- 'blocking' => true,
331
- 'sslverify' => false
332
- ) );
333
 
334
- if ( ! is_wp_error( $response ) ) {
335
- $out = wp_remote_retrieve_body( $response );
336
- $current_plugin = false;
337
- $out = json_decode( $out, true );
 
338
 
339
- if ( ! is_array( $out ) ) {
340
- $out = array();
341
- }
342
 
343
- $out[ 'upgrade' ] = array();
344
- $options = self::get_options();
345
 
 
346
  if ( $id != 0 ) {
347
  foreach ( self::$plugin_info as $plugin ) {
348
  if ( $plugin[ 'id' ] == $id ) {
@@ -356,7 +339,7 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
356
  $options[ 'plugin_key' ][ $id ] = $key;
357
 
358
  if ( isset( $out[ 'versions' ][ $id ] ) && version_compare( $current_plugin[ 'version' ], $out[ 'versions' ][ $id ], '<' ) ) {
359
- $upgrade_button = '<a href="' . wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $current_plugin[ 'plugin' ], 'upgrade-plugin_' . $current_plugin[ 'plugin' ] ) . '" class="button-primary button">Upgrade plugin</a>';
360
  $out[ 'plugin_table' ] = '<p>' . $upgrade_button . '</p>' . $out[ 'plugin_table' ];
361
  $out[ 'upgrade' ][] = array( 'id' => $id, 'upgrade' => $upgrade_button );
362
  }
@@ -365,7 +348,7 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
365
  } else {
366
  foreach ( self::$plugin_info as $plugin ) {
367
  if ( isset( $out[ 'versions' ][ $plugin[ 'id' ] ] ) && version_compare( $plugin[ 'version' ], $out[ 'versions' ][ $plugin[ 'id' ] ], '<' ) ) {
368
- $upgrade_button = '<a href="' . wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $plugin[ 'plugin' ], 'upgrade-plugin_' . $plugin[ 'plugin' ] ) . '" class="button-primary button">Upgrade plugin</a>';
369
  $out[ 'upgrade' ][] = array(
370
  'id' => $plugin[ 'id' ],
371
  'upgrade' => $upgrade_button
@@ -374,23 +357,20 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
374
  }
375
  $options[ 'account_key' ] = $key;
376
  }
377
-
378
- self::set_options( $options );
379
-
380
- delete_site_transient( 'update_plugins' );
381
- $out = json_encode( $out );
382
- set_transient( 'brupdate_' . $id . '_' . $key, $out, 600 );
383
- } else {
384
- $data = array(
385
- 'key_exist' => 0,
386
- 'status' => 'Failed',
387
- 'error' => $response->get_error_message()
388
- );
389
-
390
- $out = json_encode( $data );
391
  }
 
 
 
 
 
 
 
 
 
 
 
 
392
  }
393
- self::update_check_set('');
394
  }
395
  echo $out;
396
  wp_die();
@@ -399,11 +379,21 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
399
  public static function scripts() {
400
  ?>
401
  <script>
402
- function BeRocket_key_check(key, show_correct, product_id) {
403
  if (typeof( product_id ) == 'undefined' || product_id == null) {
404
  product_id = 0;
405
  }
406
- data = {action: 'br_test_key', key: key, id: product_id};
 
 
 
 
 
 
 
 
 
 
407
  is_submit = false;
408
  jQuery.ajax({
409
  url: ajaxurl,
@@ -424,14 +414,19 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
424
  }
425
  is_submit = true;
426
  } else {
427
- html = '<h3>' + data.status + '</h3>';
428
- html += '<p><b>Error message:</b>' + data.error + '</p>';
429
- jQuery('.berocket_test_result').html(html);
 
 
430
  }
431
  jQuery('.berocket_product_key_' + product_id + '_status').text(data.status);
 
 
 
432
  },
433
  dataType: 'json',
434
- async: false
435
  });
436
  return is_submit;
437
  }
@@ -475,13 +470,20 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
475
  }
476
 
477
  public static function account_option_register() {
478
- register_setting( 'BeRocket_account_option_settings', 'BeRocket_account_option' );
 
 
 
 
 
 
479
  }
480
 
481
  public static function account_form() {
 
482
  ?>
483
  <div class="wrap">
484
- <form method="post" action="options.php" class="account_key_send">
485
  <?php
486
  $options = get_option( 'BeRocket_account_option' );
487
  self::inside_form( $options );
@@ -494,11 +496,13 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
494
  public static function account_form_network() {
495
  ?>
496
  <div class="wrap">
497
- <form method="post" action="edit.php?page=berocket_account" class="account_key_send">
498
  <?php
499
  if ( isset( $_POST[ 'BeRocket_account_option' ] ) ) {
500
  $option = berocket_sanitize_array( $_POST[ 'BeRocket_account_option' ] );
501
  update_site_option( 'BeRocket_account_option', $option );
 
 
502
  }
503
 
504
  $options = get_site_option( 'BeRocket_account_option' );
@@ -532,7 +536,7 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
532
  size="50"
533
  value="<?php echo( empty( $options[ 'account_key' ] ) ? '' : $options[ 'account_key' ] ) ?>">
534
  </td>
535
- <td><input class="berocket_test_account button-secondary" type="button" value="Test"></td>
536
  <td class="berocket_product_key_0_status"></td>
537
  </tr>
538
  <?php
@@ -545,8 +549,8 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
545
  echo $plugin[ 'slug' ];
546
  }
547
  echo '</h4></td>';
548
- echo '<td><input id="berocket_product_key_', $plugin[ 'id' ], '" size="50" name="BeRocket_account_option[plugin_key][', $plugin[ 'id' ], ']" type="text" value="', ( empty( $options[ 'plugin_key' ][ $plugin[ 'id' ] ] ) ? '' : $options[ 'plugin_key' ][ $plugin[ 'id' ] ] ), '"></td>';
549
- echo '<td><input class="berocket_test_account_product button-secondary" data-id="', $plugin[ 'id' ], '" data-product="#berocket_product_key_', $plugin[ 'id' ], '" type="button" value="Test"></td>';
550
  echo '<td class="berocket_product_key_status berocket_product_key_', $plugin[ 'id' ], '_status"></td>';
551
  echo '</tr>';
552
  unset( $plugins_key[ $plugin[ 'id' ] ] );
@@ -558,7 +562,7 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
558
  </table>
559
  </div>
560
  <div class="berocket_test_result"></div>
561
- <input type="submit" class="button-primary" value="Save Changes"/>
562
 
563
  <div class="berocket_debug_errors">
564
  <h3>Errors</h3>
@@ -571,7 +575,7 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
571
  }
572
  ?>
573
  </select>
574
- <button type="button" class="button berocket_get_plugin_for_error">Get errors</button>
575
  <div class="berocket_html_plugin_for_error"></div>
576
  </div>
577
  </div>
@@ -587,13 +591,45 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
587
  key = jQuery('#berocket_account_key').val();
588
  BeRocket_key_check(key, true);
589
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
590
  jQuery(document).on('submit', '.account_key_send', function (event) {
591
- key = jQuery('#berocket_account_key').val();
592
- if (key != '') {
593
- result = BeRocket_key_check(key, false);
594
- if (!result) {
 
 
595
  event.preventDefault();
 
 
 
 
 
596
  }
 
 
597
  }
598
  });
599
  </script>
@@ -708,23 +744,6 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
708
  } else {
709
  update_option( 'berocket_key_activated_plugins', $active_plugin );
710
  }
711
-
712
- delete_site_transient( 'berocket_not_activated_notices_site' );
713
- delete_transient( 'berocket_not_activated_notices' );
714
- if ( is_multisite() ) {
715
- global $wpdb;
716
-
717
- $current_site = get_current_site();
718
- $all_sites = get_sites(array('fields' => 'ids'));
719
- if( is_array($all_sites) ) {
720
- foreach($all_sites as $site_id) {
721
- switch_to_blog($site_id);
722
- delete_site_transient( 'berocket_not_activated_notices_site' );
723
- delete_transient( 'berocket_not_activated_notices' );
724
- restore_current_blog();
725
- }
726
- }
727
- }
728
  if ( ! empty($value) && isset( $value->no_update ) && is_array( $value->no_update ) ) {
729
  $value->no_update = array_merge($value->no_update, $no_update_paid);
730
  foreach ( $value->no_update as $key => $val ) {
@@ -744,6 +763,7 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
744
 
745
  if ( in_array( $plugin, self::$slugs ) ) {
746
  remove_action( 'install_plugins_pre_plugin-information', 'install_plugin_information' );
 
747
 
748
  $plugin_id = array_search( $plugin, self::$slugs );
749
  $plugin_info = get_transient( 'brplugin_info_' . $plugin_id );
@@ -798,6 +818,7 @@ if ( ! class_exists( 'BeRocket_updater' ) ) {
798
  update_option( 'BeRocket_account_option', $options );
799
  }
800
  self::update_check_set('');
 
801
  }
802
  public static function admin_notice_is_display_notice($display_notice, $item, $search_data) {
803
  if( ! empty($item['for_plugin']) && is_array($item['for_plugin']) && ! empty($item['for_plugin']['id']) && ! empty($item['for_plugin']['version']) ) {
133
  $account_keys_item = $item;
134
  continue;
135
  }
 
136
  if ( ! empty($compatibility_hack[ str_replace( "edit.php?post_type=", "", $item[ 2 ] ) ]) ) {
137
+ $item_0 = "<span class='berocket_admin_menu_custom_post_submenu";
138
+ if ( $item[ 0 ] == 'Upgrade' ) {
139
+ $item_0 .= " berocket_admin_menu_custom_post_submenu_upgrade";
140
+ }
141
+ $item[ 0 ] = $item_0 . "'>" . $item[ 0 ] . "</span>";
142
  $new_sub_order[ $compatibility_hack[ str_replace( "edit.php?post_type=", "", $item[ 2 ] ) ] ][] = $item;
143
  } else {
144
  $new_order_temp[] = $item;
210
  if ( ! empty( $_GET[ 'page' ] ) && $_GET[ 'page' ] == 'berocket_account' ) {
211
  return $notices;
212
  }
213
+ $active_plugin = get_option( 'berocket_key_activated_plugins' );
214
+ $active_site_plugin = get_site_option( 'berocket_key_activated_plugins' );
215
 
216
+ if ( ! is_array( $active_plugin ) ) {
217
+ $active_plugin = array();
 
 
 
 
 
 
 
 
218
  }
219
 
220
+ if ( ! is_array( $active_site_plugin ) ) {
221
+ $active_site_plugin = array();
222
+ }
 
 
 
 
 
 
 
 
223
 
224
+ $not_activated_notices = array();
225
+ foreach ( self::$plugin_info as $plugin ) {
226
+ if ( empty( $active_plugin[ $plugin[ 'id' ] ] ) && empty( $active_site_plugin[ $plugin[ 'id' ] ] ) ) {
227
+ $version_capability = br_get_value_from_array($plugin, array('version_capability'), 15);
228
+ if ( $version_capability > 5 && $version_capability != 15 ) {
229
+ $meta_data = '?utm_source=paid_plugin&utm_medium=notice&utm_campaign='.$plugin['plugin_name'];
230
+ $not_activated_notices[] = array(
231
+ 'start' => 0,
232
+ 'end' => 0,
233
+ 'name' => $plugin[ 'name' ],
234
+ 'html' => '<strong>'.__('Please', 'BeRocket_domain'). '
235
+ <a class="berocket_button" href="' . ( is_network_admin() ? admin_url( 'network/admin.php?page=berocket_account' ) : admin_url( 'admin.php?page=berocket_account' ) ) . '">' . __('activate plugin', 'BeRocket_domain') . '</a> ' . $plugin[ 'name' ] . ' ' . __('with help of Plugin/Account Key from', 'BeRocket_domain') . '
236
+ <a class="berocket_button" href="' . BeRocket_update_path . 'user' . $meta_data . '" target="_blank">' . __('BeRocket account', 'BeRocket_domain') . '</a></strong>.
237
+ ' . __('You can activate plugin in', 'BeRocket_domain') . '
238
+ <a class="berocket_button" href="' . ( is_network_admin() ? admin_url( 'network/admin.php?page=berocket_account' ) : admin_url( 'admin.php?page=berocket_account' ) ) . '">' . __('BeRocket Account settings', 'BeRocket_domain') . '</a>
239
+ ',
240
+ 'righthtml' => '',
241
+ 'rightwidth' => 0,
242
+ 'nothankswidth' => 0,
243
+ 'contentwidth' => 1600,
244
+ 'subscribe' => false,
245
+ 'priority' => 10,
246
+ 'height' => 70,
247
+ 'repeat' => false,
248
+ 'repeatcount' => 1,
249
+ 'image' => array(
250
+ 'local' => '',
251
+ 'width' => 0,
252
+ 'height' => 0,
253
+ 'scale' => 1,
254
+ )
255
+ );
256
  }
257
  }
 
 
 
 
 
 
258
  }
259
 
260
  $notices = array_merge( $notices, $not_activated_notices );
288
  } else {
289
  $key = sanitize_text_field( $_POST[ 'key' ] );
290
  $id = sanitize_text_field( $_POST[ 'id' ] );
291
+ $fast = ! empty($_POST[ 'fast' ]);
292
+ $site_url = get_site_url();
293
+ $plugins = self::$plugin_info;
294
 
295
+ if ( is_array( $plugins ) ) {
296
+ $plugins = array_keys( $plugins );
297
+ $plugins = implode( ',', $plugins );
298
+ } else {
299
+ $plugins = '';
300
+ }
 
 
 
 
301
 
302
+ $response = wp_remote_post( BeRocket_update_path . 'main/account_updater', array(
303
+ 'body' => array(
304
+ 'key' => $key,
305
+ 'id' => $id,
306
+ 'url' => $site_url,
307
+ 'plugins' => $plugins
308
+ ),
309
+ 'method' => 'POST',
310
+ 'timeout' => 30,
311
+ 'redirection' => 5,
312
+ 'blocking' => true,
313
+ 'sslverify' => false
314
+ ) );
315
 
316
+ $options = self::get_options();
317
+ if ( ! is_wp_error( $response ) ) {
318
+ $out = wp_remote_retrieve_body( $response );
319
+ $current_plugin = false;
320
+ $out = json_decode( $out, true );
321
 
322
+ if ( ! is_array( $out ) ) {
323
+ $out = array();
324
+ }
325
 
326
+ $out[ 'upgrade' ] = array();
 
327
 
328
+ if( ! $fast ) {
329
  if ( $id != 0 ) {
330
  foreach ( self::$plugin_info as $plugin ) {
331
  if ( $plugin[ 'id' ] == $id ) {
339
  $options[ 'plugin_key' ][ $id ] = $key;
340
 
341
  if ( isset( $out[ 'versions' ][ $id ] ) && version_compare( $current_plugin[ 'version' ], $out[ 'versions' ][ $id ], '<' ) ) {
342
+ $upgrade_button = '<a href="' . wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $current_plugin[ 'plugin' ], 'upgrade-plugin_' . $current_plugin[ 'plugin' ] ) . '" class="button tiny-button">Upgrade plugin</a>';
343
  $out[ 'plugin_table' ] = '<p>' . $upgrade_button . '</p>' . $out[ 'plugin_table' ];
344
  $out[ 'upgrade' ][] = array( 'id' => $id, 'upgrade' => $upgrade_button );
345
  }
348
  } else {
349
  foreach ( self::$plugin_info as $plugin ) {
350
  if ( isset( $out[ 'versions' ][ $plugin[ 'id' ] ] ) && version_compare( $plugin[ 'version' ], $out[ 'versions' ][ $plugin[ 'id' ] ], '<' ) ) {
351
+ $upgrade_button = '<a href="' . wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $plugin[ 'plugin' ], 'upgrade-plugin_' . $plugin[ 'plugin' ] ) . '" class="button tiny-button">Upgrade plugin</a>';
352
  $out[ 'upgrade' ][] = array(
353
  'id' => $plugin[ 'id' ],
354
  'upgrade' => $upgrade_button
357
  }
358
  $options[ 'account_key' ] = $key;
359
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
360
  }
361
+ $out = json_encode( $out );
362
+ } else {
363
+ $data = array(
364
+ 'key_exist' => 0,
365
+ 'status' => 'Failed',
366
+ 'error' => $response->get_error_message()
367
+ );
368
+
369
+ $out = json_encode( $data );
370
+ }
371
+ if( ! $fast ) {
372
+ self::set_options( $options );
373
  }
 
374
  }
375
  echo $out;
376
  wp_die();
379
  public static function scripts() {
380
  ?>
381
  <script>
382
+ function BeRocket_key_check(key, show_correct, product_id, async_func, fast) {
383
  if (typeof( product_id ) == 'undefined' || product_id == null) {
384
  product_id = 0;
385
  }
386
+ if (typeof( async_func ) == 'undefined' || async_func == null) {
387
+ async_func = false;
388
+ }
389
+ if (typeof( fast ) == 'undefined' || fast == null) {
390
+ fast = 0;
391
+ }
392
+ var async = false;
393
+ if( async_func !== false ) {
394
+ async = true;
395
+ }
396
+ data = {action: 'br_test_key', key: key, id: product_id, fast:fast};
397
  is_submit = false;
398
  jQuery.ajax({
399
  url: ajaxurl,
414
  }
415
  is_submit = true;
416
  } else {
417
+ if (show_correct) {
418
+ html = '<h3>' + data.status + '</h3>';
419
+ html += '<p><b>Error message:</b>' + data.error + '</p>';
420
+ jQuery('.berocket_test_result').html(html);
421
+ }
422
  }
423
  jQuery('.berocket_product_key_' + product_id + '_status').text(data.status);
424
+ if( typeof(async_func) == 'function' ) {
425
+ async_func(is_submit);
426
+ }
427
  },
428
  dataType: 'json',
429
+ async: async
430
  });
431
  return is_submit;
432
  }
470
  }
471
 
472
  public static function account_option_register() {
473
+ register_setting( 'BeRocket_account_option_settings', 'BeRocket_account_option', array('sanitize_callback' => array(__CLASS__, 'reset_update_plugin_data')) );
474
+ }
475
+
476
+ public static function reset_update_plugin_data($data) {
477
+ self::update_check_set('');
478
+ delete_site_transient( 'update_plugins' );
479
+ return $data;
480
  }
481
 
482
  public static function account_form() {
483
+ wp_enqueue_style( 'berocket_framework_admin_style' );
484
  ?>
485
  <div class="wrap">
486
+ <form method="post" action="options.php" class="account_key_send br_framework_settings">
487
  <?php
488
  $options = get_option( 'BeRocket_account_option' );
489
  self::inside_form( $options );
496
  public static function account_form_network() {
497
  ?>
498
  <div class="wrap">
499
+ <form method="post" action="edit.php?page=berocket_account" class="account_key_send br_framework_settings">
500
  <?php
501
  if ( isset( $_POST[ 'BeRocket_account_option' ] ) ) {
502
  $option = berocket_sanitize_array( $_POST[ 'BeRocket_account_option' ] );
503
  update_site_option( 'BeRocket_account_option', $option );
504
+ self::update_check_set('');
505
+ delete_site_transient( 'update_plugins' );
506
  }
507
 
508
  $options = get_site_option( 'BeRocket_account_option' );
536
  size="50"
537
  value="<?php echo( empty( $options[ 'account_key' ] ) ? '' : $options[ 'account_key' ] ) ?>">
538
  </td>
539
+ <td><input class="berocket_test_account button tiny-button" type="button" value="Test"></td>
540
  <td class="berocket_product_key_0_status"></td>
541
  </tr>
542
  <?php
549
  echo $plugin[ 'slug' ];
550
  }
551
  echo '</h4></td>';
552
+ echo '<td><input class="berocket_test_account_product_key" id="berocket_product_key_', $plugin[ 'id' ], '" size="50" name="BeRocket_account_option[plugin_key][', $plugin[ 'id' ], ']" type="text" value="', ( empty( $options[ 'plugin_key' ][ $plugin[ 'id' ] ] ) ? '' : $options[ 'plugin_key' ][ $plugin[ 'id' ] ] ), '"></td>';
553
+ echo '<td><input class="berocket_test_account_product save_checked button tiny-button" data-id="', $plugin[ 'id' ], '" data-product="#berocket_product_key_', $plugin[ 'id' ], '" type="button" value="Test"></td>';
554
  echo '<td class="berocket_product_key_status berocket_product_key_', $plugin[ 'id' ], '_status"></td>';
555
  echo '</tr>';
556
  unset( $plugins_key[ $plugin[ 'id' ] ] );
562
  </table>
563
  </div>
564
  <div class="berocket_test_result"></div>
565
+ <button type="submit" class="button">Save Changes</button>
566
 
567
  <div class="berocket_debug_errors">
568
  <h3>Errors</h3>
575
  }
576
  ?>
577
  </select>
578
+ <button type="button" class="button tiny-button berocket_get_plugin_for_error">Get errors</button>
579
  <div class="berocket_html_plugin_for_error"></div>
580
  </div>
581
  </div>
591
  key = jQuery('#berocket_account_key').val();
592
  BeRocket_key_check(key, true);
593
  });
594
+ jQuery(document).on('change', '.berocket_test_account_product_key', function() {
595
+ jQuery(this).parents('.berocket_updater_plugin_key').find('.berocket_test_account_product').removeClass('save_checked');
596
+ });
597
+ var berocket_key_checked = 0;
598
+ var berocket_key_count = 1;
599
+ function next_berocket_key_check(result) {
600
+ berocket_key_checked = berocket_key_count - jQuery('.berocket_test_account_product:not(.save_checked), #berocket_account_key:not(.save_checked)').length;
601
+ var button = jQuery('.account_key_send .button[type="submit"]');
602
+ var element = jQuery('.berocket_test_account_product:not(.save_checked)').first();
603
+ if( element.length ) {
604
+ button.html('Checking keys '+berocket_key_checked+' / '+berocket_key_count+' <i class="fa fa-refresh fa-spin"></i>');
605
+ if (element.data('product')) {
606
+ key = jQuery(element.data('product')).val();
607
+ } else {
608
+ key = jQuery('#berocket_product_key').val();
609
+ }
610
+ element.addClass('save_checked');
611
+ BeRocket_key_check(key, false, element.data('id'), next_berocket_key_check, 1);
612
+ } else {
613
+ button.html('Saving keys <i class="fa fa-refresh fa-spin"></i>');
614
+ jQuery('.account_key_send').trigger('submit');
615
+ }
616
+ }
617
  jQuery(document).on('submit', '.account_key_send', function (event) {
618
+ var key_count = jQuery('.berocket_test_account_product:not(.save_checked), #berocket_account_key:not(.save_checked)').length;
619
+ if( ! jQuery(this).is('.saving') ) {
620
+ jQuery(this).addClass('saving');
621
+ berocket_key_checked = 0;
622
+ berocket_key_count = key_count;
623
+ if( berocket_key_count != 0 ) {
624
  event.preventDefault();
625
+ var button = jQuery('.account_key_send .button[type="submit"]');
626
+ button.html('Checking keys '+berocket_key_checked+' / '+berocket_key_count+' <i class="fa fa-refresh fa-spin"></i>');
627
+ key = jQuery('#berocket_account_key').val();
628
+ jQuery('#berocket_account_key').addClass('save_checked');
629
+ BeRocket_key_check(key, false, null, next_berocket_key_check, 1);
630
  }
631
+ } else if( key_count > 0 ) {
632
+ event.preventDefault();
633
  }
634
  });
635
  </script>
744
  } else {
745
  update_option( 'berocket_key_activated_plugins', $active_plugin );
746
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
747
  if ( ! empty($value) && isset( $value->no_update ) && is_array( $value->no_update ) ) {
748
  $value->no_update = array_merge($value->no_update, $no_update_paid);
749
  foreach ( $value->no_update as $key => $val ) {
763
 
764
  if ( in_array( $plugin, self::$slugs ) ) {
765
  remove_action( 'install_plugins_pre_plugin-information', 'install_plugin_information' );
766
+ remove_action( 'install_plugins_pre_plugin-information', 'install_plugin_information' );
767
 
768
  $plugin_id = array_search( $plugin, self::$slugs );
769
  $plugin_info = get_transient( 'brplugin_info_' . $plugin_id );
818
  update_option( 'BeRocket_account_option', $options );
819
  }
820
  self::update_check_set('');
821
+ delete_site_transient( 'update_plugins' );
822
  }
823
  public static function admin_notice_is_display_notice($display_notice, $item, $search_data) {
824
  if( ! empty($item['for_plugin']) && is_array($item['for_plugin']) && ! empty($item['for_plugin']['id']) && ! empty($item['for_plugin']['version']) ) {
berocket/libraries/addons/addons.php CHANGED
@@ -146,8 +146,9 @@ if( ! class_exists('BeRocket_framework_addons') ) {
146
  $plugin_version_capability = apply_filters( 'brfr_get_plugin_version_capability_' . $this->hook_name, 0 );
147
 
148
  if ( ! empty( $addon_info[ 'paid' ] ) && ( empty( $plugin_version_capability ) || $plugin_version_capability < 10 ) ) {
 
149
  $html = '<i class="berocket_addon_paid_sign fa fa-lock"></i>';
150
- $html .= '<div class="berocket_addon_paid_get"><a target="_blank" href="https://berocket.com/product/' . $this->values[ 'premium_slug' ] . '"><span>
151
  ' . __( 'Go Premium', 'BeRocket_domain' ) . '
152
  </span></a></div>';
153
  $html_array = berocket_insert_to_array($html_array, 'close_addon_block', array('paid_only' => $html));
146
  $plugin_version_capability = apply_filters( 'brfr_get_plugin_version_capability_' . $this->hook_name, 0 );
147
 
148
  if ( ! empty( $addon_info[ 'paid' ] ) && ( empty( $plugin_version_capability ) || $plugin_version_capability < 10 ) ) {
149
+ $meta_data = '?utm_source=free_plugin&utm_medium=plugins&utm_campaign='.$this->info['plugin_name'];
150
  $html = '<i class="berocket_addon_paid_sign fa fa-lock"></i>';
151
+ $html .= '<div class="berocket_addon_paid_get"><a target="_blank" href="https://berocket.com/product/' . $this->values[ 'premium_slug' ] . $meta_data . '"><span>
152
  ' . __( 'Go Premium', 'BeRocket_domain' ) . '
153
  </span></a></div>';
154
  $html_array = berocket_insert_to_array($html_array, 'close_addon_block', array('paid_only' => $html));
berocket/libraries/feature_tab.php CHANGED
@@ -21,14 +21,14 @@ if( ! class_exists('BeRocket_framework_feature_tab') ) {
21
  }
22
  }
23
  public function admin_menu() {
24
- register_setting($this->values[ 'option_page' ].'_features', $this->values[ 'settings_name' ].'_features');
25
  if ( method_exists( 'BeRocket_updater', 'get_plugin_count' ) ) {
26
  add_submenu_page(
27
  'berocket_account',
28
- $this->info[ 'norm_name' ] . ' ' . __( 'Features', 'BeRocket_domain' ),
29
- __( 'Features', 'BeRocket_domain' ),
30
  'manage_berocket',
31
- $this->values[ 'option_page' ].'_features',
32
  array( $this, 'option_form' )
33
  );
34
 
@@ -39,12 +39,12 @@ if( ! class_exists('BeRocket_framework_feature_tab') ) {
39
  }
40
  public function option_form() {
41
  echo '<div class="wrap">';
42
- echo '<h3>'.$this->info[ 'norm_name' ] . ' ' . __( 'Features', 'BeRocket_domain' ).'</h3>';
43
  include $this->FILE;
44
  echo '</div>';
45
  }
46
  public function menu_order_custom_post($compatibility) {
47
- $compatibility[$this->values[ 'option_page' ].'_features'] = $this->values[ 'option_page' ];
48
  return $compatibility;
49
  }
50
  }
21
  }
22
  }
23
  public function admin_menu() {
24
+ register_setting($this->values[ 'option_page' ].'_upgrade', $this->values[ 'settings_name' ].'_upgrade');
25
  if ( method_exists( 'BeRocket_updater', 'get_plugin_count' ) ) {
26
  add_submenu_page(
27
  'berocket_account',
28
+ __( 'Upgrade to Premium ', 'BeRocket_domain' ) . ' ' . $this->info[ 'norm_name' ] ,
29
+ __( 'Upgrade', 'BeRocket_domain' ),
30
  'manage_berocket',
31
+ $this->values[ 'option_page' ].'_upgrade',
32
  array( $this, 'option_form' )
33
  );
34
 
39
  }
40
  public function option_form() {
41
  echo '<div class="wrap">';
42
+ echo '<h3>' . __( 'Premium', 'BeRocket_domain' ) . ' ' . $this->info[ 'norm_name' ] . ' ' . __( 'Features', 'BeRocket_domain' ).'</h3>';
43
  include $this->FILE;
44
  echo '</div>';
45
  }
46
  public function menu_order_custom_post($compatibility) {
47
+ $compatibility[$this->values[ 'option_page' ].'_upgrade'] = $this->values[ 'option_page' ];
48
  return $compatibility;
49
  }
50
  }
berocket/libraries/templates/templates.php CHANGED
@@ -157,8 +157,9 @@ if ( ! class_exists('BeRocket_framework_templates') ) {
157
  $plugin_version_capability = apply_filters( 'brfr_get_plugin_version_capability_' . $this->hook_name, 0 );
158
 
159
  if ( ! empty( $template_info[ 'paid' ] ) && ( empty( $plugin_version_capability ) || $plugin_version_capability < 10 ) ) {
 
160
  $html = '<i class="berocket_template_paid_sign fa fa-lock"></i>';
161
- $html .= '<div class="berocket_template_paid_get"><a target="_blank" href="https://berocket.com/product/' . $this->values[ 'premium_slug' ] . '"><span>
162
  <i class="fa fa-star" aria-hidden="true"></i><i class="fa fa-star" aria-hidden="true"></i><i class="fa fa-star" aria-hidden="true"></i>
163
  ' . __( 'Go Premium', 'BeRocket_domain' ) . '
164
  <i class="fa fa-star" aria-hidden="true"></i><i class="fa fa-star" aria-hidden="true"></i><i class="fa fa-star" aria-hidden="true"></i>
157
  $plugin_version_capability = apply_filters( 'brfr_get_plugin_version_capability_' . $this->hook_name, 0 );
158
 
159
  if ( ! empty( $template_info[ 'paid' ] ) && ( empty( $plugin_version_capability ) || $plugin_version_capability < 10 ) ) {
160
+ $meta_data = '?utm_source=free_plugin&utm_medium=plugins&utm_campaign='.$this->info['plugin_name'];
161
  $html = '<i class="berocket_template_paid_sign fa fa-lock"></i>';
162
+ $html .= '<div class="berocket_template_paid_get"><a target="_blank" href="https://berocket.com/product/' . $this->values[ 'premium_slug' ] . $meta_data . '"><span>
163
  <i class="fa fa-star" aria-hidden="true"></i><i class="fa fa-star" aria-hidden="true"></i><i class="fa fa-star" aria-hidden="true"></i>
164
  ' . __( 'Go Premium', 'BeRocket_domain' ) . '
165
  <i class="fa fa-star" aria-hidden="true"></i><i class="fa fa-star" aria-hidden="true"></i><i class="fa fa-star" aria-hidden="true"></i>
berocket/templates/discount.php DELETED
@@ -1,202 +0,0 @@
1
- <?php
2
- $start_time = 1475532000;//1475272800
3
- $end_time = 1475791200;//1475445600
4
- $time = time();
5
- $discount = 30;
6
- $d_type = 'p';
7
- if( ! isset($dplugin_price) || ! is_numeric($dplugin_price) ) {
8
- $dplugin_price = 0;
9
- }
10
- if ( $d_type == 'p' ) {
11
- $discount_text = $discount . '%';
12
- $discount_amount = ( $dplugin_price / 100 * $discount );
13
- } else {
14
- $discount_text = '$' . $discount;
15
- $discount_amount = $discount;
16
- }
17
-
18
- $price_new = $dplugin_price - $discount_amount;
19
- $price_new = number_format( $price_new, 2, ".", " " );
20
- $price_new = '$' . $price_new;
21
- $discount_amount = number_format( $discount_amount, 2, ".", " " );
22
- $discount_amount = '$' . $discount_amount;
23
-
24
- if ( $time > $start_time && $time < $end_time ) { ?>
25
- <div class="discount-block-check"></div>
26
- <div class="wrap discount-block">
27
- <div>
28
- <?php
29
- $text = 'Only today <strong>PRO</strong> version of %name% plugin for just %price%!<br>
30
- Get your <strong class="scale red pulse">%disc% discount</strong> and save %amount% today
31
- <a class="buy_button" href="%link%" target="_blank">Buy Now</a>';
32
- $text = str_replace( '%name%', $dplugin_name, $text );
33
- $text = str_replace( '%link%', $dplugin_link, $text );
34
- $text = str_replace( '%disc%', $discount_text, $text );
35
- $text = str_replace( '%amount%', $discount_amount, $text );
36
- $text = str_replace( '%price%', $price_new, $text );
37
- echo $text;
38
- ?>
39
- </div>
40
- </div>
41
- <script>
42
- jQuery(window).scroll(function() {
43
- var top = jQuery('.discount-block-check').offset().top - 32;
44
-
45
- if( jQuery(window).width() <= 782 ) {
46
- jQuery('.discount-block').removeClass('fixed');
47
- jQuery('.discount-block-check').height(0);
48
- } else {
49
- if( jQuery(window).scrollTop() > top ) {
50
- if( ! jQuery('.discount-block').is('.fixed') ) {
51
- jQuery('.discount-block-check').height(jQuery('.discount-block').outerHeight(true));
52
- jQuery('.discount-block').addClass('fixed');
53
- }
54
- } else {
55
- if( jQuery('.discount-block').is('.fixed') ) {
56
- jQuery('.discount-block-check').height(0);
57
- jQuery('.discount-block').removeClass('fixed');
58
- }
59
- }
60
- }
61
- });
62
- </script>
63
- <style>
64
- .discount-block-check {
65
- margin: 0!important;
66
- padding: 0!important;
67
- }
68
- .discount-block{
69
- text-align: center;
70
- background: #ffffff;
71
- padding: 20px;
72
- font-size: 24px;
73
- border: 4px solid #ff8800;
74
- line-height: 1.8em;
75
- transition: 0.4s all;
76
- animation-name: border_pulse;
77
- animation-duration: 4s;
78
- animation-iteration-count: infinite;
79
- }
80
- .discount-block.fixed{
81
- position: fixed;
82
- top: 32px;
83
- left: 180px;
84
- right: 0px;
85
- }
86
- @media only screen and (max-device-width: 960px) {
87
- .discount-block.fixed{
88
- left: 56px;
89
- }
90
- }
91
- @media only screen and (max-device-width: 782px) {
92
- .discount-block{
93
- font-size: 16px;
94
- padding: 5px;
95
- }
96
- }
97
- @keyframes border_pulse {
98
- 0% {border-color: #ff8800;}
99
- 50% {border-color: #0088ff;}
100
- 100% {border-color: #ff8800;}
101
- }
102
- .discount-block .buy_button {
103
- font-size: 20px;
104
- padding: 8px 30px;
105
- color: #fff;
106
- line-height: 28px;
107
- font-weight: 600;
108
- text-transform: uppercase;
109
- display: inline-block;
110
- text-align: center;
111
- text-decoration: none;
112
- background-color: #f16543;
113
- cursor: pointer;
114
- }
115
- .discount-block .buy_button:hover {
116
- background-color: #d94825;
117
- }
118
- .pulse {
119
- animation-duration: 1.5s;
120
- animation-iteration-count: infinite;
121
- animation-timing-function: linear;
122
- animation-timing-function: cubic-bezier(0.2,0.2,0.2,0.2);
123
- }
124
- .time-5 {
125
- animation-duration: 0.5s;
126
- }
127
- .time-10 {
128
- animation-duration: 1s;
129
- }
130
- .time-15 {
131
- animation-duration: 1.5s;
132
- }
133
- .time-20 {
134
- animation-duration: 2s;
135
- }
136
- .time-25 {
137
- animation-duration: 2.5s;
138
- }
139
- .time-30 {
140
- animation-duration: 3s;
141
- }
142
- .time-35 {
143
- animation-duration: 3.5s;
144
- }
145
- .time-40 {
146
- animation-duration: 4s;
147
- }
148
- .red {
149
- color: #ff0000;
150
- }
151
- .red.pulse {
152
- animation-name: red_pulse;
153
- }
154
- @keyframes red_pulse {
155
- 0% {color: #ff0000;}
156
- 50% {color: #000000;}
157
- 100% {color: #ff0000;}
158
- }
159
- .blue {
160
- color: #0000ff;
161
- }
162
- .blue.pulse {
163
- animation-name: blue_pulse;
164
- }
165
- @keyframes blue_pulse {
166
- 0% {color: #0000ff;}
167
- 50% {color: #000000;}
168
- 100% {color: #0000ff;}
169
- }
170
- .pulse.scale {
171
- display: inline-block;
172
- animation-name: scale_pulse;
173
- }
174
- @keyframes scale_pulse {
175
- 0% {transform: scale(1);}
176
- 25%{transform: scale(1.05);}
177
- 50% {transform: scale(1);}
178
- 75% {transform: scale(0.9);}
179
- 100% {transform: scale(1);}
180
- }
181
- .pulse.scale.red {
182
- animation-name: scale_red_pulse;
183
- }
184
- @keyframes scale_red_pulse {
185
- 0% {transform: scale(1);color: #ff0000;}
186
- 25%{transform: scale(1.05);color: #ff0000;}
187
- 50% {transform: scale(1);color: #ff0000;}
188
- 75% {transform: scale(0.9);color: #000000;}
189
- 100% {transform: scale(1);color: #ff0000;}
190
- }
191
- .pulse.scale.blue {
192
- animation-name: scale_blue_pulse;
193
- }
194
- @keyframes scale_blue_pulse {
195
- 0% {transform: scale(1);color: #0000ff;}
196
- 25%{transform: scale(1.05);color: #0000ff;}
197
- 50% {transform: scale(1);color: #0000ff;}
198
- 75% {transform: scale(0.9);color: #000000;}
199
- 100% {transform: scale(1);color: #0000ff;}
200
- }
201
- </style>
202
- <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
berocket/templates/premium.php CHANGED
@@ -1,11 +1,16 @@
1
  <?php
2
  $feature_list = ( empty($this->cc->feature_list) ? null : $this->cc->feature_list );
3
- $dplugin_link = 'https://berocket.com/product/' . $this->cc->values['premium_slug'];
 
 
 
 
 
4
  $dplugin_lic = br_get_value_from_array($this->cc->info, 'lic_id');
5
  if( ! empty($dplugin_lic) ) {
6
- $dplugin_lic_link = 'https://berocket.com/checkout/'.$dplugin_lic.'/promo/SAVE15';
7
  } else {
8
- $dplugin_lic_link = $dplugin_link.'/SAVE15';
9
  }
10
  if ( isset($this->plugin_version_capability) && $this->plugin_version_capability <= 5 ) {
11
  echo apply_filters('berocket_rate_plugin_window', '', br_get_value_from_array($this->cc->info, 'id'));
@@ -38,9 +43,9 @@ if ( isset($this->plugin_version_capability) && $this->plugin_version_capability
38
  }
39
 
40
  $text = str_replace( '%feature_list%', $feature_text, $text );
41
- $text = str_replace( '%link%', $dplugin_link.'/SAVE15', $text );
42
  $text = str_replace( '%licence%', $dplugin_lic, $text );
43
- $text = str_replace( '%licence_link%', $dplugin_link.'/SAVE15', $text );
44
  $text = str_replace( '%discount%', $dpdiscount, $text );
45
  $text = str_replace( '%plugin_name%', (empty($plugin_info['Name']) ? '' : $plugin_info['Name']), $text );
46
  $text = str_replace( '%plugin_link%', (empty($plugin_info['PluginURI']) ? '' : $plugin_info['PluginURI']), $text );
1
  <?php
2
  $feature_list = ( empty($this->cc->feature_list) ? null : $this->cc->feature_list );
3
+ if( ! empty($this->plugin_version_capability) && $this->plugin_version_capability > 10 ) {
4
+ $meta_data = '?utm_source=paid_plugin&utm_medium=plugins&utm_campaign='.$this->info['plugin_name'];
5
+ } else {
6
+ $meta_data = '?utm_source=free_plugin&utm_medium=plugins&utm_campaign='.$this->info['plugin_name'];
7
+ }
8
+ $dplugin_link = 'https://berocket.com/product/' . $this->cc->values['premium_slug'] . '/SAVE15' . $meta_data;
9
  $dplugin_lic = br_get_value_from_array($this->cc->info, 'lic_id');
10
  if( ! empty($dplugin_lic) ) {
11
+ $dplugin_lic_link = 'https://berocket.com/checkout/'.$dplugin_lic.'/promo/SAVE15' . $meta_data;
12
  } else {
13
+ $dplugin_lic_link = $dplugin_link;
14
  }
15
  if ( isset($this->plugin_version_capability) && $this->plugin_version_capability <= 5 ) {
16
  echo apply_filters('berocket_rate_plugin_window', '', br_get_value_from_array($this->cc->info, 'id'));
43
  }
44
 
45
  $text = str_replace( '%feature_list%', $feature_text, $text );
46
+ $text = str_replace( '%link%', $dplugin_link, $text );
47
  $text = str_replace( '%licence%', $dplugin_lic, $text );
48
+ $text = str_replace( '%licence_link%', $dplugin_link, $text );
49
  $text = str_replace( '%discount%', $dpdiscount, $text );
50
  $text = str_replace( '%plugin_name%', (empty($plugin_info['Name']) ? '' : $plugin_info['Name']), $text );
51
  $text = str_replace( '%plugin_link%', (empty($plugin_info['PluginURI']) ? '' : $plugin_info['PluginURI']), $text );
berocket/templates/settings.php CHANGED
@@ -1,13 +1,16 @@
1
  <?php
2
  $plugin_info = get_plugin_data( $this->cc->info[ 'plugin_file' ] );
3
-
 
 
 
 
4
  $dplugin_name = $this->cc->info['full_name'];
5
- $dplugin_link = 'https://berocket.com/product/' . $this->cc->values['premium_slug'];
6
  $dplugin_price = $this->cc->info['price'];
7
  $dplugin_desc = $plugin_info['Description'];
8
  $options = $this->get_option();
9
 
10
- include 'discount.php';
11
  ?>
12
  <div class="wrap br_framework_settings br_<?php echo $this->cc->info['plugin_name']?>_settings">
13
  <div id="icon-themes" class="icon32"></div>
1
  <?php
2
  $plugin_info = get_plugin_data( $this->cc->info[ 'plugin_file' ] );
3
+ if( ! empty($this->plugin_version_capability) && $this->plugin_version_capability > 10 ) {
4
+ $meta_data = '?utm_source=paid_plugin&utm_medium=plugins&utm_campaign='.$this->info['plugin_name'];
5
+ } else {
6
+ $meta_data = '?utm_source=free_plugin&utm_medium=plugins&utm_campaign='.$this->info['plugin_name'];
7
+ }
8
  $dplugin_name = $this->cc->info['full_name'];
9
+ $dplugin_link = 'https://berocket.com/product/' . $this->cc->values['premium_slug'] . $meta_data;
10
  $dplugin_price = $this->cc->info['price'];
11
  $dplugin_desc = $plugin_info['Description'];
12
  $options = $this->get_option();
13
 
 
14
  ?>
15
  <div class="wrap br_framework_settings br_<?php echo $this->cc->info['plugin_name']?>_settings">
16
  <div id="icon-themes" class="icon32"></div>
berocket/templates/settings_footer.php CHANGED
@@ -1,9 +1,14 @@
1
  <div class="br_settings_footer">
2
  <?php
 
 
 
 
 
3
  if ( isset($this->plugin_version_capability) && $this->plugin_version_capability == 3 ) {
4
- $text = '<h4><a href="%plugin_link%" target="_blank">%plugin_name%</a> developed by <a href="https://berocket.com" target="_blank">BeRocket</a></h4>';
5
  } elseif ( isset($this->plugin_version_capability) && $this->plugin_version_capability <= 5 ) {
6
- $text = '<h4>Both <a href="%plugin_link%" target="_blank">Free</a> and <a href="%link%" target="_blank">Paid</a> versions of %plugin_name% developed by <a href="https://berocket.com" target="_blank">BeRocket</a></h4>';
7
  } else {
8
  $text = '<h4><a href="%plugin_link%" target="_blank">%plugin_name%</a> developed by <a href="https://berocket.com" target="_blank">BeRocket</a></h4>';
9
  }
1
  <div class="br_settings_footer">
2
  <?php
3
+ if( ! empty($this->plugin_version_capability) && $this->plugin_version_capability > 10 ) {
4
+ $meta_data = '?utm_source=paid_plugin&utm_medium=plugins&utm_campaign='.$this->info['plugin_name'];
5
+ } else {
6
+ $meta_data = '?utm_source=free_plugin&utm_medium=plugins&utm_campaign='.$this->info['plugin_name'];
7
+ }
8
  if ( isset($this->plugin_version_capability) && $this->plugin_version_capability == 3 ) {
9
+ $text = '<h4><a href="%plugin_link%" target="_blank">%plugin_name%</a> developed by <a href="https://berocket.com'.$meta_data.'" target="_blank">BeRocket</a></h4>';
10
  } elseif ( isset($this->plugin_version_capability) && $this->plugin_version_capability <= 5 ) {
11
+ $text = '<h4>Both <a href="%plugin_link%" target="_blank">Free</a> and <a href="%link%" target="_blank">Paid</a> versions of %plugin_name% developed by <a href="https://berocket.com'.$meta_data.'" target="_blank">BeRocket</a></h4>';
12
  } else {
13
  $text = '<h4><a href="%plugin_link%" target="_blank">%plugin_name%</a> developed by <a href="https://berocket.com" target="_blank">BeRocket</a></h4>';
14
  }
includes/widget.php CHANGED
@@ -764,6 +764,9 @@ class BeRocket_AAPF_Widget extends WP_Widget {
764
  $terms = self::get_terms_child_parent ( $child_parent, $custom_taxonomy, FALSE, ( isset($child_parent_depth) ? $child_parent_depth : 0 ) );
765
  $terms = BeRocket_AAPF_Widget::get_attribute_values( $custom_taxonomy, 'id', ( empty($br_options['show_all_values']) ), ( ! empty($br_options['recount_products']) ), $terms, ( isset($cat_value_limit) ? $cat_value_limit : null ), $operator );
766
  }
 
 
 
767
  if ( $order_values_by != 'Default' || in_array($custom_taxonomy, array('berocket_brand', 'product_cat')) ) {
768
  self::sort_terms( $terms, array(
769
  "order_values_by" => $order_values_by,
@@ -771,9 +774,6 @@ class BeRocket_AAPF_Widget extends WP_Widget {
771
  "order_values_type"=> (empty($order_values_type) || $order_values_type == 'asc' ? SORT_ASC : SORT_DESC)
772
  ) );
773
  }
774
- if( $custom_taxonomy == 'product_cat' ) {
775
- $terms = BeRocket_AAPF_Widget::get_attribute_values( $custom_taxonomy, 'id', ( empty($br_options['show_all_values']) ), ( ! empty($br_options['recount_products']) ), $terms, ( isset($cat_value_limit) ? $cat_value_limit : null ), $operator );
776
- }
777
  if ( ! br_is_filtered() && $child_parent != 'parent' && $child_parent != 'child' ) {
778
  br_set_cache( $custom_taxonomy . $order_values_by, $terms, $filter_type . $wp_check_product_cat, BeRocket_AJAX_cache_expire );
779
  }
@@ -991,8 +991,8 @@ class BeRocket_AAPF_Widget extends WP_Widget {
991
  $max = count( $all_terms_name ) - 1;
992
  if( ! empty($stringed_is_numeric) ) {
993
  array_multisort( $all_terms_slug, SORT_NUMERIC, $all_terms_slug, $all_terms_name );
994
- } else {
995
- //array_multisort( $all_terms_name, $all_terms_name, $all_terms_slug );
996
  }
997
  }
998
  $widget_error_log['all_terms_slug'] = (isset($all_terms_slug) ? $all_terms_slug : null);
@@ -2443,15 +2443,7 @@ if( BeRocket_AAPF::$debug_mode ) {
2443
  }
2444
  @ array_multisort( $sort_array, $sort_data['order_values_type'], SORT_NUMERIC, $terms );
2445
  } elseif ( ! empty($sort_data['wc_order_by']) or ! empty($sort_data['order_values_by']) ) {
2446
- if ( ! empty($sort_data['order_values_by']) and ( ( ! empty($sort_data['wc_order_by']) and $sort_data['wc_order_by'] == 'name' and $sort_data['order_values_by'] == 'Default' ) or $sort_data['order_values_by'] == 'Alpha' ) ) {
2447
- foreach ( $terms as $term ) {
2448
- $sort_array[] = strtolower($term->name);
2449
- if ( ! empty($term->child) ) {
2450
- self::sort_terms( $term->child, $sort_data );
2451
- }
2452
- }
2453
- @ array_multisort( $sort_array, $sort_data['order_values_type'], SORT_STRING, $terms );
2454
- } elseif ( ! empty($sort_data['order_values_by']) and ( ( ! empty($sort_data['wc_order_by']) and $sort_data['wc_order_by'] == 'name_num' and $sort_data['order_values_by'] == 'Default' ) or $sort_data['order_values_by'] == 'Numeric' ) ) {
2455
  foreach ( $terms as $term ) {
2456
  $sort_array[] = (float)preg_replace('/\s+/', '', str_replace(',', '.', $term->name));
2457
  if ( ! empty($term->child) ) {
@@ -2460,34 +2452,42 @@ if( BeRocket_AAPF::$debug_mode ) {
2460
  }
2461
  @ array_multisort( $sort_array, $sort_data['order_values_type'], SORT_NUMERIC, $terms );
2462
  } else {
2463
- if( count($terms) ) {
2464
- $get_terms_args = array( 'hide_empty' => '0', 'fields' => 'ids' );
2465
 
 
 
 
2466
  $orderby = wc_attribute_orderby( $terms[0]->taxonomy );
 
2467
 
2468
- switch ( $orderby ) {
2469
- case 'name':
2470
- $get_terms_args['orderby'] = 'name';
2471
- $get_terms_args['menu_order'] = false;
2472
- break;
2473
- case 'id':
2474
- $get_terms_args['orderby'] = 'id';
2475
- $get_terms_args['order'] = 'ASC';
2476
- $get_terms_args['menu_order'] = false;
2477
- break;
2478
- case 'menu_order':
2479
- $get_terms_args['menu_order'] = 'ASC';
2480
- break;
2481
- default:
2482
- break;
2483
- }
2484
 
2485
- $terms2 = get_terms( $terms[0]->taxonomy, $get_terms_args );
 
 
2486
  foreach ( $terms as $term ) {
2487
  $sort_array[] = array_search($term->term_id, $terms2);
 
 
 
2488
  }
 
2489
  }
2490
- @ array_multisort( $sort_array, SORT_ASC, SORT_NUMERIC, $terms );
2491
  }
2492
  $sort_array = self::sort_child_parent_hierarchy($terms);
2493
  @ array_multisort( $sort_array, SORT_DESC, SORT_NUMERIC, $terms );
764
  $terms = self::get_terms_child_parent ( $child_parent, $custom_taxonomy, FALSE, ( isset($child_parent_depth) ? $child_parent_depth : 0 ) );
765
  $terms = BeRocket_AAPF_Widget::get_attribute_values( $custom_taxonomy, 'id', ( empty($br_options['show_all_values']) ), ( ! empty($br_options['recount_products']) ), $terms, ( isset($cat_value_limit) ? $cat_value_limit : null ), $operator );
766
  }
767
+ if( $custom_taxonomy == 'product_cat' ) {
768
+ $terms = BeRocket_AAPF_Widget::get_attribute_values( $custom_taxonomy, 'id', ( empty($br_options['show_all_values']) ), ( ! empty($br_options['recount_products']) ), $terms, ( isset($cat_value_limit) ? $cat_value_limit : null ), $operator );
769
+ }
770
  if ( $order_values_by != 'Default' || in_array($custom_taxonomy, array('berocket_brand', 'product_cat')) ) {
771
  self::sort_terms( $terms, array(
772
  "order_values_by" => $order_values_by,
774
  "order_values_type"=> (empty($order_values_type) || $order_values_type == 'asc' ? SORT_ASC : SORT_DESC)
775
  ) );
776
  }
 
 
 
777
  if ( ! br_is_filtered() && $child_parent != 'parent' && $child_parent != 'child' ) {
778
  br_set_cache( $custom_taxonomy . $order_values_by, $terms, $filter_type . $wp_check_product_cat, BeRocket_AJAX_cache_expire );
779
  }
991
  $max = count( $all_terms_name ) - 1;
992
  if( ! empty($stringed_is_numeric) ) {
993
  array_multisort( $all_terms_slug, SORT_NUMERIC, $all_terms_slug, $all_terms_name );
994
+ } elseif($filter_type == 'custom_taxonomy') {
995
+ array_multisort( $all_terms_name, $all_terms_name, $all_terms_slug );
996
  }
997
  }
998
  $widget_error_log['all_terms_slug'] = (isset($all_terms_slug) ? $all_terms_slug : null);
2443
  }
2444
  @ array_multisort( $sort_array, $sort_data['order_values_type'], SORT_NUMERIC, $terms );
2445
  } elseif ( ! empty($sort_data['wc_order_by']) or ! empty($sort_data['order_values_by']) ) {
2446
+ if ( ! empty($sort_data['order_values_by']) and $sort_data['order_values_by'] == 'Numeric' ) {
 
 
 
 
 
 
 
 
2447
  foreach ( $terms as $term ) {
2448
  $sort_array[] = (float)preg_replace('/\s+/', '', str_replace(',', '.', $term->name));
2449
  if ( ! empty($term->child) ) {
2452
  }
2453
  @ array_multisort( $sort_array, $sort_data['order_values_type'], SORT_NUMERIC, $terms );
2454
  } else {
2455
+ $get_terms_args = array( 'hide_empty' => '0', 'fields' => 'ids' );
 
2456
 
2457
+ if ( ! empty($sort_data['order_values_by']) and $sort_data['order_values_by'] == 'Alpha' ) {
2458
+ $orderby = 'name';
2459
+ } else {
2460
  $orderby = wc_attribute_orderby( $terms[0]->taxonomy );
2461
+ }
2462
 
2463
+ switch ( $orderby ) {
2464
+ case 'name':
2465
+ $get_terms_args['orderby'] = 'name';
2466
+ $get_terms_args['menu_order'] = false;
2467
+ break;
2468
+ case 'id':
2469
+ $get_terms_args['orderby'] = 'id';
2470
+ $get_terms_args['order'] = 'ASC';
2471
+ $get_terms_args['menu_order'] = false;
2472
+ break;
2473
+ case 'menu_order':
2474
+ $get_terms_args['menu_order'] = 'ASC';
2475
+ break;
2476
+ default:
2477
+ break;
2478
+ }
2479
 
2480
+ if( count($terms) ) {
2481
+ $terms_first = reset($terms);
2482
+ $terms2 = get_terms( $terms_first->taxonomy, $get_terms_args );
2483
  foreach ( $terms as $term ) {
2484
  $sort_array[] = array_search($term->term_id, $terms2);
2485
+ if ( ! empty($term->child) ) {
2486
+ self::sort_terms( $term->child, $sort_data );
2487
+ }
2488
  }
2489
+ @ array_multisort( $sort_array, $sort_data['order_values_type'], SORT_NUMERIC, $terms );
2490
  }
 
2491
  }
2492
  $sort_array = self::sort_child_parent_hierarchy($terms);
2493
  @ array_multisort( $sort_array, SORT_DESC, SORT_NUMERIC, $terms );
js/themes/the7.js CHANGED
@@ -52,3 +52,7 @@ function fixWooOrdering() {
52
  jQuery(this).customSelect();
53
  });
54
  }
 
 
 
 
52
  jQuery(this).customSelect();
53
  });
54
  }
55
+ jQuery(document).on('berocket_ajax_products_loaded', function() {
56
+ fixWooIsotope();
57
+ fixWooOrdering();
58
+ });
js/widget.min.js CHANGED
@@ -713,6 +713,8 @@ var berocket_aapf_widget_product_filters = [],
713
  }
714
  }
715
  // call user func on_update
 
 
716
  if( the_ajax_script.user_func != null )
717
  berocket_fire( the_ajax_script.user_func.on_update );
718
 
@@ -2176,6 +2178,9 @@ load_hash_test();
2176
  $element = $('.berocket_single_filter_widget.berocket_inline_filters:not(".berocket_inline_filters_rewidth")').first();
2177
  width_to_set = '12.5%!important';
2178
  $style = $element.attr('style');
 
 
 
2179
  $style = $style.replace(/width:\s?(\d|\.)+%!important;/g, '');
2180
  $style = $style.replace(/clear:both!important;/g, '');
2181
  $style = $style.replace(/opacity:0!important;/g, '');
713
  }
714
  }
715
  // call user func on_update
716
+
717
+ $(document).trigger('berocket_ajax_filtering_on_update');
718
  if( the_ajax_script.user_func != null )
719
  berocket_fire( the_ajax_script.user_func.on_update );
720
 
2178
  $element = $('.berocket_single_filter_widget.berocket_inline_filters:not(".berocket_inline_filters_rewidth")').first();
2179
  width_to_set = '12.5%!important';
2180
  $style = $element.attr('style');
2181
+ if( typeof($style) == 'undefined' ) {
2182
+ $style = '';
2183
+ }
2184
  $style = $style.replace(/width:\s?(\d|\.)+%!important;/g, '');
2185
  $style = $style.replace(/clear:both!important;/g, '');
2186
  $style = $style.replace(/opacity:0!important;/g, '');
main.php CHANGED
@@ -1299,7 +1299,6 @@ jQuery(document).on('change', '.br_selected_area_show', br_selected_area_show);
1299
  /* theme scripts */
1300
  if( defined('THE7_VERSION') && THE7_VERSION ) {
1301
  wp_enqueue_script( 'berocket_ajax_fix-the7', plugins_url( 'js/themes/the7.js', __FILE__ ), array( 'jquery' ), BeRocket_AJAX_filters_version );
1302
- add_filter('berocket_aapf_user_func', array($this, 'the7_fix'));
1303
  }
1304
  global $wp_query, $wp, $sitepress, $wp_rewrite;
1305
  $this->wp_print_special_scripts();
@@ -1431,10 +1430,6 @@ jQuery(document).on('change', '.br_selected_area_show', br_selected_area_show);
1431
  ) )
1432
  );
1433
  }
1434
- public function the7_fix($scripts) {
1435
- $scripts['after_update'] = 'fixWooIsotope();fixWooOrdering(); '.$scripts['after_update'];
1436
- return $scripts;
1437
- }
1438
  public function add_error_log( $error_log ) {
1439
  $error_log[plugin_basename( __FILE__ )] = self::$error_log;
1440
  return $error_log;
1299
  /* theme scripts */
1300
  if( defined('THE7_VERSION') && THE7_VERSION ) {
1301
  wp_enqueue_script( 'berocket_ajax_fix-the7', plugins_url( 'js/themes/the7.js', __FILE__ ), array( 'jquery' ), BeRocket_AJAX_filters_version );
 
1302
  }
1303
  global $wp_query, $wp, $sitepress, $wp_rewrite;
1304
  $this->wp_print_special_scripts();
1430
  ) )
1431
  );
1432
  }
 
 
 
 
1433
  public function add_error_log( $error_log ) {
1434
  $error_log[plugin_basename( __FILE__ )] = self::$error_log;
1435
  return $error_log;
readme.txt CHANGED
@@ -1,11 +1,11 @@
1
  === Advanced AJAX Product Filters ===
2
  Plugin Name: Advanced AJAX Product Filters
3
  Contributors: dholovnia, berocket
4
- Donate link: http://berocket.com/product/woocommerce-ajax-products-filter
5
  Tags: filters, product filters, ajax product filters, ajax filter, ajax filter widget, color filter, size filter, product onsale filter, product preview, product category filter, product reset filter, product sort by filter, stock filter, product tag filter, price range filter, price box filter, advanced product filters, woocommerce filters, woocommerce product filters, woocommerce products filter, woocommerce ajax product filters, widget, plugin, woocommerce item filters, filters plugin, ajax filters plugin, filter woocommerce products, filter woocommerce products plugin, wc filters, wc filters products, wc products filters, wc ajax products filters, wc product filters, wc advanced product filters, woocommerce layered nav, woocommerce layered navigation, ajax filtered nav, ajax filtered navigation, price filter, ajax price filter, woocommerce product sorting, sidebar filter, sidebar ajax filter, taxonomy filter, category filter, attribute filter, attributes filter, woocommerce product sort, ajax products filter plugin for woocommerce, rocket, berocket, berocket woocommerce ajax products filter
6
  Requires at least: 4.0
7
- Tested up to: 5.2.1
8
- Stable tag: 1.3.2.5
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -68,12 +68,12 @@ WooCommerce AJAX Product Filters - Advanced product filtering ability for your W
68
 
69
 
70
  = Plugin Links: =
71
- [Paid Plugin](http://berocket.com/product/woocommerce-ajax-products-filter)
72
- [Demo](http://woocommerce-products-filter.berocket.com/shop/)
73
- [Demo Description](http://woocommerce-products-filter.berocket.com/)
74
 
75
  = &#127852; Wanna try admin side? =
76
- [Admin Demo](http://berocket.com/product/woocommerce-ajax-products-filter#try-admin) - Get access to this plugin's admin and try it from inside. Change things and watch how they work.
77
 
78
  = Premium plugin video =
79
  [youtube https://youtu.be/8gaMj-IxUj0]
@@ -92,9 +92,6 @@ Advanced AJAX Product Filters has been tested and compatibility is certain with
92
  &#128312; [**Products Compare for WooCommerce**](https://wordpress.org/plugins/products-compare-for-woocommerce/)
93
  &#128312; [**Wishlist and Waitlist for WooCommerce**](https://wordpress.org/plugins/wish-wait-list-for-woocommerce/)
94
 
95
- Nevertheless, it could be compatible with many other WooCommerce plugins that have not been tested yet. If you want to inform us about compatibility with other plugins, please, [email to us](http://berocket.com/contact).
96
-
97
-
98
  = Shortcode: =
99
  * In editor `[br_filters attribute=price type=slider title="Price Filter"]`
100
  * In PHP `do_shortcode('[br_filters attribute=price type=slider title="Price Filter"]');`
@@ -170,11 +167,11 @@ If none of the previous listed actions helps you solve the problem, then, submit
170
 
171
 
172
  = How can I get more features for my WooCommerce plugin? =
173
- You can get more features with the premium version of Advanced AJAX Product Filters, available on [BeRocket page](http://berocket.com/product/woocommerce-ajax-products-filter). Here you can read more about the premium features of the plugin and make it give it its best shot!
174
 
175
 
176
  = How can I try the full-featured plugin? =
177
- You can try this plugin's admin side [here](http://berocket.com/product/woocommerce-ajax-products-filter#try-admin). Configure plugin the way you need to check the results.
178
 
179
  ---
180
 
@@ -187,6 +184,18 @@ You can try this plugin's admin side [here](http://berocket.com/product/woocomme
187
 
188
  == Changelog ==
189
 
 
 
 
 
 
 
 
 
 
 
 
 
190
  = 1.3.2.5 =
191
  * Enhancement - Option to use Standard tax rates for price filter
192
  * Enhancement - Separate Query Vars addon option to set Default operator for URLs
1
  === Advanced AJAX Product Filters ===
2
  Plugin Name: Advanced AJAX Product Filters
3
  Contributors: dholovnia, berocket
4
+ Donate link: https://berocket.com/product/woocommerce-ajax-products-filter?utm_source=wordpress_org&utm_medium=donate&utm_campaign=ajax_filters
5
  Tags: filters, product filters, ajax product filters, ajax filter, ajax filter widget, color filter, size filter, product onsale filter, product preview, product category filter, product reset filter, product sort by filter, stock filter, product tag filter, price range filter, price box filter, advanced product filters, woocommerce filters, woocommerce product filters, woocommerce products filter, woocommerce ajax product filters, widget, plugin, woocommerce item filters, filters plugin, ajax filters plugin, filter woocommerce products, filter woocommerce products plugin, wc filters, wc filters products, wc products filters, wc ajax products filters, wc product filters, wc advanced product filters, woocommerce layered nav, woocommerce layered navigation, ajax filtered nav, ajax filtered navigation, price filter, ajax price filter, woocommerce product sorting, sidebar filter, sidebar ajax filter, taxonomy filter, category filter, attribute filter, attributes filter, woocommerce product sort, ajax products filter plugin for woocommerce, rocket, berocket, berocket woocommerce ajax products filter
6
  Requires at least: 4.0
7
+ Tested up to: 5.2.2
8
+ Stable tag: 1.3.2.7
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
68
 
69
 
70
  = Plugin Links: =
71
+ [Paid Plugin](https://berocket.com/l/filters-upgrade/?utm_source=wordpress_org&utm_medium=plugin_links&utm_campaign=ajax_filters)
72
+ [Demo](https://woocommerce-products-filter.berocket.com/shop/?utm_source=wordpress_org&utm_medium=plugin_links&utm_campaign=ajax_filters)
73
+ [Demo Description](https://woocommerce-products-filter.berocket.com/?utm_source=wordpress_org&utm_medium=plugin_links&utm_campaign=ajax_filters)
74
 
75
  = &#127852; Wanna try admin side? =
76
+ [Admin Demo](https://berocket.com/product/woocommerce-ajax-products-filter?utm_source=wordpress_org&utm_medium=admin_demo&utm_campaign=ajax_filters#try-admin) - Get access to this plugin's admin and try it from inside. Change things and watch how they work.
77
 
78
  = Premium plugin video =
79
  [youtube https://youtu.be/8gaMj-IxUj0]
92
  &#128312; [**Products Compare for WooCommerce**](https://wordpress.org/plugins/products-compare-for-woocommerce/)
93
  &#128312; [**Wishlist and Waitlist for WooCommerce**](https://wordpress.org/plugins/wish-wait-list-for-woocommerce/)
94
 
 
 
 
95
  = Shortcode: =
96
  * In editor `[br_filters attribute=price type=slider title="Price Filter"]`
97
  * In PHP `do_shortcode('[br_filters attribute=price type=slider title="Price Filter"]');`
167
 
168
 
169
  = How can I get more features for my WooCommerce plugin? =
170
+ You can get more features with the premium version of Advanced AJAX Product Filters, available on [BeRocket page](https://berocket.com/l/filters-upgrade/?utm_source=wordpress_org&utm_medium=faq&utm_campaign=ajax_filters). Here you can read more about the premium features of the plugin and make it give it its best shot!
171
 
172
 
173
  = How can I try the full-featured plugin? =
174
+ You can try this plugin's admin side [here](https://berocket.com/product/woocommerce-ajax-products-filter?utm_source=wordpress_org&utm_medium=faq&utm_campaign=ajax_filters#try-admin). Configure plugin the way you need to check the results.
175
 
176
  ---
177
 
184
 
185
  == Changelog ==
186
 
187
+ = 1.3.2.7 =
188
+ * Fix - Links to BeRocket
189
+ * Fix - Compatibility with other BeRocket plugins
190
+ * Fix - Categories default sorting is not working
191
+ * Fix - Remove some php notices
192
+ * Fix - Reset in above products position break other filters
193
+ * Fix - Tax rates option for price
194
+
195
+ = 1.3.2.6 =
196
+ * Fix - Values Order - Default/Numeric, Order Type was not working with multigobyte values
197
+ * Fix - PHP notices/errors
198
+
199
  = 1.3.2.5 =
200
  * Enhancement - Option to use Standard tax rates for price filter
201
  * Enhancement - Separate Query Vars addon option to set Default operator for URLs
templates/filter_post.php CHANGED
@@ -245,7 +245,7 @@ $custom_taxonomies = array_combine($custom_taxonomies, $custom_taxonomies);
245
  $range_types = array(
246
  array('value' => '', 'name' => __('1.00-100.00, 101.00-200.00, 201.00-1000.00', 'BeRocket_AJAX_domain')),
247
  array('value' => 'same', 'name' => __('1.00-100.00, 100.00-200.00, 200.00-1000.00', 'BeRocket_AJAX_domain')),
248
- array('value' => 'decimal', 'name' => __('1.00-99.99, 100.00-199.99, 200.00-1000.00', 'BeRocket_AJAX_domain')),
249
  );
250
  foreach($range_types as $range_type) {
251
  echo '<option value="'.$range_type['value'].'"'.(br_get_value_from_array($instance, 'range_display_type') == $range_type['value'] ? ' selected' : '').'>'.$range_type['name'].'</option>';
@@ -261,10 +261,24 @@ $custom_taxonomies = array_combine($custom_taxonomies, $custom_taxonomies);
261
  </label>
262
  <br />
263
  <label>
264
- <input type="checkbox" name="<?php echo $post_name.'[show_last_to_infinity]'; ?>" <?php if ( ! empty($instance['show_last_to_infinity']) ) echo 'checked'; ?> value="1" />
265
  <?php _e('Show last range to the infinity', 'BeRocket_AJAX_domain') ?>
266
  </label>
267
  <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
268
  <label>
269
  <input type="checkbox" name="<?php echo $post_name.'[disable_multiple_ranges]'; ?>" <?php if ( ! empty($instance['disable_multiple_ranges']) ) echo 'checked'; ?> value="1" />
270
  <?php _e('Disable multiple selection?', 'BeRocket_AJAX_domain') ?>
245
  $range_types = array(
246
  array('value' => '', 'name' => __('1.00-100.00, 101.00-200.00, 201.00-1000.00', 'BeRocket_AJAX_domain')),
247
  array('value' => 'same', 'name' => __('1.00-100.00, 100.00-200.00, 200.00-1000.00', 'BeRocket_AJAX_domain')),
248
+ array('value' => 'decimal', 'name' => __('1.00-99.99, 100.00-199.99, 200.00-999.99', 'BeRocket_AJAX_domain')),
249
  );
250
  foreach($range_types as $range_type) {
251
  echo '<option value="'.$range_type['value'].'"'.(br_get_value_from_array($instance, 'range_display_type') == $range_type['value'] ? ' selected' : '').'>'.$range_type['name'].'</option>';
261
  </label>
262
  <br />
263
  <label>
264
+ <input class="braapf_show_last_to_infinity" type="checkbox" name="<?php echo $post_name.'[show_last_to_infinity]'; ?>" <?php if ( ! empty($instance['show_last_to_infinity']) ) echo 'checked'; ?> value="1" />
265
  <?php _e('Show last range to the infinity', 'BeRocket_AJAX_domain') ?>
266
  </label>
267
  <br />
268
+ <label class="braapf_to_infinity_text"<?php if ( empty($instance['show_last_to_infinity']) ) echo 'style="display:none;"'; ?>>
269
+ <?php _e('Infinity text', 'BeRocket_AJAX_domain') ?>
270
+ <input type="text" name="<?php echo $post_name.'[to_infinity_text]'; ?>" placeholder="&#8734;"value="<?php echo berocket_isset($instance['to_infinity_text']); ?>">
271
+ </label>
272
+ <script>
273
+ jQuery('.braapf_show_last_to_infinity').change(function() {
274
+ if( jQuery(this).prop('checked') ) {
275
+ jQuery('.braapf_to_infinity_text').show();
276
+ } else {
277
+ jQuery('.braapf_to_infinity_text').hide();
278
+ }
279
+ });
280
+ </script>
281
+ <br />
282
  <label>
283
  <input type="checkbox" name="<?php echo $post_name.'[disable_multiple_ranges]'; ?>" <?php if ( ! empty($instance['disable_multiple_ranges']) ) echo 'checked'; ?> value="1" />
284
  <?php _e('Disable multiple selection?', 'BeRocket_AJAX_domain') ?>
templates/filters_group.php CHANGED
@@ -86,6 +86,7 @@
86
  line-height: 40px;
87
  height: 40px;
88
  border-right-width: 3px;
 
89
  }
90
  .berocket_filter_added_list li .fa-bars {
91
  margin-right: 0.5em;
@@ -114,12 +115,13 @@
114
  }
115
  .berocket_filter_added_list .berocket_edit_filter {
116
  vertical-align: middle;
117
- font-size: 0.5em;
118
  float: right;
119
  line-height: 40px;
120
- height: 2em;
121
  display: inline-block;
122
  color: #2c3b48;
 
 
123
  }
124
  .berocket_filter_added_list li .fa-times:hover,
125
  .berocket_filter_added_list .berocket_edit_filter:hover {
@@ -148,4 +150,22 @@
148
  .berocket_filter_added_list.berocket_hidden_clickable_enabled .berocket_hidden_clickable_options {
149
  display: inline-block;
150
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  </style>
86
  line-height: 40px;
87
  height: 40px;
88
  border-right-width: 3px;
89
+ background-color: rgb(238, 238, 238);
90
  }
91
  .berocket_filter_added_list li .fa-bars {
92
  margin-right: 0.5em;
115
  }
116
  .berocket_filter_added_list .berocket_edit_filter {
117
  vertical-align: middle;
118
+ font-size: 0.6em;
119
  float: right;
120
  line-height: 40px;
 
121
  display: inline-block;
122
  color: #2c3b48;
123
+ margin-left: 0.5em;
124
+ margin-right: 0.5em;
125
  }
126
  .berocket_filter_added_list li .fa-times:hover,
127
  .berocket_filter_added_list .berocket_edit_filter:hover {
150
  .berocket_filter_added_list.berocket_hidden_clickable_enabled .berocket_hidden_clickable_options {
151
  display: inline-block;
152
  }
153
+ @media screen and (max-width: 600px) {
154
+ .berocket_filter_added_list small,
155
+ .berocket_filter_added_list .berocket_edit_filter {
156
+ display: none;
157
+ }
158
+ .berocket_filter_added_list li {
159
+ position: relative;
160
+ }
161
+ .berocket_filter_added_list li .fa-times {
162
+ position: absolute;
163
+ top: 1px;
164
+ right: 0;
165
+ background-color: rgb(238, 238, 238);
166
+ margin: 0;
167
+ padding: 0 10px;
168
+ line-height: 38px;
169
+ }
170
+ }
171
  </style>
templates/free/features.php CHANGED
@@ -5,7 +5,7 @@
5
  <h5>Our WooCommerce AJAX Products Filter offers several layouts including slider, image and color</h5>
6
 
7
  <div class="demo-site">
8
- <a href="https://woocommerce-products-filter.berocket.com/shop/" target="_blank">[ demo site ]</a>
9
  </div>
10
  <img alt="Choose best layout for your filter" src="https://berocket.com/images/features/filters/filters-types.jpg" />
11
  </div>
@@ -16,7 +16,7 @@
16
  <h5>Users will get next page loaded ordered by their preferences and without page reloading</h5>
17
 
18
  <div class="demo-site">
19
- <a href="https://woocommerce-products-filter.berocket.com/shop/" target="_blank">[ demo site ]</a>
20
  </div>
21
 
22
  <img alt="Pagination and Order without page reloading" src="https://berocket.com/images/features/filters/ajax_order_nav.jpg" />
@@ -28,7 +28,7 @@
28
  <h5>Need more space for the products? Say no to sidebars</h5>
29
 
30
  <div class="demo-site">
31
- <a href="https://woocommerce-products-filter.berocket.com/product-category/tshirts/" target="_blank">[ demo site ]</a>
32
  </div>
33
  <img alt="Show filters above products" src="https://berocket.com/images/features/filters/above_products.jpg" />
34
  </div>
@@ -39,7 +39,7 @@
39
  <h5>Use Nice URLs with canonicalization and slugs instead of IDs</h5>
40
 
41
  <div class="demo-site">
42
- <a href="https://woocommerce-products-filter.berocket.com/product-category/tshirts/" target="_blank">[ demo site ]</a>
43
  </div>
44
 
45
  <div>&nbsp;</div>
@@ -48,10 +48,10 @@
48
 
49
  <div class="premium_buttons">
50
  <span>Read more about</span>
51
- <a class="get_premium_version" href="https://berocket.com/product/woocommerce-ajax-products-filter?utm_source=free_plugin&utm_medium=wordpress_org&utm_campaign=features&utm_content=block_get_premium" target="_blank">PREMIUM VERSION</a>
52
  <span class="divider">OR</span>
53
- <a class="buy_premium_version" href="https://berocket.com/product/woocommerce-ajax-products-filter/SAVE15?utm_source=free_plugin&utm_medium=wordpress_org&utm_campaign=features&utm_content=block_buy_premium" target="_blank">BUY NOW</a>
54
- <span>and get <b>15% discount</b></span>
55
  </div>
56
  <div class="clear"></div>
57
 
@@ -61,7 +61,7 @@
61
  <h5>Show users what they will get before filters applied. Fast and efficient</h5>
62
 
63
  <div class="demo-site">
64
- <a href="https://woocommerce-products-filter.berocket.com/woocommerce-products-filter-demo-4/" target="_blank">[ demo site ]</a>
65
  </div>
66
 
67
  <div>&nbsp;</div>
@@ -75,7 +75,7 @@
75
  <h5>Show only needed values from the attribute or hide few</h5>
76
 
77
  <div class="demo-site">
78
- <a href="https://woocommerce-products-filter.berocket.com/woocommerce-products-filter-demo-4/" target="_blank">[ demo site ]</a>
79
  </div>
80
  <img alt="Include/Exclude values" src="https://berocket.com/images/features/filters/include_exclude.jpg" />
81
  </div>
@@ -86,7 +86,7 @@
86
  <h5>Users can pre-fill filters before visiting shop page</h5>
87
 
88
  <div class="demo-site">
89
- <a href="https://woocommerce-products-filter.berocket.com/" target="_blank">[ demo site ]</a>
90
  </div>
91
  <img alt="Search Box on any page" src="https://berocket.com/images/features/filters/searchbox.jpg" />
92
  </div>
@@ -97,7 +97,7 @@
97
  <h5>Hate &quot;No Products!&quot; message? Hide values without products on the go</h5>
98
 
99
  <div class="demo-site">
100
- <a href="https://woocommerce-products-filter.berocket.com/shop/" target="_blank">[ demo site ]</a>
101
  </div>
102
 
103
  <div>&nbsp;</div>
@@ -107,7 +107,7 @@
107
 
108
  <div class="premium_buttons">
109
  <span>Read more about</span>
110
- <a class="get_premium_version" href="https://berocket.com/product/woocommerce-ajax-products-filter?utm_source=free_plugin&utm_medium=wordpress_org&utm_campaign=features&utm_content=single_get_premium" target="_blank">PREMIUM VERSION</a>
111
  </div>
112
  <div class="clear"></div>
113
 
@@ -119,7 +119,7 @@
119
  <h5>Users love brands. Help them find favorite brands faster</h5>
120
 
121
  <div class="demo-site">
122
- <a href="https://woocommerce-products-filter.berocket.com/woocommerce-products-filter-demo-5/" target="_blank">[ demo site ]</a>
123
  </div>
124
  <img alt="Brands" src="https://berocket.com/images/features/filters/brands.jpg" />
125
  </div>
@@ -130,7 +130,7 @@
130
  <h5>Love sliders? Use them now for the attributes too!</h5>
131
 
132
  <div class="demo-site">
133
- <a href="https://woocommerce-products-filter.berocket.com/woocommerce-products-filter-demo-2/" target="_blank">[ demo site ]</a>
134
  </div>
135
  <img alt="Price Ranges and Sliders for Attributes" src="https://berocket.com/images/features/filters/range_slider.jpg" />
136
  </div>
@@ -145,8 +145,8 @@
145
 
146
 
147
  <div class="premium_buttons">
148
- <a class="buy_premium_version" href="https://berocket.com/product/woocommerce-ajax-products-filter/SAVE15?utm_source=free_plugin&utm_medium=wordpress_org&utm_campaign=features&utm_content=single_buy_premium" target="_blank">BUY NOW</a>
149
- <span>and get <b>15% discount</b></span>
150
  </div>
151
 
152
  <div class="clear"></div>
5
  <h5>Our WooCommerce AJAX Products Filter offers several layouts including slider, image and color</h5>
6
 
7
  <div class="demo-site">
8
+ <a href="https://woocommerce-products-filter.berocket.com/shop/?utm_source=free_plugin&utm_medium=upgrade&utm_campaign=ajax_filters" target="_blank">[ demo site ]</a>
9
  </div>
10
  <img alt="Choose best layout for your filter" src="https://berocket.com/images/features/filters/filters-types.jpg" />
11
  </div>
16
  <h5>Users will get next page loaded ordered by their preferences and without page reloading</h5>
17
 
18
  <div class="demo-site">
19
+ <a href="https://woocommerce-products-filter.berocket.com/shop/?utm_source=free_plugin&utm_medium=upgrade&utm_campaign=ajax_filters" target="_blank">[ demo site ]</a>
20
  </div>
21
 
22
  <img alt="Pagination and Order without page reloading" src="https://berocket.com/images/features/filters/ajax_order_nav.jpg" />
28
  <h5>Need more space for the products? Say no to sidebars</h5>
29
 
30
  <div class="demo-site">
31
+ <a href="https://woocommerce-products-filter.berocket.com/product-category/tshirts/?utm_source=free_plugin&utm_medium=upgrade&utm_campaign=ajax_filters" target="_blank">[ demo site ]</a>
32
  </div>
33
  <img alt="Show filters above products" src="https://berocket.com/images/features/filters/above_products.jpg" />
34
  </div>
39
  <h5>Use Nice URLs with canonicalization and slugs instead of IDs</h5>
40
 
41
  <div class="demo-site">
42
+ <a href="https://woocommerce-products-filter.berocket.com/product-category/tshirts/?utm_source=free_plugin&utm_medium=upgrade&utm_campaign=ajax_filters" target="_blank">[ demo site ]</a>
43
  </div>
44
 
45
  <div>&nbsp;</div>
48
 
49
  <div class="premium_buttons">
50
  <span>Read more about</span>
51
+ <a class="get_premium_version" href="https://berocket.com/l/filters-upgrade/?utm_source=free_plugin&utm_medium=upgrade&utm_campaign=ajax_filters&utm_content=read_more&utm_term=first" target="_blank">PREMIUM VERSION</a>
52
  <span class="divider">OR</span>
53
+ <a class="buy_premium_version" href="https://berocket.com/l/filters-upgrade/?utm_source=free_plugin&utm_medium=upgrade&utm_campaign=ajax_filters&utm_content=buy_now&utm_term=first#pricing" target="_blank">BUY NOW</a>
54
+ <span>and get Up to <b>60% discount</b></span>
55
  </div>
56
  <div class="clear"></div>
57
 
61
  <h5>Show users what they will get before filters applied. Fast and efficient</h5>
62
 
63
  <div class="demo-site">
64
+ <a href="https://woocommerce-products-filter.berocket.com/woocommerce-products-filter-demo-4/?utm_source=free_plugin&utm_medium=upgrade&utm_campaign=ajax_filters" target="_blank">[ demo site ]</a>
65
  </div>
66
 
67
  <div>&nbsp;</div>
75
  <h5>Show only needed values from the attribute or hide few</h5>
76
 
77
  <div class="demo-site">
78
+ <a href="https://woocommerce-products-filter.berocket.com/woocommerce-products-filter-demo-4/?utm_source=free_plugin&utm_medium=upgrade&utm_campaign=ajax_filters" target="_blank">[ demo site ]</a>
79
  </div>
80
  <img alt="Include/Exclude values" src="https://berocket.com/images/features/filters/include_exclude.jpg" />
81
  </div>
86
  <h5>Users can pre-fill filters before visiting shop page</h5>
87
 
88
  <div class="demo-site">
89
+ <a href="https://woocommerce-products-filter.berocket.com/?utm_source=free_plugin&utm_medium=upgrade&utm_campaign=ajax_filters" target="_blank">[ demo site ]</a>
90
  </div>
91
  <img alt="Search Box on any page" src="https://berocket.com/images/features/filters/searchbox.jpg" />
92
  </div>
97
  <h5>Hate &quot;No Products!&quot; message? Hide values without products on the go</h5>
98
 
99
  <div class="demo-site">
100
+ <a href="https://woocommerce-products-filter.berocket.com/shop/?utm_source=free_plugin&utm_medium=upgrade&utm_campaign=ajax_filters" target="_blank">[ demo site ]</a>
101
  </div>
102
 
103
  <div>&nbsp;</div>
107
 
108
  <div class="premium_buttons">
109
  <span>Read more about</span>
110
+ <a class="get_premium_version" href="https://berocket.com/l/filters-upgrade/?utm_source=free_plugin&utm_medium=upgrade&utm_campaign=ajax_filters&utm_content=read_more&utm_term=second" target="_blank">PREMIUM VERSION</a>
111
  </div>
112
  <div class="clear"></div>
113
 
119
  <h5>Users love brands. Help them find favorite brands faster</h5>
120
 
121
  <div class="demo-site">
122
+ <a href="https://woocommerce-products-filter.berocket.com/woocommerce-products-filter-demo-5/?utm_source=free_plugin&utm_medium=upgrade&utm_campaign=ajax_filters" target="_blank">[ demo site ]</a>
123
  </div>
124
  <img alt="Brands" src="https://berocket.com/images/features/filters/brands.jpg" />
125
  </div>
130
  <h5>Love sliders? Use them now for the attributes too!</h5>
131
 
132
  <div class="demo-site">
133
+ <a href="https://woocommerce-products-filter.berocket.com/woocommerce-products-filter-demo-2/?utm_source=free_plugin&utm_medium=upgrade&utm_campaign=ajax_filters" target="_blank">[ demo site ]</a>
134
  </div>
135
  <img alt="Price Ranges and Sliders for Attributes" src="https://berocket.com/images/features/filters/range_slider.jpg" />
136
  </div>
145
 
146
 
147
  <div class="premium_buttons">
148
+ <a class="buy_premium_version" href="https://berocket.com/l/filters-upgrade/?utm_source=free_plugin&utm_medium=upgrade&utm_campaign=ajax_filters&utm_content=buy_now&utm_term=second#pricing" target="_blank">BUY NOW</a>
149
+ <span>and get Up to <b>60% discount</b></span>
150
  </div>
151
 
152
  <div class="clear"></div>
templates/premium.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $feature_list = ( empty($this->cc->feature_list) ? null : $this->cc->feature_list );
3
+ $dplugin_link = 'https://berocket.com/product/' . $this->cc->values['premium_slug'];
4
+ $dplugin_lic = br_get_value_from_array($this->cc->info, 'lic_id');
5
+ $plugin_landing_page = 'https://berocket.com/l/filters-upgrade/?utm_source=free_plugin&utm_medium=settings&utm_campaign=ajax_filters&utm_content=read_more';
6
+ $dplugin_lic_link = $plugin_landing_pricing = 'https://berocket.com/l/filters-upgrade/?utm_source=free_plugin&utm_medium=settings&utm_campaign=ajax_filters&utm_content=buy_now#pricing';
7
+ if ( isset($this->plugin_version_capability) && $this->plugin_version_capability <= 5 ) {
8
+ echo apply_filters('berocket_rate_plugin_window', '', br_get_value_from_array($this->cc->info, 'id'));
9
+ if ( ! empty( $feature_list ) && count( $feature_list ) > 0 ) { ?>
10
+ <div class="paid_features">
11
+ <?php
12
+ $feature_text = '';
13
+ foreach ( $feature_list as $feature ) {
14
+ $feature_text .= '<li>' . $feature . '</li>';
15
+ }
16
+ $text = '<h3>Unlock all the features with Premium version!</h3>
17
+ <div>
18
+ <ul>
19
+ %feature_list%
20
+ </ul>
21
+ </div>
22
+ <div class="premium_buttons">
23
+ <span>Read more about</span>
24
+ <a class="get_premium_version" href="%link%" target="_blank">PREMIUM VERSION</a>
25
+ <span class="divider">OR</span>
26
+ <a class="buy_premium_version" href="%licence_link%" target="_blank">BUY NOW</a>
27
+ <span>and get Up to <b>%discount% discount</b></span>
28
+ </div>
29
+ <p class="berocket_paid_features_support">Support the plugin by purchasing paid version<br>
30
+ This will help us release next version</p>';
31
+
32
+ $dpdiscount = '60%';
33
+ if ( isset( $start_time ) and isset( $end_time ) and isset( $discount ) and time() > $start_time && time() < $end_time and (int) $discount > 15 ) {
34
+ $dpdiscount = $discount;
35
+ }
36
+
37
+ $text = str_replace( '%feature_list%', $feature_text, $text );
38
+ $text = str_replace( '%link%', $plugin_landing_page, $text );
39
+ $text = str_replace( '%licence%', $plugin_landing_page, $text );
40
+ $text = str_replace( '%licence_link%', $plugin_landing_pricing, $text );
41
+ $text = str_replace( '%discount%', $dpdiscount, $text );
42
+ $text = str_replace( '%plugin_name%', (empty($plugin_info['Name']) ? '' : $plugin_info['Name']), $text );
43
+ $text = str_replace( '%plugin_link%', (empty($plugin_info['PluginURI']) ? '' : $plugin_info['PluginURI']), $text );
44
+ echo $text;
45
+ ?>
46
+ </div>
47
+ <?php
48
+ }
49
+ echo apply_filters('berocket_feature_request_window', '', br_get_value_from_array($this->cc->info, 'id'));
50
+ $subscribed = get_option('berocket_email_subscribed');
51
+ if( ! $subscribed ) {
52
+ $user_email = wp_get_current_user();
53
+ if( isset($user_email->user_email) ) {
54
+ $user_email = $user_email->user_email;
55
+ } else {
56
+ $user_email = '';
57
+ }
58
+ ?>
59
+ <div class="berocket_subscribe berocket_subscribe_form" method="POST" action="<?php echo admin_url( 'admin-ajax.php' ); ?>">
60
+ <h3>OUR NEWSLETTER</h3>
61
+ <p>Get awesome content delivered straight to your inbox.</p>
62
+ <input type="hidden" name="berocket_action" value="berocket_subscribe_email">
63
+ <input class="berocket_subscribe_email" type="email" name="email" placeholder="Enter your email address" value="<?php echo $user_email; ?>">
64
+ <p class="error" style="display: none;">Incorrect EMail. Please check it and try again</p>
65
+ <input type="submit" class="button-primary button berocket_notice_submit" value="SUBSCRIBE">
66
+ </div>
67
+ <?php
68
+ berocket_admin_notices::echo_jquery_functions();
69
+ }
70
+ }
woocommerce-filters.php CHANGED
@@ -1,18 +1,16 @@
1
  <?php
2
  /**
3
  * Plugin Name: Advanced AJAX Product Filters for WooCommerce
4
- * Plugin URI: https://wordpress.org/plugins/woocommerce-ajax-filters/
5
  * Description: Unlimited AJAX products filters to make your shop perfect
6
- * Version: 1.3.2.5
7
  * Author: BeRocket
8
  * Requires at least: 4.0
9
- * Author URI: http://berocket.com
10
- * License: Berocket License
11
- * License URI: http://berocket.com/license
12
  * Text Domain: BeRocket_AJAX_domain
13
  * Domain Path: /languages/
14
  * WC tested up to: 3.6.4
15
  */
16
- define( "BeRocket_AJAX_filters_version", '1.3.2.5' );
17
  define( "BeRocket_AJAX_filters_file", __FILE__ );
18
  include_once('main.php');
1
  <?php
2
  /**
3
  * Plugin Name: Advanced AJAX Product Filters for WooCommerce
4
+ * Plugin URI: https://wordpress.org/plugins/woocommerce-ajax-filters/?utm_source=free_plugin&utm_medium=plugins&utm_campaign=ajax_filters
5
  * Description: Unlimited AJAX products filters to make your shop perfect
6
+ * Version: 1.3.2.7
7
  * Author: BeRocket
8
  * Requires at least: 4.0
9
+ * Author URI: https://berocket.com?utm_source=free_plugin&utm_medium=plugins&utm_campaign=ajax_filters
 
 
10
  * Text Domain: BeRocket_AJAX_domain
11
  * Domain Path: /languages/
12
  * WC tested up to: 3.6.4
13
  */
14
+ define( "BeRocket_AJAX_filters_version", '1.3.2.7' );
15
  define( "BeRocket_AJAX_filters_file", __FILE__ );
16
  include_once('main.php');