84% price-calculator

Code Review | Price Calculator block - Calculate the price of products based on quantity.

WordPress plugin Price Calculator block - Calculate the price of products based on quantity. scored84%from 54 tests.

About plugin

  • Plugin page: price-calculator
  • Plugin version: 1.0.9
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Nov 25, 2021
  • Latest release: Oct 3, 2023
  • Number of updates: 30
  • Update frequency: every 22.6 days
  • Top authors: charlescormier (90%)abuhayat (13.33%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /3,579 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by Price Calculator block - Calculate the price of products based on quantity.
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0539.52 ▼0.95
Dashboard /wp-admin3.34 ▲0.0445.65 ▼11.56
Posts /wp-admin/edit.php3.39 ▲0.0448.44 ▼2.78
Add New Post /wp-admin/post-new.php5.93 ▲0.0495.36 ▲1.72
Media Library /wp-admin/upload.php3.26 ▲0.0439.30 ▲5.29

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

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

Browser metrics Passed 4 tests

Price Calculator block - Calculate the price of products based on quantity.: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲7414.67 ▲0.4311.94 ▲10.1740.74 ▼6.30
Dashboard /wp-admin2,209 ▲245.91 ▲0.0797.95 ▼2.5438.66 ▼4.59
Posts /wp-admin/edit.php2,092 ▲32.03 ▼0.0340.08 ▲5.5634.39 ▲4.90
Add New Post /wp-admin/post-new.php6,359 ▲4,82928.04 ▲9.88808.06 ▲172.4136.01 ▼19.64
Media Library /wp-admin/upload.php1,391 ▲64.22 ▲0.0497.09 ▼2.2042.85 ▲0.02

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

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)
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant PCLB_PLUGIN_VERSION - assumed 'PCLB_PLUGIN_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/price-calculator/dist/script.asset.php on line 4
    • > PHP Warning
      Use of undefined constant PCLB_PLUGIN_VERSION - assumed 'PCLB_PLUGIN_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/price-calculator/dist/editor.asset.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

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 need to be fixed:
  • Requires at least: Version not formatted correctly
You can look at the official readme.txt

price-calculator/plugin.php 92% from 13 tests

Analyzing the main PHP file in "Price Calculator block - Calculate the price of products based on quantity." version 1.0.9
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("price-calculator.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin311 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
JSON200164
PO File14382104
PHP4101439
CSS2022
JavaScript2022

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There are no PNG files in this plugin