74% product-weight

Code Review | Product Weight - Price Per Weight

WordPress plugin Product Weight - Price Per Weight scored74%from 54 tests.

About plugin

  • Plugin page: product-weight
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.9
  • WordPress version: 6.3.1
  • First release: May 21, 2022
  • Latest release: May 21, 2022
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: omardieh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,290 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼10.35ms] Passed 4 tests

Server-side resources used by Product Weight - Price Per Weight
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0133.35 ▼9.01
Dashboard /wp-admin3.31 ▼0.0344.03 ▼14.78
Posts /wp-admin/edit.php3.37 ▲0.0147.00 ▲1.54
Add New Post /wp-admin/post-new.php5.90 ▲0.0179.47 ▼19.14
Media Library /wp-admin/upload.php3.24 ▲0.0133.69 ▲2.20
Price Per Weight /wp-admin/admin.php?page=price-per-weight3.2029.62

Server storage [IO: ▲0.01MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 2 new files
Database: 1 new table, 7 new options
New tables
wp_price_per_weight
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
test_db_version
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Product Weight - Price Per Weight
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.23 ▼1.124.98 ▲3.4244.98 ▲3.01
Dashboard /wp-admin2,209 ▲215.86 ▲0.9997.93 ▲0.6837.93 ▼4.09
Posts /wp-admin/edit.php2,089 ▼02.06 ▲0.0634.23 ▼3.3332.50 ▼1.86
Add New Post /wp-admin/post-new.php1,514 ▼017.70 ▲0.10675.83 ▲60.8560.48 ▲17.86
Media Library /wp-admin/upload.php1,388 ▼34.17 ▼0.0292.96 ▼3.7941.88 ▼2.54
Price Per Weight /wp-admin/admin.php?page=price-per-weight8132.0222.4028.72

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 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 plugin did not uninstall successfully, leaving 1 table in the database
    • wp_price_per_weight
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • can_compress_scripts
    • test_db_version
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% 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 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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/product-weight/product-weight.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

product-weight/product-weight.php 92% from 13 tests

"Product Weight - Price Per Weight" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 224 characters long)

Code Analysis Passed 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 detected183 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP11122183

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
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%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin