62% calculator-guide

Code Review | Calculator Guide

WordPress plugin Calculator Guide scored62%from 54 tests.

About plugin

  • Plugin page: calculator-guide
  • Plugin version: 3.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: Apr 5, 2022
  • Latest release: Jun 14, 2023
  • Number of updates: 53
  • Update frequency: every 8.4 days
  • Top authors: walexconcepts (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /392 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▼1.92MB] [CPU: ▼52.98ms] Passed 4 tests

Analyzing server-side resources used by Calculator Guide
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.404.12 ▼40.02
Dashboard /wp-admin2.09 ▼1.227.11 ▼41.99
Posts /wp-admin/edit.php2.09 ▼1.276.42 ▼39.13
Add New Post /wp-admin/post-new.php2.09 ▼3.804.88 ▼90.78
Media Library /wp-admin/upload.php2.09 ▼1.155.22 ▼31.39
Help /wp-admin/admin.php?page=help_calculator_guide2.095.89
Settings /wp-admin/admin.php?page=settings_calculator_guide2.097.14

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: 1 new table, 6 new options
New tables
wc_calculator_guide
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Calculator Guide
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,914 ▲17913.98 ▼0.4010.06 ▲8.2146.87 ▲2.34
Dashboard /wp-admin2,235 ▲505.87 ▼0.04103.39 ▼28.8539.30 ▼6.08
Posts /wp-admin/edit.php2,118 ▲292.04 ▲0.0239.17 ▲0.1135.75 ▼1.83
Add New Post /wp-admin/post-new.php1,552 ▲3323.23 ▲0.10657.88 ▼7.7371.78 ▲1.36
Media Library /wp-admin/upload.php1,414 ▲234.21 ▲0.03114.65 ▲7.1144.88 ▼0.08
Help /wp-admin/admin.php?page=help_calculator_guide8612.0227.9129.64
Settings /wp-admin/admin.php?page=settings_calculator_guide8292.0331.4328.39

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin cannot be uninstalled
    • > 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.)
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=settings_calculator_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.)
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=settings_calculator_guide
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+204
    Undefined offset: 0
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=settings_calculator_guide
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+205
    Trying to get property 'guid' of non-object
  • 24 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=settings_calculator_guide
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+221
    Trying to get property 'ID' of non-object
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=settings_calculator_guide
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+222
    Trying to get property 'post_title' of non-object
    • > GET request to /wp-admin/admin.php?page=settings_calculator_guide
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.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
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/calculator-guide/admin/calculator_guide_help.php
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/calculator-guide/include/calculator_guide_postit.php:29
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/calculator-guide/include/calculator_guide_myform.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/calculator-guide/admin/calculator_guide_form.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: No descriptions were found for these screenshots #1, #2, #3, #4, #5, #6, #7, #8 in calculator-guide/assets to your readme.txt
You can take inspiration from this readme.txt

calculator-guide/index.php 85% from 13 tests

The main PHP script in "Calculator Guide" version 3.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 151 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("calculator-guide.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin371 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP66011283
CSS16042
JavaScript13040
SQL1606

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
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%
Functions10
▷ Named functions10100.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
There are no PNG files in this plugin