84% better-image-credits

Code Review | Better Image Credits

WordPress plugin Better Image Credits scored84%from 54 tests.

About plugin

  • Plugin page: better-image-credits
  • Plugin version: 2.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.9
  • WordPress version: 6.3.1
  • First release: Dec 21, 2013
  • Latest release: Jan 21, 2020
  • Number of updates: 64
  • Update frequency: every 34.7 days
  • Top authors: cvedovini (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

400+ active /9,691 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

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

Server-side resources used by Better Image Credits
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.0941.97 ▼0.12
Dashboard /wp-admin3.52 ▲0.1947.60 ▼2.84
Posts /wp-admin/edit.php3.63 ▲0.2552.66 ▲0.94
Add New Post /wp-admin/post-new.php6.12 ▲0.2096.19 ▼2.30
Media Library /wp-admin/upload.php3.45 ▲0.1938.34 ▲2.18
Image Credits /wp-admin/options-general.php?page=image-credits3.4133.48

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: no files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget
widget_better-image-credits-widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Better Image Credits
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6013.29 ▼1.081.67 ▼0.0139.51 ▼2.70
Dashboard /wp-admin2,215 ▲304.87 ▼0.98108.99 ▲7.3641.54 ▼3.78
Posts /wp-admin/edit.php2,095 ▲62.13 ▲0.0838.93 ▼1.1835.13 ▼4.14
Add New Post /wp-admin/post-new.php1,533 ▲423.14 ▲4.84593.15 ▼30.4148.64 ▼4.18
Media Library /wp-admin/upload.php1,477 ▲894.56 ▲0.3998.43 ▲3.9441.56 ▼1.37
Image Credits /wp-admin/options-general.php?page=image-credits1,2728.94115.7873.82

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_better-image-credits-widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/better-image-credits/class-credits-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/better-image-credits/better-image-credits.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: image, credits, media

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

The entry point to "Better Image Credits" version 2.0.3 is a PHP file that has certain tags in its header comment area
129 characters long description:
Adds credits and link fields for media uploads along with a shortcode and various options to display image credits in your posts.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin1,521 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PO File8328352728
PHP313643679
JavaScript211081
CSS16033

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity26.67
▷ Minimum class complexity6.00
▷ Maximum class complexity47.00
Average method complexity2.83
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods42
▷ Static methods12.38%
▷ Public methods42100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.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