78% featured-image-for-pressbooks

Code Review | Feature image for PressBooks

WordPress plugin Feature image for PressBooks scored 78% from 54 tests.

About plugin

  • Plugin page: featured-image-fo...
  • Plugin version: 0.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2.2
  • WordPress version: 6.3.1
  • First release: Dec 11, 2019
  • Latest release: Dec 11, 2019
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: colomet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 615 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.17MB] [CPU: ▼12.44ms] Passed 4 tests

Analyzing server-side resources used by Feature image for PressBooks
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.10 ▼3.53
Dashboard /wp-admin3.33 ▲0.0244.27 ▼0.41
Posts /wp-admin/edit.php3.38 ▲0.0246.54 ▲5.23
Add New Post /wp-admin/post-new.php5.16 ▼0.7361.82 ▼44.70
Media Library /wp-admin/upload.php3.22 ▼0.0132.66 ▼1.12

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Feature image for PressBooks
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.29 ▼0.684.53 ▲2.8145.34 ▲0.61
Dashboard /wp-admin2,209 ▲174.85 ▼0.0797.12 ▼9.0437.39 ▼2.03
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0344.83 ▲2.2034.38 ▼1.58
Add New Post /wp-admin/post-new.php1,514 ▼1917.66 ▼5.69680.45 ▲83.2348.31 ▼6.69
Media Library /wp-admin/upload.php1,388 ▼34.19 ▼0.0197.02 ▼3.3245.74 ▼0.58

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/featured-image-for-pressbooks/fifp-admin-settings.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/featured-image-for-pressbooks/featured-image-for-pressbooks.php:37

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
7 plugin tags: images, feature-image, pressbooks, multisite, wordpress plugin...

featured-image-for-pressbooks/featured-image-for-pressbooks.php 85% from 13 tests

Analyzing the main PHP file in "Feature image for PressBooks" version 0.8
You should first fix the following items:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Description: Please don't use more than 140 characters for the plugin description (currently 166 characters long)

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
No dangerous file extensions were detected368 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3104243368

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
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%
Functions22
▷ Named functions2195.45%
▷ Anonymous functions14.55%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected