66% image-price-calculator

Code Review | Image Price Calculator

WordPress plugin Image Price Calculator scored66%from 54 tests.

About plugin

  • Plugin page: image-price-calcu...
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.0
  • WordPress version: 6.3.1
  • First release: Feb 25, 2015
  • Latest release: Apr 6, 2015
  • Number of updates: 3
  • Update frequency: every 13.3 days
  • Top authors: javiromera (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,041 total downloads

Benchmarks

Plugin footprint 83% 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.65MB] [CPU: ▼20.01ms] Passed 4 tests

Analyzing server-side resources used by Image Price Calculator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0141.75 ▼0.84
Dashboard /wp-admin3.36 ▲0.0151.84 ▼15.60
Posts /wp-admin/edit.php3.41 ▲0.0553.00 ▼0.21
Add New Post /wp-admin/post-new.php3.21 ▼2.6839.78 ▼62.90
Media Library /wp-admin/upload.php3.28 ▲0.0538.52 ▼0.68
Add New /wp-admin/post-new.php?post_type=image_price_calc3.1435.12
Image Price Calculator Forms /wp-admin/edit.php?post_type=image_price_calc3.3241.00

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Image Price Calculator
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲9914.35 ▲0.431.92 ▲0.2842.91 ▲0.42
Dashboard /wp-admin2,229 ▲525.61 ▲0.0194.71 ▼3.4040.78 ▲0.03
Posts /wp-admin/edit.php2,134 ▲342.00 ▼0.0140.30 ▼0.6336.31 ▲0.49
Add New Post /wp-admin/post-new.php1,562 ▲3622.99 ▼0.11606.45 ▼77.0146.00 ▼8.89
Media Library /wp-admin/upload.php1,434 ▲314.19 ▲0.06101.94 ▼2.9144.87 ▼0.74
Add New /wp-admin/post-new.php?post_type=image_price_calc2,4868.20178.5979.40
Image Price Calculator Forms /wp-admin/edit.php?post_type=image_price_calc1,1111.9730.1330.36

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/post-new.php?post_type=image_price_calc
    • > Notice in wp-content/plugins/image-price-calculator/spcadmin.php+49
    Undefined index: activarwoo
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=image_price_calc
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/image-price-calculator/formgencode.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/image-price-calculator/imagepricecalc.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/image-price-calculator/spcadmin.php:12

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=image_price_calc
    • > Network (severe)
    wp-admin/wp-content/plugins/Image-price-calculator/ajax-loader.gif - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Front-end of plugin. Price and images change based on which buttons are selected.), #2 (Back-end of plugin automatically displays shortcode once form is created.)
The official readme.txt might help

image-price-calculator/imagepricecalc.php 92% from 13 tests

The main file in "Image Price Calculator" v. 2.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("image-price-calculator.php" instead of "imagepricecalc.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin388 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2625199
PHP312718181
CSS1808

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity5.50
▷ Minimum class complexity4.00
▷ Maximum class complexity7.00
Average method complexity1.64
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods1392.86%
▷ Protected methods00.00%
▷ Private methods17.14%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
16 PNG files occupy 2.27MB with 1.69MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
Advance/nameImagextra2kind1.png89.51KB21.59KB▼ 75.88%
Advance/nameImageCbox.png56.94KB12.60KB▼ 77.88%
Advance/nameImagextra1kind2.png323.52KB79.88KB▼ 75.31%
Basic/nameImageRadio2.png188.96KB69.28KB▼ 63.34%
Basic/nameImagextra1kind2.png58.21KB12.09KB▼ 79.23%