72% image-and-media-byline-credits

Code Review | Image and Media Byline Credits

WordPress plugin Image and Media Byline Credits scored 72% from 54 tests.

About plugin

  • Plugin page: image-and-media-b...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6.0-5.4.1
  • WordPress version: 5.8.1
  • First release: Jun 3, 2020
  • Latest release: Jun 3, 2020
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: devbackroom (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 313 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
Installer ran successfully

Server metrics [RAM: ▼1.07MB] [CPU: ▼211.63ms] Passed 4 tests

A check of server-side resources used by Image and Media Byline Credits
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.54 ▼0.3011.36 ▼11.21
Dashboard /wp-admin2.59 ▼0.4817.14 ▼24.88
Posts /wp-admin/edit.php2.59 ▼0.5214.72 ▼21.29
Add New Post /wp-admin/post-new.php2.59 ▼2.8511.58 ▼789.13
Media Library /wp-admin/upload.php2.59 ▼0.4214.32 ▼10.58
Image Byline /wp-admin/tools.php?page=image_byline2.5915.63

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 27 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Image and Media Byline Credits: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,799 ▲19816.03 ▲0.377.59 ▲2.4076.21 ▼2.59
Dashboard /wp-admin2,944 ▲496.26 ▲0.10115.59 ▼17.48163.55 ▼4.84
Posts /wp-admin/edit.php2,755 ▲313.26 ▲0.0363.39 ▲0.39139.68 ▼1.23
Add New Post /wp-admin/post-new.php1,892 ▼1,85121.02 ▲1.90391.08 ▼43.00172.25 ▲14.92
Media Library /wp-admin/upload.php1,765 ▲165.57 ▲0.04137.83 ▼11.82181.72 ▼1.96
Image Byline /wp-admin/tools.php?page=image_byline1,1392.5857.95148.99

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5663
    WP_Block_Type_Registry::register was called incorrectly. Block type "core/image" is already registered. Please see Debugging in WordPress for more information. (This message was added in version 5.0.0.)

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=image_byline
    • > POST request to /wp-admin/admin-ajax.php
    • > User notice in wp-includes/functions.php+5663
    WP_Block_Type_Registry::register was called incorrectly. Block type "core/image" is already registered. Please see Debugging in WordPress for more information. (This message was added in version 5.0.0.)

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/image-and-media-byline-credits/public/partials/image-byline-public-display.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/image-and-media-byline-credits/admin/partials/image-byline-admin-display.php:19

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: There are too many tags (12 tag instead of maximum 10)
The official readme.txt is a good inspiration

image-and-media-byline-credits/image-byline.php 85% from 13 tests

"Image and Media Byline Credits" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("image-and-media-byline-credits.php" instead of "image-byline.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin626 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP12171572355
JavaScript42344194
CSS31142
PO File111235

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity3.71
▷ Minimum class complexity1.00
▷ Maximum class complexity13.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods38
▷ Static methods25.26%
▷ Public methods3386.84%
▷ Protected methods00.00%
▷ Private methods513.16%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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