93% contact-form-7-lead-info-with-country

Code Review | Lead info with country for Contact Form 7

WordPress plugin Lead info with country for Contact Form 7 scored 93% from 54 tests.

About plugin

  • Plugin page: contact-form-7-le...
  • Plugin version: 2.4.1
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.6
  • WordPress version: 5.8.1
  • First release: Dec 13, 2014
  • Latest release: Jan 8, 2021
  • Number of updates: 86
  • Update frequency: every 25.8 days
  • Top authors: apasionados (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

5,000+ active / 48,191 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼152.89ms] Passed 4 tests

Server-side resources used by Lead info with country for Contact Form 7
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.1535.77 ▲11.92
Dashboard /wp-admin3.09 ▲0.0453.34 ▲6.20
Posts /wp-admin/edit.php3.14 ▲0.0451.73 ▲7.58
Add New Post /wp-admin/post-new.php5.45 ▲0.0293.12 ▼626.48
Media Library /wp-admin/upload.php3.04 ▲0.0332.24 ▲1.16

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Lead info with country for Contact Form 7: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲9715.78 ▲0.298.70 ▼1.2150.96 ▲2.96
Dashboard /wp-admin2,967 ▲335.90 ▼0.10139.32 ▼16.16111.63 ▼5.65
Posts /wp-admin/edit.php2,739 ▼02.69 ▼0.0069.47 ▲5.4091.34 ▼7.46
Add New Post /wp-admin/post-new.php1,670 ▲8919.16 ▲1.48387.89 ▼4.86119.30 ▼0.21
Media Library /wp-admin/upload.php1,807 ▼05.02 ▼0.01156.97 ▲5.64124.29 ▲0.97

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/contact-form-7-lead-info-with-country/wpshore_cf7_lead_tracking.php on line 19
    • > PHP Warning
      require_once(ABSPATH/wp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/contact-form-7-lead-info-with-country/wpshore_cf7_lead_tracking.php on line 19
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATH/wp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/contact-form-7-lead-info-with-country/wpshore_cf7_lead_tracking.php on line 19

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed: The official readme.txt is a good inspiration

contact-form-7-lead-info-with-country/wpshore_cf7_lead_tracking.php 77% from 13 tests

This is the main PHP file of "Lead info with country for Contact Form 7" version 2.4.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 501 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: The principal plugin file should be the same as the plugin slug ("contact-form-7-lead-info-with-country.php" instead of "wpshore_cf7_lead_tracking.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected158 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP141897
PO File1121561

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
No PNG files were detected