10% newsletter-popup

Code Review | Newsletter Popup

WordPress plugin Newsletter Popup scored10%from 54 tests.

About plugin

  • Plugin page: newsletter-popup
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.9
  • WordPress version: 6.3.1
  • First release: Nov 26, 2016
  • Latest release: Nov 17, 2017
  • Number of updates: 24
  • Update frequency: every 14.5 days
  • Top authors: mndpsingh287 (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

500+ active /18,221 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/newsletter-popup/mk_newsletter.php+234
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.04MB] [CPU: ▼0.09ms] Passed 4 tests

An overview of server-side resources used by Newsletter Popup
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.62 ▲1.51
Dashboard /wp-admin3.35 ▲0.0448.26 ▼0.80
Posts /wp-admin/edit.php3.46 ▲0.1049.49 ▲5.57
Add New Post /wp-admin/post-new.php5.93 ▲0.0495.55 ▼2.14
Media Library /wp-admin/upload.php3.27 ▲0.0430.90 ▲1.09
Add New /wp-admin/admin.php?page=wp_newsletter_add_new3.5829.54
Buy PRO /wp-admin/admin.php?page=wp_newsletter_buy_pro3.2828.43
Settings /wp-admin/admin.php?page=wp_newsletter_edit_settings3.2829.18
Overview /wp-admin/admin.php?page=wp_newsletter_overview3.2725.44
Manage Newsletters /wp-admin/admin.php?page=wp_newsletter_show_items3.3227.33
Local Record /wp-admin/admin.php?page=wp_newsletter_show_localrecord3.3030.19
Add New /wp-admin/admin.php?page=wp_newsletter_type3.3043.61
Edit Newsletter /wp-admin/admin.php?page=wp_newsletter_edit_item3.5641.86

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 95 new files
Database: 2 new tables, 7 new options
New tables
wp_mk_newsletter_data
wp_mk_newsletter_local_records
New WordPress options
can_compress_scripts
mk_newsletter_settings
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Newsletter Popup: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,846 ▲7513.29 ▼1.011.64 ▼0.9055.35 ▲11.32
Dashboard /wp-admin2,237 ▲494.87 ▼0.94110.64 ▼8.9284.13 ▲37.89
Posts /wp-admin/edit.php2,138 ▲492.03 ▲0.0243.77 ▲1.8341.24 ▲8.40
Add New Post /wp-admin/post-new.php1,435 ▼10018.18 ▼4.98694.98 ▲58.5758.50 ▼5.94
Media Library /wp-admin/upload.php1,434 ▲434.25 ▲0.05103.59 ▲3.4877.09 ▲31.85
Add New /wp-admin/admin.php?page=wp_newsletter_add_new2,8964.73101.2374.60
Buy PRO /wp-admin/admin.php?page=wp_newsletter_buy_pro9592.0828.7933.39
Settings /wp-admin/admin.php?page=wp_newsletter_edit_settings9321.7226.3233.25
Overview /wp-admin/admin.php?page=wp_newsletter_overview8862.0826.9432.10
Manage Newsletters /wp-admin/admin.php?page=wp_newsletter_show_items9911.7228.8932.09
Local Record /wp-admin/admin.php?page=wp_newsletter_show_localrecord8882.1534.2129.57
Add New /wp-admin/admin.php?page=wp_newsletter_type1,6532.3736.8749.08
Edit Newsletter /wp-admin/admin.php?page=wp_newsletter_edit_item3,5774.75127.5884.26

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie tables detected upon uninstall: 2 tables
    • wp_mk_newsletter_data
    • wp_mk_newsletter_local_records
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • mk_newsletter_settings
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 112 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp_newsletter_edit_item
    • > Notice in wp-content/plugins/newsletter-popup/app/inc/addnew.php+911
    Undefined index: type
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp_newsletter_edit_item
    • > Notice in wp-content/plugins/newsletter-popup/app/inc/addnew.php+664
    Undefined variable: arrow_position
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp_newsletter_edit_item
    • > Notice in wp-content/plugins/newsletter-popup/app/inc/addnew.php+696
    Undefined variable: wp_newsletter_upper_part_color
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp_newsletter_edit_item
    • > Notice in wp-content/plugins/newsletter-popup/app/inc/addnew.php+697
    Undefined variable: wp_newsletter_bottom_part_color

SRP 0% 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
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/newsletter-popup/app/inc/front/newsletter_footer_lightbox.php
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/newsletter-popup/mk_newsletter.php:13
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/newsletter-popup/app/inc/editsettings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/newsletter-popup/app/inc/newsletter_type1.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/newsletter-popup/app/inc/newsletter_type.php:122

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: Too many tags (18 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

newsletter-popup/mk_newsletter.php 92% from 13 tests

"Newsletter Popup" version 1.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("newsletter-popup.php" instead of "mk_newsletter.php")

Code Analysis Passed 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 plugin16,136 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
PHP4285650415,553
JavaScript81528356
CSS475227

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity47.83
▷ Minimum class complexity19.00
▷ Maximum class complexity88.00
Average method complexity4.58
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods79
▷ Static methods00.00%
▷ Public methods7594.94%
▷ Protected methods33.80%
▷ Private methods11.27%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
16 PNG files occupy 0.16MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
app/inc/images/tick.png17.71KB0.36KB▼ 97.98%
app/inc/front/images/borderbg.png19.07KB5.65KB▼ 70.39%
app/inc/front/images/mobile.png23.79KB25.56KB0.00%
app/inc/front/images/icon-1.png2.85KB1.91KB▼ 32.93%
app/inc/front/images/bluebg.png2.25KB0.35KB▼ 84.43%