84% advanced-term-fields-featured-images

Code Review | Advanced Term Images

WordPress plugin Advanced Term Images scored84%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: 6.3.1
  • 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 /4,304 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.19MB] [CPU: ▼1.14ms] Passed 4 tests

An overview of server-side resources used by Advanced Term Images
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2038.23 ▼0.86
Dashboard /wp-admin3.49 ▲0.1948.70 ▼6.23
Posts /wp-admin/edit.php3.60 ▲0.2549.72 ▲5.03
Add New Post /wp-admin/post-new.php6.07 ▲0.1890.85 ▼2.45
Media Library /wp-admin/upload.php3.41 ▲0.1838.69 ▲4.98

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 23 new files
Database: no new tables, 8 new options
New WordPress options

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Term Images
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.73 ▲0.001.71 ▲0.0443.33 ▲5.21
Dashboard /wp-admin2,198 ▲185.63 ▲0.0285.79 ▼2.7537.03 ▼0.36
Posts /wp-admin/edit.php2,100 ▲31.96 ▼0.0736.25 ▲1.0934.41 ▲0.59
Add New Post /wp-admin/post-new.php1,531 ▼523.16 ▲0.14628.66 ▼5.6849.54 ▼0.14
Media Library /wp-admin/upload.php1,403 ▲64.21 ▼0.03100.82 ▼8.0145.91 ▼1.99

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

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)
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
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > 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: 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
    • > 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

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test


Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
9 plugin tags: featured-images, category-images, taxonomy, image, metadata...

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

This is the main PHP file of "Advanced Term Images" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main 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 a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin876 lines of code in 15 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.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
▷ Abstract classes133.33%
▷ Concrete classes266.67%
▷ Final classes00.00%
▷ Static methods611.11%
▷ Public methods5092.59%
▷ Protected methods11.85%
▷ Private methods35.56%
▷ Named functions125.00%
▷ Anonymous functions375.00%
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
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/icon-128x128.png3.08KB1.93KB▼ 37.24%
assets/screenshot-1.png29.72KB11.98KB▼ 59.68%
assets/icon-256x256.png6.96KB3.25KB▼ 53.30%