94% simple-fields-map-extension

Code Review | Simple Fields Map extension

WordPress plugin Simple Fields Map extension scored 94% from 54 tests.

About plugin

  • Plugin page: simple-fields-map...
  • Plugin version: 1.3.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-3.8
  • WordPress version: 5.8.1
  • First release: Aug 23, 2012
  • Latest release: Dec 18, 2013
  • Number of updates: 26
  • Update frequency: every 18.5 days
  • Top authors: eskapism (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active / 4,476 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by Simple Fields Map extension
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.1633.48 ▲12.08
Dashboard /wp-admin3.10 ▲0.0545.37 ▼1.91
Posts /wp-admin/edit.php3.16 ▲0.0544.74 ▼3.10
Add New Post /wp-admin/post-new.php5.47 ▲0.0491.32 ▼553.64
Media Library /wp-admin/upload.php3.05 ▲0.0528.55 ▲1.82

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Simple Fields Map extension
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8315.90 ▲0.378.69 ▼1.9944.55 ▼9.06
Dashboard /wp-admin2,989 ▲585.94 ▲0.01136.90 ▼2.56112.62 ▼3.09
Posts /wp-admin/edit.php2,739 ▼02.72 ▼0.0065.39 ▼1.2287.86 ▼9.06
Add New Post /wp-admin/post-new.php1,683 ▲18518.69 ▼0.20357.76 ▼29.95104.14 ▼8.29
Media Library /wp-admin/upload.php1,810 ▲35.02 ▼0.01146.30 ▼4.62117.71 ▼14.00

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% 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)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-fields-map-extension/simple-fields-map-extension.php:401

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 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
  • Screenshots: These screenshots require images: #1 (The field with its options), #2 (The post edit screen, including the currently selected coordinates and a search result found), #3 (Example of the values that are being stored for each saved location/field (and the function used to get them))
The official readme.txt is a good inspiration

simple-fields-map-extension/simple-fields-map-extension.php Passed 13 tests

This is the main PHP file of "Simple Fields Map extension" version 1.3.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
41 characters long description:
Adds a Google Maps-field to Simple Fields

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin501 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP16296244
JavaScript16746207
CSS110239
Markdown17011

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity33.00
▷ Minimum class complexity33.00
▷ Maximum class complexity33.00
Average method complexity11.67
▷ Minimum method complexity9.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.46MB with 0.32MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png54.44KB16.98KB▼ 68.80%
screenshot-2.png402.21KB153.52KB▼ 61.83%
screenshot-3.png18.86KB4.80KB▼ 74.56%