74% meta-locker

Code Review | MetaLocker

WordPress plugin MetaLocker scored74%from 54 tests.

About plugin

  • Plugin page: meta-locker
  • Plugin version: 1.2.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.1.1
  • WordPress version: 6.3.1
  • First release: Jun 14, 2022
  • Latest release: Sep 20, 2023
  • Number of updates: 39
  • Update frequency: every 11.9 days
  • Top authors: wpclevel (46.15%)nabeel323 (28.21%)blackworks1 (12.82%)khushwantsidhu (12.82%)djter3a3 (10.26%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /1,412 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▲430.58ms] 50% from 4 tests

Analyzing server-side resources used by MetaLocker
It is recommended to improve the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 632.87ms on /wp-admin/admin.php?page=metalocker-activation)
  • Extra CPU: Extra CPU usage should be kept under 200.00ms (currently 430.58ms on /wp-admin/admin.php?page=metalocker-activation)
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2852.63 ▲13.74
Dashboard /wp-admin3.36 ▲0.06609.30 ▲556.68
Posts /wp-admin/edit.php3.41 ▲0.05634.22 ▲580.71
Add New Post /wp-admin/post-new.php5.96 ▲0.07664.74 ▲571.17
Media Library /wp-admin/upload.php3.28 ▲0.05624.93 ▲590.22
Meta Locker /wp-admin/admin.php?page=metalocker-tos3.25618.23
Settings /wp-admin/admin.php?page=metalocker-settings3.25627.72
Plugin Activation /wp-admin/admin.php?page=metalocker-activation3.28632.87

Server storage [IO: ▲3.52MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 95 new files
Database: 2 new tables, 8 new options
New tables
meta_wallet_connections
metalocker_sessions
New WordPress options
meta_private_key
widget_recent-comments
meta_public_key
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for MetaLocker
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,034 ▲28819.26 ▲5.01267.35 ▲265.7238.24 ▼4.11
Dashboard /wp-admin2,253 ▲655.87 ▼0.03103.43 ▼3.2841.67 ▼0.91
Posts /wp-admin/edit.php2,135 ▲432.02 ▲0.0241.62 ▲4.3936.28 ▲1.08
Add New Post /wp-admin/post-new.php6,225 ▲4,70419.50 ▼3.68889.33 ▲287.8955.66 ▲6.47
Media Library /wp-admin/upload.php1,435 ▲444.15 ▼0.11108.18 ▲5.0348.12 ▲1.67
Meta Locker /wp-admin/admin.php?page=metalocker-tos9652.1822.4232.13
Settings /wp-admin/admin.php?page=metalocker-settings2,1042.2746.0444.02
Plugin Activation /wp-admin/admin.php?page=metalocker-activation8602.0434.4330.16

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • meta_wallet_connections
    • metalocker_sessions
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • meta_private_key
    • db_upgraded
    • theysaidso_admin_options
    • meta_public_key
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Please fix the following
  • 12× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/meta-locker/frontend/hooks.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Jaybizzle\\CrawlerDetect\\Fixtures\\AbstractProvider' not found in wp-content/plugins/meta-locker/vendor/jaybizzle/crawler-detect/src/Fixtures/Exclusions.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/meta-locker/admin/class-settings-page.php:57
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/meta-locker/frontend/templates/popup.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/meta-locker/meta-locker.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/meta-locker/admin/class-sessions-table.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/meta-locker/admin/class-license-manager.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/meta-locker/admin/class-terms-page.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Jaybizzle\\CrawlerDetect\\Fixtures\\AbstractProvider' not found in wp-content/plugins/meta-locker/vendor/jaybizzle/crawler-detect/src/Fixtures/Headers.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Jaybizzle\\CrawlerDetect\\Fixtures\\AbstractProvider' not found in wp-content/plugins/meta-locker/vendor/jaybizzle/crawler-detect/src/Fixtures/Crawlers.php:14

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: content-locker, password-protected, protected, protect, private

meta-locker/meta-locker.php Passed 13 tests

Analyzing the main PHP file in "MetaLocker" version 1.2.0
115 characters long description:
A content locker WordPress plugin. Users are required to login with their crypto wallet to view the locked content.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin15,888 lines of code in 78 files:
LanguageFilesBlank linesComment linesLines of code
JSON10108,363
PHP376171,4295,799
JavaScript1912698902
Markdown41850555
Sass2340202
YAML215064
CSS4113

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity15.05
▷ Minimum class complexity1.00
▷ Maximum class complexity76.00
Average method complexity3.30
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes21
▷ Abstract classes14.76%
▷ Concrete classes2095.24%
▷ Final classes420.00%
Methods130
▷ Static methods5844.62%
▷ Public methods10480.00%
▷ Protected methods10.77%
▷ Private methods2519.23%
Functions25
▷ Named functions2288.00%
▷ Anonymous functions312.00%
Constants17
▷ Global constants529.41%
▷ Class constants1270.59%
▷ Public constants325.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.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/walletconnect.png29.91KB12.08KB▼ 59.61%