Flexible Checkout Fields for WooCommerce – WooCommerce Checkout Manager - Version 2.9.0

Version Description

  • 2020-12-16 =
  • Changed hook for integration with FCF plugin
  • Changed URLs for docs
  • Added notice asking for plugin review
Download this release

Release Info

Developer wpdesk
Plugin Icon wp plugin Flexible Checkout Fields for WooCommerce – WooCommerce Checkout Manager
Version 2.9.0
Comparing to
See all releases

Code changes from version 2.8.0 to 2.9.0

Files changed (47) hide show
  1. assets/css/admin-notice.css +22 -0
  2. assets/css/admin-notice.min.css +1 -0
  3. assets/js/admin-notice.js +36 -0
  4. assets/js/admin-notice.min.js +4 -0
  5. classes/plugin.php +6 -16
  6. classes/views/settings-ads.php +17 -4
  7. classes/views/settings-fields.php +6 -4
  8. classes/views/settings-pro.php +23 -24
  9. classes/views/settings-tabs.php +8 -2
  10. composer.lock +46 -6
  11. flexible-checkout-fields.php +12 -4
  12. lang/flexible-checkout-fields.pot +37 -21
  13. readme.txt +6 -1
  14. src/Admin/NoticeReview.php +149 -0
  15. src/Helpers/Shortener.php +57 -0
  16. src/Integration/Field.php +1 -1
  17. src/Integration/FieldInterface.php +1 -1
  18. src/Integration/Fields.php +2 -2
  19. src/Integration/FieldsInterface.php +1 -1
  20. src/Integration/Integrator.php +46 -5
  21. src/Integration/IntegratorIntegration.php +2 -2
  22. src/Integration/IntegratorInterface.php +13 -2
  23. src/Integration/Section.php +1 -1
  24. src/Integration/SectionInterface.php +1 -1
  25. src/Integration/Sections.php +2 -2
  26. src/Integration/SectionsInterface.php +1 -1
  27. src/Integration/Value.php +1 -1
  28. src/Integration/ValueInterface.php +1 -1
  29. src/Plugin.php +6 -2
  30. templates/notices/review.php +44 -0
  31. vendor/autoload.php +1 -1
  32. vendor/composer/autoload_classmap.php +12 -0
  33. vendor/composer/autoload_real.php +4 -4
  34. vendor/composer/autoload_static.php +16 -4
  35. vendor_prefixed/wpdesk/wp-view/composer.json +33 -0
  36. vendor_prefixed/wpdesk/wp-view/src/PluginViewBuilder.php +68 -0
  37. vendor_prefixed/wpdesk/wp-view/src/Renderer/LoadTemplatePlugin.php +25 -0
  38. vendor_prefixed/wpdesk/wp-view/src/Renderer/Renderer.php +24 -0
  39. vendor_prefixed/wpdesk/wp-view/src/Renderer/SimplePhpRenderer.php +41 -0
  40. vendor_prefixed/wpdesk/wp-view/src/Resolver/ChainResolver.php +54 -0
  41. vendor_prefixed/wpdesk/wp-view/src/Resolver/DirResolver.php +42 -0
  42. vendor_prefixed/wpdesk/wp-view/src/Resolver/Exception/CanNotResolve.php +7 -0
  43. vendor_prefixed/wpdesk/wp-view/src/Resolver/NullResolver.php +18 -0
  44. vendor_prefixed/wpdesk/wp-view/src/Resolver/Resolver.php +20 -0
  45. vendor_prefixed/wpdesk/wp-view/src/Resolver/WPThemeResolver.php +41 -0
  46. views/settings-field-advanced.php +8 -3
  47. views/settings-field-pricing.php +8 -3
assets/css/admin-notice.css ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [data-notice="fcf-admin-notice"] {
2
+ padding: 20px;
3
+ }
4
+ [data-notice="fcf-admin-notice"] h2 {
5
+ margin: 0;
6
+ padding: 0;
7
+ font-size: 24px;
8
+ line-height: 1.625;
9
+ }
10
+ [data-notice="fcf-admin-notice"] p {
11
+ margin: 0;
12
+ padding: 13px 0;
13
+ font-size: 16px;
14
+ line-height: 1.625;
15
+ }
16
+ [data-notice="fcf-admin-notice"] p .dashicons {
17
+ font-size: 16px;
18
+ line-height: 1.625;
19
+ }
20
+ [data-notice="fcf-admin-notice"] .button {
21
+ margin: 10px 0;
22
+ }
assets/css/admin-notice.min.css ADDED
@@ -0,0 +1 @@
 
1
+ [data-notice="fcf-admin-notice"]{padding:20px}[data-notice="fcf-admin-notice"] h2{margin:0;padding:0;font-size:24px;line-height:1.625}[data-notice="fcf-admin-notice"] p{margin:0;padding:13px 0;font-size:16px;line-height:1.625}[data-notice="fcf-admin-notice"] p .dashicons{font-size:16px;line-height:1.625}[data-notice="fcf-admin-notice"] .button{margin:10px 0}
assets/js/admin-notice.js ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function() {
2
+
3
+ var notice = jQuery( '[data-notice="fcf-admin-notice"]' );
4
+ var is_permanently = false;
5
+ if ( ! notice ) {
6
+ return;
7
+ }
8
+
9
+ function close_notice() {
10
+
11
+ jQuery.ajax(
12
+ notice.attr( 'data-notice-url' ),
13
+ {
14
+ type: 'POST',
15
+ data: {
16
+ action: notice.attr( 'data-notice-action' ),
17
+ is_permanently: ( is_permanently ) ? 1 : 0,
18
+ },
19
+ }
20
+ );
21
+ }
22
+
23
+ var notice_button_close = notice.find( '.notice-dismiss' );
24
+ var notice_button_hide = notice.find( '[data-notice-button]' );
25
+ if ( ! notice_button_close || ! notice_button_hide ) {
26
+ return;
27
+ }
28
+
29
+ notice_button_close.click( close_notice );
30
+ notice_button_hide.click( function( e ) {
31
+ e.preventDefault();
32
+ is_permanently = true;
33
+ notice_button_close.click();
34
+ } );
35
+
36
+ });
assets/js/admin-notice.min.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ jQuery(document).ready(function(){var notice=jQuery('[data-notice="fcf-admin-notice"]');var is_permanently=!1;if(!notice){return}
2
+ function close_notice(){jQuery.ajax(notice.attr('data-notice-url'),{type:'POST',data:{action:notice.attr('data-notice-action'),is_permanently:(is_permanently)?1:0,},})}
3
+ var notice_button_close=notice.find('.notice-dismiss');var notice_button_hide=notice.find('[data-notice-button]');if(!notice_button_close||!notice_button_hide){return}
4
+ notice_button_close.click(close_notice);notice_button_hide.click(function(e){e.preventDefault();is_permanently=!0;notice_button_close.click()})})
classes/plugin.php CHANGED
@@ -1119,24 +1119,14 @@ class Flexible_Checkout_Fields_Plugin extends \FcfVendor\WPDesk\PluginBuilder\Pl
1119
  * @return array
1120
  */
