83% fortressdb

Code Review | FortressDB

WordPress plugin FortressDB scored83%from 54 tests.

About plugin

  • Plugin page: fortressdb
  • Plugin version: 2.0.23
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0
  • WordPress version: 6.3.1
  • First release: Apr 23, 2020
  • Latest release: Jul 19, 2022
  • Number of updates: 29
  • Update frequency: every 29.2 days
  • Top authors: fortressdb (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /4,288 total downloads

Benchmarks

Plugin footprint 83% 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.19MB] [CPU: ▲0.65ms] Passed 4 tests

Analyzing server-side resources used by FortressDB
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.1948.05 ▲2.94
Dashboard /wp-admin3.49 ▲0.1957.29 ▲2.00
Posts /wp-admin/edit.php3.62 ▲0.2653.91 ▲2.46
Add New Post /wp-admin/post-new.php6.08 ▲0.1994.11 ▼4.81
Media Library /wp-admin/upload.php3.42 ▲0.1944.35 ▲6.95

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 139 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for FortressDB
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,082 ▲32125.21 ▲10.6856.99 ▲55.2217.41 ▼29.75
Dashboard /wp-admin2,304 ▲13311.60 ▲6.03137.77 ▲32.7287.52 ▲43.22
Posts /wp-admin/edit.php2,244 ▲14111.24 ▲9.2580.26 ▲38.7343.10 ▲4.50
Add New Post /wp-admin/post-new.php6,231 ▲4,70020.18 ▼2.79808.85 ▲125.0734.23 ▼19.11
Media Library /wp-admin/upload.php1,539 ▲13911.84 ▲7.60149.26 ▲34.5189.92 ▲41.34

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
  • 32× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'FortressDB_Wp_Api_Exception' not found in wp-content/plugins/fortressdb/includes/class-fortressdb-api-unauthorized-exception.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/fortressdb/addons/forminator/views/sections/authorize.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function FortressDB\\Migrations\\fortressdb_includes_dir() in wp-content/plugins/fortressdb/migrations/forminator_checkboxes.php:7
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/fortressdb/addons/forminator/views/settings/connection/authorize.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'FortressDB' not found in wp-content/plugins/fortressdb/addons/forminator/lib/class-fortressdb-forminator-form-hooks.php:4
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/fortressdb/addons/forminator/views/settings/connection/wait-authorize.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'FortressDB_Forminator_Addon_Exception' not found in wp-content/plugins/fortressdb/addons/forminator/lib/class-fortressdb-forminator-form-settings-exception.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/fortressdb/addons/forminator/views/settings/connection/wait-authorize.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'FortressDB_Wp_Api_Exception' not found in wp-content/plugins/fortressdb/includes/class-fortressdb-api-not-found-exception.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function fortressdb_addons_dir() in wp-content/plugins/fortressdb/addons/forminator/fortressdb.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

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:
  • Donate link: Please fix this invalid URI: ""
You can take inspiration from this readme.txt

fortressdb/plugin.php 92% from 13 tests

The primary PHP file in "FortressDB" version 2.0.23 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("fortressdb.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin5,642 lines of code in 104 files:
LanguageFilesBlank linesComment linesLines of code
PHP581,0881,9265,378
SVG21010217
CSS100030
JavaScript150817

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity22.14
▷ Minimum class complexity1.00
▷ Maximum class complexity109.00
Average method complexity3.86
▷ Minimum method complexity1.00
▷ Maximum method complexity59.00
Code structure
Namespaces2
Interfaces2
Traits0
Classes27
▷ Abstract classes00.00%
▷ Concrete classes27100.00%
▷ Final classes27.41%
Methods184
▷ Static methods2413.04%
▷ Public methods14679.35%
▷ Protected methods147.61%
▷ Private methods2413.04%
Functions83
▷ Named functions4048.19%
▷ Anonymous functions4351.81%
Constants47
▷ Global constants2859.57%
▷ Class constants1940.43%
▷ Public constants19100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
22 PNG files occupy 1.07MB with 0.58MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
addons/forminator/assets/images/fortressdb.png3.75KB2.30KB▼ 38.70%
addons/weforms/assets/images/fortressdb.png3.75KB2.30KB▼ 38.70%
build/assets/c3c81b46a35a19bd36a26d66a1e03b8f.png83.60KB35.16KB▼ 57.94%
build/pages/assets/0d0f468071c8f10827a9a94d44344726.png46.85KB16.15KB▼ 65.52%
build/assets/ecb34ce9b21d9c58f8893a70dbd21e6f.png59.63KB17.29KB▼ 71.01%