83% featured-image-for-custom-post-type

Code Review | featured-image-for-custom-post-type

WordPress plugin featured-image-for-custom-post-type scored83%from 54 tests.

About plugin

  • Plugin page: featured-image-fo...
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-5.9
  • WordPress version: 6.3.1
  • First release: Mar 11, 2022
  • Latest release: Mar 16, 2022
  • Number of updates: 5
  • Update frequency: every 1.0 days
  • Top authors: ala66077 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /301 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.33ms] Passed 4 tests

Server-side resources used by featured-image-for-custom-post-type
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.73 ▼2.61
Dashboard /wp-admin3.31 ▲0.0148.64 ▼4.26
Posts /wp-admin/edit.php3.37 ▲0.0154.53 ▲6.98
Add New Post /wp-admin/post-new.php5.90 ▲0.01104.47 ▲3.67
Media Library /wp-admin/upload.php3.24 ▲0.0134.54 ▼2.12

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for featured-image-for-custom-post-type
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.38 ▲0.091.57 ▼0.6341.95 ▼5.76
Dashboard /wp-admin2,192 ▲155.61 ▼0.0288.70 ▼11.3239.26 ▼2.90
Posts /wp-admin/edit.php2,103 ▲61.98 ▼0.0241.69 ▲5.3038.98 ▲2.01
Add New Post /wp-admin/post-new.php1,531 ▲523.04 ▲0.06651.38 ▼23.7655.97 ▲3.58
Media Library /wp-admin/upload.php1,400 ▼34.19 ▲0.0296.14 ▼12.9944.12 ▼1.50

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • 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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/featured-image-for-custom-post-type/featured-image-for-custom-post-type.php:23

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 is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed: The official readme.txt is a good inspiration

featured-image-for-custom-post-type/featured-image-for-custom-post-type.php 85% from 13 tests

"featured-image-for-custom-post-type" version 1.1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Requires at least: Required version must match the one declared in readme.txt ("5.2" instead of "5.9")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Good job! No executable or dangerous file extensions detected28 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1151428

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.12
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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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