84% keyring

Code Review | Keyring

WordPress plugin Keyring scored84%from 54 tests.

About plugin

  • Plugin page: keyring
  • Plugin version: 3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Mar 18, 2012
  • Latest release: Apr 26, 2023
  • Number of updates: 112
  • Update frequency: every 37.6 days
  • Top authors: beaulebens (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

3,000+ active /90,600 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.61MB] [CPU: ▲6.00ms] Passed 4 tests

Server-side resources used by Keyring
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.12 ▲0.6646.61 ▲2.62
Dashboard /wp-admin3.94 ▲0.6454.45 ▲3.96
Posts /wp-admin/edit.php3.99 ▲0.6454.36 ▲10.51
Add New Post /wp-admin/post-new.php6.46 ▲0.5798.99 ▲10.72
Media Library /wp-admin/upload.php3.80 ▲0.5742.66 ▲6.92
Keyring /wp-admin/tools.php?page=keyring3.7736.29

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 61 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Keyring
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4713.26 ▼1.392.16 ▲0.0046.47 ▲0.02
Dashboard /wp-admin2,207 ▲164.85 ▼0.05121.97 ▲6.4647.63 ▲1.56
Posts /wp-admin/edit.php2,093 ▲72.01 ▲0.0444.05 ▲9.4039.32 ▲2.26
Add New Post /wp-admin/post-new.php1,536 ▲1723.40 ▼0.22671.05 ▼17.54101.68 ▲49.91
Media Library /wp-admin/upload.php1,392 ▲44.22 ▲0.05108.66 ▲8.0646.46 ▲2.59
Keyring /wp-admin/tools.php?page=keyring8412.0228.9130.45

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
  • 49× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Keyring_Service_OAuth2' not found in wp-content/plugins/keyring/includes/services/extended/runkeeper.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Keyring_Service_OAuth1' not found in wp-content/plugins/keyring/includes/services/extended/500px.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/keyring/store.php:53
    • > PHP Fatal error
      Uncaught Error: Class 'Keyring_Service_OAuth1' not found in wp-content/plugins/keyring/includes/services/extended/yahoo.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Keyring_Service_OAuth2' not found in wp-content/plugins/keyring/includes/services/extended/fitbit.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Keyring_Service_OAuth2' not found in wp-content/plugins/keyring/includes/services/extended/nest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/keyring/includes/oauth-php/tests/OAuthSignatureMethodRsaSha1Test.php:7
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/keyring/admin-ui.php on line 270
    • > PHP Fatal error
      Uncaught Error: Class 'Keyring_Service_OAuth1' not found in wp-content/plugins/keyring/includes/services/extended/tumblr.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Keyring_Service_OAuth1' not found in wp-content/plugins/keyring/includes/services/extended/twitter.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 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
10 plugin tags: twitter, http basic, security, oauth, authentication...

keyring/keyring.php 92% from 13 tests

The main PHP script in "Keyring" version 3.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 320 characters long)

Code Analysis Passed 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
Success! There were no dangerous files found in this plugin6,297 lines of code in 56 files:
LanguageFilesBlank linesComment linesLines of code
PHP511,2771,0845,796
PO File1119134403
XML2141763
JSON10019
Markdown11016

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity9.01
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity2.27
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes68
▷ Abstract classes45.88%
▷ Concrete classes6494.12%
▷ Final classes00.00%
Methods448
▷ Static methods388.48%
▷ Public methods43697.32%
▷ Protected methods20.45%
▷ Private methods102.23%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants82
▷ Global constants78.54%
▷ Class constants7591.46%
▷ Public constants75100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/pocket.png7.34KB3.54KB▼ 51.77%