return $new; } /** * Perform periodic maintenance * * @return bool * @since 1.0 */ function do_maintenance() { do_action('searchwp_log', 'do_maintenance()'); $license = searchwp_get_license_key(); $license = sanitize_text_field($license); $api_params = array('edd_action' => 'check_license', 'license' => $license, 'item_name' => urlencode(SEARCHWP_EDD_ITEM_NAME)); $api_args = array('timeout' => 30, 'sslverify' => false, 'body' => $api_params); $response = wp_remote_post(SEARCHWP_EDD_STORE_URL, $api_args); if (is_wp_error($response)) { return false; } $license_data = json_decode(wp_remote_retrieve_body($response)); if ('valid' != $license_data->license) { do_action('searchwp_log', 'License not valid'); delete_option(SEARCHWP_PREFIX . 'license_status'); delete_option(SEARCHWP_PREFIX . 'license_expiration'); } return true; } } $license_settings = new SearchWP_Settings_Implementation_License(); $license_settings->init();