79% 1pass

Code Review | 1Pass

WordPress plugin 1Pass scored 79% from 54 tests.

About plugin

  • Plugin page: 1pass
  • Plugin version: 1.1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4.2
  • WordPress version: 5.9.2
  • First release: Nov 18, 2015
  • Latest release: Apr 18, 2016
  • Number of updates: 35
  • Update frequency: every 4.4 days
  • Top authors: duncanjbrown (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,049 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼299.06ms] Passed 4 tests

Server-side resources used by 1Pass
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2061.64 ▲9.53
Dashboard /wp-admin3.55 ▲0.1537.79 ▼17.13
Posts /wp-admin/edit.php3.78 ▲0.1443.32 ▲1.91
Add New Post /wp-admin/post-new.php7.02 ▲0.0598.75 ▼1,183.09
Media Library /wp-admin/upload.php3.43 ▲0.1427.02 ▲2.06

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 62 new files
Database: no new tables, 4 new options
New WordPress options
onepass_post_types
onepass_environment
onepass_use_content_restrictions
1pass_children

Browser metrics Passed 4 tests

This is an overview of browser requirements for 1Pass
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,814 ▲6015.77 ▼0.246.12 ▲0.312.54 ▲0.08
Dashboard /wp-admin2,911 ▲506.07 ▼0.08124.58 ▼15.83203.08 ▲33.26
Posts /wp-admin/edit.php2,757 ▲693.25 ▲0.0163.21 ▼1.66141.80 ▼58.33
Add New Post /wp-admin/post-new.php1,684 ▼616.92 ▼4.62458.05 ▲18.18194.32 ▲27.54
Media Library /wp-admin/upload.php1,735 ▲375.58 ▲0.05150.93 ▲5.13226.46 ▲36.55

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 4 options
    • onepass_use_content_restrictions
    • onepass_post_types
    • onepass_environment
    • 1pass_children

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/1pass/vendor/onepass/common/lib/Onepass/Common/Views/ButtonTag.php
    • > /wp-content/plugins/1pass/views/settings/secret-key.php
    • > /wp-content/plugins/1pass/views/settings/publishable-key.php
    • > /wp-content/plugins/1pass/vendor/onepass/common/lib/Onepass/Common/Views/JavaScriptTag.php
  • 53× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: hash in wp-content/plugins/1pass/vendor/onepass/common/lib/Onepass/Common/Views/ButtonTag.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/1pass/views/1pass-button.php on line 7
    • > PHP Notice
      Trying to get property 'author' of non-object in wp-content/plugins/1pass/vendor/onepass/common/lib/Onepass/Common/Views/ButtonTag.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/1pass/views/1pass-button.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/1pass/tests/test-environments.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function onepass_get_onepass_domain() in wp-content/plugins/1pass/views/1pass-button.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/1pass/lib/restrict-content/restrict-content.php:75
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/1pass/tests/test-credentials.php:3
    • > PHP Notice
      Undefined variable: article in wp-content/plugins/1pass/vendor/onepass/common/lib/Onepass/Common/Views/ButtonTag.php on line 4
    • > PHP Fatal error
      Trait 'Onepass\\Common\\HTTPHelpers' not found in wp-content/plugins/1pass/vendor/onepass/common/lib/Onepass/Common/PublisherAccount.php on line 8

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)
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
2 plugin tags: single-article-sales, paywalls

1pass/1pass.php Passed 13 tests

The entry point to "1Pass" version 1.1.5 is a PHP file that has certain tags in its header comment area
76 characters long description:
Activate, then configure using the 1Pass link in the admin menu to the left.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected1,846 lines of code in 53 files:
LanguageFilesBlank linesComment linesLines of code
PHP403504151,457
Bourne Shell120694
CSS123284
JSON30068
Markdown253065
JavaScript12130
XML20021
HTML20019
YAML1318

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity4.76
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity1.84
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces2
Interfaces0
Traits1
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods78
▷ Static methods22.56%
▷ Public methods6684.62%
▷ Protected methods00.00%
▷ Private methods1215.38%
Functions50
▷ Named functions3774.00%
▷ Anonymous functions1326.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.26MB with 0.18MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/1pass-shortcode.png161.43KB62.40KB▼ 61.34%
img/1pass-logo.png15.13KB5.46KB▼ 63.91%
img/read-more-tag.png43.75KB12.79KB▼ 70.76%
img/1pass-metabox.png49.96KB14.11KB▼ 71.77%