84% smart-featured-image

Code Review | Smart Featured Image

WordPress plugin Smart Featured Image scored84%from 54 tests.

About plugin

  • Plugin page: smart-featured-image
  • Plugin version: 0.2.4
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8
  • WordPress version: 6.3.1
  • First release: Jun 8, 2017
  • Latest release: Aug 29, 2017
  • Number of updates: 21
  • Update frequency: every 3.9 days
  • Top authors: grottopress (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,068 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: ▼9.43ms] Passed 4 tests

A check of server-side resources used by Smart Featured Image
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.03 ▼5.56
Dashboard /wp-admin3.31 ▼0.0448.48 ▼13.58
Posts /wp-admin/edit.php3.36 ▲0.0046.76 ▼0.47
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.05 ▼16.00
Media Library /wp-admin/upload.php3.23 ▲0.0032.59 ▼2.57

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 135 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Smart Featured Image
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.25 ▼1.134.76 ▲2.8950.62 ▲5.48
Dashboard /wp-admin2,203 ▲184.83 ▼0.08111.00 ▲5.8943.25 ▼1.07
Posts /wp-admin/edit.php2,092 ▲31.96 ▼0.0540.64 ▲0.6936.20 ▼0.36
Add New Post /wp-admin/post-new.php1,533 ▼423.12 ▲0.17647.56 ▲31.6160.80 ▲10.30
Media Library /wp-admin/upload.php1,385 ▼34.24 ▲0.0695.86 ▼2.0641.33 ▼2.20

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
  • 101× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/smart-featured-image/vendor/composer/installers/tests/Composer/Installers/Test/VgmcpInstallerTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/smart-featured-image/vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\Test\\TestCase' not found in wp-content/plugins/smart-featured-image/vendor/composer/installers/tests/Composer/Installers/Test/InstallerTest.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Composer\\Plugin\\PluginInterface' not found in wp-content/plugins/smart-featured-image/vendor/composer/installers/src/Composer/Installers/Plugin.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/smart-featured-image/vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/smart-featured-image/vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/smart-featured-image/vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/smart-featured-image/vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/smart-featured-image/vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/smart-featured-image/vendor/composer/installers/tests/Composer/Installers/Test/MediaWikiInstallerTest.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Donate link: Invalid url: ""
The official readme.txt might help

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

The main PHP file in "Smart Featured Image" ver. 0.2.4 adds more information about the plugin and also serves as the entry point for this plugin
139 characters long description:
Automagically add featured image to posts using images inserted into post content. Displays a configurable default image if no image found.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin4,172 lines of code in 126 files:
LanguageFilesBlank linesComment linesLines of code
PHP1166171,0723,585
Markdown4650283
JSON300255
YAML27026
XML12023

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity2.27
▷ Minimum class complexity1.00
▷ Maximum class complexity40.00
Average method complexity1.86
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes105
▷ Abstract classes21.90%
▷ Concrete classes10398.10%
▷ Final classes00.00%
Methods158
▷ Static methods42.53%
▷ Public methods12075.95%
▷ Protected methods3320.89%
▷ Private methods53.16%
Functions32
▷ Named functions2268.75%
▷ Anonymous functions1031.25%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin