78% sendcloud-email-sender

Code Review | SendCloud

WordPress plugin SendCloud scored78%from 54 tests.

About plugin

  • Plugin page: sendcloud-email-s...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.0
  • WordPress version: 6.3.1
  • First release: Jun 4, 2015
  • Latest release: Jun 15, 2015
  • Number of updates: 8
  • Update frequency: every 1.5 days
  • Top authors: sendcloud0319 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,440 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.18MB] [CPU: ▲100.82ms] Passed 4 tests

Analyzing server-side resources used by SendCloud
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.10 ▼6.59
Dashboard /wp-admin3.13 ▼0.17385.54 ▲335.14
Posts /wp-admin/edit.php3.26 ▼0.09714.22 ▲666.74
Add New Post /wp-admin/post-new.php5.46 ▼0.43136.78 ▲12.29
Media Library /wp-admin/upload.php3.20 ▼0.0398.39 ▲62.42
Subscriber /wp-admin/admin.php?page=sendcloud-email-sender/admin/subscribe.php2.066.72
Setting /wp-admin/admin.php?page=sendcloud-email-sender/admin/setting.php2.065.02
Data Center /wp-admin/admin.php?page=sendcloud-email-sender/admin/data_center.php2.066.44

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 26 new files
Database: 1 new table, 13 new options
New tables
wp_sendcloud_account
New WordPress options
sendcloud_version
sendcloud_posts_reply_notify
widget_recent-posts
theysaidso_admin_options
widget_sendcloud_widget
sendcloud_post_publish_notify
sendcloud_email
widget_recent-comments
widget_theysaidso_widget
sendcloud_lable
...

Browser metrics Passed 4 tests

