74% paypal-yearly-subscription

Code Review | PayPal Yearly Subscription

WordPress plugin PayPal Yearly Subscription scored74%from 54 tests.

About plugin

  • Plugin page: paypal-yearly-sub...
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.1-4.4.1
  • WordPress version: 6.3.1
  • First release: Oct 2, 2014
  • Latest release: Jan 20, 2016
  • Number of updates: 10
  • Update frequency: every 47.5 days
  • Top authors: atillaordog (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,348 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
Install script ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▲14.99ms] Passed 4 tests

An overview of server-side resources used by PayPal Yearly Subscription
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2852.86 ▲10.94
Dashboard /wp-admin3.45 ▲0.1460.50 ▲8.69
Posts /wp-admin/edit.php3.56 ▲0.2067.10 ▲21.10
Add New Post /wp-admin/post-new.php6.03 ▲0.14106.82 ▲20.67
Media Library /wp-admin/upload.php3.37 ▲0.1453.72 ▲19.64
PayPal Yearly Subs. /wp-admin/options-general.php?page=PayPalYearlySubscription3.3446.59

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 4 new files
Database: 1 new table, 6 new options
New tables
wp_yearly_subscriptions
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by PayPal Yearly Subscription
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.39 ▼0.991.62 ▼0.3442.13 ▼4.66
Dashboard /wp-admin2,210 ▲254.83 ▼1.2395.23 ▼18.6540.60 ▼7.65
Posts /wp-admin/edit.php2,093 ▲42.00 ▼0.0439.88 ▲4.2136.71 ▼0.46
Add New Post /wp-admin/post-new.php1,545 ▲1017.85 ▼3.25599.65 ▼70.2666.74 ▲15.45
Media Library /wp-admin/upload.php1,386 ▼24.22 ▲0.0395.40 ▼2.6142.81 ▼2.57
PayPal Yearly Subs. /wp-admin/options-general.php?page=PayPalYearlySubscription1,2162.0722.6533.79

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_yearly_subscriptions
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/paypal-yearly-subscription/paypal-yearly-subscription.php on line 93
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/paypal-yearly-subscription/paypal-yearly-subscription.php on line 173
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/upgrade.php' (include_path='.:/usr/share/php') in wp-content/plugins/paypal-yearly-subscription/paypal-yearly-subscription.php on line 173
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/upgrade.php): failed to open stream: No such file or directory in wp-content/plugins/paypal-yearly-subscription/paypal-yearly-subscription.php on line 173

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === paypal-yearly-subscription === )
The official readme.txt is a good inspiration

paypal-yearly-subscription/paypal-yearly-subscription.php Passed 13 tests

The principal PHP file in "PayPal Yearly Subscription" v. 0.1 is loaded by WordPress automatically on each request
69 characters long description:
A very basic plugin to add yearly subscription to a wordpress website

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
No dangerous file extensions were detected634 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1111240615
CSS10019

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity39.00
▷ Minimum class complexity39.00
▷ Maximum class complexity39.00
Average method complexity2.81
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods21
▷ Static methods14.76%
▷ Public methods1885.71%
▷ Protected methods00.00%
▷ Private methods314.29%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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 images were found in this plugin