10% email-marketing-4dem

Code Review | Email Marketing 4Dem

WordPress plugin Email Marketing 4Dem scored10%from 54 tests.

About plugin

  • Plugin page: email-marketing-4dem
  • Plugin version: 2.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.7.1
  • WordPress version: 6.3.1
  • First release: May 21, 2021
  • Latest release: Sep 15, 2023
  • Number of updates: 34
  • Update frequency: every 24.9 days
  • Top authors: 4marketing (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /1,081 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)

Server metrics [RAM: ▲0.19MB] [CPU: ▼14.63ms] Passed 4 tests

This is a short check of server-side resources used by Email Marketing 4Dem
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.61 ▲0.8849.78 ▲8.70
Dashboard /wp-admin4.43 ▲0.8759.11 ▲0.14
Posts /wp-admin/edit.php4.55 ▲0.8755.34 ▲0.80
Add New Post /wp-admin/post-new.php4.31 ▼1.8444.74 ▼68.17
Media Library /wp-admin/upload.php4.36 ▲0.8749.03 ▲9.69
E-commerce Plus /wp-admin/admin.php?page=adv_dem_ecommerce_plus4.5740.43
Gruppi di operazioni /wp-admin/admin.php?page=adv_dem_batch_table4.3441.25
Configura API Key /wp-admin/admin.php?page=adv_dem4.3841.18
Sincronizza Utenti /wp-admin/admin.php?page=adv_dem_sync_users4.4041.43

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 54 new files
Database: 3 new tables, 8 new options
New tables
wp_adv_dem_carts
wp_adv_dem_product_attributes
wp_adv_dem_batches
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_adv_dem_widget
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
adv_dem

Browser metrics Passed 4 tests

This is an overview of browser requirements for Email Marketing 4Dem
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,919 ▲13314.77 ▲0.025.46 ▲3.5042.04 ▼1.79
Dashboard /wp-admin2,222 ▲455.64 ▲0.0984.30 ▼6.2287.19 ▲42.70
Posts /wp-admin/edit.php2,145 ▲451.97 ▼0.0436.15 ▼1.4234.43 ▼1.85
Add New Post /wp-admin/post-new.php1,562 ▲2823.37 ▲0.09757.32 ▲117.7835.88 ▼20.32
Media Library /wp-admin/upload.php1,442 ▲424.25 ▼0.03100.51 ▼2.7076.84 ▲29.30
E-commerce Plus /wp-admin/admin.php?page=adv_dem_ecommerce_plus8631.7530.0928.98
Gruppi di operazioni /wp-admin/admin.php?page=adv_dem_batch_table8322.1129.8227.97
Configura API Key /wp-admin/admin.php?page=adv_dem9752.1230.2834.52
Sincronizza Utenti /wp-admin/admin.php?page=adv_dem_sync_users8431.9131.4129.74

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_adv_dem_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=adv_dem_sync_users
    • > POST request to /wp-admin/admin-ajax.php
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
    • > GET request to /wp-admin/admin.php?page=adv_dem_ecommerce_plus
    • > Notice in wp-content/plugins/email-marketing-4dem/admin/class-adv_dem-admin.php+305
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/admin.php?page=adv_dem_ecommerce_plus
    • > Warning in wp-content/plugins/email-marketing-4dem/admin/class-adv_dem-admin.php+305
    count(): Parameter must be an array or an object that implements Countable

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 items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/email-marketing-4dem/public/partials/adv_dem-public-display.php
  • 8× PHP files trigger server errors when accessed directly:
    • > 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/email-marketing-4dem/includes/class-adv_batch_table.php on line 4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/email-marketing-4dem/admin/partials/adv_dem-admin-display.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/email-marketing-4dem/admin/partials/adv_dem-admin-display-sincronizzazione-utenti.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/email-marketing-4dem/includes/class-adv_dem-widget.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/email-marketing-4dem/admin/partials/adv_dem-admin-display-batch-table.php:21
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/email-marketing-4dem/includes/class-adv_batch_table.php on line 4
    • > 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/email-marketing-4dem/includes/class-adv_batch_table.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/email-marketing-4dem/admin/partials/adv_dem-admin-display-ecommerce-plus.php:22

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 errors were detected

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Contributors: The plugin contributors field is not present
  • Screenshots: Please describe screenshot #1 in email-marketing-4dem/assets to your readme.txt
The official readme.txt is a good inspiration

email-marketing-4dem/adv_dem.php 77% from 13 tests

This is the main PHP file of "Email Marketing 4Dem" version 2.0.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("email-marketing-4dem.php" instead of "adv_dem.php")
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Description: Please keep the plugin description shorter than 140 characters (currently 252 characters long)

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
Good job! No executable or dangerous file extensions detected5,698 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
PHP287271,7544,687
CSS34633505
JavaScript6112161383
PO File23636118
JSON1005

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity27.00
▷ Minimum class complexity1.00
▷ Maximum class complexity188.00
Average method complexity3.20
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes00.00%
Methods201
▷ Static methods2612.94%
▷ Public methods16582.09%
▷ Protected methods00.00%
▷ Private methods3617.91%
Functions11
▷ Named functions436.36%
▷ Anonymous functions763.64%
Constants8
▷ Global constants00.00%
▷ Class constants8100.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
5 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/logo_plugin.png3.06KB1.17KB▼ 61.87%
admin/images/icon.png0.63KB0.32KB▼ 49.46%
admin/images/icon_plugin.png1.45KB0.79KB▼ 45.94%
admin/images/icon_plugin_wp_4dem.png1.45KB0.79KB▼ 45.94%
admin/images/logo_4Dem_plugin.png3.06KB1.17KB▼ 61.87%