84% ems-online

Code Review | EMS Online

WordPress plugin EMS Online scored84%from 54 tests.

About plugin

  • Plugin page: ems-online
  • Plugin version: 1.3.13
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.1
  • WordPress version: 6.3.1
  • First release: Feb 8, 2021
  • Latest release: Oct 13, 2023
  • Number of updates: 55
  • Update frequency: every 17.9 days
  • Top authors: emspay (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

20+ active /1,828 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▲0.78ms] Passed 4 tests

This is a short check of server-side resources used by EMS Online
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0942.94 ▲3.61
Dashboard /wp-admin3.40 ▲0.0947.20 ▼1.37
Posts /wp-admin/edit.php3.51 ▲0.1548.32 ▲1.78
Add New Post /wp-admin/post-new.php5.98 ▲0.0992.65 ▲2.84
Media Library /wp-admin/upload.php3.32 ▲0.0935.80 ▼0.14

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

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

Browser metrics Passed 4 tests

Checking browser requirements for EMS Online
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.33 ▲0.161.78 ▲0.0847.29 ▼0.63
Dashboard /wp-admin2,195 ▲155.59 ▼0.0782.49 ▼4.0437.84 ▼6.19
Posts /wp-admin/edit.php2,100 ▼32.01 ▼0.0139.94 ▲3.3035.74 ▲2.16
Add New Post /wp-admin/post-new.php1,526 ▼223.13 ▲0.02643.75 ▼73.1358.52 ▼0.88
Media Library /wp-admin/upload.php1,394 ▼64.22 ▲0.0696.68 ▼19.4039.15 ▼9.21

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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 fix the following
  • 9× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      require(wp-content/plugins/ems-online/vendor/gingerpayments/ginger-php/examples/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/ems-online/vendor/gingerpayments/ginger-php/examples/ideal-payment.php on line 3
    • > PHP Warning
      require(wp-content/plugins/ems-online/vendor/gingerpayments/ginger-php/examples/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/ems-online/vendor/gingerpayments/ginger-php/examples/payment-with-method-selection.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/ems-online/vendor/gingerpayments/ginger-php/tests/GingerTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/ems-online/vendor/gingerpayments/ginger-php/tests/HttpClient/CurlHttpClientTest.php:43
    • > PHP Fatal error
      Uncaught Error: Interface 'Ginger\\HttpClient\\HttpClient' not found in wp-content/plugins/ems-online/vendor/gingerpayments/ginger-php/tests/HttpClient/MockHttpClient.php:8
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/ems-online/vendor/gingerpayments/ginger-php/examples/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/ems-online/vendor/gingerpayments/ginger-php/examples/payment-with-method-selection.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/ems-online/vendor/gingerpayments/ginger-php/tests/ApiClientTest.php:9
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/ems-online/vendor/gingerpayments/ginger-php/examples/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/ems-online/vendor/gingerpayments/ginger-php/examples/ideal-payment.php on line 3
    • > PHP Fatal error
      Uncaught Error: Interface 'Ginger\\HttpClient\\HttpClient' not found in wp-content/plugins/ems-online/vendor/gingerpayments/ginger-php/src/HttpClient/CurlHttpClient.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: woocommerce, ems online, payment

ems-online/ginger.php 85% from 13 tests

The main PHP script in "EMS Online" version 1.3.13 is automatically included on every request by WordPress
Please take the time to 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: The principal plugin file should be the same as the plugin slug ("ems-online.php" instead of "ginger.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected5,152 lines of code in 80 files:
LanguageFilesBlank linesComment linesLines of code
PHP535599522,898
PO File55956471,647
Markdown31510312
SVG1301154
JSON300106
XML13022
YAML10012
INI1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity6.29
▷ Minimum class complexity1.00
▷ Maximum class complexity62.00
Average method complexity2.40
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces7
Interfaces8
Traits0
Classes37
▷ Abstract classes00.00%
▷ Concrete classes37100.00%
▷ Final classes1129.73%
Methods170
▷ Static methods3118.24%
▷ Public methods16395.88%
▷ Protected methods21.18%
▷ Private methods52.94%
Functions22
▷ Named functions1881.82%
▷ Anonymous functions418.18%
Constants11
▷ Global constants218.18%
▷ Class constants981.82%
▷ Public constants9100.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
13 PNG files occupy 0.13MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/ginger_ideal.png2.45KB1.73KB▼ 29.43%
images/ginger_apple-pay.png0.88KB1.22KB0.00%
images/ginger_bank-transfer.png2.56KB1.80KB▼ 29.60%
images/ginger_google-pay.png2.74KB1.83KB▼ 33.49%
images/ginger_klarna-pay-now.png52.72KB1.39KB▼ 97.36%