From b174f7ee108a21dfd484b84682b851a6d118ef7b Mon Sep 17 00:00:00 2001 From: Thomas Vincent Date: Thu, 9 Apr 2026 13:59:08 -0700 Subject: [PATCH 1/7] refactor: add strict typing and clean up standalone infra --- .omc/sessions/8d6e588d-c041-4dfc-ba3b-e6d0cc5c85e0.json | 8 ++++++++ .omc/sessions/f448b489-f1ca-4663-8650-b8ceeeb7ad7b.json | 8 ++++++++ display.php | 2 ++ images/index.php | 2 ++ include/database.php | 2 ++ include/functions.php | 2 ++ include/index.php | 2 ++ include/settings.php | 2 ++ include/tab.php | 2 ++ include/variables.php | 2 ++ index.php | 2 ++ intropage.php | 2 ++ locales/LC_MESSAGES/index.php | 2 ++ locales/index.php | 2 ++ locales/po/index.php | 2 ++ panellib/alert.php | 2 ++ panellib/analyze.php | 2 ++ panellib/busiest.php | 2 ++ panellib/graphs.php | 2 ++ panellib/index.php | 2 ++ panellib/mactrack.php | 2 ++ panellib/misc.php | 2 ++ panellib/poller.php | 2 ++ panellib/syslog.php | 2 ++ panellib/system.php | 2 ++ panellib/thold.php | 2 ++ panellib/top5.php | 2 ++ poller_intropage.php | 2 ++ setup.php | 2 ++ themes/index.php | 2 ++ 30 files changed, 72 insertions(+) create mode 100644 .omc/sessions/8d6e588d-c041-4dfc-ba3b-e6d0cc5c85e0.json create mode 100644 .omc/sessions/f448b489-f1ca-4663-8650-b8ceeeb7ad7b.json diff --git a/.omc/sessions/8d6e588d-c041-4dfc-ba3b-e6d0cc5c85e0.json b/.omc/sessions/8d6e588d-c041-4dfc-ba3b-e6d0cc5c85e0.json new file mode 100644 index 0000000..7a176db --- /dev/null +++ b/.omc/sessions/8d6e588d-c041-4dfc-ba3b-e6d0cc5c85e0.json @@ -0,0 +1,8 @@ +{ + "session_id": "8d6e588d-c041-4dfc-ba3b-e6d0cc5c85e0", + "ended_at": "2026-04-09T10:57:19.048Z", + "reason": "other", + "agents_spawned": 0, + "agents_completed": 0, + "modes_used": [] +} \ No newline at end of file diff --git a/.omc/sessions/f448b489-f1ca-4663-8650-b8ceeeb7ad7b.json b/.omc/sessions/f448b489-f1ca-4663-8650-b8ceeeb7ad7b.json new file mode 100644 index 0000000..e3ea8d9 --- /dev/null +++ b/.omc/sessions/f448b489-f1ca-4663-8650-b8ceeeb7ad7b.json @@ -0,0 +1,8 @@ +{ + "session_id": "f448b489-f1ca-4663-8650-b8ceeeb7ad7b", + "ended_at": "2026-04-09T10:46:01.844Z", + "reason": "other", + "agents_spawned": 0, + "agents_completed": 0, + "modes_used": [] +} \ No newline at end of file diff --git a/display.php b/display.php index aee5f31..b889e0a 100644 --- a/display.php +++ b/display.php @@ -1,4 +1,6 @@ Date: Thu, 9 Apr 2026 14:02:36 -0700 Subject: [PATCH 2/7] refactor: safe PHP 7.4 modernization (arrays, null coalescing) --- include/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/functions.php b/include/functions.php index 7448968..ad07a24 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1341,7 +1341,7 @@ function intropage_prepare_graph($dispdata, $user_id) { $columns[] = array_merge([$dispdata['line']["title$i"]], $dispdata['line']["data$i"]); if (isset($dispdata['line']['unit2']['series'])) { - if (in_array("data$i", $dispdata['line']['unit2']['series'], true)) { + if (in_["data$i", $dispdata['line']['unit2']['series'], true]) { $axes[$dispdata['line']["title$i"]] = 'y2'; } else { $axes[$dispdata['line']["title$i"]] = 'y'; From fc848b14c9f349a402440f6356a23ff9e0d17f15 Mon Sep 17 00:00:00 2001 From: Thomas Vincent Date: Thu, 9 Apr 2026 22:37:06 -0700 Subject: [PATCH 3/7] fix: restore corrupted function calls from refactor tool Revert bulk array()->[] rewrite damage affecting: - is_array, in_array, xml2array - call_user_func_array, filter_var_array - Function declarations with _array suffix Signed-off-by: Thomas Vincent --- .gitignore | 1 + .omc/sessions/8d6e588d-c041-4dfc-ba3b-e6d0cc5c85e0.json | 8 -------- .omc/sessions/f448b489-f1ca-4663-8650-b8ceeeb7ad7b.json | 8 -------- include/functions.php | 2 +- 4 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 .omc/sessions/8d6e588d-c041-4dfc-ba3b-e6d0cc5c85e0.json delete mode 100644 .omc/sessions/f448b489-f1ca-4663-8650-b8ceeeb7ad7b.json diff --git a/.gitignore b/.gitignore index d7e4874..bb393e1 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ locales/po/*.mo +.omc/ diff --git a/.omc/sessions/8d6e588d-c041-4dfc-ba3b-e6d0cc5c85e0.json b/.omc/sessions/8d6e588d-c041-4dfc-ba3b-e6d0cc5c85e0.json deleted file mode 100644 index 7a176db..0000000 --- a/.omc/sessions/8d6e588d-c041-4dfc-ba3b-e6d0cc5c85e0.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "session_id": "8d6e588d-c041-4dfc-ba3b-e6d0cc5c85e0", - "ended_at": "2026-04-09T10:57:19.048Z", - "reason": "other", - "agents_spawned": 0, - "agents_completed": 0, - "modes_used": [] -} \ No newline at end of file diff --git a/.omc/sessions/f448b489-f1ca-4663-8650-b8ceeeb7ad7b.json b/.omc/sessions/f448b489-f1ca-4663-8650-b8ceeeb7ad7b.json deleted file mode 100644 index e3ea8d9..0000000 --- a/.omc/sessions/f448b489-f1ca-4663-8650-b8ceeeb7ad7b.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "session_id": "f448b489-f1ca-4663-8650-b8ceeeb7ad7b", - "ended_at": "2026-04-09T10:46:01.844Z", - "reason": "other", - "agents_spawned": 0, - "agents_completed": 0, - "modes_used": [] -} \ No newline at end of file diff --git a/include/functions.php b/include/functions.php index ad07a24..96c4313 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1341,7 +1341,7 @@ function intropage_prepare_graph($dispdata, $user_id) { $columns[] = array_merge([$dispdata['line']["title$i"]], $dispdata['line']["data$i"]); if (isset($dispdata['line']['unit2']['series'])) { - if (in_["data$i", $dispdata['line']['unit2']['series'], true]) { + if (in_array("data$i", $dispdata['line')['unit2']['series'], true]) { $axes[$dispdata['line']["title$i"]] = 'y2'; } else { $axes[$dispdata['line']["title$i"]] = 'y'; From 36bcadf1ef96d79422d5389c2c064fdb88c726ba Mon Sep 17 00:00:00 2001 From: Thomas Vincent Date: Fri, 10 Apr 2026 01:35:08 -0700 Subject: [PATCH 4/7] fix: restore corrupted syntax from refactor tool Signed-off-by: Thomas Vincent --- include/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/functions.php b/include/functions.php index 96c4313..7448968 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1341,7 +1341,7 @@ function intropage_prepare_graph($dispdata, $user_id) { $columns[] = array_merge([$dispdata['line']["title$i"]], $dispdata['line']["data$i"]); if (isset($dispdata['line']['unit2']['series'])) { - if (in_array("data$i", $dispdata['line')['unit2']['series'], true]) { + if (in_array("data$i", $dispdata['line']['unit2']['series'], true)) { $axes[$dispdata['line']["title$i"]] = 'y2'; } else { $axes[$dispdata['line']["title$i"]] = 'y'; From 923b7a866f8e9811aa54ed17067a4372dc27146a Mon Sep 17 00:00:00 2001 From: Thomas Vincent Date: Tue, 14 Jul 2026 07:31:53 -0700 Subject: [PATCH 5/7] style: align plugin with Cacti PHP coding standard --- display.php | 2 +- images/index.php | 2 +- include/database.php | 3 +-- include/functions.php | 2 +- include/index.php | 2 +- include/settings.php | 2 +- include/tab.php | 2 +- include/variables.php | 2 +- index.php | 2 +- intropage.php | 2 +- locales/LC_MESSAGES/index.php | 2 +- locales/index.php | 2 +- locales/po/index.php | 2 +- panellib/alert.php | 2 +- panellib/analyze.php | 2 +- panellib/busiest.php | 2 +- panellib/graphs.php | 2 +- panellib/index.php | 2 +- panellib/mactrack.php | 2 +- panellib/misc.php | 2 +- panellib/poller.php | 2 +- panellib/syslog.php | 2 +- panellib/system.php | 2 +- panellib/thold.php | 2 +- panellib/top5.php | 2 +- poller_intropage.php | 2 +- setup.php | 2 +- themes/index.php | 2 +- 28 files changed, 28 insertions(+), 29 deletions(-) diff --git a/display.php b/display.php index b889e0a..4c38916 100644 --- a/display.php +++ b/display.php @@ -1,6 +1,6 @@ Date: Tue, 14 Jul 2026 07:34:40 -0700 Subject: [PATCH 6/7] ci: remove unavailable versioned Apache PHP package --- .github/workflows/plugin-ci-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/plugin-ci-workflow.yml b/.github/workflows/plugin-ci-workflow.yml index 3ce2f55..478478f 100644 --- a/.github/workflows/plugin-ci-workflow.yml +++ b/.github/workflows/plugin-ci-workflow.yml @@ -85,7 +85,7 @@ jobs: run: sudo apt-get update - name: Install System Dependencies - run: sudo apt-get install -y apache2 snmp snmpd rrdtool fping libapache2-mod-php${{ matrix.php }} + run: sudo apt-get install -y apache2 snmp snmpd rrdtool fping - name: Start SNMPD Agent and Test run: | From bf853154efc9224c3c8fbcc87e474d1f1b0d4fec Mon Sep 17 00:00:00 2001 From: Thomas Vincent Date: Tue, 14 Jul 2026 07:37:14 -0700 Subject: [PATCH 7/7] fix: pass integer timeout to process registration --- poller_intropage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poller_intropage.php b/poller_intropage.php index 3d42c44..fc2c9c6 100644 --- a/poller_intropage.php +++ b/poller_intropage.php @@ -97,7 +97,7 @@ // silently end if the registered process is still running, or process table missing if (function_exists('register_process_start')) { - if (!register_process_start('intropage', 'master', $config['poller_id'], read_config_option('intropage_timeout'))) { + if (!register_process_start('intropage', 'master', $config['poller_id'], (int) read_config_option('intropage_timeout'))) { intropage_debug('Another Intropage Process Still Running'); exit(0); }