66% serial-codes-generator-and-validator

Code Review | Serial Codes Generator and Validator with WooCommerce Support

WordPress plugin Serial Codes Generator and Validator with WooCommerce Support scored66%from 54 tests.

About plugin

  • Plugin page: serial-codes-gene...
  • Plugin version: 2.5.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jun 17, 2020
  • Latest release: Nov 20, 2023
  • Number of updates: 136
  • Update frequency: every 9.2 days
  • Top authors: sasonikolov (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

600+ active /22,090 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.18MB] [CPU: ▲30.75ms] Passed 4 tests

This is a short check of server-side resources used by Serial Codes Generator and Validator with WooCommerce Support
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.65 ▲1.1970.67 ▲31.65
Dashboard /wp-admin4.48 ▲1.1775.63 ▲27.88
Posts /wp-admin/edit.php4.53 ▲1.1777.99 ▲32.97
Add New Post /wp-admin/post-new.php7.06 ▲1.17115.25 ▲30.50
Media Library /wp-admin/upload.php4.42 ▲1.1968.43 ▲37.17
Serial Codes Validator /wp-admin/options-general.php?page=sngmbh-serialcodes-validator4.4260.55

Server storage [IO: ▲29.00MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Just a few items left to fix
  • The filesystem usage should be lower than 25MB (currently using 29.00MB)
Filesystem: 285 new files
Database: 3 new tables, 8 new options
New tables
wp_sngmbh_serialcodes_validator_ips
wp_sngmbh_serialcodes_validator_codes
wp_sngmbh_serialcodes_validator_lists
New WordPress options
SNGMBH_SERIALCODES_VALIDATOR_PLUGIN_VERSION
widget_recent-posts
widget_theysaidso_widget
db_upgraded
sngmbh_serialcodes_validator_db_version
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Serial Codes Generator and Validator with WooCommerce Support
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲4814.72 ▲0.011.80 ▲0.0543.75 ▼4.56
Dashboard /wp-admin2,218 ▲415.58 ▼0.0991.67 ▲0.3642.38 ▼1.88
Posts /wp-admin/edit.php2,123 ▲232.01 ▼0.0239.66 ▲1.0635.78 ▲2.47
Add New Post /wp-admin/post-new.php1,551 ▲2524.96 ▲1.78672.01 ▲36.4069.97 ▲4.10
Media Library /wp-admin/upload.php1,420 ▲204.17 ▼0.0599.01 ▲0.4643.67 ▼0.66
Serial Codes Validator /wp-admin/options-general.php?page=sngmbh-serialcodes-validator1,8614.76115.2449.50

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The uninstall procedure failed, leaving 3 tables in the database
    • wp_sngmbh_serialcodes_validator_lists
    • wp_sngmbh_serialcodes_validator_codes
    • wp_sngmbh_serialcodes_validator_ips
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • SNGMBH_SERIALCODES_VALIDATOR_PLUGIN_VERSION
    • db_upgraded
    • widget_theysaidso_widget

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)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 4× PHP files output text when accessed directly:
    • > /wp-content/plugins/serial-codes-generator-and-validator/init_file.php
    • > /wp-content/plugins/serial-codes-generator-and-validator/vendors/TCPDF/tools/tcpdf_addfont.php
    • > /wp-content/plugins/serial-codes-generator-and-validator/ticket/index.php
    • > /wp-content/plugins/serial-codes-generator-and-validator/ticket/scanner/index.php
  • 11× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/serial-codes-generator-and-validator/vollstart_Base.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/serial-codes-generator-and-validator/woocommerce-hooks.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/serial-codes-generator-and-validator/sngmbhSerialcodesValidator_AdminSettings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/serial-codes-generator-and-validator/sngmbhSerialcodesValidator_Options.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/serial-codes-generator-and-validator/vollstart_PDF.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/serial-codes-generator-and-validator/sngmbh-serial-codes-validator.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/serial-codes-generator-and-validator/vollstart_Ticket.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/serial-codes-generator-and-validator/sngmbhSerialcodesValidator_Frontend.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/serial-codes-generator-and-validator/db.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/serial-codes-generator-and-validator/SNGMBH.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% 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
These attributes need your attention:
  • Screenshots: Please add an image for screenshot #8 (**WooCommerce product 1** Set up your products to use the serial codes)
The official readme.txt might help

serial-codes-generator-and-validator/sngmbh-serial-codes-validator.php 77% from 13 tests

The main PHP script in "Serial Codes Generator and Validator with WooCommerce Support" version 2.5.5 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 286 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: The principal plugin file should be the same as the plugin slug ("serial-codes-generator-and-validator.php" instead of "sngmbh-serial-codes-validator.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected63,768 lines of code in 146 files:
LanguageFilesBlank linesComment linesLines of code
PHP1091,97512,32651,912
JavaScript202,3357,34610,012
CSS1536801,734
Markdown121063
JSON10047

PHP code 0% from 2 tests

Analyzing cyclomatic complexity and code structure
These items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 4,413)
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 502)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity286.54
▷ Minimum class complexity1.00
▷ Maximum class complexity4,413.00
Average method complexity8.80
▷ Minimum method complexity1.00
▷ Maximum method complexity502.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes26
▷ Abstract classes00.00%
▷ Concrete classes26100.00%
▷ Final classes27.69%
Methods953
▷ Static methods12112.70%
▷ Public methods58961.80%
▷ Protected methods28229.59%
▷ Private methods828.60%
Functions22
▷ Named functions1881.82%
▷ Anonymous functions418.18%
Constants142
▷ Global constants142100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
7 compressed PNG files occupy 0.00MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
3rd/DataTables-1.10.21/images/sort_desc.png0.15KB0.25KB0.00%
3rd/DataTables-1.10.21/images/sort_asc.png0.16KB0.25KB0.00%
3rd/DataTables-1.10.21/images/sort_desc_disabled.png0.14KB0.25KB0.00%
img/details_open.png0.69KB0.80KB0.00%
3rd/DataTables-1.10.21/images/sort_asc_disabled.png0.14KB0.25KB0.00%