1121
  public function links_filter( $links ) {
1122
- $docs_link = 'https://www.wpdesk.net/docs/flexible-checkout-fields-pro-woocommerce-docs/';
1123
- if ( get_locale() === 'pl_PL' ) {
1124
- $docs_link = 'https://www.wpdesk.pl/docs/woocommerce-checkout-fields-docs/';
1125
- }
1126
- $docs_link .= '?utm_source=wp-admin-plugins&utm_medium=quick-link&utm_campaign=flexible-checkout-fields-docs-link';
1127
-
1128
- $plugin_links = array();
1129
- if ( defined( 'WC_VERSION' ) ) {
1130
- $plugin_links[] = '<a href="' . admin_url( 'admin.php?page=inspire_checkout_fields_settings' ) . '">' . __( 'Settings', 'flexible-checkout-fields' ) . '</a>';
1131
- }
1132
- $plugin_links[] = '<a target="_blank" href="' . $docs_link . '">' . __( 'Docs', 'flexible-checkout-fields' ) . '</a>';
1133
- $plugin_links[] = '<a target="_blank" href="https://wordpress.org/support/plugin/flexible-checkout-fields/">' . __( 'Support', 'flexible-checkout-fields' ) . '</a>';
1134
-
1135
- $pro_link = get_locale() === 'pl_PL' ? 'https://www.wpdesk.pl/sklep/woocommerce-checkout-fields/' : 'https://www.wpdesk.net/products/flexible-checkout-fields-pro-woocommerce/';
1136
- $utm = '?utm_source=wp-admin-plugins&utm_medium=link&utm_campaign=flexible-checkout-fields-plugins-upgrade-link';
1137
 
1138
  if ( ! wpdesk_is_plugin_active( 'flexible-checkout-fields-pro/flexible-checkout-fields-pro.php' ) ) {
1139
- $plugin_links[] = '<a href="' . $pro_link . $utm . '" target="_blank" style="color:#d64e07;font-weight:bold;">' . __( 'Upgrade', 'flexible-checkout-fields' ) . '</a>';
1140
  }
1141
 
1142
  return array_merge( $plugin_links, $links );
1119
  * @return array
1120
  */
1121
  public function links_filter( $links ) {
1122
+ $plugin_links = array(
1123
+ '<a href="' . admin_url( 'admin.php?page=inspire_checkout_fields_settings' ) . '">' . __( 'Settings', 'flexible-checkout-fields' ) . '</a>',
1124
+ '<a href="' . esc_url( apply_filters( 'flexible_checkout_fields/short_url', '#', 'fcf-settings-row-action-docs' ) ) . '" target="_blank">' . __( 'Docs', 'flexible-checkout-fields' ) . '</a>',
1125
+ '<a href="' . esc_url( apply_filters( 'flexible_checkout_fields/short_url', '#', 'fcf-settings-row-action-support' ) ) . '" target="_blank">' . __( 'Support', 'flexible-checkout-fields' ) . '</a>',
1126
+ );
 
 
 
 
 
 
 
 
 
 
1127
 
1128
  if ( ! wpdesk_is_plugin_active( 'flexible-checkout-fields-pro/flexible-checkout-fields-pro.php' ) ) {
1129
+ $plugin_links[] = '<a href="' . esc_url( apply_filters( 'flexible_checkout_fields/short_url', '#', 'fcf-settings-row-action-upgrade' ) ) . '" target="_blank" style="color:#d64e07;font-weight:bold;">' . __( 'Upgrade', 'flexible-checkout-fields' ) . '</a>';
1130
  }
1131
 
1132
  return array_merge( $plugin_links, $links );
classes/views/settings-ads.php CHANGED
@@ -2,12 +2,25 @@
2
 
3
  <div class="stuffbox">
4
  <h3><?php _e( 'Enjoying the free version? Rate it!', 'flexible-checkout-fields' ); ?></h3>
5
-
6
  <div class="inside">
7
  <div class="main">
8
- <p class="rate"><a href="https://wpde.sk/fcf-rate" target="_blank"><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span></a></p>
9
-
10
- <p><?php printf( __( 'If you want to continue using Flexible Checkout Fields for free, %splease add a review%s. You will help us support the free version. Thank you.', 'flexible-checkout-fields' ), '<a href="https://wpde.sk/fcf-rate" target="_blank">', '</a>' ); ?></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  </div>
12
  </div>
13
  </div>
2
 
3
  <div class="stuffbox">
4
  <h3><?php _e( 'Enjoying the free version? Rate it!', 'flexible-checkout-fields' ); ?></h3>
 
5
  <div class="inside">
6
  <div class="main">
7
+ <p class="rate">
8
+ <a href="<?php echo esc_url( apply_filters( 'flexible_checkout_fields/short_url', '#', 'fcf-settings-widget-review-stars' ) ); ?>"
9
+ target="_blank">
10
+ <span class="dashicons dashicons-star-filled"></span>
11
+ <span class="dashicons dashicons-star-filled"></span>
12
+ <span class="dashicons dashicons-star-filled"></span>
13
+ <span class="dashicons dashicons-star-filled"></span>
14
+ <span class="dashicons dashicons-star-filled"></span>
15
+ </a>
16
+ </p>
17
+ <p style="padding: 0 10px;">
18
+ <?php echo sprintf(
19
+ __( 'If you want to continue using Flexible Checkout Fields for free, %splease add a review%s. You will help us support the free version. Thank you.', 'flexible-checkout-fields' ),
20
+ '<a href="' . esc_url( apply_filters( 'flexible_checkout_fields/short_url', '#', 'fcf-settings-widget-review-link' ) ) . '" target="_blank">',
21
+ '</a>'
22
+ ); ?>
23
+ </p>
24
  </div>
25
  </div>
26
  </div>
classes/views/settings-fields.php CHANGED
@@ -85,10 +85,12 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
85
 
86
  <div id="woocommerce_checkout_fields_field_name_container_pro" style="display:none;">
87
  <div class="updated">
88
- <?php
89
- $pro_link = get_locale() === 'pl_PL' ? 'https://www.wpdesk.pl/sklep/woocommerce-checkout-fields/' : 'https://www.wpdesk.net/products/flexible-checkout-fields-pro-woocommerce/';
90
- ?>
91
- <p><?php _e( 'This field is available in the PRO version.', 'flexible-checkout-fields' ); ?> <a href="<?php echo $pro_link; ?>?utm_source=flexible-checkout-fields-settings&utm_medium=link&utm_campaign=flexible-checkout-fields-pro-fields" target="_blank"><?php _e( 'Upgrade to PRO now &rarr;', 'flexible-checkout-fields' ); ?></a></p>
 
 
92
  </div>
93
  </div>
94
 
85
 
86
  <div id="woocommerce_checkout_fields_field_name_container_pro" style="display:none;">
87
  <div class="updated">
88
+ <p>
89
+ <?php _e( 'This field is available in the PRO version.', 'flexible-checkout-fields' ); ?>
90
+ <a href="<?php echo esc_url( apply_filters( 'flexible_checkout_fields/short_url', '#', 'fcf-settings-field-type-upgrade' ) ); ?>" target="_blank">
91
+ <?php _e( 'Upgrade to PRO now &rarr;', 'flexible-checkout-fields' ); ?>
92
+ </a>
93
+ </p>
94
  </div>
95
  </div>
96
 
classes/views/settings-pro.php CHANGED
@@ -1,27 +1,26 @@
1
  <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2
 
3
- <?php
4
- $pro_link = get_locale() === 'pl_PL' ? 'https://www.wpdesk.pl/sklep/woocommerce-checkout-fields/' : 'https://www.wpdesk.net/products/flexible-checkout-fields-pro-woocommerce/';
5
- ?>
6
-
7
- <div class="notice notice-success">
8
- <table>
9
- <tbody>
10
- <tr>
11
- <td width="60%">
12
- <p><strong><?php _e( 'Buy Flexible Checkout Fields PRO to use Custom Sections:', 'flexible-checkout-fields' ); ?></strong></p>
13
-
14
- <ul>
15
- <li><span class="dashicons dashicons-yes"></span> <?php _e( 'Add fields anywhere in the WooCommerce checkout form.', 'flexible-checkout-fields' ); ?></li>
16
- <li><span class="dashicons dashicons-yes"></span> <?php _e( 'Get more fields: checkboxes, radios buttons, dropdowns, file uploads, date & time or color pickers and more.', 'flexible-checkout-fields' ); ?></li>
17
- <li><span class="dashicons dashicons-yes"></span> <?php _e( 'Conditionally show or hide fields based on products or categories.', 'flexible-checkout-fields' ); ?></li>
18
- </ul>
19
- </td>
20
-
21
- <td>
22
- <a class="button button-primary button-hero" href="<?php echo $pro_link; ?>?utm_source=flexible-checkout-fields&utm_campaign=flexible-checkout-fields-custom-sections&utm_medium=button" target="_blank"><?php _e( 'Get Flexible Checkout Fields PRO now &rarr;', 'flexible-checkout-fields' ); ?></a>
23
- </td>
24
- </tr>
25
- </tbody>
26
- </table>
27
  </div>
1
  <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2
 
3
+ <div class="notice notice-success" style="margin-left: 0.5rem;">
4
+ <h2><?php _e( 'Buy Flexible Checkout Fields PRO to use Custom Sections:', 'flexible-checkout-fields' ); ?></h2>
5
+ <ul>
6
+ <li>
7
+ <span class="dashicons dashicons-yes"></span>
8
+ <?php _e( 'Add fields anywhere in the WooCommerce checkout form.', 'flexible-checkout-fields' ); ?>
9
+ </li>
10
+ <li>
11
+ <span class="dashicons dashicons-yes"></span>
12
+ <?php _e( 'Get more fields: checkboxes, radios buttons, dropdowns, file uploads, date & time or color pickers and more.', 'flexible-checkout-fields' ); ?>
13
+ </li>
14
+ <li>
15
+ <span class="dashicons dashicons-yes"></span>
16
+ <?php _e( 'Conditionally show or hide fields based on products or categories.', 'flexible-checkout-fields' ); ?>
17
+ </li>
18
+ </ul>
19
+ <p>
20
+ <a class="button button-primary button-hero"
21
+ href="<?php echo esc_url( apply_filters( 'flexible_checkout_fields/short_url', '#', 'fcf-settings-section-custom-upgrade' ) ); ?>"
22
+ target="_blank">
23
+ <?php _e( 'Get Flexible Checkout Fields PRO now &rarr;', 'flexible-checkout-fields' ); ?>
24
+ </a>
25
+ </p>
 
26
  </div>
classes/views/settings-tabs.php CHANGED
@@ -4,8 +4,14 @@
4
  <a class="nav-tab <?= $active ?>" href="?page=inspire_checkout_fields_settings&tab=<?= $tab_key ?>"><?php echo $tab_caption; ?></a>
5
  <?php endforeach; ?>
6
  </h2>
7
- <?php if ( !is_flexible_checkout_fields_pro_active() ) : ?>
8
- <p><?php echo sprintf( __( 'Read the %sconfiguration manual &rarr;%s', 'flexible-checkout-fields' ), '<a href="' . $docs_link . '" target="_blank">', '</a>' ); ?></p>
 
 
 
 
 
 
9
  <?php endif; ?>
10
  <?php if ( function_exists('icl_object_id') ) : ?>
11
  <p><?php echo sprintf( __( 'WPML detected. Read %sthis instructions if you want to translate Flexible Checkout Fields. &rarr;%s', 'flexible-checkout-fields' ), '<a href="https://wpml.org/faq/string-translation-default-language-not-english/" target="_blank">', '</a>' ); ?></p>
4
  <a class="nav-tab <?= $active ?>" href="?page=inspire_checkout_fields_settings&tab=<?= $tab_key ?>"><?php echo $tab_caption; ?></a>
5
  <?php endforeach; ?>
6
  </h2>
7
+ <?php if ( ! is_flexible_checkout_fields_pro_active() ) : ?>
8
+ <p>
9
+ <?php echo sprintf(
10
+ __( 'Read the %sconfiguration manual &rarr;%s', 'flexible-checkout-fields' ),
11
+ '<a href="' . esc_url( apply_filters( 'flexible_checkout_fields/short_url', '#', 'fcf-settings-section-tabs-docs' ) ) . '" target="_blank">',
12
+ '</a>'
13
+ ); ?>
14
+ </p>
15
  <?php endif; ?>
16
  <?php if ( function_exists('icl_object_id') ) : ?>
17
  <p><?php echo sprintf( __( 'WPML detected. Read %sthis instructions if you want to translate Flexible Checkout Fields. &rarr;%s', 'flexible-checkout-fields' ), '<a href="https://wpml.org/faq/string-translation-default-language-not-english/" target="_blank">', '</a>' ); ?></p>
composer.lock CHANGED
@@ -4,7 +4,7 @@
4
  "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5
  "This file is @generated automatically"
6
  ],
7
- "content-hash": "f7b14c42f2c583b049ba3368286e8286",
8
  "packages": [
9
  {
10
  "name": "psr/log",
@@ -8473,18 +8473,58 @@
8473
  ],
8474
  "time": "2020-10-15T14:54:50+00:00"
8475
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8476
  {
8477
  "name": "wpdesk/wp-wpdesk-composer",
8478
- "version": "2.9.3",
8479
  "source": {
8480
  "type": "git",
8481
  "url": "https://gitlab.com/wpdesk/wp-wpdesk-composer.git",
8482
- "reference": "2c9d935906dcef331ef4ef198c23d4e7ba06f046"
8483
  },
8484
  "dist": {
8485
  "type": "zip",
8486
- "url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-wpdesk-composer/repository/archive.zip?sha=2c9d935906dcef331ef4ef198c23d4e7ba06f046",
8487
- "reference": "2c9d935906dcef331ef4ef198c23d4e7ba06f046",
8488
  "shasum": ""
8489
  },
8490
  "require": {
@@ -8514,7 +8554,7 @@
8514
  "email": "krzysiek@wpdesk.pl"
8515
  }
8516
  ],
8517
- "time": "2020-11-26T15:44:11+00:00"
8518
  },
8519
  {
8520
  "name": "wpdesk/wp-wpdesk-helper",
4
  "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5
  "This file is @generated automatically"
6
  ],
7
+ "content-hash": "72bfa436315f71b3a16566d5e9a4a2f9",
8
  "packages": [
9
  {
10
  "name": "psr/log",
8473
  ],
8474
  "time": "2020-10-15T14:54:50+00:00"
8475
  },
8476
+ {
8477
+ "name": "wpdesk/wp-view",
8478
+ "version": "1.1.0",
8479
+ "source": {
8480
+ "type": "git",
8481
+ "url": "https://gitlab.com/wpdesk/wp-view.git",
8482
+ "reference": "8aa5ae0b68fb41dbb07ad631908cc556b1e50c0a"
8483
+ },
8484
+ "dist": {
8485
+ "type": "zip",
8486
+ "url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-view/repository/archive.zip?sha=8aa5ae0b68fb41dbb07ad631908cc556b1e50c0a",
8487
+ "reference": "8aa5ae0b68fb41dbb07ad631908cc556b1e50c0a",
8488
+ "shasum": ""
8489
+ },
8490
+ "require": {
8491
+ "php": ">=5.5"
8492
+ },
8493
+ "require-dev": {
8494
+ "10up/wp_mock": "*",
8495
+ "mockery/mockery": "*",
8496
+ "phpunit/phpunit": "<7",
8497
+ "squizlabs/php_codesniffer": "^3.0.2",
8498
+ "wimg/php-compatibility": "^8",
8499
+ "wp-coding-standards/wpcs": "^0.14.1"
8500
+ },
8501
+ "type": "library",
8502
+ "autoload": {
8503
+ "psr-4": {
8504
+ "WPDesk\\View\\": "src/"
8505
+ }
8506
+ },
8507
+ "notification-url": "https://packagist.org/downloads/",
8508
+ "authors": [
8509
+ {
8510
+ "name": "Krzysiek",
8511
+ "email": "krzysiek@wpdesk.pl"
8512
+ }
8513
+ ],
8514
+ "time": "2019-09-23T20:05:30+00:00"
8515
+ },
8516
  {
8517
  "name": "wpdesk/wp-wpdesk-composer",
8518
+ "version": "2.9.5",
8519
  "source": {
8520
  "type": "git",
8521
  "url": "https://gitlab.com/wpdesk/wp-wpdesk-composer.git",
8522
+ "reference": "d38d353ed6f6f2a17e94ee04bf5805c5e5e61298"
8523
  },
8524
  "dist": {
8525
  "type": "zip",
8526
+ "url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-wpdesk-composer/repository/archive.zip?sha=d38d353ed6f6f2a17e94ee04bf5805c5e5e61298",
8527
+ "reference": "d38d353ed6f6f2a17e94ee04bf5805c5e5e61298",
8528
  "shasum": ""
8529
  },
8530
  "require": {
8554
  "email": "krzysiek@wpdesk.pl"
8555
  }
8556
  ],
8557
+ "time": "2020-12-15T11:10:29+00:00"
8558
  },
