93% advanced-custom-fields-location-field-add-on

Code Review | Advanced Custom Fields - Location Field add-on

WordPress plugin Advanced Custom Fields - Location Field add-on scored 93% from 54 tests.

About plugin

  • Plugin page: advanced-custom-f...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-3.4.1
  • WordPress version: 5.8.1
  • First release: Jul 24, 2012
  • Latest release: Aug 1, 2012
  • Number of updates: 7
  • Update frequency: every 1.3 days
  • Top authors: julienbechade (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

2,000+ active / 47,326 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼199.77ms] Passed 4 tests

Analyzing server-side resources used by Advanced Custom Fields - Location Field add-on
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.0432.88 ▲6.57
Dashboard /wp-admin3.10 ▲0.0437.33 ▼4.88
Posts /wp-admin/edit.php3.16 ▲0.0434.35 ▼4.84
Add New Post /wp-admin/post-new.php5.47 ▲0.0276.03 ▼792.96
Media Library /wp-admin/upload.php3.05 ▲0.0429.17 ▲3.60

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 13 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Advanced Custom Fields - Location Field add-on: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,666 ▲6516.01 ▲0.038.87 ▲1.5675.68 ▼2.50
Dashboard /wp-admin2,930 ▲346.13 ▼0.11122.36 ▼9.16178.13 ▲6.21
Posts /wp-admin/edit.php2,740 ▼33.24 ▲0.0063.94 ▼1.93137.65 ▲0.20
Add New Post /wp-admin/post-new.php3,815 ▼019.29 ▼0.04445.06 ▼4.66162.19 ▼2.17
Media Library /wp-admin/upload.php1,752 ▼05.54 ▲0.02142.73 ▲8.96183.34 ▼4.04

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
This plugin's uninstaller ran successfully

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-custom-fields-location-field-add-on/location-field.php:476

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

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 add images for these screenshots: #1 (Location field and its options), #2 (Location field on an edit-post page), #3 (Type in a partial address or some coordinates), #4 (Choose to get the complete address)
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

advanced-custom-fields-location-field-add-on/location-field.php 85% from 13 tests

The entry point to "Advanced Custom Fields - Location Field add-on" version 1.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("advanced-custom-fields-location-field-add-on.php" instead of "location-field.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected488 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP172229206
JavaScript11369142
Markdown127062
CSS10048
PO File1142630

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity6.00
▷ Minimum class complexity3.00
▷ Maximum class complexity9.00
Average method complexity1.62
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods16
▷ Static methods16.25%
▷ Public methods1381.25%
▷ Protected methods00.00%
▷ Private methods318.75%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 compressed PNG files occupy 0.30MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/sprite.png1.02KB1.00KB▼ 1.34%
screenshot-1.png27.35KB27.79KB0.00%
screenshot-3.png92.73KB95.50KB0.00%
screenshot-2.png94.86KB98.19KB0.00%
screenshot-4.png94.68KB97.67KB0.00%