78% media-license

Code Review | Media License

WordPress plugin Media License scored78%from 54 tests.

About plugin

  • Plugin page: media-license
  • Plugin version: 1.6.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Oct 11, 2016
  • Latest release: Mar 6, 2023
  • Number of updates: 33
  • Update frequency: every 71.2 days
  • Top authors: EdwardBock (96.97%)Octavius.rocks (6.06%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,982 total downloads

Benchmarks

Plugin footprint 83% from 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.17MB] [CPU: ▲0.86ms] Passed 4 tests

This is a short check of server-side resources used by Media License
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.1942.07 ▼1.04
Dashboard /wp-admin3.55 ▲0.2051.51 ▲4.16
Posts /wp-admin/edit.php3.60 ▲0.2053.57 ▲3.19
Add New Post /wp-admin/post-new.php6.07 ▲0.1490.28 ▼2.80
Media Library /wp-admin/upload.php3.41 ▲0.1441.01 ▲4.10

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 39 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Media License
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲3314.63 ▲0.282.03 ▲0.1140.28 ▼7.40
Dashboard /wp-admin2,198 ▲185.57 ▼0.1186.21 ▼1.0638.11 ▼5.80
Posts /wp-admin/edit.php2,100 ▼01.98 ▲0.0238.74 ▲5.2535.17 ▼0.89
Add New Post /wp-admin/post-new.php1,532 ▲323.59 ▼0.04677.04 ▲11.4252.29 ▼0.20
Media Library /wp-admin/upload.php1,403 ▼04.14 ▼0.0698.05 ▼3.3844.29 ▲1.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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% 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)
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
Almost there! Just fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/media-license/templates/blockx__media-license--list-of-licenses__editor.php
    • > /wp-content/plugins/media-license/templates/blockx__media-license--list-of-licenses.php
  • 13× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/media-license/templates/blockx__media-license--list-of-licenses.php on line 12
    • > PHP Notice
      Undefined variable: content in wp-content/plugins/media-license/templates/blockx__media-license--list-of-licenses__editor.php on line 12
    • > PHP Fatal error
      Uncaught Error: Class 'Palasthotel\\WordPress\\Headless\\Extensions\\AbsPostExtensionPost' not found in wp-content/plugins/media-license/classes/Headless/FeaturedMedia.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Palasthotel\\WordPress\\BlockX\\Blocks\\_BlockType' not found in wp-content/plugins/media-license/classes/BlockX/ListOfLicenses.php:14
    • > PHP Notice
      Undefined variable: media_license_author in wp-content/plugins/media-license/templates/media-license-caption.tpl.php on line 27
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/media-license/templates/blockx__media-license--list-of-licenses__editor.php on line 12
    • > PHP Notice
      Trying to get property 'captions' of non-object in wp-content/plugins/media-license/templates/blockx__media-license--list-of-licenses__editor.php on line 12
    • > PHP Notice
      Undefined variable: license in wp-content/plugins/media-license/templates/media-license-caption.tpl.php on line 48
    • > PHP Notice
      Undefined variable: content in wp-content/plugins/media-license/templates/blockx__media-license--list-of-licenses.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to a member function hasLicensePath() on null in wp-content/plugins/media-license/templates/media-license-caption.tpl.php:48

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 96% from 29 tests

readme.txt Passed 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
3 plugin tags: extension, license, media

media-license/media-license.php 92% from 13 tests

The main PHP script in "Media License" version 1.6.1 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.0" instead of "4.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected1,160 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP24281524971
JavaScript23534130
PO File1181859

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity6.94
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.27
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods77
▷ Static methods67.79%
▷ Public methods7597.40%
▷ Protected methods00.00%
▷ Private methods22.60%
Functions5
▷ Named functions360.00%
▷ Anonymous functions240.00%
Constants21
▷ Global constants00.00%
▷ Class constants21100.00%
▷ Public constants21100.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
There were not PNG files found in your plugin