62% whmcs-bridge

Code Review | WHMCS Bridge

WordPress plugin WHMCS Bridge scored62%from 54 tests.

About plugin

  • Plugin page: whmcs-bridge
  • Plugin version: 6.9
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0.2
  • WordPress version: 6.3.1
  • First release: Dec 10, 2010
  • Latest release: Oct 17, 2022
  • Number of updates: 459
  • Update frequency: every 9.6 days
  • Top authors: globalprogramming (64.27%)erikpbogaerts (35.51%)

Code review

54 tests

User reviews

73 reviews

Install metrics

9,000+ active /508,685 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.83MB] [CPU: ▲5.23ms] Passed 4 tests

A check of server-side resources used by WHMCS Bridge
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.33 ▲0.8750.01 ▲13.84
Dashboard /wp-admin4.15 ▲0.8555.31 ▲3.82
Posts /wp-admin/edit.php4.20 ▲0.8551.19 ▲1.52
Add New Post /wp-admin/post-new.php6.67 ▲0.78103.60 ▲5.27
Media Library /wp-admin/upload.php4.07 ▲0.8545.98 ▲10.30
WHMCS Bridge /wp-admin/options-general.php?page=cc-ce-bridge-cp4.0342.64

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 68 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
whmcs-bridge-support-us
widget_recent-comments

Browser metrics Passed 4 tests

WHMCS Bridge: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9413.12 ▼1.265.24 ▲3.7042.29 ▲4.22
Dashboard /wp-admin2,210 ▲195.88 ▲0.85107.85 ▼0.6042.80 ▼1.12
Posts /wp-admin/edit.php2,093 ▲42.02 ▼0.0434.27 ▼6.8135.94 ▲0.65
Add New Post /wp-admin/post-new.php1,549 ▲3518.60 ▲0.79597.16 ▼106.6365.59 ▲14.11
Media Library /wp-admin/upload.php1,395 ▲44.23 ▼0.03102.85 ▲2.8444.45 ▲1.72
WHMCS Bridge /wp-admin/options-general.php?page=cc-ce-bridge-cp1,4868.5393.09107.38

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/whmcs-bridge/bridge.init.php+433
    Undefined index: id
  • Zombie WordPress options detected upon uninstall: 7 options
    • whmcs-bridge-support-us
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/whmcs-bridge/includes/cpedit.inc.php
    • > /wp-content/plugins/whmcs-bridge/pages/log.php
    • > /wp-content/plugins/whmcs-bridge/pages/sync.php
  • 36× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\Value\\Value' not found in wp-content/plugins/whmcs-bridge/libs/Sabberworm/CSS/Value/ValueList.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Sabberworm\\CSS\\Renderable' not found in wp-content/plugins/whmcs-bridge/libs/Sabberworm/CSS/Comment/Comment.php:7
    • > PHP Notice
      Undefined variable: controlpanelOptions in wp-content/plugins/whmcs-bridge/includes/cpedit.inc.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/whmcs-bridge/bridge_cp.php:212
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\CSSList\\CSSList' not found in wp-content/plugins/whmcs-bridge/libs/Sabberworm/CSS/CSSList/CSSBlockList.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\Value\\PrimitiveValue' not found in wp-content/plugins/whmcs-bridge/libs/Sabberworm/CSS/Value/Size.php:7
    • > PHP Notice
      Undefined variable: cc_whmcs_bridge_version in wp-content/plugins/whmcs-bridge/pages/log.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\Value\\PrimitiveValue' not found in wp-content/plugins/whmcs-bridge/libs/Sabberworm/CSS/Value/URL.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cc_whmcs_bridge_home() in wp-content/plugins/whmcs-bridge/pages/help.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Sabberworm\\CSS\\Property\\AtRule' not found in wp-content/plugins/whmcs-bridge/libs/Sabberworm/CSS/Property/Charset.php:12

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=cc-ce-bridge-cp
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).tabs is not a function" "TypeError: jQuery(...).tabs is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/options-general.php?page=cc-ce-bridge-cp:142:39)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=cc-ce-bridge-cp
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).tabs is not a function

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: billing, whmcs, integration, hosting, support

whmcs-bridge/bridge.php 92% from 13 tests

The main PHP script in "WHMCS Bridge" version 6.9 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("whmcs-bridge.php" instead of "bridge.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected7,146 lines of code in 58 files:
LanguageFilesBlank linesComment linesLines of code
PHP541,2908686,600
CSS443163546

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
It is recommended to fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 146)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity17.74
▷ Minimum class complexity1.00
▷ Maximum class complexity185.00
Average method complexity3.04
▷ Minimum method complexity1.00
▷ Maximum method complexity146.00
Code structure
Namespaces8
Interfaces3
Traits0
Classes47
▷ Abstract classes612.77%
▷ Concrete classes4187.23%
▷ Final classes00.00%
Methods416
▷ Static methods256.01%
▷ Public methods37690.38%
▷ Protected methods194.57%
▷ Private methods215.05%
Functions54
▷ Named functions4583.33%
▷ Anonymous functions916.67%
Constants36
▷ Global constants2775.00%
▷ Class constants925.00%
▷ Public constants9100.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.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/buy_now.png12.39KB4.38KB▼ 64.61%
images/logo.png7.41KB3.31KB▼ 55.38%
images/5-stars-125pxw.png5.87KB2.45KB▼ 58.25%