62% advanced-media-manager

Code Review | Advanced Media Manager

WordPress plugin Advanced Media Manager scored62%from 54 tests.

About plugin

  • Plugin page: advanced-media-ma...
  • Plugin version: 2.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 13, 2021
  • Latest release: Feb 22, 2023
  • Number of updates: 9
  • Update frequency: every 82.1 days
  • Top authors: smackcoders (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /814 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.91MB] [CPU: ▲6.61ms] Passed 4 tests

Server-side resources used by Advanced Media Manager
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.37 ▲0.9145.14 ▲4.44
Dashboard /wp-admin4.22 ▲0.9159.05 ▲9.45
Posts /wp-admin/edit.php4.33 ▲0.9855.49 ▲11.84
Add New Post /wp-admin/post-new.php6.80 ▲0.9191.06 ▲0.72
Media Library /wp-admin/upload.php4.14 ▲0.9142.17 ▲11.99
Advanced Media Manager /wp-admin/admin.php?page=advanced-media-manager4.1140.37
Cloud Images /wp-admin/admin.php?page=cloud-images4.1138.67

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

A short overview of filesystem and database impact
It is recommended to fix the following issues
  • The filesystem usage should be lower than 25MB (currently using 27.30MB)
Filesystem: 2,425 new files
Database: 4 new tables, 6 new options
New tables
wp_amazon_bucket_manager
wp_digital_bucket_manager
wp_storage_bucket_manager
wp_bucket_broken_images
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Media Manager
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲9213.21 ▼0.741.82 ▼0.0239.68 ▼4.70
Dashboard /wp-admin2,236 ▲484.80 ▼0.07103.45 ▼11.5540.50 ▼3.71
Posts /wp-admin/edit.php2,113 ▲212.07 ▲0.0639.33 ▲4.9034.17 ▼1.19
Add New Post /wp-admin/post-new.php1,536 ▲117.45 ▼3.60625.41 ▼55.7154.17 ▼7.62
Media Library /wp-admin/upload.php1,415 ▲274.23 ▼0.0292.24 ▼19.2640.77 ▼4.46
Advanced Media Manager /wp-admin/admin.php?page=advanced-media-manager9856.15143.0381.33
Cloud Images /wp-admin/admin.php?page=cloud-images8955.74119.7840.83

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The plugin did not uninstall successfully, leaving 4 tables in the database
    • wp_digital_bucket_manager
    • wp_bucket_broken_images
    • wp_amazon_bucket_manager
    • wp_storage_bucket_manager
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
Please take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/advanced-media-manager/composer-setup.php
    • > /wp-content/plugins/advanced-media-manager/vendor/mtdowling/jmespath.php/bin/jp.php
  • 1011× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/advanced-media-manager/vendor/aws/aws-sdk-php/src/KinesisVideo/KinesisVideoClient.php:47
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/advanced-media-manager/vendor/aws/aws-sdk-php/src/Emr/Exception/EmrException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/advanced-media-manager/vendor/aws/aws-sdk-php/src/KinesisVideo/Exception/KinesisVideoException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/advanced-media-manager/vendor/sociallydev/spaces-api/aws/Aws/Redshift/RedshiftClient.php:136
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/advanced-media-manager/vendor/sociallydev/spaces-api/aws/Aws/StorageGateway/StorageGatewayClient.php:136
    • > PHP Fatal error
      Uncaught Error: Interface 'Aws\\MonitoringEventsInterface' not found in wp-content/plugins/advanced-media-manager/vendor/aws/aws-sdk-php/src/S3/RegionalEndpoint/Exception/ConfigurationException.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/advanced-media-manager/vendor/aws/aws-sdk-php/src/CodeCommit/Exception/CodeCommitException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/advanced-media-manager/vendor/aws/aws-sdk-php/src/MediaConnect/MediaConnectClient.php:43
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/advanced-media-manager/vendor/sociallydev/spaces-api/aws/Aws/XRay/XRayClient.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Api\\Serializer\\RestSerializer' not found in wp-content/plugins/advanced-media-manager/vendor/aws/aws-sdk-php/src/Api/Serializer/RestXmlSerializer.php:10

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cloud-images
    • > Console-api (severe) in unknown
    webpack://wp-csv-importer-app/./node_modules/react-dom/cjs/react-dom.development.js? 66:29 "Warning: Invalid DOM property `%s`. Did you mean `%s`?%s" "class" "className" "\n at ul\n at div\n at div\n at App (webpack://wp-csv-importer-app/./admin/app.js?:46:86)\n at AppProvider (webpack://wp-csv-importer-app/./provider.js?:32:86)\n at AppProvider (webpack://wp-csv-importer-app/./providerNew.js?:33:86)\n at div"
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=advanced-media-manager
    • > Console-api (severe) in unknown
    webpack://wp-csv-importer-app/./node_modules/react-dom/cjs/react-dom.development.js? 66:29 "Warning: You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.%s" "\n at input\n at div\n at div\n at div\n at div\n at div\n at div\n at div\n at div\n at div\n at div\n at div\n at MediaDisplay (webpack://wp-csv-importer-app/./admin/media/mediaoptions/mediaDisplay.js?:42:86)\n at App (webpack://wp-csv-importer-app/./admin/app.js?:46:86)\n at AppProvider (webpack://wp-csv-importer-app/./provider.js?:32:86)\n at AppProvider (webpack://wp-csv-importer-app/./providerNew.js?:33:86)\n at div"
    • > GET request to /wp-admin/admin.php?page=advanced-media-manager
    • > Console-api (severe) in unknown
    webpack://wp-csv-importer-app/./node_modules/react-dom/cjs/react-dom.development.js? 66:29 "Warning: Invalid DOM property `%s`. Did you mean `%s`?%s" "for" "htmlFor" "\n at label\n at div\n at div\n at div\n at div\n at div\n at div\n at div\n at div\n at div\n at div\n at div\n at MediaDisplay (webpack://wp-csv-importer-app/./admin/media/mediaoptions/mediaDisplay.js?:42:86)\n at App (webpack://wp-csv-importer-app/./admin/app.js?:46:86)\n at AppProvider (webpack://wp-csv-importer-app/./provider.js?:32:86)\n at AppProvider (webpack://wp-csv-importer-app/./providerNew.js?:33:86)\n at div"
    • > GET request to /wp-admin/admin.php?page=advanced-media-manager
    • > Console-api (severe) in unknown
    webpack://wp-csv-importer-app/./node_modules/react-dom/cjs/react-dom.development.js? 66:29 "Warning: You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.%s" "\n at select\n at div\n at div\n at div\n at div\n at div\n at div\n at div\n at div\n at div\n at div\n at div\n at div\n at div\n at MediaDisplay (webpack://wp-csv-importer-app/./admin/media/mediaoptions/mediaDisplay.js?:42:86)\n at App (webpack://wp-csv-importer-app/./admin/app.js?:46:86)\n at AppProvider (webpack://wp-csv-importer-app/./provider.js?:32:86)\n at AppProvider (webpack://wp-csv-importer-app/./providerNew.js?:33:86)\n at div"
    • > GET request to /wp-admin/admin.php?page=cloud-images
    • > Console-api (severe) in unknown
    webpack://wp-csv-importer-app/./node_modules/react-dom/cjs/react-dom.development.js? 66:29 "Warning: You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.%s" "\n at input\n at div\n at div\n at div\n at div\n at div\n at CloudImage (webpack://wp-csv-importer-app/./admin/media/mediaoptions/cloudImages.js?:43:86)\n at App (webpack://wp-csv-importer-app/./admin/app.js?:46:86)\n at AppProvider (webpack://wp-csv-importer-app/./provider.js?:32:86)\n at AppProvider (webpack://wp-csv-importer-app/./providerNew.js?:33:86)\n at div"

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Cloud Storage Provider Configuration.), #2 (Bucket Section.), #3 (Storage Settings.), #4 (Sync Media.), #5 (Download Media from CDN)
The official readme.txt is a good inspiration

