74% gpls-paypal-subscriptions

Code Review | Paypal Subscriptions

WordPress plugin Paypal Subscriptions scored74%from 54 tests.

About plugin

  • Plugin page: gpls-paypal-subsc...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.2.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8.0-6.3
  • WordPress version: 6.3.1
  • First release: Oct 13, 2022
  • Latest release: Aug 17, 2023
  • Number of updates: 6
  • Update frequency: every 53.0 days
  • Top authors: grandplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /358 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.33MB] [CPU: ▼4.15ms] Passed 4 tests

An overview of server-side resources used by Paypal Subscriptions
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.83 ▲1.3648.41 ▲5.92
Dashboard /wp-admin4.65 ▲1.3057.56 ▼14.21
Posts /wp-admin/edit.php4.76 ▲1.4059.78 ▲1.78
Add New Post /wp-admin/post-new.php7.23 ▲1.3496.66 ▼10.10
Media Library /wp-admin/upload.php4.57 ▲1.3454.98 ▲20.26
Subscription Products /wp-admin/admin.php?page=gpls-pyplss-paypal-subscriptions-paypal-products-page5.57426.11
Subscriptions /wp-admin/admin.php?page=gpls-pyplss-paypal-subscriptions-paypal-subscriptions-page4.6049.84
Settings /wp-admin/admin.php?page=gpls-pyplss-paypal-subscriptions-paypal-subscriptions-settings4.5545.02
Subscription Plans /wp-admin/admin.php?page=gpls-pyplss-paypal-subscriptions-paypal-subscription-plans-page5.61403.52

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 233 new files
Database: 3 new tables, 6 new options
New tables
wp_gpls_pyplss_subscriptions_meta
wp_gpls_pyplss_plans_meta
wp_gpls_pyplss_subscriptions
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Paypal Subscriptions
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,985 ▲23920.43 ▲6.1331.57 ▲29.4041.82 ▼1.19
Dashboard /wp-admin2,215 ▲385.63 ▲0.0287.88 ▼2.6275.35 ▲33.27
Posts /wp-admin/edit.php2,135 ▲351.97 ▼0.0252.28 ▲10.0542.38 ▲4.26
Add New Post /wp-admin/post-new.php1,558 ▲822.94 ▼0.29776.71 ▲107.7655.74 ▼3.72
Media Library /wp-admin/upload.php1,429 ▲294.25 ▲0.0898.36 ▼11.9870.07 ▲25.59
Subscription Products /wp-admin/admin.php?page=gpls-pyplss-paypal-subscriptions-paypal-products-page9591.9026.2443.22
Subscriptions /wp-admin/admin.php?page=gpls-pyplss-paypal-subscriptions-paypal-subscriptions-page1,0552.2634.8827.10
Settings /wp-admin/admin.php?page=gpls-pyplss-paypal-subscriptions-paypal-subscriptions-settings1,1961.7324.6726.61
Subscription Plans /wp-admin/admin.php?page=gpls-pyplss-paypal-subscriptions-paypal-subscription-plans-page1,3241.8928.9825.89

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_gpls_pyplss_subscriptions_meta
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
  • 73× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/gpls-paypal-subscriptions/templates/pages/plans/paypal-plans.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/gpls-paypal-subscriptions/templates/pages/products/paypal-products.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Psr7\\Request' not found in wp-content/plugins/gpls-paypal-subscriptions/vendor/guzzlehttp/psr7/src/ServerRequest.php:27
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/gpls-paypal-subscriptions/vendor/guzzlehttp/psr7/src/NoSeekStream.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Cookie\\CookieJar' not found in wp-content/plugins/gpls-paypal-subscriptions/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/gpls-paypal-subscriptions/vendor/guzzlehttp/promises/src/FulfilledPromise.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\TransferException' not found in wp-content/plugins/gpls-paypal-subscriptions/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php:13
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/gpls-paypal-subscriptions/templates/pages/subscriptions/paypal-subscriptions.php on line 2
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Handler\\CurlFactoryInterface' not found in wp-content/plugins/gpls-paypal-subscriptions/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\BadResponseException' not found in wp-content/plugins/gpls-paypal-subscriptions/vendor/guzzlehttp/guzzle/src/Exception/ClientException.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% 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
Attributes that need to be fixed:
  • Tags: There are too many tags (11 tag instead of maximum 10)
  • Screenshots: No descriptions were found for these screenshots #1, #10, #11, #12, #2, #3, #4, #5, #6, #7, #9 in gpls-paypal-subscriptions/assets to your readme.txt
You can look at the official readme.txt

gpls-paypal-subscriptions/gpls-paypal-subscriptions.php Passed 13 tests

The principal PHP file in "Paypal Subscriptions" v. 1.0.1 is loaded by WordPress automatically on each request
52 characters long description:
Integrate Paypal Subscriptions for WordPress easily.

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
Everything looks great! No dangerous files found in this plugin20,858 lines of code in 209 files:
LanguageFilesBlank linesComment linesLines of code
PHP1693,1519,20616,149
Markdown151,26503,647
JSON9001,040
CSS90109
YAML1007
JavaScript6066

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity14.54
▷ Minimum class complexity1.00
▷ Maximum class complexity124.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces21
Interfaces27
Traits5
Classes110
▷ Abstract classes1110.00%
▷ Concrete classes9990.00%
▷ Final classes3535.35%
Methods1,171
▷ Static methods30626.13%
▷ Public methods92779.16%
▷ Protected methods968.20%
▷ Private methods14812.64%
Functions138
▷ Named functions4834.78%
▷ Anonymous functions9065.22%
Constants73
▷ Global constants22.74%
▷ Class constants7197.26%
▷ Public constants6084.51%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
9 PNG files occupy 0.19MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
core/assets/dist/images/full-logo.png6.58KB3.86KB▼ 41.28%
assets/dist/images/paypal.png1.58KB1.51KB▼ 4.44%
core/assets/dist/images/logo-icon-sm.png0.62KB0.72KB0.00%
assets/dist/images/paypal-apps-options.png82.88KB41.10KB▼ 50.41%
assets/dist/images/eye.png14.13KB7.03KB▼ 50.25%