78% acf-s3-media-files

Code Review | Advanced Custom Fields: ACF S3 Media Files

WordPress plugin Advanced Custom Fields: ACF S3 Media Files scored 78% from 54 tests.

About plugin

  • Plugin page: acf-s3-media-files
  • Plugin version: 1.1.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.9
  • WordPress version: 5.9.2
  • First release: Feb 6, 2021
  • Latest release: Mar 26, 2022
  • Number of updates: 22
  • Update frequency: every 18.8 days
  • Top authors: codemenschen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,283 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.28MB] [CPU: ▼287.23ms] Passed 4 tests

An overview of server-side resources used by Advanced Custom Fields: ACF S3 Media Files
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.84 ▲0.3255.56 ▲2.35
Dashboard /wp-admin3.69 ▲0.2835.11 ▲1.56
Posts /wp-admin/edit.php3.91 ▲0.2741.53 ▲5.32
Add New Post /wp-admin/post-new.php7.22 ▲0.24101.56 ▼1,153.56
Media Library /wp-admin/upload.php3.63 ▲0.3325.10 ▲0.74

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 1,988 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Advanced Custom Fields: ACF S3 Media Files
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,785 ▲4316.14 ▲0.386.25 ▲0.552.54 ▲0.43
Dashboard /wp-admin2,914 ▲566.15 ▼0.01116.59 ▼23.39152.50 ▼7.21
Posts /wp-admin/edit.php2,710 ▲163.24 ▲0.0165.04 ▲1.59141.67 ▼1.69
Add New Post /wp-admin/post-new.php1,683 ▲2219.23 ▲3.07395.80 ▼10.24156.17 ▲5.76
Media Library /wp-admin/upload.php1,714 ▲165.48 ▼0.02142.58 ▼1.91187.13 ▲1.48

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstall script ran successfully

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 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
Almost there! Just fix the following items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/acf-s3-media-files/vendor/bin/jp.php
    • > /wp-content/plugins/acf-s3-media-files/vendor/mtdowling/jmespath.php/bin/jp.php
  • 820× 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/acf-s3-media-files/vendor/aws/aws-sdk-php/src/LookoutMetrics/LookoutMetricsClient.php:65
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/acf-s3-media-files/vendor/aws/aws-sdk-php/src/GlobalAccelerator/GlobalAcceleratorClient.php:103
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/acf-s3-media-files/vendor/aws/aws-sdk-php/src/Swf/SwfClient.php:84
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/acf-s3-media-files/vendor/aws/aws-sdk-php/src/ServerlessApplicationRepository/Exception/ServerlessApplicationRepositoryException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/acf-s3-media-files/vendor/aws/aws-sdk-php/src/SSOAdmin/SSOAdminClient.php:71
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/acf-s3-media-files/vendor/aws/aws-sdk-php/src/MachineLearning/Exception/MachineLearningException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/acf-s3-media-files/vendor/aws/aws-sdk-php/src/CloudSearchDomain/CloudSearchDomainClient.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Api\\Parser\\AbstractParser' not found in wp-content/plugins/acf-s3-media-files/vendor/aws/aws-sdk-php/src/Api/Parser/Crc32ValidatingParser.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/acf-s3-media-files/vendor/aws/aws-sdk-php/src/ChimeSDKIdentity/ChimeSDKIdentityClient.php:57
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/acf-s3-media-files/vendor/aws/aws-sdk-php/src/Ecr/Exception/EcrException.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: s3, acf, s3 media, acf s3, acf s3 media...

acf-s3-media-files/plugin.php 92% from 13 tests

This is the main PHP file of "Advanced Custom Fields: ACF S3 Media Files" version 1.1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("acf-s3-media-files.php" instead of "plugin.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
Please fix the following items
  • Do not distribute dangerous files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/acf-s3-media-files/vendor/bin/jp.php.bat
      • wp-content/plugins/acf-s3-media-files/vendor/aws/aws-crt-php/run_tests.bat
54,091 lines of code in 1,954 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,8758,24242,89746,166
Markdown271,32603,816
JSON15601,556
C1025089882
C/C++ Header210538441
JavaScript478175368
CSS290283
YAML53057198
Bourne Shell3194176
reStructuredText1352959
GLSL117055
XML10024
m414422
Pascal151514
Bourne Again Shell15013
make1409
DOS Batch2206
INI2003

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity5.31
▷ Minimum class complexity1.00
▷ Maximum class complexity153.00
Average method complexity2.55
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces659
Interfaces60
Traits26
Classes950
▷ Abstract classes171.79%
▷ Concrete classes93398.21%
▷ Final classes576.11%
Methods2,852
▷ Static methods53718.83%
▷ Public methods2,10173.67%
▷ Protected methods1374.80%
▷ Private methods61421.53%
Functions598
▷ Named functions19632.78%
▷ Anonymous functions40267.22%
Constants259
▷ Global constants31.16%
▷ Class constants25698.84%
▷ Public constants24595.70%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/conversation.png1.24KB0.99KB▼ 20.09%
assets/images/ticket.png0.79KB0.54KB▼ 31.59%
assets/images/email.png0.89KB0.65KB▼ 27.14%
assets/images/skype.png1.16KB0.90KB▼ 22.16%