93% acf-flexible-content-layout-previews

Code Review | ACF Flexible Content Layout Previews

WordPress plugin ACF Flexible Content Layout Previews scored 93% from 54 tests.

About plugin

  • Plugin page: acf-flexible-cont...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2.2
  • WordPress version: 5.9.2
  • First release: Jul 1, 2019
  • Latest release: Jul 1, 2019
  • Number of updates: 5
  • Update frequency: every 0.6 days
  • Top authors: robertark (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active / 518 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼289.68ms] Passed 4 tests

This is a short check of server-side resources used by ACF Flexible Content Layout Previews
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1256.72 ▲5.35
Dashboard /wp-admin3.47 ▲0.0635.33 ▲1.40
Posts /wp-admin/edit.php3.69 ▲0.0539.88 ▲1.53
Add New Post /wp-admin/post-new.php6.94 ▼0.04102.30 ▼1,161.34
Media Library /wp-admin/upload.php3.35 ▲0.0525.38 ▼0.30

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 32 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by ACF Flexible Content Layout Previews
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,784 ▲3015.89 ▼0.116.15 ▼0.542.14 ▼0.84
Dashboard /wp-admin2,912 ▲546.30 ▲0.08126.10 ▼11.83154.92 ▼9.75
Posts /wp-admin/edit.php2,706 ▲183.27 ▲0.0373.05 ▲6.02144.04 ▼3.60
Add New Post /wp-admin/post-new.php1,685 ▼519.87 ▼1.52413.63 ▼56.97158.27 ▼4.90
Media Library /wp-admin/upload.php1,710 ▲125.62 ▲0.16142.36 ▼1.92190.38 ▲2.03

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/acf-flexible-content-layout-previews/admin/partials/acf-fc-layout-previews-admin-display.php

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


Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (When adding a new layout to your page, you are prompted with visual examples of each content row), #2 (You must name screenshots after the "Name" of the layout, in jpg format), #3 (Once you have screenshots ready to use, you must upload them to your [uploads]/acf-fc-layouts folder. This method may change in a major release in the future.)
  • Plugin Name: Please specify the plugin name on the first line ( === acf-flexible-content-layout-previews === )
You can take inspiration from this readme.txt

acf-flexible-content-layout-previews/acf-fc-layout-previews.php 85% from 13 tests

The main PHP script in "ACF Flexible Content Layout Previews" version 1.0.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("acf-flexible-content-layout-previews.php" instead of "acf-fc-layout-previews.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
Good job! No executable or dangerous file extensions detected262 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity1.86
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.10
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
▷ Static methods28.70%
▷ Public methods1878.26%
▷ Protected methods00.00%
▷ Private methods521.74%
▷ Named functions360.00%
▷ Anonymous functions240.00%
▷ Global constants1100.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
3 PNG files occupy 0.36MB with 0.21MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png273.02KB109.84KB▼ 59.77%
screenshot-2.png35.60KB19.86KB▼ 44.21%
screenshot-3.png58.40KB15.56KB▼ 73.37%