10% random-quote-of-the-day

Code Review | Random Quote of The Day

WordPress plugin Random Quote of The Day scored10%from 54 tests.

About plugin

  • Plugin page: random-quote-of-t...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.8
  • WordPress version: 6.3.1
  • First release: Oct 9, 2014
  • Latest release: Oct 16, 2014
  • Number of updates: 8
  • Update frequency: every 0.9 days
  • Top authors: bumin (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /2,771 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/random-quote-of-the-day/includes/widget-curatedquotes.php+91
    Function create_function() is deprecated

Server metrics [RAM: ▼1.96MB] [CPU: ▼51.31ms] Passed 4 tests

An overview of server-side resources used by Random Quote of The Day
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.445.24 ▼36.33
Dashboard /wp-admin2.05 ▼1.267.02 ▼43.46
Posts /wp-admin/edit.php2.05 ▼1.316.06 ▼43.21
Add New Post /wp-admin/post-new.php2.05 ▼3.844.78 ▼82.24
Media Library /wp-admin/upload.php2.05 ▼1.184.90 ▼34.30
Random Daily Quote /wp-admin/options-general.php?page=random-daily-quotes2.055.52

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 26 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_curatedquotes-widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Random Quote of The Day
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,880 ▲11913.44 ▼0.918.52 ▲6.6341.31 ▼2.27
Dashboard /wp-admin2,203 ▲265.60 ▼0.0582.63 ▼6.4939.25 ▼2.00
Posts /wp-admin/edit.php2,108 ▲112.06 ▲0.0835.86 ▼0.6132.84 ▼0.35
Add New Post /wp-admin/post-new.php1,533 ▲723.19 ▼0.32635.61 ▼16.1255.68 ▼7.20
Media Library /wp-admin/upload.php1,411 ▲144.32 ▲0.1798.81 ▼6.0044.76 ▲0.98
Random Daily Quote /wp-admin/options-general.php?page=random-daily-quotes8041.6525.3725.68

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/random-quote-of-the-day/includes/widget-curatedquotes.php+91
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_curatedquotes-widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=random-daily-quotes
    • > Deprecated in wp-content/plugins/random-quote-of-the-day/includes/widget-curatedquotes.php+91
    Function create_function() is deprecated

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 take a closer look at the following
  • 17× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/random-quote-of-the-day/includes/views/widget-public.php on line 4
    • > PHP Notice
      Undefined variable: author in wp-content/plugins/random-quote-of-the-day/includes/views/widget-public.php on line 5
    • > PHP Notice
      Undefined variable: title in wp-content/plugins/random-quote-of-the-day/includes/views/widget-public.php on line 2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/random-quote-of-the-day/includes/views/widget-admin.php:2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/random-quote-of-the-day/includes/views/widget-public.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/random-quote-of-the-day/includes/views/widget-public.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/random-quote-of-the-day/includes/views/widget-public.php:18
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/random-quote-of-the-day/includes/views/widget-public.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/random-quote-of-the-day/includes/views/admin.php:2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/random-quote-of-the-day/includes/views/widget-public.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% 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 need to be fixed:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

random-quote-of-the-day/randomdailyquote.php 92% from 13 tests

The principal PHP file in "Random Quote of The Day" v. 1.0.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("random-quote-of-the-day.php" instead of "randomdailyquote.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected938 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP9154275446
CSS25019445
JavaScript261034
SVG10013

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity9.00
▷ Minimum class complexity1.00
▷ Maximum class complexity18.00
Average method complexity1.69
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods35
▷ Static methods720.00%
▷ Public methods3085.71%
▷ Protected methods00.00%
▷ Private methods514.29%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected