| 1 |
<?php |
| 2 |
/** |
| 3 |
* Environment policy for the Setup Wizard module. |
| 4 |
* |
| 5 |
* @package Booking Calendar |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; |
| 10 |
} |
| 11 |
|
| 12 |
require_once dirname( __DIR__ ) . '/_functions/class-wpbc-environment-policy.php'; |
| 13 |
|
| 14 |
/** |
| 15 |
* Expose Setup Wizard capabilities from the shared environment policy. |
| 16 |
* |
| 17 |
* Route composition, review presentation, checkpoint normalization, and any |
| 18 |
* future final-summary sender use this facade. Host identity and capability |
| 19 |
* decisions remain owned by WPBC_Environment_Policy, the project-wide source |
| 20 |
* of truth. |
| 21 |
*/ |
| 22 |
final class WPBC_Setup_Wizard_Environment_Policy { |
| 23 |
|
| 24 |
/** |
| 25 |
* Determine whether the current site is a Booking Calendar live demo. |
| 26 |
* |
| 27 |
* @return bool True for a live-demo website. |
| 28 |
*/ |
| 29 |
public static function is_live_demo() { |
| 30 |
return WPBC_Environment_Policy::is_live_demo(); |
| 31 |
} |
| 32 |
|
| 33 |
/** |
| 34 |
* Determine whether WordPress is running in Playground. |
| 35 |
* |
| 36 |
* A strict boolean check avoids treating a non-boolean compatibility value |
| 37 |
* as authorization to remove a normal-site wizard step. |
| 38 |
* |
| 39 |
* @return bool True only when the canonical Playground constant is true. |
| 40 |
*/ |
| 41 |
public static function is_playground() { |
| 42 |
return WPBC_Environment_Policy::is_playground(); |
| 43 |
} |
| 44 |
|
| 45 |
/** |
| 46 |
* Determine whether the wizard may collect Business details. |
| 47 |
* |
| 48 |
* @return bool True on normal installations; false on demos and Playground. |
| 49 |
*/ |
| 50 |
public static function allows_business_details() { |
| 51 |
return WPBC_Environment_Policy::allows_setup_business_details(); |
| 52 |
} |
| 53 |
|
| 54 |
/** |
| 55 |
* Determine whether a final setup-summary email may be requested or sent. |
| 56 |
* |
| 57 |
* Summary email depends on the Business details step for its explicit email |
| 58 |
* address and consent. Environments that omit that step must never infer a |
| 59 |
* recipient from an older checkpoint or another WordPress option. |
| 60 |
* |
| 61 |
* @return bool True when Business details and summary email are available. |
| 62 |
*/ |
| 63 |
public static function allows_summary_email() { |
| 64 |
return WPBC_Environment_Policy::allows_setup_summary_email(); |
| 65 |
} |
| 66 |
|
| 67 |
/** |
| 68 |
* Determine whether the wizard may discover or publish WordPress pages. |
| 69 |
* |
| 70 |
* @return bool True for customer and internal test installations. |
| 71 |
*/ |
| 72 |
public static function allows_page_publishing() { |
| 73 |
return WPBC_Environment_Policy::allows_page_publishing(); |
| 74 |
} |
| 75 |
} |
| 76 |
|