72% post-featured-image-generator

Code Review | Post Featured Image Generator

WordPress plugin Post Featured Image Generator scored 72% from 53 tests.

About plugin

  • Plugin page: post-featured-ima...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-3.7.1
  • WordPress version: 5.8.1
  • First release: Dec 23, 2013
  • Latest release: Dec 23, 2013
  • Number of updates: 3
  • Update frequency: every 0.7 days
  • Top authors: belfisher (100%)

Code review

53 tests

User reviews

6 reviews

Install metrics

100+ active / 5,011 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.32MB] [CPU: ▼257.75ms] Passed 4 tests

An overview of server-side resources used by Post Featured Image Generator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.15 ▲0.4341.12 ▲21.50
Dashboard /wp-admin3.38 ▲0.3338.35 ▼7.61
Posts /wp-admin/edit.php3.43 ▲0.3245.43 ▲4.83
Add New Post /wp-admin/post-new.php5.74 ▲0.3192.94 ▼1,025.17
Media Library /wp-admin/upload.php3.32 ▲0.3230.88 ▼3.03
Featured Image Generator /wp-admin/options-general.php?page=fig3.1426.18

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 81 new files
Database: no new tables, 11 new options
New WordPress options
fig_video_min_width
featured_image_generator_installed
fig_priority_size
fig_priority_content
fig_types
fig_image_min_width
fig_video_enabled
fig_video_min_height
fig_image_enabled
fig_image_min_height
...

Browser metrics Passed 4 tests

Post Featured Image Generator: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,654 ▲7216.26 ▲0.697.57 ▼0.1046.71 ▲1.71
Dashboard /wp-admin2,935 ▲825.92 ▼0.12135.77 ▼2.66103.56 ▼1.84
Posts /wp-admin/edit.php2,711 ▲52.69 ▲0.0161.79 ▼4.5087.12 ▲0.99
Add New Post /wp-admin/post-new.php1,854 ▼18417.73 ▼1.35358.30 ▼12.13106.88 ▼2.50
Media Library /wp-admin/upload.php1,780 ▲85.03 ▲0.06148.20 ▲3.17110.21 ▼2.44
Featured Image Generator /wp-admin/options-general.php?page=fig1,3422.5657.4881.68

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 11 options
    • fig_video_min_height
    • fig_image_min_width
    • fig_video_enabled
    • fig_video_min_width
    • fig_types
    • fig_priority_content
    • fig_image_enabled
    • fig_image_min_height
    • featured_image_generator_installed
    • fig_priority_size
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=fig
    • > Notice in wp-content/plugins/post-featured-image-generator/library/SWL/View/Element/Form/Element.php+40
    Undefined variable: label
    • > GET request to /wp-admin/options-general.php?page=fig
    • > User deprecated in wp-includes/functions.php+5221
    screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=fig
    • > User deprecated in wp-includes/functions.php+5221
    get_screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=fig
    • > Notice in wp-content/plugins/post-featured-image-generator/library/SWL/View/Renderer/Form/Select.php+30
    Undefined index: checked

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 take a closer look at the following
  • 55× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      require_once(SWL/View/Renderer/Form/Checkbox.php): failed to open stream: No such file or directory in wp-content/plugins/post-featured-image-generator/library/SWL/View/Renderer/Form/Boolean.php on line 14
    • > PHP Warning
      require_once(View/Element.php): failed to open stream: No such file or directory in wp-content/plugins/post-featured-image-generator/library/SWL/Form/Form.php on line 14
    • > PHP Fatal error
      require_once(): Failed opening required 'SWL/Action/Manager.php' (include_path='.:/usr/share/php') in wp-content/plugins/post-featured-image-generator/library/SWL/Plugin/Plugin.php on line 14
    • > PHP Warning
      require_once(SWL/View/Element/Form/Element.php): failed to open stream: No such file or directory in wp-content/plugins/post-featured-image-generator/library/SWL/View/Element/Form/Checkbox.php on line 14
    • > PHP Fatal error
      require_once(): Failed opening required 'SWL/View/Element/Form/Element.php' (include_path='.:/usr/share/php') in wp-content/plugins/post-featured-image-generator/library/SWL/View/Element/Form/Select.php on line 14
    • > PHP Warning
      require_once(SWL/View/Element/Container.php): failed to open stream: No such file or directory in wp-content/plugins/post-featured-image-generator/library/SWL/View/Element/Form.php on line 14
    • > PHP Warning
      require_once(SWL/Page/Admin/Page.php): failed to open stream: No such file or directory in wp-content/plugins/post-featured-image-generator/library/FIG/Page/Admin/Batch.php on line 3
    • > PHP Warning
      require_once(SWL/View/Element/Form/Element.php): failed to open stream: No such file or directory in wp-content/plugins/post-featured-image-generator/library/SWL/View/Element/Form/Select.php on line 14
    • > PHP Fatal error
      require_once(): Failed opening required 'SWL/View/Decorator.php' (include_path='.:/usr/share/php') in wp-content/plugins/post-featured-image-generator/library/SWL/View/Decorator/Tag.php on line 14
    • > PHP Fatal error
      require_once(): Failed opening required 'View/Element.php' (include_path='.:/usr/share/php') in wp-content/plugins/post-featured-image-generator/library/SWL/Metabox/Metabox.php on line 14

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=fig
    • > Network (severe)
    wp-content/plugins/post-featured-image-generator/library/SWL/SWL/assets/css/admin/page/page.css?ver=5.8.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=fig
    • > Network (severe)
    wp-content/plugins/post-featured-image-generator/library/SWL/SWL/assets/css/admin/page/settings.css?ver=5.8.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === post-featured-image-generator === )
You can look at the official readme.txt

post-featured-image-generator/post-featured-image-generator.php Passed 13 tests

The principal PHP file in "Post Featured Image Generator" v. 1.0.0 is loaded by WordPress automatically on each request
46 characters long description:
Parse post content and generate featured image

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected3,294 lines of code in 80 files:
LanguageFilesBlank linesComment linesLines of code
PHP725531,3632,038
CSS758611,192
JavaScript17064

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity4.32
▷ Minimum class complexity1.00
▷ Maximum class complexity60.00
Average method complexity2.09
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes70
▷ Abstract classes68.57%
▷ Concrete classes6491.43%
▷ Final classes00.00%
Methods220
▷ Static methods31.36%
▷ Public methods18985.91%
▷ Protected methods2913.18%
▷ Private methods20.91%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

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