52% linkid

Code Review | linkID

WordPress plugin linkID scored52%from 54 tests.

About plugin

  • Plugin page: linkid
  • Plugin version: 0.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.3
  • WordPress version: 6.3.1
  • First release: Sep 8, 2015
  • Latest release: Sep 8, 2015
  • Number of updates: 8
  • Update frequency: every 0.1 days
  • Top authors: LinkID (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /628 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.16MB] [CPU: ▼45.25ms] Passed 4 tests

This is a short check of server-side resources used by linkID
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.78 ▼0.6912.06 ▼28.65
Dashboard /wp-admin2.86 ▼0.4417.55 ▼30.93
Posts /wp-admin/edit.php2.86 ▼0.5017.35 ▼39.08
Add New Post /wp-admin/post-new.php2.86 ▼3.0315.94 ▼82.35
Media Library /wp-admin/upload.php2.86 ▼0.3715.58 ▼21.83
linkID /wp-admin/options-general.php?page=link_linkid_settings_page2.8717.36

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 100 new files
Database: 1 new table, 8 new options
New tables
wp_linkid_payment
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
link_linkid_payments_table_version
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
link_linkid_settings

Browser metrics Passed 4 tests

This is an overview of browser requirements for linkID
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲10313.18 ▼1.251.81 ▼0.0842.56 ▼6.49
Dashboard /wp-admin2,219 ▲314.84 ▼1.06110.36 ▲6.2539.37 ▼4.70
Posts /wp-admin/edit.php2,102 ▲162.05 ▼0.0141.40 ▲0.6636.03 ▲4.39
Add New Post /wp-admin/post-new.php1,545 ▲3123.32 ▲5.91634.31 ▼39.7460.32 ▲1.86
Media Library /wp-admin/upload.php1,404 ▲134.15 ▼0.1096.68 ▼2.0741.88 ▼7.58
linkID /wp-admin/options-general.php?page=link_linkid_settings_page9222.1925.7830.42

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-includes/class-wp-hook.php+310
    session_start() expects parameter 1 to be array, string given
  • Zombie tables were found after uninstall: 1 table
    • wp_linkid_payment
  • Zombie WordPress options detected upon uninstall: 7 options
    • link_linkid_settings
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=link_linkid_settings_page
    • > Warning in wp-includes/class-wp-hook.php+310
    session_start() expects parameter 1 to be array, string given

SRP 0% 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 take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/linkid/lib/linkid/linkid-sdk-php/examples/LoggedIn.php
    • > /wp-content/plugins/linkid/lib/linkid/linkid-sdk-php/util/index.php
  • 39× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'SoapClient' not found in wp-content/plugins/linkid/lib/linkid/linkid-sdk-php/LinkIDWSSoapClient.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'SoapClient' not found in wp-content/plugins/linkid/lib/linkid/linkid-sdk-php/LinkIDWSSoapClient.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'SoapClient' not found in wp-content/plugins/linkid/lib/linkid/linkid-sdk-php/LinkIDWSSoapClient.php:18
    • > PHP Warning
      Use of undefined constant LINK_WP_LINKID_PLUGIN_URL - assumed 'LINK_WP_LINKID_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/linkid/templates/login-block.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/linkid/templates/payment-block.php:8
    • > PHP Notice
      Trying to get property 'paymentResponse' of non-object in wp-content/plugins/linkid/lib/linkid/linkid-sdk-php/examples/LoggedIn.php on line 40
    • > PHP Fatal error
      Uncaught Error: Class 'SoapClient' not found in wp-content/plugins/linkid/lib/linkid/linkid-sdk-php/LinkIDWSSoapClient.php:18
    • > PHP Notice
      Undefined index: linkID.authnContext in wp-content/plugins/linkid/lib/linkid/linkid-sdk-php/examples/LoggedIn.php on line 26
    • > PHP Fatal error
      Uncaught Error: Class 'SoapClient' not found in wp-content/plugins/linkid/lib/linkid/linkid-sdk-php/LinkIDWSSoapClient.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'SoapClient' not found in wp-content/plugins/linkid/lib/linkid/linkid-sdk-php/LinkIDWSSoapClient.php:18

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Screenshots: Please add an image for screenshot #6 (The customer is redirected to the payment page when linkID is selected as payment method. The payment page shows a QR code your customers can scan using the linkID app on their smartphone, allowing them to pay for their order.)
The official readme.txt might help

linkid/linkid.php 92% from 13 tests

"linkID" version 0.1.2'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

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin5,599 lines of code in 81 files:
LanguageFilesBlank linesComment linesLines of code
PHP721,5861,3564,673
PO File1150340335
CSS2501292
JavaScript4588289
Markdown1406
XML1104

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity10.02
▷ Minimum class complexity1.00
▷ Maximum class complexity81.00
Average method complexity3.53
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes50
▷ Abstract classes48.00%
▷ Concrete classes4692.00%
▷ Final classes00.00%
Methods178
▷ Static methods2916.29%
▷ Public methods15989.33%
▷ Protected methods00.00%
▷ Private methods1910.67%
Functions38
▷ Named functions38100.00%
▷ Anonymous functions00.00%
Constants81
▷ Global constants78.64%
▷ Class constants7491.36%
▷ Public constants74100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
14 PNG files occupy 0.33MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/linkID-logo-square.png8.26KB4.27KB▼ 48.29%
img/linkID-seal-bg.png5.50KB2.78KB▼ 49.53%
img/app-store.png6.33KB2.62KB▼ 58.70%
img/linkID-logo-green-background-small.png3.13KB1.95KB▼ 37.52%
img/linkid-logo-small-white.png4.69KB2.38KB▼ 49.31%