83% default-featured-image

Code Review | Default featured image

WordPress plugin Default featured image scored83%from 54 tests.

About plugin

  • Plugin page: default-featured-...
  • Plugin version: 1.7.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.2
  • WordPress version: 6.3.1
  • First release: Dec 25, 2012
  • Latest release: Apr 7, 2023
  • Number of updates: 71
  • Update frequency: every 52.9 days
  • Top authors: janw.oostendorp (100%)

Code review

54 tests

User reviews

58 reviews

Install metrics

70,000+ active /374,069 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼9.50ms] Passed 4 tests

An overview of server-side resources used by Default featured image
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0535.36 ▼5.76
Dashboard /wp-admin3.36 ▲0.0143.41 ▼15.72
Posts /wp-admin/edit.php3.47 ▲0.1144.90 ▼0.83
Add New Post /wp-admin/post-new.php5.93 ▲0.0583.56 ▼15.37
Media Library /wp-admin/upload.php3.28 ▲0.0533.89 ▼1.14

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Default featured image: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.23 ▼1.141.72 ▼0.0741.18 ▼2.04
Dashboard /wp-admin2,206 ▲185.85 ▲0.9596.03 ▼21.5937.88 ▼7.57
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0240.51 ▲4.0635.23 ▲0.75
Add New Post /wp-admin/post-new.php1,533 ▲1423.02 ▼0.38650.62 ▼47.8065.98 ▲10.40
Media Library /wp-admin/upload.php1,382 ▼34.18 ▼0.0293.88 ▼11.7240.89 ▼5.25

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

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
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/default-featured-image/set-default-featured-image.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Plugin Name: Please specify the plugin name on the first line ( === default-featured-image === )
The official readme.txt might help

default-featured-image/set-default-featured-image.php 85% from 13 tests

The main PHP script in "Default featured image" version 1.7.3 is automatically included on every request by WordPress
You should first fix the following items:
  • Requires at least: Required version must match the one declared in readme.txt ("3.5" instead of "6.2")
  • Main file name: Name the main plugin file the same as the plugin slug ("default-featured-image.php" instead of "set-default-featured-image.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin267 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP344168178
JavaScript1162664
PO File16825

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity12.50
▷ Minimum class complexity5.00
▷ Maximum class complexity20.00
Average method complexity2.44
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes150.00%
Methods16
▷ Static methods531.25%
▷ Public methods1593.75%
▷ Protected methods00.00%
▷ Private methods16.25%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.69MB with 0.47MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
.wordpress-org/screenshot-2.png561.72KB170.92KB▼ 69.57%
.wordpress-org/screenshot-1.png139.91KB46.09KB▼ 67.06%