84% elemental-calculator

Code Review | Elemental Calculator

WordPress plugin Elemental Calculator scored84%from 54 tests.

About plugin

  • Plugin page: elemental-calculator
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.3
  • WordPress version: 6.3.1
  • First release: Sep 28, 2018
  • Latest release: Jul 13, 2023
  • Number of updates: 18
  • Update frequency: every 97.2 days
  • Top authors: klushep (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /2,031 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
Install script ran successfully

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

An overview of server-side resources used by Elemental Calculator
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.77 ▼3.46
Dashboard /wp-admin3.31 ▲0.0145.85 ▼2.49
Posts /wp-admin/edit.php3.36 ▲0.0147.91 ▼1.90
Add New Post /wp-admin/post-new.php5.89 ▲0.0184.11 ▼5.32
Media Library /wp-admin/upload.php3.24 ▲0.0132.73 ▲0.50

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_elemental_calculator_widget
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Elemental Calculator: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.40 ▼1.021.88 ▲0.0341.87 ▼7.37
Dashboard /wp-admin2,206 ▲185.91 ▲0.05102.51 ▼16.4841.48 ▼1.80
Posts /wp-admin/edit.php2,089 ▼02.02 ▲0.0039.73 ▲3.6734.89 ▲1.12
Add New Post /wp-admin/post-new.php1,542 ▲918.16 ▼5.09641.50 ▼99.2446.01 ▼14.61
Media Library /wp-admin/upload.php1,388 ▲64.24 ▲0.0098.89 ▼9.5342.41 ▼2.40

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_elemental_calculator_widget
    • widget_recent-comments
    • can_compress_scripts
    • 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
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 is_admin() in wp-content/plugins/elemental-calculator/elemental_calculator_plugin.php:29

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 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: basic, widget, simple, calculator, shortcode...

elemental-calculator/elemental_calculator_plugin.php 92% from 13 tests

The main PHP file in "Elemental Calculator" ver. 1.2.1 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("elemental-calculator.php" instead of "elemental_calculator_plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin364 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript100186
PHP11426100
CSS10078

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.06
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.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