78% protect-wp-videos

Code Review | Protect Wordpress Videos

WordPress plugin Protect Wordpress Videos scored78%from 54 tests.

About plugin

  • Plugin page: protect-wp-videos
  • Plugin version: 1.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.8.3
  • WordPress version: 6.3.1
  • First release: Aug 7, 2017
  • Latest release: Mar 15, 2022
  • Number of updates: 16
  • Update frequency: every 105.1 days
  • Top authors: gaupoit (87.5%)profaceoff (18.75%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /2,115 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
Install script ran successfully

Server metrics [RAM: ▲3.42MB] [CPU: ▲12.03ms] Passed 4 tests

Server-side resources used by Protect Wordpress Videos
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /6.88 ▲3.4262.36 ▲18.75
Dashboard /wp-admin6.72 ▲3.4167.07 ▲12.59
Posts /wp-admin/edit.php6.83 ▲3.4766.58 ▲14.97
Add New Post /wp-admin/post-new.php9.32 ▲3.43105.87 ▲1.82
Media Library /wp-admin/upload.php6.64 ▲3.4166.99 ▲30.34

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 1,103 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
puv_customer_guid
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
puv_mfl

Browser metrics Passed 4 tests

An overview of browser requirements for Protect Wordpress Videos
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,947 ▲18614.23 ▼0.269.84 ▲8.2037.57 ▼7.42
Dashboard /wp-admin2,217 ▲435.06 ▼0.5296.46 ▲5.8636.86 ▲0.22
Posts /wp-admin/edit.php2,119 ▲192.50 ▲0.5136.55 ▲0.3534.76 ▼3.27
Add New Post /wp-admin/post-new.php1,380 ▼14817.39 ▼5.61562.28 ▼122.9827.15 ▼35.61
Media Library /wp-admin/upload.php1,422 ▲254.64 ▲0.38112.03 ▲10.7049.75 ▲6.31

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 8 options in the database
    • puv_mfl
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • puv_customer_guid

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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 take a closer look at the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/protect-wp-videos/public/partials/protect-ur-videos-public-display.php
    • > /wp-content/plugins/protect-wp-videos/admin/partials/protect-ur-videos-admin-display.php
  • 414× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Aws\\CacheInterface' not found in wp-content/plugins/protect-wp-videos/vendor/aws/aws-sdk-php/src/PsrCacheAdapter.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/protect-wp-videos/vendor/aws/aws-sdk-php/src/Inspector/Exception/InspectorException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/protect-wp-videos/vendor/aws/aws-sdk-php/src/ACMPCA/Exception/ACMPCAException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/protect-wp-videos/vendor/aws/aws-sdk-php/src/AlexaForBusiness/Exception/AlexaForBusinessException.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Aws\\AwsClientInterface' not found in wp-content/plugins/protect-wp-videos/vendor/aws/aws-sdk-php/src/AwsClient.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Aws\\CommandInterface' not found in wp-content/plugins/protect-wp-videos/vendor/aws/aws-sdk-php/src/Command.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/protect-wp-videos/vendor/aws/aws-sdk-php/src/Waiter.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\UriInterface' not found in wp-content/plugins/protect-wp-videos/vendor/guzzlehttp/psr7/src/Uri.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/protect-wp-videos/vendor/aws/aws-sdk-php/src/MigrationHub/MigrationHubClient.php:41
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/protect-wp-videos/vendor/aws/aws-sdk-php/src/S3/S3Client.php:177

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)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
4 plugin tags: posts, content, private, videos

protect-wp-videos/protect-ur-videos.php 85% from 13 tests

The main file in "Protect Wordpress Videos" v. 1.1.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("protect-wp-videos.php" instead of "protect-ur-videos.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected38,563 lines of code in 1,087 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,0095,26923,22526,675
JSON31806,483
Markdown1399303,315
JavaScript243752701,978
reStructuredText1352959
make210022
XML13014
Bourne Shell22012
CSS41145

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity5.81
▷ Minimum class complexity1.00
▷ Maximum class complexity81.00
Average method complexity2.39
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces315
Interfaces27
Traits13
Classes523
▷ Abstract classes81.53%
▷ Concrete classes51598.47%
▷ Final classes101.94%
Methods1,935
▷ Static methods22111.42%
▷ Public methods1,35870.18%
▷ Protected methods894.60%
▷ Private methods48825.22%
Functions375
▷ Named functions7419.73%
▷ Anonymous functions30180.27%
Constants147
▷ Global constants10.68%
▷ Class constants14699.32%
▷ Public constants146100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/js/pur-video-js.png22.10KB10.23KB▼ 53.73%