84% book-preview-for-woocommerce

Code Review | Book Preview for WooCommerce

WordPress plugin Book Preview for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: book-preview-for-...
  • Plugin version: 3.2.0
  • PHP compatiblity: 5.7+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8.2-6.3
  • WordPress version: 6.3.1
  • First release: Mar 3, 2022
  • Latest release: Aug 24, 2023
  • Number of updates: 42
  • Update frequency: every 14.0 days
  • Top authors: shalomt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /3,137 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼9.00ms] Passed 4 tests

Analyzing server-side resources used by Book Preview for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0738.37 ▲0.07
Dashboard /wp-admin3.36 ▲0.0245.87 ▼20.61
Posts /wp-admin/edit.php3.41 ▲0.0647.83 ▼2.27
Add New Post /wp-admin/post-new.php5.94 ▲0.0682.26 ▼13.20
Media Library /wp-admin/upload.php3.29 ▲0.0636.60 ▲3.79

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Book Preview for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7013.53 ▼1.082.00 ▲0.4639.72 ▼1.38
Dashboard /wp-admin2,221 ▲334.85 ▼1.06104.06 ▲0.3438.71 ▼1.61
Posts /wp-admin/edit.php2,098 ▲122.01 ▼0.0237.78 ▲0.0834.99 ▲0.62
Add New Post /wp-admin/post-new.php1,543 ▲923.07 ▼0.30657.22 ▲29.2149.46 ▼0.67
Media Library /wp-admin/upload.php1,394 ▲94.15 ▼0.0395.88 ▼5.3941.31 ▼3.12

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/book-preview-for-woocommerce/includes/template/index.php
    • > /wp-content/plugins/book-preview-for-woocommerce/includes/template/simple/index.php
    • > /wp-content/plugins/book-preview-for-woocommerce/index.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
10 plugin tags: book preview, previews, ecommerce preview, ebook previews, ebook...

book-preview-for-woocommerce/book-preview-for-woocommerce.php 85% from 13 tests

"Book Preview for WooCommerce" version 3.2.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:
  • Description: Please don't use more than 140 characters for the plugin description (currently 163 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
Good job! No executable or dangerous file extensions detected999 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP139367739
CSS12418214
JavaScript344246

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
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%
Functions16
▷ Named functions1487.50%
▷ Anonymous functions212.50%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.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
There are no PNG files in this plugin