83% qbank-dam-connector

Code Review | QBank Connector

WordPress plugin QBank Connector scored 83% from 54 tests.

About plugin

  • Plugin page: qbank-dam-connector
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.7.1
  • WordPress version: 6.3.1
  • First release: Feb 7, 2017
  • Latest release: Apr 28, 2021
  • Number of updates: 22
  • Update frequency: every 70.0 days
  • Top authors: qbank (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 2,680 total downloads

Benchmarks

Plugin footprint 83% 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.44MB] [CPU: ▲7.84ms] Passed 4 tests

Analyzing server-side resources used by QBank Connector
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.4651.75 ▲1.36
Dashboard /wp-admin3.77 ▲0.4656.48 ▲5.51
Posts /wp-admin/edit.php3.82 ▲0.4657.82 ▲12.19
Add New Post /wp-admin/post-new.php7.36 ▲1.472,038.59 ▲1,944.39
Media Library /wp-admin/upload.php3.61 ▲0.3846.57 ▲12.31
QBank Connector /wp-admin/options-general.php?page=qbank-settings3.6141.18

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 582 new files
Database: no new tables, 16 new options
New WordPress options
qbank_username
qbank_default_image_size
qbank_password
widget_recent-comments
theysaidso_admin_options
qbank_host
widget_recent-posts
qbank_default_image_extension
qbank_session_source_id
qbank_client_id
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for QBank Connector
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,941 ▲19514.94 ▲0.541.85 ▼0.0643.38 ▼1.14
Dashboard /wp-admin2,347 ▲1566.43 ▲1.55132.27 ▲14.7940.05 ▼4.31
Posts /wp-admin/edit.php2,256 ▲1673.30 ▲1.2552.44 ▲16.4931.60 ▼4.38
Add New Post /wp-admin/post-new.php1,684 ▲16222.66 ▼0.68653.75 ▼30.0332.06 ▼29.29
Media Library /wp-admin/upload.php1,397 ▲124.15 ▼0.0780.15 ▼21.0541.55 ▼1.50
QBank Connector /wp-admin/options-general.php?page=qbank-settings1,1542.9945.9827.54

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 16 options
    • widget_recent-comments
    • qbank_download_file
    • widget_recent-posts
    • qbank_username
    • qbank_default_image_size
    • theysaidso_admin_options
    • qbank_deployment_site_id
    • qbank_password
    • qbank_default_image_extension
    • qbank_host
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 282× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/qbank-dam-connector/vendor/sainsburys/guzzle-oauth2-plugin/tests/TestBase.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Stream\\StreamInterface' not found in wp-content/plugins/qbank-dam-connector/vendor/guzzlehttp/guzzle/src/Post/MultipartBody.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Event\\SubscriberInterface' not found in wp-content/plugins/qbank-dam-connector/vendor/guzzlehttp/guzzle/src/Subscriber/Prepare.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'QBNK\\QBank\\API\\Model\\Category' not found in wp-content/plugins/qbank-dam-connector/vendor/qbnk/qbank3api-phpwrapper/Model/CategoryResponse.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'React\\Promise\\TestCase' not found in wp-content/plugins/qbank-dam-connector/vendor/react/promise/tests/DeferredTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Doctrine\\Common\\Cache\\CacheProvider' not found in wp-content/plugins/qbank-dam-connector/vendor/doctrine/cache/lib/Doctrine/Common/Cache/SQLite3Cache.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'QBNK\\QBank\\API\\Exception\\QBankApiException' not found in wp-content/plugins/qbank-dam-connector/vendor/qbnk/qbank3api-phpwrapper/Exception/ResponseException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'QBNK\\QBank\\API\\Model\\Moodboard' not found in wp-content/plugins/qbank-dam-connector/vendor/qbnk/qbank3api-phpwrapper/Model/MoodboardResponse.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'React\\Promise\\TestCase' not found in wp-content/plugins/qbank-dam-connector/vendor/react/promise/tests/FulfilledPromiseTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\TransferException' not found in wp-content/plugins/qbank-dam-connector/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === qbank-dam-connector === )
  • Screenshots: Add an image for screenshot #1 (/screenshot-1.png)
The official readme.txt might help

qbank-dam-connector/qbank.php 77% from 13 tests

The primary PHP file in "QBank Connector" version 1.1.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Domain Path: The domain path folder does not exist ("/languages/")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("qbank-dam-connector.php" instead of "qbank.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected50,492 lines of code in 543 files:
LanguageFilesBlank linesComment linesLines of code
PHP4668,67717,52143,094
Markdown241,47104,644
JSON19001,363
reStructuredText10351433603
make4455181
JavaScript11860163
YAML8371159
XML7161153
Ant113097
Python14019
Dockerfile18010
INI1106

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity9.61
▷ Minimum class complexity1.00
▷ Maximum class complexity153.00
Average method complexity2.13
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces56
Interfaces51
Traits19
Classes372
▷ Abstract classes164.30%
▷ Concrete classes35695.70%
▷ Final classes164.49%
Methods3,501
▷ Static methods2126.06%
▷ Public methods3,02086.26%
▷ Protected methods2527.20%
▷ Private methods2296.54%
Functions477
▷ Named functions13728.72%
▷ Anonymous functions34071.28%
Constants254
▷ Global constants6023.62%
▷ Class constants19476.38%
▷ Public constants19097.94%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.74MB with 0.54MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png759.11KB208.01KB▼ 72.60%