84% simple-math-calculator

Code Review | Plugin Name: Wordpress Simple Calculator

WordPress plugin Plugin Name: Wordpress Simple Calculator scored84%from 54 tests.

About plugin

  • Plugin page: simple-math-calcu...
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.2
  • WordPress version: 6.3.1
  • First release: Sep 16, 2013
  • Latest release: Oct 17, 2014
  • Number of updates: 15
  • Update frequency: every 26.5 days
  • Top authors: souravmondal10 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,508 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

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

A check of server-side resources used by Plugin Name: Wordpress Simple Calculator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.70 ▼2.11
Dashboard /wp-admin3.32 ▲0.0147.94 ▼2.28
Posts /wp-admin/edit.php3.37 ▲0.0143.31 ▼6.72
Add New Post /wp-admin/post-new.php5.90 ▲0.0178.79 ▼8.24
Media Library /wp-admin/upload.php3.24 ▲0.0133.41 ▼1.91

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Plugin Name: Wordpress Simple Calculator: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲13714.01 ▼0.375.99 ▲4.1143.99 ▼1.65
Dashboard /wp-admin2,203 ▲184.86 ▼0.09114.42 ▼0.3646.05 ▲2.80
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0635.84 ▼4.2732.34 ▲0.40
Add New Post /wp-admin/post-new.php1,537 ▲1523.55 ▲0.35648.26 ▼26.2454.53 ▲1.60
Media Library /wp-admin/upload.php1,391 ▲34.18 ▼0.0493.42 ▼7.0743.26 ▼4.81

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • 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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/simple-math-calculator/index.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === Plugin Name: Wordpress Simple Calculator === )
The official readme.txt might help

simple-math-calculator/index.php 92% from 13 tests

Analyzing the main PHP file in "Plugin Name: Wordpress Simple Calculator" version 2.0.0
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("simple-math-calculator.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin328 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
CSS137232
JavaScript15657
PHP131039

PHP code Passed 2 tests

This is a very shot review 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.00
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin