78% easy-stock-featured-image

Code Review | Easy Stock Featured Image

WordPress plugin Easy Stock Featured Image scored78%from 54 tests.

About plugin

  • Plugin page: easy-stock-featur...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-5.9.0
  • WordPress version: 6.3.1
  • First release: Jun 13, 2020
  • Latest release: Feb 12, 2022
  • Number of updates: 4
  • Update frequency: every 152.5 days
  • Top authors: dcangulo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /580 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.04MB] [CPU: ▼5.16ms] Passed 4 tests

This is a short check of server-side resources used by Easy Stock Featured Image
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0435.30 ▼4.68
Dashboard /wp-admin3.34 ▲0.0442.86 ▼9.71
Posts /wp-admin/edit.php3.39 ▲0.0448.76 ▲2.78
Add New Post /wp-admin/post-new.php5.94 ▲0.0587.69 ▼1.88
Media Library /wp-admin/upload.php3.26 ▲0.0331.56 ▼4.38
Easy Stock Featured Image /wp-admin/options-general.php?page=esfi_plugin_settings3.2431.99

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Easy Stock Featured Image
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲7713.30 ▼1.281.65 ▼0.1340.99 ▼3.07
Dashboard /wp-admin2,226 ▲385.81 ▲0.91106.36 ▲1.6337.90 ▼6.93
Posts /wp-admin/edit.php2,112 ▲202.16 ▲0.1741.24 ▲2.1237.15 ▲2.48
Add New Post /wp-admin/post-new.php1,551 ▲3223.04 ▼0.05661.08 ▲58.4659.45 ▲11.24
Media Library /wp-admin/upload.php1,408 ▲204.24 ▲0.0299.96 ▼0.7345.96 ▲1.21
Easy Stock Featured Image /wp-admin/options-general.php?page=esfi_plugin_settings9491.8127.6730.44

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_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/easy-stock-featured-image/views/esfi_notice.php
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/easy-stock-featured-image/views/esfi_settings.php:5
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/image.php' (include_path='.:/usr/share/php') in wp-content/plugins/easy-stock-featured-image/index.php on line 26
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/image.php): failed to open stream: No such file or directory in wp-content/plugins/easy-stock-featured-image/index.php on line 26
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/easy-stock-featured-image/index.php on line 26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/easy-stock-featured-image/constants.php:4

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: thumbnails, thumbnail, stock photos, featured image, stock

easy-stock-featured-image/index.php 92% from 13 tests

"Easy Stock Featured Image" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("easy-stock-featured-image.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected233 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP52722168
JavaScript113041
Markdown19024

PHP code Passed 2 tests

This is a short overview 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.21
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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 were not PNG files found in your plugin