• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Easy Digital Downloads a2z

Easy Digital Downloads a2z

Easy Digital Downloads a2z

  • Home
  • Plugins
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / EDD_License::weekly_license_check() – Check if license key is valid once per week

You appear to be a bot. Output may be restricted

Description

Check if license key is valid once per week

Usage

EDD_License::weekly_license_check();

Parameters

Returns

void void

Source

File name: easy-digital-downloads/includes/class-edd-license-handler.php


Lines:

1 to 44 of 44
  public function weekly_license_check() {

    if ( ! empty( $_POST['edd_settings'] ) ) {
      return; // Don't fire when saving settings
    }

    if ( empty( $this->license ) ) {
      return;
    }

    // data to send in our API request
    $api_params = array(
      'edd_action'=> 'check_license',
      'license'   => $this->license,
      'item_name' => urlencode( $this->item_name ),
      'url'       => home_url()
    );

    if ( ! empty( $this->item_id ) ) {
      $api_params['item_id'] = $this->item_id;
    }

    // Call the API
    $response = wp_remote_post(
      $this->api_url,
      array(
        'timeout'   => 15,
        'sslverify' => false,
        'body'      => $api_params
      )
    );

    // make sure the response came back okay
    if ( is_wp_error( $response ) ) {
      return false;
    }

    $license_data = json_decode( wp_remote_retrieve_body( $response ) );

    $this->maybe_set_pass_flag( $this->license, $license_data );

    update_option( $this->item_shortname . '_license_active', $license_data );
  }
 

 View on GitHub View on Trac

Published: 26th November 2019 | Last updated: 14th September 2022

Primary Sidebar

Information

Function name: EDD_License::weekly_license_check
Class ref: EDD_License
Plugin ref: Easy Digital Downloads
Version: 3.1.0.2
Sourcefile: includes/class-edd-license-handler.php
File ref: includes/class-edd-license-handler.php
Deprecated?: No
API Letters: C,E,L,W

Footer

Easy Digital Downloads a2z
Easy Digital Downloads a2z
Easy Digital Downloads a2z
WordPress 6.1.1
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  edd.wp-a2z.org
© Copyright Easy Digital Downloads a2z 2014-2023. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins