84% norsani-api

Code Review | Norsani API

WordPress plugin Norsani API scored 84% from 54 tests.

About plugin

  • Plugin page: norsani-api
  • Plugin version: 1.3
  • PHP compatiblity: 7.2.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.2.2
  • WordPress version: 5.8.1
  • First release: Jun 18, 2019
  • Latest release: Oct 25, 2019
  • Number of updates: 18
  • Update frequency: every 7.2 days
  • Top authors: Joun007 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 557 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼141.97ms] Passed 4 tests

An overview of server-side resources used by Norsani API
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1235.93 ▲14.51
Dashboard /wp-admin3.06 ▲0.0141.62 ▼4.54
Posts /wp-admin/edit.php3.12 ▲0.0147.60 ▲4.46
Add New Post /wp-admin/post-new.php5.42 ▼0.01100.39 ▼560.37
Media Library /wp-admin/upload.php3.01 ▲0.0131.17 ▼7.43

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 232 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Norsani API
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,713 ▲14115.81 ▲0.3212.02 ▲3.5553.49 ▼1.64
Dashboard /wp-admin2,966 ▲325.91 ▼0.06162.33 ▲0.47118.28 ▲0.26
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0170.10 ▲1.4897.74 ▼1.90
Add New Post /wp-admin/post-new.php1,683 ▼018.74 ▼0.04391.92 ▼4.32115.83 ▼6.03
Media Library /wp-admin/upload.php1,807 ▼05.03 ▼0.01148.64 ▼19.38127.38 ▲2.72

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 104× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Base' not found in wp-content/plugins/norsani-api/vendor/braintree/braintree_php/lib/Braintree/EuropeBankAccount.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Instance' not found in wp-content/plugins/norsani-api/vendor/braintree/braintree_php/lib/Braintree/Transaction/AddressDetails.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Exception' not found in wp-content/plugins/norsani-api/vendor/braintree/braintree_php/lib/Braintree/Exception/Timeout.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Base' not found in wp-content/plugins/norsani-api/vendor/braintree/braintree_php/lib/Braintree/AuthorizationAdjustment.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Collection' not found in wp-content/plugins/norsani-api/vendor/braintree/braintree_php/lib/Braintree/Error/ValidationErrorCollection.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Result\\UsBankAccountVerification' not found in wp-content/plugins/norsani-api/vendor/braintree/braintree_php/lib/Braintree/UsBankAccountVerification.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Exception' not found in wp-content/plugins/norsani-api/vendor/braintree/braintree_php/lib/Braintree/Exception/Configuration.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\MultipleValueNode' not found in wp-content/plugins/norsani-api/vendor/braintree/braintree_php/lib/Braintree/MultipleValueOrTextNode.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Base' not found in wp-content/plugins/norsani-api/vendor/braintree/braintree_php/lib/Braintree/UnknownPaymentMethod.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Base' not found in wp-content/plugins/norsani-api/vendor/braintree/braintree_php/lib/Braintree/RiskData.php:9

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
There were not plugin tags detected

norsani-api/norsani-api.php Passed 13 tests

Analyzing the main PHP file in "Norsani API" version 1.3
28 characters long description:
API to connect with Norsani.

Code Analysis 5% from 3 tests

File types 0% from 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
Please fix the following items
  • Do not include executable or dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/norsani-api/vendor/braintree/braintree_php/lib/ssl/api_braintreegateway_com.ca.crt
16,929 lines of code in 214 files:
LanguageFilesBlank linesComment linesLines of code
PHP1962,2795,37313,021
PO File131,1271,3243,245
Markdown21940571
JSON30092

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity6.57
▷ Minimum class complexity1.00
▷ Maximum class complexity97.00
Average method complexity1.94
▷ Minimum method complexity1.00
▷ Maximum method complexity54.00
Code structure
Namespaces11
Interfaces0
Traits0
Classes189
▷ Abstract classes21.06%
▷ Concrete classes18798.94%
▷ Final classes10.53%
Methods1,028
▷ Static methods42241.05%
▷ Public methods85382.98%
▷ Protected methods545.25%
▷ Private methods12111.77%
Functions73
▷ Named functions1419.18%
▷ Anonymous functions5980.82%
Constants821
▷ Global constants20.24%
▷ Class constants81999.76%
▷ Public constants819100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin