68% cloudbridge-mattermost

Code Review | Cloudbridge Mattermost

WordPress plugin Cloudbridge Mattermost scored68%from 54 tests.

About plugin

  • Plugin page: cloudbridge-matte...
  • Plugin version: 2.2.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 19, 2020
  • Latest release: Aug 9, 2023
  • Number of updates: 19
  • Update frequency: every 52.3 days
  • Top authors: joho68 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /850 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▲2.00ms] Passed 4 tests

This is a short check of server-side resources used by Cloudbridge Mattermost
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0446.88 ▲3.42
Dashboard /wp-admin3.42 ▲0.0759.00 ▼7.54
Posts /wp-admin/edit.php3.47 ▲0.1159.24 ▲9.37
Add New Post /wp-admin/post-new.php5.99 ▲0.11106.65 ▲12.00
Media Library /wp-admin/upload.php3.34 ▲0.1141.56 ▲2.76
Cloudbridge Mattermost /wp-admin/options-general.php?page=cloudbridge-mattermost3.3045.93

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 221 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
cbmm-cloudflare-ipv4
cbmm-cloudflare-ipv6
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Cloudbridge Mattermost
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲3713.21 ▼1.171.61 ▼0.4139.87 ▼3.95
Dashboard /wp-admin2,212 ▲274.88 ▼0.96108.79 ▼3.2741.48 ▼1.32
Posts /wp-admin/edit.php2,092 ▲32.04 ▲0.0340.35 ▲1.6633.86 ▼1.71
Add New Post /wp-admin/post-new.php1,519 ▲517.39 ▼0.11623.99 ▼23.3945.97 ▼4.85
Media Library /wp-admin/upload.php1,394 ▲94.20 ▼0.11100.12 ▼1.8244.57 ▼1.29
Cloudbridge Mattermost /wp-admin/options-general.php?page=cloudbridge-mattermost8622.1923.6328.69

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The plugin did not uninstall correctly, leaving 221 files (3.72MB) in the plugin directory
    • (new file) composer.lock
    • (new file) externals/index.php
    • (new file) README.txt
    • (new file) css/cloudbridge-mattermost.css
    • (new file) cloudbridge-mattermost.php
    • (new file) bin/composer
    • (new file) LICENSE.txt
    • (new file) externals/php-cidr-match-0.2/CIDRmatch/CIDRmatch.php
    • (new file) composer.json
    • (new file) externals/php-cidr-match-0.2/CIDRmatch/index.php
    • ...
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_theysaidso_widget
    • cbmm-cloudflare-ipv6
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • cbmm-cloudflare-ipv4
    • widget_recent-comments

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 everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/cloudbridge-mattermost/uninstall.php
  • 64× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\TransferException' not found in wp-content/plugins/cloudbridge-mattermost/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\UploadedFileInterface' not found in wp-content/plugins/cloudbridge-mattermost/vendor/guzzlehttp/psr7/src/UploadedFile.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/cloudbridge-mattermost/vendor/guzzlehttp/psr7/src/FnStream.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/cloudbridge-mattermost/vendor/guzzlehttp/psr7/src/MultipartStream.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/cloudbridge-mattermost/vendor/psr/http-message/src/ServerRequestInterface.php:43
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\MessageFormatterInterface' not found in wp-content/plugins/cloudbridge-mattermost/vendor/guzzlehttp/guzzle/src/MessageFormatter.php:38
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\BadResponseException' not found in wp-content/plugins/cloudbridge-mattermost/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'League\\OAuth2\\Client\\Grant\\AbstractGrant' not found in wp-content/plugins/cloudbridge-mattermost/vendor/league/oauth2-client/src/Grant/ClientCredentials.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/cloudbridge-mattermost/vendor/psr/http-message/src/RequestInterface.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/cloudbridge-mattermost/vendor/guzzlehttp/promises/src/FulfilledPromise.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration Passed 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
5 plugin tags: cloud, security, mattermost, notifications, integration

cloudbridge-mattermost/cloudbridge-mattermost.php Passed 13 tests

The principal PHP file in "Cloudbridge Mattermost" v. 2.2.0 is loaded by WordPress automatically on each request
36 characters long description:
Mattermost integration for WordPress

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 plugin68,132 lines of code in 191 files:
LanguageFilesBlank linesComment linesLines of code
PHP15647,95640,81262,829
Markdown171,28803,684
JSON12101,246
PO File1117180296
CSS11339
XML10019
make1409
YAML1007
Bourne Shell1203

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity13.62
▷ Minimum class complexity1.00
▷ Maximum class complexity299.00
Average method complexity2.84
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces21
Interfaces30
Traits10
Classes96
▷ Abstract classes22.08%
▷ Concrete classes9497.92%
▷ Final classes3537.23%
Methods977
▷ Static methods14715.05%
▷ Public methods78580.35%
▷ Protected methods697.06%
▷ Private methods12312.59%
Functions126
▷ Named functions3628.57%
▷ Anonymous functions9071.43%
Constants95
▷ Global constants2930.53%
▷ Class constants6669.47%
▷ Public constants5583.33%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/webbplatsen_logo.png9.32KB5.62KB▼ 39.71%