10% subscription-plans

Code Review | Subscription Plans

WordPress plugin Subscription Plans scored10%from 54 tests.

About plugin

  • Plugin page: subscription-plans
  • Plugin version: 1.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6.10-6.2.2
  • WordPress version: 6.3.1
  • First release: Apr 21, 2023
  • Latest release: May 20, 2023
  • Number of updates: 3
  • Update frequency: every 10.3 days
  • Top authors: chargely (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /256 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/subscription-plans/chargely-subscription.php+354
    Undefined index: siteorigin_chargely_plugin_nonce

Server metrics [RAM: ▼0.74MB] [CPU: ▼22.55ms] Passed 4 tests

Analyzing server-side resources used by Subscription Plans
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0750.80 ▲6.62
Dashboard /wp-admin3.13 ▼0.1736.97 ▼15.83
Posts /wp-admin/edit.php3.25 ▼0.1038.69 ▼13.08
Add New Post /wp-admin/post-new.php3.21 ▼2.6742.18 ▼60.74
Media Library /wp-admin/upload.php3.22 ▼0.0137.13 ▼0.53
Chargely Subscriptions /wp-admin/admin.php?page=chargely_wordpress_login3.1232.92
Transactions /wp-admin/admin.php?page=chargely_wordpress_transactions3.1235.78
Subscribers /wp-admin/admin.php?page=chargely_wordpress_subscription3.1233.24

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Subscription Plans
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,998 ▲23713.78 ▼0.5710.75 ▲9.0443.15 ▼3.14
Dashboard /wp-admin2,324 ▲1475.56 ▼0.1092.50 ▼18.9144.12 ▼7.92
Posts /wp-admin/edit.php2,227 ▲1272.01 ▲0.0136.35 ▼2.0935.36 ▲2.16
Add New Post /wp-admin/post-new.php1,550 ▲1523.13 ▲4.89669.07 ▲43.2256.68 ▼9.10
Media Library /wp-admin/upload.php1,530 ▲1304.27 ▲0.06116.28 ▲9.5247.50 ▲3.26
Chargely Subscriptions /wp-admin/admin.php?page=chargely_wordpress_login1,2033.3365.6682.53
Transactions /wp-admin/admin.php?page=chargely_wordpress_transactions9862.2128.7733.36
Subscribers /wp-admin/admin.php?page=chargely_wordpress_subscription1,0942.2129.9048.52

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/subscription-plans/chargely-subscription.php+354
    Undefined index: siteorigin_chargely_plugin_nonce
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • cps_plan_pricing

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=chargely_wordpress_subscription
    • > Notice in wp-content/plugins/subscription-plans/chargely-subscription.php+271
    Undefined index: post_type

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 task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/subscription-plans/views/admin/login.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/subscription-plans/views/admin/login.php:239

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=chargely_wordpress_subscription
    • > Network (severe)
    var/www/wordpress/wp-content/plugins/subscription-plans//css/mystyle.css?ver=1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=chargely_wordpress_transactions
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=chargely_wordpress_transactions#error_popup_login - Access to fetch at 'https://chargely.com/api/merchant/pagination?page_num=1&client=Consumer%20Subscription&merchant_id=null' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=chargely_wordpress_subscription
    • > Network (severe)
    https://chargely.com/api/merchant/pagination?page_num=1&client=Consumer%20Subscription&merchant_id=null - Failed to load resource: net::ERR_FAILED
    • > GET request to /wp-admin/admin.php?page=chargely_wordpress_transactions
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=chargely_wordpress_transactions 303:4 Uncaught TypeError: Failed to fetch
    • > GET request to /wp-admin/admin.php?page=chargely_wordpress_subscription
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=chargely_wordpress_subscription#error_popup_login - Access to fetch at 'https://chargely.com/api/merchant/pagination?page_num=1&client=Consumer%20Subscription&merchant_id=null' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
    • > GET request to /wp-admin/admin.php?page=chargely_wordpress_subscription
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=chargely_wordpress_subscription 390:4 Uncaught TypeError: Failed to fetch

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #3 (banner-772x250-rtl.png), #4 (banner-772x250.png), #5 (banner-1544X500-rtl.png), #6 (banner-1544X500.png), #7 (icon-128x128.png), #8 (icon-256X256.png)
The official readme.txt is a good inspiration

subscription-plans/chargely-subscription.php 85% from 13 tests

This is the main PHP file of "Subscription Plans" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 173 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("subscription-plans.php" instead of "chargely-subscription.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected11,871 lines of code in 56 files:
LanguageFilesBlank linesComment linesLines of code
CSS81832033,779
PHP94931523,431
JavaScript111891221,827
Sass1319221,158
LESS1319311,149
SVG200527

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions26
▷ Named functions26100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
23 PNG files occupy 1.25MB with 0.49MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
views/admin/images/chargely_logo.png1.60KB0.86KB▼ 46.33%
views/admin/images/PayPal.png33.59KB15.03KB▼ 55.25%
views/admin/images/cards.png194.62KB62.59KB▼ 67.84%
views/admin/images/merchant_id.png0.46KB0.33KB▼ 26.87%
views/admin/images/checkout_logo.png8.51KB9.80KB0.00%