10% whmcs-price

Code Review | WHMCS Price

WordPress plugin WHMCS Price scored10%from 54 tests.

About plugin

  • Plugin page: whmcs-price
  • Plugin version: 1.3
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.9.8
  • WordPress version: 6.3.1
  • First release: Aug 11, 2018
  • Latest release: Aug 23, 2018
  • Number of updates: 12
  • Update frequency: every 1.0 days
  • Top authors: kamalireal (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /3,051 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
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/whmcs-price/includes/short_code/short_code.php+15
    Trying to access array offset on value of type bool

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

Server-side resources used by WHMCS Price
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.404.61 ▼36.71
Dashboard /wp-admin2.09 ▼1.227.26 ▼46.16
Posts /wp-admin/edit.php2.09 ▼1.277.26 ▼42.85
Add New Post /wp-admin/post-new.php2.09 ▼3.807.91 ▼93.29
Media Library /wp-admin/upload.php2.09 ▼1.148.35 ▼24.79
WHMCS Price Options /wp-admin/options-general.php?page=whmcs_price2.097.21

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for WHMCS Price
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.24 ▼1.351.71 ▼0.1345.04 ▼2.81
Dashboard /wp-admin2,210 ▲224.84 ▼0.05110.77 ▼5.4241.16 ▼6.65
Posts /wp-admin/edit.php2,093 ▲42.04 ▲0.0341.52 ▲0.6435.99 ▲1.64
Add New Post /wp-admin/post-new.php1,545 ▲818.27 ▼4.87585.34 ▼11.2961.54 ▲3.81
Media Library /wp-admin/upload.php1,392 ▲14.26 ▲0.0996.12 ▼4.6041.64 ▼1.21
WHMCS Price Options /wp-admin/options-general.php?page=whmcs_price9152.0322.0934.48

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/whmcs-price/includes/short_code/short_code.php+15
    Trying to access array offset on value of type bool
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% 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/options-general.php?page=whmcs_price
    • > Notice in wp-content/plugins/whmcs-price/includes/settings.php+133
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/whmcs-price/whmcs_price.php
    • > /wp-content/plugins/whmcs-price/includes/short_code/short_code.php
    • > /wp-content/plugins/whmcs-price/includes/settings.php

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 94% from 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
These attributes need your attention:
  • Tags: There are too many tags (11 tag instead of maximum 10)
You can take inspiration from this readme.txt

whmcs-price/whmcs_price.php 92% from 13 tests

The primary PHP file in "WHMCS Price" version 1.3 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("whmcs-price.php" instead of "whmcs_price.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected199 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP32372199

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity1.56
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
4 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-4.png12.13KB6.50KB▼ 46.40%
assets/screenshot-3.png24.48KB13.29KB▼ 45.69%
assets/screenshot-1.png6.68KB4.69KB▼ 29.79%
assets/screenshot-2.png19.31KB10.53KB▼ 45.46%