68% wp-encrypted-uploads

Code Review | WP Encrypted Uploads

WordPress plugin WP Encrypted Uploads scored68%from 54 tests.

About plugin

  • Plugin page: wp-encrypted-uploads
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.4.1
  • WordPress version: 6.3.1
  • First release: Jun 2, 2020
  • Latest release: Jun 2, 2020
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: AhmedGeek (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /1,151 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.33MB] [CPU: ▲3.19ms] Passed 4 tests

Analyzing server-side resources used by WP Encrypted Uploads
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.3546.85 ▲7.09
Dashboard /wp-admin3.67 ▲0.3650.78 ▲1.30
Posts /wp-admin/edit.php3.72 ▲0.3655.79 ▲2.21
Add New Post /wp-admin/post-new.php6.18 ▲0.3099.50 ▲2.14
Media Library /wp-admin/upload.php3.53 ▲0.3043.55 ▲10.11

Server storage [IO: ▲0.96MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
These are issues you should consider
  • The plugin illegally modified 2 files (1.21KB) outside of "wp-content/plugins/wp-encrypted-uploads/" and "wp-content/uploads/"
    • (modified) .htaccess
    • (new file) wp-content/wp_ancenc_yWmRbkwS3rld/index.php
Filesystem: 248 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
ancenc_custom_directory_created
ancenc_encryption_key
can_compress_scripts
ancenc_custom_directory
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for WP Encrypted Uploads
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲7113.14 ▼1.241.99 ▲0.2744.09 ▲0.23
Dashboard /wp-admin2,223 ▲355.86 ▲1.00110.53 ▼1.2742.54 ▲2.32
Posts /wp-admin/edit.php2,109 ▲172.03 ▼0.0040.50 ▼0.1635.46 ▼2.45
Add New Post /wp-admin/post-new.php1,543 ▲2423.36 ▲0.01644.01 ▲25.1961.88 ▲11.55
Media Library /wp-admin/upload.php1,408 ▲204.30 ▲0.01110.97 ▲9.4547.62 ▲4.39

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 9 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • ancenc_custom_directory_created
    • db_upgraded
    • widget_recent-comments
    • ancenc_encryption_key
    • widget_recent-posts
    • ancenc_custom_directory
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-encrypted-uploads/vendor/mustache/mustache/bin/build_bootstrap.php
  • 79× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      require(wp-content/plugins/wp-encrypted-uploads/vendor/rdlowrey/auryn/examples/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/wp-encrypted-uploads/vendor/rdlowrey/auryn/examples/make_with_concrete_dependency.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-encrypted-uploads/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/StrictCallablesTest.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Auryn\\ReflectionCache' not found in wp-content/plugins/wp-encrypted-uploads/vendor/rdlowrey/auryn/lib/ReflectionCacheApc.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Mustache_Exception' not found in wp-content/plugins/wp-encrypted-uploads/vendor/mustache/mustache/src/Mustache/Exception/UnknownFilterException.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-encrypted-uploads/vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownHelperExceptionTest.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-encrypted-uploads/vendor/mustache/mustache/test/Mustache/Test/Cache/AbstractCacheTest.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Auryn\\Reflector' not found in wp-content/plugins/wp-encrypted-uploads/vendor/rdlowrey/auryn/lib/CachingReflector.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-encrypted-uploads/vendor/mustache/mustache/test/Mustache/Test/Functional/NestedPartialIndentTest.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-encrypted-uploads/vendor/mustache/mustache/test/Mustache/Test/Functional/ExamplesTest.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-encrypted-uploads/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/ClosureQuirksTest.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Screenshots: Screenshot #1 (The settings page.) image not found
The official readme.txt is a good inspiration

wp-encrypted-uploads/encrypted-uploads.php 92% from 13 tests

The principal PHP file in "WP Encrypted Uploads" v. 1.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-encrypted-uploads.php" instead of "encrypted-uploads.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
It is important to fix the following items
  • Do not distribute dangerous files with your plugin
    • .ms - Maxwell Script in Maxwell Render
      • wp-content/plugins/wp-encrypted-uploads/vendor/mustache/mustache/test/fixtures/templates/alpha.ms
      • wp-content/plugins/wp-encrypted-uploads/vendor/mustache/mustache/test/fixtures/templates/beta.ms
22,778 lines of code in 207 files:
LanguageFilesBlank linesComment linesLines of code
CSS12,506011,733
PHP1522,0823,7199,639
Markdown42500732
Mustache41330365
JSON300184
YAML36054
XML231245
JavaScript11026

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity3.25
▷ Minimum class complexity1.00
▷ Maximum class complexity96.00
Average method complexity1.74
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces12
Interfaces13
Traits0
Classes236
▷ Abstract classes62.54%
▷ Concrete classes23097.46%
▷ Final classes00.00%
Methods806
▷ Static methods384.71%
▷ Public methods70787.72%
▷ Protected methods263.23%
▷ Private methods739.06%
Functions68
▷ Named functions68.82%
▷ Anonymous functions6291.18%
Constants122
▷ Global constants1713.93%
▷ Class constants10586.07%
▷ Public constants105100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
public/images/file_icon.png9.43KB4.98KB▼ 47.23%