activities_helper.php
3 months ago
agent_helper.php
3 months ago
analytics_helper.php
1 week ago
auth_helper.php
6 days ago
blocks_helper.php
3 weeks ago
booking_helper.php
4 days ago
bricks_helper.php
3 months ago
bundles_helper.php
4 days ago
calendar_helper.php
3 days ago
carts_helper.php
3 months ago
connector_helper.php
3 months ago
csv_helper.php
3 months ago
customer_helper.php
1 month ago
customer_import_helper.php
1 month ago
database_helper.php
1 week ago
debug_helper.php
3 months ago
defaults_helper.php
3 months ago
elementor_helper.php
3 months ago
email_helper.php
3 months ago
encrypt_helper.php
3 months ago
events_helper.php
3 months ago
form_helper.php
3 months ago
icalendar_helper.php
3 months ago
image_helper.php
3 months ago
invoices_helper.php
3 weeks ago
license_helper.php
3 months ago
location_helper.php
3 months ago
marketing_systems_helper.php
3 months ago
meeting_systems_helper.php
3 months ago
menu_helper.php
3 weeks ago
meta_helper.php
3 months ago
migrations_helper.php
3 months ago
money_helper.php
3 months ago
notifications_helper.php
3 months ago
nps_survey_helper.php
3 months ago
order_intent_helper.php
2 months ago
orders_helper.php
12 hours ago
otp_helper.php
3 months ago
pages_helper.php
3 months ago
params_helper.php
3 months ago
payments_helper.php
12 hours ago
plugin_version_update_helper.php
2 months ago
price_breakdown_helper.php
3 months ago
process_jobs_helper.php
3 months ago
processes_helper.php
3 months ago
razorpay_connect_helper.php
1 week ago
replacer_helper.php
3 months ago
resource_helper.php
4 days ago
roles_helper.php
3 weeks ago
router_helper.php
3 months ago
service_helper.php
3 months ago
sessions_helper.php
3 months ago
settings_helper.php
1 week ago
short_links_systems_helper.php
3 months ago
shortcodes_helper.php
3 weeks ago
sms_helper.php
3 months ago
steps_helper.php
12 hours ago
stripe_connect_helper.php
1 week ago
styles_helper.php
3 months ago
support_topics_helper.php
3 months ago
time_helper.php
2 months ago
timeline_helper.php
2 months ago
transaction_helper.php
1 month ago
transaction_intent_helper.php
3 months ago
util_helper.php
1 month ago
version_specific_updates_helper.php
3 months ago
whatsapp_helper.php
1 month ago
work_periods_helper.php
3 months ago
wp_datetime.php
3 months ago
wp_user_helper.php
3 months ago
license_helper.php
41 lines
| 1 | <?php |
| 2 | |
| 3 | class OsLicenseHelper { |
| 4 | |
| 5 | public static function get_license_key() { |
| 6 | $license_info = self::get_license_info(); |
| 7 | return $license_info['license_key']; |
| 8 | } |
| 9 | |
| 10 | public static function clear_license() { |
| 11 | OsSettingsHelper::save_setting_by_name( 'is_active_license', 'no' ); |
| 12 | OsSettingsHelper::save_setting_by_name( 'license_status_message', '' ); |
| 13 | OsSettingsHelper::save_setting_by_name( 'license', '' ); |
| 14 | } |
| 15 | |
| 16 | public static function get_license_info() { |
| 17 | $license_info = OsSettingsHelper::get_settings_value( 'license' ); |
| 18 | $license = array( |
| 19 | 'full_name' => '', |
| 20 | 'email' => '', |
| 21 | 'license_key' => '', |
| 22 | ); |
| 23 | |
| 24 | if ( $license_info ) { |
| 25 | $license_arr = explode( '*|||*', $license_info ); |
| 26 | $license['full_name'] = isset( $license_arr[0] ) ? $license_arr[0] : ''; |
| 27 | $license['email'] = isset( $license_arr[1] ) ? $license_arr[1] : ''; |
| 28 | $license['license_key'] = isset( $license_arr[2] ) ? $license_arr[2] : ''; |
| 29 | } |
| 30 | |
| 31 | $license['is_active'] = OsSettingsHelper::get_settings_value( 'is_active_license', 'no' ); |
| 32 | $license['status_message'] = OsSettingsHelper::get_settings_value( 'license_status_message', false ); |
| 33 | |
| 34 | return $license; |
| 35 | } |
| 36 | |
| 37 | public static function is_license_active() { |
| 38 | return ( OsSettingsHelper::get_settings_value( 'is_active_license', 'no' ) == 'yes' ); |
| 39 | } |
| 40 | } |
| 41 |