88% leadsquared-suite

Code Review | LeadSquared Suite

WordPress plugin LeadSquared Suite scored 88% from 54 tests.

About plugin

  • Plugin page: leadsquared-suite
  • Plugin version: 0.7.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8
  • WordPress version: 5.8.1
  • First release: Oct 9, 2015
  • Latest release: Sep 6, 2021
  • Number of updates: 55
  • Update frequency: every 39.3 days
  • Top authors: RizwanAliSyed (100%)

Code review

54 tests

User reviews

1 review

Install metrics

900+ active / 6,391 total downloads

Benchmarks

Plugin footprint Passed 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.19MB] [CPU: ▼139.31ms] Passed 4 tests

This is a short check of server-side resources used by LeadSquared Suite
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.01 ▲0.2938.09 ▲14.25
Dashboard /wp-admin3.24 ▲0.1846.42 ▲3.40
Posts /wp-admin/edit.php3.35 ▲0.2446.83 ▲1.96
Add New Post /wp-admin/post-new.php5.60 ▲0.1788.83 ▼564.65
Media Library /wp-admin/upload.php3.18 ▲0.1834.73 ▲2.07
Leadsquared Forms /wp-admin/edit.php?post_type=leadsquared_form3.2235.61
Leadsquared CF7 Logs /wp-admin/edit.php?post_type=leadsquared_cf7_logs3.2234.80

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 41 new files
Database: no new tables, 2 new options
New WordPress options
_leadsquared_rest_api
leadsquared_modules

Browser metrics Passed 4 tests

This is an overview of browser requirements for LeadSquared Suite
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,734 ▲13816.34 ▲0.7210.32 ▲0.6846.02 ▼3.74
Dashboard /wp-admin2,988 ▲605.89 ▼0.12142.46 ▼4.56120.56 ▲5.70
Posts /wp-admin/edit.php2,744 ▲82.62 ▼0.0960.03 ▼5.0690.74 ▲0.63
Add New Post /wp-admin/post-new.php1,690 ▲19218.84 ▼0.14377.73 ▲8.29108.00 ▲2.00
Media Library /wp-admin/upload.php1,773 ▼404.99 ▼0.05122.78 ▼20.69145.51 ▲22.08
Leadsquared Forms /wp-admin/edit.php?post_type=leadsquared_form1,4592.5557.6271.28
Leadsquared CF7 Logs /wp-admin/edit.php?post_type=leadsquared_cf7_logs1,4642.6558.6076.69

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/leadsquared-suite/inc/lsq-script.php
    • > /wp-content/plugins/leadsquared-suite/leadsquared.php
  • 19× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/leadsquared-suite/inc/metabox-display.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function getMetadata() in wp-content/plugins/leadsquared-suite/inc/modules/tel.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function getMetadata() in wp-content/plugins/leadsquared-suite/inc/modules/legacy.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/leadsquared-suite/inc/lsqadmin.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function getMetadata() in wp-content/plugins/leadsquared-suite/inc/modules/url.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function getMetadata() in wp-content/plugins/leadsquared-suite/inc/modules/email.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/leadsquared-suite/inc/metabox-tracking.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/leadsquared-suite/inc/settingsapi.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function getMetadata() in wp-content/plugins/leadsquared-suite/inc/modules/text.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/leadsquared-suite/inc/comment-form-configuration.php:49

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
3 plugin tags: leadsquared, contact form, leadsquared form

leadsquared-suite/leadsquared.php 92% from 13 tests

The principal PHP file in "LeadSquared Suite" v. 0.7.4 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("leadsquared-suite.php" instead of "leadsquared.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin2,835 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP234121452,639
JavaScript31316176
CSS10020

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity104.00
▷ Minimum class complexity104.00
▷ Maximum class complexity104.00
Average method complexity3.58
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods40
▷ Static methods00.00%
▷ Public methods40100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants15
▷ Global constants15100.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
9 PNG files occupy 0.24MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icon-25.png1.76KB0.76KB▼ 56.84%
images/LS_Wp_icon.png2.55KB1.53KB▼ 40.23%
images/tracking.png23.25KB7.59KB▼ 67.34%
images/powered_by.png4.55KB2.32KB▼ 49.02%
images/cf7.png7.26KB2.54KB▼ 65.06%