84% books-library

Code Review | Books Library

WordPress plugin Books Library scored84%from 54 tests.

About plugin

  • Plugin page: books-library
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.5.1
  • WordPress version: 6.3.1
  • First release: Nov 1, 2020
  • Latest release: Nov 1, 2020
  • Number of updates: 5
  • Update frequency: every 0.4 days
  • Top authors: rohitgupta3 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /875 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.09MB] [CPU: ▼0.47ms] Passed 4 tests

Analyzing server-side resources used by Books Library
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1042.82 ▼0.47
Dashboard /wp-admin3.39 ▲0.0851.56 ▲2.52
Posts /wp-admin/edit.php3.44 ▲0.0849.29 ▲0.25
Add New Post /wp-admin/post-new.php5.99 ▲0.1088.97 ▼4.17
Media Library /wp-admin/upload.php3.31 ▲0.0842.42 ▲8.56
Author /wp-admin/edit-tags.php?taxonomy=book_author&post_type=books3.3044.74
Add New /wp-admin/post-new.php?post_type=books3.4457.38
All Books /wp-admin/edit.php?post_type=books3.3540.24
Publisher /wp-admin/edit-tags.php?taxonomy=book_publisher&post_type=books3.3036.19

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Books Library: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,925 ▲17915.15 ▲0.7834.32 ▲32.2743.30 ▼2.64
Dashboard /wp-admin2,244 ▲534.87 ▼0.9799.46 ▼9.0241.91 ▼1.09
Posts /wp-admin/edit.php2,121 ▲322.00 ▲0.0034.80 ▼0.6638.56 ▲5.94
Add New Post /wp-admin/post-new.php6,381 ▲4,86427.75 ▲10.01915.92 ▲302.9638.86 ▼18.02
Media Library /wp-admin/upload.php1,423 ▲354.25 ▲0.01112.95 ▲10.1548.42 ▲0.40
Author /wp-admin/edit-tags.php?taxonomy=book_author&post_type=books1,2942.1430.1829.72
Add New /wp-admin/post-new.php?post_type=books2,4507.82179.9369.00
All Books /wp-admin/edit.php?post_type=books1,0881.9630.2829.56
Publisher /wp-admin/edit-tags.php?taxonomy=book_publisher&post_type=books1,2942.1426.9928.00

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Please take a closer look at the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/books-library/inc/books_meta.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/books-library/index.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/books-library/inc/endpoints.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: library, filter, books library, book, react...

books-library/index.php 92% from 13 tests

This is the main PHP file of "Books Library" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("books-library.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin3,957 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript832553,516
PHP34149272
CSS24495
JSON20052
SVG10122

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.30
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%
Functions9
▷ Named functions9100.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