68% s3-spaces-sync

Code Review | S3 Spaces Sync

WordPress plugin S3 Spaces Sync scored68%from 54 tests.

About plugin

  • Plugin page: s3-spaces-sync
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.0.2
  • WordPress version: 6.3.1
  • First release: Dec 31, 2018
  • Latest release: Dec 31, 2018
  • Number of updates: 4
  • Update frequency: every 0.8 days
  • Top authors: riespandi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /898 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.38MB] [CPU: ▲2.50ms] Passed 4 tests

An overview of server-side resources used by S3 Spaces Sync
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.89 ▲0.4343.82 ▲2.83
Dashboard /wp-admin3.71 ▲0.4149.85 ▼0.83
Posts /wp-admin/edit.php3.76 ▲0.4051.75 ▲1.50
Add New Post /wp-admin/post-new.php6.25 ▲0.36100.92 ▲8.19
Media Library /wp-admin/upload.php3.57 ▲0.3441.32 ▲6.48
S3 Spaces Sync /wp-admin/options-general.php?page=s3-spaces3.6037.57

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 1,665 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for S3 Spaces Sync
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲7513.30 ▼1.015.65 ▲2.3541.65 ▼6.35
Dashboard /wp-admin2,216 ▲314.88 ▼0.97112.72 ▲5.3242.14 ▼3.46
Posts /wp-admin/edit.php2,099 ▲102.08 ▲0.0538.77 ▲0.3737.00 ▲3.97
Add New Post /wp-admin/post-new.php1,532 ▲418.34 ▲0.27608.39 ▼45.7957.32 ▲3.74
Media Library /wp-admin/upload.php1,401 ▲134.22 ▲0.0797.09 ▲1.0542.79 ▼0.90
S3 Spaces Sync /wp-admin/options-general.php?page=s3-spaces1,1382.0327.5447.20

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/s3-spaces-sync/vendor/bin/jp.php
  • 507× 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/s3-spaces-sync/vendor/aws/aws-sdk-php/src/MarketplaceCommerceAnalytics/Exception/MarketplaceCommerceAnalyticsException.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Aws\\MonitoringEventsInterface' not found in wp-content/plugins/s3-spaces-sync/vendor/aws/aws-sdk-php/src/Api/Parser/Exception/ParserException.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Api\\AbstractModel' not found in wp-content/plugins/s3-spaces-sync/vendor/aws/aws-sdk-php/src/Api/Operation.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/s3-spaces-sync/vendor/aws/aws-sdk-php/src/Inspector/Exception/InspectorException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/s3-spaces-sync/vendor/aws/aws-sdk-php/src/ElasticLoadBalancingV2/ElasticLoadBalancingV2Client.php:77
    • > PHP Fatal error
      Uncaught Error: Interface 'Aws\\Crypto\\AesStreamInterface' not found in wp-content/plugins/s3-spaces-sync/vendor/aws/aws-sdk-php/src/Crypto/AesGcmDecryptingStream.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/s3-spaces-sync/vendor/aws/aws-sdk-php/src/ApplicationAutoScaling/ApplicationAutoScalingClient.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/s3-spaces-sync/vendor/aws/aws-sdk-php/src/Rekognition/RekognitionClient.php:77
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/s3-spaces-sync/vendor/aws/aws-sdk-php/src/AutoScaling/AutoScalingClient.php:118
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Api\\Parser\\AbstractParser' not found in wp-content/plugins/s3-spaces-sync/vendor/aws/aws-sdk-php/src/Api/Parser/QueryParser.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: s3, aws, media, storage, space...

s3-spaces-sync/s3-spaces.php 85% from 13 tests

Analyzing the main PHP file in "S3 Spaces Sync" version 1.0.0
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("s3-spaces-sync.php" instead of "s3-spaces.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 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Please make sure to remedy the following
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/s3-spaces-sync/vendor/bin/jp.php.bat
43,329 lines of code in 1,260 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,1946,72128,10332,413
JSON34806,730
Markdown171,20903,672
SVG202140
PO File13838132
reStructuredText1352959
CSS210053
XML37050
JavaScript18127
YAML28027
make210022
DOS Batch1004

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity5.65
▷ Minimum class complexity1.00
▷ Maximum class complexity81.00
Average method complexity2.28
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces372
Interfaces38
Traits23
Classes619
▷ Abstract classes152.42%
▷ Concrete classes60497.58%
▷ Final classes121.99%
Methods2,499
▷ Static methods28711.48%
▷ Public methods1,81272.51%
▷ Protected methods1455.80%
▷ Private methods54221.69%
Functions400
▷ Named functions7719.25%
▷ Anonymous functions32380.75%
Constants179
▷ Global constants00.00%
▷ Class constants179100.00%
▷ Public constants179100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin