84% advanced-custom-fields-oembed-field

Code Review | Advanced Custom Fields: oEmbed Field

WordPress plugin Advanced Custom Fields: oEmbed Field scored84%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: 6.3.1
  • 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

1,000+ active /11,885 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▲0.37ms] Passed 4 tests

Server-side resources used by Advanced Custom Fields: oEmbed Field
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.74 ▲0.95
Dashboard /wp-admin3.31 ▲0.0146.13 ▼1.98
Posts /wp-admin/edit.php3.36 ▲0.0147.74 ▲1.93
Add New Post /wp-admin/post-new.php5.89 ▲0.0191.09 ▲5.99
Media Library /wp-admin/upload.php3.23 ▲0.0033.85 ▲0.57

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Advanced Custom Fields: oEmbed Field: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.46 ▼0.171.68 ▲0.0141.06 ▼1.09
Dashboard /wp-admin2,203 ▲155.83 ▲0.9598.24 ▼9.3742.29 ▲2.12
Posts /wp-admin/edit.php2,086 ▼31.97 ▼0.0639.02 ▲0.7835.58 ▲1.33
Add New Post /wp-admin/post-new.php1,514 ▼2223.65 ▲0.60657.72 ▲66.5861.36 ▲4.61
Media Library /wp-admin/upload.php1,382 ▼64.25 ▲0.0694.88 ▼3.7641.19 ▼0.19

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > 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: Class 'acf_Field' not found in wp-content/plugins/advanced-custom-fields-oembed-field/oembed-v3.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 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% 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
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (The Add Field interface.), #2 (The field in an Advanced Custom Field.)
You can look at the official readme.txt

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

Analyzing the main PHP file in "Advanced Custom Fields: oEmbed Field" version 1.0.3
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be 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 | This is an overview of programming languages used in this plugin; dangerous file extensions 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

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
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

PNG files should be compressed to save space and 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%