62% the-wp-map-factory

Code Review | The WP Map Factory

WordPress plugin The WP Map Factory scored62%from 54 tests.

About plugin

  • Plugin page: the-wp-map-factory
  • Plugin version: 2.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Oct 29, 2019
  • Latest release: Feb 21, 2023
  • Number of updates: 12
  • Update frequency: every 101.7 days
  • Top authors: alastairgreen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /844 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼4.45ms] Passed 4 tests

Analyzing server-side resources used by The WP Map Factory
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0440.80 ▼0.05
Dashboard /wp-admin3.34 ▲0.0443.53 ▼4.87
Posts /wp-admin/edit.php3.39 ▲0.0445.79 ▲0.66
Add New Post /wp-admin/post-new.php5.93 ▲0.0586.05 ▼13.54
Media Library /wp-admin/upload.php3.27 ▲0.0435.04 ▲1.80
Settings /wp-admin/edit.php?post_type=themapfactorymaps&page=tmf_settings3.2431.22
All Maps /wp-admin/edit.php?post_type=themapfactorymaps3.3135.78
Add New /wp-admin/post-new.php?post_type=themapfactorymaps3.4368.98

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 1,436 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for The WP Map Factory
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,865 ▲13013.22 ▼1.077.83 ▲5.9140.73 ▼6.65
Dashboard /wp-admin2,237 ▲494.83 ▼1.06102.92 ▲1.8740.74 ▼6.15
Posts /wp-admin/edit.php2,120 ▲312.01 ▼0.0233.84 ▲0.2632.84 ▲2.17
Add New Post /wp-admin/post-new.php1,560 ▲2723.23 ▲0.31631.36 ▼2.8256.08 ▲1.17
Media Library /wp-admin/upload.php1,419 ▲314.25 ▲0.0795.72 ▼3.7042.61 ▼0.82
Settings /wp-admin/edit.php?post_type=themapfactorymaps&page=tmf_settings8092.0222.9125.40
All Maps /wp-admin/edit.php?post_type=themapfactorymaps1,1131.9329.8329.32
Add New /wp-admin/post-new.php?post_type=themapfactorymaps15,61014.76601.12203.25

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/the-wp-map-factory/the-wp-map-factory.php+422
    Trying to access array offset on value of type bool
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

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
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/the-wp-map-factory/the-wp-map-factory.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/the-wp-map-factory/includes/the_map_factory_backend.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/the-wp-map-factory/includes/the_map_factory_frontend.php:11

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/post-new.php?post_type=themapfactorymaps
    • > Console-api (severe) in unknown
    https://maps.googleapis.com/maps/api/js?key&callback=tmfInitialiseMap&ver=6.3.1 128:245 "You are using this API without a key. See https://developers.google.com/maps/documentation/javascript/error-messages?utm_source=maps_js&utm_medium=degraded&utm_campaign=billing#api-key-and-billing-errors"

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: maps, google, map, osm

the-wp-map-factory/the-wp-map-factory.php 92% from 13 tests

The primary PHP file in "The WP Map Factory" version 2.0.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Text Domain: The text domain should only use lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected5,806 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript4588693,096
PHP42071202,400
CSS26010310

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions33
▷ Named functions33100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1422 PNG files occupy 1.50MB with 0.45MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/images/Orange/Stores/medicalstore.png1.41KB1.04KB▼ 25.94%
includes/images/Orange/Restaurants and hotels/lodging-2.png0.60KB0.44KB▼ 27.07%
includes/images/Blue/Stores/japanese-sweet-2.png0.76KB0.51KB▼ 32.95%
includes/images/Pink/Stores/gumball_machine.png1.17KB0.78KB▼ 33.39%
includes/images/Blue/Stores/e-bike-rental.png1.38KB0.97KB▼ 29.75%