78% daily-quotes

Code Review | Daily Quotes

WordPress plugin Daily Quotes scored78%from 54 tests.

About plugin

  • Plugin page: daily-quotes
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.4.0
  • WordPress version: 6.3.1
  • First release: Apr 10, 2015
  • Latest release: May 12, 2020
  • Number of updates: 21
  • Update frequency: every 88.5 days
  • Top authors: bobcares_plugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /3,882 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.90ms] Passed 4 tests

Server-side resources used by Daily Quotes
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.90 ▼1.20
Dashboard /wp-admin3.31 ▲0.0144.39 ▼8.09
Posts /wp-admin/edit.php3.36 ▲0.0148.03 ▼2.11
Add New Post /wp-admin/post-new.php5.89 ▲0.0179.04 ▼12.19
Media Library /wp-admin/upload.php3.24 ▲0.0135.19 ▲3.30

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 7 new options
New WordPress options
widget_daily_quotes_id
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Daily Quotes
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8114.42 ▼0.142.01 ▲0.1839.47 ▼3.96
Dashboard /wp-admin2,203 ▲125.80 ▲0.91102.37 ▲0.4637.52 ▼0.86
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0135.24 ▼3.5532.90 ▲1.28
Add New Post /wp-admin/post-new.php1,538 ▲2423.29 ▲5.78651.65 ▲21.2150.67 ▼3.50
Media Library /wp-admin/upload.php1,382 ▼94.28 ▲0.0894.37 ▼3.3139.68 ▼4.17

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_daily_quotes_id
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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 fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/daily-quotes/widget-public.php
  • 12× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/daily-quotes/widget-public.php on line 11
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/daily-quotes/widget-public.php on line 11
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/daily-quotes/widget-public.php on line 12
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/daily-quotes/unirest-php-master/tests/Unirest/BodyTest.php:10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/daily-quotes/widget-public.php on line 13
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/daily-quotes/widget-public.php on line 12
    • > PHP Notice
      Undefined variable: author in wp-content/plugins/daily-quotes/widget-public.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/daily-quotes/daily-quotes.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/daily-quotes/unirest-php-master/tests/Unirest/RequestTest.php:9
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/daily-quotes/widget-public.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Screenshots: Screenshot #4 (Display of Daily Quotes widget in the sidebar.) image missing
The official readme.txt is a good inspiration

daily-quotes/daily-quotes.php Passed 13 tests

The entry point to "Daily Quotes" version 1.2.0 is a PHP file that has certain tags in its header comment area
49 characters long description:
A widget that displays daily inspirational quotes

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
Good job! No executable or dangerous file extensions detected1,436 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP132853691,049
Markdown11450294
YAML17032
JSON10028
CSS12619
XML12014

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity6.40
▷ Minimum class complexity1.00
▷ Maximum class complexity30.00
Average method complexity1.63
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces5
Interfaces1
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods87
▷ Static methods4045.98%
▷ Public methods8294.25%
▷ Protected methods00.00%
▷ Private methods55.75%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants39
▷ Global constants00.00%
▷ Class constants39100.00%
▷ Public constants39100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin