72% sailthru-widget

Code Review | Sailthru for WordPress

WordPress plugin Sailthru for WordPress scored72%from 54 tests.

About plugin

  • Plugin page: sailthru-widget
  • Plugin version: 4.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-5.7
  • WordPress version: 6.3.1
  • First release: Jun 10, 2011
  • Latest release: Aug 1, 2023
  • Number of updates: 98
  • Update frequency: every 45.3 days
  • Top authors: sailthru-wp (89.8%)rzsouza (9.18%)chinsail (3.06%)

Code review

54 tests

User reviews

1 review

Install metrics

800+ active /54,670 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.87MB] [CPU: ▲3.39ms] Passed 4 tests

Analyzing server-side resources used by Sailthru for WordPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.44 ▲0.9845.30 ▼0.39
Dashboard /wp-admin4.29 ▲0.9962.61 ▲10.06
Posts /wp-admin/edit.php4.34 ▲0.9858.53 ▲7.12
Add New Post /wp-admin/post-new.php6.42 ▲0.5393.79 ▼3.24
Media Library /wp-admin/upload.php4.22 ▲0.9854.56 ▲17.27
Content Settings /wp-admin/admin.php?page=sailthru_content_settings4.1239.51
Settings /wp-admin/admin.php?page=sailthru_configuration_page4.1341.30

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 72 new files
Database: no new tables, 14 new options
New WordPress options
sailthru_concierge_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded
sailthru_override_wp_mail
sailthru_scout_options
sailthru_content_settings
theysaidso_admin_options
...

Browser metrics Passed 4 tests

An overview of browser requirements for Sailthru for WordPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,949 ▲21414.01 ▼0.368.39 ▲6.7339.61 ▼1.48
Dashboard /wp-admin2,246 ▲615.00 ▼0.90125.25 ▼35.1876.85 ▲26.61
Posts /wp-admin/edit.php2,136 ▲472.26 ▲0.2036.56 ▼6.7540.58 ▲2.49
Add New Post /wp-admin/post-new.php6,271 ▲4,75719.22 ▲1.75914.06 ▲244.4371.41 ▲3.34
Media Library /wp-admin/upload.php1,416 ▲314.27 ▲0.05101.57 ▼7.6147.73 ▲3.21
Content Settings /wp-admin/admin.php?page=sailthru_content_settings9421.9028.1427.38
Settings /wp-admin/admin.php?page=sailthru_configuration_page8831.9034.1832.07

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_recent-comments
    • widget_recent-posts
    • widget_sailthru-subscribe-id
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_sailthru-recommends-id

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
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sailthru_configuration_page
    • > 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
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sailthru_configuration_page
    • > 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
  • 16 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sailthru_configuration_page
    • > 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
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sailthru_configuration_page
    • > 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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/sailthru-widget/views/display.php
    • > /wp-content/plugins/sailthru-widget/js/ajax.php
  • 28× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/sailthru-widget/classes/class-sailthru-meta-box.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sailthru-widget/views/admin.functions.integrations.options.php:132
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/sailthru-widget/views/widget.scout.display.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sailthru_verify_setup() in wp-content/plugins/sailthru-widget/views/welcome.html.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/sailthru-widget/views/admin.php:4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/sailthru-widget/classes/class-sailthru-mailer.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/sailthru-widget/plugin.php:43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/sailthru-widget/plugin.php:43
    • > PHP Warning
      require_once(ABSPATHWPINC/PHPMailer/PHPMailer.php): failed to open stream: No such file or directory in wp-content/plugins/sailthru-widget/classes/class-sailthru-mailer.php on line 6
    • > PHP Fatal error
      require_once(): Failed opening required 'SAILTHRU_PLUGIN_PATHviews/admin.functions.setup.options.php' (include_path='.:/usr/share/php') in wp-content/plugins/sailthru-widget/views/admin.functions.php on line 3

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

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
2 plugin tags: personalization, email

sailthru-widget/plugin.php 92% from 13 tests

"Sailthru for WordPress" version 4.3.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("sailthru-widget.php" instead of "plugin.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
Everything looks great! No dangerous files found in this plugin7,813 lines of code in 53 files:
LanguageFilesBlank linesComment linesLines of code
PHP321,6371,8905,417
JavaScript132863141,931
CSS55110242
Sass1130104
Markdown1440102
PO File10017

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity33.33
▷ Minimum class complexity1.00
▷ Maximum class complexity99.00
Average method complexity3.24
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods173
▷ Static methods74.05%
▷ Public methods15690.17%
▷ Protected methods63.47%
▷ Private methods116.36%
Functions77
▷ Named functions77100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants541.67%
▷ Class constants758.33%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
12 PNG files occupy 0.42MB with 0.28MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-5.png101.95KB33.72KB▼ 66.93%
assets/screenshot-4.png57.17KB16.52KB▼ 71.11%
assets/icon-256x256.png10.88KB4.62KB▼ 57.59%
img/smart-data.png24.15KB9.47KB▼ 60.79%
assets/screenshot-2.png63.16KB18.64KB▼ 70.49%