62% mhr-custom-anti-copy

Code Review | MHR-Custom-Anti-Copy

WordPress plugin MHR-Custom-Anti-Copy scored62%from 54 tests.

About plugin

  • Plugin page: mhr-custom-anti-copy
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0-3.5.1
  • WordPress version: 6.3.1
  • First release: Apr 6, 2011
  • Latest release: Feb 18, 2013
  • Number of updates: 17
  • Update frequency: every 40.2 days
  • Top authors: mahadirz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

500+ active /17,292 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.94MB] [CPU: ▼37.63ms] Passed 4 tests

A check of server-side resources used by MHR-Custom-Anti-Copy
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.99 ▲2.05
Dashboard /wp-admin3.01 ▼0.3327.17 ▼37.06
Posts /wp-admin/edit.php3.01 ▼0.3428.40 ▼22.51
Add New Post /wp-admin/post-new.php3.01 ▼2.8723.32 ▼82.51
Media Library /wp-admin/upload.php3.01 ▼0.2123.94 ▼8.45

Server storage [IO: ▲0.12MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 10 new options
New WordPress options
can_compress_scripts
widget_recent-comments
MHR_set_all_select
widget_theysaidso_widget
MHR_msg
db_upgraded
widget_recent-posts
theysaidso_admin_options
MHR_disable_warning
MHR_set_all_rclick

Browser metrics Passed 4 tests

MHR-Custom-Anti-Copy: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲5913.21 ▼1.152.07 ▲0.3645.62 ▲0.84
Dashboard /wp-admin2,207 ▲154.85 ▼0.07115.82 ▲9.4342.54 ▼6.36
Posts /wp-admin/edit.php2,093 ▲11.99 ▼0.0338.02 ▼3.0432.36 ▼2.87
Add New Post /wp-admin/post-new.php1,517 ▲317.53 ▼0.02669.54 ▼38.6757.62 ▲2.61
Media Library /wp-admin/upload.php1,395 ▲74.32 ▲0.1599.58 ▼3.8646.10 ▲1.28
MHR-Custom-Anti-Copy /wp-admin/anti-copy.php260.440.1116.41

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however 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
Please fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/mhr-custom-anti-copy/mhrfunction.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/mhr-custom-anti-copy/anti-copy.php on line 26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/mhr-custom-anti-copy/anti-copy.php:26

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
    • > GET request to /wp-admin/anti-copy.php
    • > Network (severe)
    wp-admin/anti-copy.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Screenshots: Add an image for screenshot #1 (The setting page.)
The official readme.txt is a good inspiration

mhr-custom-anti-copy/anti-copy.php 92% from 13 tests

The main PHP file in "MHR-Custom-Anti-Copy" ver. 2.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("mhr-custom-anti-copy.php" instead of "anti-copy.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin211 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP34722211

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.08MB with 0.06MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png70.92KB18.92KB▼ 73.32%
visit.png15.01KB5.11KB▼ 65.93%