61% easyreservations

Code Review | easyReservations

WordPress plugin easyReservations scored 61% from 54 tests.

About plugin

  • Plugin page: easyreservations
  • Plugin version: 6.0-alpha.23...
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-5.7
  • WordPress version: 5.9.2
  • First release: Aug 11, 2011
  • Latest release: Nov 28, 2021
  • Number of updates: 357
  • Update frequency: every 10.5 days
  • Top authors: feryaz (100%)

Code review

54 tests

User reviews

61 reviews

Install metrics

2,000+ active / 214,471 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲5.29MB] [CPU: ▼271.18ms] 50% from 4 tests

Server-side resources used by easyReservations
Please have a look at the following items
  • RAM: The total memory usage must be kept under 10MB (currently 11.86MB on /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php)
  • Extra RAM: The extra memory usage must be under 5MB (currently 5.29MB on /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php)
PageMemory (MB)CPU Time (ms)
Home /10.30 ▲7.17110.50 ▲74.38
Dashboard /wp-admin8.89 ▲5.4962.76 ▲30.29
Posts /wp-admin/edit.php9.20 ▲5.5666.43 ▲26.62
Add New Post /wp-admin/post-new.php11.56 ▲4.5985.88 ▼1,169.55
Media Library /wp-admin/upload.php8.83 ▲5.5452.29 ▲27.92
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php11.86107.56

Server storage [IO: ▲5.78MB] [DB: ▲0.03MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 476 new files
Database: 5 new tables, 53 new options
New tables
wp_receipt_itemmeta
wp_reservations_sessions
wp_reservationmeta
wp_reservations
wp_receipt_items
New WordPress options
reservations_price_decimal_sep
reservations_permalinks
reservations_default_location
reservations_myaccount_edit_account_endpoint
reservations_block_before
reservations_myaccount_payment_methods_endpoint
reservations_date_format
reservations_enable_taxes
reservations_earliest_arrival
widget_recent-comments
...

Browser metrics Passed 4 tests

An overview of browser requirements for easyReservations
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,053 ▲29916.33 ▲0.7017.04 ▲10.782.80 ▲0.24
Dashboard /wp-admin2,979 ▲1256.09 ▼0.03129.13 ▼11.60183.55 ▲15.18
Posts /wp-admin/edit.php2,766 ▲723.12 ▼0.1162.14 ▼1.28141.83 ▼2.66
Add New Post /wp-admin/post-new.php1,699 ▼1218.90 ▼2.48434.23 ▲9.70186.16 ▲9.41
Media Library /wp-admin/upload.php1,775 ▲835.50 ▼0.01138.11 ▼12.09210.62 ▼13.69
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php8,67519.00742.97222.33

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_reservationmeta
    • wp_receipt_itemmeta
  • Zombie WordPress options detected upon uninstall: 13 options
    • reservations_reservation_item_label
    • reservations_price_display_suffix
    • reservations_admin_notices
    • widget_easyreservations_widget_cart
    • resource_cat_children
    • reservations_schema_version
    • widget_recent-comments
    • reservations_strict_time
    • reservations_block_before
    • widget_recent-posts
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php
    • > Notice in wp-includes/class-wp-customize-nav-menus.php+1152
    Trying to get property 'title' of non-object

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/easyreservations/templates/checkout/submit.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/easyreservations/templates/single-resource/form.php:19

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php
    • > Console-api (warning) in wp-includes/js/dist/blocks.min.js?ver=28d5b8f8805a22435cbdc51927067812+1:24203
    The block \"easy-reservations/form\" is registered with an invalid category \"easy-reservations\".
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php
    • > Console-api (warning) in unknown
    /wp-includes/js/jquery/jquery.min.js?ver=3.6.0 1:31592 "jQuery.Deferred exception: wp.customize.selectiveRefresh.on is not a function" "TypeError: wp.customize.selectiveRefresh.on is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/easyreservations/assets/js/frontend/cart-fragments.min.js?ver=6.0-alpha.23:1:3021)\n at e (/wp-includes/js/jquery/jquery.min.js?ver=3.6.0:2:30038)\n at t (/wp-includes/js/jquery/jquery.min.js?ver=3.6.0:2:30340)" undefined
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php
    • > Javascript (severe) in unknown
    /wp-includes/js/jquery/jquery.min.js?ver=3.6.0 1:31702 Uncaught TypeError: wp.customize.selectiveRefresh.on is not a function

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Too many tags (15 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

easyreservations/easyReservations.php 77% from 13 tests

The entry point to "easyReservations" version 6.0-alpha.23... is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Version: Use periods and digits only for your plugin's version number (ex. "1.0.3" instead of "6.0-alpha.23...")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: The principal plugin file should be the same as the plugin slug ("easyreservations.php" instead of "easyReservations.php")

Code Analysis 97% from 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
Good job! No executable or dangerous file extensions detected93,460 lines of code in 451 files:
LanguageFilesBlank linesComment linesLines of code
PHP3169,00718,47146,221
JavaScript1027,3022,71932,131
CSS3068248015,057
SVG30151

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 103)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity26.72
▷ Minimum class complexity1.00
▷ Maximum class complexity331.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity103.00
Code structure
Namespaces0
Interfaces8
Traits1
Classes161
▷ Abstract classes2213.66%
▷ Concrete classes13986.34%
▷ Final classes32.16%
Methods1,866
▷ Static methods36519.56%
▷ Public methods1,60485.96%
▷ Protected methods19910.66%
▷ Private methods633.38%
Functions363
▷ Named functions35698.07%
▷ Anonymous functions71.93%
Constants42
▷ Global constants1433.33%
▷ Class constants2866.67%
▷ Public constants28100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
15 PNG files occupy 0.37MB with 0.25MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png62.27KB23.64KB▼ 62.04%
assets/images/logo.png3.03KB0.56KB▼ 81.44%
screenshot-4.png22.63KB7.68KB▼ 66.06%
screenshot-6.png19.56KB7.73KB▼ 60.49%
assets/images/logo32.png3.35KB0.95KB▼ 71.79%