79% 1pass

Code Review | 1Pass

WordPress plugin 1Pass scored79%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: 6.3.1
  • 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,324 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.72ms] Passed 4 tests

An overview of server-side resources used by 1Pass
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0542.71 ▲5.50
Dashboard /wp-admin3.34 ▼0.0044.10 ▼14.63
Posts /wp-admin/edit.php3.39 ▲0.0452.33 ▲4.79
Add New Post /wp-admin/post-new.php5.92 ▲0.0489.99 ▼7.95
Media Library /wp-admin/upload.php3.26 ▲0.0436.71 ▲2.91

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 62 new files
Database: no new tables, 10 new options
New WordPress options
onepass_use_content_restrictions
widget_recent-posts
onepass_post_types
widget_theysaidso_widget
theysaidso_admin_options
1pass_children
db_upgraded
widget_recent-comments
onepass_environment
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for 1Pass
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲8013.22 ▼0.971.70 ▲0.0846.48 ▲5.20
Dashboard /wp-admin2,232 ▲444.87 ▼1.02112.00 ▲5.6741.16 ▼0.78
Posts /wp-admin/edit.php2,145 ▲562.02 ▲0.0341.72 ▲6.9136.01 ▼2.00
Add New Post /wp-admin/post-new.php1,537 ▲1823.23 ▲0.14650.51 ▲58.3357.65 ▲7.52
Media Library /wp-admin/upload.php1,417 ▲264.22 ▼0.0296.51 ▲0.3143.10 ▲0.56

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 10 options in the database
    • widget_recent-posts
    • onepass_post_types
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • 1pass_children
    • onepass_environment
    • onepass_use_content_restrictions
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/1pass/views/settings/publishable-key.php
    • > /wp-content/plugins/1pass/vendor/onepass/common/lib/Onepass/Common/Views/JavaScriptTag.php
    • > /wp-content/plugins/1pass/views/settings/secret-key.php
    • > /wp-content/plugins/1pass/vendor/onepass/common/lib/Onepass/Common/Views/ButtonTag.php
  • 53× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function onepass_is_set_up() in wp-content/plugins/1pass/views/settings-page.php:2
    • > PHP Notice
      Undefined variable: article in wp-content/plugins/1pass/vendor/onepass/common/lib/Onepass/Common/Views/ButtonTag.php on line 4
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/1pass/views/1pass-button.php on line 6
    • > 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
    • > PHP Notice
      Undefined variable: set in wp-content/plugins/1pass/views/settings/publishable-key.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/1pass/tests/test-atom-feed.php:5
    • > PHP Notice
      Trying to get property 'url' of non-object in wp-content/plugins/1pass/vendor/onepass/common/lib/Onepass/Common/Views/ButtonTag.php on line 2
    • > 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_action() in wp-content/plugins/1pass/lib/taxonomy.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/1pass/vendor/onepass/common/tests/Onepass/Common/AtomFeedTest.php:7

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

Often overlooked, readme.txt is one of the most important files in your plugin
2 plugin tags: single-article-sales, paywalls

1pass/1pass.php Passed 13 tests

The principal PHP file in "1Pass" v. 1.1.5 is loaded by WordPress automatically on each request
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 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,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

An short overview of 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.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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
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-metabox.png49.96KB14.11KB▼ 71.77%
img/read-more-tag.png43.75KB12.79KB▼ 70.76%
img/1pass-logo.png15.13KB5.46KB▼ 63.91%