Saturn
Saturn 1.0.0
Saturn 1.0.0
  • Saturn 1.0.0
  • 😁User Guide
    • Settings
      • Maintenance Mode
      • Website Environment
    • Security
      • Good security practices
      • Security Notice
    • System Requirements and Support
    • Update your Server
  • ⚠️Troubleshooting
    • Errors
      • Database Errors
      • Saturn Errors
      • Checksum Issues
  • 🧩Plugins
    • Plugins in Saturn
    • Official Plugins
      • Control Panel
        • User Guide
        • Developer Guide
          • Control Panel Hooks
    • Marketplace Plugins
  • 💻Developer Documentation
    • Getting Started
    • Libraries and Functions
      • AccountManager
        • Permissions
        • UUID
      • DatabaseManager
        • DBMS
          • Sending Database Requests
          • Query Information
          • Database Security
        • Database Actions
      • HookManager
        • Actions
        • Runners
      • HTTP
      • LanguageManager
      • PluginManager
        • Manage Plugin Content
        • Plugin Compatability
        • Check if a plugin is loaded.
        • Fetch Manifest
      • RouteManager
      • SecurityManager
        • Cross-site Request Forgery
        • Cross-site Scripting
      • SessionManager
        • Start and End Sessions
        • Validate Sessions
        • Session Data
      • TestManager
    • Security
    • Plugins
      • How to structure a plugin
      • Manifest
      • APIs
      • Checking for Dependencies
      • Power Features
        • 💤Hibernate
    • Hooks
    • Tests and Profiling
    • Global Variables
Powered by GitBook
On this page
  • What happens when my plugin hibernates?
  • How do I hibernate my plugin?
  • Potential drawbacks
  1. Developer Documentation
  2. Plugins
  3. Power Features

Hibernate

Hibernate is a feature intended to speed up Saturn websites by skipping plugins that would otherwise not do anything the user needs on a specific page.

For example: if your plugin enchances the login page, why load it on every single page in Saturn? It's faster to hibernate the plugin than to load it, it also reduces the number of unintended bugs your plugin could cause.

What happens when my plugin hibernates?

For your plugin, nothing. No files will be loaded and nothing will be included. Your plugin will still appear in Saturn's list of plugins, but unless it's active it won't be loaded.

If your plugin hibernates in the official Control Panel plugin it will show as unloaded in the plugin list, and when clicked on it will inform the user that the plugin is hibernating.

How do I hibernate my plugin?

Simply edit the manifest file, and add a list of URLs you'd like your plugin to "wake up" on. When a user visits one of these URLs, the plugin will load. If the URL is not visited, the plugin will hibernate.

To disable Hibernate simply enter false:

"Hibernate": false

To enable Hibernate, enter an array list of URLs. This example plugin will wake up when a user visits example.com/login or example.com/register

The plugin will also wake up if a user visits sub-pages of the pages you listed, such as example.com/login/reset

"Hibernate": ["/login", "/register"]

Potential drawbacks

If your plugin is intended for use on the majority of Saturn, excluding one of two pages, it might not be worth enabling Hibernate.

Saturn uses loops to find Hibernate URLs, so if you have a lot of URLs, this may just slow down your plugin more.

PreviousPower FeaturesNextHooks

Last updated 1 year ago

💻
💤