10% dataporten-oauth

Code Review | Dataporten-oAuth

WordPress plugin Dataporten-oAuth scored10%from 54 tests.

About plugin

  • Plugin page: dataporten-oauth
  • Plugin version: 3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.6
  • WordPress version: 6.3.1
  • First release: Jun 21, 2016
  • Latest release: Nov 4, 2016
  • Number of updates: 29
  • Update frequency: every 4.7 days
  • Top authors: kasperrt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /7,597 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/dataporten-oauth/dataporten_oauth.php+663
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

Server metrics [RAM: ▼1.74MB] [CPU: ▼56.14ms] Passed 4 tests

This is a short check of server-side resources used by Dataporten-oAuth
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.24 ▼1.225.01 ▼41.10
Dashboard /wp-admin2.26 ▼1.046.69 ▼46.56
Posts /wp-admin/edit.php2.26 ▼1.096.71 ▼45.47
Add New Post /wp-admin/post-new.php2.26 ▼3.625.87 ▼91.41
Media Library /wp-admin/upload.php2.26 ▼0.965.79 ▼30.76
Dataporten-oAuth /wp-admin/options-general.php?page=Dataporten-oAuth2.266.15

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 9 new files
Database: 1 new table, 19 new options
New tables
wp_dataporten_oauth
New WordPress options
dataporten_oauth_clientsecret
widget_recent-posts
can_compress_scripts
dataporten_hide_native_wp
widget_theysaidso_widget
db_upgraded
dataporten_rolesets
dataporten_http_util_verify_ssl
dataporten_only
dataporten_oauth_clientid
...

Browser metrics Passed 4 tests

A check of browser resources used by Dataporten-oAuth
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲8213.22 ▼0.991.92 ▲0.1646.61 ▲3.58
Dashboard /wp-admin2,214 ▲265.88 ▲0.9999.11 ▼22.4039.72 ▼5.82
Posts /wp-admin/edit.php2,103 ▲112.00 ▼0.0134.47 ▼1.2434.52 ▼2.82
Add New Post /wp-admin/post-new.php1,525 ▲623.03 ▼0.18577.72 ▼77.7869.07 ▲13.60
Media Library /wp-admin/upload.php1,399 ▲114.19 ▲0.0599.74 ▼7.4345.46 ▲0.74
Dataporten-oAuth /wp-admin/options-general.php?page=Dataporten-oAuth1,0072.1523.2726.58

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/dataporten-oauth/dataporten_oauth.php+663
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_dataporten_oauth
  • This plugin does not fully uninstall, leaving 19 options in the database
    • can_compress_scripts
    • dataporten_rolesets
    • widget_recent-posts
    • dataporten_oauth_clientsecret
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • dataporten_oauth_clientid
    • dataporten_http_util
    • dataporten_hide_native_wp
    • dataporten_default_role_enabled
    • ...

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)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=Dataporten-oAuth
    • > Deprecated in wp-content/plugins/dataporten-oauth/dataporten_oauth.php+663
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
    • > GET request to /wp-admin/options-general.php?page=Dataporten-oAuth
    • > Notice in wp-content/plugins/dataporten-oauth/settings-view.php+67
    Array to string conversion

SRP 0% 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
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/dataporten-oauth/dataporten_oauth.php
    • > /wp-content/plugins/dataporten-oauth/login-view.php
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/dataporten-oauth/login-view.php on line 19
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/dataporten-oauth/login-view.php on line 19
    • > PHP Notice
      Undefined variable: button_params in wp-content/plugins/dataporten-oauth/login-view.php on line 19
    • > PHP Notice
      Undefined variable: button_params in wp-content/plugins/dataporten-oauth/login-view.php on line 19
    • > PHP Notice
      Undefined variable: button_params in wp-content/plugins/dataporten-oauth/login-view.php on line 19
    • > PHP Notice
      Undefined variable: button_params in wp-content/plugins/dataporten-oauth/login-view.php on line 19
    • > PHP Notice
      Undefined variable: profile in wp-content/plugins/dataporten-oauth/login-view.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/dataporten-oauth/login-view.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/dataporten-oauth/settings-view.php:14
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/dataporten-oauth/login-view.php on line 19

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)
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 to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === dataporten-oauth === )
You can take inspiration from this readme.txt

dataporten-oauth/dataporten_oauth.php 92% from 13 tests

The primary PHP file in "Dataporten-oAuth" version 3.1 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("dataporten-oauth.php" instead of "dataporten_oauth.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
Everything looks great! No dangerous files found in this plugin920 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP6202274858
CSS14141
JavaScript12321

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity30.50
▷ Minimum class complexity1.00
▷ Maximum class complexity82.00
Average method complexity3.74
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods43
▷ Static methods12.33%
▷ Public methods3376.74%
▷ Protected methods00.00%
▷ Private methods1023.26%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants550.00%
▷ Class constants550.00%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected