79% media-credit

Code Review | Media Credit

WordPress plugin Media Credit scored79%from 54 tests.

About plugin

  • Plugin page: media-credit
  • Plugin version: 4.3.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.2
  • WordPress version: 6.3.1
  • First release: Mar 5, 2010
  • Latest release: Apr 1, 2023
  • Number of updates: 306
  • Update frequency: every 15.6 days
  • Top authors: pputzer (84.31%)sbressler (16.01%)

Code review

54 tests

User reviews

19 reviews

Install metrics

1,000+ active /54,604 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
Install script ran successfully

Server metrics [RAM: ▲0.25MB] [CPU: ▼1.54ms] Passed 4 tests

An overview of server-side resources used by Media Credit
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2336.34 ▼6.40
Dashboard /wp-admin3.57 ▲0.2652.82 ▼0.97
Posts /wp-admin/edit.php3.62 ▲0.2651.44 ▲2.77
Add New Post /wp-admin/post-new.php6.18 ▲0.2997.56 ▲0.11
Media Library /wp-admin/upload.php3.49 ▲0.2638.30 ▲1.10

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 105 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
media_credit_settings
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Media Credit: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲3014.34 ▼0.211.82 ▲0.0640.04 ▼7.89
Dashboard /wp-admin2,198 ▲245.61 ▲0.1090.99 ▼9.8741.84 ▼4.41
Posts /wp-admin/edit.php2,097 ▼32.02 ▲0.0539.13 ▲0.6334.06 ▲1.67
Add New Post /wp-admin/post-new.php1,549 ▲2123.68 ▲0.68617.49 ▼82.4436.10 ▼27.62
Media Library /wp-admin/upload.php1,427 ▲245.17 ▲0.98108.06 ▲6.0841.27 ▼3.02

Uninstaller [IO: ▲0.00MB] [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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/media-credit/public/partials/author-media.php
  • 44× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/media-credit/admin/partials/settings/preview.php:46
    • > PHP Fatal error
      Uncaught Error: Interface 'Media_Credit\\Component' not found in wp-content/plugins/media-credit/includes/media-credit/components/class-frontend.php:42
    • > PHP Fatal error
      Uncaught Error: Class 'Media_Credit\\Vendor\\Dice\\Dice' not found in wp-content/plugins/media-credit/includes/media-credit/class-factory.php:50
    • > PHP Notice
      Undefined variable: html5 in wp-content/plugins/media-credit/public/partials/media-credit-shortcode.php on line 75
    • > PHP Fatal error
      Uncaught Error: Class 'Media_Credit\\Vendor\\Mundschenk\\UI\\Controls\\Input' not found in wp-content/plugins/media-credit/vendor-scoped/mundschenk-at/wp-settings-ui/src/ui/controls/class-submit-input.php:34
    • > PHP Fatal error
      Uncaught Error: Interface 'Media_Credit\\Component' not found in wp-content/plugins/media-credit/includes/media-credit/components/class-block-editor.php:40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses() in wp-content/plugins/media-credit/vendor-scoped/mundschenk-at/check-wp-requirements/partials/requirements-error-notice.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/media-credit/admin/partials/media-credit-attachment-details-tmpl.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Media_Credit\\Component' not found in wp-content/plugins/media-credit/includes/media-credit/components/class-rest-api.php:43
    • > PHP Fatal error
      Uncaught Error: Interface 'Media_Credit\\Component' not found in wp-content/plugins/media-credit/includes/media-credit/components/class-uninstallation.php:36

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)
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: image, media, credit, byline, images...

media-credit/media-credit.php Passed 13 tests

This is the main PHP file of "Media Credit" version 4.3.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
134 characters long description:
This plugin adds a "Credit" field to the media uploading and editing tool and inserts this credit when the images appear on your blog.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected6,050 lines of code in 98 files:
LanguageFilesBlank linesComment linesLines of code
PHP627755,5983,564
JavaScript163775071,451
Markdown63230872
CSS14147163

PHP code Passed 2 tests

An overview 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.36
Average class complexity9.61
▷ Minimum class complexity1.00
▷ Maximum class complexity73.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces12
Interfaces2
Traits0
Classes44
▷ Abstract classes49.09%
▷ Concrete classes4090.91%
▷ Final classes00.00%
Methods280
▷ Static methods258.93%
▷ Public methods21376.07%
▷ Protected methods6021.43%
▷ Private methods72.50%
Functions26
▷ Named functions1350.00%
▷ Anonymous functions1350.00%
Constants47
▷ Global constants48.51%
▷ Class constants4391.49%
▷ Public constants43100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected