73% book-review

Code Review | Book Review

WordPress plugin Book Review scored 73% from 54 tests.

About plugin

  • Plugin page: book-review
  • Plugin version: 2.3.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.8
  • WordPress version: 5.8.1
  • First release: Aug 20, 2013
  • Latest release: Jan 11, 2018
  • Number of updates: 99
  • Update frequency: every 16.2 days
  • Top authors: BookWookie (68.69%)donnapep (32.32%)

Code review

54 tests

User reviews

17 reviews

Install metrics

700+ active / 40,180 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼136.56ms] Passed 4 tests

A check of server-side resources used by Book Review
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.92 ▲0.2036.95 ▲7.27
Dashboard /wp-admin3.16 ▲0.1147.30 ▼0.07
Posts /wp-admin/edit.php3.25 ▲0.1441.59 ▼2.55
Add New Post /wp-admin/post-new.php5.56 ▲0.1294.19 ▼550.90
Media Library /wp-admin/upload.php3.10 ▲0.0939.63 ▲8.47
Book Review /wp-admin/options-general.php?page=book-review3.1534.47

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 64 new files
Database: 2 new tables, 1 new option
New tables
wp_book_review_custom_link_urls
wp_book_review_custom_links
New WordPress options
book_review_version

Browser metrics Passed 4 tests

Checking browser requirements for Book Review
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,710 ▲11415.95 ▲0.109.62 ▲0.7245.63 ▼2.01
Dashboard /wp-admin2,972 ▲385.89 ▼0.07150.58 ▲5.08103.70 ▼8.83
Posts /wp-admin/edit.php2,759 ▲202.73 ▲0.0163.68 ▼6.3793.01 ▲10.31
Add New Post /wp-admin/post-new.php1,978 ▲48021.66 ▲2.79306.00 ▼94.24124.08 ▲16.57
Media Library /wp-admin/upload.php1,815 ▲645.05 ▲0.07147.51 ▼1.00116.97 ▲3.57
Book Review /wp-admin/options-general.php?page=book-review1,9444.57113.0586.67

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_book_review_custom_links
    • wp_book_review_custom_link_urls
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • book_review_version

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 8× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/book-review/admin/partials/book-review-admin-advanced.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/book-review/admin/partials/book-review-admin-tabs.php:18
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/book-review/public/partials/book-review-public.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/book-review/admin/partials/book-review-admin-images.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/book-review/admin/partials/book-review-admin-appearance.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/book-review/admin/partials/book-review-admin-links.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/book-review/admin/partials/book-review-admin-custom-fields.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/book-review/admin/partials/book-review-admin-meta-box.php:16

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)
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 75% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Add a description for screenshot #11 in book-review/assets to your readme.txt
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
  • Plugin Name: You should set the name of your plugin on the first line ( === book-review === )
  • Screenshots: Screenshot #10 (Google Search Result) image not found
The official readme.txt might help

book-review/book-review.php Passed 13 tests

The primary PHP file in "Book Review" version 2.3.9 is used by WordPress to initiate all plugin functionality
99 characters long description:
Add book information such as title, author, publisher and cover photo to enhance your review posts.

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
Good job! No executable or dangerous file extensions detected7,137 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
PO File151,6621,8614,299
PHP195481,4372,832
CSS4044
JavaScript2022

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity25.00
▷ Minimum class complexity1.00
▷ Maximum class complexity101.00
Average method complexity3.02
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods119
▷ Static methods86.72%
▷ Public methods8974.79%
▷ Protected methods00.00%
▷ Private methods3025.21%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants266.67%
▷ Class constants133.33%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
7 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/images/two-star.png0.77KB0.69KB▼ 9.55%
includes/images/goodreads.png1.22KB1.28KB0.00%
includes/images/three-star.png0.89KB0.80KB▼ 10.49%
includes/images/barnes-noble.png1.46KB1.49KB0.00%
includes/images/one-star.png0.73KB0.67KB▼ 7.88%