72% fireems-stats

Code Review | FireEMS Stats

WordPress plugin FireEMS Stats scored72%from 54 tests.

About plugin

  • Plugin page: fireems-stats
  • Plugin version: 4.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.5
  • WordPress version: 6.3.1
  • First release: Nov 26, 2015
  • Latest release: Sep 11, 2020
  • Number of updates: 26
  • Update frequency: every 67.3 days
  • Top authors: MalteseSolutions (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /4,752 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.59MB] [CPU: ▲2.02ms] 75% from 4 tests

Server-side resources used by FireEMS Stats
It is recommended to improve the following
  • CPU: Try to keep total CPU usage under 500.00ms (currently 10,036.85ms on /wp-admin/admin.php?page=fems-settings)
PageMemory (MB)CPU Time (ms)
Home /4.07 ▲0.6145.97 ▲7.44
Dashboard /wp-admin3.89 ▲0.5949.85 ▲3.96
Posts /wp-admin/edit.php3.94 ▲0.5948.50 ▼1.95
Add New Post /wp-admin/post-new.php6.47 ▲0.5986.51 ▼1.38
Media Library /wp-admin/upload.php3.81 ▲0.5940.86 ▲8.13
Fire/EMS Stats /wp-admin/admin.php?page=fems-stats3.8037.70
Help & FAQs /wp-admin/admin.php?page=fems-faq3.8035.14
Settings /wp-admin/admin.php?page=fems-settings3.8310,036.85
View Prior Stats /wp-admin/admin.php?page=fems-prior3.8033.95

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 138 new files
Database: 2 new tables, 9 new options
New tables
wp_fems
wp_fems_2023
New WordPress options
widget_fems_widget_month
fems_options
can_compress_scripts
widget_recent-posts
db_upgraded
recovery_mode_email_last_sent
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

FireEMS Stats: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲7813.27 ▼1.031.92 ▲0.1147.21 ▲4.04
Dashboard /wp-admin2,239 ▲515.86 ▼0.0296.14 ▼18.2678.93 ▲32.26
Posts /wp-admin/edit.php2,116 ▲271.99 ▼0.0433.79 ▼3.3832.71 ▲4.16
Add New Post /wp-admin/post-new.php1,548 ▲3418.23 ▲0.64700.67 ▲7.9757.54 ▲3.25
Media Library /wp-admin/upload.php1,412 ▲274.17 ▼0.0096.77 ▼5.0872.94 ▲31.56
Fire/EMS Stats /wp-admin/admin.php?page=fems-stats1,1954.0743.0967.59
Help & FAQs /wp-admin/admin.php?page=fems-faq1,1494.3241.8353.20
Settings /wp-admin/admin.php?page=fems-settings1,3584.0544.2847.47
View Prior Stats /wp-admin/admin.php?page=fems-prior7262.9618.2829.45

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 8 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_fems_widget_month
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • recovery_mode_email_last_sent
    • theysaidso_admin_options

Smoke tests 25% 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)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=fems-prior
    • > Parse error in wp-content/plugins/fireems-stats/admin/partials/fems-prior-stats.php+209
    syntax error, unexpected end of file

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/fireems-stats/includes/class-fireems-stats-backup.php
    • > /wp-content/plugins/fireems-stats/public/class-fireems-stats-widget-month.php
  • 23× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Puc_v4p10_Theme_UpdateChecker' not found in wp-content/plugins/fireems-stats/update-check/Puc/v4p10/Vcs/ThemeUpdateChecker.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/fireems-stats/admin/partials/fems-faq.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/fireems-stats/admin/partials/fems-stats.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Puc_v4p10_Update' not found in wp-content/plugins/fireems-stats/update-check/Puc/v4p10/Plugin/Update.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Puc_v4p10_Vcs_Api' not found in wp-content/plugins/fireems-stats/update-check/Puc/v4p10/Vcs/GitLabApi.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Puc_v4p10_DebugBar_Panel' not found in wp-content/plugins/fireems-stats/update-check/Puc/v4p10/DebugBar/PluginPanel.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Puc_v4p10_DebugBar_Panel' not found in wp-content/plugins/fireems-stats/update-check/Puc/v4p10/DebugBar/ThemePanel.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Puc_v4p10_Vcs_Api' not found in wp-content/plugins/fireems-stats/update-check/Puc/v4p10/Vcs/BitBucketApi.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Puc_v4p10_Metadata' not found in wp-content/plugins/fireems-stats/update-check/Puc/v4p10/Update.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Puc_v4p10_InstalledPackage' not found in wp-content/plugins/fireems-stats/update-check/Puc/v4p10/Plugin/Package.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots lack descriptions #1, #2, #3 in fireems-stats/assets to your readme.txt
The official readme.txt might help

fireems-stats/fireems-stats.php 92% from 13 tests

This is the main PHP file of "FireEMS Stats" version 4.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected8,063 lines of code in 87 files:
LanguageFilesBlank linesComment linesLines of code
PHP582,9643,1087,219
PO File21122125712
CSS514159
JavaScript28540
SQL19033

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity21.48
▷ Minimum class complexity1.00
▷ Maximum class complexity159.00
Average method complexity3.09
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes45
▷ Abstract classes511.11%
▷ Concrete classes4088.89%
▷ Final classes00.00%
Methods470
▷ Static methods337.02%
▷ Public methods28961.49%
▷ Protected methods16034.04%
▷ Private methods214.47%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants125.00%
▷ Class constants375.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/icons/red-fire-truck-md.png1.06KB0.81KB▼ 23.37%
admin/images/icons/green-fire-truck-md.png1.13KB0.88KB▼ 22.22%
admin/images/icons/red-fire-truck.png0.96KB0.70KB▼ 26.48%
admin/images/icons/green-fire-truck.png0.93KB0.69KB▼ 26.44%
admin/images/small_ms.png8.56KB3.00KB▼ 64.96%