79% wp-books-gallery

Code Review | WordPress Books Gallery

WordPress plugin WordPress Books Gallery scored79%from 54 tests.

About plugin

  • Plugin page: wp-books-gallery
  • Plugin version: 4.5.8
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.3.2
  • WordPress version: 6.3.1
  • First release: Aug 19, 2019
  • Latest release: Oct 20, 2023
  • Number of updates: 1
  • Update frequency: every 365.0 days

Code review

54 tests

User reviews

65 reviews

Install metrics

2,000+ active /65,709 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲5.10MB] [CPU: ▲23.66ms] 75% from 4 tests

This is a short check of server-side resources used by WordPress Books Gallery
Please take the time to fix the following items
  • Extra RAM: The extra memory usage must be under 5MB (currently 5.10MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.91 ▲5.4564.15 ▲27.23
Dashboard /wp-admin8.93 ▲5.5971.63 ▲13.98
Posts /wp-admin/edit.php8.93 ▲5.5874.72 ▲25.00
Add New Post /wp-admin/post-new.php9.67 ▲3.78132.21 ▲28.42
Media Library /wp-admin/upload.php8.93 ▲5.7067.13 ▲31.14
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius8.9359.54

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 298 new files
Database: no new tables, 9 new options
New WordPress options
can_compress_scripts
fs_accounts
db_upgraded
fs_active_plugins
widget_theysaidso_widget
widget_recent-posts
fs_debug_mode
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by WordPress Books Gallery
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,978 ▲23213.79 ▼0.777.30 ▲5.8127.20 ▼29.57
Dashboard /wp-admin2,260 ▲805.85 ▲0.1995.91 ▲10.5742.53 ▼0.52
Posts /wp-admin/edit.php2,173 ▲732.48 ▲0.4738.75 ▲3.0833.99 ▼3.02
Add New Post /wp-admin/post-new.php1,582 ▲5418.15 ▼5.19629.88 ▼43.0047.52 ▼10.87
Media Library /wp-admin/upload.php1,465 ▲714.52 ▲0.3196.14 ▼4.9442.83 ▼0.24
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius1,1302.1431.3127.56

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/wp-books-gallery/freemius/includes/class-freemius.php+8515
    Undefined property: stdClass::$plugins
  • Zombie WordPress options detected upon uninstall: 9 options
    • can_compress_scripts
    • fs_debug_mode
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • fs_accounts
    • widget_recent-posts
    • fs_active_plugins
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
You can take inspiration from this readme.txt

wp-books-gallery/wp-books-gallery.php 92% from 13 tests

The entry point to "WordPress Books Gallery" version 4.5.8 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 142 characters long)

Code Analysis 97% from 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
There were no executable files found in this plugin50,091 lines of code in 208 files:
LanguageFilesBlank linesComment linesLines of code
PHP1668,51517,47541,512
PO File123,2305,0197,025
CSS20207411,139
JavaScript85669386
XML13016
SVG11013

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
Please fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,088)
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity76.66
▷ Minimum class complexity1.00
▷ Maximum class complexity3,088.00
Average method complexity4.52
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits8
Classes53
▷ Abstract classes23.77%
▷ Concrete classes5196.23%
▷ Final classes00.00%
Methods1,339
▷ Static methods19914.86%
▷ Public methods92869.31%
▷ Protected methods342.54%
▷ Private methods37728.16%
Functions109
▷ Named functions10899.08%
▷ Anonymous functions10.92%
Constants152
▷ Global constants10569.08%
▷ Class constants4730.92%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%