Premmerce Permalink Manager for WooCommerce - Version 2.3.5

Version Description

Release Date: Mar 3, 2022

  • Update - ode for PHP Coding Standards
Download this release

Release Info

Developer premmerce
Plugin Icon 128x128 Premmerce Permalink Manager for WooCommerce
Version 2.3.5
Comparing to
See all releases

Code changes from version 2.3.4 to 2.3.5

Files changed (54) hide show
  1. assets/admin/js/settings.js +7 -0
  2. freemius/assets/img/woo-permalink-manager.png +0 -0
  3. freemius/includes/class-freemius.php +25 -2
  4. freemius/includes/managers/class-fs-admin-notice-manager.php +7 -2
  5. freemius/includes/sdk/Exceptions/ArgumentNotExistException.php +5 -1
  6. freemius/includes/sdk/Exceptions/EmptyArgumentException.php +5 -1
  7. freemius/includes/sdk/Exceptions/Exception.php +5 -1
  8. freemius/includes/sdk/Exceptions/InvalidArgumentException.php +5 -1
  9. freemius/includes/sdk/Exceptions/OAuthException.php +5 -1
  10. freemius/includes/sdk/FreemiusBase.php +4 -0
  11. freemius/includes/sdk/FreemiusWordPress.php +4 -1
  12. freemius/require.php +5 -1
  13. freemius/start.php +1 -1
  14. freemius/templates/account/partials/addon.php +6 -1
  15. freemius/templates/ajax-loader.php +6 -1
  16. freemius/templates/debug.php +8 -2
  17. freemius/templates/firewall-issues-js.php +10 -6
  18. freemius/templates/partials/network-activation.php +6 -1
  19. freemius/templates/sticky-admin-notice-js.php +4 -2
  20. premmerce-url-manager.php +23 -24
  21. readme.txt +12 -2
  22. src/Addons/AddonInterface.php +5 -5
  23. src/Addons/AddonManager.php +18 -16
  24. src/Addons/BreadcrumbsAddon.php +84 -88
  25. src/Addons/YoastBreadcrumbsAddon.php +23 -26
  26. src/Admin/Admin.php +344 -289
  27. src/Admin/AffiliateTab.php +24 -28
  28. src/Admin/BundleAndSave.php +147 -109
  29. src/Admin/Settings.php +53 -15
  30. src/Admin/Tabs/Base/TabInterface.php +27 -26
  31. src/Frontend/Frontend.php +8 -12
  32. src/PermalinkListener.php +6 -8
  33. src/Updater.php +71 -76
  34. src/UrlManagerPlugin.php +166 -153
  35. vendor/composer/installed.php +2 -2
  36. views/admin/banner.php +29 -23
  37. views/admin/main.php +30 -25
  38. views/admin/section/additional.php +99 -102
  39. views/admin/section/category.php +34 -34
  40. views/admin/section/product.php +47 -47
  41. views/admin/section/sku.php +36 -51
  42. views/admin/section/suffix.php +96 -108
  43. views/admin/tabs/account.php +4 -4
  44. views/admin/tabs/bundle-and-save/faq.php +89 -80
  45. views/admin/tabs/bundle-and-save/featured-in.php +45 -44
  46. views/admin/tabs/bundle-and-save/header.php +2 -4
  47. views/admin/tabs/bundle-and-save/pricing.php +140 -157
  48. views/admin/tabs/bundle-and-save/testimonials.php +59 -54
  49. views/admin/tabs/bundle-and-save/texts.php +65 -63
  50. views/admin/tabs/bundle-and-save/thanks.php +18 -18
  51. views/admin/tabs/bundle_and_save.php +3 -2
  52. views/admin/tabs/contact.php +2 -2
  53. views/admin/tabs/pricing.php +2 -2
  54. views/admin/tabs/settings.php +3 -9
assets/admin/js/settings.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function ($) {
2
+ jQuery(":input").inputmask();
3
+
4
+ $('#permalink_url_suffix').on('input', function () {
5
+ $('.permalink_url_suffix').text($(this).val());
6
+ });
7
+ });
freemius/assets/img/woo-permalink-manager.png DELETED
Binary file
freemius/includes/class-freemius.php CHANGED
@@ -3550,6 +3550,8 @@
3550
  * @since 1.1.7.3
3551
  */
3552
  static function _toggle_debug_mode() {
 
 
3553
  if ( ! is_super_admin() ) {
3554
  return;
3555
  }
@@ -3571,10 +3573,19 @@
3571
  * @since 1.2.1.6
3572
  */
3573
  static function _get_debug_log() {
 
 
 
 
 
 
 
 
 
3574
  $logs = FS_Logger::load_db_logs(
3575
  fs_request_get( 'filters', false, 'post' ),
3576
- ! empty( $_POST['limit'] ) && is_numeric( $_POST['limit'] ) ? $_POST['limit'] : 200,
3577
- ! empty( $_POST['offset'] ) && is_numeric( $_POST['offset'] ) ? $_POST['offset'] : 0
3578
  );
3579
 
3580
  self::shoot_ajax_success( $logs );
@@ -4447,6 +4458,12 @@
4447
  * @since 1.0.9
4448
  */
4449
  function _email_about_firewall_issue() {
 
 
 
 
 
 
4450
  $this->_admin_notices->remove_sticky( 'failed_connect_api' );
4451
 
4452
  $pong = $this->ping();
@@ -4521,6 +4538,12 @@
4521
  * @since 1.1.7.4
4522
  */
4523
  function _retry_connectivity_test() {
 
 
 
 
 
 
4524
  $this->_admin_notices->remove_sticky( 'failed_connect_api_first' );
4525
 
4526
  $pong = $this->ping();
3550
  * @since 1.1.7.3
3551
  */
3552
  static function _toggle_debug_mode() {
3553
+ check_admin_referer( 'fs_toggle_debug_mode' );
3554
+
3555
  if ( ! is_super_admin() ) {
3556
  return;
3557
  }
3573
  * @since 1.2.1.6
3574
  */
3575
  static function _get_debug_log() {
3576
+ check_admin_referer( 'fs_get_debug_log' );
3577
+
3578
+ if ( ! is_super_admin() ) {
3579
+ return;
3580
+ }
3581
+
3582
+ $limit = min( ! empty( $_POST['limit'] ) ? absint( $_POST['limit'] ) : 200, 200 );
3583
+ $offset = min( ! empty( $_POST['offset'] ) ? absint( $_POST['offset'] ) : 200, 200 );
3584
+
3585
  $logs = FS_Logger::load_db_logs(
3586
  fs_request_get( 'filters', false, 'post' ),
3587
+ $limit,
3588
+ $offset
3589
  );
3590
 
3591
  self::shoot_ajax_success( $logs );
4458
  * @since 1.0.9
4459
  */
4460
  function _email_about_firewall_issue() {
4461
+ check_admin_referer( 'fs_resolve_firewall_issues' );
4462
+
4463
+ if ( ! current_user_can( is_multisite() ? 'manage_options' : 'activate_plugins' ) ) {
4464
+ return;
4465
+ }
4466
+
4467
  $this->_admin_notices->remove_sticky( 'failed_connect_api' );
4468
 
4469
  $pong = $this->ping();
4538
  * @since 1.1.7.4
4539
  */
4540
  function _retry_connectivity_test() {
4541
+ check_admin_referer( 'fs_retry_connectivity_test' );
4542
+
4543
+ if ( ! current_user_can( is_multisite() ? 'manage_options' : 'activate_plugins' ) ) {
4544
+ return;
4545
+ }
4546
+
4547
  $this->_admin_notices->remove_sticky( 'failed_connect_api_first' );
4548
 
4549
  $pong = $this->ping();
freemius/includes/managers/class-fs-admin-notice-manager.php CHANGED
@@ -175,7 +175,12 @@
175
  *
176
  */
177
  function dismiss_notice_ajax_callback() {
178
- $this->_sticky_storage->remove( $_POST['message_id'] );
 
 
 
 
 
179
  wp_die();
180
  }
181
 
@@ -469,4 +474,4 @@
469
  }
470
 
471
  #endregion
472
- }
175
  *
176
  */
177
  function dismiss_notice_ajax_callback() {
178
+ check_admin_referer( 'fs_dismiss_notice_action' );
179
+
180
+ if ( ! is_numeric( $_POST['message_id'] ) ) {
181
+ $this->_sticky_storage->remove( $_POST['message_id'] );
182
+ }
183
+
184
  wp_die();
185
  }
186
 
474
  }
475
 
476
  #endregion
477
+ }
freemius/includes/sdk/Exceptions/ArgumentNotExistException.php CHANGED
@@ -1,4 +1,8 @@
1
  <?php
 
 
 
 
2
  if ( ! class_exists( 'Freemius_InvalidArgumentException' ) ) {
3
  exit;
4
  }
@@ -6,4 +10,4 @@
6
  if ( ! class_exists( 'Freemius_ArgumentNotExistException' ) ) {
7
  class Freemius_ArgumentNotExistException extends Freemius_InvalidArgumentException {
8
  }
9
- }
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+
6
  if ( ! class_exists( 'Freemius_InvalidArgumentException' ) ) {
7
  exit;
8
  }
10
  if ( ! class_exists( 'Freemius_ArgumentNotExistException' ) ) {
11
  class Freemius_ArgumentNotExistException extends Freemius_InvalidArgumentException {
12
  }
13
+ }
freemius/includes/sdk/Exceptions/EmptyArgumentException.php CHANGED
@@ -1,4 +1,8 @@
1
  <?php
 
 
 
 
2
  if ( ! class_exists( 'Freemius_InvalidArgumentException' ) ) {
3
  exit;
4
  }
@@ -6,4 +10,4 @@
6
  if ( ! class_exists( 'Freemius_EmptyArgumentException' ) ) {
7
  class Freemius_EmptyArgumentException extends Freemius_InvalidArgumentException {
8
  }
9
- }
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+
6
  if ( ! class_exists( 'Freemius_InvalidArgumentException' ) ) {
7
  exit;
8
  }
10
  if ( ! class_exists( 'Freemius_EmptyArgumentException' ) ) {
11
  class Freemius_EmptyArgumentException extends Freemius_InvalidArgumentException {
12
  }
13
+ }
freemius/includes/sdk/Exceptions/Exception.php CHANGED
@@ -1,4 +1,8 @@
1
  <?php
 
 
 
 
2
  if ( ! class_exists( 'Freemius_Exception' ) ) {
3
  /**
4
  * Thrown when an API call returns an exception.
@@ -71,4 +75,4 @@
71
  return $str . $this->getMessage();
72
  }
73
  }
74
- }
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+
6
  if ( ! class_exists( 'Freemius_Exception' ) ) {
7
  /**
8
  * Thrown when an API call returns an exception.
75
  return $str . $this->getMessage();
76
  }
77
  }
78
+ }
freemius/includes/sdk/Exceptions/InvalidArgumentException.php CHANGED
@@ -1,8 +1,12 @@
1
  <?php
 
 
 
 
2
  if ( ! class_exists( 'Freemius_Exception' ) ) {
3
  exit;
4
  }
5
 
6
  if ( ! class_exists( 'Freemius_InvalidArgumentException' ) ) {
7
  class Freemius_InvalidArgumentException extends Freemius_Exception { }
8
- }
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+
6
  if ( ! class_exists( 'Freemius_Exception' ) ) {
7
  exit;
8
  }
9
 
10
  if ( ! class_exists( 'Freemius_InvalidArgumentException' ) ) {
11
  class Freemius_InvalidArgumentException extends Freemius_Exception { }
12
+ }
freemius/includes/sdk/Exceptions/OAuthException.php CHANGED
@@ -1,4 +1,8 @@
1
  <?php
 
 
 
 
2
  if ( ! class_exists( 'Freemius_Exception' ) ) {
3
  exit;
4
  }
@@ -9,4 +13,4 @@
9
  parent::__construct( $pResult );
10
  }
11
  }
12
- }
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+
6
  if ( ! class_exists( 'Freemius_Exception' ) ) {
7
  exit;
8
  }
13
  parent::__construct( $pResult );
14
  }
15
  }
16
+ }
freemius/includes/sdk/FreemiusBase.php CHANGED
@@ -15,6 +15,10 @@
15
  * under the License.
16
  */
17
 
 
 
 
 
18
  if ( ! defined( 'FS_API__VERSION' ) ) {
19
  define( 'FS_API__VERSION', '1' );
20
  }
15
  * under the License.
16
  */
17
 
18
+ if ( ! defined( 'ABSPATH' ) ) {
19
+ exit;
20
+ }
21
+
22
  if ( ! defined( 'FS_API__VERSION' ) ) {
23
  define( 'FS_API__VERSION', '1' );
24
  }
freemius/includes/sdk/FreemiusWordPress.php CHANGED
@@ -14,6 +14,9 @@
14
  * License for the specific language governing permissions and limitations
15
  * under the License.
16
  */
 
 
 
17
 
18
  require_once dirname( __FILE__ ) . '/FreemiusBase.php';
19
 
@@ -709,4 +712,4 @@
709
  }
710
 
711
  #endregion
712
- }
14
  * License for the specific language governing permissions and limitations
15
  * under the License.
16
  */
17
+ if ( ! defined( 'ABSPATH' ) ) {
18
+ exit;
19
+ }
20
 
21
  require_once dirname( __FILE__ ) . '/FreemiusBase.php';
22
 
712
  }
713
 
714
  #endregion
715
+ }
freemius/require.php CHANGED
@@ -6,6 +6,10 @@
6
  * @since 1.1.9
7
  */
8
 
 
 
 
 
9
  // Configuration should be loaded first.
10
  require_once dirname( __FILE__ ) . '/config.php';
11
  require_once WP_FS__DIR_INCLUDES . '/fs-core-functions.php';
@@ -46,4 +50,4 @@
46
  require_once WP_FS__DIR_INCLUDES . '/class-fs-admin-notices.php';
47
  require_once WP_FS__DIR_INCLUDES . '/class-freemius-abstract.php';
48
  require_once WP_FS__DIR_INCLUDES . '/sdk/Exceptions/Exception.php';
49
- require_once WP_FS__DIR_INCLUDES . '/class-freemius.php';
6
  * @since 1.1.9
7
  */
8
 
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
  // Configuration should be loaded first.
14
  require_once dirname( __FILE__ ) . '/config.php';
15
  require_once WP_FS__DIR_INCLUDES . '/fs-core-functions.php';
50
  require_once WP_FS__DIR_INCLUDES . '/class-fs-admin-notices.php';
51
  require_once WP_FS__DIR_INCLUDES . '/class-freemius-abstract.php';
52
  require_once WP_FS__DIR_INCLUDES . '/sdk/Exceptions/Exception.php';
53
+ require_once WP_FS__DIR_INCLUDES . '/class-freemius.php';
freemius/start.php CHANGED
@@ -15,7 +15,7 @@
15
  *
16
  * @var string
17
  */
18
- $this_sdk_version = '2.4.2';
19
 
20
  #region SDK Selection Logic --------------------------------------------------------------------
21
 
15
  *
16
  * @var string
17
  */
18
+ $this_sdk_version = '2.4.3';
19
 
20
  #region SDK Selection Logic --------------------------------------------------------------------
21
 
freemius/templates/account/partials/addon.php CHANGED
@@ -1,4 +1,9 @@
1
  <?php
 
 
 
 
 
2
  /**
3
  * @var array $VARS
4
  * @var Freemius $fs
@@ -443,4 +448,4 @@
443
  </td>
444
  <!--/ Optional Delete Action -->
445
  <?php endif ?>
446
- </tr>
1
  <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
  /**
8
  * @var array $VARS
9
  * @var Freemius $fs
448
  </td>
449
  <!--/ Optional Delete Action -->
450
  <?php endif ?>
451
+ </tr>
freemius/templates/ajax-loader.php CHANGED
@@ -1 +1,6 @@
1
- <div class="fs-ajax-loader" style="display: none"><?php for ( $i = 1; $i <= 8; $i ++ ) : ?><div class="fs-ajax-loader-bar fs-ajax-loader-bar-<?php echo $i ?>"></div><?php endfor ?></div>
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+ ?>
6
+ <div class="fs-ajax-loader" style="display: none"><?php for ( $i = 1; $i <= 8; $i ++ ) : ?><div class="fs-ajax-loader-bar fs-ajax-loader-bar-<?php echo $i ?>"></div><?php endfor ?></div>
freemius/templates/debug.php CHANGED
@@ -37,6 +37,8 @@
37
 
38
  $.post( ajaxurl, {
39
  action: 'fs_toggle_debug_mode',
 
 
40
  is_on : ($(this).hasClass( 'fs-on' ) ? 1 : 0)
41
  }, function ( response ) {
42
  if ( 1 == response ) {
@@ -111,7 +113,8 @@
111
  if (optionName) {
112
  $.post(ajaxurl, {
113
  action : 'fs_get_db_option',
114
- _wpnonce : '<?php echo wp_create_nonce( 'fs_get_db_option' ) ?>',
 
115
  option_name: optionName
116
  }, function (response) {
117
  if (response.data.value)
@@ -131,7 +134,8 @@
131
  if (optionValue) {
132
  $.post(ajaxurl, {
133
  action : 'fs_set_db_option',
134
- _wpnonce : '<?php echo wp_create_nonce( 'fs_set_db_option' ) ?>',
 
135
  option_name : optionName,
136
  option_value: optionValue
137
  }, function () {
@@ -724,6 +728,8 @@
724
 
725
  $.post(ajaxurl, {
726
  action : 'fs_get_debug_log',
 
 
727
  filters: filters,
728
  offset : offset,
729
  limit : limit
37
 
38
  $.post( ajaxurl, {
39
  action: 'fs_toggle_debug_mode',
40
+ // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
41
+ _wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_toggle_debug_mode' ) ); ?>,
42
  is_on : ($(this).hasClass( 'fs-on' ) ? 1 : 0)
43
  }, function ( response ) {
44
  if ( 1 == response ) {
113
  if (optionName) {
114
  $.post(ajaxurl, {
115
  action : 'fs_get_db_option',
116
+ // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
117
+ _wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_get_db_option' ) ); ?>,
118
  option_name: optionName
119
  }, function (response) {
120
  if (response.data.value)
134
  if (optionValue) {
135
  $.post(ajaxurl, {
136
  action : 'fs_set_db_option',
137
+ // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
138
+ _wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_set_db_option' ) ); ?>,
139
  option_name : optionName,
140
  option_value: optionValue
141
  }, function () {
728
 
729
  $.post(ajaxurl, {
730
  action : 'fs_get_debug_log',
731
+ // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
732
+ _wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_get_debug_log' ) ); ?>,
733
  filters: filters,
734
  offset : offset,
735
  limit : limit
freemius/templates/firewall-issues-js.php CHANGED
@@ -22,10 +22,12 @@
22
  notice = $( this ).parents( '.fs-notice' ),
23
  ajaxActionSuffix = notice.attr( 'data-manager-id' ).replace( ':', '-' );
24
 
25
- var data = {
26
- action : 'fs_resolve_firewall_issues_' + ajaxActionSuffix,
27
- error_type: error_type
28
- };
 
 
29
 
30
  if ( 'squid' === error_type ) {
31
  data.hosting_company = prompt( 'What is the name or URL of your hosting company?' );
@@ -39,7 +41,9 @@
39
  }
40
 
41
  if ( 'retry_ping' === error_type ) {
42
- data.action = 'fs_retry_connectivity_test_' + ajaxActionSuffix;
 
 
43
  }
44
 
45
  $( this ).css({'cursor': 'wait'});
@@ -56,4 +60,4 @@
56
  });
57
  });
58
  });
59
- </script>
22
  notice = $( this ).parents( '.fs-notice' ),
23
  ajaxActionSuffix = notice.attr( 'data-manager-id' ).replace( ':', '-' );
24
 
25
+ var data = {
26
+ action : 'fs_resolve_firewall_issues_' + ajaxActionSuffix,
27
+ // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
28
+ _wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_resolve_firewall_issues' ) ); ?>,
29
+ error_type: error_type
30
+ };
31
 
32
  if ( 'squid' === error_type ) {
33
  data.hosting_company = prompt( 'What is the name or URL of your hosting company?' );
41
  }
42
 
43
  if ( 'retry_ping' === error_type ) {
44
+ data.action = 'fs_retry_connectivity_test_' + ajaxActionSuffix;
45
+ // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
46
+ data._wpnonce = <?php echo wp_json_encode( wp_create_nonce( 'fs_retry_connectivity_test' ) ); ?>;
47
  }
48
 
49
  $( this ).css({'cursor': 'wait'});
60
  });
61
  });
62
  });
63
+ </script>
freemius/templates/partials/network-activation.php CHANGED
@@ -1,4 +1,9 @@
1
  <?php
 
 
 
 
 
2
  /**
3
  * @var array $VARS
4
  * @var Freemius $fs
@@ -86,4 +91,4 @@
86
  </tbody>
87
  </table>
88
  </div>
89
- </div>
1
  <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
  /**
8
  * @var array $VARS
9
  * @var Freemius $fs
91
  </tbody>
92
  </table>
93
  </div>
94
+ </div>
freemius/templates/sticky-admin-notice-js.php CHANGED
@@ -23,7 +23,9 @@
23
 
24
  notice.fadeOut( 'fast', function() {
25
  var data = {
26
- action : 'fs_dismiss_notice_action_' + ajaxActionSuffix,
 
 
27
  message_id: id
28
  };
29
 
@@ -36,4 +38,4 @@
36
  });
37
  });
38
  });
39
- </script>
23
 
24
  notice.fadeOut( 'fast', function() {
25
  var data = {
26
+ action : 'fs_dismiss_notice_action_' + ajaxActionSuffix,
27
+ // As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
28
+ _wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_dismiss_notice_action' ) ); ?>,
29
  message_id: id
30
  };
31
 
38
  });
39
  });
40
  });
41
+ </script>
premmerce-url-manager.php CHANGED
@@ -8,46 +8,45 @@ use Premmerce\UrlManager\UrlManagerPlugin;
8
  * @package Premmerce\UrlManager
9
  *
10
  * @wordpress-plugin
11
- * Plugin Name: Premmerce Permalink Manager for WooCommerce
12
- * Plugin URI: https://premmerce.com/woocommerce-permalink-manager-remove-shop-product-product-category-url/
13
- * Description: Premmerce Permalink Manager for WooCommerce allows you to change WooCommerce permalink and remove product and product_category slugs from the URL.
14
- * Version: 2.3.4
15
- * Author: premmerce
16
- * Author URI: https://premmerce.com/
17
- * License: GPL-2.0+
18
- * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
19
- * Text Domain: premmerce-url-manager
20
- * Domain Path: /languages
 
21
  *
22
- * Tested up to: 5.8.3
23
  * WC requires at least: 3.6.0
24
- * WC tested up to: 6.1.0
25
  */
26
 
27
  // If this file is called directly, abort.
28
  if ( ! defined('WPINC')) {
29
- die;
30
  }
31
 
32
  if ( ! function_exists('premmerce_wpm_fs')) {
33
 
34
- call_user_func(function () {
35
 
36
- require_once plugin_dir_path(__FILE__) . 'vendor/autoload.php';
37
 
38
- #premmerce_clear
39
- require_once plugin_dir_path(__FILE__) . '/freemius.php';
40
- #/premmerce_clear
41
 
42
- $main = new UrlManagerPlugin(__FILE__);
43
 
44
- register_activation_hook(__FILE__, [$main, 'activate']);
45
 
46
- register_deactivation_hook(__FILE__, [$main, 'deactivate']);
47
 
48
- register_uninstall_hook(__FILE__, [UrlManagerPlugin::class, 'uninstall']);
49
 
50
- $main->run();
51
 
52
- });
53
  }
8
  * @package Premmerce\UrlManager
9
  *
10
  * @wordpress-plugin
11
+ * Plugin Name: Premmerce Permalink Manager for WooCommerce
12
+ * Plugin URI: https://premmerce.com/woocommerce-permalink-manager-remove-shop-product-product-category-url/
13
+ * Description: Premmerce Permalink Manager for WooCommerce allows you to change WooCommerce permalink and remove product and product_category slugs from the URL.
14
+ * Version: 2.3.5
15
+ *
16
+ * Author: premmerce
17
+ * Author URI: https://premmerce.com/
18
+ * License: GPL-2.0+
19
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
20
+ * Text Domain: premmerce-url-manager
21
+ * Domain Path: /languages
22
  *
23
+ * Tested up to: 5.9.1
24
  * WC requires at least: 3.6.0
25
+ * WC tested up to: 6.2.1
26
  */
27
 
28
  // If this file is called directly, abort.
29
  if ( ! defined('WPINC')) {
30
+ die;
31
  }
32
 
33
  if ( ! function_exists('premmerce_wpm_fs')) {
34
 
35
+ call_user_func(function () {
36
 
37
+ require_once plugin_dir_path(__FILE__) . 'vendor/autoload.php';
38
 
39
+ require_once plugin_dir_path(__FILE__) . '/freemius.php';
 
 
40
 
41
+ $main = new UrlManagerPlugin(__FILE__);
42
 
43
+ register_activation_hook(__FILE__, [$main, 'activate']);
44
 
45
+ register_deactivation_hook(__FILE__, [$main, 'deactivate']);
46
 
47
+ register_uninstall_hook(__FILE__, [UrlManagerPlugin::class, 'uninstall']);
48
 
49
+ $main->run();
50
 
51
+ });
52
  }
readme.txt CHANGED
@@ -1,9 +1,11 @@
 
1
  === Premmerce Permalink Manager for WooCommerce ===
 
2
  Contributors: premmerce
3
  Tags: woocommerce url, remove product, remove product_category, woocommerce permalink, woocommerce, woocommerce seo
4
  Requires at least: 4.8
5
- Tested up to: 5.8.3
6
- Stable tag: 2.3.4
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -81,6 +83,14 @@ You can also install this plugin manually:
81
 
82
  == Changelog ==
83
 
 
 
 
 
 
 
 
 
84
  = 2.3.4 =
85
 
86
  Release Date: Jun 20, 2022
1
+
2
  === Premmerce Permalink Manager for WooCommerce ===
3
+
4
  Contributors: premmerce
5
  Tags: woocommerce url, remove product, remove product_category, woocommerce permalink, woocommerce, woocommerce seo
6
  Requires at least: 4.8
7
+ Tested up to: 6.0
8
+ Stable tag: 2.3.5
9
  Requires PHP: 5.6
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
83
 
84
  == Changelog ==
85
 
86
+
87
+
88
+ = 2.3.5 =
89
+
90
+ Release Date: Mar 3, 2022
91
+
92
+ * Update - Сode for PHP Coding Standards
93
+
94
  = 2.3.4 =
95
 
96
  Release Date: Jun 20, 2022
src/Addons/AddonInterface.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php namespace Premmerce\UrlManager\Addons;
2
 
3
- interface AddonInterface
4
- {
5
  /**
6
  * Check if addon is active
7
  */
8
- public function isActive();
9
 
10
  /**
11
  * Innit addon
12
  */
13
- public function init();
14
- }
1
  <?php namespace Premmerce\UrlManager\Addons;
2
 
3
+ interface AddonInterface {
4
+
5
  /**
6
  * Check if addon is active
7
  */
8
+ public function isActive();
9
 
10
  /**
11
  * Innit addon
12
  */
13
+ public function init();
14
+ }
src/Addons/AddonManager.php CHANGED
@@ -1,26 +1,28 @@
1
  <?php namespace Premmerce\UrlManager\Addons;
2
 
3
- class AddonManager
4
- {
5
  /**
 
 
6
  * @return string[]
7
  */
8
- public function getAddons() {
9
- return [
10
- BreadcrumbsAddon::class,
11
- YoastBreadcrumbsAddon::class
12
- ];
13
- }
14
 
15
  /**
16
  * Init Addons
17
  */
18
- public function initAddons() {
19
- foreach ( $this->getAddons() as $addon ) {
20
- $addon = new $addon;
21
- if( $addon->isActive() ) {
22
- $addon->init();
23
- }
24
- }
25
- }
26
  }
1
  <?php namespace Premmerce\UrlManager\Addons;
2
 
3
+ class AddonManager {
4
+
5
  /**
6
+ * Get Addons
7
+ *
8
  * @return string[]
9
  */
10
+ public function getAddons() {
11
+ return [
12
+ BreadcrumbsAddon::class,
13
+ YoastBreadcrumbsAddon::class
14
+ ];
15
+ }
16
 
17
  /**
18
  * Init Addons
19
  */
20
+ public function initAddons() {
21
+ foreach ( $this->getAddons() as $addon ) {
22
+ $addon = new $addon();
23
+ if ( $addon->isActive() ) {
24
+ $addon->init();
25
+ }
26
+ }
27
+ }
28
  }
src/Addons/BreadcrumbsAddon.php CHANGED
@@ -2,51 +2,51 @@
2
 
3
  use Premmerce\UrlManager\Admin\Settings;
4
 
5
- class BreadcrumbsAddon implements AddonInterface
6
- {
7
 
8
  /**
9
  * Breadcrumbs
 
10
  * @var array
11
  */
12
  protected $breadcrumbs = [];
13
 
14
  /**
15
  * Options
 
16
  * @var array
17
  */
18
  protected $options = [];
19
 
20
  /**
21
- * constructor
22
  */
23
- public function __construct()
24
- {
25
- $options = get_option( Settings::OPTIONS );
26
- $this->options = $options;
27
- }
28
 
29
  /**
30
  * Is active
 
31
  * @return boolean
32
  */
33
- public function isActive()
34
- {
35
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
36
- if( ! empty( $this->options['breadcrumbs'] ) && is_plugin_active( 'woocommerce/woocommerce.php') ) {
37
- return true;
38
- }
39
 
40
- return false;
41
- }
42
 
43
  /**
44
  * Init reformat breadcrumbs
45
  */
46
- public function init()
47
- {
48
- add_filter( 'woocommerce_get_breadcrumb', [ $this, 'createBreadcrumbs' ], 999 );
49
- }
50
 
51
  /**
52
  * Init reformat breadcrumbs
@@ -55,75 +55,73 @@ class BreadcrumbsAddon implements AddonInterface
55
  *
56
  * @return array|void
57
  */
58
- public function createBreadcrumbs( $crumbs )
59
- {
60
- if( ! is_product() && ! is_product_category() ) {
61
- return $crumbs;
62
- }
63
-
64
- $this->addCrumb( apply_filters( 'premmerce_permalink_home_breadcrumb_default', __( 'Home', 'premmerce-url-manager' ) ), get_site_url() );
65
 
66
- if( empty( $this->options['br_remove_shop'] ) ) {
67
- $this->addCrumb( apply_filters( 'premmerce_permalink_shop_breadcrumb_default', __( 'Shop', 'premmerce-url-manager' ) ), get_permalink( wc_get_page_id( 'shop' ) ) );
68
- }
69
 
 
 
 
70
 
71
- if( is_product() ) {
72
 
73
- if ( ! empty( $this->options['product'] ) ) {
74
- global $post;
 
75
 
76
- $terms = wc_get_product_terms(
77
- $post->ID,
78
- 'product_cat',
79
- array(
80
- 'orderby' => 'parent',
81
- 'order' => 'DESC',
82
- )
83
- );
84
 
85
- if( $terms ) {
86
- $mainTerm = $terms[0];
87
- if( $this->options['product'] == 'category_slug' ) {
88
- $this->addCrumb( $mainTerm->name, get_term_link( $mainTerm ) );
89
- } elseif( $this->options['product'] == 'hierarchical' ) {
90
- $this->addCrumbAncestors( $mainTerm->term_id, 'product_cat' );
91
- $this->addCrumb( $mainTerm->name, get_term_link( $mainTerm ) );
92
- }
93
- }
94
 
95
- $this->addCrumb( get_the_title( $post ), get_permalink( $post ) );
96
- }
97
 
98
- } elseif( is_product_category() ) {
99
 
100
- if ( ! empty( $this->options['category'] ) ) {
101
 
102
- $currentTerm = $GLOBALS['wp_query']->get_queried_object();
103
 
104
- if( $this->options['category'] == 'hierarchical' ) {
105
- $this->addCrumbAncestors( $currentTerm->term_id, 'product_cat' );
106
- }
107
 
108
- $this->addCrumb( $currentTerm->name, get_term_link( $currentTerm, 'product_cat' ) );
109
- }
110
- }
111
 
112
- if( ! empty( $this->breadcrumbs ) ) {
113
- return $this->getBreadcrumbs();
114
- }
115
 
116
- return $crumbs;
117
- }
118
 
119
  /**
120
  * Get breadcrumbs
121
  *
122
  * @return array
123
  */
124
- protected function getBreadcrumbs() {
125
- return $this->breadcrumbs;
126
- }
127
 
128
  /**
129
  * Add crumbs for a term
@@ -131,19 +129,18 @@ class BreadcrumbsAddon implements AddonInterface
131
  * @param int $termId Term ID
132
  * @param string $taxonomy Taxonomy
133
  */
134
- protected function addCrumbAncestors( $termId, $taxonomy )
135
- {
136
- $ancestors = get_ancestors( $termId, $taxonomy );
137
- $ancestors = array_reverse( $ancestors );
138
 
139
- foreach ( $ancestors as $ancestor ) {
140
- $ancestor = get_term( $ancestor, $taxonomy );
141
 
142
- if ( ! is_wp_error( $ancestor ) && $ancestor ) {
143
- $this->addCrumb( $ancestor->name, get_term_link( $ancestor ) );
144
- }
145
- }
146
- }
147
 
148
  /**
149
  * Add a crumb
@@ -151,11 +148,10 @@ class BreadcrumbsAddon implements AddonInterface
151
  * @param string $name Name
152
  * @param string $link Link
153
  */
154
- protected function addCrumb( $name, $link = '' )
155
- {
156
- $this->breadcrumbs[] = array(
157
- wp_strip_all_tags( $name ),
158
- $link,
159
- );
160
- }
161
- }
2
 
3
  use Premmerce\UrlManager\Admin\Settings;
4
 
5
+ class BreadcrumbsAddon implements AddonInterface {
6
+
7
 
8
  /**
9
  * Breadcrumbs
10
+ *
11
  * @var array
12
  */
13
  protected $breadcrumbs = [];
14
 
15
  /**
16
  * Options
17
+ *
18
  * @var array
19
  */
20
  protected $options = [];
21
 
22
  /**
23
+ * Constructor
24
  */
25
+ public function __construct() {
26
+ $options = get_option( Settings::OPTIONS );
27
+ $this->options = $options;
28
+ }
 
29
 
30
  /**
31
  * Is active
32
+ *
33
  * @return boolean
34
  */
35
+ public function isActive() {
36
+ include_once ABSPATH . 'wp-admin/includes/plugin.php' ;
37
+ if ( ! empty( $this->options['breadcrumbs'] ) && is_plugin_active( 'woocommerce/woocommerce.php') ) {
38
+ return true;
39
+ }
 
40
 
41
+ return false;
42
+ }
43
 
44
  /**
45
  * Init reformat breadcrumbs
46
  */
47
+ public function init() {
48
+ add_filter( 'woocommerce_get_breadcrumb', [ $this, 'createBreadcrumbs' ], 999 );
49
+ }
 
50
 
51
  /**
52
  * Init reformat breadcrumbs
55
  *
56
  * @return array|void
57
  */
58
+ public function createBreadcrumbs( $crumbs ) {
59
+ if ( ! is_product() && ! is_product_category() ) {
60
+ return $crumbs;
61
+ }
 
 
 
62
 
63
+ $this->addCrumb( apply_filters( 'premmerce_permalink_home_breadcrumb_default', __( 'Home', 'premmerce-url-manager' ) ), get_site_url() );
 
 
64
 
65
+ if ( empty( $this->options['br_remove_shop'] ) ) {
66
+ $this->addCrumb( apply_filters( 'premmerce_permalink_shop_breadcrumb_default', __( 'Shop', 'premmerce-url-manager' ) ), get_permalink( wc_get_page_id( 'shop' ) ) );
67
+ }
68
 
 
69
 
70
+ if ( is_product() ) {
71
+ if ( ! empty( $this->options['product'] ) ) {
72
+ global $post;
73
 
74
+ $terms = wc_get_product_terms(
75
+ $post->ID,
76
+ 'product_cat',
77
+ array(
78
+ 'orderby' => 'parent',
79
+ 'order' => 'DESC',
80
+ )
81
+ );
82
 
83
+ if ( $terms ) {
84
+ $mainTerm = $terms[0];
85
+ if ( 'category_slug' === $this->options['product'] ) {
86
+ $this->addCrumb( $mainTerm->name, get_term_link( $mainTerm ) );
87
+ } elseif ( 'hierarchical' === $this->options['product'] ) {
88
+ $this->addCrumbAncestors( $mainTerm->term_id, 'product_cat' );
89
+ $this->addCrumb( $mainTerm->name, get_term_link( $mainTerm ) );
90
+ }
91
+ }
92
 
93
+ $this->addCrumb( get_the_title( $post ), get_permalink( $post ) );
94
+ }
95
 
96
+ } elseif ( is_product_category() ) {
97
 
98
+ if ( ! empty( $this->options['category'] ) ) {
99
 
100
+ $currentTerm = $GLOBALS['wp_query']->get_queried_object();
101
 
102
+ if ( 'hierarchical' === $this->options['category'] ) {
103
+ $this->addCrumbAncestors( $currentTerm->term_id, 'product_cat' );
104
+ }
105
 
106
+ $this->addCrumb( $currentTerm->name, get_term_link( $currentTerm, 'product_cat' ) );
107
+ }
108
+ }
109
 
110
+ if ( ! empty( $this->breadcrumbs ) ) {
111
+ return $this->getBreadcrumbs();
112
+ }
113
 
114
+ return $crumbs;
115
+ }
116
 
117
  /**
118
  * Get breadcrumbs
119
  *
120
  * @return array
121
  */
122
+ protected function getBreadcrumbs() {
123
+ return $this->breadcrumbs;
124
+ }
125
 
126
  /**
127
  * Add crumbs for a term
129
  * @param int $termId Term ID
130
  * @param string $taxonomy Taxonomy
131
  */
132
+ protected function addCrumbAncestors( $termId, $taxonomy ) {
133
+ $ancestors = get_ancestors( $termId, $taxonomy );
134
+ $ancestors = array_reverse( $ancestors );
 
135
 
136
+ foreach ( $ancestors as $ancestor ) {
137
+ $ancestor = get_term( $ancestor, $taxonomy );
138
 
139
+ if ( ! is_wp_error( $ancestor ) && $ancestor ) {
140
+ $this->addCrumb( $ancestor->name, get_term_link( $ancestor ) );
141
+ }
142
+ }
143
+ }
144
 
145
  /**
146
  * Add a crumb
148
  * @param string $name Name
149
  * @param string $link Link
150
  */
151
+ protected function addCrumb( $name, $link = '' ) {
152
+ $this->breadcrumbs[] = array(
153
+ wp_strip_all_tags( $name ),
154
+ $link,
155
+ );
156
+ }
157
+ }
 
src/Addons/YoastBreadcrumbsAddon.php CHANGED
@@ -1,49 +1,46 @@
1
  <?php namespace Premmerce\UrlManager\Addons;
2
 
3
- class YoastBreadcrumbsAddon extends BreadcrumbsAddon
4
- {
5
  /**
6
  * Is active
 
7
  * @return boolean
8
  */
9
- public function isActive()
10
- {
11
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
12
- if( ! empty( $this->options['breadcrumbs'] ) && is_plugin_active( 'wordpress-seo/wp-seo.php' ) ) {
13
- return true;
14
- }
15
 
16
- return false;
17
- }
18
 
19
  /**
20
  * Init reformat breadcrumbs
21
  */
22
- public function init()
23
- {
24
- add_filter( 'wpseo_breadcrumb_links', [ $this, 'createBreadcrumbs' ], 999 );
25
- }
26
 
27
  /**
28
  * Get breadcrumbs
29
  *
30
  * @return array
31
  */
32
- public function getBreadcrumbs()
33
- {
34
- return array_map( [ $this, 'reformatBreadcrumbs' ], $this->breadcrumbs );
35
- }
36
 
37
  /**
38
  * Reformat breadcrumbs
39
  *
40
  * @return array
41
  */
42
- protected function reformatBreadcrumbs( $arr )
43
- {
44
- return [
45
- 'text' => $arr[0],
46
- 'url' => $arr[1],
47
- ];
48
- }
49
- }
1
  <?php namespace Premmerce\UrlManager\Addons;
2
 
3
+ class YoastBreadcrumbsAddon extends BreadcrumbsAddon {
4
+
5
  /**
6
  * Is active
7
+ *
8
  * @return boolean
9
  */
10
+ public function isActive() {
11
+ include_once ABSPATH . 'wp-admin/includes/plugin.php' ;
12
+ if ( ! empty( $this->options['breadcrumbs'] ) && is_plugin_active( 'wordpress-seo/wp-seo.php' ) ) {
13
+ return true;
14
+ }
 
15
 
16
+ return false;
17
+ }
18
 
19
  /**
20
  * Init reformat breadcrumbs
21
  */
22
+ public function init() {
23
+ add_filter( 'wpseo_breadcrumb_links', [ $this, 'createBreadcrumbs' ], 999 );
24
+ }
 
25
 
26
  /**
27
  * Get breadcrumbs
28
  *
29
  * @return array
30
  */
31
+ public function getBreadcrumbs() {
32
+ return array_map( [ $this, 'reformatBreadcrumbs' ], $this->breadcrumbs );
33
+ }
 
34
 
35
  /**
36
  * Reformat breadcrumbs
37
  *
38
  * @return array
39
  */
40
+ protected function reformatBreadcrumbs( $arr ) {
41
+ return [
42
+ 'text' => $arr[0],
43
+ 'url' => $arr[1],
44
+ ];
45
+ }
46
+ }
 
src/Admin/Admin.php CHANGED
@@ -1,301 +1,356 @@
1
  <?php namespace Premmerce\UrlManager\Admin;
2
 
 
3
  use Premmerce\UrlManager\UrlManagerPlugin;
4
  use Premmerce\UrlManager\Admin\AffiliateTab;
5
  use Premmerce\SDK\V2\FileManager\FileManager;
6
  use Premmerce\UrlManager\Admin\BundleAndSave;
 
 
 
7
 
8
  /**
9
  * Class Admin
10
  *
11
  * @package Premmerce\UrlManager
12
  */
13
- class Admin
14
- {
15
-
16
- /**
17
- * @var string
18
- */
19
- private $settingsPage;
20
- /**
21
- * @var FileManager
22
- */
23
- private $fileManager;
24
-
25
- /**
26
- * @var Settings
27
- */
28
- private $settings;
29
-
30
- /**
31
- * @var bundlesAndSave
32
- */
33
- private $bundlesAndSave;
34
-
35
- /**
36
- * @var affiliateTab
37
- */
38
- private $affiliate;
39
-
40
- const META_IGNORE_BANNER = 'premmerce_url_manager_ignore_banner';
41
-
42
- /**
43
- * Admin constructor.
44
- *
45
- * @param FileManager $fileManager
46
- */
47
- public function __construct(FileManager $fileManager)
48
- {
49
- $this->fileManager = $fileManager;
50
- $this->settingsPage = UrlManagerPlugin::DOMAIN . '-admin';
51
- $this->settings = new Settings($fileManager);
52
- $this->bundlesAndSave = new BundleAndSave($fileManager);
53
- $this->affiliate = new AffiliateTab($fileManager);
54
-
55
- $this->registerActions();
56
- }
57
-
58
- private function registerActions()
59
- {
60
- $flushActions = [
61
- 'created_product_cat',
62
- 'edited_product_cat',
63
- 'delete_product_cat',
64
-
65
- 'created_product_tag',
66
- 'edited_product_tag',
67
- 'delete_product_tag',
68
-
69
- 'update_option_' . Settings::OPTIONS,
70
- ];
71
-
72
- foreach ($flushActions as $action) {
73
- add_action($action, [$this, 'triggerFlush']);
74
- }
75
-
76
- add_action('shutdown', [$this, 'flush']);
77
-
78
-
79
- add_action('admin_init', [$this->settings, 'register']);
80
-
81
- add_action('admin_enqueue_scripts', [$this, 'enqueueScripts']);
82
-
83
- add_action('admin_menu', [$this, 'addMenuPage']);
84
-
85
- #premmerce_clear
86
- add_action('admin_menu', [$this, 'addFullPack'], 100);
87
- add_action('admin_notices', array($this, 'renderAdminBanner'));
88
- add_action('wp_ajax_premmerce_url_manager_ignore_banner', array($this, 'ignoreAdminBanner'));
89
- #/premmerce_clear
90
-
91
- add_filter('admin_footer_text', [$this, 'removeFooterAdmin']);
92
-
93
-
94
- }
95
- #premmerce_clear
96
-
97
- /**
98
- * Show Banner
99
- */
100
- public function renderAdminBanner()
101
- {
102
- if ($this->isBannerActive()) {
103
- $this->fileManager->includeTemplate('admin/banner.php', ['fm' => $this->fileManager]);
104
- }
105
-
106
- }
107
-
108
- /**
109
- * Hide Banner
110
- */
111
- public function ignoreAdminBanner()
112
- {
113
-
114
- $user = wp_get_current_user();
115
- $user_id = $user->ID;
116
-
117
- add_user_meta($user_id, self::META_IGNORE_BANNER, true, true);
118
-
119
- die;
120
-
121
- }
122
- #/premmerce_clear
123
-
124
- /**
125
- * Add submenu to premmerce menu page
126
- */
127
- public function addMenuPage()
128
- {
129
- global $admin_page_hooks;
130
-
131
- $premmerceMenuExists = isset($admin_page_hooks['premmerce']);
132
-
133
-
134
- if ( ! $premmerceMenuExists) {
135
- $svg = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="20" height="16" style="fill:#82878c" viewBox="0 0 20 16"><g id="Rectangle_7"> <path d="M17.8,4l-0.5,1C15.8,7.3,14.4,8,14,8c0,0,0,0,0,0H8h0V4.3C8,4.1,8.1,4,8.3,4H17.8 M4,0H1C0.4,0,0,0.4,0,1c0,0.6,0.4,1,1,1 h1.7C2.9,2,3,2.1,3,2.3V12c0,0.6,0.4,1,1,1c0.6,0,1-0.4,1-1V1C5,0.4,4.6,0,4,0L4,0z M18,2H7.3C6.6,2,6,2.6,6,3.3V12 c0,0.6,0.4,1,1,1c0.6,0,1-0.4,1-1v-1.7C8,10.1,8.1,10,8.3,10H14c1.1,0,3.2-1.1,5-4l0.7-1.4C20,4,20,3.2,19.5,2.6 C19.1,2.2,18.6,2,18,2L18,2z M14,11h-4c-0.6,0-1,0.4-1,1c0,0.6,0.4,1,1,1h4c0.6,0,1-0.4,1-1C15,11.4,14.6,11,14,11L14,11z M14,14 c-0.6,0-1,0.4-1,1c0,0.6,0.4,1,1,1c0.6,0,1-0.4,1-1C15,14.4,14.6,14,14,14L14,14z M4,14c-0.6,0-1,0.4-1,1c0,0.6,0.4,1,1,1 c0.6,0,1-0.4,1-1C5,14.4,4.6,14,4,14L4,14z"/></g></svg>';
136
- $svg = 'data:image/svg+xml;base64,' . base64_encode($svg);
137
-
138
- add_menu_page(
139
- 'Premmerce',
140
- 'Premmerce',
141
- 'manage_options',
142
- 'premmerce',
143
- '',
144
- $svg
145
- );
146
- }
147
-
148
-
149
- add_submenu_page(
150
- 'premmerce',
151
- __('Permalink Manager', 'premmerce-url-manager'),
152
- __('Permalink Manager', 'premmerce-url-manager'),
153
- 'manage_options',
154
- $this->settingsPage,
155
- [$this, 'options']
156
- );
157
-
158
- if ( ! $premmerceMenuExists) {
159
- global $submenu;
160
- unset($submenu['premmerce'][0]);
161
- }
162
- }
163
-
164
- #premmerce_clear
165
- public function addFullPack()
166
- {
167
- global $submenu;
168
-
169
- if ( ! function_exists('get_plugins')) {
170
- require_once ABSPATH . 'wp-admin/includes/plugin.php';
171
- }
172
-
173
- $plugins = get_plugins();
174
-
175
- $premmerceInstalled = array_key_exists('premmerce-premium/premmerce.php', $plugins)
176
- || array_key_exists('premmerce/premmerce.php', $plugins);
177
-
178
- if ( ! $premmerceInstalled) {
179
- $submenu['premmerce'][999] = [
180
- 'Get premmerce full pack',
181
- 'manage_options',
182
- admin_url('plugin-install.php?tab=plugin-information&plugin=premmerce'),
183
- ];
184
- }
185
- }
186
- #/premmerce_clear
187
-
188
- /**
189
- * Options page
190
- */
191
- public function options()
192
- {
193
- $this->triggerFlush();
194
-
195
- $current = isset($_GET['tab']) ? $_GET['tab'] : 'settings';
196
-
197
- $tabs['settings'] = __('Settings', 'premmerce-url-manager');
198
- $tabs['bundle_and_save'] = __('Bundle and Save', 'premmerce-url-manager');
199
- $tabs['affiliate'] = __('Affiliate', 'premmerce-url-manager');
200
-
201
- #premmerce_clear
202
- if (function_exists('premmerce_wpm_fs')) {
203
- if (premmerce_wpm_fs()->is_registered()) {
204
- $tabs['account'] = __('Account', 'premmerce-url-manager');
205
- }
206
- $tabs['contact'] = __('Contact Us', 'premmerce-url-manager');
207
- }
208
- #/premmerce_clear
209
-
210
-
211
- $this->fileManager->includeTemplate('admin/main.php', [
212
- 'settings' => $this->settings,
213
- 'bundles' => $this->bundlesAndSave,
214
- 'affiliate' => $this->affiliate,
215
- 'tabs' => $tabs,
216
- 'current' => $current,
217
- ]);
218
- }
219
-
220
- /**
221
- * @param string $hook
222
- */
223
- public function enqueueScripts($hook)
224
- {
225
- if ($hook == 'premmerce_page_premmerce-url-manager-admin') {
226
- wp_enqueue_style('premmerce-permalink-style', $this->fileManager->locateAsset('admin/css/style.css'), [],
227
- UrlManagerPlugin::VERSION);
228
-
229
- }
230
- #premmerce_clear
231
- if ($this->isBannerActive()) {
232
- wp_enqueue_script('premmerce-permalink-banner-script',
233
- $this->fileManager->locateAsset('admin/js/banner.js'),
234
- ['jquery'], UrlManagerPlugin::VERSION);
235
- wp_enqueue_style('premmerce-permalink-banner-style',
236
- $this->fileManager->locateAsset('admin/css/banner.css'), [],
237
- UrlManagerPlugin::VERSION);
238
- }
239
- #/premmerce_clear
240
- }
241
-
242
-
243
- /**
244
- * Set flush trigger
245
- */
246
- public function triggerFlush()
247
- {
248
- update_option(Settings::OPTION_FLUSH, true);
249
- }
250
-
251
- /**
252
- * Flush rewrite rules
253
- */
254
- public function flush()
255
- {
256
- if (get_option(Settings::OPTION_FLUSH)) {
257
- flush_rewrite_rules();
258
- delete_option(Settings::OPTION_FLUSH);
259
- }
260
- }
261
-
262
- /**
263
- * Admin footer modification
264
- *
265
- * @param $text - default Wordpress footer thankyou text
266
- */
267
- public function removeFooterAdmin($text)
268
- {
269
- $screen = get_current_screen();
270
- $premmercePages = [
271
- 'premmerce_page_premmerce-url-manager-admin'
272
- ];
273
-
274
- if (in_array($screen->id, $premmercePages)) {
275
- $link = 'https://wordpress.org/support/plugin/woo-permalink-manager/reviews/?filter=5';
276
- $target = 'target="_blank"';
277
- $text = '<span id="footer-thankyou">';
278
- $text .= sprintf(
279
- __('Please rate our Premmerce Permalink Manager for WooCommerce on <a href="%1$s" %2$s>WordPress.org</a><br/>Thank you from the Premmerce team!', 'premmerce-filter'),
280
- $link,
281
- $target
282
- );
283
- $text .= '</span>';
284
- } else {
285
- $text = '<span id="footer-thankyou">' . $text . '</span>';
286
- }
287
-
288
- return $text;
289
- }
290
-
291
- #premmerce_clear
292
- public function isBannerActive()
293
- {
294
- $user = wp_get_current_user();
295
- $user_id = $user->ID;
296
-
297
- return ! get_user_meta($user_id, self::META_IGNORE_BANNER, true);
298
-
299
- }
300
- #/premmerce_clear
301
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php namespace Premmerce\UrlManager\Admin;
2
 
3
+ use Premmerce\UrlManager\Admin\Settings;
4
  use Premmerce\UrlManager\UrlManagerPlugin;
5
  use Premmerce\UrlManager\Admin\AffiliateTab;
6
  use Premmerce\SDK\V2\FileManager\FileManager;
7
  use Premmerce\UrlManager\Admin\BundleAndSave;
8
+ use Premmerce\UrlManager\Admin\FieldsTypes\InputOptionTypeRadio;
9
+ use Premmerce\UrlManager\Admin\FieldsTypes\InputOptionTypeCheckbox;
10
+ use Premmerce\UrlManager\Admin\FieldsTypes\InputOptionTypeUrlSuffix;
11
 
12
  /**
13
  * Class Admin
14
  *
15
  * @package Premmerce\UrlManager
16
  */
17
+ class Admin {
18
+
19
+
20
+ /**
21
+ * Settings Page
22
+ *
23
+ * @var string
24
+ */
25
+ private $settingsPage;
26
+
27
+ /**
28
+ * Settings Array
29
+ *
30
+ * @var arrat
31
+ */
32
+ private $settingsArray;
33
+
34
+ /**
35
+ * All Settings Field Names
36
+ *
37
+ * @var array
38
+ */
39
+ private $allFieldsName;
40
+
41
+ /**
42
+ * Settings Page
43
+ *
44
+ * @var string
45
+ */
46
+ private $parrentPageSlug;
47
+
48
+ /**
49
+ * FileManager
50
+ *
51
+ * @var FileManager
52
+ */
53
+ private $fileManager;
54
+
55
+ /**
56
+ * Settings
57
+ *
58
+ * @var Settings
59
+ */
60
+ private $settings;
61
+
62
+ /**
63
+ * Bundles and Save
64
+ *
65
+ * @var bundlesAndSave
66
+ */
67
+ private $bundlesAndSave;
68
+
69
+ /**
70
+ * Affiliate Tab
71
+ *
72
+ * @var affiliateTab
73
+ */
74
+ private $affiliate;
75
+
76
+ const META_IGNORE_BANNER = 'premmerce_url_manager_ignore_banner';
77
+
78
+ const WOO_TAB_NAME = 'woo_tab_premmerce_permalink';
79
+
80
+ /**
81
+ * Admin constructor.
82
+ *
83
+ * @param FileManager $fileManager
84
+ */
85
+ public function __construct( FileManager $fileManager) {
86
+ $this->fileManager = $fileManager;
87
+ $this->settings = new Settings($fileManager);
88
+ $this->settingsPage = UrlManagerPlugin::DOMAIN . '-admin';
89
+
90
+ $this->parrentPageSlug = 'premmerce';
91
+ $this->bundlesAndSave = new BundleAndSave($fileManager);
92
+ $this->affiliate = new AffiliateTab($fileManager);
93
+ $this->registerActions();
94
+ }
95
+
96
+
97
+
98
+ private function registerActions() {
99
+ $flushActions = [
100
+ 'created_product_cat',
101
+ 'edited_product_cat',
102
+ 'delete_product_cat',
103
+
104
+ 'created_product_tag',
105
+ 'edited_product_tag',
106
+ 'delete_product_tag',
107
+
108
+ 'update_option_' . Settings::OPTIONS,
109
+ ];
110
+
111
+ foreach ($flushActions as $action) {
112
+ add_action($action, [$this, 'triggerFlush']);
113
+ }
114
+
115
+ add_action('shutdown', [$this, 'flush']);
116
+
117
+ add_action('admin_init', [$this->settings, 'register']);
118
+
119
+ add_action('admin_enqueue_scripts', [$this, 'enqueueScripts']);
120
+
121
+
122
+
123
+ add_action('admin_menu', [$this, 'addMenuPage'], 80);
124
+ add_action('admin_menu', [$this, 'addFullPack'], 100);
125
+ add_action('admin_notices', array($this, 'renderAdminBanner'));
126
+ add_action('wp_ajax_premmerce_url_manager_ignore_banner', array($this, 'ignoreAdminBanner'));
127
+ add_filter( 'plugin_action_links_' . plugin_basename( $this->fileManager->getMainFile() ), [$this, 'settingPageLink'], 10, 4 );
128
+ add_filter('admin_footer_text', [$this, 'removeFooterAdmin']);
129
+ }
130
+
131
+ /**
132
+ * Setting Page Link
133
+ *
134
+ * @param mixed $actions
135
+ * @return void
136
+ */
137
+ public function settingPageLink( $actions) {
138
+ $actions[] = '<a href="' . $this->getSettingLink() . '">' . __( 'Settings', 'premmerce-url-manager' ) . '</a>';
139
+
140
+ return $actions;
141
+ }
142
+
143
+ /**
144
+ * Get url to settings page
145
+ *
146
+ * @return string
147
+ */
148
+ public function getSettingLink() {
149
+
150
+ $param = ['page' => 'premmerce-url-manager-admin' ];
151
+ return esc_url( add_query_arg($param, get_admin_url() . 'admin.php' ) );
152
+ }
153
+
154
+ /**
155
+ * Show Banner
156
+ */
157
+ public function renderAdminBanner() {
158
+ if ($this->isBannerActive()) {
159
+ $this->fileManager->includeTemplate('admin/banner.php', ['fm' => $this->fileManager]);
160
+ }
161
+ }
162
+
163
+ /**
164
+ * Hide Banner
165
+ */
166
+ public function ignoreAdminBanner() {
167
+
168
+ $user = wp_get_current_user();
169
+ $user_id = $user->ID;
170
+
171
+ add_user_meta($user_id, self::META_IGNORE_BANNER, true, true);
172
+
173
+ die;
174
+ }
175
+
176
+
177
+
178
+ /**
179
+ * Add submenu to premmerce menu page
180
+ */
181
+ public function addMenuPage() {
182
+ global $admin_page_hooks;
183
+
184
+
185
+ $premmerceMenuExists = isset($admin_page_hooks['premmerce']);
186
+
187
+ if ( ! $premmerceMenuExists) {
188
+ $svg = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="20" height="16" style="fill:#82878c" viewBox="0 0 20 16"><g id="Rectangle_7"> <path d="M17.8,4l-0.5,1C15.8,7.3,14.4,8,14,8c0,0,0,0,0,0H8h0V4.3C8,4.1,8.1,4,8.3,4H17.8 M4,0H1C0.4,0,0,0.4,0,1c0,0.6,0.4,1,1,1 h1.7C2.9,2,3,2.1,3,2.3V12c0,0.6,0.4,1,1,1c0.6,0,1-0.4,1-1V1C5,0.4,4.6,0,4,0L4,0z M18,2H7.3C6.6,2,6,2.6,6,3.3V12 c0,0.6,0.4,1,1,1c0.6,0,1-0.4,1-1v-1.7C8,10.1,8.1,10,8.3,10H14c1.1,0,3.2-1.1,5-4l0.7-1.4C20,4,20,3.2,19.5,2.6 C19.1,2.2,18.6,2,18,2L18,2z M14,11h-4c-0.6,0-1,0.4-1,1c0,0.6,0.4,1,1,1h4c0.6,0,1-0.4,1-1C15,11.4,14.6,11,14,11L14,11z M14,14 c-0.6,0-1,0.4-1,1c0,0.6,0.4,1,1,1c0.6,0,1-0.4,1-1C15,14.4,14.6,14,14,14L14,14z M4,14c-0.6,0-1,0.4-1,1c0,0.6,0.4,1,1,1 c0.6,0,1-0.4,1-1C5,14.4,4.6,14,4,14L4,14z"/></g></svg>';
189
+ $svg = 'data:image/svg+xml;base64,' . base64_encode($svg);
190
+ add_menu_page(
191
+ 'Premmerce',
192
+ 'Premmerce',
193
+ 'manage_options',
194
+ 'premmerce',
195
+ '',
196
+ $svg
197
+ );
198
+ }
199
+
200
+
201
+ add_submenu_page(
202
+ $this->parrentPageSlug,
203
+ __('Permalink Manager', 'premmerce-url-manager'),
204
+ __('Permalink Manager', 'premmerce-url-manager'),
205
+ 'manage_options',
206
+ $this->settingsPage,
207
+ [$this, 'options'],
208
+ 10
209
+ );
210
+
211
+ if ( ! $premmerceMenuExists) {
212
+ global $submenu;
213
+ unset($submenu['premmerce'][0]);
214
+ }
215
+ }
216
+
217
+ public function addFullPack() {
218
+ if ( ! function_exists('get_plugins')) {
219
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
220
+ }
221
+
222
+ $plugins = get_plugins();
223
+
224
+ $premmerceInstalled = array_key_exists('premmerce-premium/premmerce.php', $plugins)
225
+ || array_key_exists('premmerce/premmerce.php', $plugins);
226
+
227
+ if ( ! $premmerceInstalled) {
228
+ add_submenu_page(
229
+ 'premmerce',
230
+ __('Get premmerce full pack', 'premmerce-url-manager'),
231
+ __('Get premmerce full pack', 'premmerce-url-manager'),
232
+ 'manage_options',
233
+ admin_url('plugin-install.php?tab=plugin-information&plugin=premmerce')
234
+ );
235
+ }
236
+ }
237
+
238
+ /**
239
+ * Options page
240
+ */
241
+ public function options() {
242
+ $this->triggerFlush();
243
+
244
+ $current = isset($_GET['tab']) ? wc_clean(wp_unslash($_GET['tab'])) : 'settings';
245
+
246
+ $tabs['settings'] = __('Settings', 'premmerce-url-manager');
247
+ $tabs['bundle_and_save'] = __('Bundle and Save', 'premmerce-url-manager');
248
+ $tabs['affiliate'] = __('Affiliate', 'premmerce-url-manager');
249
+
250
+ if (function_exists('premmerce_wpm_fs')) {
251
+ if (premmerce_wpm_fs()->is_registered()) {
252
+ $tabs['account'] = __('Account', 'premmerce-url-manager');
253
+ }
254
+ $tabs['contact'] = __('Contact Us', 'premmerce-url-manager');
255
+ }
256
+
257
+
258
+ $this->fileManager->includeTemplate('admin/main.php', [
259
+ 'settings' => $this->settings,
260
+ 'bundles' => $this->bundlesAndSave,
261
+ 'affiliate' => $this->affiliate,
262
+ 'tabs' => $tabs,
263
+ 'current' => $current,
264
+ ]);
265
+ }
266
+
267
+ /**
268
+ * Enqueue Scripts
269
+ *
270
+ * @param string $hook
271
+ */
272
+ public function enqueueScripts( $hook) {
273
+ //init input-mask
274
+ wp_enqueue_script(
275
+ 'input-mask.js',
276
+ $this->fileManager->locateAsset( 'admin/js/input-mask.min.js' ),
277
+ [ 'jquery' ],
278
+ UrlManagerPlugin::getPluginVersion()
279
+ );
280
+ //add styles for Settings
281
+ if (in_array($hook, ['premmerce_page_premmerce-url-manager-admin', 'woocommerce_page_wc-settings'])) {
282
+ wp_enqueue_style('premmerce-permalink-style', $this->fileManager->locateAsset('admin/css/style.css'), [],
283
+ UrlManagerPlugin::getPluginVersion());
284
+ }
285
+ //add scripts for settings
286
+ wp_enqueue_script(
287
+ 'premmerce-permalink-settings-script',
288
+ $this->fileManager->locateAsset('admin/js/settings.js'),
289
+ ['jquery'], UrlManagerPlugin::getPluginVersion()
290
+ );
291
+
292
+ if ($this->isBannerActive()) {
293
+ wp_enqueue_script('premmerce-permalink-banner-script',
294
+ $this->fileManager->locateAsset('admin/js/banner.js'),
295
+ ['jquery'], UrlManagerPlugin::getPluginVersion());
296
+ wp_enqueue_style('premmerce-permalink-banner-style',
297
+ $this->fileManager->locateAsset('admin/css/banner.css'), [],
298
+ UrlManagerPlugin::getPluginVersion());
299
+ }
300
+ }
301
+
302
+
303
+ /**
304
+ * Set flush trigger
305
+ */
306
+ public function triggerFlush() {
307
+ update_option(Settings::OPTION_FLUSH, true);
308
+ }
309
+
310
+ /**
311
+ * Flush rewrite rules
312
+ */
313
+ public function flush() {
314
+ if (get_option(Settings::OPTION_FLUSH)) {
315
+ flush_rewrite_rules();
316
+ delete_option(Settings::OPTION_FLUSH);
317
+ }
318
+ }
319
+
320
+ /**
321
+ * Admin footer modification
322
+ *
323
+ * @param $text - default WordPress footer thankyou text
324
+ */
325
+ public function removeFooterAdmin( $text) {
326
+ $screen = get_current_screen();
327
+ $premmercePages = [
328
+ 'premmerce_page_premmerce-url-manager-admin'
329
+ ];
330
+
331
+ if (in_array($screen->id, $premmercePages)) {
332
+ $link = 'https://wordpress.org/support/plugin/woo-permalink-manager/reviews/?filter=5';
333
+ $target = 'target="_blank"';
334
+ $text = '<span id="footer-thankyou">';
335
+ $text .= sprintf(
336
+ /* translators: %%1$s: plugin link, %2$s target */
337
+ __('Please rate our Premmerce Permalink Manager for WooCommerce on <a href="%1$s" %2$s>WordPress.org</a><br/>Thank you from the Premmerce team!', 'premmerce-filter'),
338
+ $link,
339
+ $target
340
+ );
341
+ $text .= '</span>';
342
+ } else {
343
+ $text = '<span id="footer-thankyou">' . $text . '</span>';
344
+ }
345
+
346
+ return $text;
347
+ }
348
+
349
+ public function isBannerActive() {
350
+ $user = wp_get_current_user();
351
+ $user_id = $user->ID;
352
+
353
+ return ! get_user_meta($user_id, self::META_IGNORE_BANNER, true);
354
+
355
+ }
356
+ }
src/Admin/AffiliateTab.php CHANGED
@@ -3,40 +3,36 @@
3
  use Premmerce\SDK\V2\FileManager\FileManager;
4
  use Premmerce\UrlManager\Admin\Tabs\Base\TabInterface;
5
 
6
- class AffiliateTab implements TabInterface
7
- {
8
 
9
- /**
10
- * @var FileManager
11
- */
12
- private $fileManager;
13
 
14
- public function __construct(FileManager $fileManager)
15
- {
16
- $this->fileManager = $fileManager;
17
- }
 
 
18
 
19
- public function init() {
 
 
20
 
21
- }
 
22
 
23
- public function render()
24
- {
25
- }
26
 
27
 
28
- public function getLabel()
29
- {
30
- return __('Affiliate', 'premmerce-url-manager');
31
- }
32
 
33
- public function getName()
34
- {
35
- return 'affiliate';
36
- }
37
 
38
- public function valid()
39
- {
40
- return true;
41
- }
42
- }
3
  use Premmerce\SDK\V2\FileManager\FileManager;
4
  use Premmerce\UrlManager\Admin\Tabs\Base\TabInterface;
5
 
6
+ class AffiliateTab implements TabInterface {
 
7
 
 
 
 
 
8
 
9
+ /**
10
+ * FileManager
11
+ *
12
+ * @var FileManager
13
+ */
14
+ private $fileManager;
15
 
16
+ public function __construct( FileManager $fileManager) {
17
+ $this->fileManager = $fileManager;
18
+ }
19
 
20
+ public function init() {
21
+ }
22
 
23
+ public function render() {
24
+ }
 
25
 
26
 
27
+ public function getLabel() {
28
+ return __('Affiliate', 'premmerce-url-manager');
29
+ }
 
30
 
31
+ public function getName() {
32
+ return 'affiliate';
33
+ }
 
34
 
35
+ public function valid() {
36
+ return true;
37
+ }
38
+ }
 
src/Admin/BundleAndSave.php CHANGED
@@ -1,114 +1,152 @@
1
  <?php namespace Premmerce\UrlManager\Admin;
2
 
 
3
  use Premmerce\SDK\V2\FileManager\FileManager;
4
  use Premmerce\UrlManager\Admin\Tabs\Base\TabInterface;
5
 
6
- class BundleAndSave implements TabInterface
7
- {
8
-
9
- /**
10
- * @var FileManager
11
- */
12
- private $fileManager;
13
-
14
- public function __construct(FileManager $fileManager)
15
- {
16
- $this->fileManager = $fileManager;
17
- $this->hooks();
18
- }
19
-
20
- public function init() {
21
-
22
- }
23
-
24
- public function hooks()
25
- {
26
- add_action( 'admin_enqueue_scripts', [$this, 'registerBundlesAssets'], 11 );
27
- }
28
-
29
- public function render()
30
- {
31
- $images = [
32
- 'header_img' => $this->fileManager->locateAsset('admin/img/premmerce_bundle.jpg'),
33
- 'premmerce_logo' => $this->fileManager->locateAsset('admin/img/premmerce.png'),
34
- 'permalink_img' => $this->fileManager->locateAsset('admin/img/permalink.png'),
35
- 'filter_img' => $this->fileManager->locateAsset('admin/img/filter.png'),
36
- 'variants_img' => $this->fileManager->locateAsset('admin/img/variants.png'),
37
- 'search_img' => $this->fileManager->locateAsset('admin/img/search.png'),
38
- 'riley_pearcy' => $this->fileManager->locateAsset('admin/img/riley_pearcy.jpg'),
39
- 'lian_perry' => $this->fileManager->locateAsset('admin/img/lian_perry.jpg'),
40
- 'rommie_mercer' => $this->fileManager->locateAsset('admin/img/rommie_mercer.jpg'),
41
- 'svg' => $this->fileManager->locateAsset('admin/img/svg.svg'),
42
- 'wp_logo' => $this->fileManager->locateAsset('admin/img/wp.png'),
43
- 'wp_rocket_logo' => $this->fileManager->locateAsset('admin/img/wp-rocket.jpg'),
44
- 'learnwoo_logo' => $this->fileManager->locateAsset('admin/img/learnwoo.png'),
45
- 'wp_lift_logo' => $this->fileManager->locateAsset('admin/img/wp-lift.png'),
46
- 'mayor_logo' => $this->fileManager->locateAsset('admin/img/mayor.png'),
47
- 'managewp_logo' => $this->fileManager->locateAsset('admin/img/managewp.png'),
48
- 'thanks_img' => $this->fileManager->locateAsset('admin/img/thanks.png'),
49
- ];
50
-
51
- //sections on Bundles tab
52
- $this->fileManager->includeTemplate('admin/tabs/bundle-and-save/header.php', $images);
53
- $this->fileManager->includeTemplate('admin/tabs/bundle-and-save/pricing.php', $images);
54
- $this->fileManager->includeTemplate('admin/tabs/bundle-and-save/texts.php', $images);
55
- $this->fileManager->includeTemplate('admin/tabs/bundle-and-save/testimonials.php', $images);
56
- $this->fileManager->includeTemplate('admin/tabs/bundle-and-save/faq.php', $images);
57
- $this->fileManager->includeTemplate('admin/tabs/bundle-and-save/featured-in.php', $images);
58
- $this->fileManager->includeTemplate('admin/tabs/bundle-and-save/thanks.php', $images);
59
- }
60
-
61
- /**
62
- * Register css and js only for Bundles tab
63
- *
64
- * @param $page
65
- */
66
- public function registerBundlesAssets($page)
67
- {
68
- if ($page === 'premmerce_page_premmerce-url-manager-admin') {
69
- //scripts and styles for bundle tab
70
- if (isset($_GET['tab']) && $_GET['tab'] === $this->getName()) {
71
- //css and js for bundle tab
72
- wp_enqueue_style('premmerce_url_manager_admin_premmerce_style', $this->fileManager->locateAsset('admin/css/premmerce.min.css'));
73
- wp_enqueue_script(
74
- 'premmerce_url_manager_admin_bundles_freemius_jquery_for_checkout_script',
75
- 'https://code.jquery.com/jquery-1.12.4.min.js'
76
- );
77
- wp_enqueue_script(
78
- 'premmerce_url_manager_admin_bundles_freemius_checkout_script',
79
- 'https://checkout.freemius.com/checkout.min.js'
80
- );
81
- wp_enqueue_script(
82
- 'premmerce_url_manager_admin_bundles_script',
83
- $this->fileManager->locateAsset('admin/js/bundles.js')
84
- );
85
- }
86
- }
87
- }
88
-
89
- public function getLabel()
90
- {
91
- return __('Bundle & Save', 'premmerce-url-manager');
92
- }
93
-
94
- public function getName()
95
- {
96
- return 'bundle_and_save';
97
- }
98
-
99
- public function valid()
100
- {
101
- return true;
102
- }
103
-
104
- public static function premmerce_use_svg_symbol($svg_url, $name, $echo = true)
105
- {
106
- $ico = '<use xlink:href="' . $svg_url . '#svg-icon__' . $name . '"></use>';
107
-
108
- if ($echo) {
109
- echo $ico;
110
- } else {
111
- return $ico;
112
- }
113
- }
114
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php namespace Premmerce\UrlManager\Admin;
2
 
3
+ use Premmerce\UrlManager\UrlManagerPlugin;
4
  use Premmerce\SDK\V2\FileManager\FileManager;
5
  use Premmerce\UrlManager\Admin\Tabs\Base\TabInterface;
6
 
7
+ class BundleAndSave implements TabInterface {
8
+
9
+
10
+ /**
11
+ * FileManager
12
+ *
13
+ * @var FileManager
14
+ */
15
+ private $fileManager;
16
+
17
+ public function __construct( FileManager $fileManager) {
18
+ $this->fileManager = $fileManager;
19
+ $this->hooks();
20
+ }
21
+
22
+ public function init() {
23
+
24
+ }
25
+
26
+ public function hooks() {
27
+ add_action( 'admin_enqueue_scripts', [$this, 'registerBundlesAssets'], 11 );
28
+ }
29
+
30
+ public function render() {
31
+ $images = [
32
+ 'header_img' => $this->fileManager->locateAsset('admin/img/premmerce_bundle.jpg'),
33
+ 'premmerce_logo' => $this->fileManager->locateAsset('admin/img/premmerce.png'),
34
+ 'permalink_img' => $this->fileManager->locateAsset('admin/img/permalink.png'),
35
+ 'filter_img' => $this->fileManager->locateAsset('admin/img/filter.png'),
36
+ 'variants_img' => $this->fileManager->locateAsset('admin/img/variants.png'),
37
+ 'search_img' => $this->fileManager->locateAsset('admin/img/search.png'),
38
+ 'riley_pearcy' => $this->fileManager->locateAsset('admin/img/riley_pearcy.jpg'),
39
+ 'lian_perry' => $this->fileManager->locateAsset('admin/img/lian_perry.jpg'),
40
+ 'rommie_mercer' => $this->fileManager->locateAsset('admin/img/rommie_mercer.jpg'),
41
+ 'svg' => $this->fileManager->locateAsset('admin/img/svg.svg'),
42
+ 'wp_logo' => $this->fileManager->locateAsset('admin/img/wp.png'),
43
+ 'wp_rocket_logo' => $this->fileManager->locateAsset('admin/img/wp-rocket.jpg'),
44
+ 'learnwoo_logo' => $this->fileManager->locateAsset('admin/img/learnwoo.png'),
45
+ 'wp_lift_logo' => $this->fileManager->locateAsset('admin/img/wp-lift.png'),
46
+ 'mayor_logo' => $this->fileManager->locateAsset('admin/img/mayor.png'),
47
+ 'managewp_logo' => $this->fileManager->locateAsset('admin/img/managewp.png'),
48
+ 'thanks_img' => $this->fileManager->locateAsset('admin/img/thanks.png'),
49
+ ];
50
+
51
+ //sections on Bundles tab
52
+ $this->fileManager->includeTemplate('admin/tabs/bundle-and-save/header.php', $images);
53
+ $this->fileManager->includeTemplate('admin/tabs/bundle-and-save/pricing.php', $images);
54
+ $this->fileManager->includeTemplate('admin/tabs/bundle-and-save/texts.php', $images);
55
+ $this->fileManager->includeTemplate('admin/tabs/bundle-and-save/testimonials.php', $images);
56
+ $this->fileManager->includeTemplate('admin/tabs/bundle-and-save/faq.php', $images);
57
+ $this->fileManager->includeTemplate('admin/tabs/bundle-and-save/featured-in.php', $images);
58
+ $this->fileManager->includeTemplate('admin/tabs/bundle-and-save/thanks.php', $images);
59
+ }
60
+
61
+ /**
62
+ * Register css and js only for Bundles tab
63
+ *
64
+ * @param $page
65
+ */
66
+ public function registerBundlesAssets( $page) {
67
+ if ('premmerce_page_premmerce-url-manager-admin' === $page) {
68
+ //scripts and styles for bundle tab
69
+ if (isset($_GET['tab']) && $_GET['tab'] === $this->getName()) {
70
+ //css and js for bundle tab
71
+ wp_enqueue_style(
72
+ 'premmerce_url_manager_admin_premmerce_style',
73
+ $this->fileManager->locateAsset('admin/css/premmerce.min.css'),
74
+ [],
75
+ UrlManagerPlugin::getPluginVersion()
76
+ );
77
+ wp_enqueue_script(
78
+ 'premmerce_url_manager_admin_bundles_freemius_jquery_for_checkout_script',
79
+ 'https://code.jquery.com/jquery-1.12.4.min.js',
80
+ UrlManagerPlugin::getPluginVersion(),
81
+ true
82
+ );
83
+ wp_enqueue_script(
84
+ 'premmerce_url_manager_admin_bundles_freemius_checkout_script',
85
+ 'https://checkout.freemius.com/checkout.min.js',
86
+ UrlManagerPlugin::getPluginVersion(),
87
+ true
88
+ );
89
+ wp_enqueue_script(
90
+ 'premmerce_url_manager_admin_bundles_script',
91
+ $this->fileManager->locateAsset('admin/js/bundles.js'),
92
+ UrlManagerPlugin::getPluginVersion(),
93
+ true
94
+ );
95
+ }
96
+ }
97
+ }
98
+
99
+ /**
100
+ * Get Label
101
+ *
102
+ * @return void
103
+ */
104
+ public function getLabel() {
105
+ return __('Bundle & Save', 'premmerce-url-manager');
106
+ }
107
+
108
+ /**
109
+ * Get Name
110
+ *
111
+ * @return void
112
+ */
113
+ public function getName() {
114
+ return 'bundle_and_save';
115
+ }
116
+
117
+ /**
118
+ * Valid
119
+ *
120
+ * @return void
121
+ */
122
+ public function valid() {
123
+ return true;
124
+ }
125
+
126
+ /**
127
+ * Get ico
128
+ *
129
+ * @param mixed $svg_url
130
+ * @param mixed $name
131
+ * @param mixed $echo
132
+ * @return void
133
+ */
134
+ public static function premmerce_use_svg_symbol( $svg_url, $name, $echo = true) {
135
+ $ico = '<use xlink:href="' . $svg_url . '#svg-icon__' . $name . '"></use>';
136
+
137
+ $ksesDefaults = wp_kses_allowed_html( 'post' );
138
+
139
+ $icoArgs = [
140
+ 'use' => [
141
+ 'href' => true,
142
+ 'xlink:href' => true,
143
+ ]
144
+ ];
145
+
146
+ if ($echo) {
147
+ echo wp_kses( $ico, array_merge( $ksesDefaults, $icoArgs ) );
148
+ } else {
149
+ return $ico;
150
+ }
151
+ }
152
+ }
src/Admin/Settings.php CHANGED
@@ -1,7 +1,6 @@
1
  <?php namespace Premmerce\UrlManager\Admin;
2
 
3
  use Premmerce\SDK\V2\FileManager\FileManager;
4
- use Premmerce\UrlManager\UrlManagerPlugin;
5
 
6
  class Settings {
7
 
@@ -19,7 +18,10 @@ class Settings {
19
 
20
  const PERMALINK_WC_PRODUCT = 'product';
21
 
 
22
  /**
 
 
23
  * @var FileManager
24
  */
25
  private $fileManager;
@@ -45,8 +47,8 @@ class Settings {
45
 
46
  add_settings_section('sku_link', __('SKU', 'premmerce-url-manager'), [
47
  $this,
48
- 'skuSection',
49
- ], self::SETTINGS_PAGE);
50
 
51
  add_settings_section( 'additional', __( 'Additional', 'premmerce-url-manager' ), [
52
  $this,
@@ -59,11 +61,17 @@ class Settings {
59
  ], self::SETTINGS_PAGE );
60
  }
61
 
62
- public function show() {
63
-
64
- wp_enqueue_script( 'input-mask.js', $this->fileManager->locateAsset( 'admin/js/input-mask.min.js' ), [ 'jquery' ], UrlManagerPlugin::VERSION );
 
 
 
 
 
65
 
66
- print( '<form action="' . admin_url( 'options.php' ) . '" method="post">' );
 
67
 
68
  settings_errors();
69
 
@@ -75,6 +83,24 @@ class Settings {
75
  print( '</form>' );
76
  }
77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  public function categorySection() {
79
  $this->fileManager->includeTemplate( 'admin/section/category.php', [
80
  'category' => $this->getOption( 'category' ),
@@ -89,8 +115,8 @@ class Settings {
89
 
90
  public function skuSection() {
91
  $this->fileManager->includeTemplate( 'admin/section/sku.php', [
92
- 'sku' => $this->getOption( 'sku' ),
93
- 'product' => $this->getOption( 'product' ),
94
  ] );
95
  }
96
 
@@ -115,6 +141,12 @@ class Settings {
115
  ] );
116
  }
117
 
 
 
 
 
 
 
118
  public function updateSettings( $settings ) {
119
  $this->fixWPWCSettings( $settings );
120
 
@@ -125,18 +157,23 @@ class Settings {
125
  return $settings;
126
  }
127
 
128
-
 
 
 
 
 
129
  private function fixWPWCSettings( $options ) {
130
 
131
- if ( $options['product'] || $options['category'] ) {
132
  if ( ! get_option( 'permalink_structure' ) ) {
133
  update_option( 'permalink_structure', self::PERMALINK_STRUCTURE );
134
  };
135
  }
136
 
137
- if ( $options['product'] ) {
138
 
139
- if ( $options['product'] == 'slug' ) {
140
  $wc['product_base'] = self::PERMALINK_WC_PRODUCT;
141
  }
142
  if ( in_array( $options['product'], [ 'category_slug', 'hierarchical' ] ) ) {
@@ -145,10 +182,11 @@ class Settings {
145
 
146
  update_option( 'woocommerce_permalinks', $wc );
147
  }
148
-
149
  }
150
 
151
  /**
 
 
152
  * @param string $key
153
  * @param mixed|null $default
154
  *
@@ -162,4 +200,4 @@ class Settings {
162
 
163
  return isset( $this->options[ $key ] ) ? $this->options[ $key ] : $default;
164
  }
165
- }
1
  <?php namespace Premmerce\UrlManager\Admin;
2
 
3
  use Premmerce\SDK\V2\FileManager\FileManager;
 
4
 
5
  class Settings {
6
 
18
 
19
  const PERMALINK_WC_PRODUCT = 'product';
20
 
21
+
22
  /**
23
+ * FileManager
24
+ *
25
  * @var FileManager
26
  */
27
  private $fileManager;
47
 
48
  add_settings_section('sku_link', __('SKU', 'premmerce-url-manager'), [
49
  $this,
50
+ 'skuSection',
51
+ ], self::SETTINGS_PAGE);
52
 
53
  add_settings_section( 'additional', __( 'Additional', 'premmerce-url-manager' ), [
54
  $this,
61
  ], self::SETTINGS_PAGE );
62
  }
63
 
64
+ /**
65
+ * Get Main Settings Text
66
+ *
67
+ * @return void
68
+ */
69
+ public static function getMainSettingsText() {
70
+ return __('WooCommerce Permalink Manager offers you the ability to create a custom URL structure for your permalinks. Custom URL structures can improve the aesthetics, usability, and forward-compatibility of your links. A number of settings are available, and here are some examples to get you started.', 'premmerce-url-manager');
71
+ }
72
 
73
+ public function show() {
74
+ print( '<form action="' . esc_url(admin_url( 'options.php' )) . '" method="post">' );
75
 
76
  settings_errors();
77
 
83
  print( '</form>' );
84
  }
85
 
86
+ /**
87
+ * Get Product Path For Sku
88
+ *
89
+ * @return void
90
+ */
91
+ public function getProductPathForSku() {
92
+ $product = $this->getOption( 'product' );
93
+
94
+ switch ( $product ) {
95
+ case 'category_slug':
96
+ return '/category';
97
+ case 'hierarchical':
98
+ return 'parent-category/category';
99
+ default:
100
+ return '';
101
+ }
102
+ }
103
+
104
  public function categorySection() {
105
  $this->fileManager->includeTemplate( 'admin/section/category.php', [
106
  'category' => $this->getOption( 'category' ),
115
 
116
  public function skuSection() {
117
  $this->fileManager->includeTemplate( 'admin/section/sku.php', [
118
+ 'sku' => $this->getOption( 'sku' ),
119
+ 'productPath' => $this->getProductPathForSku(),
120
  ] );
121
  }
122
 
141
  ] );
142
  }
143
 
144
+ /**
145
+ * Update Settings
146
+ *
147
+ * @param mixed $settings
148
+ * @return void
149
+ */
150
  public function updateSettings( $settings ) {
151
  $this->fixWPWCSettings( $settings );
152
 
157
  return $settings;
158
  }
159
 
160
+ /**
161
+ * Fix WP WC Settings
162
+ *
163
+ * @param mixed $options
164
+ * @return void
165
+ */
166
  private function fixWPWCSettings( $options ) {
167
 
168
+ if ( isset($options['product']) && !empty($options['product']) || isset($options['category']) && !empty($options['category']) ) {
169
  if ( ! get_option( 'permalink_structure' ) ) {
170
  update_option( 'permalink_structure', self::PERMALINK_STRUCTURE );
171
  };
172
  }
173
 
174
+ if ( isset($options['product']) && !empty($options['product']) ) {
175
 
176
+ if ( 'slug' === $options['product']) {
177
  $wc['product_base'] = self::PERMALINK_WC_PRODUCT;
178
  }
179
  if ( in_array( $options['product'], [ 'category_slug', 'hierarchical' ] ) ) {
182
 
183
  update_option( 'woocommerce_permalinks', $wc );
184
  }
 
185
  }
186
 
187
  /**
188
+ * Get Option
189
+ *
190
  * @param string $key
191
  * @param mixed|null $default
192
  *
200
 
201
  return isset( $this->options[ $key ] ) ? $this->options[ $key ] : $default;
202
  }
203
+ }
src/Admin/Tabs/Base/TabInterface.php CHANGED
@@ -1,33 +1,34 @@
1
  <?php namespace Premmerce\UrlManager\Admin\Tabs\Base;
2
 
3
- interface TabInterface
4
- {
5
 
6
- /**
7
- * Register hooks
8
- */
9
- public function init();
10
 
11
- /**
12
- * Render tab content
13
- */
14
- public function render();
15
 
16
- /**
17
- * Returns tab label
18
- * @return string
19
- */
20
- public function getLabel();
21
 
22
- /**
23
- * Returns unique tab name
24
- */
25
- public function getName();
 
 
26
 
27
- /**
28
- * Is tab valid to render
29
- *
30
- * @return bool
31
- */
32
- public function valid();
33
- }
 
 
 
 
 
1
  <?php namespace Premmerce\UrlManager\Admin\Tabs\Base;
2
 
3
+ interface TabInterface {
 
4
 
 
 
 
 
5
 
6
+ /**
7
+ * Register hooks
8
+ */
9
+ public function init();
10
 
11
+ /**
12
+ * Render tab content
13
+ */
14
+ public function render();
 
15
 
16
+ /**
17
+ * Returns tab label
18
+ *
19
+ * @return string
20
+ */
21
+ public function getLabel();
22
 
23
+ /**
24
+ * Returns unique tab name
25
+ */
26
+ public function getName();
27
+
28
+ /**
29
+ * Is tab valid to render
30
+ *
31
+ * @return bool
32
+ */
33
+ public function valid();
34
+ }
src/Frontend/Frontend.php CHANGED
@@ -16,6 +16,7 @@ class Frontend
16
  const WOO_CATEGORY = 'product_cat' ;
17
  /**
18
  * Options
 
19
  * @var array
20
  */
21
  protected $options = array() ;
@@ -32,7 +33,6 @@ class Frontend
32
  if ( !empty($options['canonical']) ) {
33
  add_action( 'wp_head', [ $this, 'addCanonical' ] );
34
  }
35
- #/premmerce_clear
36
  $isGetParamUrlFormat = apply_filters( 'wpml_setting', 0, 'language_negotiation_type' ) == '3';
37
  if ( class_exists( 'SitePress' ) && $isGetParamUrlFormat ) {
38
  add_filter( 'icl_ls_languages', [ $this, 'modifyWpmlLanguageSwitcher' ], 20 );
@@ -86,27 +86,25 @@ class Frontend
86
  $slug = array_pop( $url );
87
  $replace = [];
88
 
89
- if ( $slug === 'feed' ) {
90
  $replace['feed'] = $slug;
91
  $slug = array_pop( $url );
92
  }
93
 
94
 
95
- if ( $slug === 'amp' ) {
96
  $replace['amp'] = $slug;
97
  $slug = array_pop( $url );
98
  }
99
 
100
  $commentsPosition = strpos( $slug, 'comment-page-' );
101
 
102
- if ( $commentsPosition === 0 ) {
103
  $replace['cpage'] = substr( $slug, strlen( 'comment-page-' ) );
104
  $slug = array_pop( $url );
105
  }
106
 
107
- $sql = "SELECT COUNT(ID) as count_id FROM {$wpdb->posts} WHERE post_name = %s AND post_type = %s";
108
- $query = $wpdb->prepare( $sql, [ $slug, self::WOO_PRODUCT ] );
109
- $num = intval( $wpdb->get_var( $query ) );
110
 
111
  if ( $num > 0 ) {
112
  $replace['page'] = '';
@@ -124,7 +122,7 @@ class Frontend
124
  protected function removeSuffix( $url, $suffix )
125
  {
126
  $length = mb_strlen( $suffix );
127
- if ( $length == 0 ) {
128
  return true;
129
  }
130
  // Ends with
@@ -186,13 +184,11 @@ class Frontend
186
  protected function findSlugBySku( $sku )
187
  {
188
  global $wpdb ;
189
- $sql = "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_value = %s AND meta_key = '_sku'";
190
- $query = $wpdb->prepare( $sql, [ $sku ] );
191
- $skuId = $wpdb->get_row( $query, ARRAY_A );
192
 
193
  if ( isset( $skuId['post_id'] ) ) {
194
  $postSlug = get_post_field( 'post_name', $skuId['post_id'] );
195
- if ( $postSlug != '' ) {
196
  return $postSlug;
197
  }
198
  }
16
  const WOO_CATEGORY = 'product_cat' ;
17
  /**
18
  * Options
19
+ *
20
  * @var array
21
  */
22
  protected $options = array() ;
33
  if ( !empty($options['canonical']) ) {
34
  add_action( 'wp_head', [ $this, 'addCanonical' ] );
35
  }
 
36
  $isGetParamUrlFormat = apply_filters( 'wpml_setting', 0, 'language_negotiation_type' ) == '3';
37
  if ( class_exists( 'SitePress' ) && $isGetParamUrlFormat ) {
38
  add_filter( 'icl_ls_languages', [ $this, 'modifyWpmlLanguageSwitcher' ], 20 );
86
  $slug = array_pop( $url );
87
  $replace = [];
88
 
89
+ if ( 'feed' === $slug ) {
90
  $replace['feed'] = $slug;
91
  $slug = array_pop( $url );
92
  }
93
 
94
 
95
+ if ( 'amp' === $slug ) {
96
  $replace['amp'] = $slug;
97
  $slug = array_pop( $url );
98
  }
99
 
100
  $commentsPosition = strpos( $slug, 'comment-page-' );
101
 
102
+ if ( 0 === $commentsPosition ) {
103
  $replace['cpage'] = substr( $slug, strlen( 'comment-page-' ) );
104
  $slug = array_pop( $url );
105
  }
106
 
107
+ $num = intval( $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) as count_id FROM {$wpdb->posts} WHERE post_name = %s AND post_type = %s", [ $slug, self::WOO_PRODUCT ] ) ) );
 
 
108
 
109
  if ( $num > 0 ) {
110
  $replace['page'] = '';
122
  protected function removeSuffix( $url, $suffix )
123
  {
124
  $length = mb_strlen( $suffix );
125
+ if ( 0 === (int) $length ) {
126
  return true;
127
  }
128
  // Ends with
184
  protected function findSlugBySku( $sku )
185
  {
186
  global $wpdb ;
187
+ $skuId = $wpdb->get_row( $wpdb->prepare( "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_value = %s AND meta_key = '_sku'", [ $sku ] ), ARRAY_A );
 
 
188
 
189
  if ( isset( $skuId['post_id'] ) ) {
190
  $postSlug = get_post_field( 'post_name', $skuId['post_id'] );
191
+ if ( '' !== $postSlug ) {
192
  return $postSlug;
193
  }
194
  }
src/PermalinkListener.php CHANGED
@@ -28,12 +28,11 @@ class PermalinkListener
28
  'use_primary_category' => !empty($options['use_primary_category']),
29
  'product' => ( isset( $options['product'] ) ? $options['product'] : '' ),
30
  'suffix' => ( !empty($options['suffix']) ? $options['suffix'] : false ),
31
- 'enable_suffix_categories' => isset( $options['enable_suffix_categories'] ),
32
- 'enable_suffix_products' => isset( $options['enable_suffix_products'] ),
33
  'sku' => ( isset( $options['sku'] ) ? $options['sku'] : '' ),
34
  ];
35
  $this->taxonomyOptions['product_cat'] = ( isset( $options['category'] ) ? $options['category'] : '' );
36
- #/premmerce_clear
37
  }
38
 
39
  /**
@@ -83,7 +82,6 @@ class PermalinkListener
83
  /**
84
  * Replace product permalink according to settings
85
  *
86
- *
87
  * @param string $permalink
88
  * @param WP_Post $post
89
  *
@@ -91,7 +89,7 @@ class PermalinkListener
91
  */
92
  public function replaceProductLink( $permalink, $post )
93
  {
94
- if ( $post->post_type !== self::WOO_PRODUCT ) {
95
  return $permalink;
96
  }
97
  if ( !get_option( 'permalink_structure' ) ) {
@@ -315,7 +313,7 @@ class PermalinkListener
315
 
316
  private function isHierarchical( $type )
317
  {
318
- return $type === 'hierarchical';
319
  }
320
 
321
  /**
@@ -352,8 +350,8 @@ class PermalinkListener
352
  protected function replaceSlugWithSku( $permalink, $postID )
353
  {
354
  $skuString = get_post_meta( $postID, '_sku', true );
355
- if ( $skuString != '' ) {
356
- if ( $this->options['sku'] == 'sku' ) {
357
  return str_replace( basename( $permalink ), $skuString, $permalink );
358
  }
359
  }
28
  'use_primary_category' => !empty($options['use_primary_category']),
29
  'product' => ( isset( $options['product'] ) ? $options['product'] : '' ),
30
  'suffix' => ( !empty($options['suffix']) ? $options['suffix'] : false ),
31
+ 'enable_suffix_categories' => ( isset( $options['enable_suffix_categories'] ) && !empty($options['enable_suffix_categories']) ? true : false ),
32
+ 'enable_suffix_products' => ( isset( $options['enable_suffix_products'] ) && !empty($options['enable_suffix_products']) ? true : false ),
33
  'sku' => ( isset( $options['sku'] ) ? $options['sku'] : '' ),
34
  ];
35
  $this->taxonomyOptions['product_cat'] = ( isset( $options['category'] ) ? $options['category'] : '' );
 
36
  }
37
 
38
  /**
82
  /**
83
  * Replace product permalink according to settings
84
  *
 
85
  * @param string $permalink
86
  * @param WP_Post $post
87
  *
89
  */
90
  public function replaceProductLink( $permalink, $post )
91
  {
92
+ if ( self::WOO_PRODUCT !== $post->post_type ) {
93
  return $permalink;
94
  }
95
  if ( !get_option( 'permalink_structure' ) ) {
313
 
314
  private function isHierarchical( $type )
315
  {
316
+ return 'hierarchical' === $type;
317
  }
318
 
319
  /**
350
  protected function replaceSlugWithSku( $permalink, $postID )
351
  {
352
  $skuString = get_post_meta( $postID, '_sku', true );
353
+ if ( '' !== $skuString ) {
354
+ if ( 'sku' === $this->options['sku'] ) {
355
  return str_replace( basename( $permalink ), $skuString, $permalink );
356
  }
357
  }
src/Updater.php CHANGED
@@ -2,79 +2,74 @@
2
 
3
  use Premmerce\UrlManager\Admin\Settings;
4
 
5
- class Updater
6
- {
7
-
8
- const CURRENT_VERSION = '2.0';
9
-
10
- const DB_OPTION = 'premmerce_permalink_manager_db_version';
11
-
12
- public function checkForUpdates()
13
- {
14
- return $this->compare(self::CURRENT_VERSION);
15
- }
16
-
17
- private function compare($version)
18
- {
19
- $dbVersion = get_option(self::DB_OPTION, 1.1);
20
-
21
- return version_compare($dbVersion, $version, '<');
22
- }
23
-
24
- public function update()
25
- {
26
- if ($this->checkForUpdates()) {
27
- foreach ($this->getUpdates() as $version => $callback) {
28
- if ($this->compare($version)) {
29
- call_user_func($callback);
30
- }
31
- }
32
-
33
- update_option(Settings::OPTION_FLUSH, true);
34
- }
35
- }
36
-
37
- public function getUpdates()
38
- {
39
- return [
40
- '2.0' => [$this, 'update2_0'],
41
- ];
42
- }
43
-
44
- public function update2_0()
45
- {
46
-
47
- $options = get_option('premmerce_url_manager_options', []);
48
- $options12 = [
49
- 'use_primary_category' => 'on',
50
- ];
51
-
52
- $wc = get_option('woocommerce_permalinks');
53
-
54
- $showProductCats = false;
55
- if ( ! empty($wc['product_base'])) {
56
- $showProductCats = strpos($wc['product_base'], '%product_cat%') !== false;
57
- }
58
-
59
-
60
- if ( ! empty($options['remove_product_base'])) {
61
- $options12['product'] = 'slug';
62
- if ($showProductCats) {
63
- $options12['product'] = 'hierarchical';
64
- }
65
- }
66
- if ( ! empty($options['remove_category_base'])) {
67
- $options12['category'] = 'hierarchical';
68
- if ( ! empty($options['remove_category_parent_slugs'])) {
69
- $options12['category'] = 'slug';
70
-
71
- }
72
- }
73
-
74
- update_option('premmerce_permalink_manager', $options12);
75
- delete_option('premmerce_url_manager_options');
76
- delete_option(Settings::OPTION_DISABLED);
77
- update_option(self::DB_OPTION, '2.0');
78
- }
79
-
80
- }
2
 
3
  use Premmerce\UrlManager\Admin\Settings;
4
 
5
+ class Updater {
6
+
7
+
8
+ const CURRENT_VERSION = '2.0';
9
+
10
+ const DB_OPTION = 'premmerce_permalink_manager_db_version';
11
+
12
+ public function checkForUpdates() {
13
+ return $this->compare(self::CURRENT_VERSION);
14
+ }
15
+
16
+ private function compare( $version) {
17
+ $dbVersion = get_option(self::DB_OPTION, 1.1);
18
+
19
+ return version_compare($dbVersion, $version, '<');
20
+ }
21
+
22
+ public function update() {
23
+ if ($this->checkForUpdates()) {
24
+ foreach ($this->getUpdates() as $version => $callback) {
25
+ if ($this->compare($version)) {
26
+ call_user_func($callback);
27
+ }
28
+ }
29
+
30
+ update_option(Settings::OPTION_FLUSH, true);
31
+ }
32
+ }
33
+
34
+ public function getUpdates() {
35
+ return [
36
+ '2.0' => [$this, 'update2_0'],
37
+ ];
38
+ }
39
+
40
+ public function update2_0() {
41
+
42
+ $options = get_option('premmerce_url_manager_options', []);
43
+ $options12 = [
44
+ 'use_primary_category' => 'on',
45
+ ];
46
+
47
+ $wc = get_option('woocommerce_permalinks');
48
+
49
+ $showProductCats = false;
50
+ if ( ! empty($wc['product_base'])) {
51
+ $showProductCats = strpos($wc['product_base'], '%product_cat%') !== false;
52
+ }
53
+
54
+
55
+ if ( ! empty($options['remove_product_base'])) {
56
+ $options12['product'] = 'slug';
57
+ if ($showProductCats) {
58
+ $options12['product'] = 'hierarchical';
59
+ }
60
+ }
61
+ if ( ! empty($options['remove_category_base'])) {
62
+ $options12['category'] = 'hierarchical';
63
+ if ( ! empty($options['remove_category_parent_slugs'])) {
64
+ $options12['category'] = 'slug';
65
+
66
+ }
67
+ }
68
+
69
+ update_option('premmerce_permalink_manager', $options12);
70
+ delete_option('premmerce_url_manager_options');
71
+ delete_option(Settings::OPTION_DISABLED);
72
+ update_option(self::DB_OPTION, '2.0');
73
+ }
74
+
75
+ }
 
 
 
 
 
src/UrlManagerPlugin.php CHANGED
@@ -1,166 +1,179 @@
1
  <?php namespace Premmerce\UrlManager;
2
 
3
- use Premmerce\SDK\V2\FileManager\FileManager;
4
- use Premmerce\SDK\V2\Notifications\AdminNotifier;
5
  use Premmerce\UrlManager\Admin\Admin;
6
  use Premmerce\UrlManager\Admin\Settings;
 
7
  use Premmerce\UrlManager\Frontend\Frontend;
 
8
  use Premmerce\UrlManager\Addons\AddonManager;
 
9
 
10
  /**
11
  * Class UrlManagerPlugin
12
  *
13
  * @package Premmerce\UrlManager
14
  */
15
- class UrlManagerPlugin
16
- {
17
-
18
- const DOMAIN = 'premmerce-url-manager';
19
-
20
- const VERSION = '2.2.0';
21
-
22
- /**
23
- * @var FileManager
24
- */
25
- private $fileManager;
26
-
27
- /**
28
- * @var AdminNotifier
29
- */
30
- private $notifier;
31
-
32
- /**
33
- * PluginManager constructor.
34
- *
35
- * @param $mainFile
36
- */
37
- public function __construct($mainFile)
38
- {
39
- $this->fileManager = new FileManager($mainFile);
40
- $this->notifier = new AdminNotifier();
41
-
42
- add_action('init', [$this, 'loadTextDomain']);
43
- add_action('admin_init', [$this, 'checkRequirePlugins']);
44
-
45
- premmerce_wpm_fs()->add_filter('freemius_pricing_js_path', [$this, 'cutomFreemiusPricingPage']);
46
- }
47
-
48
- /**
49
- * Custom pricing page
50
- */
51
- public function cutomFreemiusPricingPage($default_pricing_js_path)
52
- {
53
- $pluginDir = $this->fileManager->getPluginDirectory();
54
- $pricing_js_path = $pluginDir . '/assets/admin/js/pricing-page/freemius-pricing.js';
55
-
56
- return $pricing_js_path;
57
- }
58
-
59
- /**
60
- * Run plugin part
61
- */
62
- public function run()
63
- {
64
- $valid = count($this->validateRequiredPlugins()) === 0;
65
- (new Updater())->update();
66
-
67
- if (is_admin()) {
68
- new Admin($this->fileManager);
69
- }
70
-
71
- if ($valid) {
72
- if ( ! is_admin()) {
73
- new Frontend();
74
- }
75
- (new PermalinkListener())->registerFilters();
76
- (new AddonManager())->initAddons();
77
- }
78
- }
79
-
80
- /**
81
- * Fired when the plugin is activated
82
- */
83
- public function activate()
84
- {
85
- flush_rewrite_rules();
86
- }
87
-
88
- /**
89
- * Fired when the plugin is deactivated
90
- */
91
- public function deactivate()
92
- {
93
- $this->deleteUsersBannerMeta();
94
- flush_rewrite_rules();
95
- }
96
-
97
- /**
98
- * Fired during plugin uninstall
99
- */
100
- public static function uninstall()
101
- {
102
- delete_option(Updater::DB_OPTION);
103
- delete_option(Settings::OPTION_FLUSH);
104
- delete_option(Settings::OPTION_DISABLED);
105
- delete_option(Settings::OPTIONS);
106
- flush_rewrite_rules();
107
- }
108
-
109
- private function deleteUsersBannerMeta()
110
- {
111
- global $wpdb;
112
-
113
- $wpdb->delete($wpdb->usermeta, ['meta_key' => Admin::META_IGNORE_BANNER]);
114
- }
115
-
116
- /**
117
- * Load plugin translations
118
- */
119
- public function loadTextDomain()
120
- {
121
- $name = $this->fileManager->getPluginName();
122
- load_plugin_textdomain('premmerce-url-manager', false, $name . '/languages/');
123
- }
124
-
125
- /**
126
- * Check required plugins and push notifications
127
- */
128
- public function checkRequirePlugins()
129
- {
130
- $message = __('The %s plugin requires %s plugin to be active!', 'premmerce-url-manager');
131
-
132
- $plugins = $this->validateRequiredPlugins();
133
-
134
- if (count($plugins)) {
135
- foreach ($plugins as $plugin) {
136
- $error = sprintf($message, 'WooCommerce Permalink Manager', $plugin);
137
- $this->notifier->push($error, AdminNotifier::ERROR, false);
138
- }
139
- }
140
-
141
- }
142
-
143
- /**
144
- * Validate required plugins
145
- *
146
- * @return array
147
- */
148
- private function validateRequiredPlugins()
149
- {
150
-
151
- $plugins = [];
152
-
153
- if ( ! function_exists('is_plugin_active')) {
154
- include_once(ABSPATH . 'wp-admin/includes/plugin.php');
155
- }
156
-
157
- /**
158
- * Check if WooCommerce is active
159
- **/
160
- if ( ! (is_plugin_active('woocommerce/woocommerce.php') || is_plugin_active_for_network('woocommerce/woocommerce.php'))) {
161
- $plugins[] = '<a target="_blank" href="https://wordpress.org/plugins/woocommerce/">WooCommerce</a>';
162
- }
163
-
164
- return $plugins;
165
- }
 
 
 
 
 
 
 
 
 
 
 
 
166
  }
1
  <?php namespace Premmerce\UrlManager;
2
 
 
 
3
  use Premmerce\UrlManager\Admin\Admin;
4
  use Premmerce\UrlManager\Admin\Settings;
5
+ use Premmerce\UrlManager\Admin\WooSettings;
6
  use Premmerce\UrlManager\Frontend\Frontend;
7
+ use Premmerce\SDK\V2\FileManager\FileManager;
8
  use Premmerce\UrlManager\Addons\AddonManager;
9
+ use Premmerce\SDK\V2\Notifications\AdminNotifier;
10
 
11
  /**
12
  * Class UrlManagerPlugin
13
  *
14
  * @package Premmerce\UrlManager
15
  */
16
+ class UrlManagerPlugin {
17
+
18
+ const DOMAIN = 'premmerce-url-manager';
19
+
20
+
21
+
22
+ const VERSION = '2.3.5';
23
+
24
+ /**
25
+ * FileManager
26
+ *
27
+ * @var FileManager
28
+ */
29
+ private $fileManager;
30
+
31
+ /**
32
+ * Notifier
33
+ *
34
+ * @var AdminNotifier
35
+ */
36
+ private $notifier;
37
+
38
+ /**
39
+ * PluginManager constructor.
40
+ *
41
+ * @param $mainFile
42
+ */
43
+ public function __construct( $mainFile ) {
44
+ $this->fileManager = new FileManager($mainFile);
45
+ $this->notifier = new AdminNotifier();
46
+
47
+ add_action('init', [$this, 'loadTextDomain']);
48
+ add_action('admin_init', [$this, 'checkRequirePlugins']);
49
+
50
+ premmerce_wpm_fs()->add_filter('freemius_pricing_js_path', [$this, 'cutomFreemiusPricingPage']);
51
+ }
52
+
53
+ /**
54
+ * Get Plugin Version
55
+ *
56
+ * @return void
57
+ */
58
+ public static function getPluginVersion() {
59
+
60
+ if (defined('self::VERSION')) {
61
+ return self::VERSION;
62
+ }
63
+ return '1.0.0';
64
+ }
65
+
66
+ /**
67
+ * Custom pricing page
68
+ */
69
+ public function cutomFreemiusPricingPage( $default_pricing_js_path) {
70
+ $pluginDir = $this->fileManager->getPluginDirectory();
71
+ $pricing_js_path = $pluginDir . '/assets/admin/js/pricing-page/freemius-pricing.js';
72
+
73
+ return $pricing_js_path;
74
+ }
75
+
76
+ /**
77
+ * Run plugin part
78
+ */
79
+ public function run() {
80
+ $valid = count($this->validateRequiredPlugins()) === 0;
81
+ ( new Updater() )->update();
82
+
83
+ if (is_admin()) {
84
+ new Admin($this->fileManager);
85
+ }
86
+
87
+ if ($valid) {
88
+ if ( ! is_admin()) {
89
+ new Frontend();
90
+ }
91
+ ( new PermalinkListener() )->registerFilters();
92
+ ( new AddonManager() )->initAddons();
93
+ }
94
+ }
95
+
96
+ /**
97
+ * Fired when the plugin is activated
98
+ */
99
+ public function activate() {
100
+ flush_rewrite_rules();
101
+ }
102
+
103
+ /**
104
+ * Fired when the plugin is deactivated
105
+ */
106
+ public function deactivate() {
107
+ $this->deleteUsersBannerMeta();
108
+ flush_rewrite_rules();
109
+ }
110
+
111
+ /**
112
+ * Fired during plugin uninstall
113
+ */
114
+ public static function uninstall() {
115
+ delete_option(Updater::DB_OPTION);
116
+ delete_option(Settings::OPTION_FLUSH);
117
+ delete_option(Settings::OPTION_DISABLED);
118
+ delete_option(Settings::OPTIONS);
119
+
120
+ flush_rewrite_rules();
121
+ }
122
+
123
+
124
+
125
+ private function deleteUsersBannerMeta() {
126
+ global $wpdb;
127
+
128
+ $wpdb->delete($wpdb->usermeta, ['meta_key' => Admin::META_IGNORE_BANNER]);
129
+ }
130
+
131
+ /**
132
+ * Load plugin translations
133
+ */
134
+ public function loadTextDomain() {
135
+ $name = $this->fileManager->getPluginName();
136
+ load_plugin_textdomain('premmerce-url-manager', false, $name . '/languages/');
137
+ }
138
+
139
+ /**
140
+ * Check required plugins and push notifications
141
+ */
142
+ public function checkRequirePlugins() {
143
+ /* translators: %%1$s: our plugin name, %2$s another plugin name */
144
+ $message = __('The %1$s plugin requires %2$s plugin to be active!', 'premmerce-url-manager');
145
+
146
+ $plugins = $this->validateRequiredPlugins();
147
+
148
+ if (count($plugins)) {
149
+ foreach ($plugins as $plugin) {
150
+ $error = sprintf($message, 'WooCommerce Permalink Manager', $plugin);
151
+ $this->notifier->push($error, AdminNotifier::ERROR, false);
152
+ }
153
+ }
154
+
155
+ }
156
+
157
+ /**
158
+ * Validate required plugins
159
+ *
160
+ * @return array
161
+ */
162
+ private function validateRequiredPlugins() {
163
+
164
+ $plugins = [];
165
+
166
+ if ( ! function_exists('is_plugin_active')) {
167
+ include_once ABSPATH . 'wp-admin/includes/plugin.php';
168
+ }
169
+
170
+ /**
171
+ * Check if WooCommerce is active
172
+ **/
173
+ if ( ! ( is_plugin_active('woocommerce/woocommerce.php') || is_plugin_active_for_network('woocommerce/woocommerce.php') )) {
174
+ $plugins[] = '<a target="_blank" href="https://wordpress.org/plugins/woocommerce/">WooCommerce</a>';
175
+ }
176
+
177
+ return $plugins;
178
+ }
179
  }
vendor/composer/installed.php CHANGED
@@ -5,7 +5,7 @@
5
  'type' => 'wordpress-plugin',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
- 'reference' => '36e7c3612b19376fd3be762de8d5aa0e470e0a98',
9
  'name' => 'premmerce/woo-permalink-manager',
10
  'dev' => false,
11
  ),
@@ -16,7 +16,7 @@
16
  'type' => 'wordpress-plugin',
17
  'install_path' => __DIR__ . '/../../',
18
  'aliases' => array(),
19
- 'reference' => '36e7c3612b19376fd3be762de8d5aa0e470e0a98',
20
  'dev_requirement' => false,
21
  ),
22
  'premmerce/wordpress-sdk' => array(
5
  'type' => 'wordpress-plugin',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
+ 'reference' => '0cacf3ffbcce738a59527f661a604355eebc055d',
9
  'name' => 'premmerce/woo-permalink-manager',
10
  'dev' => false,
11
  ),
16
  'type' => 'wordpress-plugin',
17
  'install_path' => __DIR__ . '/../../',
18
  'aliases' => array(),
19
+ 'reference' => '0cacf3ffbcce738a59527f661a604355eebc055d',
20
  'dev_requirement' => false,
21
  ),
22
  'premmerce/wordpress-sdk' => array(
views/admin/banner.php CHANGED
@@ -1,35 +1,41 @@
1
  <?php
2
 
3
  if ( ! defined('WPINC')) {
4
- die;
5
  }
6
 
7
  /**
 
 
8
  * @var $fm \Premmerce\SDK\V2\FileManager\FileManager
9
  */
10
  ?>
11
 
12
  <div class="notice woo-permalink-manager-banner" data-get-woo-permalink-manager-banner>
13
- <p>
14
- <img src="<?php echo esc_url($fm->locateAsset('admin/images/filter-icon.png')); ?>"
15
- alt="<? esc_attr_e( 'Premmerce WooCommerce Product Filter Premium', 'premmerce-url-manager' ); ?>">
16
- </p>
17
- <h1 class="woo-permalink-manager-banner--heading">
18
- <?php esc_html_e( 'Premmerce WooCommerce Product Filter Premium', 'premmerce-url-manager' ); ?>
19
- </h1>
20
- <p>
21
- <?php esc_html_e( 'Get clean URLs and additional Pro SEO settings for your Filter pages with Premmerce WooCommerce Filter Premium for only $69!', 'premmerce-url-manager' ); ?>
22
- <a
23
- href="<?php echo esc_url(add_query_arg(array('action' => 'premmerce_url_manager_ignore_banner'),
24
- site_url('wp-admin/admin-ajax.php'))); ?>"
25
- class="notice-dismiss dashicons dashicons-dismiss dashicons-dismiss-icon"
26
- data-get-woo-permalink-manager-banner--ignore></a>
 
 
 
 
27
 
28
- </p>
29
- <p>
30
- <a href="<?php echo esc_url( 'https://premmerce.com/premmerce-woocommerce-product-filter/' ); ?>"
31
- class="button button-primary button-hero" style="text-decoration: none;">
32
- <?php esc_html_e( 'Get it now', 'saleszone' ); ?>
33
- </a>
34
- </p>
35
- </div>
1
  <?php
2
 
3
  if ( ! defined('WPINC')) {
4
+ die;
5
  }
6
 
7
  /**
8
+ * Banner values
9
+ *
10
  * @var $fm \Premmerce\SDK\V2\FileManager\FileManager
11
  */
12
  ?>
13
 
14
  <div class="notice woo-permalink-manager-banner" data-get-woo-permalink-manager-banner>
15
+ <p>
16
+ <img src="<?php echo esc_url($fm->locateAsset('admin/images/filter-icon.png')); ?>"
17
+ alt="<?php esc_attr_e( 'Premmerce WooCommerce Product Filter Premium', 'premmerce-url-manager' ); ?>">
18
+ </p>
19
+ <h1 class="woo-permalink-manager-banner--heading">
20
+ <?php esc_html_e( 'Premmerce WooCommerce Product Filter Premium', 'premmerce-url-manager' ); ?>
21
+ </h1>
22
+ <p>
23
+ <?php esc_html_e( 'Get clean URLs and additional Pro SEO settings for your Filter pages with Premmerce WooCommerce Filter Premium for only $69!', 'premmerce-url-manager' ); ?>
24
+ <a
25
+ href="
26
+ <?php
27
+ echo esc_url(add_query_arg(array('action' => 'premmerce_url_manager_ignore_banner'),
28
+ site_url('wp-admin/admin-ajax.php')));
29
+ ?>
30
+ "
31
+ class="notice-dismiss dashicons dashicons-dismiss dashicons-dismiss-icon"
32
+ data-get-woo-permalink-manager-banner--ignore></a>
33
 
34
+ </p>
35
+ <p>
36
+ <a href="<?php echo esc_url( 'https://premmerce.com/premmerce-woocommerce-product-filter/' ); ?>"
37
+ class="button button-primary button-hero" style="text-decoration: none;">
38
+ <?php esc_html_e( 'Get it now', 'saleszone' ); ?>
39
+ </a>
40
+ </p>
41
+ </div>
views/admin/main.php CHANGED
@@ -1,33 +1,38 @@
1
  <?php
2
 
3
  if ( ! defined('WPINC')) {
4
- die;
5
  }
6
  ?>
7
  <div class="wrap">
8
- <h2><?php esc_html_e('WooCommerce Permalink Settings', 'premmerce-url-manager'); ?></h2>
9
 
10
- <h2 class="nav-tab-wrapper">
11
- <?php foreach ($tabs as $tab => $name):
12
- $class = ($tab == $current) ? ' nav-tab-active' : '';
13
- $link = ('affiliate' == $tab) ? '?page=premmerce-url-manager-admin-affiliation' : '?page=premmerce-url-manager-admin&tab=' . $tab;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
- ?>
16
- <a class='nav-tab<?php echo $class; ?>' href='<?php echo $link; ?>'>
17
- <?php echo $name; ?>
18
- </a>
19
- <?php endforeach; ?>
20
-
21
- <?php if (!premmerce_wpm_fs()->can_use_premium_code()) : //if it is not Premium plan.?>
22
- <a class="nav-tab premmerce-upgrate-to-premium-button"
23
- href="<?php echo admin_url('admin.php?page=premmerce-url-manager-admin-pricing'); ?>">
24
- <?php _e('Upgrate to Premium', 'premmerce-url-manager') ?>
25
- </a>
26
- <?php endif; ?>
27
- </h2>
28
-
29
- <?php $file = __DIR__ . "/tabs/{$current}.php"; ?>
30
- <?php if (file_exists($file)): ?>
31
- <?php include $file; ?>
32
- <?php endif; ?>
33
- </div>
1
  <?php
2
 
3
  if ( ! defined('WPINC')) {
4
+ die;
5
  }
6
  ?>
7
  <div class="wrap">
8
+ <h2><?php esc_html_e('WooCommerce Permalink Settings', 'premmerce-url-manager'); ?></h2>
9
 
10
+ <?php if (!empty($tabs)) : ?>
11
+ <h2 class="nav-tab-wrapper">
12
+ <?php
13
+ foreach ($tabs as $tabKey => $tabName) :
14
+ $class = ( $tabKey === $current ) ? ' nav-tab-active' : '';
15
+ $tabLink = ( 'affiliate' === $tabKey ) ? '?page=premmerce-url-manager-admin-affiliation' : '?page=premmerce-url-manager-admin&tab=' . $tabKey;
16
+ ?>
17
+ <a class='nav-tab<?php echo esc_attr($class); ?>' href='<?php echo esc_url($tabLink); ?>'>
18
+ <?php echo esc_attr($tabName); ?>
19
+ </a>
20
+ <?php
21
+ endforeach;
22
+ if (!premmerce_wpm_fs()->can_use_premium_code()) : //if it is not Premium plan.
23
+ ?>
24
+ <a class="nav-tab premmerce-upgrate-to-premium-button"
25
+ href="<?php echo esc_url(admin_url('admin.php?page=premmerce-url-manager-admin-pricing')); ?>">
26
+ <?php esc_html_e('Upgrate to Premium', 'premmerce-url-manager'); ?>
27
+ </a>
28
+ <?php
29
+ endif;
30
+ ?>
31
+ </h2>
32
+ <?php endif; ?>
33
 
34
+ <?php $file = __DIR__ . "/tabs/{$current}.php"; ?>
35
+ <?php if (file_exists($file)) : ?>
36
+ <?php include $file; ?>
37
+ <?php endif; ?>
38
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/section/additional.php CHANGED
@@ -5,6 +5,8 @@ if ( ! defined( 'WPINC' ) ) {
5
  }
6
 
7
  /**
 
 
8
  * @var bool $free
9
  * @var string $tag
10
  * @var string $canonical
@@ -16,114 +18,109 @@ if ( ! defined( 'WPINC' ) ) {
16
 
17
  use Premmerce\UrlManager\Admin\Settings;
18
 
19
- #premmerce_clear
20
  $free = true;
21
  if ( premmerce_wpm_fs()->can_use_premium_code() ) {
22
- #/premmerce_clear
23
  $free = false;
24
- #premmerce_clear
25
  }
26
- #/premmerce_clear
27
  ?>
28
 
29
  <table class="form-table">
30
- <tbody class="<?php echo $free ? 'is-free' : ''; ?>">
31
- <tr>
32
- <th>
33
- <label class="premium-only-label">
34
- <input <?php echo $free ? 'disabled' : ''; ?> type="checkbox"
35
- name="<?php echo Settings::OPTIONS; ?>[tag]" value="slug" <?php checked( 'slug', $tag ); ?>>
36
- <?php esc_html_e( 'Remove product tag base', 'premmerce-url-manager' ) ?>
37
- </label>
38
- <p class="description">
39
- <span class="premium-only-feature">
40
- <a class="premium-only-feature-link"
41
- href="<?php echo admin_url('admin.php?page=premmerce-url-manager-admin-pricing'); ?>">
42
- <?php esc_html_e( 'Available only in premium version', 'premmerce-url-manager' ); ?>
43
- </a>
44
- </span>
45
- </p>
46
- </th>
47
- </tr>
48
- <tr>
49
- <th>
50
- <label>
51
- <input type="checkbox" name="<?php echo Settings::OPTIONS; ?>[use_primary_category]"
52
- <?php checked( 'on', $use_primary_category ); ?>>
53
- <?php esc_html_e( 'Use primary category', 'premmerce-url-manager' ); ?>
54
- </label>
55
- <p class="description">
56
- <?php esc_html_e( "Use 'Yoast SEO' primary category to build product path", 'premmerce-url-manager' ) ?>
57
- </p>
58
- </th>
59
- </tr>
60
- <tr>
61
- <th>
62
- <label>
63
- <input type="checkbox" name="<?php echo Settings::OPTIONS; ?>[canonical]"
64
- <?php checked( 'on', $canonical ); ?>>
65
- <?php esc_html_e( 'Add canonicals', 'premmerce-url-manager' ) ?>
66
- </label>
67
- <p class="description">
68
- <?php esc_html_e( 'Add canonical meta tag to duplicated pages', 'premmerce-url-manager' ) ?></p>
69
- </th>
70
- </tr>
71
- <tr>
72
- <th>
73
- <label class="premium-only-label">
74
- <input <?php echo $free ? 'disabled' : ''; ?> type="checkbox"
75
- name="<?php echo Settings::OPTIONS; ?>[redirect]" <?php checked( 'on', $redirect ); ?>>
76
- <?php esc_html_e( 'Create redirects', 'premmerce-url-manager' ); ?>
77
- </label>
78
- <p class="description">
79
- <span class="premium-only-feature">
80
- <a class="premium-only-feature-link"
81
- href="<?php echo admin_url('admin.php?page=premmerce-url-manager-admin-pricing'); ?>">
82
- <?php esc_html_e( 'Available only in premium version', 'premmerce-url-manager' ); ?>
83
- </a>
84
- </span>
85
- <?php esc_html_e( 'Create 301 redirect from duplicated pages', 'premmerce-url-manager' ); ?>
86
- </p>
87
- </th>
88
- </tr>
89
- <tr>
90
- <th>
91
- <label class="premium-only-label">
92
- <input <?php echo $free ? 'disabled' : ''; ?> type="checkbox"
93
- name="<?php echo Settings::OPTIONS; ?>[breadcrumbs]" <?php checked( 'on', $breadcrumbs ); ?>>
94
- <?php esc_html_e( 'Support breadcrumbs', 'premmerce-url-manager' ); ?>
95
- </label>
96
- <p class="description">
97
- <span class="premium-only-feature">
98
- <a class="premium-only-feature-link"
99
- href="<?php echo admin_url('admin.php?page=premmerce-url-manager-admin-pricing'); ?>">
100
- <?php esc_html_e( 'Available only in premium version', 'premmerce-url-manager' ); ?>
101
- </a>
102
- </span>
103
- <?php esc_html_e( 'Enable breadcrumbs support', 'premmerce-url-manager' ); ?>
104
- </p>
105
- </th>
106
- </tr>
107
- <tr>
108
- <th>
109
- <label class="premium-only-label">
110
- <input <?php echo $free ? 'disabled' : ''; ?> type="checkbox"
111
- name="<?php echo Settings::OPTIONS; ?>[br_remove_shop]"
112
- <?php checked( 'on', $br_remove_shop ); ?>>
113
- <?php esc_html_e( 'Remove Shop', 'premmerce-url-manager' ); ?>
114
- </label>
115
- <p class="description">
 
 
 
 
 
 
 
 
 
 
116
 
117
- <span class="premium-only-feature">
118
- <a class="premium-only-feature-link"
119
- href="<?php echo admin_url('admin.php?page=premmerce-url-manager-admin-pricing'); ?>">
120
- <?php esc_html_e( 'Available only in premium version', 'premmerce-url-manager' ); ?>
121
- </a>
122
- </span>
123
- <?php esc_html_e( 'Remove "Shop" from breadcrumbs', 'premmerce-url-manager' ); ?>
124
- </p>
125
- </th>
126
- </tr>
127
-
128
- </tbody>
129
  </table>
5
  }
6
 
7
  /**
8
+ * Additional values
9
+ *
10
  * @var bool $free
11
  * @var string $tag
12
  * @var string $canonical
18
 
19
  use Premmerce\UrlManager\Admin\Settings;
20
 
 
21
  $free = true;
22
  if ( premmerce_wpm_fs()->can_use_premium_code() ) {
 
23
  $free = false;
 
24
  }
 
25
  ?>
26
 
27
  <table class="form-table">
28
+ <tbody class="<?php echo $free ? 'is-free' : ''; ?>">
29
+ <tr>
30
+ <th>
31
+ <label class="premium-only-label">
32
+ <input <?php echo $free ? 'disabled' : ''; ?> type="checkbox"
33
+ name="<?php echo esc_attr(Settings::OPTIONS); ?>[tag]" value="on" <?php checked( 'on', $tag ); ?>>
34
+ <?php esc_html_e( 'Remove product tag base', 'premmerce-url-manager' ); ?>
35
+ </label>
36
+ <p class="description">
37
+ <span class="premium-only-feature">
38
+ <a class="premium-only-feature-link"
39
+ href="<?php echo esc_url(admin_url('admin.php?page=premmerce-url-manager-admin-pricing')); ?>">
40
+ <?php esc_html_e( 'Available only in premium version', 'premmerce-url-manager' ); ?>
41
+ </a>
42
+ </span>
43
+ </p>
44
+ </th>
45
+ </tr>
46
+ <tr>
47
+ <th>
48
+ <label>
49
+ <input type="checkbox" name="<?php echo esc_attr(Settings::OPTIONS); ?>[use_primary_category]"
50
+ <?php checked( 'on', $use_primary_category ); ?>>
51
+ <?php esc_html_e( 'Use primary category', 'premmerce-url-manager' ); ?>
52
+ </label>
53
+ <p class="description">
54
+ <?php esc_html_e( "Use 'Yoast SEO' primary category to build product path", 'premmerce-url-manager' ); ?>
55
+ </p>
56
+ </th>
57
+ </tr>
58
+ <tr>
59
+ <th>
60
+ <label>
61
+ <input type="checkbox" name="<?php echo esc_attr(Settings::OPTIONS); ?>[canonical]"
62
+ <?php checked( 'on', $canonical ); ?>>
63
+ <?php esc_html_e( 'Add canonicals', 'premmerce-url-manager' ); ?>
64
+ </label>
65
+ <p class="description">
66
+ <?php esc_html_e( 'Add canonical meta tag to duplicated pages', 'premmerce-url-manager' ); ?></p>
67
+ </th>
68
+ </tr>
69
+ <tr>
70
+ <th>
71
+ <label class="premium-only-label">
72
+ <input <?php echo $free ? 'disabled' : ''; ?> type="checkbox"
73
+ name="<?php echo esc_attr(Settings::OPTIONS); ?>[redirect]" <?php checked( 'on', $redirect ); ?>>
74
+ <?php esc_html_e( 'Create redirects', 'premmerce-url-manager' ); ?>
75
+ </label>
76
+ <p class="description">
77
+ <span class="premium-only-feature">
78
+ <a class="premium-only-feature-link"
79
+ href="<?php echo esc_url(admin_url('admin.php?page=premmerce-url-manager-admin-pricing')); ?>">
80
+ <?php esc_html_e( 'Available only in premium version', 'premmerce-url-manager' ); ?>
81
+ </a>
82
+ </span>
83
+ <?php esc_html_e( 'Create 301 redirect from duplicated pages', 'premmerce-url-manager' ); ?>
84
+ </p>
85
+ </th>
86
+ </tr>
87
+ <tr>
88
+ <th>
89
+ <label class="premium-only-label">
90
+ <input <?php echo $free ? 'disabled' : ''; ?> type="checkbox"
91
+ name="<?php echo esc_attr(Settings::OPTIONS); ?>[breadcrumbs]" <?php checked( 'on', $breadcrumbs ); ?>>
92
+ <?php esc_html_e( 'Support breadcrumbs', 'premmerce-url-manager' ); ?>
93
+ </label>
94
+ <p class="description">
95
+ <span class="premium-only-feature">
96
+ <a class="premium-only-feature-link"
97
+ href="<?php echo esc_url(admin_url('admin.php?page=premmerce-url-manager-admin-pricing')); ?>">
98
+ <?php esc_html_e( 'Available only in premium version', 'premmerce-url-manager' ); ?>
99
+ </a>
100
+ </span>
101
+ <?php esc_html_e( 'Enable breadcrumbs support', 'premmerce-url-manager' ); ?>
102
+ </p>
103
+ </th>
104
+ </tr>
105
+ <tr>
106
+ <th>
107
+ <label class="premium-only-label">
108
+ <input <?php echo $free ? 'disabled' : ''; ?> type="checkbox"
109
+ name="<?php echo esc_attr(Settings::OPTIONS); ?>[br_remove_shop]"
110
+ <?php checked( 'on', $br_remove_shop ); ?>>
111
+ <?php esc_html_e( 'Remove Shop', 'premmerce-url-manager' ); ?>
112
+ </label>
113
+ <p class="description">
114
+ <span class="premium-only-feature">
115
+ <a class="premium-only-feature-link"
116
+ href="<?php echo esc_url(admin_url('admin.php?page=premmerce-url-manager-admin-pricing')); ?>">
117
+ <?php esc_html_e( 'Available only in premium version', 'premmerce-url-manager' ); ?>
118
+ </a>
119
+ </span>
120
+ <?php esc_html_e( 'Remove "Shop" from breadcrumbs', 'premmerce-url-manager' ); ?>
121
+ </p>
122
+ </th>
123
+ </tr>
124
 
125
+ </tbody>
 
 
 
 
 
 
 
 
 
 
 
126
  </table>
views/admin/section/category.php CHANGED
@@ -8,39 +8,39 @@ use Premmerce\UrlManager\Admin\Settings;
8
 
9
  ?>
10
  <table class="form-table">
11
- <tbody>
12
- <tr>
13
- <th>
14
- <label class="flex-label">
15
- <input type="radio" name="<?php echo Settings::OPTIONS; ?>[category]"
16
- value="" <?php checked( '', $category ); ?>>
17
  <?php esc_html_e( 'Use WooCommerce settings', 'premmerce-url-manager' ); ?>
18
- </label>
19
- </th>
20
- </tr>
21
- <tr>
22
- <th>
23
- <label class="flex-label">
24
- <input type="radio" name="<?php echo Settings::OPTIONS; ?>[category]"
25
- value="slug" <?php checked( 'slug', $category ); ?>>
26
- <?php esc_html_e( 'Category slug', 'premmerce-url-manager' ) ?>
27
- </label>
28
- </th>
29
- <td>
30
- <code><?php echo home_url( '/category' ); ?></code>
31
- </td>
32
- </tr>
33
- <tr>
34
- <th>
35
- <label class="flex-label">
36
- <input type="radio" name="<?php echo Settings::OPTIONS; ?>[category]"
37
- value="hierarchical" <?php checked( 'hierarchical', $category ); ?>>
38
  <?php esc_html_e( 'Full category path', 'premmerce-url-manager' ); ?>
39
- </label>
40
- </th>
41
- <td>
42
- <code><?php echo home_url( 'parent-category/category' ); ?></code>
43
- </td>
44
- </tr>
45
- </tbody>
46
- </table>
8
 
9
  ?>
10
  <table class="form-table">
11
+ <tbody>
12
+ <tr>
13
+ <th>
14
+ <label class="flex-label">
15
+ <input type="radio" name="<?php echo esc_attr(Settings::OPTIONS); ?>[category]"
16
+ value="" <?php checked( '', $category ); ?>>
17
  <?php esc_html_e( 'Use WooCommerce settings', 'premmerce-url-manager' ); ?>
18
+ </label>
19
+ </th>
20
+ </tr>
21
+ <tr>
22
+ <th>
23
+ <label class="flex-label">
24
+ <input type="radio" name="<?php echo esc_attr(Settings::OPTIONS); ?>[category]"
25
+ value="slug" <?php checked( 'slug', $category ); ?>>
26
+ <?php esc_html_e( 'Category slug', 'premmerce-url-manager' ); ?>
27
+ </label>
28
+ </th>
29
+ <td>
30
+ <code><?php echo esc_url(home_url( '/category' )); ?></code>
31
+ </td>
32
+ </tr>
33
+ <tr>
34
+ <th>
35
+ <label class="flex-label">
36
+ <input type="radio" name="<?php echo esc_attr(Settings::OPTIONS); ?>[category]"
37
+ value="hierarchical" <?php checked( 'hierarchical', $category ); ?>>
38
  <?php esc_html_e( 'Full category path', 'premmerce-url-manager' ); ?>
39
+ </label>
40
+ </th>
41
+ <td>
42
+ <code><?php echo esc_url(home_url( 'parent-category/category' )); ?></code>
43
+ </td>
44
+ </tr>
45
+ </tbody>
46
+ </table>
views/admin/section/product.php CHANGED
@@ -1,61 +1,61 @@
1
  <?php
2
 
3
  if ( ! defined('WPINC')) {
4
- die;
5
  }
6
 
7
  use Premmerce\UrlManager\Admin\Settings;
8
 
9
  ?>
10
  <table class="form-table">
11
- <tbody>
12
- <tr>
13
- <th>
14
- <label class="flex-label">
15
- <input type="radio" name="<?php echo Settings::OPTIONS; ?>[product]"
16
- value="" <?php checked( '', $product ); ?>>
17
- <span>
18
  <?php esc_html_e( 'Use WooCommerce settings', 'premmerce-url-manager' ); ?>
19
- </span>
20
 
21
- </label>
22
- </th>
23
- </tr>
24
- <tr>
25
- <th>
26
- <label class="flex-label">
27
- <input type="radio" name="<?php echo Settings::OPTIONS; ?>[product]"
28
- value="slug" <?php checked( 'slug', $product ); ?>>
29
  <?php esc_html_e( 'Product slug', 'premmerce-url-manager' ); ?>
30
- </label>
31
- </th>
32
- <td>
33
- <code><?php echo home_url( '/sample-product' ); ?></code>
34
- </td>
35
- </tr>
36
- <tr>
37
- <th>
38
- <label class="flex-label">
39
- <input type="radio" name="<?php echo Settings::OPTIONS; ?>[product]"
40
- value="category_slug" <?php checked( 'category_slug', $product ); ?>>
41
  <?php esc_html_e( 'Product slug with primary category', 'premmerce-url-manager' ); ?>
42
- </label>
43
- </th>
44
- <td>
45
- <code><?php echo home_url( '/category/sample-product' ); ?></code>
46
- </td>
47
- </tr>
48
- <tr>
49
- <th>
50
- <label class="flex-label">
51
- <input type="radio" name="<?php echo Settings::OPTIONS; ?>[product]"
52
- value="hierarchical" <?php checked( 'hierarchical', $product ); ?>>
53
  <?php esc_html_e( 'Full product path', 'premmerce-url-manager' ); ?>
54
- </label>
55
- </th>
56
- <td>
57
- <code><?php echo home_url( 'parent-category/category/sample-product' ); ?></code>
58
- </td>
59
- </tr>
60
- </tbody>
61
- </table>
1
  <?php
2
 
3
  if ( ! defined('WPINC')) {
4
+ die;
5
  }
6
 
7
  use Premmerce\UrlManager\Admin\Settings;
8
 
9
  ?>
10
  <table class="form-table">
11
+ <tbody>
12
+ <tr>
13
+ <th>
14
+ <label class="flex-label">
15
+ <input type="radio" name="<?php echo esc_attr(Settings::OPTIONS); ?>[product]"
16
+ value="" <?php checked( '', $product ); ?>>
17
+ <span>
18
  <?php esc_html_e( 'Use WooCommerce settings', 'premmerce-url-manager' ); ?>
19
+ </span>
20
 
21
+ </label>
22
+ </th>
23
+ </tr>
24
+ <tr>
25
+ <th>
26
+ <label class="flex-label">
27
+ <input type="radio" name="<?php echo esc_attr(Settings::OPTIONS); ?>[product]"
28
+ value="slug" <?php checked( 'slug', $product ); ?>>
29
  <?php esc_html_e( 'Product slug', 'premmerce-url-manager' ); ?>
30
+ </label>
31
+ </th>
32
+ <td>
33
+ <code><?php echo esc_url(home_url( '/sample-product' )); ?></code>
34
+ </td>
35
+ </tr>
36
+ <tr>
37
+ <th>
38
+ <label class="flex-label">
39
+ <input type="radio" name="<?php echo esc_attr(Settings::OPTIONS); ?>[product]"
40
+ value="category_slug" <?php checked( 'category_slug', $product ); ?>>
41
  <?php esc_html_e( 'Product slug with primary category', 'premmerce-url-manager' ); ?>
42
+ </label>
43
+ </th>
44
+ <td>
45
+ <code><?php echo esc_url(home_url( '/category/sample-product' )); ?></code>
46
+ </td>
47
+ </tr>
48
+ <tr>
49
+ <th>
50
+ <label class="flex-label">
51
+ <input type="radio" name="<?php echo esc_attr(Settings::OPTIONS); ?>[product]"
52
+ value="hierarchical" <?php checked( 'hierarchical', $product ); ?>>
53
  <?php esc_html_e( 'Full product path', 'premmerce-url-manager' ); ?>
54
+ </label>
55
+ </th>
56
+ <td>
57
+ <code><?php echo esc_url(home_url( 'parent-category/category/sample-product' )); ?></code>
58
+ </td>
59
+ </tr>
60
+ </tbody>
61
+ </table>
views/admin/section/sku.php CHANGED
@@ -1,10 +1,12 @@
1
  <?php
2
 
3
  if ( ! defined('WPINC')) {
4
- die;
5
  }
6
 
7
  /**
 
 
8
  * @var bool $free
9
  * @var string $sku
10
  * @var string $product
@@ -13,60 +15,43 @@ if ( ! defined('WPINC')) {
13
 
14
  use Premmerce\UrlManager\Admin\Settings;
15
 
16
- #premmerce_clear
17
  $free = true;
18
  if ( premmerce_wpm_fs()->can_use_premium_code() ) {
19
- #/premmerce_clear
20
  $free = false;
21
- #premmerce_clear
22
- }
23
- #/premmerce_clear
24
-
25
- switch( $product ) {
26
- case 'category_slug':
27
- $productPath = '/category';
28
- break;
29
- case 'hierarchical':
30
- $productPath = 'parent-category/category';
31
- break;
32
- default:
33
- $productPath = '';
34
- break;
35
  }
36
 
37
  ?>
38
  <table class="form-table">
39
- <tbody class="<?php echo $free ? 'is-free' : ''; ?>">
40
- <tr>
41
- <th>
42
- <label class="flex-label">
43
- <input type="radio" name="<?= Settings::OPTIONS ?>[sku]" value="" <?php checked( '', $sku ); ?>>
44
- <span>
45
- <?php esc_html_e( 'Use WooCommerce settings', 'premmerce-url-manager' ); ?>
46
- </span>
47
-
48
- </label>
49
- </th>
50
- </tr>
51
- <tr>
52
- <th>
53
- <label class="flex-label">
54
- <input <?php echo $free ? 'disabled' : '' ?> type="radio" name="<?= Settings::OPTIONS ?>[sku]"
55
- value="sku" <?php checked( 'sku', $sku ); ?>>
56
- <?php esc_html_e( 'Replace product slug', 'premmerce-url-manager' ); ?>
57
- </label>
58
- <p class="description">
59
- <span class="premium-only-feature">
60
- <a class="premium-only-feature-link"
61
- href="<?php echo admin_url('admin.php?page=premmerce-url-manager-admin-pricing'); ?>">
62
- <?php esc_html_e( 'Available only in premium version', 'premmerce-url-manager' ); ?>
63
- </a>
64
- </span>
65
- </p>
66
- </th>
67
- <td>
68
- <code><?php echo home_url( $productPath . '/SKU' ); ?></code>
69
- </td>
70
- </tr>
71
- </tbody>
72
- </table>
1
  <?php
2
 
3
  if ( ! defined('WPINC')) {
4
+ die;
5
  }
6
 
7
  /**
8
+ * SKU Variables
9
+ *
10
  * @var bool $free
11
  * @var string $sku
12
  * @var string $product
15
 
16
  use Premmerce\UrlManager\Admin\Settings;
17
 
 
18
  $free = true;
19
  if ( premmerce_wpm_fs()->can_use_premium_code() ) {
 
20
  $free = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  }
22
 
23
  ?>
24
  <table class="form-table">
25
+ <tbody class="<?php echo $free ? 'is-free' : ''; ?>">
26
+ <tr>
27
+ <th>
28
+ <label class="flex-label">
29
+ <input type="radio" name="<?php echo esc_attr(Settings::OPTIONS); ?>[sku]" value="" <?php checked( '', $sku ); ?>>
30
+ <span>
31
+ <?php esc_html_e( 'Use WooCommerce settings', 'premmerce-url-manager' ); ?>
32
+ </span>
33
+ </label>
34
+ </th>
35
+ </tr>
36
+ <tr>
37
+ <th>
38
+ <label class="flex-label">
39
+ <input <?php echo $free ? 'disabled' : ''; ?> type="radio" name="<?php echo esc_attr(Settings::OPTIONS); ?>[sku]"
40
+ value="sku" <?php checked( 'sku', $sku ); ?>>
41
+ <?php esc_html_e( 'Replace product slug', 'premmerce-url-manager' ); ?>
42
+ </label>
43
+ <p class="description">
44
+ <span class="premium-only-feature">
45
+ <a class="premium-only-feature-link"
46
+ href="<?php echo esc_url(admin_url('admin.php?page=premmerce-url-manager-admin-pricing')); ?>">
47
+ <?php esc_html_e( 'Available only in premium version', 'premmerce-url-manager' ); ?>
48
+ </a>
49
+ </span>
50
+ </p>
51
+ </th>
52
+ <td>
53
+ <code><?php echo esc_url(home_url( $productPath . '/SKU' )); ?></code>
54
+ </td>
55
+ </tr>
56
+ </tbody>
57
+ </table>
 
views/admin/section/suffix.php CHANGED
@@ -5,6 +5,8 @@ if ( ! defined( 'WPINC' ) ) {
5
  }
6
 
7
  /**
 
 
8
  * @var bool $free
9
  * @var string $suffix
10
  * @var string $enable_suffix_products
@@ -15,119 +17,105 @@ if ( ! defined( 'WPINC' ) ) {
15
 
16
  use Premmerce\UrlManager\Admin\Settings;
17
 
18
- #premmerce_clear
19
  $free = true;
20
  if ( premmerce_wpm_fs()->can_use_premium_code() ) {
21
- #/premmerce_clear
22
  $free = false;
23
- #premmerce_clear
24
  }
25
- #/premmerce_clear
26
  ?>
27
 
28
- <script>
29
- jQuery(document).ready(function($) {
30
- jQuery(":input").inputmask();
31
-
32
- $('#permalink_url_suffix').on('input', function() {
33
- $('.permalink_url_suffix').text($(this).val());
34
- });
35
- });
36
- </script>
37
-
38
  <table class="form-table">
39
- <tbody class="<?php echo $free ? 'is-free' : ''; ?>">
40
- <tr>
41
- <th>
42
- <label class="premium-only-label">
43
- <input <?php echo $free ? 'disabled' : ''; ?> type="text" id="permalink_url_suffix"
44
- name="<?php echo Settings::OPTIONS; ?>[suffix]" value="<?php echo $suffix; ?>"
45
- data-inputmask="'mask': '.[*{1,10}]'">
46
- </label>
47
- <p class="description">
48
- <span class="premium-only-feature">
49
- <a class="premium-only-feature-link"
50
- href="<?php echo admin_url('admin.php?page=premmerce-url-manager-admin-pricing'); ?>">
51
- <?php esc_html_e( 'Available only in premium version', 'premmerce-url-manager' ); ?>
52
- </a>
53
- </span>
54
- <?php esc_html_e( 'Specify suffix for your urls. For example ', 'premmerce-url-manager' ); ?>
55
- <b>.html</b>
56
- </p>
57
- </th>
58
- </tr>
59
-
60
- <tr>
61
- <th>
62
- <label class="premium-only-label">
63
- <input <?php echo $free ? 'disabled' : ''; ?> type="checkbox"
64
- name="<?php echo Settings::OPTIONS; ?>[enable_suffix_products]"
65
- <?php checked( 'on', $enable_suffix_products ); ?>>
66
- <?php esc_html_e( 'Enable for products', 'premmerce-url-manager' ); ?>
67
- </label>
68
- <p class="description">
69
- <span class="premium-only-feature">
70
- <a class="premium-only-feature-link"
71
- href="<?php echo admin_url('admin.php?page=premmerce-url-manager-admin-pricing'); ?>">
72
- <?php esc_html_e( 'Available only in premium version', 'premmerce-url-manager' ); ?>
73
- </a>
74
- </span>
75
- <br>
76
- <?php if ( $product == 'slug' ): ?>
77
-
78
- <code>
79
- <?php echo home_url( '/sample-product' ); ?><span class="permalink_url_suffix"><?php echo $suffix; ?></span>
80
- </code>
81
-
82
- <?php elseif ( $product === 'category_slug' ): ?>
83
-
84
- <code>
85
- <?php echo home_url( '/category/sample-product' ); ?><span class="permalink_url_suffix"><?php echo $suffix; ?></span>
86
- </code>
87
-
88
- <?php elseif ( $product === 'hierarchical' ): ?>
89
-
90
- <code>
91
- <?php echo home_url( 'parent-category/category/sample-product' ); ?><span
92
- class="permalink_url_suffix"><?php echo $suffix; ?></span>
93
- </code>
94
-
95
- <?php endif; ?>
96
- </p>
97
- </th>
98
- </tr>
99
-
100
- <tr>
101
- <th>
102
- <label class="premium-only-label">
103
- <input <?php echo $free ? 'disabled' : ''; ?> type="checkbox"
104
- name="<?php echo Settings::OPTIONS; ?>[enable_suffix_categories]"
105
- <?php checked( 'on', $enable_suffix_categories ); ?>>
106
- <?php esc_html_e( 'Enable for categories', 'premmerce-url-manager' ); ?>
107
- </label>
108
- <p class="description">
109
- <span class="premium-only-feature">
110
- <a class="premium-only-feature-link"
111
- href="<?php echo admin_url('admin.php?page=premmerce-url-manager-admin-pricing'); ?>">
112
- <?php esc_html_e( 'Available only in premium version', 'premmerce-url-manager' ); ?>
113
- </a>
114
- </span>
115
- <br>
116
- <?php if ( $category == 'slug' ): ?>
117
-
118
- <code>
119
- <?php echo home_url( '/category' ); ?><span class="permalink_url_suffix"><?php echo $suffix; ?></span>
120
- </code>
121
-
122
-
123
- <?php elseif ( $category === 'hierarchical' ): ?>
124
- <code>
125
- <?php echo home_url( 'parent-category/category' ); ?><span class="permalink_url_suffix"><?php echo $suffix; ?></span>
126
- </code>
127
-
128
- <?php endif; ?>
129
- </p>
130
- </th>
131
- </tr>
132
- </tbody>
133
  </table>
5
  }
6
 
7
  /**
8
+ * Suffix values
9
+ *
10
  * @var bool $free
11
  * @var string $suffix
12
  * @var string $enable_suffix_products
17
 
18
  use Premmerce\UrlManager\Admin\Settings;
19
 
 
20
  $free = true;
21
  if ( premmerce_wpm_fs()->can_use_premium_code() ) {
 
22
  $free = false;
 
23
  }
 
24
  ?>
25
 
 
 
 
 
 
 
 
 
 
 
26
  <table class="form-table">
27
+ <tbody class="<?php echo $free ? 'is-free' : ''; ?>">
28
+ <tr>
29
+ <th>
30
+ <label class="premium-only-label">
31
+ <input <?php echo $free ? 'disabled' : ''; ?> type="text" id="permalink_url_suffix"
32
+ name="<?php echo esc_attr(Settings::OPTIONS); ?>[suffix]" value="<?php echo esc_attr($suffix); ?>"
33
+ data-inputmask="'mask': '.[*{1,10}]'">
34
+ </label>
35
+ <p class="description">
36
+ <span class="premium-only-feature">
37
+ <a class="premium-only-feature-link"
38
+ href="<?php echo esc_url(admin_url('admin.php?page=premmerce-url-manager-admin-pricing')); ?>">
39
+ <?php esc_html_e( 'Available only in premium version', 'premmerce-url-manager' ); ?>
40
+ </a>
41
+ </span>
42
+ <?php esc_html_e( 'Specify suffix for your urls. For example ', 'premmerce-url-manager' ); ?>
43
+ <b>.html</b>
44
+ </p>
45
+ </th>
46
+ </tr>
47
+
48
+ <tr>
49
+ <th>
50
+ <label class="premium-only-label">
51
+ <input <?php echo $free ? 'disabled' : ''; ?> type="checkbox"
52
+ name="<?php echo esc_attr(Settings::OPTIONS); ?>[enable_suffix_products]"
53
+ <?php checked( 'on', $enable_suffix_products ); ?>>
54
+ <?php esc_html_e( 'Enable for products', 'premmerce-url-manager' ); ?>
55
+ </label>
56
+ <p class="description">
57
+ <span class="premium-only-feature">
58
+ <a class="premium-only-feature-link"
59
+ href="<?php echo esc_url(admin_url('admin.php?page=premmerce-url-manager-admin-pricing')); ?>">
60
+ <?php esc_html_e( 'Available only in premium version', 'premmerce-url-manager' ); ?>
61
+ </a>
62
+ </span>
63
+ <br>
64
+ <?php if ( 'slug' === $product ) : ?>
65
+
66
+ <code>
67
+ <?php echo esc_url(home_url( '/sample-product' )); ?><span class="permalink_url_suffix"><?php echo esc_attr($suffix); ?></span>
68
+ </code>
69
+
70
+ <?php elseif ( 'category_slug' === $product ) : ?>
71
+
72
+ <code>
73
+ <?php echo esc_url(home_url( '/category/sample-product' )); ?><span class="permalink_url_suffix"><?php echo esc_attr($suffix); ?></span>
74
+ </code>
75
+
76
+ <?php elseif ( 'hierarchical' === $product ) : ?>
77
+
78
+ <code>
79
+ <?php echo esc_url(home_url( 'parent-category/category/sample-product' )); ?><span
80
+ class="permalink_url_suffix"><?php echo esc_attr($suffix); ?></span>
81
+ </code>
82
+
83
+ <?php endif; ?>
84
+ </p>
85
+ </th>
86
+ </tr>
87
+
88
+ <tr>
89
+ <th>
90
+ <label class="premium-only-label">
91
+ <input <?php echo $free ? 'disabled' : ''; ?> type="checkbox"
92
+ name="<?php echo esc_attr(Settings::OPTIONS); ?>[enable_suffix_categories]"
93
+ <?php checked( 'on', $enable_suffix_categories ); ?>>
94
+ <?php esc_html_e( 'Enable for categories', 'premmerce-url-manager' ); ?>
95
+ </label>
96
+ <p class="description">
97
+ <span class="premium-only-feature">
98
+ <a class="premium-only-feature-link"
99
+ href="<?php echo esc_url(admin_url('admin.php?page=premmerce-url-manager-admin-pricing')); ?>">
100
+ <?php esc_html_e( 'Available only in premium version', 'premmerce-url-manager' ); ?>
101
+ </a>
102
+ </span>
103
+ <br>
104
+ <?php if ( 'slug' === $category ) : ?>
105
+
106
+ <code>
107
+ <?php echo esc_url(home_url( '/category' )); ?><span class="permalink_url_suffix"><?php echo esc_attr($suffix); ?></span>
108
+ </code>
109
+
110
+
111
+ <?php elseif ( 'hierarchical' === $category ) : ?>
112
+ <code>
113
+ <?php echo esc_url(home_url( 'parent-category/category' )); ?><span class="permalink_url_suffix"><?php echo esc_attr($suffix); ?></span>
114
+ </code>
115
+
116
+ <?php endif; ?>
117
+ </p>
118
+ </th>
119
+ </tr>
120
+ </tbody>
121
  </table>
views/admin/tabs/account.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
 
3
  if ( ! defined('WPINC')) {
4
- die;
5
  }
6
 
7
  if (function_exists('premmerce_wpm_fs') && premmerce_wpm_fs()->is_registered()) {
8
- premmerce_wpm_fs()->add_filter('hide_account_tabs', '__return_true');
9
- premmerce_wpm_fs()->_account_page_load();
10
- premmerce_wpm_fs()->_account_page_render();
11
  }
1
  <?php
2
 
3
  if ( ! defined('WPINC')) {
4
+ die;
5
  }
6
 
7
  if (function_exists('premmerce_wpm_fs') && premmerce_wpm_fs()->is_registered()) {
8
+ premmerce_wpm_fs()->add_filter('hide_account_tabs', '__return_true');
9
+ premmerce_wpm_fs()->_account_page_load();
10
+ premmerce_wpm_fs()->_account_page_render();
11
  }
views/admin/tabs/bundle-and-save/faq.php CHANGED
@@ -3,90 +3,99 @@
3
  use Premmerce\UrlManager\Admin\BundleAndSave;
4
 
5
  if (! defined('ABSPATH')) {
6
- exit;
7
  }
8
 
9
  $bundlesFAQs = [
10
- [
11
- 'question' => __('How does the domain limit work?', 'premmerce-url-manager'),
12
- 'answer' => __('Once you choose a plan, you get access to the products described in the package and a specific number of domain licenses. You can activate any of the premium products (themes or plugins) on the domains where you have an active license.', 'premmerce-url-manager'),
13
- ],
14
- [
15
- 'question' => __('What will happen if I if I don’t renew my license in a year?', 'premmerce-url-manager'),
16
- 'answer' => __('Your domain license will become invalid in 12 months period. The product will continue to work.However, after your license expires, the access to security updates, support requests, and new features is discontinued until the new license is activated. For lifetime membership this is not the case, only for the annual plans.', 'premmerce-url-manager'),
17
- ],
18
- [
19
- 'question' => __('How often do I have to pay?', 'premmerce-url-manager'),
20
- 'answer' => __('With the annual membership, you will have to renew after the first year if you want to continue receiving security updates and support. The product will continue to work even if you cancel immediately, but you won’t get the updates and support after the license expires. You are free to upgrade/cancel anytime. Lifetime is a one-time payment, and as long as the product is maintained, you will get support and security updates.', 'premmerce-url-manager'),
21
- ],
22
- [
23
- 'question' => __('Do you offer refunds?', 'premmerce-url-manager'),
24
- 'answer' => __('Yes, if you have an issue that cannot be resolved via our support service within 14 days from the purchase date, you will be offered a full refund.', 'premmerce-url-manager'),
25
- ],
26
- [
27
- 'question' => __('Will my subscription renew automatically?', 'premmerce-url-manager'),
28
- 'answer' => __('Yes, your subscription will renew automatically every year, until its cancellation.', 'premmerce-url-manager'),
29
- ],
30
- [
31
- 'question' => __('Can I use my licence in a development environment?', 'premmerce-url-manager'),
32
- 'answer' => __('Yes. Most development environments will not count towards your site limit.', 'premmerce-url-manager'),
33
- ],
34
- [
35
- 'question' => __('How do I download the plugins?', 'premmerce-url-manager'),
36
- 'answer' => __('Once you place your order, you\'ll be sent an email containing the download links to all the purchased plugins and themes.', 'premmerce-url-manager'),
37
- ],
38
- [
39
- 'question' => __('How much money am I saving with a Premmerce Suite bundle?', 'premmerce-url-manager'),
40
- 'answer' => __('You will save at least 70% when you buy a bundle. This percentage is even higher if you opt to pay annually.', 'premmerce-url-manager'),
41
- ],
42
- [
43
- 'question' => __('Are there any hidden fees and what do we have to pay for after the project has been delivered?', 'premmerce-url-manager'),
44
- 'answer' => __('There are no hidden or recurring charges to be paid after a project delivery. However, you need a hosting platform and a domain name for your website which are usually paid on a regular basis. You can buy them from our company or elsewhere. The most important thing is that your hosting platform must adhere to our software minimal requirements.', 'premmerce-url-manager'),
45
- ],
46
  ];
47
  ?>
48
 
49
  <div class="c-section">
50
- <div class="c-section__container">
51
- <div class="c-section__title"><span style="font-weight: 400;">Frequently Asked Questions</span></div>
52
- <div class="c-section__desc"><span style="font-weight: 400;">
53
- <?php _e('If you have any further questions, don’t hesitate to ask us via the online chat or by e-mail', 'premmerce-url-manager'); ?>
54
- </span>
55
- <a href="mailto:info@premmerce.com">
56
- <span style="font-weight: 400;">
57
- info@premmerce.com
58
- </span>
59
- </a>
60
- </div>
61
- <div class="c-section__content">
62
- <?php
63
- $rowCount = 0;
64
- $numOfCols = 2;
65
- foreach ($bundlesFAQs as $faq) :
66
- if ($rowCount % $numOfCols == 0) { ?> <div class="row"> <?php }
67
- $rowCount++;
68
- ?>
69
- <div class="col-sm-6">
70
- <div class="pc-qa" data-qa-scope="">
71
- <div class="pc-qa__header" data-qa-toggle="">
72
- <div class="pc-qa__title">
73
- <?php echo $faq['question']; ?>
74
- </div>
75
- <div class="pc-qa__arrow">
76
- <svg class="svg-icon">
77
- <?php BundleAndSave::premmerce_use_svg_symbol($svg, 'arrow-bootom') ?>
78
- </svg>
79
- </div>
80
- </div>
81
- <div class="pc-qa__content" data-qa-content="" style="display: none;">
82
- <?php echo $faq['answer']; ?>
83
- </div>
84
- </div>
85
- </div>
86
- <?php
87
- if ( $rowCount % $numOfCols == 0) : ?>
88
- </div> <?php endif; ?>
89
- <?php endforeach; ?>
90
- </div>
91
- </div>
92
- </div>
 
 
 
 
 
 
 
 
 
3
  use Premmerce\UrlManager\Admin\BundleAndSave;
4
 
5
  if (! defined('ABSPATH')) {
6
+ exit;
7
  }
8
 
9
  $bundlesFAQs = [
10
+ [
11
+ 'question' => __('How does the domain limit work?', 'premmerce-url-manager'),
12
+ 'answer' => __('Once you choose a plan, you get access to the products described in the package and a specific number of domain licenses. You can activate any of the premium products (themes or plugins) on the domains where you have an active license.', 'premmerce-url-manager'),
13
+ ],
14
+ [
15
+ 'question' => __('What will happen if I if I don’t renew my license in a year?', 'premmerce-url-manager'),
16
+ 'answer' => __('Your domain license will become invalid in 12 months period. The product will continue to work.However, after your license expires, the access to security updates, support requests, and new features is discontinued until the new license is activated. For lifetime membership this is not the case, only for the annual plans.', 'premmerce-url-manager'),
17
+ ],
18
+ [
19
+ 'question' => __('How often do I have to pay?', 'premmerce-url-manager'),
20
+ 'answer' => __('With the annual membership, you will have to renew after the first year if you want to continue receiving security updates and support. The product will continue to work even if you cancel immediately, but you won’t get the updates and support after the license expires. You are free to upgrade/cancel anytime. Lifetime is a one-time payment, and as long as the product is maintained, you will get support and security updates.', 'premmerce-url-manager'),
21
+ ],
22
+ [
23
+ 'question' => __('Do you offer refunds?', 'premmerce-url-manager'),
24
+ 'answer' => __('Yes, if you have an issue that cannot be resolved via our support service within 14 days from the purchase date, you will be offered a full refund.', 'premmerce-url-manager'),
25
+ ],
26
+ [
27
+ 'question' => __('Will my subscription renew automatically?', 'premmerce-url-manager'),
28
+ 'answer' => __('Yes, your subscription will renew automatically every year, until its cancellation.', 'premmerce-url-manager'),
29
+ ],
30
+ [
31
+ 'question' => __('Can I use my licence in a development environment?', 'premmerce-url-manager'),
32
+ 'answer' => __('Yes. Most development environments will not count towards your site limit.', 'premmerce-url-manager'),
33
+ ],
34
+ [
35
+ 'question' => __('How do I download the plugins?', 'premmerce-url-manager'),
36
+ 'answer' => __('Once you place your order, you\'ll be sent an email containing the download links to all the purchased plugins and themes.', 'premmerce-url-manager'),
37
+ ],
38
+ [
39
+ 'question' => __('How much money am I saving with a Premmerce Suite bundle?', 'premmerce-url-manager'),
40
+ 'answer' => __('You will save at least 70% when you buy a bundle. This percentage is even higher if you opt to pay annually.', 'premmerce-url-manager'),
41
+ ],
42
+ [
43
+ 'question' => __('Are there any hidden fees and what do we have to pay for after the project has been delivered?', 'premmerce-url-manager'),
44
+ 'answer' => __('There are no hidden or recurring charges to be paid after a project delivery. However, you need a hosting platform and a domain name for your website which are usually paid on a regular basis. You can buy them from our company or elsewhere. The most important thing is that your hosting platform must adhere to our software minimal requirements.', 'premmerce-url-manager'),
45
+ ],
46
  ];
47
  ?>
48
 
49
  <div class="c-section">
50
+ <div class="c-section__container">
51
+ <div class="c-section__title">
52
+ <span style="font-weight: 400;">
53
+ <?php esc_attr_e('Frequently Asked Questions', 'premmerce-url-manager'); ?>
54
+ </span>
55
+ </div>
56
+ <div class="c-section__desc"><span style="font-weight: 400;">
57
+ <?php esc_attr_e('If you have any further questions, don’t hesitate to ask us via the online chat or by e-mail', 'premmerce-url-manager'); ?>
58
+ </span>
59
+ <a href="mailto:info@premmerce.com">
60
+ <span style="font-weight: 400;">
61
+ info@premmerce.com
62
+ </span>
63
+ </a>
64
+ </div>
65
+ <div class="c-section__content">
66
+ <?php
67
+ $rowCount = 0;
68
+ $numOfCols = 2;
69
+ foreach ($bundlesFAQs as $faq) :
70
+ if (0 === $rowCount % $numOfCols) {
71
+
72
+ ?>
73
+ <div class="row">
74
+ <?php
75
+ }
76
+ $rowCount++;
77
+ ?>
78
+ <div class="col-sm-6">
79
+ <div class="pc-qa" data-qa-scope="">
80
+ <div class="pc-qa__header" data-qa-toggle="">
81
+ <div class="pc-qa__title">
82
+ <?php echo esc_attr($faq['question']); ?>
83
+ </div>
84
+ <div class="pc-qa__arrow">
85
+ <svg class="svg-icon">
86
+ <?php BundleAndSave::premmerce_use_svg_symbol($svg, 'arrow-bootom'); ?>
87
+ </svg>
88
+ </div>
89
+ </div>
90
+ <div class="pc-qa__content" data-qa-content="" style="display: none;">
91
+ <?php echo esc_attr($faq['answer']); ?>
92
+ </div>
93
+ </div>
94
+ </div>
95
+ <?php if ( 0 === $rowCount % $numOfCols) : ?>
96
+ </div>
97
+ <?php endif; ?>
98
+ <?php endforeach; ?>
99
+ </div>
100
+ </div>
101
+ </div>
views/admin/tabs/bundle-and-save/featured-in.php CHANGED
@@ -1,55 +1,56 @@
1
  <?php
2
  if (! defined('ABSPATH')) {
3
- exit;
4
  }
5
 
6
  $featuredInCompanies = [
7
- [
8
- 'title' => 'Wordpress',
9
- 'img' => $wp_logo
10
- ],
11
- [
12
- 'title' => 'WP Rocket',
13
- 'img' => $wp_rocket_logo
14
- ],
15
- [
16
- 'title' => 'LearnWoo',
17
- 'img' => $learnwoo_logo
18
- ],
19
- [
20
- 'title' => 'WPLift',
21
- 'img' => $wp_lift_logo
22
- ],
23
- [
24
- 'title' => 'WP Mayor',
25
- 'img' => $mayor_logo
26
- ],
27
- [
28
- 'title' => 'ManageWP',
29
- 'img' => $managewp_logo
30
- ],
31
  ];
32
  ?>
33
  <div class="c-section c-section--grey c-section--md wow hidden-md hidden-sm hidden-xs animated"
34
- style="visibility: visible;">
35
- <div class="c-section__container">
36
- <div class="c-section__title fade-up fade-up--step-1">
37
- <?php _e('Featured in', 'premmerce-url-manager'); ?>
38
- </div>
39
- <div class="c-section__content">
40
- <div class="row row--ib row--ib-mid">
41
 
42
- <?php foreach ($featuredInCompanies as $company) : ?>
43
- <div class="col-md-2">
44
- <div class="c-vendor-logo">
45
- <img class="c-vendor-logo__img" src="<?php echo $company['img']; ?>"
46
- alt="<?php echo $company['title']; ?>">
47
- </div>
48
- </div>
49
- <?php endforeach; ?>
 
 
50
 
51
-
52
- </div>
53
- </div>
54
- </div>
55
  </div>
1
  <?php
2
  if (! defined('ABSPATH')) {
3
+ exit;
4
  }
5
 
6
  $featuredInCompanies = [
7
+ [
8
+ 'title' => 'Wordpress',
9
+ 'img' => $wp_logo
10
+ ],
11
+ [
12
+ 'title' => 'WP Rocket',
13
+ 'img' => $wp_rocket_logo
14
+ ],
15
+ [
16
+ 'title' => 'LearnWoo',
17
+ 'img' => $learnwoo_logo
18
+ ],
19
+ [
20
+ 'title' => 'WPLift',
21
+ 'img' => $wp_lift_logo
22
+ ],
23
+ [
24
+ 'title' => 'WP Mayor',
25
+ 'img' => $mayor_logo
26
+ ],
27
+ [
28
+ 'title' => 'ManageWP',
29
+ 'img' => $managewp_logo
30
+ ],
31
  ];
32
  ?>
33
  <div class="c-section c-section--grey c-section--md wow hidden-md hidden-sm hidden-xs animated"
34
+ style="visibility: visible;">
35
+ <div class="c-section__container">
36
+ <div class="c-section__title fade-up fade-up--step-1">
37
+ <?php esc_attr_e('Featured in', 'premmerce-url-manager'); ?>
38
+ </div>
39
+ <div class="c-section__content">
40
+ <div class="row row--ib row--ib-mid">
41
 
42
+ <?php foreach ($featuredInCompanies as $company) : ?>
43
+ <div class="col-md-2">
44
+ <div class="c-vendor-logo">
45
+ <img class="c-vendor-logo__img"
46
+ src="<?php echo esc_url($company['img']); ?>"
47
+ alt="<?php echo esc_attr($company['title']); ?>"
48
+ >
49
+ </div>
50
+ </div>
51
+ <?php endforeach; ?>
52
 
53
+ </div>
54
+ </div>
55
+ </div>
 
56
  </div>
views/admin/tabs/bundle-and-save/header.php CHANGED
@@ -1,8 +1,6 @@
1
  <?php
2
-
3
  if (! defined('ABSPATH')) {
4
- exit;
5
  }
6
-
7
  ?>
8
- <img src="<?php echo $header_img; ?>" style="width:100%;height:auto;margin-top:20px" alt="Bundel and Save">
1
  <?php
 
2
  if (! defined('ABSPATH')) {
3
+ exit;
4
  }
 
5
  ?>
6
+ <img src="<?php echo esc_url($header_img); ?>" style="width:100%;height:auto;margin-top:20px" alt="Bundel and Save">
views/admin/tabs/bundle-and-save/pricing.php CHANGED
@@ -1,186 +1,169 @@
1
  <?php
2
 
3
  if (! defined('ABSPATH')) {
4
- exit;
5
  }
6
 
7
  $premmercePlugins = [
8
- [
9
- 'title' => 'Premmerce Permalink Manager for WooCommerce',
10
- 'link' => '#1118',
11
- ],
12
- [
13
- 'title' => 'Premmerce WooCommerce Product Filter',
14
- 'link' => '#1818',
15
- ],
16
- [
17
- 'title' => 'Premmerce WooCommerce Variation Swatches',
18
- 'link' => '#4173',
19
- ],
20
- [
21
- 'title' => 'WooCommerce Product Search',
22
- 'link' => '#1847',
23
- ]
24
  ];
25
 
26
  if (!function_exists('premmerce_bundle_licence_header')) {
27
- function premmerce_bundle_licence_header($title, $symbol, $price, $savePrice) {
28
- ?>
29
  <div class="c-license__header">
30
- <div class="c-license__inner">
31
- <div class="c-license__title">
32
- <?php echo $title; ?>
33
- </div>
34
- <div class="c-license__price">
35
- <span class="woocommerce-Price-amount amount"><span
36
- class="woocommerce-Price-currencySymbol"><?php echo $symbol; ?></span><?php echo $price; ?></span>
37
- </div>
38
- <div class="c-license__save-price">
39
- <span class="woocommerce-Price-amount amount"><span
40
- class="woocommerce-Price-currencySymbol"><?php echo $symbol; ?></span><?php echo $savePrice; ?></span>
41
- </div>
42
-
43
- </div>
44
  </div>
45
  <?php
46
- }
47
  }
48
 
49
  if (!function_exists('premmerce_bundle_licence_body')) {
50
- function premmerce_bundle_licence_body($description, $plugins) {
51
- ?>
52
  <div class="c-license__body">
53
- <div class="c-license__inner">
54
- <div class="c-license__body-inner">
55
- <div class="c-license__body-description">
56
- <span><?php echo $description; ?></span>
57
- </div>
58
- </div>
59
- <div class="c-license__body-inner">
60
- <ul class="c-license__plugins-list">
61
- <?php foreach ($plugins as $key => $plugin) : ?>
62
- <li class="c-license__plugin">
63
- <a class="c-license__plugin-link" href="<?php echo $plugin['link']; ?>">
64
- <i class="fa fa-check" aria-hidden="true"></i>
65
- <?php echo $plugin['title']; ?>
66
- </a>
67
- </li>
68
- <?php endforeach; ?>
69
-
70
- </ul>
71
- </div>
72
- </div>
73
  </div>
74
  <?php
75
- }
76
  }
77
 
78
  if (!function_exists('premmerce_bundle_licence_footer')) {
79
- function premmerce_bundle_licence_footer($licence, $freemius_image) {
80
- ?>
81
  <div class="c-license__footer">
82
- <div class="c-license__inner">
83
- <div class="c-license__purchase">
84
- <button class="o-button o-button--primary o-button--lg o-button--caps purchase" target="_blank"
85
- data-freemius-bundle data-licence="<?php echo esc_attr($licence); ?>"
86
- data-freemius-image="<?php echo esc_url($freemius_image); ?>">
87
- <?php _e('Buy now', 'premmerce-url-manager'); ?>
88
- </button>
89
- </div>
90
- </div>
91
  </div>
92
  <?php
93
- }
94
  }
95
  ?>
96
 
97
  <div class="c-section">
98
- <div class="c-section__container wow animated" style="visibility: visible;">
99
- <div class="c-section__content">
100
- <div class="row row--ib row--vindent-m">
101
- <div class="variations-tabs">
102
- <!-- Variation tabs -->
103
- <div class="variations-tabs__header variations-tabs__header--inline">
104
- <button class="variations-tabs__link is-active" type="button"
105
- data-variation-tab-target="annual">
106
- <?php _e('Annual', 'premmerce-url-manager'); ?>
107
- </button>
108
- <button class="variations-tabs__link " type="button" data-variation-tab-target="lifetime">
109
- <?php _e( 'Lifetime', 'premmerce-url-manager'); ?>
110
- </button>
111
- </div>
112
- <!-- Variation tabs body annual -->
113
- <div class="variations-tabs__body " data-variation-tab-content="annual">
114
-
115
- <div class="variant-list variant-list--in-tab">
116
- <div class="row row--ib row--vindent-m row--center">
117
-
118
- <div class="col-xs-12 col-sm-12 col-md-4">
119
- <div class="c-license c-license--1">
120
- <?php premmerce_bundle_licence_header('One Site', '$', '99.99', '219'); ?>
121
-
122
- <?php premmerce_bundle_licence_body('Access to Best Premmerce plugins for 1 domain', $premmercePlugins); ?>
123
-
124
- <?php premmerce_bundle_licence_footer('1', $premmerce_logo); ?>
125
-
126
- </div>
127
-
128
- </div>
129
-
130
- <div class="col-xs-12 col-sm-12 col-md-4">
131
- <div class="c-license c-license--20">
132
-
133
- <?php premmerce_bundle_licence_header('Pro', '$', '299.99', '1,100'); ?>
134
-
135
- <?php premmerce_bundle_licence_body('Access to Best Premmerce plugins for 5 domains', $premmercePlugins); ?>
136
-
137
- <?php premmerce_bundle_licence_footer('5', $premmerce_logo); ?>
138
-
139
- </div>
140
-
141
- </div>
142
-
143
- </div>
144
- </div>
145
-
146
- </div>
147
-
148
- <!-- Variation tabs body lifetime -->
149
- <div class="variations-tabs__body hidden" data-variation-tab-content="lifetime">
150
-
151
- <div class="variant-list variant-list--in-tab">
152
- <div class="row row--ib row--vindent-m row--center">
153
-
154
- <div class="col-xs-12 col-sm-12 col-md-4">
155
- <div class="c-license c-license--1">
156
-
157
- <?php premmerce_bundle_licence_header('One Site', '$', '299.99', '660'); ?>
158
-
159
- <?php premmerce_bundle_licence_body('Access to Best Premmerce plugins for 1 domain', $premmercePlugins); ?>
160
-
161
- <?php premmerce_bundle_licence_footer('1', $premmerce_logo); ?>
162
-
163
- </div>
164
-
165
- </div>
166
-
167
-
168
- <div class="col-xs-12 col-sm-12 col-md-4">
169
- <div class="c-license c-license--20">
170
-
171
- <?php premmerce_bundle_licence_header('Pro', '$', '999.99', '3,300'); ?>
172
-
173
- <?php premmerce_bundle_licence_body('Access to Best Premmerce plugins for 5 domains', $premmercePlugins); ?>
174
-
175
- <?php premmerce_bundle_licence_footer('5', $premmerce_logo); ?>
176
-
177
- </div>
178
- </div>
179
- </div>
180
- </div>
181
- </div>
182
- </div>
183
- </div>
184
- </div>
185
- </div>
186
  </div>
1
  <?php
2
 
3
  if (! defined('ABSPATH')) {
4
+ exit;
5
  }
6
 
7
  $premmercePlugins = [
8
+ [
9
+ 'title' => 'Premmerce Permalink Manager for WooCommerce',
10
+ 'link' => '#1118',
11
+ ],
12
+ [
13
+ 'title' => 'Premmerce WooCommerce Product Filter',
14
+ 'link' => '#1818',
15
+ ],
16
+ [
17
+ 'title' => 'Premmerce WooCommerce Variation Swatches',
18
+ 'link' => '#4173',
19
+ ],
20
+ [
21
+ 'title' => 'WooCommerce Product Search',
22
+ 'link' => '#1847',
23
+ ]
24
  ];
25
 
26
  if (!function_exists('premmerce_bundle_licence_header')) {
27
+ function premmerce_bundle_licence_header( $title, $symbol, $price, $savePrice) {
28
+ ?>
29
  <div class="c-license__header">
30
+ <div class="c-license__inner">
31
+ <div class="c-license__title">
32
+ <?php echo esc_attr($title); ?>
33
+ </div>
34
+ <div class="c-license__price">
35
+ <span class="woocommerce-Price-amount amount"><span
36
+ class="woocommerce-Price-currencySymbol"><?php echo esc_attr($symbol); ?></span><?php echo esc_attr($price); ?></span>
37
+ </div>
38
+ <div class="c-license__save-price">
39
+ <span class="woocommerce-Price-amount amount"><span
40
+ class="woocommerce-Price-currencySymbol"><?php echo esc_attr($symbol); ?></span><?php echo esc_attr($savePrice); ?></span>
41
+ </div>
42
+
43
+ </div>
44
  </div>
45
  <?php
46
+ }
47
  }
48
 
49
  if (!function_exists('premmerce_bundle_licence_body')) {
50
+ function premmerce_bundle_licence_body( $description, $plugins) {
51
+ ?>
52
  <div class="c-license__body">
53
+ <div class="c-license__inner">
54
+ <div class="c-license__body-inner">
55
+ <div class="c-license__body-description">
56
+ <span><?php echo esc_attr($description); ?></span>
57
+ </div>
58
+ </div>
59
+ <div class="c-license__body-inner">
60
+ <ul class="c-license__plugins-list">
61
+ <?php foreach ($plugins as $plugin) : ?>
62
+ <li class="c-license__plugin">
63
+ <a class="c-license__plugin-link" href="<?php echo esc_attr($plugin['link']); ?>">
64
+ <i class="fa fa-check" aria-hidden="true"></i>
65
+ <?php echo esc_attr($plugin['title']); ?>
66
+ </a>
67
+ </li>
68
+ <?php endforeach; ?>
69
+
70
+ </ul>
71
+ </div>
72
+ </div>
73
  </div>
74
  <?php
75
+ }
76
  }
77
 
78
  if (!function_exists('premmerce_bundle_licence_footer')) {
79
+ function premmerce_bundle_licence_footer( $licence, $freemius_image) {
80
+ ?>
81
  <div class="c-license__footer">
82
+ <div class="c-license__inner">
83
+ <div class="c-license__purchase">
84
+ <button class="o-button o-button--primary o-button--lg o-button--caps purchase" target="_blank"
85
+ data-freemius-bundle data-licence="<?php echo esc_attr($licence); ?>"
86
+ data-freemius-image="<?php echo esc_url($freemius_image); ?>">
87
+ <?php esc_attr_e('Buy now', 'premmerce-url-manager'); ?>
88
+ </button>
89
+ </div>
90
+ </div>
91
  </div>
92
  <?php
93
+ }
94
  }
95
  ?>
96
 
97
  <div class="c-section">
98
+ <div class="c-section__container wow animated" style="visibility: visible;">
99
+ <div class="c-section__content">
100
+ <div class="row row--ib row--vindent-m">
101
+ <div class="variations-tabs">
102
+ <!-- Variation tabs -->
103
+ <div class="variations-tabs__header variations-tabs__header--inline">
104
+ <button class="variations-tabs__link is-active" type="button"
105
+ data-variation-tab-target="annual">
106
+ <?php esc_attr_e('Annual', 'premmerce-url-manager'); ?>
107
+ </button>
108
+ <button class="variations-tabs__link " type="button" data-variation-tab-target="lifetime">
109
+ <?php esc_attr_e( 'Lifetime', 'premmerce-url-manager'); ?>
110
+ </button>
111
+ </div>
112
+ <!-- Variation tabs body annual -->
113
+ <div class="variations-tabs__body " data-variation-tab-content="annual">
114
+
115
+ <div class="variant-list variant-list--in-tab">
116
+ <div class="row row--ib row--vindent-m row--center">
117
+
118
+ <div class="col-xs-12 col-sm-12 col-md-4">
119
+ <div class="c-license c-license--1">
120
+ <?php premmerce_bundle_licence_header('One Site', '$', '99.99', '219'); ?>
121
+ <?php premmerce_bundle_licence_body('Access to Best Premmerce plugins for 1 domain', $premmercePlugins); ?>
122
+ <?php premmerce_bundle_licence_footer('1', $premmerce_logo); ?>
123
+ </div>
124
+ </div>
125
+
126
+ <div class="col-xs-12 col-sm-12 col-md-4">
127
+ <div class="c-license c-license--20">
128
+ <?php premmerce_bundle_licence_header('Pro', '$', '299.99', '1,100'); ?>
129
+ <?php premmerce_bundle_licence_body('Access to Best Premmerce plugins for 5 domains', $premmercePlugins); ?>
130
+ <?php premmerce_bundle_licence_footer('5', $premmerce_logo); ?>
131
+ </div>
132
+ </div>
133
+
134
+ </div>
135
+ </div>
136
+
137
+ </div>
138
+
139
+ <!-- Variation tabs body lifetime -->
140
+ <div class="variations-tabs__body hidden" data-variation-tab-content="lifetime">
141
+
142
+ <div class="variant-list variant-list--in-tab">
143
+ <div class="row row--ib row--vindent-m row--center">
144
+
145
+ <div class="col-xs-12 col-sm-12 col-md-4">
146
+ <div class="c-license c-license--1">
147
+ <?php premmerce_bundle_licence_header('One Site', '$', '299.99', '660'); ?>
148
+ <?php premmerce_bundle_licence_body('Access to Best Premmerce plugins for 1 domain', $premmercePlugins); ?>
149
+ <?php premmerce_bundle_licence_footer('1', $premmerce_logo); ?>
150
+ </div>
151
+ </div>
152
+
153
+ <div class="col-xs-12 col-sm-12 col-md-4">
154
+ <div class="c-license c-license--20">
155
+ <?php premmerce_bundle_licence_header('Pro', '$', '999.99', '3,300'); ?>
156
+ <?php premmerce_bundle_licence_body('Access to Best Premmerce plugins for 5 domains', $premmercePlugins); ?>
157
+ <?php premmerce_bundle_licence_footer('5', $premmerce_logo); ?>
158
+ </div>
159
+ </div>
160
+
161
+ </div>
162
+ </div>
163
+
164
+ </div>
165
+ </div>
166
+ </div>
167
+ </div>
168
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
169
  </div>
views/admin/tabs/bundle-and-save/testimonials.php CHANGED
@@ -1,64 +1,69 @@
1
  <?php
2
  if (! defined('ABSPATH')) {
3
- exit;
4
  }
5
 
6
  $premmerceTestimonials = [
7
- [
8
- 'content' => __('Great, free, useful plugin if you want your category link to be yourURL/category name and product link to be yourURL/product-name. Even skips parent category names. Thank you so much!', 'premmerce-url-manager'),
9
- 'name' => 'Riley Pearcy',
10
- 'img' => $riley_pearcy
11
- ],
12
- [
13
- 'content' => __('THi All, We us this plugin for a big website we run. This plugin works with the famous WPML plugin. It’s removes the Product category base and the shop link in a Multilingual website. Must have for all WooCommerce users!!! Regards from a satisfied user.', 'premmerce-url-manager'),
14
- 'name' => 'Lian Perry',
15
- 'img' => $lian_perry
16
- ],
17
- [
18
- 'content' => __('The Premmerce Filter is BY FAR the best product filter plugin available for WordPress. It works well out of the box with a great layout. It’s something that you would think would be so simple, but finding a great product filter tool sure wasn’t easy. Really love how well it integrates with the Premmerce Brands plugin as well. Thanks!!', 'premmerce-url-manager'),
19
- 'name' => 'Rommie Mercer',
20
- 'img' => $rommie_mercer
21
- ]
22
  ];
23
  ?>
24
  <section class="c-section c-section--dark-bg">
25
- <div class="c-section__container wow animated" style="visibility: visible;">
26
- <h2 class="c-section__title fade-up fade-up--step-1">
27
- <span style="font-weight: 400;">
28
- <?php _e('What clients say about Premmerce', 'premmerce-url-manager'); ?>
29
- </span>
30
- </h2>
31
- <div class="c-section__content fade-up fade-up--step-2">
32
- <div class="widget-primary" data-slider="widget-primary">
33
- <div class="widget-primary__inner">
34
- <div class="row row--ib">
35
 
36
- <div aria-live="polite" class="draggable">
37
- <div class="">
38
- <?php foreach ($premmerceTestimonials as $key => $testimonial) { ?>
39
- <div class="col-xs-12 col-sm-6 col-md-4">
40
- <div class="testimonials" data-same-height="testimonials"
41
- style="min-height: 371px;">
42
- <div class="testimonials__content"><?php echo $testimonial['content'] ?></div>
43
- <div class="testimonials__user">
44
- <div class="testimonials__user-image"><img class="aligncenter size-full"
45
- src="<?php echo $testimonial['img'] ?>"
46
- alt="<?php echo $testimonial['name'] ?>"></div>
47
- <div class="testimonials__user-info">
48
- <div class="testimonials__user-name">
49
- <?php echo $testimonial['name'] ?>
50
- </div>
51
- <div class="testimonials__user-link"></div>
52
- </div>
53
- </div>
54
- </div>
55
- </div>
56
- <?php } ?>
57
- </div>
58
- </div>
59
- </div>
60
- </div>
61
- </div>
62
- </div>
63
- </div>
 
 
 
 
 
64
  </section>
1
  <?php
2
  if (! defined('ABSPATH')) {
3
+ exit;
4
  }
5
 
6
  $premmerceTestimonials = [
7
+ [
8
+ 'content' => __('Great, free, useful plugin if you want your category link to be yourURL/category name and product link to be yourURL/product-name. Even skips parent category names. Thank you so much!', 'premmerce-url-manager'),
9
+ 'name' => 'Riley Pearcy',
10
+ 'img' => $riley_pearcy
11
+ ],
12
+ [
13
+ 'content' => __('THi All, We us this plugin for a big website we run. This plugin works with the famous WPML plugin. It’s removes the Product category base and the shop link in a Multilingual website. Must have for all WooCommerce users!!! Regards from a satisfied user.', 'premmerce-url-manager'),
14
+ 'name' => 'Lian Perry',
15
+ 'img' => $lian_perry
16
+ ],
17
+ [
18
+ 'content' => __('The Premmerce Filter is BY FAR the best product filter plugin available for WordPress. It works well out of the box with a great layout. It’s something that you would think would be so simple, but finding a great product filter tool sure wasn’t easy. Really love how well it integrates with the Premmerce Brands plugin as well. Thanks!!', 'premmerce-url-manager'),
19
+ 'name' => 'Rommie Mercer',
20
+ 'img' => $rommie_mercer
21
+ ]
22
  ];
23
  ?>
24
  <section class="c-section c-section--dark-bg">
25
+ <div class="c-section__container wow animated" style="visibility: visible;">
26
+ <h2 class="c-section__title fade-up fade-up--step-1">
27
+ <span style="font-weight: 400;">
28
+ <?php esc_attr_e('What clients say about Premmerce', 'premmerce-url-manager'); ?>
29
+ </span>
30
+ </h2>
31
+ <div class="c-section__content fade-up fade-up--step-2">
32
+ <div class="widget-primary" data-slider="widget-primary">
33
+ <div class="widget-primary__inner">
34
+ <div class="row row--ib">
35
 
36
+ <div aria-live="polite" class="draggable">
37
+ <div class="">
38
+ <?php foreach ($premmerceTestimonials as $key => $testimonial) : ?>
39
+ <div class="col-xs-12 col-sm-6 col-md-4">
40
+ <div class="testimonials" data-same-height="testimonials"
41
+ style="min-height: 371px;">
42
+ <div class="testimonials__content">
43
+ <?php echo esc_attr($testimonial['content']); ?>
44
+ </div>
45
+ <div class="testimonials__user">
46
+ <div class="testimonials__user-image">
47
+ <img class="aligncenter size-full"
48
+ src="<?php echo esc_url($testimonial['img']); ?>"
49
+ alt="<?php echo esc_attr($testimonial['name']); ?>"
50
+ >
51
+ </div>
52
+ <div class="testimonials__user-info">
53
+ <div class="testimonials__user-name">
54
+ <?php echo esc_attr($testimonial['name']); ?>
55
+ </div>
56
+ <div class="testimonials__user-link"></div>
57
+ </div>
58
+ </div>
59
+ </div>
60
+ </div>
61
+ <?php endforeach; ?>
62
+ </div>
63
+ </div>
64
+ </div>
65
+ </div>
66
+ </div>
67
+ </div>
68
+ </div>
69
  </section>
views/admin/tabs/bundle-and-save/texts.php CHANGED
@@ -1,81 +1,83 @@
1
  <?php
2
  if (! defined('ABSPATH')) {
3
- exit;
4
  }
5
 
6
  $premmercePluginsInfo = [
7
- [
8
- 'id' => '1118',
9
- 'title' => __('Permalink Manager Plugin', 'premmerce-url-manager'),
10
- 'text' => __('Allows you to configure URL generation strategy for your WooCommerce based store. Removing /product-category base from URL. Able to generate a product category URL in such a way that only its slug can be seen, removing all the prefixes from URL, leaving just the category or product name, and automatic adds of the ‘rel=canonical’ attribute to duplicate pages for SEO ranking improving.', 'premmerce-url-manager'),
11
- 'link' => 'https://premmerce.com/woocommerce-permalink-manager',
12
- 'img' => $permalink_img
13
- ],
14
- [
15
- 'id' => '1818',
16
- 'title' => __('Product Filter Plugin', 'premmerce-url-manager'),
17
- 'text' => __('Is a convenient and flexible tool for managing filters for WooCommerce products. Among the main features of this plugin there is a single widget that manages the display of all available filters. Comparing to the standard WooCommerce filters, Premmerce WooCommerce Product Filter has a well thought out caching system for the load speed improving.', 'premmerce-url-manager'),
18
- 'link' => 'https://premmerce.com/premmerce-woocommerce-product-filter',
19
- 'img' => $filter_img
20
- ],
21
- [
22
- 'id' => '4173',
23
- 'title' => __('Variation Swatches Plugin', 'premmerce-url-manager'),
24
- 'text' => __('Flexibly extends standard features of the WooCommerce attributes and variations.The ability to highlight the main attributes and display them on the product category page and possibility to add a description to the attribute. The ability to add a product variation to the cart directly on the product category page.', 'premmerce-url-manager'),
25
- 'link' => 'https://premmerce.com/premmerce-woocommerce-variation-swatches',
26
- 'img' => $variants_img
27
- ],
28
- [
29
- 'id' => '1847',
30
- 'title' => __('Product Search Plugin', 'premmerce-url-manager'),
31
- 'text' => __('Makes the WooCommerce product search more flexible and efficient and gives the additional search results due to the spell correction. With the help of this plugin, the products search results within your store will be as relevant as possible for your potential customers. With our plugin, you no longer have to create the databases of synonyms and duplicate the words with common mistakes in the product name or its description.', 'premmerce-url-manager'),
32
- 'link' => 'https://premmerce.com/premmerce-woocommerce-product-search',
33
- 'img' => $search_img
34
- ]
35
  ];
36
  ?>
37
 
38
  <div class="c-section-price">
39
- <div class="c-section__container">
40
- <div class="c-section-price__row">
41
- <div class="c-section-price__content c-section-price__content--100">
42
- <p class="c-section-price__text">
43
- <?php _e('The Premmerce bundle consists of interchangeably combined plugins to
 
44
  ensure you’re getting the whole package. Each one of our most popular plugins performs smoothly on
45
  its own and works wonders when paired with the other ones. From “clean” links and well-thought-out
46
  filter widgets to displaying the product variation data right on the category page and actualizing
47
  search results, we’ve got you covered. All of it and everything in between (bulk-generated landing
48
  pages and spell correction, to name just a few) makes up for the full-fledged toolkit for high SEO
49
  rankings, advanced search and filter management in categories. And you can transform your online
50
- shop for more than 50% less compared to acquiring the plugins separately.', 'premmerce-url-manager'); ?>
51
- </p>
52
- </div>
53
- </div>
54
- </div>
 
55
  </div>
56
 
57
- <?php foreach ($premmercePluginsInfo as $key => $plugin) { ?>
58
- <div class="c-section-price" id="<?php echo $plugin['id']; ?>" tabindex="-1">
59
- <div class="c-section__container">
60
- <div class="c-section-price__row">
61
- <div class="c-section-price__content">
62
- <h3 class="c-section-price__title">
63
- <?php echo $plugin['title']; ?>
64
- </h3>
65
- <p class="c-section-price__text">
66
- <?php echo $plugin['text']; ?>
67
- </p>
68
- <p>
69
- <a class="c-section-price__more" href="<?php echo $plugin['link']; ?>" target="_blank">
70
- <?php _e( 'Read more', 'premmerce-url-manager'); ?>
71
- </a>
72
- </p>
73
- </div>
74
- <div class="c-section-price__image">
75
- <img class="aligncenter size-full" src="<?php echo $plugin['img']; ?>"
76
- alt="<?php echo $plugin['title']; ?>">
77
- </div>
78
- </div>
79
- </div>
80
  </div>
81
- <?php } ?>
1
  <?php
2
  if (! defined('ABSPATH')) {
3
+ exit;
4
  }
5
 
6
  $premmercePluginsInfo = [
7
+ [
8
+ 'id' => '1118',
9
+ 'title' => __('Permalink Manager Plugin', 'premmerce-url-manager'),
10
+ 'text' => __('Allows you to configure URL generation strategy for your WooCommerce based store. Removing /product-category base from URL. Able to generate a product category URL in such a way that only its slug can be seen, removing all the prefixes from URL, leaving just the category or product name, and automatic adds of the ‘rel=canonical’ attribute to duplicate pages for SEO ranking improving.', 'premmerce-url-manager'),
11
+ 'link' => 'https://premmerce.com/woocommerce-permalink-manager',
12
+ 'img' => $permalink_img
13
+ ],
14
+ [
15
+ 'id' => '1818',
16
+ 'title' => __('Product Filter Plugin', 'premmerce-url-manager'),
17
+ 'text' => __('Is a convenient and flexible tool for managing filters for WooCommerce products. Among the main features of this plugin there is a single widget that manages the display of all available filters. Comparing to the standard WooCommerce filters, Premmerce WooCommerce Product Filter has a well thought out caching system for the load speed improving.', 'premmerce-url-manager'),
18
+ 'link' => 'https://premmerce.com/premmerce-woocommerce-product-filter',
19
+ 'img' => $filter_img
20
+ ],
21
+ [
22
+ 'id' => '4173',
23
+ 'title' => __('Variation Swatches Plugin', 'premmerce-url-manager'),
24
+ 'text' => __('Flexibly extends standard features of the WooCommerce attributes and variations.The ability to highlight the main attributes and display them on the product category page and possibility to add a description to the attribute. The ability to add a product variation to the cart directly on the product category page.', 'premmerce-url-manager'),
25
+ 'link' => 'https://premmerce.com/premmerce-woocommerce-variation-swatches',
26
+ 'img' => $variants_img
27
+ ],
28
+ [
29
+ 'id' => '1847',
30
+ 'title' => __('Product Search Plugin', 'premmerce-url-manager'),
31
+ 'text' => __('Makes the WooCommerce product search more flexible and efficient and gives the additional search results due to the spell correction. With the help of this plugin, the products search results within your store will be as relevant as possible for your potential customers. With our plugin, you no longer have to create the databases of synonyms and duplicate the words with common mistakes in the product name or its description.', 'premmerce-url-manager'),
32
+ 'link' => 'https://premmerce.com/premmerce-woocommerce-product-search',
33
+ 'img' => $search_img
34
+ ]
35
  ];
36
  ?>
37
 
38
  <div class="c-section-price">
39
+ <div class="c-section__container">
40
+ <div class="c-section-price__row">
41
+ <div class="c-section-price__content c-section-price__content--100">
42
+ <p class="c-section-price__text">
43
+ <?php
44
+ esc_attr_e('The Premmerce bundle consists of interchangeably combined plugins to
45
  ensure you’re getting the whole package. Each one of our most popular plugins performs smoothly on
46
  its own and works wonders when paired with the other ones. From “clean” links and well-thought-out
47
  filter widgets to displaying the product variation data right on the category page and actualizing
48
  search results, we’ve got you covered. All of it and everything in between (bulk-generated landing
49
  pages and spell correction, to name just a few) makes up for the full-fledged toolkit for high SEO
50
  rankings, advanced search and filter management in categories. And you can transform your online
51
+ shop for more than 50% less compared to acquiring the plugins separately.', 'premmerce-url-manager');
52
+ ?>
53
+ </p>
54
+ </div>
55
+ </div>
56
+ </div>
57
  </div>
58
 
59
+ <?php foreach ($premmercePluginsInfo as $key => $pluginData) : ?>
60
+ <div class="c-section-price" id="<?php echo esc_attr($pluginData['id']); ?>" tabindex="-1">
61
+ <div class="c-section__container">
62
+ <div class="c-section-price__row">
63
+ <div class="c-section-price__content">
64
+ <h3 class="c-section-price__title">
65
+ <?php echo esc_attr($pluginData['title']); ?>
66
+ </h3>
67
+ <p class="c-section-price__text">
68
+ <?php echo esc_attr($pluginData['text']); ?>
69
+ </p>
70
+ <p>
71
+ <a class="c-section-price__more" href="<?php echo esc_attr($pluginData['link']); ?>" target="_blank">
72
+ <?php esc_attr_e( 'Read more', 'premmerce-url-manager'); ?>
73
+ </a>
74
+ </p>
75
+ </div>
76
+ <div class="c-section-price__image">
77
+ <img class="aligncenter size-full" src="<?php echo esc_url($pluginData['img']); ?>"
78
+ alt="<?php echo esc_attr($pluginData['title']); ?>">
79
+ </div>
80
+ </div>
81
+ </div>
82
  </div>
83
+ <?php endforeach; ?>
views/admin/tabs/bundle-and-save/thanks.php CHANGED
@@ -1,28 +1,28 @@
1
  <?php
2
 
3
  if (! defined('ABSPATH')) {
4
- exit;
5
  }
6
 
7
  use Premmerce\UrlManager\Admin\BundleAndSave;
8
  ?>
9
 
10
  <div class="c-section wow hidden-md hidden-sm hidden-xs animated" style="visibility: visible;">
11
- <div class="c-section__container">
12
- <div class="active-users-reviews">
13
- <img class="active-users-reviews__thanks" src="<?php echo $thanks_img; ?>" alt="thanks">
14
- <?php _e('to our', 'premmerce-url-manager'); ?> <span class="active-users-reviews__count">70,000+</span>
15
- <?php _e('active users for 5 star', 'premmerce-url-manager'); ?>
16
- <span class="active-users-reviews__stars">
17
- <?php for ($i=0; $i < 5; $i++) : ?>
18
- <svg class="svg-icon svg-icon--rating-star">
19
- <?php BundleAndSave::premmerce_use_svg_symbol($svg, 'rating-star'); ?>
20
- </svg>
21
- <?php endfor; ?>
22
 
23
- </span> <?php _e('reviews on', 'premmerce-url-manager'); ?> <a class="active-users-reviews__link"
24
- href="https://profiles.wordpress.org/premmerce#content-plugins" target="_blank"
25
- rel="noopener">WordPress.org</a>
26
- </div>
27
- </div>
28
- </div>
1
  <?php
2
 
3
  if (! defined('ABSPATH')) {
4
+ exit;
5
  }
6
 
7
  use Premmerce\UrlManager\Admin\BundleAndSave;
8
  ?>
9
 
10
  <div class="c-section wow hidden-md hidden-sm hidden-xs animated" style="visibility: visible;">
11
+ <div class="c-section__container">
12
+ <div class="active-users-reviews">
13
+ <img class="active-users-reviews__thanks" src="<?php echo esc_url($thanks_img); ?>" alt="thanks">
14
+ <?php esc_attr_e('to our', 'premmerce-url-manager'); ?> <span class="active-users-reviews__count">70,000+</span>
15
+ <?php esc_attr_e('active users for 5 star', 'premmerce-url-manager'); ?>
16
+ <span class="active-users-reviews__stars">
17
+ <?php for ($i=0; $i < 5; $i++) : ?>
18
+ <svg class="svg-icon svg-icon--rating-star">
19
+ <?php BundleAndSave::premmerce_use_svg_symbol($svg, 'rating-star'); ?>
20
+ </svg>
21
+ <?php endfor; ?>
22
 
23
+ </span> <?php esc_attr_e('reviews on', 'premmerce-url-manager'); ?> <a class="active-users-reviews__link"
24
+ href="https://profiles.wordpress.org/premmerce#content-plugins" target="_blank"
25
+ rel="noopener">WordPress.org</a>
26
+ </div>
27
+ </div>
28
+ </div>
views/admin/tabs/bundle_and_save.php CHANGED
@@ -1,8 +1,9 @@
1
  <?php
2
 
3
  if ( ! defined('WPINC')) {
4
- die;
5
  }
6
 
7
  ?>
8
- <?php $bundles->render(); ?>
 
1
  <?php
2
 
3
  if ( ! defined('WPINC')) {
4
+ die;
5
  }
6
 
7
  ?>
8
+ <?php
9
+ $bundles->render();
views/admin/tabs/contact.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
 
3
  if ( ! defined('WPINC')) {
4
- die;
5
  }
6
 
7
  if (function_exists('premmerce_wpm_fs')) {
8
- premmerce_wpm_fs()->_contact_page_render();
9
  }
1
  <?php
2
 
3
  if ( ! defined('WPINC')) {
4
+ die;
5
  }
6
 
7
  if (function_exists('premmerce_wpm_fs')) {
8
+ premmerce_wpm_fs()->_contact_page_render();
9
  }
views/admin/tabs/pricing.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
 
3
  if ( ! defined('WPINC')) {
4
- die;
5
  }
6
 
7
  if (function_exists('premmerce_wpm_fs')) {
8
- premmerce_wpm_fs()->_pricing_page_render();
9
  }
1
  <?php
2
 
3
  if ( ! defined('WPINC')) {
4
+ die;
5
  }
6
 
7
  if (function_exists('premmerce_wpm_fs')) {
8
+ premmerce_wpm_fs()->_pricing_page_render();
9
  }
views/admin/tabs/settings.php CHANGED
@@ -1,13 +1,7 @@
1
  <?php
2
-
3
  if ( ! defined('WPINC')) {
4
- die;
5
  }
6
-
7
  ?>
8
-
9
- <p>
10
- <?php esc_html_e('WooCommerce Permalink Manager offers you the ability to create a custom URL structure for your permalinks. Custom URL structures can improve the aesthetics, usability, and forward-compatibility of your links. A number of settings are available, and here are some examples to get you started.',
11
- 'premmerce-url-manager'); ?>
12
- </p>
13
- <?php $settings->show(); ?>
1
  <?php
 
2
  if ( ! defined('WPINC')) {
3
+ die;
4
  }
 
5
  ?>
6
+ <p><?php echo esc_attr($settings->getMainSettingsText()); ?></p>
7
+ <?php $settings->show(); ?>