8559
  {
8560
  "name": "wpdesk/wp-wpdesk-helper",
flexible-checkout-fields.php CHANGED
@@ -3,15 +3,15 @@
3
  Plugin Name: Flexible Checkout Fields
4
  Plugin URI: https://www.wpdesk.net/products/flexible-checkout-fields-pro-woocommerce/
5
  Description: Manage your WooCommerce checkout fields. Change order, labels, placeholders and add new fields.
6
- Version: 2.8.0
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-checkout-fields
10
  Domain Path: /lang/
11
  Requires at least: 4.9
12
  Tested up to: 5.6
13
- WC requires at least: 4.4
14
- WC tested up to: 4.8
15
  Requires PHP: 7.0
16
 
17
  Copyright 2017 WP Desk Ltd.
@@ -39,9 +39,17 @@ if ( ! defined( 'ABSPATH' ) ) {
39
 
40
 
41
  /* THIS VARIABLE CAN BE CHANGED AUTOMATICALLY */
42
- $plugin_version = '2.8.0';
 
 
 
 
 
 
 
43
 
44
  define( 'FLEXIBLE_CHECKOUT_FIELDS_VERSION', $plugin_version );
 
45
 
46
  if ( ! defined( 'FCF_VERSION' ) ) {
47
  define( 'FCF_VERSION', FLEXIBLE_CHECKOUT_FIELDS_VERSION );
3
  Plugin Name: Flexible Checkout Fields
4
  Plugin URI: https://www.wpdesk.net/products/flexible-checkout-fields-pro-woocommerce/
5
  Description: Manage your WooCommerce checkout fields. Change order, labels, placeholders and add new fields.
6
+ Version: 2.9.0
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-checkout-fields
10
  Domain Path: /lang/
11
  Requires at least: 4.9
12
  Tested up to: 5.6
13
+ WC requires at least: 4.5
14
+ WC tested up to: 4.9
15
  Requires PHP: 7.0
16
 
17
  Copyright 2017 WP Desk Ltd.
39
 
40
 
41
  /* THIS VARIABLE CAN BE CHANGED AUTOMATICALLY */
42
+ $plugin_version = '2.9.0';
43
+
44
+ /*
45
+ * Update when conditions are met:
46
+ * - major version: no compatibility (disables dependent plugins)
47
+ * - minor version: compatibility problems (displays notice in dependent plugins)
48
+ */
49
+ $plugin_version_dev = '1.0';
50
 
51
  define( 'FLEXIBLE_CHECKOUT_FIELDS_VERSION', $plugin_version );
52
+ define( 'FLEXIBLE_CHECKOUT_FIELDS_VERSION_DEV', $plugin_version_dev );
53
 
54
  if ( ! defined( 'FCF_VERSION' ) ) {
55
  define( 'FCF_VERSION', FLEXIBLE_CHECKOUT_FIELDS_VERSION );
lang/flexible-checkout-fields.pot CHANGED
@@ -7,8 +7,8 @@ msgstr ""
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
9
  "Content-Transfer-Encoding: 8bit\n"
10
- "POT-Creation-Date: 2020-12-09T15:44:54+00:00\n"
11
- "PO-Revision-Date: 2020-12-09T15:44:54+00:00\n"
12
  "Language: \n"
13
  "X-Poedit-Basepath: ..\n"
14
  "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
@@ -18,7 +18,7 @@ msgstr ""
18
  "X-Poedit-SearchPathExcluded-0: *.js\n"
19
  "X-Poedit-WPHeader: flexible-checkout-fields.php\n"
20
 
21
- #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-ads.php:10
22
  msgid "If you want to continue using Flexible Checkout Fields for free, %splease add a review%s. You will help us support the free version. Thank you."
23
  msgstr ""
24
 
@@ -47,48 +47,48 @@ msgid "Display field's label"
47
  msgstr ""
48
 
49
  #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-fields.php:83
50
- #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-fields.php:363
51
  msgid "Meta name: %s."
52
  msgstr ""
53
 
54
- #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-fields.php:325
55
  msgid "Requirement of this field is controlled by WooCommerce and cannot be changed."
56
  msgstr ""
57
 
58
- #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-fields.php:384
59
- #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-fields.php:821
60
  msgid "For Post Code validation works only with country."
61
  msgstr ""
62
 
63
- #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-fields.php:479
64
  msgid "This field is address locale dependent and cannot be modified."
65
  msgstr ""
66
 
67
- #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-fields.php:549
68
  msgid "Display state abbreviations"
69
  msgstr ""
70
 
71
- #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-fields.php:554
72
  msgid "Display a comma before, if the field is not in the new line"
73
  msgstr ""
74
 
75
- #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-fields.php:658
76
  msgid "Invalid field name: %s. The name already exists."
77
  msgstr ""
78
 
79
- #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-fields.php:809
80
  msgid "Meta name: "
81
  msgstr ""
82
 
83
- #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-fields.php:1007
84
  msgid "Do you really want to delete this field: %s? Deleting a field remove it from all orders."
85
  msgstr ""
86
 
87
- #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-tabs.php:8
88
  msgid "Read the %sconfiguration manual &rarr;%s"
89
  msgstr ""
90
 
91
- #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-tabs.php:11
92
  msgid "WPML detected. Read %sthis instructions if you want to translate Flexible Checkout Fields. &rarr;%s"
93
  msgstr ""
94
 
@@ -214,24 +214,24 @@ msgstr ""
214
  msgid "Previous"
215
  msgstr ""
216
 
217
- #: /builds/wpdesk/flexible-checkout-fields/classes/plugin.php:1130
218
  #: /builds/wpdesk/flexible-checkout-fields/classes/settings.php:165
219
  #: /builds/wpdesk/flexible-checkout-fields/vendor_prefixed/wpdesk/wp-builder/src/Plugin/AbstractPlugin.php:198
220
  #: /builds/wpdesk/flexible-checkout-fields/vendor_prefixed/wpdesk/wp-wpdesk-helper/src/Page/SettingsPage.php:46
221
  msgid "Settings"
222
  msgstr ""
223
 
224
- #: /builds/wpdesk/flexible-checkout-fields/classes/plugin.php:1132
225
  #: /builds/wpdesk/flexible-checkout-fields/vendor_prefixed/wpdesk/wp-builder/src/Plugin/AbstractPlugin.php:194
226
  msgid "Docs"
227
  msgstr ""
228
 
229
- #: /builds/wpdesk/flexible-checkout-fields/classes/plugin.php:1133
230
  #: /builds/wpdesk/flexible-checkout-fields/vendor_prefixed/wpdesk/wp-builder/src/Plugin/AbstractPlugin.php:191
231
  msgid "Support"
232
  msgstr ""
233
 
234
- #: /builds/wpdesk/flexible-checkout-fields/classes/plugin.php:1139
235
  msgid "Upgrade"
236
  msgstr ""
237
 
@@ -282,6 +282,22 @@ msgstr ""
282
  msgid "No"
283
  msgstr ""
284
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
285
  #: /builds/wpdesk/flexible-checkout-fields/vendor_prefixed/wpdesk/wp-basic-requirements/src/Basic_Requirement_Checker.php:181
286
  msgid "The &#8220;%s&#8221; plugin cannot run on PHP versions older than %s. Please contact your host and ask them to upgrade."
287
  msgstr ""
@@ -579,10 +595,10 @@ msgstr ""
579
  msgid "You are deactivating %s plugin."
580
  msgstr ""
581
 
582
- #: /builds/wpdesk/flexible-checkout-fields/views/settings-field-advanced.php:5
583
  msgid "%sGo PRO &rarr;%s to add conditional logic based on products/categories, fields and shipping method."
584
  msgstr ""
585
 
586
- #: /builds/wpdesk/flexible-checkout-fields/views/settings-field-pricing.php:5
587
  msgid "%sGo PRO &rarr;%s In this tab it is possible to add a fixed or percentage price to the field and set the tax on this price."
588
  msgstr ""
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
9
  "Content-Transfer-Encoding: 8bit\n"
10
+ "POT-Creation-Date: 2020-12-16T16:15:02+00:00\n"
11
+ "PO-Revision-Date: 2020-12-16T16:15:02+00:00\n"
12
  "Language: \n"
13
  "X-Poedit-Basepath: ..\n"
14
  "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
18
  "X-Poedit-SearchPathExcluded-0: *.js\n"
19
  "X-Poedit-WPHeader: flexible-checkout-fields.php\n"
20
 
21
+ #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-ads.php:19
22
  msgid "If you want to continue using Flexible Checkout Fields for free, %splease add a review%s. You will help us support the free version. Thank you."
23
  msgstr ""
24
 
47
  msgstr ""
48
 
49
  #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-fields.php:83
50
+ #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-fields.php:365
51
  msgid "Meta name: %s."
52
  msgstr ""
53
 
54
+ #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-fields.php:327
55
  msgid "Requirement of this field is controlled by WooCommerce and cannot be changed."
56
  msgstr ""
57
 
58
+ #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-fields.php:386
59
+ #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-fields.php:823
60
  msgid "For Post Code validation works only with country."
61
  msgstr ""
62
 
63
+ #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-fields.php:481
64
  msgid "This field is address locale dependent and cannot be modified."
65
  msgstr ""
66
 
67
+ #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-fields.php:551
68
  msgid "Display state abbreviations"
69
  msgstr ""
70
 
71
+ #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-fields.php:556
72
  msgid "Display a comma before, if the field is not in the new line"
73
  msgstr ""
74
 
75
+ #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-fields.php:660
76
  msgid "Invalid field name: %s. The name already exists."
77
  msgstr ""
78
 
79
+ #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-fields.php:811
80
  msgid "Meta name: "
81
  msgstr ""
82
 
83
+ #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-fields.php:1009
84
  msgid "Do you really want to delete this field: %s? Deleting a field remove it from all orders."
85
  msgstr ""
86
 
87
+ #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-tabs.php:10
88
  msgid "Read the %sconfiguration manual &rarr;%s"
89
  msgstr ""
90
 
91
+ #: /builds/wpdesk/flexible-checkout-fields/classes/views/settings-tabs.php:17
92
  msgid "WPML detected. Read %sthis instructions if you want to translate Flexible Checkout Fields. &rarr;%s"
93
  msgstr ""
94
 
214
  msgid "Previous"
215
  msgstr ""
216
 
217
+ #: /builds/wpdesk/flexible-checkout-fields/classes/plugin.php:1123
218
  #: /builds/wpdesk/flexible-checkout-fields/classes/settings.php:165
219
  #: /builds/wpdesk/flexible-checkout-fields/vendor_prefixed/wpdesk/wp-builder/src/Plugin/AbstractPlugin.php:198
220
  #: /builds/wpdesk/flexible-checkout-fields/vendor_prefixed/wpdesk/wp-wpdesk-helper/src/Page/SettingsPage.php:46
221
  msgid "Settings"
222
  msgstr ""
223
 
224
+ #: /builds/wpdesk/flexible-checkout-fields/classes/plugin.php:1124
225
  #: /builds/wpdesk/flexible-checkout-fields/vendor_prefixed/wpdesk/wp-builder/src/Plugin/AbstractPlugin.php:194
226
  msgid "Docs"
227
  msgstr ""
228
 
229
+ #: /builds/wpdesk/flexible-checkout-fields/classes/plugin.php:1125
230
  #: /builds/wpdesk/flexible-checkout-fields/vendor_prefixed/wpdesk/wp-builder/src/Plugin/AbstractPlugin.php:191
231
  msgid "Support"
232
  msgstr ""
233
 
234
+ #: /builds/wpdesk/flexible-checkout-fields/classes/plugin.php:1129
235
  msgid "Upgrade"
236
  msgstr ""
237
 
282
  msgid "No"
283
  msgstr ""
284
 
285
+ #: /builds/wpdesk/flexible-checkout-fields/templates/notices/review.php:19
286
+ msgid "Thanks for using the free version of Flexible Checkout Fields!"
287
+ msgstr ""
288
+
289
+ #: /builds/wpdesk/flexible-checkout-fields/templates/notices/review.php:26
290
+ msgid "We are glad that (with our little help %1$s) the shop is now better suited to the needs. We will be grateful for the rating and feedback. %2$sIt will take less than reading this and it will help us a lot!"
291
+ msgstr ""
292
+
293
+ #: /builds/wpdesk/flexible-checkout-fields/templates/notices/review.php:37
294
+ msgid "Add review"
295
+ msgstr ""
296
+
297
+ #: /builds/wpdesk/flexible-checkout-fields/templates/notices/review.php:41
298
+ msgid "I added review, do not show again"
299
+ msgstr ""
300
+
301
  #: /builds/wpdesk/flexible-checkout-fields/vendor_prefixed/wpdesk/wp-basic-requirements/src/Basic_Requirement_Checker.php:181
302
  msgid "The &#8220;%s&#8221; plugin cannot run on PHP versions older than %s. Please contact your host and ask them to upgrade."
303
  msgstr ""
595
  msgid "You are deactivating %s plugin."
596
  msgstr ""
597
 
598
+ #: /builds/wpdesk/flexible-checkout-fields/views/settings-field-advanced.php:7
599
  msgid "%sGo PRO &rarr;%s to add conditional logic based on products/categories, fields and shipping method."
600
  msgstr ""
601
 
602
+ #: /builds/wpdesk/flexible-checkout-fields/views/settings-field-pricing.php:7
603
  msgid "%sGo PRO &rarr;%s In this tab it is possible to add a fixed or percentage price to the field and set the tax on this price."
604
  msgstr ""
readme.txt CHANGED
@@ -1,6 +1,6 @@
1
  === Flexible Checkout Fields for WooCommerce ===
2
 
3
- Contributors: wpdesk,dyszczo,grola,piotrpo,marcinkolanko
4
  Donate link: https://www.wpdesk.net/flexible-checkout-fields-woocommerce/
5
  Tags: woocommerce checkout fields, woocommerce custom fields, woocommerce checkout manager, woocommerce checkout editor, woocommerce fields manager, woocommerce fields editor, woocommerce custom checkout fields, woocommerce checkout options, woocommerce checkout pro, woocommerce custom sections, woocommerce file upload
6
  Requires at least: 4.9
@@ -187,6 +187,11 @@ If you are upgrading from the old WooCommerce Checkout Fields version (1.1, wooc
187
 
188
  == Changelog ==
189
 
 
 
 
 
 
190
  = 2.8.0 - 2020-12-09 =
191
  * Added hook for integration with FCF plugin
192
 
1
  === Flexible Checkout Fields for WooCommerce ===
2
 
3
+ Contributors: wpdesk,dyszczo,grola,piotrpo,marcinkolanko,mateuszgbiorczyk
4
  Donate link: https://www.wpdesk.net/flexible-checkout-fields-woocommerce/
5
  Tags: woocommerce checkout fields, woocommerce custom fields, woocommerce checkout manager, woocommerce checkout editor, woocommerce fields manager, woocommerce fields editor, woocommerce custom checkout fields, woocommerce checkout options, woocommerce checkout pro, woocommerce custom sections, woocommerce file upload
6
  Requires at least: 4.9
187
 
188
  == Changelog ==
189
 
190
+ = 2.9.0 - 2020-12-16 =
191
+ * Changed hook for integration with FCF plugin
192
+ * Changed URLs for docs
193
+ * Added notice asking for plugin review
194
+
195
  = 2.8.0 - 2020-12-09 =
196
  * Added hook for integration with FCF plugin
197
 
src/Admin/NoticeReview.php ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * .
4
+ *
5
+ * @package WPDesk\FCF\Free
6
+ */
7
+
8
+ namespace WPDesk\FCF\Free\Admin;
9
+
10
+ use FcfVendor\WPDesk\PluginBuilder\Plugin\Hookable;
11
+ use FcfVendor\WPDesk\PluginBuilder\Plugin\HookablePluginDependant;
12
+ use FcfVendor\WPDesk\PluginBuilder\Plugin\PluginAccess;
13
+ use FcfVendor\WPDesk\View\Renderer\SimplePhpRenderer;
14
+ use FcfVendor\WPDesk\View\Resolver\DirResolver;
15
+
16
+ /**
17
+ * Creates admin notice about review.
18
+ */
19
+ class NoticeReview implements Hookable, HookablePluginDependant {
20
+
21
+ use PluginAccess;
22
+
23
+ const ACTIVATION_OPTION_NAME = 'plugin_activation_%s';
24
+ const NOTICE_OPTION_NAME = 'notice_review_%s';
25
+ const NOTICE_AJAX_ACTION = 'fcf_close_notice_review';
26
+
27
+ /**
28
+ * Class object for template rendering.
29
+ *
30
+ * @var SimplePhpRenderer
31
+ */
32
+ private $renderer;
33
+
34
+ /**
35
+ * Class constructor.
36
+ */
37
+ public function __construct() {
38
+ $this->set_renderer();
39
+ }
40
+
41
+ /**
42
+ * Init class for template rendering.
43
+ */
44
+ private function set_renderer() {
45
+ $this->renderer = new SimplePhpRenderer( new DirResolver( dirname( dirname( __DIR__ ) ) . '/templates' ) );
46
+ }
47
+
48
+ /**
49
+ * Integrate with WordPress and with other plugins using action/filter system.
50
+ *
51
+ * @return void
52
+ */
53
+ public function hooks() {
54
+ add_filter( 'admin_init', [ $this, 'init_review_notice' ] );
55
+ add_action( 'wp_ajax_' . self::NOTICE_AJAX_ACTION, [ $this, 'hide_review_notice' ] );
56
+ }
57
+
58
+ /**
59
+ * Generates admin notice about plugin review.
60
+ *
61
+ * @internal
62
+ */
63
+ public function init_review_notice() {
64
+ $option_notice = sprintf( self::NOTICE_OPTION_NAME, $this->plugin->get_plugin_file_path() );
65
+ $notice_date = strtotime( get_option( $option_notice, false ) );
66
+ $min_date = strtotime( current_time( 'mysql' ) );
67
+
68
+ if ( ( $notice_date !== false ) && ( $notice_date > $min_date ) ) {
69
+ return;
70
+ }
71
+
72
+ $option_activation = sprintf( self::ACTIVATION_OPTION_NAME, $this->plugin->get_plugin_file_path() );
73
+ $activation_date = strtotime( get_option( $option_activation, current_time( 'mysql' ) ) );
74
+ $min_date = strtotime( current_time( 'mysql' ) . ' -2 weeks' );
75
+
76
+ if ( $activation_date > $min_date ) {
77
+ return;
78
+ }
79
+
80
+ add_filter( 'admin_notices', [ $this, 'show_review_notice' ] );
81
+ add_action( 'admin_enqueue_scripts', [ $this, 'load_styles_for_notice' ] );
82
+ add_action( 'admin_enqueue_scripts', [ $this, 'load_scripts_for_notice' ] );
83
+ }
84
+
85
+ /**
86
+ * Disables visible notice.
87
+ *
88
+ * @internal
89
+ */
90
+ public function hide_review_notice() {
91
+ $option_name = sprintf( self::NOTICE_OPTION_NAME, $this->plugin->get_plugin_file_path() );
92
+ $is_permanent = ( isset( $_POST['is_permanently'] ) && $_POST['is_permanently'] ); // phpcs:ignore
93
+ $notice_time = strtotime( current_time( 'mysql' ) . ( ( $is_permanent ) ? ' +10 years' : ' +1 month' ) );
94
+ $notice_date = gmdate( 'Y-m-d H:i:s', $notice_time );
95
+
96
+ update_option( $option_name, $notice_date, true );
97
+ }
98
+
99
+ /**
100
+ * Displays admin notice about plugin review.
101
+ *
102
+ * @internal
103
+ */
104
+ public function show_review_notice() {
105
+ echo $this->renderer->render( // phpcs:ignore
106
+ 'notices/review',
107
+ [
108
+ 'ajax_url' => esc_attr( admin_url( 'admin-ajax.php' ) ),
109
+ 'ajax_action' => esc_attr( self::NOTICE_AJAX_ACTION ),
110
+ ]
111
+ );
112
+ }
113
+
114
+ /**
115
+ * Enqueues styles in WordPress Admin Dashboard.
116
+ *
117
+ * @internal
118
+ */
119
+ public function load_styles_for_notice() {
120
+ $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '.css' : '.min.css';
121
+
122
+ wp_register_style(
123
+ 'fcf-notice',
124
+ trailingslashit( $this->plugin->get_plugin_assets_url() ) . 'css/admin-notice' . $suffix,
125
+ [],
126
+ $this->plugin->get_script_version()
127
+ );
128
+ wp_enqueue_style( 'fcf-notice' );
129
+ }
130
+
131
+ /**
132
+ * Enqueues scripts in WordPress Admin Dashboard.
133
+ *
134
+ * @internal
135
+ */
136
+ public function load_scripts_for_notice() {
137
+ $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '.js' : '.min.js';
138
+
139
+ wp_register_script(
140
+ 'fcf-notice',
141
+ trailingslashit( $this->plugin->get_plugin_assets_url() ) . 'js/admin-notice' . $suffix,
142
+ [],
143
+ $this->plugin->get_script_version(),
144
+ true
145
+ );
146
+ wp_enqueue_script( 'fcf-notice' );
147
+ }
148
+
149
+ }
src/Helpers/Shortener.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * .
4
+ *
5
+ * @package WPDesk\FCF\Free
6
+ */
7
+
8
+ namespace WPDesk\FCF\Free\Helpers;
9
+
10
+ use FcfVendor\WPDesk\PluginBuilder\Plugin\Hookable;
11
+ use FcfVendor\WPDesk\PluginBuilder\Plugin\HookablePluginDependant;
12
+ use FcfVendor\WPDesk\PluginBuilder\Plugin\PluginAccess;
13
+
14
+ /**
15
+ * Creates helpers for short URLs.
16
+ */
17
+ class Shortener implements Hookable, HookablePluginDependant {
18
+
19
+ use PluginAccess;
20
+
21
+ const SHORTENER_DOMAIN = 'https://wpde.sk/';
22
+
23
+ /**
24
+ * Integrate with WordPress and with other plugins using action/filter system.
25
+ *
26
+ * @return void
27
+ */
28
+ public function hooks() {
29
+ add_filter( 'flexible_checkout_fields/short_url', [ $this, 'generate_short_url' ], 10, 2 );
30
+ }
31
+
32
+ /**
33
+ * Generates short URL for link.
34
+ *
35
+ * @param string $default_value Default value for filter.
36
+ * @param string $short_path Path for short URL.
37
+ *
38
+ * @return string Short URL.
39
+ *
40
+ * @internal
41
+ */
42
+ public function generate_short_url( string $default_value, string $short_path ): string {
43
+ if ( ! preg_match( '/^[a-z-]+$/i', $short_path ) ) {
44
+ return '#';
45
+ }
46
+
47
+ $locale = get_locale();
48
+ $short_url = self::SHORTENER_DOMAIN . $short_path;
49
+ switch ( $locale ) {
50
+ case 'pl_PL':
51
+ $short_url .= '-pl';
52
+ break;
53
+ }
54
+ return $short_url;
55
+ }
56
+
57
+ }
src/Integration/Field.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * .
4
  *
5
- * @package WPDesk\FCF\Pro
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
2
  /**
3
  * .
4
  *
5
+ * @package WPDesk\FCF\Free
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
src/Integration/FieldInterface.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * .
4
  *
5
- * @package WPDesk\FCF\Pro
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
2
  /**
3
  * .
4
  *
5
+ * @package WPDesk\FCF\Free
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
src/Integration/Fields.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * .
4
  *
5
- * @package WPDesk\FCF\Pro
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
@@ -26,7 +26,7 @@ class Fields implements FieldsInterface {
26
  /**
27
  * Class constructor.
28
  *
29
- * @param array $field_groups List of field groups
30
  */
31
  public function __construct( array $field_groups ) {
32
  $this->field_groups = $field_groups;
2
  /**
3
  * .
4
  *
5
+ * @package WPDesk\FCF\Free
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
26
  /**
27
  * Class constructor.
28
  *
29
+ * @param array $field_groups List of field groups.
30
  */
31
  public function __construct( array $field_groups ) {
32
  $this->field_groups = $field_groups;
src/Integration/FieldsInterface.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * .
4
  *
5
- * @package WPDesk\FCF\Pro
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
2
  /**
3
  * .
4
  *
5
+ * @package WPDesk\FCF\Free
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
src/Integration/Integrator.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * .
4
  *
5
- * @package WPDesk\FCF\Pro
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
@@ -26,6 +26,13 @@ class Integrator implements IntegratorInterface {
26
  */
27
  private $version = FLEXIBLE_CHECKOUT_FIELDS_VERSION;
28
 
 
 
 
 
 
 
 
29
  /**
30
  * List of field sections.
31
  *
@@ -43,8 +50,8 @@ class Integrator implements IntegratorInterface {
43
  /**
44
  * Class constructor.
45
  *
46
- * @param array $field_sections List of field sections
47
- * @param array $field_groups List of field groups
48
  */
49
  public function __construct( array $field_sections, array $field_groups ) {
50
  $this->field_sections = $field_sections;
@@ -54,10 +61,44 @@ class Integrator implements IntegratorInterface {
54
  /**
55
  * Returns version of integration script.
56
  *
57
- * @return string Script version.
 
 
58
  */
59
  public function get_version(): string {
60
- return $this->version;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  }
62
 
63
  /**
2
  /**
3
  * .
4
  *
5
+ * @package WPDesk\FCF\Free
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
26
  */
27
  private $version = FLEXIBLE_CHECKOUT_FIELDS_VERSION;
28
 
29
+ /**
30
+ * Version of plugin core (for compatibility with dependent plugins).
31
+ *
32
+ * @var string
33
+ */
34
+ private $version_dev = FLEXIBLE_CHECKOUT_FIELDS_VERSION_DEV;
35
+
36
  /**
37
  * List of field sections.
38
  *
50
  /**
51
  * Class constructor.
52
  *
53
+ * @param array $field_sections List of field sections.
54
+ * @param array $field_groups List of field groups.
55
  */
56
  public function __construct( array $field_sections, array $field_groups ) {
57
  $this->field_sections = $field_sections;
61
  /**
62
  * Returns version of integration script.
63
  *
64
+ * @example Use method to integration with plugin.
65
+ *
66
+ * @return string Integration script version.
67
  */
68
  public function get_version(): string {
69
+ $version_dev_major = explode( '.', $this->version_dev )[0];
70
+ $version_dev_minor = explode( '.', $this->version_dev )[1];
71
+ $version_major = explode( '.', $this->version )[0];
72
+ $version_minor = explode( '.', $this->version )[1];
73
+ $version_patch = explode( '.', $this->version )[2];
74
+
75
+ return sprintf(
76
+ '%d.%d.%d',
77
+ ( ( $version_dev_major * 1000 ) + $version_dev_minor ),
78
+ ( ( $version_major * 1000 ) + $version_minor ),
79
+ $version_patch
80
+ );
81
+ }
82
+
83
+ /**
84
+ * Returns version of plugin core (do not use this method for plugin integration).
85
+ *
86
+ * @example Use method to create plugin dependent on this plugin.
87
+ *
88
+ * @return string Plugin core version.
89
+ */
90
+ public function get_version_dev(): string {
91
+ $version_dev_major = explode( '.', $this->version_dev )[0];
92
+ $version_dev_minor = explode( '.', $this->version_dev )[1];
93
+ $version_major = explode( '.', $this->version )[0];
94
+ $version_minor = explode( '.', $this->version )[1];
95
+
96
+ return sprintf(
97
+ '%d.%d.%d',
98
+ $version_dev_major,
99
+ $version_dev_minor,
100
+ ( ( $version_major * 1000 ) + $version_minor )
101
+ );
102
  }
103
 
104
  /**
src/Integration/IntegratorIntegration.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * .
4
  *
5
- * @package WPDesk\FCF\Pro
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
@@ -29,7 +29,7 @@ class IntegratorIntegration implements Hookable, HookablePluginDependant {
29
  /**
30
  * Class constructor.
31
  *
32
- * @param \Flexible_Checkout_Fields_Plugin $plugin_old Plugin info.
33
  */
34
  public function __construct( \Flexible_Checkout_Fields_Plugin $plugin_old ) {
35
  $this->plugin_old = $plugin_old;
2
  /**
3
  * .
4
  *
5
+ * @package WPDesk\FCF\Free
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
29
  /**
30
  * Class constructor.
31
  *
32
+ * @param \Flexible_Checkout_Fields_Plugin $plugin_old Main plugin.
33
  */
34
  public function __construct( \Flexible_Checkout_Fields_Plugin $plugin_old ) {
35
  $this->plugin_old = $plugin_old;
src/Integration/IntegratorInterface.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * .
4
  *
5
- * @package WPDesk\FCF\Pro
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
@@ -19,7 +19,18 @@ interface IntegratorInterface extends SectionsInterface, FieldsInterface, ValueI
19
  /**
20
  * Returns version of integration script.
21
  *
22
- * @return string Script version.
 
 
23
  */
24
  public function get_version(): string;
 
 
 
 
 
 
 
 
 
25
  }
2
  /**
3
  * .
4
  *
5
+ * @package WPDesk\FCF\Free
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
19
  /**
20
  * Returns version of integration script.
21
  *
22
+ * @example Use method to integration with plugin.
23
+ *
24
+ * @return string Integration script version.
25
  */
26
  public function get_version(): string;
27
+
28
+ /**
29
+ * Returns version of plugin core (do not use this method for plugin integration).
30
+ *
31
+ * @example Use method to create plugin dependent on this plugin.
32
+ *
33
+ * @return string Plugin core version.
34
+ */
35
+ public function get_version_dev(): string;
36
  }
src/Integration/Section.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * .
4
  *
5
- * @package WPDesk\FCF\Pro
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
2
  /**
3
  * .
4
  *
5
+ * @package WPDesk\FCF\Free
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
src/Integration/SectionInterface.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * .
4
  *
5
- * @package WPDesk\FCF\Pro
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
2
  /**
3
  * .
4
  *
5
+ * @package WPDesk\FCF\Free
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
src/Integration/Sections.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * .
4
  *
5
- * @package WPDesk\FCF\Pro
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
@@ -26,7 +26,7 @@ class Sections implements SectionsInterface {
26
  /**
27
  * Class constructor.
28
  *
29
- * @param array $field_sections List of field sections
30
  */
31
  public function __construct( array $field_sections ) {
32
  $this->field_sections = $field_sections;
2
  /**
3
  * .
4
  *
5
+ * @package WPDesk\FCF\Free
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
26
  /**
27
  * Class constructor.
28
  *
29
+ * @param array $field_sections List of field sections.
30
  */
31
  public function __construct( array $field_sections ) {
32
  $this->field_sections = $field_sections;
src/Integration/SectionsInterface.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * .
4
  *
5
- * @package WPDesk\FCF\Pro
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
2
  /**
3
  * .
4
  *
5
+ * @package WPDesk\FCF\Free
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
src/Integration/Value.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * .
4
  *
5
- * @package WPDesk\FCF\Pro
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
2
  /**
3
  * .
4
  *
5
+ * @package WPDesk\FCF\Free
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
src/Integration/ValueInterface.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * .
4
  *
5
- * @package WPDesk\FCF\Pro
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
2
  /**
3
  * .
4
  *
5
+ * @package WPDesk\FCF\Free
6
  */
7
 
8
  namespace WPDesk\FCF\Free\Integration;
src/Plugin.php CHANGED
@@ -11,6 +11,8 @@ use FcfVendor\WPDesk_Plugin_Info;
11
  use FcfVendor\WPDesk\PluginBuilder\Plugin\AbstractPlugin;
12
  use FcfVendor\WPDesk\PluginBuilder\Plugin\HookableCollection;
13
  use FcfVendor\WPDesk\PluginBuilder\Plugin\HookableParent;
 
 
14
  use WPDesk\FCF\Free\Integration;
15
 
16
  /**
@@ -37,8 +39,8 @@ class Plugin extends AbstractPlugin implements HookableCollection {
37
  /**
38
  * Plugin constructor.
39
  *
40
- * @param WPDesk_Plugin_Info $plugin_info Plugin info.
41
- * @param \Flexible_Checkout_Fields_Plugin $plugin_old Plugin info.
42
  */
43
  public function __construct( WPDesk_Plugin_Info $plugin_info, \Flexible_Checkout_Fields_Plugin $plugin_old ) {
44
  parent::__construct( $plugin_info );
@@ -58,6 +60,8 @@ class Plugin extends AbstractPlugin implements HookableCollection {
58
  * @return void
59
  */
60
  public function init() {
 
 
61
  $this->add_hookable( new Integration\IntegratorIntegration( $this->plugin_old ) );
62
  }
63
 
11
  use FcfVendor\WPDesk\PluginBuilder\Plugin\AbstractPlugin;
12
  use FcfVendor\WPDesk\PluginBuilder\Plugin\HookableCollection;
13
  use FcfVendor\WPDesk\PluginBuilder\Plugin\HookableParent;
14
+ use WPDesk\FCF\Free\Admin;
15
+ use WPDesk\FCF\Free\Helpers;
16
  use WPDesk\FCF\Free\Integration;
17
 
18
  /**
39
  /**
40
  * Plugin constructor.
41
  *
42
+ * @param WPDesk_Plugin_Info $plugin_info Plugin info.
43
+ * @param \Flexible_Checkout_Fields_Plugin $plugin_old Main plugin.
44
  */
45
  public function __construct( WPDesk_Plugin_Info $plugin_info, \Flexible_Checkout_Fields_Plugin $plugin_old ) {
46
  parent::__construct( $plugin_info );
60
  * @return void
61
  */
62
  public function init() {
63
+ $this->add_hookable( new Admin\NoticeReview() );
64
+ $this->add_hookable( new Helpers\Shortener() );
65
  $this->add_hookable( new Integration\IntegratorIntegration( $this->plugin_old ) );
66
  }
67
 
templates/notices/review.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Notice about plugin review.
4
+ *
5
+ * @var string $ajax_url URL for Admin Ajax.
6
+ * @var string $ajax_action Action for Admin Ajax.
7
+ *
8
+ * @author WP Desk
9
+ * @package WPDesk\FCF\Free\Templates
10
+ * @version 1.0.0
11
+ */
12
+
13
+ ?>
14
+ <div class="notice notice-success is-dismissible"
15
+ data-notice="fcf-admin-notice"
16
+ data-notice-url="<?php echo esc_attr( $ajax_url ); ?>"
17
+ data-notice-action="<?php echo esc_attr( $ajax_action ); ?>">
18
+ <h2>
19
+ <?php echo esc_html( __( 'Thanks for using the free version of Flexible Checkout Fields!', 'flexible-checkout-fields' ) ); ?>
20
+ </h2>
21
+ <p>
22
+ <?php
23
+ echo wp_kses_post(
24
+ sprintf(
25
+ /* translators: %1$s: dashicon, %2$s: break-line tag */
26
+ __( 'We are glad that (with our little help %1$s) the shop is now better suited to the needs. We will be grateful for the rating and feedback. %2$sIt will take less than reading this and it will help us a lot!', 'flexible-checkout-fields' ),
27
+ '<span class="dashicons dashicons-heart"></span>',
28
+ '<br>'
29
+ )
30
+ );
31
+ ?>
32
+ </p>
33
+ <div>
34
+ <a href="<?php echo esc_url( apply_filters( 'flexible_checkout_fields/short_url', '#', 'fcf-settings-notice-review-button' ) ); ?>"
35
+ target="_blank"
36
+ class="button button-hero button-primary">
37
+ <?php echo esc_html( __( 'Add review', 'flexible-checkout-fields' ) ); ?>
38
+ </a>
39
+ <a href="#"
40
+ class="button button-hero" data-notice-button>
41
+ <?php echo esc_html( __( 'I added review, do not show again', 'flexible-checkout-fields' ) ); ?>
42
+ </a>
43
+ </div>
44
+ </div>
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit694734dffd87b09567ef2e8453e9eaf0::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitfff51be9e85471ac3ff7f10b0880f813::getLoader();
vendor/composer/autoload_classmap.php CHANGED
@@ -185,6 +185,16 @@ return array(
185
  'FcfVendor\\WPDesk\\Plugin\\Flow\\Initialization\\Simple\\SimplePaidStrategy' => $baseDir . '/vendor_prefixed/wpdesk/wp-plugin-flow/src/Initialization/Simple/SimplePaidStrategy.php',
186
  'FcfVendor\\WPDesk\\Plugin\\Flow\\Initialization\\Simple\\TrackerInstanceAsFilterTrait' => $baseDir . '/vendor_prefixed/wpdesk/wp-plugin-flow/src/Initialization/TrackerInstanceAsFilterTrait.php',
187
  'FcfVendor\\WPDesk\\Plugin\\Flow\\PluginBootstrap' => $baseDir . '/vendor_prefixed/wpdesk/wp-plugin-flow/src/PluginBootstrap.php',
 
 
 
 
 
 
 
 
 
 
188
  'FcfVendor\\WPDesk_API_KEY' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-license/src/ApiManager/class-wc-key-api.php',
189
  'FcfVendor\\WPDesk_API_MENU' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-license/src/ApiManager/class-wc-api-manager-menu.php',
190
  'FcfVendor\\WPDesk_API_Manager_With_Update_Flag' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-license/src/ApiManager/class-wc-api-manager.php',
@@ -258,6 +268,8 @@ return array(
258
  'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/DummyTest.php',
259
  'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
260
  'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php',
 
 
261
  'WPDesk\\FCF\\Free\\Integration\\Field' => $baseDir . '/src/Integration/Field.php',
262
  'WPDesk\\FCF\\Free\\Integration\\FieldInterface' => $baseDir . '/src/Integration/FieldInterface.php',
263
  'WPDesk\\FCF\\Free\\Integration\\Fields' => $baseDir . '/src/Integration/Fields.php',
185
  'FcfVendor\\WPDesk\\Plugin\\Flow\\Initialization\\Simple\\SimplePaidStrategy' => $baseDir . '/vendor_prefixed/wpdesk/wp-plugin-flow/src/Initialization/Simple/SimplePaidStrategy.php',
186
  'FcfVendor\\WPDesk\\Plugin\\Flow\\Initialization\\Simple\\TrackerInstanceAsFilterTrait' => $baseDir . '/vendor_prefixed/wpdesk/wp-plugin-flow/src/Initialization/TrackerInstanceAsFilterTrait.php',
187
  'FcfVendor\\WPDesk\\Plugin\\Flow\\PluginBootstrap' => $baseDir . '/vendor_prefixed/wpdesk/wp-plugin-flow/src/PluginBootstrap.php',
188
+ 'FcfVendor\\WPDesk\\View\\PluginViewBuilder' => $baseDir . '/vendor_prefixed/wpdesk/wp-view/src/PluginViewBuilder.php',
189
+ 'FcfVendor\\WPDesk\\View\\Renderer\\LoadTemplatePlugin' => $baseDir . '/vendor_prefixed/wpdesk/wp-view/src/Renderer/LoadTemplatePlugin.php',
190
+ 'FcfVendor\\WPDesk\\View\\Renderer\\Renderer' => $baseDir . '/vendor_prefixed/wpdesk/wp-view/src/Renderer/Renderer.php',
191
+ 'FcfVendor\\WPDesk\\View\\Renderer\\SimplePhpRenderer' => $baseDir . '/vendor_prefixed/wpdesk/wp-view/src/Renderer/SimplePhpRenderer.php',
192
+ 'FcfVendor\\WPDesk\\View\\Resolver\\ChainResolver' => $baseDir . '/vendor_prefixed/wpdesk/wp-view/src/Resolver/ChainResolver.php',
193
+ 'FcfVendor\\WPDesk\\View\\Resolver\\DirResolver' => $baseDir . '/vendor_prefixed/wpdesk/wp-view/src/Resolver/DirResolver.php',
194
+ 'FcfVendor\\WPDesk\\View\\Resolver\\Exception\\CanNotResolve' => $baseDir . '/vendor_prefixed/wpdesk/wp-view/src/Resolver/Exception/CanNotResolve.php',
195
+ 'FcfVendor\\WPDesk\\View\\Resolver\\NullResolver' => $baseDir . '/vendor_prefixed/wpdesk/wp-view/src/Resolver/NullResolver.php',
196
+ 'FcfVendor\\WPDesk\\View\\Resolver\\Resolver' => $baseDir . '/vendor_prefixed/wpdesk/wp-view/src/Resolver/Resolver.php',
197
+ 'FcfVendor\\WPDesk\\View\\Resolver\\WPThemeResolver' => $baseDir . '/vendor_prefixed/wpdesk/wp-view/src/Resolver/WPThemeResolver.php',
198
  'FcfVendor\\WPDesk_API_KEY' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-license/src/ApiManager/class-wc-key-api.php',
199
  'FcfVendor\\WPDesk_API_MENU' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-license/src/ApiManager/class-wc-api-manager-menu.php',
200
  'FcfVendor\\WPDesk_API_Manager_With_Update_Flag' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-license/src/ApiManager/class-wc-api-manager.php',
268
  'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/DummyTest.php',
269
  'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
270
  'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php',
271
+ 'WPDesk\\FCF\\Free\\Admin\\NoticeReview' => $baseDir . '/src/Admin/NoticeReview.php',
272
+ 'WPDesk\\FCF\\Free\\Helpers\\Shortener' => $baseDir . '/src/Helpers/Shortener.php',
273
  'WPDesk\\FCF\\Free\\Integration\\Field' => $baseDir . '/src/Integration/Field.php',
274
  'WPDesk\\FCF\\Free\\Integration\\FieldInterface' => $baseDir . '/src/Integration/FieldInterface.php',
275
  'WPDesk\\FCF\\Free\\Integration\\Fields' => $baseDir . '/src/Integration/Fields.php',
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit694734dffd87b09567ef2e8453e9eaf0
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit694734dffd87b09567ef2e8453e9eaf0
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit694734dffd87b09567ef2e8453e9eaf0', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit694734dffd87b09567ef2e8453e9eaf0', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInit694734dffd87b09567ef2e8453e9eaf0::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitfff51be9e85471ac3ff7f10b0880f813
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitfff51be9e85471ac3ff7f10b0880f813', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitfff51be9e85471ac3ff7f10b0880f813', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInitfff51be9e85471ac3ff7f10b0880f813::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit694734dffd87b09567ef2e8453e9eaf0
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'W' =>
@@ -208,6 +208,16 @@ class ComposerStaticInit694734dffd87b09567ef2e8453e9eaf0
208
  'FcfVendor\\WPDesk\\Plugin\\Flow\\Initialization\\Simple\\SimplePaidStrategy' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-plugin-flow/src/Initialization/Simple/SimplePaidStrategy.php',
209
  'FcfVendor\\WPDesk\\Plugin\\Flow\\Initialization\\Simple\\TrackerInstanceAsFilterTrait' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-plugin-flow/src/Initialization/TrackerInstanceAsFilterTrait.php',
210
  'FcfVendor\\WPDesk\\Plugin\\Flow\\PluginBootstrap' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-plugin-flow/src/PluginBootstrap.php',
 
 
 
 
 
 
 
 
 
 
211
  'FcfVendor\\WPDesk_API_KEY' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-license/src/ApiManager/class-wc-key-api.php',
212
  'FcfVendor\\WPDesk_API_MENU' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-license/src/ApiManager/class-wc-api-manager-menu.php',
213
  'FcfVendor\\WPDesk_API_Manager_With_Update_Flag' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-license/src/ApiManager/class-wc-api-manager.php',
@@ -281,6 +291,8 @@ class ComposerStaticInit694734dffd87b09567ef2e8453e9eaf0
281
  'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/DummyTest.php',
282
  'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
283
  'Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php',
 
 
284
  'WPDesk\\FCF\\Free\\Integration\\Field' => __DIR__ . '/../..' . '/src/Integration/Field.php',
285
  'WPDesk\\FCF\\Free\\Integration\\FieldInterface' => __DIR__ . '/../..' . '/src/Integration/FieldInterface.php',
286
  'WPDesk\\FCF\\Free\\Integration\\Fields' => __DIR__ . '/../..' . '/src/Integration/Fields.php',
@@ -306,9 +318,9 @@ class ComposerStaticInit694734dffd87b09567ef2e8453e9eaf0
306
  public static function getInitializer(ClassLoader $loader)
307
  {
308
  return \Closure::bind(function () use ($loader) {
309
- $loader->prefixLengthsPsr4 = ComposerStaticInit694734dffd87b09567ef2e8453e9eaf0::$prefixLengthsPsr4;
310
- $loader->prefixDirsPsr4 = ComposerStaticInit694734dffd87b09567ef2e8453e9eaf0::$prefixDirsPsr4;
311
- $loader->classMap = ComposerStaticInit694734dffd87b09567ef2e8453e9eaf0::$classMap;
312
 
313
  }, null, ClassLoader::class);
314
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitfff51be9e85471ac3ff7f10b0880f813
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'W' =>
208
  'FcfVendor\\WPDesk\\Plugin\\Flow\\Initialization\\Simple\\SimplePaidStrategy' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-plugin-flow/src/Initialization/Simple/SimplePaidStrategy.php',
209
  'FcfVendor\\WPDesk\\Plugin\\Flow\\Initialization\\Simple\\TrackerInstanceAsFilterTrait' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-plugin-flow/src/Initialization/TrackerInstanceAsFilterTrait.php',
210
  'FcfVendor\\WPDesk\\Plugin\\Flow\\PluginBootstrap' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-plugin-flow/src/PluginBootstrap.php',
211
+ 'FcfVendor\\WPDesk\\View\\PluginViewBuilder' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-view/src/PluginViewBuilder.php',
212
+ 'FcfVendor\\WPDesk\\View\\Renderer\\LoadTemplatePlugin' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-view/src/Renderer/LoadTemplatePlugin.php',
213
+ 'FcfVendor\\WPDesk\\View\\Renderer\\Renderer' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-view/src/Renderer/Renderer.php',
214
+ 'FcfVendor\\WPDesk\\View\\Renderer\\SimplePhpRenderer' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-view/src/Renderer/SimplePhpRenderer.php',
215
+ 'FcfVendor\\WPDesk\\View\\Resolver\\ChainResolver' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-view/src/Resolver/ChainResolver.php',
216
+ 'FcfVendor\\WPDesk\\View\\Resolver\\DirResolver' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-view/src/Resolver/DirResolver.php',
217
+ 'FcfVendor\\WPDesk\\View\\Resolver\\Exception\\CanNotResolve' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-view/src/Resolver/Exception/CanNotResolve.php',
218
+ 'FcfVendor\\WPDesk\\View\\Resolver\\NullResolver' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-view/src/Resolver/NullResolver.php',
219
+ 'FcfVendor\\WPDesk\\View\\Resolver\\Resolver' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-view/src/Resolver/Resolver.php',
220
+ 'FcfVendor\\WPDesk\\View\\Resolver\\WPThemeResolver' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-view/src/Resolver/WPThemeResolver.php',
221
  'FcfVendor\\WPDesk_API_KEY' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-license/src/ApiManager/class-wc-key-api.php',
222
  'FcfVendor\\WPDesk_API_MENU' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-license/src/ApiManager/class-wc-api-manager-menu.php',
223
  'FcfVendor\\WPDesk_API_Manager_With_Update_Flag' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-license/src/ApiManager/class-wc-api-manager.php',
291
  'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/DummyTest.php',
292
  'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
293
  'Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php',
294
+ 'WPDesk\\FCF\\Free\\Admin\\NoticeReview' => __DIR__ . '/../..' . '/src/Admin/NoticeReview.php',
295
+ 'WPDesk\\FCF\\Free\\Helpers\\Shortener' => __DIR__ . '/../..' . '/src/Helpers/Shortener.php',
296
  'WPDesk\\FCF\\Free\\Integration\\Field' => __DIR__ . '/../..' . '/src/Integration/Field.php',
297
  'WPDesk\\FCF\\Free\\Integration\\FieldInterface' => __DIR__ . '/../..' . '/src/Integration/FieldInterface.php',
298
  'WPDesk\\FCF\\Free\\Integration\\Fields' => __DIR__ . '/../..' . '/src/Integration/Fields.php',
318
  public static function getInitializer(ClassLoader $loader)
319
  {
320
  return \Closure::bind(function () use ($loader) {
321
+ $loader->prefixLengthsPsr4 = ComposerStaticInitfff51be9e85471ac3ff7f10b0880f813::$prefixLengthsPsr4;
322
+ $loader->prefixDirsPsr4 = ComposerStaticInitfff51be9e85471ac3ff7f10b0880f813::$prefixDirsPsr4;
323
+ $loader->classMap = ComposerStaticInitfff51be9e85471ac3ff7f10b0880f813::$classMap;
324
 
325
  }, null, ClassLoader::class);
326
  }
vendor_prefixed/wpdesk/wp-view/composer.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "wpdesk\/wp-view",
3
+ "authors": [
4
+ {
5
+ "name": "Krzysiek",
6
+ "email": "krzysiek@wpdesk.pl"
7
+ }
8
+ ],
9
+ "require": {
10
+ "php": ">=5.5"
11
+ },
12
+ "require-dev": {
13
+ "phpunit\/phpunit": "<7",
14
+ "wp-coding-standards\/wpcs": "^0.14.1",
15
+ "squizlabs\/php_codesniffer": "^3.0.2",
16
+ "mockery\/mockery": "*",
17
+ "10up\/wp_mock": "*",
18
+ "wimg\/php-compatibility": "^8"
19
+ },
20
+ "autoload": {
21
+ "psr-4": {
22
+ "FcfVendor\\WPDesk\\View\\": "src\/"
23
+ }
24
+ },
25
+ "autoload-dev": {},
26
+ "scripts": {
27
+ "phpcs": "phpcs",
28
+ "phpunit-unit": "phpunit --configuration phpunit-unit.xml --coverage-text --colors=never",
29
+ "phpunit-unit-fast": "phpunit --configuration phpunit-unit.xml --no-coverage",
30
+ "phpunit-integration": "phpunit --configuration phpunit-integration.xml --coverage-text --colors=never",
31
+ "phpunit-integration-fast": "phpunit --configuration phpunit-integration.xml --no-coverage"
32
+ }
33
+ }
vendor_prefixed/wpdesk/wp-view/src/PluginViewBuilder.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FcfVendor\WPDesk\View;
4
+
5
+ use FcfVendor\WPDesk\View\Renderer\SimplePhpRenderer;
6
+ use FcfVendor\WPDesk\View\Resolver\ChainResolver;
7
+ use FcfVendor\WPDesk\View\Resolver\DirResolver;
8
+ use FcfVendor\WPDesk\View\Resolver\WPThemeResolver;
9
+ /**
10
+ * Facilitates building of the default plugin renderer.
11
+ *
12
+ * @package WPDesk\View
13
+ */
14
+ class PluginViewBuilder
15
+ {
16
+ /** @var string */
17
+ private $plugin_dir;
18
+ /** @var string[] */
19
+ private $template_dirs;
20
+ /**
21
+ * @param string $plugin_dir Plugin directory path(absolute path)
22
+ * @param string|string[] $template_dir Directory or list of directories with templates to render
23
+ */
24
+ public function __construct($plugin_dir, $template_dir = 'templates')
25
+ {
26
+ $this->plugin_dir = $plugin_dir;
27
+ if (!\is_array($template_dir)) {
28
+ $this->template_dirs = [$template_dir];
29
+ } else {
30
+ $this->template_dirs = $template_dir;
31
+ }
32
+ }
33
+ /**
34
+ * Creates simple renderer that search for the templates in plugin dir and in theme/child dir.
35
+ *
36
+ * For example if your plugin dir is /plugin, template dir is /templates, theme is /theme, and a child theme is /child
37
+ * the templates will be loaded from(order is important):
38
+ * - /child/plugin/*.php
39
+ * - /theme/plugin/*.php
40
+ * - /plugin/templates/*.php
41
+ *
42
+ * @return SimplePhpRenderer
43
+ */
44
+ public function createSimpleRenderer()
45
+ {
46
+ $resolver = new \FcfVendor\WPDesk\View\Resolver\ChainResolver();
47
+ $resolver->appendResolver(new \FcfVendor\WPDesk\View\Resolver\WPThemeResolver(\basename($this->plugin_dir)));
48
+ foreach ($this->template_dirs as $dir) {
49
+ $dir = \trailingslashit($this->plugin_dir) . \trailingslashit($dir);
50
+ $resolver->appendResolver(new \FcfVendor\WPDesk\View\Resolver\DirResolver($dir));
51
+ }
52
+ return new \FcfVendor\WPDesk\View\Renderer\SimplePhpRenderer($resolver);
53
+ }
54
+ /**
55
+ * Load templates using simple renderer.
56
+ *
57
+ * @param string $name Name of the template
58
+ * @param string $path Additional path of the template ie. for path "path" the templates would be loaded from /plugin/templates/path/*.php
59
+ * @param array $args Arguments for templates to use
60
+ *
61
+ * @return string Rendered template.
62
+ */
63
+ public function loadTemplate($name, $path = '.', $args = array())
64
+ {
65
+ $renderer = $this->createSimpleRenderer();
66
+ return $renderer->render(\trailingslashit($path) . $name, $args);
67
+ }
68
+ }
vendor_prefixed/wpdesk/wp-view/src/Renderer/LoadTemplatePlugin.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FcfVendor\WPDesk\View\Renderer;
4
+
5
+ use FcfVendor\WPDesk\View\Resolver\Resolver;
6
+ /**
7
+ * Can render templates
8
+ */
9
+ class LoadTemplatePlugin implements \FcfVendor\WPDesk\View\Renderer\Renderer
10
+ {
11
+ private $plugin;
12
+ private $path;
13
+ public function __construct($plugin, $path = '')
14
+ {
15
+ $this->plugin = $plugin;
16
+ $this->path = $path;
17
+ }
18
+ public function set_resolver(\FcfVendor\WPDesk\View\Resolver\Resolver $resolver)
19
+ {
20
+ }
21
+ public function render($template, array $params = null)
22
+ {
23
+ return $this->plugin->load_template($template, $this->path, $params);
24
+ }
25
+ }
vendor_prefixed/wpdesk/wp-view/src/Renderer/Renderer.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FcfVendor\WPDesk\View\Renderer;
4
+
5
+ use FcfVendor\WPDesk\View\Resolver\Resolver;
6
+ /**
7
+ * Can render templates
8
+ */
9
+ interface Renderer
10
+ {
11
+ /**
12
+ * Set the resolver used to map a template name to a resource the renderer may consume.
13
+ *
14
+ * @param Resolver $resolver
15
+ */
16
+ public function set_resolver(\FcfVendor\WPDesk\View\Resolver\Resolver $resolver);
17
+ /**
18
+ * @param string $template
19
+ * @param array $params
20
+ *
21
+ * @return string
22
+ */
23
+ public function render($template, array $params = null);
24
+ }
vendor_prefixed/wpdesk/wp-view/src/Renderer/SimplePhpRenderer.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FcfVendor\WPDesk\View\Renderer;
4
+
5
+ use FcfVendor\WPDesk\View\Resolver\Resolver;
6
+ /**
7
+ * Can render templates
8
+ */
9
+ class SimplePhpRenderer implements \FcfVendor\WPDesk\View\Renderer\Renderer
10
+ {
11
+ /** @var Resolver */
12
+ private $resolver;
13
+ public function __construct(\FcfVendor\WPDesk\View\Resolver\Resolver $resolver)
14
+ {
15
+ $this->set_resolver($resolver);
16
+ }
17
+ /**
18
+ * @param Resolver $resolver
19
+ *
20
+ * @return void|Resolver
21
+ */
22
+ public function set_resolver(\FcfVendor\WPDesk\View\Resolver\Resolver $resolver)
23
+ {
24
+ $this->resolver = $resolver;
25
+ }
26
+ /**
27
+ * @param string $template
28
+ * @param array|null $params
29
+ *
30
+ * @return string
31
+ */
32
+ public function render($template, array $params = null)
33
+ {
34
+ if ($params !== null) {
35
+ \extract($params, \EXTR_SKIP);
36
+ }
37
+ \ob_start();
38
+ include $this->resolver->resolve($template . '.php');
39
+ return \ob_get_clean();
40
+ }
41
+ }
vendor_prefixed/wpdesk/wp-view/src/Resolver/ChainResolver.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FcfVendor\WPDesk\View\Resolver;
4
+
5
+ use FcfVendor\WPDesk\View\Renderer\Renderer;
6
+ use FcfVendor\WPDesk\View\Resolver\Exception\CanNotResolve;
7
+ /**
8
+ * Provide resolvers and this class can try them one after another
9
+ *
10
+ * @package WPDesk\View\Resolver
11
+ */
12
+ class ChainResolver implements \FcfVendor\WPDesk\View\Resolver\Resolver
13
+ {
14
+ /** @var Resolver[] */
15
+ private $resolvers;
16
+ /**
17
+ * Warning: function with variadic input. Input should be list of Resolver instances.
18
+ */
19
+ public function __construct()
20
+ {
21
+ $args = \func_get_args();
22
+ foreach ($args as $resolver) {
23
+ $this->appendResolver($resolver);
24
+ }
25
+ }
26
+ /**
27
+ * Append resolver to the end of the list
28
+ *
29
+ * @param Resolver $resolver
30
+ */
31
+ public function appendResolver($resolver)
32
+ {
33
+ $this->resolvers[] = $resolver;
34
+ }
35
+ /**
36
+ * Resolve name to full path
37
+ *
38
+ * @param string $name
39
+ * @param Renderer|null $renderer
40
+ *
41
+ * @return string
42
+ */
43
+ public function resolve($name, \FcfVendor\WPDesk\View\Renderer\Renderer $renderer = null)
44
+ {
45
+ foreach ($this->resolvers as $resolver) {
46
+ try {
47
+ return $resolver->resolve($name);
48
+ } catch (\FcfVendor\WPDesk\View\Resolver\Exception\CanNotResolve $e) {
49
+ // not interested
50
+ }
51
+ }
52
+ throw new \FcfVendor\WPDesk\View\Resolver\Exception\CanNotResolve("Cannot resolve {$name}");
53
+ }
54
+ }
vendor_prefixed/wpdesk/wp-view/src/Resolver/DirResolver.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FcfVendor\WPDesk\View\Resolver;
4
+
5
+ use FcfVendor\WPDesk\View\Renderer\Renderer;
6
+ use FcfVendor\WPDesk\View\Resolver\Exception\CanNotResolve;
7
+ /**
8
+ * Class should resolve name by serching in provided dir. If empty then current dir
9
+ *
10
+ * @package WPDesk\View\Resolver
11
+ */
12
+ class DirResolver implements \FcfVendor\WPDesk\View\Resolver\Resolver
13
+ {
14
+ /** @var string */
15
+ private $dir;
16
+ /**
17
+ * Base path for templates ie. subdir
18
+ *
19
+ * @param $dir
20
+ */
21
+ public function __construct($dir)
22
+ {
23
+ $this->dir = $dir;
24
+ }
25
+ /**
26
+ * Resolve name to full path
27
+ *
28
+ * @param string $name
29
+ * @param Renderer|null $renderer
30
+ *
31
+ * @return string
32
+ */
33
+ public function resolve($name, \FcfVendor\WPDesk\View\Renderer\Renderer $renderer = null)
34
+ {
35
+ $dir = \rtrim($this->dir, '/');
36
+ $fullName = $dir . '/' . $name;
37
+ if (\file_exists($fullName)) {
38
+ return $fullName;
39
+ }
40
+ throw new \FcfVendor\WPDesk\View\Resolver\Exception\CanNotResolve("Cannot resolve {$name}");
41
+ }
42
+ }
vendor_prefixed/wpdesk/wp-view/src/Resolver/Exception/CanNotResolve.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FcfVendor\WPDesk\View\Resolver\Exception;
4
+
5
+ class CanNotResolve extends \RuntimeException
6
+ {
7
+ }
vendor_prefixed/wpdesk/wp-view/src/Resolver/NullResolver.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FcfVendor\WPDesk\View\Resolver;
4
+
5
+ use FcfVendor\WPDesk\View\Renderer\Renderer;
6
+ use FcfVendor\WPDesk\View\Resolver\Exception\CanNotResolve;
7
+ /**
8
+ * This resolver never finds the file
9
+ *
10
+ * @package WPDesk\View\Resolver
11
+ */
12
+ class NullResolver implements \FcfVendor\WPDesk\View\Resolver\Resolver
13
+ {
14
+ public function resolve($name, \FcfVendor\WPDesk\View\Renderer\Renderer $renderer = null)
15
+ {
16
+ throw new \FcfVendor\WPDesk\View\Resolver\Exception\CanNotResolve("Null Cannot resolve");
17
+ }
18
+ }
vendor_prefixed/wpdesk/wp-view/src/Resolver/Resolver.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FcfVendor\WPDesk\View\Resolver;
4
+
5
+ use FcfVendor\WPDesk\View\Renderer\Renderer;
6
+ /**
7
+ * Can resolve template name to a file
8
+ */
9
+ interface Resolver
10
+ {
11
+ /**
12
+ * Resolve a template/pattern name to a resource the renderer can consume
13
+ *
14
+ * @param string $name
15
+ * @param null|Resolver $renderer
16
+ *
17
+ * @return string
18
+ */
19
+ public function resolve($name, \FcfVendor\WPDesk\View\Renderer\Renderer $renderer = null);
20
+ }
vendor_prefixed/wpdesk/wp-view/src/Resolver/WPThemeResolver.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FcfVendor\WPDesk\View\Resolver;
4
+
5
+ use FcfVendor\WPDesk\View\Renderer\Renderer;
6
+ use FcfVendor\WPDesk\View\Resolver\Exception\CanNotResolve;
7
+ /**
8
+ * Class should resolve name by standard wp theme resolve
9
+ *
10
+ * @package WPDesk\View\Resolver
11
+ */
12
+ class WPThemeResolver implements \FcfVendor\WPDesk\View\Resolver\Resolver
13
+ {
14
+ /** @var string */
15
+ private $template_base_path;
16
+ /**
17
+ * Base path for templates ie. subdir
18
+ *
19
+ * @param $template_base_path
20
+ */
21
+ public function __construct($template_base_path)
22
+ {
23
+ $this->template_base_path = $template_base_path;
24
+ }
25
+ /**
26
+ * Resolve name to full path
27
+ *
28
+ * @param string $name
29
+ * @param Renderer|null $renderer
30
+ *
31
+ * @return string
32
+ */
33
+ public function resolve($name, \FcfVendor\WPDesk\View\Renderer\Renderer $renderer = null)
34
+ {
35
+ $templateFile = \locate_template([\trailingslashit($this->template_base_path) . $name]);
36
+ if (!$templateFile) {
37
+ throw new \FcfVendor\WPDesk\View\Resolver\Exception\CanNotResolve("Cannot resolve {$name}");
38
+ }
39
+ return $templateFile;
40
+ }
41
+ }
views/settings-field-advanced.php CHANGED
@@ -1,8 +1,13 @@
1
- <?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?><div class="field-settings-tab-container field-settings-advanced" style="display:none;">
 
 
2
  <div>
3
  <?php
4
- $url = get_locale() === 'pl_PL' ? 'https://www.wpdesk.pl/sklep/woocommerce-checkout-fields/' : 'https://www.wpdesk.net/products/flexible-checkout-fields-pro-woocommerce/';
5
- echo sprintf( __( '%sGo PRO &rarr;%s to add conditional logic based on products/categories, fields and shipping method.' , 'flexible-checkout-fields' ), '<a href="' . $url . '?utm_source=flexible-checkout-fields-settings&utm_medium=link-advanced-tab&utm_campaign=settings-docs-link" target="_blank">', '</a>' );
 
 
 
6
  ?>
7
  </div>
8
  </div>
1
+ <?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
2
+
3
+ <div class="field-settings-tab-container field-settings-advanced" style="display:none;">
4
  <div>
5
  <?php
6
+ echo sprintf(
7
+ __( '%sGo PRO &rarr;%s to add conditional logic based on products/categories, fields and shipping method.' , 'flexible-checkout-fields' ),
8
+ '<a href="' . esc_url( apply_filters( 'flexible_checkout_fields/short_url', '#', 'fcf-settings-field-tab-advanced-upgrade' ) ) . '" target="_blank">',
9
+ '</a>'
10
+ );
11
  ?>
12
  </div>
13
  </div>
views/settings-field-pricing.php CHANGED
@@ -1,8 +1,13 @@
1
- <?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?><div class="field-settings-tab-container field-settings-pricing" style="display:none;">
 
 
2
  <div>
3
  <?php
4
- $url = get_locale() === 'pl_PL' ? 'https://www.wpdesk.pl/sklep/woocommerce-checkout-fields/' : 'https://www.wpdesk.net/products/flexible-checkout-fields-pro-woocommerce/';
5
- echo sprintf( __( '%sGo PRO &rarr;%s In this tab it is possible to add a fixed or percentage price to the field and set the tax on this price.' , 'flexible-checkout-fields' ), '<a href="' . $url . '?utm_source=flexible-checkout-fields-settings&utm_medium=link-pricing-tab&utm_campaign=settings-docs-link" target="_blank">', '</a>' );
 
 
 
6
  ?>
7
  </div>
8
  </div>
1
+ <?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
2
+
3
+ <div class="field-settings-tab-container field-settings-pricing" style="display:none;">
4
  <div>
5
  <?php
6
+ echo sprintf(
7
+ __( '%sGo PRO &rarr;%s In this tab it is possible to add a fixed or percentage price to the field and set the tax on this price.' , 'flexible-checkout-fields' ),
8
+ '<a href="' . esc_url( apply_filters( 'flexible_checkout_fields/short_url', '#', 'fcf-settings-field-tab-pricing-upgrade' ) ) . '" target="_blank">',
9
+ '</a>'
10
+ );
11
  ?>
12
  </div>
13
  </div>