94% lightweight-image-credits

Code Review | Lightweight Image Credits Plugin

WordPress plugin Lightweight Image Credits Plugin scored 94% from 54 tests.

About plugin

  • Plugin page: lightweight-image...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.4.1
  • WordPress version: 5.8.1
  • First release: Jan 28, 2016
  • Latest release: Jan 28, 2016
  • Number of updates: 9
  • Update frequency: N/A
  • Top authors: meinsw (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 677 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼148.09ms] Passed 4 tests

Server-side resources used by Lightweight Image Credits Plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.0124.52 ▲1.60
Dashboard /wp-admin3.07 ▲0.0131.30 ▼4.75
Posts /wp-admin/edit.php3.13 ▲0.0231.47 ▼0.02
Add New Post /wp-admin/post-new.php5.44 ▼0.0069.64 ▼586.63
Media Library /wp-admin/upload.php3.02 ▲0.0121.84 ▼0.95

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Lightweight Image Credits Plugin: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,666 ▲6515.94 ▲0.375.19 ▲0.0676.93 ▼0.60
Dashboard /wp-admin2,930 ▲376.18 ▲0.03114.67 ▼18.01169.56 ▼2.46
Posts /wp-admin/edit.php2,740 ▲33.23 ▲0.0062.72 ▼4.90134.50 ▼19.19
Add New Post /wp-admin/post-new.php3,859 ▲11818.80 ▲0.62416.76 ▼17.67168.12 ▲4.35
Media Library /wp-admin/upload.php1,749 ▼05.48 ▼0.04142.54 ▼5.85190.10 ▲2.34

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstall script ran successfully

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

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
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/lightweight-image-credits/lightweight-image-credits.php:57

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

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === lightweight-image-credits === )
Please take inspiration from this readme.txt

lightweight-image-credits/lightweight-image-credits.php Passed 13 tests

The main file in "Lightweight Image Credits Plugin" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
136 characters long description:
Will add a box to your backend edit pages to insert image credits. A shortcode will show all image credits, sorted by their origin site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected52 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1263552

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
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%
Constants0
▷ Global constants00.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