68% mappress-google-maps-for-wordpress

Code Review | MapPress Maps for WordPress

WordPress plugin MapPress Maps for WordPress scored68%from 54 tests.

About plugin

  • Plugin page: mappress-google-m...
  • Plugin version: 2.88.13
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9.5-6.4
  • WordPress version: 6.3.1
  • First release: Apr 1, 2009
  • Latest release: Nov 25, 2023
  • Number of updates: 593
  • Update frequency: every 9.0 days
  • Top authors: chrisvrichardson (100%)

Code review

54 tests

User reviews

141 reviews

Install metrics

50,000+ active /4,117,154 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.75MB] [CPU: ▲1.77ms] Passed 4 tests

An overview of server-side resources used by MapPress Maps for WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.23 ▲0.7643.64 ▲4.25
Dashboard /wp-admin4.06 ▲0.7253.31 ▼7.23
Posts /wp-admin/edit.php4.14 ▲0.7857.69 ▲12.63
Add New Post /wp-admin/post-new.php6.66 ▲0.7888.51 ▲4.67
Media Library /wp-admin/upload.php3.98 ▲0.7641.02 ▲5.38
Support /wp-admin/admin.php?page=mappress_support3.9139.20
Maps /wp-admin/admin.php?page=mappress_maps4.0343.77
Settings /wp-admin/admin.php?page=mappress3.9947.43

Server storage [IO: ▲1.24MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 61 new files
Database: 1 new table, 9 new options
New tables
wp_mapp_maps
New WordPress options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
mappress_review
db_upgraded
widget_recent-posts
theysaidso_admin_options
mappress_db_version
mappress_version

Browser metrics Passed 4 tests

A check of browser resources used by MapPress Maps for WordPress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,000 ▲25313.86 ▼0.491.55 ▼0.1644.71 ▼0.30
Dashboard /wp-admin2,399 ▲2195.60 ▼0.1092.29 ▲2.4243.50 ▲0.64
Posts /wp-admin/edit.php2,422 ▲32210.52 ▲8.57235.64 ▲195.0536.94 ▲5.24
Add New Post /wp-admin/post-new.php1,582 ▲5624.08 ▲0.38702.86 ▲60.3439.34 ▼13.16
Media Library /wp-admin/upload.php1,719 ▲3164.18 ▼0.0197.10 ▼3.8041.63 ▲0.10
Support /wp-admin/admin.php?page=mappress_support1,18510.0399.8937.33
Maps /wp-admin/admin.php?page=mappress_maps1,81515.22209.6433.92
Settings /wp-admin/admin.php?page=mappress2,87610.00165.9953.45

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_mapp_maps
  • Zombie WordPress options were found after uninstall: 9 options
    • can_compress_scripts
    • mappress_version
    • db_upgraded
    • widget_theysaidso_widget
    • mappress_review
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • mappress_db_version

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 6× PHP files output text when accessed directly:
    • > /wp-content/plugins/mappress-google-maps-for-wordpress/templates/mashup-item.php
    • > /wp-content/plugins/mappress-google-maps-for-wordpress/templates/mashup-popup.php
    • > /wp-content/plugins/mappress-google-maps-for-wordpress/templates/map-item.php
    • > /wp-content/plugins/mappress-google-maps-for-wordpress/templates/map-popup.php
    • > /wp-content/plugins/mappress-google-maps-for-wordpress/templates/user-mashup-popup.php
    • > /wp-content/plugins/mappress-google-maps-for-wordpress/templates/user-mashup-item.php
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/mappress-google-maps-for-wordpress/mappress_api.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Mappress_Obj' not found in wp-content/plugins/mappress-google-maps-for-wordpress/mappress_template.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Mappress_Obj' not found in wp-content/plugins/mappress-google-maps-for-wordpress/mappress_settings.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mappress_Obj' not found in wp-content/plugins/mappress-google-maps-for-wordpress/mappress_poi.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_post_thumbnail() in wp-content/plugins/mappress-google-maps-for-wordpress/templates/mashup-modal.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/mappress-google-maps-for-wordpress/mappress_api.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Mappress_Obj' not found in wp-content/plugins/mappress-google-maps-for-wordpress/mappress_map.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/mappress-google-maps-for-wordpress/languages/texts.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention: You can look at the official readme.txt

mappress-google-maps-for-wordpress/mappress.php 92% from 13 tests

The primary PHP file in "MapPress Maps for WordPress" version 2.88.13 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("mappress-google-maps-for-wordpress.php" instead of "mappress.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin7,315 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
CSS58694624,032
PHP175503523,276
JavaScript5065
SVG2002

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity52.82
▷ Minimum class complexity3.00
▷ Maximum class complexity246.00
Average method complexity4.65
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods147
▷ Static methods11276.19%
▷ Public methods147100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions00.00%
▷ Anonymous functions16100.00%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
22 PNG files occupy 0.24MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/roadmap.png31.18KB11.59KB▼ 62.82%
images/search.png0.26KB0.21KB▼ 20.30%
lib/leaflet/images/layers.png0.68KB1.05KB0.00%
images/outline_format_list_bulleted_black_18dp.png0.14KB0.18KB0.00%
images/get-directions.png0.29KB0.32KB0.00%