advanced-media-manager/advanced-media-manager.php Passed 13 tests

"Advanced Media Manager" version 2.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
74 characters long description:
Automatically store wp media uploads to Amazon S3 and DigitalOcean Spaces.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin77,168 lines of code in 1,945 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,88510,89548,62459,812
JSON321606,818
CSS5338566,418
Markdown141,08903,438
JavaScript2220264407
SVG100143
reStructuredText1352959
YAML14027
make210022
XML13014
Dockerfile18010

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity5.94
▷ Minimum class complexity1.00
▷ Maximum class complexity153.00
Average method complexity2.49
▷ Minimum method complexity1.00
▷ Maximum method complexity52.00
Code structure
Namespaces483
Interfaces67
Traits28
Classes1,229
▷ Abstract classes211.71%
▷ Concrete classes1,20898.29%
▷ Final classes433.56%
Methods4,389
▷ Static methods62214.17%
▷ Public methods3,11070.86%
▷ Protected methods2235.08%
▷ Private methods1,05624.06%
Functions869
▷ Named functions20623.71%
▷ Anonymous functions66376.29%
Constants354
▷ Global constants92.54%
▷ Class constants34597.46%
▷ Public constants345100.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
43 PNG files occupy 0.43MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/images/file/music.png0.38KB0.61KB0.00%
screenshot-2.png39.00KB9.65KB▼ 75.24%
assets/images/warning.png0.56KB0.24KB▼ 57.02%
assets/images/check-circle.png0.87KB0.38KB▼ 55.83%
assets/css/images/file/file-lock.png0.60KB0.58KB▼ 2.77%