77% offload-videos-bunny-netaws-s3

Code Review | Offload Videos - Bunny.net, AWS S3

WordPress plugin Offload Videos - Bunny.net, AWS S3 scored77%from 54 tests.

About plugin

  • Plugin page: offload-videos-bu...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 19, 2022
  • Latest release: Dec 19, 2022
  • Number of updates: 6
  • Update frequency: every 0.5 days
  • Top authors: webgarh (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /990 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.15MB] [CPU: ▼17.26ms] Passed 4 tests

Analyzing server-side resources used by Offload Videos - Bunny.net, AWS S3
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0435.91 ▼4.06
Dashboard /wp-admin3.23 ▼0.1232.14 ▼32.30
Posts /wp-admin/edit.php3.29 ▼0.0637.25 ▼7.31
Add New Post /wp-admin/post-new.php5.47 ▼0.4168.55 ▼25.35
Media Library /wp-admin/upload.php3.23 ▲0.0130.56 ▼2.42
Videos /wp-admin/admin.php?page=videos3.2027.60
Offload Videos /wp-admin/admin.php?page=offload-video3.2030.80

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

Analyzing filesystem and database footprints of this plugin
Please fix the following
  • Try to limit filesystem usage to 25MB (currently using 29.97MB)
Filesystem: 2,042 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Offload Videos - Bunny.net, AWS S3: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,025 ▲27913.61 ▼0.7711.29 ▲9.4744.91 ▲2.60
Dashboard /wp-admin2,238 ▲504.86 ▼0.93104.93 ▼11.4539.72 ▼9.59
Posts /wp-admin/edit.php2,121 ▲292.04 ▲0.0134.79 ▼2.1130.45 ▼3.80
Add New Post /wp-admin/post-new.php1,540 ▼217.63 ▼0.48683.12 ▲66.0955.32 ▲5.71
Media Library /wp-admin/upload.php1,420 ▲324.23 ▲0.0195.34 ▼1.4842.30 ▲0.17
Videos /wp-admin/admin.php?page=videos8112.0424.9724.03
Offload Videos /wp-admin/admin.php?page=offload-video1,0211.7324.1725.17

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
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=offload-video
    • > Notice in wp-content/plugins/offload-videos-bunny-netaws-s3/admin/class-offload-video-admin.php+155
    Undefined index: bsacft_success

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 845× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/offload-videos-bunny-netaws-s3/includes/aws/Aws/IoTFleetHub/Exception/IoTFleetHubException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/offload-videos-bunny-netaws-s3/includes/aws/Aws/WorkMail/WorkMailClient.php:145
    • > PHP Fatal error
      Uncaught Error: Interface 'Aws\\Crypto\\AesStreamInterface' not found in wp-content/plugins/offload-videos-bunny-netaws-s3/includes/aws/Aws/Crypto/AesDecryptingStream.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/offload-videos-bunny-netaws-s3/includes/aws/Aws/MemoryDB/MemoryDBClient.php:79
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/offload-videos-bunny-netaws-s3/includes/aws/Aws/KinesisVideo/KinesisVideoClient.php:47
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/offload-videos-bunny-netaws-s3/includes/aws/Aws/CodeDeploy/CodeDeployClient.php:104
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/offload-videos-bunny-netaws-s3/includes/aws/Aws/Honeycode/Exception/HoneycodeException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\BadResponseException' not found in wp-content/plugins/offload-videos-bunny-netaws-s3/includes/aws/GuzzleHttp/Exception/ServerException.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/offload-videos-bunny-netaws-s3/public/guzzle/vendor/guzzlehttp/psr7/src/LazyOpenStream.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/offload-videos-bunny-netaws-s3/includes/aws/Aws/Ec2/Ec2Client.php:1058

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (Screenshot-1.png), #2 (Screenshot-2.png)
You can look at the official readme.txt

offload-videos-bunny-netaws-s3/offload-video.php 85% from 13 tests

This is the main PHP file of "Offload Videos - Bunny.net, AWS S3" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("offload-videos-bunny-netaws-s3.php" instead of "offload-video.php")
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected91,921 lines of code in 2,008 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,9629,57849,04260,197
Markdown174,138011,477
SVG30128,770
JavaScript71,0931,0035,761
CSS81,695464,704
JSON10001,005
YAML1007

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
These items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity6.22
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity2.79
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces659
Interfaces74
Traits28
Classes995
▷ Abstract classes131.31%
▷ Concrete classes98298.69%
▷ Final classes606.11%
Methods3,252
▷ Static methods57217.59%
▷ Public methods2,37172.91%
▷ Protected methods1364.18%
▷ Private methods74522.91%
Functions585
▷ Named functions11920.34%
▷ Anonymous functions46679.66%
Constants370
▷ Global constants4010.81%
▷ Class constants33089.19%
▷ Public constants31996.67%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.21MB with 0.14MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
Screenshot-1.png73.49KB26.26KB▼ 64.26%
Screenshot-2.png136.50KB40.08KB▼ 70.64%