78% acf-onyx-poll

Code Review | ACF Onyx Poll

WordPress plugin ACF Onyx Poll scored 78% from 54 tests.

About plugin

  • Plugin page: acf-onyx-poll
  • Plugin version: 1.1.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.8
  • WordPress version: 5.9.2
  • First release: May 26, 2020
  • Latest release: Jul 21, 2021
  • Number of updates: 27
  • Update frequency: every 15.6 days
  • Top authors: andremacola (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

90+ active / 1,376 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

Analyzing server-side resources used by ACF Onyx Poll
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0153.71 ▲3.95
Dashboard /wp-admin3.41 ▲0.0034.74 ▲2.55
Posts /wp-admin/edit.php3.64 ▲0.0034.17 ▼1.25
Add New Post /wp-admin/post-new.php6.88 ▼0.0989.80 ▼1,174.93
Media Library /wp-admin/upload.php3.29 ▲0.0026.19 ▲1.67
All polls /wp-admin/edit.php?post_type=onyxpolls3.1819.18
Add new /wp-admin/post-new.php?post_type=onyxpolls3.1819.16

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 31 new files
Database: no new tables, 1 new option
New WordPress options
widget_onyx_poll

Browser metrics Passed 4 tests

ACF Onyx Poll: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲915.84 ▲0.176.18 ▲0.022.38 ▼0.36
Dashboard /wp-admin2,892 ▲386.16 ▲0.00118.58 ▼21.12156.89 ▼1.33
Posts /wp-admin/edit.php2,691 ▼03.37 ▲0.1463.01 ▼1.79133.60 ▼4.74
Add New Post /wp-admin/post-new.php1,751 ▲9021.35 ▲5.31419.87 ▼1.58155.07 ▼4.89
Media Library /wp-admin/upload.php1,698 ▲35.51 ▼0.01143.12 ▲0.98188.49 ▲1.44
All polls /wp-admin/edit.php?post_type=onyxpolls280.940.0416.32
Add new /wp-admin/post-new.php?post_type=onyxpolls280.940.0316.93

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 1 option in the database
    • widget_onyx_poll

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_field() in wp-content/plugins/acf-onyx-poll/admin/block/block.php:16
    • > PHP Notice
      Undefined variable: block in wp-content/plugins/acf-onyx-poll/admin/block/block.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/acf-onyx-poll/admin/block/block.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/acf-onyx-poll/admin/poll-type.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/acf-onyx-poll/admin/poll-block.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/acf-onyx-poll/admin/poll-widget.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/acf-onyx-poll/api/poll-api.php:9

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/edit.php?post_type=onyxpolls
    • > Network (severe)
    wp-admin/edit.php?post_type=onyxpolls - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/post-new.php?post_type=onyxpolls
    • > Network (severe)
    wp-admin/post-new.php?post_type=onyxpolls - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

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
Attributes that require attention:
  • Screenshots: Add an image for screenshot #4 (Showing poll results.)
The official readme.txt might help

acf-onyx-poll/onyx-poll.php 92% from 13 tests

This is the main PHP file of "ACF Onyx Poll" version 1.1.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("acf-onyx-poll.php" instead of "onyx-poll.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected2,162 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP91492121,129
CSS45618366
PO File2155162344
JavaScript54310323

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity15.60
▷ Minimum class complexity7.00
▷ Maximum class complexity32.00
Average method complexity3.03
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods32
▷ Static methods515.62%
▷ Public methods3093.75%
▷ Protected methods26.25%
▷ Private methods00.00%
Functions15
▷ Named functions213.33%
▷ Anonymous functions1386.67%
Constants3
▷ Global constants3100.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
7 PNG files occupy 0.38MB with 0.22MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/banner-772x250.png35.13KB12.82KB▼ 63.51%
assets/images/screenshot-2.png128.26KB40.26KB▼ 68.61%
assets/images/icon-256x256.png9.98KB5.03KB▼ 49.54%
assets/images/icon-128x128.png4.81KB2.81KB▼ 41.56%
assets/images/screenshot-3.png52.65KB18.06KB▼ 65.69%