83% verify-id-tokens-firebase

Code Review | Verify ID Tokens | Firebase

WordPress plugin Verify ID Tokens | Firebase scored83%from 54 tests.

About plugin

  • Plugin page: verify-id-tokens-...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-5.1.1
  • WordPress version: 6.3.1
  • First release: Mar 25, 2019
  • Latest release: Mar 25, 2019
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: bhoot (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /538 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.35MB] [CPU: ▼16.24ms] Passed 4 tests

This is a short check of server-side resources used by Verify ID Tokens | Firebase
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.82 ▲0.3536.99 ▼2.83
Dashboard /wp-admin3.66 ▲0.3645.63 ▼3.13
Posts /wp-admin/edit.php3.71 ▲0.3549.29 ▼1.15
Add New Post /wp-admin/post-new.php3.47 ▼2.4134.37 ▼57.86
Media Library /wp-admin/upload.php3.52 ▲0.2946.42 ▲8.33

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 244 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Verify ID Tokens | Firebase
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.22 ▼1.364.25 ▲2.1545.10 ▼5.31
Dashboard /wp-admin2,206 ▲215.79 ▼0.10103.27 ▼12.4838.35 ▼5.45
Posts /wp-admin/edit.php2,089 ▼02.01 ▲0.0138.94 ▲0.7235.51 ▼2.23
Add New Post /wp-admin/post-new.php1,541 ▲2723.33 ▲5.82661.68 ▼42.6663.39 ▲9.42
Media Library /wp-admin/upload.php1,391 ▲34.22 ▼0.10112.15 ▼1.9347.99 ▼0.13

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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 take a closer look at the following
  • 100× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Lcobucci\\JWT\\Signer\\BaseSigner' not found in wp-content/plugins/verify-id-tokens-firebase/vendor/lcobucci/jwt/src/Signer/Ecdsa.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/verify-id-tokens-firebase/vendor/psr/http-message/src/RequestInterface.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/verify-id-tokens-firebase/vendor/lcobucci/jwt/test/unit/TokenTest.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\TaskQueueInterface' not found in wp-content/plugins/verify-id-tokens-firebase/vendor/guzzlehttp/promises/src/TaskQueue.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/verify-id-tokens-firebase/vendor/lcobucci/jwt/test/unit/ParserTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Lcobucci\\JWT\\Claim\\Basic' not found in wp-content/plugins/verify-id-tokens-firebase/vendor/lcobucci/jwt/src/Claim/EqualsTo.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/verify-id-tokens-firebase/vendor/guzzlehttp/psr7/src/FnStream.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\SimpleCache\\CacheException' not found in wp-content/plugins/verify-id-tokens-firebase/vendor/psr/simple-cache/src/InvalidArgumentException.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Firebase\\Auth\\Token\\Domain\\Generator' not found in wp-content/plugins/verify-id-tokens-firebase/vendor/kreait/firebase-tokens/src/Handler.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Promise\\RejectionException' not found in wp-content/plugins/verify-id-tokens-firebase/vendor/guzzlehttp/promises/src/AggregateException.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% 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
Please fix the following attributes:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === verify-id-tokens-firebase === )
You can look at the official readme.txt

verify-id-tokens-firebase/verify-id-tokens.php 85% from 13 tests

"Verify ID Tokens | Firebase" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to 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 ("verify-id-tokens-firebase.php" instead of "verify-id-tokens.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected16,019 lines of code in 214 files:
LanguageFilesBlank linesComment linesLines of code
PHP1802,6888,82011,570
Markdown171,15103,480
JSON1100822
YAML37089
XML26049
make1409

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity7.76
▷ Minimum class complexity1.00
▷ Maximum class complexity81.00
Average method complexity2.07
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces22
Interfaces25
Traits3
Classes137
▷ Abstract classes42.92%
▷ Concrete classes13397.08%
▷ Final classes1410.53%
Methods1,036
▷ Static methods696.66%
▷ Public methods88285.14%
▷ Protected methods141.35%
▷ Private methods14013.51%
Functions144
▷ Named functions5739.58%
▷ Anonymous functions8760.42%
Constants126
▷ Global constants10.79%
▷ Class constants12599.21%
▷ Public constants125100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin