42% sendpress

Code Review | SendPress Newsletters

WordPress plugin SendPress Newsletters scored42%from 54 tests.

About plugin

  • Plugin page: sendpress
  • Plugin version: 1.22.3.31
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.9
  • WordPress version: 6.3.1
  • First release: Jun 14, 2012
  • Latest release: Mar 31, 2022
  • Number of updates: 512
  • Update frequency: every 7.0 days
  • Top authors: brewlabs (69.92%)joshl (30.27%)

Code review

54 tests

User reviews

60 reviews

Install metrics

4,000+ active /521,366 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.24MB] [CPU: ▲10.43ms] Passed 4 tests

This is a short check of server-side resources used by SendPress Newsletters
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.73 ▲1.2752.30 ▲12.39
Dashboard /wp-admin4.55 ▲1.2456.38 ▲6.59
Posts /wp-admin/edit.php4.62 ▲1.2666.11 ▲10.72
Add New Post /wp-admin/post-new.php7.11 ▲1.22110.09 ▲12.00
Media Library /wp-admin/upload.php4.45 ▲1.2250.24 ▲14.31
Overview /wp-admin/admin.php?page=sp-overview5.4756.22
Help /wp-admin/admin.php?page=sp-help5.22417.51
Queue /wp-admin/admin.php?page=sp-queue5.2857.40
Reports /wp-admin/admin.php?page=sp-reports4.7647.44
Email Templates /wp-admin/customize.php?url=http%3A%2F%2Fwp.com%2F%3Fsendpress_display%3Dtrue%26spemail%3D0&return=http%3A%2F%2Fwp.com%2Fwp-admin%2F&sendpress_display=true&spemail=09.25178.72
Settings /wp-admin/admin.php?page=sp-settings4.5955.58
Pro /wp-admin/admin.php?page=sp-pro4.7148.56
Subscribers /wp-admin/admin.php?page=sp-subscribers5.5151.07
Emails /wp-admin/admin.php?page=sp-emails4.7245.34

Server storage [IO: ▲13.34MB] [DB: ▲0.04MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 867 new files
Database: 12 new tables, 18 new options
New tables
wp_sendpress_subscribers_url
wp_sendpress_subscribers
wp_sendpress_queue
wp_sendpress_schedules
wp_sendpress_subscribers_tracker
wp_sendpress_url
wp_sendpress_customfields
wp_sendpress_subscribers_meta
wp_sendpress_subscribers_status
wp_sendpress_list_subscribers
...
New WordPress options
sendpress_base_settings
sendpress_sender_settings
widget_recent-comments
widget_theysaidso_widget
wp_sendpress_url_db_version
wp_sendpress_subscribers_url_db_version
wp_sendpress_subscribers_tracker_db_version
wp_sendpress_customfields_db_version
can_compress_scripts
widget_sendpress-forms-widget
...

Browser metrics Passed 4 tests

An overview of browser requirements for SendPress Newsletters
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,955 ▲19413.43 ▼1.108.23 ▲6.6139.63 ▼1.29
Dashboard /wp-admin2,250 ▲735.60 ▼0.0791.75 ▲4.6441.42 ▲1.22
Posts /wp-admin/edit.php2,158 ▲581.95 ▼0.0839.45 ▲4.9637.30 ▲1.09
Add New Post /wp-admin/post-new.php1,569 ▲4323.32 ▼0.38608.94 ▼67.0752.97 ▼9.68
Media Library /wp-admin/upload.php1,458 ▲614.17 ▼0.0593.51 ▼6.3741.72 ▼3.15
Overview /wp-admin/admin.php?page=sp-overview1,0742.5047.6346.28
Help /wp-admin/admin.php?page=sp-help1,4245.4571.3382.72
Queue /wp-admin/admin.php?page=sp-queue1,4382.4740.7745.33
Reports /wp-admin/admin.php?page=sp-reports1,2102.4637.6538.09
Email Templates /wp-admin/customize.php?url=http%3A%2F%2Fwp.com%2F%3Fsendpress_display%3Dtrue%26spemail%3D0&return=http%3A%2F%2Fwp.com%2Fwp-admin%2F&sendpress_display=true&spemail=07,89022.08559.39110.26
Settings /wp-admin/admin.php?page=sp-settings2,3063.3847.9252.30
Pro /wp-admin/admin.php?page=sp-pro1,2572.4443.4444.01
Subscribers /wp-admin/admin.php?page=sp-subscribers1,2622.4537.1633.16
Emails /wp-admin/admin.php?page=sp-emails1,2682.4636.8431.15

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/sendpress/uninstall.php+18
    Constant SENDPRESS_VERSION already defined
  • The uninstall procedure failed, leaving 12 tables in the database
    • wp_sendpress_autoresponders
    • wp_sendpress_subscribers
    • wp_sendpress_schedules
    • wp_sendpress_subscribers_tracker
    • wp_sendpress_customfields
    • wp_sendpress_subscribers_status
    • wp_sendpress_subscribers_url
    • wp_sendpress_subscribers_meta
    • wp_sendpress_queue
    • wp_sendpress_list_subscribers
    • ...
  • This plugin does not fully uninstall, leaving 18 options in the database
    • wp_sendpress_url_db_version
    • can_compress_scripts
    • wp_sendpress_autoresponders_db_version
    • sendpress_sender_settings
    • sendpress_options
    • sendpress_base_settings
    • db_upgraded
    • wp_sendpress_subscribers_tracker_db_version
    • wp_sendpress_subscribers_url_db_version
    • widget_sendpress-forms-widget
    • ...

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
Smoke test failed, please fix the following
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sp-settings
    • > Notice in wp-content/plugins/sendpress/classes/class-sendpress-sender-spnl.php+35
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 15× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Control' not found in wp-content/plugins/sendpress/classes/class-sendpress-font-customizer.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'SendPress_DB' not found in wp-content/plugins/sendpress/classes/db/class-sendpress-db-remote-connection.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'SendPress_DB' not found in wp-content/plugins/sendpress/classes/db/class-sendpress-db-url.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Control' not found in wp-content/plugins/sendpress/class-sendpress-font-customizer.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/sendpress/tests/test_wordpress_plugin_tests.php:8
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/sendpress/tests/bootstrap.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'SendPress_DB' not found in wp-content/plugins/sendpress/classes/db/class-sendpress-db-suppression.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/sendpress/tests/test_sendpress_data.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'SendPress_DB' not found in wp-content/plugins/sendpress/classes/db/class-sendpress-db-schedules.php:3
    • > PHP Warning
      require_once(/tmp/wordpress-tests-lib/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/sendpress/tests/bootstrap.php on line 9

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sp-emails
    • > Network (severe)
    spnl-api/system-check - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/customize.php?url=http%3A%2F%2Fwp.com%2F%3Fsendpress_display%3Dtrue%26spemail%3D0&return=http%3A%2F%2Fwp.com%2Fwp-admin%2F&sendpress_display=true&spemail=0
    • > Security (warning) in unknown
    /?sendpress_display=true&spemail=0&customize_changeset_uuid=7690c7a3-fcf3-495d-a213-49c5b7e33ee5&customize_theme=twentytwentyone&customize_messenger_channel=preview-0 - An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: You are using too many tags: 15 tag instead of maximum 10
The official readme.txt might help

sendpress/sendpress.php Passed 13 tests

The main PHP script in "SendPress Newsletters" version 1.22.3.31 is automatically included on every request by WordPress
41 characters long description:
Easy to manage Newsletters for WordPress.

Code Analysis 5% from 3 tests

File types 0% from 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
Almost there! Just fix the following issues
  • For security reasons, never distribute binary or executable files with your plugin
    • .ls - LightWave LScript File in LightWave
      • wp-content/plugins/sendpress/codemirror/mode/livescript/livescript.ls
142,674 lines of code in 672 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2107,1414,22043,114
CSS661,7666,97630,768
PHP2348,3668,56327,770
PO File1510,00516,82922,395
HTML1362,7947817,460
Markdown31840630
SVG211374
Bourne Shell224699
JSON30061
YAML1003

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity15.18
▷ Minimum class complexity1.00
▷ Maximum class complexity235.00
Average method complexity3.18
▷ Minimum method complexity1.00
▷ Maximum method complexity65.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes225
▷ Abstract classes41.78%
▷ Concrete classes22198.22%
▷ Final classes00.00%
Methods1,467
▷ Static methods49333.61%
▷ Public methods1,42296.93%
▷ Protected methods10.07%
▷ Private methods443.00%
Functions32
▷ Named functions32100.00%
▷ Anonymous functions00.00%
Constants58
▷ Global constants2950.00%
▷ Class constants2950.00%
▷ Public constants29100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
139 PNG files occupy 4.22MB with 2.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/smoothness/images/ui-icons_cd0a0a_256x240.png4.44KB4.17KB▼ 6.02%
img/32px/Delicious.png1.32KB0.57KB▼ 56.94%
img/icons.png290.19KB78.49KB▼ 72.95%
img/32px/Flickr.png1.91KB0.92KB▼ 51.59%
img/16px/Google+.png1.47KB0.51KB▼ 65.05%