84% advanced-term-fields

Code Review | Advanced Term Fields

WordPress plugin Advanced Term Fields scored84%from 54 tests.

About plugin

  • Plugin page: advanced-term-fields
  • Plugin version: 0.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.5
  • WordPress version: 6.3.1
  • First release: Feb 5, 2016
  • Latest release: Apr 10, 2016
  • Number of updates: 7
  • Update frequency: every 9.3 days
  • Top authors: dbmartin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,703 total downloads


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.09MB] [CPU: ▼3.92ms] Passed 4 tests

This is a short check of server-side resources used by Advanced Term Fields
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0941.73 ▼2.01
Dashboard /wp-admin3.40 ▲0.0960.28 ▲4.64
Posts /wp-admin/edit.php3.51 ▲0.1553.89 ▼1.40
Add New Post /wp-admin/post-new.php5.98 ▲0.0985.88 ▼12.06
Media Library /wp-admin/upload.php3.32 ▲0.0940.42 ▼0.19

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 16 new files
Database: no new tables, 7 new options
New WordPress options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Advanced Term Fields
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.23 ▼0.331.67 ▼0.4445.00 ▲2.03
Dashboard /wp-admin2,198 ▲215.61 ▼0.0493.89 ▼29.5442.04 ▼14.91
Posts /wp-admin/edit.php2,103 ▼01.99 ▼0.0441.89 ▼5.5235.50 ▼3.37
Add New Post /wp-admin/post-new.php1,404 ▼12418.03 ▼4.85654.77 ▲25.5250.23 ▼3.24
Media Library /wp-admin/upload.php1,397 ▼04.29 ▲0.08103.39 ▲0.8941.35 ▼2.76

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • atf_core_version
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
Please fix the following items
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/advanced-term-fields/views/quick-form-field.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/advanced-term-fields/views/add-form-field.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-term-fields/inc/functions.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/advanced-term-fields/views/edit-form-field.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected


Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: taxonomy, term_meta, metadata, meta, term...

advanced-term-fields/advanced-term-fields.php 92% from 13 tests

The principal PHP file in "Advanced Term Fields" v. 0.1.2 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Everything looks great! No dangerous files found in this plugin497 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity24.00
▷ Minimum class complexity6.00
▷ Maximum class complexity42.00
Average method complexity2.08
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
▷ Abstract classes150.00%
▷ Concrete classes150.00%
▷ Final classes00.00%
▷ Static methods716.67%
▷ Public methods3890.48%
▷ Protected methods12.38%
▷ Private methods37.14%
▷ Named functions125.00%
▷ Anonymous functions375.00%
▷ Global constants2100.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
assets/screenshot.png29.72KB11.98KB▼ 59.68%