84% wp-mailerlite-lite

Code Review | Wordpress Mailerlite Integration Lite

WordPress plugin Wordpress Mailerlite Integration Lite scored84%from 54 tests.

About plugin

  • Plugin page: wp-mailerlite-lite
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-5.4.1
  • WordPress version: 6.3.1
  • First release: Mar 1, 2017
  • Latest release: Jun 4, 2020
  • Number of updates: 10
  • Update frequency: every 118.9 days
  • Top authors: thekoder (60%)mojtabad (50%)

Code review

54 tests

User reviews

2 reviews

Install metrics

300+ active /4,624 total downloads

Benchmarks

Plugin footprint 83% 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 gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼1.90ms] Passed 4 tests

Server-side resources used by Wordpress Mailerlite Integration Lite
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0540.02 ▼1.65
Dashboard /wp-admin3.35 ▲0.0552.35 ▲4.70
Posts /wp-admin/edit.php3.47 ▲0.1149.95 ▼0.54
Add New Post /wp-admin/post-new.php5.95 ▲0.0794.44 ▼3.67
Media Library /wp-admin/upload.php3.28 ▲0.0538.11 ▼1.72

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 238 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_wpmi-widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Wordpress Mailerlite Integration Lite: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,902 ▲14114.16 ▼0.568.28 ▲6.6443.95 ▲5.54
Dashboard /wp-admin2,222 ▲455.80 ▲0.1394.26 ▲1.5238.60 ▼3.39
Posts /wp-admin/edit.php2,127 ▲242.26 ▲0.2839.56 ▼2.2137.02 ▼0.11
Add New Post /wp-admin/post-new.php1,561 ▲3518.62 ▼4.47669.22 ▲42.4371.62 ▲14.87
Media Library /wp-admin/upload.php1,421 ▲214.38 ▲0.1096.56 ▼11.2544.10 ▼2.79

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_wpmi-widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
  • 115× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-mailerlite-lite/includes/vendor/guzzlehttp/psr7/tests/AppendStreamTest.php:7
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/wp-mailerlite-lite/includes/vendor/guzzlehttp/psr7/tests/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-mailerlite-lite/includes/vendor/guzzlehttp/psr7/tests/bootstrap.php on line 4
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/wp-mailerlite-lite/includes/vendor/guzzlehttp/psr7/tests/StreamDecoratorTraitTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-mailerlite-lite/includes/vendor/guzzlehttp/psr7/tests/ServerRequestTest.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Http\\Message\\Encoding\\FilteredStream' not found in wp-content/plugins/wp-mailerlite-lite/includes/vendor/php-http/message/src/Encoding/GzipEncodeStream.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Http\\Client\\Exception\\RequestException' not found in wp-content/plugins/wp-mailerlite-lite/includes/vendor/php-http/httplug/src/Exception/NetworkException.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/wp-mailerlite-lite/includes/vendor/guzzlehttp/psr7/src/BufferStream.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/wp-mailerlite-lite/includes/vendor/guzzlehttp/psr7/src/Request.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Http\\Message\\Encoding\\FilteredStream' not found in wp-content/plugins/wp-mailerlite-lite/includes/vendor/php-http/message/src/Encoding/CompressStream.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/wp-mailerlite-lite/includes/vendor/psr/http-message/src/ServerRequestInterface.php:43

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Plugin settings), #2 (Plugin widget settings), #3 (Plugin widget)
The official readme.txt is a good inspiration

wp-mailerlite-lite/wp-mailerlite-lite.php Passed 13 tests

Analyzing the main PHP file in "Wordpress Mailerlite Integration Lite" version 1.1.1
94 characters long description:
With this plugin you can integrate your website users with Mailerlite email marketing software

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected13,561 lines of code in 217 files:
LanguageFilesBlank linesComment linesLines of code
PHP1682,3594,93510,491
JSON16001,315
Markdown2078701,158
CSS3180430
JavaScript37068
XML31348
YAML35029
make17022

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity4.99
▷ Minimum class complexity1.00
▷ Maximum class complexity62.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces30
Interfaces21
Traits6
Classes132
▷ Abstract classes32.27%
▷ Concrete classes12997.73%
▷ Final classes3325.58%
Methods1,028
▷ Static methods444.28%
▷ Public methods94792.12%
▷ Protected methods242.33%
▷ Private methods575.54%
Functions107
▷ Named functions3128.97%
▷ Anonymous functions7671.03%
Constants12
▷ Global constants325.00%
▷ Class constants975.00%
▷ Public constants9100.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
3 PNG files occupy 0.10MB with 0.06MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png49.87KB19.62KB▼ 60.66%
screenshot-2.png31.39KB12.76KB▼ 59.34%
screenshot-3.png17.91KB7.56KB▼ 57.78%