84% quantitymodifier

Code Review | Quantity Modifier

WordPress plugin Quantity Modifier scored84%from 54 tests.

About plugin

  • Plugin page: quantitymodifier
  • Plugin version: 0.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.7
  • WordPress version: 6.3.1
  • First release: Sep 15, 2018
  • Latest release: Sep 15, 2018
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: hypertextstudios (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /604 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
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.91ms] Passed 4 tests

Server-side resources used by Quantity Modifier
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.94 ▲5.03
Dashboard /wp-admin3.31 ▲0.0147.52 ▲1.53
Posts /wp-admin/edit.php3.36 ▲0.0144.01 ▼1.51
Add New Post /wp-admin/post-new.php5.91 ▲0.0379.88 ▼16.75
Media Library /wp-admin/upload.php3.24 ▲0.0134.14 ▲1.11
quantityModifier /wp-admin/options-general.php?page=quantityModifier3.2029.35

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Quantity Modifier
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,878 ▲11713.38 ▼1.288.86 ▲7.2043.10 ▼2.49
Dashboard /wp-admin2,204 ▲245.65 ▲0.0291.04 ▲3.9844.85 ▲7.08
Posts /wp-admin/edit.php2,106 ▲62.02 ▲0.0233.50 ▲0.0733.98 ▼4.01
Add New Post /wp-admin/post-new.php1,533 ▲523.07 ▲0.12660.29 ▼6.0251.50 ▲0.01
Media Library /wp-admin/upload.php1,406 ▲34.23 ▲0.06105.59 ▲5.5145.57 ▼0.05
quantityModifier /wp-admin/options-general.php?page=quantityModifier7722.0424.3123.97

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options

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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 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/quantitymodifier/quantityModifier.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Screenshots: Add an image for screenshot #1 (An example of the buttons on the product page)
Please take inspiration from this readme.txt

quantitymodifier/quantityModifier.php 92% from 13 tests

Analyzing the main PHP file in "Quantity Modifier" version 0.1
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("quantitymodifier.php" instead of "quantityModifier.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected54 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP1102938
JavaScript23116

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.00
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%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.06MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-01.png58.37KB16.45KB▼ 71.81%