10% lock-pattern

Code Review | Pattern Lock

WordPress plugin Pattern Lock scored10%from 54 tests.

About plugin

  • Plugin page: lock-pattern
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.6
  • WordPress version: 6.3.1
  • First release: Sep 5, 2016
  • Latest release: Sep 5, 2016
  • Number of updates: 4
  • Update frequency: every 0.5 days
  • Top authors: mndpsingh287 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /670 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/lock-pattern/pattern_lock.php+68
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.05MB] [CPU: ▼2.26ms] Passed 4 tests

Server-side resources used by Pattern Lock
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0634.73 ▼6.67
Dashboard /wp-admin3.36 ▲0.0644.54 ▼5.02
Posts /wp-admin/edit.php3.41 ▲0.0554.14 ▲7.49
Add New Post /wp-admin/post-new.php5.94 ▲0.0592.53 ▲1.89
Media Library /wp-admin/upload.php3.28 ▲0.0535.93 ▲0.75
Pattern Lock /wp-admin/admin.php?page=pattern_lock3.2531.96
Settings /wp-admin/admin.php?page=pattern_lock_settings3.2730.95

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 14 new files
Database: 1 new table, 7 new options
New tables
wp_pattern_lock
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
pattern_lock_options

Browser metrics Passed 4 tests

A check of browser resources used by Pattern Lock
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,907 ▲16113.70 ▼0.891.70 ▼0.1140.84 ▼9.65
Dashboard /wp-admin2,313 ▲1255.09 ▲0.19120.31 ▲6.2137.29 ▼13.52
Posts /wp-admin/edit.php2,196 ▲1072.25 ▲0.2448.10 ▲9.8335.64 ▼0.22
Add New Post /wp-admin/post-new.php1,603 ▲6623.27 ▼0.06691.35 ▲16.4440.58 ▼22.06
Media Library /wp-admin/upload.php1,492 ▲1044.30 ▲0.09117.70 ▲13.9042.28 ▼3.84
Pattern Lock /wp-admin/admin.php?page=pattern_lock9171.8342.5027.21
Settings /wp-admin/admin.php?page=pattern_lock_settings1,0911.9837.5530.01

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie tables were found after uninstall: 1 table
    • wp_pattern_lock
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • pattern_lock_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=pattern_lock
    • > Notice in wp-content/plugins/lock-pattern/inc/pattern_lock_admin.php+19
    Trying to get property 'lock_password' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pattern_lock_settings
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/lock-pattern/inc/pattern_request_check.php+7
    count(): Parameter must be an array or an object that implements Countable

SRP 50% 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
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/lock-pattern/pattern_lock.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
10 plugin tags: wp-admin, lock, password, pattern, pattern settings...

lock-pattern/pattern_lock.php 92% from 13 tests

The primary PHP file in "Pattern Lock" version 1.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("lock-pattern.php" instead of "pattern_lock.php")

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 detected2,135 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript23801701,555
PHP91260569
CSS10011

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity1.86
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods17.14%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin