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

Version Description

  • 2022-02-03 =
  • Added settings migration tool
  • Added support for WordPress 5.9
  • Added support for WooCommerce 6.1
Download this release

Release Info

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

Code changes from version 3.1.2 to 3.1.3

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: 3.1.2
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: 5.2
12
- Tested up to: 5.8
13
- WC requires at least: 5.6
14
- WC tested up to: 6.0
15
  Requires PHP: 7.0
16
 
17
  Copyright 2017 WP Desk Ltd.
@@ -39,7 +39,7 @@ if ( ! defined( 'ABSPATH' ) ) {
39
 
40
 
41
  /* THIS VARIABLE CAN BE CHANGED AUTOMATICALLY */
42
- $plugin_version = '3.1.2';
43
 
44
  /*
45
  * Update when conditions are met:
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: 3.1.3
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: 5.2
12
+ Tested up to: 5.9
13
+ WC requires at least: 5.7
14
+ WC tested up to: 6.1
15
  Requires PHP: 7.0
16
 
17
  Copyright 2017 WP Desk Ltd.
39
 
40
 
41
  /* THIS VARIABLE CAN BE CHANGED AUTOMATICALLY */
42
+ $plugin_version = '3.1.3';
43
 
44
  /*
45
  * Update when conditions are met:
lang/flexible-checkout-fields.pot CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the Flexible Checkout Fields plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Flexible Checkout Fields 3.1.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/flexible-checkout-fields\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2022-01-18T09:11:28+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: flexible-checkout-fields\n"
2
  # This file is distributed under the same license as the Flexible Checkout Fields plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Flexible Checkout Fields 3.1.3\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/flexible-checkout-fields\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2022-02-03T14:35:51+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: flexible-checkout-fields\n"
readme.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: wpdesk,dyszczo,grola,piotrpo,marcinkolanko,mateuszgbiorczyk,sebast
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
6
  Requires at least: 4.9
7
- Tested up to: 5.8
8
  Stable tag: trunk
9
  Requires PHP: 7.0
10
  License: GPLv3 or later
@@ -192,6 +192,11 @@ If you are upgrading from the old WooCommerce Checkout Fields version (1.1, wooc
192
 
193
  == Changelog ==
194
 
 
 
 
 
 
195
  = 3.1.2 - 2021-11-29 =
196
  * Fixed saving line breaks for textarea field
197
  * Added support for WooCommerce 6.0
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
6
  Requires at least: 4.9
7
+ Tested up to: 5.9
8
  Stable tag: trunk
9
  Requires PHP: 7.0
10
  License: GPLv3 or later
192
 
193
  == Changelog ==
194
 
195
+ = 3.1.3 - 2022-02-03 =
196
+ * Added settings migration tool
197
+ * Added support for WordPress 5.9
198
+ * Added support for WooCommerce 6.1
199
+
200
  = 3.1.2 - 2021-11-29 =
201
  * Fixed saving line breaks for textarea field
202
  * Added support for WooCommerce 6.0
src/Plugin.php CHANGED
@@ -70,6 +70,7 @@ class Plugin extends AbstractPlugin implements HookableCollection {
70
  ( new Settings\Forms() )->init();
71
  ( new Settings\Routes() )->init();
72
  ( new Settings\Tabs() )->init();
 
73
  }
74
 
75
  /**
70
  ( new Settings\Forms() )->init();
71
  ( new Settings\Routes() )->init();
72
  ( new Settings\Tabs() )->init();
73
+ $this->add_hookable( new Settings\MigrationsManager( $this->plugin_info->get_version() ) );
74
  }
75
 
76
  /**
src/Settings/Form/EditFieldsForm.php CHANGED
@@ -27,7 +27,7 @@ class EditFieldsForm extends FormAbstract implements FormInterface {
27
  $settings = get_option( self::SETTINGS_OPTION_NAME, [] );
28
  $section_fields = $this->combine_fields_settings(
29
  $this->get_section_form_data( $form_key ),
30
- $settings[ $form_key ] ?? []
31
  );
32
  if ( ! $section_fields ) {
33
  return $form_data;
27
  $settings = get_option( self::SETTINGS_OPTION_NAME, [] );
28
  $section_fields = $this->combine_fields_settings(
29
  $this->get_section_form_data( $form_key ),
30
+ ( $settings[ $form_key ] ?? [] ) ?: []
31
  );
32
  if ( ! $section_fields ) {
33
  return $form_data;
src/Settings/Migrations/Migration.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WPDesk\FCF\Free\Settings\Migrations;
4
+
5
+ interface Migration {
6
+
7
+ /**
8
+ * @return string
9
+ */
10
+ public function get_version(): string;
11
+
12
+ /**
13
+ * Performs migration operations.
14
+ *
15
+ * @return void
16
+ */
17
+ public function up();
18
+
19
+ /**
20
+ * Rolls back migration operations.
21
+ *
22
+ * @return void
23
+ */
24
+ public function down();
25
+ }
src/Settings/Migrations/Migration320.php ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WPDesk\FCF\Free\Settings\Migrations;
4
+
5
+ use WPDesk\FCF\Free\Field\Type\FileType;
6
+ use WPDesk\FCF\Free\Field\Type\Multiselect;
7
+ use WPDesk\FCF\Free\Field\Type\RadioType;
8
+ use WPDesk\FCF\Free\Field\Type\SelectType;
9
+ use WPDesk\FCF\Free\Settings\Form\EditFieldsForm;
10
+
11
+ class Migration320 implements Migration {
12
+
13
+ /**
14
+ * {@inheritdoc}
15
+ */
16
+ public function get_version(): string {
17
+ return '3.2.0';
18
+ }
19
+
20
+ /**
21
+ * {@inheritdoc}
22
+ */
23
+ public function up() {
24
+ $plugin_settings = get_option( EditFieldsForm::SETTINGS_OPTION_NAME, [] );
25
+
26
+ foreach ( $plugin_settings as $section_id => $section_fields ) {
27
+ foreach ( $section_fields as $field_id => $field_data ) {
28
+ switch ( $field_data['type'] ?? '' ) {
29
+ case RadioType::FIELD_TYPE:
30
+ case SelectType::FIELD_TYPE:
31
+ case Multiselect::FIELD_TYPE:
32
+ $field_data = $this->convert_option_string_to_options_array( $field_data );
33
+ break;
34
+ case FileType::FIELD_TYPE:
35
+ $field_data = $this->convert_extensions_to_mime_types( $field_data );
36
+ break;
37
+ }
38
+
39
+ $plugin_settings[ $section_id ][ $field_id ] = $field_data;
40
+ }
41
+ }
42
+
43
+ update_option( EditFieldsForm::SETTINGS_OPTION_NAME, $plugin_settings );
44
+ }
45
+
46
+ /**
47
+ * {@inheritdoc}
48
+ */
49
+ public function down() {
50
+ $plugin_settings = get_option( EditFieldsForm::SETTINGS_OPTION_NAME, [] );
51
+
52
+ foreach ( $plugin_settings as $section_id => $section_fields ) {
53
+ foreach ( $section_fields as $field_id => $field_data ) {
54
+ switch ( $field_data['type'] ?? '' ) {
55
+ case RadioType::FIELD_TYPE:
56
+ case SelectType::FIELD_TYPE:
57
+ case Multiselect::FIELD_TYPE:
58
+ $field_data = $this->convert_options_array_to_option_string( $field_data );
59
+ break;
60
+ case FileType::FIELD_TYPE:
61
+ $field_data = $this->convert_mime_types_to_extensions( $field_data );
62
+ break;
63
+ }
64
+
65
+ $plugin_settings[ $section_id ][ $field_id ] = $field_data;
66
+ }
67
+ }
68
+
69
+ update_option( EditFieldsForm::SETTINGS_OPTION_NAME, $plugin_settings );
70
+ }
71
+
72
+ /**
73
+ * Converts "value1 : Value 1\nvalue2 : Value 2" to array structure.
74
+ */
75
+ private function convert_option_string_to_options_array( array $field_data ): array {
76
+ if ( isset( $field_data['options'] ) ) {
77
+ return $field_data;
78
+ }
79
+
80
+ $options = explode( "\n", $field_data['option'] ?? '' );
81
+ $rows = [];
82
+ foreach ( $options as $option ) {
83
+ $values = explode( ':', $option );
84
+ if ( ! $values ) {
85
+ continue;
86
+ }
87
+
88
+ $rows[] = [
89
+ 'key' => trim( $values[0] ),
90
+ 'value' => trim( implode( ':', array_slice( $values, 1 ) ) ),
91
+ ];
92
+ }
93
+
94
+ $field_data['options'] = $rows;
95
+ if ( isset( $field_data['option'] ) ) {
96
+ unset( $field_data['option'] );
97
+ }
98
+
99
+ return $field_data;
100
+ }
101
+
102
+ /**
103
+ * Converts array structure to "value1 : Value 1\nvalue2 : Value 2".
104
+ */
105
+ private function convert_options_array_to_option_string( array $field_data ): array {
106
+ if ( isset( $field_data['option'] ) ) {
107
+ return $field_data;
108
+ }
109
+
110
+ $options = $field_data['options'] ?? [];
111
+ $rows = [];
112
+ foreach ( $options as $option ) {
113
+ $rows[] = sprintf( '%1$s : %2$s', $option['key'], $option['value'] );
114
+ }
115
+
116
+ $field_data['option'] = implode( "\n", $rows );
117
+ if ( isset( $field_data['options'] ) ) {
118
+ unset( $field_data['options'] );
119
+ }
120
+
121
+ return $field_data;
122
+ }
123
+
124
+ /**
125
+ * Converts "jpg,pdf" to "image/jpeg,application/pdf".
126
+ */
127
+ private function convert_extensions_to_mime_types( array $field_data ): array {
128
+ $values = array_map( 'trim', explode( ',', $field_data['file_types'] ?? '' ) );
129
+ $mime_types = wp_get_mime_types();
130
+ $mime_values = [];
131
+ foreach ( $mime_types as $mime_extensions => $mime_type ) {
132
+ foreach ( explode( '|', $mime_extensions ) as $mime_extension ) {
133
+ $mime_values[ $mime_extension ] = $mime_type;
134
+ }
135
+ }
136
+
137
+ $new_values = [];
138
+ foreach ( $values as $value ) {
139
+ if ( in_array( $value, $mime_values ) ) {
140
+ $new_values[] = $value;
141
+ } elseif ( isset( $mime_values[ $value ] ) ) {
142
+ $new_values[] = $mime_values[ $value ];
143
+ }
144
+ }
145
+
146
+ $field_data['file_types'] = implode( ',', array_unique( $new_values ) );
147
+ return $field_data;
148
+ }
149
+
150
+ /**
151
+ * Converts "image/jpeg,application/pdf" to "jpg,jpeg,jpe,pdf".
152
+ */
153
+ private function convert_mime_types_to_extensions( array $field_data ): array {
154
+ $values = array_map( 'trim', explode( ',', $field_data['file_types'] ?? '' ) );
155
+ $mime_types = wp_get_mime_types();
156
+ $mime_values = [];
157
+ foreach ( $mime_types as $mime_extensions => $mime_type ) {
158
+ $mime_values[ $mime_type ] = explode( '|', $mime_extensions );
159
+ }
160
+
161
+ $new_values = [];
162
+ foreach ( $values as $value ) {
163
+ if ( isset( $mime_values[ $value ] ) ) {
164
+ $new_values[] = implode( ',', $mime_values[ $value ] );
165
+ } else {
166
+ $new_values[] = $value;
167
+ }
168
+ }
169
+
170
+ $field_data['file_types'] = implode( ',', array_unique( $new_values ) );
171
+ return $field_data;
172
+ }
173
+ }
src/Settings/MigrationsManager.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WPDesk\FCF\Free\Settings;
4
+
5
+ use FcfVendor\WPDesk\PluginBuilder\Plugin\Hookable;
6
+ use WPDesk\FCF\Free\Settings\Migrations\Migration;
7
+ use WPDesk\FCF\Free\Settings\Migrations\Migration320;
8
+
9
+ class MigrationsManager implements Hookable {
10
+
11
+ const PLUGIN_MIGRATION_OPTION_KEY = 'fcf_migration_version';
12
+
13
+ /**
14
+ * @var string
15
+ */
16
+ private $plugin_version;
17
+
18
+ /**
19
+ * @var Migration[]
20
+ */
21
+ private $migrations = [];
22
+
23
+ public function __construct( string $plugin_version ) {
24
+ $this->plugin_version = $plugin_version;
25
+
26
+ $this->migrations[] = new Migration320();
27
+ }
28
+
29
+ /**
30
+ * {@inheritdoc}
31
+ */
32
+ public function hooks() {
33
+ add_action( 'init', [ $this, 'make_migrations' ] );
34
+ }
35
+
36
+ /**
37
+ * @return void
38
+ *
39
+ * @internal
40
+ */
41
+ public function make_migrations() {
42
+ $current_migration = get_option( self::PLUGIN_MIGRATION_OPTION_KEY, '1.0.0' );
43
+ if ( $current_migration === $this->plugin_version ) {
44
+ return;
45
+ }
46
+
47
+ foreach ( $this->migrations as $migration ) {
48
+ if ( $migration->get_version() > $this->plugin_version ) {
49
+ $migration->down();
50
+ } elseif ( $migration->get_version() > $current_migration ) {
51
+ $migration->up();
52
+ }
53
+ }
54
+
55
+ update_option( self::PLUGIN_MIGRATION_OPTION_KEY, $this->plugin_version );
56
+ }
57
+ }
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit608b64501c466b3002826cb900c23228::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit80d22af9fb097430b94704dbeb7f0839::getLoader();
vendor/composer/autoload_classmap.php CHANGED
@@ -114,10 +114,12 @@ return array(
114
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\LocalCodeceptionTrait' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/LocalCodeceptionTrait.php',
115
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareCodeceptionDb' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareCodeceptionDb.php',
116
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareLocalCodeceptionTests' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareLocalCodeceptionTests.php',
 
117
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareParallelCodeceptionTests' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareParallelCodeceptionTests.php',
118
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareWordpressForCodeception' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareWordpressForCodeception.php',
119
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\RunCodeceptionTests' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/RunCodeceptionTests.php',
120
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\RunLocalCodeceptionTests' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/RunLocalCodeceptionTests.php',
 
121
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\SedTrait' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/SedTrait.php',
122
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\SettingsException' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/SettingsException.php',
123
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Plugin' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Plugin.php',
@@ -345,6 +347,9 @@ return array(
345
  'WPDesk\\FCF\\Free\\Settings\\Form\\SettingsPageForm' => $baseDir . '/src/Settings/Form/SettingsPageForm.php',
346
  'WPDesk\\FCF\\Free\\Settings\\Forms' => $baseDir . '/src/Settings/Forms.php',
347
  'WPDesk\\FCF\\Free\\Settings\\Menu' => $baseDir . '/src/Settings/Menu.php',
 
 
 
348
  'WPDesk\\FCF\\Free\\Settings\\Option\\CssOption' => $baseDir . '/src/Settings/Option/CssOption.php',
349
  'WPDesk\\FCF\\Free\\Settings\\Option\\CustomFieldDisabledOption' => $baseDir . '/src/Settings/Option/CustomFieldDisabledOption.php',
350
  'WPDesk\\FCF\\Free\\Settings\\Option\\CustomFieldOption' => $baseDir . '/src/Settings/Option/CustomFieldOption.php',
114
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\LocalCodeceptionTrait' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/LocalCodeceptionTrait.php',
115
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareCodeceptionDb' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareCodeceptionDb.php',
116
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareLocalCodeceptionTests' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareLocalCodeceptionTests.php',
117
+ 'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareLocalCodeceptionTestsWithCoverage' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareLocalCodeceptionTestsWithCoverage.php',
118
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareParallelCodeceptionTests' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareParallelCodeceptionTests.php',
119
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareWordpressForCodeception' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareWordpressForCodeception.php',
120
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\RunCodeceptionTests' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/RunCodeceptionTests.php',
121
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\RunLocalCodeceptionTests' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/RunLocalCodeceptionTests.php',
122
+ 'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\RunLocalCodeceptionTestsWithCoverage' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/RunLocalCodeceptionTestsWithCoverage.php',
123
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\SedTrait' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/SedTrait.php',
124
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\SettingsException' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/SettingsException.php',
125
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Plugin' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Plugin.php',
347
  'WPDesk\\FCF\\Free\\Settings\\Form\\SettingsPageForm' => $baseDir . '/src/Settings/Form/SettingsPageForm.php',
348
  'WPDesk\\FCF\\Free\\Settings\\Forms' => $baseDir . '/src/Settings/Forms.php',
349
  'WPDesk\\FCF\\Free\\Settings\\Menu' => $baseDir . '/src/Settings/Menu.php',
350
+ 'WPDesk\\FCF\\Free\\Settings\\MigrationsManager' => $baseDir . '/src/Settings/MigrationsManager.php',
351
+ 'WPDesk\\FCF\\Free\\Settings\\Migrations\\Migration' => $baseDir . '/src/Settings/Migrations/Migration.php',
352
+ 'WPDesk\\FCF\\Free\\Settings\\Migrations\\Migration320' => $baseDir . '/src/Settings/Migrations/Migration320.php',
353
  'WPDesk\\FCF\\Free\\Settings\\Option\\CssOption' => $baseDir . '/src/Settings/Option/CssOption.php',
354
  'WPDesk\\FCF\\Free\\Settings\\Option\\CustomFieldDisabledOption' => $baseDir . '/src/Settings/Option/CustomFieldDisabledOption.php',
355
  'WPDesk\\FCF\\Free\\Settings\\Option\\CustomFieldOption' => $baseDir . '/src/Settings/Option/CustomFieldOption.php',
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit608b64501c466b3002826cb900c23228
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit608b64501c466b3002826cb900c23228
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInit608b64501c466b3002826cb900c23228', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
- spl_autoload_unregister(array('ComposerAutoloaderInit608b64501c466b3002826cb900c23228', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Composer\Autoload\ComposerStaticInit608b64501c466b3002826cb900c23228::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit80d22af9fb097430b94704dbeb7f0839
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInit80d22af9fb097430b94704dbeb7f0839', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
+ spl_autoload_unregister(array('ComposerAutoloaderInit80d22af9fb097430b94704dbeb7f0839', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
+ call_user_func(\Composer\Autoload\ComposerStaticInit80d22af9fb097430b94704dbeb7f0839::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit608b64501c466b3002826cb900c23228
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'W' =>
@@ -137,10 +137,12 @@ class ComposerStaticInit608b64501c466b3002826cb900c23228
137
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\LocalCodeceptionTrait' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/LocalCodeceptionTrait.php',
138
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareCodeceptionDb' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareCodeceptionDb.php',
139
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareLocalCodeceptionTests' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareLocalCodeceptionTests.php',
 
140
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareParallelCodeceptionTests' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareParallelCodeceptionTests.php',
141
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareWordpressForCodeception' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareWordpressForCodeception.php',
142
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\RunCodeceptionTests' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/RunCodeceptionTests.php',
143
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\RunLocalCodeceptionTests' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/RunLocalCodeceptionTests.php',
 
144
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\SedTrait' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/SedTrait.php',
145
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\SettingsException' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/SettingsException.php',
146
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Plugin' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Plugin.php',
@@ -368,6 +370,9 @@ class ComposerStaticInit608b64501c466b3002826cb900c23228
368
  'WPDesk\\FCF\\Free\\Settings\\Form\\SettingsPageForm' => __DIR__ . '/../..' . '/src/Settings/Form/SettingsPageForm.php',
369
  'WPDesk\\FCF\\Free\\Settings\\Forms' => __DIR__ . '/../..' . '/src/Settings/Forms.php',
370
  'WPDesk\\FCF\\Free\\Settings\\Menu' => __DIR__ . '/../..' . '/src/Settings/Menu.php',
 
 
 
371
  'WPDesk\\FCF\\Free\\Settings\\Option\\CssOption' => __DIR__ . '/../..' . '/src/Settings/Option/CssOption.php',
372
  'WPDesk\\FCF\\Free\\Settings\\Option\\CustomFieldDisabledOption' => __DIR__ . '/../..' . '/src/Settings/Option/CustomFieldDisabledOption.php',
373
  'WPDesk\\FCF\\Free\\Settings\\Option\\CustomFieldOption' => __DIR__ . '/../..' . '/src/Settings/Option/CustomFieldOption.php',
@@ -437,9 +442,9 @@ class ComposerStaticInit608b64501c466b3002826cb900c23228
437
  public static function getInitializer(ClassLoader $loader)
438
  {
439
  return \Closure::bind(function () use ($loader) {
440
- $loader->prefixLengthsPsr4 = ComposerStaticInit608b64501c466b3002826cb900c23228::$prefixLengthsPsr4;
441
- $loader->prefixDirsPsr4 = ComposerStaticInit608b64501c466b3002826cb900c23228::$prefixDirsPsr4;
442
- $loader->classMap = ComposerStaticInit608b64501c466b3002826cb900c23228::$classMap;
443
 
444
  }, null, ClassLoader::class);
445
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit80d22af9fb097430b94704dbeb7f0839
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'W' =>
137
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\LocalCodeceptionTrait' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/LocalCodeceptionTrait.php',
138
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareCodeceptionDb' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareCodeceptionDb.php',
139
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareLocalCodeceptionTests' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareLocalCodeceptionTests.php',
140
+ 'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareLocalCodeceptionTestsWithCoverage' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareLocalCodeceptionTestsWithCoverage.php',
141
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareParallelCodeceptionTests' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareParallelCodeceptionTests.php',
142
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\PrepareWordpressForCodeception' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareWordpressForCodeception.php',
143
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\RunCodeceptionTests' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/RunCodeceptionTests.php',
144
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\RunLocalCodeceptionTests' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/RunLocalCodeceptionTests.php',
145
+ 'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\RunLocalCodeceptionTestsWithCoverage' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/RunLocalCodeceptionTestsWithCoverage.php',
146
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\SedTrait' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/SedTrait.php',
147
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Commands\\SettingsException' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/SettingsException.php',
148
  'FcfVendor\\WPDesk\\Composer\\Codeception\\Plugin' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Plugin.php',
370
  'WPDesk\\FCF\\Free\\Settings\\Form\\SettingsPageForm' => __DIR__ . '/../..' . '/src/Settings/Form/SettingsPageForm.php',
371
  'WPDesk\\FCF\\Free\\Settings\\Forms' => __DIR__ . '/../..' . '/src/Settings/Forms.php',
372
  'WPDesk\\FCF\\Free\\Settings\\Menu' => __DIR__ . '/../..' . '/src/Settings/Menu.php',
373
+ 'WPDesk\\FCF\\Free\\Settings\\MigrationsManager' => __DIR__ . '/../..' . '/src/Settings/MigrationsManager.php',
374
+ 'WPDesk\\FCF\\Free\\Settings\\Migrations\\Migration' => __DIR__ . '/../..' . '/src/Settings/Migrations/Migration.php',
375
+ 'WPDesk\\FCF\\Free\\Settings\\Migrations\\Migration320' => __DIR__ . '/../..' . '/src/Settings/Migrations/Migration320.php',
376
  'WPDesk\\FCF\\Free\\Settings\\Option\\CssOption' => __DIR__ . '/../..' . '/src/Settings/Option/CssOption.php',
377
  'WPDesk\\FCF\\Free\\Settings\\Option\\CustomFieldDisabledOption' => __DIR__ . '/../..' . '/src/Settings/Option/CustomFieldDisabledOption.php',
378
  'WPDesk\\FCF\\Free\\Settings\\Option\\CustomFieldOption' => __DIR__ . '/../..' . '/src/Settings/Option/CustomFieldOption.php',
442
  public static function getInitializer(ClassLoader $loader)
443
  {
444
  return \Closure::bind(function () use ($loader) {
445
+ $loader->prefixLengthsPsr4 = ComposerStaticInit80d22af9fb097430b94704dbeb7f0839::$prefixLengthsPsr4;
446
+ $loader->prefixDirsPsr4 = ComposerStaticInit80d22af9fb097430b94704dbeb7f0839::$prefixDirsPsr4;
447
+ $loader->classMap = ComposerStaticInit80d22af9fb097430b94704dbeb7f0839::$classMap;
448
 
449
  }, null, ClassLoader::class);
450
  }
vendor_prefixed/wpdesk/wp-codeception/composer.json CHANGED
@@ -16,34 +16,32 @@
16
  "email": "grola@wpdesk.net"
17
  }
18
  ],
 
 
 
 
 
 
19
  "require": {
20
- "php": ">=7.0",
21
  "ext-json": "*",
22
  "composer-plugin-api": "^1.1|^2",
23
- "codeception\/module-db": "^1.0",
 
24
  "codeception\/module-cli": "^1.0",
25
- "codeception\/module-webdriver": "^1.0",
26
- "lucatume\/wp-browser": "^2.4",
27
  "codeception\/module-filesystem": "^1.0",
28
- "codeception\/module-rest": "^1.2",
29
  "codeception\/module-phpbrowser": "^1.0",
30
- "codeception\/module-asserts": "^1.1",
 
31
  "codeception\/util-universalframework": "^1.0",
32
- "vlucas\/phpdotenv": "^4.2.0",
33
- "albertofem\/rsync-lib": "^1.0",
34
- "wp-cli\/wp-cli-bundle": "^2.4",
35
- "symfony\/yaml": "^v3.4.47",
36
  "lucatume\/codeception-steppify": "^1.0",
 
 
 
 
37
  "wp-cli\/admin-command": "^2.0",
38
- "bordoni\/phpass": "^0.3.5"
39
- },
40
- "require-dev": {
41
- "phpunit\/phpunit": "<7",
42
- "wp-coding-standards\/wpcs": "^0.14.1",
43
- "squizlabs\/php_codesniffer": "^3.0.2",
44
- "mockery\/mockery": "*",
45
- "10up\/wp_mock": "*",
46
- "wimg\/php-compatibility": "^8"
47
  },
48
  "autoload": {
49
  "psr-4": {
16
  "email": "grola@wpdesk.net"
17
  }
18
  ],
19
+ "config": {
20
+ "sort-packages": true,
21
+ "platform": {
22
+ "php": "7.0.8"
23
+ }
24
+ },
25
  "require": {
26
+ "php": ">=7.0.8",
27
  "ext-json": "*",
28
  "composer-plugin-api": "^1.1|^2",
29
+ "albertofem\/rsync-lib": "^1.0",
30
+ "bordoni\/phpass": "^0.3.5",
31
  "codeception\/module-cli": "^1.0",
32
+ "codeception\/module-db": "^1.0",
 
33
  "codeception\/module-filesystem": "^1.0",
 
34
  "codeception\/module-phpbrowser": "^1.0",
35
+ "codeception\/module-rest": "^1.2",
36
+ "codeception\/module-webdriver": "^1.0",
37
  "codeception\/util-universalframework": "^1.0",
 
 
 
 
38
  "lucatume\/codeception-steppify": "^1.0",
39
+ "lucatume\/wp-browser": "^2.4",
40
+ "phpunit\/php-code-coverage": "^5.3",
41
+ "symfony\/yaml": "^v3.4.47",
42
+ "vlucas\/phpdotenv": "^4.2.0",
43
  "wp-cli\/admin-command": "^2.0",
44
+ "wp-cli\/wp-cli-bundle": "^2.4"
 
 
 
 
 
 
 
 
45
  },
46
  "autoload": {
47
  "psr-4": {
vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/CommandProvider.php CHANGED
@@ -5,10 +5,12 @@ namespace FcfVendor\WPDesk\Composer\Codeception;
5
  use FcfVendor\WPDesk\Composer\Codeception\Commands\CreateCodeceptionTests;
6
  use FcfVendor\WPDesk\Composer\Codeception\Commands\PrepareCodeceptionDb;
7
  use FcfVendor\WPDesk\Composer\Codeception\Commands\PrepareLocalCodeceptionTests;
 
8
  use FcfVendor\WPDesk\Composer\Codeception\Commands\PrepareParallelCodeceptionTests;
9
  use FcfVendor\WPDesk\Composer\Codeception\Commands\PrepareWordpressForCodeception;
10
  use FcfVendor\WPDesk\Composer\Codeception\Commands\RunCodeceptionTests;
11
  use FcfVendor\WPDesk\Composer\Codeception\Commands\RunLocalCodeceptionTests;
 
12
  /**
13
  * Links plugin commands handlers to composer.
14
  */
@@ -16,6 +18,6 @@ class CommandProvider implements \FcfVendor\Composer\Plugin\Capability\CommandPr
16
  {
17
  public function getCommands()
18
  {
19
- return [new \FcfVendor\WPDesk\Composer\Codeception\Commands\CreateCodeceptionTests(), new \FcfVendor\WPDesk\Composer\Codeception\Commands\RunCodeceptionTests(), new \FcfVendor\WPDesk\Composer\Codeception\Commands\RunLocalCodeceptionTests(), new \FcfVendor\WPDesk\Composer\Codeception\Commands\PrepareCodeceptionDb(), new \FcfVendor\WPDesk\Composer\Codeception\Commands\PrepareWordpressForCodeception(), new \FcfVendor\WPDesk\Composer\Codeception\Commands\PrepareLocalCodeceptionTests(), new \FcfVendor\WPDesk\Composer\Codeception\Commands\PrepareParallelCodeceptionTests()];
20
  }
21
  }
5
  use FcfVendor\WPDesk\Composer\Codeception\Commands\CreateCodeceptionTests;
6
  use FcfVendor\WPDesk\Composer\Codeception\Commands\PrepareCodeceptionDb;
7
  use FcfVendor\WPDesk\Composer\Codeception\Commands\PrepareLocalCodeceptionTests;
8
+ use FcfVendor\WPDesk\Composer\Codeception\Commands\PrepareLocalCodeceptionTestsWithCoverage;
9
  use FcfVendor\WPDesk\Composer\Codeception\Commands\PrepareParallelCodeceptionTests;
10
  use FcfVendor\WPDesk\Composer\Codeception\Commands\PrepareWordpressForCodeception;
11
  use FcfVendor\WPDesk\Composer\Codeception\Commands\RunCodeceptionTests;
12
  use FcfVendor\WPDesk\Composer\Codeception\Commands\RunLocalCodeceptionTests;
13
+ use FcfVendor\WPDesk\Composer\Codeception\Commands\RunLocalCodeceptionTestsWithCoverage;
14
  /**
15
  * Links plugin commands handlers to composer.
16
  */
18
  {
19
  public function getCommands()
20
  {
21
+ return [new \FcfVendor\WPDesk\Composer\Codeception\Commands\CreateCodeceptionTests(), new \FcfVendor\WPDesk\Composer\Codeception\Commands\RunCodeceptionTests(), new \FcfVendor\WPDesk\Composer\Codeception\Commands\RunLocalCodeceptionTests(), new \FcfVendor\WPDesk\Composer\Codeception\Commands\RunLocalCodeceptionTestsWithCoverage(), new \FcfVendor\WPDesk\Composer\Codeception\Commands\PrepareCodeceptionDb(), new \FcfVendor\WPDesk\Composer\Codeception\Commands\PrepareWordpressForCodeception(), new \FcfVendor\WPDesk\Composer\Codeception\Commands\PrepareLocalCodeceptionTests(), new \FcfVendor\WPDesk\Composer\Codeception\Commands\PrepareLocalCodeceptionTestsWithCoverage(), new \FcfVendor\WPDesk\Composer\Codeception\Commands\PrepareParallelCodeceptionTests()];
22
  }
23
  }
vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/LocalCodeceptionTrait.php CHANGED
@@ -2,6 +2,8 @@
2
 
3
  namespace FcfVendor\WPDesk\Composer\Codeception\Commands;
4
 
 
 
5
  use FcfVendor\Symfony\Component\Console\Output\OutputInterface;
6
  use FcfVendor\Symfony\Component\Yaml\Exception\ParseException;
7
  use FcfVendor\Symfony\Component\Yaml\Yaml;
@@ -28,11 +30,12 @@ trait LocalCodeceptionTrait
28
  $apache_document_root = $configuration->getApacheDocumentRoot();
29
  $this->executeWpCliAndOutput('config set WP_DEBUG true --raw', $output, $apache_document_root);
30
  $this->executeWpCliAndOutput('config set WP_DEBUG_LOG true --raw', $output, $apache_document_root);
31
- $this->executeWpCliAndOutput('config set WP_DEBUG_DISPLAY true --raw', $output, $apache_document_root);
32
  $this->executeWpCliAndOutput('config set WP_HOME http://' . $configuration->getWptestsIp(), $output, $apache_document_root);
33
  $this->executeWpCliAndOutput('config set WP_SITEURL http://' . $configuration->getWptestsIp(), $output, $apache_document_root);
34
  $this->executeWpCliAndOutput('config set WP_AUTO_UPDATE_CORE false --raw', $output, $apache_document_root);
35
  $this->executeWpCliAndOutput('config set AUTOMATIC_UPDATER_DISABLED false --raw', $output, $apache_document_root);
 
36
  }
37
  /**
38
  * @param OutputInterface $output
@@ -96,14 +99,21 @@ trait LocalCodeceptionTrait
96
  * @param string $plugin_dir
97
  * @param OutputInterface $output
98
  * @param Configuration $configuration
 
99
  */
100
- private function installPlugin($plugin_dir, \FcfVendor\Symfony\Component\Console\Output\OutputInterface $output, \FcfVendor\WPDesk\Composer\Codeception\Commands\Configuration $configuration)
101
  {
102
  $source = $this->preparePathForRsync(\getcwd() . '/*', $configuration::isWindows());
103
  $target = $this->preparePathForRsync($this->prepareTargetDir($plugin_dir, $configuration) . '/', $configuration::isWindows());
104
- $rsync = 'rsync -a ' . $source . ' ' . $target . ' --exclude=node_modules --exclude=.git --exclude=tests --exclude=.idea --exclude=vendor';
105
  $this->execAndOutput($rsync, $output);
106
- $this->execAndOutput('composer install --no-dev --working-dir=' . $configuration->getApacheDocumentRoot() . '/wp-content/plugins/' . $plugin_dir, $output);
 
 
 
 
 
 
107
  }
108
  /**
109
  * @param string $path
@@ -210,4 +220,37 @@ trait LocalCodeceptionTrait
210
  $dimensions = $dimensions ? $dimensions : '{"width":"' . $price . '","length":"' . $price . '","height":"' . $price . '"}';
211
  return "wc product create --name=\"{$product_name}\" --virtual=false --downloadable=false --type=simple --sku={$sku} --regular_price={$price} --weight={$weight} --dimensions='{$dimensions}' --user=admin";
212
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  }
2
 
3
  namespace FcfVendor\WPDesk\Composer\Codeception\Commands;
4
 
5
+ use FcfVendor\Composer\Downloader\FilesystemException;
6
+ use FcfVendor\Symfony\Component\Console\Input\InputInterface;
7
  use FcfVendor\Symfony\Component\Console\Output\OutputInterface;
8
  use FcfVendor\Symfony\Component\Yaml\Exception\ParseException;
9
  use FcfVendor\Symfony\Component\Yaml\Yaml;
30
  $apache_document_root = $configuration->getApacheDocumentRoot();
31
  $this->executeWpCliAndOutput('config set WP_DEBUG true --raw', $output, $apache_document_root);
32
  $this->executeWpCliAndOutput('config set WP_DEBUG_LOG true --raw', $output, $apache_document_root);
33
+ $this->executeWpCliAndOutput('config set WP_DEBUG_DISPLAY false --raw', $output, $apache_document_root);
34
  $this->executeWpCliAndOutput('config set WP_HOME http://' . $configuration->getWptestsIp(), $output, $apache_document_root);
35
  $this->executeWpCliAndOutput('config set WP_SITEURL http://' . $configuration->getWptestsIp(), $output, $apache_document_root);
36
  $this->executeWpCliAndOutput('config set WP_AUTO_UPDATE_CORE false --raw', $output, $apache_document_root);
37
  $this->executeWpCliAndOutput('config set AUTOMATIC_UPDATER_DISABLED false --raw', $output, $apache_document_root);
38
+ $this->executeWpCliAndOutput('rewrite structure \'/%postname%/\'', $output, $apache_document_root);
39
  }
40
  /**
41
  * @param OutputInterface $output
99
  * @param string $plugin_dir
100
  * @param OutputInterface $output
101
  * @param Configuration $configuration
102
+ * @param bool $coverage
103
  */
104
+ private function installPlugin(string $plugin_dir, \FcfVendor\Symfony\Component\Console\Output\OutputInterface $output, \FcfVendor\WPDesk\Composer\Codeception\Commands\Configuration $configuration, bool $coverage = \true)
105
  {
106
  $source = $this->preparePathForRsync(\getcwd() . '/*', $configuration::isWindows());
107
  $target = $this->preparePathForRsync($this->prepareTargetDir($plugin_dir, $configuration) . '/', $configuration::isWindows());
108
+ $rsync = 'rsync -av ' . $source . ' ' . $target . ' --exclude=node_modules --exclude=.git --exclude=.idea --exclude=vendor --exclude=vendor_prefixed --exclude=tests/wordpress ';
109
  $this->execAndOutput($rsync, $output);
110
+ \copy(\getcwd() . '/.env.testing', $this->prepareTargetDir($plugin_dir, $configuration) . '/.env.testing');
111
+ if (!$coverage) {
112
+ $this->execAndOutput('composer install --working-dir=' . $configuration->getApacheDocumentRoot() . '/wp-content/plugins/' . $plugin_dir, $output);
113
+ $this->execAndOutput('composer install --no-dev --working-dir=' . $configuration->getApacheDocumentRoot() . '/wp-content/plugins/' . $plugin_dir, $output);
114
+ } else {
115
+ $this->execAndOutput('composer require --dev codeception/c3 --working-dir=' . $configuration->getApacheDocumentRoot() . '/wp-content/plugins/' . $plugin_dir, $output);
116
+ }
117
  }
118
  /**
119
  * @param string $path
220
  $dimensions = $dimensions ? $dimensions : '{"width":"' . $price . '","length":"' . $price . '","height":"' . $price . '"}';
221
  return "wc product create --name=\"{$product_name}\" --virtual=false --downloadable=false --type=simple --sku={$sku} --regular_price={$price} --weight={$weight} --dimensions='{$dimensions}' --user=admin";
222
  }
223
+ /**
224
+ * @param InputInterface $input
225
+ * @param OutputInterface $output
226
+ * @param bool $coverage
227
+ *
228
+ * @throws \Composer\Downloader\FilesystemException
229
+ */
230
+ private function prepareLocalCodeceptionTests(\FcfVendor\Symfony\Component\Console\Input\InputInterface $input, \FcfVendor\Symfony\Component\Console\Output\OutputInterface $output, bool $coverage = \false)
231
+ {
232
+ $configuration = $this->getWpDeskConfiguration();
233
+ $this->installPlugin($configuration->getPluginDir(), $output, $configuration, $coverage);
234
+ $this->activatePlugins($output, $configuration);
235
+ $this->prepareWpConfig($output, $configuration);
236
+ $this->copyThemeFiles($configuration->getThemeFiles(), $configuration->getApacheDocumentRoot() . '/wp-content/themes/storefront-wpdesk-tests');
237
+ $sep = \DIRECTORY_SEPARATOR;
238
+ $codecept = "vendor{$sep}bin{$sep}codecept";
239
+ $cleanOutput = $codecept . ' clean';
240
+ $this->execAndOutput($cleanOutput, $output);
241
+ }
242
+ /**
243
+ * @param array $theme_files
244
+ * @param $theme_folder
245
+ *
246
+ * @throws FilesystemException
247
+ */
248
+ private function copyThemeFiles(array $theme_files, $theme_folder)
249
+ {
250
+ foreach ($theme_files as $theme_file) {
251
+ if (!\copy($theme_file, $this->trailingslashit($theme_folder) . \basename($theme_file))) {
252
+ throw new \FcfVendor\Composer\Downloader\FilesystemException('Error copying theme file: ' . $theme_file);
253
+ }
254
+ }
255
+ }
256
  }
vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareLocalCodeceptionTests.php CHANGED
@@ -33,15 +33,7 @@ class PrepareLocalCodeceptionTests extends \FcfVendor\WPDesk\Composer\Codeceptio
33
  */
34
  protected function execute(\FcfVendor\Symfony\Component\Console\Input\InputInterface $input, \FcfVendor\Symfony\Component\Console\Output\OutputInterface $output)
35
  {
36
- $configuration = $this->getWpDeskConfiguration();
37
- $this->installPlugin($configuration->getPluginDir(), $output, $configuration);
38
- $this->activatePlugins($output, $configuration);
39
- $this->prepareWpConfig($output, $configuration);
40
- $this->copyThemeFiles($configuration->getThemeFiles(), $configuration->getApacheDocumentRoot() . '/wp-content/themes/storefront-wpdesk-tests');
41
- $sep = \DIRECTORY_SEPARATOR;
42
- $codecept = "vendor{$sep}bin{$sep}codecept";
43
- $cleanOutput = $codecept . ' clean';
44
- $this->execAndOutput($cleanOutput, $output);
45
  }
46
  /**
47
  * @param array $theme_files
33
  */
34
  protected function execute(\FcfVendor\Symfony\Component\Console\Input\InputInterface $input, \FcfVendor\Symfony\Component\Console\Output\OutputInterface $output)
35
  {
36
+ $this->prepareLocalCodeceptionTests($input, $output, \false);
 
 
 
 
 
 
 
 
37
  }
38
  /**
39
  * @param array $theme_files
vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/PrepareLocalCodeceptionTestsWithCoverage.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FcfVendor\WPDesk\Composer\Codeception\Commands;
4
+
5
+ use FcfVendor\Composer\Downloader\FilesystemException;
6
+ use FcfVendor\Symfony\Component\Console\Input\InputArgument;
7
+ use FcfVendor\Symfony\Component\Console\Input\InputInterface;
8
+ use FcfVendor\Symfony\Component\Console\Output\OutputInterface;
9
+ use FcfVendor\Symfony\Component\Yaml\Exception\ParseException;
10
+ use FcfVendor\Symfony\Component\Yaml\Yaml;
11
+ /**
12
+ * Codeception tests run command.
13
+ *
14
+ * @package WPDesk\Composer\Codeception\Commands
15
+ */
16
+ class PrepareLocalCodeceptionTestsWithCoverage extends \FcfVendor\WPDesk\Composer\Codeception\Commands\RunCodeceptionTests
17
+ {
18
+ use LocalCodeceptionTrait;
19
+ /**
20
+ * Configure command.
21
+ */
22
+ protected function configure()
23
+ {
24
+ parent::configure();
25
+ $this->setName('prepare-local-codeception-tests-with-coverage')->setDescription('Prepare local codeception tests.');
26
+ }
27
+ /**
28
+ * Execute command.
29
+ *
30
+ * @param InputInterface $input
31
+ * @param OutputInterface $output
32
+ * @return void
33
+ */
34
+ protected function execute(\FcfVendor\Symfony\Component\Console\Input\InputInterface $input, \FcfVendor\Symfony\Component\Console\Output\OutputInterface $output)
35
+ {
36
+ $this->prepareLocalCodeceptionTests($input, $output, \true);
37
+ $configuration = $this->getWpDeskConfiguration();
38
+ $plugin_file = $configuration->getApacheDocumentRoot() . '/wp-content/plugins/' . $configuration->getPluginFile();
39
+ \file_put_contents($plugin_file, "\ndefine('C3_CODECOVERAGE_ERROR_LOG_FILE', '/tmp/c3_error.log'); include __DIR__ . '/c3.php';", \FILE_APPEND);
40
+ }
41
+ }
vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/RunLocalCodeceptionTestsWithCoverage.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace FcfVendor\WPDesk\Composer\Codeception\Commands;
4
+
5
+ use FcfVendor\Symfony\Component\Console\Input\InputArgument;
6
+ use FcfVendor\Symfony\Component\Console\Input\InputInterface;
7
+ use FcfVendor\Symfony\Component\Console\Output\OutputInterface;
8
+ use FcfVendor\Symfony\Component\Yaml\Exception\ParseException;
9
+ use FcfVendor\Symfony\Component\Yaml\Yaml;
10
+ /**
11
+ * Codeception tests run command.
12
+ *
13
+ * @package WPDesk\Composer\Codeception\Commands
14
+ */
15
+ class RunLocalCodeceptionTestsWithCoverage extends \FcfVendor\WPDesk\Composer\Codeception\Commands\RunCodeceptionTests
16
+ {
17
+ use LocalCodeceptionTrait;
18
+ /**
19
+ * Configure command.
20
+ */
21
+ protected function configure()
22
+ {
23
+ parent::configure();
24
+ $this->setName('run-local-codeception-tests-with-coverage')->setDescription('Run local codeception tests.')->setDefinition(array(new \FcfVendor\Symfony\Component\Console\Input\InputArgument(self::SINGLE, \FcfVendor\Symfony\Component\Console\Input\InputArgument::OPTIONAL, 'Name of Single test to run.', ' ')));
25
+ }
26
+ /**
27
+ * Execute command.
28
+ *
29
+ * @param InputInterface $input
30
+ * @param OutputInterface $output
31
+ * @return void
32
+ */
33
+ protected function execute(\FcfVendor\Symfony\Component\Console\Input\InputInterface $input, \FcfVendor\Symfony\Component\Console\Output\OutputInterface $output)
34
+ {
35
+ $configuration = $this->getWpDeskConfiguration();
36
+ $this->prepareWpConfig($output, $configuration);
37
+ $singleTest = $input->getArgument(self::SINGLE);
38
+ $sep = \DIRECTORY_SEPARATOR;
39
+ $codecept = "vendor{$sep}bin{$sep}codecept";
40
+ $cleanOutput = $codecept . ' clean';
41
+ $this->execAndOutput($cleanOutput, $output);
42
+ $runLocalTests = $codecept . ' run -f --steps --html --coverage --coverage-xml --coverage-html --verbose acceptance ' . $singleTest;
43
+ $this->execAndOutput($runLocalTests, $output);
44
+ }
45
+ }