SendCloud: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,857 ▲12213.71 ▼0.672.07 ▲0.1242.94 ▼4.78
Dashboard /wp-admin2,239 ▲515.85 ▼0.0199.07 ▼10.6279.64 ▲37.10
Posts /wp-admin/edit.php2,122 ▲332.02 ▼0.0334.77 ▼5.1733.32 ▼1.21
Add New Post /wp-admin/post-new.php1,693 ▲17422.64 ▼0.41745.32 ▲130.2363.44 ▲14.58
Media Library /wp-admin/upload.php1,418 ▲304.24 ▲0.08116.14 ▲19.8643.60 ▼0.61
Subscriber /wp-admin/admin.php?page=sendcloud-email-sender/admin/subscribe.php6951.5311.4530.93
Setting /wp-admin/admin.php?page=sendcloud-email-sender/admin/setting.php9941.8928.4440.26
Data Center /wp-admin/admin.php?page=sendcloud-email-sender/admin/data_center.php1,8612.3345.8334.98

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options were found after uninstall: 8 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_sendcloud_widget
    • sendcloud_version
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sendcloud-email-sender/admin/data_center.php
    • > Deprecated in wp-content/plugins/sendcloud-email-sender/sendcloud.php+41
    The each() function is deprecated. This message will be suppressed on further calls
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sendcloud-email-sender/admin/data_center.php
    • > Warning in wp-content/plugins/sendcloud-email-sender/sendcloud_client.php+63
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: No address associated with hostname
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sendcloud-email-sender/admin/data_center.php
    • > Warning in wp-content/plugins/sendcloud-email-sender/sendcloud_client.php+63
    file_get_contents(http://sendcloud.sohu.com/webapi/discuz.getApiUserInfo.json): failed to open stream: php_network_getaddresses: getaddrinfo failed: No address associated with hostname
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sendcloud-email-sender/admin/data_center.php
    • > User notice in wp-content/plugins/sendcloud-email-sender/sendcloud_client.php+94
    request url :http://sendcloud.sohu.com/webapi/discuz.getApiUserInfo.jsonException
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sendcloud-email-sender/admin/data_center.php
    • > Notice in wp-content/plugins/sendcloud-email-sender/admin/data_center.php+103
    Trying to get property 'message' of non-object
    • > GET request to /wp-admin/admin.php?page=sendcloud-email-sender/admin/subscribe.php
    • > Notice in wp-content/plugins/sendcloud-email-sender/admin/subscribe.php+33
    Undefined variable: apiUser
    • > GET request to /wp-admin/admin.php?page=sendcloud-email-sender/admin/subscribe.php
    • > Notice in wp-content/plugins/sendcloud-email-sender/admin/subscribe.php+33
    Undefined variable: apiKey
    • > GET request to /wp-admin/admin.php?page=sendcloud-email-sender/admin/subscribe.php
    • > Warning in wp-content/plugins/sendcloud-email-sender/sendcloud_client.php+63
    file_get_contents(http://sendcloud.sohu.com/webapi/list_member.get.json): failed to open stream: php_network_getaddresses: getaddrinfo failed: No address associated with hostname
    • > GET request to /wp-admin/admin.php?page=sendcloud-email-sender/admin/subscribe.php
    • > User notice in wp-content/plugins/sendcloud-email-sender/sendcloud_client.php+94
    request url :http://sendcloud.sohu.com/webapi/list_member.get.jsonException
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sendcloud-email-sender/admin/data_center.php
    • > Notice in wp-content/plugins/sendcloud-email-sender/admin/data_center.php+102
    Trying to get property 'api_user' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sendcloud-email-sender/admin/data_center.php
    • > Notice in wp-content/plugins/sendcloud-email-sender/admin/data_center.php+102
    Trying to get property 'api_key' of non-object
    • > GET request to /wp-admin/admin.php?page=sendcloud-email-sender/admin/data_center.php
    • > Warning in wp-content/plugins/sendcloud-email-sender/sendcloud_client.php+63
    file_get_contents(http://sendcloud.sohu.com/webapi/label.list.json): failed to open stream: php_network_getaddresses: getaddrinfo failed: No address associated with hostname
    • > GET request to /wp-admin/admin.php?page=sendcloud-email-sender/admin/data_center.php
    • > User notice in wp-content/plugins/sendcloud-email-sender/sendcloud_client.php+94
    request url :http://sendcloud.sohu.com/webapi/label.list.jsonException
    • > GET request to /wp-admin/admin.php?page=sendcloud-email-sender/admin/data_center.php
    • > Notice in wp-content/plugins/sendcloud-email-sender/sendcloud_tool.php+73
    Trying to get property 'list' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sendcloud-email-sender/admin/data_center.php
    • > Warning in wp-content/plugins/sendcloud-email-sender/admin/data_center.php+121
    Invalid argument supplied for foreach()
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sendcloud-email-sender/admin/data_center.php
    • > Warning in wp-content/plugins/sendcloud-email-sender/sendcloud_client.php+63
    file_get_contents(http://sendcloud.sohu.com/webapi/label.create.json): failed to open stream: php_network_getaddresses: getaddrinfo failed: No address associated with hostname
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sendcloud-email-sender/admin/data_center.php
    • > User notice in wp-content/plugins/sendcloud-email-sender/sendcloud_client.php+94
    request url :http://sendcloud.sohu.com/webapi/label.create.jsonException
    • > GET request to /wp-admin/admin.php?page=sendcloud-email-sender/admin/data_center.php
    • > Warning in wp-content/plugins/sendcloud-email-sender/sendcloud_client.php+63
    file_get_contents(http://sendcloud.sohu.com/webapi/stats.get.json): failed to open stream: php_network_getaddresses: getaddrinfo failed: No address associated with hostname
    • > GET request to /wp-admin/admin.php?page=sendcloud-email-sender/admin/data_center.php
    • > User notice in wp-content/plugins/sendcloud-email-sender/sendcloud_client.php+94
    request url :http://sendcloud.sohu.com/webapi/stats.get.jsonException
    • > GET request to /wp-admin/admin.php?page=sendcloud-email-sender/admin/data_center.php
    • > Notice in wp-content/plugins/sendcloud-email-sender/admin/data_center.php+104
    Trying to get property 'stats' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sendcloud-email-sender/admin/data_center.php
    • > Notice in wp-content/plugins/sendcloud-email-sender/admin/data_center.php+472
    Undefined variable: daterange

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 14× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      include(ABSPATHwp-includes/pluggable.php): failed to open stream: No such file or directory in wp-content/plugins/sendcloud-email-sender/sendcloud.php on line 17
    • > PHP Warning
      require_once(sdPATHsendcloud_client.php): failed to open stream: No such file or directory in wp-content/plugins/sendcloud-email-sender/admin/setting.php on line 2
    • > PHP Warning
      include(): Failed opening 'ABSPATHwp-includes/pluggable.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/sendcloud-email-sender/sendcloud.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/sendcloud-email-sender/sendcloud.php:20
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/sendcloud-email-sender/sendcloud.php on line 17
    • > PHP Fatal error
      require_once(): Failed opening required 'sdPATHsendcloud_client.php' (include_path='.:/usr/share/php') in wp-content/plugins/sendcloud-email-sender/admin/setting.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'sdPATHsendcloud_client.php' (include_path='.:/usr/share/php') in wp-content/plugins/sendcloud-email-sender/admin/subscribe.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/sendcloud-email-sender/sendcloud_widget.php:2
    • > PHP Warning
      Use of undefined constant sdPATH - assumed 'sdPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/sendcloud-email-sender/admin/setting.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'sdPATHsendcloud_client.php' (include_path='.:/usr/share/php') in wp-content/plugins/sendcloud-email-sender/admin/data_center.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues 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
3 plugin tags: sendmail, mail, email

sendcloud-email-sender/sendcloud.php 85% from 13 tests

The main PHP file in "SendCloud" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("sendcloud-email-sender.php" instead of "sendcloud.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 244 characters long)

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 plugin7,408 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript71,2615345,097
PHP788201,588
SVG100288
CSS24512283
PO File16074152

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity18.50
▷ Minimum class complexity1.00
▷ Maximum class complexity36.00
Average method complexity2.21
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods29
▷ Static methods00.00%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/sendcloud.png17.49KB0.40KB▼ 97.73%