77% sendpulse-email-marketing-newsletter

Code Review | SendPulse Email Marketing Newsletter

WordPress plugin SendPulse Email Marketing Newsletter scored77%from 54 tests.

About plugin

  • Plugin page: sendpulse-email-m...
  • Plugin version: 2.1.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.2.2
  • WordPress version: 6.3.1
  • First release: Mar 14, 2017
  • Latest release: Jul 14, 2023
  • Number of updates: 29
  • Update frequency: every 79.6 days
  • Top authors: sendpulse (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

2,000+ active /19,535 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.41MB] [CPU: ▼2.86ms] Passed 4 tests

A check of server-side resources used by SendPulse Email Marketing Newsletter
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.87 ▲0.4141.34 ▼9.14
Dashboard /wp-admin3.74 ▲0.4055.70 ▼7.52
Posts /wp-admin/edit.php3.79 ▲0.4458.98 ▲6.70
Add New Post /wp-admin/post-new.php6.32 ▲0.43112.44 ▲2.67
Media Library /wp-admin/upload.php3.64 ▲0.4139.62 ▲2.57
SendPulse Forms /wp-admin/edit.php?post_type=sendpulse_form3.7146.23
Add Form /wp-admin/post-new.php?post_type=sendpulse_form3.7054.75
Settings /wp-admin/edit.php?post_type=sendpulse_form&page=send_pulse_settings3.6440.25

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 57 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
sp_import_setting
widget_recent-posts
sp_api_setting

Browser metrics Passed 4 tests

SendPulse Email Marketing Newsletter: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,989 ▲22814.69 ▲0.541.64 ▼0.2641.60 ▲0.49
Dashboard /wp-admin2,392 ▲2156.39 ▲0.80122.60 ▲31.1340.62 ▼2.42
Posts /wp-admin/edit.php2,322 ▲2223.53 ▲1.5657.86 ▲21.3134.80 ▲0.76
Add New Post /wp-admin/post-new.php1,584 ▲4718.42 ▲0.10598.74 ▼24.3441.75 ▼25.54
Media Library /wp-admin/upload.php1,459 ▲564.38 ▲0.2087.46 ▼8.3044.32 ▼0.63
SendPulse Forms /wp-admin/edit.php?post_type=sendpulse_form1,2883.7444.1926.98
Add Form /wp-admin/post-new.php?post_type=sendpulse_form1,3803.6569.6932.94
Settings /wp-admin/edit.php?post_type=sendpulse_form&page=send_pulse_settings1,1313.4749.0228.61

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • sp_api_setting
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • sp_import_setting

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/sendpulse-email-marketing-newsletter/custom-error-page.php
  • 14× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sendpulse-email-marketing-newsletter/inc/class-senpulse-newsletter-forms.php:15
    • > PHP Fatal error
      Uncaught Exception: Empty ID or SECRET in wp-content/plugins/sendpulse-email-marketing-newsletter/vendor/sendpulse/sendpulse-rest-api-php/api/sendpulse.php:39
    • > PHP Fatal error
      Uncaught Error: Interface 'TokenStorageInterface' not found in wp-content/plugins/sendpulse-email-marketing-newsletter/vendor/sendpulse/sendpulse-rest-api-php/api/Storage/MemcacheStorage.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WeDevs_Settings_API' not found in wp-content/plugins/sendpulse-email-marketing-newsletter/inc/class-sendpulse-newsletter-settings.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'Send_Pulse_Newsletter_Settings' not found in wp-content/plugins/sendpulse-email-marketing-newsletter/inc/class-sendpulse-newsletter-users.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'TokenStorageInterface' not found in wp-content/plugins/sendpulse-email-marketing-newsletter/vendor/sendpulse/sendpulse-rest-api-php/api/Storage/MemcachedStorage.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'TokenStorageInterface' not found in wp-content/plugins/sendpulse-email-marketing-newsletter/vendor/sendpulse/sendpulse-rest-api-php/api/Storage/FileStorage.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'TokenStorageInterface' not found in wp-content/plugins/sendpulse-email-marketing-newsletter/vendor/sendpulse/sendpulse-rest-api-php/api/Storage/SessionStorage.php:7
    • > PHP Warning
      require_once(wp-content/plugins/sendpulse-email-marketing-newsletter/vendor/tareq1988/wordpress-settings-api-class/example/oop-example.php): failed to open stream: No such file or directory in wp-content/plugins/sendpulse-email-marketing-newsletter/vendor/tareq1988/wordpress-settings-api-class/plugin.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sendpulse-email-marketing-newsletter/inc/class-sendpulse-newsletter-ajax.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Tags: Please delete some tags, you are using 28 tag instead of maximum 10
The official readme.txt is a good inspiration

sendpulse-email-marketing-newsletter/sendpulse-newsletter.php 77% from 13 tests

This is the main PHP file of "SendPulse Email Marketing Newsletter" version 2.1.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:
  • Domain Path: Please prefix the domain path with a forward slash character ("/languages")
  • Main file name: The principal plugin file should be the same as the plugin slug ("sendpulse-email-marketing-newsletter.php" instead of "sendpulse-newsletter.php")
  • Domain Path: You should use only dashes and lowercase characters for the domain path ("languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin6,596 lines of code in 47 files:
LanguageFilesBlank linesComment linesLines of code
JSON6003,781
PHP317801,6012,366
PO File17193226
JavaScript42432111
Markdown332079
CSS26033

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity15.15
▷ Minimum class complexity1.00
▷ Maximum class complexity76.00
Average method complexity2.53
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces2
Interfaces2
Traits0
Classes18
▷ Abstract classes00.00%
▷ Concrete classes18100.00%
▷ Final classes00.00%
Methods235
▷ Static methods218.94%
▷ Public methods22595.74%
▷ Protected methods41.70%
▷ Private methods62.55%
Functions8
▷ Named functions787.50%
▷ Anonymous functions112.50%
Constants6
▷ Global constants466.67%
▷ Class constants233.33%
▷ Public constants2100.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.38MB with 0.13MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/menu_icon.png0.67KB0.71KB0.00%
vendor/tareq1988/wordpress-settings-api-class/screenshot-1.png389.59KB115.93KB▼ 70.24%