67% author-showcase

Code Review | Author Showcase

WordPress plugin Author Showcase scored67%from 54 tests.

About plugin

  • Plugin page: author-showcase
  • Plugin version: 1.4.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.5
  • WordPress version: 6.3.1
  • First release: Jul 5, 2016
  • Latest release: Sep 17, 2020
  • Number of updates: 14
  • Update frequency: every 109.7 days
  • Top authors: raynfall (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /3,019 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.25MB] [CPU: ▼3.65ms] Passed 4 tests

This is a short check of server-side resources used by Author Showcase
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2338.44 ▼4.90
Dashboard /wp-admin3.62 ▲0.3151.80 ▼2.78
Posts /wp-admin/edit.php3.67 ▲0.3253.43 ▼4.02
Add New Post /wp-admin/post-new.php6.12 ▲0.23103.54 ▼2.91
Media Library /wp-admin/upload.php3.46 ▲0.2344.95 ▲5.76
Author Showcase Book List /wp-admin/admin.php?page=btbe_admin3.4642.93
Add Book /wp-admin/admin.php?page=btbe_add3.5639.17
Add API Keys /wp-admin/admin.php?page=btbe_apis3.4637.93

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 23 new files
Database: 2 new tables, 8 new options
New tables
wp_buybooks
wp_bb_apis
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_author_showcase_widget
can_compress_scripts
buybook_db_version
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Author Showcase
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,051 ▲30515.46 ▲1.055.36 ▲3.5843.31 ▼1.67
Dashboard /wp-admin2,374 ▲1836.41 ▲1.54141.50 ▲21.3946.54 ▼1.23
Posts /wp-admin/edit.php2,283 ▲1943.31 ▲1.3055.13 ▲16.5335.63 ▼2.99
Add New Post /wp-admin/post-new.php1,558 ▲3823.40 ▲0.35633.46 ▼71.7235.89 ▼18.94
Media Library /wp-admin/upload.php1,413 ▲254.14 ▼0.0380.92 ▼31.6243.11 ▼5.24
Author Showcase Book List /wp-admin/admin.php?page=btbe_admin1,1053.0146.3531.34
Add Book /wp-admin/admin.php?page=btbe_add1,2093.1837.4637.99
Add API Keys /wp-admin/admin.php?page=btbe_apis1,0353.1539.4925.79

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_bb_apis
    • wp_buybooks
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • buybook_db_version
    • widget_author_showcase_widget
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=btbe_add
    • > Notice in wp-content/plugins/author-showcase/btbe_add.php+334
    Undefined index: btbe_id
    • > GET request to /wp-admin/admin.php?page=btbe_add
    • > Notice in wp-content/plugins/author-showcase/btbe_add.php+10
    Undefined index: btbe_add
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=btbe_apis
    • > Notice in wp-content/plugins/author-showcase/btbe_apis.php+49
    Undefined variable: btbe_message
    • > GET request to /wp-admin/admin.php?page=btbe_add
    • > Notice in wp-content/plugins/author-showcase/btbe_add.php+213
    Undefined index: title
    • > GET request to /wp-admin/admin.php?page=btbe_add
    • > Notice in wp-content/plugins/author-showcase/btbe_add.php+217
    Undefined index: subtitle
    • > GET request to /wp-admin/admin.php?page=btbe_add
    • > Notice in wp-content/plugins/author-showcase/btbe_add.php+236
    Undefined index: series
    • > GET request to /wp-admin/admin.php?page=btbe_add
    • > Notice in wp-content/plugins/author-showcase/btbe_add.php+242
    Undefined index: series_num
    • > GET request to /wp-admin/admin.php?page=btbe_add
    • > Notice in wp-content/plugins/author-showcase/btbe_add.php+247
    Undefined index: author
    • > GET request to /wp-admin/admin.php?page=btbe_add
    • > Notice in wp-content/plugins/author-showcase/btbe_add.php+254
    Undefined index: short_blurb
    • > GET request to /wp-admin/admin.php?page=btbe_add
    • > Notice in wp-content/plugins/author-showcase/btbe_add.php+259
    Undefined index: blurb
    • > GET request to /wp-admin/admin.php?page=btbe_add
    • > Notice in wp-content/plugins/author-showcase/btbe_add.php+266
    Undefined index: book_page
    • > GET request to /wp-admin/admin.php?page=btbe_add
    • > Notice in wp-content/plugins/author-showcase/btbe_add.php+270
    Undefined index: asin
    • > GET request to /wp-admin/admin.php?page=btbe_add
    • > Notice in wp-content/plugins/author-showcase/btbe_add.php+274
    Undefined index: isbn
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=btbe_add
    • > Notice in wp-content/plugins/author-showcase/btbe_add.php+342
    Undefined index: cover
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=btbe_apis
    • > Notice in wp-content/plugins/author-showcase/btbe_apis.php+7
    Undefined offset: 0
    • > GET request to /wp-admin/admin.php?page=btbe_apis
    • > Notice in wp-content/plugins/author-showcase/btbe_apis.php+14
    Undefined index: btbe_api
    • > GET request to /wp-admin/admin.php?page=btbe_apis
    • > Notice in wp-content/plugins/author-showcase/btbe_apis.php+54
    Undefined index: amazon_assoc
    • > GET request to /wp-admin/admin.php?page=btbe_apis
    • > Notice in wp-content/plugins/author-showcase/btbe_apis.php+57
    Undefined index: amazon_access
    • > GET request to /wp-admin/admin.php?page=btbe_apis
    • > Notice in wp-content/plugins/author-showcase/btbe_apis.php+60
    Undefined index: amazon_secret
    • > GET request to /wp-admin/admin.php?page=btbe_apis
    • > Notice in wp-content/plugins/author-showcase/btbe_apis.php+63
    Undefined index: goodreads_key

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
The following issues need your attention
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/author-showcase/author_showcase.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/author-showcase/btbe_apis.php:1
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/author-showcase/btbe_add.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/author-showcase/btbe_admin.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% 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 11 tag instead of maximum 10
You can look at the official readme.txt

author-showcase/author_showcase.php 85% from 13 tests

The main file in "Author Showcase" v. 1.4.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 155 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("author-showcase.php" instead of "author_showcase.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin2,147 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP72135081,617
PO File2170170475
CSS12143
JavaScript10012

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity35.00
▷ Minimum class complexity5.00
▷ Maximum class complexity94.00
Average method complexity3.52
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods54
▷ Static methods00.00%
▷ Public methods3564.81%
▷ Protected methods1833.33%
▷ Private methods11.85%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
9 PNG files occupy 0.65MB with 0.28MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
icons/Createspace.png2.01KB1.64KB▼ 18.34%
screenshot2.png148.57KB39.31KB▼ 73.54%
icons/Barnes and Noble.png4.42KB1.75KB▼ 60.42%
icons/Amazon.png4.28KB1.54KB▼ 64.10%
icons/Kobo.png0.96KB1.02KB0.00%