78% newsletter2go

Code Review | Newsletter2Go

WordPress plugin Newsletter2Go scored78%from 54 tests.

About plugin

  • Plugin page: newsletter2go
  • Plugin version: 4.0.13
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jan 21, 2019
  • Latest release: Feb 2, 2022
  • Number of updates: 21
  • Update frequency: every 53.2 days
  • Top authors: newsletter2go (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

4,000+ active /34,425 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 gracefully, with no errors

Server metrics [RAM: ▲0.10MB] [CPU: ▼3.97ms] Passed 4 tests

This is a short check of server-side resources used by Newsletter2Go
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1141.70 ▼0.53
Dashboard /wp-admin3.40 ▲0.1047.62 ▼3.75
Posts /wp-admin/edit.php3.52 ▲0.1645.30 ▼3.80
Add New Post /wp-admin/post-new.php5.98 ▲0.1083.42 ▼6.08
Media Library /wp-admin/upload.php3.32 ▲0.1038.38 ▼2.25

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 34 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_n2go_widget
n2go_apikey
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Newsletter2Go
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲8213.31 ▼1.074.73 ▲3.0042.68 ▼2.22
Dashboard /wp-admin2,207 ▲155.85 ▲0.93100.10 ▼26.1771.73 ▲25.55
Posts /wp-admin/edit.php2,102 ▲131.99 ▼0.0234.83 ▼2.6332.87 ▼5.72
Add New Post /wp-admin/post-new.php1,679 ▲14622.32 ▼0.78669.38 ▼8.2265.82 ▲9.53
Media Library /wp-admin/upload.php1,401 ▲104.12 ▼0.18102.02 ▲2.7445.64 ▲1.55

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_n2go_widget
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • n2go_apikey
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/newsletter2go/widget/widgetStyles.php
  • 16× 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/newsletter2go/newsletter2go.php:142
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/newsletter2go/widget/widgetStyles.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/newsletter2go/widget/widgetStyles.php on line 3
    • > PHP Notice
      Undefined variable: colors in wp-content/plugins/newsletter2go/widget/widgetStyles.php on line 9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/newsletter2go/widget/widgetStyles.php on line 10
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/newsletter2go/widget/widgetView.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/newsletter2go/widget/N2Go_Widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/newsletter2go/gui/adminView.php:4
    • > PHP Notice
      Undefined variable: colors in wp-content/plugins/newsletter2go/widget/widgetStyles.php on line 14
    • > PHP Notice
      Undefined variable: colors in wp-content/plugins/newsletter2go/widget/widgetStyles.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
The official readme.txt might help

newsletter2go/newsletter2go.php Passed 13 tests

"Newsletter2Go" version 4.0.13's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
125 characters long description:
Adds email marketing functionality to your E-commerce platform. Easily synchronize your contacts and send product newsletters

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected4,641 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
CSS3701181,843
JavaScript51021651,000
PHP8148115920
SVG100685
PO File27785193

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity19.25
▷ Minimum class complexity2.00
▷ Maximum class complexity38.00
Average method complexity4.09
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods25
▷ Static methods832.00%
▷ Public methods1560.00%
▷ Protected methods00.00%
▷ Private methods1040.00%
Functions12
▷ Named functions1083.33%
▷ Anonymous functions216.67%
Constants10
▷ Global constants220.00%
▷ Class constants880.00%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
gui/lib/wordpress_icon.png1.25KB0.46KB▼ 62.99%
gui/lib/banner_wordpress_newsletter2go.png24.09KB10.74KB▼ 55.41%
gui/lib/wheel.png11.32KB6.53KB▼ 42.30%
gui/lib/mask.png1.95KB4.18KB0.00%
gui/lib/marker.png0.43KB0.71KB0.00%