84% advanced-custom-fields-position-field

Code Review | Advanced Custom Fields: Position Field

WordPress plugin Advanced Custom Fields: Position Field scored84%from 54 tests.

About plugin

  • Plugin page: advanced-custom-f...
  • Plugin version: 1.1
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-5.1
  • WordPress version: 6.3.1
  • First release: Sep 22, 2014
  • Latest release: Mar 13, 2019
  • Number of updates: 32
  • Update frequency: every 51.0 days
  • Top authors: mihdan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,008 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.01MB] [CPU: ▼3.17ms] Passed 4 tests

This is a short check of server-side resources used by Advanced Custom Fields: Position Field
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.82 ▼0.76
Dashboard /wp-admin3.31 ▲0.0148.38 ▼5.95
Posts /wp-admin/edit.php3.36 ▲0.0151.79 ▲1.76
Add New Post /wp-admin/post-new.php5.89 ▲0.0195.03 ▼6.10
Media Library /wp-admin/upload.php3.23 ▲0.0135.93 ▲0.13

Server storage [IO: ▲0.05MB] [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: 12 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Advanced Custom Fields: Position Field: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.54 ▼0.861.92 ▲0.3237.49 ▼4.20
Dashboard /wp-admin2,221 ▲184.84 ▼0.08109.47 ▲3.5842.56 ▲0.80
Posts /wp-admin/edit.php2,100 ▼02.04 ▲0.0440.54 ▲1.1337.41 ▲5.81
Add New Post /wp-admin/post-new.php1,549 ▲1818.62 ▼4.67635.24 ▼47.3058.43 ▲4.39
Media Library /wp-admin/upload.php1,400 ▲34.24 ▲0.0697.80 ▼9.7242.49 ▼2.30

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/advanced-custom-fields-position-field/register-fields.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/advanced-custom-fields-position-field/acf-position.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Tags: There are too many tags (12 tag instead of maximum 10)
Please take inspiration from this readme.txt

advanced-custom-fields-position-field/acf-position.php 92% from 13 tests

"Advanced Custom Fields: Position Field" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("advanced-custom-fields-position-field.php" instead of "acf-position.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
No dangerous file extensions were detected573 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP4124279306
CSS1300167
JavaScript13015100

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity8.50
▷ Minimum class complexity1.00
▷ Maximum class complexity16.00
Average method complexity1.83
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/select2.png1.80KB1.24KB▼ 31.31%
images/select2x2.png0.83KB0.77KB▼ 6.15%