78% numbers-generator-and-validator

Code Review | Numbers generator and validator

WordPress plugin Numbers generator and validator scored78%from 54 tests.

About plugin

  • Plugin page: numbers-generator...
  • Plugin version: 2.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-5.8.1
  • WordPress version: 6.3.1
  • First release: Jun 17, 2016
  • Latest release: Nov 6, 2021
  • Number of updates: 100
  • Update frequency: every 19.7 days
  • Top authors: axel8721 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /4,881 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
Installer ran successfully

Server metrics [RAM: ▼0.65MB] [CPU: ▼14.41ms] Passed 4 tests

This is a short check of server-side resources used by Numbers generator and validator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.97 ▲0.21
Dashboard /wp-admin3.32 ▲0.0246.10 ▼1.22
Posts /wp-admin/edit.php3.43 ▲0.0848.88 ▼0.94
Add New Post /wp-admin/post-new.php3.19 ▼2.6936.41 ▼55.69
Media Library /wp-admin/upload.php3.24 ▲0.0141.45 ▲8.56
Numbers Validator /wp-admin/tools.php?page=my-unique-identifier3.2837.27

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Numbers generator and validator
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲10613.72 ▼0.671.83 ▲0.0541.39 ▼4.33
Dashboard /wp-admin2,217 ▲624.88 ▼0.82107.94 ▲8.1342.97 ▲1.44
Posts /wp-admin/edit.php2,097 ▲82.04 ▲0.0139.15 ▼1.2734.51 ▼1.41
Add New Post /wp-admin/post-new.php1,521 ▼1223.53 ▲0.41683.96 ▼0.9452.19 ▲4.39
Media Library /wp-admin/upload.php1,396 ▲114.29 ▼0.1195.21 ▼7.2544.56 ▲1.56
Numbers Validator /wp-admin/tools.php?page=my-unique-identifier1,5781.7232.6146.19

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_recent-posts
    • NumbersValidator_your_checked_tables
    • widget_recent-comments
    • can_compress_scripts
    • NumbersValidator_version
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/numbers-generator-and-validator/src/templates/template-generator.php
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      require_once(NGV_PATH/src/classes/class-storage.php): failed to open stream: No such file or directory in wp-content/plugins/numbers-generator-and-validator/src/classes/class-admin.php on line 10
    • > PHP Fatal error
      require_once(): Failed opening required 'NGV_PATH/src/classes/class-storage.php' (include_path='.:/usr/share/php') in wp-content/plugins/numbers-generator-and-validator/src/classes/class-admin.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function update_option() in wp-content/plugins/numbers-generator-and-validator/src/classes/ngv-settings.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/numbers-generator-and-validator/src/views/template-generator.php:13
    • > PHP Warning
      Use of undefined constant NGV_PATH - assumed 'NGV_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/numbers-generator-and-validator/src/classes/class-admin.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/numbers-generator-and-validator/src/endpoints.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Contributors: The plugin contributors field is missing
Please take inspiration from this readme.txt

numbers-generator-and-validator/ngav.php 92% from 13 tests

The main PHP file in "Numbers generator and validator" ver. 2.0.8 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("numbers-generator-and-validator.php" instead of "ngav.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
No dangerous file extensions were detected3,504 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP164361501,640
JavaScript72812551,251
Sass1720297
CSS26819296
JSON10019
Markdown1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity17.38
▷ Minimum class complexity1.00
▷ Maximum class complexity35.00
Average method complexity4.05
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods43
▷ Static methods00.00%
▷ Public methods2660.47%
▷ Protected methods00.00%
▷ Private methods1739.53%
Functions18
▷ Named functions1688.89%
▷ Anonymous functions211.11%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

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