78% acf-images-search-and-insert

Code Review | ACF Images Search And Insert

WordPress plugin ACF Images Search And Insert scored 78% from 54 tests.

About plugin

  • Plugin page: acf-images-search...
  • Plugin version: 1.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4
  • WordPress version: 5.9.2
  • First release: Apr 1, 2016
  • Latest release: Apr 2, 2016
  • Number of updates: 22
  • Update frequency: every 0.1 days
  • Top authors: takayukii (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,154 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.30MB] [CPU: ▼306.99ms] Passed 4 tests

This is a short check of server-side resources used by ACF Images Search And Insert
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.1555.32 ▲4.73
Dashboard /wp-admin3.30 ▼0.1120.21 ▼13.04
Posts /wp-admin/edit.php3.36 ▼0.2824.11 ▼12.54
Add New Post /wp-admin/post-new.php6.14 ▼0.8373.68 ▼1,198.09
Media Library /wp-admin/upload.php3.32 ▲0.0322.00 ▼4.27
ACF Images Search And Insert /wp-admin/options-general.php?page=aisai_settings3.2823.27

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 13 new files
Database: no new tables, 1 new option
New WordPress options
aisai_options

Browser metrics Passed 4 tests

A check of browser resources used by ACF Images Search And Insert
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,781 ▲2716.54 ▲1.016.24 ▼0.122.40 ▼0.58
Dashboard /wp-admin2,907 ▲497.18 ▲0.99128.16 ▼4.75174.01 ▲14.71
Posts /wp-admin/edit.php2,706 ▲213.29 ▲0.0568.43 ▲2.87163.82 ▲23.20
Add New Post /wp-admin/post-new.php1,764 ▲7421.89 ▲1.21435.49 ▲5.34161.08 ▼9.09
Media Library /wp-admin/upload.php1,713 ▲126.23 ▲0.67130.43 ▼11.60205.47 ▲22.19
ACF Images Search And Insert /wp-admin/options-general.php?page=aisai_settings1,4133.0762.54183.56

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The uninstall procedure has failed, leaving 1 option in the database
    • aisai_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=aisai_settings
    • > Notice in wp-content/plugins/acf-images-search-and-insert/acf-images-search-and-insert.php+112
    Undefined index: post_id

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
Almost there! Just fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/acf-images-search-and-insert/settings.php:74
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/acf-images-search-and-insert/acf-images-search-and-insert.php:45

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: Add an image for screenshot #1 (Search result in WP Media modal)
You can take inspiration from this readme.txt

acf-images-search-and-insert/acf-images-search-and-insert.php 85% from 13 tests

The main PHP file in "ACF Images Search And Insert" ver. 1.1.4 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • 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
  • Description: Please keep the plugin description shorter than 140 characters (currently 183 characters long)

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
Good job! No executable or dangerous file extensions detected445 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP257128359
PO File1202266
JavaScript203819
CSS1011

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity21.00
▷ Minimum class complexity19.00
▷ Maximum class complexity23.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions00.00%
▷ Anonymous functions9100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.47MB with 0.33MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png481.29KB141.84KB▼ 70.53%