78% first-picture-as-featured-image

Code Review | First Picture as Featured Image

WordPress plugin First Picture as Featured Image scored78%from 54 tests.

About plugin

  • Plugin page: first-picture-as-...
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.0-4.9
  • WordPress version: 6.3.1
  • First release: Dec 9, 2017
  • Latest release: Dec 9, 2017
  • Number of updates: 7
  • Update frequency: N/A
  • Top authors: deblynprado (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,014 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

An overview of server-side resources used by First Picture as Featured Image
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.18 ▼6.07
Dashboard /wp-admin3.33 ▼0.0145.98 ▼12.13
Posts /wp-admin/edit.php3.38 ▲0.0346.96 ▼5.44
Add New Post /wp-admin/post-new.php5.91 ▲0.0389.79 ▲0.07
Media Library /wp-admin/upload.php3.25 ▲0.0332.22 ▲0.24
First Picture as Featured Image /wp-admin/tools.php?page=first_picture_as_featured_image3.1930.45

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

First Picture as Featured Image: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.26 ▼1.421.75 ▲0.0439.23 ▼7.65
Dashboard /wp-admin2,210 ▲254.87 ▼0.94108.75 ▲2.2741.60 ▼0.37
Posts /wp-admin/edit.php2,096 ▲72.01 ▲0.0140.48 ▲1.5236.50 ▼0.84
Add New Post /wp-admin/post-new.php1,545 ▲3118.42 ▲0.86606.44 ▼51.9652.35 ▼8.61
Media Library /wp-admin/upload.php1,392 ▲44.21 ▲0.0396.88 ▼4.8341.73 ▼3.61
First Picture as Featured Image /wp-admin/tools.php?page=first_picture_as_featured_image7942.0923.9025.56

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

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
These server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=first_picture_as_featured_image
    • > Notice in wp-content/plugins/first-picture-as-featured-image/admin/settings-page.php+38
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/tools.php?page=first_picture_as_featured_image
    • > Notice in wp-content/plugins/first-picture-as-featured-image/admin/settings-page.php+59
    Undefined index: settings-updated

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× 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/first-picture-as-featured-image/admin/settings-page.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 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
4 plugin tags: picture, image, picture as featured image, featured image

first-picture-as-featured-image/fpfi.php 77% from 13 tests

This is the main PHP file of "First Picture as Featured Image" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("first-picture-as-featured-image.php" instead of "fpfi.php")
  • Domain Path: The domain path folder was not found ("/languages")

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
Everything looks great! No dangerous files found in this plugin108 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP22423108

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.17
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%
Functions10
▷ Named functions10100.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
PNG images were not found in this plugin