84% toms-product-label

Code Review | TomS Product Label

WordPress plugin TomS Product Label scored84%from 54 tests.

About plugin

  • Plugin page: toms-product-label
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 23, 2022
  • Latest release: Dec 23, 2022
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: tomsneddon (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,245 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼6.69ms] Passed 4 tests

A check of server-side resources used by TomS Product Label
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0542.13 ▲0.15
Dashboard /wp-admin3.35 ▲0.0552.53 ▼0.93
Posts /wp-admin/edit.php3.40 ▲0.0449.24 ▼5.60
Add New Post /wp-admin/post-new.php5.93 ▲0.0493.47 ▼16.12
Media Library /wp-admin/upload.php3.27 ▲0.0433.52 ▼4.10

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

TomS Product Label: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.83 ▼0.425.91 ▲4.0544.25 ▲4.40
Dashboard /wp-admin2,203 ▲185.83 ▲0.01121.48 ▲14.0442.85 ▼1.91
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0134.57 ▼6.1332.15 ▼4.49
Add New Post /wp-admin/post-new.php1,514 ▼517.43 ▼5.88717.54 ▲45.7061.17 ▲0.75
Media Library /wp-admin/upload.php1,388 ▼34.19 ▼0.0597.96 ▼14.0041.21 ▼6.93

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/toms-product-label/library/toms-wpl-html.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/toms-product-label/library/toms-wpl-editor.php:3

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

The readme.txt file uses markdown syntax to describe your plugin to the world
9 plugin tags: stick on a label, woocommerce, product label, 1d barcode, sealing label...

toms-product-label/toms-product-label.php 85% from 13 tests

Analyzing the main PHP file in "TomS Product Label" version 1.0.0
It is important to fix the following:
  • Requires PHP: Required version must be the same as the one declared in readme.txt ("7.4" instead of "7.0")
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin785 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP34539418
CSS2717339
JavaScript42428

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity20.00
▷ Minimum class complexity20.00
▷ Maximum class complexity20.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
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
6 compressed PNG files occupy 0.06MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/toms-product-label.png5.44KB3.71KB▼ 31.92%
assets/img/TomS-Caprice.png3.28KB2.95KB▼ 10.15%
assets/img/TomS-68.png1.34KB1.79KB0.00%
assets/img/ce.png0.93KB1.17KB0.00%
assets/img/fcc.png1.28KB1.53KB0.00%