57% offload-media-cloud-storage

Code Review | Offload Media - Cloud Storage

WordPress plugin Offload Media - Cloud Storage scored57%from 54 tests.

About plugin

  • Plugin page: offload-media-clo...
  • Plugin version: 1.1.9
  • PHP compatiblity: 7.0 or higher+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-6.1
  • WordPress version: 6.3.1
  • First release: Jun 15, 2022
  • Latest release: Apr 20, 2023
  • Number of updates: 21
  • Update frequency: every 14.8 days
  • Top authors: acowebscd (95.24%)acowebs (9.52%)

Code review

54 tests

User reviews

7 reviews

Install metrics

200+ active /5,534 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼4.70ms] Passed 4 tests

This is a short check of server-side resources used by Offload Media - Cloud Storage
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0442.91 ▼1.07
Dashboard /wp-admin3.36 ▲0.0650.83 ▲1.62
Posts /wp-admin/edit.php3.41 ▲0.0651.48 ▼7.84
Add New Post /wp-admin/post-new.php5.96 ▲0.0791.03 ▼11.50
Media Library /wp-admin/upload.php3.29 ▲0.0643.17 ▲7.98
Dashboard /wp-admin/admin.php?page=acoofm-admin-ui3.2839.78

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

Input-output and database impact of this plugin
These are issues you should consider
  • Total filesystem usage must be limited to 25MB (currently using 29.28MB)
Filesystem: 2,614 new files
Database: 1 new table, 7 new options
New tables
wp_acoofm_items
New WordPress options
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
acoofm_db_version

Browser metrics Passed 4 tests

Checking browser requirements for Offload Media - Cloud Storage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,875 ▲12913.31 ▼1.341.93 ▼0.0139.69 ▼3.85
Dashboard /wp-admin2,241 ▲535.86 ▲0.9498.93 ▼19.4486.88 ▲44.75
Posts /wp-admin/edit.php2,139 ▲502.04 ▲0.0536.39 ▼4.1946.66 ▲10.20
Add New Post /wp-admin/post-new.php1,714 ▲19022.51 ▼0.64696.13 ▼6.7569.08 ▲6.22
Media Library /wp-admin/upload.php1,436 ▲484.26 ▲0.0399.88 ▼8.8680.69 ▲35.26
Configure /wp-admin/admin.php?page=acoofm-admin-ui#/configure1,3224.8464.29116.08
Dashboard /wp-admin/admin.php?page=acoofm-admin-ui1,3074.5965.16109.63

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie tables were found after uninstall: 1 table
    • wp_acoofm_items
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • acoofm_db_version
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/offload-media-cloud-storage/includes/s3/vendor/mtdowling/jmespath.php/bin/jp.php
  • 1080× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/offload-media-cloud-storage/includes/s3/vendor/aws/aws-sdk-php/src/StorageGateway/StorageGatewayClient.php:190
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/offload-media-cloud-storage/includes/google/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/offload-media-cloud-storage/includes/s3/vendor/aws/aws-sdk-php/src/Sqs/Exception/SqsException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/offload-media-cloud-storage/includes/s3/vendor/aws/aws-sdk-php/src/Personalize/Exception/PersonalizeException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/offload-media-cloud-storage/includes/s3/vendor/aws/aws-sdk-php/src/SavingsPlans/Exception/SavingsPlansException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/offload-media-cloud-storage/includes/s3/vendor/aws/aws-sdk-php/src/DataPipeline/DataPipelineClient.php:48
    • > PHP Fatal error
      Trait 'Google\\Cloud\\Core\\TimeTrait' not found in wp-content/plugins/offload-media-cloud-storage/includes/google/vendor/google/cloud-core/src/Timestamp.php on line 40
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Cloud\\Core\\Exception\\ServiceException' not found in wp-content/plugins/offload-media-cloud-storage/includes/google/vendor/google/cloud-core/src/Exception/FailedPreconditionException.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/offload-media-cloud-storage/includes/s3/vendor/aws/aws-sdk-php/src/Sfn/Exception/SfnException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Promise\\RejectionException' not found in wp-content/plugins/offload-media-cloud-storage/includes/google/vendor/guzzlehttp/promises/src/CancellationException.php:8

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 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Donate link: Please fix this invalid URI: ""
Please take inspiration from this readme.txt

offload-media-cloud-storage/start.php 85% from 13 tests

This is the main PHP file of "Offload Media - Cloud Storage" version 1.1.9, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Requires PHP: Required version number formatted incorrectly (ex. "7.0" instead of "7.0 or higher")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("offload-media-cloud-storage.php" instead of "start.php")

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
These items require your attention
  • Do not distribute dangerous files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/offload-media-cloud-storage/includes/google/vendor/bin/google-cloud-batch.bat
      • wp-content/plugins/offload-media-cloud-storage/includes/s3/vendor/bin/jp.php.bat
      • wp-content/plugins/offload-media-cloud-storage/includes/s3/vendor/aws/aws-crt-php/run_tests.bat
103,488 lines of code in 2,379 files:
LanguageFilesBlank linesComment linesLines of code
PHP2,24714,18164,98787,499
JSON33607,876
Markdown441,78505,162
C122851591,014
C/C++ Header311556466
PO File1154165368
YAML127262351
JavaScript4103202
Bourne Shell52520193
m42151860
reStructuredText1352959
GLSL117055
make2171651
XML20043
CSS10032
Pascal151514
Bourne Again Shell15013
DOS Batch32012
Dockerfile18010
SVG1005
INI2003

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
It is recommended to fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity7.49
▷ Minimum class complexity1.00
▷ Maximum class complexity305.00
Average method complexity2.81
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces705
Interfaces96
Traits70
Classes1,305
▷ Abstract classes292.22%
▷ Concrete classes1,27697.78%
▷ Final classes836.50%
Methods5,415
▷ Static methods86816.03%
▷ Public methods4,05174.81%
▷ Protected methods3266.02%
▷ Private methods1,03819.17%
Functions893
▷ Named functions33337.29%
▷ Anonymous functions56062.71%
Constants695
▷ Global constants11115.97%
▷ Class constants58484.03%
▷ Public constants584100.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
There are no PNG files in this plugin