62% elastic-email-subscribe-form

Code Review | Elastic Email Subscribe Form

WordPress plugin Elastic Email Subscribe Form scored62%from 54 tests.

About plugin

  • Plugin page: elastic-email-sub...
  • Plugin version: 1.2.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-5.7
  • WordPress version: 6.3.1
  • First release: Feb 7, 2018
  • Latest release: Oct 27, 2021
  • Number of updates: 51
  • Update frequency: every 26.6 days
  • Top authors: elasticemail (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

300+ active /14,114 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.25MB] [CPU: ▲0.26ms] Passed 4 tests

A check of server-side resources used by Elastic Email Subscribe Form
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1441.64 ▲5.34
Dashboard /wp-admin3.59 ▲0.2551.76 ▼5.69
Posts /wp-admin/edit.php3.71 ▲0.3549.43 ▲1.79
Add New Post /wp-admin/post-new.php6.19 ▲0.3197.69 ▲1.10
Media Library /wp-admin/upload.php3.52 ▲0.2938.89 ▲3.85
Send test /wp-admin/admin.php?page=elasticemail-send-test3.5034.00
Security /wp-admin/admin.php?page=elasticemail-security3.5036.76
Reports /wp-admin/admin.php?page=elasticemail-report4.5440.74
Lists /wp-admin/admin.php?page=elasticemail-lists4.5438.68
Settings /wp-admin/admin.php?page=elasticemail-settings4.5445.21
Error log /wp-admin/admin.php?page=elasticemail-error-log3.4936.21

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 38 new files
Database: 1 new table, 18 new options
New tables
wp_elasticemail_log
New WordPress options
theysaidso_admin_options
ee_actualselectedlist
ee_mimetype
elastic-email-subscribe-status
elastic-email-subscribe-basename
eesf_plugin_path
ee_config_from_name
widget_recent-posts
ee-apikey
can_compress_scripts
...

Browser metrics Passed 4 tests

An overview of browser requirements for Elastic Email Subscribe Form
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,867 ▲9614.80 ▲0.152.06 ▲0.2446.07 ▲3.92
Dashboard /wp-admin2,245 ▲565.84 ▲0.9196.31 ▼25.3569.76 ▲28.37
Posts /wp-admin/edit.php2,137 ▲452.02 ▲0.0637.58 ▼1.8433.31 ▼2.92
Add New Post /wp-admin/post-new.php1,556 ▲3522.96 ▼0.09720.00 ▲36.4164.99 ▲13.76
Media Library /wp-admin/upload.php1,430 ▲454.11 ▼0.1197.15 ▼11.8175.05 ▲27.79
Send test /wp-admin/admin.php?page=elasticemail-send-test1,0152.1829.9927.10
Security /wp-admin/admin.php?page=elasticemail-security1,0632.0424.1733.60
Reports /wp-admin/admin.php?page=elasticemail-report1,0162.6235.3625.15
Lists /wp-admin/admin.php?page=elasticemail-lists1,0882.1527.3728.01
Settings /wp-admin/admin.php?page=elasticemail-settings1,0762.1025.7125.53
Error log /wp-admin/admin.php?page=elasticemail-error-log9222.2024.7327.39

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_elasticemail_log
  • Zombie WordPress options were found after uninstall: 11 options
    • elastic-email-subscribe-status
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • ee_config_from_name
    • widget_recent-comments
    • ee_config_from_email
    • db_upgraded
    • elastic-email-subscribe-basename
    • can_compress_scripts
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=elasticemail-error-log
    • > Notice in wp-content/plugins/elastic-email-subscribe-form/template/t-eesf_errorlog.php+20
    Trying to access array offset on value of type bool

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
  • 7× PHP files output text when accessed directly:
    • > /wp-content/plugins/elastic-email-subscribe-form/template/t-eesf_reports.php
    • > /wp-content/plugins/elastic-email-subscribe-form/template/t-eesf_lists.php
    • > /wp-content/plugins/elastic-email-subscribe-form/template/t-eesf_sendtest.php
    • > /wp-content/plugins/elastic-email-subscribe-form/template/t-eesf_errorlog.php
    • > /wp-content/plugins/elastic-email-subscribe-form/template/t-eesf_admin.php
    • > /wp-content/plugins/elastic-email-subscribe-form/template/widget/t-eesf_widget-footer.php
    • > /wp-content/plugins/elastic-email-subscribe-form/template/t-eesf_security.php
  • 19× 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 get_option() in wp-content/plugins/elastic-email-subscribe-form/template/widget/t-eesf_widget-header.php:3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/elastic-email-subscribe-form/template/widget/t-eesf_widget-footer.php on line 18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/elastic-email-subscribe-form/defaults/function.reset_pass.php:21
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/elastic-email-subscribe-form/elasticemailsubscribe.php on line 4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/elastic-email-subscribe-form/template/widget/t-eesf_widget-footer.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/elastic-email-subscribe-form/security/config/eesf_config.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/elastic-email-subscribe-form/class/eesf_widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/elastic-email-subscribe-form/template/t-eesf_connecterror.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/elastic-email-subscribe-form/template/t-eesf_apidisabled.php:2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/elastic-email-subscribe-form/elasticemailsubscribe.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: email marketing, recaptcha, tags elastic email, subscribe widget, newsletter...

elastic-email-subscribe-form/elasticemailsubscribe.php 92% from 13 tests

The entry point to "Elastic Email Subscribe Form" version 1.2.2 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("elastic-email-subscribe-form.php" instead of "elasticemailsubscribe.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin6,243 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP211,4493,6715,271
SVG300962
JavaScript60106
CSS4064

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity2.90
▷ Minimum class complexity1.00
▷ Maximum class complexity79.00
Average method complexity2.04
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes102
▷ Abstract classes2423.53%
▷ Concrete classes7876.47%
▷ Final classes00.00%
Methods185
▷ Static methods137.03%
▷ Public methods18398.92%
▷ Protected methods00.00%
▷ Private methods21.08%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants127
▷ Global constants53.94%
▷ Class constants12296.06%
▷ Public constants122100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/img/icon.png3.45KB0.78KB▼ 77.30%
src/img/connect_apikey.png16.15KB6.44KB▼ 60.15%