10% set-featured-attachment

Code Review | Set Featured Attachment

WordPress plugin Set Featured Attachment scored10%from 54 tests.

About plugin

  • Plugin page: set-featured-atta...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5.1-3.9
  • WordPress version: 6.3.1
  • First release: Jun 23, 2014
  • Latest release: Jul 5, 2014
  • Number of updates: 5
  • Update frequency: every 2.6 days
  • Top authors: arkapravamajumder (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /861 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/set-featured-attachment/set-featured-attachment.php+12
    Methods with the same name as their class will not be constructors in a future version of PHP; SFA has a deprecated constructor

Server metrics [RAM: ▼0.70MB] [CPU: ▼16.52ms] Passed 4 tests

An overview of server-side resources used by Set Featured Attachment
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.43 ▼0.0338.41 ▼0.69
Dashboard /wp-admin3.31 ▲0.0151.82 ▲6.16
Posts /wp-admin/edit.php3.37 ▲0.0147.83 ▼3.84
Add New Post /wp-admin/post-new.php3.10 ▼2.7936.59 ▼64.80
Media Library /wp-admin/upload.php3.24 ▲0.0137.50 ▲3.24

Server storage [IO: ▲0.01MB] [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: 3 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Set Featured Attachment
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.72 ▲0.622.39 ▲0.7245.30 ▲1.07
Dashboard /wp-admin2,198 ▲215.59 ▼0.0889.43 ▲1.1840.49 ▼3.13
Posts /wp-admin/edit.php2,097 ▼02.03 ▲0.0235.85 ▼1.8134.61 ▼0.92
Add New Post /wp-admin/post-new.php6,229 ▲4,70325.95 ▲2.50922.56 ▲257.3758.82 ▼0.29
Media Library /wp-admin/upload.php1,400 ▼34.18 ▲0.01105.97 ▲2.6647.13 ▲2.05

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 detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/set-featured-attachment/set-featured-attachment.php:15

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

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Screenshots: Screenshot #1 (Admin panel or back End Screenshot) image not found
The official readme.txt is a good inspiration

set-featured-attachment/set-featured-attachment.php Passed 13 tests

Analyzing the main PHP file in "Set Featured Attachment" version 1.0
93 characters long description:
This plugin will create "set featured attachment" like "set featured image on post and page".

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected85 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP151685

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity3.17
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.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
There are no PNG files in this plugin