78% pay-with-square-in-memberpress

Code Review | Pay with Square in MemberPress

WordPress plugin Pay with Square in MemberPress scored78%from 54 tests.

About plugin

  • Plugin page: pay-with-square-i...
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.0
  • WordPress version: 6.3.1
  • First release: May 21, 2021
  • Latest release: May 24, 2022
  • Number of updates: 18
  • Update frequency: every 20.5 days
  • Top authors: wpexpertsio (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

30+ active /1,144 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼7.10ms] Passed 4 tests

Analyzing server-side resources used by Pay with Square in MemberPress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.34 ▼2.78
Dashboard /wp-admin3.33 ▼0.0245.94 ▼12.71
Posts /wp-admin/edit.php3.38 ▲0.0244.62 ▼1.31
Add New Post /wp-admin/post-new.php5.93 ▲0.0490.22 ▼10.18
Media Library /wp-admin/upload.php3.25 ▲0.0232.11 ▼2.72

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Pay with Square in MemberPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲6813.26 ▼1.131.73 ▲0.1040.19 ▼6.81
Dashboard /wp-admin2,217 ▲255.82 ▲0.8397.43 ▼7.5340.44 ▼1.63
Posts /wp-admin/edit.php2,099 ▲102.03 ▲0.0237.25 ▼3.5933.95 ▼1.44
Add New Post /wp-admin/post-new.php1,537 ▲2323.35 ▲5.90586.22 ▼104.6849.57 ▼3.45
Media Library /wp-admin/upload.php1,405 ▲204.33 ▲0.13101.01 ▼4.2645.76 ▲0.03

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
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Please take a closer look at the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/pay-with-square-in-memberpress/MpFreeSquare.php
    • > /wp-content/plugins/pay-with-square-in-memberpress/includes/MeprFreeSquareCtrl.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/pay-with-square-in-memberpress/includes/views/square-admin-form.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed: You can look at the official readme.txt

pay-with-square-in-memberpress/square-for-memberpress.php 85% from 13 tests

The principal PHP file in "Pay with Square in MemberPress" v. 1.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("pay-with-square-in-memberpress.php" instead of "square-for-memberpress.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin941 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP716848739
CSS22010120
JavaScript3162082

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity14.20
▷ Minimum class complexity1.00
▷ Maximum class complexity28.00
Average method complexity2.38
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods48
▷ Static methods36.25%
▷ Public methods4797.92%
▷ Protected methods12.08%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.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
There are no PNG files in this plugin