10% email-marketing-integration-adv

Code Review | Email Marketing Integration Adv

WordPress plugin Email Marketing Integration Adv scored10%from 54 tests.

About plugin

  • Plugin page: email-marketing-i...
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.7.1
  • WordPress version: 6.3.1
  • First release: May 17, 2021
  • Latest release: May 17, 2021
  • Number of updates: 2
  • Update frequency: every 3.5 days
  • Top authors: 4marketing (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /331 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > 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.00MB] [CPU: ▼11.53ms] Passed 4 tests

This is a short check of server-side resources used by Email Marketing Integration Adv
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.18 ▲0.7144.31 ▼3.35
Dashboard /wp-admin4.01 ▲0.7062.55 ▲7.97
Posts /wp-admin/edit.php4.06 ▲0.7061.96 ▲9.42
Add New Post /wp-admin/post-new.php3.82 ▼2.0741.65 ▼56.17
Media Library /wp-admin/upload.php3.93 ▲0.7042.99 ▲5.43
E-commerce Plus /wp-admin/admin.php?page=adv_dem_ecommerce_plus4.0834.57
Gruppi di operazioni /wp-admin/admin.php?page=adv_dem_batch_table3.8543.49
Sincronizza Utenti /wp-admin/admin.php?page=adv_dem_sync_users3.9141.62
Configura API Key /wp-admin/admin.php?page=adv_dem3.8939.15

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 47 new files
Database: 3 new tables, 7 new options
New tables
wp_adv_dem_carts
wp_adv_dem_product_attributes
wp_adv_dem_batches
New WordPress options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_adv_dem_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Email Marketing Integration Adv
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,955 ▲22013.91 ▼0.688.97 ▲6.8138.49 ▼2.37
Dashboard /wp-admin2,248 ▲604.93 ▼0.91111.83 ▼29.2473.59 ▲21.39
Posts /wp-admin/edit.php2,131 ▲392.04 ▲0.0343.19 ▲1.9743.85 ▲9.89
Add New Post /wp-admin/post-new.php1,553 ▲2021.01 ▼2.34694.47 ▲15.9728.35 ▼44.24
Media Library /wp-admin/upload.php1,427 ▲394.21 ▲0.01110.16 ▼9.2073.71 ▲27.61
E-commerce Plus /wp-admin/admin.php?page=adv_dem_ecommerce_plus8271.8036.3229.85
Gruppi di operazioni /wp-admin/admin.php?page=adv_dem_batch_table8232.1237.4935.21
Sincronizza Utenti /wp-admin/admin.php?page=adv_dem_sync_users8311.7232.4231.23
Configura API Key /wp-admin/admin.php?page=adv_dem9662.1533.6237.18

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
Please fix the following items
  • 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_adv_dem_widget
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting 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
    • > 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-integration-adv/admin/class-adv_dem-admin.php+287
    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-integration-adv/admin/class-adv_dem-admin.php+287
    count(): Parameter must be an array or an object that implements Countable
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=adv_dem
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+204
    Undefined offset: 0
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=adv_dem
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+205
    Trying to get property 'guid' of non-object
  • 36 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=adv_dem
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+221
    Trying to get property 'ID' of non-object
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=adv_dem
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+222
    Trying to get property 'post_title' of non-object

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/email-marketing-integration-adv/public/partials/adv_dem-public-display.php
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > 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-integration-adv/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-integration-adv/admin/partials/adv_dem-admin-display.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/email-marketing-integration-adv/admin/partials/adv_dem-admin-display-ecommerce-plus.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/email-marketing-integration-adv/admin/partials/adv_dem-admin-display-batch-table.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/email-marketing-integration-adv/admin/partials/adv_dem-admin-display-sincronizzazione-utenti.php:20
    • > 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-integration-adv/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-integration-adv/includes/class-adv_batch_table.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/email-marketing-integration-adv/includes/class-adv_dem-widget.php:5

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

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Contributors: Contributors not specified
Please take inspiration from this readme.txt

email-marketing-integration-adv/adv_dem.php 77% from 13 tests

This is the main PHP file of "Email Marketing Integration Adv" version 1.1.0, 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: The principal plugin file should be the same as the plugin slug ("email-marketing-integration-adv.php" instead of "adv_dem.php")
  • Text Domain: The text domain should only use lowercase characters and dashes
  • Description: 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 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin4,756 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP215381,3093,745
CSS34633505
JavaScript6112161383
PO File23636118
JSON1005

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity30.92
▷ Minimum class complexity1.00
▷ Maximum class complexity177.00
Average method complexity2.92
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods156
▷ Static methods31.92%
▷ Public methods13989.10%
▷ Protected methods00.00%
▷ Private methods1710.90%
Functions10
▷ Named functions440.00%
▷ Anonymous functions660.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in 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/logo_4Dem_plugin.png3.06KB1.17KB▼ 61.87%
admin/images/icon_plugin_wp_4dem.png1.45KB0.79KB▼ 45.94%
admin/images/icon.png0.63KB0.32KB▼ 49.46%
admin/images/icon_plugin.png1.45KB0.79KB▼ 45.94%