84% acf-price

Code Review | Advanced Custom Fields: Price Field

WordPress plugin Advanced Custom Fields: Price Field scored84%from 54 tests.

About plugin

  • Plugin page: acf-price
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.8
  • WordPress version: 6.3.1
  • First release: Jul 16, 2017
  • Latest release: Jul 16, 2017
  • Number of updates: 3
  • Update frequency: every 4.3 days
  • Top authors: speccode (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

600+ active /3,385 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by Advanced Custom Fields: Price Field
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0343.09 ▼2.26
Dashboard /wp-admin3.32 ▲0.0253.01 ▲0.34
Posts /wp-admin/edit.php3.38 ▲0.0256.07 ▲0.42
Add New Post /wp-admin/post-new.php5.91 ▲0.0298.50 ▼6.47
Media Library /wp-admin/upload.php3.25 ▲0.0242.18 ▲4.39

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Advanced Custom Fields: Price Field
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.75 ▲0.361.83 ▼0.1245.01 ▲0.33
Dashboard /wp-admin2,192 ▲125.52 ▼0.1491.51 ▲2.9739.76 ▼0.18
Posts /wp-admin/edit.php2,103 ▲31.99 ▼0.0135.67 ▼1.3431.66 ▼6.71
Add New Post /wp-admin/post-new.php1,526 ▼023.13 ▲1.10622.96 ▼82.2766.11 ▲15.73
Media Library /wp-admin/upload.php1,400 ▼34.19 ▼0.0496.23 ▼4.5641.63 ▼3.01

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 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, 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 fix the following
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/acf-price/fields/acf-price-common.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'acf_price_common' not found in wp-content/plugins/acf-price/fields/acf-price-v5.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'acf_price_common' not found in wp-content/plugins/acf-price/fields/acf-price-v4.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: acf, advanced custom fields, price

acf-price/acf-price.php Passed 13 tests

The main PHP script in "Advanced Custom Fields: Price Field" version 1.2.1 is automatically included on every request by WordPress
35 characters long description:
ACF Price field with number format.

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 plugin261 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP43114156
PO File2161661
JavaScript34123
JSON10021

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity1.75
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes125.00%
▷ Concrete classes375.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There were not PNG files found in your plugin