84% content-protection-and-disable-right-click

Code Review | Content Protection and Disable Right Click

WordPress plugin Content Protection and Disable Right Click scored 84% from 54 tests.

About plugin

  • Plugin page: content-protectio...
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.2.4
  • WordPress version: 6.3.1
  • First release: Dec 7, 2019
  • Latest release: Dec 7, 2019
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: getseofix (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active / 1,217 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.51ms] Passed 4 tests

This is a short check of server-side resources used by Content Protection and Disable Right Click
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.69 ▼2.71
Dashboard /wp-admin3.32 ▲0.0143.66 ▼2.33
Posts /wp-admin/edit.php3.37 ▲0.0148.86 ▲3.05
Add New Post /wp-admin/post-new.php5.90 ▲0.0192.34 ▼1.85
Media Library /wp-admin/upload.php3.24 ▲0.0134.92 ▲0.86

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, 9 new options
New WordPress options
Content_ProtectInputField4
widget_recent-posts
theysaidso_admin_options
Content_ProtectInputField3
widget_recent-comments
Content_ProtectInputField2
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Content Protection and Disable Right Click
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲2613.19 ▲0.001.69 ▲0.1141.35 ▲3.86
Dashboard /wp-admin2,221 ▲124.92 ▼0.9199.47 ▲4.1865.79 ▲27.18
Posts /wp-admin/edit.php2,110 ▲211.99 ▼0.0639.29 ▲2.6133.83 ▼0.30
Add New Post /wp-admin/post-new.php1,537 ▼522.93 ▲4.85716.43 ▲86.1047.38 ▼11.10
Media Library /wp-admin/upload.php1,397 ▲64.21 ▲0.0495.76 ▲0.0870.92 ▲29.13

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 did not uninstall successfully, leaving 9 options in the database
    • Content_ProtectInputField4
    • can_compress_scripts
    • Content_ProtectInputField3
    • widget_recent-posts
    • widget_theysaidso_widget
    • Content_ProtectInputField2
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_site_url() in wp-content/plugins/content-protection-and-disable-right-click/Settings.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: text selection, view source, copy paste, disable right click, content protection

content-protection-and-disable-right-click/ContentProtection-GSF.php 92% from 13 tests

Analyzing the main PHP file in "Content Protection and Disable Right Click" version 1.0
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("content-protection-and-disable-right-click.php" instead of "ContentProtection-GSF.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
No dangerous file extensions were detected186 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP27325186

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity1.57
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods228.57%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
6 PNG files occupy 0.61MB with 0.44MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
logo.png14.34KB2.65KB▼ 81.55%
screenicon.png5.21KB2.55KB▼ 50.97%
thumb.png9.53KB0.48KB▼ 94.96%
screenshot-2.png49.73KB16.68KB▼ 66.46%
screenshot-1.png512.54KB161.27KB▼ 68.54%