68% restaurantconnect-reswidget

Code Review | Restaurant Reservations Widget

WordPress plugin Restaurant Reservations Widget scored 68% from 54 tests.

About plugin

  • Plugin page: restaurantconnect...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Dec 5, 2016
  • Latest release: Dec 14, 2016
  • Number of updates: 8
  • Update frequency: every 0.4 days
  • Top authors: rconnect305 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 904 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼2.78ms] Passed 4 tests

An overview of server-side resources used by Restaurant Reservations Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.97 ▼6.49
Dashboard /wp-admin3.38 ▲0.0846.24 ▼3.52
Posts /wp-admin/edit.php3.49 ▲0.1450.01 ▲2.59
Add New Post /wp-admin/post-new.php5.96 ▲0.0788.29 ▼3.68
Media Library /wp-admin/upload.php3.30 ▲0.0736.33 ▲2.96
Add API Key /wp-admin/admin.php?page=resto-api-key3.2428.90
ResWidget Configuration /wp-admin/admin.php?page=resto-configuration3.2426.66

Server storage [IO: ▲0.08MB] [DB: ▲0.33MB] Passed 3 tests

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 6 new files
Database: 1 new table, 6 new options
New tables
wp_restaurants
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Restaurant Reservations Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,932 ▲19713.59 ▼1.0210.35 ▲8.1943.33 ▼7.37
Dashboard /wp-admin2,235 ▲446.00 ▲1.1396.73 ▼9.0963.76 ▲16.58
Posts /wp-admin/edit.php2,112 ▲232.00 ▲0.0138.90 ▲4.6535.56 ▼1.59
Add New Post /wp-admin/post-new.php1,690 ▲15722.37 ▼1.10703.11 ▲20.0050.02 ▼7.90
Media Library /wp-admin/upload.php1,414 ▲264.24 ▲0.05109.85 ▲5.6746.56 ▼1.74
Add API Key /wp-admin/admin.php?page=resto-api-key8212.0224.2823.94
ResWidget Configuration /wp-admin/admin.php?page=resto-configuration1,0732.0724.2123.26

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_restaurants
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=resto-api-key
    • > Notice in wp-content/plugins/restaurantconnect-reswidget/reswidget.php+102
    Undefined variable: arrMsg
    • > GET request to /wp-admin/admin.php?page=resto-api-key
    • > Notice in wp-content/plugins/restaurantconnect-reswidget/reswidget.php+102
    Trying to access array offset on value of type null
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=resto-configuration
    • > Notice in wp-content/plugins/restaurantconnect-reswidget/add-restaurant.php+458
    Undefined index: s
    • > GET request to /wp-admin/admin.php?page=resto-configuration
    • > Notice in wp-content/plugins/restaurantconnect-reswidget/add-restaurant.php+572
    Undefined index: id

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 take a closer look at the following
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/restaurantconnect-reswidget/add-restaurant.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/restaurantconnect-reswidget/reswidget.php:16
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/restaurantconnect-reswidget/add-restaurant.php on line 5
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/restaurantconnect-reswidget/add-restaurant.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Requires at least: Version not formatted correctly
Please take inspiration from this readme.txt

restaurantconnect-reswidget/reswidget.php 92% from 13 tests

"Restaurant Reservations Widget" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("restaurantconnect-reswidget.php" instead of "reswidget.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
No dangerous file extensions were detected465 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP238729423
JavaScript114042

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity8.50
▷ Minimum class complexity7.00
▷ Maximum class complexity10.00
Average method complexity1.88
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
1 PNG file occupies 0.05MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/icon2.png50.59KB0.66KB▼ 98.70%