78% book-previewer-for-woocommerce

Code Review | Book Previewer for Woocommerce

WordPress plugin Book Previewer for Woocommerce scored78%from 54 tests.

About plugin

  • Plugin page: book-previewer-fo...
  • Plugin version: 1.0.6
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.6
  • WordPress version: 6.3.1
  • First release: Sep 30, 2019
  • Latest release: Dec 15, 2020
  • Number of updates: 24
  • Update frequency: every 18.5 days
  • Top authors: g5theme (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active /9,433 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼7.50ms] Passed 4 tests

A check of server-side resources used by Book Previewer for Woocommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0333.63 ▼5.81
Dashboard /wp-admin3.33 ▼0.0143.77 ▼15.68
Posts /wp-admin/edit.php3.45 ▲0.0944.35 ▲0.70
Add New Post /wp-admin/post-new.php5.91 ▲0.0389.18 ▼2.51
Media Library /wp-admin/upload.php3.26 ▲0.0333.86 ▼5.99

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Book Previewer for Woocommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲4913.26 ▼1.031.64 ▼0.7740.08 ▼18.46
Dashboard /wp-admin2,206 ▲214.83 ▼1.17110.09 ▼2.7141.72 ▼1.57
Posts /wp-admin/edit.php2,098 ▲122.03 ▼0.0239.36 ▲3.4136.09 ▼0.07
Add New Post /wp-admin/post-new.php1,534 ▼13318.41 ▼3.81600.96 ▼59.6457.88 ▲11.83
Media Library /wp-admin/upload.php1,394 ▲94.19 ▲0.0096.22 ▼16.4242.12 ▼4.61

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% 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 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
Almost there! Just fix the following items
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/book-previewer-for-woocommerce/inc/ajax.class.php
    • > /wp-content/plugins/book-previewer-for-woocommerce/templates/svg-icons.php
    • > /wp-content/plugins/book-previewer-for-woocommerce/inc/admin.class.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/book-previewer-for-woocommerce/inc/functions.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/book-previewer-for-woocommerce/admin/templates/back-image-field.php:6

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 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: book, book store, book shop, book gallery, book previewer

book-previewer-for-woocommerce/book-previewer-for-woocommerce.php 92% from 13 tests

The main PHP file in "Book Previewer for Woocommerce" ver. 1.0.6 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • 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 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin2,690 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript64161691,529
CSS6999651
PHP1081110510

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity6.80
▷ Minimum class complexity2.00
▷ Maximum class complexity18.00
Average method complexity1.78
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods37
▷ Static methods513.51%
▷ Public methods37100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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 were not PNG files found in your plugin