94% autoset-featured-image

Code Review | Autoset Featured Image

WordPress plugin Autoset Featured Image scored 94% from 54 tests.

About plugin

  • Plugin page: autoset-featured-...
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.9.1
  • WordPress version: 5.8.1
  • First release: Feb 2, 2014
  • Latest release: Jun 13, 2014
  • Number of updates: 31
  • Update frequency: every 4.2 days
  • Top authors: eflyjason (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

3,000+ active / 49,219 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.33MB] [CPU: ▼153.22ms] Passed 4 tests

A check of server-side resources used by Autoset Featured Image
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1346.54 ▲23.97
Dashboard /wp-admin3.07 ▲0.0249.81 ▲3.30
Posts /wp-admin/edit.php3.16 ▲0.0544.27 ▼8.70
Add New Post /wp-admin/post-new.php4.05 ▼1.3849.38 ▼609.25
Media Library /wp-admin/upload.php3.01 ▲0.0135.78 ▲1.78

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Autoset Featured Image
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10716.23 ▲0.347.96 ▲0.4152.18 ▼2.30
Dashboard /wp-admin2,973 ▲365.91 ▼0.04141.44 ▼6.22119.32 ▼3.41
Posts /wp-admin/edit.php2,739 ▼02.69 ▼0.0168.52 ▼2.78100.93 ▲7.58
Add New Post /wp-admin/post-new.php1,683 ▼018.80 ▼0.00393.17 ▼0.94113.91 ▼2.58
Media Library /wp-admin/upload.php1,807 ▼05.03 ▲0.02157.47 ▲1.51125.17 ▼1.38

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/autoset-featured-image/autoset-featured-image.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
1 plugin tags: featured image

autoset-featured-image/autoset-featured-image.php Passed 13 tests

Analyzing the main PHP file in "Autoset Featured Image" version 1.2.2
56 characters long description:
Auto Set the first image of your post to Featured Image.

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
There were no executable files found in this plugin25 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1102125

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin