67% smart-marketing-for-wp

Code Review | Smart Marketing SMS and Newsletters Forms

WordPress plugin Smart Marketing SMS and Newsletters Forms scored67%from 54 tests.

About plugin

  • Plugin page: smart-marketing-f...
  • Plugin version: 4.1.10
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1.0
  • WordPress version: 6.3.1
  • First release: Aug 2, 2016
  • Latest release: Jun 20, 2023
  • Number of updates: 267
  • Update frequency: every 9.5 days
  • Top authors: egoi (100%)

Code review

54 tests

User reviews

153 reviews

Install metrics

2,000+ active /141,390 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲1.57MB] [CPU: ▲6.35ms] Passed 4 tests

A check of server-side resources used by Smart Marketing SMS and Newsletters Forms
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /5.00 ▲1.5446.35 ▲3.18
Dashboard /wp-admin4.89 ▲1.5970.46 ▲14.86
Posts /wp-admin/edit.php4.97 ▲1.6267.49 ▲9.44
Add New Post /wp-admin/post-new.php7.47 ▲1.58101.38 ▼2.07
Media Library /wp-admin/upload.php4.78 ▲1.5655.22 ▲21.31
Account /wp-admin/admin.php?page=egoi-4-wp-account4.8448.26

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 260 new files
Database: 3 new tables, 16 new options
New tables
wp_egoi_lazy_request
wp_egoi_map_fields
wp_egoi_form_subscribers
New WordPress options
widget_egoi4widget
theysaidso_admin_options
db_upgraded
egoi_client_allow
egoi_client
can_compress_scripts
egoi_api_key
egoi_bar_sync
egoi_transactional_email
egoi_sync
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Smart Marketing SMS and Newsletters Forms
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,138 ▲37713.75 ▼0.878.52 ▲6.4827.56 ▼18.11
Dashboard /wp-admin2,436 ▲2594.93 ▼0.74101.78 ▲4.8885.40 ▲39.00
Posts /wp-admin/edit.php2,185 ▲852.31 ▲0.2736.77 ▼1.9333.05 ▼3.67
Add New Post /wp-admin/post-new.php6,447 ▲4,92127.66 ▲4.63938.24 ▲217.8938.94 ▼16.18
Media Library /wp-admin/upload.php1,480 ▲804.45 ▲0.28105.60 ▲5.3168.80 ▲28.02
Account /wp-admin/admin.php?page=egoi-4-wp-account1,0844.0467.4760.87

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie tables detected upon uninstall: 3 tables
    • wp_egoi_lazy_request
    • wp_egoi_map_fields
    • wp_egoi_form_subscribers
  • Zombie WordPress options were found after uninstall: 16 options
    • db_upgraded
    • egoi_client_type
    • widget_egoi4widget
    • widget_recent-comments
    • egoi_bar_sync
    • theysaidso_admin_options
    • egoi_client_allow
    • egoi_transactional_email
    • egoi_sync
    • widget_theysaidso_widget
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/smart-marketing-for-wp/admin/partials/emailcampaignwidget/email_content.php
    • > /wp-content/plugins/smart-marketing-for-wp/admin/partials/egoi-for-wp-common.php
    • > /wp-content/plugins/smart-marketing-for-wp/admin/partials/capture/functions.php
  • 41× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/smart-marketing-for-wp/admin/partials/egoi-for-wp-admin-header.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_locale() in wp-content/plugins/smart-marketing-for-wp/admin/partials/capture/simple-forms.php:137
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/smart-marketing-for-wp/admin/partials/webpush/home.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/smart-marketing-for-wp/admin/partials/integrations/home.php:5
    • > PHP Warning
      array_values() expects parameter 1 to be array, bool given in wp-content/plugins/smart-marketing-for-wp/admin/partials/capture/simple-forms.php on line 136
    • > PHP Warning
      The use statement with non-compound name 'MailCatcherInterface' has no effect in wp-content/plugins/smart-marketing-for-wp/includes/transactionalemail/mailer.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/smart-marketing-for-wp/admin/partials/capture/popup.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/smart-marketing-for-wp/admin/partials/transactionalemail/home.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/smart-marketing-for-wp/admin/partials/capture/home.php:2
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/smart-marketing-for-wp/admin/partials/rssfeed/campaign-rss.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 79% from 29 tests

readme.txt 75% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === smart-marketing-for-wp === )
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Add descriptions for screenshots #1, #10, #2, #3, #4, #5, #6, #7, #8, #9 in smart-marketing-for-wp/assets to your readme.txt
  • Donate link: Invalid url: ""
The official readme.txt is a good inspiration

smart-marketing-for-wp/egoi-for-wp.php 85% from 13 tests

"Smart Marketing SMS and Newsletters Forms" version 4.1.10's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("smart-marketing-for-wp.php" instead of "egoi-for-wp.php")

Code Analysis Passed 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
Good job! No executable or dangerous file extensions detected96,881 lines of code in 165 files:
LanguageFilesBlank linesComment linesLines of code
CSS2710,79425144,745
JavaScript394,4331,76219,437
PHP852,9771,66617,897
SVG9139,846
PO File31,9803,1004,885
JSON20071

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity52.04
▷ Minimum class complexity1.00
▷ Maximum class complexity402.00
Average method complexity3.71
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes23
▷ Abstract classes00.00%
▷ Concrete classes23100.00%
▷ Final classes00.00%
Methods442
▷ Static methods8118.33%
▷ Public methods35079.19%
▷ Protected methods153.39%
▷ Private methods7717.42%
Functions69
▷ Named functions6086.96%
▷ Anonymous functions913.04%
Constants38
▷ Global constants410.53%
▷ Class constants3489.47%
▷ Public constants34100.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
47 PNG files occupy 0.43MB with 0.20MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/check.png31.48KB8.99KB▼ 71.45%
admin/img/upgrade-icon.png5.87KB2.31KB▼ 60.63%
admin/img/error.png23.77KB10.94KB▼ 53.98%
admin/img/colorpicker/colorpicker_rgb_r.png1.04KB0.77KB▼ 26.17%
admin/img/colorpicker/custom_rgb_r.png0.99KB0.74KB▼ 25.34%