Skip to content

Commit

Permalink
Best Practices (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
rami-elementor authored Sep 23, 2024
1 parent 0b7e80d commit 7ff399b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/.vuepress/sidebars/getting-started.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module.exports = [
sidebarDepth: -1,
children: [
'requirements',
'best-practices',
'first-addon',
]
},
Expand Down
41 changes: 41 additions & 0 deletions src/getting-started/best-practices.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Best Practices

<Badge type="tip" vertical="top" text="Elementor Core" /> <Badge type="warning" vertical="top" text="Basic" />

This Best Practices guide is a living document for Elementor addon developers, meant to be revised as Elementor makes changes, introduces new features, and provides additional recommendations. We recommend following these best practices.

## Supported PHP Versions

Ensure your addon is compatible with the most used PHP version (v7.4) and the latest PHP versions and (v8.0 and above).

## Compatibility Tag

Elementor has its own [header comments](https://developers.elementor.com/docs/addons/plugin-header/) where you can note the Elementor version that the addon was tested against. This is an optional header, but we recommend using it.

## Compatibility Checks

[Check which Elementor and PHP versions](https://developers.elementor.com/docs/addons/compatibility/) a website uses to make sure your addon supports it. Otherwise, notify the user that the website doesn’t meet the addon’s requirements.

## Scripts & Style Registration

Elementor has its own way to [register scripts and styles](https://developers.elementor.com/docs/scripts-styles/). Using the recommended methods ensures your addon is optimized for performance.

## Internationalization

Use WordPress functions to [internationalize](https://developer.wordpress.org/apis/internationalization/internationalization-functions/) your strings.

## Remove Deprecated Code

Already have an addon? Run it through the [Elementor Deprecated Code Detector](https://github.com/matipojo/elementor-deprecated-code-detector) to see if your addon contains any [deprecated code](https://developers.elementor.com/docs/deprecations). If so, we highly recommend removing it.

## Adopt Latest Performance Features

Implement [Element Caching](https://developers.elementor.com/elementor-3-22-developers-update/) to store element output in the cache for more performant websites.

## Elementor Pro Developer License

Test with Elementor Pro by requesting a [Developer License](https://elementor.com/pages/addon-developers-corner/).

## Security

Participate in Patchstack’s free [mVDP Program](https://elemn.to/patchstack-for-plugins) to maintain the security hygiene of your product with a clear vulnerability reporting structure.

0 comments on commit 7ff399b

Please sign in to comment.