84% acf-sidebar-selector-field

Code Review | ACF: Sidebar Selector

WordPress plugin ACF: Sidebar Selector scored84%from 54 tests.

About plugin

  • Plugin page: acf-sidebar-selec...
  • Plugin version: 3.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.2
  • WordPress version: 6.3.1
  • First release: Feb 16, 2014
  • Latest release: Apr 22, 2015
  • Number of updates: 12
  • Update frequency: every 35.8 days
  • Top authors: danielpataki (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

1,000+ active /10,010 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

Analyzing server-side resources used by ACF: Sidebar Selector
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0144.29 ▼2.77
Dashboard /wp-admin3.32 ▼0.0349.98 ▼17.04
Posts /wp-admin/edit.php3.37 ▲0.0147.77 ▼2.00
Add New Post /wp-admin/post-new.php5.90 ▲0.0185.99 ▼9.89
Media Library /wp-admin/upload.php3.24 ▲0.0135.99 ▼1.88

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by ACF: Sidebar Selector
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲1814.34 ▼0.021.73 ▼0.2544.13 ▼5.93
Dashboard /wp-admin2,198 ▲215.60 ▼0.0691.19 ▼10.1841.78 ▼3.52
Posts /wp-admin/edit.php2,100 ▼02.01 ▼0.0238.65 ▲0.1534.79 ▼0.79
Add New Post /wp-admin/post-new.php1,529 ▼523.13 ▲4.80611.70 ▼33.8158.43 ▼5.26
Media Library /wp-admin/upload.php1,400 ▲34.19 ▼0.0797.57 ▼6.3045.53 ▼0.02

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/acf-sidebar-selector-field/acf-sidebar_selector-v5.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/acf-sidebar-selector-field/acf-sidebar_selector-v4.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/acf-sidebar-selector-field/acf-sidebar_selector.php:15

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
3 plugin tags: sidebar, acf, custom fields

acf-sidebar-selector-field/acf-sidebar_selector.php 92% from 13 tests

The primary PHP file in "ACF: Sidebar Selector" version 3.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-sidebar-selector-field.php" instead of "acf-sidebar_selector.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin176 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP365147145
PO File18831

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.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
PNG images were not found in this plugin