78% stormpath

Code Review | Stormpath

WordPress plugin Stormpath scored78%from 54 tests.

About plugin

  • Plugin page: stormpath
  • Plugin version: 0.1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-4.6.1
  • WordPress version: 6.3.1
  • First release: Sep 26, 2016
  • Latest release: Oct 27, 2016
  • Number of updates: 19
  • Update frequency: every 1.9 days
  • Top authors: bretterer (78.95%)stormpath (26.32%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /944 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
Installer ran successfully

Server metrics [RAM: ▲0.26MB] [CPU: ▼1.31ms] Passed 4 tests

This is a short check of server-side resources used by Stormpath
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2642.85 ▲5.89
Dashboard /wp-admin3.62 ▲0.2754.35 ▼7.33
Posts /wp-admin/edit.php3.67 ▲0.3149.64 ▲1.80
Add New Post /wp-admin/post-new.php6.14 ▲0.2587.55 ▼2.88
Media Library /wp-admin/upload.php3.48 ▲0.2536.96 ▲3.19
Stormpath /wp-admin/options-general.php?page=stormpath3.4433.66

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Stormpath
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲6213.30 ▼1.004.47 ▲2.8736.38 ▼2.88
Dashboard /wp-admin2,217 ▲254.85 ▼0.06111.23 ▼7.8440.61 ▼2.90
Posts /wp-admin/edit.php2,096 ▲72.05 ▲0.0139.61 ▲3.1036.12 ▲1.09
Add New Post /wp-admin/post-new.php1,528 ▼023.25 ▲5.08621.77 ▲4.7747.21 ▼10.26
Media Library /wp-admin/upload.php1,399 ▲84.27 ▲0.0598.44 ▲4.5843.96 ▼0.04
Stormpath /wp-admin/options-general.php?page=stormpath8482.0326.0925.71

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/stormpath/includes/admin/settings.php
    • > /wp-content/plugins/stormpath/vendor/firebase/php-jwt/tests/bootstrap.php
  • 307× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Stormpath\\Provider\\ProviderAccountRequest' not found in wp-content/plugins/stormpath/vendor/stormpath/sdk/src/Provider/LinkedInProviderAccountRequest.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Stormpath\\Resource\\AbstractCollectionResource' not found in wp-content/plugins/stormpath/vendor/stormpath/sdk/src/Resource/AccountList.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Stormpath\\Mfa\\Factor' not found in wp-content/plugins/stormpath/vendor/stormpath/sdk/src/Mfa/SmsFactor.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Stormpath\\Resource\\InstanceResource' not found in wp-content/plugins/stormpath/vendor/stormpath/sdk/src/Mfa/Factor.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/stormpath/vendor/guzzlehttp/psr7/tests/ServerRequestTest.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Discovery\\Exception' not found in wp-content/plugins/stormpath/vendor/php-http/discovery/src/Exception/ClassInstantiationFailedException.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Stormpath\\Resource\\AbstractCollectionResource' not found in wp-content/plugins/stormpath/vendor/stormpath/sdk/src/Mail/UnmodeledEmailTemplateList.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Client\\Common\\Plugin' not found in wp-content/plugins/stormpath/vendor/php-http/client-common/src/Plugin/HeaderAppendPlugin.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Client\\Common\\Plugin' not found in wp-content/plugins/stormpath/vendor/php-http/client-common/src/Plugin/HeaderSetPlugin.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Stormpath\\Resource\\AbstractCollectionResource' not found in wp-content/plugins/stormpath/vendor/stormpath/sdk/src/Resource/ApiKeyList.php:24

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === stormpath === )
The official readme.txt is a good inspiration

stormpath/stormpath.php 92% from 13 tests

"Stormpath" version 0.1.6'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: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin74,809 lines of code in 543 files:
LanguageFilesBlank linesComment linesLines of code
PHP45834,98534,45667,675
YAML25140893,204
JSON17002,290
Markdown3390101,340
XML61125194
Bourne Shell322484
make17022

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 104)
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity11.74
▷ Minimum class complexity1.00
▷ Maximum class complexity591.00
Average method complexity2.74
▷ Minimum method complexity1.00
▷ Maximum method complexity104.00
Code structure
Namespaces83
Interfaces49
Traits18
Classes380
▷ Abstract classes143.68%
▷ Concrete classes36696.32%
▷ Final classes5414.75%
Methods3,001
▷ Static methods1605.33%
▷ Public methods2,72790.87%
▷ Protected methods1083.60%
▷ Private methods1665.53%
Functions208
▷ Named functions3215.38%
▷ Anonymous functions17684.62%
Constants613
▷ Global constants233.75%
▷ Class constants59096.25%
▷ Public constants590100.00%

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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
includes/images/dashicon.png1.55KB0.68KB▼ 56.21%