84% moceanapi-abandoned-carts

Code Review | MoceanAPI Abandoned Carts for WooCommerce

WordPress plugin MoceanAPI Abandoned Carts for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: moceanapi-abandon...
  • Plugin version: 1.2.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.0
  • WordPress version: 6.3.1
  • First release: Jun 1, 2021
  • Latest release: Apr 26, 2023
  • Number of updates: 8
  • Update frequency: every 89.8 days
  • Top authors: moceanapiplugin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /409 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲4.76MB] [CPU: ▲24.25ms] Passed 4 tests

Analyzing server-side resources used by MoceanAPI Abandoned Carts for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /8.54 ▲5.0764.75 ▲20.98
Dashboard /wp-admin8.56 ▲5.2573.38 ▲23.74
Posts /wp-admin/edit.php8.56 ▲5.2079.57 ▲35.83
Add New Post /wp-admin/post-new.php9.40 ▲3.51114.87 ▲20.08
Media Library /wp-admin/upload.php8.56 ▲5.3265.89 ▲32.21
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius8.5661.72

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 194 new files
Database: 1 new table, 16 new options
New tables
wp_moceanapi_abandoned_carts
New WordPress options
moceanapi_abandoned_carts_ghost_cart_count
fs_gdpr
widget_theysaidso_widget
theysaidso_admin_options
moceanapi_abandoned_carts_version_number
db_upgraded
moceanapi_abandoned_carts_sms_notification_frequency
fs_active_plugins
widget_recent-comments
can_compress_scripts
...

Browser metrics Passed 4 tests

A check of browser resources used by MoceanAPI Abandoned Carts for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲10213.31 ▼1.061.74 ▼0.3628.42 ▼16.44
Dashboard /wp-admin2,243 ▲555.84 ▼0.03120.85 ▲7.9444.97 ▼1.97
Posts /wp-admin/edit.php2,130 ▲442.01 ▼0.0139.33 ▲0.3033.63 ▼0.08
Add New Post /wp-admin/post-new.php1,535 ▲1522.18 ▼0.88612.90 ▼102.2059.21 ▲3.81
Media Library /wp-admin/upload.php1,425 ▲374.27 ▲0.0696.13 ▼13.1543.90 ▼2.28
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,0721.7223.4828.55

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • fs_debug_mode
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • fs_active_plugins
    • fs_gdpr
    • fs_accounts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% 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× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/moceanapi-abandoned-carts/admin/class-moceanapi-abandoned-carts-admin-table.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/moceanapi-abandoned-carts/admin/class-moceanapi-abandoned-carts-admin.php:14
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/moceanapi-abandoned-carts/admin/class-moceanapi-abandoned-carts-admin-table.php on line 13
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/moceanapi-abandoned-carts/admin/class-moceanapi-abandoned-carts-admin-table.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
9 plugin tags: abandon carts, sms notification, woocommerce, mocean, cart abandonment...

moceanapi-abandoned-carts/moceanapi-abandoned-carts.php 92% from 13 tests

The entry point to "MoceanAPI Abandoned Carts for WooCommerce" version 1.2.0 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis 97% from 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
No dangerous file extensions were detected34,309 lines of code in 144 files:
LanguageFilesBlank linesComment linesLines of code
PHP1207,68017,00333,191
CSS137511449
JavaScript680121414
Markdown2680215
JSON10027
SVG20113

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
Please fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity82.13
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity4.61
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes54
▷ Abstract classes23.70%
▷ Concrete classes5296.30%
▷ Final classes00.00%
Methods1,246
▷ Static methods17514.04%
▷ Public methods89571.83%
▷ Protected methods151.20%
▷ Private methods33626.97%
Functions97
▷ Named functions97100.00%
▷ Anonymous functions00.00%
Constants137
▷ Global constants11281.75%
▷ Class constants2518.25%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
lib/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
lib/freemius/assets/img/moceansms-order-sms-notification-for-woocommerce.png1.78KB1.19KB▼ 33.33%
lib/freemius/assets/img/moceanapi-abandoned-carts.png4.22KB1.98KB▼ 53.16%