Files
CodePress/guide/en/admin-beheerder/plugins.md
T

2.9 KiB

Plugins

Plugin types

There are two types of plugins:

  • System plugins (blue badge) - Manage CMS functionality such as Dashboard, Logs and Statistics
  • Content plugins (green badge) - Display content on the front-end such as HTMLBlock and Navigation

Essential plugins

Essential plugins (with a shield icon) cannot be edited, deactivated, or deleted. This applies to the Navigation plugin for example.

Managing plugins

  • Enable/Disable - Turn plugins on/off
  • Edit - Modify plugin code
  • Configuration - Plugin settings (only for plugins with a Config button)
  • Delete - Remove plugin

Only active plugins are shown in the admin sidebar.

New plugin

  1. Go to PluginsNew plugin
  2. Enter a name (e.g. MyPlugin)
  3. Edit the PHP file
  4. Enable the plugin

New plugins are content-plugins by default. To create a system plugin, add "type": "system" to plugin.json.

Plugin editor

Via Edit (pencil icon) in the plugin overview you open the plugin editor (/admin/plugins-edit?plugin=<name>). It works the same as the content and theme editors.

File browser sidebar

  • Shows the nested file tree of the plugin, with a clickable plugin root at the top
  • Click a file to open it in the CodeMirror editor
  • Click a folder to open the folder detail pane on the right (new file, new folder, upload, delete)
  • Folders containing the active file are auto-expanded
  • Per folder there are action buttons: new file, new folder — they operate on the selected folder
  • Per file there are action buttons: rename/move (pencil), delete (trash) — appear on hover

Drag-and-drop

  • Drag a file or folder onto another folder to move it
  • Valid drop targets are highlighted during dragging
  • The move is performed via an AJAX call — the page reloads automatically on success
  • Protected plugins (like Navigation) cannot be edited/moved

Editable file types

.php, .json, .md, .html, .css, .scss, .js

Create a new file / folder

  • Select the target folder in the sidebar (click the folder name), or use the root
  • Click New file or New folder (in the folder-detail pane or at the top)
  • For a new file: enter a path within the plugin (e.g. helper.php or assets/css/extra.css)
  • Subfolders are created automatically

Move / delete a file

  • Move: drag the file onto another folder (drag-and-drop), or click the pencil icon
  • Delete: click the trash button next to the file in the sidebar, with confirmation

Folder management

  • Click a folder in the sidebar to open the folder-detail pane on the right
  • New file / new folder / upload into this folder: use the buttons in the folder-detail pane
  • Delete folder: delete button in the folder-detail pane (only empty folders)

Security

  • Protected plugins (Navigation) cannot be edited
  • All actions require a CSRF token
  • Path-traversal protection via realpath() + prefix check on the plugin dir