84% concrete-calculator

Code Review | Concrete Calculator

WordPress plugin Concrete Calculator scored 84% from 54 tests.

About plugin

  • Plugin page: concrete-calculator
  • Plugin version: 1.0
  • PHP compatiblity: 8.1+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Apr 11, 2019
  • Latest release: Feb 26, 2023
  • Number of updates: 17
  • Update frequency: every 83.4 days
  • Top authors: sakawsar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active / 1,105 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
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.48ms] Passed 4 tests

An overview of server-side resources used by Concrete Calculator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.82 ▼3.68
Dashboard /wp-admin3.33 ▲0.0248.29 ▼0.01
Posts /wp-admin/edit.php3.38 ▲0.0248.71 ▼1.74
Add New Post /wp-admin/post-new.php5.91 ▲0.0290.31 ▼8.48
Media Library /wp-admin/upload.php3.25 ▲0.0235.93 ▲1.76
Concrete Calculator /wp-admin/options-general.php?page=sak_cc3.2230.64

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Concrete Calculator
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲10213.27 ▼1.392.12 ▼0.4241.43 ▼6.85
Dashboard /wp-admin2,213 ▲286.04 ▲1.13109.33 ▼3.9441.65 ▼4.43
Posts /wp-admin/edit.php2,093 ▲42.02 ▼0.0239.43 ▲0.3834.86 ▼1.12
Add New Post /wp-admin/post-new.php1,541 ▲2723.14 ▲5.63593.96 ▼81.4751.83 ▼3.06
Media Library /wp-admin/upload.php1,386 ▲14.22 ▼0.0599.40 ▲0.5544.55 ▼0.84
Concrete Calculator /wp-admin/options-general.php?page=sak_cc7832.0326.7826.48

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

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
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/concrete-calculator/shortcode_function.php
    • > /wp-content/plugins/concrete-calculator/shortcode_function_metric.php
    • > /wp-content/plugins/concrete-calculator/index.php

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === concrete-calculator === )
The official readme.txt is a good inspiration

concrete-calculator/index.php 92% from 13 tests

The main PHP script in "Concrete Calculator" version 1.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("concrete-calculator.php" instead of "index.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
Everything looks great! No dangerous files found in this plugin579 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
CSS3696397
PHP3138139
JavaScript161243

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity1.86
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
3 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
asset/images/calculator-icon.png5.30KB3.75KB▼ 29.15%
asset/images/calculator-icon2.png5.30KB3.75KB▼ 29.15%
asset/images/dropdown.png1.01KB0.16KB▼ 83.78%