77% betterbook

Code Review | BetterBook

WordPress plugin BetterBook scored 77% from 54 tests.

About plugin

  • Plugin page: betterbook
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.2
  • WordPress version: 6.3.1
  • First release: Feb 25, 2020
  • Latest release: Feb 25, 2020
  • Number of updates: 3
  • Update frequency: every 12.0 days
  • Top authors: mdw2000 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 648 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▲1.47ms] Passed 4 tests

An overview of server-side resources used by BetterBook
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.39 ▼0.07314.12 ▲270.41
Dashboard /wp-admin3.31 ▲0.0144.03 ▲0.68
Posts /wp-admin/edit.php3.36 ▲0.0141.03 ▼1.57
Add New Post /wp-admin/post-new.php5.89 ▲0.0190.76 ▲6.46
Media Library /wp-admin/upload.php3.24 ▲0.0134.61 ▲0.33
BetterBook /wp-admin/options-general.php?page=BetterBook3.2430.64

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by BetterBook
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.24 ▼1.351.61 ▼0.3539.52 ▼6.05
Dashboard /wp-admin2,213 ▲275.87 ▲0.89100.40 ▼10.7739.64 ▲0.72
Posts /wp-admin/edit.php2,093 ▲42.02 ▲0.0337.72 ▼0.1534.88 ▲1.76
Add New Post /wp-admin/post-new.php1,539 ▲523.33 ▲0.04623.03 ▲23.0552.52 ▲4.94
Media Library /wp-admin/upload.php1,392 ▲104.20 ▲0.0193.06 ▼12.9640.88 ▼2.28
BetterBook /wp-admin/options-general.php?page=BetterBook8542.0323.4026.18

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 5× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/betterbook/includes/shortcode.php
    • > /wp-content/plugins/betterbook/admin/betterbook_notice.php
    • > /wp-content/plugins/betterbook/index.php
    • > /wp-content/plugins/betterbook/includes/enqueue.php
    • > /wp-content/plugins/betterbook/admin/index.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant BETTERBOOK_APIKEY_NONCE - assumed 'BETTERBOOK_APIKEY_NONCE' (this will throw an Error in a future version of PHP) in wp-content/plugins/betterbook/admin/betterbook_admin.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/betterbook/admin/betterbook_admin.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 86% 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
Please fix the following attributes:
  • Plugin Name: You should set the name of your plugin on the first line ( === betterbook === )
You can take inspiration from this readme.txt

betterbook/index.php 77% from 13 tests

This is the main PHP file of "BetterBook" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("2.0" instead of "5.2")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("betterbook.php" instead of "index.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 147 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin175 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP64415175

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions342.86%
▷ Anonymous functions457.14%
Constants6
▷ Global constants6100.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
5 PNG files occupy 0.25MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png43.60KB14.46KB▼ 66.84%
assets/icon-256x256.png4.31KB2.04KB▼ 52.79%
assets/screenshot-3.png24.54KB8.39KB▼ 65.81%
assets/screenshot-2.png24.70KB9.22KB▼ 62.69%
assets/banner-1544x500.png154.12KB48.54KB▼ 68.50%