10% attribute-calculator

Code Review | Attribute Calculator

WordPress plugin Attribute Calculator scored 10% from 54 tests.

About plugin

  • Plugin page: attribute-calculator
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.5.3
  • WordPress version: 6.3.1
  • First release: Nov 19, 2019
  • Latest release: Nov 9, 2020
  • Number of updates: 5
  • Update frequency: every 72.6 days
  • Top authors: UsusIpse (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 653 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/attribute-calculator/AttributeCalculator_Plugin.php+30
    count(): Parameter must be an array or an object that implements Countable

Server metrics [RAM: ▲0.15MB] [CPU: ▼3.99ms] Passed 4 tests

This is a short check of server-side resources used by Attribute Calculator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1535.92 ▼6.49
Dashboard /wp-admin3.45 ▲0.1547.22 ▲2.15
Posts /wp-admin/edit.php3.56 ▲0.2148.54 ▼0.62
Add New Post /wp-admin/post-new.php6.05 ▲0.1784.08 ▼9.17
Media Library /wp-admin/upload.php3.37 ▲0.1433.42 ▲0.31
Attribute Calculator /wp-admin/plugins.php?page=AttributeCalculator_PluginSettings3.3430.06

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
AttributeCalculator_Plugin_multiplyBy
AttributeCalculator_Plugin__installed
widget_recent-posts
widget_theysaidso_widget
AttributeCalculator_Plugin_isEnabled
AttributeCalculator_Plugin__version
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Attribute Calculator
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4714.48 ▲0.101.69 ▼0.2941.36 ▼8.05
Dashboard /wp-admin2,213 ▲284.86 ▼0.0899.02 ▼10.7537.88 ▼9.83
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0240.43 ▲5.8935.68 ▲1.21
Add New Post /wp-admin/post-new.php1,545 ▲2118.82 ▼4.46604.64 ▼41.3161.11 ▼5.84
Media Library /wp-admin/upload.php1,392 ▲74.36 ▲0.0996.17 ▼1.7341.88 ▼3.78
Attribute Calculator /wp-admin/plugins.php?page=AttributeCalculator_PluginSettings8402.0623.6429.49

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 10 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • AttributeCalculator_Plugin_isEnabled
    • can_compress_scripts
    • theysaidso_admin_options
    • AttributeCalculator_Plugin_multiplyBy
    • AttributeCalculator_Plugin__version
    • AttributeCalculator_Plugin__installed

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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 fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/attribute-calculator/attribute-calculator.php:79

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/plugins.php?page=AttributeCalculator_PluginSettings
    • > Network (severe)
    wp-content/plugins/attribute-calculator/css/admin-style.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/plugins.php?page=AttributeCalculator_PluginSettings
    • > Network (severe)
    wp-content/plugins/attribute-calculator//js/calcadmin.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
9 plugin tags: length-calculator, length, product, woocommerce, calculator...

attribute-calculator/attribute-calculator.php Passed 13 tests

The primary PHP file in "Attribute Calculator" version 1.2 is used by WordPress to initiate all plugin functionality
81 characters long description:
Allows you to define an attribute to multiply your product's price in WooCommerce

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
There were no executable files found in this plugin668 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP8195509652
JavaScript18116

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity14.00
▷ Minimum class complexity1.00
▷ Maximum class complexity45.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes233.33%
▷ Concrete classes466.67%
▷ Final classes00.00%
Methods80
▷ Static methods00.00%
▷ Public methods5265.00%
▷ Protected methods2835.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

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