68% wp-easy-pay

Code Review | WP EasyPay - Square for WordPress

WordPress plugin WP EasyPay - Square for WordPress scored68%from 54 tests.

About plugin

  • Plugin page: wp-easy-pay
  • Plugin version: 4.2.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Mar 12, 2018
  • Latest release: Sep 7, 2023
  • Number of updates: 232
  • Update frequency: every 8.7 days
  • Top authors: wpexpertsio (100%)

Code review

54 tests

User reviews

35 reviews

Install metrics

2,000+ active /107,864 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.68MB] [CPU: ▲12.21ms] Passed 4 tests

Server-side resources used by WP EasyPay - Square for WordPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.16 ▲0.7059.31 ▲18.21
Dashboard /wp-admin4.00 ▲0.7058.31 ▲3.21
Posts /wp-admin/edit.php4.05 ▲0.6963.47 ▲15.84
Add New Post /wp-admin/post-new.php6.51 ▲0.63107.59 ▲13.93
Media Library /wp-admin/upload.php3.93 ▲0.7052.91 ▲15.85
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius4.1147.51

Server storage [IO: ▲11.00MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 1,047 new files
Database: no new tables, 13 new options
New WordPress options
can_compress_scripts
widget_recent-comments
wpep_refresh_token
fs_accounts
wpep_stn
fs_active_plugins
wpep_live_token_upgraded
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP EasyPay - Square for WordPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,043 ▲30815.98 ▲1.679.56 ▲7.7432.40 ▼12.00
Dashboard /wp-admin2,270 ▲826.42 ▲1.48107.42 ▲1.2498.07 ▲47.98
Posts /wp-admin/edit.php2,173 ▲843.08 ▲1.0846.44 ▲9.1969.95 ▲32.59
Add New Post /wp-admin/post-new.php6,259 ▲4,72619.57 ▼3.67986.26 ▲310.1739.96 ▼36.59
Media Library /wp-admin/upload.php1,472 ▲845.71 ▲1.51103.10 ▼1.5375.04 ▲27.59
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,1142.7732.4424.44

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/wp-easy-pay/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin did not uninstall successfully, leaving 13 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • fs_active_plugins
    • wpep_token_expires_at
    • can_compress_scripts
    • wpep_refresh_token
    • wpep_stn
    • widget_recent-posts
    • widget_recent-comments
    • wpep_live_token_upgraded
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Please fix the following
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-easy-pay/views/frontend/saved-cards.php
    • > /wp-content/plugins/wp-easy-pay/views/frontend/no-square-setup.php
    • > /wp-content/plugins/wp-easy-pay/views/backend/form_builder_settings/tabs-list-and-switches.php
    • > /wp-content/plugins/wp-easy-pay/views/backend/roadmap-page.php
  • 98× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Cookie\\CookieJar' not found in wp-content/plugins/wp-easy-pay/modules/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-easy-pay/views/frontend/wpep_free/popup-form-free.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/wp-easy-pay/modules/vendor/guzzlehttp/guzzle/src/Pool.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\BadResponseException' not found in wp-content/plugins/wp-easy-pay/modules/vendor/guzzlehttp/guzzle/src/Exception/ClientException.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\MessageFormatterInterface' not found in wp-content/plugins/wp-easy-pay/modules/vendor/guzzlehttp/guzzle/src/MessageFormatter.php:38
    • > PHP Warning
      require_once(WPEP_ROOT_PATHmodules/payments/square-configuration.php): failed to open stream: No such file or directory in wp-content/plugins/wp-easy-pay/modules/payments/payment-helper-functions.php on line 12
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/wp-easy-pay/modules/vendor/psr/http-message/src/RequestInterface.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/wp-easy-pay/modules/vendor/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/wp-easy-pay/modules/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/wp-easy-pay/modules/vendor/guzzlehttp/psr7/src/NoSeekStream.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Screenshots: Add descriptions for screenshots #10, #11, #12, #7, #8, #9 in wp-easy-pay/assets to your readme.txt
The official readme.txt is a good inspiration

wp-easy-pay/wp-easy-pay.php 92% from 13 tests

The main PHP file in "WP EasyPay - Square for WordPress" ver. 4.2.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected185,462 lines of code in 951 files:
LanguageFilesBlank linesComment linesLines of code
PHP82827,67781,051144,183
JSON200019,575
CSS231,48810010,491
JavaScript211,1905205,610
Markdown1186702,862
Sass28399772,515
SVG1502149
Bourne Shell113831
XML11020
YAML20017
make1409

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
It is recommended to fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity25.89
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity2.88
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces15
Interfaces26
Traits3
Classes666
▷ Abstract classes20.30%
▷ Concrete classes66499.70%
▷ Final classes345.12%
Methods9,258
▷ Static methods3433.70%
▷ Public methods8,46691.45%
▷ Protected methods3073.32%
▷ Private methods4855.24%
Functions309
▷ Named functions20867.31%
▷ Anonymous functions10132.69%
Constants215
▷ Global constants10548.84%
▷ Class constants11051.16%
▷ Public constants9990.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
25 PNG files occupy 0.36MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/backend/img/signup.png3.83KB4.21KB0.00%
assets/backend/img/square-icon.png0.25KB0.25KB0.00%
assets/backend/img/minus.png1.38KB0.52KB▼ 62.61%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
assets/frontend/img/placeholder-image.png5.68KB1.87KB▼ 67.03%