62% bookalet

Code Review | Bookalet

WordPress plugin Bookalet scored62%from 54 tests.

About plugin

  • Plugin page: bookalet
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.8-4.9.8
  • WordPress version: 6.3.1
  • First release: Aug 10, 2018
  • Latest release: Nov 15, 2018
  • Number of updates: 6
  • Update frequency: every 16.3 days
  • Top authors: Bookalet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /984 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.86MB] [CPU: ▼34.20ms] Passed 4 tests

This is a short check of server-side resources used by Bookalet
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0942.10 ▼12.66
Dashboard /wp-admin3.08 ▼0.2222.54 ▼26.63
Posts /wp-admin/edit.php3.08 ▼0.2724.75 ▼26.62
Add New Post /wp-admin/post-new.php3.08 ▼2.8028.36 ▼70.89
Media Library /wp-admin/upload.php3.08 ▼0.1527.25 ▼8.58
Bookalet /wp-admin/options-general.php?page=bookalet3.0823.55

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Bookalet: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲6213.25 ▼1.501.85 ▼0.1142.50 ▼0.67
Dashboard /wp-admin2,214 ▲234.87 ▼0.04110.94 ▲0.7542.79 ▲0.70
Posts /wp-admin/edit.php2,100 ▲112.05 ▲0.0641.68 ▲0.9737.17 ▲0.60
Add New Post /wp-admin/post-new.php1,531 ▼618.39 ▲0.28640.59 ▲16.3361.21 ▲6.44
Media Library /wp-admin/upload.php1,390 ▼14.19 ▲0.00100.12 ▲3.5544.14 ▼0.60
Bookalet /wp-admin/options-general.php?page=bookalet8472.0625.7331.14

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 25% 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/options-general.php?page=bookalet
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

SRP 0% 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
Please fix the following items
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/bookalet/admin/partials/bookalet-admin-error.php
    • > /wp-content/plugins/bookalet/admin/picker.php
    • > /wp-content/plugins/bookalet/admin/picker.widget.php
  • 66× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Trying to get property 'Id' of non-object in wp-content/plugins/bookalet/admin/picker.widget.php on line 19
    • > PHP Notice
      Undefined variable: widget in wp-content/plugins/bookalet/admin/picker.widget.php on line 54
    • > PHP Notice
      Undefined variable: properties in wp-content/plugins/bookalet/admin/picker.widget.php on line 9
    • > PHP Notice
      Undefined variable: widget in wp-content/plugins/bookalet/admin/picker.widget.php on line 13
    • > PHP Notice
      Trying to get property 'Id' of non-object in wp-content/plugins/bookalet/admin/picker.widget.php on line 2
    • > PHP Notice
      Undefined variable: widget in wp-content/plugins/bookalet/admin/picker.widget.php on line 47
    • > PHP Notice
      Undefined variable: widget in wp-content/plugins/bookalet/admin/picker.widget.php on line 41
    • > PHP Notice
      Undefined variable: widget in wp-content/plugins/bookalet/admin/picker.widget.php on line 25
    • > PHP Notice
      Undefined variable: widget in wp-content/plugins/bookalet/admin/picker.widget.php on line 25
    • > PHP Notice
      Trying to get property 'Id' of non-object in wp-content/plugins/bookalet/admin/picker.widget.php on line 47

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3, #4 in bookalet/assets to your readme.txt
The official readme.txt might help

bookalet/bookalet.php 92% from 13 tests

This is the main PHP file of "Bookalet" version 1.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 151 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin2,178 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript215691,050
PHP16171576652
CSS14728476

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity5.62
▷ Minimum class complexity1.00
▷ Maximum class complexity25.00
Average method complexity1.82
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods45
▷ Static methods48.89%
▷ Public methods4088.89%
▷ Protected methods00.00%
▷ Private methods511.11%
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/logo.png17.55KB6.60KB▼ 62.40%
admin/icon.png0.73KB0.67KB▼ 7.76%