All checks were successful
Build & Release Plugin / release (push) Successful in 12s
49 lines
1.8 KiB
Markdown
49 lines
1.8 KiB
Markdown
# SitiWebUpdater2 - Globale Plugin Updater
|
|
|
|
Deze class gebruikt een globale registry zodat alle plugins die deze updater gebruiken hun licenties op één centrale pagina beheren.
|
|
|
|
## Gebruik
|
|
|
|
### Basis setup (per plugin)
|
|
|
|
```php
|
|
require_once 'path/to/SitiWebUpdater2.php';
|
|
|
|
$updater = new SitiWebUpdater2( __FILE__ );
|
|
$updater->set_owner( 'jouw-github-username' );
|
|
$updater->set_repository( 'jouw-plugin-repo' );
|
|
$updater->initialize();
|
|
```
|
|
|
|
### Automatische features
|
|
|
|
De updater doet alles automatisch:
|
|
|
|
1. **Globale license pagina**: Voegt één instellingen pagina toe onder Instellingen > Plugin Licenties
|
|
2. **Admin notices**: Toont rood bericht per plugin als licentie ongeldig is
|
|
3. **Dagelijkse checks**: Controleert dagelijks alle licenties
|
|
4. **Auto-updates**: Controleert op updates voor alle plugins
|
|
|
|
### Centrale licentie pagina
|
|
|
|
Alle plugins die SitiWebUpdater2 gebruiken verschijnen automatisch op de centrale pagina `Instellingen > Plugin Licenties`, waar je alle licentiecodes in één keer kunt beheren.
|
|
|
|
## Configuratie
|
|
|
|
- **Owner/Repo**: Stel in via `set_owner()` en `set_repository()`
|
|
- **API URL**: Standaard `https://plugins.robert.ooo`, aanpasbaar met `set_api_base_url()`
|
|
- **License key**: Wordt opgeslagen in eigen option key per plugin
|
|
|
|
## Option Keys (per plugin)
|
|
|
|
- `siti_updater_{plugin_slug}_license_key`: De licentiecode
|
|
- `siti_updater_{plugin_slug}_license_data`: Gecachte licentie data
|
|
- `siti_updater_{plugin_slug}_last_check`: Timestamp laatste check
|
|
|
|
## Cron Jobs (per plugin)
|
|
|
|
- `siti_updater_daily_check_siti_updater_{plugin_slug}_`: Dagelijkse licentie verificatie
|
|
|
|
## Herbruikbaarheid
|
|
|
|
Deze class is volledig herbruikbaar in meerdere plugins. Elke plugin registreert zichzelf automatisch in de globale registry en verschijnt op de centrale licentie pagina. |