93% acf-focal-point

Code Review | ACF: Focal Point

WordPress plugin ACF: Focal Point scored 93% from 54 tests.

About plugin

  • Plugin page: acf-focal-point
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.2
  • WordPress version: 5.9.2
  • First release: Feb 2, 2016
  • Latest release: Feb 7, 2016
  • Number of updates: 12
  • Update frequency: every 0.4 days
  • Top authors: evuze (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

700+ active / 9,451 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: ▼296.56ms] Passed 4 tests

A check of server-side resources used by ACF: Focal Point
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0158.59 ▲7.15
Dashboard /wp-admin3.41 ▲0.0133.57 ▲1.37
Posts /wp-admin/edit.php3.65 ▲0.0137.65 ▲1.42
Add New Post /wp-admin/post-new.php6.89 ▼0.0892.97 ▼1,188.17
Media Library /wp-admin/upload.php3.30 ▲0.0123.91 ▼0.84

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 15 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for ACF: Focal Point
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,871 ▲14516.78 ▲1.0310.49 ▲5.062.30 ▼0.07
Dashboard /wp-admin2,888 ▲306.00 ▼0.32118.17 ▼19.81156.59 ▼2.33
Posts /wp-admin/edit.php2,694 ▲33.24 ▲0.0062.03 ▼0.87141.28 ▼1.94
Add New Post /wp-admin/post-new.php1,758 ▲6821.96 ▲1.12440.80 ▲9.34158.57 ▼3.70
Media Library /wp-admin/upload.php1,698 ▼05.46 ▼0.08140.89 ▼0.60186.41 ▲0.40

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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
Almost there! Just fix the following items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/acf-focal-point/acf-focal_point-v5.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/acf-focal-point/acf-focal_point.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/acf-focal-point/acf-focal_point-v4.php:3

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 issues were found

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: Please add images for these screenshots: #1 (Creating a Focal Point Field.), #2 (Selecting a Focal Point for the selected image.), #3 (Desktop width image on 2016 Theme.), #4 (Same image at mobile width.)
You can take inspiration from this readme.txt

acf-focal-point/acf-focal_point.php 92% from 13 tests

This is the main PHP file of "ACF: Focal Point" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("acf-focal-point.php" instead of "acf-focal_point.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin629 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP3206234320
JavaScript3128100224
Markdown143050
CSS12035

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.26
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 1.00MB with 0.69MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png33.06KB15.83KB▼ 52.12%
screenshot-4.png245.55KB62.84KB▼ 74.41%
screenshot-3.png599.64KB153.13KB▼ 74.46%
screenshot-2.png150.55KB40.03KB▼ 73.41%