67% mailbard-newsletters

Code Review | MailBard Newsletters

WordPress plugin MailBard Newsletters scored67%from 54 tests.

About plugin

  • Plugin page: mailbard-newsletters
  • Plugin version: 0.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.7
  • WordPress version: 6.3.1
  • First release: May 6, 2018
  • Latest release: Apr 28, 2021
  • Number of updates: 13
  • Update frequency: every 83.9 days
  • Top authors: mailbard (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /1,138 total downloads

Benchmarks

Plugin footprint 65% 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: ▲1.15MB] [CPU: ▲4.51ms] Passed 4 tests

A check of server-side resources used by MailBard Newsletters
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.60 ▲1.1448.28 ▲6.90
Dashboard /wp-admin4.45 ▲1.1552.76 ▲4.98
Posts /wp-admin/edit.php4.50 ▲1.1553.52 ▲3.02
Add New Post /wp-admin/post-new.php7.06 ▲1.1798.75 ▲3.12
Media Library /wp-admin/upload.php4.37 ▲1.1443.94 ▲8.89
Newsletters /wp-admin/admin.php?page=wysija_campaigns5.4853.15
Subscribers /wp-admin/admin.php?page=wysija_subscribers5.4155.64
Settings /wp-admin/admin.php?page=wysija_config5.7562.75

Server storage [IO: ▲4.55MB] [DB: ▲0.05MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 744 new files
Database: 16 new tables, 12 new options
New tables
wp_wysija_campaign_list
wp_wysija_email
wp_wysija_user_field
wp_wysija_queue
wp_wysija_url
wp_wysija_user_list
wp_wysija_campaign
wp_wysija_list
wp_wysija_custom_field
wp_wysija_email_user_url
...
New WordPress options
wysija_post_type_updated
widget_theysaidso_widget
db_upgraded
widget_wysija
wysija
wysija_schedules
installation_step
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
...

Browser metrics Passed 4 tests

A check of browser resources used by MailBard Newsletters
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,857 ▲12213.21 ▼1.161.70 ▼0.0638.55 ▼9.78
Dashboard /wp-admin2,234 ▲435.84 ▲0.96101.46 ▼4.7169.44 ▲27.67
Posts /wp-admin/edit.php2,114 ▲222.04 ▲0.0433.26 ▼6.0131.75 ▼4.73
Add New Post /wp-admin/post-new.php1,546 ▲1823.25 ▲4.90646.14 ▲7.9864.78 ▲7.60
Media Library /wp-admin/upload.php1,413 ▲284.23 ▲0.05114.88 ▲12.6647.37 ▼0.93
Newsletters /wp-admin/admin.php?page=wysija_campaigns9152.2942.6834.45
Subscribers /wp-admin/admin.php?page=wysija_subscribers1,1732.3942.1625.19
Settings /wp-admin/admin.php?page=wysija_config2,2222.9853.6823.38

Uninstaller [IO: ▲0.26MB] [DB: ▲0.05MB] 50% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure failed, leaving 16 tables in the database
    • wp_wysija_campaign
    • wp_wysija_form
    • wp_wysija_url
    • wp_wysija_user_list
    • wp_wysija_list
    • wp_wysija_url_mail
    • wp_wysija_user_history
    • wp_wysija_user
    • wp_wysija_subscriber_ips
    • wp_wysija_email_user_stat
    • ...
  • The uninstall procedure has failed, leaving 12 options in the database
    • widget_recent-comments
    • wysija_post_type_updated
    • installation_step
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • wysija
    • wysija_post_type_created
    • db_upgraded
    • theysaidso_admin_options
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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 take a closer look at the following
  • 130× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/mailbard-newsletters/legacy/modules/archive_std/archive_std.php
    • > /wp-content/plugins/mailbard-newsletters/legacy/helpers/http.php
    • > /wp-content/plugins/mailbard-newsletters/legacy/classes/WJ_StatsSessionManager.php
    • > /wp-content/plugins/mailbard-newsletters/legacy/classes/WJ_Export.php
    • > /wp-content/plugins/mailbard-newsletters/legacy/core/controller.php
    • > /wp-content/plugins/mailbard-newsletters/legacy/controllers/back/config.php
    • > /wp-content/plugins/mailbard-newsletters/legacy/inc/mailer/class.sendgrid.php
    • > /wp-content/plugins/mailbard-newsletters/legacy/models/config.php
    • > /wp-content/plugins/mailbard-newsletters/legacy/helpers/encoding.php
    • > /wp-content/plugins/mailbard-newsletters/legacy/controllers/ajax/tmce.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/mailbard-newsletters/legacy/helpers/shortcodes.php on line 100

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
8 plugin tags: welcome email, newsletter, signup, email, smtp...

mailbard-newsletters/index.php 69% from 13 tests

"MailBard Newsletters" version 0.2.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 268 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("mailbard-newsletters.php" instead of "index.php")
  • Domain Path: The domain path folder does not exist ("/languages/")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin64,803 lines of code in 391 files:
LanguageFilesBlank linesComment linesLines of code
PHP1317,3367,47434,905
JavaScript1303,5052,40524,262
CSS485723173,727
HTML78121401,722
SQL23229173
SVG10011
Markdown1103

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 163)
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity50.19
▷ Minimum class complexity1.00
▷ Maximum class complexity387.00
Average method complexity5.46
▷ Minimum method complexity1.00
▷ Maximum method complexity163.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes129
▷ Abstract classes21.55%
▷ Concrete classes12798.45%
▷ Final classes00.00%
Methods1,424
▷ Static methods614.28%
▷ Public methods1,22385.88%
▷ Protected methods775.41%
▷ Private methods1248.71%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants91
▷ Global constants5560.44%
▷ Class constants3639.56%
▷ Public constants36100.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
205 PNG files occupy 0.53MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
legacy/img/nl-placeholder.png3.04KB2.29KB▼ 24.45%
legacy/data/bookmarks/medium/07/linkedin.png0.89KB0.75KB▼ 15.86%
legacy/img/select2/select2x2.png0.83KB0.77KB▼ 6.15%
legacy/img/popup/close.png0.49KB0.42KB▼ 14.62%
legacy/img/default-newsletter/newsletter/youtube-video.png15.10KB7.22KB▼ 52.18%