93% power-calculator

Code Review | Power Calculator

WordPress plugin Power Calculator scored 93% from 54 tests.

About plugin

  • Plugin page: power-calculator
  • Plugin version: 1.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.4
  • WordPress version: 5.8.1
  • First release: Jul 7, 2020
  • Latest release: Jul 7, 2020
  • Number of updates: 9
  • Update frequency: N/A
  • Top authors: deepfitnessclub (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 349 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.13MB] [CPU: ▼141.15ms] Passed 4 tests

Analyzing server-side resources used by Power Calculator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.91 ▲0.1940.07 ▲19.11
Dashboard /wp-admin3.19 ▲0.1343.93 ▼2.96
Posts /wp-admin/edit.php3.24 ▲0.1347.06 ▲0.77
Add New Post /wp-admin/post-new.php5.54 ▲0.1193.10 ▼567.16
Media Library /wp-admin/upload.php3.13 ▲0.1337.48 ▲4.77

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 1 new option
New WordPress options
ddev_power_calculator

Browser metrics Passed 4 tests

Power Calculator: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,699 ▲10315.93 ▲0.358.68 ▲0.5952.19 ▼1.45
Dashboard /wp-admin2,993 ▲625.91 ▼0.03144.46 ▼18.90105.73 ▼13.46
Posts /wp-admin/edit.php2,759 ▲202.70 ▲0.0167.58 ▼1.2799.49 ▲13.80
Add New Post /wp-admin/post-new.php1,696 ▲19818.77 ▼0.11368.10 ▼34.52114.77 ▼4.15
Media Library /wp-admin/upload.php1,827 ▲204.99 ▼0.01155.87 ▼13.54121.40 ▼6.01

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% 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
  • 2× 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/power-calculator/inc/shortcodes/power-calculator.php:102
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/power-calculator/admin/OptionPage.php:38

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: No descriptions were found for these screenshots #1, #2, #3, #4 in power-calculator/assets to your readme.txt
Please take inspiration from this readme.txt

power-calculator/ddev-power-calculator.php 69% from 13 tests

Analyzing the main PHP file in "Power Calculator" version 1.0
You should first fix the following items:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Requires at least: Required version does not match the one declared in readme.txt ("4.7" instead of "5.2")
  • Requires PHP: Required version does not match the one declared in readme.txt ("7.0" instead of "7.2")
  • Main file name: The principal plugin file should be the same as the plugin slug ("power-calculator.php" instead of "ddev-power-calculator.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin11,016 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript31,3031,48810,289
PHP644128334
PO File3126126305
CSS18088

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.20
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods660.00%
▷ Protected methods440.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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 were not PNG files found in your plugin