83% setup-default-feature-image

Code Review | Setup Default Featured Image

WordPress plugin Setup Default Featured Image scored83%from 54 tests.

About plugin

  • Plugin page: setup-default-fea...
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.2
  • WordPress version: 6.3.1
  • First release: Aug 30, 2022
  • Latest release: May 26, 2023
  • Number of updates: 7
  • Update frequency: every 38.6 days
  • Top authors: gravitymaster97 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /242 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼0.34ms] Passed 4 tests

Analyzing server-side resources used by Setup Default Featured Image
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0938.88 ▼1.76
Dashboard /wp-admin3.41 ▲0.1152.36 ▲1.67
Posts /wp-admin/edit.php3.53 ▲0.1755.02 ▲11.31
Add New Post /wp-admin/post-new.php5.99 ▲0.1188.38 ▼4.57
Media Library /wp-admin/upload.php3.31 ▲0.0939.49 ▲3.31

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
wdfi_flake_image_type
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Setup Default Featured Image
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,949 ▲18814.63 ▲0.281.66 ▼0.0739.75 ▼5.97
Dashboard /wp-admin2,352 ▲1786.21 ▲0.62114.32 ▲20.1639.54 ▼0.51
Posts /wp-admin/edit.php2,283 ▲1803.51 ▲1.5554.84 ▲17.6834.38 ▼2.79
Add New Post /wp-admin/post-new.php1,546 ▲1723.23 ▲0.07646.66 ▲37.3636.71 ▼15.26
Media Library /wp-admin/upload.php1,417 ▲174.19 ▼0.0083.21 ▼18.9644.29 ▼4.37

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • wdfi_flake_image_type
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/setup-default-feature-image/includes/WDFI_Advaced.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/setup-default-feature-image/includes/WDFI_General.php:3

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 87% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention: The official readme.txt might help

setup-default-feature-image/default-feature-image.php 85% from 13 tests

"Setup Default Featured Image" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("setup-default-feature-image.php" instead of "default-feature-image.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin653 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP639118533
JavaScript131379
CSS10041

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity20.67
▷ Minimum class complexity13.00
▷ Maximum class complexity26.00
Average method complexity4.93
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.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
There are no PNG files in this plugin