68% dmca-badge

Code Review | DMCA Protection Badge

WordPress plugin DMCA Protection Badge scored 68% from 54 tests.

About plugin

  • Plugin page: dmca-badge
  • Plugin version: 2.1.60
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-6.2.2
  • WordPress version: 6.3.1
  • First release: Oct 1, 2011
  • Latest release: Jun 7, 2023
  • Number of updates: 125
  • Update frequency: every 34.1 days
  • Top authors: dmca (76%)tarasm (14.4%)NewClarity (11.2%)

Code review

54 tests

User reviews

19 reviews

Install metrics

3,000+ active / 135,576 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.28MB] [CPU: ▲1.55ms] Passed 4 tests

Server-side resources used by DMCA Protection Badge
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.261,282.06 ▲1,237.62
Dashboard /wp-admin3.59 ▲0.2949.42 ▲0.19
Posts /wp-admin/edit.php3.64 ▲0.2951.62 ▲5.82
Add New Post /wp-admin/post-new.php6.17 ▲0.2986.73 ▼9.54
Media Library /wp-admin/upload.php3.51 ▲0.2942.95 ▲9.75
DMCA Badge /wp-admin/options-general.php?page=dmca-badge-settings3.5236.37
DMCA Badge Reset /wp-admin/tools.php?page=dmca-badge-reset3.4235.20

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for DMCA Protection Badge
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲6613.38 ▼1.202.07 ▲0.2536.70 ▼14.01
Dashboard /wp-admin2,214 ▲235.85 ▲0.7795.34 ▼10.1238.61 ▼0.33
Posts /wp-admin/edit.php2,097 ▲52.01 ▲0.0238.80 ▼1.0235.24 ▼0.99
Add New Post /wp-admin/post-new.php1,540 ▲2622.92 ▲5.46677.78 ▼9.5856.15 ▲0.78
Media Library /wp-admin/upload.php1,393 ▲54.21 ▼0.02100.55 ▼0.8443.21 ▼2.61
DMCA Badge /wp-admin/options-general.php?page=dmca-badge-settings1,1225.06115.6160.92
DMCA Badge Reset /wp-admin/tools.php?page=dmca-badge-reset7872.0223.7126.69

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'DMCA_Badge_Plugin' does not have a method 'deactivate'
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_dmca_widget_badge
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

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
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/dmca-badge/libraries/dmca-api-client/dmca-api-client.php
  • 45× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/dmca-badge/classes/class-list-pages.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'RESTian_Client' not found in wp-content/plugins/dmca-badge/libraries/dmca-api-client/classes/class-api-client.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'RESTian_Parser_Base' not found in wp-content/plugins/dmca-badge/libraries/sidecar/restian/parsers/application-xml-parser.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/dmca-badge/classes/class-test-page.php:28
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/dmca-badge/classes/class-list-pages.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'RESTian_Parser_Base' not found in wp-content/plugins/dmca-badge/libraries/restian/parsers/text-csv-parser.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'RESTian_Parser_Base' not found in wp-content/plugins/dmca-badge/libraries/restian/parsers/application-serialized-php.php:6
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/dmca-badge/classes/class-list-pages.php on line 7
    • > PHP Notice
      Undefined index: HOME in wp-content/plugins/dmca-badge/libraries/dmca-api-client/tests/DMCA_API_ClientTest.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'RESTian_Parser_Base' not found in wp-content/plugins/dmca-badge/libraries/sidecar/restian/parsers/text-csv-parser.php:6

User-side errors Passed 1 test

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

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
8 plugin tags: badge, takedown, copyright, content theft, dmca...

dmca-badge/dmca-badge.php 92% from 13 tests

"DMCA Protection Badge" version 2.1.60's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 285 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin59,104 lines of code in 180 files:
LanguageFilesBlank linesComment linesLines of code
HTML9611,688031,717
PHP672,5465,93822,783
JavaScript51803472,026
CSS33272161,653
XML300748
Markdown5770170
JSON1007

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity73.39
▷ Minimum class complexity1.00
▷ Maximum class complexity617.00
Average method complexity7.52
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes62
▷ Abstract classes914.52%
▷ Concrete classes5385.48%
▷ Final classes11.89%
Methods688
▷ Static methods507.27%
▷ Public methods64794.04%
▷ Protected methods91.31%
▷ Private methods324.65%
Functions27
▷ Named functions27100.00%
▷ Anonymous functions00.00%
Constants19
▷ Global constants1894.74%
▷ Class constants15.26%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
36 PNG files occupy 1.46MB with 0.58MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
libraries/sidecar/restian/docs/api/resources/inherit.png0.15KB0.10KB▼ 29.61%
images/dmca-icon.png6.92KB3.35KB▼ 51.60%
libraries/sidecar/docs/api/resources/tree-vertical.png0.12KB0.08KB▼ 31.50%
libraries/sidecar/docs/api/resources/resize.png0.21KB0.10KB▼ 51.39%
libraries/sidecar/docs/api/resources/tree-last.png0.17KB0.11KB▼ 36.05%