62% web-design-calculator

Code Review | Web Design Calculator

WordPress plugin Web Design Calculator scored62%from 54 tests.

About plugin

  • Plugin page: web-design-calcul...
  • Plugin version: 2.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.1.1
  • WordPress version: 6.3.1
  • First release: Mar 9, 2023
  • Latest release: Jun 10, 2023
  • Number of updates: 21
  • Update frequency: every 4.4 days
  • Top authors: walexconcepts (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /167 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.93MB] [CPU: ▼54.00ms] Passed 4 tests

Server-side resources used by Web Design Calculator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.414.77 ▼38.59
Dashboard /wp-admin2.08 ▼1.237.02 ▼44.60
Posts /wp-admin/edit.php2.08 ▼1.285.91 ▼48.83
Add New Post /wp-admin/post-new.php2.08 ▼3.818.05 ▼83.99
Media Library /wp-admin/upload.php2.08 ▼1.155.75 ▼34.18
Help /wp-admin/admin.php?page=help_webestimator_guide2.087.48

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 11 new files
Database: 3 new tables, 6 new options
New tables
inputs
main_choices
currency
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Web Design Calculator
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,025 ▲26413.85 ▼0.5013.76 ▲11.9942.65 ▲2.16
Dashboard /wp-admin2,207 ▲305.55 ▲0.0286.34 ▼7.2363.28 ▲15.80
Posts /wp-admin/edit.php2,127 ▲271.99 ▲0.0537.42 ▲0.5633.48 ▼9.28
Add New Post /wp-admin/post-new.php1,547 ▲1823.68 ▲0.56725.74 ▲45.6654.14 ▼2.61
Media Library /wp-admin/upload.php1,418 ▲184.20 ▲0.0398.25 ▼18.9178.04 ▲30.66
Help /wp-admin/admin.php?page=help_webestimator_guide8861.9925.4429.64

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=help_webestimator_guide
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)

SRP 0% 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
Almost there! Just fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/web-design-calculator/admin/webestimator_guide_help.php
    • > /wp-content/plugins/web-design-calculator/include/webestimator_guide_myform.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/web-design-calculator/include/webestimator_guide_ajax_request.php:3

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 is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
7 plugin tags: guide, price, calculator, website, estimator...

web-design-calculator/index.php 92% from 13 tests

The entry point to "Web Design Calculator" version 2.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: It is recommended to name the main PHP file as the plugin slug ("web-design-calculator.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin1,850 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1001,037
PHP41009520
SQL1160221
CSS214072

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.38
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%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
adminicon.png12.10KB0.99KB▼ 91.80%