61% upc-ean-barcode-generator

Code Review | UPC/EAN Code Generator

WordPress plugin UPC/EAN Code Generator scored61%from 54 tests.

About plugin

  • Plugin page: upc-ean-barcode-g...
  • Plugin version: 2.0.0
  • PHP compatiblity: 5.8.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.4
  • WordPress version: 6.3.1
  • First release: Oct 18, 2021
  • Latest release: Nov 15, 2023
  • Number of updates: 13
  • Update frequency: every 58.5 days
  • Top authors: UkrSolution (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /1,669 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.55MB] [CPU: ▼0.64ms] Passed 4 tests

An overview of server-side resources used by UPC/EAN Code Generator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.16 ▲0.6943.82 ▲5.64
Dashboard /wp-admin3.88 ▲0.5750.31 ▲1.97
Posts /wp-admin/edit.php3.93 ▲0.5755.16 ▲10.05
Add New Post /wp-admin/post-new.php6.40 ▲0.5088.03 ▼13.36
Media Library /wp-admin/upload.php3.78 ▲0.5440.06 ▲3.18
Settings /wp-admin/admin.php?page=upc-ean-generator3.7142.36
Support /wp-admin/admin.php?page=upc-ean-generator-support3.7139.33
Barcode Scanner /wp-admin/admin.php?page=bs-mobile-home3.6836.32
FAQ /wp-admin/admin.php?page=upc-ean-generator-faq3.7137.75

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 308 new files
Database: 2 new tables, 7 new options
New tables
wp_uean_generator_files
wp_uean_generator_codes
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
active-{%plugin%}-barcodes-version
widget_theysaidso_widget

Browser metrics Passed 4 tests

UPC/EAN Code Generator: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,860 ▲9814.34 ▼0.001.56 ▼0.2739.62 ▼8.03
Dashboard /wp-admin2,262 ▲855.98 ▲0.34125.31 ▲35.0741.47 ▼5.21
Posts /wp-admin/edit.php2,176 ▲762.98 ▲0.9749.32 ▲8.4635.48 ▼2.47
Add New Post /wp-admin/post-new.php1,562 ▲3323.97 ▲0.63681.21 ▲60.7550.92 ▼15.06
Media Library /wp-admin/upload.php1,474 ▲745.43 ▲1.23105.80 ▲6.1741.46 ▼0.32
Settings /wp-admin/admin.php?page=upc-ean-generator9973.3860.7932.62
Support /wp-admin/admin.php?page=upc-ean-generator-support8452.6130.8223.11
Barcode Scanner /wp-admin/admin.php?page=bs-mobile-home8432.7332.0524.80
FAQ /wp-admin/admin.php?page=upc-ean-generator-faq8412.7133.9923.70

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 2 tables in the database
    • wp_uean_generator_files
    • wp_uean_generator_codes
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • active-{%plugin%}-barcodes-version
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=bs-mobile-home
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'UkrSolution\UpcEanGenerator\Core' does not have a method 'mobilePageHome'

SRP 0% 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 take a closer look at the following
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/upc-ean-barcode-generator/src/features/settings/index.php
    • > /wp-content/plugins/upc-ean-barcode-generator/src/features/products/views/set-field-value.php
    • > /wp-content/plugins/upc-ean-barcode-generator/src/features/settings/index_backup.php
  • 115× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPExcel_Writer_OpenDocument_WriterPart' not found in wp-content/plugins/upc-ean-barcode-generator/extlibs/PHPExcel/PHPExcel/Writer/OpenDocument/Content.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'PHPExcel_Style_Supervisor' not found in wp-content/plugins/upc-ean-barcode-generator/extlibs/PHPExcel/PHPExcel/Style.php:4
    • > PHP Fatal error
      require_once(): Failed opening required 'PHPEXCEL_ROOTPHPExcel/Shared/trend/bestFitClass.php' (include_path='.:/usr/share/php') in wp-content/plugins/upc-ean-barcode-generator/extlibs/PHPExcel/PHPExcel/Shared/trend/polynomialBestFitClass.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'UkrSolution\\UpcEanGenerator\\features\\Integrations\\DefaultField' not found in wp-content/plugins/upc-ean-barcode-generator/src/features/Integrations/EanForWc.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPExcel_Writer_Excel2007_WriterPart' not found in wp-content/plugins/upc-ean-barcode-generator/extlibs/PHPExcel/PHPExcel/Writer/Excel2007/Rels.php:4
    • > PHP Warning
      Use of undefined constant PHPEXCEL_ROOT - assumed 'PHPEXCEL_ROOT' (this will throw an Error in a future version of PHP) in wp-content/plugins/upc-ean-barcode-generator/extlibs/PHPExcel/PHPExcel/Shared/trend/linearBestFitClass.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/upc-ean-barcode-generator/src/config/jsL10n.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'PHPExcel_Writer_Abstract' not found in wp-content/plugins/upc-ean-barcode-generator/extlibs/PHPExcel/PHPExcel/Writer/OpenDocument.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'PHPExcel_CachedObjectStorage_CacheBase' not found in wp-content/plugins/upc-ean-barcode-generator/extlibs/PHPExcel/PHPExcel/CachedObjectStorage/Igbinary.php:4
    • > PHP Warning
      require_once(PHPEXCEL_ROOTPHPExcel/Shared/trend/bestFitClass.php): failed to open stream: No such file or directory in wp-content/plugins/upc-ean-barcode-generator/extlibs/PHPExcel/PHPExcel/Shared/trend/powerBestFitClass.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% 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
6 plugin tags: ean, barcode, upc-a, ean-13, upc...

upc-ean-barcode-generator/index.php 77% from 13 tests

The principal PHP file in "UPC/EAN Code Generator" v. 2.0.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.0.1" instead of "4.0.0")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("upc-ean-barcode-generator.php" instead of "index.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected54,337 lines of code in 243 files:
LanguageFilesBlank linesComment linesLines of code
PHP24012,35385554,178
CSS14091
JSON10067
JavaScript1001

PHP code 0% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 1,176)
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 387)
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity47.61
▷ Minimum class complexity1.00
▷ Maximum class complexity1,176.00
Average method complexity4.66
▷ Minimum method complexity1.00
▷ Maximum method complexity387.00
Code structure
Namespaces10
Interfaces7
Traits0
Classes220
▷ Abstract classes94.09%
▷ Concrete classes21195.91%
▷ Final classes00.00%
Methods2,912
▷ Static methods63921.94%
▷ Public methods2,36481.18%
▷ Protected methods491.68%
▷ Private methods49917.14%
Functions26
▷ Named functions1453.85%
▷ Anonymous functions1246.15%
Constants869
▷ Global constants12013.81%
▷ Class constants74986.19%
▷ Public constants749100.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