78% newsletter-optin-box

Code Review | Simple Newsletter Plugin - Noptin

WordPress plugin Simple Newsletter Plugin - Noptin scored78%from 54 tests.

About plugin

  • Plugin page: newsletter-optin-box
  • Plugin version: 2.0.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.3
  • WordPress version: 6.3.1
  • First release: Mar 6, 2019
  • Latest release: Sep 29, 2023
  • Number of updates: 103
  • Update frequency: every 16.2 days
  • Top authors: picocodes (100%)

Code review

54 tests

User reviews

57 reviews

Install metrics

9,000+ active /181,301 total downloads

Benchmarks

Plugin footprint 82% 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: ▲4.11MB] [CPU: ▲19.98ms] 75% from 4 tests

Server-side resources used by Simple Newsletter Plugin - Noptin
Please fix the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 808.51ms on /wp-admin/admin.php?page=noptin-addons)
PageMemory (MB)CPU Time (ms)
Home /7.60 ▲4.1466.65 ▲26.02
Dashboard /wp-admin7.42 ▲4.1176.63 ▲20.48
Posts /wp-admin/edit.php7.48 ▲4.1375.90 ▲23.74
Add New Post /wp-admin/post-new.php10.32 ▲4.43117.81 ▲9.69
Media Library /wp-admin/upload.php7.28 ▲4.0577.43 ▲38.35
Subscription Forms /wp-admin/edit.php?post_type=noptin-form7.4675.52
Automation Rules /wp-admin/admin.php?page=noptin-automation-rules7.6367.84
Email Campaigns /wp-admin/admin.php?page=noptin-email-campaigns7.51136.20
Dashboard /wp-admin/admin.php?page=noptin7.5673.98
Extensions /wp-admin/admin.php?page=noptin-addons7.49808.51
Welcome Wizzard /wp-admin/index.php?page=noptin-welcome-wizzard7.3080.57
Email Subscribers /wp-admin/admin.php?page=noptin-subscribers7.30103.46
Tools /wp-admin/admin.php?page=noptin-tools7.3774.68
Settings /wp-admin/admin.php?page=noptin-settings7.7787.81

Server storage [IO: ▲5.98MB] [DB: ▲0.02MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 487 new files
Database: 3 new tables, 13 new options
New tables
wp_noptin_subscribers
wp_noptin_subscriber_meta
wp_noptin_automation_rules
New WordPress options
_noptin_has_welcomed
widget_noptin_widget
widget_recent-posts
noptin_options
theysaidso_admin_options
widget_noptin_widget_premade
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
...

Browser metrics Passed 4 tests

Simple Newsletter Plugin - Noptin: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,875 ▲8913.19 ▼1.252.13 ▲0.0938.05 ▼12.13
Dashboard /wp-admin2,271 ▲645.79 ▲0.8398.78 ▼12.7242.34 ▲4.62
Posts /wp-admin/edit.php2,153 ▲532.00 ▼0.0537.50 ▼3.1531.78 ▼12.19
Add New Post /wp-admin/post-new.php1,567 ▲2223.18 ▲0.11616.05 ▼68.6592.50 ▲11.33
Media Library /wp-admin/upload.php1,453 ▲534.19 ▲0.00100.81 ▼15.4244.53 ▼4.19
Subscription Forms /wp-admin/edit.php?post_type=noptin-form1,4605.4498.4634.56
Automation Rules /wp-admin/admin.php?page=noptin-automation-rules1,3873.6647.5228.92
Email Campaigns /wp-admin/admin.php?page=noptin-email-campaigns1,1673.5451.2171.43
Dashboard /wp-admin/admin.php?page=noptin1,3683.7552.0889.91
Extensions /wp-admin/admin.php?page=noptin-addons2,0023.4442.24103.25
Welcome Wizzard /wp-admin/index.php?page=noptin-welcome-wizzard1,2238.46191.8129.86
Email Subscribers /wp-admin/admin.php?page=noptin-subscribers1,6308.52248.5740.06
Tools /wp-admin/admin.php?page=noptin-tools1,1373.5949.1131.26
Settings /wp-admin/admin.php?page=noptin-settings4,6116.93133.4955.06

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 9 options
    • db_upgraded
    • can_compress_scripts
    • widget_noptin_widget_premade
    • theysaidso_admin_options
    • widget_recent-posts
    • _noptin_has_welcomed
    • widget_recent-comments
    • widget_noptin_widget
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/newsletter-optin-box/templates/email-templates/merriweather/styles.php
    • > /wp-content/plugins/newsletter-optin-box/templates/email-templates/paste/styles.php
  • 75× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/newsletter-optin-box/templates/email-templates/paste/logo.php:1
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/class-wp-list-table.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/newsletter-optin-box/includes/emails/admin/class-list-table.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/newsletter-optin-box/templates/email-templates/plain/logo.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/newsletter-optin-box/vendor/symfony/css-selector/Tests/XPath/TranslatorTest.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/newsletter-optin-box/templates/actions-page.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/newsletter-optin-box/vendor/symfony/css-selector/Tests/Parser/ReaderTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/newsletter-optin-box/includes/admin/class-noptin-custom-content-table.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\CssSelector\\Parser\\ParserInterface' not found in wp-content/plugins/newsletter-optin-box/vendor/symfony/css-selector/Parser/Shortcut/ElementParser.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\\Tests\ode\\AbstractNodeTest' not found in wp-content/plugins/newsletter-optin-box/vendor/symfony/css-selector/Tests/Node/NegationNodeTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Noptin_Async_Request' not found in wp-content/plugins/newsletter-optin-box/includes/class-noptin-background-process.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: newsletter widget, email subscription, email opt-in, email popup, email newsletter form...

newsletter-optin-box/noptin.php 92% from 13 tests

The main file in "Simple Newsletter Plugin - Noptin" v. 2.0.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("newsletter-optin-box.php" instead of "noptin.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
Good job! No executable or dangerous file extensions detected71,927 lines of code in 417 files:
LanguageFilesBlank linesComment linesLines of code
PHP34811,35020,49236,960
JavaScript364,2743,50321,279
PO File34,4076,32610,165
CSS15184592,561
HTML200356
Markdown4700303
JSON600226
XML27076
SVG1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity17.37
▷ Minimum class complexity1.00
▷ Maximum class complexity140.00
Average method complexity2.81
▷ Minimum method complexity1.00
▷ Maximum method complexity79.00
Code structure
Namespaces26
Interfaces6
Traits0
Classes231
▷ Abstract classes219.09%
▷ Concrete classes21090.91%
▷ Final classes20.95%
Methods2,177
▷ Static methods1567.17%
▷ Public methods1,95789.89%
▷ Protected methods1557.12%
▷ Private methods652.99%
Functions201
▷ Named functions18893.53%
▷ Anonymous functions136.47%
Constants21
▷ Global constants838.10%
▷ Class constants1361.90%
▷ Public constants13100.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
11 PNG files occupy 0.42MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/assets/images/double-bg.png30.44KB12.90KB▼ 57.62%
includes/assets/images/mail-icon-alt.png5.40KB2.74KB▼ 49.23%
includes/assets/images/avatar.png15.84KB6.25KB▼ 60.52%
includes/assets/images/checkmark.png2.92KB2.51KB▼ 13.90%
includes/assets/images/email-icon.png8.15KB8.12KB0.43%