84% aj-easy-calculator

Code Review | Easy Calculator

WordPress plugin Easy Calculator scored84%from 54 tests.

About plugin

  • Plugin page: aj-easy-calculator
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.4
  • WordPress version: 6.3.1
  • First release: Sep 2, 2014
  • Latest release: Jan 5, 2016
  • Number of updates: 14
  • Update frequency: every 37.3 days
  • Top authors: ajanthr (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

80+ active /3,282 total downloads

Benchmarks

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

A check of server-side resources used by Easy Calculator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.94 ▼0.60
Dashboard /wp-admin3.31 ▼0.0349.29 ▼16.96
Posts /wp-admin/edit.php3.37 ▲0.0151.97 ▲0.53
Add New Post /wp-admin/post-new.php5.90 ▲0.0188.25 ▼22.13
Media Library /wp-admin/upload.php3.24 ▲0.0133.56 ▼2.37

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_aj_easy_calculator
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Easy Calculator: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.26 ▼0.121.97 ▼0.0342.43 ▼5.53
Dashboard /wp-admin2,198 ▲215.60 ▲0.0187.53 ▼4.2543.18 ▼2.58
Posts /wp-admin/edit.php2,100 ▼02.05 ▲0.0439.98 ▲3.0837.38 ▼1.22
Add New Post /wp-admin/post-new.php1,526 ▼617.67 ▼5.46668.93 ▼43.0761.56 ▲6.11
Media Library /wp-admin/upload.php1,403 ▲34.22 ▼0.0198.17 ▼8.0248.59 ▲2.50

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 7 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_aj_easy_calculator
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/aj-easy-calculator/easycalculator.php:184

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: operations, arithmetic, calculate, calculator

aj-easy-calculator/easycalculator.php 85% from 13 tests

The main PHP script in "Easy Calculator" version 1.0.4 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 174 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("aj-easy-calculator.php" instead of "easycalculator.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 plugin376 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP11219376

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.12
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%
Functions2
▷ Named functions2100.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
PNG images were not found in this plugin