84% selectel-storage-upload

Code Review | Selectel Storage Upload

WordPress plugin Selectel Storage Upload scored84%from 54 tests.

About plugin

  • Plugin page: selectel-storage-...
  • Plugin version: 2.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.8
  • WordPress version: 6.3.1
  • First release: Jul 14, 2014
  • Latest release: Aug 1, 2017
  • Number of updates: 28
  • Update frequency: every 39.9 days
  • Top authors: Mauhem (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

40+ active /3,254 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.21MB] [CPU: ▼1.21ms] Passed 4 tests

An overview of server-side resources used by Selectel Storage Upload
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2042.86 ▲7.48
Dashboard /wp-admin3.51 ▲0.2151.34 ▲4.43
Posts /wp-admin/edit.php3.63 ▲0.2746.42 ▲0.91
Add New Post /wp-admin/post-new.php6.11 ▲0.2382.15 ▼9.61
Media Library /wp-admin/upload.php3.44 ▲0.2136.07 ▼0.56
Selectel Upload /wp-admin/options-general.php?page=selectel-storage-upload/code.php3.4140.20

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 94 new files
Database: no new tables, 9 new options
New WordPress options
selupload_path_in_storage
selupload_filter
selupload_auth
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Selectel Storage Upload
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲6213.22 ▼1.401.73 ▲0.0444.78 ▲3.46
Dashboard /wp-admin2,214 ▲294.88 ▼0.99111.25 ▲7.5644.32 ▲0.56
Posts /wp-admin/edit.php2,094 ▲52.01 ▼0.0233.74 ▼1.9333.92 ▼2.23
Add New Post /wp-admin/post-new.php1,524 ▲523.46 ▲0.44597.42 ▼27.7749.33 ▼2.85
Media Library /wp-admin/upload.php1,396 ▲84.22 ▲0.0695.14 ▼2.7741.20 ▼1.53
Selectel Upload /wp-admin/options-general.php?page=selectel-storage-upload/code.php1,1242.1925.1235.32

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • selupload_path_in_storage
    • selupload_filter
    • db_upgraded
    • selupload_auth
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
  • 33× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/selectel-storage-upload/code.php:48
    • > PHP Fatal error
      Uncaught Error: Class 'OpenStackStorage\\Exceptions\\Error' not found in wp-content/plugins/selectel-storage-upload/vendor/endeveit/open-stack-storage/src/Exceptions/ContainerNotPublic.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'OpenStackStorageTest\\Base' not found in wp-content/plugins/selectel-storage-upload/vendor/endeveit/open-stack-storage/tests/src/ObjectTest.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'OpenStackStorageTest\\Base' not found in wp-content/plugins/selectel-storage-upload/vendor/endeveit/open-stack-storage/tests/src/AuthenticationTest.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'OpenStackStorage\\Exceptions\\Error' not found in wp-content/plugins/selectel-storage-upload/vendor/endeveit/open-stack-storage/src/Exceptions/ContainerExists.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'OpenStackStorage\\Exceptions\\Error' not found in wp-content/plugins/selectel-storage-upload/vendor/endeveit/open-stack-storage/src/Exceptions/InvalidMetaName.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'OpenStackStorage\\Exceptions\\Error' not found in wp-content/plugins/selectel-storage-upload/vendor/endeveit/open-stack-storage/src/Exceptions/AuthenticationError.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Psr\\Log\\AbstractLogger' not found in wp-content/plugins/selectel-storage-upload/vendor/psr/log/Psr/Log/NullLogger.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Resty\\Resty' not found in wp-content/plugins/selectel-storage-upload/vendor/endeveit/open-stack-storage/src/Client.php:16
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/selectel-storage-upload/vendor/resty/resty/tests/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/selectel-storage-upload/vendor/resty/resty/tests/tests.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: storage, cloud, selectel, media library, openstack...

selectel-storage-upload/supload.php 85% from 13 tests

The main file in "Selectel Storage Upload" v. 2.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("selectel-storage-upload.php" instead of "supload.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected5,043 lines of code in 70 files:
LanguageFilesBlank linesComment linesLines of code
PHP518542,4293,707
PO File3133159464
JSON600346
Markdown51310343
JavaScript11090
CSS11140
XML20038
Bourne Shell14215

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity7.91
▷ Minimum class complexity1.00
▷ Maximum class complexity90.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces9
Interfaces2
Traits2
Classes40
▷ Abstract classes25.00%
▷ Concrete classes3895.00%
▷ Final classes00.00%
Methods237
▷ Static methods62.53%
▷ Public methods21088.61%
▷ Protected methods2410.13%
▷ Private methods31.27%
Functions37
▷ Named functions2464.86%
▷ Anonymous functions1335.14%
Constants21
▷ Global constants523.81%
▷ Class constants1676.19%
▷ Public constants16100.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
1 PNG file occupies 0.45MB with 0.26MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
vendor/endeveit/open-stack-storage/tests/fixtures/container-1/Lenna.png462.14KB192.04KB▼ 58.45%