GravityKit / GravityView

The best and easiest way to display Gravity Forms entries on your website.
https://www.gravitykit.com/products/gravityview/
245 stars 63 forks source link

Optimize EDD License Updater updates #989

Open soulseekah opened 6 years ago

soulseekah commented 6 years ago

This should not be happening, we're contacting the same server. Since the EDD License Handler is now namespaced, let's think about aggregating the calls together and send them all in one call.

image

┆Issue is synchronized with this Asana task

soulseekah commented 6 years ago

The license server should have a new endpoint: get_all_versions. This should output all the plugins that is knows about.

It will send the following parameters:

      'edd_action' => string 'get_all_versions' (length=16)
      'license' => string '2edb41fff85ddbaa47558371454f4d77' (length=32)
      'url' => string 'http://gv2.dev.codeseekah.com' (length=29)
      'beta' => boolean false

get_version will no longer be called on the server, this may mean that version statistics will no longer be collected. If get_version was used to do so, we'll need to come up with a bulk mechanism as well. Perhaps we can pass all the current versions via get_all_versions?

soulseekah commented 6 years ago

Here's what I came up with so far:

  1. get_all_version retrieves all the latest versions (including betas) as needed. Just a huge JSON array. If the license key is provided then the download links are also present for products that can be updated. Just return an array of responses for all the registered plugins on the server.
  2. A static variable ($remote_versions) will assemble all the plugins by slug, and any subsequent calls to get_version from other plugins will not call the license server but get the data from the static variable.
  3. Moreover a new static variable ($current_versions) will be assembled with various license information and whatnot, this will be sent out as a new request to the license server called report_all_versions. This will contain information that is being gathered otherwise (usually via the get_version call).

Would this make sense? What are the flaws?

Questions:

  1. Is the beta flag global for all our extensions? Or can some plugins set the beta flag, while others not?
  2. Is the license key global for all the extensions on a site?
  3. And the URL? What about multisite licenses? or subdomains?

If the plan above sounds fine then the code is drafted and can be released this week, given that the server endpoints are ready.

soulseekah commented 4 years ago

This hasn't been an issue that anyone else complained off. Setting to Low priority for now. Difficulty is quite moderate. Needs EED work on the server.