| 1 |
<?php |
| 2 |
|
| 3 |
namespace gVectors\License; |
| 4 |
|
| 5 |
class Config { |
| 6 |
private $core_plugin_version; // "3.0.5" |
| 7 |
private $core_plugin_slug; // "wpforo" |
| 8 |
private $license_module_url; // "https://example.com/wp-content/plugins/wpforo/modules/license" |
| 9 |
private $dashboard_addons_page_slug; // admin_url('admin.php?page=XXXXXXX'); |
| 10 |
private $dashboard_menu_hook; // add_action('admin_menu', function() { //the core plugin add menu actions; do_action('XXXXXXX', $parent_slug );} |
| 11 |
private $proxy_server_url = 'https://store.gvectors.com'; // "https://store.gvectors.com" | "https://gv.loc" |
| 12 |
|
| 13 |
public function __construct( |
| 14 |
$core_plugin_version, |
| 15 |
$core_plugin_slug, |
| 16 |
$license_module_url, |
| 17 |
$dashboard_addons_page_slug, |
| 18 |
$dashboard_menu_hook |
| 19 |
) { |
| 20 |
$this->core_plugin_version = $core_plugin_version; |
| 21 |
$this->core_plugin_slug = $core_plugin_slug; |
| 22 |
$this->license_module_url = $license_module_url; |
| 23 |
$this->dashboard_addons_page_slug = $dashboard_addons_page_slug; |
| 24 |
$this->dashboard_menu_hook = $dashboard_menu_hook; |
| 25 |
} |
| 26 |
|
| 27 |
/* |
| 28 |
* "3.0.5" |
| 29 |
*/ |
| 30 |
public function get_core_plugin_version(): string { |
| 31 |
return $this->core_plugin_version; |
| 32 |
} |
| 33 |
|
| 34 |
/* |
| 35 |
* "wpforo" |
| 36 |
*/ |
| 37 |
public function get_core_plugin_slug(): string { |
| 38 |
return $this->core_plugin_slug; |
| 39 |
} |
| 40 |
|
| 41 |
/* |
| 42 |
* "https://example.com/wp-content/plugins/wpforo/modules/license" |
| 43 |
*/ |
| 44 |
public function get_license_module_url(): string { |
| 45 |
return $this->license_module_url; |
| 46 |
} |
| 47 |
|
| 48 |
/* |
| 49 |
* admin_url('admin.php?page=XXXXXXX'); |
| 50 |
*/ |
| 51 |
public function get_dashboard_addons_page_slug(): string { |
| 52 |
return $this->dashboard_addons_page_slug; |
| 53 |
} |
| 54 |
|
| 55 |
/* |
| 56 |
* add_action('admin_menu', function() { //the core plugin add menu actions; do_action('XXXXXXX', $parent_slug );} |
| 57 |
*/ |
| 58 |
public function get_dashboard_menu_hook(): string { |
| 59 |
return $this->dashboard_menu_hook; |
| 60 |
} |
| 61 |
|
| 62 |
/* |
| 63 |
* "https://store.gvectors.com" | "https://gv.loc" |
| 64 |
*/ |
| 65 |
public function get_proxy_server_url(): string { |
| 66 |
return $this->proxy_server_url; |
| 67 |
} |
| 68 |
|
| 69 |
public function get_manifest_public_key(): string { |
| 70 |
// @TODO Replace with your production public key before release. |
| 71 |
return '008aed68f1caf91cce7fbf679091879091c8f8c660cd3a64107c9db11d2f62af'; |
| 72 |
} |
| 73 |
|
| 74 |
public function get_tamper_grace_days(): int { |
| 75 |
return 5; |
| 76 |
} |
| 77 |
|
| 78 |
public function get_legacy_check_period(): int { |
| 79 |
return DAY_IN_SECONDS; |
| 80 |
} |
| 81 |
|
| 82 |
public function get_license_revalidation_period(): int { |
| 83 |
return DAY_IN_SECONDS; |
| 84 |
} |
| 85 |
|
| 86 |
public function get_license_batch_cache_ttl(): int { |
| 87 |
return 10 * MINUTE_IN_SECONDS; |
| 88 |
} |
| 89 |
|
| 90 |
/* |
| 91 |
* admin_url('XXXXXXX'); |
| 92 |
*/ |
| 93 |
public function get_dashboard_addons_store_url(): string { |
| 94 |
return 'admin.php?page=' . $this->dashboard_addons_page_slug; |
| 95 |
} |
| 96 |
|
| 97 |
public function get_proxy_checkout_loading_url(): string { |
| 98 |
return $this->proxy_server_url . '/checkout-loading.html'; |
| 99 |
} |
| 100 |
|
| 101 |
public function get_proxy_checkout_base_url(): string { |
| 102 |
return $this->proxy_server_url . '/pay/index.php'; |
| 103 |
} |
| 104 |
} |
| 105 |
|