84% acf-starrating

Code Review | ACF: Star Rating Field

WordPress plugin ACF: Star Rating Field scored84%from 54 tests.

About plugin

  • Plugin page: acf-starrating
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.1.1
  • WordPress version: 6.3.1
  • First release: Nov 30, 2014
  • Latest release: Mar 22, 2015
  • Number of updates: 9
  • Update frequency: every 12.4 days
  • Top authors: lienann (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

200+ active /7,411 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
The plugin installed gracefully, with no errors

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

Server-side resources used by ACF: Star Rating Field
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0244.18 ▼2.19
Dashboard /wp-admin3.32 ▲0.0249.60 ▼4.52
Posts /wp-admin/edit.php3.37 ▲0.0150.53 ▲3.59
Add New Post /wp-admin/post-new.php5.92 ▲0.03103.36 ▲7.86
Media Library /wp-admin/upload.php3.24 ▲0.0138.88 ▼1.80

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 17 new files
Database: 1 new table, 6 new options
New tables
wp_acfsrf
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for ACF: Star Rating Field
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,882 ▲12113.38 ▼0.978.88 ▲7.2043.71 ▼2.95
Dashboard /wp-admin2,202 ▲255.64 ▼0.0195.61 ▼4.2940.65 ▼4.87
Posts /wp-admin/edit.php2,107 ▲72.03 ▲0.0238.13 ▲0.3835.71 ▲0.04
Add New Post /wp-admin/post-new.php1,544 ▲1817.88 ▼5.81646.62 ▼39.3566.44 ▲5.09
Media Library /wp-admin/upload.php1,407 ▲104.20 ▼0.04100.24 ▼11.3747.83 ▼0.53

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/acf-starrating/functions.php:98
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/acf-starrating/acf-starrating.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/acf-starrating/acf-starrating-v4.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

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
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 ("Star rating" field appearance.), #2 (Field settings in ACF.), #3 (Field settings in ACF.)
You can look at the official readme.txt

acf-starrating/acf-starrating.php 92% from 13 tests

The main file in "ACF: Star Rating Field" v. 1.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 148 characters long)

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 plugin875 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP4242278483
JavaScript1627194
PO File25362138
CSS17032
Markdown115028

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity2.40
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
4 PNG files occupy 0.09MB with 0.05MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png10.22KB4.01KB▼ 60.73%
images/stars.png4.33KB2.47KB▼ 43.00%
screenshot-2.png55.28KB20.58KB▼ 62.77%
screenshot-3.png20.00KB8.87KB▼ 55.67%