83% banner-image-for-post-and-page

Code Review | Banner Image for post and page

WordPress plugin Banner Image for post and page scored83%from 54 tests.

About plugin

  • Plugin page: banner-image-for-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.6
  • WordPress version: 6.3.1
  • First release: Apr 20, 2018
  • Latest release: Jan 1, 2021
  • Number of updates: 5
  • Update frequency: every 197.6 days
  • Top authors: logicrays (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,033 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.44ms] Passed 4 tests

A check of server-side resources used by Banner Image for post and page
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.45 ▼3.56
Dashboard /wp-admin3.31 ▲0.0053.20 ▲2.71
Posts /wp-admin/edit.php3.36 ▲0.0051.85 ▼3.55
Add New Post /wp-admin/post-new.php5.89 ▲0.0190.50 ▼6.09
Media Library /wp-admin/upload.php3.23 ▲0.0040.16 ▼0.57

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Banner Image for post and page
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.48 ▼0.111.71 ▲0.0242.22 ▼4.42
Dashboard /wp-admin2,203 ▲125.81 ▲0.93103.77 ▼3.4043.20 ▲1.50
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0437.98 ▼3.0934.58 ▼1.18
Add New Post /wp-admin/post-new.php6,233 ▲4,71426.25 ▲3.11939.97 ▲248.8456.67 ▲0.27
Media Library /wp-admin/upload.php1,388 ▼04.22 ▲0.03114.42 ▼0.9146.99 ▼0.68

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/banner-image-for-post-and-page/banner_image.php:43

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Stable tag: Empty value
  • Donate link: Please fix this invalid url: ""
You can look at the official readme.txt

banner-image-for-post-and-page/banner_image.php 85% from 13 tests

"Banner Image for post and page" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 146 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("banner-image-for-post-and-page.php" instead of "banner_image.php")

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
Success! There were no dangerous files found in this plugin50 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP121850

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
There were not PNG files found in your plugin