78% user-generator

Code Review | User Generator

WordPress plugin User Generator scored78%from 54 tests.

About plugin

  • Plugin page: user-generator
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.6
  • WordPress version: 6.3.1
  • First release: Jan 22, 2021
  • Latest release: Jan 23, 2021
  • Number of updates: 2
  • Update frequency: every 2.0 days
  • Top authors: anatolykulikov (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active /784 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
Install script ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼6.72ms] Passed 4 tests

A check of server-side resources used by User Generator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1239.24 ▲0.67
Dashboard /wp-admin3.42 ▲0.1248.26 ▼0.93
Posts /wp-admin/edit.php3.54 ▲0.1847.99 ▼19.86
Add New Post /wp-admin/post-new.php6.03 ▲0.1486.55 ▼6.77
Media Library /wp-admin/upload.php3.35 ▲0.1246.60 ▲7.16
User Generator /wp-admin/users.php?page=user-generator3.3336.91

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for User Generator
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲3813.86 ▼0.671.58 ▼0.2041.24 ▼2.92
Dashboard /wp-admin2,199 ▲225.15 ▼0.38114.76 ▲27.1838.35 ▼2.26
Posts /wp-admin/edit.php2,110 ▲72.67 ▲0.6939.27 ▲0.8932.90 ▼3.04
Add New Post /wp-admin/post-new.php1,544 ▲1625.41 ▲2.45655.57 ▼29.8962.76 ▼6.36
Media Library /wp-admin/upload.php1,413 ▲164.77 ▲0.59102.76 ▼6.6643.07 ▼1.49
User Generator /wp-admin/users.php?page=user-generator8152.3836.5126.59

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

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
  • 2× 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/user-generator/user-generator.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-generator/functions/rest.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
    • > GET request to /wp-admin/users.php?page=user-generator
    • > Network (severe)
    wp-json/usergen/start - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/users.php?page=user-generator
    • > Javascript (severe) in unknown
    /wp-admin/users.php?page=user-generator 0:0 Uncaught SyntaxError: Unexpected token '

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: random users, generate users, generator

user-generator/user-generator.php 92% from 13 tests

The main PHP script in "User Generator" version 1.0.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin1,153 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PO File5377375838
PHP54657257
JavaScript1015644
Markdown18013
CSS1011

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity1.80
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods120.00%
▷ Protected methods00.00%
▷ Private methods480.00%
Functions13
▷ Named functions1076.92%
▷ Anonymous functions323.08%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected