62% wp-copysafe-web

Code Review | CopySafe Web Protection

WordPress plugin CopySafe Web Protection scored62%from 54 tests.

About plugin

  • Plugin page: wp-copysafe-web
  • Plugin version: 3.14
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Dec 10, 2012
  • Latest release: May 5, 2023
  • Number of updates: 77
  • Update frequency: every 49.4 days
  • Top authors: ArtistScope (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

1,000+ active /44,555 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
Install script ran successfully

Server metrics [RAM: ▼0.98MB] [CPU: ▼43.38ms] Passed 4 tests

Server-side resources used by CopySafe Web Protection
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.99 ▼0.4713.60 ▼26.31
Dashboard /wp-admin3.03 ▼0.2818.86 ▼31.60
Posts /wp-admin/edit.php3.03 ▼0.3317.96 ▼27.08
Add New Post /wp-admin/post-new.php3.03 ▼2.8616.88 ▼88.54
Media Library /wp-admin/upload.php3.03 ▼0.2016.79 ▼18.57
List Files /wp-admin/admin.php?page=wpcsw_list3.0317.73
Settings /wp-admin/admin.php?page=wpcsw_settings3.0317.71

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 41 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
wpcsw_settings
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by CopySafe Web Protection
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲6214.26 ▲0.091.50 ▼0.2540.08 ▼9.50
Dashboard /wp-admin2,232 ▲555.63 ▲0.0580.80 ▼23.6037.38 ▼7.07
Posts /wp-admin/edit.php2,134 ▲342.00 ▲0.0134.77 ▼0.9735.64 ▲1.92
Add New Post /wp-admin/post-new.php1,564 ▲2823.39 ▲5.21685.99 ▲50.7839.29 ▼21.29
Media Library /wp-admin/upload.php1,434 ▲314.17 ▼0.05104.43 ▲1.1846.00 ▲3.35
List Files /wp-admin/admin.php?page=wpcsw_list8772.0329.9439.18
Settings /wp-admin/admin.php?page=wpcsw_settings1,0211.6623.8029.41

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/wp-copysafe-web/wp-copysafe-web.php+636
    Undefined index: page
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpcsw_settings
    • > Notice in wp-content/plugins/wp-copysafe-web/wp-copysafe-web.php+638
    Undefined index: cswfilename
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpcsw_settings
    • > Notice in wp-content/plugins/wp-copysafe-web/wp-copysafe-web.php+640
    Undefined index: action
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpcsw_settings
    • > Notice in wp-content/plugins/wp-copysafe-web/wp-copysafe-web.php+642
    Undefined index: cswdel_nonce
    • > GET request to /wp-admin/admin.php?page=wpcsw_list
    • > Warning in wp-content/plugins/wp-copysafe-web/function.php+324
    scandir(wp-content/uploads/copysafe-web/): failed to open dir: Permission denied
    • > GET request to /wp-admin/admin.php?page=wpcsw_list
    • > Warning in wp-content/plugins/wp-copysafe-web/function.php+324
    scandir(): (errno 13): Permission denied
    • > GET request to /wp-admin/admin.php?page=wpcsw_list
    • > Warning in wp-content/plugins/wp-copysafe-web/function.php+326
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/admin.php?page=wpcsw_settings
    • > Notice in wp-content/plugins/wp-copysafe-web/wp-copysafe-web.php+318
    Undefined variable: latest_version

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
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-copysafe-web/popup_load.php
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant WPCSW_PLUGIN_PATH - assumed 'WPCSW_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-copysafe-web/popup_load.php on line 42
    • > PHP Warning
      include(): Failed opening 'WPCSW_PLUGIN_PATHmedia-upload.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/wp-copysafe-web/popup_load.php on line 42
    • > PHP Warning
      Use of undefined constant WPCSW_PLUGIN_URL - assumed 'WPCSW_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-copysafe-web/popup_load.php on line 47
    • > PHP Warning
      include(WPCSW_PLUGIN_PATHmedia-upload.php): failed to open stream: No such file or directory in wp-content/plugins/wp-copysafe-web/popup_load.php on line 42
    • > PHP Warning
      Use of undefined constant WPCSW_PLUGIN_URL - assumed 'WPCSW_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-copysafe-web/popup_load.php on line 52

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: prevent, secure, protect

wp-copysafe-web/wp-copysafe-web.php 92% from 13 tests

The main PHP file in "CopySafe Web Protection" ver. 3.14 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 173 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin2,698 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP41911331,305
CSS36244516
JavaScript48578510
HTML4290367

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions33
▷ Named functions33100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
8 PNG files occupy 0.06MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/settings.png1.83KB1.69KB▼ 7.68%
images/help14.png1.00KB0.81KB▼ 19.57%
images/search.png2.72KB1.50KB▼ 44.98%
images/file.png1.43KB1.13KB▼ 21.12%
images/help-24-30.png1.52KB1.19KB▼ 21.77%