84% library-bookshelves

Code Review | Library Bookshelves

WordPress plugin Library Bookshelves scored84%from 54 tests.

About plugin

  • Plugin page: library-bookshelves
  • Plugin version: 5.5
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Aug 28, 2017
  • Latest release: Jul 21, 2023
  • Number of updates: 119
  • Update frequency: every 18.1 days
  • Top authors: photonicgnostic (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

600+ active /19,433 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.21MB] [CPU: ▼6.67ms] Passed 4 tests

This is a short check of server-side resources used by Library Bookshelves
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1844.78 ▼5.53
Dashboard /wp-admin3.53 ▲0.1961.68 ▼2.15
Posts /wp-admin/edit.php3.63 ▲0.2861.51 ▲11.04
Add New Post /wp-admin/post-new.php6.20 ▲0.3191.42 ▼20.27
Media Library /wp-admin/upload.php3.44 ▲0.2141.95 ▲1.29
Settings /wp-admin/edit.php?post_type=bookshelves&page=bookshelf-settings-page3.4449.93
Add New /wp-admin/post-new.php?post_type=bookshelves3.6472.06
Bookshelves /wp-admin/edit.php?post_type=bookshelves3.4947.62
Locations /wp-admin/edit-tags.php?taxonomy=location&post_type=bookshelves3.5252.76

Server storage [IO: ▲0.25MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 23 new files
Database: no new tables, 7 new options
New WordPress options
library_bookshelves
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Library Bookshelves
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,092 ▲33115.32 ▲0.974.85 ▲3.2343.67 ▼0.26
Dashboard /wp-admin2,390 ▲2186.20 ▲0.48109.62 ▲4.1396.83 ▲51.55
Posts /wp-admin/edit.php2,336 ▲2333.44 ▲1.4754.68 ▲14.9986.15 ▲50.32
Add New Post /wp-admin/post-new.php1,597 ▲7123.25 ▼0.37658.24 ▼51.0836.60 ▼21.74
Media Library /wp-admin/upload.php1,476 ▲764.21 ▲0.0589.60 ▼18.9468.82 ▲19.71
Settings /wp-admin/edit.php?post_type=bookshelves&page=bookshelf-settings-page1,5033.2244.1469.98
Add New /wp-admin/post-new.php?post_type=bookshelves2,8693.8579.6383.61
Bookshelves /wp-admin/edit.php?post_type=bookshelves1,3613.2946.1073.80
Locations /wp-admin/edit-tags.php?taxonomy=location&post_type=bookshelves1,5163.1444.0473.63

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/library-bookshelves/bookshelves-taxonomy.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/library-bookshelves/single-bookshelves.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: catalog, ils, bookshelf, books, opac...

library-bookshelves/class-library-bookshelves.php 85% from 13 tests

"Library Bookshelves" version 5.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("library-bookshelves.php" instead of "class-library-bookshelves.php")
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected4,150 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP84657303,554
CSS35417423
JavaScript33539159
SVG21014

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity32.00
▷ Minimum class complexity3.00
▷ Maximum class complexity89.00
Average method complexity3.82
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods44
▷ Static methods49.09%
▷ Public methods4295.45%
▷ Protected methods00.00%
▷ Private methods24.55%
Functions27
▷ Named functions2281.48%
▷ Anonymous functions518.52%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin