94% wp-book-manager

Code Review | WP Book Manager

WordPress plugin WP Book Manager scored 94% from 54 tests.

About plugin

  • Plugin page: wp-book-manager
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.0.3
  • WordPress version: 5.8.1
  • First release: Feb 9, 2019
  • Latest release: Feb 13, 2019
  • Number of updates: 5
  • Update frequency: every 0.8 days
  • Top authors: deepsiva (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 478 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼142.22ms] Passed 4 tests

Server-side resources used by WP Book Manager
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.1535.09 ▲11.78
Dashboard /wp-admin3.10 ▲0.0446.47 ▲0.49
Posts /wp-admin/edit.php3.15 ▲0.0446.63 ▼5.01
Add New Post /wp-admin/post-new.php5.46 ▲0.0296.66 ▼567.62
Media Library /wp-admin/upload.php3.04 ▲0.0435.57 ▲3.26
Add New /wp-admin/post-new.php?post_type=book3.1656.13
All Books /wp-admin/edit.php?post_type=book3.0835.07

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Book Manager
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,718 ▲12215.93 ▲0.487.35 ▼1.0345.92 ▼3.13
Dashboard /wp-admin3,005 ▲745.94 ▼0.24139.01 ▼35.07115.06 ▼6.51
Posts /wp-admin/edit.php2,774 ▲352.71 ▲0.0166.80 ▼1.5097.29 ▲4.17
Add New Post /wp-admin/post-new.php1,523 ▼16018.80 ▲0.45357.18 ▼40.75109.12 ▼9.32
Media Library /wp-admin/upload.php1,845 ▲385.00 ▼0.00161.59 ▲4.78117.84 ▼10.96
Add New /wp-admin/post-new.php?post_type=book3,6889.14234.50152.46
All Books /wp-admin/edit.php?post_type=book1,4792.6261.3982.03

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-book-manager/index.php:51
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-book-manager/form.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wp-book-manager/single-book.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wp-book-manager/archive-book.php:5

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

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 detail view, book, book publisher form, book manager, book list

wp-book-manager/index.php 92% from 13 tests

Analyzing the main PHP file in "WP Book Manager" version 1.0.1
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-book-manager.php" instead of "index.php")

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
Everything looks great! No dangerous files found in this plugin186 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP42016186

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.25
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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected