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.6
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3.1
  • WordPress version: 6.3.1
  • First release: May 26, 2020
  • Latest release: Sep 29, 2023
  • Number of updates: 31
  • Update frequency: every 39.4 days
  • Top authors: andremacola (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active / 2,294 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

Analyzing server-side resources used by ACF Onyx Poll
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0033.97 ▼5.99
Dashboard /wp-admin3.31 ▲0.0044.29 ▼2.54
Posts /wp-admin/edit.php3.36 ▲0.0048.37 ▲0.33
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.08 ▲2.69
Media Library /wp-admin/upload.php3.23 ▲0.0031.64 ▼4.93
All polls /wp-admin/edit.php?post_type=onyxpolls3.0424.30
Add new /wp-admin/post-new.php?post_type=onyxpolls3.0423.83

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 31 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_onyx_poll
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for ACF Onyx Poll
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.21 ▼1.161.61 ▼0.2541.08 ▼2.71
Dashboard /wp-admin2,206 ▲185.91 ▲0.02105.70 ▲0.4541.93 ▲4.53
Posts /wp-admin/edit.php2,092 ▲32.01 ▼0.0338.69 ▲5.2435.07 ▼4.25
Add New Post /wp-admin/post-new.php1,531 ▼318.43 ▼4.69584.22 ▼81.1152.26 ▼2.34
Media Library /wp-admin/upload.php1,388 ▲64.29 ▲0.0791.66 ▼13.5939.82 ▼5.77
All polls /wp-admin/edit.php?post_type=onyxpolls280.440.073.39
Add new /wp-admin/post-new.php?post_type=onyxpolls280.440.073.51

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_onyx_poll
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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
Please take a closer look at the following
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > 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 get_field() in wp-content/plugins/acf-onyx-poll/admin/block/block.php:16
    • > 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: Call to undefined function add_action() in wp-content/plugins/acf-onyx-poll/admin/poll-block.php:10
    • > 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: Class 'WP_REST_Controller' not found in wp-content/plugins/acf-onyx-poll/api/poll-api.php:9
    • > PHP Notice
      Undefined variable: block in wp-content/plugins/acf-onyx-poll/admin/block/block.php on line 3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
    • > 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

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Add an image for screenshot #4 (Showing poll results.)
Please take inspiration from this readme.txt

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

The entry point to "ACF Onyx Poll" version 1.1.6 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • 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 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin2,162 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP91492121,129
CSS45618366
PO File2155162344
JavaScript54310323

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
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.24MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon-256x256.png9.98KB5.03KB▼ 49.54%
assets/images/screenshot-2.png128.26KB40.26KB▼ 68.61%
assets/images/screenshot-1.png73.12KB23.63KB▼ 67.68%
assets/images/screenshot-3.png52.65KB18.06KB▼ 65.69%
assets/images/banner-1544x500.png81.70KB28.85KB▼ 64.69%