73% opr-place-reservations

Code Review | OPR Place Reservations

WordPress plugin OPR Place Reservations scored73%from 54 tests.

About plugin

  • Plugin page: opr-place-reserva...
  • Plugin version: 1.1.12
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.3
  • WordPress version: 6.3.1
  • First release: Mar 26, 2020
  • Latest release: Jul 22, 2023
  • Number of updates: 22
  • Update frequency: every 55.2 days
  • Top authors: orwokki (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,472 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by OPR Place Reservations
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.87 ▲1.4145.39 ▲5.06
Dashboard /wp-admin4.57 ▲1.2749.26 ▲1.83
Posts /wp-admin/edit.php4.68 ▲1.3254.84 ▲7.97
Add New Post /wp-admin/post-new.php7.17 ▲1.2894.59 ▼12.94
Media Library /wp-admin/upload.php4.49 ▲1.2645.49 ▲13.87
Places /wp-admin/admin.php?page=opr-places4.4648.74
Types & locations /wp-admin/admin.php?page=opr-types4.4638.68
Settings /wp-admin/admin.php?page=opr-settings4.4739.50
Import /wp-admin/admin.php?page=opr-importer4.4736.83
Reservations /wp-admin/admin.php?page=opr-reservations4.4641.89

Server storage [IO: ▲0.31MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 36 new files
Database: 5 new tables, 6 new options
New tables
wp_opr_reservations
wp_opr_places_locations
wp_opr_places
wp_opr_reservations_period_types
wp_opr_places_place_types
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

OPR Place Reservations: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,863 ▲12813.70 ▼0.674.35 ▲2.7536.37 ▼5.56
Dashboard /wp-admin2,255 ▲675.87 ▲0.01110.66 ▲10.0739.47 ▲0.99
Posts /wp-admin/edit.php2,147 ▲582.04 ▲0.0244.20 ▲8.7934.57 ▼1.29
Add New Post /wp-admin/post-new.php1,561 ▲2423.59 ▲0.24670.75 ▲75.8435.55 ▼22.67
Media Library /wp-admin/upload.php1,443 ▲524.24 ▼0.08112.57 ▲9.2645.70 ▲1.73
Places /wp-admin/admin.php?page=opr-places1,0562.2227.8131.66
Types & locations /wp-admin/admin.php?page=opr-types9602.2339.0929.85
Settings /wp-admin/admin.php?page=opr-settings1,1382.0626.3630.90
Import /wp-admin/admin.php?page=opr-importer9432.0727.5432.18
Reservations /wp-admin/admin.php?page=opr-reservations1,0362.2229.1830.09

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The plugin did not uninstall successfully, leaving 5 tables in the database
    • wp_opr_reservations_period_types
    • wp_opr_places
    • wp_opr_places_locations
    • wp_opr_places_place_types
    • wp_opr_reservations
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% 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 fix the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Orwokki\\PlaceReservations\\Importer\\FileImporter' not found in wp-content/plugins/opr-place-reservations/classes/Importer/ReservationsWithPlacesImporter.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Orwokki\\PlaceReservations\\Importer\\FileImporter' not found in wp-content/plugins/opr-place-reservations/classes/Importer/ReservationsImporter.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Orwokki\\PlaceReservations\\Importer\\FileImporter' not found in wp-content/plugins/opr-place-reservations/classes/Importer/PlacesImporter.php:8

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% 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: Please add an image for screenshot #1 (Admin UI 4)
You can take inspiration from this readme.txt

opr-place-reservations/opr-place-reservations.php 85% from 13 tests

The main PHP script in "OPR Place Reservations" version 1.1.12 is automatically included on every request by WordPress
The following require your attention:
  • Requires at least: The required version number must match the one declared in readme.txt ("5.4" instead of "5.8")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected5,501 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP207963583,607
JavaScript10349811,492
PO File1154251372
CSS21030

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity29.42
▷ Minimum class complexity1.00
▷ Maximum class complexity137.00
Average method complexity3.37
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes19
▷ Abstract classes15.26%
▷ Concrete classes1894.74%
▷ Final classes00.00%
Methods228
▷ Static methods00.00%
▷ Public methods16773.25%
▷ Protected methods93.95%
▷ Private methods5222.81%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants26
▷ Global constants00.00%
▷ Class constants26100.00%
▷ Public constants26100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin