78% acf-restrict-color-picker

Code Review | Advanced Custom Fields: Restrict Color Picker Options

WordPress plugin Advanced Custom Fields: Restrict Color Picker Options scored78%from 54 tests.

About plugin

  • Plugin page: acf-restrict-colo...
  • Plugin version: 1.3.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.9
  • WordPress version: 6.3.1
  • First release: Mar 8, 2016
  • Latest release: Jan 25, 2022
  • Number of updates: 37
  • Update frequency: every 58.1 days
  • Top authors: adamwalter (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

2,000+ active /12,848 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 gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼3.44ms] Passed 4 tests

Server-side resources used by Advanced Custom Fields: Restrict Color Picker Options
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.55 ▼5.34
Dashboard /wp-admin3.36 ▲0.0545.43 ▼2.46
Posts /wp-admin/edit.php3.47 ▲0.1143.42 ▼2.84
Add New Post /wp-admin/post-new.php5.94 ▲0.0587.12 ▼3.10
Media Library /wp-admin/upload.php3.28 ▲0.0537.12 ▲5.81
Restrict Color Picker Options /wp-admin/edit.php?post_type=acf-field-group&page=acf-restrict-color-picker3.0422.84

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Advanced Custom Fields: Restrict Color Picker Options: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.26 ▼1.131.77 ▼0.3541.77 ▼4.95
Dashboard /wp-admin2,206 ▲245.91 ▲0.01102.90 ▲2.1739.40 ▼9.06
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0434.10 ▼7.4633.66 ▼2.35
Add New Post /wp-admin/post-new.php1,514 ▼1917.78 ▼5.37689.00 ▲64.4655.55 ▼0.89
Media Library /wp-admin/upload.php1,388 ▲34.24 ▲0.03102.50 ▲2.7943.33 ▲1.03
Restrict Color Picker Options /wp-admin/edit.php?post_type=acf-field-group&page=acf-restrict-color-picker280.440.115.44

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/acf-restrict-color-picker/admin.php:153

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
    • > GET request to /wp-admin/edit.php?post_type=acf-field-group&page=acf-restrict-color-picker
    • > Network (severe)
    wp-admin/edit.php?post_type=acf-field-group&page=acf-restrict-color-picker - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
3 plugin tags: custom fields, acf, color

acf-restrict-color-picker/acf-restrict-color-picker.php 92% from 13 tests

The primary PHP file in "Advanced Custom Fields: Restrict Color Picker Options" version 1.3.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected268 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP36397214
CSS18044
JavaScript13010

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity11.50
▷ Minimum class complexity5.00
▷ Maximum class complexity18.00
Average method complexity2.24
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods1482.35%
▷ Protected methods00.00%
▷ Private methods317.65%
Functions1
▷ Named functions1100.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