84% acf-field-roles-filter

Code Review | ACF: Field Roles Filter

WordPress plugin ACF: Field Roles Filter scored84%from 54 tests.

About plugin

  • Plugin page: acf-field-roles-f...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.2
  • WordPress version: 6.3.1
  • First release: Aug 2, 2015
  • Latest release: Aug 2, 2015
  • Number of updates: 4
  • Update frequency: every 1.8 days
  • Top authors: Cypves (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,422 total downloads

Benchmarks

Plugin footprint 83% 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼7.09ms] Passed 4 tests

A check of server-side resources used by ACF: Field Roles Filter
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0238.50 ▼4.01
Dashboard /wp-admin3.33 ▼0.0149.55 ▼13.98
Posts /wp-admin/edit.php3.38 ▲0.0348.33 ▲2.29
Add New Post /wp-admin/post-new.php5.91 ▲0.0390.83 ▼12.65
Media Library /wp-admin/upload.php3.25 ▲0.0342.10 ▲5.09

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for ACF: Field Roles Filter
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.19 ▼0.231.60 ▼0.2340.05 ▼9.16
Dashboard /wp-admin2,195 ▲215.56 ▼0.1384.33 ▼32.5139.14 ▼13.63
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0136.92 ▼2.0034.16 ▼3.00
Add New Post /wp-admin/post-new.php1,536 ▲1023.22 ▲0.05681.59 ▼9.1166.49 ▲15.91
Media Library /wp-admin/upload.php1,397 ▼34.14 ▼0.03111.84 ▼0.4346.88 ▼3.92

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, 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
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/acf-field-roles-filter/index.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Screenshots: Screenshot #1 (User Filter metabox in ACF edit page.) image required
The official readme.txt is a good inspiration

acf-field-roles-filter/index.php 92% from 13 tests

The primary PHP file in "ACF: Field Roles Filter" version 1.0.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("acf-field-roles-filter.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin209 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP12719110
JavaScript122068
PO File11114
JSON10013
CSS1004

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity20.00
▷ Minimum class complexity20.00
▷ Maximum class complexity20.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods787.50%
▷ Protected methods00.00%
▷ Private methods112.50%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.08MB with 0.06MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png83.18KB25.73KB▼ 69.07%