62% map-contact

Code Review | Map Contact

WordPress plugin Map Contact scored62%from 54 tests.

About plugin

  • Plugin page: map-contact
  • Plugin version: 3.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.2.1
  • WordPress version: 6.3.1
  • First release: Aug 1, 2014
  • Latest release: Jun 16, 2019
  • Number of updates: 40
  • Update frequency: every 44.5 days
  • Top authors: ryan_xantoo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /6,123 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.07MB] [CPU: ▼5.68ms] Passed 4 tests

A check of server-side resources used by Map Contact
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0842.74 ▲1.49
Dashboard /wp-admin3.39 ▲0.0453.24 ▼9.97
Posts /wp-admin/edit.php3.51 ▲0.1549.55 ▼6.26
Add New Post /wp-admin/post-new.php5.98 ▲0.08100.89 ▼7.99
Media Library /wp-admin/upload.php3.32 ▲0.0837.78 ▲1.49
Add New Contact /wp-admin/admin.php?page=add_new_address3.2938.13
Map Settings /wp-admin/admin.php?page=map_settings3.3134.09
Address Book /wp-admin/admin.php?page=map_addressess3.3333.35

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: 2 new tables, 6 new options
New tables
wp_map_settings
wp_map_addresses
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Map Contact
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,847 ▲7614.60 ▲0.061.90 ▲0.2843.90 ▼1.01
Dashboard /wp-admin2,228 ▲515.63 ▼0.0589.30 ▼8.1045.93 ▲2.65
Posts /wp-admin/edit.php2,128 ▲251.98 ▲0.0137.33 ▼2.7137.70 ▲2.09
Add New Post /wp-admin/post-new.php1,553 ▲1623.19 ▲4.93620.76 ▼15.8452.48 ▼12.31
Media Library /wp-admin/upload.php1,434 ▲374.20 ▲0.0296.05 ▼10.3445.32 ▼1.77
Add New Contact /wp-admin/admin.php?page=add_new_address8852.1324.0026.39
Map Settings /wp-admin/admin.php?page=map_settings1,1342.0526.9832.80
Address Book /wp-admin/admin.php?page=map_addressess1,0512.1828.7433.56

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_map_addresses
    • wp_map_settings
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=map_addressess
    • > Notice in wp-content/plugins/map-contact/admin/map_addresses.php+51
    Undefined index: submit
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=map_addressess
    • > Notice in wp-content/plugins/map-contact/admin/map_addresses.php+129
    Undefined variable: URL
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=map_settings
    • > Notice in wp-content/plugins/map-contact/admin/map_settings.php+85
    unserialize(): Error at offset 0 of 1 bytes
    • > GET request to /wp-admin/admin.php?page=map_settings
    • > Notice in wp-content/plugins/map-contact/admin/map_settings.php+85
    unserialize(): Error at offset 0 of 2 bytes
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=map_settings
    • > Notice in wp-content/plugins/map-contact/admin/map_settings.php+85
    unserialize(): Error at offset 0 of 4 bytes
    • > GET request to /wp-admin/admin.php?page=map_settings
    • > Notice in wp-content/plugins/map-contact/admin/map_settings.php+85
    unserialize(): Error at offset 0 of 29 bytes

SRP 50% 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 take a closer look at the following
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > 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/admin/map_addresses.php on line 2
    • > 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/admin/map_settings.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/map-contact/admin/add_new_address.php:8
    • > 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/admin/map_settings.php on line 2
    • > 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/admin/map_addresses.php on line 2
    • > 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/admin/map_addresses.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/map-contact/map-contact.php:11
    • > 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/admin/map_settings.php on line 2

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/admin.php?page=map_addressess
    • > Network (severe)
    http://a1.res.cloudinary.com/hvqqwrowv/image/asset/css3-65bdc13faee51df7f05b91f44414a80d.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
You can take inspiration from this readme.txt

map-contact/map-contact.php Passed 13 tests

The principal PHP file in "Map Contact" v. 3.0.4 is loaded by WordPress automatically on each request
91 characters long description:
Instantly create stylish and professional Contact Us Page with Map for any WordPress Theme!

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected726 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP51218659
CSS10044
JavaScript171323

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity15.00
▷ Minimum class complexity4.00
▷ Maximum class complexity37.00
Average method complexity3.80
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/close.png1.24KB0.29KB▼ 76.49%