84% advanced-custom-fields-shortcode-field

Code Review | Advanced Custom Field: Shortcode Field

WordPress plugin Advanced Custom Field: Shortcode Field scored84%from 54 tests.

About plugin

  • Plugin page: advanced-custom-f...
  • Plugin version: 4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-3.5.2
  • WordPress version: 6.3.1
  • First release: Jun 29, 2013
  • Latest release: Jun 29, 2013
  • Number of updates: 6
  • Update frequency: every 0.2 days
  • Top authors: ounziw (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /3,762 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

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

A check of server-side resources used by Advanced Custom Field: Shortcode Field
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0042.45 ▼1.42
Dashboard /wp-admin3.31 ▼0.0351.23 ▼16.53
Posts /wp-admin/edit.php3.36 ▲0.0050.11 ▼2.21
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.17 ▼20.38
Media Library /wp-admin/upload.php3.23 ▲0.0043.07 ▲6.49

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Custom Field: Shortcode Field
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.16 ▼1.231.72 ▼0.2543.38 ▼0.07
Dashboard /wp-admin2,206 ▲155.80 ▼0.10101.45 ▼5.0339.79 ▼0.85
Posts /wp-admin/edit.php2,092 ▲32.02 ▲0.0139.95 ▼1.9533.23 ▼4.12
Add New Post /wp-admin/post-new.php1,514 ▼2917.52 ▼0.63656.55 ▲49.0156.72 ▲0.94
Media Library /wp-admin/upload.php1,388 ▼04.18 ▲0.00102.76 ▼1.5645.97 ▼1.68

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/advanced-custom-fields-shortcode-field/shortcode_field.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-custom-fields-shortcode-field/init.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: Screenshot #1 (field for shortcodes, you can view the shortcodes available on your blog.) image missing
You can take inspiration from this readme.txt

advanced-custom-fields-shortcode-field/init.php 92% from 13 tests

The main PHP script in "Advanced Custom Field: Shortcode Field" version 4.0 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("advanced-custom-fields-shortcode-field.php" instead of "init.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin71 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP291154
PO File14517

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.04
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.33
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.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
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png32.97KB14.58KB▼ 55.77%