Forums / Contribution-Writing Guidelines / Listings in the Plugins db + Question about encapsulation

Listings in the Plugins db + Question about encapsulation

Views: 7,287

Results 1 to 3 of 3
19 Feb 2025, 9:22 PM
#1
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Listings in the Plugins db + Question about encapsulation

Right now I'm releasing two versions of the same plugin in the DB each with the same ID number. Right now I submit one with the _noEPS ending and one without. I wanted to compare the versions to alert of a potential upgrade, but I just realized the last submitted/approved version is what is returned by the plugin_version_check_for_updates function.

I wanted to know if there was a problem in listing a plugin module with the same version number in the ZenCart database? (So, for example, the next version would be listed as v1.1.0 with both a "Encapsulated: Yes" and "Encapsulated: No" version but both will be listed with v1.1.0.)

Secondly, I wanted to ask exactly which versions of ZC are able to take advantage of front-side encapsulation. I know 2.1.0 is out the box, but I'm lost to which of 1.5.8, 1.5.7 can as well.

Also to add on, I'm tempted to release a zip of two zip files as well, but not sure how complicated that would be. Any suggestions would be appreciated.

20 Feb 2025, 2:52 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Listings in the Plugins db + Question about encapsulation

Instead of having 2 zips in one zip file, you could just release one zip containing both versions. And if they want the encapsulated one, they just upload the stuff under the zip's zc_plugins directory, else they upload the /includes directory.
Then you wouldn't have to be releasing separate updates either.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

20 Feb 2025, 3:19 AM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Listings in the Plugins db + Question about encapsulation

retched:

Secondly, I wanted to ask exactly which versions of ZC are able to take advantage of front-side encapsulation. I know 2.1.0 is out the box, but I'm lost to which of 1.5.8, 1.5.7 can as well.

When it comes to installing/upgrading, the /includes/classes/PluginSupport/ScriptedInstallHelpers.php (and any Traits it incorporates or classes it extends) determine compatibility.
eg: v2.0.0 doesn't recognize executeInstallerSelectQuery() in ScriptedInstaller, because it was added in v2.1.0

https://docs.zen-cart.com/dev/plugins/encapsulated_plugins/ mentions a github gist that delineates many things that are different between versions, including whether necessary directories are autoloaded in proper precedence ... which is the crux of compatibility challenges.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.