10% paywhirl-recurring-payments

Code Review | Paywhirl for Wordpress

WordPress plugin Paywhirl for Wordpress scored 10% from 54 tests.

About plugin

  • Plugin page: paywhirl-recurrin...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Aug 8, 2014
  • Latest release: Jul 12, 2015
  • Number of updates: 44
  • Update frequency: every 7.7 days
  • Top authors: paywhirl (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

10+ active / 2,584 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Warning in wp-content/plugins/paywhirl-recurring-payments/includes/database.php+17
    Use of undefined constant key - assumed 'key' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.96MB] [CPU: ▼51.16ms] Passed 4 tests

This is a short check of server-side resources used by Paywhirl for Wordpress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.433.73 ▼35.86
Dashboard /wp-admin2.05 ▼1.266.37 ▼41.10
Posts /wp-admin/edit.php2.05 ▼1.315.77 ▼42.79
Add New Post /wp-admin/post-new.php2.05 ▼3.845.52 ▼84.88
Media Library /wp-admin/upload.php2.05 ▼1.187.35 ▼28.53
Installation /wp-admin/admin.php?page=paywhirl-installation2.056.46
Paywhirl /wp-admin/admin.php?page=paywhirl-menu2.056.02
Orders /wp-admin/admin.php?page=paywhirl-orders2.055.81
Subscribers /wp-admin/admin.php?page=paywhirl-subscribers2.056.26

Server storage [IO: ▲0.38MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
Please fix the following
  • Illegal file modification found: 1 file (0.68KB) outside of "wp-content/plugins/paywhirl-recurring-payments/" and "wp-content/uploads/"
    • (modified) .htaccess
Filesystem: 65 new files
Database: 1 new table, 6 new options
New tables
wp_paywhirl_user_invoices
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Paywhirl for Wordpress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲10514.48 ▼0.271.64 ▲0.0040.31 ▼8.02
Dashboard /wp-admin2,243 ▲544.94 ▼0.0297.36 ▼6.7870.25 ▲21.35
Posts /wp-admin/edit.php2,129 ▲371.99 ▲0.0134.78 ▼6.3935.92 ▲1.53
Add New Post /wp-admin/post-new.php1,556 ▲2223.11 ▲0.05715.02 ▲40.3159.53 ▲9.49
Media Library /wp-admin/upload.php1,424 ▲364.22 ▲0.02103.37 ▲3.2181.21 ▲35.48
Installation /wp-admin/admin.php?page=paywhirl-installation8782.0225.6023.72
Paywhirl /wp-admin/admin.php?page=paywhirl-menu1,4869.46361.2389.69
Orders /wp-admin/admin.php?page=paywhirl-orders8352.0125.6324.42
Subscribers /wp-admin/admin.php?page=paywhirl-subscribers8242.0123.3523.18

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/paywhirl-recurring-payments/includes/database.php+17
    Use of undefined constant key - assumed 'key' (this will throw an Error in a future version of PHP)
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=paywhirl-subscribers
    • > Warning in wp-content/plugins/paywhirl-recurring-payments/includes/database.php+17
    Use of undefined constant key - assumed 'key' (this will throw an Error in a future version of PHP)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=paywhirl-subscribers
    • > Warning in wp-content/plugins/paywhirl-recurring-payments/includes/database.php+18
    Use of undefined constant name - assumed 'name' (this will throw an Error in a future version of PHP)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=paywhirl-subscribers
    • > Warning in wp-content/plugins/paywhirl-recurring-payments/includes/database.php+19
    Use of undefined constant fields - assumed 'fields' (this will throw an Error in a future version of PHP)

SRP Passed 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
The SRP test was a success

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=paywhirl-installation
    • > Network (severe)
    wp-content/plugins/paywhirl/css/admin-installation-page.css - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=paywhirl-subscribers
    • > Network (severe)
    wp-content/plugins/paywhirl/images/menu-icon.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=paywhirl-menu
    • > Network (severe)
    wp-content/plugins/paywhirl/css/admin-dashboard-page.css - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=paywhirl-menu
    • > Security (severe) in unknown
    https://doug1izaerwt3.cloudfront.net/ab1b7a2db4b13eba5f777af9aab8f3ae3f642253.1.js 40 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://app.kissmetrics.com') does not match the recipient window's origin ('').
    • > GET request to /wp-admin/admin.php?page=paywhirl-orders
    • > Network (severe)
    wp-content/plugins/paywhirl/css/admin-orders-page.css - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=paywhirl-orders
    • > Network (severe)
    wp-content/plugins/paywhirl/js/orders.js - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=paywhirl-subscribers
    • > Network (severe)
    wp-content/plugins/paywhirl/css/admin-subscribers-page.css - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=paywhirl-subscribers
    • > Network (severe)
    wp-content/plugins/paywhirl/js/subscribers.js - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: Please specify the plugin name on the first line ( === paywhirl-recurring-payments === )
  • Tags: Too many tags (16 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

paywhirl-recurring-payments/paywhirl.php 92% from 13 tests

"Paywhirl for Wordpress" version 1.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("paywhirl-recurring-payments.php" instead of "paywhirl.php")

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
No dangerous file extensions were detected1,820 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2328199805
PHP24326200521
Sass1414321490
CSS4044

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity4.67
▷ Minimum class complexity3.00
▷ Maximum class complexity6.00
Average method complexity2.22
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods9
▷ Static methods444.44%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions1392.86%
▷ Anonymous functions17.14%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
6 PNG files occupy 0.14MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/menu-icon.png1.79KB1.05KB▼ 41.43%
images/logo.png2.66KB1.77KB▼ 33.46%
images/close-button.png2.52KB0.89KB▼ 64.85%
images/installation-step-1.png29.22KB9.02KB▼ 69.12%
images/installation-step-3.png32.92KB11.22KB▼ 65.91%