78% leadbi

Code Review | LeadBI Plugin for WordPress

WordPress plugin LeadBI Plugin for WordPress scored 78% from 54 tests.

About plugin

  • Plugin page: leadbi
  • Plugin version: 1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-5.9
  • WordPress version: 6.3.1
  • First release: Sep 27, 2017
  • Latest release: Apr 8, 2022
  • Number of updates: 14
  • Update frequency: every 118.4 days
  • Top authors: leadbi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 1,143 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.58ms] Passed 4 tests

Server-side resources used by LeadBI Plugin for WordPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0341.48 ▼3.77
Dashboard /wp-admin3.33 ▲0.0243.66 ▼5.50
Posts /wp-admin/edit.php3.38 ▲0.0247.59 ▼2.69
Add New Post /wp-admin/post-new.php5.93 ▲0.0484.71 ▼10.36
Media Library /wp-admin/upload.php3.25 ▲0.0234.11 ▲1.90

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 23 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments
leadbi_settings

Browser metrics Passed 4 tests

LeadBI Plugin for WordPress: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲7413.32 ▼1.061.86 ▼0.3542.98 ▲0.38
Dashboard /wp-admin2,229 ▲384.91 ▲0.01108.83 ▲3.1082.33 ▲29.86
Posts /wp-admin/edit.php2,112 ▲202.03 ▲0.0437.93 ▲0.5234.59 ▲0.59
Add New Post /wp-admin/post-new.php1,532 ▲1017.63 ▼5.55765.03 ▲81.1965.78 ▼4.34
Media Library /wp-admin/upload.php1,408 ▲204.28 ▲0.1195.57 ▼11.9677.22 ▲30.13

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • can_compress_scripts
    • leadbi_settings
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/leadbi/frontend/partials/tag.php
    • > /wp-content/plugins/leadbi/admin/partials/connect.php
  • 9× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined variable: nonce in wp-content/plugins/leadbi/admin/partials/connect.php on line 13
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/leadbi/admin/partials/view.php:8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/leadbi/admin/partials/view.php on line 5
    • > PHP Notice
      Undefined variable: endpoint in wp-content/plugins/leadbi/admin/partials/connect.php on line 12
    • > PHP Notice
      Undefined variable: websiteId in wp-content/plugins/leadbi/frontend/partials/tag.php on line 2
    • > PHP Notice
      Undefined variable: settings in wp-content/plugins/leadbi/admin/partials/view.php on line 5
    • > PHP Notice
      Undefined variable: domain in wp-content/plugins/leadbi/admin/partials/connect.php on line 12
    • > PHP Notice
      Undefined variable: websiteDomain in wp-content/plugins/leadbi/frontend/partials/tag.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Integration' not found in wp-content/plugins/leadbi/frontend/WooCommerce.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: tracking code, analytics, marketing analytics, leadbi, marketing automation...

leadbi/leadbi.php 92% from 13 tests

The primary PHP file in "LeadBI Plugin for WordPress" version 1.7 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 181 characters long)

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
Good job! No executable or dangerous file extensions detected721 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP14166212589
JavaScript31315112
CSS25620

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity6.50
▷ Minimum class complexity2.00
▷ Maximum class complexity21.00
Average method complexity2.19
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods37
▷ Static methods38.11%
▷ Public methods3183.78%
▷ Protected methods00.00%
▷ Private methods616.22%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.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.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/img/favicon-16x16.png1.10KB0.54KB▼ 50.66%