10% paymob-for-woocommerce

Code Review | Paymob for WooCommerce

WordPress plugin Paymob for WooCommerce scored10%from 54 tests.

About plugin

  • Plugin page: paymob-for-woocom...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Nov 19, 2023
  • Latest release: Nov 26, 2023
  • Number of updates: 16
  • Update frequency: every 0.6 days
  • Top authors: nspaymob (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /181 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/paymob-for-woocommerce/init_paymob.php+78
    array_key_exists() expects parameter 2 to be array, bool given

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.85ms] Passed 4 tests

An overview of server-side resources used by Paymob for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0040.42 ▼3.15
Dashboard /wp-admin3.31 ▲0.0046.92 ▼5.17
Posts /wp-admin/edit.php3.36 ▲0.0048.59 ▼0.16
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.04 ▼9.59
Media Library /wp-admin/upload.php3.23 ▲0.0031.92 ▼1.48

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Paymob for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.67 ▲0.451.66 ▼0.1242.63 ▼3.03
Dashboard /wp-admin2,198 ▲215.58 ▲0.0496.64 ▼3.2746.28 ▲2.06
Posts /wp-admin/edit.php2,100 ▼31.94 ▼0.0239.39 ▼1.0435.78 ▼2.39
Add New Post /wp-admin/post-new.php1,526 ▼023.27 ▲0.09685.26 ▲95.1451.38 ▼0.22
Media Library /wp-admin/upload.php1,403 ▲94.20 ▼0.0894.23 ▲0.2240.99 ▼0.63

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
9 plugin tags: gateway, paymob, woo, e-commerce, accept...

paymob-for-woocommerce/init_paymob.php 77% from 13 tests

The entry point to "Paymob for WooCommerce" version 1.0.1 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("paymob-for-woocommerce.php" instead of "init_paymob.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.0" instead of "4.0")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected1,043 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP711884768
PO File14444115
CSS24982
JavaScript16478

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity21.40
▷ Minimum class complexity5.00
▷ Maximum class complexity40.00
Average method complexity3.22
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods46
▷ Static methods1226.09%
▷ Public methods46100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/paymob.png2.72KB1.31KB▼ 52.08%