72% location-module-for-contact-form-7

Code Review | Location Module (Lite) for Contact Form 7

WordPress plugin Location Module (Lite) for Contact Form 7 scored72%from 54 tests.

About plugin

  • Plugin page: location-module-f...
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.8.2
  • WordPress version: 6.3.1
  • First release: Apr 1, 2016
  • Latest release: Oct 20, 2017
  • Number of updates: 34
  • Update frequency: every 16.7 days
  • Top authors: nicola.bavaro (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

200+ active /5,587 total downloads

Benchmarks

Plugin footprint 83% 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.00MB] [CPU: ▼6.26ms] Passed 4 tests

This is a short check of server-side resources used by Location Module (Lite) for Contact Form 7
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0042.80 ▼1.07
Dashboard /wp-admin3.31 ▲0.0050.46 ▼2.94
Posts /wp-admin/edit.php3.36 ▲0.0050.94 ▼2.16
Add New Post /wp-admin/post-new.php5.89 ▲0.0095.62 ▼18.88
Media Library /wp-admin/upload.php3.23 ▲0.0038.41 ▲2.88
Location Module for CF7 /wp-admin/options-general.php?page=cf7-location-module-settings3.0127.14

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Location Module (Lite) for Contact Form 7
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲4814.30 ▼0.081.66 ▼0.1438.51 ▼2.20
Dashboard /wp-admin2,195 ▲185.64 ▲0.1189.96 ▼1.0739.02 ▼0.43
Posts /wp-admin/edit.php2,100 ▲32.00 ▼0.0439.74 ▼0.4233.94 ▼4.35
Add New Post /wp-admin/post-new.php1,545 ▲1122.98 ▼0.68608.54 ▼51.8449.36 ▼5.31
Media Library /wp-admin/upload.php1,394 ▼94.21 ▼0.0197.15 ▼7.6243.06 ▼1.04
Location Module for CF7 /wp-admin/options-general.php?page=cf7-location-module-settings280.440.113.63

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Please fix the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/location-module-for-contact-form-7/admin/cf7-location-module-tag-settings.php
    • > /wp-content/plugins/location-module-for-contact-form-7/cf7-location-module.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/location-module-for-contact-form-7/admin/cf7-location-module-settings-page.php:11

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=cf7-location-module-settings
    • > Network (severe)
    wp-admin/options-general.php?page=cf7-location-module-settings - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
9 plugin tags: module, geogode, location, form, contact form...

location-module-for-contact-form-7/cf7-location-module.php 92% from 13 tests

The main PHP script in "Location Module (Lite) for Contact Form 7" version 1.1.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("location-module-for-contact-form-7.php" instead of "cf7-location-module.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin2,556 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript44652471,962
PHP49797391
PO File14849145
CSS23058

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity22.00
▷ Minimum class complexity10.00
▷ Maximum class complexity34.00
Average method complexity2.56
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods27
▷ Static methods00.00%
▷ Public methods2488.89%
▷ Protected methods311.11%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected