94% paymentwall-for-jigoshop

Code Review | Paymentwall for Jigoshop

WordPress plugin Paymentwall for Jigoshop scored 94% from 54 tests.

About plugin

  • Plugin page: paymentwall-for-j...
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.3.1
  • WordPress version: 5.8.1
  • First release: Aug 4, 2015
  • Latest release: Oct 22, 2015
  • Number of updates: 5
  • Update frequency: every 50.8 days
  • Top authors: Paymentwall (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 600 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

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

An overview of server-side resources used by Paymentwall for Jigoshop
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1235.10 ▲12.56
Dashboard /wp-admin3.06 ▲0.0042.66 ▲0.94
Posts /wp-admin/edit.php3.11 ▲0.0045.90 ▲8.63
Add New Post /wp-admin/post-new.php5.42 ▼0.0287.08 ▼689.08
Media Library /wp-admin/upload.php3.01 ▲0.0031.52 ▼1.14

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 45 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Paymentwall for Jigoshop
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲7316.37 ▲0.728.53 ▲0.0851.05 ▼0.75
Dashboard /wp-admin2,970 ▲415.89 ▼0.25137.11 ▼9.65110.19 ▲1.88
Posts /wp-admin/edit.php2,739 ▼02.71 ▼0.0060.96 ▲0.9190.46 ▲2.69
Add New Post /wp-admin/post-new.php1,676 ▲17618.84 ▲0.28384.23 ▲0.57102.00 ▼16.78
Media Library /wp-admin/upload.php1,807 ▼05.03 ▲0.00143.06 ▼13.02117.06 ▼4.62

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstaller ran successfully

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)
Good news, no errors were detected

SRP 50% 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
Please take a closer look at the following
  • 23× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'paymentwall_gateway' not found in wp-content/plugins/paymentwall-for-jigoshop/includes/class-paymentwall-brick.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Paymentwall_Config' not found in wp-content/plugins/paymentwall-for-jigoshop/lib/paymentwall-php/lib/Paymentwall/Base.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Paymentwall_ApiObject' not found in wp-content/plugins/paymentwall-for-jigoshop/lib/paymentwall-php/lib/Paymentwall/Charge.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Paymentwall_Instance' not found in wp-content/plugins/paymentwall-for-jigoshop/lib/paymentwall-php/lib/Paymentwall/HttpAction.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Paymentwall_Response_Abstract' not found in wp-content/plugins/paymentwall-for-jigoshop/lib/paymentwall-php/lib/Paymentwall/Response/Error.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Paymentwall_ApiObject' not found in wp-content/plugins/paymentwall-for-jigoshop/lib/paymentwall-php/lib/Paymentwall/GenerericApiObject.php:3
    • > PHP Fatal error
      require_once(): Failed opening required 'lib/paymentwall.php' (include_path='.:/usr/share/php') in wp-content/plugins/paymentwall-for-jigoshop/lib/paymentwall-php/features/bootstrap/FeatureContext.php on line 10
    • > PHP Fatal error
      Uncaught Error: Class 'Behat\\Behat\\Context\\BehatContext' not found in wp-content/plugins/paymentwall-for-jigoshop/lib/paymentwall-php/features/bootstrap/PingbackContext.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Paymentwall_Response_Abstract' not found in wp-content/plugins/paymentwall-for-jigoshop/lib/paymentwall-php/lib/Paymentwall/Response/Success.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Behat\\Behat\\Context\\BehatContext' not found in wp-content/plugins/paymentwall-for-jigoshop/lib/paymentwall-php/features/bootstrap/ChargeContext.php:5

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)
Everything seems fine on the user side

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
8 plugin tags: paymentgateway, ecommerce, creditcard, jigoshop, brick...

paymentwall-for-jigoshop/paymentwall-for-jigoshop.php Passed 13 tests

The primary PHP file in "Paymentwall for Jigoshop" version 1.2.0 is used by WordPress to initiate all plugin functionality
51 characters long description:
Official Paymentwall module for WordPress Jigoshop.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin2,471 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
PHP334042271,862
Markdown1450267
Cucumber3360222
HTML215080
JSON10040

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity5.41
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity1.66
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces2
Traits0
Classes27
▷ Abstract classes518.52%
▷ Concrete classes2281.48%
▷ Final classes00.00%
Methods201
▷ Static methods62.99%
▷ Public methods16582.09%
▷ Protected methods3517.41%
▷ Private methods10.50%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants42
▷ Global constants716.67%
▷ Class constants3583.33%
▷ Public constants35100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/brick_logo.png4.00KB2.34KB▼ 41.40%
assets/images/paymentwall_logo.png2.19KB1.32KB▼ 39.87%