77% rs-wp-books-showcase

Code Review | RS WP Book ShowCase - WordPress Book Gallery Plugin (Book Slider, Book Carousel, Book Grid, Book List))

WordPress plugin RS WP Book ShowCase - WordPress Book Gallery Plugin (Book Slider, Book Carousel, Book Grid, Book List)) scored77%from 54 tests.

About plugin

  • Plugin page: rs-wp-books-showcase
  • Plugin version: 6.1.9
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.4.1
  • WordPress version: 6.3.1
  • First release: Apr 23, 2022
  • Latest release: Nov 30, 2023
  • Number of updates: 76
  • Update frequency: every 7.7 days
  • Top authors: rswpthemes (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

700+ active /25,207 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.84MB] [CPU: ▲3.82ms] Passed 4 tests

Server-side resources used by RS WP Book ShowCase - WordPress Book Gallery Plugin (Book Slider, Book Carousel, Book Grid, Book List))
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.35 ▲0.8952.54 ▲13.93
Dashboard /wp-admin4.18 ▲0.8755.19 ▲6.70
Posts /wp-admin/edit.php4.22 ▲0.8658.78 ▲7.02
Add New Post /wp-admin/post-new.php6.72 ▲0.8493.60 ▼11.44
Media Library /wp-admin/upload.php4.03 ▲0.8046.55 ▲13.00
All Book Reviews /wp-admin/edit.php?post_type=book_reviews4.1445.13
Add New /wp-admin/post-new.php?post_type=book_reviews4.2857.76
Tutorial /wp-admin/edit.php?post_type=book&page=rswpbs-tutorial4.0244.48

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 65 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-comments
widget_featured_books
widget_recent-posts
book_layouts_settings
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_books_list
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by RS WP Book ShowCase - WordPress Book Gallery Plugin (Book Slider, Book Carousel, Book Grid, Book List))
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,033 ▲27113.58 ▼0.8211.05 ▲9.5028.47 ▼8.79
Dashboard /wp-admin2,311 ▲1345.58 ▼0.0495.04 ▼4.4782.99 ▲38.29
Posts /wp-admin/edit.php2,223 ▲1202.14 ▲0.2037.73 ▼10.8134.46 ▼3.35
Add New Post /wp-admin/post-new.php1,643 ▲11723.30 ▼0.42810.66 ▲202.7637.80 ▼14.22
Media Library /wp-admin/upload.php1,519 ▲1164.22 ▲0.0698.08 ▲0.7470.72 ▲27.17
All Book Reviews /wp-admin/edit.php?post_type=book_reviews1,2172.0737.3735.21
Add New /wp-admin/post-new.php?post_type=book_reviews2,4267.57184.26141.48
Tutorial /wp-admin/edit.php?post_type=book&page=rswpbs-tutorial3,19023.95782.63133.60

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 9 options in the database
    • widget_recent-comments
    • widget_featured_books
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_books_list
    • book_layouts_settings

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following
  • 25× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      require_once(RSWPBS_PLUGIN_PATH/review-system/review-cpt.php): failed to open stream: No such file or directory in wp-content/plugins/rs-wp-books-showcase/review-system/review.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/rs-wp-books-showcase/review-system/reviews-list.php:2
    • > PHP Warning
      Use of undefined constant RSWPBS_PLUGIN_PATH - assumed 'RSWPBS_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/rs-wp-books-showcase/review-system/review.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/rs-wp-books-showcase/frontend/shortcodes/book-advanced-search-shortcode.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/rs-wp-books-showcase/review-system/review-cmb.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/rs-wp-books-showcase/rsbs-templates/taxonomy-book-author.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/rs-wp-books-showcase/review-system/review-cpt.php:41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/rs-wp-books-showcase/includes/default-loop-modify-bkp.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_transient() in wp-content/plugins/rs-wp-books-showcase/includes/opt-in/opt-in.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/rs-wp-books-showcase/rsbs-templates/taxonomy-book-category.php:6

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/edit.php?post_type=book&page=rswpbs-tutorial
    • > Other (warning) in unknown
    /wp-admin/edit.php?post_type=book&page=rswpbs-tutorial 174 Unrecognized feature: 'web-share'.

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: Please delete some tags, you are using 27 tag instead of maximum 10
Please take inspiration from this readme.txt

rs-wp-books-showcase/rs-wp-books-showcase.php 77% from 13 tests

This is the main PHP file of "RS WP Book ShowCase - WordPress Book Gallery Plugin (Book Slider, Book Carousel, Book Grid, Book List))" version 6.1.9, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.2" instead of "4.9")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 162 characters long)

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 plugin18,383 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
CSS83,3666910,922
PHP321831484,705
JavaScript8870782,361
PO File1183198395

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity19.00
▷ Minimum class complexity1.00
▷ Maximum class complexity50.00
Average method complexity5.09
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods22
▷ Static methods00.00%
▷ Public methods22100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions144
▷ Named functions14298.61%
▷ Anonymous functions21.39%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 0.53MB with 0.31MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/assets/img/readers-feedback.png41.87KB8.18KB▼ 80.47%
includes/assets/img/rs-wp-book-showcase-logo.png12.69KB5.14KB▼ 59.54%
includes/assets/img/screenshot-6.png79.31KB39.94KB▼ 49.64%
admin/assets/icon/book-icon.png3.76KB1.72KB▼ 54.17%
includes/assets/img/sales-links.png19.93KB10.65KB▼ 46.60%