10% bhm-random-quote

Code Review | BHM Random Quote

WordPress plugin BHM Random Quote scored10%from 54 tests.

About plugin

  • Plugin page: bhm-random-quote
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.5.1
  • WordPress version: 6.3.1
  • First release: Feb 18, 2013
  • Latest release: Feb 18, 2013
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: bmarston (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,660 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/bhm-random-quote/bhm-quote.php+89
    Function create_function() is deprecated

Server metrics [RAM: ▼1.92MB] [CPU: ▼56.50ms] Passed 4 tests

Analyzing server-side resources used by BHM Random Quote
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.396.01 ▼37.42
Dashboard /wp-admin2.09 ▼1.225.67 ▼43.76
Posts /wp-admin/edit.php2.09 ▼1.275.79 ▼47.07
Add New Post /wp-admin/post-new.php2.09 ▼3.805.56 ▼97.74
Media Library /wp-admin/upload.php2.09 ▼1.147.10 ▼27.81
Add New /wp-admin/post-new.php?post_type=bhm_quote2.096.11
All Quotes /wp-admin/edit.php?post_type=bhm_quote2.096.94

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_quote_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by BHM Random Quote
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5814.25 ▼0.131.76 ▼0.1439.83 ▼2.87
Dashboard /wp-admin2,222 ▲425.50 ▼0.1084.71 ▼6.0739.97 ▼7.88
Posts /wp-admin/edit.php2,127 ▲271.95 ▼0.0538.86 ▲0.9937.53 ▼0.65
Add New Post /wp-admin/post-new.php1,549 ▲2223.11 ▼0.02648.54 ▼6.4359.69 ▲5.36
Media Library /wp-admin/upload.php1,421 ▲214.18 ▼0.0094.76 ▼10.1644.59 ▼4.72
Add New /wp-admin/post-new.php?post_type=bhm_quote2,0636.77155.8363.33
All Quotes /wp-admin/edit.php?post_type=bhm_quote1,0801.9632.6029.63

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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
    • > Deprecated in wp-content/plugins/bhm-random-quote/bhm-quote.php+89
    Function create_function() is deprecated
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_quote_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=bhm_quote
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/bhm-random-quote/bhm-quote.php+89
    Function create_function() is deprecated

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bhm-random-quote/bhm-quote.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Donate link: Invalid URI ("")
Please take inspiration from this readme.txt

bhm-random-quote/bhm-quote.php 92% from 13 tests

"BHM Random Quote" version 0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("bhm-random-quote.php" instead of "bhm-quote.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected116 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP12544116

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin