94% acf-field-roles-filter

Code Review | ACF: Field Roles Filter

WordPress plugin ACF: Field Roles Filter scored 94% 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: 5.9.2
  • 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

30+ active / 1,224 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼295.37ms] Passed 4 tests

This is a short check of server-side resources used by ACF: Field Roles Filter
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0354.89 ▲3.58
Dashboard /wp-admin3.44 ▲0.0333.40 ▲0.64
Posts /wp-admin/edit.php3.67 ▲0.0337.32 ▼3.72
Add New Post /wp-admin/post-new.php6.91 ▼0.0793.40 ▼1,180.18
Media Library /wp-admin/upload.php3.32 ▲0.0226.05 ▲1.80

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 9 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by ACF: Field Roles Filter
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲2115.91 ▲0.345.56 ▼0.152.41 ▲0.41
Dashboard /wp-admin2,895 ▲376.10 ▼0.07117.46 ▼16.81155.25 ▼7.00
Posts /wp-admin/edit.php2,694 ▼03.24 ▲0.0162.97 ▼1.34140.54 ▼0.38
Add New Post /wp-admin/post-new.php1,772 ▲10521.13 ▲2.41463.81 ▲58.80158.90 ▲3.54
Media Library /wp-admin/upload.php1,695 ▼05.49 ▲0.02136.06 ▼4.37186.39 ▼1.24

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
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 | 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
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /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
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: Please add an image for screenshot #1 (User Filter metabox in ACF edit page.)
The official readme.txt might help

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

The principal PHP file in "ACF: Field Roles Filter" v. 1.0.0 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same 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 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected209 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP12719110
JavaScript122068
PO File11114
JSON10013
CSS1004

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.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

Using a strong compression for your PNG files is a great way to speed-up your plugin
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%