67% freshmail-integration

Code Review | FreshMail For Wordpress

WordPress plugin FreshMail For Wordpress scored67%from 54 tests.

About plugin

  • Plugin page: freshmail-integra...
  • Plugin version: 2.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.2.4
  • WordPress version: 6.3.1
  • First release: Feb 8, 2017
  • Latest release: Feb 3, 2020
  • Number of updates: 21
  • Update frequency: every 51.9 days
  • Top authors: FreshMail.com (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

2,000+ active /20,467 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.52MB] [CPU: ▲180.59ms] Passed 4 tests

An overview of server-side resources used by FreshMail For Wordpress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.98 ▲0.52215.44 ▲174.79
Dashboard /wp-admin3.88 ▲0.53225.33 ▲170.61
Posts /wp-admin/edit.php3.93 ▲0.57228.62 ▲179.23
Add New Post /wp-admin/post-new.php6.41 ▲0.52285.84 ▲197.71
Media Library /wp-admin/upload.php3.74 ▲0.501,812.44 ▲1,775.39
Checkboxes /wp-admin/admin.php?page=freshmail_checkboxes3.71225.59
New form /wp-admin/admin.php?page=freshmail_new_form3.71206.34
Reports /wp-admin/admin.php?page=freshmail_reports3.71222.08
Settings /wp-admin/admin.php?page=freshmail_connect3.71208.20
FreshMail /wp-admin/admin.php?page=freshmail3.71235.33

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 39 new files
Database: 2 new tables, 9 new options
New tables
wp_freshmail_stats
wp_freshmail_forms
New WordPress options
can_compress_scripts
widget_recent-comments
widget_1
freshmail_custom_theme
theysaidso_admin_options
widget_recent-posts
db_upgraded
WP_FRESHMAIL_VERSION
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for FreshMail For Wordpress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲7213.29 ▼1.061.65 ▼0.1836.73 ▼2.88
Dashboard /wp-admin2,244 ▲674.90 ▼0.6997.51 ▼2.8481.22 ▲34.37
Posts /wp-admin/edit.php2,166 ▲662.32 ▲0.3236.54 ▼7.7836.16 ▼1.55
Add New Post /wp-admin/post-new.php1,581 ▲5521.24 ▼2.00644.34 ▲29.3038.99 ▼21.17
Media Library /wp-admin/upload.php1,465 ▲654.45 ▲0.3090.68 ▼30.5368.40 ▲21.18
Checkboxes /wp-admin/admin.php?page=freshmail_checkboxes9081.7915.4540.36
New form /wp-admin/admin.php?page=freshmail_new_form9081.6314.8039.11
Reports /wp-admin/admin.php?page=freshmail_reports9081.7913.6625.69
Settings /wp-admin/admin.php?page=freshmail_connect9822.0829.1531.48
FreshMail /wp-admin/admin.php?page=freshmail9081.6314.0428.73

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie tables detected upon uninstall: 2 tables
    • wp_freshmail_stats
    • wp_freshmail_forms
  • The uninstall procedure has failed, leaving 9 options in the database
    • can_compress_scripts
    • db_upgraded
    • freshmail_custom_theme
    • WP_FRESHMAIL_VERSION
    • widget_1
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • 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 50% 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 fix the following
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/freshmail-integration/templates/admin_edit_form_page.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/freshmail-integration/templates/admin_new_form_page.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/freshmail-integration/templates/admin_connect_page.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/freshmail-integration/templates/ajax_get_freshmail_fields.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/freshmail-integration/templates/admin_all_forms_page.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/freshmail-integration/templates/admin_reports.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/freshmail-integration/src/Plugin/Newsletter/Widget/FreshmailWidget.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/freshmail-integration/templates/admin_checkboxes.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=freshmail
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).accordion is not a function" "TypeError: jQuery(...).accordion is not a function\n at initAddForm (/wp-content/plugins/freshmail-integration/assets/js/scripts.js?ver=6.3.1:134:23)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/freshmail-integration/assets/js/scripts.js?ver=6.3.1:28:2)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1:2:27292)" undefined
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=freshmail
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).accordion is not a function

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: Too many tags (20 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: These screenshots have no corresponding images in /assets: #7 (Creating sign-up forms is easy.), #8 (You have the option of enabling automatic sign-up to a subscription with the use of a checkbox added to other standard WordPress forms as well as forms of other plugins: WooCommerce, Easy Digital Download, bbPress, MultiSite, BuddyPress.)
The official readme.txt is a good inspiration

freshmail-integration/wp-freshmail.php 85% from 13 tests

The main file in "FreshMail For Wordpress" v. 2.3.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("freshmail-integration.php" instead of "wp-freshmail.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 261 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin5,628 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP235246084,488
PO File1240323561
CSS25332235
JavaScript22834229
Markdown2470115

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity76.20
▷ Minimum class complexity1.00
▷ Maximum class complexity272.00
Average method complexity4.34
▷ Minimum method complexity1.00
▷ Maximum method complexity52.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods82
▷ Static methods00.00%
▷ Public methods5668.29%
▷ Protected methods1619.51%
▷ Private methods1012.20%
Functions36
▷ Named functions12.78%
▷ Anonymous functions3597.22%
Constants6
▷ Global constants350.00%
▷ Class constants350.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.12MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon.png3.46KB0.89KB▼ 74.34%
assets/images/bg_2.png0.87KB0.86KB▼ 1.23%
assets/images/close.png0.90KB0.90KB▼ 0.86%
assets/images/bg_3.png0.64KB0.85KB0.00%
assets/images/freshmail_logo.png11.15KB4.71KB▼ 57.75%