94% advanced-term-fields-featured-images

Code Review | Advanced Term Images

WordPress plugin Advanced Term Images scored 94% from 54 tests.

About plugin

  • Plugin page: advanced-term-fie...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.5
  • WordPress version: 5.9.2
  • First release: Feb 7, 2016
  • Latest release: Apr 16, 2016
  • Number of updates: 12
  • Update frequency: every 6.3 days
  • Top authors: dbmartin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active / 3,796 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▼289.46ms] Passed 4 tests

Analyzing server-side resources used by Advanced Term Images
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.2654.85 ▲2.78
Dashboard /wp-admin3.60 ▲0.1933.46 ▲1.10
Posts /wp-admin/edit.php3.83 ▲0.1938.32 ▲2.85
Add New Post /wp-admin/post-new.php7.06 ▲0.0995.56 ▼1,163.90
Media Library /wp-admin/upload.php3.48 ▲0.1926.21 ▲2.19

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 2 new options
New WordPress options
atf__thumbnail_id_version
atf__thumbnail_id_key_updated

Browser metrics Passed 4 tests

An overview of browser requirements for Advanced Term Images
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲915.83 ▲0.035.68 ▼0.122.82 ▼0.13
Dashboard /wp-admin2,895 ▲346.00 ▼0.28124.92 ▼9.69164.97 ▲2.62
Posts /wp-admin/edit.php2,688 ▼33.24 ▲0.0163.57 ▼0.89143.76 ▼0.29
Add New Post /wp-admin/post-new.php1,752 ▲9121.52 ▲5.87431.62 ▼40.31157.19 ▲1.71
Media Library /wp-admin/upload.php1,698 ▼05.50 ▼0.00137.23 ▼6.72191.12 ▲4.97

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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
Please fix the following
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/advanced-term-fields-featured-images/views/inner-add-form-field.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/advanced-term-fields-featured-images/lib/adv-term-fields/views/add-form-field.php:16
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/advanced-term-fields-featured-images/lib/adv-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-featured-images/lib/adv-term-fields/views/edit-form-field.php:16
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/advanced-term-fields-featured-images/views/inner-edit-form-field.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/advanced-term-fields-featured-images/views/inner-quick-form-field.php:17

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 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
9 plugin tags: term-meta, images, meta, taxonomy, image...

advanced-term-fields-featured-images/advanced-term-fields-images.php 85% from 13 tests

The primary PHP file in "Advanced Term Images" version 1.0 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("advanced-term-fields-featured-images.php" instead of "advanced-term-fields-images.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin876 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP123241,324700
JavaScript14965133
Markdown123033
CSS10010

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity20.67
▷ Minimum class complexity9.00
▷ Maximum class complexity43.00
Average method complexity2.06
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes133.33%
▷ Concrete classes266.67%
▷ Final classes00.00%
Methods54
▷ Static methods611.11%
▷ Public methods5092.59%
▷ Protected methods11.85%
▷ Private methods35.56%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants3
▷ Global constants3100.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
3 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png29.72KB11.98KB▼ 59.68%
assets/icon-256x256.png6.96KB3.25KB▼ 53.30%
assets/icon-128x128.png3.08KB1.93KB▼ 37.24%