Skip to content

Licensing: a site_inactive site never borrows the network update package #1730

Description

@jakejackson1

maybe_apply_network_package() only falls back to the network-shared package when this site's own package is empty:

if ( ! is_multisite() || ! is_object( $version_info ) || ! empty( $version_info->package ) ) {
    return $version_info;
}

An unentitled site doesn't always get an empty one. With no license at all the store returns package: "", but with a valid key whose domain was never activated (site_inactive) it returns a signed URL that 401s — "Your license has not been activated for this domain, please activate it first."

So on a Multisite with the plugin activated per-site, a site_inactive site takes the early return, never borrows the working package another site promoted, and the install fails. That's the case the fallback exists for, and the likelier one: the key tends to be entered on every site while the domain is activated on only some.

set_version_info_cache() already gates the promoting side on is_license_active(), and its comment notes the store "can return a package URL even when the license is inactive (that URL errors on access)". The consuming side just needs the same test:

if ( ! empty( $version_info->package ) && $this->is_license_active() ) {
    return $version_info;
}

Confidence: the code path is read directly from src/Helper/Licensing/EDD_SL_Plugin_Updater.php on development. The 401 was reproduced against a different EDD Software Licensing store, not gravitypdf.com — the error string is EDD SL's stock package_download response, so I'd expect it to match, but I haven't confirmed it against your store.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions