78% paypal-pay-buy-donation-and-cart-buttons-shortcode

Code Review | PayPal Pay Now, Buy Now, Donation and Cart Buttons Shortcode

WordPress plugin PayPal Pay Now, Buy Now, Donation and Cart Buttons Shortcode scored78%from 54 tests.

About plugin

  • Plugin page: paypal-pay-buy-do...
  • Plugin version: 1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3.1
  • WordPress version: 6.3.1
  • First release: Jan 14, 2013
  • Latest release: Aug 30, 2023
  • Number of updates: 20
  • Update frequency: every 194.1 days
  • Top authors: mohsinrasool (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

800+ active /18,562 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.10MB] [CPU: ▼8.07ms] Passed 4 tests

A check of server-side resources used by PayPal Pay Now, Buy Now, Donation and Cart Buttons Shortcode
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1037.70 ▼3.62
Dashboard /wp-admin3.42 ▲0.0746.06 ▼13.98
Posts /wp-admin/edit.php3.54 ▲0.1847.34 ▼2.38
Add New Post /wp-admin/post-new.php6.01 ▲0.1187.56 ▼12.30
Media Library /wp-admin/upload.php3.35 ▲0.1136.60 ▲1.74
Paypal Button /wp-admin/options-general.php?page=wpdev-paypal-button3.3236.79

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, 12 new options
New WordPress options
can_compress_scripts
wpdev_paypal_button_lang
wpdev_paypal_button_display_cc
widget_recent-posts
widget_recent-comments
wpdev_paypal_button_currency
db_upgraded
widget_theysaidso_widget
wpdev_paypal_button_size
wpdev_paypal_button_add_note
...

Browser metrics Passed 4 tests

Checking browser requirements for PayPal Pay Now, Buy Now, Donation and Cart Buttons Shortcode
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.16 ▼0.411.67 ▲0.1141.30 ▲2.37
Dashboard /wp-admin2,196 ▲225.51 ▼0.0680.09 ▼5.4437.55 ▼3.25
Posts /wp-admin/edit.php2,104 ▲41.99 ▼0.0433.44 ▼4.2233.09 ▼5.68
Add New Post /wp-admin/post-new.php1,529 ▲122.97 ▼0.14670.46 ▼13.0260.28 ▼1.38
Media Library /wp-admin/upload.php1,407 ▲74.21 ▼0.09104.12 ▲6.0645.35 ▲0.95
Paypal Button /wp-admin/options-general.php?page=wpdev-paypal-button1,6555.62146.3642.98

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 12 options
    • widget_recent-comments
    • wpdev_paypal_button_display_cc
    • db_upgraded
    • wpdev_paypal_button_size
    • wpdev_paypal_button_add_note
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • wpdev_paypal_button_lang
    • wpdev_paypal_button_currency
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for 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
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/paypal-pay-buy-donation-and-cart-buttons-shortcode/admin-settings.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/paypal-pay-buy-donation-and-cart-buttons-shortcode/admin-settings.php:8

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=wpdev-paypal-button
    • > Network (severe)
    https://wpdevsnippets.com/plugin-images/icon_thumb_up.png - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/options-general.php?page=wpdev-paypal-button
    • > Network (severe)
    https://wpdevsnippets.com/plugin-images/icon_wordpress_blue.png - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/options-general.php?page=wpdev-paypal-button
    • > Network (severe)
    https://wpdevsnippets.com/plugin-images/icon_doc_find.png - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/options-general.php?page=wpdev-paypal-button
    • > Network (severe)
    https://wpdevsnippets.com/plugin-images/btn_donate.gif - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/options-general.php?page=wpdev-paypal-button
    • > Network (severe)
    https://wpdevsnippets.com/plugin-images/icon_person_help.png - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/options-general.php?page=wpdev-paypal-button
    • > Other (severe) in unknown
    chrome-error://chromewebdata/ - Refused to display 'https://developers.google.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Tags: There are too many tags (12 tag instead of maximum 10)
Please take inspiration from this readme.txt

paypal-pay-buy-donation-and-cart-buttons-shortcode/paypal-pay-buy-cart-buttons.php 85% from 13 tests

The main PHP file in "PayPal Pay Now, Buy Now, Donation and Cart Buttons Shortcode" ver. 1.7 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("paypal-pay-buy-donation-and-cart-buttons-shortcode.php" instead of "paypal-pay-buy-cart-buttons.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 154 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin665 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP29826496
Markdown1650169

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
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%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin