78% simple-price-calculator-basic

Code Review | Simple Price Calculator

WordPress plugin Simple Price Calculator scored78%from 54 tests.

About plugin

  • Plugin page: simple-price-calc...
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.9.4
  • WordPress version: 6.3.1
  • First release: Sep 15, 2014
  • Latest release: Mar 16, 2018
  • Number of updates: 15
  • Update frequency: every 85.3 days
  • Top authors: premiumbizthemes (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

100+ active /12,729 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

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

Server-side resources used by Simple Price Calculator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.37 ▼4.90
Dashboard /wp-admin3.36 ▲0.0246.93 ▼16.83
Posts /wp-admin/edit.php3.41 ▲0.0650.82 ▲1.99
Add New Post /wp-admin/post-new.php5.94 ▲0.0690.14 ▼11.97
Media Library /wp-admin/upload.php3.29 ▲0.0635.86 ▼0.12
FAQ /wp-admin/edit.php?post_type=simple_price_calc&page=simple-price-calc-support3.2529.10
Simple Price Calculator Forms /wp-admin/edit.php?post_type=simple_price_calc3.3335.55
Add New /wp-admin/post-new.php?post_type=simple_price_calc3.4047.45

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple Price Calculator
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲8913.25 ▼1.141.61 ▼0.2241.16 ▼5.00
Dashboard /wp-admin2,241 ▲564.89 ▼0.97125.47 ▲22.6239.75 ▼2.69
Posts /wp-admin/edit.php2,124 ▲352.06 ▲0.0241.20 ▲4.0634.34 ▼0.43
Add New Post /wp-admin/post-new.php1,571 ▲5218.04 ▼5.02616.42 ▼72.9969.14 ▲12.35
Media Library /wp-admin/upload.php1,423 ▲384.23 ▼0.0295.30 ▲0.8343.04 ▼1.33
FAQ /wp-admin/edit.php?post_type=simple_price_calc&page=simple-price-calc-support9042.0222.3327.87
Simple Price Calculator Forms /wp-admin/edit.php?post_type=simple_price_calc1,1041.9431.2131.29
Add New /wp-admin/post-new.php?post_type=simple_price_calc2,6207.94172.7680.29

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 were found after uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

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 no errors were found, this is by no means an exhaustive test

SRP 0% 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
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/simple-price-calculator-basic/formgencode.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/simple-price-calculator-basic/simplepricecalc.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-price-calculator-basic/spcadmin.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention: The official readme.txt might help

simple-price-calculator-basic/simplepricecalc.php 85% from 13 tests

The entry point to "Simple Price Calculator" version 1.3 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("simple-price-calculator-basic.php" instead of "simplepricecalc.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 207 characters long)

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 plugin354 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP39020253
JavaScript331493
CSS1808

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity4.00
▷ Minimum class complexity2.00
▷ Maximum class complexity6.00
Average method complexity1.40
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods1493.33%
▷ Protected methods00.00%
▷ Private methods16.67%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin