51% arvancloud-object-storage

Code Review | ArvanCloud Object Storage

WordPress plugin ArvanCloud Object Storage scored51%from 54 tests.

About plugin

  • Plugin page: arvancloud-object...
  • Plugin version: 1.2.3
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Dec 25, 2021
  • Latest release: Aug 11, 2023
  • Number of updates: 26
  • Update frequency: every 23.0 days
  • Top authors: khorshidlab (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

80+ active /4,968 total downloads

Benchmarks

Plugin footprint 64% 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: ▲11.43MB] [CPU: ▲57.57ms] 50% from 4 tests

A check of server-side resources used by ArvanCloud Object Storage
Please have a look at the following items
  • RAM: Total memory usage should be kept under 10MB (currently 14.68MB on /wp-admin/admin.php?page=wp-arvancloud-storage-about)
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 11.43MB on /wp-admin/admin.php?page=wp-arvancloud-storage-about)
PageMemory (MB)CPU Time (ms)
Home /43.12 ▲39.618,173,136.15 ▲8,173,090.98
Dashboard /wp-admin14.80 ▲11.45138.41 ▲81.03
Posts /wp-admin/edit.php14.88 ▲11.47101.09 ▲48.78
Add New Post /wp-admin/post-new.php17.34 ▲11.41144.75 ▲48.62
Media Library /wp-admin/upload.php14.66 ▲11.3994.42 ▲51.83
Settings /wp-admin/admin.php?page=wp-arvancloud-storage16.10445.73
Scheduled Actions /wp-admin/tools.php?page=action-scheduler14.88107.15
Scheduled Actions /wp-admin/admin.php?page=wp-arvancloud-storage-filtertask14.90103.28
About /wp-admin/admin.php?page=wp-arvancloud-storage-about14.6890.92

Server storage [IO: ▲29.95MB] [DB: ▲0.01MB] 67% from 3 tests

Input-output and database impact of this plugin
Please try to fix the following items
  • Try to limit filesystem usage to 25MB (currently using 29.95MB)
Filesystem: 2,560 new files
Database: 5 new tables, 12 new options
New tables
wp_actionscheduler_logs
wp_actionscheduler_groups
wp_actionscheduler_actions
wp_actionscheduler_claims
wp_obs_operations
New WordPress options
schema-ActionScheduler_StoreSchema
theysaidso_admin_options
OBS_INVALID_API_KEY
action_scheduler_lock_async-request-runner
acs_settings
action_scheduler_hybrid_store_demarkation
widget_recent-posts
db_upgraded
can_compress_scripts
schema-ActionScheduler_LoggerSchema
...

Browser metrics Passed 4 tests

A check of browser resources used by ArvanCloud Object Storage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,995 ▲23414.51 ▼0.241.52 ▼0.7339.14 ▼8.29
Dashboard /wp-admin2,386 ▲2066.23 ▲0.57111.40 ▲23.0388.52 ▲44.41
Posts /wp-admin/edit.php2,329 ▲2293.57 ▲1.6054.04 ▲16.2972.38 ▲34.28
Add New Post /wp-admin/post-new.php1,580 ▲5421.52 ▼1.53614.05 ▼35.25158.82 ▲97.67
Media Library /wp-admin/upload.php1,466 ▲724.21 ▲0.0187.00 ▼16.5875.43 ▲28.59
Settings /wp-admin/admin.php?page=wp-arvancloud-storage9501.7512.0037.86
Scheduled Actions /wp-admin/tools.php?page=action-scheduler1,5653.2643.3761.85
Scheduled Actions /wp-admin/admin.php?page=wp-arvancloud-storage-filtertask2,0854.4147.3787.17
About /wp-admin/admin.php?page=wp-arvancloud-storage-about1,1372.9840.3386.18

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie tables detected upon uninstall: 5 tables
    • wp_obs_operations
    • wp_actionscheduler_logs
    • wp_actionscheduler_groups
    • wp_actionscheduler_claims
    • wp_actionscheduler_actions
  • This plugin does not fully uninstall, leaving 12 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • schema-ActionScheduler_LoggerSchema
    • widget_theysaidso_widget
    • action_scheduler_lock_async-request-runner
    • OBS_INVALID_API_KEY
    • acs_settings
    • action_scheduler_hybrid_store_demarkation
    • ...

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
  • 48 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-arvancloud-storage-about
    • > POST request to /wp-cron.php?doing_wp_cron=1697551793.8827230930328369140625
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
  • 48 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-arvancloud-storage-about
    • > POST request to /wp-cron.php?doing_wp_cron=1697551793.8827230930328369140625
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(http://www.fillyourtaproom.com/wp-json/wp/v2/posts?per_page=10): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/arvancloud-object-storage/admin/partials/partial-styles.php
    • > /wp-content/plugins/arvancloud-object-storage/vendor/mtdowling/jmespath.php/bin/jp.php
  • 901× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/arvancloud-object-storage/vendor/aws/aws-sdk-php/src/IoTFleetWise/Exception/IoTFleetWiseException.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Aws\\CacheInterface' not found in wp-content/plugins/arvancloud-object-storage/vendor/aws/aws-sdk-php/src/PsrCacheAdapter.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/arvancloud-object-storage/vendor/aws/aws-sdk-php/src/CognitoSync/CognitoSyncClient.php:44
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/arvancloud-object-storage/vendor/aws/aws-sdk-php/src/AppIntegrationsService/AppIntegrationsServiceClient.php:39
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/arvancloud-object-storage/vendor/aws/aws-sdk-php/src/SnowDeviceManagement/Exception/SnowDeviceManagementException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/arvancloud-object-storage/vendor/aws/aws-sdk-php/src/SecurityHub/SecurityHubClient.php:121
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/arvancloud-object-storage/vendor/aws/aws-sdk-php/src/SageMakerRuntime/Exception/SageMakerRuntimeException.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Aws\\MonitoringEventsInterface' not found in wp-content/plugins/arvancloud-object-storage/vendor/aws/aws-sdk-php/src/Retry/Exception/ConfigurationException.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/arvancloud-object-storage/vendor/aws/aws-sdk-php/src/AppIntegrationsService/Exception/AppIntegrationsServiceException.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/arvancloud-object-storage/vendor/guzzlehttp/psr7/src/Stream.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: storage, offload, arvancloud, s3, backup...

arvancloud-object-storage/wp-arvancloud-storage.php 85% from 13 tests

"ArvanCloud Object Storage" version 1.2.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 343 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("arvancloud-object-storage.php" instead of "wp-arvancloud-storage.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
These items require your attention
  • Do not include executable or dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/arvancloud-object-storage/vendor/aws/aws-crt-php/run_tests.bat
71,639 lines of code in 2,504 files:
LanguageFilesBlank linesComment linesLines of code
PHP2,40811,48650,98560,207
Markdown291,42203,993
JSON181003,134
Sass1121101,123
C1025089882
PO File1298444804
JavaScript310921472
C/C++ Header210538441
YAML53057198
Bourne Shell3194176
reStructuredText1352959
GLSL117055
XML10024
m414422
SVG40016
Pascal151514
Bourne Again Shell15013
INI2003
DOS Batch1202
CSS1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity5.93
▷ Minimum class complexity1.00
▷ Maximum class complexity232.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces700
Interfaces63
Traits26
Classes1,078
▷ Abstract classes322.97%
▷ Concrete classes1,04697.03%
▷ Final classes595.64%
Methods3,626
▷ Static methods64117.68%
▷ Public methods2,68874.13%
▷ Protected methods2797.69%
▷ Private methods65918.17%
Functions627
▷ Named functions20733.01%
▷ Anonymous functions42066.99%
Constants307
▷ Global constants103.26%
▷ Class constants29796.74%
▷ Public constants28094.28%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/loading-bg-green.png0.57KB0.64KB0.00%
assets/img/loading-bg-gray.png0.65KB0.68KB0.00%