83% money-space

Code Review | Money Space

WordPress plugin Money Space scored83%from 54 tests.

About plugin

  • Plugin page: money-space
  • Plugin version: 2.8.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.3.1
  • WordPress version: 6.3.1
  • First release: Dec 3, 2021
  • Latest release: Oct 11, 2023
  • Number of updates: 23
  • Update frequency: every 29.6 days
  • Top authors: moneyspace (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /1,270 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼0.46ms] Passed 4 tests

This is a short check of server-side resources used by Money Space
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0437.37 ▼1.29
Dashboard /wp-admin3.34 ▲0.0443.40 ▼2.89
Posts /wp-admin/edit.php3.39 ▲0.0449.55 ▲2.13
Add New Post /wp-admin/post-new.php5.92 ▲0.0490.34 ▲2.98
Media Library /wp-admin/upload.php3.26 ▲0.0434.76 ▲0.19

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 218 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Money Space
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.35 ▲0.081.78 ▲0.2039.64 ▼3.49
Dashboard /wp-admin2,192 ▲125.51 ▼0.1679.89 ▼5.2640.49 ▲2.78
Posts /wp-admin/edit.php2,103 ▼02.13 ▲0.1138.29 ▲1.7435.19 ▲0.83
Add New Post /wp-admin/post-new.php1,526 ▼223.07 ▼0.27666.64 ▲34.9271.39 ▲16.03
Media Library /wp-admin/upload.php1,403 ▼04.23 ▲0.0394.13 ▼1.8744.40 ▲1.94

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 fix the following
  • 30× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/money-space/templates/qrnone/mns_tpl_qrnone_2.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/money-space/templates/qrnone/qrnone_form.php:3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/money-space/templates/qrnone/mns_tpl_qrnone_1.php on line 4
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/money-space/templates/qrnone/mns_tpl_qrnone_2.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/money-space/view/webhook.php:7
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/money-space/templates/qrnone/mns_tpl_qrnone_2.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_get_order() in wp-content/plugins/money-space/view/process-payment.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WC() in wp-content/plugins/money-space/view/info.php:10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/money-space/templates/qrnone/mns_tpl_qrnone_2.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/money-space/payment-gateway/class-woocommerce-moneyspace-payment-gateway_QrProm.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% 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
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (The MoneySpace payment gateway settings screen used to configure the main MoneySpace gateway.), #2 (Offer a range of payment methods such as local and alternative payment methods.), #3 (Pay with a saved payment method, a new card, and allow customers to save the payment card for future transactions.)
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === money-space === )
You can take inspiration from this readme.txt

money-space/moneyspace_payment_gateway.php 85% from 13 tests

The main file in "Money Space" v. 2.8.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("money-space.php" instead of "moneyspace_payment_gateway.php")
  • Description: The description should be shorter than 140 characters (currently 862 characters long)

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
Success! There were no dangerous files found in this plugin123,877 lines of code in 88 files:
LanguageFilesBlank linesComment linesLines of code
SVG240083,902
CSS182,28030319,054
JavaScript143,2233,31517,336
PHP316114203,375
Markdown13160210

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity13.44
▷ Minimum class complexity1.00
▷ Maximum class complexity66.00
Average method complexity2.83
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods116
▷ Static methods2521.55%
▷ Public methods8775.00%
▷ Protected methods2521.55%
▷ Private methods43.45%
Functions30
▷ Named functions2376.67%
▷ Anonymous functions723.33%
Constants173
▷ Global constants16494.80%
▷ Class constants95.20%
▷ Public constants9100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
52 PNG files occupy 6.93MB with 3.51MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/images/qr/bill.png16.22KB6.75KB▼ 58.38%
includes/images/installment/central.png3.40KB1.84KB▼ 45.73%
includes/themes/mns-01/images/step_4.png4.54KB2.31KB▼ 49.07%
includes/themes/mns-01/images/partner_4.png3.50KB2.09KB▼ 40.41%
includes/themes/mns-01/images/product_image.png1,136.94KB458.74KB▼ 59.65%