78% require-featured-image

Code Review | Require Featured Image

WordPress plugin Require Featured Image scored78%from 54 tests.

About plugin

  • Plugin page: require-featured-...
  • Plugin version: 1.5.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.3.1
  • WordPress version: 6.3.1
  • First release: Aug 2, 2013
  • Latest release: Dec 18, 2019
  • Number of updates: 72
  • Update frequency: every 32.4 days
  • Top authors: pressupinc (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

6,000+ active /87,963 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

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

Analyzing server-side resources used by Require Featured Image
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0044.86 ▲2.39
Dashboard /wp-admin3.32 ▲0.0249.36 ▼8.27
Posts /wp-admin/edit.php3.37 ▲0.0154.98 ▲5.05
Add New Post /wp-admin/post-new.php5.45 ▼0.4480.78 ▼38.92
Media Library /wp-admin/upload.php3.24 ▲0.0134.74 ▼2.56
Req Featured Image /wp-admin/options-general.php?page=rfi3.1932.86

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 21 new files
Database: no new tables, 8 new options
New WordPress options
rfi_post_types
rfi_enforcement_start
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Require Featured Image
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.70 ▲0.461.91 ▲0.2043.76 ▲1.23
Dashboard /wp-admin2,199 ▲315.66 ▲0.0899.95 ▼13.7144.17 ▼6.41
Posts /wp-admin/edit.php2,107 ▲72.00 ▲0.0541.76 ▲2.7037.25 ▼0.12
Add New Post /wp-admin/post-new.php1,545 ▲1117.94 ▼0.44616.05 ▼82.2870.70 ▼3.52
Media Library /wp-admin/upload.php1,404 ▲44.26 ▲0.10101.23 ▼8.2742.92 ▼5.47
Req Featured Image /wp-admin/options-general.php?page=rfi8492.0023.9729.99

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
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • db_upgraded
    • rfi_enforcement_start
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • rfi_post_types

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=rfi
    • > Notice in wp-content/plugins/require-featured-image/admin-options.php+90
    Trying to access array offset on value of type bool

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
Please fix the following
  • 2× 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/require-featured-image/admin-options.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/require-featured-image/admin-options.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
  • Screenshots: These screenshots do not have images: #1 (The warning that you see when editing a post that doesn't have a featured image set. The "Publish" button is also disabled.), #2 (The settings page, which lets you specify which post types the plugin should operate on.)
You can take inspiration from this readme.txt

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

Analyzing the main PHP file in "Require Featured Image" version 1.5.0
97 characters long description:
Like it says on the tin: requires posts to have a featured image set before they'll be published.

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 plugin294 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP23131187
JavaScript114378
JSON11029

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
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%
Functions20
▷ Named functions20100.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
2 PNG files occupy 0.13MB with 0.09MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png67.85KB20.57KB▼ 69.68%
screenshot-2.png67.52KB19.26KB▼ 71.48%