63% emercury-for-woocommerce

Code Review | Emercury for WooCommerce

WordPress plugin Emercury for WooCommerce scored63%from 54 tests.

About plugin

  • Plugin page: emercury-for-wooc...
  • Plugin version: 1.1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 2, 2019
  • Latest release: Apr 11, 2023
  • Number of updates: 22
  • Update frequency: every 55.9 days
  • Top authors: emercury (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /639 total downloads

Benchmarks

Plugin footprint 48% 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.00MB] [CPU: ▼11.24ms] Passed 4 tests

A check of server-side resources used by Emercury for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.31 ▼4.77
Dashboard /wp-admin3.31 ▲0.0051.22 ▼6.41
Posts /wp-admin/edit.php3.36 ▲0.0048.23 ▼16.97
Add New Post /wp-admin/post-new.php5.89 ▲0.0095.90 ▼16.80
Media Library /wp-admin/upload.php3.23 ▲0.0038.85 ▼2.16

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Emercury for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.17 ▼0.181.74 ▼0.0440.87 ▼6.36
Dashboard /wp-admin2,192 ▲125.60 ▲0.0187.73 ▼10.7741.06 ▼5.90
Posts /wp-admin/edit.php2,100 ▼01.95 ▼0.0834.29 ▼8.4635.58 ▼5.27
Add New Post /wp-admin/post-new.php1,526 ▼223.13 ▼0.01652.66 ▼42.9054.72 ▲1.47
Media Library /wp-admin/upload.php1,400 ▲34.23 ▲0.09110.24 ▼5.0449.72 ▼1.11

Uninstaller [IO: ▲0.23MB] [DB: ▲0.00MB] 25% 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
  • This plugin did not uninstall without warnings or errors
    • > Error in wp-content/plugins/emercury-for-woocommerce/emercury-woocommerce.php+205
    Uncaught Error: Call to undefined function as_next_scheduled_action() in wp-content/plugins/emercury-for-woocommerce/emercury-woocommerce.php:205
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): WC_Emercury_Integration::drop_plugin_tables()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/includes/plugin.php(1269): do_action()
    #4 wp-admin/includes/plugin.php(960): uninstall_plugin()
  • The plugin did not uninstall correctly, leaving 14 files (0.23MB) in the plugin directory
    • (new file) includes/wc-marketing-settings-emercury.php
    • (new file) includes/emercury.php
    • (new file) includes/functions.php
    • (new file) emercury-woocommerce.php
    • (new file) includes/wc-settings-emercury.php
    • (new file) includes/wc-settings-emercury-force-campaign.php
    • (new file) includes/data-settings.php
    • (new file) assets/js/integration-emercury.js
    • (new file) readme.txt
    • (new file) includes/wc-settings-emercury-list.php
    • ...
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/emercury-for-woocommerce/includes/wc-marketing-settings-emercury.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/emercury-for-woocommerce/includes/functions.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/emercury-for-woocommerce/includes/wc-settings-emercury-force-campaign.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/emercury-for-woocommerce/includes/wc-settings-emercury.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/emercury-for-woocommerce/includes/wc-settings-emercury-list.php:6

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 86% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Emercury Settings.), #2 (Emercury Mapping.), #3 (Emercury Marketing Settings.), #4 (Checkout page.)
Please take inspiration from this readme.txt

emercury-for-woocommerce/emercury-woocommerce.php 77% from 13 tests

The primary PHP file in "Emercury for WooCommerce" version 1.1.1 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("emercury-for-woocommerce.php" instead of "emercury-woocommerce.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 171 characters long)
  • Requires at least: Required version does not match the one declared in readme.txt ("4.6" instead of "4.6.0")

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
Success! There were no dangerous files found in this plugin1,192 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP8274701,161
JavaScript15031

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity19.67
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods47
▷ Static methods2961.70%
▷ Public methods4595.74%
▷ Protected methods00.00%
▷ Private methods24.26%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.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.17MB with 0.10MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png40.36KB13.97KB▼ 65.39%
screenshot-1.png28.83KB12.43KB▼ 56.89%
screenshot-3.png50.47KB16.32KB▼ 67.66%
screenshot-2.png51.27KB22.22KB▼ 56.66%