52% wp-stateless

Code Review | WP-Stateless - Google Cloud Storage

WordPress plugin WP-Stateless - Google Cloud Storage scored52%from 54 tests.

About plugin

  • Plugin page: wp-stateless
  • Plugin version: 3.2.5
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Mar 11, 2016
  • Latest release: Oct 17, 2023
  • Number of updates: 117
  • Update frequency: every 23.7 days
  • Top authors: andypotanin (87.18%)alimuzzamanalim (13.68%)

Code review

54 tests

User reviews

44 reviews

Install metrics

5,000+ active /289,397 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲3.64MB] [CPU: ▲2.69ms] Passed 4 tests

Analyzing server-side resources used by WP-Stateless - Google Cloud Storage
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /7.02 ▲3.5651.24 ▲10.81
Dashboard /wp-admin6.96 ▲3.6658.07 ▲9.64
Posts /wp-admin/edit.php7.07 ▲3.7254.33 ▲3.22
Add New Post /wp-admin/post-new.php9.57 ▲3.6892.28 ▼12.90
Media Library /wp-admin/upload.php6.88 ▲3.6650.67 ▲17.88
Stateless Settings /wp-admin/upload.php?page=stateless-settings7.0046.49
Stateless Setup /wp-admin/upload.php?page=stateless-setup6.8640.43
Dashboard /wp-admin/plugins.php?page=meta-box6.9045.20
Licenses /wp-admin/upload.php?page=stateless-settings&page=wpcloud/wp-stateless_licenses6.5745.15

Server storage [IO: ▲10.30MB] [DB: ▲0.05MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 2,145 new files
Database: 1 new table, 13 new options
New tables
wp_sm_sync
New WordPress options
can_compress_scripts
sm_sync_db_version
sm_mode
wp-stateless-current-version
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
dismissed_notice_stateless_cache_busting
udl_wpcloud/wp-stateless-url
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP-Stateless - Google Cloud Storage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8314.38 ▼0.271.72 ▼0.0544.34 ▲0.24
Dashboard /wp-admin2,235 ▲615.66 ▲0.0992.48 ▲0.8738.57 ▲2.10
Posts /wp-admin/edit.php2,117 ▲172.05 ▲0.1134.80 ▼1.6532.20 ▲1.07
Add New Post /wp-admin/post-new.php1,541 ▲622.01 ▲3.77688.95 ▲62.6053.24 ▼11.74
Media Library /wp-admin/upload.php1,423 ▲264.28 ▲0.07101.51 ▲4.3645.56 ▲1.96
Stateless Settings /wp-admin/upload.php?page=stateless-settings3,6964.29134.9836.79
Stateless Setup /wp-admin/upload.php?page=stateless-setup8102.1823.3718.18
Dashboard /wp-admin/plugins.php?page=meta-box1,75613.02264.3363.59
Licenses /wp-admin/upload.php?page=stateless-settings&page=wpcloud/wp-stateless_licenses280.420.094.74

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie tables were found after uninstall: 1 table
    • wp_sm_sync
  • The uninstall procedure has failed, leaving 13 options in the database
    • wp-stateless-current-version
    • ud_ping_wpcloudwp-stateless
    • wp_sm_version
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • udl_wpcloud/wp-stateless-url
    • dismissed_notice_stateless_cache_busting
    • db_upgraded
    • ...

Smoke tests 25% 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)
The smoke test was a success, however most plugin functionality was not tested

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
  • 7× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-stateless/vendor/udx/lib-ud-api-client/static/templates/admin-notice.php
    • > /wp-content/plugins/wp-stateless/vendor/deliciousbrains/wp-background-processing/tests/bootstrap.php
    • > /wp-content/plugins/wp-stateless/vendor/wpmetabox/meta-box/inc/templates/audio.php
    • > /wp-content/plugins/wp-stateless/vendor/wpmetabox/meta-box/inc/templates/media.php
    • > /wp-content/plugins/wp-stateless/vendor/wpmetabox/meta-box/inc/templates/image-advanced.php
    • > /wp-content/plugins/wp-stateless/vendor/wpmetabox/meta-box/inc/templates/upload.php
    • > /wp-content/plugins/wp-stateless/vendor/wpmetabox/meta-box/inc/templates/video.php
  • 923× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/wp-stateless/lib/Google/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/wp-stateless/lib/Google/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/wp-stateless/lib/Google/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Collection' not found in wp-content/plugins/wp-stateless/lib/Google/src/Service/Storage/Notification.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Console\\Formatter\\WrappableOutputFormatterInterface' not found in wp-content/plugins/wp-stateless/vendor/symfony/console/Formatter/OutputFormatter.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\BadResponseException' not found in wp-content/plugins/wp-stateless/lib/Google/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-stateless/vendor/wpmetabox/meta-box/tests/009-datetime.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Collection' not found in wp-content/plugins/wp-stateless/lib/Google/src/Service/Storage/TestIamPermissionsResponse.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\EC\\Curves\\secp192r1' not found in wp-content/plugins/wp-stateless/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/prime192v1.php:16
    • > PHP Fatal error
      Trait 'phpseclib3\\System\\SSH\\Common\\Traits\\ReadBytes' not found in wp-content/plugins/wp-stateless/lib/Google/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php on line 49

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
    • > GET request to /wp-admin/upload.php?page=stateless-settings&page=wpcloud/wp-stateless_licenses
    • > Network (severe)
    wp-admin/upload.php?page=stateless-settings&page=wpcloud/wp-stateless_licenses - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
8 plugin tags: stateless, media, cdn, backup, uploads...

wp-stateless/wp-stateless-media.php 85% from 13 tests

"WP-Stateless - Google Cloud Storage" version 3.2.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-stateless.php" instead of "wp-stateless-media.php")

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Please fix the following items
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .exe - Executable in Windows
      • wp-content/plugins/wp-stateless/vendor/symfony/console/Resources/bin/hiddeninput.exe
170,483 lines of code in 2,017 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,54927,38584,467133,878
JavaScript2453,5114,35812,514
JSON620010,030
Markdown773,21608,794
CSS482841883,507
HTML2140358
YAML10632353
XML7718198
Bourne Shell32927164
XHTML3316162
C23570144
LESS110132
Bourne Again Shell1101460
SVG20156
make2171656
m41111438
C/C++ Header1101825
Dockerfile13014

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 104)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity11.75
▷ Minimum class complexity1.00
▷ Maximum class complexity670.00
Average method complexity2.92
▷ Minimum method complexity1.00
▷ Maximum method complexity104.00
Code structure
Namespaces189
Interfaces128
Traits76
Classes1,271
▷ Abstract classes25920.38%
▷ Concrete classes1,01279.62%
▷ Final classes13913.74%
Methods8,432
▷ Static methods1,43817.05%
▷ Public methods6,79480.57%
▷ Protected methods6938.22%
▷ Private methods94511.21%
Functions558
▷ Named functions20336.38%
▷ Anonymous functions35563.62%
Constants866
▷ Global constants354.04%
▷ Class constants83195.96%
▷ Public constants72487.12%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
33 PNG files occupy 0.32MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
static/scripts/jquery-ui/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png0.12KB0.16KB0.00%
vendor/wpmetabox/meta-box/img/jqueryui/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
static/images/ficon3.png0.54KB0.29KB▼ 46.01%
static/scripts/jquery-ui/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png3.38KB1.68KB▼ 50.10%
static/images/tick.png0.20KB0.19KB▼ 3.50%