77% woocommerce-pay-per-post

Code Review | Pay For Post with WooCommerce

WordPress plugin Pay For Post with WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: woocommerce-pay-p...
  • Plugin version: 3.1.13
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-6.2.2
  • WordPress version: 6.3.1
  • First release: May 16, 2014
  • Latest release: Oct 20, 2023
  • Number of updates: 103
  • Update frequency: every 33.5 days
  • Top authors: mattpramschufer (100%)

Code review

54 tests

User reviews

53 reviews

Install metrics

2,000+ active /85,577 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.00ms] Passed 4 tests

This is a short check of server-side resources used by Pay For Post with WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0037.22 ▼0.38
Dashboard /wp-admin3.31 ▲0.0143.88 ▼3.08
Posts /wp-admin/edit.php3.36 ▲0.0045.07 ▲0.18
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.06 ▼14.50
Media Library /wp-admin/upload.php3.24 ▲0.0031.64 ▼2.02

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 1,416 new files
Database: no new tables, 9 new options
New WordPress options
fs_debug_mode
can_compress_scripts
widget_theysaidso_widget
fs_accounts
db_upgraded
theysaidso_admin_options
widget_recent-comments
fs_active_plugins
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Pay For Post with WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▼0.241.57 ▲0.0337.79 ▼3.90
Dashboard /wp-admin2,192 ▲185.54 ▼0.0584.33 ▼2.2139.70 ▼3.92
Posts /wp-admin/edit.php2,097 ▼32.01 ▼0.0134.09 ▼0.9430.79 ▼3.66
Add New Post /wp-admin/post-new.php1,526 ▼022.83 ▼0.18660.03 ▼6.5463.61 ▲8.03
Media Library /wp-admin/upload.php1,400 ▼34.23 ▲0.06105.88 ▲7.2247.39 ▲3.84

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 9 options
    • widget_recent-posts
    • widget_recent-comments
    • fs_debug_mode
    • fs_accounts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • fs_active_plugins
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/woocommerce-pay-per-post/public/partials/shortcode-remaining.php
  • 244× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Pramadillo\\PayForPost\\Monolog\\Handler\\SocketHandler' not found in wp-content/plugins/woocommerce-pay-per-post/vendor-prefixed/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'Pramadillo\\PayForPost\\Symfony\\Component\\Translation\\Dumper\\DumperInterface' not found in wp-content/plugins/woocommerce-pay-per-post/vendor-prefixed/symfony/translation/Dumper/FileDumper.php:29
    • > PHP Fatal error
      Uncaught Error: Interface 'PHPStan\\Reflection\\Php\\BuiltinMethodReflection' not found in wp-content/plugins/woocommerce-pay-per-post/vendor-prefixed/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php:39
    • > PHP Fatal error
      Uncaught Error: Interface 'Pramadillo\\PayForPost\\Symfony\\Component\\Translation\\Formatter\\MessageFormatterInterface' not found in wp-content/plugins/woocommerce-pay-per-post/vendor-prefixed/symfony/translation/Formatter/MessageFormatter.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'Pramadillo\\PayForPost\\Carbon\\Exceptions\\InvalidArgumentException' not found in wp-content/plugins/woocommerce-pay-per-post/vendor-prefixed/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php:20
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/woocommerce-pay-per-post/public/partials/shortcode-has_access-polylang.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'Pramadillo\\PayForPost\\Monolog\\Handler\\AbstractHandler' not found in wp-content/plugins/woocommerce-pay-per-post/vendor-prefixed/monolog/monolog/src/Monolog/Handler/FilterHandler.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Pramadillo\\PayForPost\\Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/woocommerce-pay-per-post/vendor-prefixed/monolog/monolog/src/Monolog/Handler/RavenHandler.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Pramadillo\\PayForPost\\Monolog\\Handler\\MailHandler' not found in wp-content/plugins/woocommerce-pay-per-post/vendor-prefixed/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php:26
    • > PHP Notice
      Undefined variable: purchased in wp-content/plugins/woocommerce-pay-per-post/public/partials/shortcode-purchased.php on line 8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 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
7 plugin tags: sell content, woo commerce, sell pages, pay for post, payforpost...

woocommerce-pay-per-post/woocommerce-pay-per-post.php 85% from 13 tests

The principal PHP file in "Pay For Post with WooCommerce" v. 3.1.13 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.8" instead of "2.6")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected116,121 lines of code in 1,147 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,09616,96948,44378,237
JSON80022,590
JavaScript121,2131,3079,500
XSD392482,803
PO File38081,6862,518
CSS176716294
Markdown5520161
XML13016
SVG2002

PHP code 0% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
The following items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,088)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 160)
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity24.88
▷ Minimum class complexity1.00
▷ Maximum class complexity3,088.00
Average method complexity3.58
▷ Minimum method complexity1.00
▷ Maximum method complexity160.00
Code structure
Namespaces38
Interfaces35
Traits31
Classes283
▷ Abstract classes217.42%
▷ Concrete classes26292.58%
▷ Final classes93.44%
Methods3,616
▷ Static methods67318.61%
▷ Public methods2,76176.36%
▷ Protected methods3018.32%
▷ Private methods55415.32%
Functions413
▷ Named functions16038.74%
▷ Anonymous functions25361.26%
Constants311
▷ Global constants10734.41%
▷ Class constants20465.59%
▷ Public constants20399.51%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
17 PNG files occupy 0.31MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/shortcode-templates.png149.90KB43.91KB▼ 70.70%
admin/img/override-content.png20.08KB18.72KB▼ 6.78%
admin/css/datatables/images/sort_both.png0.20KB0.29KB0.00%
admin/img/options.png13.10KB12.12KB▼ 7.48%
admin/img/delay-restriction.png10.74KB10.49KB▼ 2.33%