id = 'licensekey'; $this->label = __( 'License Key', 'propertyhive' ); add_filter( 'propertyhive_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); add_action( 'propertyhive_settings_' . $this->id, array( $this, 'output' ) ); add_action( 'propertyhive_settings_save_' . $this->id, array( $this, 'save' ) ); } /** * Get sections. * * @return array */ public function get_sections() { $sections = array( '' => __( 'License Key', 'propertyhive' ), ); return apply_filters( 'propertyhive_get_sections_' . $this->id, $sections ); } /** * Get settings array. * * @return array */ public function get_settings() { $license = PH()->license->get_current_license(); $output = ''; $input_border_color = ''; $renew_link = '' . __( 'Renew License', 'propertyhive' ) . ''; $valid_license = false; if ( is_array($license) && empty($license) && get_option( 'propertyhive_license_key', '' ) != '' ) { $output = '' . __( 'Invalid license key entered. If you\'re seeing this message and the license key is correct please contact Property Hive support.', 'propertyhive' ) . ''; $input_border_color = '#900'; } elseif ( isset($license['active']) && $license['active'] != '1' ) { $output = '' . __( 'License inactive.', 'propertyhive' ) . ''; $input_border_color = '#900'; } else { if ( isset($license['expires_at']) && $license['expires_at'] != '' ) { if ( strtotime($license['expires_at']) <= time() ) { // Expired $output = '' . __( 'License expired on ' . date("jS F Y", strtotime($license['expires_at'])), 'propertyhive' ) . '. ' . $renew_link . ''; $input_border_color = '#900'; } elseif ( strtotime($license['expires_at']) > time() && strtotime($license['expires_at']) < (time() + 30 * 24 * 60 * 60) ) { // Expires in less than 30 days $output = '' . __( 'License expires on ' . date("jS F Y", strtotime($license['expires_at'])), 'propertyhive' ) . '. ' . $renew_link . ''; $input_border_color = '#F90'; } elseif (strtotime($license['expires_at']) > time()) { // Valid $output = '' . __( 'License valid. Expires on ' . date("jS F Y", strtotime($license['expires_at'])), 'propertyhive' ) . '.'; $input_border_color = '#090'; $valid_license = true; } } } $settings = apply_filters( 'propertyhive_licenses_settings', array( array( 'title' => __( 'License Key', 'propertyhive' ), 'type' => 'title', 'id' => 'license_options' ), array( 'type' => 'html', 'html' => __( '
By having a license key you will benefit from priority one-to-one email support, setup assistance, troubleshooting, and updates to purchased add ons containing new functionality and fixes.
Licenses are valid for 12 months from the date of purchase and exist on a per-site-basis. Should a license key not exist, your website will still function as it does now. However support will be limited and potentially slower than usual and you won’t receive updates to any purchased add ons.
' . ( (!$valid_license) ? '