10% paymentwall-for-easy-digital-downloads

Code Review | Paymentwall for EDD

WordPress plugin Paymentwall for EDD scored10%from 54 tests.

About plugin

  • Plugin page: paymentwall-for-e...
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 4, 2015
  • Latest release: May 27, 2016
  • Number of updates: 6
  • Update frequency: every 78.7 days
  • Top authors: Paymentwall (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,447 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Error in wp-content/plugins/paymentwall-for-easy-digital-downloads/includes/class-paymentwall-brick.php+49
    Uncaught Error: Call to undefined function edd_is_test_mode() in wp-content/plugins/paymentwall-for-easy-digital-downloads/includes/class-paymentwall-brick.php:49
    Stack trace:
    #0 wp-content/plugins/paymentwall-for-easy-digital-downloads/includes/class-paymentwall-brick.php(25): edd_paymentwall_brick->init_paymentwall_config()
    #1 wp-content/plugins/paymentwall-for-easy-digital-downloads/paymentwall-for-easy-digital-downloads.php(58): edd_paymentwall_brick->init()
    #2 wp-admin/includes/plugin.php(2318): include_once('/var/www/wordpr...')
    #3 wp-admin/includes/plugin.php(663): plugin_sandbox_scrape()

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

A check of server-side resources used by Paymentwall for EDD
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.56 ▲0.72
Dashboard /wp-admin3.31 ▲0.0044.12 ▼6.74
Posts /wp-admin/edit.php3.36 ▲0.0046.26 ▲0.78
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.23 ▼24.93
Media Library /wp-admin/upload.php3.23 ▲0.0032.51 ▼0.83

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 43 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Paymentwall for EDD
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.24 ▼1.381.74 ▼0.0844.56 ▲0.10
Dashboard /wp-admin2,206 ▲155.91 ▲0.01109.81 ▲1.7942.70 ▲0.09
Posts /wp-admin/edit.php2,089 ▼32.05 ▲0.0440.42 ▲4.7436.09 ▲3.56
Add New Post /wp-admin/post-new.php1,533 ▲523.47 ▼0.01645.14 ▼18.5956.69 ▼0.88
Media Library /wp-admin/upload.php1,391 ▲64.21 ▲0.0298.60 ▼5.6243.52 ▼1.51

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 24× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Paymentwall_Signature_Abstract' not found in wp-content/plugins/paymentwall-for-easy-digital-downloads/lib/paymentwall-php/lib/Paymentwall/Signature/Pingback.php:3
    • > PHP Fatal error
      require_once(): Failed opening required 'lib/paymentwall.php' (include_path='.:/usr/share/php') in wp-content/plugins/paymentwall-for-easy-digital-downloads/lib/paymentwall-php/features/bootstrap/FeatureContext.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/paymentwall-for-easy-digital-downloads/paymentwall-for-easy-digital-downloads.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Paymentwall_Instance' not found in wp-content/plugins/paymentwall-for-easy-digital-downloads/lib/paymentwall-php/lib/Paymentwall/Widget.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Paymentwall_ApiObject' not found in wp-content/plugins/paymentwall-for-easy-digital-downloads/lib/paymentwall-php/lib/Paymentwall/Charge.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Paymentwall_ApiObject' not found in wp-content/plugins/paymentwall-for-easy-digital-downloads/lib/paymentwall-php/lib/Paymentwall/GenerericApiObject.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Paymentwall_Response_Abstract' not found in wp-content/plugins/paymentwall-for-easy-digital-downloads/lib/paymentwall-php/lib/Paymentwall/Response/Success.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Paymentwall_ApiObject' not found in wp-content/plugins/paymentwall-for-easy-digital-downloads/lib/paymentwall-php/lib/Paymentwall/Subscription.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Behat\\Behat\\Context\\BehatContext' not found in wp-content/plugins/paymentwall-for-easy-digital-downloads/lib/paymentwall-php/features/bootstrap/WidgetContext.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'edd_paymentwall_abstract' not found in wp-content/plugins/paymentwall-for-easy-digital-downloads/includes/class-paymentwall-brick.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Tested up to: Version not formatted correctly
  • Requires at least: Version not formatted correctly
Please take inspiration from this readme.txt

paymentwall-for-easy-digital-downloads/paymentwall-for-easy-digital-downloads.php Passed 13 tests

The entry point to "Paymentwall for EDD" version 1.1.1 is a PHP file that has certain tags in its header comment area
73 characters long description:
Allows to use Paymentwall as a payment gateway for Easy Digital Downloads

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected2,408 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
PHP333962381,782
Markdown1450267
Cucumber3360222
HTML213097
JSON10040

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity5.48
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity1.65
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces2
Traits0
Classes27
▷ Abstract classes518.52%
▷ Concrete classes2281.48%
▷ Final classes00.00%
Methods209
▷ Static methods62.87%
▷ Public methods16679.43%
▷ Protected methods3818.18%
▷ Private methods52.39%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants41
▷ Global constants49.76%
▷ Class constants3790.24%
▷ Public constants37100.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
No PNG files were detected