77% gs-books-showcase

Code Review | WordPress Book Plugin for Displaying Books in Grid, Flip, Slider, Popup Layout and more

WordPress plugin WordPress Book Plugin for Displaying Books in Grid, Flip, Slider, Popup Layout and more scored77%from 54 tests.

About plugin

  • Plugin page: gs-books-showcase
  • Plugin version: 1.3.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-6.3
  • WordPress version: 6.3.1
  • First release: Jan 11, 2017
  • Latest release: Aug 30, 2023
  • Number of updates: 57
  • Update frequency: every 42.4 days
  • Top authors: samdani (100%)

Code review

54 tests

User reviews

27 reviews

Install metrics

300+ active /18,675 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.56MB] [CPU: ▲2.64ms] 75% from 4 tests

This is a short check of server-side resources used by WordPress Book Plugin for Displaying Books in Grid, Flip, Slider, Popup Layout and more
Please fix the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 648.46ms on /wp-admin/edit.php?post_type=gs_bookshowcase&page=gs-books-plugins-premium)
PageMemory (MB)CPU Time (ms)
Home /4.00 ▲0.5441.75 ▼1.79
Dashboard /wp-admin3.92 ▲0.6264.20 ▲13.35
Posts /wp-admin/edit.php3.97 ▲0.6264.73 ▲13.26
Add New Post /wp-admin/post-new.php6.44 ▲0.5596.71 ▼5.87
Media Library /wp-admin/upload.php3.76 ▲0.5343.80 ▲4.94
Add New Book /wp-admin/post-new.php?post_type=gs_bookshowcase3.9657.49
GS Plugins Lite /wp-admin/edit.php?post_type=gs_bookshowcase&page=gs-books-plugins-lite4.13645.96
Books Showcase /wp-admin/edit.php?post_type=gs_bookshowcase3.8846.23
Help & Usage /wp-admin/edit.php?post_type=gs_bookshowcase&page=gs-books-plugins-help3.7641.21
GS Plugins Pro /wp-admin/edit.php?post_type=gs_bookshowcase&page=gs-books-plugins-premium3.92648.46
Bookshowcase Settings /wp-admin/edit.php?post_type=gs_bookshowcase&page=bookshowcase-settings3.7640.63

Server storage [IO: ▲1.44MB] [DB: ▲0.04MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 38 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
gs_bookshowcase_style_settings
can_compress_scripts
widget_theysaidso_widget
gs_bookshowcase_settings
theysaidso_admin_options

Browser metrics Passed 4 tests

WordPress Book Plugin for Displaying Books in Grid, Flip, Slider, Popup Layout and more: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,136 ▲37515.17 ▲0.808.30 ▲6.6838.85 ▼1.56
Dashboard /wp-admin2,425 ▲2456.51 ▲0.83115.61 ▲20.8740.94 ▼3.55
Posts /wp-admin/edit.php2,357 ▲2543.86 ▲1.8556.79 ▲19.7438.31 ▼0.11
Add New Post /wp-admin/post-new.php1,605 ▲7617.78 ▼0.08661.96 ▲23.1337.08 ▼14.53
Media Library /wp-admin/upload.php1,490 ▲904.63 ▲0.42109.93 ▲1.3045.90 ▲0.69
Add New Book /wp-admin/post-new.php?post_type=gs_bookshowcase2,7488.08188.2074.75
GS Plugins Lite /wp-admin/edit.php?post_type=gs_bookshowcase&page=gs-books-plugins-lite2,7573.3850.84119.50
Books Showcase /wp-admin/edit.php?post_type=gs_bookshowcase1,3483.6949.5029.58
Help & Usage /wp-admin/edit.php?post_type=gs_bookshowcase&page=gs-books-plugins-help1,1673.3443.6143.78
GS Plugins Pro /wp-admin/edit.php?post_type=gs_bookshowcase&page=gs-books-plugins-premium2,4193.3744.4051.89
Bookshowcase Settings /wp-admin/edit.php?post_type=gs_bookshowcase&page=bookshowcase-settings2,0026.52137.5356.19

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • gs_bookshowcase_settings
    • widget_theysaidso_widget
    • gs_bookshowcase_style_settings
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not 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 take a closer look at the following
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gs-books-showcase/gs-bookshowcase-files/includes/gs-bookshowcase-meta-fields.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'gs_Bookshowcase_WeDevs_Settings_API' not found in wp-content/plugins/gs-books-showcase/gs-bookshowcase-files/admin/gs_bookshowcase_options_config.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gs-books-showcase/gs-bookshowcase-files/gs-bookshowcase-scripts.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gs-books-showcase/gs-bookshowcase-files/gs-plugins/gs-plugins-free.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/gs-books-showcase/gs-bookshowcase-files/includes/gs-bookshowcase-column.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_id() in wp-content/plugins/gs-books-showcase/gs-bookshowcase-files/includes/templates/gs_bookshowcase_structure_1_square.php:4
    • > PHP Notice
      Undefined variable: output in wp-content/plugins/gs-books-showcase/gs-bookshowcase-files/includes/templates/gs_bookshowcase_structure_1_square.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/gs-books-showcase/gs-bookshowcase.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gs-books-showcase/gs-bookshowcase-files/gs-plugins/gs-plugins.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/gs-books-showcase/gs-bookshowcase-files/gs-common-pages/gs-books-common-pages.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/edit.php?post_type=gs_bookshowcase&page=bookshowcase-settings
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
    • > GET request to /wp-admin/edit.php?post_type=gs_bookshowcase&page=bookshowcase-settings
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'bluetooth'.

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: book review plugin, book plugin, book showcase plugin, book review plugin wordpress

gs-books-showcase/gs-bookshowcase.php 77% from 13 tests

The principal PHP file in "WordPress Book Plugin for Displaying Books in Grid, Flip, Slider, Popup Layout and more" v. 1.3.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Description: Keep the plugin description shorter than 140 characters (currently 347 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("gs-books-showcase.php" instead of "gs-bookshowcase.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin7,943 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP177969513,373
CSS7169343,253
SVG200566
Sass11016521
JavaScript25873209
JSON10021

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity30.11
▷ Minimum class complexity3.00
▷ Maximum class complexity70.00
Average method complexity2.64
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods149
▷ Static methods32.01%
▷ Public methods11577.18%
▷ Protected methods64.03%
▷ Private methods2818.79%
Functions35
▷ Named functions3497.14%
▷ Anonymous functions12.86%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
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
gs-bookshowcase-files/assets/img/no_img.png8.45KB3.71KB▼ 56.07%
gs-bookshowcase-files/assets/img/icon-128x128.png11.88KB5.18KB▼ 56.38%