77% wp-mapit

Code Review | WP MapIt

WordPress plugin WP MapIt scored77%from 54 tests.

About plugin

  • Plugin page: wp-mapit
  • Plugin version: 2.7.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-6.2
  • WordPress version: 6.3.1
  • First release: Mar 28, 2019
  • Latest release: Mar 22, 2023
  • Number of updates: 42
  • Update frequency: every 34.7 days
  • Top authors: phpwebdev (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

2,000+ active /13,086 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.11MB] [CPU: ▼0.05ms] Passed 4 tests

This is a short check of server-side resources used by WP MapIt
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1435.44 ▼2.07
Dashboard /wp-admin3.46 ▲0.1651.03 ▲5.27
Posts /wp-admin/edit.php3.51 ▲0.1553.42 ▲11.11
Add New Post /wp-admin/post-new.php5.97 ▲0.0987.81 ▼6.27
Media Library /wp-admin/upload.php3.29 ▲0.0735.92 ▲2.88
Settings /wp-admin/admin.php?page=wp_mapit3.2937.68
Multipin Map /wp-admin/edit.php?post_type=wp_mapit_map3.4339.51

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 47 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_wp_mapit_contextual_map_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

WP MapIt: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,085 ▲32416.18 ▲1.838.90 ▲7.2938.31 ▼6.10
Dashboard /wp-admin2,385 ▲2087.09 ▲1.50122.87 ▲34.0841.76 ▲1.96
Posts /wp-admin/edit.php2,313 ▲2103.93 ▲1.9358.46 ▲24.1134.77 ▲0.73
Add New Post /wp-admin/post-new.php6,243 ▲4,71719.44 ▼4.10936.66 ▲290.5041.04 ▼14.33
Media Library /wp-admin/upload.php1,453 ▲565.16 ▲0.9799.56 ▼3.2045.97 ▲3.36
Settings /wp-admin/admin.php?page=wp_mapit1,3733.9752.1987.21
Multipin Map /wp-admin/edit.php?post_type=wp_mapit_map1,2853.8148.7229.20

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • widget_wp_mapit_contextual_map_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-mapit/wp_mapit.php
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-mapit/wp_mapit/classes/class.wp_mapit_the_content.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-mapit/wp_mapit/classes/class.wp_mapit_admin_settings.php:60
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-mapit/wp_mapit/classes/class.wp_mapit_widget.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-mapit/wp_mapit/classes/class.wp_mapit_gutenberg_block.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-mapit/wp_mapit/classes/class.wp_mapit_post_type.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-mapit/wp_mapit/classes/class.wp_mapit_contextual_map_widget.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-mapit/wp_mapit/classes/class.wp_mapit_scripts.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-mapit/wp_mapit/classes/class.wp_mapit_admin_ajax.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-mapit/wp_mapit/classes/class.wp_mapit_shortcode.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'wp_mapit_admin_settings' not found in wp-content/plugins/wp-mapit/wp_mapit/classes/class.wp_mapit_metabox.php: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)
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please describe screenshot #12 in wp-mapit/assets to your readme.txt
  • Tags: Please reduce the number of tags, currently 19 tag instead of maximum 10
Please take inspiration from this readme.txt

wp-mapit/wp_mapit.php 85% from 13 tests

The main PHP script in "WP MapIt" version 2.7.1 is automatically included on every request by WordPress
You should first fix the following items:
  • Domain Path: Use only dashes and lowercase characters for the domain path ("wp_mapit/languages")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-mapit.php" instead of "wp_mapit.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
Everything looks great! No dangerous files found in this plugin4,046 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript104291461,724
PHP172407991,285
CSS7168561,037

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity13.60
▷ Minimum class complexity1.00
▷ Maximum class complexity98.00
Average method complexity3.40
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods79
▷ Static methods6886.08%
▷ Public methods7696.20%
▷ Protected methods00.00%
▷ Private methods33.80%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants3
▷ Global constants3100.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
10 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
wp_mapit/images/marker-icon-2x.png2.41KB2.52KB0.00%
wp_mapit/images/marker-icon.png1.43KB1.55KB0.00%
wp_mapit/images/map-pin.png1.41KB0.95KB▼ 32.60%
wp_mapit/images/search.png0.77KB0.84KB0.00%
wp_mapit/images/remove-pin.png3.16KB0.69KB▼ 78.17%