57% eelv-newsletter

Code Review | EELV Newsletter

WordPress plugin EELV Newsletter scored57%from 54 tests.

About plugin

  • Plugin page: eelv-newsletter
  • Plugin version: 4.8.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.4
  • WordPress version: 6.3.1
  • First release: Oct 22, 2012
  • Latest release: Apr 8, 2022
  • Number of updates: 226
  • Update frequency: every 15.3 days
  • Top authors: bastho (92.48%)ecolosites (7.96%)

Code review

54 tests

User reviews

3 reviews

Install metrics

70+ active /12,783 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.65MB] [CPU: ▲4.00ms] Passed 4 tests

Server-side resources used by EELV Newsletter
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.09 ▲0.6350.07 ▲7.15
Dashboard /wp-admin3.98 ▲0.6754.65 ▼0.63
Posts /wp-admin/edit.php4.03 ▲0.6755.10 ▲5.05
Add New Post /wp-admin/post-new.php6.68 ▲0.79103.41 ▲9.19
Media Library /wp-admin/upload.php3.84 ▲0.6142.95 ▲4.43
Reload parameters /wp-admin/edit.php?post_type=newsletter&page=checkdb3.9059.96
Configuration/help /wp-admin/edit.php?post_type=newsletter&page=settings_page3.8245.77
Archives /wp-admin/edit.php?post_type=newsletter_archive3.8938.90
Send /wp-admin/edit.php?post_type=newsletter&page=news_envoi3.8439.25
add /wp-admin/post-new.php?post_type=newsletter6.5183.25
Skins /wp-admin/edit.php?post_type=newsletter_template4.0153.84
Newsletter /wp-admin/edit.php?post_type=newsletter3.9446.69
News types /wp-admin/edit-tags.php?taxonomy=newsletter_archives_types&post_type=newsletter3.8436.76
Address book /wp-admin/edit.php?post_type=newsletter&page=news_carnet_adresse3.8544.26

Server storage [IO: ▲0.81MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 67 new files
Database: 1 new table, 11 new options
New tables
eelv_0_newsletter_adr
New WordPress options
eelv_newsletter_version
newsletter_last_burst
widget_recent-comments
widget_eelv_nl_archives_widget
newsletter_options_version
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
...

Browser metrics Passed 4 tests

EELV Newsletter: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,954 ▲16813.59 ▼0.709.11 ▲7.0343.22 ▼0.50
Dashboard /wp-admin2,268 ▲915.58 ▲0.0183.02 ▼17.3040.33 ▼3.75
Posts /wp-admin/edit.php2,176 ▲762.02 ▼0.0137.22 ▲1.3233.00 ▼8.81
Add New Post /wp-admin/post-new.php6,381 ▲4,85524.55 ▲1.44866.48 ▲203.4636.05 ▼14.69
Media Library /wp-admin/upload.php1,473 ▲734.23 ▲0.13101.80 ▼15.0045.30 ▼4.33
Reload parameters /wp-admin/edit.php?post_type=newsletter&page=checkdb8752.0428.8927.27
Configuration/help /wp-admin/edit.php?post_type=newsletter&page=settings_page1,3481.8625.2436.13
Archives /wp-admin/edit.php?post_type=newsletter_archive1,1781.9635.3330.76
Send /wp-admin/edit.php?post_type=newsletter&page=news_envoi8522.0526.5124.25
add /wp-admin/post-new.php?post_type=newsletter6,41126.30933.7335.07
Skins /wp-admin/edit.php?post_type=newsletter_template1,7782.0239.5431.69
Newsletter /wp-admin/edit.php?post_type=newsletter1,1531.9632.3029.19
News types /wp-admin/edit-tags.php?taxonomy=newsletter_archives_types&post_type=newsletter1,3392.1527.7729.99
Address book /wp-admin/edit.php?post_type=newsletter&page=news_carnet_adresse9992.0522.8925.17

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie tables were found after uninstall: 1 table
    • eelv_0_newsletter_adr
  • This plugin does not fully uninstall, leaving 11 options in the database
    • newsletter_options_version
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • newsletter_last_burst
    • widget_theysaidso_widget
    • eelv_newsletter_version
    • widget_recent-posts
    • widget_eelv_nl_subscribe_widget
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=newsletter&page=settings_page
    • > Notice in wp-content/plugins/eelv-newsletter/lettreinfo.php+2218
    Trying to access array offset on value of type bool
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=newsletter
    • > Notice in wp-content/plugins/eelv-newsletter/views/admin/editor-send.php+39
    Undefined variable: item_id

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/eelv-newsletter/reading/read.php
  • 34× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/eelv-newsletter/csv.php:5
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/eelv-newsletter/views/addressbook/contact-import.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/eelv-newsletter/views/archive/archive-queue-list.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/eelv-newsletter/inc/cpt/newsletter_template.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_ID() in wp-content/plugins/eelv-newsletter/views/archive/archive-preview.php:3
    • > PHP Notice
      Undefined variable: con_id in wp-content/plugins/eelv-newsletter/views/addressbook/contact-edit.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/eelv-newsletter/views/admin/editor-send.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/eelv-newsletter/views/admin/editor.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/eelv-newsletter/views/admin/admin-settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/eelv-newsletter/views/addressbook/contact-edit.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
    • > GET request to /wp-admin/post-new.php?post_type=newsletter
    • > Javascript (severe) in unknown
    /wp-content/plugins/eelv-newsletter/js/blocks/autocomplete.js?ver=1576742362 0:655 Uncaught TypeError: Cannot read properties of undefined (reading 'Autocomplete')
    • > GET request to /wp-admin/post-new.php?post_type=newsletter
    • > Javascript (severe) in unknown
    /wp-content/plugins/eelv-newsletter/js/blocks/post.js?ver=1576742362 0:937 Uncaught TypeError: Cannot read properties of undefined (reading 'URLInputButton')

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: newsletter, mailing, contacts, tracking, email...

eelv-newsletter/lettreinfo.php 92% from 13 tests

The main PHP file in "EELV Newsletter" ver. 4.8.2 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("eelv-newsletter.php" instead of "lettreinfo.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin11,652 lines of code in 61 files:
LanguageFilesBlank linesComment linesLines of code
JSON2006,311
PHP362764603,624
PO File1338394696
JavaScript126971654
CSS72010337
Sass32030

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity114.67
▷ Minimum class complexity3.00
▷ Maximum class complexity325.00
Average method complexity5.21
▷ Minimum method complexity1.00
▷ Maximum method complexity62.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods81
▷ Static methods00.00%
▷ Public methods81100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions787.50%
▷ Anonymous functions112.50%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/newsletter.png30.63KB13.81KB▼ 54.90%