83% 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 scored83%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: 6.3.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

1,000+ active /47,792 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

Server-side resources used by Advanced Custom Fields - Location Field add-on
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0440.30 ▼3.78
Dashboard /wp-admin3.35 ▲0.0050.81 ▼14.72
Posts /wp-admin/edit.php3.46 ▲0.1044.69 ▼3.76
Add New Post /wp-admin/post-new.php5.93 ▲0.0489.67 ▼0.78
Media Library /wp-admin/upload.php3.27 ▲0.0437.49 ▲0.11

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Custom Fields - Location Field add-on
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.57 ▲0.222.18 ▲0.5745.01 ▼12.29
Dashboard /wp-admin2,192 ▲215.63 ▲0.0992.30 ▲2.6944.03 ▲3.56
Posts /wp-admin/edit.php2,100 ▼01.98 ▲0.0037.98 ▲1.2135.52 ▲1.61
Add New Post /wp-admin/post-new.php1,526 ▼323.21 ▼0.35647.95 ▲15.2050.62 ▲0.94
Media Library /wp-admin/upload.php1,400 ▲64.17 ▲0.02101.12 ▲0.3443.14 ▼0.40

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
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/advanced-custom-fields-location-field-add-on/location-field.php:476

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
  • Screenshots: These screenshots require images: #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)
The official readme.txt might help

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

Analyzing the main PHP file in "Advanced Custom Fields - Location Field add-on" version 1.0
You should first fix the following items:
  • 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
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("advanced-custom-fields-location-field-add-on.php" instead of "location-field.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
Success! There were no dangerous files found in this plugin488 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP172229206
JavaScript11369142
Markdown127062
CSS10048
PO File1142630

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
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

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