94% random-quote-generator

Code Review | Random Quote Generator

WordPress plugin Random Quote Generator scored 94% from 54 tests.

About plugin

  • Plugin page: random-quote-gene...
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.2.2
  • WordPress version: 5.8.1
  • First release: Aug 8, 2019
  • Latest release: Aug 9, 2019
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: moazkhan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 417 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼149.57ms] Passed 4 tests

Analyzing server-side resources used by Random Quote Generator
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1234.30 ▲13.96
Dashboard /wp-admin3.06 ▲0.0142.35 ▼6.65
Posts /wp-admin/edit.php3.11 ▲0.0145.50 ▲0.18
Add New Post /wp-admin/post-new.php5.43 ▼0.0090.83 ▼586.39
Media Library /wp-admin/upload.php3.01 ▼0.0031.72 ▼5.41

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Random Quote Generator
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8315.98 ▲0.288.62 ▼1.1348.33 ▼3.41
Dashboard /wp-admin2,967 ▲335.90 ▼0.06142.30 ▼5.07108.68 ▼6.73
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0163.46 ▼3.3199.42 ▼3.50
Add New Post /wp-admin/post-new.php1,615 ▲11721.91 ▲3.03270.19 ▼102.70103.16 ▼31.18
Media Library /wp-admin/upload.php1,810 ▲35.05 ▲0.03142.94 ▼14.08121.22 ▼15.28

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% 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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/random-quote-generator/index.php:37

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
1 plugin tags: tags for the plugin

random-quote-generator/index.php 92% from 13 tests

The entry point to "Random Quote Generator" version 1.1.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("random-quote-generator.php" instead of "index.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
Success! There were no dangerous files found in this plugin16 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP112916

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.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
There are no PNG files in this plugin