83% acf-focal-point

Code Review | ACF: Focal Point

WordPress plugin ACF: Focal Point scored83%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: 6.3.1
  • 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

600+ active /11,635 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by ACF: Focal Point
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.09 ▼9.66
Dashboard /wp-admin3.31 ▼0.0349.27 ▼18.13
Posts /wp-admin/edit.php3.36 ▲0.0148.51 ▲0.24
Add New Post /wp-admin/post-new.php5.89 ▲0.0190.61 ▼16.82
Media Library /wp-admin/upload.php3.23 ▲0.0136.96 ▲0.13

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for ACF: Focal Point
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,906 ▲16013.61 ▼0.618.84 ▲7.0543.06 ▼0.50
Dashboard /wp-admin2,203 ▲145.79 ▲0.86104.85 ▼7.9739.60 ▼6.25
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0540.13 ▲0.8534.46 ▼2.48
Add New Post /wp-admin/post-new.php1,533 ▼023.10 ▼0.06673.92 ▼25.5954.63 ▼1.08
Media Library /wp-admin/upload.php1,385 ▼34.20 ▼0.0199.84 ▼18.1445.55 ▼5.86

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 3× PHP files trigger server errors when accessed directly:
    • > 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 | This is a shallow check for browser errors
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
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #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.)
The official readme.txt might help

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

The primary PHP file in "ACF: Focal Point" version 1.0.1 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • 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 | A short check of programming languages and file extensions; no executable files are 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
This plugin has no cyclomatic complexity problems
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
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-2.png150.55KB40.03KB▼ 73.41%
screenshot-4.png245.55KB62.84KB▼ 74.41%
screenshot-1.png33.06KB15.83KB▼ 52.12%
screenshot-3.png599.64KB153.13KB▼ 74.46%