79% questpass

Code Review | Questpass

WordPress plugin Questpass scored79%from 54 tests.

About plugin

  • Plugin page: questpass
  • Plugin version: 2.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.9
  • WordPress version: 6.3.1
  • First release: Oct 8, 2021
  • Latest release: Mar 2, 2022
  • Number of updates: 12
  • Update frequency: every 12.1 days
  • Top authors: questpass (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /454 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.64MB] [CPU: ▼4.53ms] Passed 4 tests

This is a short check of server-side resources used by Questpass
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.17 ▲0.7142.88 ▲5.93
Dashboard /wp-admin3.97 ▲0.6347.02 ▼11.56
Posts /wp-admin/edit.php4.02 ▲0.6748.65 ▼2.40
Add New Post /wp-admin/post-new.php6.56 ▲0.6889.41 ▼4.59
Media Library /wp-admin/upload.php3.83 ▲0.6037.14 ▲0.43
Questpass /wp-admin/options-general.php?page=questpass_admin_page3.9741.27

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 285 new files
Database: 1 new table, 13 new options
New tables
wp_questpass_subscription_users
New WordPress options
questpass_javascript
widget_recent-posts
questpass_javascript_update_date
can_compress_scripts
widget_recent-comments
questpass_active_campaigns_status
questpass_subscriptions_status
questpass_service_status
widget_theysaidso_widget
theysaidso_admin_options
...

Browser metrics Passed 4 tests

Checking browser requirements for Questpass
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.63 ▲0.281.70 ▲0.1641.01 ▲1.23
Dashboard /wp-admin2,196 ▲165.53 ▼0.1581.10 ▼2.6436.36 ▼6.24
Posts /wp-admin/edit.php2,104 ▲42.00 ▲0.0036.82 ▼2.1833.47 ▼1.99
Add New Post /wp-admin/post-new.php6,254 ▲4,72625.96 ▲2.93912.41 ▲278.0255.89 ▼6.42
Media Library /wp-admin/upload.php1,407 ▲74.22 ▼0.0395.72 ▼18.5045.05 ▲0.07
Questpass /wp-admin/options-general.php?page=questpass_admin_page1,0942.0322.5735.26

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • 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)
The smoke test was a success, however most plugin functionality was not tested

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
Please take a closer look at the following
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/questpass/vendor_prefixed/adquesto/adquesto-php-sdk/examples/example_manualprepare.php
    • > /wp-content/plugins/questpass/vendor_prefixed/adquesto/adquesto-php-sdk/examples/example_autoprepare.php
    • > /wp-content/plugins/questpass/vendor_prefixed/adquesto/adquesto-php-sdk/examples/example_webhook.php
  • 157× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'QuestpassVendor\\GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/questpass/vendor_prefixed/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'QuestpassVendor\\Psr\\Http\\Client\\ClientExceptionInterface' not found in wp-content/plugins/questpass/vendor_prefixed/guzzlehttp/guzzle/src/Exception/GuzzleException.php:6
    • > PHP Warning
      include(./vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/questpass/vendor_prefixed/adquesto/adquesto-php-sdk/examples/example_basic.php on line 7
    • > PHP Fatal error
      Uncaught Error: Interface 'QuestpassVendor\\Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/questpass/vendor_prefixed/psr/http-message/src/ServerRequestInterface.php:43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/questpass/templates/components/fields/post/multi-checkbox.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'QuestpassVendor\\Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/questpass/vendor_prefixed/guzzlehttp/psr7/src/FnStream.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Questpass\\Logger\\LoggerInterface' not found in wp-content/plugins/questpass/src/Logger/WordpressLogger.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'QuestpassVendor\\GuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/questpass/vendor_prefixed/guzzlehttp/guzzle/src/Pool.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/questpass/templates/components/fields/post/text.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'QuestpassVendor\\League\\OAuth2\\Client\\Provider\\ResourceOwnerInterface' not found in wp-content/plugins/questpass/vendor_prefixed/league/oauth2-client/src/Provider/GenericResourceOwner.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: publishers, paywall, ads, subscriptions, advertising...

questpass/questpass.php Passed 13 tests

The main file in "Questpass" v. 2.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
66 characters long description:
Questpass plugin displays ads based on the idea of questvertising.

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 plugin15,888 lines of code in 277 files:
LanguageFilesBlank linesComment linesLines of code
PHP2681,2959,35714,808
JSON100845
PO File13849138
JavaScript25040
XML20037
CSS21017
Bourne Shell1203

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity9.23
▷ Minimum class complexity1.00
▷ Maximum class complexity249.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity66.00
Code structure
Namespaces40
Interfaces42
Traits10
Classes186
▷ Abstract classes52.69%
▷ Concrete classes18197.31%
▷ Final classes3418.78%
Methods1,413
▷ Static methods16211.46%
▷ Public methods1,17483.09%
▷ Protected methods805.66%
▷ Private methods15911.25%
Functions135
▷ Named functions3828.15%
▷ Anonymous functions9771.85%
Constants191
▷ Global constants2513.09%
▷ Class constants16686.91%
▷ Public constants15593.37%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.20MB with 0.07MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/questpass-sygnet.png0.44KB0.56KB0.00%
assets/img/guestpass-widget.png207.77KB59.73KB▼ 71.25%