84% random-vocabulary

Code Review | Random Vocab

WordPress plugin Random Vocab scored 84% from 54 tests.

About plugin

  • Plugin page: random-vocabulary
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.2
  • WordPress version: 6.3.1
  • First release: Aug 12, 2015
  • Latest release: Aug 12, 2015
  • Number of updates: 4
  • Update frequency: every 1.0 days
  • Top authors: rakshithvbharani@gmail.com (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 600 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by Random Vocab
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0134.89 ▼6.09
Dashboard /wp-admin3.31 ▲0.0044.62 ▼1.68
Posts /wp-admin/edit.php3.36 ▲0.0046.17 ▼1.03
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.94 ▼5.86
Media Library /wp-admin/upload.php3.23 ▲0.0033.29 ▼0.69

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Random Vocab
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7113.20 ▼1.151.60 ▼0.2041.37 ▼9.99
Dashboard /wp-admin2,212 ▲305.81 ▼0.01103.01 ▼0.7738.65 ▼8.12
Posts /wp-admin/edit.php2,094 ▲52.13 ▲0.1138.38 ▼1.5335.54 ▲1.09
Add New Post /wp-admin/post-new.php1,599 ▲6623.97 ▲0.92579.42 ▼39.1937.61 ▼16.75
Media Library /wp-admin/upload.php1,391 ▲34.39 ▲0.1795.04 ▲0.9942.83 ▲1.24

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/random-vocabulary/word.php:130

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (Plugin in action, which is in conjunction with Hello Dolly.) image missing
The official readme.txt is a good inspiration

random-vocabulary/word.php 92% from 13 tests

"Random Vocab" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("random-vocabulary.php" instead of "word.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
Success! There were no dangerous files found in this plugin126 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP11016126

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.11
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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected