78% do-spaces-sync

Code Review | DigitalOcean Spaces Sync

WordPress plugin DigitalOcean Spaces Sync scored78%from 54 tests.

About plugin

  • Plugin page: do-spaces-sync
  • Plugin version: 2.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.3.2
  • WordPress version: 6.3.1
  • First release: Nov 23, 2017
  • Latest release: Feb 16, 2020
  • Number of updates: 45
  • Update frequency: every 18.2 days
  • Top authors: keeross (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

1,000+ active /22,330 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.37MB] [CPU: ▲0.45ms] Passed 4 tests

Analyzing server-side resources used by DigitalOcean Spaces Sync
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.88 ▲0.4240.46 ▼2.24
Dashboard /wp-admin3.70 ▲0.4048.70 ▼1.12
Posts /wp-admin/edit.php3.75 ▲0.4051.26 ▲10.59
Add New Post /wp-admin/post-new.php6.24 ▲0.3596.13 ▲2.53
Media Library /wp-admin/upload.php3.56 ▲0.3338.50 ▲2.64

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 1,890 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by DigitalOcean Spaces Sync
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲7513.25 ▼1.124.54 ▲2.8140.31 ▼4.27
Dashboard /wp-admin2,216 ▲254.86 ▼0.03106.77 ▼8.6140.88 ▼2.93
Posts /wp-admin/edit.php2,099 ▲72.04 ▲0.0439.62 ▼0.7133.87 ▼1.84
Add New Post /wp-admin/post-new.php1,525 ▼1923.30 ▲5.44602.75 ▼10.7151.36 ▼7.75
Media Library /wp-admin/upload.php1,401 ▲104.20 ▼0.0296.01 ▼4.9644.49 ▲2.60
DigitalOcean Spaces Sync /wp-admin/setting_page.php260.440.0913.42

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 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

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 no errors were found, this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 547× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/do-spaces-sync/vendor/aws/aws-sdk-php/src/LicenseManager/Exception/LicenseManagerException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/do-spaces-sync/vendor/aws/aws-sdk-php/src/WafRegional/WafRegionalClient.php:169
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/do-spaces-sync/vendor/aws/aws-sdk-php/src/CognitoSync/Exception/CognitoSyncException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/do-spaces-sync/vendor/aws/aws-sdk-php/src/CloudSearchDomain/Exception/CloudSearchDomainException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/do-spaces-sync/vendor/aws/aws-sdk-php/src/GroundStation/GroundStationClient.php:59
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/do-spaces-sync/vendor/guzzlehttp/psr7/src/DroppingStream.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/do-spaces-sync/vendor/aws/aws-sdk-php/src/PersonalizeRuntime/Exception/PersonalizeRuntimeException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/do-spaces-sync/vendor/aws/aws-sdk-php/src/IoT1ClickProjects/IoT1ClickProjectsClient.php:41
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/do-spaces-sync/vendor/aws/aws-sdk-php/src/MediaStoreData/MediaStoreDataClient.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Aws\\Crypto\\MetadataStrategyInterface' not found in wp-content/plugins/do-spaces-sync/vendor/aws/aws-sdk-php/src/S3/Crypto/HeadersMetadataStrategy.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
    • > GET request to /wp-admin/setting_page.php
    • > Network (severe)
    wp-admin/setting_page.php - Failed to load resource: the server responded with a status of 404 (Not 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
Please fix the following attributes:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === do-spaces-sync === )
The official readme.txt is a good inspiration

do-spaces-sync/loader.php 85% from 13 tests

The main PHP script in "DigitalOcean Spaces Sync" version 2.2.1 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("do-spaces-sync.php" instead of "loader.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin45,067 lines of code in 1,358 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,2957,06630,34334,320
JSON33806,713
Markdown191,17903,573
SVG202140
PO File13838133
reStructuredText1352959
CSS211053
JavaScript19127
make210022
XML13014
YAML14013

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity5.68
▷ Minimum class complexity1.00
▷ Maximum class complexity81.00
Average method complexity2.31
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces409
Interfaces40
Traits25
Classes664
▷ Abstract classes162.41%
▷ Concrete classes64897.59%
▷ Final classes121.85%
Methods2,602
▷ Static methods31712.18%
▷ Public methods1,87772.14%
▷ Protected methods1535.88%
▷ Private methods57221.98%
Functions426
▷ Named functions7718.08%
▷ Anonymous functions34981.92%
Constants198
▷ Global constants00.00%
▷ Class constants198100.00%
▷ Public constants198100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin