74% mailmojo-widget

Code Review | MailMojo Widget

WordPress plugin MailMojo Widget scored74%from 54 tests.

About plugin

  • Plugin page: mailmojo-widget
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8.1
  • WordPress version: 6.3.1
  • First release: Aug 4, 2011
  • Latest release: Nov 10, 2021
  • Number of updates: 52
  • Update frequency: every 72.4 days
  • Top authors: stianpr (84.62%)fdanielsen (17.31%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /4,783 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.12MB] [CPU: ▼6.32ms] Passed 4 tests

A check of server-side resources used by MailMojo Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1435.05 ▼4.93
Dashboard /wp-admin3.43 ▲0.0947.35 ▼12.30
Posts /wp-admin/edit.php3.55 ▲0.1953.51 ▲3.33
Add New Post /wp-admin/post-new.php6.01 ▲0.1392.86 ▼11.36
Media Library /wp-admin/upload.php3.36 ▲0.1335.44 ▲3.70
MailMojo /wp-admin/options-general.php?page=mailmojo-widget3.3229.80

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for MailMojo Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲7113.18 ▼1.201.70 ▼0.2144.69 ▲1.82
Dashboard /wp-admin2,222 ▲405.87 ▲1.01110.54 ▲0.6341.38 ▲0.82
Posts /wp-admin/edit.php2,101 ▲151.98 ▼0.0342.20 ▲2.2035.30 ▼4.79
Add New Post /wp-admin/post-new.php1,559 ▲4518.08 ▲0.49616.04 ▲16.8850.48 ▼4.67
Media Library /wp-admin/upload.php1,401 ▲134.18 ▼0.02103.10 ▼9.5445.40 ▲1.55
MailMojo /wp-admin/options-general.php?page=mailmojo-widget8052.0725.7536.17

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
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method MailMojoSettings::removeSettings() should not be called statically
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_mailmojo
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 116× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installer\\LibraryInstaller' not found in wp-content/plugins/mailmojo-widget/trunk/vendor/composer/installers/src/Composer/Installers/Installer.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/mailmojo-widget/trunk/vendor/eliksir/mailmojo-php-sdk/test/Model/ContactsTest.php:55
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/mailmojo-widget/trunk/mailmojo-widget.php:19
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/mailmojo-widget/templates/widget-page.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\Test\\TestCase' not found in wp-content/plugins/mailmojo-widget/trunk/vendor/composer/installers/tests/Composer/Installers/Test/CakePHPInstallerTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/mailmojo-widget/vendor/eliksir/mailmojo-php-sdk/test/Model/SubscriberTest.php:55
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/mailmojo-widget/vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/mailmojo-widget/trunk/vendor/composer/installers/src/Composer/Installers/OxidInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/mailmojo-widget/trunk/vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/mailmojo-widget/trunk/vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
9 plugin tags: mailmojo, email, mailing list, email marketing, subscribe...

mailmojo-widget/mailmojo.php 92% from 13 tests

The main file in "MailMojo Widget" v. 1.0.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("mailmojo-widget.php" instead of "mailmojo.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin6,447 lines of code in 103 files:
LanguageFilesBlank linesComment linesLines of code
PHP781,4014,7485,280
Markdown163200766
JSON300209
PO File13738117
Bourne Shell113831
XML12023
YAML23018
CSS1003

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity7.76
▷ Minimum class complexity1.00
▷ Maximum class complexity56.00
Average method complexity1.80
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes134
▷ Abstract classes42.99%
▷ Concrete classes13097.01%
▷ Final classes00.00%
Methods1,126
▷ Static methods16014.21%
▷ Public methods1,10097.69%
▷ Protected methods201.78%
▷ Private methods60.53%
Functions20
▷ Named functions840.00%
▷ Anonymous functions1260.00%
Constants26
▷ Global constants00.00%
▷ Class constants26100.00%
▷ Public constants26100.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
No PNG images were found in this plugin