94% advanced-custom-fields-oembed-field

Code Review | Advanced Custom Fields: oEmbed Field

WordPress plugin Advanced Custom Fields: oEmbed Field scored 94% from 54 tests.

About plugin

  • Plugin page: advanced-custom-f...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.0
  • WordPress version: 5.9.2
  • First release: Jan 16, 2014
  • Latest release: Sep 4, 2014
  • Number of updates: 13
  • Update frequency: every 17.8 days
  • Top authors: edwardtownend (100%)

Code review

54 tests

User reviews

1 review

Install metrics

2,000+ active / 10,852 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.01MB] [CPU: ▼292.57ms] Passed 4 tests

Analyzing server-side resources used by Advanced Custom Fields: oEmbed Field
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.0266.06 ▲14.89
Dashboard /wp-admin3.45 ▲0.0133.58 ▼0.27
Posts /wp-admin/edit.php3.69 ▲0.0136.47 ▼2.13
Add New Post /wp-admin/post-new.php6.92 ▼0.0892.73 ▼1,166.20
Media Library /wp-admin/upload.php3.34 ▲0.0124.47 ▼1.68

Server storage [IO: ▲0.18MB] [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: 12 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Advanced Custom Fields: oEmbed Field
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,795 ▲4115.88 ▲0.176.02 ▼0.273.07 ▲0.53
Dashboard /wp-admin2,895 ▲376.11 ▼0.05117.43 ▼21.42154.62 ▼13.06
Posts /wp-admin/edit.php2,688 ▼63.24 ▲0.0064.30 ▼0.11143.10 ▼1.96
Add New Post /wp-admin/post-new.php1,781 ▲9122.27 ▲1.29414.17 ▼38.90158.85 ▼0.74
Media Library /wp-admin/upload.php1,698 ▲65.48 ▼0.01144.07 ▲0.07192.32 ▲7.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
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'acf_Field' not found in wp-content/plugins/advanced-custom-fields-oembed-field/oembed-v3.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/advanced-custom-fields-oembed-field/oembed-v4.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-custom-fields-oembed-field/acf-oembed.php:34

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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 your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (The Add Field interface.), #2 (The field in an Advanced Custom Field.)
The official readme.txt might help

advanced-custom-fields-oembed-field/acf-oembed.php 92% from 13 tests

The main file in "Advanced Custom Fields: oEmbed Field" v. 1.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("advanced-custom-fields-oembed-field.php" instead of "acf-oembed.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin414 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP4152302323
JavaScript211041
CSS13026
Markdown118024

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity6.00
▷ Minimum class complexity2.00
▷ Maximum class complexity17.00
Average method complexity1.87
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods23
▷ Static methods00.00%
▷ Public methods23100.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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.15MB with 0.09MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png78.88KB39.36KB▼ 50.10%
screenshot-2.png76.53KB28.93KB▼ 62.20%