74% barcode-generator

Code Review | Barcode Generator

WordPress plugin Barcode Generator scored74%from 54 tests.

About plugin

  • Plugin page: barcode-generator
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Feb 23, 2018
  • Latest release: Mar 1, 2018
  • Number of updates: 4
  • Update frequency: every 1.5 days
  • Top authors: theweeky15 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,608 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.90MB] [CPU: ▼40.38ms] Passed 4 tests

Server-side resources used by Barcode Generator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0740.81 ▼4.45
Dashboard /wp-admin3.06 ▼0.2923.00 ▼41.61
Posts /wp-admin/edit.php3.06 ▼0.3023.32 ▼28.69
Add New Post /wp-admin/post-new.php3.06 ▼2.8322.83 ▼76.17
Media Library /wp-admin/upload.php3.06 ▼0.1721.77 ▼15.03

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-posts
barcode_num
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Barcode Generator
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5814.36 ▲0.221.93 ▼0.2842.50 ▼4.90
Dashboard /wp-admin2,225 ▲194.84 ▼0.95106.30 ▼11.2940.64 ▼4.59
Posts /wp-admin/edit.php2,107 ▲72.00 ▼0.0235.68 ▼7.7732.42 ▼2.42
Add New Post /wp-admin/post-new.php1,548 ▲323.19 ▲0.12672.42 ▼36.6356.31 ▲5.62
Media Library /wp-admin/upload.php1,407 ▲104.26 ▲0.0199.69 ▼49.2745.21 ▼18.03
Generate Barcode /wp-admin/tools.php?page=Generate Barcode8302.0726.2325.31

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • barcode_num
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% 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 50% 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/barcode-generator/index.php:206

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: barcode, generator, print, orientation, easy...

barcode-generator/index.php 85% from 13 tests

"Barcode Generator" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("barcode-generator.php" instead of "index.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 151 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin187 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1138187

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
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%
Functions4
▷ Named functions4100.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
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
barcode-generator.png31.90KB14.47KB▼ 54.66%