72% dive-sites-manager

Code Review | Dive Sites Manager

WordPress plugin Dive Sites Manager scored72%from 54 tests.

About plugin

  • Plugin page: dive-sites-manager
  • Plugin version: 1.2.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2
  • WordPress version: 6.3.1
  • First release: Nov 13, 2020
  • Latest release: Apr 8, 2023
  • Number of updates: 145
  • Update frequency: every 6.0 days
  • Top authors: chonicodefish (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /742 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.48MB] [CPU: ▼0.60ms] Passed 4 tests

Server-side resources used by Dive Sites Manager
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.94 ▲0.4742.67 ▲0.43
Dashboard /wp-admin3.82 ▲0.5158.15 ▲5.15
Posts /wp-admin/edit.php3.87 ▲0.5157.53 ▲6.27
Add New Post /wp-admin/post-new.php6.40 ▲0.5191.78 ▼10.26
Media Library /wp-admin/upload.php3.66 ▲0.4240.86 ▲2.29
Display Format /wp-admin/admin.php?page=dive_sites_format3.6543.32
Dashboard /wp-admin/admin.php?page=dive_sites_manager3.6546.52
Dive Sites Characteristics /wp-admin/admin.php?page=dive_sites_characteristics3.6544.90
Add New /wp-admin/post-new.php?post_type=divesite6.3989.93
All Dive Sites /wp-admin/edit.php?post_type=divesite3.7439.80

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 58 new files
Database: no new tables, 11 new options
New WordPress options
can_compress_scripts
cfish_dsm_format
cfish_dsm
widget_recent-posts
theysaidso_admin_options
cfish_dsm_characteristics
cfish_dsm_loc
widget_theysaidso_widget
cfish_dsm_map
db_upgraded
...

Browser metrics Passed 4 tests

An overview of browser requirements for Dive Sites Manager
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,018 ▲23215.10 ▲0.701.62 ▼0.6938.94 ▼8.87
Dashboard /wp-admin2,419 ▲2426.41 ▲0.73116.15 ▲16.4738.49 ▼12.47
Posts /wp-admin/edit.php2,352 ▲2553.64 ▲1.6048.51 ▲11.1531.56 ▼6.32
Add New Post /wp-admin/post-new.php1,598 ▲5123.23 ▼0.15677.77 ▲1.3838.59 ▼19.49
Media Library /wp-admin/upload.php1,495 ▲954.39 ▲0.2287.73 ▼30.4544.89 ▼2.70
Display Format /wp-admin/admin.php?page=dive_sites_format1,5053.7363.7163.12
Dashboard /wp-admin/admin.php?page=dive_sites_manager1,1363.2945.7726.51
Dive Sites Characteristics /wp-admin/admin.php?page=dive_sites_characteristics1,1863.3143.5727.36
Add New /wp-admin/post-new.php?post_type=divesite6,27619.02840.0838.04
All Dive Sites /wp-admin/edit.php?post_type=divesite1,3463.6547.8429.63

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 11 options in the database
    • cfish_dsm
    • cfish_dsm_loc
    • widget_theysaidso_widget
    • can_compress_scripts
    • cfish_dsm_map
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • cfish_dsm_characteristics
    • widget_recent-comments
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/edit.php?post_type=divesite
    • > Notice in wp-content/plugins/dive-sites-manager/cfish-dsm-inc/Base/DiveSitesController.php+263
    Undefined index: location

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
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/dive-sites-manager/dive-sites-manager.php
  • 26× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'cfishDSMInc\\Base\\BaseController' not found in wp-content/plugins/dive-sites-manager/cfish-dsm-inc/Pages/Format.php:13
    • > PHP Notice
      Undefined variable: atts in wp-content/plugins/dive-sites-manager/templates/divesites-horizontal-left.php on line 9
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/dive-sites-manager/templates/divesites-horizontal-left.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'cfishDSMInc\\Base\\BaseController' not found in wp-content/plugins/dive-sites-manager/cfish-dsm-inc/Api/Callbacks/FormatCallbacks.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'cfishDSMInc\\Base\\BaseController' not found in wp-content/plugins/dive-sites-manager/cfish-dsm-inc/Base/I18n.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'cfishDSMInc\\Base\\BaseController' not found in wp-content/plugins/dive-sites-manager/cfish-dsm-inc/Base/DiveSitesController.php:14
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/dive-sites-manager/templates/divesites-vertical.php:11
    • > PHP Notice
      Undefined variable: atts in wp-content/plugins/dive-sites-manager/templates/divesites-horizontal-right.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'cfishDSMInc\\Base\\BaseController' not found in wp-content/plugins/dive-sites-manager/cfish-dsm-inc/Api/Callbacks/ManagerCallbacks.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'cfishDSMInc\\Base\\BaseController' not found in wp-content/plugins/dive-sites-manager/cfish-dsm-inc/Pages/Dashboard.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: dive resort, dive center, scuba, dive, diving...

dive-sites-manager/dive-sites-manager.php 92% from 13 tests

The main file in "Dive Sites Manager" v. 1.2.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 158 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected2,783 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
PHP364753292,093
JavaScript31916390
PO File199119242
CSS33257
JSON1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity7.64
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.29
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes14.55%
Methods114
▷ Static methods87.02%
▷ Public methods11298.25%
▷ Protected methods00.00%
▷ Private methods21.75%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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.18MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/horizontal-right.png3.74KB1.16KB▼ 68.97%
assets/horizontal-left.png3.78KB1.16KB▼ 69.32%
assets/watercolor.png136.84KB54.20KB▼ 60.39%
assets/vertical.png3.66KB1.15KB▼ 68.54%
assets/standard.png33.68KB12.34KB▼ 63.35%