78% slope-calculator

Code Review | Slope Calculator

WordPress plugin Slope Calculator scored 78% from 54 tests.

About plugin

  • Plugin page: slope-calculator
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.1
  • WordPress version: 6.3.1
  • First release: Nov 24, 2022
  • Latest release: Nov 30, 2022
  • Number of updates: 3
  • Update frequency: every 2.0 days
  • Top authors: enzipeapps (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 132 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.01MB] [CPU: ▼6.84ms] Passed 4 tests

Server-side resources used by Slope Calculator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.98 ▼0.36
Dashboard /wp-admin3.32 ▲0.0144.99 ▼7.83
Posts /wp-admin/edit.php3.37 ▲0.0144.04 ▲0.07
Add New Post /wp-admin/post-new.php5.90 ▲0.0182.42 ▼19.22
Media Library /wp-admin/upload.php3.24 ▲0.0134.18 ▲0.12

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Slope Calculator
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,923 ▲16613.90 ▼0.749.58 ▲7.5242.04 ▼3.10
Dashboard /wp-admin2,218 ▲295.88 ▲0.91109.42 ▼0.5043.61 ▼9.34
Posts /wp-admin/edit.php2,101 ▲92.05 ▲0.0834.49 ▼0.4934.03 ▲1.35
Add New Post /wp-admin/post-new.php1,543 ▲1023.48 ▲0.49675.33 ▲56.8648.17 ▼11.35
Media Library /wp-admin/upload.php1,400 ▲154.24 ▲0.0793.18 ▼7.3542.24 ▼3.24

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
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/slope-calculator/slope-cal.php
    • > /wp-content/plugins/slope-calculator/inc/main-form.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/slope-calculator/inc/admin-setting.php:38

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: slope calculator, calculator

slope-calculator/slope-cal.php 92% from 13 tests

The entry point to "Slope Calculator" version 1.0.0 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("slope-calculator.php" instead of "slope-cal.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin891 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
CSS1625375
PHP62819285
JavaScript1220231

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.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
No PNG images were found in this plugin