10% pandora-fms-wp

Code Review | Pandora FMS WP - Monitoring Wordpress from Pandora FMS

WordPress plugin Pandora FMS WP - Monitoring Wordpress from Pandora FMS scored10%from 54 tests.

About plugin

  • Plugin page: pandora-fms-wp
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.9
  • WordPress version: 6.3.1
  • First release: Mar 6, 2017
  • Latest release: Feb 10, 2022
  • Number of updates: 11
  • Update frequency: every 163.7 days
  • Top authors: articast (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /919 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/pandora-fms-wp/includes/pagination.class.php+4
    Methods with the same name as their class will not be constructors in a future version of PHP; pagination has a deprecated constructor

Server metrics [RAM: ▼1.58MB] [CPU: ▼56.20ms] Passed 4 tests

An overview of server-side resources used by Pandora FMS WP - Monitoring Wordpress from Pandora FMS
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.41 ▼1.067.16 ▼35.49
Dashboard /wp-admin2.43 ▼0.888.79 ▼53.82
Posts /wp-admin/edit.php2.43 ▼0.938.66 ▼42.00
Add New Post /wp-admin/post-new.php2.43 ▼3.469.07 ▼93.50
Media Library /wp-admin/upload.php2.43 ▼0.807.39 ▼29.27
Audit records /wp-admin/admin.php?page=pfms_wp_admin_menu_access_control2.439.64
Dashboard /wp-admin/admin.php?page=pfms_wp_admin_menu2.437.85
General Setup /wp-admin/admin.php?page=pfms_wp_admin_menu_general_setup2.438.78

Server storage [IO: ▲0.15MB] [DB: ▲0.00MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 22 new files
Database: 2 new tables, 11 new options
New tables
wp_pfms-wp::access_control
wp_pfms-wp::user_stats
New WordPress options
widget_recent-posts
can_compress_scripts
pfms-wp::installed
pfmswp-options-access_control
pfmswp-options
pfms-wp::installed_plugins
theysaidso_admin_options
widget_recent-comments
pfms-wp::installed_themes
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

Checking browser requirements for Pandora FMS WP - Monitoring Wordpress from Pandora FMS
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,863 ▲7714.42 ▼0.112.02 ▲0.0239.16 ▼4.23
Dashboard /wp-admin2,240 ▲604.90 ▼0.7797.87 ▲7.5289.07 ▲53.05
Posts /wp-admin/edit.php2,147 ▲442.31 ▲0.3740.40 ▼2.4737.10 ▲0.56
Add New Post /wp-admin/post-new.php1,718 ▲19022.49 ▼0.69655.84 ▼17.8638.48 ▼12.85
Media Library /wp-admin/upload.php1,442 ▲454.50 ▲0.32107.85 ▲3.7876.95 ▲28.87
Audit records /wp-admin/admin.php?page=pfms_wp_admin_menu_access_control9562.1934.5029.36
Dashboard /wp-admin/admin.php?page=pfms_wp_admin_menu1,0751.9926.8230.35
General Setup /wp-admin/admin.php?page=pfms_wp_admin_menu_general_setup1,1301.8926.6236.56

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% from 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/pandora-fms-wp/includes/pagination.class.php+4
    Methods with the same name as their class will not be constructors in a future version of PHP; pagination has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pfms_wp_admin_menu_general_setup
    • > Deprecated in wp-content/plugins/pandora-fms-wp/includes/pagination.class.php+4
    Methods with the same name as their class will not be constructors in a future version of PHP; pagination has a deprecated constructor
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pfms_wp_admin_menu
    • > Notice in wp-content/plugins/pandora-fms-wp/includes/PandoraFMS_WP.class.php+830
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/pandora-fms-wp/includes/PandoraFMS_WP.class.php:19
    • > PHP Notice
      Undefined variable: plugin_dir_path in wp-content/plugins/pandora-fms-wp/includes/PFMS_AdminPages.class.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/pandora-fms-wp/includes/PFMS_ApiRest.class.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: security, monitoring, secure, audit

pandora-fms-wp/pandorafms-wp.php 77% from 13 tests

This is the main PHP file of "Pandora FMS WP - Monitoring Wordpress from Pandora FMS" version 2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 219 characters long)
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("pandora-fms-wp.php" instead of "pandorafms-wp.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin3,066 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP76752102,322
JavaScript211428340
INI1240330
Markdown113048
Perl16715
CSS10011

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity35.40
▷ Minimum class complexity2.00
▷ Maximum class complexity73.00
Average method complexity2.87
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods92
▷ Static methods4751.09%
▷ Public methods8289.13%
▷ Protected methods00.00%
▷ Private methods1010.87%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/icon.png0.72KB0.37KB▼ 48.51%