10% credit-calc

Code Review | credit_calc Plugin

WordPress plugin credit_calc Plugin scored10%from 54 tests.

About plugin

  • Plugin page: credit-calc
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4
  • WordPress version: 6.3.1
  • First release: Apr 24, 2020
  • Latest release: May 25, 2020
  • Number of updates: 4
  • Update frequency: every 10.3 days
  • Top authors: kostikovmu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /685 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • The plugin did not install without errors
    • > User deprecated in wp-includes/functions.php+5643
    File class-phpmailer.php is deprecated since version 5.5.0! Use wp-includes/PHPMailer/PHPMailer.php instead. The PHPMailer class has been moved to wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace.

Server metrics [RAM: ▼1.89MB] [CPU: ▼51.65ms] Passed 4 tests

A check of server-side resources used by credit_calc Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.10 ▼1.366.61 ▼36.14
Dashboard /wp-admin2.12 ▼1.187.04 ▼38.36
Posts /wp-admin/edit.php2.12 ▼1.246.86 ▼39.62
Add New Post /wp-admin/post-new.php2.12 ▼3.776.55 ▼92.49
Media Library /wp-admin/upload.php2.12 ▼1.116.53 ▼29.24
Credit calc /wp-admin/options-general.php?page=credit_calc_option2.126.30

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for credit_calc Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲6213.64 ▼0.741.79 ▼0.1744.58 ▼5.69
Dashboard /wp-admin2,215 ▲244.85 ▼0.02102.06 ▼5.3539.34 ▼1.24
Posts /wp-admin/edit.php2,104 ▲152.02 ▲0.0236.73 ▼0.0538.89 ▲3.73
Add New Post /wp-admin/post-new.php1,423 ▼11021.64 ▼1.49551.96 ▼106.5730.63 ▼25.06
Media Library /wp-admin/upload.php1,397 ▲94.28 ▲0.0496.53 ▼0.8238.99 ▼2.77
Credit calc /wp-admin/options-general.php?page=credit_calc_option6851.327.5925.95

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > User deprecated in wp-includes/functions.php+5643
    File class-phpmailer.php is deprecated since version 5.5.0! Use wp-includes/PHPMailer/PHPMailer.php instead. The PHPMailer class has been moved to wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace.
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=credit_calc_option
    • > User deprecated in wp-includes/functions.php+5643
    File class-phpmailer.php is deprecated since version 5.5.0! Use wp-includes/PHPMailer/PHPMailer.php instead. The PHPMailer class has been moved to wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace.
    • > GET request to /wp-admin/options-general.php?page=credit_calc_option
    • > Error in wp-content/plugins/credit-calc/credit-calc.php+145
    Uncaught Error: Call to undefined function get_template_html() in wp-content/plugins/credit-calc/credit-calc.php:145
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): Credit_Calc_Plugin->change_option()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #5 {main}
    thrown

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 fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/credit-calc/inc/helpers.php
    • > /wp-content/plugins/credit-calc/inc/functions.php
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/credit-calc/template/main_admin_option.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/credit-calc/template/calc.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/credit-calc/credit-calc.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% 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
2 plugin tags: calculator, credit

credit-calc/credit-calc.php 85% from 13 tests

Analyzing the main PHP file in "credit_calc Plugin" version 1.1.0
It is important to fix the following:
  • Text Domain: The text domain should only use lowercase characters and dashes
  • Domain Path: The domain path folder was not found ("/language")

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 plugin16,345 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript41,7981,9628,622
CSS41,3633687,355
PHP56414368

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.07
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity1.47
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods1386.67%
▷ Protected methods00.00%
▷ Private methods213.33%
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

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected