Development workflow

This page discusses the general workflows available for developing plentymarkets plugins. It covers the following topics:

  • Development from scratch vs. building on an existing plugin

  • Plugin upload process

  • Plugin deployment process

  • Caching

  • Limitations on plugin usage

Basis for development

When developing a plugin, you can either start from scratch or use an existing open source plugin as a base.

If you want to start from scratch, make sure to follow the structure described on the plugin architecture page. You can also generate this structure automatically by using the plugin generator.

Alternatively, you can build on an existing open source plugin. Open source plugins from plentysystems are available as GitHub repositories. If you’ve purchased an open source plugin from plentyMarketplace, you can also download it to your local environment with plentyDevTool.

Adding your own plugin to plentymarkets

To test and use your plugin, you have to add it to your plentymarkets system. You can add your plugin in one of two ways:

  • plentyDevTool

  • Git

plentymarkets supports GitHub, GitLab and Bitbucket.

In most cases, using plentyDevTool for adding your plugin to the system and uploading your changes is preferable to using Git. In large parts, this is because pushing your local changes to the system is a one-click operation. Using Git, you always need both a push and a pull operation. We recommend that, during development, you use plentyDevTool to push your code to plentymarkets, but run a version control system alongside it. This way, you can still revert quickly to earlier stages of development.

An exception is if you want to deploy the plugin in multiple systems. In this case, we recommend adding the plugin via Git. With Git, you can always keep your local source code in one place. plentyDevTool, on the other hand, requires you to maintain the plugin for each of your systems separately. By maintaining multiple instances of the same code, there’s a greater risk of accidental mistakes.

Deployment process

In plentymarkets, you cannot deploy individual plugins. Instead, you have to deploy a collection of plugins, a so-called plugin set. This is because during the deployment process, plentymarkets checks the source code of the plugins. The code check takes dependencies across multiple plugins into account. For instructions on how to deploy the plugin set, refer to the manual page Installing added plugins.

In addition to the regular deployment process, there’s also an abbreviated one. The abbreviated process is only available when using plentyDevTool. Furthermore, there are the following requirements for the abbreviated process:

  • The plugin set isn’t linked to any client.

  • The plugin was deployed before, using the regular deployment process.

If all requirements are met, plentymarkets automatically executes the abbreviated process whenever you push changes with plentyDevTool. The following table shows the differences between the deployment processes.

Step Full build Abbr. build

Files built

All

New
Modified
Deleted

Copy files to deployment directory

Yes

No

Check code of plugins

Yes

No

Copy files to build directory

Yes

Yes

Publish resources

Yes

Yes

Reset cache

Yes

Yes

Update plugin routes cache

Yes

No

Run database migrations

Yes

No

Clean configurations

Yes

No

As indicated in the table, the abbreviated build only processes changed files. It doesn’t validate how these files interact with any other files. Because of this, it cannot catch as many errors as the full build.

Caching

plentymarkets uses Zend Opcache caching to increase performance. These caches can have an impact on plugin development because changes may not always be visible right away. There are three components that cache information.

Component Caching

Live shop

Always cached

Plugin set preview

Always cached

plentymarkets back end

Always cached
Caching can be disabled.

The Opcache is emptied every 7 minutes. The routes cache is reset every time you deploy a plugin set using the full build.

Usage limitations

Depending on how plentymarkets accesses the plugin, you may need to take additional steps for your plugin to run properly. The following table lists the relevant limitations.

Integration Limitation

plentyShop routes

Link the plugin set to a client.
Alternatively, you can use the plentyShop preview.

plentymarkets back end routes

Link the plugin set to your user account.

Crons

plentymarkets only runs cron jobs of plugins if they’re installed in the plugin set linked to the standard client. The standard client is labeled in the Setup » Client menu.

No limitations apply to event listeners.