Completed
Push — develop ( 73c132...baaab2 )
by David
03:02
created

Wordlift_Admin_Setup::admin_notices()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 17
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 9
nc 2
nop 0
dl 0
loc 17
rs 9.4285
c 0
b 0
f 0
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 29 and the first side effect is on line 16.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
/**
3
 * Admin UI: Wordlift_Admin_Install_Wizard
4
 *
5
 * The {@link Wordlift_Admin_Install_Wizard} class handles WL's installation wizard by checking whether WL is configured
6
 * and, if not, displays a notice with a link to the configuration wizard.
7
 *
8
 * @link       https://wordlift.io
9
 *
10
 * @package    Wordlift
11
 * @subpackage Wordlift/admin
12
 * @since      3.9.0
13
 */
14
15
if ( ! defined( 'ABSPATH' ) ) {
16
	exit;
17
}
18
19
/**
20
 * The install wizard.
21
 *
22
 * Methods to track and implement the various steps of the install wizard
23
 * which is triggered on dirst install of the plugin (when there are no settings)
24
 *
25
 * @package    Wordlift
26
 * @subpackage Wordlift/admin
27
 * @author     WordLift <[email protected]>
28
 */
29
class Wordlift_Admin_Setup {
30
31
	/**
32
	 * A {@link Wordlift_Configuration_Service} instance.
33
	 *
34
	 * @since  3.9.0
35
	 * @access private
36
	 * @var Wordlift_Configuration_Service A {@link Wordlift_Configuration_Service} instance.
37
	 */
38
	private $configuration_service;
39
40
	/**
41
	 * A {@link Wordlift_Key_Validation_Service} instance.
42
	 *
43
	 * @since  3.9.0
44
	 * @access private
45
	 * @var Wordlift_Key_Validation_Service A {@link Wordlift_Key_Validation_Service} instance.
46
	 */
47
	private $key_validation_service;
48
49
	/**
50
	 * A {@link Wordlift_Entity_Service} instance.
51
	 *
52
	 * @since  3.9.0
53
	 * @access private
54
	 * @var Wordlift_Entity_Service $entity_service A {@link Wordlift_Entity_Service} instance.
55
	 */
56
	private $entity_service;
57
58
	/**
59
	 * Initialize the class and set its properties.
60
	 *
61
	 * @since    3.9.0
62
	 *
63
	 * @param Wordlift_Configuration_Service  $configuration_service  A {@link Wordlift_Configuration_Service} instance.
64
	 * @param Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance.
65
	 * @param Wordlift_Entity_Service         $entity_service         A {@link Wordlift_Entity_Service} instance.
66
	 */
67
	public function __construct( $configuration_service, $key_validation_service, $entity_service ) {
68
69
		// Set a reference to the configuration service.
70
		$this->configuration_service = $configuration_service;
71
72
		// Set a reference to the key validation service.
73
		$this->key_validation_service = $key_validation_service;
74
75
		// Set a reference to the entity service.
76
		$this->entity_service = $entity_service;
77
78
		// Hook to some WP's events:
79
		// When WP is loaded check whether the user decided to skip the set-up, i.e. don't show us even if WL is not set up.
80
		add_action( 'wp_loaded', array( $this, 'hide_notices' ) );
81
82
		// Hook to `admin_menu` in order to add our own setup wizard page.
83
		add_action( 'admin_menu', array( $this, 'admin_menu' ) );
84
85
		// Triggered when the user accesses the admin area, we decide whether to show our own wizard.
86
		add_action( 'admin_init', array( $this, 'show_page' ) );
87
88
		// Hook to `admin_notices` to display our notices.
89
		add_action( 'admin_notices', array( $this, 'admin_notices' ) );
90
91
	}
92
93
	/**
94
	 * Hook to `admin_init` and redirect to WordLift's setup page if the `_wl_activation_redirect` transient flag is set.
95
	 *
96
	 * @since 3.9.0
97
	 */
98
	public function admin_init() {
0 ignored issues
show
Coding Style introduced by
admin_init uses the super-global variable $_GET which is generally not recommended.

Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable:

// Bad
class Router
{
    public function generate($path)
    {
        return $_SERVER['HOST'].$path;
    }
}

// Better
class Router
{
    private $host;

    public function __construct($host)
    {
        $this->host = $host;
    }

    public function generate($path)
    {
        return $this->host.$path;
    }
}

class Controller
{
    public function myAction(Request $request)
    {
        // Instead of
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;

        // Better (assuming you use the Symfony2 request)
        $page = $request->query->get('page', 1);
    }
}
Loading history...
99
100
		// If the `_wl_activation_redirect` is set, the redirect to the setup page.
101
		if ( get_transient( '_wl_activation_redirect' ) ) {
102
			delete_transient( '_wl_activation_redirect' );
103
104
			// If the user asked to skip the wizard then comply.
105
			if ( $this->configuration_service->is_skip_wizard() ) {
106
				return;
107
			}
108
109
			// If we're already on the page or the user doesn't have permissions, return.
110
			if ( ( ! empty( $_GET['page'] ) && in_array( $_GET['page'], array( 'wl-setup' ) ) ) || is_network_admin() || isset( $_GET['activate-multi'] ) || ! current_user_can( 'manage_options' ) ) {
111
				return;
112
			}
113
114
			// Finally redirect to the setup page.
115
			wp_safe_redirect( admin_url( 'index.php?page=wl-setup' ) );
116
117
			exit;
0 ignored issues
show
Coding Style Compatibility introduced by
The method admin_init() contains an exit expression.

An exit expression should only be used in rare cases. For example, if you write a short command line script.

In most cases however, using an exit expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.

Loading history...
118
		}
119
120
	}
121
122
	/**
123
	 * Generate an admin notice suggesting to start the wizard if there is no configuration.
124
	 *
125
	 * @since    3.9.0
126
	 */
127
	public function admin_notices() {
128
129
		// Use `wl_configuration_get_key` to check whether WL's key is set and that the user didn't disable the wizard.
130
		if ( '' === $this->configuration_service->get_key() && ! $this->configuration_service->is_skip_wizard() ) {
131
			?>
132
            <div id="wl-message" class="updated">
133
                <p><?php esc_html_e( 'Welcome to WordLift &#8211; You&lsquo;re almost ready to start', 'wordlift' ); ?></p>
134
                <p class="submit"><a href="<?php echo esc_url( admin_url( 'admin.php?page=wl-setup' ) ); ?>"
135
                                     class="button-primary"><?php esc_html_e( 'Run the Setup Wizard', 'wordlift' ); ?></a>
136
                    <a class="button-secondary skip"
137
                       href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wl-hide-notice', 'install' ), 'wordlift_hide_notices_nonce', '_wl_notice_nonce' ) ); ?>"><?php esc_html_e( 'Skip Setup', 'wordlift' ); ?></a>
138
                </p>
139
            </div>
140
			<?php
141
		}
142
143
	}
144
145
	/**
146
	 * Handle hiding the wizard notices by user request
147
	 *
148
	 * @since    3.9.0
149
	 */
150
	public function hide_notices() {
0 ignored issues
show
Coding Style introduced by
hide_notices uses the super-global variable $_GET which is generally not recommended.

Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable:

// Bad
class Router
{
    public function generate($path)
    {
        return $_SERVER['HOST'].$path;
    }
}

// Better
class Router
{
    private $host;

    public function __construct($host)
    {
        $this->host = $host;
    }

    public function generate($path)
    {
        return $this->host.$path;
    }
}

class Controller
{
    public function myAction(Request $request)
    {
        // Instead of
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;

        // Better (assuming you use the Symfony2 request)
        $page = $request->query->get('page', 1);
    }
}
Loading history...
151
152
		// If it's not a `wl-hide-notice` or the nonce is not set, return.
153
		if ( ! isset( $_GET['wl-hide-notice'], $_GET['_wl_notice_nonce'] ) ) {
154
			return;
155
		}
156
157
		// If the nonce is invalid, return an error.
158
		if ( ! wp_verify_nonce( $_GET['_wl_notice_nonce'], 'wordlift_hide_notices_nonce' ) ) {
159
			wp_die( __( 'Action failed. Please refresh the page and retry.', 'wordlift' ) );
160
		}
161
162
		// If the user doesn't have the right privileges, return an error.
163
		if ( ! current_user_can( 'manage_options' ) ) {
164
			wp_die( __( 'Cheatin&#8217; huh?', 'wordlift' ) );
165
		}
166
167
		// Store a flag telling to skip the wizard.
168
		$this->configuration_service->set_skip_wizard( TRUE );
169
170
	}
171
172
	/**
173
	 * Register the wizard page to be able to access it
174
	 *
175
	 * @since    3.9.0
176
	 */
177
	public function admin_menu() {
178
179
		// @todo: find another way to do this, since this is adding an empty space in WP's dashboard menu.
180
		add_dashboard_page( '', '', 'manage_options', 'wl-setup', '' );
181
182
	}
183
184
	/**
185
	 * Displays the wizard page
186
	 *
187
	 * @since    3.9.0
188
	 */
189
	public function show_page() {
0 ignored issues
show
Coding Style introduced by
show_page uses the super-global variable $_GET which is generally not recommended.

Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable:

// Bad
class Router
{
    public function generate($path)
    {
        return $_SERVER['HOST'].$path;
    }
}

// Better
class Router
{
    private $host;

    public function __construct($host)
    {
        $this->host = $host;
    }

    public function generate($path)
    {
        return $this->host.$path;
    }
}

class Controller
{
    public function myAction(Request $request)
    {
        // Instead of
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;

        // Better (assuming you use the Symfony2 request)
        $page = $request->query->get('page', 1);
    }
}
Loading history...
Coding Style introduced by
show_page uses the super-global variable $_POST which is generally not recommended.

Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable:

// Bad
class Router
{
    public function generate($path)
    {
        return $_SERVER['HOST'].$path;
    }
}

// Better
class Router
{
    private $host;

    public function __construct($host)
    {
        $this->host = $host;
    }

    public function generate($path)
    {
        return $this->host.$path;
    }
}

class Controller
{
    public function myAction(Request $request)
    {
        // Instead of
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;

        // Better (assuming you use the Symfony2 request)
        $page = $request->query->get('page', 1);
    }
}
Loading history...
190
191
		// First check if we are in the wizard page at all, if not do nothing.
192
		if ( empty( $_GET['page'] ) || 'wl-setup' !== $_GET['page'] ) {
193
			return;
194
		}
195
196
		// If it's a POST and the `wl-save-configuration` action is set, save the configuration.
197
		if ( isset( $_POST['action'] ) && 'wl-save-configuration' === $_POST['action'] ) {
198
199
			// Check the nonce and the user capabilities.
200
			check_admin_referer( 'wl-save-configuration' );
201
202
			// Check if the user has the right privileges.
203
			if ( ! current_user_can( 'manage_options' ) ) {
204
				wp_die( __( 'Sorry, you do not have a permission to save the settings', 'wordlift' ) );
205
			}
206
207
			// Save the configuration.
208
			$this->save_configuration( $_POST );
209
210
			// Redirect to the admin's page.
211
			wp_redirect( admin_url() );
212
213
			exit;
0 ignored issues
show
Coding Style Compatibility introduced by
The method show_page() contains an exit expression.

An exit expression should only be used in rare cases. For example, if you write a short command line script.

In most cases however, using an exit expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.

Loading history...
214
		}
215
216
		include plugin_dir_path( dirname( __FILE__ ) ) . 'admin/partials/wordlift-admin-setup.php';
217
218
		exit;
0 ignored issues
show
Coding Style Compatibility introduced by
The method show_page() contains an exit expression.

An exit expression should only be used in rare cases. For example, if you write a short command line script.

In most cases however, using an exit expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.

Loading history...
219
	}
220
221
	/**
222
	 * Save WordLift's configuration using the provided parameters.
223
	 *
224
	 * @since 3.9.0
225
	 *
226
	 * @param array $params An array of configuration parameters.
227
	 */
228
	private function save_configuration( $params ) {
229
230
		// We have the following parameters:
231
		// `key`, holding WL's key,
232
		// `vocabulary`, holding the vocabulary path,
233
		// `language`, with the language code (e.g. `en`),
234
		// `user_type`, the user type either `personal` or `company`,
0 ignored issues
show
Unused Code Comprehensibility introduced by
38% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
235
		// `name`, with the `personal` or `company`'s name,
236
		// `logo`, the attachment id for the `personal` or `company` entity.
237
238
		// Store the key:
239
		$this->configuration_service->set_key( $params['key'] );
240
241
		// Store the vocabulary path:
242
		$this->configuration_service->set_entity_base_path( $params['vocabulary'] );
243
244
		// Store the site's language:
245
		$this->configuration_service->set_language_code( $params['language'] );
246
247
		// Set the type URI, either http://schema.org/Person or http://schema.org/Organization.
248
		$type_uri = sprintf( 'http://schema.org/%s', 'organization' === $params['user_type'] ? 'Organization' : 'Person' );
249
250
		// Create an entity for the publisher.
251
		$publisher_post_id = $this->entity_service->create( $params['name'], $type_uri, $params['logo'], 'publish' );
252
253
		// Store the publisher entity post id in the configuration.
254
		$this->configuration_service->set_publisher_id( $publisher_post_id );
255
256
		flush_rewrite_rules(); // Needed because of possible change to the entity base path.
257
258
	}
259
260
//	/**
0 ignored issues
show
Unused Code Comprehensibility introduced by
36% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
261
//	 * Output the html for the header of the page.
262
//	 *
263
//	 * @since    3.9.0
264
//	 *
265
//	 * @param int $step The current step.
266
//	 */
267
//	public function header( $step ) {
268
//
269
//		// Enqueue styles (do we need wordlift-reloaded here?).
270
//		wp_enqueue_style( 'wordlift - reloaded', plugin_dir_url( dirname( __FILE__ ) ) . 'css / wordlift - reloaded . min . css' );
271
//		wp_enqueue_style( 'wordlift - admin - install - wizard', plugin_dir_url( dirname( __FILE__ ) ) . 'admin / css / wordlift - admin - install - wizard . css' );
272
//
273
//		wp_enqueue_script( 'wordlift - admin - install - wizard', plugin_dir_url( dirname( __FILE__ ) ) . 'admin / js / wordlift - admin - install - wizard . js' );
274
//		wp_localize_script( 'wordlift - admin - install - wizard', '_wlAdminSetup', array(
275
//			'ajaxUrl' => parse_url( self_admin_url( 'admin - ajax . php' ), PHP_URL_PATH ),
276
//			'action'  => 'wl_validate_key',
277
//			'media'   => array(
278
//				'title'  => __( 'WordLift Choose Logo', 'wordlift' ),
279
//				'button' => array( 'text' => __( 'Choose Logo', 'wordlift' ) ),
280
//			),
281
//		) );
282
//
283
//		// Include the header.
284
//		include plugin_dir_path( dirname( __FILE__ ) ) . 'admin / partials / wordlift - admin - install - wizard - header . php';
285
//
286
//	}
287
//
288
//	/**
289
//	 * Output the html for the footer of the page.
290
//	 *
291
//	 * @since    3.9.0
292
//	 */
293
//	public function footer() {
294
//
295
//		// Include the header.
296
//		include plugin_dir_path( dirname( __FILE__ ) ) . 'admin / partials / wordlift - admin - install - wizard - footer . php';
297
//
298
//	}
299
//
300
//	/**
301
//	 * Output the html for the welcome page.
302
//	 *
303
//	 * @since    3.9.0
304
//	 */
305
//	public function welcome_page() {
306
//
307
//		// Include the welcome page.
308
//		include plugin_dir_path( dirname( __FILE__ ) ) . 'admin / partials / wordlift - admin - install - wizard - step - 1.php';
309
//
310
//	}
311
//
312
//	/**
313
//	 * Output the html for the license page.
314
//	 *
315
//	 * @since    3.9.0
316
//	 *
317
//	 */
318
//	public function license_page() {
319
//		$key = '';
320
//		if ( isset( $_COOKIE['wl_key'] ) ) {
321
//			$key = $_COOKIE['wl_key'];
322
//		}
323
//
324
//		$valid = $this->key_validation_service->is_valid( $key ) ? 'valid' : 'invalid';
325
//
326
//		// Include the license page.
327
//		include plugin_dir_path( dirname( __FILE__ ) ) . 'admin / partials / wordlift - admin - install - wizard - step - 2.php';
328
//
329
//	}
330
//
331
//	/**
332
//	 * Output the html for the vocabulary page.
333
//	 *
334
//	 * @since    3.9.0
335
//	 *
336
//	 */
337
//	public function vocabulary_page() {
338
//
339
//		$slug = ' / ' . __( 'vocabulary', 'wordlift' ) . ' / ';
340
//		if ( isset( $_COOKIE['wl_slug'] ) ) {
341
//			$slug = $_COOKIE['wl_slug'];
342
//		}
343
//
344
//		// Include the vocabulary page.
345
//		include plugin_dir_path( dirname( __FILE__ ) ) . 'admin / partials / wordlift - admin - install - wizard - step - 3.php';
346
//
347
//	}
348
//
349
//	/**
350
//	 * Output the html for the language page.
351
//	 *
352
//	 * @since    3.9.0
353
//	 *
354
//	 */
355
//	public function language_page() {
356
//
357
//		$langs = Wordlift_Languages::get_languages();
358
//
359
//		$locale = get_locale();
360
//		$parts  = explode( '_', $locale );
361
//		$lang   = $parts[0];
362
//
363
//		if ( isset( $_COOKIE['wl_lang'] ) ) {
364
//			$lang = $_COOKIE['wl_lang'];
365
//		}
366
//
367
//		if ( ! isset( $langs[ $lang ] ) ) {
368
//			$lang = 'en'; // Use english by default.
369
//		}
370
//
371
//		// Include the language page.
372
//		include plugin_dir_path( dirname( __FILE__ ) ) . 'admin / partials / wordlift - admin - install - wizard - step - 4.php';
373
//
374
//	}
375
//
376
//	/**
377
//	 * Output the html for the publisher page.
378
//	 *
379
//	 * @since    3.9.0
380
//	 *
381
//	 */
382
//	public function publisher_page() {
383
//
384
//		$type = 'personal';
385
//		if ( isset( $_COOKIE['wl_type'] ) ) {
386
//			$type = $_COOKIE['wl_type'];
387
//		}
388
//
389
//		$name = '';
390
//		if ( isset( $_COOKIE['wl_name'] ) ) {
391
//			$name = $_COOKIE['wl_name'];
392
//		}
393
//
394
//		$image_id = 0;
395
//		if ( isset( $_COOKIE['wl_image_id'] ) ) {
396
//			$image_id = $_COOKIE['wl_image_id'];
397
//		}
398
//
399
//		$image_url = 0;
400
//		if ( isset( $_COOKIE['wl_image_url'] ) ) {
401
//			$image_url = $_COOKIE['wl_image_url'];
402
//		}
403
//
404
//		// Include the publisher page.
405
//		include plugin_dir_path( dirname( __FILE__ ) ) . 'admin / partials / wordlift - admin - install - wizard - step - 5.php';
406
//
407
//	}
408
409
//	/**
0 ignored issues
show
Unused Code Comprehensibility introduced by
43% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
410
//	 * Finish the wizard, store all settings from the cookie into the DB.
411
//	 *
412
//	 * @since    3.9.0
413
//	 *
414
//	 */
415
//	public function finish() {
416
//
417
//		// If the nonce isn't set, exit .
418
//		if ( ! isset( $_GET['_wl_finish_nonce'] ) ) {
419
//			return;
420
//		}
421
//
422
//		// Check the nonce.
423
//		if ( ! wp_verify_nonce( $_GET['_wl_finish_nonce'], 'wordlift_finish_nonce' ) ) {
424
//			wp_die( __( 'Action failed. Please refresh the page and retry.', 'wordlift' ) );
425
//		}
426
//
427
//		// Check if the user has the right privileges.
428
//		if ( ! current_user_can( 'manage_options' ) ) {
429
//			wp_die( __( 'Sorry, you do not have a permission to save the settings', 'wordlift' ) );
430
//		}
431
//
432
//		// Update the configuration, set WordLift's key,
433
//		$this->configuration_service->set_key( $_COOKIE['wl_key'] );
434
//
435
//		// Set WordLift's language code.
436
//		$this->configuration_service->set_language_code( $_COOKIE['wl_lang'] );
437
//
438
//		// Set the entity base path.
439
//		// @todo should we use stripslashes here? (and move it to the configuration service).
440
//		$this->configuration_service->set_entity_base_path( trim( $_COOKIE['wl_slug'], '\\' ) );
441
//
442
//		// Create an entity for the publisher.
443
//		$post_id = wp_insert_post( array(
444
//			'post_type'    => Wordlift_Entity_Service::TYPE_NAME,
445
//			'post_title'   => $_COOKIE['wl_name'],
446
//			'post_status'  => 'publish',
447
//			'post_content' => '',
448
//		) );
449
//
450
//		// Set a thumbnail if a logo was selected.
451
//		if ( ! empty( $_COOKIE['wl_image_id'] ) && 0 < $image_id = absint( $_COOKIE['wl_image_id'] ) ) {
452
//			set_post_thumbnail( $post_id, $image_id );
453
//		}
454
//
455
//		// Set the type URI, either http://schema.org/Person or http://schema.org/Organization.
456
//		$type_uri = sprintf( 'http://schema.org/%s', 'company' === $_COOKIE['wl_type'] ? 'Organization' : 'Person' );
457
//
458
//		// Set the entity type.
459
//		Wordlift_Entity_Type_Service::get_instance()->set( $post_id, $type_uri );
460
//
461
//		// Store the publisher entity post id in the configuration.
462
//		$this->configuration_service->set_publisher_id( $post_id );
463
//
464
//		flush_rewrite_rules(); // Needed because of possible change to the entity base path.
465
//		wp_redirect( admin_url( 'admin.php?page=wl_configuration_admin_menu' ) );
466
//		exit();
467
//
468
//	}
469
470
}
471