84% term-featured-image-fallback

Code Review | Term Featured Image Fallback

WordPress plugin Term Featured Image Fallback scored84%from 54 tests.

About plugin

  • Plugin page: term-featured-ima...
  • Plugin version: 1.0.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.7.3
  • WordPress version: 6.3.1
  • First release: Apr 29, 2017
  • Latest release: May 1, 2017
  • Number of updates: 21
  • Update frequency: every 0.1 days
  • Top authors: neeonez (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /650 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.94ms] Passed 4 tests

Analyzing server-side resources used by Term Featured Image Fallback
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0242.03 ▼2.23
Dashboard /wp-admin3.32 ▲0.0251.20 ▲3.15
Posts /wp-admin/edit.php3.37 ▲0.0249.62 ▼2.44
Add New Post /wp-admin/post-new.php5.90 ▲0.0295.79 ▼8.08
Media Library /wp-admin/upload.php3.24 ▲0.0233.19 ▼3.01
Term featured images /wp-admin/themes.php?page=term-featured-image-options3.2334.65

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Term Featured Image Fallback
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.26 ▼1.171.78 ▼0.1141.68 ▼2.71
Dashboard /wp-admin2,204 ▲165.82 ▼0.07103.43 ▼6.9740.19 ▲0.80
Posts /wp-admin/edit.php2,093 ▲11.99 ▼0.0439.79 ▼2.1135.40 ▲0.50
Add New Post /wp-admin/post-new.php1,545 ▲318.56 ▲0.33581.07 ▼18.5150.85 ▼4.95
Media Library /wp-admin/upload.php1,395 ▲74.22 ▼0.0195.50 ▲0.8840.07 ▼1.30
Term featured images /wp-admin/themes.php?page=term-featured-image-options3,3123.3248.1826.21

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/term-featured-image-fallback/methods/post-functions.php:6
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/term-featured-image-fallback/methods/term-fields.php:6
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/term-featured-image-fallback/methods/page-options.php:5

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

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed: You can look at the official readme.txt

term-featured-image-fallback/main.php 92% from 13 tests

"Term Featured Image Fallback" version 1.0.4.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("term-featured-image-fallback.php" instead of "main.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
Good job! No executable or dangerous file extensions detected804 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP869152562
PO File25254173
JavaScript24638
CSS14031

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity7.50
▷ Minimum class complexity3.00
▷ Maximum class complexity12.00
Average method complexity2.30
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits1
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods110.00%
▷ Public methods990.00%
▷ Protected methods00.00%
▷ Private methods110.00%
Functions25
▷ Named functions1352.00%
▷ Anonymous functions1248.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
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
core/images/imgdel.png3.56KB1.03KB▼ 71.06%
core/images/add-image.png2.97KB1.85KB▼ 37.70%
core/images/list-item.png0.19KB0.20KB0.00%