78% lead-captor

Code Review | Lead Captor

WordPress plugin Lead Captor scored78%from 54 tests.

About plugin

  • Plugin page: lead-captor
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.8
  • WordPress version: 6.3.1
  • First release: Apr 10, 2017
  • Latest release: Sep 15, 2017
  • Number of updates: 11
  • Update frequency: every 14.4 days
  • Top authors: nicoandrade (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,524 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▲2.36ms] Passed 4 tests

A check of server-side resources used by Lead Captor
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1241.63 ▲0.84
Dashboard /wp-admin3.38 ▲0.0845.97 ▼1.80
Posts /wp-admin/edit.php3.44 ▲0.0849.57 ▲5.28
Add New Post /wp-admin/post-new.php5.96 ▲0.0893.18 ▲9.43
Media Library /wp-admin/upload.php3.31 ▲0.0836.72 ▲5.12
Add New /wp-admin/post-new.php?post_type=lead-subscriber3.3442.08
All Subscribers /wp-admin/edit.php?post_type=lead-subscriber3.3839.08
Lead Captor /wp-admin/tools.php?page=lead-captor-admin3.3537.90

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 83 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Lead Captor
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,023 ▲27713.99 ▼0.668.10 ▲6.2086.58 ▲42.43
Dashboard /wp-admin2,234 ▲525.82 ▼0.02105.46 ▼22.6841.67 ▼2.07
Posts /wp-admin/edit.php2,117 ▲282.00 ▼0.0239.68 ▲1.6634.15 ▼0.10
Add New Post /wp-admin/post-new.php1,567 ▲4822.92 ▼0.33609.94 ▼34.6259.87 ▲1.15
Media Library /wp-admin/upload.php1,419 ▲314.18 ▼0.0597.84 ▼0.8743.55 ▼1.80
Add New /wp-admin/post-new.php?post_type=lead-subscriber1,5322.5249.1371.81
All Subscribers /wp-admin/edit.php?post_type=lead-subscriber1,2633.6258.0127.21
Lead Captor /wp-admin/tools.php?page=lead-captor-admin1,8886.76151.96133.04

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% 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
The following issues need your attention
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _x() in wp-content/plugins/lead-captor/lead-captor/admin/partials/custom-post-types.php:4
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_templates() on null in wp-content/plugins/lead-captor/public/partials/lead-captor-public-display.php:18
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_templates() on null in wp-content/plugins/lead-captor/lead-captor/public/partials/lead-captor-public-display.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/lead-captor/admin/partials/lead-captor-admin-display.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/lead-captor/lead-captor/admin/partials/lead-captor-admin-display.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _x() in wp-content/plugins/lead-captor/admin/partials/custom-post-types.php:4

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/tools.php?page=lead-captor-admin
    • > Network (severe)
    wp-content/plugins/lead-captor/admin/images/quema-labs.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3, #4 in lead-captor/assets to your readme.txt
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === lead-captor === )
The official readme.txt is a good inspiration

lead-captor/lead-captor.php Passed 13 tests

"Lead Captor" version 1.1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
75 characters long description:
Attractive popup forms on exit intent to convert visitors into subscribers.

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
No dangerous file extensions were detected3,715 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP217481,3271,804
CSS32275886
LESS512978846
JavaScript48421161
SVG10018

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity11.27
▷ Minimum class complexity1.00
▷ Maximum class complexity60.00
Average method complexity2.18
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods130
▷ Static methods43.08%
▷ Public methods11185.38%
▷ Protected methods00.00%
▷ Private methods1914.62%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 PNG files occupy 0.90MB with 0.68MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/popup3.png129.00KB45.25KB▼ 64.93%
admin/images/popup1.png123.94KB35.50KB▼ 71.36%
admin/images/popup4.png137.96KB19.34KB▼ 85.98%
lead-captor/admin/images/popup1.png123.94KB35.50KB▼ 71.36%
lead-captor/admin/images/popup4.png137.96KB19.34KB▼ 85.98%