68% leaky-paywall

Code Review | Leaky Paywall

WordPress plugin Leaky Paywall scored68%from 54 tests.

About plugin

  • Plugin page: leaky-paywall
  • Plugin version: 4.20.5
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3.2
  • WordPress version: 6.3.1
  • First release: Dec 17, 2015
  • Latest release: Nov 3, 2023
  • Number of updates: 159
  • Update frequency: every 18.2 days
  • Top authors: zeen101 (100%)

Code review

54 tests

User reviews

28 reviews

Install metrics

1,000+ active /83,935 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲4.35MB] [CPU: ▲17.05ms] Passed 4 tests

An overview of server-side resources used by Leaky Paywall
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /7.89 ▲4.43131.36 ▲88.93
Dashboard /wp-admin7.65 ▲4.3171.42 ▲11.49
Posts /wp-admin/edit.php7.74 ▲4.3963.87 ▲14.14
Add New Post /wp-admin/post-new.php10.26 ▲4.38103.25 ▲6.74
Media Library /wp-admin/upload.php7.55 ▲4.3268.97 ▲35.82
Upgrade /wp-admin/admin.php?page=leaky-paywall-upgrade7.5251.94
Subscribers /wp-admin/admin.php?page=leaky-paywall-subscribers7.5353.70
Settings /wp-admin/admin.php?page=issuem-leaky-paywall7.5357.04
Transactions /wp-admin/edit.php?post_type=lp_transaction7.5955.59
Insights /wp-admin/admin.php?page=leaky-paywall-insights7.5453.98

Server storage [IO: ▲2.60MB] [DB: ▲0.02MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 380 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts
last_zeen101_dot_com_leaky_rss_item
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Leaky Paywall: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,082 ▲33513.35 ▼1.009.54 ▲7.7242.23 ▼1.69
Dashboard /wp-admin2,347 ▲1675.66 ▲0.0494.86 ▼2.5240.05 ▼6.85
Posts /wp-admin/edit.php2,196 ▲961.98 ▼0.0434.24 ▼2.0633.93 ▲2.13
Add New Post /wp-admin/post-new.php1,661 ▲13522.15 ▼0.83673.08 ▼17.1762.56 ▲12.69
Media Library /wp-admin/upload.php1,495 ▲984.28 ▲0.10100.68 ▼1.0541.48 ▼5.26
Upgrade /wp-admin/admin.php?page=leaky-paywall-upgrade9332.1823.6232.16
Subscribers /wp-admin/admin.php?page=leaky-paywall-subscribers1,4831.8029.9531.70
Settings /wp-admin/admin.php?page=issuem-leaky-paywall1,1462.0326.1632.54
Transactions /wp-admin/edit.php?post_type=lp_transaction1,1581.9430.3229.49
Insights /wp-admin/admin.php?page=leaky-paywall-insights1,0072.1531.9630.17

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • last_zeen101_dot_com_leaky_rss_item
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Please fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/leaky-paywall/include/stripe/build.php
    • > /wp-content/plugins/leaky-paywall/include/stripe/update_certs.php
  • 252× 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/leaky-paywall/include/admin/tools.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/leaky-paywall/include/stripe/lib/Terminal/Location.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe_ApiResource' not found in wp-content/plugins/leaky-paywall/include/stripe/lib/Stripe/Transfer.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/leaky-paywall/include/stripe/lib/ApplicationFeeRefund.php:25
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/leaky-paywall/include/stripe/build.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/leaky-paywall/include/stripe/lib/Service/TransferService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/leaky-paywall/include/stripe/lib/Service/CountrySpecService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/leaky-paywall/include/stripe/lib/Token.php:46
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/leaky-paywall/include/stripe/lib/Coupon.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/leaky-paywall/include/stripe/lib/Service/DisputeService.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
10 plugin tags: metered, metered paywall, paid content, metered pay wall, membership...

leaky-paywall/leaky-paywall.php Passed 13 tests

"Leaky Paywall" version 4.20.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
127 characters long description:
The first and most flexible metered paywall for WordPress. Sell subscriptions without sacrificing search and social visibility.

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
These items require your attention
  • Do not distribute dangerous files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/leaky-paywall/include/stripe/data/ca-certificates.crt
      • wp-content/plugins/leaky-paywall/include/stripe/lib/data/ca-certificates.crt
28,780 lines of code in 335 files:
LanguageFilesBlank linesComment linesLines of code
PHP3015,12911,51420,288
CSS5215403,353
PO File21,0831,1152,422
JavaScript153441551,572
Markdown46390952
YAML38368
XML30061
JSON10037
make19027

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 106)
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity5.83
▷ Minimum class complexity1.00
▷ Maximum class complexity190.00
Average method complexity2.34
▷ Minimum method complexity1.00
▷ Maximum method complexity106.00
Code structure
Namespaces23
Interfaces8
Traits7
Classes268
▷ Abstract classes165.97%
▷ Concrete classes25294.03%
▷ Final classes00.00%
Methods1,018
▷ Static methods21921.51%
▷ Public methods93191.45%
▷ Protected methods414.03%
▷ Private methods464.52%
Functions158
▷ Named functions15396.84%
▷ Anonymous functions53.16%
Constants702
▷ Global constants253.56%
▷ Class constants67796.44%
▷ Public constants677100.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
26 PNG files occupy 0.16MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/ui-bg_glass_100_fdf5ce_1x400.png0.40KB0.16KB▼ 60.59%
images/ui-icons_ffffff_256x240.png6.33KB4.18KB▼ 33.99%
images/lock-icon.png1.22KB0.62KB▼ 49.00%
images/ui-icons_ffd27a_256x240.png4.51KB4.18KB▼ 7.28%
images/PP_logo_h_150x38.png2.60KB2.46KB▼ 5.37%