84% enforce-featured-image

Code Review | Enforce Featured Image

WordPress plugin Enforce Featured Image scored84%from 54 tests.

About plugin

  • Plugin page: enforce-featured-...
  • Plugin version: 0.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.7
  • WordPress version: 6.3.1
  • First release: Dec 23, 2016
  • Latest release: Dec 23, 2016
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: alex-ye (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /629 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼7.08ms] Passed 4 tests

Analyzing server-side resources used by Enforce Featured Image
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0334.22 ▼8.25
Dashboard /wp-admin3.34 ▲0.0343.23 ▼9.59
Posts /wp-admin/edit.php3.39 ▲0.0346.11 ▼0.75
Add New Post /wp-admin/post-new.php5.92 ▲0.0380.28 ▼9.73
Media Library /wp-admin/upload.php3.26 ▲0.0334.09 ▼0.41

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Enforce Featured Image
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.21 ▼1.191.69 ▲0.0142.79 ▼5.72
Dashboard /wp-admin2,200 ▲125.81 ▲0.91104.40 ▼13.1139.88 ▼6.50
Posts /wp-admin/edit.php2,089 ▲32.00 ▼0.0040.60 ▲2.1833.43 ▲0.80
Add New Post /wp-admin/post-new.php1,534 ▼823.23 ▲5.03678.23 ▲39.5551.33 ▼8.76
Media Library /wp-admin/upload.php1,391 ▲64.21 ▼0.0199.82 ▼2.2143.67 ▼3.52

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
Please fix the following
  • 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/enforce-featured-image/enforce-featured-image.php:33

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: featured image, image, admin, post thumbnail, featured

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

The principal PHP file in "Enforce Featured Image" v. 0.1.3 is loaded by WordPress automatically on each request
102 characters long description:
Enforce certain post types to be published with a featured image with certain dimensions if specified.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin187 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP14293142
PO File128265345

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity36.00
▷ Minimum class complexity36.00
▷ Maximum class complexity36.00
Average method complexity4.50
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods330.00%
▷ Public methods880.00%
▷ Protected methods00.00%
▷ Private methods220.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

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin