10% lifeline-donation

Code Review | Lifeline Donation

WordPress plugin Lifeline Donation scored 10% from 54 tests.

About plugin

  • Plugin page: lifeline-donation
  • Plugin version: 1.2.6
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-5.8
  • WordPress version: 6.3.1
  • First release: Mar 25, 2020
  • Latest release: Jul 31, 2021
  • Number of updates: 74
  • Update frequency: every 6.7 days
  • Top authors: webinnane (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 6,072 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/lifeline-donation/vendor/webinane/webinane-commerce/includes/Classes/Webinane.php+263
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲1.00MB] [CPU: ▲2.29ms] Passed 4 tests

This is a short check of server-side resources used by Lifeline Donation
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.27 ▲0.8155.46 ▲11.20
Dashboard /wp-admin4.92 ▲1.6166.24 ▲9.70
Posts /wp-admin/edit.php4.99 ▲1.6368.65 ▲20.57
Add New Post /wp-admin/post-new.php5.83 ▼0.0664.19 ▼25.59
Media Library /wp-admin/upload.php4.92 ▲1.7046.66 ▲13.85
Donations /wp-admin/edit.php?post_type=orders4.9750.24
Add New /wp-admin/post-new.php?post_type=cause5.8256.99
Add New /wp-admin/post-new.php?post_type=project5.8257.71
All Projects /wp-admin/edit.php?post_type=project4.9745.41
Lifeline Donation /wp-admin/admin.php?page=wp-commerce-settings4.9058.27
Category /wp-admin/edit-tags.php?taxonomy=project_cat&post_type=project4.9246.83
Dashboard /wp-admin/admin.php?page=wp-commerce-dashboard4.9045.15
Categories /wp-admin/edit-tags.php?taxonomy=cause_cat&post_type=cause4.9247.47
All Causes /wp-admin/edit.php?post_type=cause4.9747.46
Extensions /wp-admin/admin.php?page=wp-commerce-extensions4.9046.60

Server storage [IO: ▲10.83MB] [DB: ▲0.13MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 1,605 new files
Database: 7 new tables, 15 new options
New tables
wp_wpcommerce_customer_meta
wp_wpcommerce_order_items
wp_wpcommerce_sessions
wp_wpcommerce_customers
wp_wpcommerce_log
wp_wpcommerce_payment_tokenmeta
wp_wpcommerce_payment_tokens
New WordPress options
wpcm_user_data
_wpcommerce_settings
theysaidso_admin_options
widget_wi_urgent_cause
widget_wi_urgent_campaigns
widget_wi_donor_of_month
widget_wi_top_donors
can_compress_scripts
widget_recent-comments
widget_wi_donors_list
...

Browser metrics Passed 4 tests

A check of browser resources used by Lifeline Donation
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,507 ▲77222.69 ▲8.3953.74 ▲51.6446.08 ▼5.69
Dashboard /wp-admin2,709 ▲5249.08 ▲4.01190.65 ▲76.3055.69 ▲4.19
Posts /wp-admin/edit.php2,542 ▲4536.73 ▲4.77110.02 ▲73.8337.88 ▲2.77
Add New Post /wp-admin/post-new.php6,581 ▲5,04822.38 ▼0.62985.51 ▲281.6638.24 ▼23.77
Media Library /wp-admin/upload.php1,724 ▲3397.97 ▲3.70140.98 ▲29.6747.08 ▼2.23
Donations /wp-admin/edit.php?post_type=orders1,5586.6693.1830.68
Add New /wp-admin/post-new.php?post_type=cause6,93525.05995.85105.98
Add New /wp-admin/post-new.php?post_type=project6,85224.53855.5062.20
All Projects /wp-admin/edit.php?post_type=project1,5696.5592.2630.04
Lifeline Donation /wp-admin/admin.php?page=wp-commerce-settings5,87229.71138.5459.84
Category /wp-admin/edit-tags.php?taxonomy=project_cat&post_type=project1,7187.2985.9730.38
Dashboard /wp-admin/admin.php?page=wp-commerce-dashboard1,6708.76134.41101.40
Categories /wp-admin/edit-tags.php?taxonomy=cause_cat&post_type=cause1,7157.2981.9131.80
All Causes /wp-admin/edit.php?post_type=cause1,5696.5988.6828.10
Extensions /wp-admin/admin.php?page=wp-commerce-extensions1,5308.59127.7626.15

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie tables detected upon uninstall: 7 tables
    • wp_wpcommerce_payment_tokenmeta
    • wp_wpcommerce_payment_tokens
    • wp_wpcommerce_order_items
    • wp_wpcommerce_customers
    • wp_wpcommerce_log
    • wp_wpcommerce_sessions
    • wp_wpcommerce_customer_meta
  • The uninstall procedure has failed, leaving 15 options in the database
    • widget_recent-comments
    • widget_wi_urgent_campaigns
    • can_compress_scripts
    • wpcm_user_data
    • _wpcommerce_settings
    • widget_wi_top_donors
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=project
    • > User deprecated in wp-includes/functions.php+5828
    Hook block_categories is deprecated since version 5.8.0! Use block_categories_all instead.

SRP 0% 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
The following issues need your attention
  • 24× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/lifeline-donation/shortcodes/output/wi_donation_parallax4.php
    • > /wp-content/plugins/lifeline-donation/shortcodes/output/wi_donation_campaigns4.php
    • > /wp-content/plugins/lifeline-donation/vendor/webinane/webinane-commerce/templates/admin/settings.php
    • > /wp-content/plugins/lifeline-donation/shortcodes/output/wi_donation_campaigns1.php
    • > /wp-content/plugins/lifeline-donation/vendor/webinane/webinane-commerce/templates/emails/layouts/template2.php
    • > /wp-content/plugins/lifeline-donation/shortcodes/output/wi_donation_parallax2.php
    • > /wp-content/plugins/lifeline-donation/shortcodes/output/wi_donation_campaigns2.php
    • > /wp-content/plugins/lifeline-donation/shortcodes/output/wi_donation_template.php
    • > /wp-content/plugins/lifeline-donation/shortcodes/output/wi_donation_campaigns5.php
    • > /wp-content/plugins/lifeline-donation/vendor/illuminate/pagination/resources/views/semantic-ui.blade.php
  • 854× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Core\\PPXmlMessage' not found in wp-content/plugins/lifeline-donation/vendor/paypal/merchant-sdk-php/lib/PayPal/EBLBaseComponents/GetBillingAgreementCustomerDetailsResponseDetailsType.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Core\\PPXmlMessage' not found in wp-content/plugins/lifeline-donation/vendor/paypal/merchant-sdk-php/lib/PayPal/EBLBaseComponents/UpdateRecurringPaymentsProfileRequestDetailsType.php:9
    • > PHP Fatal error
      Trait 'Rakit\\Validation\\Traits\\TranslationsTrait' not found in wp-content/plugins/lifeline-donation/vendor/rakit/validation/src/Validator.php on line 5
    • > PHP Fatal error
      Trait 'Carbon\\Traits\\Localization' not found in wp-content/plugins/lifeline-donation/vendor/nesbot/carbon/src/Carbon/Traits/Options.php on line 26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lifeline-donation/blocks/parallax.php:61
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Core\\PPBaseService' not found in wp-content/plugins/lifeline-donation/vendor/paypal/merchant-sdk-php/lib/PayPal/Service/PayPalAPIInterfaceServiceService.php:112
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Core\\PPXmlMessage' not found in wp-content/plugins/lifeline-donation/vendor/paypal/merchant-sdk-php/lib/PayPal/PayPalAPI/MassPayReq.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\PayPalAPI\\DoExpressCheckoutPaymentResponseType' not found in wp-content/plugins/lifeline-donation/vendor/paypal/merchant-sdk-php/lib/PayPal/PayPalAPI/DoUATPExpressCheckoutPaymentResponseType.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Core\\PPXmlMessage' not found in wp-content/plugins/lifeline-donation/vendor/paypal/merchant-sdk-php/lib/PayPal/EBLBaseComponents/DoReferenceTransactionRequestDetailsType.php:9
    • > PHP Fatal error
      Trait 'Carbon\\Traits\\Cast' not found in wp-content/plugins/lifeline-donation/vendor/nesbot/carbon/src/Carbon/Traits/Mutability.php on line 21

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 fix the following browser errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-commerce-settings
    • > Console-api (severe) in wp-content/plugins/lifeline-donation/vendor/webinane/webinane-commerce/assets/js/common/vue.js?ver=1696258781+633:16
    [Vue warn]: Unknown custom element: \u003Ccomponent> - did you register the component correctly? For recursive components, make sure to provide the \"name\" option.\n\nfound in\n\n---> \u003CElRadioGroup> at packages/radio/src/radio-group.vue\n \u003CElFormItem> at packages/form/src/form-item.vue\n \u003CFields>\n \u003CElCol>\n \u003CElRow>\n \u003CElForm> at packages/form/src/form.vue\n \u003CFields>\n \u003CElTabPane> at packages/tabs/src/tab-pane.vue\n \u003CElTabs> at packages/tabs/src/tabs.vue\n \u003CElTabPane> at packages/tabs/src/tab-pane.vue\n \u003CElTabs> at packages/tabs/src/tabs.vue\n \u003CSettings>\n \u003CRoot>
    • > GET request to /wp-admin/admin.php?page=wp-commerce-settings
    • > Network (severe)
    index.php/wp-json/webinane-commerce/v1/countries/null/states - Failed to load resource: the server responded with a status of 400 (Bad Request)

Optimizations

Plugin configuration 93% 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
Attributes that require attention: Please take inspiration from this readme.txt

lifeline-donation/lifeline-donation.php 92% from 13 tests

The entry point to "Lifeline Donation" version 1.2.6 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 429 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin128,835 lines of code in 1,488 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,22319,68962,37787,828
CSS371,68622915,543
JavaScript421,3441,90112,659
JSON162508,646
XSD392482,803
Markdown71940455
HTML2280411
SVG517301
Blade51119136
XML10046
YAML1007

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 158)
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity7.56
▷ Minimum class complexity1.00
▷ Maximum class complexity337.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity158.00
Code structure
Namespaces130
Interfaces127
Traits56
Classes900
▷ Abstract classes303.33%
▷ Concrete classes87096.67%
▷ Final classes323.68%
Methods6,397
▷ Static methods1,10717.30%
▷ Public methods5,14780.46%
▷ Protected methods1,05016.41%
▷ Private methods2003.13%
Functions627
▷ Named functions24839.55%
▷ Anonymous functions37960.45%
Constants183
▷ Global constants2212.02%
▷ Class constants16187.98%
▷ Public constants15797.52%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
37 PNG files occupy 0.73MB with 0.40MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/2cr.png2.92KB0.24KB▼ 91.69%
assets/images/bg-hands.png622.77KB170.18KB▼ 72.67%
assets/images/paypal-icon.png2.03KB1.22KB▼ 40.12%
vendor/webinane/webinane-commerce/assets/images/icons/menu-icon4.png1.61KB1.06KB▼ 34.12%
vendor/webinane/webinane-commerce/assets/images/offline-icon.png1.40KB0.91KB▼ 34.98%