72% sendmachine

Code Review | Sendmachine for WordPress

WordPress plugin Sendmachine for WordPress scored72%from 54 tests.

About plugin

  • Plugin page: sendmachine
  • Plugin version: 1.0.19
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2.1-6.2
  • WordPress version: 6.3.1
  • First release: Aug 21, 2015
  • Latest release: Apr 11, 2023
  • Number of updates: 33
  • Update frequency: every 84.6 days
  • Top authors: sendmachine (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /2,054 total downloads

Benchmarks

Plugin footprint 83% 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.04MB] [CPU: ▼6.36ms] Passed 4 tests

Server-side resources used by Sendmachine for WordPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0335.42 ▼5.43
Dashboard /wp-admin3.34 ▲0.0443.93 ▼4.60
Posts /wp-admin/edit.php3.46 ▲0.1044.57 ▼2.03
Add New Post /wp-admin/post-new.php5.94 ▲0.0681.37 ▼13.39
Media Library /wp-admin/upload.php3.27 ▲0.0441.62 ▲8.65
Lists /wp-admin/admin.php?page=sendmachine_lists3.2128.48
General /wp-admin/admin.php?page=sendmachine_settings3.2830.04
Email Settings /wp-admin/admin.php?page=sendmachine_email3.3329.16
Feed /wp-admin/admin.php?page=sendmachine_feed3.3336.19

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 41 new files
Database: no new tables, 7 new options
New WordPress options
sendmachine_application
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Sendmachine for WordPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲9513.24 ▼1.071.71 ▼0.1342.40 ▼3.88
Dashboard /wp-admin2,250 ▲624.85 ▼0.0896.82 ▼20.8085.97 ▲43.60
Posts /wp-admin/edit.php2,127 ▲382.00 ▼0.0334.80 ▼2.5432.21 ▼5.40
Add New Post /wp-admin/post-new.php1,702 ▲16622.13 ▼1.18788.85 ▲108.8457.76 ▲6.60
Media Library /wp-admin/upload.php1,426 ▲354.26 ▲0.03109.71 ▲6.9671.90 ▲24.96
Lists /wp-admin/admin.php?page=sendmachine_lists1,2182.0825.8235.78
General /wp-admin/admin.php?page=sendmachine_settings8862.0426.3530.57
Email Settings /wp-admin/admin.php?page=sendmachine_email1,1212.2124.0133.59
Feed /wp-admin/admin.php?page=sendmachine_feed2,47810.26177.67151.12

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

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
    • > GET request to /wp-admin/admin.php?page=sendmachine_lists
    • > Warning in wp-admin/includes/plugin.php+294
    opendir(wp-content/plugins/really-simple-captcha): failed to open dir: No such file or directory

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 fix the following items
  • 6× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/sendmachine/api/examples/list_examples.php
    • > /wp-content/plugins/sendmachine/api/examples/sender_examples.php
    • > /wp-content/plugins/sendmachine/api/examples/template_examples.php
    • > /wp-content/plugins/sendmachine/api/examples/campaign_examples.php
    • > /wp-content/plugins/sendmachine/api/examples/mail_examples.php
    • > /wp-content/plugins/sendmachine/api/examples/account_examples.php
  • 8× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/sendmachine/sendmachine_widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/sendmachine/views/wp_sm_feed_settings.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/sendmachine/views/wp_sm_list_settings.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/sendmachine/sendmachine_widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/sendmachine/views/wp_sm_email_settings.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Sm_wp' not found in wp-content/plugins/sendmachine/sendmachine_wp_admin.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/sendmachine/views/wp_sm_general_settings.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/sendmachine/views/wp_sm_feed_preview.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: subscribers, sendmachine, email marketing, campaigns, sign-up...

sendmachine/sendmachine_wp.php 85% from 13 tests

The main PHP script in "Sendmachine for WordPress" version 1.0.19 is automatically included on every request by WordPress
It is important to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("sendmachine.php" instead of "sendmachine_wp.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin2,997 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP276836762,306
PO File1148155416
CSS223153
JavaScript2410107
JSON10011
Markdown1104

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.40
Average class complexity17.28
▷ Minimum class complexity1.00
▷ Maximum class complexity85.00
Average method complexity3.59
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes18
▷ Abstract classes00.00%
▷ Concrete classes18100.00%
▷ Final classes00.00%
Methods114
▷ Static methods65.26%
▷ Public methods10289.47%
▷ Protected methods00.00%
▷ Private methods1210.53%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
static/images/wp_sendmachine_logo_big.png3.21KB2.01KB▼ 37.37%
static/images/wp_sendmachine_logo_old.png1.60KB1.38KB▼ 13.74%
static/images/wp_sendmachine_logo.png0.45KB0.62KB0.00%