Cacti 1.3 types api_plugin_register_hook() 5th arg as bool enable. These calls passed int 1, which only coerces while the file lacks declare(strict_types=1); pass true so they stay type-correct. php -l clean.
* Fix select2 change recursion from double-wired Criticality device filter
Gate the client-side Criticality filter injection on whether core already rendered the field (device_filters/CactiTableFilter) instead of a CACTI_VERSION string. When core renders it natively the handler now bails, avoiding the second widget/handler that drove the select2 change -> selection:update recursion. Legacy releases still inject once, matching core's widget engine and binding a single namespaced change handler.
* test: cover monitor_device_table_bottom() filter injection
Exercise the device_table_bottom hook that injects the legacy Criticality filter, locking in the select2 change-recursion fix: the bail guard when core already rendered the field, a single namespaced change.monitor handler, a single widget engine (never both), theme gating, and the selected-option build. Covers the previously untested changed lines (setup.php patch-coverage gate).
* Relocate schema to includes/database.php via plugin table API + db_update_table upgrade
* CI: allowlist unmeasured schema bootstrap and web entry points
* CI: keep include_once for the settings-page-only lib/reports.php load (uncoverable)
* Add manifest.json + upgrade-time file pruning; consolidate themes/ into css/
* database: keep user-owned dashboards table across uninstall
api_plugin_db_table_create() records plugin_monitor_dashboards in
plugin_db_changes, so api_plugin_db_changes_remove() (run by
api_plugin_uninstall() after plugin_monitor_uninstall()) would drop it
even though monitor_drop_tables() intentionally leaves it in place. Remove
the 'create' ownership record after provisioning (install and upgrade
paths) so user dashboards survive an uninstall. Adds a regression test.
* Prune phpunit.xml on upgrade and ignore markdown-lint configs
phpunit.xml ships in the repo for CI but is a dev-only test artifact, so it
is removed from manifest.json 'expected', pruned from installs on upgrade
(like tests/), and excluded from the manifest drift check.
The retired markdown-lint configs (.mdlrc, .md_style.rb) are deleted, and
.md* is now ignored like .git*: protected from pruning and excluded from
drift if it reappears.
* Move libraries into includes/, flatten css, drop sonar config
db_functions.php, monitor_render.php and monitor_controller.php move into
includes/ (the latter two lose the monitor_ prefix, becoming render.php and
controller.php); monitor.php and the tests load them from there. Each per-theme
stylesheet css/<theme>/monitor.css becomes css/<theme>.css so users can drop
their own css/<theme>.css into the css base, and plugin_monitor_page_head()
looks there, falling back to css/monitor.css. The unreferenced
sonar-project.properties is removed. Old paths are tombstoned so existing
installs drop the stale copies on upgrade.
* Rename includes/db_functions.php to includes/functions.php
Follows the fleet convention for the plugin's shared library filename; monitor.php,
the measured-source list and the unit test load it from the new name.
* Regenerate cacti.pot for the includes/ file relocations
Moving the plugin's library files into includes/ changed the source-reference
lines in the translation template; regenerate it so the 'Verify translation
template' CI check passes.
* Harden prune against tampered-manifest path traversal
The upgrade-time prune now rejects any tombstone containing '.'/'..' segments
(which could escape the plugin directory or resolve to its root) and treats
ancestors of whitelist entries as protected, so a tombstone on a parent
directory can no longer delete a whitelisted file beneath it.
* docs: update and align the Project Structure block
Point the structure tree at the relocated files (libraries now under
includes/, data files under docs/, stylesheets under css/) and align the
trailing '# ...' comments to a single column so they no longer drift right.
* docs/tests: standardize test header and correct manifest-contract notes
- Use the full license header (from the plugin's own setup.php) in
tests/Unit/PruneFilesTest.php instead of the abbreviated copyright banner.
- Document that the manifest drift check and the upgrade-time prune also
handle phpunit.xml and .md* files, matching the implemented behavior.
* refactor: rename prune helpers to the plugin-slug function prefix
The repository naming contract reserves the plugin_<name>_ prefix for plugin
lifecycle / hook-registration functions; all other functions use the plain
<name>_ prefix. Rename the internal upgrade helpers accordingly:
plugin_<name>_prune_files() -> <name>_prune_files()
plugin_<name>_rmtree() -> <name>_rmtree()
The call site, unit tests, and the copilot-instructions.md references are
updated to match. No behavioral change.
* chore: set the Cacti compatibility floor to 1.2.29
Align the compat metadata (and the contributor-guide references) with the
team decision to standardize the minimum supported Cacti version at 1.2.29;
the previously proposed 1.2.32 floor was not adopted.
* Bump plugin version to 3.0 so the upgrade-time cleanup migration runs
Add a 3.0 CHANGELOG section for this cycle's schema/manifest work and set
INFO version = 3.0 so existing 2.9 installs detect the version change and
run the schema refresh and manifest-based file prune.
---------
Co-authored-by: Copilot <copilot@users.noreply.github.com>
* Add PHPDoc blocks to all functions in setup.php
This plugin's other PHP files (db_functions.php, monitor_controller.php,
monitor_render.php, poller_functions.php) already have complete PHPDoc
coverage from prior work. This adds PHPDoc blocks (description,
@param, @return, and applicable @global tags) to the 25 functions in
setup.php, the one file that had none.
No functional changes; documentation only. Validated with php -l.
* Address review feedback and refresh translation template
- Correct plugin_monitor_uninstall() docblock to list the three tables it actually drops
- Fix @global type/usage for $page_refresh_interval in monitor_config_settings()
- Fix @return type for monitor_top_graph_refresh() (int|string, not int)
- Regenerate locales/po/cacti.pot (source line references only)
* Fix .gitignore pattern for compiled .mo files (they live under locales/LC_MESSAGES/, not locales/po/)
* fix: don't apply jQuery UI selectmenu on the criticality select if select2 already did
Cacti core is converting its global select-enhancement catch-all from
jQuery UI selectmenu to select2. If core's catch-all already turned the
dynamically-inserted #criticality select into a select2, skip re-applying
selectmenu to it here too, so it doesn't render twice.
* chore: bump minimum compatible Cacti version to 1.2.32
* fix: wire applyFilter() to the select2 branch of the criticality select
Copilot review caught this: the select2-hidden-accessible branch skipped
selectmenu's change:applyFilter() callback entirely, so choosing a
criticality no longer reloaded the filtered device list once core had
already converted the select to select2. Bind change->applyFilter()
directly in that branch instead.
Also regenerate locales/po/cacti.pot (and the merged .po/.mo files) via
locales/build_gettext.sh - setup.php's line numbers shifted.
* Add a feature (send one email to all recipients in case of device reboot)
Add a feature (send one email to all recipients in case of device reboot)
* Add a feature (send one email to all recipients in case of device reboot)
Add a feature (send one email to all recipients in case of device reboot)
* Update poller_monitor.php
* Update setup.php
---------
Co-authored-by: TheWitness <thewitness@cacti.net>
* Correct additional PSR issues from recent pull request
* Monitor can remove all main data collector devices
* Monitor poller should not be run on remote data collectors
* Split off CHANGELOG.md from README.md
* Added option to Loop the alarm sound.
* Minor fix for undefined **get_monitor_sound_loop** shown in logs
* Fix issue with sound still looping even when user set not to loop sound
* Update README.md
* Fix spelling mistake for Monitor Size Drop-down.
The default is Medium, but it defaults to Extra Small due to this spelling mistake.
* Feature - Add zoom with options on device down for monitor plugin.
* Mostly Cacti PSR Updates
* More PSR Updates
* More PSR Updates
* More PSR Updates
Co-authored-by: TheWitness <thewitness@cacti.net>