84% multiple-featured-images

Code Review | Multiple Featured Images

WordPress plugin Multiple Featured Images scored 84% from 54 tests.

About plugin

  • Plugin page: multiple-featured...
  • Plugin version: 0.5.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.5
  • WordPress version: 6.3.1
  • First release: Apr 26, 2012
  • Latest release: Aug 20, 2020
  • Number of updates: 24
  • Update frequency: every 126.6 days
  • Top authors: marcus.kober (100%)

Code review

54 tests

User reviews

28 reviews

Install metrics

8,000+ active / 96,583 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼3.99ms] Passed 4 tests

A check of server-side resources used by Multiple Featured Images
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0840.35 ▲0.71
Dashboard /wp-admin3.38 ▲0.0847.13 ▼1.10
Posts /wp-admin/edit.php3.49 ▲0.1449.61 ▼3.51
Add New Post /wp-admin/post-new.php5.96 ▲0.0785.10 ▼8.09
Media Library /wp-admin/upload.php3.30 ▲0.0734.15 ▼3.25

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 19 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
widget_kdmfi_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
kdmfi_version
can_compress_scripts

Browser metrics Passed 4 tests

Multiple Featured Images: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲6713.27 ▼1.101.80 ▼0.0741.18 ▼1.05
Dashboard /wp-admin2,208 ▲235.89 ▲0.02108.92 ▲2.7338.96 ▼2.94
Posts /wp-admin/edit.php2,091 ▲22.05 ▲0.0238.98 ▼0.6633.40 ▼2.56
Add New Post /wp-admin/post-new.php1,530 ▲1623.24 ▲5.51666.02 ▼19.7351.78 ▼4.55
Media Library /wp-admin/upload.php1,390 ▲24.21 ▼0.0094.02 ▼2.3440.84 ▼6.34

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_kdmfi_widget
    • theysaidso_admin_options
    • kdmfi_version

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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/multiple-featured-images/Model/Kdmfi_Widget.php:6

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Admin meta box with multiple featured images.), #2 (Media uploader.), #3 (Multiple Featured Images Widget)
The official readme.txt is a good inspiration

multiple-featured-images/multiple-featured-images.php Passed 13 tests

This is the main PHP file of "Multiple Featured Images" version 0.5.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
108 characters long description:
Enables multiple featured images for all post types. Comes with a widget for displaying the featured images.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected557 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP6161228383
JavaScript22911117
PO File2101457

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity7.80
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity2.26
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods27
▷ Static methods311.11%
▷ Public methods2696.30%
▷ Protected methods00.00%
▷ Private methods13.70%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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.05MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png17.21KB9.46KB▼ 45.05%
screenshot-2.png28.82KB14.16KB▼ 50.85%
screenshot-3.png8.99KB5.19KB▼ 42.28%