94% acf-starrating

Code Review | ACF: Star Rating Field

WordPress plugin ACF: Star Rating Field scored 94% 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: 5.9.2
  • 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

300+ active / 6,586 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼294.78ms] Passed 4 tests

A check of server-side resources used by ACF: Star Rating Field
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0254.46 ▲3.01
Dashboard /wp-admin3.43 ▲0.0231.79 ▼1.00
Posts /wp-admin/edit.php3.65 ▲0.0135.92 ▲0.72
Add New Post /wp-admin/post-new.php6.90 ▼0.0790.17 ▼1,180.41
Media Library /wp-admin/upload.php3.30 ▲0.0125.51 ▲1.56

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 17 new files
Database: 1 new table, no new options
New tables
wp_acfsrf

Browser metrics Passed 4 tests

ACF: Star Rating Field: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,904 ▲15016.27 ▲0.259.39 ▲3.712.18 ▼0.50
Dashboard /wp-admin2,899 ▲456.27 ▲0.12115.40 ▼14.44155.20 ▼1.17
Posts /wp-admin/edit.php2,695 ▲43.37 ▲0.0263.55 ▼0.72147.68 ▲7.85
Add New Post /wp-admin/post-new.php1,767 ▲10622.77 ▲7.24403.70 ▼1.13159.89 ▲4.81
Media Library /wp-admin/upload.php1,705 ▲105.57 ▲0.03142.51 ▼1.98188.95 ▲3.06

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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
The following issues need your attention
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > 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
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/acf-starrating/functions.php:98

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 ("Star rating" field appearance.), #2 (Field settings in ACF.), #3 (Field settings in ACF.)
Please take inspiration from this readme.txt

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

"ACF: Star Rating Field" version 1.0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 148 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were 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
This plugin has no cyclomatic complexity problems
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-3.png20.00KB8.87KB▼ 55.67%
screenshot-2.png55.28KB20.58KB▼ 62.77%