10% tg-copy-protection

Code Review | TG Copy Protection

WordPress plugin TG Copy Protection scored10%from 54 tests.

About plugin

  • Plugin page: tg-copy-protection
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.2.3
  • WordPress version: 6.3.1
  • First release: Aug 1, 2015
  • Latest release: Aug 1, 2015
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: ashokdhamija (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

500+ active /12,174 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/tg-copy-protection/tg-copy-protection.php+178
    Use of undefined constant tg_copy_protection_enq_script - assumed 'tg_copy_protection_enq_script' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.91MB] [CPU: ▼55.11ms] Passed 4 tests

Analyzing server-side resources used by TG Copy Protection
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.394.75 ▼33.52
Dashboard /wp-admin2.09 ▼1.215.64 ▼50.33
Posts /wp-admin/edit.php2.09 ▼1.265.99 ▼46.17
Add New Post /wp-admin/post-new.php2.09 ▼3.797.09 ▼90.41
Media Library /wp-admin/upload.php2.09 ▼1.145.80 ▼29.88
TG Copy Protection /wp-admin/options-general.php?page=tg_copy_protection2.097.91

Server storage [IO: ▲0.18MB] [DB: ▲0.31MB] Passed 3 tests

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

Browser metrics Passed 4 tests

Checking browser requirements for TG Copy Protection
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,872 ▲12213.35 ▼1.008.10 ▲6.4239.82 ▼5.79
Dashboard /wp-admin2,199 ▲225.62 ▲0.0489.19 ▼14.6240.91 ▼19.60
Posts /wp-admin/edit.php2,101 ▲12.02 ▲0.0741.60 ▲0.2235.85 ▼0.55
Add New Post /wp-admin/post-new.php1,367 ▼15917.14 ▼6.31584.24 ▼109.9647.37 ▼8.77
Media Library /wp-admin/upload.php1,404 ▲44.09 ▼0.19110.73 ▲10.3048.38 ▲3.26
TG Copy Protection /wp-admin/options-general.php?page=tg_copy_protection8512.0226.7431.95

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/tg-copy-protection/tg-copy-protection.php+178
    Use of undefined constant tg_copy_protection_enq_script - assumed 'tg_copy_protection_enq_script' (this will throw an Error in a future version of PHP)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=tg_copy_protection
    • > Warning in wp-content/plugins/tg-copy-protection/tg-copy-protection.php+178
    Use of undefined constant tg_copy_protection_enq_script - assumed 'tg_copy_protection_enq_script' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=tg_copy_protection
    • > Warning in wp-content/plugins/tg-copy-protection/tg-copy-protection.php+179
    Use of undefined constant tg_copy_protection_new_code - assumed 'tg_copy_protection_new_code' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=tg_copy_protection
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=tg_copy_protection
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tg-copy-protection/tg-copy-protection.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (TG Copy Protection plugin settings interface (Settings -> TG Copy Protection).), #2 (How to access TG Copy Protection plugin settings interface from admin screen of your WordPress website.), #3 (See in action, how the copyright and credit-link or backlink of your page from where the text was copied, appears along with copied text (this is only an optional setting in plugin).)
Please take inspiration from this readme.txt

tg-copy-protection/tg-copy-protection.php 92% from 13 tests

"TG Copy Protection" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 142 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin184 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP23540184

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.11
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%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.16MB with 0.07MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png68.36KB41.85KB▼ 38.78%
screenshot-3.png77.67KB39.39KB▼ 49.29%
screenshot-2.png15.64KB8.55KB▼ 45.34%