72% map-contact-form-7

Code Review | Maps for Contact Form 7

WordPress plugin Maps for Contact Form 7 scored 72% from 54 tests.

About plugin

  • Plugin page: map-contact-form-7
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7.2-5.7.2
  • WordPress version: 6.3.1
  • First release: Jun 5, 2021
  • Latest release: Jun 5, 2021
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: tanakayasuo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 309 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.27MB] [CPU: ▼3.23ms] Passed 4 tests

An overview of server-side resources used by Maps for Contact Form 7
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2128.27 ▼11.98
Dashboard /wp-admin3.64 ▲0.3451.81 ▼2.25
Posts /wp-admin/edit.php3.69 ▲0.3346.16 ▲0.59
Add New Post /wp-admin/post-new.php6.16 ▲0.2796.84 ▲0.74
Media Library /wp-admin/upload.php3.50 ▲0.2735.19 ▲1.35
Maps for Contact Form 7 /wp-admin/options-general.php?page=maps-for-cf7-settings3.4438.77

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 30 new files
Database: no new tables, 7 new options
New WordPress options
recovery_mode_email_last_sent
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Maps for Contact Form 7: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,487 ▼24814.84 ▲0.620.49 ▼1.3418.47 ▼27.06
Dashboard /wp-admin2,228 ▲374.89 ▼0.99105.97 ▼1.7543.32 ▼2.64
Posts /wp-admin/edit.php2,111 ▲222.01 ▼0.0033.88 ▼3.6733.15 ▼0.40
Add New Post /wp-admin/post-new.php1,550 ▲1623.37 ▲0.38662.90 ▼108.8767.67 ▲7.32
Media Library /wp-admin/upload.php1,413 ▲254.22 ▼0.0595.45 ▼15.0542.65 ▼2.80
Maps for Contact Form 7 /wp-admin/options-general.php?page=maps-for-cf7-settings7801.578.1018.42

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • recovery_mode_email_last_sent
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=maps-for-cf7-settings
    • > Notice in wp-content/plugins/map-contact-form-7/includes/options.php+93
    Undefined index: API_KEY
    • > GET request to /wp-admin/options-general.php?page=maps-for-cf7-settings
    • > Error in wp-content/plugins/map-contact-form-7/includes/options.php+151
    Uncaught Error: Class 'WPCF7_ContactForm' not found in wp-content/plugins/map-contact-form-7/includes/options.php:151
    Stack trace:
    #0 wp-admin/includes/template.php(1824): MAPS_FOR_CF7_Options->output_form_ids_field()
    #1 wp-admin/includes/template.php(1778): do_settings_fields()
    #2 wp-content/plugins/map-contact-form-7/includes/options.php(212): do_settings_sections()
    #3 wp-includes/class-wp-hook.php(310): MAPS_FOR_CF7_Options->output()
    #4 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #5 wp-includes/plugin.php(517): WP_Hook->do_action()
    #6 wp-admin/admin.php(259): do_action()
    #7 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #8 {main}
    thrown

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/map-contact-form-7/includes/add-option.php
  • 15× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'MAPS_FOR_CF7_PLUGIN_DIR/includes/capabilities.php' (include_path='.:/usr/share/php') in wp-content/plugins/map-contact-form-7/load.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/map-contact-form-7/admin/includes/form_list_table.php on line 4
    • > PHP Warning
      Use of undefined constant MAPS_FOR_CF7_PLUGIN_DIR - assumed 'MAPS_FOR_CF7_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/map-contact-form-7/load.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'MAPS_FOR_CF7_PLUGIN_DIR/admin/includes/form_list_table.php' (include_path='.:/usr/share/php') in wp-content/plugins/map-contact-form-7/admin/admin.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/map-contact-form-7/admin/includes/post_list_table.php on line 4
    • > PHP Warning
      Use of undefined constant MAPS_FOR_CF7_PLUGIN_DIR - assumed 'MAPS_FOR_CF7_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/map-contact-form-7/admin/admin.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/map-contact-form-7/admin/includes/form_list_table.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/map-contact-form-7/admin/includes/form_list_table.php on line 4
    • > PHP Warning
      require_once(MAPS_FOR_CF7_PLUGIN_DIR/admin/includes/form_list_table.php): failed to open stream: No such file or directory in wp-content/plugins/map-contact-form-7/admin/admin.php on line 3
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/map-contact-form-7/admin/includes/post_list_table.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Donate link: Please fix this invalid URI: ""
Please take inspiration from this readme.txt

map-contact-form-7/maps-for-contact-form-7.php 85% from 13 tests

The primary PHP file in "Maps for Contact Form 7" version 1.0.2 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("map-contact-form-7.php" instead of "maps-for-contact-form-7.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Good job! No executable or dangerous file extensions detected2,375 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP202492801,976
JavaScript12711271
Sass14083
CSS121639
Ruby16136

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity10.82
▷ Minimum class complexity3.00
▷ Maximum class complexity28.00
Average method complexity2.26
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods82
▷ Static methods3441.46%
▷ Public methods5769.51%
▷ Protected methods11.22%
▷ Private methods2429.27%
Functions24
▷ Named functions1041.67%
▷ Anonymous functions1458.33%
Constants32
▷ Global constants928.12%
▷ Class constants2371.88%
▷ Public constants23100.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