68% weltenretter-media-copyright

Code Review | Media Copyright

WordPress plugin Media Copyright scored68%from 54 tests.

About plugin

  • Plugin page: weltenretter-medi...
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0.3-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 2, 2022
  • Latest release: Jan 19, 2023
  • Number of updates: 21
  • Update frequency: every 2.7 days
  • Top authors: weltenretter (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /906 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲1.12MB] [CPU: ▲5.43ms] Passed 4 tests

An overview of server-side resources used by Media Copyright
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.61 ▲1.1543.87 ▲6.21
Dashboard /wp-admin5.62 ▲2.3261.42 ▲14.23
Posts /wp-admin/edit.php4.50 ▲1.1548.39 ▲3.65
Add New Post /wp-admin/post-new.php6.97 ▲1.0888.62 ▲3.00
Media Library /wp-admin/upload.php4.31 ▲1.0841.43 ▲8.85
Media-Copyright /wp-admin/tools.php?page=wr-media-copyright5.8248.98

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 933 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Media Copyright
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲3614.37 ▲0.021.69 ▲0.0839.30 ▼4.84
Dashboard /wp-admin2,203 ▲265.64 ▼0.0487.80 ▼2.1639.34 ▼2.28
Posts /wp-admin/edit.php2,104 ▲41.98 ▼0.1833.68 ▼2.0133.39 ▼3.99
Add New Post /wp-admin/post-new.php1,534 ▼123.12 ▲4.86689.10 ▲34.8863.45 ▼8.43
Media Library /wp-admin/upload.php1,407 ▲74.19 ▲0.0098.12 ▼1.2441.44 ▼2.99
Media-Copyright /wp-admin/tools.php?page=wr-media-copyright7812.0424.6128.56

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% 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
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/weltenretter-media-copyright/wrmc_imagecopyright.php
  • 409× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\VarDumper\\Caster\\ConstStub' not found in wp-content/plugins/weltenretter-media-copyright/vendor/symfony/var-dumper/Caster/LinkStub.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Hamcrest\\Description' not found in wp-content/plugins/weltenretter-media-copyright/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/BaseDescription.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\ode' not found in wp-content/plugins/weltenretter-media-copyright/vendor/twig/twig/src/Node/CheckSecurityCallNode.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\ode' not found in wp-content/plugins/weltenretter-media-copyright/vendor/twig/twig/src/Node/MacroNode.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Hamcrest\\AbstractMatcherTest' not found in wp-content/plugins/weltenretter-media-copyright/vendor/hamcrest/hamcrest-php/tests/Hamcrest/Text/StringContainsTest.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Hamcrest\\Core\\IsTypeOf' not found in wp-content/plugins/weltenretter-media-copyright/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Type/IsInteger.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\VarDumper\\Command\\Descriptor\\DumpDescriptorInterface' not found in wp-content/plugins/weltenretter-media-copyright/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Mockery\\Matcher\\MatcherAbstract' not found in wp-content/plugins/weltenretter-media-copyright/vendor/mockery/mockery/library/Mockery/Matcher/HasValue.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Hamcrest\\SelfDescribing' not found in wp-content/plugins/weltenretter-media-copyright/vendor/hamcrest/hamcrest-php/tests/Hamcrest/StringDescriptionTest.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Hamcrest\\BaseMatcher' not found in wp-content/plugins/weltenretter-media-copyright/vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest/Core/IsTypeOf.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
1 plugin tags: media copyright weltenretter

weltenretter-media-copyright/wrmc_imagecopyright.php 92% from 13 tests

Analyzing the main PHP file in "Media Copyright" version 1.0.2
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("weltenretter-media-copyright.php" instead of "wrmc_imagecopyright.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
It is important to fix the following items
  • For security reasons, never distribute binary or executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/weltenretter-media-copyright/vendor/bin/var-dump-server.bat
46,602 lines of code in 897 files:
LanguageFilesBlank linesComment linesLines of code
PHP8009,23415,02841,345
Markdown2463501,692
JSON15501,496
reStructuredText371,0371,3281,229
YAML9751368
Twig300206
CSS100130
XML516979
Python17015542
JavaScript10010
DOS Batch1005

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity6.47
▷ Minimum class complexity1.00
▷ Maximum class complexity318.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity73.00
Code structure
Namespaces93
Interfaces55
Traits4
Classes721
▷ Abstract classes273.74%
▷ Concrete classes69496.26%
▷ Final classes649.22%
Methods2,986
▷ Static methods47015.74%
▷ Public methods2,50683.92%
▷ Protected methods2588.64%
▷ Private methods2227.43%
Functions335
▷ Named functions26378.51%
▷ Anonymous functions7221.49%
Constants162
▷ Global constants2213.58%
▷ Class constants14086.42%
▷ Public constants11682.86%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin