57% mailflatrate

Code Review | mailflatrate

WordPress plugin mailflatrate scored 57% from 54 tests.

About plugin

  • Plugin page: mailflatrate
  • Plugin version: 1.7.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-5.5.1
  • WordPress version: 5.8.1
  • First release: Jan 29, 2019
  • Latest release: Oct 23, 2020
  • Number of updates: 41
  • Update frequency: every 15.9 days
  • Top authors: smsmfr (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 622 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.31MB] [CPU: ▼143.30ms] Passed 4 tests

Server-side resources used by mailflatrate
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.10 ▲0.3837.40 ▲16.09
Dashboard /wp-admin3.36 ▲0.3141.64 ▼7.44
Posts /wp-admin/edit.php3.47 ▲0.3647.81 ▲1.06
Add New Post /wp-admin/post-new.php5.72 ▲0.2893.54 ▼568.03
Media Library /wp-admin/upload.php3.30 ▲0.3035.83 ▲1.20
Form /wp-admin/admin.php?page=mailflatrate-form3.5731.99
Import /wp-admin/admin.php?page=mailflatrate-import3.3231.65
Export /wp-admin/admin.php?page=mailflatrate-export3.3230.05
Sync /wp-admin/admin.php?page=mailflatrate-sync3.3236.51
Mailflatrate for WP /wp-admin/admin.php?page=mailflatrateOptions3.2731.75

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 656 new files
Database: no new tables, 7 new options
New WordPress options
mailflatrate-invalid-email-address
mailflatrate-successfully-subscribeed
recovery_mode_email_last_sent
mailflatate_already_subscribed
data-protection
missing-email-address
mailflatrate-agree_to_terms

Browser metrics Passed 4 tests

A check of browser resources used by mailflatrate
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,807 ▲21116.79 ▲0.7811.46 ▲1.2849.10 ▲1.91
Dashboard /wp-admin3,062 ▲1317.49 ▲1.53144.43 ▼41.66118.37 ▲0.51
Posts /wp-admin/edit.php2,859 ▲1203.05 ▲0.3369.02 ▲4.92105.26 ▲11.62
Add New Post /wp-admin/post-new.php1,694 ▲19423.26 ▲4.80312.07 ▼55.37105.24 ▼1.89
Media Library /wp-admin/upload.php1,854 ▲295.83 ▲0.82144.14 ▼14.27130.91 ▲19.94
Form /wp-admin/admin.php?page=mailflatrate-form4,4763.52111.0282.51
Import /wp-admin/admin.php?page=mailflatrate-import9952.3437.7752.08
Export /wp-admin/admin.php?page=mailflatrate-export9952.3437.1057.70
Sync /wp-admin/admin.php?page=mailflatrate-sync1,0332.3343.2054.62
Mailflatrate for WP /wp-admin/admin.php?page=mailflatrateOptions1,1863.0572.8783.69

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • missing-email-address
    • mailflatrate-agree_to_terms
    • mailflatrate-successfully-subscribeed
    • mailflatrate-invalid-email-address
    • mailflatate_already_subscribed
    • data-protection
    • recovery_mode_email_last_sent

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 42 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mailflatrate-sync
    • > Deprecated in wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/MailWizzApi/Base.php+253
    Array and string offset access syntax with curly braces is deprecated
    • > GET request to /wp-admin/admin.php?page=mailflatrate-import
    • > Error in wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/MailWizzApi/Endpoint/Lists.php+34
    Uncaught Error: Call to a member function getApiUrl() on null in wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/MailWizzApi/Endpoint/Lists.php:34
    Stack trace:
    #0 wp-content/plugins/mailflatrate/mailflatrate.php(513): MailWizzApi_Endpoint_Lists->getLists()
    #1 wp-includes/class-wp-hook.php(303): mailflatrateImportfunction()
    #2 wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(470): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=mailflatrate-export
    • > Error in wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/MailWizzApi/Endpoint/Lists.php+34
    Uncaught Error: Call to a member function getApiUrl() on null in wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/MailWizzApi/Endpoint/Lists.php:34
    Stack trace:
    #0 wp-content/plugins/mailflatrate/mailflatrate.php(382): MailWizzApi_Endpoint_Lists->getLists()
    #1 wp-includes/class-wp-hook.php(303): mailflatrateExportfunction()
    #2 wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(470): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=mailflatrate-sync
    • > Error in wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/MailWizzApi/Endpoint/Lists.php+34
    Uncaught Error: Call to a member function getApiUrl() on null in wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/MailWizzApi/Endpoint/Lists.php:34
    Stack trace:
    #0 wp-content/plugins/mailflatrate/mailflatrate.php(238): MailWizzApi_Endpoint_Lists->getLists()
    #1 wp-includes/class-wp-hook.php(303): mailflatrateSyncfunction()
    #2 wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(470): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown

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
  • 15× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/examples/list_segments.php
    • > /wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/examples/templates.php
    • > /wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/examples/ajax_subscribe.php
    • > /wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/examples/lists_create.php
    • > /wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/examples/lists.php
    • > /wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/examples/campaigns.php
    • > /wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/examples/setup.php
    • > /wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/examples/list_subscribers.php
    • > /wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/examples/countries.php
    • > /wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/examples/customers.php
  • 24× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'MailWizzApi_Base' not found in wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/MailWizzApi/Endpoint/TransactionalEmails.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'MailWizzApi_Base' not found in wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/MailWizzApi/Endpoint/CampaignsTracking.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'MailWizzApi_Base' not found in wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/MailWizzApi/Params.php:65
    • > PHP Fatal error
      Uncaught Error: Class 'MailWizzApi_Cache_Abstract' not found in wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/MailWizzApi/Cache/Apc.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'MailWizzApi_Base' not found in wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/MailWizzApi/Endpoint/CampaignBounces.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'MailWizzApi_Cache_Abstract' not found in wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/MailWizzApi/Cache/Dummy.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'MailWizzApi_Cache_Abstract' not found in wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/MailWizzApi/Cache/File.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'MailWizzApi_Base' not found in wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/MailWizzApi/Http/Response.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'MailWizzApi_Base' not found in wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/MailWizzApi/Endpoint/ListFields.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'MailWizzApi_Base' not found in wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/MailWizzApi/Http/Client.php:19

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
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mailflatrateOptions
    • > Network (severe)
    wp-content/plugins/mailflatrate/assets/js/import.js?ver=1.0.0 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% 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:
  • Donate link: Invalid URI found ("")
Please take inspiration from this readme.txt

mailflatrate/mailflatrate.php Passed 13 tests

The primary PHP file in "mailflatrate" version 1.7.2 is used by WordPress to initiate all plugin functionality
127 characters long description:
mailflatrate for wordPress by Swiss Marketing Systems Germany GmbH. Adds various highly effective sign-up methods to your site.

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
These items require your attention
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .bin - Binary Executable in Windows, macOS, Linux
      • wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/MailWizzApi/Cache/data/cache/8c08545ff1ea8ea1c4e1252e413d19dcab621d45.bin
      • wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/MailWizzApi/Cache/data/cache/b86a0471132b3c1159e02c07d3f7cf67a2bde7dd.bin
      • wp-content/plugins/mailflatrate/vendor/twisted1919/mailwizz-php-sdk/MailWizzApi/Cache/data/cache/da84e60c0d5a9f20afec0f2cdc7a9be506957c2f.bin
102,745 lines of code in 627 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript3038,0066,10470,426
HTML1843,8411123,092
PHP531,0742,4994,452
CSS725293093,377
Markdown461101,051
PO File17492199
JSON600118
SVG20020
Bourne Shell1015
YAML1005

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity13.14
▷ Minimum class complexity1.00
▷ Maximum class complexity116.00
Average method complexity2.99
▷ Minimum method complexity1.00
▷ Maximum method complexity71.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes29
▷ Abstract classes13.45%
▷ Concrete classes2896.55%
▷ Final classes00.00%
Methods182
▷ Static methods168.79%
▷ Public methods17093.41%
▷ Protected methods116.04%
▷ Private methods10.55%
Functions22
▷ Named functions2195.45%
▷ Anonymous functions14.55%
Constants16
▷ Global constants425.00%
▷ Class constants1275.00%
▷ Public constants12100.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
9 PNG files occupy 0.17MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/codeminor/doc/yinyang.png4.52KB2.03KB▼ 55.19%
assets/screenshot-5.png7.82KB4.79KB▼ 38.77%
assets/screenshot-2.png35.21KB17.46KB▼ 50.41%
assets/codeminor/doc/logo.png9.09KB4.10KB▼ 54.95%
assets/screenshot-4.png32.52KB17.38KB▼ 46.55%